ARM: dts: rockchip: fix phy nodename for rk3228-evb
Subsystems (12)
Sasha Levin
maintainerPATCH 1/32 ARM: dts: rockchip: fix phy nodename for rk3228-evb
From: Johan Jonker <[email protected]>
[ Upstream commit 287e0d538fcec2f6e8eb1e565bf0749f3b90186d ]
A test with the command below gives for example this error:
arch/arm/boot/dts/rk3228-evb.dt.yaml: phy@0:
'#phy-cells' is a required property
The phy nodename is normally used by a phy-handle. This node is however compatible with "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22" which is just been added to 'ethernet-phy.yaml'. So change nodename to 'ethernet-phy' for which '#phy-cells' is not a required property
make ARCH=arm dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml
--- arch/arm/boot/dts/rk3228-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/rk3228-evb.dts +1 -1
@@ -46,7 +46,7 @@ #address-cells = <1>; #size-cells = <0>; - phy: phy@0 { + phy: ethernet-phy@0 { compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22"; reg = <0>; clocks = <&cru SCLK_MAC_PHY>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 2/32 ARM: dts: rockchip: fix phy nodename for rk3229-xms6
From: Johan Jonker <[email protected]>
[ Upstream commit 621c8d0c233e260232278a4cfd3380caa3c1da29 ]
A test with the command below gives for example this error:
arch/arm/boot/dts/rk3229-xms6.dt.yaml: phy@0:
'#phy-cells' is a required property
The phy nodename is normally used by a phy-handle. This node is however compatible with "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22" which is just been added to 'ethernet-phy.yaml'. So change nodename to 'ethernet-phy' for which '#phy-cells' is not a required property
make ARCH=arm dtbs_check DT_SCHEMA_FILES=~/.local/lib/python3.5/site-packages/dtschema/schemas/ phy/phy-provider.yaml
--- arch/arm/boot/dts/rk3229-xms6.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/rk3229-xms6.dts +1 -1
@@ -150,7 +150,7 @@ #address-cells = <1>; #size-cells = <0>; - phy: phy@0 { + phy: ethernet-phy@0 { compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22"; reg = <0>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 3/32 arm64: dts: rockchip: fix status for &gmac2phy in rk3328-evb.dts
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit c617ed88502d0b05149e7f32f3b3fd8a0663f7e2 ]
The status was removed of the '&gmac2phy' node with the apply of a patch long time ago, so fix status for '&gmac2phy' in 'rk3328-evb.dts'.
--- arch/arm64/boot/dts/rockchip/rk3328-evb.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3328-evb.dts +1 -1
@@ -86,7 +86,7 @@ assigned-clock-rate = <50000000>; assigned-clocks = <&cru SCLK_MAC2PHY>; assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>; - + status = "okay"; }; &i2c1 {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 4/32 arm64: dts: rockchip: swap interrupts interrupt-names rk3399 gpu node
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit c604fd810bda667bdc20b2c041917baa7803e0fb ]
Dts files with Rockchip rk3399 'gpu' nodes were manually verified. In order to automate this process arm,mali-midgard.txt has been converted to yaml. In the new setup dtbs_check with arm,mali-midgard.yaml expects interrupts and interrupt-names values in the same order. Fix this for rk3399.
make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/gpu/ arm,mali-midgard.yaml
--- arch/arm64/boot/dts/rockchip/rk3399.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/rockchip/rk3399.dtsi +4 -4
@@ -1881,10 +1881,10 @@ gpu: gpu@ff9a0000 { compatible = "rockchip,rk3399-mali", "arm,mali-t860"; reg = <0x0 0xff9a0000 0x0 0x10000>; - interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>, - <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>; - interrupt-names = "gpu", "job", "mmu"; + interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>, + <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>, + <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>; + interrupt-names = "job", "mmu", "gpu"; clocks = <&cru ACLK_GPU>; power-domains = <&power RK3399_PD_GPU>; status = "disabled";
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 5/32 ARM: dts: rockchip: swap clock-names of gpu nodes
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit b14f3898d2c25a9b47a61fb879d0b1f3af92c59b ]
Dts files with Rockchip 'gpu' nodes were manually verified. In order to automate this process arm,mali-utgard.txt has been converted to yaml. In the new setup dtbs_check with arm,mali-utgard.yaml expects clock-names values
in the same order, so fix that.
--- arch/arm/boot/dts/rk3036.dtsi | 2 +- arch/arm/boot/dts/rk322x.dtsi | 2 +- arch/arm/boot/dts/rk3xxx.dtsi | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/rk3036.dtsi +1 -1
@@ -128,7 +128,7 @@ assigned-clocks = <&cru SCLK_GPU>; assigned-clock-rates = <100000000>; clocks = <&cru SCLK_GPU>, <&cru SCLK_GPU>; - clock-names = "core", "bus"; + clock-names = "bus", "core"; resets = <&cru SRST_GPU>; status = "disabled"; };
arch/arm/boot/dts/rk322x.dtsi +1 -1
@@ -561,7 +561,7 @@ "pp1", "ppmmu1"; clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>; - clock-names = "core", "bus"; + clock-names = "bus", "core"; resets = <&cru SRST_GPU_A>; status = "disabled"; };
arch/arm/boot/dts/rk3xxx.dtsi +1 -1
@@ -84,7 +84,7 @@ compatible = "arm,mali-400"; reg = <0x10090000 0x10000>; clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>; - clock-names = "core", "bus"; + clock-names = "bus", "core"; assigned-clocks = <&cru ACLK_GPU>; assigned-clock-rates = <100000000>; resets = <&cru SRST_GPU>;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 6/32 ARM: dts: rockchip: fix pinctrl sub nodename for spi in rk322x.dtsi
In reply to Sasha LevinFrom: Johan Jonker <[email protected]>
[ Upstream commit 855bdca1781c79eb661f89c8944c4a719ce720e8 ]
A test with the command below gives these errors:
arch/arm/boot/dts/rk3229-evb.dt.yaml: spi-0:
'#address-cells' is a required property arch/arm/boot/dts/rk3229-evb.dt.yaml: spi-1:
'#address-cells' is a required property arch/arm/boot/dts/rk3229-xms6.dt.yaml: spi-0:
'#address-cells' is a required property arch/arm/boot/dts/rk3229-xms6.dt.yaml: spi-1:
'#address-cells' is a required property
The $nodename pattern for spi nodes is "^spi(@.*|-[0-9a-f])*$". To prevent warnings rename 'spi-0' and 'spi-1' pinctrl sub nodenames to 'spi0' and 'spi1' in 'rk322x.dtsi'.
make ARCH=arm dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/spi-controller.yaml
--- arch/arm/boot/dts/rk322x.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/rk322x.dtsi +2 -2
@@ -1033,7 +1033,7 @@ }; }; - spi-0 { + spi0 { spi0_clk: spi0-clk { rockchip,pins = <0 RK_PB1 2 &pcfg_pull_up>; };
@@ -1051,7 +1051,7 @@ }; }; - spi-1 { + spi1 { spi1_clk: spi1-clk { rockchip,pins = <0 RK_PC7 2 &pcfg_pull_up>; };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 7/32 gpio: tegra: mask GPIO IRQs during IRQ shutdown
In reply to Sasha LevinFrom: Stephen Warren <[email protected]>
[ Upstream commit 0cf253eed5d2bdf7bb3152457b38f39b012955f7 ]
The driver currently leaves GPIO IRQs unmasked even when the GPIO IRQ client has released the GPIO IRQ. This allows the HW to raise IRQs, and SW to process them, after shutdown. Fix this by masking the IRQ when it's shut down. This is usually taken care of by the irqchip core, but since this driver has a custom irq_shutdown implementation, it must do this explicitly itself.
--- drivers/gpio/gpio-tegra.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-tegra.c +1 -0
@@ -365,6 +365,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)struct tegra_gpio_info *tgi = bank->tgi;unsigned int gpio = d->hwirq; +tegra_gpio_irq_mask (d);gpiochip_unlock_as_irq (&tgi->gc, gpio); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 10/32 gfs2: move privileged user check to gfs2_quota_lock_check
In reply to Sasha LevinFrom: Bob Peterson <[email protected]>
[ Upstream commit 4ed0c30811cb4d30ef89850b787a53a84d5d2bcb ]
Before this patch, function gfs2_quota_lock checked if it was called from a privileged user, and if so, it bypassed the quota check:
superuser can operate outside the quotas.
That's the wrong place for the check because the lock/unlock functions are separate from the lock_check function, and you can do lock and unlock without actually checking the quotas.
This patch moves the check to gfs2_quota_lock_check.
--- fs/gfs2/quota.c | 3 +-- fs/gfs2/quota.h | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-)
fs/gfs2/quota.c +1 -2
@@ -1040,8 +1040,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)u32 x;int error =0 ; -if (capable (CAP_SYS_RESOURCE ) || - sdp->sd_args.ar_quota !=GFS2_QUOTA_ON ) +if (sdp->sd_args.ar_quota !=GFS2_QUOTA_ON )return 0 ; error =gfs2_quota_hold (ip, uid, gid);
fs/gfs2/quota.h +2 -1
@@ -44,7 +44,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,int ret; ap->allowed =UINT_MAX ;/* Assume we are permitted a whole lot */ -if (sdp->sd_args.ar_quota ==GFS2_QUOTA_OFF ) +if (capable (CAP_SYS_RESOURCE ) || + sdp->sd_args.ar_quota ==GFS2_QUOTA_OFF )return 0 ; ret =gfs2_quota_lock (ip,NO_UID_QUOTA_CHANGE ,NO_GID_QUOTA_CHANGE );if (ret)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 11/32 gfs2: don't call quota_unhold if quotas are not locked
In reply to Sasha LevinFrom: Bob Peterson <[email protected]>
[ Upstream commit c9cb9e381985bbbe8acd2695bbe6bd24bf06b81c ]
Before this patch, function gfs2_quota_unlock checked if quotas are turned off, and if so, it branched to label out, which called gfs2_quota_unhold. With the new system of gfs2_qa_get and put, we no longer want to call gfs2_quota_unhold or we won't balance our gets and puts.
--- fs/gfs2/quota.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/gfs2/quota.c +1 -2
@@ -1113,7 +1113,7 @@ void gfs2_quota_unlock(struct gfs2_inode *ip)int found;if (!test_and_clear_bit (GIF_QD_LOCKED , &ip->i_flags)) - goto out; +return ;for (x =0 ; x < ip->i_qadata->qa_qd_num; x++) {struct gfs2_quota_data *qd;
@@ -1150,7 +1150,6 @@ void gfs2_quota_unlock(struct gfs2_inode *ip)qd_unlock (qda[x]); } -out:gfs2_quota_unhold (ip); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 12/32 gfs2: Grab glock reference sooner in gfs2_add_revoke
In reply to Sasha LevinFrom: Andreas Gruenbacher <[email protected]>
[ Upstream commit f4e2f5e1a527ce58fc9f85145b03704779a3123e ]
This patch rearranges gfs2_add_revoke so that the extra glock reference is added earlier on in the function to avoid races in which the glock is freed before the new reference is taken.
--- fs/gfs2/log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/gfs2/log.c +3 -3
@@ -598,13 +598,13 @@ void gfs2_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)struct buffer_head *bh = bd->bd_bh;struct gfs2_glock *gl = bd->bd_gl; + sdp->sd_log_num_revoke++; +if (atomic_inc_return (&gl->gl_revokes) ==1 ) +gfs2_glock_hold (gl); bh->b_private =NULL ; bd->bd_blkno = bh->b_blocknr;gfs2_remove_from_ail (bd);/* drops ref on bh */ bd->bd_bh =NULL ; - sdp->sd_log_num_revoke++; -if (atomic_inc_return (&gl->gl_revokes) ==1 ) -gfs2_glock_hold (gl);set_bit (GLF_LFLUSH , &gl->gl_flags);list_add (&bd->bd_list, &sdp->sd_log_revokes); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 16/32 Revert "gfs2: Don't demote a glock until its revokes are written"
In reply to Sasha LevinFrom: Bob Peterson <[email protected]>
[ Upstream commit b14c94908b1b884276a6608dea3d0b1b510338b7 ]
This reverts commit df5db5f9ee112e76b5202fbc331f990a0fc316d6.
This patch fixes a regression: patch df5db5f9ee112 allowed function run_queue() to bypass its call to do_xmote() if revokes were queued for the glock. That's wrong because its call to do_xmote() is what is responsible for calling the go_sync() glops functions to sync both the ail list and any revokes queued for it. By bypassing the call, gfs2 could get into a stand-off where the glock could not be demoted until its revokes are written back, but the revokes would not be written back because do_xmote() was never called.
It "sort of" works, however, because there are other mechanisms like the log flush daemon (logd) that can sync the ail items and revokes, if it deems it necessary. The problem is: without file system pressure, it might never deem it necessary.
--- fs/gfs2/glock.c | 3 --- 1 file changed, 3 deletions(-)
fs/gfs2/glock.c +0 -3
@@ -639,9 +639,6 @@ __acquires(&gl->gl_lockref.lock) goto out_unlock;if (nonblock) goto out_sched; -smp_mb (); -if (atomic_read (&gl->gl_revokes) !=0 ) - goto out_sched;set_bit (GLF_DEMOTE_IN_PROGRESS , &gl->gl_flags);GLOCK_BUG_ON (gl, gl->gl_demote_state ==LM_ST_EXCLUSIVE ); gl->gl_target = gl->gl_demote_state;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 13/32 drm/amdgpu: drop unnecessary cancel_delayed_work_sync on PG ungate
In reply to Sasha LevinFrom: Evan Quan <[email protected]>
[ Upstream commit 1fe48ec08d9f2e26d893a6c05bd6c99a3490f9ef ]
As this is already properly handled in amdgpu_gfx_off_ctrl(). In fact, this unnecessary cancel_delayed_work_sync may leave a small time window for race condition and is dangerous.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 6 +----- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++--------- 2 files changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -5
@@ -4290,11 +4290,7 @@ static int gfx_v10_0_set_powergating_state(void *handle,switch (adev->asic_type) {case CHIP_NAVI10 :case CHIP_NAVI14 : -if (!enable) { -amdgpu_gfx_off_ctrl (adev, false); -cancel_delayed_work_sync (&adev->gfx.gfx_off_delay_work); - }else -amdgpu_gfx_off_ctrl (adev, true); +amdgpu_gfx_off_ctrl (adev, enable);break ;default :break ;
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3 -9
@@ -4839,10 +4839,9 @@ static int gfx_v9_0_set_powergating_state(void *handle,switch (adev->asic_type) {case CHIP_RAVEN :case CHIP_RENOIR : -if (!enable) { +if (!enable)amdgpu_gfx_off_ctrl (adev, false); -cancel_delayed_work_sync (&adev->gfx.gfx_off_delay_work); - } +if (adev->pg_flags &AMD_PG_SUPPORT_RLC_SMU_HS ) {gfx_v9_0_enable_sck_slow_down_on_power_up (adev, true);gfx_v9_0_enable_sck_slow_down_on_power_down (adev, true);
@@ -4868,12 +4867,7 @@ static int gfx_v9_0_set_powergating_state(void *handle,amdgpu_gfx_off_ctrl (adev, true);break ;case CHIP_VEGA12 : -if (!enable) { -amdgpu_gfx_off_ctrl (adev, false); -cancel_delayed_work_sync (&adev->gfx.gfx_off_delay_work); - }else { -amdgpu_gfx_off_ctrl (adev, true); - } +amdgpu_gfx_off_ctrl (adev, enable);break ;default :break ;
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 15/32 drm/amdgpu: Use GEM obj reference for KFD BOs
In reply to Sasha LevinFrom: Felix Kuehling <[email protected]>
[ Upstream commit 39b3128d7ffd44e400e581e6f49e88cb42bef9a1 ]
Releasing the AMDGPU BO ref directly leads to problems when BOs were exported as DMA bufs. Releasing the GEM reference makes sure that the AMDGPU/TTM BO is not freed too early.
Also take a GEM reference when importing BOs from DMABufs to keep references to imported BOs balances properly.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +3 -2
@@ -1288,7 +1288,7 @@ int amdgpu_amdkfd_gpuvm_free_memory_of_gpu( }/* Free the BO*/ -amdgpu_bo_unref (&mem->bo); +drm_gem_object_put_unlocked (&mem->bo->tbo.base);mutex_destroy (&mem->lock);kfree (mem);
@@ -1630,7 +1630,8 @@ int amdgpu_amdkfd_gpuvm_import_dmabuf(struct kgd_dev *kgd,AMDGPU_VM_PAGE_READABLE |AMDGPU_VM_PAGE_WRITEABLE |AMDGPU_VM_PAGE_EXECUTABLE |AMDGPU_VM_MTYPE_NC ; - (*mem)->bo =amdgpu_bo_ref (bo); +drm_gem_object_get (&bo->tbo.base); + (*mem)->bo = bo; (*mem)->va = va; (*mem)->domain = (bo->preferred_domains &AMDGPU_GEM_DOMAIN_VRAM ) ?AMDGPU_GEM_DOMAIN_VRAM :AMDGPU_GEM_DOMAIN_GTT ;
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 14/32 drm/amd/powerplay: perform PG ungate prior to CG ungate
In reply to Sasha LevinFrom: Evan Quan <[email protected]>
[ Upstream commit f4fcfa4282c1a1bf51475ebb0ffda623eebf1191 ]
Since gfxoff should be disabled first before trying to access those GC registers.
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 6 +++--- drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +3 -3
@@ -320,12 +320,12 @@ static void pp_dpm_en_umd_pstate(struct pp_hwmgr *hwmgr,if (*level & profile_mode_mask) { hwmgr->saved_dpm_level = hwmgr->dpm_level; hwmgr->en_umd_pstate = true; -amdgpu_device_ip_set_clockgating_state (hwmgr->adev, -AMD_IP_BLOCK_TYPE_GFX , -AMD_CG_STATE_UNGATE );amdgpu_device_ip_set_powergating_state (hwmgr->adev,AMD_IP_BLOCK_TYPE_GFX ,AMD_PG_STATE_UNGATE ); +amdgpu_device_ip_set_clockgating_state (hwmgr->adev, +AMD_IP_BLOCK_TYPE_GFX , +AMD_CG_STATE_UNGATE ); } }else {/* exit umd pstate, restore level, enable gfx cg*/
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +3 -3
@@ -1541,12 +1541,12 @@ static int smu_enable_umd_pstate(void *handle,if (*level & profile_mode_mask) { smu_dpm_ctx->saved_dpm_level = smu_dpm_ctx->dpm_level; smu_dpm_ctx->enable_umd_pstate = true; -amdgpu_device_ip_set_clockgating_state (smu->adev, -AMD_IP_BLOCK_TYPE_GFX , -AMD_CG_STATE_UNGATE );amdgpu_device_ip_set_powergating_state (smu->adev,AMD_IP_BLOCK_TYPE_GFX ,AMD_PG_STATE_UNGATE ); +amdgpu_device_ip_set_clockgating_state (smu->adev, +AMD_IP_BLOCK_TYPE_GFX , +AMD_CG_STATE_UNGATE ); } }else {/* exit umd pstate, restore level, enable gfx cg*/
Signature · 6 lines
2.25.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 24/32 clk: ti: am33xx: fix RTC clock parent
In reply to Sasha LevinFrom: Tero Kristo <[email protected]>
[ Upstream commit dc6dbd51009fc412729c307161f442c0a08618f4 ]
Right now, trying to use RTC purely with the ti-sysc / clkctrl framework fails to enable the RTC module properly. Based on experimentation, this appears to be because RTC is sourced from the clkdiv32k optional clock. TRM is not very clear on this topic, but fix the RTC to use the proper source clock nevertheless.
--- drivers/clk/ti/clk-33xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/ti/clk-33xx.c +1 -1
@@ -212,7 +212,7 @@ static const struct omap_clkctrl_reg_data am3_mpu_clkctrl_regs[] __initconst = { };static const struct omap_clkctrl_reg_data am3_l4_rtc_clkctrl_regs[]__initconst = { - {AM3_L4_RTC_RTC_CLKCTRL ,NULL ,CLKF_SW_SUP ,"clk_32768_ck" }, + {AM3_L4_RTC_RTC_CLKCTRL ,NULL ,CLKF_SW_SUP ,"clk-24mhz-clkctrl:0000:0" }, {0 }, };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 28/32 hwmon: (nct7904) Fix incorrect range of temperature limit registers
In reply to Sasha LevinFrom: Amy Shih <[email protected]>
[ Upstream commit 7b2fd270af27edaf02acb41a7babe805a9441914 ]
The format of temperature limitation registers are 8-bit 2's complement and the range is -128~127.
Converts the reading value to signed char to fix the incorrect range of temperature limitation registers.
--- drivers/hwmon/nct7904.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwmon/nct7904.c +3 -1
@@ -356,6 +356,7 @@ static int nct7904_read_temp(struct device *dev, u32 attr, int channel,struct nct7904_data *data =dev_get_drvdata (dev);int ret, temp;unsigned int reg1, reg2, reg3; +s8 temps;switch (attr) {case hwmon_temp_input:
@@ -461,7 +462,8 @@ static int nct7904_read_temp(struct device *dev, u32 attr, int channel,if (ret <0 )return ret; - *val = ret *1000 ; + temps = ret; + *val = temps *1000 ;return 0 ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 25/32 csky: Fixup msa highest 3 bits mask
In reply to Sasha LevinFrom: Liu Yibin <[email protected]>
[ Upstream commit 165f2d2858013253042809df082b8df7e34e86d7 ]
Just as comment mentioned, the msa format:
cr<30/31, 15> MSA register format:
31 - 29 | 28 - 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
BA Reserved SH WA B SO SEC C D V
So we should shift 29 bits not 28 bits for mask
--- arch/csky/abiv1/inc/abi/entry.h | 4 ++-- arch/csky/abiv2/inc/abi/entry.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/csky/abiv1/inc/abi/entry.h +2 -2
@@ -167,8 +167,8 @@* BA Reserved C D V */ cprcr r6, cpcr30 - lsri r6, 28 - lsli r6, 28 + lsri r6, 29 + lsli r6, 29 addi r6, 0xe cpwcr r6, cpcr30
arch/csky/abiv2/inc/abi/entry.h +2 -2
@@ -225,8 +225,8 @@*/ mfcr r6, cr<30, 15> /* Get MSA0 */ 2: - lsri r6, 28 - lsli r6, 28 + lsri r6, 29 + lsli r6, 29 addi r6, 0x1ce mtcr r6, cr<30, 15> /* Set MSA0 */
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 30/32 csky: Fixup raw_copy_from_user()
In reply to Sasha LevinFrom: Al Viro <[email protected]>
[ Upstream commit 51bb38cb78363fdad1f89e87357b7bc73e39ba88 ]
If raw_copy_from_user(to, from, N) returns K, callers expect the first N - K bytes starting at to to have been replaced with the contents of corresponding area starting at from and the last K bytes of destination *left* *unmodified*.
What arch/sky/lib/usercopy.c is doing is broken - it can lead to e.g. data corruption on write(2).
raw_copy_to_user() is inaccurate about return value, which is a bug, but consequences are less drastic than for raw_copy_from_user(). And just what are those access_ok() doing in there? I mean, look into linux/uaccess.h; that's where we do that check (as well as zero tail on failure in the callers that need zeroing).
AFAICS, all of that shouldn't be hard to fix; something like a patch below might make a useful starting point.
I would suggest moving these macros into usercopy.c (they are never used anywhere else) and possibly expanding them there; if you leave them alive, please at least rename __copy_user_zeroing(). Again, it must not zero anything on failed read.
Said that, I'm not sure we won't be better off simply turning usercopy.c into usercopy.S - all that is left there is a couple of functions, each consisting only of inline asm.
Guo Ren reply:
Yes, raw_copy_from_user is wrong, it's no need zeroing code.
unsigned long _copy_from_user(void *to, const void __user *from, unsigned long n)
{
unsigned long res = n;
might_fault();
if (likely(access_ok(from, n))) {
kasan_check_write(to, n);
res = raw_copy_from_user(to, from, n);
}
if (unlikely(res))
memset(to + (n - res), 0, res);
return res;
}EXPORT_SYMBOL(_copy_from_user);
You are right and access_ok() should be removed.
but, how about:
do {
...
"2: stw %3, (%1, 0) \n" \
+ " subi %0, 4 \n" \
"9: stw %4, (%1, 4) \n" \
+ " subi %0, 4 \n" \
"10: stw %5, (%1, 8) \n" \
+ " subi %0, 4 \n" \
"11: stw %6, (%1, 12) \n" \
+ " subi %0, 4 \n" \
" addi %2, 16 \n" \
" addi %1, 16 \n" \Don't expand __ex_table
AI Viro reply:
Hey, I've no idea about the instruction scheduling on csky - if that doesn't slow the things down, all the better. It's just that copy_to_user() and friends are on fairly hot codepaths, and in quite a few situations they will dominate the speed of e.g. read(2). So I tried to keep the fast path unchanged. Up to the architecture maintainers, obviously. Which would be you...
As for the fixups size increase (__ex_table size is unchanged)... You have each of those macros expanded exactly once.
So the size is not a serious argument, IMO - useless complexity would be, if it is, in fact, useless; the size... not really, especially since those extra subi will at least offset it.
Again, up to you - asm optimizations of (essentially) memcpy()-style loops are tricky and can depend upon the fairly subtle details of architecture. So even on something I know reasonably well I would resort to direct experiments if I can't pass the buck to architecture maintainers.
It *is* worth optimizing - this is where read() from a file that is already in page cache spends most of the time, etc.
Guo Ren reply:
Thx, after fixup some typo “sub %0, 4”, apply the patch.
TODO:
- user copy/from codes are still need optimizing.
--- arch/csky/include/asm/uaccess.h | 49 +++++++++++++++++---------------- arch/csky/lib/usercopy.c | 8 ++---- 2 files changed, 28 insertions(+), 29 deletions(-)
arch/csky/include/asm/uaccess.h +26 -23
@@ -254,7 +254,7 @@ do { \extern int __get_user_bad (void ); -#define __copy_user (to, from, n) \ +#define ___copy_to_user (to, from, n) \ do { \ int w0, w1, w2, w3; \ asm volatile( \
@@ -289,31 +289,34 @@ do { \ " subi %0, 4 \n" \ " br 3b \n" \ "5: cmpnei %0, 0 \n" /* 1B */ \ - " bf 8f \n" \ + " bf 13f \n" \ " ldb %3, (%2, 0) \n" \ "6: stb %3, (%1, 0) \n" \ " addi %2, 1 \n" \ " addi %1, 1 \n" \ " subi %0, 1 \n" \ " br 5b \n" \ - "7: br 8f \n" \ + "7: subi %0, 4 \n" \ + "8: subi %0, 4 \n" \ + "12: subi %0, 4 \n" \ + " br 13f \n" \ ".section __ex_table, \"a\" \n" \ ".align 2 \n" \ - ".long 2b, 7b \n" \ - ".long 9b, 7b \n" \ - ".long 10b, 7b \n" \ + ".long 2b, 13f \n" \ + ".long 4b, 13f \n" \ + ".long 6b, 13f \n" \ + ".long 9b, 12b \n" \ + ".long 10b, 8b \n" \ ".long 11b, 7b \n" \ - ".long 4b, 7b \n" \ - ".long 6b, 7b \n" \ ".previous \n" \ - "8: \n" \ + "13: \n" \ : "=r"(n), "=r"(to), "=r"(from), "=r"(w0), \ "=r"(w1), "=r"(w2), "=r"(w3) \ : "0"(n), "1"(to), "2"(from) \ : "memory"); \ } while (0) -#define __copy_user_zeroing (to, from, n) \ +#define ___copy_from_user (to, from, n) \ do { \ int tmp; \ int nsave; \
@@ -356,22 +359,22 @@ do { \" addi %1, 1 \n" \" subi %0, 1 \n" \" br 5b \n" \ -"8: mov %3, %0 \n" \ -" movi %4, 0 \n" \ -"9: stb %4, (%1, 0) \n" \ -" addi %1, 1 \n" \ -" subi %3, 1 \n" \ -" cmpnei %3, 0 \n" \ -" bt 9b \n" \ -" br 7f \n" \ +"8: stw %3, (%1, 0) \n" \ +" subi %0, 4 \n" \ +" bf 7f \n" \ +"9: subi %0, 8 \n" \ +" bf 7f \n" \ +"13: stw %3, (%1, 8) \n" \ +" subi %0, 12 \n" \ +" bf 7f \n" \".section __ex_table, \"a\" \n" \".align 2 \n" \ -".long 2b, 8b \n" \ +".long 2b, 7f \n" \ +".long 4b, 7f \n" \ +".long 6b, 7f \n" \".long 10b, 8b \n" \ -".long 11b, 8b \n" \ -".long 12b, 8b \n" \ -".long 4b, 8b \n" \ -".long 6b, 8b \n" \ +".long 11b, 9b \n" \ +".long 12b,13b \n" \".previous \n" \"7: \n" \ : "=r"(n), "=r"(to), "=r"(from), "=r"(nsave), \
arch/csky/lib/usercopy.c +2 -6
@@ -7,10 +7,7 @@unsigned long raw_copy_from_user (void *to,const void *from,unsigned long n) { -if (access_ok (from, n)) -__copy_user_zeroing (to, from, n); -else -memset (to,0 , n); +___copy_from_user (to, from, n);return n; }EXPORT_SYMBOL (raw_copy_from_user);
@@ -18,8 +15,7 @@ EXPORT_SYMBOL(raw_copy_from_user);unsigned long raw_copy_to_user (void *to,const void *from,unsigned long n) { -if (access_ok (to, n)) -__copy_user (to, from, n); +___copy_to_user (to, from, n);return n; }EXPORT_SYMBOL (raw_copy_to_user);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 8/32 ALSA: usb-audio: add mapping for ASRock TRX40 Creator
In reply to Sasha LevinFrom: Andrew Oakley <[email protected]>
[ Upstream commit da7a8f1a8fc3e14c6dcc52b4098bddb8f20390be ]
This is another TRX40 based motherboard with ALC1220-VB USB-audio that requires a static mapping table.
This motherboard also has a PCI device which advertises no codecs. The PCI ID is 1022:1487 and PCI SSID is 1022:d102. As this is using the AMD vendor ID, don't blacklist for now in case other boards have a working audio device with the same ssid.
alsa-info.sh report for this board:
http://alsa-project.org/db/?f=0a742f89066527497b77ce16bca486daccf8a70c
--- sound/usb/mixer_maps.c | 5 +++++ sound/usb/quirks-table.h | 1 + 2 files changed, 6 insertions(+)
sound/usb/mixer_maps.c +5 -0
@@ -529,6 +529,11 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = { .map = trx40_mobo_map, .connector_map = trx40_mobo_connector_map, }, + {/* Asrock TRX40 Creator */ + .id = USB_ID(0x26ce, 0x0a01), + .map = trx40_mobo_map, + .connector_map = trx40_mobo_connector_map, + }, { 0 } /* terminator */ };
sound/usb/quirks-table.h +1 -0
@@ -3647,6 +3647,7 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),ALC1220_VB_DESKTOP (0x0414 ,0xa002 ),/* Gigabyte TRX40 Aorus Pro WiFi */ ALC1220_VB_DESKTOP (0x0db0 ,0x0d64 ),/* MSI TRX40 Creator */ ALC1220_VB_DESKTOP (0x0db0 ,0x543d ),/* MSI TRX40 */ +ALC1220_VB_DESKTOP (0x26ce ,0x0a01 ),/* Asrock TRX40 Creator */ #undef ALC1220_VB_DESKTOP #undef USB_DEVICE_VENDOR_SPEC
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 31/32 samples: bpf: Fix build error
In reply to Sasha LevinFrom: Matteo Croce <[email protected]>
[ Upstream commit 23ad04669f81f958e9a4121b0266228d2eb3c357 ]
GCC 10 is very strict about symbol clash, and lwt_len_hist_user contains a symbol which clashes with libbpf:
/usr/bin/ld: samples/bpf/lwt_len_hist_user.o:(.bss+0x0): multiple definition of `bpf_log_buf'; samples/bpf/bpf_load.o:(.bss+0x8c0): first defined here
collect2: error: ld returned 1 exit status
bpf_log_buf here seems to be a leftover, so removing it.
--- samples/bpf/lwt_len_hist_user.c | 2 -- 1 file changed, 2 deletions(-)
samples/bpf/lwt_len_hist_user.c +0 -2
@@ -15,8 +15,6 @@#define MAX_INDEX 64#define MAX_STARS 38 -char bpf_log_buf[BPF_LOG_BUF_SIZE ]; -static void stars (char *str,long val,long max,int width) {int i;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 26/32 csky: Fixup perf callchain unwind
In reply to Sasha LevinFrom: Mao Han <[email protected]>
[ Upstream commit 229a0ddee1108a3f82a873e6cbbe35c92c540444 ]
[ 5221.974084] Unable to handle kernel paging request at virtual address 0xfffff000, pc: 0x8002c18e [ 5221.985929] Oops: 00000000 [ 5221.989488] [ 5221.989488] CURRENT PROCESS: [ 5221.989488] [ 5221.992877] COMM=callchain_test PID=11962 [ 5221.995213] TEXT=00008000-000087e0 DATA=00009f1c-0000a018 BSS=0000a018-0000b000 [ 5221.999037] USER-STACK=7fc18e20 KERNEL-STACK=be204680 [ 5221.999037] [ 5222.003292] PC: 0x8002c18e (perf_callchain_kernel+0x3e/0xd4) [ 5222.007957] LR: 0x8002c198 (perf_callchain_kernel+0x48/0xd4) [ 5222.074873] Call Trace: [ 5222.074873] [<800a248e>] get_perf_callchain+0x20a/0x29c [ 5222.074873] [<8009d964>] perf_callchain+0x64/0x80 [ 5222.074873] [<8009dc1c>] perf_prepare_sample+0x29c/0x4b8 [ 5222.074873] [<8009de6e>] perf_event_output_forward+0x36/0x98 [ 5222.074873] [<800497e0>] search_exception_tables+0x20/0x44 [ 5222.074873] [<8002cbb6>] do_page_fault+0x92/0x378 [ 5222.074873] [<80098608>] __perf_event_overflow+0x54/0xdc [ 5222.074873] [<80098778>] perf_swevent_hrtimer+0xe8/0x164 [ 5222.074873] [<8002ddd0>] update_mmu_cache+0x0/0xd8 [ 5222.074873] [<8002c014>] user_backtrace+0x58/0xc4 [ 5222.074873] [<8002c0b4>] perf_callchain_user+0x34/0xd0 [ 5222.074873] [<800a2442>] get_perf_callchain+0x1be/0x29c [ 5222.074873] [<8009d964>] perf_callchain+0x64/0x80 [ 5222.074873] [<8009d834>] perf_output_sample+0x78c/0x858 [ 5222.074873] [<8009dc1c>] perf_prepare_sample+0x29c/0x4b8 [ 5222.074873] [<8009de94>] perf_event_output_forward+0x5c/0x98 [ 5222.097846] [ 5222.097846] [<800a0300>] perf_event_exit_task+0x58/0x43c [ 5222.097846] [<8006c874>] hrtimer_interrupt+0x104/0x2ec [ 5222.097846] [<800a0300>] perf_event_exit_task+0x58/0x43c [ 5222.097846] [<80437bb6>] dw_apb_clockevent_irq+0x2a/0x4c [ 5222.097846] [<8006c770>] hrtimer_interrupt+0x0/0x2ec [ 5222.097846] [<8005f2e4>] __handle_irq_event_percpu+0xac/0x19c [ 5222.097846] [<80437bb6>] dw_apb_clockevent_irq+0x2a/0x4c [ 5222.097846] [<8005f408>] handle_irq_event_percpu+0x34/0x88 [ 5222.097846] [<8005f480>] handle_irq_event+0x24/0x64 [ 5222.097846] [<8006218c>] handle_level_irq+0x68/0xdc [ 5222.097846] [<8005ec76>] __handle_domain_irq+0x56/0xa8 [ 5222.097846] [<80450e90>] ck_irq_handler+0xac/0xe4 [ 5222.097846] [<80029012>] csky_do_IRQ+0x12/0x24 [ 5222.097846] [<8002a3a0>] csky_irq+0x70/0x80 [ 5222.097846] [<800ca612>] alloc_set_pte+0xd2/0x238 [ 5222.097846] [<8002ddd0>] update_mmu_cache+0x0/0xd8 [ 5222.097846] [<800a0340>] perf_event_exit_task+0x98/0x43c
The original fp check doesn't base on the real kernal stack region. Invalid fp address may cause kernel panic.
--- arch/csky/kernel/perf_callchain.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
arch/csky/kernel/perf_callchain.c +7 -2
@@ -12,12 +12,17 @@ struct stackframe {static int unwind_frame_kernel (struct stackframe *frame) { -if (kstack_end ((void *)frame->fp)) +unsigned long low = (unsigned long )task_stack_page (current); +unsigned long high = low +THREAD_SIZE ; + +if (unlikely (frame->fp < low || frame->fp > high))return -EPERM ; -if (frame->fp &0x3 || frame->fp <TASK_SIZE ) + +if (kstack_end ((void *)frame->fp) || frame->fp &0x3 )return -EPERM ; *frame = *(struct stackframe *)frame->fp; +if (__kernel_text_address (frame->lr)) {int graph =0 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 32/32 drivers: net: hamradio: Fix suspicious RCU usage warning in bpqether.c
In reply to Sasha LevinFrom: Madhuparna Bhowmik <[email protected]>
[ Upstream commit 95f59bf88bb75281cc626e283ecefdd5d5641427 ]
This patch fixes the following warning:
=============================
WARNING: suspicious RCU usage
5.7.0-rc5-next-20200514-syzkaller #0 Not tainted
-----------------------------drivers/net/hamradio/bpqether.c:149 RCU-list traversed in non-reader section!!
Since rtnl lock is held, pass this cond in list_for_each_entry_rcu().
--- drivers/net/hamradio/bpqether.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/hamradio/bpqether.c +2 -1
@@ -127,7 +127,8 @@ static inline struct net_device *bpq_get_ax25_dev(struct net_device *dev) {struct bpqdev *bpq; -list_for_each_entry_rcu (bpq, &bpq_devices, bpq_list) { +list_for_each_entry_rcu (bpq, &bpq_devices, bpq_list, +lockdep_rtnl_is_held ()) {if (bpq->ethdev == dev)return bpq->axdev; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 29/32 cifs: Fix null pointer check in cifs_read
In reply to Sasha LevinFrom: Steve French <[email protected]>
[ Upstream commit 9bd21d4b1a767c3abebec203342f3820dcb84662 ]
Coverity scan noted a redundant null check
Coverity-id: 728517
--- fs/cifs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/file.c +1 -1
@@ -3997,7 +3997,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)* than it negotiated since it will refuse the read * then. */ -if ((tcon->ses) && !(tcon->ses->capabilities & +if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_large_files)) { current_read_size =min_t (uint, current_read_size, CIFSMaxBufSize);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 27/32 csky: Fixup remove duplicate irq_disable
In reply to Sasha LevinFrom: Liu Yibin <[email protected]>
[ Upstream commit 6633a5aa8eb6bda70eb3a9837efd28a67ccc6e0a ]
Interrupt has been disabled in __schedule() with local_irq_disable() and enabled in finish_task_switch->finish_lock_switch() with local_irq_enabled(), So needn't to disable irq here.
--- arch/csky/kernel/entry.S | 2 -- 1 file changed, 2 deletions(-)
arch/csky/kernel/entry.S +0 -2
@@ -318,8 +318,6 @@ ENTRY(__switch_to) mfcr a2, psr /* Save PSR value */ stw a2, (a3, THREAD_SR) /* Save PSR in task struct */ - bclri a2, 6 /* Disable interrupts */ - mtcr a2, psr SAVE_SWITCH_STACK
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 22/32 IB/i40iw: Remove bogus call to netdev_master_upper_dev_get()
In reply to Sasha LevinFrom: "Denis V. Lunev" <[email protected]>
[ Upstream commit 856ec7f64688387b100b7083cdf480ce3ac41227 ]
Local variable netdev is not used in these calls.
It should be noted, that this change is required to work in bonded mode. Otherwise we would get the following assert:
"RTNL: assertion failed at net/core/dev.c (5665)"
With the calltrace as follows:
dump_stack+0x19/0x1b netdev_master_upper_dev_get+0x61/0x70 i40iw_addr_resolve_neigh+0x1e8/0x220 i40iw_make_cm_node+0x296/0x700 ? i40iw_find_listener.isra.10+0xcc/0x110 i40iw_receive_ilq+0x3d4/0x810 i40iw_puda_poll_completion+0x341/0x420 i40iw_process_ceq+0xa5/0x280 i40iw_ceq_dpc+0x1e/0x40 tasklet_action+0x83/0x140 __do_softirq+0x125/0x2bb call_softirq+0x1c/0x30 do_softirq+0x65/0xa0 irq_exit+0x105/0x110 do_IRQ+0x56/0xf0 common_interrupt+0x16a/0x16a ? cpuidle_enter_state+0x57/0xd0 cpuidle_idle_call+0xde/0x230 arch_cpu_idle+0xe/0xc0 cpu_startup_entry+0x14a/0x1e0 start_secondary+0x1f7/0x270 start_cpu+0x5/0x14
--- drivers/infiniband/hw/i40iw/i40iw_cm.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/infiniband/hw/i40iw/i40iw_cm.c +0 -8
@@ -1987,7 +1987,6 @@ static int i40iw_addr_resolve_neigh(struct i40iw_device *iwdev,struct rtable *rt;struct neighbour *neigh;int rc = arpindex; -struct net_device *netdev = iwdev->netdev;__be32 dst_ipaddr =htonl (dst_ip);__be32 src_ipaddr =htonl (src_ip);
@@ -1997,9 +1996,6 @@ static int i40iw_addr_resolve_neigh(struct i40iw_device *iwdev,return rc; } -if (netif_is_bond_slave (netdev)) - netdev =netdev_master_upper_dev_get (netdev); - neigh =dst_neigh_lookup (&rt->dst, &dst_ipaddr);rcu_read_lock ();
@@ -2065,7 +2061,6 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev, {struct neighbour *neigh;int rc = arpindex; -struct net_device *netdev = iwdev->netdev;struct dst_entry *dst;struct sockaddr_in6 dst_addr;struct sockaddr_in6 src_addr;
@@ -2086,9 +2081,6 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev,return rc; } -if (netif_is_bond_slave (netdev)) - netdev =netdev_master_upper_dev_get (netdev); - neigh =dst_neigh_lookup (dst, dst_addr.sin6_addr.in6_u.u6_addr32);rcu_read_lock ();
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 20/32 usb: gadget: legacy: fix redundant initialization warnings
In reply to Sasha LevinFrom: Masahiro Yamada <[email protected]>
[ Upstream commit d13cce757954fa663c69845611957396843ed87a ]
Fix the following cppcheck warnings:
drivers/usb/gadget/legacy/inode.c:1364:8: style: Redundant initialization for 'value'. The initialized value is overwritten$
value = -EOPNOTSUPP;
^
drivers/usb/gadget/legacy/inode.c:1331:15: note: value is initialized
int value = -EOPNOTSUPP;
^
drivers/usb/gadget/legacy/inode.c:1364:8: note: value is overwritten
value = -EOPNOTSUPP;
^
drivers/usb/gadget/legacy/inode.c:1817:8: style: Redundant initialization for 'value'. The initialized value is overwritten$
value = -EINVAL;
^
drivers/usb/gadget/legacy/inode.c:1787:18: note: value is initialized
ssize_t value = len, length = len;
^
drivers/usb/gadget/legacy/inode.c:1817:8: note: value is overwritten
value = -EINVAL;
^--- drivers/usb/gadget/legacy/inode.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/usb/gadget/legacy/inode.c +1 -2
@@ -1361,7 +1361,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) req->buf = dev->rbuf; req->context =NULL ; - value = -EOPNOTSUPP ;switch (ctrl->bRequest) {case USB_REQ_GET_DESCRIPTOR :
@@ -1784,7 +1783,7 @@ static ssize_t dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr) { struct dev_data *dev = fd->private_data; -ssize_t value = len, length = len; +ssize_t value, length = len;unsigned total;u32 tag;char *kbuf;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 23/32 riscv: stacktrace: Fix undefined reference to `walk_stackframe'
In reply to Sasha LevinFrom: Kefeng Wang <[email protected]>
[ Upstream commit 0502bee37cdef755d63eee60236562e5605e2480 ]
Drop static declaration to fix following build error if FRAME_POINTER disabled,
riscv64-linux-ld: arch/riscv/kernel/perf_callchain.o: in function `.L0':
perf_callchain.c:(.text+0x2b8): undefined reference to `walk_stackframe'
--- arch/riscv/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/stacktrace.c +1 -1
@@ -63,7 +63,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,#else /* !CONFIG_FRAME_POINTER */ -static void notrace walk_stackframe(struct task_struct *task, +void notrace walk_stackframe(struct task_struct *task,struct pt_regs *regs,bool (*fn)(unsigned long ,void *),void *arg) {unsigned long sp, pc;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 21/32 net: freescale: select CONFIG_FIXED_PHY where needed
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 99352c79af3e5f2e4724abf37fa5a2a3299b1c81 ]
I ran into a randconfig build failure with CONFIG_FIXED_PHY=m and CONFIG_GIANFAR=y:
x86_64-linux-ld: drivers/net/ethernet/freescale/gianfar.o:(.rodata+0x418): undefined reference to `fixed_phy_change_carrier'
It seems the same thing can happen with dpaa and ucc_geth, so change all three to do an explicit 'select FIXED_PHY'.
The fixed-phy driver actually has an alternative stub function that theoretically allows building network drivers when fixed-phy is disabled, but I don't see how that would help here, as the drivers presumably would not work then.
--- drivers/net/ethernet/freescale/Kconfig | 2 ++ drivers/net/ethernet/freescale/dpaa/Kconfig | 1 + 2 files changed, 3 insertions(+)
drivers/net/ethernet/freescale/Kconfig +2 -0
@@ -77,6 +77,7 @@ config UCC_GETH depends on QUICC_ENGINE select FSL_PQ_MDIO select PHYLIB + select FIXED_PHY ---help--- This driver supports the Gigabit Ethernet mode of the QUICC Engine, which is available on some Freescale SOCs.
@@ -90,6 +91,7 @@ config GIANFAR depends on HAS_DMA select FSL_PQ_MDIO select PHYLIB + select FIXED_PHY select CRC32 ---help--- This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
drivers/net/ethernet/freescale/dpaa/Kconfig +1 -0
@@ -3,6 +3,7 @@ menuconfig FSL_DPAA_ETH tristate "DPAA Ethernet" depends on FSL_DPAA && FSL_FMAN select PHYLIB + select FIXED_PHY select FSL_FMAN_MAC ---help--- Data Path Acceleration Architecture Ethernet driver,
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 19/32 usb: phy: twl6030-usb: Fix a resource leak in an error handling path in 'twl6030_usb_probe()'
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit f058764d19000d98aef72010468db1f69faf9fa0 ]
A call to 'regulator_get()' is hidden in 'twl6030_usb_ldo_init()'. A corresponding put must be performed in the error handling path, as already done in the remove function.
While at it, also move a 'free_irq()' call in the error handling path in order to be consistent.
--- drivers/usb/phy/phy-twl6030-usb.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/usb/phy/phy-twl6030-usb.c +9 -3
@@ -377,7 +377,7 @@ static int twl6030_usb_probe(struct platform_device *pdev)if (status <0 ) {dev_err (&pdev->dev,"can't get IRQ %d, err %d\n" , twl->irq1, status); -return status; + goto err_put_regulator; } status = request_threaded_irq(twl->irq2, NULL, twl6030_usb_irq,
@@ -386,8 +386,7 @@ static int twl6030_usb_probe(struct platform_device *pdev)if (status <0 ) {dev_err (&pdev->dev,"can't get IRQ %d, err %d\n" , twl->irq2, status); -free_irq (twl->irq1, twl); -return status; + goto err_free_irq1; } twl->asleep =0 ;
@@ -396,6 +395,13 @@ static int twl6030_usb_probe(struct platform_device *pdev)dev_info (&pdev->dev,"Initialized TWL6030 USB module\n" );return 0 ; + +err_free_irq1: +free_irq (twl->irq1, twl); +err_put_regulator: +regulator_put (twl->usb3v3); + +return status; }static int twl6030_usb_remove (struct platform_device *pdev)
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 18/32 usb: dwc3: pci: Enable extcon driver for Intel Merrifield
In reply to Sasha LevinFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 066c09593454e89bc605ffdff1c9810061f9b1e1 ]
Intel Merrifield provides a DR support via PMIC which has its own extcon driver.
Add a property string to link to that driver.
--- drivers/usb/dwc3/dwc3-pci.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/dwc3/dwc3-pci.c +1 -0
@@ -114,6 +114,7 @@ static const struct property_entry dwc3_pci_intel_properties[] = {static const struct property_entry dwc3_pci_mrfld_properties[] = {PROPERTY_ENTRY_STRING ("dr_mode" ,"otg" ), +PROPERTY_ENTRY_STRING ("linux,extcon-name" ,"mrfld_bcove_pwrsrc" ),PROPERTY_ENTRY_BOOL ("linux,sysdev_is_parent" ), {} };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 17/32 cachefiles: Fix race between read_waiter and read_copier involving op->to_do
In reply to Sasha LevinFrom: Lei Xue <[email protected]>
[ Upstream commit 7bb0c5338436dae953622470d52689265867f032 ]
There is a potential race in fscache operation enqueuing for reading and copying multiple pages from cachefiles to netfs. The problem can be seen easily on a heavy loaded system (for example many processes reading files continually on an NFS share covered by fscache triggered this problem within a few minutes).
The race is due to cachefiles_read_waiter() adding the op to the monitor to_do list and then then drop the object->work_lock spinlock before completing fscache_enqueue_operation(). Once the lock is dropped, cachefiles_read_copier() grabs the op, completes processing it, and makes it through fscache_retrieval_complete() which sets the op->state to the final state of FSCACHE_OP_ST_COMPLETE(4). When cachefiles_read_waiter() finally gets through the remainder of fscache_enqueue_operation() it sees the invalid state, and hits the ASSERTCMP and the following oops is seen:
[ 2259.612361] FS-Cache: [ 2259.614785] FS-Cache: Assertion failed [ 2259.618639] FS-Cache: 4 == 5 is false [ 2259.622456] ------------[ cut here ]------------ [ 2259.627190] kernel BUG at fs/fscache/operation.c:70! ... [ 2259.791675] RIP: 0010:[<ffffffffc061b4cf>] [<ffffffffc061b4cf>] fscache_enqueue_operation+0xff/0x170 [fscache] [ 2259.802059] RSP: 0000:ffffa0263d543be0 EFLAGS: 00010046 [ 2259.807521] RAX: 0000000000000019 RBX: ffffa01a4d390480 RCX: 0000000000000006 [ 2259.814847] RDX: 0000000000000000 RSI: 0000000000000046 RDI: ffffa0263d553890 [ 2259.822176] RBP: ffffa0263d543be8 R08: 0000000000000000 R09: ffffa0263c2d8708 [ 2259.829502] R10: 0000000000001e7f R11: 0000000000000000 R12: ffffa01a4d390480 [ 2259.844483] R13: ffff9fa9546c5920 R14: ffffa0263d543c80 R15: ffffa0293ff9bf10 [ 2259.859554] FS: 00007f4b6efbd700(0000) GS:ffffa0263d540000(0000) knlGS:0000000000000000 [ 2259.875571] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2259.889117] CR2: 00007f49e1624ff0 CR3: 0000012b38b38000 CR4: 00000000007607e0 [ 2259.904015] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 2259.918764] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 2259.933449] PKRU: 55555554 [ 2259.943654] Call Trace: [ 2259.953592] <IRQ> [ 2259.955577] [<ffffffffc03a7c12>] cachefiles_read_waiter+0x92/0xf0 [cachefiles] [ 2259.978039] [<ffffffffa34d3942>] __wake_up_common+0x82/0x120 [ 2259.991392] [<ffffffffa34d3a63>] __wake_up_common_lock+0x83/0xc0 [ 2260.004930] [<ffffffffa34d3510>] ? task_rq_unlock+0x20/0x20 [ 2260.017863] [<ffffffffa34d3ab3>] __wake_up+0x13/0x20 [ 2260.030230] [<ffffffffa34c72a0>] __wake_up_bit+0x50/0x70 [ 2260.042535] [<ffffffffa35bdcdb>] unlock_page+0x2b/0x30 [ 2260.054495] [<ffffffffa35bdd09>] page_endio+0x29/0x90 [ 2260.066184] [<ffffffffa368fc81>] mpage_end_io+0x51/0x80
CPU1cachefiles_read_waiter()
20 static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode,
21 int sync, void *_key)
22 {
...
61 spin_lock(&object->work_lock); 62 list_add_tail(&monitor->op_link, &op->to_do); 63 spin_unlock(&object->work_lock);
<begin race window>
64
65 fscache_enqueue_retrieval(op);
182 static inline void fscache_enqueue_retrieval(struct fscache_retrieval *op) 183 {
184 fscache_enqueue_operation(&op->op);
185 }
58 void fscache_enqueue_operation(struct fscache_operation *op) 59 {
60 struct fscache_cookie *cookie = op->object->cookie;
61
62 _enter("{OBJ%x OP%x,%u}",
63 op->object->debug_id, op->debug_id, atomic_read(&op->usage));
64
65 ASSERT(list_empty(&op->pend_link)); 66 ASSERT(op->processor != NULL); 67 ASSERT(fscache_object_is_available(op->object)); 68 ASSERTCMP(atomic_read(&op->usage), >, 0);
<end race window>
CPU2cachefiles_read_copier()
168 while (!list_empty(&op->to_do)) {
...
202 fscache_end_io(op, monitor->netfs_page, error); 203 put_page(monitor->netfs_page); 204 fscache_retrieval_complete(op, 1);
CPU1
58 void fscache_enqueue_operation(struct fscache_operation *op) 59 {
...
69 ASSERTIFCMP(op->state != FSCACHE_OP_ST_IN_PROGRESS,
70 op->state, ==, FSCACHE_OP_ST_CANCELLED);
--- fs/cachefiles/rdwr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cachefiles/rdwr.c +1 -1
@@ -60,9 +60,9 @@ static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode, object = container_of(op->op.object, struct cachefiles_object, fscache);spin_lock (&object->work_lock);list_add_tail (&monitor->op_link, &op->to_do); +fscache_enqueue_retrieval (op);spin_unlock (&object->work_lock); -fscache_enqueue_retrieval (op);fscache_put_retrieval (op);return 0 ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 9/32 net: microchip: encx24j600: add missed kthread_stop
In reply to Sasha LevinFrom: Chuhong Yuan <[email protected]>
[ Upstream commit ff8ce319e9c25e920d994cc35236f0bb32dfc8f3 ]
This driver calls kthread_run() in probe, but forgets to call kthread_stop() in probe failure and remove.
Add the missed kthread_stop() to fix it.
--- drivers/net/ethernet/microchip/encx24j600.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/microchip/encx24j600.c +4 -1
@@ -1070,7 +1070,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)if (unlikely (ret)) {netif_err (priv, probe, ndev,"Error %d initializing card encx24j600 card\n" , ret); - goto out_free; + goto out_stop; } eidled =encx24j600_read_reg (priv,EIDLED );
@@ -1088,6 +1088,8 @@ static int encx24j600_spi_probe(struct spi_device *spi) out_unregister:unregister_netdev (priv->ndev); +out_stop: +kthread_stop (priv->kworker_task); out_free:free_netdev (ndev);
@@ -1100,6 +1102,7 @@ static int encx24j600_spi_remove(struct spi_device *spi)struct encx24j600_priv *priv =dev_get_drvdata (&spi->dev);unregister_netdev (priv->ndev); +kthread_stop (priv->kworker_task);free_netdev (priv->ndev);
Signature · 1 line
2.25.1