drm/amdgpu: remove set but not used variable 'mc_shared_chmap' from 'gfx_v6_0.c' and 'gfx_v7_0.c'
Subsystems (63)
Sasha Levin
maintainerPATCH 166/459 selinux: ensure we cleanup the internal AVC counters on error in avc_insert()
In reply to Sasha LevinFrom: Paul Moore <[email protected]>
[ Upstream commit d8db60cb23e49a92cf8cada3297395c7fa50fdf8 ]
Fix avc_insert() to call avc_node_kill() if we've already allocated an AVC node and the code fails to insert the node in the cache.
--- security/selinux/avc.c | 51 ++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 27 deletions(-)
security/selinux/avc.c +24 -27
@@ -617,40 +617,37 @@ static struct avc_node *avc_insert(struct selinux_avc *avc,struct avc_node *pos, *node =NULL ;int hvalue;unsigned long flag; +spinlock_t *lock; +struct hlist_head *head;if (avc_latest_notif_update (avc, avd->seqno,1 )) - goto out; +return NULL ; node =avc_alloc_node (avc); -if (node) { -struct hlist_head *head; -spinlock_t *lock; -int rc =0 ; - - hvalue =avc_hash (ssid, tsid, tclass); -avc_node_populate (node, ssid, tsid, tclass, avd); - rc =avc_xperms_populate (node, xp_node); -if (rc) { -kmem_cache_free (avc_node_cachep, node); -return NULL ; - } - head = &avc->avc_cache.slots[hvalue]; - lock = &avc->avc_cache.slots_lock[hvalue]; +if (!node) +return NULL ; -spin_lock_irqsave (lock, flag); -hlist_for_each_entry (pos, head, list) { -if (pos->ae.ssid == ssid && - pos->ae.tsid == tsid && - pos->ae.tclass == tclass) { -avc_node_replace (avc, node, pos); - goto found; - } +avc_node_populate (node, ssid, tsid, tclass, avd); +if (avc_xperms_populate (node, xp_node)) { +avc_node_kill (avc, node); +return NULL ; + } + + hvalue =avc_hash (ssid, tsid, tclass); + head = &avc->avc_cache.slots[hvalue]; + lock = &avc->avc_cache.slots_lock[hvalue]; +spin_lock_irqsave (lock, flag); +hlist_for_each_entry (pos, head, list) { +if (pos->ae.ssid == ssid && + pos->ae.tsid == tsid && + pos->ae.tclass == tclass) { +avc_node_replace (avc, node, pos); + goto found; } -hlist_add_head_rcu (&node->list, head); -found: -spin_unlock_irqrestore (lock, flag); } -out: +hlist_add_head_rcu (&node->list, head); +found: +spin_unlock_irqrestore (lock, flag);return node; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 167/459 arm64: dts: qcom: msm8996: Disable USB2 PHY suspend by core
In reply to Sasha LevinFrom: Manu Gautam <[email protected]>
[ Upstream commit d026c96b25b7ce5df89526aad2df988d553edb4d ]
QUSB2 PHY on msm8996 doesn't work well when autosuspend by dwc3 core using USB2PHYCFG register is enabled. One of the issue seen is that PHY driver reports PLL lock failure and fails phy_init() if dwc3 core has USB2 PHY suspend enabled. Fix this by using quirks to disable USB2 PHY LPM/suspend and dwc3 core already takes care of explicitly suspending PHY during suspend if quirks are specified.
--- arch/arm64/boot/dts/qcom/msm8996.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/qcom/msm8996.dtsi +4 -0
@@ -1598,6 +1598,8 @@ interrupts = <0 138 IRQ_TYPE_LEVEL_HIGH>; phys = <&hsusb_phy2>; phy-names = "usb2-phy"; + snps,dis_u2_susphy_quirk; + snps,dis_enblslpm_quirk; }; };
@@ -1628,6 +1630,8 @@ interrupts = <0 131 IRQ_TYPE_LEVEL_HIGH>; phys = <&hsusb_phy1>, <&ssusb_phy_0>; phy-names = "usb2-phy", "usb3-phy"; + snps,dis_u2_susphy_quirk; + snps,dis_enblslpm_quirk; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 168/459 padata: validate cpumask without removed CPU during offline
In reply to Sasha LevinFrom: Daniel Jordan <[email protected]>
[ Upstream commit 894c9ef9780c5cf2f143415e867ee39a33ecb75d ]
Configuring an instance's parallel mask without any online CPUs...
echo 2 > /sys/kernel/pcrypt/pencrypt/parallel_cpumask echo 0 > /sys/devices/system/cpu/cpu1/online
...makes tcrypt mode=215 crash like this:
divide error: 0000 [#1] SMP PTI
CPU: 4 PID: 283 Comm: modprobe Not tainted 5.4.0-rc8-padata-doc-v2+ #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ?-20191013_105130-anatol 04/01/2014 RIP: 0010:padata_do_parallel+0x114/0x300 Call Trace: pcrypt_aead_encrypt+0xc0/0xd0 [pcrypt] crypto_aead_encrypt+0x1f/0x30 do_mult_aead_op+0x4e/0xdf [tcrypt] test_mb_aead_speed.constprop.0.cold+0x226/0x564 [tcrypt] do_test+0x28c2/0x4d49 [tcrypt] tcrypt_mod_init+0x55/0x1000 [tcrypt] ...
cpumask_weight() in padata_cpu_hash() returns 0 because the mask has no CPUs. The problem is __padata_remove_cpu() checks for valid masks too early and so doesn't mark the instance PADATA_INVALID as expected, which would have made padata_do_parallel() return error before doing the division.
Fix by introducing a second padata CPU hotplug state before CPUHP_BRINGUP_CPU so that __padata_remove_cpu() sees the online mask without @cpu. No need for the second argument to padata_replace() since @cpu is now already missing from the online mask.
--- include/linux/cpuhotplug.h | 1 + kernel/padata.c | 30 ++++++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-)
include/linux/cpuhotplug.h +1 -0
@@ -59,6 +59,7 @@ enum cpuhp_state {CPUHP_IOMMU_INTEL_DEAD ,CPUHP_LUSTRE_CFS_DEAD ,CPUHP_AP_ARM_CACHE_B15_RAC_DEAD , +CPUHP_PADATA_DEAD ,CPUHP_WORKQUEUE_PREP ,CPUHP_POWER_NUMA_PREPARE , CPUHP_HRTIMERS_PREPARE,
kernel/padata.c +18 -12
@@ -512,7 +512,7 @@ static int padata_replace_one(struct padata_shell *ps)return 0 ; } -static int padata_replace (struct padata_instance *pinst,int cpu) +static int padata_replace (struct padata_instance *pinst) {int notification_mask =0 ;struct padata_shell *ps;
@@ -523,16 +523,12 @@ static int padata_replace(struct padata_instance *pinst, int cpu)cpumask_copy (pinst->omask, pinst->rcpumask.pcpu);cpumask_and (pinst->rcpumask.pcpu, pinst->cpumask.pcpu, cpu_online_mask); -if (cpu >=0 ) -cpumask_clear_cpu (cpu, pinst->rcpumask.pcpu);if (!cpumask_equal (pinst->omask, pinst->rcpumask.pcpu)) notification_mask |=PADATA_CPU_PARALLEL ;cpumask_copy (pinst->omask, pinst->rcpumask.cbcpu);cpumask_and (pinst->rcpumask.cbcpu, pinst->cpumask.cbcpu, cpu_online_mask); -if (cpu >=0 ) -cpumask_clear_cpu (cpu, pinst->rcpumask.cbcpu);if (!cpumask_equal (pinst->omask, pinst->rcpumask.cbcpu)) notification_mask |=PADATA_CPU_SERIAL ;
@@ -624,7 +620,7 @@ static int __padata_set_cpumasks(struct padata_instance *pinst,cpumask_copy (pinst->cpumask.pcpu, pcpumask);cpumask_copy (pinst->cpumask.cbcpu, cbcpumask); - err =padata_setup_cpumasks (pinst) ?:padata_replace (pinst,-1 ); + err =padata_setup_cpumasks (pinst) ?:padata_replace (pinst);if (valid)__padata_start (pinst);
@@ -715,7 +711,7 @@ static int __padata_add_cpu(struct padata_instance *pinst, int cpu)int err =0 ;if (cpumask_test_cpu (cpu, cpu_online_mask)) { - err =padata_replace (pinst,-1 ); + err =padata_replace (pinst);if (padata_validate_cpumask (pinst, pinst->cpumask.pcpu) &&padata_validate_cpumask (pinst, pinst->cpumask.cbcpu))
@@ -729,12 +725,12 @@ static int __padata_remove_cpu(struct padata_instance *pinst, int cpu) {int err =0 ; -if (cpumask_test_cpu (cpu, cpu_online_mask)) { +if (!cpumask_test_cpu (cpu, cpu_online_mask)) {if (!padata_validate_cpumask (pinst, pinst->cpumask.pcpu) || !padata_validate_cpumask (pinst, pinst->cpumask.cbcpu))__padata_stop (pinst); - err =padata_replace (pinst, cpu); + err =padata_replace (pinst); }return err;
@@ -796,7 +792,7 @@ static int padata_cpu_online(unsigned int cpu, struct hlist_node *node)return ret; } -static int padata_cpu_prep_down (unsigned int cpu,struct hlist_node *node) +static int padata_cpu_dead (unsigned int cpu,struct hlist_node *node) {struct padata_instance *pinst;int ret;
@@ -817,6 +813,7 @@ static enum cpuhp_state hp_online;static void __padata_free (struct padata_instance *pinst) {#ifdef CONFIG_HOTPLUG_CPU +cpuhp_state_remove_instance_nocalls (CPUHP_PADATA_DEAD , &pinst->node);cpuhp_state_remove_instance_nocalls (hp_online, &pinst->node);#endif
@@ -1024,6 +1021,8 @@ static struct padata_instance *padata_alloc(const char *name,#ifdef CONFIG_HOTPLUG_CPU cpuhp_state_add_instance_nocalls_cpuslocked (hp_online, &pinst->node); +cpuhp_state_add_instance_nocalls_cpuslocked (CPUHP_PADATA_DEAD , + &pinst->node);#endif put_online_cpus ();
@@ -1136,17 +1135,24 @@ static __init int padata_driver_init(void)int ret; ret =cpuhp_setup_state_multi (CPUHP_AP_ONLINE_DYN ,"padata:online" , - padata_cpu_online, - padata_cpu_prep_down); + padata_cpu_online,NULL );if (ret <0 )return ret; hp_online = ret; + + ret =cpuhp_setup_state_multi (CPUHP_PADATA_DEAD ,"padata:dead" , +NULL , padata_cpu_dead); +if (ret <0 ) { +cpuhp_remove_multi_state (hp_online); +return ret; + }return 0 ; }module_init (padata_driver_init); static __exit void padata_driver_exit(void) { +cpuhp_remove_multi_state (CPUHP_PADATA_DEAD );cpuhp_remove_multi_state (hp_online); }module_exit (padata_driver_exit);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 169/459 padata: always acquire cpu_hotplug_lock before pinst->lock
In reply to Sasha LevinFrom: Daniel Jordan <[email protected]>
[ Upstream commit 38228e8848cd7dd86ccb90406af32de0cad24be3 ]
lockdep complains when padata's paths to update cpumasks via CPU hotplug and sysfs are both taken:
# echo 0 > /sys/devices/system/cpu/cpu1/online # echo ff > /sys/kernel/pcrypt/pencrypt/parallel_cpumask
======================================================
WARNING: possible circular locking dependency detected 5.4.0-rc8-padata-cpuhp-v3+ #1 Not tainted
------------------------------------------------------
bash/205 is trying to acquire lock:
ffffffff8286bcd0 (cpu_hotplug_lock.rw_sem){++++}, at: padata_set_cpumask+0x2b/0x120
but task is already holding lock:
ffff8880001abfa0 (&pinst->lock){+.+.}, at: padata_set_cpumask+0x26/0x120
which lock already depends on the new lock.
padata doesn't take cpu_hotplug_lock and pinst->lock in a consistent order. Which should be first? CPU hotplug calls into padata with cpu_hotplug_lock already held, so it should have priority.
--- kernel/padata.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/padata.c +2 -2
@@ -643,8 +643,8 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type,struct cpumask *serial_mask, *parallel_mask;int err = -EINVAL ; -mutex_lock (&pinst->lock);get_online_cpus (); +mutex_lock (&pinst->lock);switch (cpumask_type) {case PADATA_CPU_PARALLEL :
@@ -662,8 +662,8 @@ int padata_set_cpumask(struct padata_instance *pinst, int cpumask_type, err =__padata_set_cpumasks (pinst, parallel_mask, serial_mask); out: -put_online_cpus ();mutex_unlock (&pinst->lock); +put_online_cpus ();return err; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 170/459 dmaengine: axi-dmac: add a check for devm_regmap_init_mmio
In reply to Sasha LevinFrom: Chuhong Yuan <[email protected]>
[ Upstream commit a5b982af953bcc838cd198b0434834cc1dff14ec ]
The driver misses checking the result of devm_regmap_init_mmio(). Add a check to fix it.
--- drivers/dma/dma-axi-dmac.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/dma/dma-axi-dmac.c +9 -1
@@ -830,6 +830,7 @@ static int axi_dmac_probe(struct platform_device *pdev)struct dma_device *dma_dev;struct axi_dmac *dmac;struct resource *res; +struct regmap *regmap;int ret; dmac =devm_kzalloc (&pdev->dev,sizeof (*dmac),GFP_KERNEL );
@@ -921,10 +922,17 @@ static int axi_dmac_probe(struct platform_device *pdev)platform_set_drvdata (pdev, dmac); -devm_regmap_init_mmio (&pdev->dev, dmac->base, &axi_dmac_regmap_config); + regmap =devm_regmap_init_mmio (&pdev->dev, dmac->base, + &axi_dmac_regmap_config); +if (IS_ERR (regmap)) { + ret =PTR_ERR (regmap); + goto err_free_irq; + }return 0 ; +err_free_irq: +free_irq (dmac->irq, dmac); err_unregister_of:of_dma_controller_free (pdev->dev.of_node); err_unregister_device:
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 171/459 clk: imx: Add correct failure handling for clk based helpers
In reply to Sasha LevinFrom: Abel Vesa <[email protected]>
[ Upstream commit f60f1c62c3188fcca945581e35e3440ee3fdcc95 ]
If the clk_hw based API returns an error, trying to return the clk from hw will end up in a NULL pointer dereference. So adding the to_clk checker and using it inside every clk based macro helper we handle that case correctly.
This to_clk is also temporary and will go away along with the clk based macro helpers once there is no user that need them anymore.
--- drivers/clk/imx/clk.h | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-)
drivers/clk/imx/clk.h +22 -15
@@ -51,48 +51,48 @@ struct imx_pll14xx_clk { };#define imx_clk_cpu (name, parent_name, div, mux, pll, step) \ - imx_clk_hw_cpu(name, parent_name, div, mux, pll, step)->clk + to_clk(imx_clk_hw_cpu(name, parent_name, div, mux, pll, step))#define clk_register_gate2 (dev, name, parent_name, flags, reg, bit_idx, \ cgr_val, clk_gate_flags, lock, share_count) \ - clk_hw_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ - cgr_val, clk_gate_flags, lock, share_count)->clk + to_clk(clk_hw_register_gate2(dev, name, parent_name, flags, reg, bit_idx, \ + cgr_val, clk_gate_flags, lock, share_count))#define imx_clk_pllv3 (type, name, parent_name, base, div_mask) \ - imx_clk_hw_pllv3(type, name, parent_name, base, div_mask)->clk + to_clk(imx_clk_hw_pllv3(type, name, parent_name, base, div_mask))#define imx_clk_pfd (name, parent_name, reg, idx) \ - imx_clk_hw_pfd(name, parent_name, reg, idx)->clk + to_clk(imx_clk_hw_pfd(name, parent_name, reg, idx))#define imx_clk_gate_exclusive (name, parent, reg, shift, exclusive_mask) \ - imx_clk_hw_gate_exclusive(name, parent, reg, shift, exclusive_mask)->clk + to_clk(imx_clk_hw_gate_exclusive(name, parent, reg, shift, exclusive_mask))#define imx_clk_fixed_factor (name, parent, mult, div) \ - imx_clk_hw_fixed_factor(name, parent, mult, div)->clk + to_clk(imx_clk_hw_fixed_factor(name, parent, mult, div))#define imx_clk_divider2 (name, parent, reg, shift, width) \ - imx_clk_hw_divider2(name, parent, reg, shift, width)->clk + to_clk(imx_clk_hw_divider2(name, parent, reg, shift, width))#define imx_clk_gate_dis (name, parent, reg, shift) \ - imx_clk_hw_gate_dis(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate_dis(name, parent, reg, shift))#define imx_clk_gate2 (name, parent, reg, shift) \ - imx_clk_hw_gate2(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate2(name, parent, reg, shift))#define imx_clk_gate2_flags (name, parent, reg, shift, flags) \ - imx_clk_hw_gate2_flags(name, parent, reg, shift, flags)->clk + to_clk(imx_clk_hw_gate2_flags(name, parent, reg, shift, flags))#define imx_clk_gate2_shared2 (name, parent, reg, shift, share_count) \ - imx_clk_hw_gate2_shared2(name, parent, reg, shift, share_count)->clk + to_clk(imx_clk_hw_gate2_shared2(name, parent, reg, shift, share_count))#define imx_clk_gate3 (name, parent, reg, shift) \ - imx_clk_hw_gate3(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate3(name, parent, reg, shift))#define imx_clk_gate4 (name, parent, reg, shift) \ - imx_clk_hw_gate4(name, parent, reg, shift)->clk + to_clk(imx_clk_hw_gate4(name, parent, reg, shift))#define imx_clk_mux (name, reg, shift, width, parents, num_parents) \ - imx_clk_hw_mux(name, reg, shift, width, parents, num_parents)->clk + to_clk(imx_clk_hw_mux(name, reg, shift, width, parents, num_parents))struct clk *imx_clk_pll14xx (const char *name,const char *parent_name,void __iomem *base,const struct imx_pll14xx_clk *pll_clk);
@@ -195,6 +195,13 @@ struct clk_hw *imx_clk_hw_fixup_mux(const char *name, void __iomem *reg, u8 shift, u8 width, const char * const *parents, int num_parents, void (*fixup)(u32 *val)); +static inline struct clk *to_clk (struct clk_hw *hw) +{ +if (IS_ERR_OR_NULL (hw)) +return ERR_CAST (hw); +return hw->clk; +} +static inline struct clk *imx_clk_fixed (const char *name,int rate) {return clk_register_fixed_rate (NULL , name,NULL ,0 , rate);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 172/459 ARM: exynos_defconfig: Bring back explicitly wanted options
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 9f9e2df2e64df197ff6548ef494f76be5b35d08a ]
Few options KALLSYMS_ALL, SCSI, PM_DEVFREQ and mutex/spinlock debugging were removed with savedefconfig because they were selected by other options. However these are user-visible options and they might not be selected in the future. Exactly this happened with commit 0e4a459f56c3 ("tracing: Remove unnecessary DEBUG_FS dependency") removing the dependency between DEBUG_FS and TRACING.
To avoid losing these options in the future, explicitly mention them in defconfig.
--- arch/arm/configs/exynos_defconfig | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/configs/exynos_defconfig +6 -0
@@ -38,6 +38,7 @@ CONFIG_CRYPTO_SHA256_ARM=m CONFIG_CRYPTO_SHA512_ARM=m CONFIG_CRYPTO_AES_ARM_BS=m CONFIG_CRYPTO_CHACHA20_NEON=m +CONFIG_KALLSYMS_ALL=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_PARTITION_ADVANCED=y
@@ -92,6 +93,7 @@ CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=y CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_SIZE=8192 +CONFIG_SCSI=y CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_SG=y CONFIG_ATA=y
@@ -290,6 +292,7 @@ CONFIG_CROS_EC_SPI=y CONFIG_COMMON_CLK_MAX77686=y CONFIG_COMMON_CLK_S2MPS11=y CONFIG_EXYNOS_IOMMU=y +CONFIG_PM_DEVFREQ=y CONFIG_DEVFREQ_GOV_PERFORMANCE=y CONFIG_DEVFREQ_GOV_POWERSAVE=y CONFIG_DEVFREQ_GOV_USERSPACE=y
@@ -354,4 +357,7 @@ CONFIG_SOFTLOCKUP_DETECTOR=y # CONFIG_DETECT_HUNG_TASK is not set CONFIG_PROVE_LOCKING=y CONFIG_DEBUG_ATOMIC_SLEEP=y +CONFIG_DEBUG_RT_MUTEXES=y +CONFIG_DEBUG_SPINLOCK=y +CONFIG_DEBUG_MUTEXES=y CONFIG_DEBUG_USER=y
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 173/459 ARM: dts: imx6: rdu2: Disable WP for USDHC2 and USDHC3
In reply to Sasha LevinFrom: Andrey Smirnov <[email protected]>
[ Upstream commit cd58a174e58649426fb43d7456e5f7d7eab58af1 ]
RDU2 production units come with resistor connecting WP pin to correpsonding GPIO DNPed for both SD card slots. Drop any WP related configuration and mark both slots with "disable-wp".
--- arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi +2 -4
@@ -627,7 +627,7 @@ pinctrl-0 = <&pinctrl_usdhc2>; bus-width = <4>; cd-gpios = <&gpio2 2 GPIO_ACTIVE_LOW>; - wp-gpios = <&gpio2 3 GPIO_ACTIVE_HIGH>; + disable-wp; vmmc-supply = <®_3p3v_sd>; vqmmc-supply = <®_3p3v>; no-1-8-v;
@@ -640,7 +640,7 @@ pinctrl-0 = <&pinctrl_usdhc3>; bus-width = <4>; cd-gpios = <&gpio2 0 GPIO_ACTIVE_LOW>; - wp-gpios = <&gpio2 1 GPIO_ACTIVE_HIGH>; + disable-wp; vmmc-supply = <®_3p3v_sd>; vqmmc-supply = <®_3p3v>; no-1-8-v;
@@ -1055,7 +1055,6 @@ MX6QDL_PAD_SD2_DAT1__SD2_DATA1 0x17059 MX6QDL_PAD_SD2_DAT2__SD2_DATA2 0x17059 MX6QDL_PAD_SD2_DAT3__SD2_DATA3 0x17059 - MX6QDL_PAD_NANDF_D3__GPIO2_IO03 0x40010040 MX6QDL_PAD_NANDF_D2__GPIO2_IO02 0x40010040 >; };
@@ -1068,7 +1067,6 @@ MX6QDL_PAD_SD3_DAT1__SD3_DATA1 0x17059 MX6QDL_PAD_SD3_DAT2__SD3_DATA2 0x17059 MX6QDL_PAD_SD3_DAT3__SD3_DATA3 0x17059 - MX6QDL_PAD_NANDF_D1__GPIO2_IO01 0x40010040 MX6QDL_PAD_NANDF_D0__GPIO2_IO00 0x40010040 >;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 174/459 ARM: dts: imx6: rdu2: Limit USBH1 to Full Speed
In reply to Sasha LevinFrom: Andrey Smirnov <[email protected]>
[ Upstream commit 6bb1e09c4c375db29770444f689f35f5cbe696bc ]
Cabling used to connect devices to USBH1 on RDU2 does not meet USB spec cable quality and cable length requirements to operate at High Speed, so limit the port to Full Speed only.
--- arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi +1 -0
@@ -774,6 +774,7 @@ &usbh1 { vbus-supply = <®_5p0v_main>; disable-over-current; + maximum-speed = "full-speed"; status = "okay"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 175/459 tty: serial: amba-pl011: remove set but unused variable
In reply to Sasha LevinFrom: Xiongfeng Wang <[email protected]>
[ Upstream commit 94345aee285334e9e12fc70572e3d9380791a64e ]
Fix the following warning:drivers/tty/serial/amba-pl011.c: In function check_apply_cts_event_workaround:drivers/tty/serial/amba-pl011.c:1461:15: warning: variable dummy_read set but not used [-Wunused-but-set-variable]
The data read is useless and can be dropped.
--- drivers/tty/serial/amba-pl011.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/tty/serial/amba-pl011.c +2 -4
@@ -1456,8 +1456,6 @@ static void pl011_modem_status(struct uart_amba_port *uap)static void check_apply_cts_event_workaround (struct uart_amba_port *uap) { -unsigned int dummy_read; -if (!uap->vendor->cts_event_workaround)return ;
@@ -1469,8 +1467,8 @@ static void check_apply_cts_event_workaround(struct uart_amba_port *uap)* single apb access will incur 2 pclk(133.12Mhz) delay, * so add 2 dummy reads */ - dummy_read =pl011_read (uap,REG_ICR ); - dummy_read =pl011_read (uap,REG_ICR ); +pl011_read (uap,REG_ICR ); +pl011_read (uap,REG_ICR ); }static irqreturn_t pl011_int (int irq,void *dev_id)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 176/459 bus: ti-sysc: Implement quirk handling for CLKDM_NOAUTO
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 94f6345712b37e4bb23cb265ce4c65b9d177e75a ]
For dra7 dcan and dwc3 instances we need to block clockdomain autoidle. Let's do this with CLKDM_NOAUTO quirk flag and enable it for dcan and dwc3.
--- drivers/bus/ti-sysc.c | 10 ++++++++-- include/linux/platform_data/ti-sysc.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +8 -2
@@ -479,7 +479,7 @@ static void sysc_clkdm_deny_idle(struct sysc *ddata) {struct ti_sysc_platform_data *pdata; -if (ddata->legacy_mode) +if (ddata->legacy_mode || (ddata->cfg.quirks &SYSC_QUIRK_CLKDM_NOAUTO ))return ; pdata =dev_get_platdata (ddata->dev);
@@ -491,7 +491,7 @@ static void sysc_clkdm_allow_idle(struct sysc *ddata) {struct ti_sysc_platform_data *pdata; -if (ddata->legacy_mode) +if (ddata->legacy_mode || (ddata->cfg.quirks &SYSC_QUIRK_CLKDM_NOAUTO ))return ; pdata =dev_get_platdata (ddata->dev);
@@ -1251,6 +1251,12 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {/* Quirks that need to be set based on detected module */ SYSC_QUIRK ("aess" ,0 ,0 ,0x10 ,-1 ,0x40000000 ,0xffffffff ,SYSC_MODULE_QUIRK_AESS ), +SYSC_QUIRK ("dcan" ,0x48480000 ,0x20 ,-1 ,-1 ,0xa3170504 ,0xffffffff , +SYSC_QUIRK_CLKDM_NOAUTO ), +SYSC_QUIRK ("dwc3" ,0x48880000 ,0 ,0x10 ,-1 ,0x500a0200 ,0xffffffff , +SYSC_QUIRK_CLKDM_NOAUTO ), +SYSC_QUIRK ("dwc3" ,0x488c0000 ,0 ,0x10 ,-1 ,0x500a0200 ,0xffffffff , +SYSC_QUIRK_CLKDM_NOAUTO ),SYSC_QUIRK ("hdq1w" ,0 ,0 ,0x14 ,0x18 ,0x00000006 ,0xffffffff ,SYSC_MODULE_QUIRK_HDQ1W ), SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,
include/linux/platform_data/ti-sysc.h +1 -0
@@ -49,6 +49,7 @@ struct sysc_regbits {s8 emufree_shift; }; +#define SYSC_QUIRK_CLKDM_NOAUTO BIT(21)#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)#define SYSC_MODULE_QUIRK_AESS BIT(19)#define SYSC_MODULE_QUIRK_SGX BIT(18)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 177/459 PCI: iproc: Apply quirk_paxc_bridge() for module as well as built-in
In reply to Sasha LevinFrom: Wei Liu <[email protected]>
[ Upstream commit 574f29036fce385e28617547955dd6911d375025 ]
Previously quirk_paxc_bridge() was applied when the iproc driver was built-in, but not when it was compiled as a module.
This happened because it was under #ifdef CONFIG_PCIE_IPROC_PLATFORM:
PCIE_IPROC_PLATFORM=y causes CONFIG_PCIE_IPROC_PLATFORM to be defined, but PCIE_IPROC_PLATFORM=m causes CONFIG_PCIE_IPROC_PLATFORM_MODULE to be defined.
Move quirk_paxc_bridge() to pcie-iproc.c and drop the #ifdef so the quirk is always applied, whether iproc is built-in or a module.
--- drivers/pci/controller/pcie-iproc.c | 24 ++++++++++++++++++++++++ drivers/pci/quirks.c | 26 -------------------------- 2 files changed, 24 insertions(+), 26 deletions(-)
drivers/pci/controller/pcie-iproc.c +24 -0
@@ -1608,6 +1608,30 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_BROADCOM, 0xd802,DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd804 , quirk_paxc_disable_msi_parsing); +static void quirk_paxc_bridge (struct pci_dev *pdev) +{ +/* +* The PCI config space is shared with the PAXC root port and the first +* Ethernet device. So, we need to workaround this by telling the PCI +* code that the bridge is not an Ethernet device. +*/ +if (pdev->hdr_type ==PCI_HEADER_TYPE_BRIDGE ) + pdev->class =PCI_CLASS_BRIDGE_PCI <<8 ; + +/* +* MPSS is not being set properly (as it is currently 0). This is +* because that area of the PCI config space is hard coded to zero, and +* is not modifiable by firmware. Set this to 2 (e.g., 512 byte MPS) +* so that the MPS can be set to the real max value. +*/ + pdev->pcie_mpss =2 ; +} +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0x16cd , quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0x16f0 , quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd750 , quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd802 , quirk_paxc_bridge); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd804 , quirk_paxc_bridge); +MODULE_AUTHOR ("Ray Jui <[email protected]>" );MODULE_DESCRIPTION ("Broadcom iPROC PCIe common driver" );MODULE_LICENSE ("GPL v2" );
drivers/pci/quirks.c +0 -26
@@ -2381,32 +2381,6 @@ DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_BROADCOM,PCI_DEVICE_ID_TIGON3_5719 , quirk_brcm_5719_limit_mrrs); -#ifdef CONFIG_PCIE_IPROC_PLATFORM -static void quirk_paxc_bridge (struct pci_dev *pdev) -{ -/* -* The PCI config space is shared with the PAXC root port and the first -* Ethernet device. So, we need to workaround this by telling the PCI -* code that the bridge is not an Ethernet device. -*/ -if (pdev->hdr_type ==PCI_HEADER_TYPE_BRIDGE ) - pdev->class =PCI_CLASS_BRIDGE_PCI <<8 ; - -/* -* MPSS is not being set properly (as it is currently 0). This is -* because that area of the PCI config space is hard coded to zero, and -* is not modifiable by firmware. Set this to 2 (e.g., 512 byte MPS) -* so that the MPS can be set to the real max value. -*/ - pdev->pcie_mpss =2 ; -} -DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0x16cd , quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0x16f0 , quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd750 , quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd802 , quirk_paxc_bridge); -DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_BROADCOM ,0xd804 , quirk_paxc_bridge); -#endif -/* * Originally in EDAC sources for i82875P: Intel tells BIOS developers to * hide device 6 which configures the overflow device access containing the
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 178/459 media: cx23885: Add support for AVerMedia CE310B
In reply to Sasha LevinFrom: Forest Crossman <[email protected]>
[ Upstream commit dc4cac67e13515835ed8081d510aa507aacb013b ]
The AVerMedia CE310B is a simple composite + S-Video + stereo audio capture card, and uses only the CX23888 to perform all of these functions.
I've tested both video inputs and the audio interface and confirmed that they're all working. However, there are some issues:
* Sometimes when I switch inputs the video signal turns black and can't be recovered until the system is rebooted. I haven't been able to determine the cause of this behavior, nor have I found a solution to fix it or any workarounds other than rebooting.
* The card sometimes seems to have trouble syncing to the video signal, and some of the VBI data appears as noise at the top of the frame, but I assume that to be a result of my very noisy RF environment and the card's unshielded input traces rather than a configuration issue.
--- drivers/media/pci/cx23885/cx23885-cards.c | 24 +++++++++++++++++++++++ drivers/media/pci/cx23885/cx23885-video.c | 3 ++- drivers/media/pci/cx23885/cx23885.h | 1 + 3 files changed, 27 insertions(+), 1 deletion(-)
drivers/media/pci/cx23885/cx23885-cards.c +24 -0
@@ -801,6 +801,25 @@ struct cx23885_board cx23885_boards[] = { .name = "Hauppauge WinTV-Starburst2", .portb = CX23885_MPEG_DVB, }, + [CX23885_BOARD_AVERMEDIA_CE310B] = { + .name = "AVerMedia CE310B", + .porta = CX23885_ANALOG_VIDEO, + .force_bff = 1, + .input = {{ + .type = CX23885_VMUX_COMPOSITE1, + .vmux = CX25840_VIN1_CH1 | + CX25840_NONE_CH2 | + CX25840_NONE0_CH3, + .amux = CX25840_AUDIO7, + }, { + .type = CX23885_VMUX_SVIDEO, + .vmux = CX25840_VIN8_CH1 | + CX25840_NONE_CH2 | + CX25840_VIN7_CH3 | + CX25840_SVIDEO_ON, + .amux = CX25840_AUDIO7, + } }, + }, };const unsigned int cx23885_bcount =ARRAY_SIZE (cx23885_boards);
@@ -1124,6 +1143,10 @@ struct cx23885_subid cx23885_subids[] = { .subvendor = 0x0070, .subdevice = 0xf02a, .card = CX23885_BOARD_HAUPPAUGE_STARBURST2, + }, { + .subvendor = 0x1461, + .subdevice = 0x3100, + .card = CX23885_BOARD_AVERMEDIA_CE310B, }, };const unsigned int cx23885_idcount =ARRAY_SIZE (cx23885_subids);
@@ -2348,6 +2371,7 @@ void cx23885_card_setup(struct cx23885_dev *dev)case CX23885_BOARD_DVBSKY_T982 :case CX23885_BOARD_VIEWCAST_260E :case CX23885_BOARD_VIEWCAST_460E : +case CX23885_BOARD_AVERMEDIA_CE310B : dev->sd_cx25840 =v4l2_i2c_new_subdev (&dev->v4l2_dev, &dev->i2c_bus[2 ].i2c_adap,"cx25840" ,0x88 >>1 ,NULL );
drivers/media/pci/cx23885/cx23885-video.c +2 -1
@@ -257,7 +257,8 @@ static int cx23885_video_mux(struct cx23885_dev *dev, unsigned int input) (dev->board == CX23885_BOARD_MYGICA_X8507) || (dev->board == CX23885_BOARD_AVERMEDIA_HC81R) || (dev->board == CX23885_BOARD_VIEWCAST_260E) || - (dev->board == CX23885_BOARD_VIEWCAST_460E)) { + (dev->board == CX23885_BOARD_VIEWCAST_460E) || + (dev->board == CX23885_BOARD_AVERMEDIA_CE310B)) {/* Configure audio routing */ v4l2_subdev_call (dev->sd_cx25840, audio, s_routing,INPUT (input)->amux,0 ,0 );
drivers/media/pci/cx23885/cx23885.h +1 -0
@@ -101,6 +101,7 @@#define CX23885_BOARD_HAUPPAUGE_STARBURST2 59#define CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885 60#define CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC_885 61 +#define CX23885_BOARD_AVERMEDIA_CE310B 62#define GPIO_0 0x00000001#define GPIO_1 0x00000002
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 179/459 PCI: Add generic quirk for increasing D3hot delay
In reply to Sasha LevinFrom: Daniel Drake <[email protected]>
[ Upstream commit 62fe23df067715a21c4aef44068efe7ceaa8f627 ]
Separate the D3 delay increase functionality out of quirk_radeon_pm() into its own function so that it can be shared with other quirks, including the AMD Ryzen XHCI quirk that will be introduced in a followup commit.
Tweak the function name and message to indicate more clearly that the delay relates to a D3hot-to-D0 transition.
--- drivers/pci/quirks.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
drivers/pci/quirks.c +12 -7
@@ -1871,16 +1871,21 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x2609, quirk_intel_pcie_pm);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x260a , quirk_intel_pcie_pm);DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,0x260b , quirk_intel_pcie_pm); +static void quirk_d3hot_delay (struct pci_dev *dev,unsigned int delay) +{ +if (dev->d3_delay >= delay) +return ; + + dev->d3_delay = delay; +pci_info (dev,"extending delay after power-on from D3hot to %d msec\n" , + dev->d3_delay); +} +static void quirk_radeon_pm (struct pci_dev *dev) {if (dev->subsystem_vendor ==PCI_VENDOR_ID_APPLE && - dev->subsystem_device ==0x00e2 ) { -if (dev->d3_delay <20 ) { - dev->d3_delay =20 ; -pci_info (dev,"extending delay after power-on from D3 to %d msec\n" , - dev->d3_delay); - } - } + dev->subsystem_device ==0x00e2 ) +quirk_d3hot_delay (dev,20 ); }DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ATI ,0x6741 , quirk_radeon_pm);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 180/459 PCI: Increase D3 delay for AMD Ryzen5/7 XHCI controllers
In reply to Sasha LevinFrom: Daniel Drake <[email protected]>
[ Upstream commit 3030df209aa8cf831b9963829bd9f94900ee8032 ]
On Asus UX434DA (AMD Ryzen7 3700U) and Asus X512DK (AMD Ryzen5 3500U), the XHCI controller fails to resume from runtime suspend or s2idle, and USB becomes unusable from that point.
xhci_hcd 0000:03:00.4: Refused to change power state, currently in D3 xhci_hcd 0000:03:00.4: enabling device (0000 -> 0002) xhci_hcd 0000:03:00.4: WARN: xHC restore state timeout xhci_hcd 0000:03:00.4: PCI post-resume error -110! xhci_hcd 0000:03:00.4: HC died; cleaning up
During suspend, a transition to D3cold is attempted, however the affected platforms do not seem to cut the power to the PCI device when in this state, so the device stays in D3hot.
Upon resume, the D3hot-to-D0 transition is successful only if the D3 delay is increased to 20ms. The transition failure does not appear to be detectable as a CRS condition. Add a PCI quirk to increase the delay on the affected hardware.
--- drivers/pci/quirks.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/pci/quirks.c +16 -0
@@ -1889,6 +1889,22 @@ static void quirk_radeon_pm(struct pci_dev *dev) }DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_ATI ,0x6741 , quirk_radeon_pm); +/* +* Ryzen5/7 XHCI controllers fail upon resume from runtime suspend or s2idle. +* https://bugzilla.kernel.org/show_bug.cgi?id=205587 +* +* The kernel attempts to transition these devices to D3cold, but that seems +* to be ineffective on the platforms in question; the PCI device appears to +* remain on in D3hot state. The D3hot-to-D0 transition then requires an +* extended delay in order to succeed. +*/ +static void quirk_ryzen_xhci_d3hot (struct pci_dev *dev) +{ +quirk_d3hot_delay (dev,20 ); +} +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,0x15e0 , quirk_ryzen_xhci_d3hot); +DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_AMD ,0x15e1 , quirk_ryzen_xhci_d3hot); +#ifdef CONFIG_X86_IO_APIC static int dmi_disable_ioapicreroute (const struct dmi_system_id *d) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 181/459 Revert "nfp: abm: fix memory leak in nfp_abm_u32_knode_replace"
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 1d1997db870f4058676439ef7014390ba9e24eb2 ]
This reverts commit 78beef629fd9 ("nfp: abm: fix memory leak in nfp_abm_u32_knode_replace").
The quoted commit does not fix anything and resulted in a bogus CVE-2019-19076.
If match is NULL then it is known there is no matching entry in list, hence, calling nfp_abm_u32_knode_delete() is pointless.
--- drivers/net/ethernet/netronome/nfp/abm/cls.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-)
drivers/net/ethernet/netronome/nfp/abm/cls.c +4 -10
@@ -176,10 +176,8 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,u8 mask, val;int err; -if (!nfp_abm_u32_check_knode (alink->abm, knode, proto, extack)) { - err = -EOPNOTSUPP ; +if (!nfp_abm_u32_check_knode (alink->abm, knode, proto, extack)) goto err_delete; - } tos_off = proto ==htons (ETH_P_IP ) ?16 :20 ;
@@ -200,18 +198,14 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,if ((iter->val & cmask) == (val & cmask) && iter->band != knode->res->classid) {NL_SET_ERR_MSG_MOD (extack,"conflict with already offloaded filter" ); - err = -EOPNOTSUPP ; goto err_delete; } }if (!match) { match =kzalloc (sizeof (*match),GFP_KERNEL ); -if (!match) { - err = -ENOMEM ; - goto err_delete; - } - +if (!match) +return -ENOMEM ;list_add (&match->list, &alink->dscp_map); } match->handle = knode->handle;
@@ -227,7 +221,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink, err_delete:nfp_abm_u32_knode_delete (alink, knode); -return err; +return -EOPNOTSUPP ; } static int nfp_abm_setup_tc_block_cb(enum tc_setup_type type,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 182/459 gpu/drm: ingenic: Avoid null pointer deference in plane atomic update
In reply to Sasha LevinFrom: Paul Cercueil <[email protected]>
[ Upstream commit 354b051c5dcbeb35bbfd5d54161364fc7a75a58a ]
It is possible that there is no drm_framebuffer associated with a given plane state.
v2: Handle drm_plane->state which can be NULL too
# *** extracted tags ***
--- drivers/gpu/drm/ingenic/ingenic-drm.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/gpu/drm/ingenic/ingenic-drm.c +10 -6
@@ -371,14 +371,18 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,struct ingenic_drm *priv =drm_plane_get_priv (plane);struct drm_plane_state *state = plane->state;unsigned int width, height, cpp; +dma_addr_t addr; - width = state->crtc->state->adjusted_mode.hdisplay; - height = state->crtc->state->adjusted_mode.vdisplay; - cpp = state->fb->format->cpp[plane->index]; +if (state && state->fb) { + addr =drm_fb_cma_get_gem_addr (state->fb, state,0 ); + width = state->crtc->state->adjusted_mode.hdisplay; + height = state->crtc->state->adjusted_mode.vdisplay; + cpp = state->fb->format->cpp[plane->index]; - priv->dma_hwdesc->addr =drm_fb_cma_get_gem_addr (state->fb, state,0 ); - priv->dma_hwdesc->cmd = width * height * cpp /4 ; - priv->dma_hwdesc->cmd |=JZ_LCD_CMD_EOF_IRQ ; + priv->dma_hwdesc->addr = addr; + priv->dma_hwdesc->cmd = width * height * cpp /4 ; + priv->dma_hwdesc->cmd |=JZ_LCD_CMD_EOF_IRQ ; + } } static void ingenic_drm_encoder_atomic_mode_set(struct drm_encoder *encoder,
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 183/459 selftests/net: make so_txtime more robust to timer variance
In reply to Sasha LevinFrom: Willem de Bruijn <[email protected]>
[ Upstream commit ea6a547669b37453f2b1a5d85188d75b3613dfaa ]
The SO_TXTIME test depends on accurate timers. In some virtualized environments the test has been reported to be flaky. This is easily reproduced by disabling kvm acceleration in Qemu.
Allow greater variance in a run and retry to further reduce flakiness.
Observed errors are one of two kinds: either the packet arrives too early or late at recv(), or it was dropped in the qdisc itself and the recv() call times out.
In the latter case, the qdisc queues a notification to the error queue of the send socket. Also explicitly report this cause.
--- tools/testing/selftests/net/so_txtime.c | 84 +++++++++++++++++++++++- tools/testing/selftests/net/so_txtime.sh | 9 ++- 2 files changed, 88 insertions(+), 5 deletions(-)
tools/testing/selftests/net/so_txtime.c +81 -3
@@ -12,7 +12,11 @@#include <arpa/inet.h> #include <error.h> #include <errno.h> +#include <inttypes.h> #include <linux/net_tstamp.h> +#include <linux/errqueue.h> +#include <linux/ipv6.h> +#include <linux/tcp.h> #include <stdbool.h> #include <stdlib.h> #include <stdio.h>
@@ -28,7 +32,7 @@ static int cfg_clockid = CLOCK_TAI;static bool cfg_do_ipv4;static bool cfg_do_ipv6;static uint16_t cfg_port =8000 ; -static int cfg_variance_us =2000 ; +static int cfg_variance_us =4000 ;static uint64_t glob_tstart;
@@ -43,6 +47,9 @@ static struct timed_send cfg_in[MAX_NUM_PKT];static struct timed_send cfg_out[MAX_NUM_PKT ];static int cfg_num_pkt; +static int cfg_errq_level; +static int cfg_errq_type; +static uint64_t gettime_ns (void ) {struct timespec ts;
@@ -90,13 +97,15 @@ static void do_send_one(int fdt, struct timed_send *ts) } -static void do_recv_one (int fdr,struct timed_send *ts) +static bool do_recv_one (int fdr,struct timed_send *ts) {int64_t tstop, texpect;char rbuf[2 ];int ret; ret =recv (fdr, rbuf,sizeof (rbuf),0 ); +if (ret ==-1 && errno ==EAGAIN ) +return true;if (ret ==-1 )error (1 , errno,"read" );if (ret !=1 )
@@ -113,6 +122,8 @@ static void do_recv_one(int fdr, struct timed_send *ts)if (labs (tstop - texpect) > cfg_variance_us)error (1 ,0 ,"exceeds variance (%d us)" , cfg_variance_us); + +return false; }static void do_recv_verify_empty (int fdr)
@@ -125,12 +136,70 @@ static void do_recv_verify_empty(int fdr)error (1 ,0 ,"recv: not empty as expected (%d, %d)" , ret, errno); } +static void do_recv_errqueue_timeout (int fdt) +{ +char control[CMSG_SPACE (sizeof (struct sock_extended_err )) + +CMSG_SPACE (sizeof (struct sockaddr_in6 ))] = {0 }; +char data[sizeof (struct ipv6hdr ) + +sizeof (struct tcphdr ) +1 ]; +struct sock_extended_err *err; +struct msghdr msg = {0 }; +struct iovec iov = {0 }; +struct cmsghdr *cm; +int64_t tstamp =0 ; +int ret; + + iov.iov_base = data; + iov.iov_len =sizeof (data); + + msg.msg_iov = &iov; + msg.msg_iovlen =1 ; + + msg.msg_control = control; + msg.msg_controllen =sizeof (control); + +while (1 ) { + ret =recvmsg (fdt, &msg,MSG_ERRQUEUE ); +if (ret ==-1 && errno ==EAGAIN ) +break ; +if (ret ==-1 ) +error (1 , errno,"errqueue" ); +if (msg.msg_flags !=MSG_ERRQUEUE ) +error (1 ,0 ,"errqueue: flags 0x%x\n" , msg.msg_flags); + + cm =CMSG_FIRSTHDR (&msg); +if (cm->cmsg_level != cfg_errq_level || + cm->cmsg_type != cfg_errq_type) +error (1 ,0 ,"errqueue: type 0x%x.0x%x\n" , + cm->cmsg_level, cm->cmsg_type); + + err = (struct sock_extended_err *)CMSG_DATA (cm); +if (err->ee_origin !=SO_EE_ORIGIN_TXTIME ) +error (1 ,0 ,"errqueue: origin 0x%x\n" , err->ee_origin); +if (err->ee_code !=ECANCELED ) +error (1 ,0 ,"errqueue: code 0x%x\n" , err->ee_code); + + tstamp = ((int64_t ) err->ee_data) <<32 | err->ee_info; + tstamp -= (int64_t ) glob_tstart; + tstamp /=1000 *1000 ; +fprintf (stderr,"send: pkt %c at %" PRId64"ms dropped\n" , + data[ret -1 ], tstamp); + + msg.msg_flags =0 ; + msg.msg_controllen =sizeof (control); + } + +error (1 ,0 ,"recv: timeout" ); +} +static void setsockopt_txtime (int fd) {struct sock_txtime so_txtime_val = { .clockid = cfg_clockid };struct sock_txtime so_txtime_val_read = {0 };socklen_t vallen =sizeof (so_txtime_val); + so_txtime_val.flags =SOF_TXTIME_REPORT_ERRORS ; +if (setsockopt (fd,SOL_SOCKET ,SO_TXTIME , &so_txtime_val,sizeof (so_txtime_val)))error (1 , errno,"setsockopt txtime" );
@@ -194,7 +263,8 @@ static void do_test(struct sockaddr *addr, socklen_t alen)for (i =0 ; i < cfg_num_pkt; i++)do_send_one (fdt, &cfg_in[i]);for (i =0 ; i < cfg_num_pkt; i++) -do_recv_one (fdr, &cfg_out[i]); +if (do_recv_one (fdr, &cfg_out[i])) +do_recv_errqueue_timeout (fdt);do_recv_verify_empty (fdr);
@@ -280,6 +350,10 @@ int main(int argc, char **argv) addr6.sin6_family =AF_INET6 ; addr6.sin6_port =htons (cfg_port); addr6.sin6_addr = in6addr_loopback; + + cfg_errq_level =SOL_IPV6 ; + cfg_errq_type =IPV6_RECVERR ; +do_test ((void *)&addr6,sizeof (addr6)); }
@@ -289,6 +363,10 @@ int main(int argc, char **argv) addr4.sin_family =AF_INET ; addr4.sin_port =htons (cfg_port); addr4.sin_addr.s_addr =htonl (INADDR_LOOPBACK ); + + cfg_errq_level =SOL_IP ; + cfg_errq_type =IP_RECVERR ; +do_test ((void *)&addr4,sizeof (addr4)); }
tools/testing/selftests/net/so_txtime.sh +7 -2
@@ -5,7 +5,12 @@ # Run in network namespace if [[ $# -eq 0 ]]; then - ./in_netns.sh $0 __subprocess + if ! ./in_netns.sh $0 __subprocess; then + # test is time sensitive, can be flaky + echo "test failed: retry once" + ./in_netns.sh $0 __subprocess + fi + exit $? fi
@@ -18,7 +23,7 @@ tc qdisc add dev lo root fq ./so_txtime -4 -6 -c mono a,10,b,20 a,10,b,20 ./so_txtime -4 -6 -c mono a,20,b,10 b,20,a,20 -if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 200000; then +if tc qdisc replace dev lo root etf clockid CLOCK_TAI delta 400000; then ! ./so_txtime -4 -6 -c tai a,-1 a,-1 ! ./so_txtime -4 -6 -c tai a,0 a,0 ./so_txtime -4 -6 -c tai a,10 a,10
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 184/459 media: v4l2-device.h: Explicitly compare grp{id,mask} to zero in v4l2_device macros
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit afb34781620274236bd9fc9246e22f6963ef5262 ]
When building with Clang + -Wtautological-constant-compare, several of the ivtv and cx18 drivers warn along the lines of:
drivers/media/pci/cx18/cx18-driver.c:1005:21: warning: converting the result of '<<' to a boolean always evaluates to true [-Wtautological-constant-compare]
cx18_call_hw(cx, CX18_HW_GPIO_RESET_CTRL,
^
drivers/media/pci/cx18/cx18-cards.h:18:37: note: expanded from macro
'CX18_HW_GPIO_RESET_CTRL'
#define CX18_HW_GPIO_RESET_CTRL (1 << 6)
^1 warning generated.
This warning happens because the shift operation is implicitly converted to a boolean in v4l2_device_mask_call_all before being negated. This can be solved by just comparing the mask result to 0 explicitly so that there is no boolean conversion. The ultimate goal is to enable -Wtautological-compare globally because there are several subwarnings that would be helpful to have.
For visual consistency and avoidance of these warnings in the future, all of the implicitly boolean conversions in the v4l2_device macros are converted to explicit ones as well.
--- include/media/v4l2-device.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
include/media/v4l2-device.h +6 -6
@@ -371,7 +371,7 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev)struct v4l2_subdev *__sd; \ \__v4l2_device_call_subdevs_p (v4l2_dev, __sd, \ - !(grpid) || __sd->grp_id == (grpid), o, f , \ + (grpid) == 0 || __sd->grp_id == (grpid), o, f , \ ##args); \ }while (0 )
@@ -403,7 +403,7 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev) ({ \struct v4l2_subdev *__sd; \__v4l2_device_call_subdevs_until_err_p (v4l2_dev, __sd, \ - !(grpid) || __sd->grp_id == (grpid), o, f , \ + (grpid) == 0 || __sd->grp_id == (grpid), o, f , \ ##args); \ })
@@ -431,8 +431,8 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev)struct v4l2_subdev *__sd; \ \__v4l2_device_call_subdevs_p (v4l2_dev, __sd, \ - !(grpmsk) || (__sd->grp_id & (grpmsk)), o, f , \ - ##args); \ + (grpmsk) ==0 || (__sd->grp_id & (grpmsk)), o, \ + f , ##args); \ }while (0 )/**
@@ -462,8 +462,8 @@ static inline bool v4l2_device_supports_requests(struct v4l2_device *v4l2_dev) ({ \struct v4l2_subdev *__sd; \__v4l2_device_call_subdevs_until_err_p (v4l2_dev, __sd, \ - !(grpmsk) || (__sd->grp_id & (grpmsk)), o, f , \ - ##args); \ + (grpmsk) ==0 || (__sd->grp_id & (grpmsk)), o, \ + f , ##args); \ })
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 185/459 reiserfs: Fix spurious unlock in reiserfs_fill_super() error handling
In reply to Sasha LevinFrom: Jan Kara <[email protected]>
[ Upstream commit 4d5c1adaf893b8aa52525d2b81995e949bcb3239 ]
When we fail to allocate string for journal device name we jump to 'error' label which tries to unlock reiserfs write lock which is not held. Jump to 'error_unlocked' instead.
--- fs/reiserfs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/reiserfs/super.c +1 -1
@@ -1948,7 +1948,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)if (!sbi->s_jdev) {SWARN (silent, s,"" ,"Cannot allocate memory for " "journal device name" ); - goto error; + goto error_unlocked; } }#ifdef CONFIG_QUOTA
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 186/459 samples/bpf: Set -fno-stack-protector when building BPF programs
In reply to Sasha LevinFrom: Toke Høiland-Jørgensen <[email protected]>
[ Upstream commit 450278977acbf494a20367c22fbb38729772d1fc ]
It seems Clang can in some cases turn on stack protection by default, which doesn't work with BPF. This was reported once before[0], but it seems the flag to explicitly turn off the stack protector wasn't added to the Makefile, so do that now.
The symptom of this is compile errors like the following:
error: <unknown>:0:0: in function bpf_prog1 i32 (%struct.__sk_buff*): A call to built-in function '__stack_chk_fail' is not supported.
[0] https://www.spinics.net/lists/netdev/msg556400.html
--- samples/bpf/Makefile | 1 + 1 file changed, 1 insertion(+)
samples/bpf/Makefile +1 -0
@@ -219,6 +219,7 @@ BTF_LLVM_PROBE := $(shell echo "int main() { return 0; }" | \ readelf -S ./llvm_btf_verify.o | grep BTF; \ /bin/rm -f ./llvm_btf_verify.o) +BPF_EXTRA_CFLAGS += -fno-stack-protector ifneq ($(BTF_LLVM_PROBE),) EXTRA_CFLAGS += -g else
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 187/459 r8169: check that Realtek PHY driver module is loaded
In reply to Sasha LevinFrom: Heiner Kallweit <[email protected]>
[ Upstream commit f325937735498afb054a0195291bbf68d0b60be5 ]
Some users complained about problems with r8169 and it turned out that the generic PHY driver was used instead instead of the dedicated one. In all cases reason was that r8169.ko was in initramfs, but realtek.ko not. Manually adding realtek.ko to initramfs fixed the issues. Root cause seems to be that tools like dracut and genkernel don't consider softdeps. Add a check for loaded Realtek PHY driver module and provide the user with a hint if it's not loaded.
--- drivers/net/ethernet/realtek/r8169_main.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +9 -0
@@ -7064,6 +7064,15 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)int chipset, region;int jumbo_max, rc; +/* Some tools for creating an initramfs don't consider softdeps, then +* r8169.ko may be in initramfs, but realtek.ko not. Then the generic +* PHY driver is used that doesn't work with most chip versions. +*/ +if (!driver_find ("RTL8201CP Ethernet" , &mdio_bus_type)) { +dev_err (&pdev->dev,"realtek.ko not loaded, maybe it needs to be added to initramfs?\n" ); +return -ENOENT ; + } + dev =devm_alloc_etherdev (&pdev->dev,sizeof (*tp));if (!dev)return -ENOMEM ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 188/459 fore200e: Fix incorrect checks of NULL pointer dereference
In reply to Sasha LevinFrom: Aditya Pakki <[email protected]>
[ Upstream commit bbd20c939c8aa3f27fa30e86691af250bf92973a ]
In fore200e_send and fore200e_close, the pointers from the arguments are dereferenced in the variable declaration block and then checked for NULL. The patch fixes these issues by avoiding NULL pointer dereferences.
--- drivers/atm/fore200e.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
drivers/atm/fore200e.c +18 -7
@@ -1414,12 +1414,14 @@ fore200e_open(struct atm_vcc *vcc)static void fore200e_close (struct atm_vcc * vcc) { -struct fore200e * fore200e =FORE200E_DEV (vcc->dev);struct fore200e_vcc * fore200e_vcc; +struct fore200e * fore200e;struct fore200e_vc_map * vc_map;unsigned long flags;ASSERT (vcc); + fore200e =FORE200E_DEV (vcc->dev); +ASSERT ((vcc->vpi >=0 ) && (vcc->vpi <1 <<FORE200E_VPI_BITS ));ASSERT ((vcc->vci >=0 ) && (vcc->vci <1 <<FORE200E_VCI_BITS ));
@@ -1464,10 +1466,10 @@ fore200e_close(struct atm_vcc* vcc)static int fore200e_send (struct atm_vcc *vcc,struct sk_buff *skb) { -struct fore200e * fore200e =FORE200E_DEV (vcc->dev); -struct fore200e_vcc * fore200e_vcc =FORE200E_VCC (vcc); +struct fore200e * fore200e; +struct fore200e_vcc * fore200e_vcc;struct fore200e_vc_map * vc_map; -struct host_txq * txq = &fore200e->host_txq; +struct host_txq * txq;struct host_txq_entry * entry;struct tpd * tpd;struct tpd_haddr tpd_haddr;
@@ -1480,9 +1482,18 @@ fore200e_send(struct atm_vcc *vcc, struct sk_buff *skb)unsigned char * data;unsigned long flags; -ASSERT (vcc); -ASSERT (fore200e); -ASSERT (fore200e_vcc); +if (!vcc) +return -EINVAL ; + + fore200e =FORE200E_DEV (vcc->dev); + fore200e_vcc =FORE200E_VCC (vcc); + +if (!fore200e) +return -EINVAL ; + + txq = &fore200e->host_txq; +if (!fore200e_vcc) +return -EINVAL ;if (!test_bit (ATM_VF_READY , &vcc->flags)) {DPRINTK (1 ,"VC %d.%d.%d not ready for tx\n" , vcc->itf, vcc->vpi, vcc->vpi);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 189/459 isdn: don't mark kcapi_proc_exit as __exit
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit b33bdf8020c94438269becc6dace9ed49257c4ba ]
As everybody pointed out by now, my patch to clean up CAPI introduced a link time warning, as the two parts of the capi driver are now in one module and the exit function may need to be called in the error path of the init function:
Quoted 1 line
Quoted 1 line
WARNING: drivers/isdn/capi/kernelcapi.o(.text+0xea4): Section mismatch in reference from the function
kcapi_exit()to the function .exit.text:kcapi_proc_exit()
The function kcapi_exit() references a function in an exit section. Often the function kcapi_proc_exit() has valid usage outside the exit section and the fix is to remove the __exit annotation of kcapi_proc_exit.
Remove the incorrect __exit annotation.
--- drivers/isdn/capi/kcapi_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/isdn/capi/kcapi_proc.c +1 -1
@@ -239,7 +239,7 @@ kcapi_proc_init(void)proc_create_seq ("capi/driver" ,0 ,NULL , &seq_capi_driver_ops); } -void __exit +void kcapi_proc_exit (void ) {remove_proc_entry ("capi/driver" ,NULL );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 190/459 ARM: OMAP2+: pdata-quirks: add PRM data for reset support
In reply to Sasha LevinFrom: Tero Kristo <[email protected]>
[ Upstream commit 8de44fb70659a5bc0c53a443e6129ea1bf00fd8b ]
The parent clockdomain for reset must be in force wakeup mode, otherwise the reset may never complete. Add pdata quirks for this purpose for PRM driver.
--- arch/arm/mach-omap2/pdata-quirks.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +8 -0
@@ -24,6 +24,7 @@#include <linux/platform_data/ti-sysc.h> #include <linux/platform_data/wkup_m3.h> #include <linux/platform_data/asoc-ti-mcbsp.h> +#include <linux/platform_data/ti-prm.h> #include "clockdomain.h" #include "common.h"
@@ -463,6 +464,12 @@ void omap_pcs_legacy_init(int irq, void (*rearm)(void)) pcs_pdata.rearm = rearm; } +static struct ti_prm_platform_data ti_prm_pdata = { + .clkdm_deny_idle = clkdm_deny_idle, + .clkdm_allow_idle = clkdm_allow_idle, + .clkdm_lookup = clkdm_lookup, +}; +/* * GPIOs for TWL are initialized by the I2C bus and need custom * handing until DSS has device tree bindings.
@@ -565,6 +572,7 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = {/* Common auxdata */ OF_DEV_AUXDATA ("ti,sysc" ,0 ,NULL , &ti_sysc_pdata),OF_DEV_AUXDATA ("pinctrl-single" ,0 ,NULL , &pcs_pdata), + OF_DEV_AUXDATA("ti,omap-prm-inst", 0, NULL, &ti_prm_pdata), { /* sentinel */ }, };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 191/459 ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879
In reply to Sasha LevinFrom: Suman Anna <[email protected]>
[ Upstream commit 2f14101a1d760db72393910d481fbf7768c44530 ]
Errata Title:
i879: DSP MStandby requires CD_EMU in SW_WKUP
Description:
The DSP requires the internal emulation clock to be actively toggling in order to successfully enter a low power mode via execution of the IDLE instruction and PRCM MStandby/Idle handshake. This assumes that other prerequisites and software sequence are followed.
Workaround:
The emulation clock to the DSP is free-running anytime CCS is connected via JTAG debugger to the DSP subsystem or when the CD_EMU clock domain is set in SW_WKUP mode. The CD_EMU domain can be set in SW_WKUP mode via the CM_EMU_CLKSTCTRL [1:0]CLKTRCTRL field.
Implementation:
This patch implements this workaround by denying the HW_AUTO mode for the EMU clockdomain during the power-up of any DSP processor and re-enabling the HW_AUTO mode during the shutdown of the last DSP processor (actually done during the enabling and disabling of the respective DSP MDMA MMUs). Reference counting has to be used to manage the independent sequencing between the multiple DSP processors.
This switching is done at runtime rather than a static clockdomain flags value to meet the target power domain state for the EMU power domain during suspend.
Note that the DSP MStandby behavior is not consistent across all boards prior to this fix. Please see commit 45f871eec6c0 ("ARM:
OMAP2+: Extend DRA7 IPU1 MMU pdata quirks to DSP MDMA MMUs") for details.
--- arch/arm/mach-omap2/omap-iommu.c | 43 +++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/omap-iommu.c +40 -3
@@ -11,14 +11,43 @@#include "omap_hwmod.h" #include "omap_device.h" +#include "clockdomain.h" #include "powerdomain.h" +static void omap_iommu_dra7_emu_swsup_config (struct platform_device *pdev, +bool enable) +{ +static struct clockdomain *emu_clkdm; +static DEFINE_SPINLOCK (emu_lock); +static atomic_t count; +struct device_node *np = pdev->dev.of_node; + +if (!of_device_is_compatible (np,"ti,dra7-dsp-iommu" )) +return ; + +if (!emu_clkdm) { + emu_clkdm =clkdm_lookup ("emu_clkdm" ); +if (WARN_ON_ONCE (!emu_clkdm)) +return ; + } + +spin_lock (&emu_lock); + +if (enable && (atomic_inc_return (&count) ==1 )) +clkdm_deny_idle (emu_clkdm); +else if (!enable && (atomic_dec_return (&count) ==0 )) +clkdm_allow_idle (emu_clkdm); + +spin_unlock (&emu_lock); +} +int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev,bool request,u8 *pwrst) {struct powerdomain *pwrdm;struct omap_device *od;u8 next_pwrst; +int ret =0 ; od =to_omap_device (pdev);if (!od)
@@ -31,13 +60,21 @@ int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request,if (!pwrdm)return -EINVAL ; -if (request) +if (request) { *pwrst =pwrdm_read_next_pwrst (pwrdm); +omap_iommu_dra7_emu_swsup_config (pdev, true); + }if (*pwrst >PWRDM_POWER_RET ) -return 0 ; + goto out; next_pwrst = request ?PWRDM_POWER_ON : *pwrst; -return pwrdm_set_next_pwrst (pwrdm, next_pwrst); + ret =pwrdm_set_next_pwrst (pwrdm, next_pwrst); + +out: +if (!request) +omap_iommu_dra7_emu_swsup_config (pdev, false); + +return ret; }
Signature · 1 line
2.20.1
Re: [PATCH AUTOSEL 5.4 191/459] ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879
Hi Sasha,
Quoted 31 lines · Sasha Levin
From: Suman Anna <[email protected]>
[ Upstream commit
2f14101a1d760db72393910d481fbf7768c44530]Errata Title:
i879: DSP MStandby requiresCD_EMUinSW_WKUPDescription:
The DSP requires the internal emulation clock to be actively toggling in order to successfully enter a low power mode via execution of the IDLE instruction and PRCM MStandby/Idle handshake. This assumes that other prerequisites and software sequence are followed.Workaround:
The emulation clock to the DSP is free-running anytime CCS is connected via JTAG debugger to the DSP subsystem or when theCD_EMUclock domain is set inSW_WKUPmode. TheCD_EMUdomain can be set inSW_WKUPmode via theCM_EMU_CLKSTCTRL[1:0]CLKTRCTRL field.Implementation:
This patch implements this workaround by denying theHW_AUTOmode for the EMU clockdomain during the power-up of any DSP processor and re-enabling theHW_AUTOmode during the shutdown of the last DSP processor (actually done during the enabling and disabling of the respective DSP MDMA MMUs). Reference counting has to be used to manage the independent sequencing between the multiple DSP processors.This switching is done at runtime rather than a static clockdomain flags value to meet the target power domain state for the EMU power domain during suspend.
Quoted 8 lines
Note that the DSP MStandby behavior is not consistent across all boards prior to this fix. Please see commit
45f871eec6c0("ARM:
OMAP2+: Extend DRA7 IPU1 MMU pdata quirks to DSP MDMA MMUs") for details.Signed-off-by Suman Anna <[email protected]>Signed-off-by Tony Lindgren <[email protected]>Signed-off-by Sasha Levin <[email protected]>
You can drop this from the 5.4-stable queue. Mainline doesn't yet boot the processors, so this is not needed for stable queue.
regards
Suman
Quoted 78 lines
--- arch/arm/mach-omap2/omap-iommu.c | 43 +++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-)arch/arm/mach-omap2/omap-iommu.c +40
-3@@ -11,14 +11,43 @@#include "omap_hwmod.h" #include "omap_device.h" +#include "clockdomain.h" #include "powerdomain.h" +static void omap_iommu_dra7_emu_swsup_config (struct platform_device *pdev, +bool enable) +{ +static struct clockdomain *emu_clkdm; +static DEFINE_SPINLOCK (emu_lock); +static atomic_t count; +struct device_node *np = pdev->dev.of_node; + +if (!of_device_is_compatible (np,"ti,dra7-dsp-iommu" )) +return ; + +if (!emu_clkdm) { + emu_clkdm =clkdm_lookup ("emu_clkdm" ); +if (WARN_ON_ONCE (!emu_clkdm)) +return ; + } + +spin_lock (&emu_lock); + +if (enable && (atomic_inc_return (&count) ==1 )) +clkdm_deny_idle (emu_clkdm); +else if (!enable && (atomic_dec_return (&count) ==0 )) +clkdm_allow_idle (emu_clkdm); + +spin_unlock (&emu_lock); +} +int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev,bool request,u8 *pwrst) {struct powerdomain *pwrdm;struct omap_device *od;u8 next_pwrst; +int ret =0 ; od =to_omap_device (pdev);if (!od)@@ -31,13 +60,21 @@ int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request,if (!pwrdm)return -EINVAL ; -if (request) +if (request) { *pwrst =pwrdm_read_next_pwrst (pwrdm); +omap_iommu_dra7_emu_swsup_config (pdev, true); + }if (*pwrst >PWRDM_POWER_RET ) -return 0 ; + goto out; next_pwrst = request ?PWRDM_POWER_ON : *pwrst; -return pwrdm_set_next_pwrst (pwrdm, next_pwrst); + ret =pwrdm_set_next_pwrst (pwrdm, next_pwrst); + +out: +if (!request) +omap_iommu_dra7_emu_swsup_config (pdev, false); + +return ret; }
Sasha Levin
maintainerPATCH 192/459 ARM: OMAP2+: use separate IOMMU pdata to fix DRA7 IPU1 boot
In reply to Sasha LevinFrom: Suman Anna <[email protected]>
[ Upstream commit 4601832f40501efc3c2fd264a5a69bd1ac17d520 ]
The IPU1 MMU has been using common IOMMU pdata quirks defined and used by all IPU IOMMU devices on OMAP4 and beyond. Separate out the pdata for IPU1 MMU with the additional .set_pwrdm_constraint ops plugged in, so that the IPU1 power domain can be restricted to ON state during the boot and active period of the IPU1 remote processor. This eliminates the pre-conditions for the IPU1 boot issue as described in commit afe518400bdb ("iommu/omap: fix boot issue on remoteprocs with AMMU/Unicache").
NOTE:
1. RET is not a valid target power domain state on DRA7 platforms, and IPU power domain is normally programmed for OFF. The IPU1 still fails to boot though, and an unclearable l3_noc error is thrown currently on 4.14 kernel without this fix. This behavior is slightly different from previous 4.9 LTS kernel.
2. The fix is currently applied only to IPU1 on DRA7xx SoC, as the other affected processors on OMAP4/OMAP5/DRA7 are in domains that are not entering RET. IPU2 on DRA7 is in CORE power domain which is only programmed for ON power state. The fix can be easily scaled if these domains do hit RET in the future.
3. The issue was not seen on current DRA7 platforms if any of the DSP remote processors were booted and using one of the GPTimers 5, 6, 7 or 8 on previous 4.9 LTS kernel. This was due to the errata fix for i874 implemented in commit 1cbabcb9807e ("ARM:
DRA7: clockdomain: Implement timer workaround for errata i874") which keeps the IPU1 power domain from entering RET when the timers are active. But the timer workaround did not make any difference on 4.14 kernel, and an l3_noc error was seen still without this fix.
--- arch/arm/mach-omap2/pdata-quirks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +21 -0
@@ -45,6 +45,17 @@ struct pdata_init {static struct of_dev_auxdata omap_auxdata_lookup[];static struct twl4030_gpio_platform_data twl_gpio_auxdata; +#if IS_ENABLED (CONFIG_OMAP_IOMMU ) +int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev,bool request, +u8 *pwrst); +#else +static inline int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev, +bool request,u8 *pwrst) +{ +return 0 ; +} +#endif +#ifdef CONFIG_MACH_NOKIA_N8X0 static void __init omap2420_n8x0_legacy_init (void ) {
@@ -337,6 +348,10 @@ static void __init omap5_uevm_legacy_init(void)#endif #ifdef CONFIG_SOC_DRA7XX +static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = { + .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint, +}; +static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1;static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2;static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3;
@@ -568,6 +583,12 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { &dra7_hsmmc_data_mmc2),OF_DEV_AUXDATA ("ti,dra7-hsmmc" ,0x480ad000 ,"480ad000.mmc" , &dra7_hsmmc_data_mmc3), +OF_DEV_AUXDATA ("ti,dra7-dsp-iommu" ,0x40d01000 ,"40d01000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), +OF_DEV_AUXDATA ("ti,dra7-dsp-iommu" ,0x41501000 ,"41501000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), +OF_DEV_AUXDATA ("ti,dra7-iommu" ,0x58882000 ,"58882000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), #endif/* Common auxdata */ OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
Signature · 1 line
2.20.1
Re: [PATCH AUTOSEL 5.4 192/459] ARM: OMAP2+: use separate IOMMU pdata to fix DRA7 IPU1 boot
Hi Sasha,
Quoted 34 lines · Sasha Levin
From: Suman Anna <[email protected]>
[ Upstream commit
4601832f40501efc3c2fd264a5a69bd1ac17d520]The IPU1 MMU has been using common IOMMU pdata quirks defined and used by all IPU IOMMU devices on OMAP4 and beyond. Separate out the pdata for IPU1 MMU with the additional .set_pwrdm_constraint ops plugged in, so that the IPU1 power domain can be restricted to ON state during the boot and active period of the IPU1 remote processor. This eliminates the pre-conditions for the IPU1 boot issue as described in commit
afe518400bdb("iommu/omap: fix boot issue on remoteprocs with AMMU/Unicache").NOTE:
1. RET is not a valid target power domain state on DRA7 platforms, and IPU power domain is normally programmed for OFF. The IPU1 still fails to boot though, and an unclearablel3_nocerror is thrown currently on 4.14 kernel without this fix. This behavior is slightly different from previous 4.9 LTS kernel.
2. The fix is currently applied only to IPU1 on DRA7xx SoC, as the other affected processors on OMAP4/OMAP5/DRA7 are in domains that are not entering RET. IPU2 on DRA7 is in CORE power domain which is only programmed for ON power state. The fix can be easily scaled if these domains do hit RET in the future.
3. The issue was not seen on current DRA7 platforms if any of the DSP remote processors were booted and using one of the GPTimers 5, 6, 7 or 8 on previous 4.9 LTS kernel. This was due to the errata fix for i874 implemented in commit1cbabcb9807e("ARM:
DRA7: clockdomain: Implement timer workaround for errata i874") which keeps the IPU1 power domain from entering RET when the timers are active. But the timer workaround did not make any difference on 4.14 kernel, and anl3_nocerror was seen still without this fix.
Quoted 3 lines
Signed-off-by Suman Anna <[email protected]>Signed-off-by Tony Lindgren <[email protected]>Signed-off-by Sasha Levin <[email protected]>
You can drop this as well. Same comments as on PATCH AUTOSEL 5.4 191/459.
regards
Suman
Quoted 51 lines
--- arch/arm/mach-omap2/pdata-quirks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)arch/arm/mach-omap2/pdata-quirks.c +21
-0@@ -45,6 +45,17 @@ struct pdata_init {static struct of_dev_auxdata omap_auxdata_lookup[];static struct twl4030_gpio_platform_data twl_gpio_auxdata; +#if IS_ENABLED (CONFIG_OMAP_IOMMU ) +int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev,bool request, +u8 *pwrst); +#else +static inline int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev, +bool request,u8 *pwrst) +{ +return 0 ; +} +#endif +#ifdef CONFIG_MACH_NOKIA_N8X0 static void __init omap2420_n8x0_legacy_init (void ) {@@ -337,6 +348,10 @@ static void __init omap5_uevm_legacy_init(void)#endif #ifdef CONFIG_SOC_DRA7XX +static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = { + .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint, +}; +static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1;static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2;static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3;@@ -568,6 +583,12 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { &dra7_hsmmc_data_mmc2),OF_DEV_AUXDATA ("ti,dra7-hsmmc" ,0x480ad000 ,"480ad000.mmc" , &dra7_hsmmc_data_mmc3), +OF_DEV_AUXDATA ("ti,dra7-dsp-iommu" ,0x40d01000 ,"40d01000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), +OF_DEV_AUXDATA ("ti,dra7-dsp-iommu" ,0x41501000 ,"41501000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), +OF_DEV_AUXDATA ("ti,dra7-iommu" ,0x58882000 ,"58882000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), #endif/* Common auxdata */ OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
Sasha Levin
maintainerPATCH 193/459 netfilter: nft_tunnel: add the missing ERSPAN_VERSION nla_policy
In reply to Sasha LevinFrom: Xin Long <[email protected]>
[ Upstream commit 0705f95c332081036d85f26691e9d3cd7d901c31 ]
ERSPAN_VERSION is an attribute parsed in kernel side, nla_policy type should be added for it, like other attributes.
--- net/netfilter/nft_tunnel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/netfilter/nft_tunnel.c +2 -1
@@ -248,8 +248,9 @@ static int nft_tunnel_obj_vxlan_init(const struct nlattr *attr, }static const struct nla_policy nft_tunnel_opts_erspan_policy[NFTA_TUNNEL_KEY_ERSPAN_MAX +1 ] = { + [NFTA_TUNNEL_KEY_ERSPAN_VERSION ] = { .type =NLA_U32 }, [NFTA_TUNNEL_KEY_ERSPAN_V1_INDEX ] = { .type =NLA_U32 }, - [NFTA_TUNNEL_KEY_ERSPAN_V2_DIR ] = { .type =NLA_U8 }, + [NFTA_TUNNEL_KEY_ERSPAN_V2_DIR ] = { .type =NLA_U8 }, [NFTA_TUNNEL_KEY_ERSPAN_V2_HWID ] = { .type =NLA_U8 }, };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 194/459 ALSA: usx2y: Adjust indentation in snd_usX2Y_hwdep_dsp_status
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit df4654bd6e42125d9b85ce3a26eaca2935290b98 ]
Clang warns:
../sound/usb/usx2y/usX2Yhwdep.c:122:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
info->version = USX2Y_DRIVER_VERSION;
^
../sound/usb/usx2y/usX2Yhwdep.c:120:2: note: previous statement is here
if (us428->chip_status & USX2Y_STAT_CHIP_INIT)
^1 warning generated.
This warning occurs because there is a space before the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.
This was introduced before the beginning of git history so no fixes tag.
--- sound/usb/usx2y/usX2Yhwdep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/usb/usx2y/usX2Yhwdep.c +1 -1
@@ -119,7 +119,7 @@ static int snd_usX2Y_hwdep_dsp_status(struct snd_hwdep *hw, info->num_dsps =2 ;// 0: Prepad Data, 1: FPGA Code if (us428->chip_status &USX2Y_STAT_CHIP_INIT ) info->chip_ready =1 ; - info->version =USX2Y_DRIVER_VERSION ; + info->version =USX2Y_DRIVER_VERSION ;return 0 ; }
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 195/459 Revert "tty/serial: atmel: fix out of range clock divider handling"
In reply to Sasha LevinFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 6dbd54e4154dfe386b3333687de15be239576617 ]
This reverts commit 751d0017334db9c4d68a8909c59f662a6ecbcec6.
The wrong commit got added to the tty-next tree, the correct one is in the tty-linus branch.
--- drivers/tty/serial/atmel_serial.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/atmel_serial.c +3 -0
@@ -2270,6 +2270,9 @@ static void atmel_set_termios(struct uart_port *port, struct ktermios *termios, mode |=ATMEL_US_USMODE_NORMAL ; } +/* set the mode, clock divisor, parity, stop bits and data size */ +atmel_uart_writel (port,ATMEL_US_MR , mode); +/* * Set the baud rate: * Fractional baudrate allows to setup output frequency more
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 196/459 PCI: Add nr_devfns parameter to pci_add_dma_alias()
In reply to Sasha LevinFrom: James Sewart <[email protected]>
[ Upstream commit 09298542cd891b43778db1f65aa3613aa5a562eb ]
Add a "nr_devfns" parameter to pci_add_dma_alias() so it can be used to create DMA aliases for a range of devfns.
[bhelgaas: incorporate nr_devfns fix from James, update quirk_pex_vca_alias() and setup_aliases()]
--- drivers/iommu/amd_iommu.c | 7 ++----- drivers/pci/pci.c | 22 +++++++++++++++++----- drivers/pci/quirks.c | 23 +++++++++-------------- include/linux/pci.h | 2 +- 4 files changed, 29 insertions(+), 25 deletions(-)
drivers/iommu/amd_iommu.c +2 -5
@@ -272,11 +272,8 @@ static struct pci_dev *setup_aliases(struct device *dev)*/ ivrs_alias = amd_iommu_alias_table[pci_dev_id (pdev)];if (ivrs_alias !=pci_dev_id (pdev) && -PCI_BUS_NUM (ivrs_alias) == pdev->bus->number) { -pci_add_dma_alias (pdev, ivrs_alias &0xff ); -pci_info (pdev,"Added PCI DMA alias %02x.%d\n" , -PCI_SLOT (ivrs_alias),PCI_FUNC (ivrs_alias)); - } +PCI_BUS_NUM (ivrs_alias) == pdev->bus->number) +pci_add_dma_alias (pdev, ivrs_alias &0xff ,1 );clone_aliases (pdev);
drivers/pci/pci.c +17 -5
@@ -5875,7 +5875,8 @@ EXPORT_SYMBOL_GPL(pci_pr3_present);/** * pci_add_dma_alias - Add a DMA devfn alias for a device * @dev: the PCI device for which alias is added -* @devfn: alias slot and function +* @devfn_from: alias slot and function +* @nr_devfns: number of subsequent devfns to alias * * This helper encodes an 8-bit devfn as a bit number in dma_alias_mask * which is used to program permissible bus-devfn source addresses for DMA
@@ -5891,8 +5892,13 @@ EXPORT_SYMBOL_GPL(pci_pr3_present);* cannot be left as a userspace activity). DMA aliases should therefore * be configured via quirks, such as the PCI fixup header quirk. */ -void pci_add_dma_alias (struct pci_dev *dev,u8 devfn) +void pci_add_dma_alias (struct pci_dev *dev,u8 devfn_from,unsigned nr_devfns) { +int devfn_to; + + nr_devfns =min (nr_devfns, (unsigned )MAX_NR_DEVFNS - devfn_from); + devfn_to = devfn_from + nr_devfns -1 ; +if (!dev->dma_alias_mask) dev->dma_alias_mask =bitmap_zalloc (MAX_NR_DEVFNS ,GFP_KERNEL );if (!dev->dma_alias_mask) {
@@ -5900,9 +5906,15 @@ void pci_add_dma_alias(struct pci_dev *dev, u8 devfn)return ; } -set_bit (devfn, dev->dma_alias_mask); -pci_info (dev,"Enabling fixed DMA alias to %02x.%d\n" , -PCI_SLOT (devfn),PCI_FUNC (devfn)); +bitmap_set (dev->dma_alias_mask, devfn_from, nr_devfns); + +if (nr_devfns ==1 ) +pci_info (dev,"Enabling fixed DMA alias to %02x.%d\n" , +PCI_SLOT (devfn_from),PCI_FUNC (devfn_from)); +else if (nr_devfns >1 ) +pci_info (dev,"Enabling fixed DMA alias for devfn range from %02x.%d to %02x.%d\n" , +PCI_SLOT (devfn_from),PCI_FUNC (devfn_from), +PCI_SLOT (devfn_to),PCI_FUNC (devfn_to)); }bool pci_devs_are_dma_aliases (struct pci_dev *dev1,struct pci_dev *dev2)
drivers/pci/quirks.c +9 -14
@@ -3927,7 +3927,7 @@ int pci_dev_specific_reset(struct pci_dev *dev, int probe)static void quirk_dma_func0_alias (struct pci_dev *dev) {if (PCI_FUNC (dev->devfn) !=0 ) -pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),0 )); +pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),0 ),1 ); }/*
@@ -3941,7 +3941,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_RICOH, 0xe476, quirk_dma_func0_alias);static void quirk_dma_func1_alias (struct pci_dev *dev) {if (PCI_FUNC (dev->devfn) !=1 ) -pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),1 )); +pci_add_dma_alias (dev,PCI_DEVFN (PCI_SLOT (dev->devfn),1 ),1 ); }/*
@@ -4026,7 +4026,7 @@ static void quirk_fixed_dma_alias(struct pci_dev *dev) id =pci_match_id (fixed_dma_alias_tbl, dev);if (id) -pci_add_dma_alias (dev, id->driver_data); +pci_add_dma_alias (dev, id->driver_data,1 ); }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_ADAPTEC2 ,0x0285 , quirk_fixed_dma_alias);
@@ -4068,9 +4068,9 @@ DECLARE_PCI_FIXUP_HEADER(0x8086, 0x244e, quirk_use_pcie_bridge_dma_alias);*/ static void quirk_mic_x200_dma_alias (struct pci_dev *pdev) { -pci_add_dma_alias (pdev,PCI_DEVFN (0x10 ,0x0 )); -pci_add_dma_alias (pdev,PCI_DEVFN (0x11 ,0x0 )); -pci_add_dma_alias (pdev,PCI_DEVFN (0x12 ,0x3 )); +pci_add_dma_alias (pdev,PCI_DEVFN (0x10 ,0x0 ),1 ); +pci_add_dma_alias (pdev,PCI_DEVFN (0x11 ,0x0 ),1 ); +pci_add_dma_alias (pdev,PCI_DEVFN (0x12 ,0x3 ),1 ); }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2260 , quirk_mic_x200_dma_alias);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2264 , quirk_mic_x200_dma_alias);
@@ -4094,13 +4094,8 @@ static void quirk_pex_vca_alias(struct pci_dev *pdev)const unsigned int num_pci_slots =0x20 ;unsigned int slot; -for (slot =0 ; slot < num_pci_slots; slot++) { -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x0 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x1 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x2 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x3 )); -pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x4 )); - } +for (slot =0 ; slot < num_pci_slots; slot++) +pci_add_dma_alias (pdev,PCI_DEVFN (slot,0x0 ),5 ); }DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2954 , quirk_pex_vca_alias);DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_INTEL ,0x2955 , quirk_pex_vca_alias);
@@ -5315,7 +5310,7 @@ static void quirk_switchtec_ntb_dma_alias(struct pci_dev *pdev)pci_dbg (pdev,"Aliasing Partition %d Proxy ID %02x.%d\n" , pp,PCI_SLOT (devfn),PCI_FUNC (devfn)); -pci_add_dma_alias (pdev, devfn); +pci_add_dma_alias (pdev, devfn,1 ); } }
include/linux/pci.h +1 -1
@@ -2324,7 +2324,7 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) }#endif -void pci_add_dma_alias (struct pci_dev *dev,u8 devfn); +void pci_add_dma_alias (struct pci_dev *dev,u8 devfn_from,unsigned nr_devfns);bool pci_devs_are_dma_aliases (struct pci_dev *dev1,struct pci_dev *dev2); int pci_for_each_dma_alias(struct pci_dev *pdev, int (*fn)(struct pci_dev *pdev,
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 197/459 PCI: Add DMA alias quirk for PLX PEX NTB
In reply to Sasha LevinFrom: James Sewart <[email protected]>
[ Upstream commit 7b90dfc4873b87c468cc6046538f46a531c1d785 ]
The PLX PEX NTB forwards DMA transactions using Requester IDs that don't exist as PCI devices. The devfn for a transaction is used as an index into a lookup table storing the origin of a transaction on the other side of the bridge.
Alias all possible devfns to the NTB device so that any transaction coming in is governed by the mappings for the NTB.
--- drivers/pci/quirks.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
drivers/pci/quirks.c +15 -0
@@ -5352,6 +5352,21 @@ SWITCHTEC_QUIRK(0x8574); /* PFXI 64XG3 */SWITCHTEC_QUIRK (0x8575 );/* PFXI 80XG3 */ SWITCHTEC_QUIRK (0x8576 );/* PFXI 96XG3 */ +/* +* The PLX NTB uses devfn proxy IDs to move TLPs between NT endpoints. +* These IDs are used to forward responses to the originator on the other +* side of the NTB. Alias all possible IDs to the NTB to permit access when +* the IOMMU is turned on. +*/ +static void quirk_plx_ntb_dma_alias (struct pci_dev *pdev) +{ +pci_info (pdev,"Setting PLX NTB proxy ID aliases\n" ); +/* PLX NTB may use all 256 devfns */ +pci_add_dma_alias (pdev,0 ,256 ); +} +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_PLX ,0x87b0 , quirk_plx_ntb_dma_alias); +DECLARE_PCI_FIXUP_HEADER (PCI_VENDOR_ID_PLX ,0x87b1 , quirk_plx_ntb_dma_alias); +/* * On Lenovo Thinkpad P50 SKUs with a Nvidia Quadro M1000M, the BIOS does * not always reset the secondary Nvidia GPU between reboots if the system
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 198/459 b43legacy: Fix -Wcast-function-type
In reply to Sasha LevinFrom: Phong Tran <[email protected]>
[ Upstream commit 475eec112e4267232d10f4afe2f939a241692b6c ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/broadcom/b43legacy/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/broadcom/b43legacy/main.c +3 -2
@@ -1275,8 +1275,9 @@ static void handle_irq_ucode_debug(struct b43legacy_wldev *dev) }/* Interrupt handler bottom-half */ -static void b43legacy_interrupt_tasklet (struct b43legacy_wldev *dev) +static void b43legacy_interrupt_tasklet (unsigned long data) { +struct b43legacy_wldev *dev = (struct b43legacy_wldev *)data;u32 reason;u32 dma_reason[ARRAY_SIZE (dev->dma_reason)];u32 merged_dma_reason =0 ;
@@ -3741,7 +3742,7 @@ static int b43legacy_one_core_attach(struct ssb_device *dev,b43legacy_set_status (wldev, B43legacy_STAT_UNINIT); wldev->bad_frames_preempt = modparam_bad_frames_preempt;tasklet_init (&wldev->isr_tasklet, - (void (*)(unsigned long ))b43legacy_interrupt_tasklet, + b43legacy_interrupt_tasklet, (unsigned long )wldev);if (modparam_pio) wldev->__using_pio = true;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 199/459 ipw2x00: Fix -Wcast-function-type
In reply to Sasha LevinFrom: Phong Tran <[email protected]>
[ Upstream commit ebd77feb27e91bb5fe35a7818b7c13ea7435fb98 ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/intel/ipw2x00/ipw2100.c | 7 ++++--- drivers/net/wireless/intel/ipw2x00/ipw2200.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/net/wireless/intel/ipw2x00/ipw2100.c +4 -3
@@ -3206,8 +3206,9 @@ static void ipw2100_tx_send_data(struct ipw2100_priv *priv) } } -static void ipw2100_irq_tasklet (struct ipw2100_priv *priv) +static void ipw2100_irq_tasklet (unsigned long data) { +struct ipw2100_priv *priv = (struct ipw2100_priv *)data;struct net_device *dev = priv->net_dev;unsigned long flags;u32 inta, tmp;
@@ -6007,7 +6008,7 @@ static void ipw2100_rf_kill(struct work_struct *work)spin_unlock_irqrestore (&priv->low_lock, flags); } -static void ipw2100_irq_tasklet (struct ipw2100_priv *priv); +static void ipw2100_irq_tasklet (unsigned long data);static const struct net_device_ops ipw2100_netdev_ops = { .ndo_open = ipw2100_open,
@@ -6137,7 +6138,7 @@ static struct net_device *ipw2100_alloc_device(struct pci_dev *pci_dev,INIT_DELAYED_WORK (&priv->rf_kill, ipw2100_rf_kill);INIT_DELAYED_WORK (&priv->scan_event, ipw2100_scan_event); -tasklet_init (&priv->irq_tasklet, (void (*)(unsigned long )) +tasklet_init (&priv->irq_tasklet, ipw2100_irq_tasklet, (unsigned long )priv);/* NOTE: We do not start the deferred work for status checks yet */
drivers/net/wireless/intel/ipw2x00/ipw2200.c +3 -2
@@ -1945,8 +1945,9 @@ static void notify_wx_assoc_event(struct ipw_priv *priv)wireless_send_event (priv->net_dev,SIOCGIWAP , &wrqu,NULL ); } -static void ipw_irq_tasklet (struct ipw_priv *priv) +static void ipw_irq_tasklet (unsigned long data) { +struct ipw_priv *priv = (struct ipw_priv *)data;u32 inta, inta_mask, handled =0 ;unsigned long flags;int rc =0 ;
@@ -10680,7 +10681,7 @@ static int ipw_setup_deferred_work(struct ipw_priv *priv)INIT_WORK (&priv->qos_activate, ipw_bg_qos_activate);#endif /* CONFIG_IPW2200_QOS */ -tasklet_init (&priv->irq_tasklet, (void (*)(unsigned long )) +tasklet_init (&priv->irq_tasklet, ipw_irq_tasklet, (unsigned long )priv);return ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 200/459 iwlegacy: Fix -Wcast-function-type
In reply to Sasha LevinFrom: Phong Tran <[email protected]>
[ Upstream commit da5e57e8a6a3e69dac2937ba63fa86355628fbb2 ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 5 +++-- drivers/net/wireless/intel/iwlegacy/4965-mac.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlegacy/3945-mac.c +3 -2
@@ -1376,8 +1376,9 @@ il3945_dump_nic_error_log(struct il_priv *il) }static void -il3945_irq_tasklet (struct il_priv *il) +il3945_irq_tasklet (unsigned long data) { +struct il_priv *il = (struct il_priv *)data;u32 inta, handled =0 ;u32 inta_fh;unsigned long flags;
@@ -3403,7 +3404,7 @@ il3945_setup_deferred_work(struct il_priv *il)timer_setup (&il->watchdog, il_bg_watchdog,0 );tasklet_init (&il->irq_tasklet, - (void (*)(unsigned long ))il3945_irq_tasklet, + il3945_irq_tasklet, (unsigned long )il); }
drivers/net/wireless/intel/iwlegacy/4965-mac.c +3 -2
@@ -4344,8 +4344,9 @@ il4965_synchronize_irq(struct il_priv *il) }static void -il4965_irq_tasklet (struct il_priv *il) +il4965_irq_tasklet (unsigned long data) { +struct il_priv *il = (struct il_priv *)data;u32 inta, handled =0 ;u32 inta_fh;unsigned long flags;
@@ -6238,7 +6239,7 @@ il4965_setup_deferred_work(struct il_priv *il)timer_setup (&il->watchdog, il_bg_watchdog,0 );tasklet_init (&il->irq_tasklet, - (void (*)(unsigned long ))il4965_irq_tasklet, + il4965_irq_tasklet, (unsigned long )il); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 201/459 rtlwifi: rtl_pci: Fix -Wcast-function-type
In reply to Sasha LevinFrom: Phong Tran <[email protected]>
[ Upstream commit cb775c88da5d48a85d99d95219f637b6fad2e0e9 ]
correct usage prototype of callback in tasklet_init(). Report by https://github.com/KSPP/linux/issues/20
--- drivers/net/wireless/realtek/rtlwifi/pci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/net/wireless/realtek/rtlwifi/pci.c +6 -4
@@ -1061,13 +1061,15 @@ static irqreturn_t _rtl_pci_interrupt(int irq, void *dev_id)return ret; } -static void _rtl_pci_irq_tasklet (struct ieee80211_hw *hw) +static void _rtl_pci_irq_tasklet (unsigned long data) { +struct ieee80211_hw *hw = (struct ieee80211_hw *)data;_rtl_pci_tx_chk_waitq (hw); } -static void _rtl_pci_prepare_bcn_tasklet (struct ieee80211_hw *hw) +static void _rtl_pci_prepare_bcn_tasklet (unsigned long data) { +struct ieee80211_hw *hw = (struct ieee80211_hw *)data;struct rtl_priv *rtlpriv =rtl_priv (hw);struct rtl_pci *rtlpci =rtl_pcidev (rtl_pcipriv (hw));struct rtl_mac *mac =rtl_mac (rtl_priv (hw));
@@ -1193,10 +1195,10 @@ static void _rtl_pci_init_struct(struct ieee80211_hw *hw,/*task */ tasklet_init (&rtlpriv->works.irq_tasklet, - (void (*)(unsigned long ))_rtl_pci_irq_tasklet, + _rtl_pci_irq_tasklet, (unsigned long )hw);tasklet_init (&rtlpriv->works.irq_prepare_bcn_tasklet, - (void (*)(unsigned long ))_rtl_pci_prepare_bcn_tasklet, + _rtl_pci_prepare_bcn_tasklet, (unsigned long )hw);INIT_WORK (&rtlpriv->works.lps_change_work, rtl_lps_change_work_callback);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 202/459 bcma: remove set but not used variable 'sizel'
In reply to Sasha LevinFrom: yu kuai <[email protected]>
[ Upstream commit f427939391f290cbeabe0231eb8a116429d823f0 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/bcma/scan.c: In function ‘bcma_erom_get_addr_desc’:
drivers/bcma/scan.c:222:20: warning: variable ‘sizel’ set but not used [-Wunused-but-set-variable]
It is never used, and so can be removed.
--- drivers/bcma/scan.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/bcma/scan.c +2 -5
@@ -219,7 +219,7 @@ static s32 bcma_erom_get_mst_port(struct bcma_bus *bus, u32 __iomem **eromptr)static u32 bcma_erom_get_addr_desc (struct bcma_bus *bus,u32 __iomem **eromptr,u32 type,u8 port) { -u32 addrl, addrh, sizel, sizeh =0 ; +u32 addrl, addrh, sizeh =0 ;u32 size;u32 ent =bcma_erom_get_ent (bus, eromptr);
@@ -239,12 +239,9 @@ static u32 bcma_erom_get_addr_desc(struct bcma_bus *bus, u32 __iomem **eromptr,if ((ent &SCAN_ADDR_SZ ) ==SCAN_ADDR_SZ_SZD ) { size =bcma_erom_get_ent (bus, eromptr); - sizel = size &SCAN_SIZE_SZ ;if (size &SCAN_SIZE_SG32 ) sizeh =bcma_erom_get_ent (bus, eromptr); - }else - sizel =SCAN_ADDR_SZ_BASE << - ((ent &SCAN_ADDR_SZ ) >>SCAN_ADDR_SZ_SHIFT ); + }return addrl; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 203/459 orinoco: avoid assertion in case of NULL pointer
In reply to Sasha LevinFrom: Aditya Pakki <[email protected]>
[ Upstream commit c705f9fc6a1736dcf6ec01f8206707c108dca824 ]
In ezusb_init, if upriv is NULL, the code crashes. However, the caller in ezusb_probe can handle the error and print the failure message. The patch replaces the BUG_ON call to error return.
--- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/intersil/orinoco/orinoco_usb.c +2 -1
@@ -1361,7 +1361,8 @@ static int ezusb_init(struct hermes *hw)int retval;BUG_ON (in_interrupt ()); -BUG_ON (!upriv); +if (!upriv) +return -EINVAL ; upriv->reply_count =0 ;/* Write the MAGIC number on the simulated registers to keep
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 204/459 drm/amdgpu: fix KIQ ring test fail in TDR of SRIOV
In reply to Sasha LevinFrom: Monk Liu <[email protected]>
[ Upstream commit 5a7489a7e189ee2be889485f90c8cf24ea4b9a40 ]
issues:
MEC is ruined by the amdkfd_pre_reset after VF FLR done
fix:amdkfd_pre_reset() would ruin MEC after hypervisor finished the VF FLR, the correct sequence is do amdkfd_pre_reset before VF FLR but there is a limitation to block this sequence:
if we do pre_reset() before VF FLR, it would go KIQ way to do register access and stuck there, because KIQ probably won't work by that time (e.g. you already made GFX hang)
so the best way right now is to simply remove it.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -2
@@ -3466,8 +3466,6 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev,if (r)return r; -amdgpu_amdkfd_pre_reset (adev); -/* Resume IP prior to SMC */ r =amdgpu_device_ip_reinit_early_sriov (adev);if (r)
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 205/459 clk: qcom: smd: Add missing bimc clock
In reply to Sasha LevinFrom: Jeffrey Hugo <[email protected]>
[ Upstream commit 87ec9adcca71801a44ddb311185b17df09839ab5 ]
It turns out booting the modem is dependent on a bimc vote from Linux on msm8998. To make the modem happy, add the bimc clock to rely on the default vote from rpmcc. Once we have interconnect support, bimc should be controlled properly.
--- drivers/clk/qcom/clk-smd-rpm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/clk/qcom/clk-smd-rpm.c +3 -0
@@ -648,6 +648,7 @@ static const struct rpm_smd_clk_desc rpm_clk_qcs404 = { };/* msm8998 */ +DEFINE_CLK_SMD_RPM (msm8998, bimc_clk, bimc_a_clk,QCOM_SMD_RPM_MEM_CLK ,0 );DEFINE_CLK_SMD_RPM (msm8998, pcnoc_clk, pcnoc_a_clk,QCOM_SMD_RPM_BUS_CLK ,0 );DEFINE_CLK_SMD_RPM (msm8998, snoc_clk, snoc_a_clk,QCOM_SMD_RPM_BUS_CLK ,1 );DEFINE_CLK_SMD_RPM (msm8998, cnoc_clk, cnoc_a_clk,QCOM_SMD_RPM_BUS_CLK ,2 );
@@ -671,6 +672,8 @@ DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL(msm8998, rf_clk2_pin, rf_clk2_a_pin, 5);DEFINE_CLK_SMD_RPM_XO_BUFFER (msm8998, rf_clk3, rf_clk3_a,6 );DEFINE_CLK_SMD_RPM_XO_BUFFER_PINCTRL (msm8998, rf_clk3_pin, rf_clk3_a_pin,6 );static struct clk_smd_rpm *msm8998_clks[] = { + [RPM_SMD_BIMC_CLK ] = &msm8998_bimc_clk, + [RPM_SMD_BIMC_A_CLK ] = &msm8998_bimc_a_clk, [RPM_SMD_PCNOC_CLK ] = &msm8998_pcnoc_clk, [RPM_SMD_PCNOC_A_CLK ] = &msm8998_pcnoc_a_clk, [RPM_SMD_SNOC_CLK ] = &msm8998_snoc_clk,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 206/459 ACPICA: Disassembler: create buffer fields in ACPI_PARSE_LOAD_PASS1
In reply to Sasha LevinFrom: Erik Kaneda <[email protected]>
[ Upstream commit 5ddbd77181dfca61b16d2e2222382ea65637f1b9 ]
ACPICA commit 29cc8dbc5463a93625bed87d7550a8bed8913bf4
create_buffer_field is a deferred op that is typically processed in load pass 2. However, disassembly of control method contents walk the parse tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed in a later walk. This is a problem when there is a control method that has the same name as the AML_CREATE object. In this case, any use of the name segment will be detected as a method call rather than a reference to a buffer field. If this is detected as a method call, it can result in a mal-formed parse tree if the control methods have parameters.
This change in processing AML_CREATE ops earlier solves this issue by inserting the named object in the ACPI namespace so that references to this name would be detected as a name string rather than a method call.
--- drivers/acpi/acpica/dsfield.c | 2 +- drivers/acpi/acpica/dswload.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-)
drivers/acpi/acpica/dsfield.c +1 -1
@@ -244,7 +244,7 @@ acpi_ds_create_buffer_field(union acpi_parse_object *op,* FUNCTION: acpi_ds_get_field_names * * PARAMETERS: info - create_field info structure -* ` walk_state - Current method state +* walk_state - Current method state * arg - First parser arg for the field name list * * RETURN: Status
drivers/acpi/acpica/dswload.c +21 -0
@@ -410,6 +410,27 @@ acpi_status acpi_ds_load1_end_op(struct acpi_walk_state *walk_state)ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH ,"Op=%p State=%p\n" , op, walk_state)); +/* +* Disassembler: handle create field operators here. +* +* create_buffer_field is a deferred op that is typically processed in load +* pass 2. However, disassembly of control method contents walk the parse +* tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed +* in a later walk. This is a problem when there is a control method that +* has the same name as the AML_CREATE object. In this case, any use of the +* name segment will be detected as a method call rather than a reference +* to a buffer field. +* +* This earlier creation during disassembly solves this issue by inserting +* the named object in the ACPI namespace so that references to this name +* would be a name string rather than a method call. +*/ +if ((walk_state->parse_flags &ACPI_PARSE_DISASSEMBLE ) && + (walk_state->op_info->flags &AML_CREATE )) { + status =acpi_ds_create_buffer_field (op, walk_state); +return_ACPI_STATUS (status); + } +/* We are only interested in opcodes that have an associated name */ if (!(walk_state->op_info->flags & (AML_NAMED |AML_FIELD ))) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 207/459 nfsd: Clone should commit src file metadata too
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 57f64034966fb945fc958f95f0c51e47af590344 ]
vfs_clone_file_range() can modify the metadata on the source file too, so we need to commit that to stable storage as well.
--- fs/nfsd/vfs.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
fs/nfsd/vfs.c +14 -5
@@ -280,19 +280,25 @@ nfsd_lookup(struct svc_rqst *rqstp, struct svc_fh *fhp, const char *name,* Commit metadata changes to stable storage. */ static int -commit_metadata (struct svc_fh *fhp) +commit_inode_metadata (struct inode *inode) { -struct inode *inode =d_inode (fhp->fh_dentry);const struct export_operations *export_ops = inode->i_sb->s_export_op; -if (!EX_ISSYNC (fhp->fh_export)) -return 0 ; -if (export_ops->commit_metadata)return export_ops->commit_metadata (inode);return sync_inode_metadata (inode,1 ); } +static int +commit_metadata (struct svc_fh *fhp) +{ +struct inode *inode =d_inode (fhp->fh_dentry); + +if (!EX_ISSYNC (fhp->fh_export)) +return 0 ; +return commit_inode_metadata (inode); +} +/* * Go over the attributes and take care of the small differences between * NFS semantics and what Linux expects.
@@ -537,6 +543,9 @@ __be32 nfsd4_clone_file_range(struct file *src, u64 src_pos, struct file *dst,if (sync) {loff_t dst_end = count ? dst_pos + count -1 :LLONG_MAX ;int status =vfs_fsync_range (dst, dst_pos, dst_end,0 ); + +if (!status) + status =commit_inode_metadata (file_inode (src));if (status <0 )return nfserrno (status); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 208/459 scsi: ufs: Complete pending requests in host reset and restore path
In reply to Sasha LevinFrom: Can Guo <[email protected]>
[ Upstream commit 2df74b6985b51e77756e2e8faa16c45ca3ba53c5 ]
In UFS host reset and restore path, before probe, we stop and start the host controller once. After host controller is stopped, the pending requests, if any, are cleared from the doorbell, but no completion IRQ would be raised due to the hba is stopped. These pending requests shall be completed along with the first NOP_OUT command (as it is the first command which can raise a transfer completion IRQ) sent during probe. Since the OCSs of these pending requests are not SUCCESS (because they are not yet literally finished), their UPIUs shall be dumped. When there are multiple pending requests, the UPIU dump can be overwhelming and may lead to stability issues because it is in atomic context. Therefore, before probe, complete these pending requests right after host controller is stopped and silence the UPIU dump from them.
--- drivers/scsi/ufs/ufshcd.c | 24 ++++++++++-------------- drivers/scsi/ufs/ufshcd.h | 2 ++ 2 files changed, 12 insertions(+), 14 deletions(-)
drivers/scsi/ufs/ufshcd.c +10 -14
@@ -4788,7 +4788,7 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)break ; }/* end of switch */ -if (host_byte (result) !=DID_OK ) +if ((host_byte (result) !=DID_OK ) && !hba->silence_err_logs)ufshcd_print_trs (hba,1 << lrbp->task_tag, true);return result; }
@@ -5321,8 +5321,8 @@ static void ufshcd_err_handler(struct work_struct *work)/* * if host reset is required then skip clearing the pending -* transfers forcefully because they will automatically get -* cleared after link startup. +* transfers forcefully because they will get cleared during +* host reset and restore */ if (needs_reset) goto skip_pending_xfer_clear;
@@ -6205,9 +6205,15 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)int err;unsigned long flags; -/* Reset the host controller */ +/* +* Stop the host controller and complete the requests +* cleared by h/w +*/ spin_lock_irqsave (hba->host->host_lock, flags);ufshcd_hba_stop (hba, false); + hba->silence_err_logs = true; +ufshcd_complete_requests (hba); + hba->silence_err_logs = false;spin_unlock_irqrestore (hba->host->host_lock, flags);/* scale up clocks to max frequency before full reinitialization */
@@ -6241,7 +6247,6 @@ static int ufshcd_host_reset_and_restore(struct ufs_hba *hba)static int ufshcd_reset_and_restore (struct ufs_hba *hba) {int err =0 ; -unsigned long flags;int retries =MAX_HOST_RESET_RETRIES ; do {
@@ -6251,15 +6256,6 @@ static int ufshcd_reset_and_restore(struct ufs_hba *hba) err =ufshcd_host_reset_and_restore (hba); }while (err && --retries); -/* -* After reset the door-bell might be cleared, complete -* outstanding requests in s/w here. -*/ -spin_lock_irqsave (hba->host->host_lock, flags); -ufshcd_transfer_req_compl (hba); -ufshcd_tmc_handler (hba); -spin_unlock_irqrestore (hba->host->host_lock, flags); -return err; }
drivers/scsi/ufs/ufshcd.h +2 -0
@@ -513,6 +513,7 @@ struct ufs_stats {* @uic_error: UFS interconnect layer error status * @saved_err: sticky error mask * @saved_uic_err: sticky UIC error mask +* @silence_err_logs: flag to silence error logs * @dev_cmd: ufs device management command information * @last_dme_cmd_tstamp: time stamp of the last completed DME command * @auto_bkops_enabled: to track whether bkops is enabled in device
@@ -670,6 +671,7 @@ struct ufs_hba {u32 saved_err;u32 saved_uic_err;struct ufs_stats ufs_stats; +bool silence_err_logs;/* Device management request data */ struct ufs_dev_cmd dev_cmd;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 209/459 scsi: ibmvscsi_tgt: remove set but not used variables 'iue' and 'sd'
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit 4aca8fe7716669e39f7857b2e1fc5dfd4475b7e5 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function ibmvscsis_send_messages:drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:1888:19: warning: variable iue set but not used [-Wunused-but-set-variable] drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c: In function ibmvscsis_queue_data_in:drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c:3806:8: warning: variable sd set but not used [-Wunused-but-set-variable]
--- drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c +0 -5
@@ -1877,7 +1877,6 @@ static void ibmvscsis_send_messages(struct scsi_info *vscsi)*/ struct viosrp_crq *crq = (struct viosrp_crq *)&msg_hi;struct ibmvscsis_cmd *cmd, *nxt; -struct iu_entry *iue;long rc =ADAPT_SUCCESS ;bool retry = false;
@@ -1931,8 +1930,6 @@ static void ibmvscsis_send_messages(struct scsi_info *vscsi)*/ vscsi->credit +=1 ; }else { - iue = cmd->iue; - crq->valid =VALID_CMD_RESP_EL ; crq->format = cmd->rsp.format;
@@ -3797,7 +3794,6 @@ static int ibmvscsis_queue_data_in(struct se_cmd *se_cmd) se_cmd);struct iu_entry *iue = cmd->iue;struct scsi_info *vscsi = cmd->adapter; -char *sd;uint len =0 ;int rc;
@@ -3805,7 +3801,6 @@ static int ibmvscsis_queue_data_in(struct se_cmd *se_cmd) 1);if (rc) {dev_err (&vscsi->dev,"srp_transfer_data failed: %d\n" , rc); - sd = se_cmd->sense_buffer; se_cmd->scsi_sense_length =18 ;memset (se_cmd->sense_buffer,0 , se_cmd->scsi_sense_length);/* Logical Unit Communication Time-out asc/ascq = 0x0801 */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 210/459 scsi: aic7xxx: Adjust indentation in ahc_find_syncrate
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 4dbc96ad65c45cdd4e895ed7ae4c151b780790c5 ]
Clang warns:
../drivers/scsi/aic7xxx/aic7xxx_core.c:2317:5: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if ((syncrate->sxfr_u2 & ST_SXFR) != 0)
^
../drivers/scsi/aic7xxx/aic7xxx_core.c:2310:4: note: previous statement
is here
if (syncrate == &ahc_syncrates[maxsync])
^1 warning generated.
This warning occurs because there is a space amongst the tabs on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.
This has been a problem since the beginning of git history hence no fixes tag.
--- drivers/scsi/aic7xxx/aic7xxx_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/aic7xxx/aic7xxx_core.c +1 -1
@@ -2314,7 +2314,7 @@ ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,* At some speeds, we only support * ST transfers. */ -if ((syncrate->sxfr_u2 &ST_SXFR ) !=0 ) +if ((syncrate->sxfr_u2 &ST_SXFR ) !=0 ) *ppr_options &= ~MSG_EXT_PPR_DT_REQ ;break ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 211/459 crypto: inside-secure - add unspecified HAS_IOMEM dependency
In reply to Sasha LevinFrom: Brendan Higgins <[email protected]>
[ Upstream commit 6dc0e310623fdcb27a1486eb436f0118c45e95a5 ]
Currently CONFIG_CRYPTO_DEV_SAFEXCEL=y implicitly depends on CONFIG_HAS_IOMEM=y; consequently, on architectures without IOMEM we get the following build error:
ld: drivers/crypto/inside-secure/safexcel.o: in function `safexcel_probe':drivers/crypto/inside-secure/safexcel.c:1692: undefined reference to `devm_platform_ioremap_resource'
Fix the build error by adding the unspecified dependency.
--- drivers/crypto/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/Kconfig +1 -1
@@ -739,7 +739,7 @@ source "drivers/crypto/stm32/Kconfig" config CRYPTO_DEV_SAFEXCEL tristate "Inside Secure's SafeXcel cryptographic engine driver" - depends on OF || PCI || COMPILE_TEST + depends on (OF || PCI || COMPILE_TEST) && HAS_IOMEM select CRYPTO_LIB_AES select CRYPTO_AUTHENC select CRYPTO_BLKCIPHER
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 212/459 drm/mediatek: handle events when enabling/disabling crtc
In reply to Sasha LevinFrom: Bibby Hsieh <[email protected]>
[ Upstream commit 411f5c1eacfebb1f6e40b653d29447cdfe7282aa ]
The driver currently handles vblank events only when updating planes on an already enabled CRTC. The atomic update API however allows requesting an event when enabling or disabling a CRTC. This currently leads to event objects being leaked in the kernel and to events not being sent out. Fix it.
--- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +8 -0
@@ -298,6 +298,7 @@ static int mtk_crtc_ddp_hw_init(struct mtk_drm_crtc *mtk_crtc)static void mtk_crtc_ddp_hw_fini (struct mtk_drm_crtc *mtk_crtc) {struct drm_device *drm = mtk_crtc->base.dev; +struct drm_crtc *crtc = &mtk_crtc->base;int i;DRM_DEBUG_DRIVER ("%s\n" , __func__);
@@ -319,6 +320,13 @@ static void mtk_crtc_ddp_hw_fini(struct mtk_drm_crtc *mtk_crtc)mtk_disp_mutex_unprepare (mtk_crtc->mutex);pm_runtime_put (drm->dev); + +if (crtc->state->event && !crtc->state->active) { +spin_lock_irq (&crtc->dev->event_lock); +drm_crtc_send_vblank_event (crtc, crtc->state->event); + crtc->state->event =NULL ; +spin_unlock_irq (&crtc->dev->event_lock); + } }static void mtk_crtc_ddp_config (struct drm_crtc *crtc)
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 213/459 clk: renesas: rcar-gen3: Allow changing the RPC[D2] clocks
In reply to Sasha LevinFrom: Sergei Shtylyov <[email protected]>
[ Upstream commit 0d67c0340a60829c5c1b7d09629d23bbd67696f3 ]
I was unable to get clk_set_rate() setting a lower RPC-IF clock frequency and that issue boiled down to me not passing CLK_SET_RATE_PARENT flag to clk_register_composite() when registering the RPC[D2] clocks...
--- drivers/clk/renesas/rcar-gen3-cpg.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/clk/renesas/rcar-gen3-cpg.c +4 -2
@@ -464,7 +464,8 @@ static struct clk * __init cpg_rpc_clk_register(const char *name, clk =clk_register_composite (NULL , name, &parent_name,1 ,NULL ,NULL , &rpc->div.hw, &clk_divider_ops, - &rpc->gate.hw, &clk_gate_ops,0 ); + &rpc->gate.hw, &clk_gate_ops, +CLK_SET_RATE_PARENT );if (IS_ERR (clk)) {kfree (rpc);return clk;
@@ -500,7 +501,8 @@ static struct clk * __init cpg_rpcd2_clk_register(const char *name, clk =clk_register_composite (NULL , name, &parent_name,1 ,NULL ,NULL , &rpcd2->fixed.hw, &clk_fixed_factor_ops, - &rpcd2->gate.hw, &clk_gate_ops,0 ); + &rpcd2->gate.hw, &clk_gate_ops, +CLK_SET_RATE_PARENT );if (IS_ERR (clk))kfree (rpcd2);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 214/459 ARM: dts: r8a7779: Add device node for ARM global timer
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 8443ffd1bbd5be74e9b12db234746d12e8ea93e2 ]
Add a device node for the global timer, which is part of the Cortex-A9 MPCore.
The global timer can serve as an accurate (4 ns) clock source for scheduling and delay loops.
--- arch/arm/boot/dts/r8a7779.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/r8a7779.dtsi +8 -0
@@ -68,6 +68,14 @@ <0xf0000100 0x100>; }; + timer@f0000200 { + compatible = "arm,cortex-a9-global-timer"; + reg = <0xf0000200 0x100>; + interrupts = <GIC_PPI 11 + (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_EDGE_RISING)>; + clocks = <&cpg_clocks R8A7779_CLK_ZS>; + }; + timer@f0000600 { compatible = "arm,cortex-a9-twd-timer"; reg = <0xf0000600 0x20>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 215/459 arm64: dts: renesas: r8a77990: ebisu: Remove clkout-lr-synchronous from sound
In reply to Sasha LevinFrom: Kuninori Morimoto <[email protected]>
[ Upstream commit bf2b74ce9b33a2edd6ba1930ce60a71830790910 ]
rcar_sound doesn't support clkout-lr-synchronous in upstream. It was supported under out-of-tree rcar_sound. upstream rcar_sound is supporting
- clkout-lr-synchronous
+ clkout-lr-asynchronous
--- arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts | 1 - 1 file changed, 1 deletion(-)
arch/arm64/boot/dts/renesas/r8a77990-ebisu.dts +0 -1
@@ -636,7 +636,6 @@ /* audio_clkout0/1/2/3 */ #clock-cells = <1>; clock-frequency = <12288000 11289600>; - clkout-lr-synchronous; status = "okay";
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 216/459 selinux: ensure we cleanup the internal AVC counters on error in avc_update()
In reply to Sasha LevinFrom: Jaihind Yadav <[email protected]>
[ Upstream commit 030b995ad9ece9fa2d218af4429c1c78c2342096 ]
In AVC update we don't call avc_node_kill() when avc_xperms_populate() fails, resulting in the avc->avc_cache.active_nodes counter having a false value. In last patch this changes was missed , so correcting it.
--- security/selinux/avc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
security/selinux/avc.c +1 -1
@@ -891,7 +891,7 @@ static int avc_update_node(struct selinux_avc *avc,if (orig->ae.xp_node) { rc =avc_xperms_populate (node, orig->ae.xp_node);if (rc) { -kmem_cache_free (avc_node_cachep, node); +avc_node_kill (avc, node); goto out_unlock; } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 217/459 scsi: lpfc: Fix: Rework setting of fdmi symbolic node name registration
In reply to Sasha LevinFrom: James Smart <[email protected]>
[ Upstream commit df9166bfa7750bade5737ffc91fbd432e0354442 ]
This patch reworks the fdmi symbolic node name data for the following two issues:
- Correcting extraneous periods following the DV and HN fdmi data fields.
- Avoiding buffer overflow issues when formatting the data.
The fix to the fist issue is to just remove the characters.
The fix to the second issue has all data being staged in temporary storage before being moved to the real buffer.
--- drivers/scsi/lpfc/lpfc_ct.c | 42 +++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 20 deletions(-)
drivers/scsi/lpfc/lpfc_ct.c +22 -20
@@ -1477,33 +1477,35 @@ int lpfc_vport_symbolic_node_name(struct lpfc_vport *vport, char *symbol, size_t size) { - char fwrev[FW_REV_STR_SIZE]; -int n; + char fwrev[FW_REV_STR_SIZE] = {0}; +char tmp[MAXHOSTNAMELEN ] = {0 }; -lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); +memset (symbol,0 , size); - n =scnprintf (symbol, size,"Emulex %s" , vport->phba->ModelName); -if (size < n) -return n; +scnprintf (tmp,sizeof (tmp),"Emulex %s" , vport->phba->ModelName); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done; - n +=scnprintf (symbol + n, size - n," FV%s" , fwrev); -if (size < n) -return n; +lpfc_decode_firmware_rev (vport->phba, fwrev,0 ); +scnprintf (tmp,sizeof (tmp)," FV%s" , fwrev); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done; - n +=scnprintf (symbol + n, size - n," DV%s." , - lpfc_release_version); -if (size < n) -return n; +scnprintf (tmp,sizeof (tmp)," DV%s" , lpfc_release_version); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done; - n +=scnprintf (symbol + n, size - n," HN:%s." , -init_utsname ()->nodename); -if (size < n) -return n; +scnprintf (tmp,sizeof (tmp)," HN:%s" ,init_utsname ()->nodename); +if (strlcat (symbol, tmp, size) >= size) + goto buffer_done;/* Note :- OS name is "Linux" */ - n +=scnprintf (symbol + n, size - n," OS:%s" , -init_utsname ()->sysname); -return n; +scnprintf (tmp,sizeof (tmp)," OS:%s" ,init_utsname ()->sysname); +strlcat (symbol, tmp, size); + +buffer_done: +return strnlen (symbol, size); + } static uint32_t
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 218/459 arm64: dts: qcom: db845c: Enable ath10k 8bit host-cap quirk
In reply to Sasha LevinFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 2e198c395a084ff3015d71896e35de049c40e3a4 ]
The WiFi firmware used on db845c implements the 8bit host-capability message, so enable the quirk for this.
--- arch/arm64/boot/dts/qcom/sdm845-db845c.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/sdm845-db845c.dts +2 -0
@@ -517,6 +517,8 @@ vdd-1.8-xo-supply = <&vreg_l7a_1p8>; vdd-1.3-rfa-supply = <&vreg_l17a_1p3>; vdd-3.3-ch0-supply = <&vreg_l25a_3p3>; + + qcom,snoc-host-cap-8bit-quirk; }; /* PINCTRL - additions to nodes defined in sdm845.dtsi */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 219/459 rtc: hym8563: Return -EINVAL if the time is known to be invalid
In reply to Sasha LevinFrom: Paul Kocialkowski <[email protected]>
[ Upstream commit f236a2a2ebabad0848ad0995af7ad1dc7029e895 ]
The current code returns -EPERM when the voltage loss bit is set. Since the bit indicates that the time value is not valid, return -EINVAL instead, which is the appropriate error code for this situation.
--- drivers/rtc/rtc-hym8563.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-hym8563.c +1 -1
@@ -97,7 +97,7 @@ static int hym8563_rtc_read_time(struct device *dev, struct rtc_time *tm)if (!hym8563->valid) {dev_warn (&client->dev,"no valid clock/calendar values available\n" ); -return -EPERM ; +return -EINVAL ; } ret =i2c_smbus_read_i2c_block_data (client,HYM8563_SEC ,7 , buf);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 220/459 iommu/amd: Check feature support bit before accessing MSI capability registers
In reply to Sasha LevinFrom: Suravee Suthikulpanit <[email protected]>
[ Upstream commit 813071438e83d338ba5cfe98b3b26c890dc0a6c0 ]
The IOMMU MMIO access to MSI capability registers is available only if the EFR[MsiCapMmioSup] is set. Current implementation assumes this bit is set if the EFR[XtSup] is set, which might not be the case.
Fix by checking the EFR[MsiCapMmioSup] before accessing the MSI address low/high and MSI data registers via the MMIO.
--- drivers/iommu/amd_iommu_init.c | 17 ++++++++++++----- drivers/iommu/amd_iommu_types.h | 1 + 2 files changed, 13 insertions(+), 5 deletions(-)
drivers/iommu/amd_iommu_init.c +12 -5
@@ -147,7 +147,7 @@ bool amd_iommu_dump;bool amd_iommu_irq_remap__read_mostly ;int amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_VAPIC ; -static int amd_iommu_xt_mode =IRQ_REMAP_X2APIC_MODE ; +static int amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ;static bool amd_iommu_detected;static bool __initdata amd_iommu_disabled;
@@ -1534,8 +1534,15 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) iommu->mmio_phys_end =MMIO_CNTR_CONF_OFFSET ;if (((h->efr_reg & (0x1 <<IOMMU_EFR_GASUP_SHIFT )) ==0 )) amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_LEGACY ; -if (((h->efr_reg & (0x1 <<IOMMU_EFR_XTSUP_SHIFT )) ==0 )) - amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ; +/* +* Note: Since iommu_update_intcapxt() leverages +* the IOMMU MMIO access to MSI capability block registers +* for MSI address lo/hi/data, we need to check both +* EFR[XtSup] and EFR[MsiCapMmioSup] for x2APIC support. +*/ +if ((h->efr_reg &BIT (IOMMU_EFR_XTSUP_SHIFT )) && + (h->efr_reg &BIT (IOMMU_EFR_MSICAPMMIOSUP_SHIFT ))) + amd_iommu_xt_mode =IRQ_REMAP_X2APIC_MODE ;break ;default :return -EINVAL ;
@@ -1996,8 +2003,8 @@ static int iommu_init_intcapxt(struct amd_iommu *iommu)struct irq_affinity_notify *notify = &iommu->intcapxt_notify;/** -* IntCapXT requires XTSup=1, which can be inferred -* amd_iommu_xt_mode. +* IntCapXT requires XTSup=1 and MsiCapMmioSup=1, +* which can be inferred from amd_iommu_xt_mode. */ if (amd_iommu_xt_mode !=IRQ_REMAP_X2APIC_MODE )return 0 ;
drivers/iommu/amd_iommu_types.h +1 -0
@@ -383,6 +383,7 @@/* IOMMU Extended Feature Register (EFR) */ #define IOMMU_EFR_XTSUP_SHIFT 2#define IOMMU_EFR_GASUP_SHIFT 7 +#define IOMMU_EFR_MSICAPMMIOSUP_SHIFT 46#define MAX_DOMAIN_ID 65536
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 221/459 iommu/amd: Only support x2APIC with IVHD type 11h/40h
In reply to Sasha LevinFrom: Suravee Suthikulpanit <[email protected]>
[ Upstream commit 966b753cf3969553ca50bacd2b8c4ddade5ecc9e ]
Current implementation for IOMMU x2APIC support makes use of the MMIO access to MSI capability block registers, which requires checking EFR[MsiCapMmioSup]. However, only IVHD type 11h/40h contain the information, and not in the IVHD type 10h IOMMU feature reporting field. Since the BIOS in newer systems, which supports x2APIC, would normally contain IVHD type 11h/40h, remove the IOMMU_FEAT_XTSUP_SHIFT check for IVHD type 10h, and only support x2APIC with IVHD type 11h/40h.
--- drivers/iommu/amd_iommu_init.c | 2 -- drivers/iommu/amd_iommu_types.h | 1 - 2 files changed, 3 deletions(-)
drivers/iommu/amd_iommu_init.c +0 -2
@@ -1523,8 +1523,6 @@ static int __init init_iommu_one(struct amd_iommu *iommu, struct ivhd_header *h) iommu->mmio_phys_end =MMIO_CNTR_CONF_OFFSET ;if (((h->efr_attr & (0x1 <<IOMMU_FEAT_GASUP_SHIFT )) ==0 )) amd_iommu_guest_ir =AMD_IOMMU_GUEST_IR_LEGACY ; -if (((h->efr_attr & (0x1 <<IOMMU_FEAT_XTSUP_SHIFT )) ==0 )) - amd_iommu_xt_mode =IRQ_REMAP_XAPIC_MODE ;break ;case 0x11 :case 0x40 :
drivers/iommu/amd_iommu_types.h +0 -1
@@ -377,7 +377,6 @@#define IOMMU_CAP_EFR 27/* IOMMU Feature Reporting Field (for IVHD type 10h */ -#define IOMMU_FEAT_XTSUP_SHIFT 0#define IOMMU_FEAT_GASUP_SHIFT 6/* IOMMU Extended Feature Register (EFR) */
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 222/459 iommu/iova: Silence warnings under memory pressure
In reply to Sasha LevinFrom: Qian Cai <[email protected]>
[ Upstream commit 944c9175397476199d4dd1028d87ddc582c35ee8 ]
When running heavy memory pressure workloads, this 5+ old system is throwing endless warnings below because disk IO is too slow to recover from swapping. Since the volume from alloc_iova_fast() could be large, once it calls printk(), it will trigger disk IO (writing to the log files) and pending softirqs which could cause an infinite loop and make no progress for days by the ongoimng memory reclaim. This is the counter part for Intel where the AMD part has already been merged. See the commit 3d708895325b ("iommu/amd: Silence warnings under memory pressure"). Since the allocation failure will be reported in intel_alloc_iova(), so just call dev_err_once() there because even the "ratelimited" is too much, and silence the one in alloc_iova_mem() to avoid the expensive warn_alloc().
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
slab_out_of_memory: 66 callbacks suppressed
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: iommu_iova, object size: 40, buffer size: 448, default order:
0, min order: 0
node 0: slabs: 1822, objs: 16398, free: 0
node 1: slabs: 2051, objs: 18459, free: 31
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: iommu_iova, object size: 40, buffer size: 448, default order:
0, min order: 0
node 0: slabs: 1822, objs: 16398, free: 0
node 1: slabs: 2051, objs: 18459, free: 31
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: iommu_iova, object size: 40, buffer size: 448, default order:
0, min order: 0
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
node 0: slabs: 697, objs: 4182, free: 0
node 0: slabs: 697, objs: 4182, free: 0
node 0: slabs: 697, objs: 4182, free: 0
node 0: slabs: 697, objs: 4182, free: 0
node 1: slabs: 381, objs: 2286, free: 27
node 1: slabs: 381, objs: 2286, free: 27
node 1: slabs: 381, objs: 2286, free: 27
node 1: slabs: 381, objs: 2286, free: 27
node 0: slabs: 1822, objs: 16398, free: 0
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
node 1: slabs: 2051, objs: 18459, free: 31
node 0: slabs: 697, objs: 4182, free: 0
SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
node 1: slabs: 381, objs: 2286, free: 27
cache: skbuff_head_cache, object size: 208, buffer size: 640, default
order: 0, min order: 0
node 0: slabs: 697, objs: 4182, free: 0
node 1: slabs: 381, objs: 2286, free: 27
hpsa 0000:03:00.0: DMAR: Allocating 1-page iova failed
warn_alloc: 96 callbacks suppressed
kworker/11:1H: page allocation failure: order:0,
mode:0xa20(GFP_ATOMIC), nodemask=(null),cpuset=/,mems_allowed=0-1
CPU: 11 PID: 1642 Comm: kworker/11:1H Tainted: G B Hardware name: HP ProLiant XL420 Gen9/ProLiant XL420 Gen9, BIOS U19 12/27/2015 Workqueue: kblockd blk_mq_run_work_fn Call Trace: dump_stack+0xa0/0xea warn_alloc.cold.94+0x8a/0x12d __alloc_pages_slowpath+0x1750/0x1870 __alloc_pages_nodemask+0x58a/0x710 alloc_pages_current+0x9c/0x110 alloc_slab_page+0xc9/0x760 allocate_slab+0x48f/0x5d0 new_slab+0x46/0x70 ___slab_alloc+0x4ab/0x7b0 __slab_alloc+0x43/0x70 kmem_cache_alloc+0x2dd/0x450 SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC) alloc_iova+0x33/0x210 cache: skbuff_head_cache, object size: 208, buffer size: 640, default order: 0, min order: 0 node 0: slabs: 697, objs: 4182, free: 0 alloc_iova_fast+0x62/0x3d1 node 1: slabs: 381, objs: 2286, free: 27 intel_alloc_iova+0xce/0xe0 intel_map_sg+0xed/0x410 scsi_dma_map+0xd7/0x160 scsi_queue_rq+0xbf7/0x1310 blk_mq_dispatch_rq_list+0x4d9/0xbc0 blk_mq_sched_dispatch_requests+0x24a/0x300 __blk_mq_run_hw_queue+0x156/0x230 blk_mq_run_work_fn+0x3b/0x40 process_one_work+0x579/0xb90 worker_thread+0x63/0x5b0 kthread+0x1e6/0x210 ret_from_fork+0x3a/0x50 Mem-Info: active_anon:2422723 inactive_anon:361971 isolated_anon:34403 active_file:2285 inactive_file:1838 isolated_file:0 unevictable:0 dirty:1 writeback:5 unstable:0 slab_reclaimable:13972 slab_unreclaimable:453879 mapped:2380 shmem:154 pagetables:6948 bounce:0 free:19133 free_pcp:7363 free_cma:0
--- drivers/iommu/intel-iommu.c | 3 ++- drivers/iommu/iova.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/iommu/intel-iommu.c +2 -1
@@ -3401,7 +3401,8 @@ static unsigned long intel_alloc_iova(struct device *dev, iova_pfn =alloc_iova_fast (&domain->iovad, nrpages,IOVA_PFN (dma_mask), true);if (unlikely (!iova_pfn)) { -dev_err (dev,"Allocating %ld-page iova failed" , nrpages); +dev_err_once (dev,"Allocating %ld-page iova failed\n" , + nrpages);return 0 ; }
drivers/iommu/iova.c +1 -1
@@ -233,7 +233,7 @@ static DEFINE_MUTEX(iova_cache_mutex);struct iova *alloc_iova_mem (void ) { -return kmem_cache_zalloc (iova_cache,GFP_ATOMIC ); +return kmem_cache_zalloc (iova_cache,GFP_ATOMIC | __GFP_NOWARN); }EXPORT_SYMBOL (alloc_iova_mem);
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 223/459 clk: actually call the clock init before any other callback of the clock
In reply to Sasha LevinFrom: Jerome Brunet <[email protected]>
[ Upstream commit f6fa75ca912be6021335de63a32aa4d295f3c524 ]
__clk_init_parent() will call the .get_parent() callback of the clock so .init() must run before.
--- drivers/clk/clk.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-)
drivers/clk/clk.c +15 -11
@@ -3320,6 +3320,21 @@ static int __clk_core_init(struct clk_core *core) goto out; } +/* +* optional platform-specific magic +* +* The .init callback is not used by any of the basic clock types, but +* exists for weird hardware that must perform initialization magic. +* Please consider other ways of solving initialization problems before +* using this callback, as its use is discouraged. +* +* If it exist, this callback should called before any other callback of +* the clock +*/ +if (core->ops->init) + core->ops->init (core->hw); + + core->parent =__clk_init_parent (core);/*
@@ -3344,17 +3359,6 @@ static int __clk_core_init(struct clk_core *core) core->orphan = true; } -/* -* optional platform-specific magic -* -* The .init callback is not used by any of the basic clock types, but -* exists for weird hardware that must perform initialization magic. -* Please consider other ways of solving initialization problems before -* using this callback, as its use is discouraged. -*/ -if (core->ops->init) - core->ops->init (core->hw); -/* * Set clk's accuracy. The preferred method is to use * .recalc_accuracy. For simple clocks and lazy developers the default
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 224/459 dmaengine: Store module owner in dma_device struct
In reply to Sasha LevinFrom: Logan Gunthorpe <[email protected]>
[ Upstream commit dae7a589c18a4d979d5f14b09374e871b995ceb1 ]
dma_chan_to_owner() dereferences the driver from the struct device to obtain the owner and call module_[get|put](). However, if the backing device is unbound before the dma_device is unregistered, the driver will be cleared and this will cause a NULL pointer dereference.
Instead, store a pointer to the owner module in the dma_device struct so the module reference can be properly put when the channel is put, even if the backing device was destroyed first.
This change helps to support a safer unbind of DMA engines. If the dma_device is unregistered in the driver's remove function, there's no guarantee that there are no existing clients and a users action may trigger the WARN_ONCE in dma_async_device_unregister() which is unlikely to leave the system in a consistent state. Instead, a better approach is to allow the backing driver to go away and fail any subsequent requests to it.
--- drivers/dma/dmaengine.c | 4 +++- include/linux/dmaengine.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/dma/dmaengine.c +3 -1
@@ -179,7 +179,7 @@ __dma_device_satisfies_mask(struct dma_device *device,static struct module *dma_chan_to_owner (struct dma_chan *chan) { -return chan->device->dev->driver->owner; +return chan->device->owner; }/**
@@ -919,6 +919,8 @@ int dma_async_device_register(struct dma_device *device)return -EIO ; } + device->owner = device->dev->driver->owner; +if (dma_has_cap (DMA_MEMCPY , device->cap_mask) && !device->device_prep_dma_memcpy) { dev_err(device->dev, "Device claims capability %s, but op is not defined\n",
include/linux/dmaengine.h +2 -0
@@ -674,6 +674,7 @@ struct dma_filter {* @fill_align: alignment shift for memset operations * @dev_id: unique device ID * @dev: struct device reference for dma mapping api +* @owner: owner module (automatically set based on the provided dev) * @src_addr_widths: bit mask of src addr widths the device supports * Width is specified in bytes, e.g. for a device supporting * a width of 4 the mask should have BIT(4) set.
@@ -737,6 +738,7 @@ struct dma_device {int dev_id;struct device *dev; +struct module *owner;u32 src_addr_widths;u32 dst_addr_widths;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 225/459 ASoC: Intel: kbl_da7219_max98357a: remove unused variable 'constraints_16000' and 'ch_mono'
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit c5614fb8e3d13be7bba79f71b798468a3a6224f7 ]
sound/soc/intel/boards/kbl_da7219_max98357a.c:343:48:
warning: constraints_16000 defined but not used [-Wunused-const-variable=]sound/soc/intel/boards/kbl_da7219_max98357a.c:348:27:
warning: ch_mono defined but not used [-Wunused-const-variable=]
They are never used, so can be removed.
--- sound/soc/intel/boards/kbl_da7219_max98357a.c | 13 ------------- 1 file changed, 13 deletions(-)
sound/soc/intel/boards/kbl_da7219_max98357a.c +0 -13
@@ -336,19 +336,6 @@ static struct snd_soc_ops kabylake_dmic_ops = { .startup = kabylake_dmic_startup, }; -static const unsigned int rates_16000[] = { -16000 , -}; - -static const struct snd_pcm_hw_constraint_list constraints_16000 = { - .count =ARRAY_SIZE (rates_16000), - .list = rates_16000, -}; - -static const unsigned int ch_mono[] = { -1 , -}; -SND_SOC_DAILINK_DEF (dummy,DAILINK_COMP_ARRAY (COMP_DUMMY ()));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 226/459 dmaengine: imx-sdma: Fix memory leak
In reply to Sasha LevinFrom: Sascha Hauer <[email protected]>
[ Upstream commit 02939cd167095f16328a1bd5cab5a90b550606df ]
The current descriptor is not on any list of the virtual DMA channel. Once sdma_terminate_all() is called when a descriptor is currently in flight then this one is forgotten to be freed. We have to call vchan_terminate_vdesc() on this descriptor to re-add it to the lists. Now that we also free the currently running descriptor we can (and actually have to) remove the current descriptor from its list also for the cyclic case.
--- drivers/dma/imx-sdma.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/dma/imx-sdma.c +11 -8
@@ -760,12 +760,8 @@ static void sdma_start_desc(struct sdma_channel *sdmac)return ; } sdmac->desc = desc =to_sdma_desc (&vd->tx); -/* -* Do not delete the node in desc_issued list in cyclic mode, otherwise -* the desc allocated will never be freed in vchan_dma_desc_free_list -*/ -if (!(sdmac->flags &IMX_DMA_SG_LOOP )) -list_del (&vd->node); + +list_del (&vd->node); sdma->channel_control[channel].base_bd_ptr = desc->bd_phys; sdma->channel_control[channel].current_bd_ptr = desc->bd_phys;
@@ -1071,7 +1067,6 @@ static void sdma_channel_terminate_work(struct work_struct *work)spin_lock_irqsave (&sdmac->vc.lock, flags);vchan_get_all_descriptors (&sdmac->vc, &head); - sdmac->desc =NULL ;spin_unlock_irqrestore (&sdmac->vc.lock, flags);vchan_dma_desc_free_list (&sdmac->vc, &head); sdmac->context_loaded = false;
@@ -1080,11 +1075,19 @@ static void sdma_channel_terminate_work(struct work_struct *work)static int sdma_disable_channel_async (struct dma_chan *chan) {struct sdma_channel *sdmac =to_sdma_chan (chan); +unsigned long flags; + +spin_lock_irqsave (&sdmac->vc.lock, flags);sdma_disable_channel (chan); -if (sdmac->desc) +if (sdmac->desc) { +vchan_terminate_vdesc (&sdmac->desc->vd); + sdmac->desc =NULL ;schedule_work (&sdmac->terminate_worker); + } + +spin_unlock_irqrestore (&sdmac->vc.lock, flags);return 0 ; }
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 227/459 bpf: Print error message for bpftool cgroup show
In reply to Sasha LevinFrom: Hechao Li <[email protected]>
[ Upstream commit 1162f844030ac1ac7321b5e8f6c9badc7a11428f ]
Currently, when bpftool cgroup show <path> has an error, no error message is printed. This is confusing because the user may think the result is empty.
Before the change:
$ bpftool cgroup show /sys/fs/cgroup ID AttachType AttachFlags Name $ echo $? 255
After the change:
$ ./bpftool cgroup show /sys/fs/cgroup Error: can't query bpf programs attached to /sys/fs/cgroup: Operation not permitted
v2: Rename check_query_cgroup_progs to cgroup_has_attached_progs
--- tools/bpf/bpftool/cgroup.c | 56 ++++++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 17 deletions(-)
tools/bpf/bpftool/cgroup.c +39 -17
@@ -117,6 +117,25 @@ static int count_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type)return prog_cnt; } +static int cgroup_has_attached_progs (int cgroup_fd) +{ +enum bpf_attach_type type; +bool no_prog = true; + +for (type =0 ; type < __MAX_BPF_ATTACH_TYPE; type++) { +int count =count_attached_bpf_progs (cgroup_fd, type); + +if (count <0 && errno !=EINVAL ) +return -1 ; + +if (count >0 ) { + no_prog = false; +break ; + } + } + +return no_prog ?0 :1 ; +}static int show_attached_bpf_progs (int cgroup_fd,enum bpf_attach_type type,int level) {
@@ -161,6 +180,7 @@ static int show_attached_bpf_progs(int cgroup_fd, enum bpf_attach_type type,static int do_show (int argc,char **argv) {enum bpf_attach_type type; +int has_attached_progs;const char *path;int cgroup_fd;int ret =-1 ;
@@ -192,6 +212,16 @@ static int do_show(int argc, char **argv) goto exit; } + has_attached_progs =cgroup_has_attached_progs (cgroup_fd); +if (has_attached_progs <0 ) { +p_err ("can't query bpf programs attached to %s: %s" , + path,strerror (errno)); + goto exit_cgroup; + }else if (!has_attached_progs) { + ret =0 ; + goto exit_cgroup; + } +if (json_output)jsonw_start_array (json_wtr);else
@@ -212,6 +242,7 @@ static int do_show(int argc, char **argv)if (json_output)jsonw_end_array (json_wtr); +exit_cgroup:close (cgroup_fd); exit:return ret;
@@ -228,7 +259,7 @@ static int do_show_tree_fn(const char *fpath, const struct stat *sb, int typeflag, struct FTW *ftw) { enum bpf_attach_type type; -bool skip = true; +int has_attached_progs;int cgroup_fd;if (typeflag !=FTW_D )
@@ -240,22 +271,13 @@ static int do_show_tree_fn(const char *fpath, const struct stat *sb,return SHOW_TREE_FN_ERR ; } -for (type =0 ; type < __MAX_BPF_ATTACH_TYPE; type++) { -int count =count_attached_bpf_progs (cgroup_fd, type); - -if (count <0 && errno !=EINVAL ) { -p_err ("can't query bpf programs attached to %s: %s" , - fpath,strerror (errno)); -close (cgroup_fd); -return SHOW_TREE_FN_ERR ; - } -if (count >0 ) { - skip = false; -break ; - } - } - -if (skip) { + has_attached_progs =cgroup_has_attached_progs (cgroup_fd); +if (has_attached_progs <0 ) { +p_err ("can't query bpf programs attached to %s: %s" , + fpath,strerror (errno)); +close (cgroup_fd); +return SHOW_TREE_FN_ERR ; + }else if (!has_attached_progs) {close (cgroup_fd);return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 228/459 net: phy: realtek: add logging for the RGMII TX delay configuration
In reply to Sasha LevinFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 3aec743d69822d22d4a5b60deb9518ed8be6fa67 ]
RGMII requires a delay of 2ns between the data and the clock signal. There are at least three ways this can happen. One possibility is by having the PHY generate this delay.
This is a common source for problems (for example with slow TX speeds or packet loss when sending data). The TX delay configuration of the RTL8211F PHY can be set either by pin-strappping the RXD1 pin (HIGH means enabled, LOW means disabled) or through configuring a paged register. The setting from the RXD1 pin is also reflected in the register.
Add debug logging to the TX delay configuration on RTL8211F so it's easier to spot these issues (for example if the TX delay is enabled for both, the RTL8211F PHY and the MAC).
This is especially helpful because there is no public datasheet for the RTL8211F PHY available with all the RX/TX delay specifics.
--- drivers/net/phy/realtek.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-)
drivers/net/phy/realtek.c +18 -1
@@ -171,7 +171,9 @@ static int rtl8211c_config_init(struct phy_device *phydev)static int rtl8211f_config_init (struct phy_device *phydev) { +struct device *dev = &phydev->mdio.dev;u16 val; +int ret;/* enable TX-delay for rgmii-{id,txid}, and disable it for rgmii and * rgmii-rxid. The RX-delay can be enabled by the external RXDLY pin.
@@ -189,7 +191,22 @@ static int rtl8211f_config_init(struct phy_device *phydev)return 0 ; } -return phy_modify_paged (phydev,0xd08 ,0x11 ,RTL8211F_TX_DELAY , val); + ret =phy_modify_paged_changed (phydev,0xd08 ,0x11 ,RTL8211F_TX_DELAY , + val); +if (ret <0 ) { +dev_err (dev,"Failed to update the TX delay register\n" ); +return ret; + }else if (ret) { +dev_dbg (dev, +"%s 2ns TX delay (and changing the value from pin-strapping RXD1 or the bootloader)\n" , + val ?"Enabling" :"Disabling" ); + }else { +dev_dbg (dev, +"2ns TX delay was already %s (by pin-strapping RXD1 or bootloader configuration)\n" , + val ?"enabled" :"disabled" ); + } + +return 0 ; }static int rtl8211e_config_init (struct phy_device *phydev)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 229/459 crypto: chtls - Fixed memory leak
In reply to Sasha LevinFrom: Vinay Kumar Yadav <[email protected]>
[ Upstream commit 93e23eb2ed6c11b4f483c8111ac155ec2b1f3042 ]
Freed work request skbs when connection terminates. enqueue_wr()/ dequeue_wr() is shared between softirq and application contexts, should be protected by socket lock. Moved dequeue_wr() to appropriate file.
--- drivers/crypto/chelsio/chtls/chtls_cm.c | 27 +++++++++++++------------ drivers/crypto/chelsio/chtls/chtls_cm.h | 21 +++++++++++++++++++ drivers/crypto/chelsio/chtls/chtls_hw.c | 3 +++ 3 files changed, 38 insertions(+), 13 deletions(-)
drivers/crypto/chelsio/chtls/chtls_cm.c +14 -13
@@ -727,6 +727,14 @@ static int chtls_close_listsrv_rpl(struct chtls_dev *cdev, struct sk_buff *skb)return 0 ; } +static void chtls_purge_wr_queue (struct sock *sk) +{ +struct sk_buff *skb; + +while ((skb =dequeue_wr (sk)) !=NULL ) +kfree_skb (skb); +} +static void chtls_release_resources (struct sock *sk) {struct chtls_sock *csk =rcu_dereference_sk_user_data (sk);
@@ -741,6 +749,11 @@ static void chtls_release_resources(struct sock *sk)kfree_skb (csk->txdata_skb_cache); csk->txdata_skb_cache =NULL ; +if (csk->wr_credits != csk->wr_max_credits) { +chtls_purge_wr_queue (sk); +chtls_reset_wr_list (csk); + } +if (csk->l2t_entry) {cxgb4_l2t_release (csk->l2t_entry); csk->l2t_entry =NULL ;
@@ -1735,6 +1748,7 @@ static void chtls_peer_close(struct sock *sk, struct sk_buff *skb)else sk_wake_async (sk,SOCK_WAKE_WAITD ,POLL_IN ); } +kfree_skb (skb); }static void chtls_close_con_rpl (struct sock *sk,struct sk_buff *skb)
@@ -2062,19 +2076,6 @@ static int chtls_conn_cpl(struct chtls_dev *cdev, struct sk_buff *skb)return 0 ; } -static struct sk_buff *dequeue_wr (struct sock *sk) -{ -struct chtls_sock *csk =rcu_dereference_sk_user_data (sk); -struct sk_buff *skb = csk->wr_skb_head; - -if (likely (skb)) { -/* Don't bother clearing the tail */ - csk->wr_skb_head =WR_SKB_CB (skb)->next_wr; -WR_SKB_CB (skb)->next_wr =NULL ; - } -return skb; -} -static void chtls_rx_ack (struct sock *sk,struct sk_buff *skb) {struct cpl_fw4_ack *hdr =cplhdr (skb) +RSS_HDR ;
drivers/crypto/chelsio/chtls/chtls_cm.h +21 -0
@@ -185,6 +185,12 @@ static inline void chtls_kfree_skb(struct sock *sk, struct sk_buff *skb)kfree_skb (skb); } +static inline void chtls_reset_wr_list (struct chtls_sock *csk) +{ + csk->wr_skb_head =NULL ; + csk->wr_skb_tail =NULL ; +} +static inline void enqueue_wr (struct chtls_sock *csk,struct sk_buff *skb) {WR_SKB_CB (skb)->next_wr =NULL ;
@@ -197,4 +203,19 @@ static inline void enqueue_wr(struct chtls_sock *csk, struct sk_buff *skb)WR_SKB_CB (csk->wr_skb_tail)->next_wr = skb; csk->wr_skb_tail = skb; } + +static inline struct sk_buff *dequeue_wr (struct sock *sk) +{ +struct chtls_sock *csk =rcu_dereference_sk_user_data (sk); +struct sk_buff *skb =NULL ; + + skb = csk->wr_skb_head; + +if (likely (skb)) { +/* Don't bother clearing the tail */ + csk->wr_skb_head =WR_SKB_CB (skb)->next_wr; +WR_SKB_CB (skb)->next_wr =NULL ; + } +return skb; +}#endif
drivers/crypto/chelsio/chtls/chtls_hw.c +3 -0
@@ -350,6 +350,7 @@ int chtls_setkey(struct chtls_sock *csk, u32 keylen, u32 optname) kwr->sc_imm.cmd_more =cpu_to_be32 (ULPTX_CMD_V (ULP_TX_SC_IMM )); kwr->sc_imm.len =cpu_to_be32 (klen); +lock_sock (sk);/* key info */ kctx = (struct _key_ctx *)(kwr +1 ); ret =chtls_key_info (csk, kctx, keylen, optname);
@@ -388,8 +389,10 @@ int chtls_setkey(struct chtls_sock *csk, u32 keylen, u32 optname) csk->tlshws.txkey = keyid; } +release_sock (sk);return ret; out_notcb: +release_sock (sk);free_tls_keyid (sk); out_nokey:kfree_skb (skb);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 230/459 net/wan/fsl_ucc_hdlc: remove set but not used variables 'ut_info' and 'ret'
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit 270fe2ceda66b6964d4c6f261d7f562a02c1c786 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/net/wan/fsl_ucc_hdlc.c: In function ucc_hdlc_irq_handler:drivers/net/wan/fsl_ucc_hdlc.c:643:23:
warning: variable ut_info set but not used [-Wunused-but-set-variable]drivers/net/wan/fsl_ucc_hdlc.c: In function uhdlc_suspend:drivers/net/wan/fsl_ucc_hdlc.c:880:23:
warning: variable ut_info set but not used [-Wunused-but-set-variable]drivers/net/wan/fsl_ucc_hdlc.c: In function uhdlc_resume:drivers/net/wan/fsl_ucc_hdlc.c:925:6:
warning: variable ret set but not used [-Wunused-but-set-variable]
--- drivers/net/wan/fsl_ucc_hdlc.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/net/wan/fsl_ucc_hdlc.c +5 -9
@@ -640,11 +640,9 @@ static irqreturn_t ucc_hdlc_irq_handler(int irq, void *dev_id)struct ucc_hdlc_private *priv = (struct ucc_hdlc_private *)dev_id;struct net_device *dev = priv->ndev;struct ucc_fast_private *uccf; -struct ucc_tdm_info *ut_info;u32 ucce;u32 uccm; - ut_info = priv->ut_info; uccf = priv->uccf; ucce =ioread32be (uccf->p_ucce);
@@ -877,7 +875,6 @@ static void resume_clk_config(struct ucc_hdlc_private *priv)static int uhdlc_suspend (struct device *dev) {struct ucc_hdlc_private *priv =dev_get_drvdata (dev); -struct ucc_tdm_info *ut_info;struct ucc_fast __iomem *uf_regs;if (!priv)
@@ -889,7 +886,6 @@ static int uhdlc_suspend(struct device *dev)netif_device_detach (priv->ndev);napi_disable (&priv->napi); - ut_info = priv->ut_info; uf_regs = priv->uf_regs;/* backup gumr guemr*/
@@ -922,7 +918,7 @@ static int uhdlc_resume(struct device *dev)struct ucc_fast __iomem *uf_regs;struct ucc_fast_private *uccf;struct ucc_fast_info *uf_info; -int ret, i; +int i;u32 cecr_subblock;u16 bd_status;
@@ -967,16 +963,16 @@ static int uhdlc_resume(struct device *dev)/* Write to QE CECR, UCCx channel to Stop Transmission */ cecr_subblock =ucc_fast_get_qe_cr_subblock (uf_info->ucc_num); - ret =qe_issue_cmd (QE_STOP_TX , cecr_subblock, - (u8 )QE_CR_PROTOCOL_UNSPECIFIED ,0 ); +qe_issue_cmd (QE_STOP_TX , cecr_subblock, + (u8 )QE_CR_PROTOCOL_UNSPECIFIED ,0 );/* Set UPSMR normal mode */ iowrite32be (0 , &uf_regs->upsmr);/* init parameter base */ cecr_subblock =ucc_fast_get_qe_cr_subblock (uf_info->ucc_num); - ret =qe_issue_cmd (QE_ASSIGN_PAGE_TO_DEVICE , cecr_subblock, -QE_CR_PROTOCOL_UNSPECIFIED , priv->ucc_pram_offset); +qe_issue_cmd (QE_ASSIGN_PAGE_TO_DEVICE , cecr_subblock, +QE_CR_PROTOCOL_UNSPECIFIED , priv->ucc_pram_offset); priv->ucc_pram = (struct ucc_hdlc_param __iomem *)qe_muram_addr (priv->ucc_pram_offset);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 231/459 x86/vdso: Provide missing include file
In reply to Sasha LevinFrom: Valdis Klētnieks <[email protected]>
[ Upstream commit bff47c2302cc249bcd550b17067f8dddbd4b6f77 ]
When building with C=1, sparse issues a warning:
CHECK arch/x86/entry/vdso/vdso32-setup.c
arch/x86/entry/vdso/vdso32-setup.c:28:28: warning: symbol 'vdso32_enabled' was not declared. Should it be static?
Provide the missing header file.
--- arch/x86/entry/vdso/vdso32-setup.c | 1 + 1 file changed, 1 insertion(+)
arch/x86/entry/vdso/vdso32-setup.c +1 -0
@@ -11,6 +11,7 @@#include <linux/smp.h> #include <linux/kernel.h> #include <linux/mm_types.h> +#include <linux/elf.h> #include <asm/processor.h> #include <asm/vdso.h>
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 232/459 PM / devfreq: exynos-ppmu: Fix excessive stack usage
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit d4556f5e99d5f603913bac01adaff8670cb2d08b ]
Putting a 'struct devfreq_event_dev' object on the stack is generally a bad idea and here it leads to a warnig about potential stack overflow:
drivers/devfreq/event/exynos-ppmu.c:643:12: error: stack frame size of 1040 bytes in function 'exynos_ppmu_probe' [-Werror,-Wframe-larger-than=]
There is no real need for the device structure, only the string inside it, so add an internal helper function that simply takes the string as its argument and remove the device structure.
--- drivers/devfreq/event/exynos-ppmu.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/devfreq/event/exynos-ppmu.c +8 -5
@@ -101,17 +101,22 @@ static struct __exynos_ppmu_events { PPMU_EVENT(dmc1_1), }; -static int exynos_ppmu_find_ppmu_id (struct devfreq_event_dev *edev) +static int __exynos_ppmu_find_ppmu_id (const char *edev_name) {int i;for (i =0 ; i <ARRAY_SIZE (ppmu_events); i++) -if (!strcmp (edev->desc->name, ppmu_events[i].name)) +if (!strcmp (edev_name, ppmu_events[i].name))return ppmu_events[i].id;return -EINVAL ; } +static int exynos_ppmu_find_ppmu_id (struct devfreq_event_dev *edev) +{ +return __exynos_ppmu_find_ppmu_id (edev->desc->name); +} +/* * The devfreq-event ops structure for PPMU v1.1 */
@@ -556,13 +561,11 @@ static int of_get_devfreq_events(struct device_node *np,* use default if not. */ if (info->ppmu_type ==EXYNOS_TYPE_PPMU_V2 ) { -struct devfreq_event_dev edev;int id;/* Not all registers take the same value for * read+write data count. */ - edev.desc = &desc[j]; - id =exynos_ppmu_find_ppmu_id (&edev); + id =__exynos_ppmu_find_ppmu_id (desc[j].name);switch (id) {case PPMU_PMNCNT0 :
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 233/459 PM / devfreq: rk3399_dmc: Add COMPILE_TEST and HAVE_ARM_SMCCC dependency
In reply to Sasha LevinFrom: Chanwoo Choi <[email protected]>
[ Upstream commit eff5d31f7407fa9d31fb840106f1593399457298 ]
To build test, add COMPILE_TEST depedency to both ARM_RK3399_DMC_DEVFREQ and DEVFREQ_EVENT_ROCKCHIP_DFI configuration. And ARM_RK3399_DMC_DEVFREQ used the SMCCC interface so that add HAVE_ARM_SMCCC dependency to prevent the build break.
--- drivers/devfreq/Kconfig | 3 ++- drivers/devfreq/event/Kconfig | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/devfreq/Kconfig +2 -1
@@ -118,7 +118,8 @@ config ARM_TEGRA20_DEVFREQ config ARM_RK3399_DMC_DEVFREQ tristate "ARM RK3399 DMC DEVFREQ Driver" - depends on ARCH_ROCKCHIP + depends on (ARCH_ROCKCHIP && HAVE_ARM_SMCCC) || \ + (COMPILE_TEST && HAVE_ARM_SMCCC) select DEVFREQ_EVENT_ROCKCHIP_DFI select DEVFREQ_GOV_SIMPLE_ONDEMAND select PM_DEVFREQ_EVENT
drivers/devfreq/event/Kconfig +1 -1
@@ -34,7 +34,7 @@ config DEVFREQ_EVENT_EXYNOS_PPMU config DEVFREQ_EVENT_ROCKCHIP_DFI tristate "ROCKCHIP DFI DEVFREQ event Driver" - depends on ARCH_ROCKCHIP + depends on ARCH_ROCKCHIP || COMPILE_TEST help This add the devfreq-event driver for Rockchip SoC. It provides DFI (DDR Monitor Module) driver to count ddr load.
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 234/459 drm/fbdev: Fallback to non tiled mode if all tiles not present
In reply to Sasha LevinFrom: Manasi Navare <[email protected]>
[ Upstream commit f25c7a006cd1c07254780e3406e45cee4842b933 ]
In case of tiled displays, if we hotplug just one connector, fbcon currently just selects the preferred mode and if it is tiled mode then that becomes a problem if rest of the tiles are not present.
So in the fbdev driver on hotplug when we probe the client modeset, if we dont find all the connectors for all tiles, then on a connector with one tile, just fallback to the first available non tiled mode to display over a single connector.
On the hotplug of the consecutive tiled connectors, if the tiled mode no longer exists because of fbcon size limitation, then return no modes for consecutive tiles but retain the non tiled mode on the 0th tile.
Use the same logic in case of connected boot case as well. This has been tested with Dell UP328K tiled monitor.
v2:
* Set the modes on consecutive hotplugged tiles to no mode if tiled mode is pruned (Dave)
v1:
* Just handle the 1st connector hotplug case
* v1 Reviewed-by: Dave Airlie <[email protected]>
--- drivers/gpu/drm/drm_client_modeset.c | 72 ++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+)
drivers/gpu/drm/drm_client_modeset.c +72 -0
@@ -114,6 +114,33 @@ drm_client_find_modeset(struct drm_client_dev *client, struct drm_crtc *crtc)return NULL ; } +static struct drm_display_mode * +drm_connector_get_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +return mode; + } +return NULL ; +} + +static struct drm_display_mode * +drm_connector_fallback_non_tiled_mode (struct drm_connector *connector) +{ +struct drm_display_mode *mode; + +list_for_each_entry (mode, &connector->modes, head) { +if (mode->hdisplay == connector->tile_h_size && + mode->vdisplay == connector->tile_v_size) +continue ; +return mode; + } +return NULL ; +} +static struct drm_display_mode *drm_connector_has_preferred_mode (struct drm_connector *connector,int width,int height) {
@@ -348,8 +375,15 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,struct drm_connector *connector;u64 conn_configured =0 ;int tile_pass =0 ; +int num_tiled_conns =0 ;int i; +for (i =0 ; i < connector_count; i++) { +if (connectors[i]->has_tile && + connectors[i]->status == connector_status_connected) + num_tiled_conns++; + } + retry:for (i =0 ; i < connector_count; i++) { connector = connectors[i];
@@ -399,6 +433,28 @@ static bool drm_client_target_preferred(struct drm_connector **connectors,list_for_each_entry (modes[i], &connector->modes, head)break ; } +/* +* In case of tiled mode if all tiles not present fallback to +* first available non tiled mode. +* After all tiles are present, try to find the tiled mode +* for all and if tiled mode not present due to fbcon size +* limitations, use first non tiled mode only for +* tile 0,0 and set to no mode for all other tiles. +*/ +if (connector->has_tile) { +if (num_tiled_conns < + connector->num_h_tile * connector->num_v_tile || + (connector->tile_h_loc ==0 && + connector->tile_v_loc ==0 && + !drm_connector_get_tiled_mode (connector))) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + }else { + modes[i] =drm_connector_get_tiled_mode (connector); + } + } +DRM_DEBUG_KMS ("found mode %s\n" , modes[i] ? modes[i]->name :"none" ); conn_configured |=BIT_ULL (i);
@@ -516,6 +572,7 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,bool fallback = true, ret = true;int num_connectors_enabled =0 ;int num_connectors_detected =0 ; +int num_tiled_conns =0 ;struct drm_modeset_acquire_ctx ctx;if (!drm_drv_uses_atomic_modeset (dev))
@@ -533,6 +590,11 @@ static bool drm_client_firmware_config(struct drm_client_dev *client,memcpy (save_enabled, enabled, count); mask =GENMASK (count -1 ,0 ); conn_configured =0 ; +for (i =0 ; i < count; i++) { +if (connectors[i]->has_tile && + connectors[i]->status == connector_status_connected) + num_tiled_conns++; + } retry: conn_seq = conn_configured;for (i =0 ; i < count; i++) {
@@ -632,6 +694,16 @@ static bool drm_client_firmware_config(struct drm_client_dev *client, connector->name); modes[i] = &connector->state->crtc->mode; } +/* +* In case of tiled modes, if all tiles are not present +* then fallback to a non tiled mode. +*/ +if (connector->has_tile && + num_tiled_conns < connector->num_h_tile * connector->num_v_tile) { +DRM_DEBUG_KMS ("Falling back to non tiled mode on Connector %d\n" , + connector->base.id); + modes[i] =drm_connector_fallback_non_tiled_mode (connector); + } crtcs[i] = new_crtc; DRM_DEBUG_KMS("connector %s on [CRTC:%d:%s]: %dx%d%s\n",
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 235/459 pinctrl: sh-pfc: r8a7778: Fix duplicate SDSELF_B and SD1_CLK_B
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 805f635703b2562b5ddd822c62fc9124087e5dd5 ]
The FN_SDSELF_B and FN_SD1_CLK_B enum IDs are used twice, which means one set of users must be wrong. Replace them by the correct enum IDs.
--- drivers/pinctrl/sh-pfc/pfc-r8a7778.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a7778.c +2 -2
@@ -2305,7 +2305,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {FN_ATAG0_A ,0 ,FN_REMOCON_B ,0 ,/* IP0_11_8 [4] */ FN_SD1_DAT2_A ,FN_MMC_D2 ,0 ,FN_BS , -FN_ATADIR0_A ,0 ,FN_SDSELF_B ,0 , +FN_ATADIR0_A ,0 ,FN_SDSELF_A ,0 ,FN_PWM4_B ,0 ,0 ,0 ,0 ,0 ,0 ,0 , /* IP0_7_5 [3] */
@@ -2349,7 +2349,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {FN_TS_SDAT0_A ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,/* IP1_10_8 [3] */ -FN_SD1_CLK_B ,FN_MMC_D6 ,0 ,FN_A24 , +FN_SD1_CD_A ,FN_MMC_D6 ,0 ,FN_A24 ,FN_DREQ1_A ,0 ,FN_HRX0_B ,FN_TS_SPSYNC0_A ,/* IP1_7_5 [3] */ FN_A23, FN_HTX0_B, FN_TX2_B, FN_DACK2_A,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 236/459 pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 02aeb2f21530c98fc3ca51028eda742a3fafbd9f ]
pinmux_func_gpios[] contains a hole due to the missing function GPIO definition for the "CTX0&CTX1" signal, which is the logical "AND" of the first two CAN outputs.
A closer look reveals other issues:
- Some functionality is available on alternative pins, but the PINMUX_DATA() entries is using the wrong marks,
- Several configurations are missing.
Fix this by:
- Renaming CTX0CTX1CTX2_MARK, CRX0CRX1_PJ22_MARK, and CRX0CRX1CRX2_PJ20_MARK to CTX0_CTX1_CTX2_MARK, CRX0_CRX1_PJ22_MARK, resp. CRX0_CRX1_CRX2_PJ20_MARK for consistency with the corresponding enum IDs,
- Adding all missing enum IDs and marks,
- Use the right (*_PJ2x) variants for alternative pins,
- Adding all missing configurations to pinmux_data[],
- Adding all missing function GPIO definitions to pinmux_func_gpios[].
See SH7268 Group, SH7269 Group User’s Manual: Hardware, Rev. 2.00:
[1] Table 1.4 List of Pins
[2] Figure 23.29 Connection Example when Using Channels 0 and 1 as One Channel (64 Mailboxes × 1 Channel) and Channel 2 as One Channel (32 Mailboxes × 1 Channel),
[3] Figure 23.30 Connection Example when Using Channels 0, 1, and 2 as One Channel (96 Mailboxes × 1 Channel),
[4] Table 48.3 Multiplexed Pins (Port B),
[5] Table 48.4 Multiplexed Pins (Port C),
[6] Table 48.10 Multiplexed Pins (Port J),
[7] Section 48.2.4 Port B Control Registers 0 to 5 (PBCR0 to PBCR5).
--- arch/sh/include/cpu-sh2a/cpu/sh7269.h | 11 ++++++-- drivers/pinctrl/sh-pfc/pfc-sh7269.c | 39 ++++++++++++++++++--------- 2 files changed, 36 insertions(+), 14 deletions(-)
arch/sh/include/cpu-sh2a/cpu/sh7269.h +9 -2
@@ -78,8 +78,15 @@ enum {GPIO_FN_WDTOVF ,/* CAN */ -GPIO_FN_CTX1 ,GPIO_FN_CRX1 ,GPIO_FN_CTX0 ,GPIO_FN_CTX0_CTX1 , -GPIO_FN_CRX0 ,GPIO_FN_CRX0_CRX1 ,GPIO_FN_CRX0_CRX1_CRX2 , +GPIO_FN_CTX2 ,GPIO_FN_CRX2 , +GPIO_FN_CTX1 ,GPIO_FN_CRX1 , +GPIO_FN_CTX0 ,GPIO_FN_CRX0 , +GPIO_FN_CTX0_CTX1 ,GPIO_FN_CRX0_CRX1 , +GPIO_FN_CTX0_CTX1_CTX2 ,GPIO_FN_CRX0_CRX1_CRX2 , +GPIO_FN_CTX2_PJ21 ,GPIO_FN_CRX2_PJ20 , +GPIO_FN_CTX1_PJ23 ,GPIO_FN_CRX1_PJ22 , +GPIO_FN_CTX0_CTX1_PJ23 ,GPIO_FN_CRX0_CRX1_PJ22 , +GPIO_FN_CTX0_CTX1_CTX2_PJ21 ,GPIO_FN_CRX0_CRX1_CRX2_PJ20 ,/* DMAC */ GPIO_FN_TEND0, GPIO_FN_DACK0, GPIO_FN_DREQ0,
drivers/pinctrl/sh-pfc/pfc-sh7269.c +27 -12
@@ -737,13 +737,12 @@ enum {CRX0_MARK ,CTX0_MARK ,CRX1_MARK ,CTX1_MARK ,CRX2_MARK ,CTX2_MARK , -CRX0_CRX1_MARK , -CRX0_CRX1_CRX2_MARK , -CTX0CTX1CTX2_MARK , +CRX0_CRX1_MARK ,CTX0_CTX1_MARK , +CRX0_CRX1_CRX2_MARK ,CTX0_CTX1_CTX2_MARK ,CRX1_PJ22_MARK ,CTX1_PJ23_MARK ,CRX2_PJ20_MARK ,CTX2_PJ21_MARK , -CRX0CRX1_PJ22_MARK , -CRX0CRX1CRX2_PJ20_MARK , +CRX0_CRX1_PJ22_MARK ,CTX0_CTX1_PJ23_MARK , +CRX0_CRX1_CRX2_PJ20_MARK ,CTX0_CTX1_CTX2_PJ21_MARK ,/* VDC */ DV_CLK_MARK,
@@ -821,6 +820,7 @@ static const u16 pinmux_data[] = {PINMUX_DATA (CS3_MARK ,PC8MD_001 ),PINMUX_DATA (TXD7_MARK ,PC8MD_010 ),PINMUX_DATA (CTX1_MARK ,PC8MD_011 ), +PINMUX_DATA (CTX0_CTX1_MARK ,PC8MD_100 ),PINMUX_DATA (PC7_DATA ,PC7MD_000 ), PINMUX_DATA(CKE_MARK, PC7MD_001),
@@ -833,11 +833,12 @@ static const u16 pinmux_data[] = {PINMUX_DATA (CAS_MARK ,PC6MD_001 ),PINMUX_DATA (SCK7_MARK ,PC6MD_010 ),PINMUX_DATA (CTX0_MARK ,PC6MD_011 ), +PINMUX_DATA (CTX0_CTX1_CTX2_MARK ,PC6MD_100 ),PINMUX_DATA (PC5_DATA ,PC5MD_000 ),PINMUX_DATA (RAS_MARK ,PC5MD_001 ),PINMUX_DATA (CRX0_MARK ,PC5MD_011 ), -PINMUX_DATA (CTX0CTX1CTX2_MARK ,PC5MD_100 ), +PINMUX_DATA (CTX0_CTX1_CTX2_MARK ,PC5MD_100 ),PINMUX_DATA (IRQ0_PC_MARK ,PC5MD_101 ), PINMUX_DATA(PC4_DATA, PC4MD_00),
@@ -1289,30 +1290,32 @@ static const u16 pinmux_data[] = {PINMUX_DATA (LCD_DATA23_PJ23_MARK ,PJ23MD_010 ),PINMUX_DATA (LCD_TCON6_MARK ,PJ23MD_011 ),PINMUX_DATA (IRQ3_PJ_MARK ,PJ23MD_100 ), -PINMUX_DATA (CTX1_MARK ,PJ23MD_101 ), +PINMUX_DATA (CTX1_PJ23_MARK ,PJ23MD_101 ), +PINMUX_DATA (CTX0_CTX1_PJ23_MARK ,PJ23MD_110 ),PINMUX_DATA (PJ22_DATA ,PJ22MD_000 ),PINMUX_DATA (DV_DATA22_MARK ,PJ22MD_001 ),PINMUX_DATA (LCD_DATA22_PJ22_MARK ,PJ22MD_010 ),PINMUX_DATA (LCD_TCON5_MARK ,PJ22MD_011 ),PINMUX_DATA (IRQ2_PJ_MARK ,PJ22MD_100 ), -PINMUX_DATA (CRX1_MARK ,PJ22MD_101 ), -PINMUX_DATA (CRX0_CRX1_MARK ,PJ22MD_110 ), +PINMUX_DATA (CRX1_PJ22_MARK ,PJ22MD_101 ), +PINMUX_DATA (CRX0_CRX1_PJ22_MARK ,PJ22MD_110 ),PINMUX_DATA (PJ21_DATA ,PJ21MD_000 ),PINMUX_DATA (DV_DATA21_MARK ,PJ21MD_001 ),PINMUX_DATA (LCD_DATA21_PJ21_MARK ,PJ21MD_010 ),PINMUX_DATA (LCD_TCON4_MARK ,PJ21MD_011 ),PINMUX_DATA (IRQ1_PJ_MARK ,PJ21MD_100 ), -PINMUX_DATA (CTX2_MARK ,PJ21MD_101 ), +PINMUX_DATA (CTX2_PJ21_MARK ,PJ21MD_101 ), +PINMUX_DATA (CTX0_CTX1_CTX2_PJ21_MARK ,PJ21MD_110 ),PINMUX_DATA (PJ20_DATA ,PJ20MD_000 ),PINMUX_DATA (DV_DATA20_MARK ,PJ20MD_001 ),PINMUX_DATA (LCD_DATA20_PJ20_MARK ,PJ20MD_010 ),PINMUX_DATA (LCD_TCON3_MARK ,PJ20MD_011 ),PINMUX_DATA (IRQ0_PJ_MARK ,PJ20MD_100 ), -PINMUX_DATA (CRX2_MARK ,PJ20MD_101 ), -PINMUX_DATA (CRX0CRX1CRX2_PJ20_MARK ,PJ20MD_110 ), +PINMUX_DATA (CRX2_PJ20_MARK ,PJ20MD_101 ), +PINMUX_DATA (CRX0_CRX1_CRX2_PJ20_MARK ,PJ20MD_110 ),PINMUX_DATA (PJ19_DATA ,PJ19MD_000 ), PINMUX_DATA(DV_DATA19_MARK, PJ19MD_001),
@@ -1663,12 +1666,24 @@ static const struct pinmux_func pinmux_func_gpios[] = {GPIO_FN (WDTOVF ),/* CAN */ +GPIO_FN (CTX2 ), +GPIO_FN (CRX2 ),GPIO_FN (CTX1 ),GPIO_FN (CRX1 ),GPIO_FN (CTX0 ),GPIO_FN (CRX0 ), +GPIO_FN (CTX0_CTX1 ),GPIO_FN (CRX0_CRX1 ), +GPIO_FN (CTX0_CTX1_CTX2 ),GPIO_FN (CRX0_CRX1_CRX2 ), +GPIO_FN (CTX2_PJ21 ), +GPIO_FN (CRX2_PJ20 ), +GPIO_FN (CTX1_PJ23 ), +GPIO_FN (CRX1_PJ22 ), +GPIO_FN (CTX0_CTX1_PJ23 ), +GPIO_FN (CRX0_CRX1_PJ22 ), +GPIO_FN (CTX0_CTX1_CTX2_PJ21 ), +GPIO_FN (CRX0_CRX1_CRX2_PJ20 ),/* DMAC */ GPIO_FN(TEND0),
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 237/459 reset: uniphier: Add SCSSI reset control for each channel
In reply to Sasha LevinFrom: Kunihiko Hayashi <[email protected]>
[ Upstream commit f4aec227e985e31d2fdc5608daf48e3de19157b7 ]
SCSSI has reset controls for each channel in the SoCs newer than Pro4, so this adds missing reset controls for channel 1, 2 and 3. And more, this moves MCSSI reset ID after SCSSI.
--- drivers/reset/reset-uniphier.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/reset/reset-uniphier.c +8 -5
@@ -193,8 +193,8 @@ static const struct uniphier_reset_data uniphier_pro5_sd_reset_data[] = {#define UNIPHIER_PERI_RESET_FI2C (id, ch) \ UNIPHIER_RESETX((id), 0x114, 24 + (ch)) -#define UNIPHIER_PERI_RESET_SCSSI (id) \ - UNIPHIER_RESETX((id), 0x110, 17) +#define UNIPHIER_PERI_RESET_SCSSI (id, ch) \ + UNIPHIER_RESETX((id), 0x110, 17 + (ch))#define UNIPHIER_PERI_RESET_MCSSI (id) \ UNIPHIER_RESETX((id), 0x114, 14)
@@ -209,7 +209,7 @@ static const struct uniphier_reset_data uniphier_ld4_peri_reset_data[] = {UNIPHIER_PERI_RESET_I2C (6 ,2 ),UNIPHIER_PERI_RESET_I2C (7 ,3 ),UNIPHIER_PERI_RESET_I2C (8 ,4 ), -UNIPHIER_PERI_RESET_SCSSI (11 ), +UNIPHIER_PERI_RESET_SCSSI (11 ,0 ), UNIPHIER_RESET_END, };
@@ -225,8 +225,11 @@ static const struct uniphier_reset_data uniphier_pro4_peri_reset_data[] = {UNIPHIER_PERI_RESET_FI2C (8 ,4 ),UNIPHIER_PERI_RESET_FI2C (9 ,5 ),UNIPHIER_PERI_RESET_FI2C (10 ,6 ), -UNIPHIER_PERI_RESET_SCSSI (11 ), -UNIPHIER_PERI_RESET_MCSSI (12 ), +UNIPHIER_PERI_RESET_SCSSI (11 ,0 ), +UNIPHIER_PERI_RESET_SCSSI (12 ,1 ), +UNIPHIER_PERI_RESET_SCSSI (13 ,2 ), +UNIPHIER_PERI_RESET_SCSSI (14 ,3 ), +UNIPHIER_PERI_RESET_MCSSI (15 ), UNIPHIER_RESET_END, };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 238/459 ASoC: soc-topology: fix endianness issues
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit 72bbeda0222bcd382ee33b3aff71346074410c21 ]
Sparse complains about a series of easy warnings, fix.
--- sound/soc/soc-topology.c | 42 +++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 20 deletions(-)
sound/soc/soc-topology.c +22 -20
@@ -604,9 +604,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, ext_ops = tplg->bytes_ext_ops; num_ops = tplg->bytes_ext_ops_count;for (i =0 ; i < num_ops; i++) { -if (!sbe->put && ext_ops[i].id == be->ext_ops.put) +if (!sbe->put && + ext_ops[i].id ==le32_to_cpu (be->ext_ops.put)) sbe->put = ext_ops[i].put; -if (!sbe->get && ext_ops[i].id == be->ext_ops.get) +if (!sbe->get && + ext_ops[i].id ==le32_to_cpu (be->ext_ops.get)) sbe->get = ext_ops[i].get; }
@@ -621,11 +623,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, num_ops = tplg->io_ops_count;for (i =0 ; i < num_ops; i++) { -if (k->put ==NULL && ops[i].id == hdr->ops.put) +if (k->put ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.put)) k->put = ops[i].put; -if (k->get ==NULL && ops[i].id == hdr->ops.get) +if (k->get ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.get)) k->get = ops[i].get; -if (k->info ==NULL && ops[i].id == hdr->ops.info) +if (k->info ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.info)) k->info = ops[i].info; }
@@ -638,11 +640,11 @@ static int soc_tplg_kcontrol_bind_io(struct snd_soc_tplg_ctl_hdr *hdr, num_ops =ARRAY_SIZE (io_ops);for (i =0 ; i < num_ops; i++) { -if (k->put ==NULL && ops[i].id == hdr->ops.put) +if (k->put ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.put)) k->put = ops[i].put; -if (k->get ==NULL && ops[i].id == hdr->ops.get) +if (k->get ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.get)) k->get = ops[i].get; -if (k->info ==NULL && ops[i].id == hdr->ops.info) +if (k->info ==NULL && ops[i].id ==le32_to_cpu (hdr->ops.info)) k->info = ops[i].info; }
@@ -931,7 +933,7 @@ static int soc_tplg_denum_create_texts(struct soc_enum *se,if (se->dobj.control.dtexts ==NULL )return -ENOMEM ; -for (i =0 ; i < ec->items; i++) { +for (i =0 ; i <le32_to_cpu (ec->items); i++) {if (strnlen (ec->texts[i],SNDRV_CTL_ELEM_ID_NAME_MAXLEN ) ==SNDRV_CTL_ELEM_ID_NAME_MAXLEN ) {
@@ -1325,7 +1327,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create(if (kc[i].name ==NULL ) goto err_sm; kc[i].iface =SNDRV_CTL_ELEM_IFACE_MIXER ; - kc[i].access = mc->hdr.access; + kc[i].access =le32_to_cpu (mc->hdr.access);/* we only support FL/FR channel mapping atm */ sm->reg = tplc_chan_get_reg(tplg, mc->channel,
@@ -1337,10 +1339,10 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create( sm->rshift =tplc_chan_get_shift (tplg, mc->channel,SNDRV_CHMAP_FR ); - sm->max = mc->max; - sm->min = mc->min; - sm->invert = mc->invert; - sm->platform_max = mc->platform_max; + sm->max =le32_to_cpu (mc->max); + sm->min =le32_to_cpu (mc->min); + sm->invert =le32_to_cpu (mc->invert); + sm->platform_max =le32_to_cpu (mc->platform_max); sm->dobj.index = tplg->index;INIT_LIST_HEAD (&sm->dobj.list);
@@ -1401,7 +1403,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( goto err_se; tplg->pos += (sizeof (struct snd_soc_tplg_enum_control ) + - ec->priv.size); +le32_to_cpu (ec->priv.size));dev_dbg (tplg->dev," adding DAPM widget enum control %s\n" , ec->hdr.name);
@@ -1411,7 +1413,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(if (kc[i].name ==NULL ) goto err_se; kc[i].iface =SNDRV_CTL_ELEM_IFACE_MIXER ; - kc[i].access = ec->hdr.access; + kc[i].access =le32_to_cpu (ec->hdr.access);/* we only support FL/FR channel mapping atm */ se->reg =tplc_chan_get_reg (tplg, ec->channel,SNDRV_CHMAP_FL );
@@ -1420,8 +1422,8 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( se->shift_r =tplc_chan_get_shift (tplg, ec->channel,SNDRV_CHMAP_FR ); - se->items = ec->items; - se->mask = ec->mask; + se->items =le32_to_cpu (ec->items); + se->mask =le32_to_cpu (ec->mask); se->dobj.index = tplg->index;switch (le32_to_cpu (ec->hdr.ops.info)) {
@@ -1523,9 +1525,9 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dbytes_create(if (kc[i].name ==NULL ) goto err_sbe; kc[i].iface =SNDRV_CTL_ELEM_IFACE_MIXER ; - kc[i].access = be->hdr.access; + kc[i].access =le32_to_cpu (be->hdr.access); - sbe->max = be->max; + sbe->max =le32_to_cpu (be->max);INIT_LIST_HEAD (&sbe->dobj.list);/* map standard io handlers and check for external handlers */
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 239/459 fbdev: fix numbering of fbcon options
In reply to Sasha LevinFrom: Peter Rosin <[email protected]>
[ Upstream commit fd933c00ebe220060e66fb136a7050a242456566 ]
Three shall be the number thou shalt count, and the number of the counting shall be three. Four shalt thou not count...
One! Two! Five!
--- Documentation/fb/fbcon.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Documentation/fb/fbcon.rst +4 -4
@@ -127,7 +127,7 @@ C. Boot options is typically located on the same video card. Thus, the consoles that are controlled by the VGA console will be garbled. -4. fbcon=rotate:<n> +5. fbcon=rotate:<n> This option changes the orientation angle of the console display. The value 'n' accepts the following:
@@ -152,21 +152,21 @@ C. Boot options Actually, the underlying fb driver is totally ignorant of console rotation. -5. fbcon=margin:<color> +6. fbcon=margin:<color> This option specifies the color of the margins. The margins are the leftover area at the right and the bottom of the screen that are not used by text. By default, this area will be black. The 'color' value is an integer number that depends on the framebuffer driver being used. -6. fbcon=nodefer +7. fbcon=nodefer If the kernel is compiled with deferred fbcon takeover support, normally the framebuffer contents, left in place by the firmware/bootloader, will be preserved until there actually is some text is output to the console. This option causes fbcon to bind immediately to the fbdev device. -7. fbcon=logo-pos:<location> +8. fbcon=logo-pos:<location> The only possible 'location' is 'center' (without quotes), and when given, the bootup logo is moved from the default top-left corner
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 240/459 RDMA/rxe: Fix error type of mmap_offset
In reply to Sasha LevinFrom: Jiewei Ke <[email protected]>
[ Upstream commit 6ca18d8927d468c763571f78c9a7387a69ffa020 ]
The type of mmap_offset should be u64 instead of int to match the type of mminfo.offset. If otherwise, after we create several thousands of CQs, it will run into overflow issues.
--- drivers/infiniband/sw/rxe/rxe_verbs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_verbs.h +1 -1
@@ -407,7 +407,7 @@ struct rxe_dev {struct list_head pending_mmaps;spinlock_t mmap_offset_lock;/* guard mmap_offset */ -int mmap_offset; +u64 mmap_offset;atomic64_t stats_counters[RXE_NUM_OF_COUNTERS ];
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 241/459 clk: sunxi-ng: add mux and pll notifiers for A64 CPU clock
In reply to Sasha LevinFrom: Icenowy Zheng <[email protected]>
[ Upstream commit ec97faff743b398e21f74a54c81333f3390093aa ]
The A64 PLL_CPU clock has the same instability if some factor changed without the PLL gated like other SoCs with sun6i-style CCU, e.g. A33, H3.
Add the mux and pll notifiers for A64 CPU clock to workaround the problem.
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 28 ++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +27 -1
@@ -921,11 +921,26 @@ static const struct sunxi_ccu_desc sun50i_a64_ccu_desc = { .num_resets = ARRAY_SIZE(sun50i_a64_ccu_resets), }; +static struct ccu_pll_nb sun50i_a64_pll_cpu_nb = { + .common = &pll_cpux_clk.common, +/* copy from pll_cpux_clk */ + .enable =BIT (31 ), + .lock =BIT (28 ), +}; + +static struct ccu_mux_nb sun50i_a64_cpu_nb = { + .common = &cpux_clk.common, + .cm = &cpux_clk.mux, + .delay_us =1 ,/* > 8 clock cycles at 24 MHz */ + .bypass_index =1 ,/* index of 24 MHz oscillator */ +}; +static int sun50i_a64_ccu_probe (struct platform_device *pdev) {struct resource *res;void __iomem *reg;u32 val; +int ret; res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); reg =devm_ioremap_resource (&pdev->dev, res);
@@ -939,7 +954,18 @@ static int sun50i_a64_ccu_probe(struct platform_device *pdev)writel (0x515 , reg +SUN50I_A64_PLL_MIPI_REG ); -return sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a64_ccu_desc); + ret =sunxi_ccu_probe (pdev->dev.of_node, reg, &sun50i_a64_ccu_desc); +if (ret) +return ret; + +/* Gate then ungate PLL CPU after any rate changes */ +ccu_pll_notifier_register (&sun50i_a64_pll_cpu_nb); + +/* Reparent CPU during PLL CPU rate changes */ +ccu_mux_notifier_register (pll_cpux_clk.common.hw.clk, + &sun50i_a64_cpu_nb); + +return 0 ; }static const struct of_device_id sun50i_a64_ccu_ids[] = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 242/459 ALSA: sh: Fix unused variable warnings
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 5da116f164ce265e397b8f59af5c39e4a61d61a5 ]
Remove unused variables that are left over after the conversion of new PCM ops:
sound/sh/sh_dac_audio.c:166:26: warning: unused variable 'runtime' sound/sh/sh_dac_audio.c:186:26: warning: unused variable 'runtime' sound/sh/sh_dac_audio.c:205:26: warning: unused variable 'runtime'
--- sound/sh/sh_dac_audio.c | 3 --- 1 file changed, 3 deletions(-)
sound/sh/sh_dac_audio.c +0 -3
@@ -175,7 +175,6 @@ static int snd_sh_dac_pcm_copy(struct snd_pcm_substream *substream, {/* channel is not used (interleaved data) */ struct snd_sh_dac *chip =snd_pcm_substream_chip (substream); -struct snd_pcm_runtime *runtime = substream->runtime;if (copy_from_user_toio (chip->data_buffer + pos, src, count))return -EFAULT ;
@@ -195,7 +194,6 @@ static int snd_sh_dac_pcm_copy_kernel(struct snd_pcm_substream *substream, {/* channel is not used (interleaved data) */ struct snd_sh_dac *chip =snd_pcm_substream_chip (substream); -struct snd_pcm_runtime *runtime = substream->runtime;memcpy_toio (chip->data_buffer + pos, src, count); chip->buffer_end = chip->data_buffer + pos + count;
@@ -214,7 +212,6 @@ static int snd_sh_dac_pcm_silence(struct snd_pcm_substream *substream, {/* channel is not used (interleaved data) */ struct snd_sh_dac *chip =snd_pcm_substream_chip (substream); -struct snd_pcm_runtime *runtime = substream->runtime;memset_io (chip->data_buffer + pos,0 , count); chip->buffer_end = chip->data_buffer + pos + count;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 243/459 clk: Use parent node pointer during registration if necessary
In reply to Sasha LevinFrom: Stephen Boyd <[email protected]>
[ Upstream commit 9011f92622e5ef2d075f45e5fa818776d4feb8c0 ]
Sometimes clk drivers are attached to devices which are children of a parent device that is connected to a node in DT. This happens when devices are MFD-ish and the parent device driver mostly registers child devices to match against drivers placed in their respective subsystem directories like drivers/clk, drivers/regulator, etc. When the clk driver calls clk_register() with a device pointer, that struct device pointer won't have a device_node associated with it because it was created purely in software as a way to partition logic to a subsystem.
This causes problems for the way we find parent clks for the clks registered by these child devices because we look at the registering device's device_node pointer to lookup 'clocks' and 'clock-names' properties. Let's use the parent device's device_node pointer if the registering device doesn't have a device_node but the parent does. This simplifies clk registration code by avoiding the need to assign some device_node to the device registering the clk.
--- drivers/clk/clk.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-)
drivers/clk/clk.c +25 -2
@@ -3718,6 +3718,28 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)return ERR_PTR (ret); } +/** +* dev_or_parent_of_node() - Get device node of @dev or @dev's parent +* @dev: Device to get device node of +* +* Return: device node pointer of @dev, or the device node pointer of +* @dev->parent if dev doesn't have a device node, or NULL if neither +* @dev or @dev->parent have a device node. +*/ +static struct device_node *dev_or_parent_of_node (struct device *dev) +{ +struct device_node *np; + +if (!dev) +return NULL ; + + np =dev_of_node (dev); +if (!np) + np =dev_of_node (dev->parent); + +return np; +} +/** * clk_register - allocate a new clock, register it and return an opaque cookie * @dev: device that is registering this clock
@@ -3733,7 +3755,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)*/ struct clk *clk_register (struct device *dev,struct clk_hw *hw) { -return __clk_register (dev,dev_of_node (dev), hw); +return __clk_register (dev,dev_or_parent_of_node (dev), hw); }EXPORT_SYMBOL_GPL (clk_register);
@@ -3749,7 +3771,8 @@ EXPORT_SYMBOL_GPL(clk_register);*/ int clk_hw_register (struct device *dev,struct clk_hw *hw) { -return PTR_ERR_OR_ZERO (__clk_register (dev,dev_of_node (dev), hw)); +return PTR_ERR_OR_ZERO (__clk_register (dev,dev_or_parent_of_node (dev), + hw)); }EXPORT_SYMBOL_GPL (clk_hw_register);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 244/459 clk: uniphier: Add SCSSI clock gate for each channel
In reply to Sasha LevinFrom: Kunihiko Hayashi <[email protected]>
[ Upstream commit 1ec09a2ec67a0baa46a3ccac041dbcdbc6db2cb9 ]
SCSSI has clock gates for each channel in the SoCs newer than Pro4, so this adds missing clock gates for channel 1, 2 and 3. And more, this moves MCSSI clock ID after SCSSI.
--- drivers/clk/uniphier/clk-uniphier-peri.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/clk/uniphier/clk-uniphier-peri.c +8 -5
@@ -18,8 +18,8 @@#define UNIPHIER_PERI_CLK_FI2C (idx, ch) \ UNIPHIER_CLK_GATE("i2c" #ch, (idx), "i2c", 0x24, 24 + (ch)) -#define UNIPHIER_PERI_CLK_SCSSI (idx) \ - UNIPHIER_CLK_GATE("scssi", (idx), "spi", 0x20, 17) +#define UNIPHIER_PERI_CLK_SCSSI (idx, ch) \ + UNIPHIER_CLK_GATE("scssi" #ch, (idx), "spi", 0x20, 17 + (ch))#define UNIPHIER_PERI_CLK_MCSSI (idx) \ UNIPHIER_CLK_GATE("mcssi", (idx), "spi", 0x24, 14)
@@ -35,7 +35,7 @@ const struct uniphier_clk_data uniphier_ld4_peri_clk_data[] = {UNIPHIER_PERI_CLK_I2C (6 ,2 ),UNIPHIER_PERI_CLK_I2C (7 ,3 ),UNIPHIER_PERI_CLK_I2C (8 ,4 ), - UNIPHIER_PERI_CLK_SCSSI(11), + UNIPHIER_PERI_CLK_SCSSI(11, 0), { /* sentinel */ } };
@@ -51,7 +51,10 @@ const struct uniphier_clk_data uniphier_pro4_peri_clk_data[] = {UNIPHIER_PERI_CLK_FI2C (8 ,4 ),UNIPHIER_PERI_CLK_FI2C (9 ,5 ),UNIPHIER_PERI_CLK_FI2C (10 ,6 ), -UNIPHIER_PERI_CLK_SCSSI (11 ), - UNIPHIER_PERI_CLK_MCSSI(12), +UNIPHIER_PERI_CLK_SCSSI (11 ,0 ), +UNIPHIER_PERI_CLK_SCSSI (12 ,1 ), +UNIPHIER_PERI_CLK_SCSSI (13 ,2 ), +UNIPHIER_PERI_CLK_SCSSI (14 ,3 ), + UNIPHIER_PERI_CLK_MCSSI(15), { /* sentinel */ } };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 245/459 ALSA: hda/realtek - Apply mic mute LED quirk for Dell E7xx laptops, too
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 5fab5829674c279839a7408ab30c71c6dfe726b9 ]
Dell E7xx laptops have also mic mute LED that is driven by the dell-laptop platform driver. Bind it with the capture control as already done for other models.
A caveat is that the fixup hook for the mic mute LED has to be applied at last, otherwise it results in the invalid override of the callback.
--- sound/pci/hda/patch_realtek.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
sound/pci/hda/patch_realtek.c +9 -1
@@ -5848,6 +5848,7 @@ enum {ALC288_FIXUP_DELL1_MIC_NO_PRESENCE ,ALC288_FIXUP_DELL_XPS_13 ,ALC288_FIXUP_DISABLE_AAMIX , +ALC292_FIXUP_DELL_E7X_AAMIX ,ALC292_FIXUP_DELL_E7X ,ALC292_FIXUP_DISABLE_AAMIX , ALC293_FIXUP_DISABLE_AAMIX_MULTIJACK,
@@ -6543,12 +6544,19 @@ static const struct hda_fixup alc269_fixups[] = { .chained = true, .chain_id =ALC293_FIXUP_DELL1_MIC_NO_PRESENCE }, - [ALC292_FIXUP_DELL_E7X] = { + [ALC292_FIXUP_DELL_E7X_AAMIX] = { .type = HDA_FIXUP_FUNC, .v.func = alc_fixup_dell_xps13, .chained = true, .chain_id =ALC292_FIXUP_DISABLE_AAMIX }, + [ALC292_FIXUP_DELL_E7X] = { + .type = HDA_FIXUP_FUNC, + .v.func = snd_hda_gen_fixup_micmute_led, +/* micmute fixup must be applied at last */ + .chained_before = true, + .chain_id = ALC292_FIXUP_DELL_E7X_AAMIX, + }, [ALC298_FIXUP_ALIENWARE_MIC_NO_PRESENCE] = { .type = HDA_FIXUP_PINS, .v.pins = (const struct hda_pintbl []) {
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 246/459 ALSA: sh: Fix compile warning wrt const
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit f1dd4795b1523fbca7ab4344dd5a8bb439cc770d ]
A long-standing compile warning was seen during build test:
sound/sh/aica.c: In function 'load_aica_firmware':
sound/sh/aica.c:521:25: warning: passing argument 2 of 'spu_memload' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
--- sound/sh/aica.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/sh/aica.c +2 -2
@@ -101,10 +101,10 @@ static void spu_memset(u32 toi, u32 what, int length) }/* spu_memload - write to SPU address space */ -static void spu_memload (u32 toi,void *from,int length) +static void spu_memload (u32 toi,const void *from,int length) {unsigned long flags; -u32 *froml = from; +const u32 *froml = from;u32 __iomem *to = (u32 __iomem *) (SPU_MEMORY_BASE + toi);int i;u32 val;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 247/459 net: phy: fixed_phy: fix use-after-free when checking link GPIO
In reply to Sasha LevinFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit d266f19f3ae7fbcaf92229639b78d2110ae44f33 ]
If we fail to locate GPIO for any reason other than deferral or not-found-GPIO, we try to print device tree node info, however if might be freed already as we called of_node_put() on it.
--- drivers/net/phy/fixed_phy.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/phy/fixed_phy.c +2 -5
@@ -212,16 +212,13 @@ static struct gpio_desc *fixed_phy_get_gpiod(struct device_node *np)*/ gpiod =gpiod_get_from_of_node (fixed_link_node,"link-gpios" ,0 ,GPIOD_IN ,"mdio" ); -of_node_put (fixed_link_node); -if (IS_ERR (gpiod)) { -if (PTR_ERR (gpiod) == -EPROBE_DEFER ) -return gpiod; - +if (IS_ERR (gpiod) &&PTR_ERR (gpiod) != -EPROBE_DEFER ) {if (PTR_ERR (gpiod) != -ENOENT )pr_err ("error getting GPIO for fixed link %pOF, proceed without\n" , fixed_link_node); gpiod =NULL ; } +of_node_put (fixed_link_node);return gpiod; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 248/459 tools lib api fs: Fix gcc9 stringop-truncation compilation error
In reply to Sasha LevinFrom: Andrey Zhizhikin <[email protected]>
[ Upstream commit 6794200fa3c9c3e6759dae099145f23e4310f4f7 ]
GCC9 introduced string hardening mechanisms, which exhibits the error during fs api compilation:
error: '__builtin_strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]
This comes when the length of copy passed to strncpy is is equal to destination size, which could potentially lead to buffer overflow.
There is a need to mitigate this potential issue by limiting the size of destination by 1 and explicitly terminate the destination with NULL.
--- tools/lib/api/fs/fs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/lib/api/fs/fs.c +3 -1
@@ -210,6 +210,7 @@ static bool fs__env_override(struct fs *fs)size_t name_len =strlen (fs->name);/* name + "_PATH" + '\0' */ char upper_name[name_len +5 +1 ]; +memcpy (upper_name, fs->name, name_len);mem_toupper (upper_name, name_len);strcpy (&upper_name[name_len],"_PATH" );
@@ -219,7 +220,8 @@ static bool fs__env_override(struct fs *fs)return false; fs->found = true; -strncpy (fs->path, override_path,sizeof (fs->path)); +strncpy (fs->path, override_path,sizeof (fs->path) -1 ); + fs->path[sizeof (fs->path) -1 ] ='\0' ;return true; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 249/459 vfio/spapr/nvlink2: Skip unpinning pages on error exit
In reply to Sasha LevinFrom: Alexey Kardashevskiy <[email protected]>
[ Upstream commit 338b4e10f939a71194d8ecef7ece205a942cec05 ]
The nvlink2 subdriver for IBM Witherspoon machines preregisters GPU memory in the IOMMI API so KVM TCE code can map this memory for DMA as well. This is done by mm_iommu_newdev() called from vfio_pci_nvgpu_regops::mmap.
In an unlikely event of failure the data->mem remains NULL and since mm_iommu_put() (which unregisters the region and unpins memory if that was regular memory) does not expect mem=NULL, it should not be called.
This adds a check to only call mm_iommu_put() for a valid data->mem.
--- drivers/vfio/pci/vfio_pci_nvlink2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/vfio/pci/vfio_pci_nvlink2.c +4 -2
@@ -97,8 +97,10 @@ static void vfio_pci_nvgpu_release(struct vfio_pci_device *vdev,/* If there were any mappings at all... */ if (data->mm) { - ret =mm_iommu_put (data->mm, data->mem); -WARN_ON (ret); +if (data->mem) { + ret =mm_iommu_put (data->mm, data->mem); +WARN_ON (ret); + }mmdrop (data->mm); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 250/459 ASoC: Intel: sof_rt5682: Ignore the speaker amp when there isn't one.
In reply to Sasha LevinFrom: Sam McNally <[email protected]>
[ Upstream commit d4b74e218a8d0d6cf58e546627ab9d4d4f2645ab ]
Some members of the Google_Hatch family include a rt5682 jack codec, but no speaker amplifier. This uses the same driver (sof_rt5682) as a combination of rt5682 jack codec and max98357a speaker amplifier. Within the sof_rt5682 driver, these cases are not currently distinguishable, relying on a DMI quirk to decide the configuration. This causes an incorrect configuration when only the rt5682 is present on a Google_Hatch device.
For CML, the jack codec is used as the primary key when matching, with a possible speaker amplifier described in quirk_data. The two cases of interest are the second and third 10EC5682 entries in snd_soc_acpi_intel_cml_machines[]. The second entry matches the combination of rt5682 and max98357a, resulting in the quirk_data field in the snd_soc_acpi_mach being non-null, pointing at max98357a_spk_codecs, the snd_soc_acpi_codecs for the matched speaker amplifier. The third entry matches just the rt5682, resulting in a null quirk_data.
The sof_rt5682 driver's DMI data matching identifies that a speaker amplifier is present for all Google_Hatch family devices. Detect cases where there is no speaker amplifier by checking for a null quirk_data in the snd_soc_acpi_mach and remove the speaker amplifier bit in that case.
--- sound/soc/intel/boards/sof_rt5682.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
sound/soc/intel/boards/sof_rt5682.c +8 -1
@@ -594,6 +594,14 @@ static int sof_audio_probe(struct platform_device *pdev)dmi_check_system (sof_rt5682_quirk_table); + mach = (&pdev->dev)->platform_data; + +/* A speaker amp might not be present when the quirk claims one is. +* Detect this via whether the machine driver match includes quirk_data. +*/ +if ((sof_rt5682_quirk &SOF_SPEAKER_AMP_PRESENT ) && !mach->quirk_data) + sof_rt5682_quirk &= ~SOF_SPEAKER_AMP_PRESENT ; +if (soc_intel_is_byt () ||soc_intel_is_cht ()) { is_legacy_cpu =1 ; dmic_be_num =0 ;
@@ -654,7 +662,6 @@ static int sof_audio_probe(struct platform_device *pdev)INIT_LIST_HEAD (&ctx->hdmi_pcm_list); sof_audio_card_rt5682.dev = &pdev->dev; - mach = (&pdev->dev)->platform_data;/* set platform name for each dailink */ ret = snd_soc_fixup_dai_links_platform_name(&sof_audio_card_rt5682,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 251/459 x86/unwind/orc: Fix !CONFIG_MODULES build warning
In reply to Sasha LevinFrom: Shile Zhang <[email protected]>
[ Upstream commit 22a7fa8848c5e881d87ef2f7f3c2ea77b286e6f9 ]
To fix follwowing warning due to ORC sort moved to build time:
arch/x86/kernel/unwind_orc.c:210:12: warning: ‘orc_sort_cmp’ defined but not used [-Wunused-function] arch/x86/kernel/unwind_orc.c:190:13: warning: ‘orc_sort_swap’ defined but not used [-Wunused-function]
--- arch/x86/kernel/unwind_orc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/kernel/unwind_orc.c +2 -1
@@ -187,6 +187,8 @@ static struct orc_entry *orc_find(unsigned long ip)return orc_ftrace_find (ip); } +#ifdef CONFIG_MODULES +static void orc_sort_swap (void *_a,void *_b,int size) {struct orc_entry *orc_a, *orc_b;
@@ -229,7 +231,6 @@ static int orc_sort_cmp(const void *_a, const void *_b)return orc_a->sp_reg ==ORC_REG_UNDEFINED && !orc_a->end ?-1 :1 ; } -#ifdef CONFIG_MODULES void unwind_module_init (struct module *mod,void *_orc_ip,size_t orc_ip_size,void *_orc,size_t orc_size) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 252/459 ACPI: button: Add DMI quirk for Razer Blade Stealth 13 late 2019 lid switch
In reply to Sasha LevinFrom: Jason Ekstrand <[email protected]>
[ Upstream commit 0528904926aab19bffb2068879aa44db166c6d5f ]
Running evemu-record on the lid switch event shows that the lid reports the first "close" but then never reports an "open". This causes systemd to continuously re-suspend the laptop every 30s. Resetting the _LID to "open" fixes the issue.
--- drivers/acpi/button.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/acpi/button.c +11 -0
@@ -89,6 +89,17 @@ static const struct dmi_system_id lid_blacklst[] = { }, .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, }, + { + /* + * Razer Blade Stealth 13 late 2019, notification of the LID device + * only happens on close, not on open and _LID always returns closed. + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Razer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Razer Blade Stealth 13 Late 2019"), + }, + .driver_data = (void *)(long)ACPI_BUTTON_LID_INIT_OPEN, + }, {} };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 253/459 iommu/vt-d: Match CPU and IOMMU paging mode
In reply to Sasha LevinFrom: Jacob Pan <[email protected]>
[ Upstream commit 79db7e1b4cf2a006f556099c13de3b12970fc6e3 ]
When setting up first level page tables for sharing with CPU, we need to ensure IOMMU can support no less than the levels supported by the CPU.
It is not adequate, as in the current code, to set up 5-level paging in PASID entry First Level Paging Mode(FLPM) solely based on CPU.
Currently, intel_pasid_setup_first_level() is only used by native SVM code which already checks paging mode matches. However, future use of this helper function may not be limited to native SVM.
https://lkml.org/lkml/2019/11/18/1037
--- drivers/iommu/intel-pasid.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/iommu/intel-pasid.c +10 -2
@@ -499,8 +499,16 @@ int intel_pasid_setup_first_level(struct intel_iommu *iommu, }#ifdef CONFIG_X86 -if (cpu_feature_enabled (X86_FEATURE_LA57 )) -pasid_set_flpm (pte,1 ); +/* Both CPU and IOMMU paging mode need to match */ +if (cpu_feature_enabled (X86_FEATURE_LA57 )) { +if (cap_5lp_support (iommu->cap)) { +pasid_set_flpm (pte,1 ); + }else { +pr_err ("VT-d has no 5-level paging support for CPU\n" ); +pasid_clear_entry (pte); +return -EINVAL ; + } + }#endif /* CONFIG_X86 */ pasid_set_domain_id (pte, did);
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 254/459 iommu/vt-d: Avoid sending invalid page response
In reply to Sasha LevinFrom: Jacob Pan <[email protected]>
[ Upstream commit 5f75585e19cc7018bf2016aa771632081ee2f313 ]
Page responses should only be sent when last page in group (LPIG) or private data is present in the page request. This patch avoids sending invalid descriptors.
--- drivers/iommu/intel-svm.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/iommu/intel-svm.c +3 -4
@@ -654,11 +654,10 @@ static irqreturn_t prq_event_thread(int irq, void *d)if (req->priv_data_present)memcpy (&resp.qw2, req->priv_data,sizeof (req->priv_data)); + resp.qw2 =0 ; + resp.qw3 =0 ; +qi_submit_sync (&resp, iommu); } - resp.qw2 =0 ; - resp.qw3 =0 ; -qi_submit_sync (&resp, iommu); - head = (head +sizeof (*req)) &PRQ_RING_MASK ; }
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 255/459 drm/amdkfd: Fix permissions of hang_hws
In reply to Sasha LevinFrom: Felix Kuehling <[email protected]>
[ Upstream commit 2bdac179e217a0c0b548a8c60524977586621b19 ]
Reading from /sys/kernel/debug/kfd/hang_hws would cause a kernel oops because we didn't implement a read callback. Set the permission to write-only to prevent that.
--- drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdkfd/kfd_debugfs.c +1 -1
@@ -93,7 +93,7 @@ void kfd_debugfs_init(void) kfd_debugfs_hqds_by_device, &kfd_debugfs_fops);debugfs_create_file ("rls" ,S_IFREG |0444 , debugfs_root, kfd_debugfs_rls_by_device, &kfd_debugfs_fops); -debugfs_create_file ("hang_hws" ,S_IFREG |0644 , debugfs_root, +debugfs_create_file ("hang_hws" ,S_IFREG |0200 , debugfs_root,NULL , &kfd_debugfs_hang_hws_fops); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 256/459 mlx5: work around high stack usage with gcc
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 42ae1a5c76691928ed217c7e40269db27f5225e9 ]
In some configurations, gcc tries too hard to optimize this code:
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c: In function 'mlx5e_grp_sw_update_stats':drivers/net/ethernet/mellanox/mlx5/core/en_stats.c:302:1: error: the frame size of 1336 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
As was stated in the bug report, the reason is that gcc runs into a corner case in the register allocator that is rather hard to fix in a good way.
As there is an easy way to work around it, just add a comment and the barrier that stops gcc from trying to overoptimize the function.
--- drivers/net/ethernet/mellanox/mlx5/core/en_stats.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_stats.c +3 -0
@@ -297,6 +297,9 @@ static void mlx5e_grp_sw_update_stats(struct mlx5e_priv *priv) s->tx_tls_drop_bypass_req += sq_stats->tls_drop_bypass_req;#endif s->tx_cqes += sq_stats->cqes; + +/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92657 */ +barrier (); } } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 257/459 RDMA/hns: Avoid printing address of mtt page
In reply to Sasha LevinFrom: Wenpeng Liang <[email protected]>
[ Upstream commit eca44507c3e908b7362696a4d6a11d90371334c6 ]
Address of a page shouldn't be printed in case of security issues.
--- drivers/infiniband/hw/hns/hns_roce_mr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hns/hns_roce_mr.c +2 -2
@@ -1062,8 +1062,8 @@ int hns_roce_ib_umem_write_mtt(struct hns_roce_dev *hr_dev,if (!(npage % (1 << (mtt->page_shift -PAGE_SHIFT )))) {if (page_addr & ((1 << mtt->page_shift) -1 )) {dev_err (dev, -"page_addr 0x%llx is not page_shift %d alignment!\n" , - page_addr, mtt->page_shift); +"page_addr is not page_shift %d alignment!\n" , + mtt->page_shift); ret = -EINVAL ; goto out; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 258/459 drm: remove the newline for CRC source name.
In reply to Sasha LevinFrom: Dingchen Zhang <[email protected]>
[ Upstream commit 72a848f5c46bab4c921edc9cbffd1ab273b2be17 ]
userspace may transfer a newline, and this terminating newline is replaced by a '\0' to avoid followup issues.
'len-1' is the index to replace the newline of CRC source name.
v3: typo fix (Sam)
v2: update patch subject, body and format. (Sam)
--- drivers/gpu/drm/drm_debugfs_crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_debugfs_crc.c +2 -2
@@ -140,8 +140,8 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf,if (IS_ERR (source))return PTR_ERR (source); -if (source[len] =='\n' ) - source[len] ='\0' ; +if (source[len -1 ] =='\n' ) + source[len -1 ] ='\0' ; ret = crtc->funcs->verify_crc_source (crtc, source, &values_cnt);if (ret)
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 259/459 soc: qcom: rpmhpd: Set 'active_only' for active only power domains
In reply to Sasha LevinFrom: Douglas Anderson <[email protected]>
[ Upstream commit 5d0d4d42bed0090d3139e7c5ca1587d76d48add6 ]
The 'active_only' attribute was accidentally never set to true for any power domains meaning that all the code handling this attribute was dead.
NOTE that the RPM power domain code (as opposed to the RPMh one) gets this right.
--- drivers/soc/qcom/rpmhpd.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/soc/qcom/rpmhpd.c +2 -0
@@ -93,6 +93,7 @@ static struct rpmhpd sdm845_mx = {static struct rpmhpd sdm845_mx_ao = { .pd = { .name ="mx_ao" , }, + .active_only = true, .peer = &sdm845_mx, .res_name ="mx.lvl" , };
@@ -107,6 +108,7 @@ static struct rpmhpd sdm845_cx = {static struct rpmhpd sdm845_cx_ao = { .pd = { .name ="cx_ao" , }, + .active_only = true, .peer = &sdm845_cx, .parent = &sdm845_mx_ao.pd, .res_name ="cx.lvl" ,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 260/459 drm/gma500: remove set but not used variables 'hist_reg'
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit 72f775611daf3ce20358388facbaf11f22899fa2 ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/gpu/drm/gma500/psb_irq.c: In function psb_irq_turn_off_dpst:drivers/gpu/drm/gma500/psb_irq.c:473:6:
warning: variable hist_reg set but not used [-Wunused-but-set-variable]
--- drivers/gpu/drm/gma500/psb_irq.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/gma500/psb_irq.c +1 -2
@@ -458,12 +458,11 @@ void psb_irq_turn_off_dpst(struct drm_device *dev) {struct drm_psb_private *dev_priv = (struct drm_psb_private *) dev->dev_private; -u32 hist_reg;u32 pwm_reg;if (gma_power_begin (dev, false)) {PSB_WVDC32 (0x00000000 ,HISTOGRAM_INT_CONTROL ); - hist_reg =PSB_RVDC32 (HISTOGRAM_INT_CONTROL ); +PSB_RVDC32 (HISTOGRAM_INT_CONTROL );psb_disable_pipestat (dev_priv,0 ,PIPE_DPST_EVENT_ENABLE );
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 261/459 ARM: dts: meson8: use the actual frequency for the GPU's 182.1MHz OPP
In reply to Sasha LevinFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit fe634a7a9a57fb736e39fb71aa9adc6448a90f94 ]
The clock setup on Meson8 cannot achieve a Mali frequency of exactly 182.15MHz. The vendor driver uses "FCLK_DIV7 / 2" for this frequency, which translates to 2550MHz / 7 / 2 = 182142857Hz.
Update the GPU operating point to that specific frequency to not confuse myself when comparing the frequency from the .dts with the actual clock rate on the system.
--- arch/arm/boot/dts/meson8.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/meson8.dtsi +2 -2
@@ -129,8 +129,8 @@ gpu_opp_table: gpu-opp-table { compatible = "operating-points-v2"; - opp-182150000 { - opp-hz = /bits/ 64 <182150000>; + opp-182142857 { + opp-hz = /bits/ 64 <182142857>; opp-microvolt = <1150000>; }; opp-318750000 {
Signature · 7 lines
2.20.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Sasha Levin
maintainerPATCH 262/459 ARM: dts: meson8b: use the actual frequency for the GPU's 364MHz OPP
In reply to Sasha LevinFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit c3dd3315ab58b2cfa1916df55b0d0f9fbd94266f ]
The clock setup on Meson8 cannot achieve a Mali frequency of exactly 182.15MHz. The vendor driver uses "FCLK_DIV7 / 1" for this frequency, which translates to 2550MHz / 7 / 1 = 364285714Hz.
Update the GPU operating point to that specific frequency to not confuse myself when comparing the frequency from the .dts with the actual clock rate on the system.
--- arch/arm/boot/dts/meson8b.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/meson8b.dtsi +2 -2
@@ -125,8 +125,8 @@ opp-hz = /bits/ 64 <255000000>; opp-microvolt = <1100000>; }; - opp-364300000 { - opp-hz = /bits/ 64 <364300000>; + opp-364285714 { + opp-hz = /bits/ 64 <364285714>; opp-microvolt = <1100000>; }; opp-425000000 {
Signature · 7 lines
2.20.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Sasha Levin
maintainerPATCH 263/459 soc: fsl: qe: remove set but not used variable 'mm_gc'
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 6e62bd36e9ad85a22d92b1adce6a0336ea549733 ]
drivers/soc/fsl/qe/gpio.c: In function qe_pin_request:drivers/soc/fsl/qe/gpio.c:163:26: warning: variable mm_gc set but not used [-Wunused-but-set-variable]
commit 1e714e54b5ca ("powerpc: qe_lib-gpio: use gpiochip data pointer") left behind this unused variable.
--- drivers/soc/fsl/qe/gpio.c | 2 -- 1 file changed, 2 deletions(-)
drivers/soc/fsl/qe/gpio.c +0 -2
@@ -160,7 +160,6 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) {struct qe_pin *qe_pin;struct gpio_chip *gc; -struct of_mm_gpio_chip *mm_gc;struct qe_gpio_chip *qe_gc;int err;unsigned long flags;
@@ -186,7 +185,6 @@ struct qe_pin *qe_pin_request(struct device_node *np, int index) goto err0; } - mm_gc =to_of_mm_gpio_chip (gc); qe_gc =gpiochip_get_data (gc);spin_lock_irqsave (&qe_gc->lock, flags);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 264/459 crypto: artpec6 - return correct error code for failed setkey()
In reply to Sasha LevinFrom: Eric Biggers <[email protected]>
[ Upstream commit b828f905904cd76424230c69741a4cabb0174168 ]
->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1.
--- drivers/crypto/axis/artpec6_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/axis/artpec6_crypto.c +1 -1
@@ -1251,7 +1251,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key,if (len !=16 && len !=24 && len !=32 ) {crypto_aead_set_flags (tfm,CRYPTO_TFM_RES_BAD_KEY_LEN ); -return -1 ; +return -EINVAL ; } ctx->key_length = len;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 265/459 crypto: atmel-sha - fix error handling when setting hmac key
In reply to Sasha LevinFrom: Eric Biggers <[email protected]>
[ Upstream commit b529f1983b2dcc46354f311feda92e07b6e9e2da ]
HMAC keys can be of any length, and atmel_sha_hmac_key_set() can only fail due to -ENOMEM. But atmel_sha_hmac_setkey() incorrectly treated any error as a "bad key length" error. Fix it to correctly propagate the -ENOMEM error code and not set any tfm result flags.
--- drivers/crypto/atmel-sha.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/crypto/atmel-sha.c +1 -6
@@ -1918,12 +1918,7 @@ static int atmel_sha_hmac_setkey(struct crypto_ahash *tfm, const u8 *key, {struct atmel_sha_hmac_ctx *hmac =crypto_ahash_ctx (tfm); -if (atmel_sha_hmac_key_set (&hmac->hkey, key, keylen)) { -crypto_ahash_set_flags (tfm,CRYPTO_TFM_RES_BAD_KEY_LEN ); -return -EINVAL ; - } - -return 0 ; +return atmel_sha_hmac_key_set (&hmac->hkey, key, keylen); }static int atmel_sha_hmac_init (struct ahash_request *req)
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 266/459 usb: dwc3: use proper initializers for property entries
In reply to Sasha LevinFrom: Dmitry Torokhov <[email protected]>
[ Upstream commit 5eb5afb07853d6e90d3a2b230c825e028e948f79 ]
We should not be reaching into property entries and initialize them by hand, but rather use proper initializer macros. This way we can alter internal representation of property entries with no visible changes to their users.
--- drivers/usb/dwc3/host.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/usb/dwc3/host.c +3 -3
@@ -88,10 +88,10 @@ int dwc3_host_init(struct dwc3 *dwc)memset (props,0 ,sizeof (struct property_entry ) *ARRAY_SIZE (props));if (dwc->usb3_lpm_capable) - props[prop_idx++].name ="usb3-lpm-capable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb3-lpm-capable" );if (dwc->usb2_lpm_disable) - props[prop_idx++].name ="usb2-lpm-disable" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("usb2-lpm-disable" );/** * WORKAROUND: dwc3 revisions <=3.00a have a limitation
@@ -103,7 +103,7 @@ int dwc3_host_init(struct dwc3 *dwc)* This following flag tells XHCI to do just that. */ if (dwc->revision <=DWC3_REVISION_300A ) - props[prop_idx++].name ="quirk-broken-port-ped" ; + props[prop_idx++] =PROPERTY_ENTRY_BOOL ("quirk-broken-port-ped" );if (prop_idx) { ret =platform_device_add_properties (xhci, props);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 267/459 ARM: dts: stm32: Add power-supply for DSI panel on stm32f469-disco
In reply to Sasha LevinFrom: Benjamin Gaignard <[email protected]>
[ Upstream commit 0ff15a86d0c5a3f004fee2e92d65b88e56a3bc58 ]
Add a fixed regulator and use it as power supply for DSI panel.
--- arch/arm/boot/dts/stm32f469-disco.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/stm32f469-disco.dts +8 -0
@@ -76,6 +76,13 @@ regulator-max-microvolt = <3300000>; }; + vdd_dsi: vdd-dsi { + compatible = "regulator-fixed"; + regulator-name = "vdd_dsi"; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + soc { dma-ranges = <0xc0000000 0x0 0x10000000>; };
@@ -155,6 +162,7 @@ compatible = "orisetech,otm8009a"; reg = <0>; /* dsi virtual channel (0..3) */ reset-gpios = <&gpioh 7 GPIO_ACTIVE_LOW>; + power-supply = <&vdd_dsi>; status = "okay"; port {
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 268/459 usbip: Fix unsafe unaligned pointer usage
In reply to Sasha LevinFrom: Shuah Khan <[email protected]>
[ Upstream commit 585c91f40d201bc564d4e76b83c05b3b5363fe7e ]
Fix unsafe unaligned pointer usage in usbip network interfaces. usbip tool build fails with new gcc -Werror=address-of-packed-member checks.
usbip_network.c: In function ‘usbip_net_pack_usb_device’:
usbip_network.c:79:32: error: taking address of packed member of ‘struct usbip_usb_device’ may result in an unaligned pointer value [-Werror=address-of-packed-member]
79 | usbip_net_pack_uint32_t(pack, &udev->busnum);
Fix with minor changes to pass by value instead of by address.
--- tools/usb/usbip/src/usbip_network.c | 40 +++++++++++++++++------------ tools/usb/usbip/src/usbip_network.h | 12 +++------ 2 files changed, 27 insertions(+), 25 deletions(-)
tools/usb/usbip/src/usbip_network.c +24 -16
@@ -50,39 +50,39 @@ void usbip_setup_port_number(char *arg)info ("using port %d (\"%s\")" , usbip_port, usbip_port_string); } -void usbip_net_pack_uint32_t (int pack,uint32_t *num) +uint32_t usbip_net_pack_uint32_t (int pack,uint32_t num) {uint32_t i;if (pack) - i =htonl (*num); + i =htonl (num);else - i =ntohl (*num); + i =ntohl (num); - *num = i; +return i; } -void usbip_net_pack_uint16_t (int pack,uint16_t *num) +uint16_t usbip_net_pack_uint16_t (int pack,uint16_t num) {uint16_t i;if (pack) - i =htons (*num); + i =htons (num);else - i =ntohs (*num); + i =ntohs (num); - *num = i; +return i; }void usbip_net_pack_usb_device (int pack,struct usbip_usb_device *udev) { -usbip_net_pack_uint32_t (pack, &udev->busnum); -usbip_net_pack_uint32_t (pack, &udev->devnum); -usbip_net_pack_uint32_t (pack, &udev->speed); + udev->busnum =usbip_net_pack_uint32_t (pack, udev->busnum); + udev->devnum =usbip_net_pack_uint32_t (pack, udev->devnum); + udev->speed =usbip_net_pack_uint32_t (pack, udev->speed); -usbip_net_pack_uint16_t (pack, &udev->idVendor); -usbip_net_pack_uint16_t (pack, &udev->idProduct); -usbip_net_pack_uint16_t (pack, &udev->bcdDevice); + udev->idVendor =usbip_net_pack_uint16_t (pack, udev->idVendor); + udev->idProduct =usbip_net_pack_uint16_t (pack, udev->idProduct); + udev->bcdDevice =usbip_net_pack_uint16_t (pack, udev->bcdDevice); } void usbip_net_pack_usb_interface(int pack __attribute__((unused)),
@@ -129,6 +129,14 @@ ssize_t usbip_net_send(int sockfd, void *buff, size_t bufflen)return usbip_net_xmit (sockfd, buff, bufflen,1 ); } +static inline void usbip_net_pack_op_common (int pack, +struct op_common *op_common) +{ + op_common->version =usbip_net_pack_uint16_t (pack, op_common->version); + op_common->code =usbip_net_pack_uint16_t (pack, op_common->code); + op_common->status =usbip_net_pack_uint32_t (pack, op_common->status); +} +int usbip_net_send_op_common (int sockfd,uint32_t code,uint32_t status) {struct op_common op_common;
@@ -140,7 +148,7 @@ int usbip_net_send_op_common(int sockfd, uint32_t code, uint32_t status) op_common.code = code; op_common.status = status; -PACK_OP_COMMON (1 , &op_common); +usbip_net_pack_op_common (1 , &op_common); rc =usbip_net_send (sockfd, &op_common,sizeof (op_common));if (rc <0 ) {
@@ -164,7 +172,7 @@ int usbip_net_recv_op_common(int sockfd, uint16_t *code, int *status) goto err; } -PACK_OP_COMMON (0 , &op_common); +usbip_net_pack_op_common (0 , &op_common);if (op_common.version !=USBIP_VERSION ) { err("USBIP Kernel and tool version mismatch: %d %d:",
tools/usb/usbip/src/usbip_network.h +3 -9
@@ -32,12 +32,6 @@ struct op_common { } __attribute__((packed)); -#define PACK_OP_COMMON (pack, op_common) do {\ - usbip_net_pack_uint16_t(pack, &(op_common)->version);\ - usbip_net_pack_uint16_t(pack, &(op_common)->code);\ - usbip_net_pack_uint32_t(pack, &(op_common)->status);\ -} while (0) -/* ---------------------------------------------------------------------- */ /* Dummy Code */ #define OP_UNSPEC 0x00
@@ -163,11 +157,11 @@ struct op_devlist_reply_extra { } while (0)#define PACK_OP_DEVLIST_REPLY (pack, reply) do {\ - usbip_net_pack_uint32_t(pack, &(reply)->ndev);\ + (reply)->ndev = usbip_net_pack_uint32_t(pack, (reply)->ndev);\ } while (0) -void usbip_net_pack_uint32_t (int pack,uint32_t *num); -void usbip_net_pack_uint16_t (int pack,uint16_t *num); +uint32_t usbip_net_pack_uint32_t (int pack,uint32_t num); +uint16_t usbip_net_pack_uint16_t (int pack,uint16_t num);void usbip_net_pack_usb_device (int pack,struct usbip_usb_device *udev);void usbip_net_pack_usb_interface (int pack,struct usbip_usb_interface *uinf);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 269/459 udf: Fix free space reporting for metadata and virtual partitions
In reply to Sasha LevinFrom: Jan Kara <[email protected]>
[ Upstream commit a4a8b99ec819ca60b49dc582a4287ef03411f117 ]
Free space on filesystems with metadata or virtual partition maps currently gets misreported. This is because these partitions are just remapped onto underlying real partitions from which keep track of free blocks. Take this remapping into account when counting free blocks as well.
--- fs/udf/super.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
fs/udf/super.c +17 -5
@@ -2491,17 +2491,29 @@ static unsigned int udf_count_free_table(struct super_block *sb,static unsigned int udf_count_free (struct super_block *sb) {unsigned int accum =0 ; -struct udf_sb_info *sbi; +struct udf_sb_info *sbi =UDF_SB (sb);struct udf_part_map *map; +unsigned int part = sbi->s_partition; +int ptype = sbi->s_partmaps[part].s_partition_type; + +if (ptype ==UDF_METADATA_MAP25 ) { + part = sbi->s_partmaps[part].s_type_specific.s_metadata. + s_phys_partition_ref; + }else if (ptype ==UDF_VIRTUAL_MAP15 || ptype ==UDF_VIRTUAL_MAP20 ) { +/* +* Filesystems with VAT are append-only and we cannot write to +* them. Let's just report 0 here. +*/ +return 0 ; + } - sbi =UDF_SB (sb);if (sbi->s_lvid_bh) {struct logicalVolIntegrityDesc *lvid = (struct logicalVolIntegrityDesc *) sbi->s_lvid_bh->b_data; -if (le32_to_cpu (lvid->numOfPartitions) > sbi->s_partition) { +if (le32_to_cpu (lvid->numOfPartitions) > part) { accum =le32_to_cpu ( - lvid->freeSpaceTable[sbi->s_partition]); + lvid->freeSpaceTable[part]);if (accum ==0xFFFFFFFF ) accum =0 ; }
@@ -2510,7 +2522,7 @@ static unsigned int udf_count_free(struct super_block *sb)if (accum)return accum; - map = &sbi->s_partmaps[sbi->s_partition]; + map = &sbi->s_partmaps[part];if (map->s_partition_flags &UDF_PART_FLAG_UNALLOC_BITMAP ) { accum +=udf_count_free_bitmap (sb, map->s_uspace.s_bitmap);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 270/459 drm/mediatek: Add gamma property according to hardware capability
In reply to Sasha LevinFrom: Yongqiang Niu <[email protected]>
[ Upstream commit 4cebc1de506fa753301266a5a23bb21bca52ad3a ]
If there is no gamma function in the crtc
display path, don't add gamma property
for crtc
--- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_crtc.c +8 -2
@@ -537,6 +537,7 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,int pipe = priv->num_pipes;int ret;int i; +uint gamma_lut_size =0 ;if (!path)return 0 ;
@@ -587,6 +588,9 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, } mtk_crtc->ddp_comp[i] = comp; + +if (comp->funcs && comp->funcs->gamma_set) + gamma_lut_size =MTK_LUT_SIZE ; } mtk_crtc->layer_nr =mtk_ddp_comp_layer_nr (mtk_crtc->ddp_comp[0 ]);
@@ -609,8 +613,10 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev, NULL, pipe);if (ret <0 )return ret; -drm_mode_crtc_set_gamma_size (&mtk_crtc->base,MTK_LUT_SIZE ); -drm_crtc_enable_color_mgmt (&mtk_crtc->base,0 , false,MTK_LUT_SIZE ); + +if (gamma_lut_size) +drm_mode_crtc_set_gamma_size (&mtk_crtc->base, gamma_lut_size); +drm_crtc_enable_color_mgmt (&mtk_crtc->base,0 , false, gamma_lut_size); priv->num_pipes++;return 0 ;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 271/459 iommu/arm-smmu-v3: Populate VMID field for CMDQ_OP_TLBI_NH_VA
In reply to Sasha LevinFrom: Shameer Kolothum <[email protected]>
[ Upstream commit 935d43ba272e0001f8ef446a3eff15d8175cb11b ]
CMDQ_OP_TLBI_NH_VA requires VMID and this was missing since commit 1c27df1c0a82 ("iommu/arm-smmu: Use correct address mask for CMD_TLBI_S2_IPA"). Add it back.
--- drivers/iommu/arm-smmu-v3.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/arm-smmu-v3.c +1 -0
@@ -856,6 +856,7 @@ static int arm_smmu_cmdq_build_cmd(u64 *cmd, struct arm_smmu_cmdq_ent *ent) cmd[1 ] |=FIELD_PREP (CMDQ_CFGI_1_RANGE ,31 );break ;case CMDQ_OP_TLBI_NH_VA : + cmd[0 ] |=FIELD_PREP (CMDQ_TLBI_0_VMID , ent->tlbi.vmid); cmd[0 ] |=FIELD_PREP (CMDQ_TLBI_0_ASID , ent->tlbi.asid); cmd[1 ] |=FIELD_PREP (CMDQ_TLBI_1_LEAF , ent->tlbi.leaf); cmd[1 ] |= ent->tlbi.addr &CMDQ_TLBI_1_VA_MASK ;
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 272/459 staging: rtl8188: avoid excessive stack usage
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit c497ae2077c055b85c1bf04f3d182a84bd8f365b ]
The rtl8188 copy of the os_dep support code causes a warning about a very significant stack usage in the translate_scan() function:
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c: In function 'translate_scan':drivers/staging/rtl8188eu/os_dep/ioctl_linux.c:306:1: error: the frame size of 1560 bytes is larger than 1400 bytes [-Werror=frame-larger-than=]
Use the same trick as in the rtl8723bs copy of the same function, and allocate it dynamically.
--- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/staging/rtl8188eu/os_dep/ioctl_linux.c +6 -3
@@ -229,18 +229,21 @@ static char *translate_scan(struct adapter *padapter,/* parsing WPA/WPA2 IE */ { -u8 buf[MAX_WPA_IE_LEN ]; +u8 *buf;u8 wpa_ie[255 ], rsn_ie[255 ];u16 wpa_len =0 , rsn_len =0 ;u8 *p; + buf =kzalloc (MAX_WPA_IE_LEN ,GFP_ATOMIC ); +if (!buf) +return start; +rtw_get_sec_ie (pnetwork->network.ies, pnetwork->network.ie_length, rsn_ie, &rsn_len, wpa_ie, &wpa_len);RT_TRACE (_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: ssid =%s\n" , pnetwork->network.ssid.ssid));RT_TRACE (_module_rtl871x_mlme_c_, _drv_info_, ("rtw_wx_get_scan: wpa_len =%d rsn_len =%d\n" , wpa_len, rsn_len));if (wpa_len >0 ) { p = buf; -memset (buf,0 ,MAX_WPA_IE_LEN ); p +=sprintf (p,"wpa_ie=" );for (i =0 ; i < wpa_len; i++) p +=sprintf (p,"%02x" , wpa_ie[i]);
@@ -257,7 +260,6 @@ static char *translate_scan(struct adapter *padapter, }if (rsn_len >0 ) { p = buf; -memset (buf,0 ,MAX_WPA_IE_LEN ); p +=sprintf (p,"rsn_ie=" );for (i =0 ; i < rsn_len; i++) p +=sprintf (p,"%02x" , rsn_ie[i]);
@@ -271,6 +273,7 @@ static char *translate_scan(struct adapter *padapter, iwe.u.data.length = rsn_len; start =iwe_stream_add_point (info, start, stop, &iwe, rsn_ie); } +kfree (buf); } {/* parsing WPS IE */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 273/459 RDMA/core: Fix locking in ib_uverbs_event_read
In reply to Sasha LevinFrom: Jason Gunthorpe <[email protected]>
[ Upstream commit 14e23bd6d22123f6f3b2747701fa6cd4c6d05873 ]
This should not be using ib_dev to test for disassociation, during disassociation is_closed is set under lock and the waitq is triggered.
Instead check is_closed and be sure to re-obtain the lock to test the value after the wait_event returns.
--- drivers/infiniband/core/uverbs_main.c | 32 ++++++++++++--------------- 1 file changed, 14 insertions(+), 18 deletions(-)
drivers/infiniband/core/uverbs_main.c +14 -18
@@ -220,7 +220,6 @@ void ib_uverbs_release_file(struct kref *ref) }static ssize_t ib_uverbs_event_read (struct ib_uverbs_event_queue *ev_queue, -struct ib_uverbs_file *uverbs_file,struct file *filp,char __user *buf,size_t count,loff_t *pos,size_t eventsz)
@@ -238,19 +237,16 @@ static ssize_t ib_uverbs_event_read(struct ib_uverbs_event_queue *ev_queue,if (wait_event_interruptible (ev_queue->poll_wait, (!list_empty (&ev_queue->event_list) || -/* The barriers built into wait_event_interruptible() -* and wake_up() guarentee this will see the null set -* without using RCU -*/ - !uverbs_file->device->ib_dev))) + ev_queue->is_closed)))return -ERESTARTSYS ; +spin_lock_irq (&ev_queue->lock); +/* If device was disassociated and no event exists set an error */ -if (list_empty (&ev_queue->event_list) && - !uverbs_file->device->ib_dev) +if (list_empty (&ev_queue->event_list) && ev_queue->is_closed) { +spin_unlock_irq (&ev_queue->lock);return -EIO ; - -spin_lock_irq (&ev_queue->lock); + } } event = list_entry(ev_queue->event_list.next, struct ib_uverbs_event, list);
@@ -285,8 +281,7 @@ static ssize_t ib_uverbs_async_event_read(struct file *filp, char __user *buf, {struct ib_uverbs_async_event_file *file = filp->private_data; -return ib_uverbs_event_read (&file->ev_queue, file->uverbs_file, filp, - buf, count, pos, +return ib_uverbs_event_read (&file->ev_queue, filp, buf, count, pos,sizeof (struct ib_uverbs_async_event_desc )); }
@@ -296,9 +291,8 @@ static ssize_t ib_uverbs_comp_event_read(struct file *filp, char __user *buf,struct ib_uverbs_completion_event_file *comp_ev_file = filp->private_data; -return ib_uverbs_event_read (&comp_ev_file->ev_queue, - comp_ev_file->uobj.ufile, filp, - buf, count, pos, +return ib_uverbs_event_read (&comp_ev_file->ev_queue, filp, buf, count, + pos,sizeof (struct ib_uverbs_comp_event_desc )); }
@@ -321,7 +315,9 @@ static __poll_t ib_uverbs_event_poll(struct ib_uverbs_event_queue *ev_queue,static __poll_t ib_uverbs_async_event_poll (struct file *filp,struct poll_table_struct *wait) { -return ib_uverbs_event_poll (filp->private_data, filp, wait); +struct ib_uverbs_async_event_file *file = filp->private_data; + +return ib_uverbs_event_poll (&file->ev_queue, filp, wait); } static __poll_t ib_uverbs_comp_event_poll(struct file *filp,
@@ -335,9 +331,9 @@ static __poll_t ib_uverbs_comp_event_poll(struct file *filp,static int ib_uverbs_async_event_fasync (int fd,struct file *filp,int on) { -struct ib_uverbs_event_queue *ev_queue = filp->private_data; +struct ib_uverbs_async_event_file *file = filp->private_data; -return fasync_helper (fd, filp, on, &ev_queue->async_queue); +return fasync_helper (fd, filp, on, &file->ev_queue.async_queue); }static int ib_uverbs_comp_event_fasync (int fd,struct file *filp,int on)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 274/459 IB/hfi1: Add software counter for ctxt0 seq drop
In reply to Sasha LevinFrom: Mike Marciniszyn <[email protected]>
[ Upstream commit 5ffd048698ea5139743acd45e8ab388a683642b8 ]
All other code paths increment some form of drop counter.
This was missed in the original implementation.
--- drivers/infiniband/hw/hfi1/chip.c | 10 ++++++++++ drivers/infiniband/hw/hfi1/chip.h | 1 + drivers/infiniband/hw/hfi1/driver.c | 1 + drivers/infiniband/hw/hfi1/hfi.h | 2 ++ 4 files changed, 14 insertions(+)
drivers/infiniband/hw/hfi1/chip.c +10 -0
@@ -1685,6 +1685,14 @@ static u64 access_sw_pio_drain(const struct cntr_entry *entry,return dd->verbs_dev.n_piodrain; } +static u64 access_sw_ctx0_seq_drop (const struct cntr_entry *entry, +void *context,int vl,int mode,u64 data) +{ +struct hfi1_devdata *dd = context; + +return dd->ctx0_seq_drop; +} +static u64 access_sw_vtx_wait (const struct cntr_entry *entry,void *context,int vl,int mode,u64 data) {
@@ -4249,6 +4257,8 @@ static struct cntr_entry dev_cntrs[DEV_CNTR_LAST] = { access_sw_cpu_intr), [C_SW_CPU_RCV_LIM ] =CNTR_ELEM ("RcvLimit" ,0 ,0 ,CNTR_NORMAL , access_sw_cpu_rcv_limit), +[C_SW_CTX0_SEQ_DROP ] =CNTR_ELEM ("SeqDrop0" ,0 ,0 ,CNTR_NORMAL , + access_sw_ctx0_seq_drop), [C_SW_VTX_WAIT ] =CNTR_ELEM ("vTxWait" ,0 ,0 ,CNTR_NORMAL , access_sw_vtx_wait), [C_SW_PIO_WAIT] = CNTR_ELEM("PioWait", 0, 0, CNTR_NORMAL,
drivers/infiniband/hw/hfi1/chip.h +1 -0
@@ -926,6 +926,7 @@ enum {C_DC_PG_STS_TX_MBE_CNT ,C_SW_CPU_INTR ,C_SW_CPU_RCV_LIM , +C_SW_CTX0_SEQ_DROP ,C_SW_VTX_WAIT ,C_SW_PIO_WAIT , C_SW_PIO_DRAIN,
drivers/infiniband/hw/hfi1/driver.c +1 -0
@@ -734,6 +734,7 @@ static noinline int skip_rcv_packet(struct hfi1_packet *packet, int thread) {int ret; + packet->rcd->dd->ctx0_seq_drop++;/* Set up for the next packet */ packet->rhqoff += packet->rsize;if (packet->rhqoff >= packet->maxcnt)
drivers/infiniband/hw/hfi1/hfi.h +2 -0
@@ -1153,6 +1153,8 @@ struct hfi1_devdata {char *boardname;/* human readable board info */ +u64 ctx0_seq_drop; +/* reset value */ u64 z_int_counter;u64 z_rcv_limit;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 275/459 IB/hfi1: Add RcvShortLengthErrCnt to hfi1stats
In reply to Sasha LevinFrom: Mike Marciniszyn <[email protected]>
[ Upstream commit 2c9d4e26d1ab27ceae2ded2ffe930f8e5f5b2a89 ]
This counter, RxShrErr, is required for error analysis and debug.
--- drivers/infiniband/hw/hfi1/chip.c | 1 + drivers/infiniband/hw/hfi1/chip.h | 1 + drivers/infiniband/hw/hfi1/chip_registers.h | 1 + 3 files changed, 3 insertions(+)
drivers/infiniband/hw/hfi1/chip.c +1 -0
@@ -4114,6 +4114,7 @@ def_access_ibp_counter(rc_crwaits);static struct cntr_entry dev_cntrs[DEV_CNTR_LAST ] = { [C_RCV_OVF ] =RXE32_DEV_CNTR_ELEM (RcvOverflow,RCV_BUF_OVFL_CNT ,CNTR_SYNTH ), [C_RX_LEN_ERR ] =RXE32_DEV_CNTR_ELEM (RxLenErr,RCV_LENGTH_ERR_CNT ,CNTR_SYNTH ), +[C_RX_SHORT_ERR ] =RXE32_DEV_CNTR_ELEM (RxShrErr,RCV_SHORT_ERR_CNT ,CNTR_SYNTH ), [C_RX_ICRC_ERR ] =RXE32_DEV_CNTR_ELEM (RxICrcErr,RCV_ICRC_ERR_CNT ,CNTR_SYNTH ), [C_RX_EBP ] =RXE32_DEV_CNTR_ELEM (RxEbpCnt,RCV_EBP_CNT ,CNTR_SYNTH ), [C_RX_TID_FULL] = RXE32_DEV_CNTR_ELEM(RxTIDFullEr, RCV_TID_FULL_ERR_CNT,
drivers/infiniband/hw/hfi1/chip.h +1 -0
@@ -859,6 +859,7 @@ static inline int idx_from_vl(int vl)enum {C_RCV_OVF =0 ,C_RX_LEN_ERR , +C_RX_SHORT_ERR ,C_RX_ICRC_ERR ,C_RX_EBP ,C_RX_TID_FULL ,
drivers/infiniband/hw/hfi1/chip_registers.h +1 -0
@@ -381,6 +381,7 @@#define DC_LCB_STS_LINK_TRANSFER_ACTIVE (DC_LCB_CSRS + 0x000000000468)#define DC_LCB_STS_ROUND_TRIP_LTP_CNT (DC_LCB_CSRS + 0x0000000004B0)#define RCV_LENGTH_ERR_CNT 0 +#define RCV_SHORT_ERR_CNT 2#define RCV_ICRC_ERR_CNT 6#define RCV_EBP_CNT 9#define RCV_BUF_OVFL_CNT 10
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 276/459 soc/tegra: fuse: Correct straps' address for older Tegra124 device trees
In reply to Sasha LevinFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit 2d9ea1934f8ef0dfb862d103389562cc28b4fc03 ]
Trying to read out Chip ID before APBMISC registers are mapped won't succeed, in a result Tegra124 gets a wrong address for the HW straps register if machine uses an old outdated device tree.
--- drivers/soc/tegra/fuse/tegra-apbmisc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/tegra/fuse/tegra-apbmisc.c +1 -1
@@ -123,7 +123,7 @@ void __init tegra_init_apbmisc(void) apbmisc.flags =IORESOURCE_MEM ;/* strapping options */ -if (tegra_get_chip_id () ==TEGRA124 ) { +if (of_machine_is_compatible ("nvidia,tegra124" )) { straps.start =0x7000e864 ; straps.end =0x7000e867 ; }else {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 277/459 ARM: dts: at91: sama5d3: fix maximum peripheral clock rates
In reply to Sasha LevinFrom: Alexandre Belloni <[email protected]>
[ Upstream commit ee0aa926ddb0bd8ba59e33e3803b3b5804e3f5da ]
Currently the maximum rate for peripheral clock is calculated based on a typical 133MHz MCK. The maximum frequency is defined in the datasheet as a ratio to MCK. Some sama5d3 platforms are using a 166MHz MCK. Update the device trees to match the maximum rate based on 166MHz.
--- arch/arm/boot/dts/sama5d3.dtsi | 28 ++++++++++++++-------------- arch/arm/boot/dts/sama5d3_can.dtsi | 4 ++-- arch/arm/boot/dts/sama5d3_uart.dtsi | 4 ++-- 3 files changed, 18 insertions(+), 18 deletions(-)
arch/arm/boot/dts/sama5d3.dtsi +14 -14
@@ -1188,49 +1188,49 @@ usart0_clk: usart0_clk { #clock-cells = <0>; reg = <12>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; usart1_clk: usart1_clk { #clock-cells = <0>; reg = <13>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; usart2_clk: usart2_clk { #clock-cells = <0>; reg = <14>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; usart3_clk: usart3_clk { #clock-cells = <0>; reg = <15>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; uart0_clk: uart0_clk { #clock-cells = <0>; reg = <16>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; twi0_clk: twi0_clk { reg = <18>; #clock-cells = <0>; - atmel,clk-output-range = <0 16625000>; + atmel,clk-output-range = <0 41500000>; }; twi1_clk: twi1_clk { #clock-cells = <0>; reg = <19>; - atmel,clk-output-range = <0 16625000>; + atmel,clk-output-range = <0 41500000>; }; twi2_clk: twi2_clk { #clock-cells = <0>; reg = <20>; - atmel,clk-output-range = <0 16625000>; + atmel,clk-output-range = <0 41500000>; }; mci0_clk: mci0_clk {
@@ -1246,19 +1246,19 @@ spi0_clk: spi0_clk { #clock-cells = <0>; reg = <24>; - atmel,clk-output-range = <0 133000000>; + atmel,clk-output-range = <0 166000000>; }; spi1_clk: spi1_clk { #clock-cells = <0>; reg = <25>; - atmel,clk-output-range = <0 133000000>; + atmel,clk-output-range = <0 166000000>; }; tcb0_clk: tcb0_clk { #clock-cells = <0>; reg = <26>; - atmel,clk-output-range = <0 133000000>; + atmel,clk-output-range = <0 166000000>; }; pwm_clk: pwm_clk {
@@ -1269,7 +1269,7 @@ adc_clk: adc_clk { #clock-cells = <0>; reg = <29>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; dma0_clk: dma0_clk {
@@ -1300,13 +1300,13 @@ ssc0_clk: ssc0_clk { #clock-cells = <0>; reg = <38>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; ssc1_clk: ssc1_clk { #clock-cells = <0>; reg = <39>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; sha_clk: sha_clk {
arch/arm/boot/dts/sama5d3_can.dtsi +2 -2
@@ -36,13 +36,13 @@ can0_clk: can0_clk { #clock-cells = <0>; reg = <40>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; can1_clk: can1_clk { #clock-cells = <0>; reg = <41>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; }; };
arch/arm/boot/dts/sama5d3_uart.dtsi +2 -2
@@ -41,13 +41,13 @@ uart0_clk: uart0_clk { #clock-cells = <0>; reg = <16>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; uart1_clk: uart1_clk { #clock-cells = <0>; reg = <17>; - atmel,clk-output-range = <0 66000000>; + atmel,clk-output-range = <0 83000000>; }; }; };
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 278/459 ARM: dts: at91: sama5d3: define clock rate range for tcb1
In reply to Sasha LevinFrom: Alexandre Belloni <[email protected]>
[ Upstream commit a7e0f3fc01df4b1b7077df777c37feae8c9e8b6d ]
The clock rate range for the TCB1 clock is missing. define it in the device tree.
--- arch/arm/boot/dts/sama5d3_tcb1.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/sama5d3_tcb1.dtsi +1 -0
@@ -22,6 +22,7 @@ tcb1_clk: tcb1_clk { #clock-cells = <0>; reg = <27>; + atmel,clk-output-range = <0 166000000>; }; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 279/459 efi/x86: Don't panic or BUG() on non-critical error conditions
In reply to Sasha LevinFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit e2d68a955e49d61fd0384f23e92058dc9b79be5e ]
The logic in __efi_enter_virtual_mode() does a number of steps in sequence, all of which may fail in one way or the other. In most cases, we simply print an error and disable EFI runtime services support, but in some cases, we BUG() or panic() and bring down the system when encountering conditions that we could easily handle in the same way.
While at it, replace a pointless page-to-virt-phys conversion with one that goes straight from struct page to physical.
--- arch/x86/platform/efi/efi.c | 28 ++++++++++++++-------------- arch/x86/platform/efi/efi_64.c | 9 +++++---- 2 files changed, 19 insertions(+), 18 deletions(-)
arch/x86/platform/efi/efi.c +14 -14
@@ -954,16 +954,14 @@ static void __init __efi_enter_virtual_mode(void)if (efi_alloc_page_tables ()) {pr_err ("Failed to allocate EFI page tables\n" ); -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; + goto err; }efi_merge_regions (); new_memmap =efi_map_regions (&count, &pg_shift);if (!new_memmap) {pr_err ("Error reallocating memory, EFI runtime non-functional!\n" ); -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; + goto err; } pa =__pa (new_memmap);
@@ -977,8 +975,7 @@ static void __init __efi_enter_virtual_mode(void)if (efi_memmap_init_late (pa, efi.memmap.desc_size * count)) {pr_err ("Failed to remap late EFI memory map\n" ); -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; + goto err; }if (efi_enabled (EFI_DBG )) {
@@ -986,12 +983,11 @@ static void __init __efi_enter_virtual_mode(void)efi_print_memmap (); } -BUG_ON (!efi.systab); +if (WARN_ON (!efi.systab)) + goto err; -if (efi_setup_page_tables (pa,1 << pg_shift)) { -clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); -return ; - } +if (efi_setup_page_tables (pa,1 << pg_shift)) + goto err;efi_sync_low_kernel_mappings ();
@@ -1011,9 +1007,9 @@ static void __init __efi_enter_virtual_mode(void) }if (status !=EFI_SUCCESS ) { -pr_alert ("Unable to switch EFI into virtual mode (status=%lx)!\n" , - status); -panic ("EFI call to SetVirtualAddressMap() failed!" ); +pr_err ("Unable to switch EFI into virtual mode (status=%lx)!\n" , + status); + goto err; }efi_free_boot_services ();
@@ -1042,6 +1038,10 @@ static void __init __efi_enter_virtual_mode(void)/* clean DUMMY object */ efi_delete_dummy_variable (); +return ; + +err: +clear_bit (EFI_RUNTIME_SERVICES , &efi.flags); }void __init efi_enter_virtual_mode (void )
arch/x86/platform/efi/efi_64.c +5 -4
@@ -392,11 +392,12 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)return 0 ; page =alloc_page (GFP_KERNEL |__GFP_DMA32); -if (!page) -panic ("Unable to allocate EFI runtime stack < 4GB\n" ); +if (!page) { +pr_err ("Unable to allocate EFI runtime stack < 4GB\n" ); +return 1 ; + } - efi_scratch.phys_stack =virt_to_phys (page_address (page)); - efi_scratch.phys_stack +=PAGE_SIZE ;/* stack grows down */ + efi_scratch.phys_stack =page_to_phys (page +1 );/* stack grows down */ npages = (_etext - _text) >>PAGE_SHIFT ; text =__pa (_text);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 280/459 rcu: Use WRITE_ONCE() for assignments to ->pprev for hlist_nulls
In reply to Sasha LevinFrom: "Paul E. McKenney" <[email protected]>
[ Upstream commit 860c8802ace14c646864795e057349c9fb2d60ad ]
Eric Dumazet supplied a KCSAN report of a bug that forces use of hlist_unhashed_lockless() from sk_unhashed():
------------------------------------------------------------------------
BUG: KCSAN: data-race in inet_unhash / inet_unhash
write to 0xffff8880a69a0170 of 8 bytes by interrupt on cpu 1:
__hlist_nulls_del include/linux/list_nulls.h:88 [inline] hlist_nulls_del_init_rcu include/linux/rculist_nulls.h:36 [inline] __sk_nulls_del_node_init_rcu include/net/sock.h:676 [inline] inet_unhash+0x38f/0x4a0 net/ipv4/inet_hashtables.c:612 tcp_set_state+0xfa/0x3e0 net/ipv4/tcp.c:2249 tcp_done+0x93/0x1e0 net/ipv4/tcp.c:3854 tcp_write_err+0x7e/0xc0 net/ipv4/tcp_timer.c:56 tcp_retransmit_timer+0x9b8/0x16d0 net/ipv4/tcp_timer.c:479 tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:599 tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:619 call_timer_fn+0x5f/0x2f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0xc0c/0xcd0 kernel/time/timer.c:1786 __do_softirq+0x115/0x33f kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0xbb/0xe0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71 arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571 default_idle_call+0x1e/0x40 kernel/sched/idle.c:94 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1af/0x280 kernel/sched/idle.c:263 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355 start_secondary+0x208/0x260 arch/x86/kernel/smpboot.c:264 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
read to 0xffff8880a69a0170 of 8 bytes by interrupt on cpu 0:
sk_unhashed include/net/sock.h:607 [inline] inet_unhash+0x3d/0x4a0 net/ipv4/inet_hashtables.c:592 tcp_set_state+0xfa/0x3e0 net/ipv4/tcp.c:2249 tcp_done+0x93/0x1e0 net/ipv4/tcp.c:3854 tcp_write_err+0x7e/0xc0 net/ipv4/tcp_timer.c:56 tcp_retransmit_timer+0x9b8/0x16d0 net/ipv4/tcp_timer.c:479 tcp_write_timer_handler+0x42d/0x510 net/ipv4/tcp_timer.c:599 tcp_write_timer+0xd1/0xf0 net/ipv4/tcp_timer.c:619 call_timer_fn+0x5f/0x2f0 kernel/time/timer.c:1404 expire_timers kernel/time/timer.c:1449 [inline] __run_timers kernel/time/timer.c:1773 [inline] __run_timers kernel/time/timer.c:1740 [inline] run_timer_softirq+0xc0c/0xcd0 kernel/time/timer.c:1786 __do_softirq+0x115/0x33f kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0xbb/0xe0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:536 [inline] smp_apic_timer_interrupt+0xe6/0x280 arch/x86/kernel/apic/apic.c:1137 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:830 native_safe_halt+0xe/0x10 arch/x86/kernel/paravirt.c:71 arch_cpu_idle+0x1f/0x30 arch/x86/kernel/process.c:571 default_idle_call+0x1e/0x40 kernel/sched/idle.c:94 cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x1af/0x280 kernel/sched/idle.c:263 cpu_startup_entry+0x1b/0x20 kernel/sched/idle.c:355 rest_init+0xec/0xf6 init/main.c:452 arch_call_rest_init+0x17/0x37 start_kernel+0x838/0x85e init/main.c:786 x86_64_start_reservations+0x29/0x2b arch/x86/kernel/head64.c:490 x86_64_start_kernel+0x72/0x76 arch/x86/kernel/head64.c:471 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
Reported by Kernel Concurrency Sanitizer on:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.4.0-rc6+ #0 Hardware name: Google Google Compute Engine/Google Compute Engine,
BIOS Google 01/01/2011
------------------------------------------------------------------------
This commit therefore replaces C-language assignments with WRITE_ONCE() in include/linux/list_nulls.h and include/linux/rculist_nulls.h.
--- include/linux/list_nulls.h | 8 ++++---- include/linux/rculist_nulls.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
include/linux/list_nulls.h +4 -4
@@ -72,10 +72,10 @@ static inline void hlist_nulls_add_head(struct hlist_nulls_node *n,struct hlist_nulls_node *first = h->first; n->next = first; - n->pprev = &h->first; +WRITE_ONCE (n->pprev, &h->first); h->first = n;if (!is_a_nulls (first)) - first->pprev = &n->next; +WRITE_ONCE (first->pprev, &n->next); }static inline void __hlist_nulls_del (struct hlist_nulls_node *n)
@@ -85,13 +85,13 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n)WRITE_ONCE (*pprev, next);if (!is_a_nulls (next)) - next->pprev = pprev; +WRITE_ONCE (next->pprev, pprev); }static inline void hlist_nulls_del (struct hlist_nulls_node *n) {__hlist_nulls_del (n); - n->pprev =LIST_POISON2 ; +WRITE_ONCE (n->pprev,LIST_POISON2 ); }/**
include/linux/rculist_nulls.h +4 -4
@@ -34,7 +34,7 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n) {if (!hlist_nulls_unhashed (n)) {__hlist_nulls_del (n); - n->pprev =NULL ; +WRITE_ONCE (n->pprev,NULL ); } }
@@ -66,7 +66,7 @@ static inline void hlist_nulls_del_init_rcu(struct hlist_nulls_node *n)static inline void hlist_nulls_del_rcu (struct hlist_nulls_node *n) {__hlist_nulls_del (n); - n->pprev =LIST_POISON2 ; +WRITE_ONCE (n->pprev,LIST_POISON2 ); }/**
@@ -94,10 +94,10 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n,struct hlist_nulls_node *first = h->first; n->next = first; - n->pprev = &h->first; +WRITE_ONCE (n->pprev, &h->first);rcu_assign_pointer (hlist_nulls_first_rcu (h), n);if (!is_a_nulls (first)) - first->pprev = &n->next; +WRITE_ONCE (first->pprev, &n->next); }/**
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 281/459 ARM: at91: pm: use SAM9X60 PMC's compatible
In reply to Sasha LevinFrom: Claudiu Beznea <[email protected]>
[ Upstream commit 6b9dfd986a81a999a27b6ed9dbe91203089c62dd ]
SAM9X60 PMC's has a different PMC. It was not integrated at the moment commit 01c7031cfa73 ("ARM: at91: pm: initial PM support for SAM9X60") was published.
--- arch/arm/mach-at91/pm.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-at91/pm.c +1 -0
@@ -751,6 +751,7 @@ static const struct of_device_id atmel_pmc_ids[] __initconst = { { .compatible = "atmel,sama5d3-pmc", .data = &pmc_infos[1] }, { .compatible = "atmel,sama5d4-pmc", .data = &pmc_infos[1] }, { .compatible = "atmel,sama5d2-pmc", .data = &pmc_infos[1] }, + { .compatible = "microchip,sam9x60-pmc", .data = &pmc_infos[1] }, { /* sentinel */ }, };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 282/459 ARM: at91: pm: use of_device_id array to find the proper shdwc node
In reply to Sasha LevinFrom: Claudiu Beznea <[email protected]>
[ Upstream commit ec6e618c8c018c1361d77789a100a5f6f6317178 ]
Use of_device_id array to find the proper shdwc compatibile node. SAM9X60's shdwc changes were not integrated when
commit eaedc0d379da ("ARM: at91: pm: add ULP1 support for SAM9X60") was integrated.
--- arch/arm/mach-at91/pm.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
arch/arm/mach-at91/pm.c +7 -1
@@ -691,6 +691,12 @@ static void __init at91_pm_use_default_mode(int pm_mode) soc_pm.data.suspend_mode =AT91_PM_ULP0 ; } +static const struct of_device_id atmel_shdwc_ids[] = { + { .compatible ="atmel,sama5d2-shdwc" }, + { .compatible ="microchip,sam9x60-shdwc" }, + {/* sentinel. */ } +}; +static void __init at91_pm_modes_init (void ) {struct device_node *np;
@@ -700,7 +706,7 @@ static void __init at91_pm_modes_init(void) !at91_is_pm_mode_active(AT91_PM_ULP1))return ; - np =of_find_compatible_node (NULL ,NULL ,"atmel,sama5d2-shdwc" ); + np =of_find_matching_node (NULL , atmel_shdwc_ids);if (!np) {pr_warn ("%s: failed to find shdwc!\n" , __func__); goto ulp1_default;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 283/459 Input: edt-ft5x06 - work around first register access error
In reply to Sasha LevinFrom: Philipp Zabel <[email protected]>
[ Upstream commit e112324cc0422c046f1cf54c56f333d34fa20885 ]
The EP0700MLP1 returns bogus data on the first register read access (reading the threshold parameter from register 0x00):
edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40
It ignores writes until then. This patch adds a dummy read after which the number of sensors and parameter read/writes work correctly.
--- drivers/input/touchscreen/edt-ft5x06.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/input/touchscreen/edt-ft5x06.c +7 -0
@@ -1041,6 +1041,7 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client, {const struct edt_i2c_chip_data *chip_data;struct edt_ft5x06_ts_data *tsdata; +u8 buf[2 ] = {0xfc ,0x00 };struct input_dev *input;unsigned long irq_flags;int error;
@@ -1110,6 +1111,12 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,return error; } +/* +* Dummy read access. EP0700MLP1 returns bogus data on the first +* register read access and ignores writes. +*/ +edt_ft5x06_ts_readwrite (tsdata->client,2 , buf,2 , buf); +edt_ft5x06_ts_set_regs (tsdata);edt_ft5x06_ts_get_defaults (&client->dev, tsdata);edt_ft5x06_ts_get_parameters (tsdata);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 284/459 bnxt: Detach page from page pool before sending up the stack
In reply to Sasha LevinFrom: Jonathan Lemon <[email protected]>
[ Upstream commit 3071c51783b39d6a676d02a9256c3b3f87804285 ]
When running in XDP mode, pages come from the page pool, and should be freed back to the same pool or specifically detached. Currently, when the driver re-initializes, the page pool destruction is delayed forever since it thinks there are oustanding pages.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -0
@@ -942,6 +942,7 @@ static struct sk_buff *bnxt_rx_page_skb(struct bnxt *bp, dma_addr -= bp->rx_dma_offset;dma_unmap_page_attrs (&bp->pdev->dev, dma_addr,PAGE_SIZE , bp->rx_dir,DMA_ATTR_WEAK_ORDERING ); +page_pool_release_page (rxr->page_pool, page);if (unlikely (!payload)) payload =eth_get_headlen (bp->dev, data_ptr, len);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 285/459 x86/nmi: Remove irq_work from the long duration NMI handler
In reply to Sasha LevinFrom: Changbin Du <[email protected]>
[ Upstream commit 248ed51048c40d36728e70914e38bffd7821da57 ]
First, printk() is NMI-context safe now since the safe printk() has been implemented and it already has an irq_work to make NMI-context safe.
Second, this NMI irq_work actually does not work if a NMI handler causes panic by watchdog timeout. It has no chance to run in such case, while the safe printk() will flush its per-cpu buffers before panicking.
While at it, repurpose the irq_work callback into a function which concentrates the NMI duration checking and makes the code easier to follow.
[ bp: Massage. ]
--- arch/x86/include/asm/nmi.h | 1 - arch/x86/kernel/nmi.c | 20 +++++++++----------- 2 files changed, 9 insertions(+), 12 deletions(-)
arch/x86/include/asm/nmi.h +0 -1
@@ -41,7 +41,6 @@ struct nmiaction {struct list_head list;nmi_handler_t handler;u64 max_duration; -struct irq_work irq_work;unsigned long flags;const char *name; };
arch/x86/kernel/nmi.c +9 -11
@@ -104,18 +104,22 @@ static int __init nmi_warning_debugfs(void) }fs_initcall (nmi_warning_debugfs); -static void nmi_max_handler (struct irq_work *w) +static void nmi_check_duration (struct nmiaction *action,u64 duration) { - struct nmiaction *a = container_of(w, struct nmiaction, irq_work); +u64 whole_msecs =READ_ONCE (action->max_duration);int remainder_ns, decimal_msecs; -u64 whole_msecs =READ_ONCE (a->max_duration); + +if (duration < nmi_longest_ns || duration < action->max_duration) +return ; + + action->max_duration = duration; remainder_ns =do_div (whole_msecs, (1000 *1000 )); decimal_msecs = remainder_ns /1000 ;printk_ratelimited (KERN_INFO "INFO: NMI handler (%ps) took too long to run: %lld.%03d msecs\n" , - a->handler, whole_msecs, decimal_msecs); + action->handler, whole_msecs, decimal_msecs); }static int nmi_handle (unsigned int type,struct pt_regs *regs)
@@ -142,11 +146,7 @@ static int nmi_handle(unsigned int type, struct pt_regs *regs) delta =sched_clock () - delta;trace_nmi_handler (a->handler, (int )delta, thishandled); -if (delta < nmi_longest_ns || delta < a->max_duration) -continue ; - - a->max_duration = delta; -irq_work_queue (&a->irq_work); +nmi_check_duration (a, delta); }rcu_read_unlock ();
@@ -164,8 +164,6 @@ int __register_nmi_handler(unsigned int type, struct nmiaction *action)if (!action->handler)return -EINVAL ; -init_irq_work (&action->irq_work, nmi_max_handler); -raw_spin_lock_irqsave (&desc->lock, flags);/*
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 286/459 wan: ixp4xx_hss: fix compile-testing on 64-bit
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 504c28c853ec5c626900b914b5833daf0581a344 ]
Change the driver to use portable integer types to avoid warnings during compile testing:
drivers/net/wan/ixp4xx_hss.c:863:21: error: cast to 'u32 *' (aka 'unsigned int *') from smaller integer type 'int' [-Werror,-Wint-to-pointer-cast]
memcpy_swab32(mem, (u32 *)((int)skb->data & ~3), bytes / 4);
^
drivers/net/wan/ixp4xx_hss.c:979:12: error: incompatible pointer types passing 'u32 *' (aka 'unsigned int *') to parameter of type 'dma_addr_t *' (aka 'unsigned long long *') [-Werror,-Wincompatible-pointer-types]
&port->desc_tab_phys)))
^~~~~~~~~~~~~~~~~~~~
include/linux/dmapool.h:27:20: note: passing argument to parameter 'handle' here
dma_addr_t *handle);
^--- drivers/net/wan/ixp4xx_hss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wan/ixp4xx_hss.c +2 -2
@@ -258,7 +258,7 @@ struct port {struct hss_plat_info *plat;buffer_t *rx_buff_tab[RX_DESCS ], *tx_buff_tab[TX_DESCS ];struct desc *desc_tab;/* coherent */ -u32 desc_tab_phys; +dma_addr_t desc_tab_phys;unsigned int id;unsigned int clock_type, clock_rate, loopback;unsigned int initialized, carrier;
@@ -858,7 +858,7 @@ static int hss_hdlc_xmit(struct sk_buff *skb, struct net_device *dev) dev->stats.tx_dropped++; return NETDEV_TX_OK; } -memcpy_swab32 (mem, (u32 *)((int )skb->data & ~3 ), bytes /4 ); +memcpy_swab32 (mem, (u32 *)((uintptr_t )skb->data & ~3 ), bytes /4 );dev_kfree_skb (skb);#endif
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 287/459 clocksource: davinci: only enable clockevents once tim34 is initialized
In reply to Sasha LevinFrom: Bartosz Golaszewski <[email protected]>
[ Upstream commit cea931c25104e6bddc42eb067f58193f355dbdd7 ]
The DM365 platform has a strange quirk (only present when using ancient u-boot - mainline u-boot v2013.01 and later works fine) where if we enable the second half of the timer in periodic mode before we do its initialization - the time won't start flowing and we can't boot.
When using more recent u-boot, we can enable the timer, then reinitialize it and all works fine.
To work around this issue only enable clockevents once tim34 is initialized i.e. move clockevents_config_and_register() below tim34 initialization.
--- drivers/clocksource/timer-davinci.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clocksource/timer-davinci.c +4 -4
@@ -302,10 +302,6 @@ int __init davinci_timer_register(struct clk *clk,return rv; } -clockevents_config_and_register (&clockevent->dev, tick_rate, -DAVINCI_TIMER_MIN_DELTA , -DAVINCI_TIMER_MAX_DELTA ); - davinci_clocksource.dev.rating =300 ; davinci_clocksource.dev.read = davinci_clocksource_read; davinci_clocksource.dev.mask =
@@ -323,6 +319,10 @@ int __init davinci_timer_register(struct clk *clk,davinci_clocksource_init_tim34 (base); } +clockevents_config_and_register (&clockevent->dev, tick_rate, +DAVINCI_TIMER_MIN_DELTA , +DAVINCI_TIMER_MAX_DELTA ); + rv =clocksource_register_hz (&davinci_clocksource.dev, tick_rate);if (rv) {pr_err ("Unable to register clocksource" );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 288/459 arm64: dts: rockchip: fix dwmmc clock name for px30
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit 7f2147350291569acd1df5a26dcdfc573916016f ]
An experimental test with the command below gives this error:px30-evb.dt.yaml: dwmmc@ff390000: clock-names:2:
'ciu-drive' was expected
'ciu-drv' is not a valid dwmmc clock name,
so fix this by changing it to 'ciu-drive'.
make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm64/boot/dts/rockchip/px30.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/rockchip/px30.dtsi +3 -3
@@ -768,7 +768,7 @@ interrupts = <GIC_SPI 54 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru HCLK_SDMMC>, <&cru SCLK_SDMMC>, <&cru SCLK_SDMMC_DRV>, <&cru SCLK_SDMMC_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
@@ -783,7 +783,7 @@ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru HCLK_SDIO>, <&cru SCLK_SDIO>, <&cru SCLK_SDIO_DRV>, <&cru SCLK_SDIO_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; pinctrl-names = "default";
@@ -798,7 +798,7 @@ interrupts = <GIC_SPI 53 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cru HCLK_EMMC>, <&cru SCLK_EMMC>, <&cru SCLK_EMMC_DRV>, <&cru SCLK_EMMC_SAMPLE>; - clock-names = "biu", "ciu", "ciu-drv", "ciu-sample"; + clock-names = "biu", "ciu", "ciu-drive", "ciu-sample"; fifo-depth = <0x100>; max-frequency = <150000000>; power-domains = <&power PX30_PD_MMC_NAND>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 289/459 arm64: dts: rockchip: add reg property to brcmf sub-nodes
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit 96ff264bccb22175bbe2185a1eb5204ca3c5f03f ]
An experimental test with the command below gives this error:rk3399-firefly.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required propertyrk3399-orangepi.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property rk3399-khadas-edge.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property rk3399-khadas-edge-captain.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property rk3399-khadas-edge-v.dt.yaml: dwmmc@fe310000: wifi@1:
'reg' is a required property
So fix this by adding a reg property to the brcmf sub node. Also add #address-cells and #size-cells to prevent more warnings.
make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm64/boot/dts/rockchip/rk3399-firefly.dts | 3 +++ arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi | 3 +++ arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts | 3 +++ 3 files changed, 9 insertions(+)
arch/arm64/boot/dts/rockchip/rk3399-firefly.dts +3 -0
@@ -669,9 +669,12 @@ vqmmc-supply = &vcc1v8_s3; /* IO line */ vmmc-supply = &vcc_sdio; /* card's power */ + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio0>; interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi +3 -0
@@ -654,9 +654,12 @@ sd-uhs-sdr104; vqmmc-supply = <&vcc1v8_s3>; vmmc-supply = <&vccio_sd>; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio0>; interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
arch/arm64/boot/dts/rockchip/rk3399-orangepi.dts +3 -0
@@ -648,9 +648,12 @@ pinctrl-names = "default"; pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>; sd-uhs-sdr104; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio0>; interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 290/459 ARM: dts: rockchip: add reg property to brcmf sub node for rk3188-bqedison2qc
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit cf206bca178cd5b5a436494b2e0cea75295944f4 ]
An experimental test with the command below gives this error:rk3188-bqedison2qc.dt.yaml: dwmmc@10218000: wifi@1:
'reg' is a required property
So fix this by adding a reg property to the brcmf sub node. Also add #address-cells and #size-cells to prevent more warnings.
make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml
--- arch/arm/boot/dts/rk3188-bqedison2qc.dts | 3 +++ 1 file changed, 3 insertions(+)
arch/arm/boot/dts/rk3188-bqedison2qc.dts +3 -0
@@ -466,9 +466,12 @@ pinctrl-names = "default"; pinctrl-0 = <&sd1_clk>, <&sd1_cmd>, <&sd1_bus4>; vmmcq-supply = <&vccio_wl>; + #address-cells = <1>; + #size-cells = <0>; status = "okay"; brcmf: wifi@1 { + reg = <1>; compatible = "brcm,bcm4329-fmac"; interrupt-parent = <&gpio3>; interrupts = <RK_PD2 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 291/459 ALSA: usb-audio: Add boot quirk for MOTU M Series
In reply to Sasha LevinFrom: Alexander Tsoy <[email protected]>
[ Upstream commit 73ac9f5e5b43a5dbadb61f27dae7a971f7ec0d22 ]
Add delay to make sure that audio urbs are not sent too early. Otherwise the device hangs. Windows driver makes ~2s delay, so use about the same time delay value.
snd_usb_apply_boot_quirk() is called 3 times for my MOTU M4, which is an overkill. Thus a quirk that is called only once is implemented.
Also send two vendor-specific control messages before and after the delay. This behaviour is blindly copied from the Windows driver.
--- sound/usb/card.c | 4 ++++ sound/usb/quirks.c | 38 ++++++++++++++++++++++++++++++++++++++ sound/usb/quirks.h | 5 +++++ 3 files changed, 47 insertions(+)
sound/usb/card.c +4 -0
@@ -597,6 +597,10 @@ static int usb_audio_probe(struct usb_interface *intf, } }if (! chip) { + err =snd_usb_apply_boot_quirk_once (dev, intf, quirk, id); +if (err <0 ) +return err; +/* it's a fresh one. * now look for an empty slot and create a new card instance */
sound/usb/quirks.c +38 -0
@@ -1113,6 +1113,31 @@ static int snd_usb_motu_microbookii_boot_quirk(struct usb_device *dev)return err; } +static int snd_usb_motu_m_series_boot_quirk (struct usb_device *dev) +{ +int ret; + +if (snd_usb_pipe_sanity_check (dev,usb_sndctrlpipe (dev,0 ))) +return -EINVAL ; + ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), +1 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE , +0x0 ,0 ,NULL ,0 ,1000 ); + +if (ret <0 ) +return ret; + +msleep (2000 ); + + ret =usb_control_msg (dev,usb_sndctrlpipe (dev,0 ), +1 ,USB_TYPE_VENDOR |USB_RECIP_DEVICE , +0x20 ,0 ,NULL ,0 ,1000 ); + +if (ret <0 ) +return ret; + +return 0 ; +} +/* * Setup quirks */
@@ -1297,6 +1322,19 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,return 0 ; } +int snd_usb_apply_boot_quirk_once (struct usb_device *dev, +struct usb_interface *intf, +const struct snd_usb_audio_quirk *quirk, +unsigned int id) +{ +switch (id) { +case USB_ID (0x07fd ,0x0008 ):/* MOTU M Series */ +return snd_usb_motu_m_series_boot_quirk (dev); + } + +return 0 ; +} +/* * check if the device uses big-endian samples */
sound/usb/quirks.h +5 -0
@@ -20,6 +20,11 @@ int snd_usb_apply_boot_quirk(struct usb_device *dev,const struct snd_usb_audio_quirk *quirk, unsigned int usb_id); +int snd_usb_apply_boot_quirk_once (struct usb_device *dev, +struct usb_interface *intf, +const struct snd_usb_audio_quirk *quirk, +unsigned int usb_id); +void snd_usb_set_format_quirk (struct snd_usb_substream *subs,struct audioformat *fmt);
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 292/459 ASoC: atmel: fix build error with CONFIG_SND_ATMEL_SOC_DMA=m
In reply to Sasha LevinFrom: Chen Zhou <[email protected]>
[ Upstream commit 8fea78029f5e6ed734ae1957bef23cfda1af4354 ]
If CONFIG_SND_ATMEL_SOC_DMA=m, build error:
sound/soc/atmel/atmel_ssc_dai.o: In function `atmel_ssc_set_audio':
(.text+0x7cd): undefined reference to `atmel_pcm_dma_platform_register'
Function atmel_pcm_dma_platform_register is defined under CONFIG SND_ATMEL_SOC_DMA, so select SND_ATMEL_SOC_DMA in CONFIG SND_ATMEL_SOC_SSC, same to CONFIG_SND_ATMEL_SOC_PDC.
--- sound/soc/atmel/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/atmel/Kconfig +2 -0
@@ -19,6 +19,8 @@ config SND_ATMEL_SOC_DMA config SND_ATMEL_SOC_SSC tristate + select SND_ATMEL_SOC_DMA + select SND_ATMEL_SOC_PDC config SND_ATMEL_SOC_SSC_PDC tristate "SoC PCM DAI support for AT91 SSC controller using PDC"
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 293/459 PCI: Don't disable bridge BARs when assigning bus resources
In reply to Sasha LevinFrom: Logan Gunthorpe <[email protected]>
[ Upstream commit 9db8dc6d0785225c42a37be7b44d1b07b31b8957 ]
Some PCI bridges implement BARs in addition to bridge windows. For example, here's a PLX switch:
04:00.0 PCI bridge: PLX Technology, Inc. PEX 8724 24-Lane, 6-Port PCI
Express Gen 3 (8 GT/s) Switch, 19 x 19mm FCBGA (rev ca) (prog-if 00 [Normal decode])
Flags: bus master, fast devsel, latency 0, IRQ 30, NUMA node 0 Memory at 90a00000 (32-bit, non-prefetchable) [size=256K]
Bus: primary=04, secondary=05, subordinate=0a, sec-latency=0 I/O behind bridge: 00002000-00003fff
Memory behind bridge: 90000000-909fffff
Prefetchable memory behind bridge: 0000380000800000-0000380000bfffff
Previously, when the kernel assigned resource addresses (with the pci=realloc command line parameter, for example) it could clear the struct resource corresponding to the BAR. When this happened, lspci would report this BAR as "ignored":
Region 0: Memory at <ignored> (32-bit, non-prefetchable) [size=256K]
This is because the kernel reports a zero start address and zero flags in the corresponding sysfs resource file and in /proc/bus/pci/devices. Investigation with 'lspci -x', however, shows the BIOS-assigned address will still be programmed in the device's BAR registers.
It's clearly a bug that the kernel lost track of the BAR value, but in most cases, this still won't result in a visible issue because nothing uses the memory, so nothing is affected. However, when an IOMMU is in use, it will not reserve this space in the IOVA because the kernel no longer thinks the range is valid. (See dmar_init_reserved_ranges() for the Intel implementation of this.)
Without the proper reserved range, a DMA mapping may allocate an IOVA that matches a bridge BAR, which results in DMA accesses going to the BAR instead of the intended RAM.
The problem was in pci_assign_unassigned_root_bus_resources(). When any resource from a bridge device fails to get assigned, the code set the resource's flags to zero. This makes sense for bridge windows, as they will be re-enabled later, but for regular BARs, it makes the kernel permanently lose track of the fact that they decode address space.
Change pci_assign_unassigned_root_bus_resources() and pci_assign_unassigned_bridge_resources() so they only clear "res->flags" for bridge *windows*, not bridge BARs.
--- drivers/pci/setup-bus.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/pci/setup-bus.c +16 -4
@@ -1785,12 +1785,18 @@ void pci_assign_unassigned_root_bus_resources(struct pci_bus *bus)/* Restore size and flags */ list_for_each_entry (fail_res, &fail_head, list) {struct resource *res = fail_res->res; +int idx; res->start = fail_res->start; res->end = fail_res->end; res->flags = fail_res->flags; -if (fail_res->dev->subordinate) - res->flags =0 ; + +if (pci_is_bridge (fail_res->dev)) { + idx = res - &fail_res->dev->resource[0 ]; +if (idx >=PCI_BRIDGE_RESOURCES && + idx <=PCI_BRIDGE_RESOURCE_END ) + res->flags =0 ; + } }free_list (&fail_head);
@@ -2037,12 +2043,18 @@ void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge)/* Restore size and flags */ list_for_each_entry (fail_res, &fail_head, list) {struct resource *res = fail_res->res; +int idx; res->start = fail_res->start; res->end = fail_res->end; res->flags = fail_res->flags; -if (fail_res->dev->subordinate) - res->flags =0 ; + +if (pci_is_bridge (fail_res->dev)) { + idx = res - &fail_res->dev->resource[0 ]; +if (idx >=PCI_BRIDGE_RESOURCES && + idx <=PCI_BRIDGE_RESOURCE_END ) + res->flags =0 ; + } }free_list (&fail_head);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 294/459 raid6/test: fix a compilation warning
In reply to Sasha LevinFrom: Zhengyuan Liu <[email protected]>
[ Upstream commit 5e5ac01c2b8802921fee680518a986011cb59820 ]
The compilation warning is redefination showed as following:
In file included from tables.c:2:
../../../include/linux/export.h:180: warning: "EXPORT_SYMBOL" redefined
#define EXPORT_SYMBOL(sym) __EXPORT_SYMBOL(sym, "")
In file included from tables.c:1:
../../../include/linux/raid/pq.h:61: note: this is the location of the previous definition
#define EXPORT_SYMBOL(sym)
--- include/linux/raid/pq.h | 2 ++ lib/raid6/mktables.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-)
include/linux/raid/pq.h +2 -0
@@ -58,7 +58,9 @@ extern const char raid6_empty_zero_page[PAGE_SIZE];#define enable_kernel_altivec ()#define disable_kernel_altivec () +#undef EXPORT_SYMBOL#define EXPORT_SYMBOL (sym) +#undef EXPORT_SYMBOL_GPL#define EXPORT_SYMBOL_GPL (sym)#define MODULE_LICENSE (licence)#define MODULE_DESCRIPTION (desc)
lib/raid6/mktables.c +1 -1
@@ -56,8 +56,8 @@ int main(int argc, char *argv[])uint8_t v;uint8_t exptbl[256 ], invtbl[256 ]; -printf ("#include <linux/raid/pq.h>\n" );printf ("#include <linux/export.h>\n" ); +printf ("#include <linux/raid/pq.h>\n" );/* Compute multiplication table */ printf("\nconst u8 __attribute__((aligned(256)))\n"
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 295/459 RDMA/uverbs: Remove needs_kfree_rcu from uverbs_obj_type_class
In reply to Sasha LevinFrom: Jason Gunthorpe <[email protected]>
[ Upstream commit 8bdf9dd984c18375d1090ddeb1792511f619c5c1 ]
After device disassociation the uapi_objects are destroyed and freed, however it is still possible that core code can be holding a kref on the uobject. When it finally goes to uverbs_uobject_free() via the kref_put() it can trigger a use-after-free on the uapi_object.
Since needs_kfree_rcu is a micro optimization that only benefits file uobjects, just get rid of it. There is no harm in using kfree_rcu even if it isn't required, and the number of involved objects is small.
--- drivers/infiniband/core/rdma_core.c | 23 +---------------------- include/rdma/uverbs_types.h | 1 - 2 files changed, 1 insertion(+), 23 deletions(-)
drivers/infiniband/core/rdma_core.c +1 -22
@@ -49,13 +49,7 @@ void uverbs_uobject_get(struct ib_uobject *uobject)static void uverbs_uobject_free (struct kref *ref) { -struct ib_uobject *uobj = - container_of(ref, struct ib_uobject, ref); - -if (uobj->uapi_object->type_class->needs_kfree_rcu) -kfree_rcu (uobj, rcu); -else -kfree (uobj); + kfree_rcu(container_of(ref, struct ib_uobject, ref), rcu); }void uverbs_uobject_put (struct ib_uobject *uobject)
@@ -744,20 +738,6 @@ const struct uverbs_obj_type_class uverbs_idr_class = { .lookup_put = lookup_put_idr_uobject, .destroy_hw = destroy_hw_idr_uobject, .remove_handle = remove_handle_idr_uobject, -/* -* When we destroy an object, we first just lock it for WRITE and -* actually DESTROY it in the finalize stage. So, the problematic -* scenario is when we just started the finalize stage of the -* destruction (nothing was executed yet). Now, the other thread -* fetched the object for READ access, but it didn't lock it yet. -* The DESTROY thread continues and starts destroying the object. -* When the other thread continue - without the RCU, it would -* access freed memory. However, the rcu_read_lock delays the free -* until the rcu_read_lock of the READ operation quits. Since the -* exclusive lock of the object is still taken by the DESTROY flow, the -* READ operation will get -EBUSY and it'll just bail out. -*/ - .needs_kfree_rcu = true, };EXPORT_SYMBOL (uverbs_idr_class);
@@ -919,7 +899,6 @@ const struct uverbs_obj_type_class uverbs_fd_class = { .lookup_put = lookup_put_fd_uobject, .destroy_hw = destroy_hw_fd_uobject, .remove_handle = remove_handle_fd_uobject, - .needs_kfree_rcu = false, };EXPORT_SYMBOL (uverbs_fd_class);
include/rdma/uverbs_types.h +0 -1
@@ -98,7 +98,6 @@ struct uverbs_obj_type_class {enum rdma_remove_reason why, struct uverbs_attr_bundle *attrs);void (*remove_handle)(struct ib_uobject *uobj); -u8 needs_kfree_rcu; };struct uverbs_obj_type {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 296/459 tty: synclinkmp: Adjust indentation in several functions
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 1feedf61e7265128244f6993f23421f33dd93dbc ]
Clang warns:
../drivers/tty/synclinkmp.c:1456:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (C_CRTSCTS(tty)) {
^
../drivers/tty/synclinkmp.c:1453:2: note: previous statement is here
if (I_IXOFF(tty))
^
../drivers/tty/synclinkmp.c:2473:8: warning: misleading indentation;
statement is not part of the previous 'if' [-Wmisleading-indentation]
info->port.tty->hw_stopped = 0;
^../drivers/tty/synclinkmp.c:2471:7: note: previous statement is here
if ( debug_level >= DEBUG_LEVEL_ISR ) ^../drivers/tty/synclinkmp.c:2482:8: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
info->port.tty->hw_stopped = 1;
^../drivers/tty/synclinkmp.c:2480:7: note: previous statement is here
if ( debug_level >= DEBUG_LEVEL_ISR ) ^../drivers/tty/synclinkmp.c:2809:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
^
../drivers/tty/synclinkmp.c:2807:2: note: previous statement is here
if (I_INPCK(info->port.tty))
^
../drivers/tty/synclinkmp.c:3246:3: warning: misleading indentation;
statement is not part of the previous 'else' [-Wmisleading-indentation]
set_signals(info);
^
../drivers/tty/synclinkmp.c:3244:2: note: previous statement is here
else
^5 warnings generated.
The indentation on these lines is not at all consistent, tabs and spaces are mixed together. Convert to just using tabs to be consistent with the Linux kernel coding style and eliminate these warnings from clang.
--- drivers/tty/synclinkmp.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/tty/synclinkmp.c +12 -12
@@ -1453,10 +1453,10 @@ static void throttle(struct tty_struct * tty)if (I_IXOFF (tty))send_xchar (tty,STOP_CHAR (tty)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->serial_signals &= ~SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -1482,10 +1482,10 @@ static void unthrottle(struct tty_struct * tty)send_xchar (tty,START_CHAR (tty)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->serial_signals |= SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -2470,7 +2470,7 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )if (status & SerialSignal_CTS) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx start..." ); - info->port.tty->hw_stopped =0 ; + info->port.tty->hw_stopped =0 ;tx_start (info); info->pending_bh |=BH_TRANSMIT ;return ;
@@ -2479,7 +2479,7 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )if (!(status & SerialSignal_CTS)) {if ( debug_level >=DEBUG_LEVEL_ISR )printk ("CTS tx stop..." ); - info->port.tty->hw_stopped =1 ; + info->port.tty->hw_stopped =1 ;tx_stop (info); } }
@@ -2806,8 +2806,8 @@ static void change_params(SLMP_INFO *info) info->read_status_mask2 =OVRN ;if (I_INPCK (info->port.tty)) info->read_status_mask2 |=PE |FRME ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) - info->read_status_mask1 |=BRKD ; +if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) + info->read_status_mask1 |=BRKD ;if (I_IGNPAR (info->port.tty)) info->ignore_status_mask2 |=PE |FRME ;if (I_IGNBRK (info->port.tty)) {
@@ -3177,7 +3177,7 @@ static int tiocmget(struct tty_struct *tty)unsigned long flags;spin_lock_irqsave (&info->lock,flags); -get_signals (info); +get_signals (info);spin_unlock_irqrestore (&info->lock,flags); result = ((info->serial_signals & SerialSignal_RTS) ? TIOCM_RTS : 0) |
@@ -3215,7 +3215,7 @@ static int tiocmset(struct tty_struct *tty, info->serial_signals &= ~SerialSignal_DTR;spin_lock_irqsave (&info->lock,flags); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags);return 0 ;
@@ -3227,7 +3227,7 @@ static int carrier_raised(struct tty_port *port)unsigned long flags;spin_lock_irqsave (&info->lock,flags); -get_signals (info); +get_signals (info);spin_unlock_irqrestore (&info->lock,flags);return (info->serial_signals & SerialSignal_DCD) ?1 :0 ;
@@ -3243,7 +3243,7 @@ static void dtr_rts(struct tty_port *port, int on) info->serial_signals |= SerialSignal_RTS | SerialSignal_DTR; else info->serial_signals &= ~(SerialSignal_RTS | SerialSignal_DTR); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 297/459 tty: synclink_gt: Adjust indentation in several functions
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 446e76873b5e4e70bdee5db2f2a894d5b4a7d081 ]
Clang warns:
../drivers/tty/synclink_gt.c:1337:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (C_CRTSCTS(tty)) {
^
../drivers/tty/synclink_gt.c:1335:2: note: previous statement is here
if (I_IXOFF(tty))
^
../drivers/tty/synclink_gt.c:2563:3: warning: misleading indentation;
statement is not part of the previous 'if' [-Wmisleading-indentation]
if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty))
^
../drivers/tty/synclink_gt.c:2561:2: note: previous statement is here
if (I_INPCK(info->port.tty))
^
../drivers/tty/synclink_gt.c:3221:3: warning: misleading indentation;
statement is not part of the previous 'else' [-Wmisleading-indentation]
set_signals(info);
^
../drivers/tty/synclink_gt.c:3219:2: note: previous statement is here
else
^3 warnings generated.
The indentation on these lines is not at all consistent, tabs and spaces are mixed together. Convert to just using tabs to be consistent with the Linux kernel coding style and eliminate these warnings from clang.
--- drivers/tty/synclink_gt.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
drivers/tty/synclink_gt.c +9 -9
@@ -1334,10 +1334,10 @@ static void throttle(struct tty_struct * tty)DBGINFO (("%s throttle\n" , info->device_name));if (I_IXOFF (tty))send_xchar (tty,STOP_CHAR (tty)); -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->signals &= ~SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -1359,10 +1359,10 @@ static void unthrottle(struct tty_struct * tty)else send_xchar (tty,START_CHAR (tty)); } -if (C_CRTSCTS (tty)) { +if (C_CRTSCTS (tty)) {spin_lock_irqsave (&info->lock,flags); info->signals |= SerialSignal_RTS; -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); } }
@@ -2560,8 +2560,8 @@ static void change_params(struct slgt_info *info) info->read_status_mask =IRQ_RXOVER ;if (I_INPCK (info->port.tty)) info->read_status_mask |=MASK_PARITY |MASK_FRAMING ; -if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) - info->read_status_mask |=MASK_BREAK ; +if (I_BRKINT (info->port.tty) ||I_PARMRK (info->port.tty)) + info->read_status_mask |=MASK_BREAK ;if (I_IGNPAR (info->port.tty)) info->ignore_status_mask |=MASK_PARITY |MASK_FRAMING ;if (I_IGNBRK (info->port.tty)) {
@@ -3192,7 +3192,7 @@ static int tiocmset(struct tty_struct *tty, info->signals &= ~SerialSignal_DTR;spin_lock_irqsave (&info->lock,flags); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags);return 0 ; }
@@ -3203,7 +3203,7 @@ static int carrier_raised(struct tty_port *port) struct slgt_info *info = container_of(port, struct slgt_info, port);spin_lock_irqsave (&info->lock,flags); -get_signals (info); +get_signals (info);spin_unlock_irqrestore (&info->lock,flags);return (info->signals & SerialSignal_DCD) ?1 :0 ; }
@@ -3218,7 +3218,7 @@ static void dtr_rts(struct tty_port *port, int on) info->signals |= SerialSignal_RTS | SerialSignal_DTR; else info->signals &= ~(SerialSignal_RTS | SerialSignal_DTR); -set_signals (info); +set_signals (info);spin_unlock_irqrestore (&info->lock,flags); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 298/459 misc: genwqe: fix compile warnings
In reply to Sasha LevinFrom: Hongbo Yao <[email protected]>
[ Upstream commit 8edf4cd193067ac5e03fd9580f1affbb6a3f729b ]
Using the following command will get compile warnings:
make W=1 drivers/misc/genwqe/card_ddcb.o ARCH=x86_64
drivers/misc/genwqe/card_ddcb.c: In function setup_ddcb_queue:drivers/misc/genwqe/card_ddcb.c:1024:6: warning: variable rc set but not used [-Wunused-but-set-variable] drivers/misc/genwqe/card_ddcb.c: In function genwqe_card_thread:drivers/misc/genwqe/card_ddcb.c:1190:23: warning: variable rc set but not used [-Wunused-but-set-variable]
--- drivers/misc/genwqe/card_ddcb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/misc/genwqe/card_ddcb.c +4 -4
@@ -1084,7 +1084,7 @@ static int setup_ddcb_queue(struct genwqe_dev *cd, struct ddcb_queue *queue) queue->ddcb_daddr); queue->ddcb_vaddr =NULL ; queue->ddcb_daddr =0ull ; -return -ENODEV ; +return rc; }
@@ -1179,7 +1179,7 @@ static irqreturn_t genwqe_vf_isr(int irq, void *dev_id)*/ static int genwqe_card_thread (void *data) { -int should_stop =0 , rc =0 ; +int should_stop =0 ;struct genwqe_dev *cd = (struct genwqe_dev *)data;while (!kthread_should_stop ()) {
@@ -1187,12 +1187,12 @@ static int genwqe_card_thread(void *data)genwqe_check_ddcb_queue (cd, &cd->queue);if (GENWQE_POLLING_ENABLED ) { - rc =wait_event_interruptible_timeout ( +wait_event_interruptible_timeout ( cd->queue_waitq,genwqe_ddcbs_in_flight (cd) || (should_stop =kthread_should_stop ()),1 ); }else { - rc =wait_event_interruptible_timeout ( +wait_event_interruptible_timeout ( cd->queue_waitq,genwqe_next_ddcb_ready (cd) || (should_stop =kthread_should_stop ()),HZ );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 299/459 misc: xilinx_sdfec: fix xsdfec_poll()'s return type
In reply to Sasha LevinFrom: Luc Van Oostenryck <[email protected]>
[ Upstream commit fa4e7fc1386078edcfddd8848cb0374f4af74fe7 ]
xsdfec_poll() is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type.
Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for __poll_t.
--- drivers/misc/xilinx_sdfec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/misc/xilinx_sdfec.c +5 -5
@@ -1025,25 +1025,25 @@ static long xsdfec_dev_compat_ioctl(struct file *file, unsigned int cmd, }#endif -static unsigned int xsdfec_poll (struct file *file,poll_table *wait) +static __poll_t xsdfec_poll (struct file *file,poll_table *wait) { -unsigned int mask =0 ; +__poll_t mask =0 ;struct xsdfec_dev *xsdfec; xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev);if (!xsdfec) -return POLLNVAL |POLLHUP ; +return EPOLLNVAL |EPOLLHUP ;poll_wait (file, &xsdfec->waitq, wait);/* XSDFEC ISR detected an error */ spin_lock_irqsave (&xsdfec->error_data_lock, xsdfec->flags);if (xsdfec->state_updated) - mask |=POLLIN |POLLPRI ; + mask |=EPOLLIN |EPOLLPRI ;if (xsdfec->stats_updated) - mask |=POLLIN |POLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ;spin_unlock_irqrestore (&xsdfec->error_data_lock, xsdfec->flags);return mask;
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
RE: [PATCH AUTOSEL 5.4 299/459] misc: xilinx_sdfec: fix xsdfec_poll()'s return type
Quoted 68 lines
-----Original Message-----
From: Sasha Levin <[email protected]>
Sent: Friday 14 February 2020 15:59
To: [email protected]; [email protected]
Cc: Luc Van Oostenryck <[email protected]>; Derek Kiernan <[email protected]>; Dragan Cvetic <[email protected]>; Greg Kroah-Hartman <[email protected]>; Sasha Levin <[email protected]>; linux-arm- [email protected]
Subject: [PATCH AUTOSEL 5.4 299/459] misc:xilinx_sdfec: fix xsdfec_poll()'s return typeFrom: Luc Van Oostenryck <[email protected]>
[ Upstream commit
fa4e7fc1386078edcfddd8848cb0374f4af74fe7]
xsdfec_poll()is defined as returning 'unsigned int' but the .poll method is declared as returning '__poll_t', a bitwise type.Fix this by using the proper return type and using the EPOLL constants instead of the POLL ones, as required for
__poll_t.CC Derek Kiernan <[email protected]>CC Dragan Cvetic <[email protected]>Signed-off-by Luc Van Oostenryck <[email protected]>Acked-by Dragan Cvetic <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/misc/xilinx_sdfec.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)drivers/misc/xilinx_sdfec.c +5
-6@@ -1025,25 +1025,25 @@ static long xsdfec_dev_compat_ioctl(struct file *file, unsigned int cmd, }#endif -static unsigned int xsdfec_poll (struct file *file,poll_table *wait) +static __poll_t xsdfec_poll (struct file *file,poll_table *wait) { -unsigned int mask =0 ; +__poll_t mask =0 ;struct xsdfec_dev *xsdfec; xsdfec = container_of(file->private_data, struct xsdfec_dev, miscdev);if (!xsdfec) -return POLLNVAL |POLLHUP ; +return EPOLLNVAL |EPOLLHUP ;poll_wait (file, &xsdfec->waitq, wait);/* XSDFEC ISR detected an error */ spin_lock_irqsave (&xsdfec->error_data_lock, xsdfec->flags);if (xsdfec->state_updated) - mask |=POLLIN |POLLPRI ; + mask |=EPOLLIN |EPOLLPRI ;if (xsdfec->stats_updated) - mask |=POLLIN |POLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ;spin_unlock_irqrestore (&xsdfec->error_data_lock, xsdfec->flags);return mask; --
Quoted 1 line
2.20.1
Sasha Levin
maintainerPATCH 300/459 visorbus: fix uninitialized variable access
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit caf82f727e69b647f09d57a1fc56e69d22a5f483 ]
The setup_crash_devices_work_queue function only partially initializes the message it sends to chipset_init, leading to undefined behavior:
drivers/visorbus/visorchipset.c: In function 'setup_crash_devices_work_queue':drivers/visorbus/visorchipset.c:333:6: error: '((unsigned char*)&msg.hdr.flags)[0]' is used uninitialized in this function [-Werror=uninitialized]
if (inmsg->hdr.flags.response_expected)
Set up the entire structure, zero-initializing the 'response_expected' flag.
This was apparently found by the patch that added the -O3 build option in Kconfig.
--- drivers/visorbus/visorchipset.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/visorbus/visorchipset.c +7 -4
@@ -1210,14 +1210,17 @@ static void setup_crash_devices_work_queue(struct work_struct *work) {struct controlvm_message local_crash_bus_msg;struct controlvm_message local_crash_dev_msg; -struct controlvm_message msg; +struct controlvm_message msg = { + .hdr.id =CONTROLVM_CHIPSET_INIT , + .cmd.init_chipset = { + .bus_count =23 , + .switch_count =0 , + }, + };u32 local_crash_msg_offset;u16 local_crash_msg_count;/* send init chipset msg */ - msg.hdr.id =CONTROLVM_CHIPSET_INIT ; - msg.cmd.init_chipset.bus_count =23 ; - msg.cmd.init_chipset.switch_count =0 ;chipset_init (&msg);/* get saved message count */ if (visorchannel_read(chipset_dev->controlvm_channel,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 301/459 driver core: platform: Prevent resouce overflow from causing infinite loops
In reply to Sasha LevinFrom: Simon Schwartz <[email protected]>
[ Upstream commit 39cc539f90d035a293240c9443af50be55ee81b8 ]
num_resources in the platform_device struct is declared as a u32. The for loops that iterate over num_resources use an int as the counter, which can cause infinite loops on architectures with smaller ints. Change the loop counters to u32.
--- drivers/base/platform.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/base/platform.c +6 -4
@@ -27,6 +27,7 @@#include <linux/limits.h> #include <linux/property.h> #include <linux/kmemleak.h> +#include <linux/types.h> #include "base.h" #include "power/power.h"
@@ -48,7 +49,7 @@ EXPORT_SYMBOL_GPL(platform_bus);struct resource *platform_get_resource (struct platform_device *dev,unsigned int type,unsigned int num) { -int i; +u32 i;for (i =0 ; i < dev->num_resources; i++) {struct resource *r = &dev->resource[i];
@@ -226,7 +227,7 @@ struct resource *platform_get_resource_byname(struct platform_device *dev,unsigned int type, const char *name) { - int i; + u32 i;for (i =0 ; i < dev->num_resources; i++) {struct resource *r = &dev->resource[i];
@@ -473,7 +474,8 @@ EXPORT_SYMBOL_GPL(platform_device_add_properties);*/ int platform_device_add (struct platform_device *pdev) { -int i, ret; +u32 i; +int ret;if (!pdev)return -EINVAL ;
@@ -562,7 +564,7 @@ EXPORT_SYMBOL_GPL(platform_device_add);*/ void platform_device_del (struct platform_device *pdev) { -int i; +u32 i;if (!IS_ERR_OR_NULL (pdev)) {device_del (&pdev->dev);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 302/459 driver core: Print device when resources present in really_probe()
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7c35e699c88bd60734277b26962783c60e04b494 ]
If a device already has devres items attached before probing, a warning backtrace is printed. However, this backtrace does not reveal the offending device, leaving the user uninformed. Furthermore, using WARN_ON() causes systems with panic-on-warn to reboot.
Fix this by replacing the WARN_ON() by a dev_crit() message. Abort probing the device, to prevent doing more damage to the device's resources.
--- drivers/base/dd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/base/dd.c +4 -1
@@ -516,7 +516,10 @@ static int really_probe(struct device *dev, struct device_driver *drv)atomic_inc (&probe_count);pr_debug ("bus: '%s': %s: probing driver %s with device %s\n" , drv->bus->name, __func__, drv->name,dev_name (dev)); -WARN_ON (!list_empty (&dev->devres_head)); +if (!list_empty (&dev->devres_head)) { +dev_crit (dev,"Resources present before probing\n" ); +return -EBUSY ; + } re_probe: dev->driver = drv;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 303/459 ASoC: SOF: Intel: hda-dai: fix compilation warning in pcm_prepare
In reply to Sasha LevinFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit d873997192ddcacb5333575502be2f91ea4b47b8 ]
Fix GCC warning with W=1, previous cleanup did not remove unnecessary variable.
sound/soc/sof/intel/hda-dai.c: In function ‘hda_link_pcm_prepare’:
sound/soc/sof/intel/hda-dai.c:265:31: warning: variable ‘hda_stream’ set but not used [-Wunused-but-set-variable]
265 | struct sof_intel_hda_stream *hda_stream;
| ^~~~~~~~~~--- sound/soc/sof/intel/hda-dai.c | 3 --- 1 file changed, 3 deletions(-)
sound/soc/sof/intel/hda-dai.c +0 -3
@@ -261,14 +261,11 @@ static int hda_link_pcm_prepare(struct snd_pcm_substream *substream, {struct hdac_ext_stream *link_dev =snd_soc_dai_get_dma_data (dai, substream); -struct sof_intel_hda_stream *hda_stream;struct snd_sof_dev *sdev =snd_soc_component_get_drvdata (dai->component);struct snd_soc_pcm_runtime *rtd =snd_pcm_substream_chip (substream);int stream = substream->stream; - hda_stream =hstream_to_sof_hda_stream (link_dev); -if (link_dev->link_prepared)return 0 ;
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 304/459 ARC: [plat-axs10x]: Add missing multicast filter number to GMAC node
In reply to Sasha LevinFrom: Jose Abreu <[email protected]>
[ Upstream commit 7980dff398f86a618f502378fa27cf7e77449afa ]
Add a missing property to GMAC node so that multicast filtering works correctly.
--- arch/arc/boot/dts/axs10x_mb.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arc/boot/dts/axs10x_mb.dtsi +1 -0
@@ -77,6 +77,7 @@ interrupt-names = "macirq"; phy-mode = "rgmii"; snps,pbl = < 32 >; + snps,multicast-filter-bins = <256>; clocks = <&apbclk>; clock-names = "stmmaceth"; max-speed = <100>;
Signature · 7 lines
2.20.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Sasha Levin
maintainerPATCH 305/459 arm64: cpufeature: Set the FP/SIMD compat HWCAP bits properly
In reply to Sasha LevinFrom: Suzuki K Poulose <[email protected]>
[ Upstream commit 7559950aef1ab8792c50797c6c5c7c5150a02460 ]
We set the compat_elf_hwcap bits unconditionally on arm64 to include the VFP and NEON support. However, the FP/SIMD unit is optional on Arm v8 and thus could be missing. We already handle this properly in the kernel, but still advertise to the COMPAT applications that the VFP is available. Fix this to make sure we only advertise when we really have them.
--- arch/arm64/kernel/cpufeature.c | 37 +++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-)
arch/arm64/kernel/cpufeature.c +34 -3
@@ -32,9 +32,7 @@ static unsigned long elf_hwcap __read_mostly;#define COMPAT_ELF_HWCAP_DEFAULT \ (COMPAT_HWCAP_HALF|COMPAT_HWCAP_THUMB|\ COMPAT_HWCAP_FAST_MULT|COMPAT_HWCAP_EDSP|\ - COMPAT_HWCAP_TLS|COMPAT_HWCAP_VFP|\ - COMPAT_HWCAP_VFPv3|COMPAT_HWCAP_VFPv4|\ - COMPAT_HWCAP_NEON|COMPAT_HWCAP_IDIV|\ + COMPAT_HWCAP_TLS|COMPAT_HWCAP_IDIV|\ COMPAT_HWCAP_LPAE)unsigned int compat_elf_hwcap__read_mostly =COMPAT_ELF_HWCAP_DEFAULT ;unsigned int compat_elf_hwcap2__read_mostly ;
@@ -1595,6 +1593,12 @@ static const struct arm64_cpu_capabilities arm64_features[] = { .match_list = list, \ } +#define HWCAP_CAP_MATCH (match, cap_type, cap) \ + { \ + __HWCAP_CAP(#cap, cap_type, cap) \ + .matches = match, \ + } + #ifdef CONFIG_ARM64_PTR_AUTH static const struct arm64_cpu_capabilities ptr_auth_hwcap_addr_matches[] = { {
@@ -1668,8 +1672,35 @@ static const struct arm64_cpu_capabilities arm64_elf_hwcaps[] = { {}, }; +#ifdef CONFIG_COMPAT +static bool compat_has_neon (const struct arm64_cpu_capabilities *cap,int scope) +{ +/* +* Check that all of MVFR1_EL1.{SIMDSP, SIMDInt, SIMDLS} are available, +* in line with that of arm32 as in vfp_init(). We make sure that the +* check is future proof, by making sure value is non-zero. +*/ +u32 mvfr1; + +WARN_ON (scope ==SCOPE_LOCAL_CPU &&preemptible ()); +if (scope ==SCOPE_SYSTEM ) + mvfr1 =read_sanitised_ftr_reg (SYS_MVFR1_EL1 ); +else + mvfr1 =read_sysreg_s (SYS_MVFR1_EL1 ); + +return cpuid_feature_extract_unsigned_field (mvfr1,MVFR1_SIMDSP_SHIFT ) && +cpuid_feature_extract_unsigned_field (mvfr1,MVFR1_SIMDINT_SHIFT ) && +cpuid_feature_extract_unsigned_field (mvfr1,MVFR1_SIMDLS_SHIFT ); +} +#endif +static const struct arm64_cpu_capabilities compat_elf_hwcaps[] = { #ifdef CONFIG_COMPAT +HWCAP_CAP_MATCH (compat_has_neon,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_NEON ), +HWCAP_CAP (SYS_MVFR1_EL1 ,MVFR1_SIMDFMAC_SHIFT ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP , COMPAT_HWCAP_VFPv4), +/* Arm v8 mandates MVFR0.FPDP == {0, 2}. So, piggy back on this for the presence of VFP support */ +HWCAP_CAP (SYS_MVFR0_EL1 ,MVFR0_FPDP_SHIFT ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP ,COMPAT_HWCAP_VFP ), +HWCAP_CAP (SYS_MVFR0_EL1 ,MVFR0_FPDP_SHIFT ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP , COMPAT_HWCAP_VFPv3),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_AES_SHIFT ,FTR_UNSIGNED ,2 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_PMULL ),HWCAP_CAP (SYS_ID_ISAR5_EL1 ,ID_ISAR5_AES_SHIFT ,FTR_UNSIGNED ,1 ,CAP_COMPAT_HWCAP2 ,COMPAT_HWCAP2_AES ), HWCAP_CAP(SYS_ID_ISAR5_EL1, ID_ISAR5_SHA1_SHIFT, FTR_UNSIGNED, 1, CAP_COMPAT_HWCAP2, COMPAT_HWCAP2_SHA1),
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 306/459 arm64: ptrace: nofpsimd: Fail FP/SIMD regset operations
In reply to Sasha LevinFrom: Suzuki K Poulose <[email protected]>
[ Upstream commit c9d66999f064947e6b577ceacc1eb2fbca6a8d3c ]
When fp/simd is not supported on the system, fail the operations of FP/SIMD regsets.
--- arch/arm64/kernel/ptrace.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/arm64/kernel/ptrace.c +21 -0
@@ -615,6 +615,13 @@ static int gpr_set(struct task_struct *target, const struct user_regset *regset,return 0 ; } +static int fpr_active (struct task_struct *target,const struct user_regset *regset) +{ +if (!system_supports_fpsimd ()) +return -ENODEV ; +return regset->n; +} +/* * TODO: update fp accessors for lazy context switching (sync/flush hwstate) */
@@ -637,6 +644,9 @@ static int fpr_get(struct task_struct *target, const struct user_regset *regset, unsigned int pos, unsigned int count, void *kbuf, void __user *ubuf) { + if (!system_supports_fpsimd()) + return -EINVAL; +if (target == current)fpsimd_preserve_current_state ();
@@ -676,6 +686,9 @@ static int fpr_set(struct task_struct *target, const struct user_regset *regset, {int ret; +if (!system_supports_fpsimd ()) +return -EINVAL ; + ret =__fpr_set (target, regset, pos, count, kbuf, ubuf,0 );if (ret)return ret;
@@ -1134,6 +1147,7 @@ static const struct user_regset aarch64_regsets[] = {*/ .size = sizeof(u32), .align = sizeof(u32), + .active = fpr_active, .get = fpr_get, .set = fpr_set },
@@ -1348,6 +1362,9 @@ static int compat_vfp_get(struct task_struct *target,compat_ulong_t fpscr;int ret, vregs_end_pos; +if (!system_supports_fpsimd ()) +return -EINVAL ; + uregs = &target->thread.uw.fpsimd_state;if (target == current)
@@ -1381,6 +1398,9 @@ static int compat_vfp_set(struct task_struct *target,compat_ulong_t fpscr;int ret, vregs_end_pos; +if (!system_supports_fpsimd ()) +return -EINVAL ; + uregs = &target->thread.uw.fpsimd_state; vregs_end_pos =VFP_STATE_SIZE -sizeof (compat_ulong_t);
@@ -1438,6 +1458,7 @@ static const struct user_regset aarch32_regsets[] = { .n = VFP_STATE_SIZE / sizeof(compat_ulong_t), .size = sizeof(compat_ulong_t), .align = sizeof(compat_ulong_t), + .active = fpr_active, .get = compat_vfp_get, .set = compat_vfp_set },
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 307/459 bpf: Return -EBADRQC for invalid map type in __bpf_tx_xdp_map
In reply to Sasha LevinFrom: Li RongQing <[email protected]>
[ Upstream commit 0a29275b6300f39f78a87f2038bbfe5bdbaeca47 ]
A negative value should be returned if map->map_type is invalid although that is impossible now, but if we run into such situation in future, then xdpbuff could be leaked.
Daniel Borkmann suggested:
-EBADRQC should be returned to stay consistent with generic XDP for the tracepoint output and not to be confused with -EOPNOTSUPP from other locations like dev_map_enqueue() when ndo_xdp_xmit is missing and such.
--- net/core/filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/filter.c +1 -1
@@ -3543,7 +3543,7 @@ static int __bpf_tx_xdp_map(struct net_device *dev_rx, void *fwd,return err; }default : -break ; +return -EBADRQC ; }return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 308/459 vme: bridges: reduce stack usage
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 7483e7a939c074d887450ef1c4d9ccc5909405f8 ]
With CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE_O3, the stack usage in vme_fake grows above the warning limit:
drivers/vme/bridges/vme_fake.c: In function 'fake_master_read':drivers/vme/bridges/vme_fake.c:610:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=] drivers/vme/bridges/vme_fake.c: In function 'fake_master_write':drivers/vme/bridges/vme_fake.c:797:1: error: the frame size of 1160 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
The problem is that in some configurations, each call to fake_vmereadX() puts another variable on the stack.
Reduce the amount of inlining to get back to the previous state, with no function using more than 200 bytes each.
--- drivers/vme/bridges/vme_fake.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-)
drivers/vme/bridges/vme_fake.c +18 -12
@@ -414,8 +414,9 @@ static void fake_lm_check(struct fake_driver *bridge, unsigned long long addr, } } -static u8 fake_vmeread8 (struct fake_driver *bridge,unsigned long long addr, -u32 aspace,u32 cycle) +static noinline_for_stack u8 fake_vmeread8(struct fake_driver *bridge, +unsigned long long addr, +u32 aspace,u32 cycle) {u8 retval =0xff ;int i;
@@ -446,8 +447,9 @@ static u8 fake_vmeread8(struct fake_driver *bridge, unsigned long long addr,return retval; } -static u16 fake_vmeread16 (struct fake_driver *bridge,unsigned long long addr, -u32 aspace,u32 cycle) +static noinline_for_stack u16 fake_vmeread16(struct fake_driver *bridge, +unsigned long long addr, +u32 aspace,u32 cycle) {u16 retval =0xffff ;int i;
@@ -478,8 +480,9 @@ static u16 fake_vmeread16(struct fake_driver *bridge, unsigned long long addr,return retval; } -static u32 fake_vmeread32 (struct fake_driver *bridge,unsigned long long addr, -u32 aspace,u32 cycle) +static noinline_for_stack u32 fake_vmeread32(struct fake_driver *bridge, +unsigned long long addr, +u32 aspace,u32 cycle) {u32 retval =0xffffffff ;int i;
@@ -609,8 +612,9 @@ static ssize_t fake_master_read(struct vme_master_resource *image, void *buf,return retval; } -static void fake_vmewrite8 (struct fake_driver *bridge,u8 *buf, -unsigned long long addr,u32 aspace,u32 cycle) +static noinline_for_stack void fake_vmewrite8(struct fake_driver *bridge, +u8 *buf,unsigned long long addr, +u32 aspace,u32 cycle) {int i;unsigned long long start, end, offset;
@@ -639,8 +643,9 @@ static void fake_vmewrite8(struct fake_driver *bridge, u8 *buf, } -static void fake_vmewrite16 (struct fake_driver *bridge,u16 *buf, -unsigned long long addr,u32 aspace,u32 cycle) +static noinline_for_stack void fake_vmewrite16(struct fake_driver *bridge, +u16 *buf,unsigned long long addr, +u32 aspace,u32 cycle) {int i;unsigned long long start, end, offset;
@@ -669,8 +674,9 @@ static void fake_vmewrite16(struct fake_driver *bridge, u16 *buf, } -static void fake_vmewrite32 (struct fake_driver *bridge,u32 *buf, -unsigned long long addr,u32 aspace,u32 cycle) +static noinline_for_stack void fake_vmewrite32(struct fake_driver *bridge, +u32 *buf,unsigned long long addr, +u32 aspace,u32 cycle) {int i;unsigned long long start, end, offset;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 309/459 drm/nouveau/secboot/gm20b: initialize pointer in gm20b_secboot_new()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 3613a9bea95a1470dd42e4ed1cc7d86ebe0a2dc0 ]
We accidentally set "psb" which is a no-op instead of "*psb" so it generates a static checker warning. We should probably set it before the first error return so that it's always initialized.
--- drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/nouveau/nvkm/subdev/secboot/gm20b.c +2 -3
@@ -108,6 +108,7 @@ gm20b_secboot_new(struct nvkm_device *device, int index,struct gm200_secboot *gsb;struct nvkm_acr *acr; + *psb =NULL ; acr =acr_r352_new (BIT (NVKM_SECBOOT_FALCON_FECS ) |BIT (NVKM_SECBOOT_FALCON_PMU ));if (IS_ERR (acr))
@@ -116,10 +117,8 @@ gm20b_secboot_new(struct nvkm_device *device, int index, acr->optional_falcons =BIT (NVKM_SECBOOT_FALCON_PMU ); gsb =kzalloc (sizeof (*gsb),GFP_KERNEL ); -if (!gsb) { - psb =NULL ; +if (!gsb)return -ENOMEM ; - } *psb = &gsb->base; ret =nvkm_secboot_ctor (&gm20b_secboot, acr, device, index, &gsb->base);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 310/459 drm/nouveau/gr/gk20a,gm200-: add terminators to method lists read from fw
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit 7adc77aa0e11f25b0e762859219c70852cd8d56f ]
Method init is typically ordered by class in the FW image as ThreeD, TwoD, Compute.
Due to a bug in parsing the FW into our internal format, we've been accidentally sending Twod + Compute methods to the ThreeD class, as well as Compute methods to the TwoD class - oops.
--- .../gpu/drm/nouveau/nvkm/engine/gr/gk20a.c | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/gpu/drm/nouveau/nvkm/engine/gr/gk20a.c +11 -10
@@ -143,23 +143,24 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name, nent = (fuc.size /sizeof (struct gk20a_fw_av )); - pack =vzalloc ((sizeof (*pack) * max_classes) + - (sizeof (*init) * (nent +1 ))); + pack =vzalloc ((sizeof (*pack) * (max_classes +1 )) + + (sizeof (*init) * (nent + max_classes +1 )));if (!pack) { ret = -ENOMEM ; goto end; } - init = (void *)(pack + max_classes); + init = (void *)(pack + max_classes +1 ); -for (i =0 ; i < nent; i++) { -struct gf100_gr_init *ent = &init[i]; +for (i =0 ; i < nent; i++, init++) {struct gk20a_fw_av *av = &((struct gk20a_fw_av *)fuc.data)[i];u32 class = av->addr &0xffff ;u32 addr = (av->addr &0xffff0000 ) >>14 ;if (prevclass != class) { - pack[classidx].init = ent; +if (prevclass)/* Add terminator to the method list. */ + init++; + pack[classidx].init = init; pack[classidx].type = class; prevclass = class;if (++classidx >= max_classes) {
@@ -169,10 +170,10 @@ gk20a_gr_av_to_method(struct gf100_gr *gr, const char *fw_name, } } - ent->addr = addr; - ent->data = av->data; - ent->count =1 ; - ent->pitch =1 ; + init->addr = addr; + init->data = av->data; + init->count =1 ; + init->pitch =1 ; } *ppack = pack;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 311/459 drm/nouveau: Fix copy-paste error in nouveau_fence_wait_uevent_handler
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 1eb013473bff5f95b6fe1ca4dd7deda47257b9c2 ]
Like other cases, it should use rcu protected 'chan' rather than 'fence->channel' in nouveau_fence_wait_uevent_handler.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +1 -1
@@ -156,7 +156,7 @@ nouveau_fence_wait_uevent_handler(struct nvif_notify *notify) fence =list_entry (fctx->pending.next,typeof (*fence), head); chan =rcu_dereference_protected (fence->channel,lockdep_is_held (&fctx->lock)); -if (nouveau_fence_update (fence->channel, fctx)) +if (nouveau_fence_update (chan, fctx)) ret =NVIF_NOTIFY_DROP ; }spin_unlock_irqrestore (&fctx->lock, flags);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 312/459 drm/nouveau/drm/ttm: Remove set but not used variable 'mem'
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 2e4534a22794746b11a794b2229b8d58797eccce ]
drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_vram_manager_new:drivers/gpu/drm/nouveau/nouveau_ttm.c:66:22: warning: variable mem set but not used [-Wunused-but-set-variable] drivers/gpu/drm/nouveau/nouveau_ttm.c: In function nouveau_gart_manager_new:drivers/gpu/drm/nouveau/nouveau_ttm.c:106:22: warning: variable mem set but not used [-Wunused-but-set-variable]
They are not used any more, so remove it.
--- drivers/gpu/drm/nouveau/nouveau_ttm.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/gpu/drm/nouveau/nouveau_ttm.c +0 -4
@@ -63,14 +63,12 @@ nouveau_vram_manager_new(struct ttm_mem_type_manager *man, {struct nouveau_bo *nvbo =nouveau_bo (bo);struct nouveau_drm *drm =nouveau_bdev (bo->bdev); -struct nouveau_mem *mem;int ret;if (drm->client.device.info.ram_size ==0 )return -ENOMEM ; ret =nouveau_mem_new (&drm->master, nvbo->kind, nvbo->comp, reg); - mem =nouveau_mem (reg);if (ret)return ret;
@@ -103,11 +101,9 @@ nouveau_gart_manager_new(struct ttm_mem_type_manager *man, {struct nouveau_bo *nvbo =nouveau_bo (bo);struct nouveau_drm *drm =nouveau_bdev (bo->bdev); -struct nouveau_mem *mem;int ret; ret =nouveau_mem_new (&drm->master, nvbo->kind, nvbo->comp, reg); - mem =nouveau_mem (reg);if (ret)return ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 313/459 drm/nouveau/fault/gv100-: fix memory leak on module unload
In reply to Sasha LevinFrom: Ben Skeggs <[email protected]>
[ Upstream commit 633cc9beeb6f9b5fa2f17a2a9d0e2790cb6c3de7 ]
--- drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/nouveau/nvkm/subdev/fault/base.c +1 -0
@@ -146,6 +146,7 @@ nvkm_fault_dtor(struct nvkm_subdev *subdev)struct nvkm_fault *fault =nvkm_fault (subdev);int i; +nvkm_notify_fini (&fault->nrpfb);nvkm_event_fini (&fault->event);for (i =0 ; i < fault->buffer_nr; i++) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 314/459 dm thin: don't allow changing data device during thin-pool reload
In reply to Sasha LevinFrom: Mikulas Patocka <[email protected]>
[ Upstream commit 873937e75f9a8ea231a502c3d29d9cb6ad91b3ef ]
The existing code allows changing the data device when the thin-pool target is reloaded.
This capability is not required and only complicates device lifetime guarantees. This can cause crashes like the one reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=1788596
where the kernel tries to issue a flush bio located in a structure that was already freed.
Take the first step to simplifying the thin-pool's data device lifetime by disallowing changing it. Like the thin-pool's metadata device, the data device is now set in pool_create() and it cannot be changed for a given thin-pool.
--- drivers/md/dm-thin.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/md/dm-thin.c +13 -5
@@ -231,6 +231,7 @@ struct pool {struct dm_target *ti;/* Only set if a pool target is bound */ struct mapped_device *pool_md; +struct block_device *data_dev;struct block_device *md_dev;struct dm_pool_metadata *pmd;
@@ -2945,6 +2946,7 @@ static struct kmem_cache *_new_mapping_cache;static struct pool *pool_create (struct mapped_device *pool_md,struct block_device *metadata_dev, +struct block_device *data_dev,unsigned long block_size,int read_only,char **error) {
@@ -3052,6 +3054,7 @@ static struct pool *pool_create(struct mapped_device *pool_md, pool->last_commit_jiffies = jiffies; pool->pool_md = pool_md; pool->md_dev = metadata_dev; + pool->data_dev = data_dev;__pool_table_insert (pool);return pool;
@@ -3093,6 +3096,7 @@ static void __pool_dec(struct pool *pool)static struct pool *__pool_find (struct mapped_device *pool_md,struct block_device *metadata_dev, +struct block_device *data_dev,unsigned long block_size,int read_only,char **error,int *created) {
@@ -3103,19 +3107,23 @@ static struct pool *__pool_find(struct mapped_device *pool_md, *error ="metadata device already in use by a pool" ;return ERR_PTR (-EBUSY ); } +if (pool->data_dev != data_dev) { + *error ="data device already in use by a pool" ; +return ERR_PTR (-EBUSY ); + }__pool_inc (pool); }else { pool =__pool_table_lookup (pool_md);if (pool) { -if (pool->md_dev != metadata_dev) { +if (pool->md_dev != metadata_dev || pool->data_dev != data_dev) { *error ="different pool cannot replace a pool" ;return ERR_PTR (-EINVAL ); }__pool_inc (pool); }else { - pool =pool_create (pool_md, metadata_dev, block_size, read_only, error); + pool =pool_create (pool_md, metadata_dev, data_dev, block_size, read_only, error); *created =1 ; } }
@@ -3368,7 +3376,7 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) goto out; } - pool =__pool_find (dm_table_get_md (ti->table), metadata_dev->bdev, + pool =__pool_find (dm_table_get_md (ti->table), metadata_dev->bdev, data_dev->bdev, block_size, pf.mode ==PM_READ_ONLY , &ti->error, &pool_created);if (IS_ERR (pool)) { r =PTR_ERR (pool);
@@ -4114,7 +4122,7 @@ static struct target_type pool_target = { .name = "thin-pool", .features = DM_TARGET_SINGLETON | DM_TARGET_ALWAYS_WRITEABLE | DM_TARGET_IMMUTABLE, - .version = {1, 21, 0}, + .version = {1, 22, 0}, .module = THIS_MODULE, .ctr = pool_ctr, .dtr = pool_dtr,
@@ -4493,7 +4501,7 @@ static void thin_io_hints(struct dm_target *ti, struct queue_limits *limits)static struct target_type thin_target = { .name ="thin" , - .version = {1 ,21 ,0 }, + .version = {1 ,22 ,0 }, .module =THIS_MODULE , .ctr = thin_ctr, .dtr = thin_dtr,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 315/459 gpiolib: Set lockdep class for hierarchical irq domains
In reply to Sasha LevinFrom: Stephen Boyd <[email protected]>
[ Upstream commit c34f6dc8c9e6bbe9fba1d53acd6d9a3889599da3 ]
I see the following lockdep splat in the qcom pinctrl driver when attempting to suspend the device.
============================================
WARNING: possible recursive locking detected
5.4.2 #2 Tainted: G S
--------------------------------------------
cat/6536 is trying to acquire lock:
ffffff814787ccc0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
but task is already holding lock:
ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0
---- lock(&irq_desc_lock_class);
lock(&irq_desc_lock_class);
*** DEADLOCK ***
May be due to missing lock nesting notation
7 locks held by cat/6536:
#0: ffffff8140e0c420 (sb_writers#7){.+.+}, at: vfs_write+0xc8/0x19c #1: ffffff8121eec480 (&of->mutex){+.+.}, at: kernfs_fop_write+0x128/0x1f4 #2: ffffff8147cad668 (kn->count#263){.+.+}, at: kernfs_fop_write+0x130/0x1f4 #3: ffffffd011446000 (system_transition_mutex){+.+.}, at: pm_suspend+0x108/0x354 #4: ffffff814302b970 (&dev->mutex){....}, at: __device_suspend+0x16c/0x420 #5: ffffff81436740c0 (&irq_desc_lock_class){-.-.}, at: __irq_get_desc_lock+0x64/0x94 #6: ffffff81479b8c10 (&pctrl->lock){....}, at: msm_gpio_irq_set_wake+0x48/0x7c
stack backtrace: CPU: 4 PID: 6536 Comm: cat Tainted: G S 5.4.2 #2 Call trace: dump_backtrace+0x0/0x174 show_stack+0x20/0x2c dump_stack+0xdc/0x144 __lock_acquire+0x52c/0x2268 lock_acquire+0x1dc/0x220 _raw_spin_lock_irqsave+0x64/0x80 __irq_get_desc_lock+0x64/0x94 irq_set_irq_wake+0x40/0x144 msm_gpio_irq_set_wake+0x5c/0x7c set_irq_wake_real+0x40/0x5c irq_set_irq_wake+0x70/0x144 cros_ec_rtc_suspend+0x38/0x4c platform_pm_suspend+0x34/0x60 dpm_run_callback+0x64/0xcc __device_suspend+0x314/0x420 dpm_suspend+0xf8/0x298 dpm_suspend_start+0x84/0xb4 suspend_devices_and_enter+0xbc/0x628 pm_suspend+0x214/0x354 state_store+0xb0/0x108 kobj_attr_store+0x14/0x24 sysfs_kf_write+0x4c/0x64 kernfs_fop_write+0x158/0x1f4 __vfs_write+0x54/0x18c vfs_write+0xdc/0x19c ksys_write+0x7c/0xe4 __arm64_sys_write+0x20/0x2c el0_svc_common+0xa8/0x160 el0_svc_compat_handler+0x2c/0x38 el0_svc_compat+0x8/0x10
This is because the msm_gpio_irq_set_wake() function calls irq_set_irq_wake() as a backup in case the irq comes in during the path to idle. Given that we're calling irqchip functions from within an irqchip we need to set the lockdep class to be different for this child controller vs. the default one that the parent irqchip gets.
This used to be done before this driver was converted to hierarchical irq domains in commit e35a6ae0eb3a ("pinctrl/msm: Setup GPIO chip in hierarchy") via the gpiochip_irq_map() function. With hierarchical irq domains this function has been replaced by gpiochip_hierarchy_irq_domain_alloc(). Therefore, set the lockdep class like was done previously in the irq domain path so we can avoid this lockdep warning.
--- drivers/gpio/gpiolib.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpiolib.c +1 -0
@@ -1924,6 +1924,7 @@ static int gpiochip_hierarchy_irq_domain_alloc(struct irq_domain *d, parent_type);chip_info (gc,"alloc_irqs_parent for %d parent hwirq %d\n" , irq, parent_hwirq); +irq_set_lockdep_class (irq, gc->irq.lock_key, gc->irq.request_key); ret =irq_domain_alloc_irqs_parent (d, irq,1 , &parent_fwspec);if (ret) chip_err(gc,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 316/459 drm/vmwgfx: prevent memory leak in vmw_cmdbuf_res_add
In reply to Sasha LevinFrom: Navid Emamdoost <[email protected]>
[ Upstream commit 40efb09a7f53125719e49864da008495e39aaa1e ]
In vmw_cmdbuf_res_add if drm_ht_insert_item fails the allocated memory for cres should be released.
--- drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_cmdbuf_res.c +3 -1
@@ -209,8 +209,10 @@ int vmw_cmdbuf_res_add(struct vmw_cmdbuf_res_manager *man, cres->hash.key = user_key | (res_type <<24 ); ret =drm_ht_insert_item (&man->resources, &cres->hash); -if (unlikely (ret !=0 )) +if (unlikely (ret !=0 )) { +kfree (cres); goto out_invalid_key; + } cres->state =VMW_CMDBUF_RES_ADD ; cres->res =vmw_resource_reference (res);
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 317/459 perf/imx_ddr: Fix cpu hotplug state cleanup
In reply to Sasha LevinFrom: Leonard Crestez <[email protected]>
[ Upstream commit 9ee68b314e9aa63ed11b98beb8a68810b8234dcf ]
This driver allocates a dynamic cpu hotplug state but never releases it. If reloaded in a loop it will quickly trigger a WARN message:
"No more dynamic states available for CPU hotplug"
Fix by calling cpuhp_remove_multi_state on remove like several other perf pmu drivers.
Also fix the cleanup logic on probe error paths: add the missing cpuhp_remove_multi_state call and properly check the return value from cpuhp_state_add_instant_nocalls.
--- drivers/perf/fsl_imx8_ddr_perf.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-)
drivers/perf/fsl_imx8_ddr_perf.c +11 -5
@@ -572,13 +572,17 @@ static int ddr_perf_probe(struct platform_device *pdev)if (ret <0 ) {dev_err (&pdev->dev,"cpuhp_setup_state_multi failed\n" ); - goto ddr_perf_err; + goto cpuhp_state_err; } pmu->cpuhp_state = ret;/* Register the pmu instance for cpu hotplug */ -cpuhp_state_add_instance_nocalls (pmu->cpuhp_state, &pmu->node); + ret =cpuhp_state_add_instance_nocalls (pmu->cpuhp_state, &pmu->node); +if (ret) { +dev_err (&pdev->dev,"Error %d registering hotplug\n" , ret); + goto cpuhp_instance_err; + }/* Request irq */ irq =of_irq_get (np,0 );
@@ -612,9 +616,10 @@ static int ddr_perf_probe(struct platform_device *pdev)return 0 ; ddr_perf_err: -if (pmu->cpuhp_state) -cpuhp_state_remove_instance_nocalls (pmu->cpuhp_state, &pmu->node); - +cpuhp_state_remove_instance_nocalls (pmu->cpuhp_state, &pmu->node); +cpuhp_instance_err: +cpuhp_remove_multi_state (pmu->cpuhp_state); +cpuhp_state_err:ida_simple_remove (&ddr_ida, pmu->id);dev_warn (&pdev->dev,"i.MX8 DDR Perf PMU failed (%d), disabled\n" , ret);return ret;
@@ -625,6 +630,7 @@ static int ddr_perf_remove(struct platform_device *pdev)struct ddr_pmu *pmu =platform_get_drvdata (pdev);cpuhp_state_remove_instance_nocalls (pmu->cpuhp_state, &pmu->node); +cpuhp_remove_multi_state (pmu->cpuhp_state);irq_set_affinity_hint (pmu->irq,NULL );perf_pmu_unregister (&pmu->pmu);
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 318/459 usb: musb: omap2430: Get rid of musb .set_vbus for omap2430 glue
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 91b6dec32e5c25fbdbb564d1e5af23764ec17ef1 ]
We currently have musb_set_vbus() called from two different paths. Mostly it gets called from the USB PHY via omap_musb_set_mailbox(), but in some cases it can get also called from musb_stage0_irq() rather via .set_vbus:
(musb_set_host [musb_hdrc])
(omap2430_musb_set_vbus [omap2430])
(musb_stage0_irq [musb_hdrc])
(musb_interrupt [musb_hdrc])
(omap2430_musb_interrupt [omap2430])
This is racy and will not work with introducing generic helper functions for musb_set_host() and musb_set_peripheral(). We want to get rid of the busy loops in favor of usleep_range().
Let's just get rid of .set_vbus for omap2430 glue layer and let the PHY code handle VBUS with musb_set_vbus(). Note that in the follow-up patch we can completely remove omap2430_musb_set_vbus(), but let's do it in a separate patch as this change may actually turn out to be needed as a fix.
--- drivers/usb/musb/omap2430.c | 2 -- 1 file changed, 2 deletions(-)
drivers/usb/musb/omap2430.c +0 -2
@@ -361,8 +361,6 @@ static const struct musb_platform_ops omap2430_ops = { .init = omap2430_musb_init, .exit = omap2430_musb_exit, - .set_vbus = omap2430_musb_set_vbus, - .enable = omap2430_musb_enable, .disable = omap2430_musb_disable,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 319/459 kbuild: remove *.tmp file when filechk fails
In reply to Sasha LevinFrom: Masahiro Yamada <[email protected]>
[ Upstream commit 88fe89a47153facd8cb2d06d5c8727f7224c43c2 ]
Bartosz Golaszewski reports that when "make {menu,n,g,x}config" fails due to missing packages, a temporary file is left over, which is not ignored by git.
For example, if GTK+ is not installed:
$ make gconfig
*
* Unable to find the GTK+ installation. Please make sure that
* the GTK+ 2.0 development package is correctly installed.
* You need gtk+-2.0 gmodule-2.0 libglade-2.0
*
scripts/kconfig/Makefile:208: recipe for target 'scripts/kconfig/gconf-cfg' failed
make[1]: *** [scripts/kconfig/gconf-cfg] Error 1
Makefile:567: recipe for target 'gconfig' failed
make: *** [gconfig] Error 2
$ git status
HEAD detached at v5.4
Untracked files:
(use "git add <file>..." to include in what will be committed) scripts/kconfig/gconf-cfg.tmp
nothing added to commit but untracked files present (use "git add" to track)
This is because the check scripts are run with filechk, which misses to clean up the temporary file on failure.
When the line
{ $(filechk_$(1)); } > [email protected];... fails, it exits immediately due to the 'set -e'. Use trap to make sure to delete the temporary file on exit.
For extra safety, I replaced [email protected] with $(dot-target).tmp to make it a hidden file.
--- scripts/Kbuild.include | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
scripts/Kbuild.include +7 -8
@@ -55,14 +55,13 @@ kecho := $($(quiet)kecho) # - stdin is piped in from the first prerequisite ($<) so one has # to specify a valid file as first prerequisite (often the kbuild file) define filechk - $(Q)set -e; \ - mkdir -p $(dir $@); \ - { $(filechk_$(1)); } > [email protected]; \ - if [ -r $@ ] && cmp -s $@ [email protected]; then \ - rm -f [email protected]; \ - else \ - $(kecho) ' UPD $@'; \ - mv -f [email protected] $@; \ + $(Q)set -e; \ + mkdir -p $(dir $@); \ + trap "rm -f $(dot-target).tmp" EXIT; \ + { $(filechk_$(1)); } > $(dot-target).tmp; \ + if [ ! -r $@ ] || ! cmp -s $@ $(dot-target).tmp; then \ + $(kecho) ' UPD $@'; \ + mv -f $(dot-target).tmp $@; \ fi endef
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 320/459 NFS: Revalidate the file size on a fatal write error
In reply to Sasha LevinFrom: Trond Myklebust <[email protected]>
[ Upstream commit 0df68ced55443243951d02cc497be31fadf28173 ]
If we suffer a fatal error upon writing a file, which causes us to need to revalidate the entire mapping, then we should also revalidate the file size.
--- fs/nfs/write.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/nfs/write.c +8 -0
@@ -243,7 +243,15 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c/* A writeback failed: mark the page as bad, and invalidate the page cache */ static void nfs_set_pageerror (struct address_space *mapping) { +struct inode *inode = mapping->host; +nfs_zap_mapping (mapping->host, mapping); +/* Force file size revalidation */ +spin_lock (&inode->i_lock); +NFS_I (inode)->cache_validity |=NFS_INO_REVAL_FORCED | +NFS_INO_REVAL_PAGECACHE | +NFS_INO_INVALID_SIZE ; +spin_unlock (&inode->i_lock); }static void nfs_mapping_set_error (struct page *page,int error)
Signature · 1 line
2.20.1