drm/sti: do not remove the drm_bridge that was never added
Subsystems (24)
Sasha Levin
maintainerPATCH 4/671 ixgbe: don't clear IPsec sa counters on HW clearing
In reply to Sasha LevinFrom: Shannon Nelson <[email protected]>
[ Upstream commit 9e3f2f5ecee69b0f70003fb3e07639151e91de73 ]
The software SA record counters should not be cleared when clearing the hardware tables. This causes the counters to be out of sync after a driver reset.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c +0 -4
@@ -114,7 +114,6 @@ static void ixgbe_ipsec_set_rx_ip(struct ixgbe_hw *hw, u16 idx, __be32 addr[])**/ static void ixgbe_ipsec_clear_hw_tables (struct ixgbe_adapter *adapter) { -struct ixgbe_ipsec *ipsec = adapter->ipsec;struct ixgbe_hw *hw = &adapter->hw;u32 buf[4 ] = {0 ,0 ,0 ,0 };u16 idx;
@@ -133,9 +132,6 @@ static void ixgbe_ipsec_clear_hw_tables(struct ixgbe_adapter *adapter)ixgbe_ipsec_set_tx_sa (hw, idx, buf,0 );ixgbe_ipsec_set_rx_sa (hw, idx,0 , buf,0 ,0 ,0 ); } - - ipsec->num_rx_sa =0 ; - ipsec->num_tx_sa =0 ; }/**
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/671 drm/virtio: fix bounds check in virtio_gpu_cmd_get_capset()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 09c4b49457434fa74749ad6194ef28464d9f5df9 ]
This doesn't affect runtime because in the current code "idx" is always valid.
First, we read from "vgdev->capsets[idx].max_size" before checking whether "idx" is within bounds. And secondly the bounds check is off by one so we could end up reading one element beyond the end of the vgdev->capsets[] array.
--- drivers/gpu/drm/virtio/virtgpu_vq.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/virtio/virtgpu_vq.c +3 -2
@@ -650,11 +650,11 @@ int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev, {struct virtio_gpu_get_capset *cmd_p;struct virtio_gpu_vbuffer *vbuf; -int max_size = vgdev->capsets[idx].max_size; +int max_size;struct virtio_gpu_drv_cap_cache *cache_ent;void *resp_buf; -if (idx > vgdev->num_capsets) +if (idx >= vgdev->num_capsets)return -EINVAL ;if (version > vgdev->capsets[idx].max_version)
@@ -664,6 +664,7 @@ int virtio_gpu_cmd_get_capset(struct virtio_gpu_device *vgdev,if (!cache_ent)return -ENOMEM ; + max_size = vgdev->capsets[idx].max_size; cache_ent->caps_cache =kmalloc (max_size,GFP_KERNEL );if (!cache_ent->caps_cache) {kfree (cache_ent);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/671 bridge: br_arp_nd_proxy: set icmp6_router if neigh has NTF_ROUTER
In reply to Sasha LevinFrom: Roopa Prabhu <[email protected]>
[ Upstream commit 7aca011f88eb57be1b17b0216247f4e32ac54e29 ]
--- net/bridge/br_arp_nd_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bridge/br_arp_nd_proxy.c +1 -1
@@ -311,7 +311,7 @@ static void br_nd_send(struct net_bridge *br, struct net_bridge_port *p,/* Neighbor Advertisement */ memset (na,0 ,sizeof (*na) + na_olen); na->icmph.icmp6_type =NDISC_NEIGHBOUR_ADVERTISEMENT ; - na->icmph.icmp6_router =0 ;/* XXX: should be 1 ? */ + na->icmph.icmp6_router = (n->flags &NTF_ROUTER ) ?1 :0 ; na->icmph.icmp6_override =1 ; na->icmph.icmp6_solicited =1 ; na->target = ns->target;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 15/671 signal/ia64: Use the generic force_sigsegv in setup_frame
In reply to Sasha LevinFrom: "Eric W. Biederman" <[email protected]>
[ Upstream commit 8b9c6b28312cc51a87055e292b11c5aa28f0c935 ]
The ia64 handling of failure to setup a signal frame has been trying to set overlapping fields in struct siginfo since 2.3.43. The si_pid and si_uid fields are stomped when the si_addr field is set. The si_code of SI_KERNEL indicates that si_pid and si_uid should be valid, and that si_addr does not exist.
Being at odds with the definition of SI_KERNEL and with nothing to indicate that this was a signal frame setup failure there is no way for userspace to know that si_addr was filled out instead.
In practice failure to setup a signal frame is rare, and si_pid and si_uid are always set to 0 when si_code is SI_KERNEL so I expect no one has looked closely enough before to see this weirdness. Further the only difference between force_sigsegv_info and the generic force_sigsegv other than the return code is that force_sigsegv_info stomps the si_uid and si_pid fields.
Remove the bug and simplify the code by using force_sigsegv in this case just like other architectures.
--- arch/ia64/kernel/signal.c | 50 ++++++++++----------------------------- 1 file changed, 12 insertions(+), 38 deletions(-)
arch/ia64/kernel/signal.c +12 -38
@@ -231,37 +231,6 @@ rbs_on_sig_stack (unsigned long bsp)return (bsp - current->sas_ss_sp < current->sas_ss_size); } -static long -force_sigsegv_info (int sig,void __user *addr) -{ -unsigned long flags; -struct siginfo si; - -clear_siginfo (&si); -if (sig =SIGSEGV ) { -/* -* Acquiring siglock around the sa_handler-update is almost -* certainly overkill, but this isn't a -* performance-critical path and I'd rather play it safe -* here than having to debug a nasty race if and when -* something changes in kernel/signal.c that would make it -* no longer safe to modify sa_handler without holding the -* lock. -*/ -spin_lock_irqsave (¤t->sighand->siglock, flags); - current->sighand->action[sig -1 ].sa.sa_handler =SIG_DFL ; -spin_unlock_irqrestore (¤t->sighand->siglock, flags); - } - si.si_signo =SIGSEGV ; - si.si_errno =0 ; - si.si_code =SI_KERNEL ; - si.si_pid =task_pid_vnr (current); - si.si_uid =from_kuid_munged (current_user_ns (),current_uid ()); - si.si_addr = addr; -force_sig_info (SIGSEGV , &si, current); -return 1 ; -} -static long setup_frame (struct ksignal *ksig,sigset_t *set,struct sigscratch *scr) {
@@ -295,15 +264,18 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct sigscratch *scr)* instead so we will die with SIGSEGV. */ check_sp = (new_sp -sizeof (*frame)) & -STACK_ALIGN ; -if (!likely (on_sig_stack (check_sp))) -return force_sigsegv_info (ksig->sig, (void __user *) - check_sp); +if (!likely (on_sig_stack (check_sp))) { +force_sigsegv (ksig->sig, current); +return 1 ; + } } } frame = (void __user *) ((new_sp -sizeof (*frame)) & -STACK_ALIGN ); -if (!access_ok (VERIFY_WRITE , frame,sizeof (*frame))) -return force_sigsegv_info (ksig->sig, frame); +if (!access_ok (VERIFY_WRITE , frame,sizeof (*frame))) { +force_sigsegv (ksig->sig, current); +return 1 ; + } err =__put_user (ksig->sig, &frame->arg0); err |=__put_user (&frame->info, &frame->arg1);
@@ -317,8 +289,10 @@ setup_frame(struct ksignal *ksig, sigset_t *set, struct sigscratch *scr) err |=__save_altstack (&frame->sc.sc_stack, scr->pt.r12); err |=setup_sigcontext (&frame->sc, set, scr); -if (unlikely (err)) -return force_sigsegv_info (ksig->sig, frame); +if (unlikely (err)) { +force_sigsegv (ksig->sig, current); +return 1 ; + } scr->pt.r12 = (unsigned long ) frame -16 ;/* new stack pointer */ scr->pt.ar_fpsr =FPSR_DEFAULT ;/* reset fpsr for signal handler */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/671 signal/ia64: Use the force_sig(SIGSEGV,...) in ia64_rt_sigreturn
In reply to Sasha LevinFrom: "Eric W. Biederman" <[email protected]>
[ Upstream commit b92adb74adde62d9a9780ff2977d63dcb21aeaa6 ]
The ia64 handling of failure to return from a signal frame has been trying to set overlapping fields in struct siginfo since 2.3.43. The si_code corresponds to the fields that were stomped (not the field that is actually written), so I can not imagine a piece of userspace code making sense of the signal frame if it looks closely.
In practice failure to return from a signal frame is a rare event that almost never happens. Someone using an alternate signal stack to recover and looking in detail is even more rare. So I presume no one has ever noticed and reported this ia64 nonsense.
Sort this out by causing ia64 to use force_sig(SIGSEGV) like other architectures.
--- arch/ia64/kernel/signal.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
arch/ia64/kernel/signal.c +1 -9
@@ -110,7 +110,6 @@ ia64_rt_sigreturn (struct sigscratch *scr) {extern char ia64_strace_leave_kernel, ia64_leave_kernel;struct sigcontext __user *sc; -struct siginfo si;sigset_t set;long retval;
@@ -153,14 +152,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)return retval; give_sigsegv: -clear_siginfo (&si); - si.si_signo =SIGSEGV ; - si.si_errno =0 ; - si.si_code =SI_KERNEL ; - si.si_pid =task_pid_vnr (current); - si.si_uid =from_kuid_munged (current_user_ns (),current_uid ()); - si.si_addr = sc; -force_sig_info (SIGSEGV , &si, current); +force_sig (SIGSEGV , current);return retval; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 33/671 pwm: lpss: Release runtime-pm reference from the driver's remove callback
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 42885551cedb45961879d2fc3dc3c4dc545cc23e ]
For each pwm output which gets enabled through pwm_lpss_apply(), we do a pm_runtime_get_sync().
This commit adds pm_runtime_put() calls to pwm_lpss_remove() to balance these when the driver gets removed with some of the outputs still enabled.
--- drivers/pwm/pwm-lpss.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/pwm/pwm-lpss.c +6 -0
@@ -216,6 +216,12 @@ EXPORT_SYMBOL_GPL(pwm_lpss_probe);int pwm_lpss_remove (struct pwm_lpss_chip *lpwm) { +int i; + +for (i =0 ; i < lpwm->info->npwm; i++) { +if (pwm_is_enabled (&lpwm->chip.pwms[i])) +pm_runtime_put (lpwm->chip.dev); + }return pwmchip_remove (&lpwm->chip); }EXPORT_SYMBOL_GPL (pwm_lpss_remove);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 51/671 bus: ti-sysc: Add mcasp optional clocks flag
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit 2c63a833e4500b341a62bf97e67488909ae12086 ]
We have OPT_CLKS_NEEDED in legacy platform data, but it's missing from the ti-sysc driver for device tree based configuration.
In order to pass OPT_CLKS_NEEDED quirk flag we need to update omap4 module data and add a new compatible for dra7 as the module layout is different from sysc_regbits_omap4_mcasp.
target modules")
--- Documentation/devicetree/bindings/bus/ti-sysc.txt | 1 + drivers/bus/ti-sysc.c | 11 +++++++++++ 2 files changed, 12 insertions(+)
Documentation/devicetree/bindings/bus/ti-sysc.txt +1 -0
@@ -35,6 +35,7 @@ Required standard properties: "ti,sysc-omap3-sham" "ti,sysc-omap-aes" "ti,sysc-mcasp" + "ti,sysc-dra7-mcasp" "ti,sysc-usb-host-fs" "ti,sysc-dra7-mcan"
drivers/bus/ti-sysc.c +11 -0
@@ -1593,6 +1593,16 @@ static const struct sysc_regbits sysc_regbits_omap4_mcasp = {static const struct sysc_capabilities sysc_omap4_mcasp = { .type =TI_SYSC_OMAP4_MCASP , .regbits = &sysc_regbits_omap4_mcasp, + .mod_quirks =SYSC_QUIRK_OPT_CLKS_NEEDED , +}; + +/* +* McASP found on dra7 and later +*/ +static const struct sysc_capabilities sysc_dra7_mcasp = { + .type =TI_SYSC_OMAP4_SIMPLE , + .regbits = &sysc_regbits_omap4_simple, + .mod_quirks =SYSC_QUIRK_OPT_CLKS_NEEDED , };/*
@@ -1821,6 +1831,7 @@ static const struct of_device_id sysc_match[] = { { .compatible = "ti,sysc-omap3-sham", .data = &sysc_omap3_sham, }, { .compatible = "ti,sysc-omap-aes", .data = &sysc_omap3_aes, }, { .compatible = "ti,sysc-mcasp", .data = &sysc_omap4_mcasp, }, + { .compatible = "ti,sysc-dra7-mcasp", .data = &sysc_dra7_mcasp, }, { .compatible = "ti,sysc-usb-host-fs", .data = &sysc_omap4_usb_host_fs, }, { .compatible = "ti,sysc-dra7-mcan", .data = &sysc_dra7_mcan, },
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 113/671 spi: cadence: Correct initialisation of runtime PM
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit 734882a8bf984c2ac8a57d8ac3ee53230bd0bed8 ]
Currently the driver calls pm_runtime_put_autosuspend but without ever having done a pm_runtime_get, this causes the reference count in the pm runtime core to become -1. The bad reference count causes the core to sometimes suspend whilst an active SPI transfer is in progress.
arizona spi0.1: SPI transfer timed outspi_master spi0: failed to transfer one message from queue
The correct proceedure is to do all the initialisation that requires the hardware to be powered up before enabling the PM runtime, then enable the PM runtime having called pm_runtime_set_active to inform it that the hardware is currently powered up. The core will then power it down at it's leisure and no explicit pm_runtime_put is required.
--- drivers/spi/spi-cadence.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
drivers/spi/spi-cadence.c +4 -7
@@ -584,11 +584,6 @@ static int cdns_spi_probe(struct platform_device *pdev) goto clk_dis_apb; } -pm_runtime_use_autosuspend (&pdev->dev); -pm_runtime_set_autosuspend_delay (&pdev->dev,SPI_AUTOSUSPEND_TIMEOUT ); -pm_runtime_set_active (&pdev->dev); -pm_runtime_enable (&pdev->dev); - ret =of_property_read_u32 (pdev->dev.of_node,"num-cs" , &num_cs);if (ret <0 ) master->num_chipselect =CDNS_SPI_DEFAULT_NUM_CS ;
@@ -603,8 +598,10 @@ static int cdns_spi_probe(struct platform_device *pdev)/* SPI controller initializations */ cdns_spi_init_hw (xspi); -pm_runtime_mark_last_busy (&pdev->dev); -pm_runtime_put_autosuspend (&pdev->dev); +pm_runtime_set_active (&pdev->dev); +pm_runtime_enable (&pdev->dev); +pm_runtime_use_autosuspend (&pdev->dev); +pm_runtime_set_autosuspend_delay (&pdev->dev,SPI_AUTOSUSPEND_TIMEOUT ); irq =platform_get_irq (pdev,0 );if (irq <=0 ) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 116/671 memory: tegra: Don't invoke Tegra30+ specific memory timing setup on Tegra20
In reply to Sasha LevinFrom: Dmitry Osipenko <[email protected]>
[ Upstream commit be4dbdec2bab8635c7a41573668624ee13d83022 ]
This fixes irrelevant "tegra-mc 7000f000.memory-controller: no memory timings for RAM code 0 registered" warning message during of kernels boot-up on Tegra20.
--- drivers/memory/tegra/mc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/memory/tegra/mc.c +6 -5
@@ -664,12 +664,13 @@ static int tegra_mc_probe(struct platform_device *pdev) } isr = tegra_mc_irq; - } - err =tegra_mc_setup_timings (mc); -if (err <0 ) { -dev_err (&pdev->dev,"failed to setup timings: %d\n" , err); -return err; + err =tegra_mc_setup_timings (mc); +if (err <0 ) { +dev_err (&pdev->dev,"failed to setup timings: %d\n" , + err); +return err; + } } mc->irq =platform_get_irq (pdev,0 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 1/671 drm/sti: do not remove the drm_bridge that was never added
From: Peter Rosin <[email protected]>
[ Upstream commit 66e31a72dc38543b2d9d1ce267dc78ba9beebcfd ]
Removing the drm_bridge_remove call should avoid a NULL dereference during list processing in drm_bridge_remove if the error path is ever taken.
The more natural approach would perhaps be to add a drm_bridge_add, but there are several other bridges that never call drm_bridge_add. Just removing the drm_bridge_remove is the easier fix.
--- drivers/gpu/drm/sti/sti_hda.c | 1 - drivers/gpu/drm/sti/sti_hdmi.c | 1 - 2 files changed, 2 deletions(-)
drivers/gpu/drm/sti/sti_hda.c +0 -1
@@ -721,7 +721,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)return 0 ; err_sysfs: -drm_bridge_remove (bridge);return -EINVAL ; }
drivers/gpu/drm/sti/sti_hdmi.c +0 -1
@@ -1315,7 +1315,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)return 0 ; err_sysfs: -drm_bridge_remove (bridge); hdmi->drm_connector =NULL ;return -EINVAL ; }
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 2/671 ARM: dts: at91: nattis: set the PRLUD and HIPOW signals low
From: Peter Rosin <[email protected]>
[ Upstream commit 29feb2c960ab32fc24249443d4434194ce96f083 ]
AT91_PINCTRL_OUTPUT_VAL(0) without AT91_PINCTRL_OUTPUT is a no-op, so make sure the pins really output a zero.
--- arch/arm/boot/dts/at91-nattis-2-natte-2.dts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/boot/dts/at91-nattis-2-natte-2.dts +4 -2
@@ -38,14 +38,16 @@ atmel,pins = <AT91_PIOA 21 AT91_PERIPH_GPIO - AT91_PINCTRL_OUTPUT_VAL(0)>; + (AT91_PINCTRL_OUTPUT | + AT91_PINCTRL_OUTPUT_VAL(0))>; }; pinctrl_lcd_hipow0: lcd_hipow0 { atmel,pins = <AT91_PIOA 23 AT91_PERIPH_GPIO - AT91_PINCTRL_OUTPUT_VAL(0)>; + (AT91_PINCTRL_OUTPUT | + AT91_PINCTRL_OUTPUT_VAL(0))>; }; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/671 apparmor: Fix network performance issue in aa_label_sk_perm
In reply to Sasha LevinFrom: Tony Jones <[email protected]>
[ Upstream commit 5f997580e8b12b9f585e34cc16304925d26ce49e ]
The netperf benchmark shows a 5.73% reduction in throughput for small (64 byte) transfers by unconfined tasks.
DEFINE_AUDIT_SK() in aa_label_sk_perm() should not be performed unconditionally, rather only when the label is confined.
netperf-tcp
56974a6fc^ 56974a6fc Min 64 563.48 ( 0.00%) 531.17 ( -5.73%) Min 128 1056.92 ( 0.00%) 999.44 ( -5.44%) Min 256 1945.95 ( 0.00%) 1867.97 ( -4.01%) Min 1024 6761.40 ( 0.00%) 6364.23 ( -5.87%) Min 2048 11110.53 ( 0.00%) 10606.20 ( -4.54%) Min 3312 13692.67 ( 0.00%) 13158.41 ( -3.90%) Min 4096 14926.29 ( 0.00%) 14457.46 ( -3.14%) Min 8192 18399.34 ( 0.00%) 18091.65 ( -1.67%) Min 16384 21384.13 ( 0.00%) 21158.05 ( -1.06%) Hmean 64 564.96 ( 0.00%) 534.38 ( -5.41%) Hmean 128 1064.42 ( 0.00%) 1010.12 ( -5.10%) Hmean 256 1965.85 ( 0.00%) 1879.16 ( -4.41%) Hmean 1024 6839.77 ( 0.00%) 6478.70 ( -5.28%) Hmean 2048 11154.80 ( 0.00%) 10671.13 ( -4.34%) Hmean 3312 13838.12 ( 0.00%) 13249.01 ( -4.26%) Hmean 4096 15009.99 ( 0.00%) 14561.36 ( -2.99%) Hmean 8192 18975.57 ( 0.00%) 18326.54 ( -3.42%) Hmean 16384 21440.44 ( 0.00%) 21324.59 ( -0.54%) Stddev 64 1.24 ( 0.00%) 2.85 (-130.64%) Stddev 128 4.51 ( 0.00%) 6.53 ( -44.84%) Stddev 256 11.67 ( 0.00%) 8.50 ( 27.16%) Stddev 1024 48.33 ( 0.00%) 75.07 ( -55.34%) Stddev 2048 54.82 ( 0.00%) 65.16 ( -18.86%) Stddev 3312 153.57 ( 0.00%) 56.29 ( 63.35%) Stddev 4096 100.25 ( 0.00%) 88.50 ( 11.72%) Stddev 8192 358.13 ( 0.00%) 169.99 ( 52.54%) Stddev 16384 43.99 ( 0.00%) 141.82 (-222.39%)
mediation")
--- security/apparmor/net.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
security/apparmor/net.c +9 -6
@@ -146,17 +146,20 @@ int aa_af_perm(struct aa_label *label, const char *op, u32 request, u16 family,static int aa_label_sk_perm (struct aa_label *label,const char *op,u32 request,struct sock *sk) { -struct aa_profile *profile; -DEFINE_AUDIT_SK (sa, op, sk); +int error =0 ;AA_BUG (!label);AA_BUG (!sk); -if (unconfined (label)) -return 0 ; +if (!unconfined (label)) { +struct aa_profile *profile; +DEFINE_AUDIT_SK (sa, op, sk); -return fn_for_each_confined (label, profile, -aa_profile_af_sk_perm (profile, &sa, request, sk)); + error =fn_for_each_confined (label, profile, +aa_profile_af_sk_perm (profile, &sa, request, sk)); + } + +return error; }int aa_sk_perm (const char *op,u32 request,struct sock *sk)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/671 drm/hisilicon: hibmc: Don't overwrite fb helper surface depth
In reply to Sasha LevinFrom: John Garry <[email protected]>
[ Upstream commit 0ff9f49646353ce31312411e7e7bd2281492a40e ]
Currently the driver overwrites the surface depth provided by the fb helper to give an invalid bpp/surface depth combination.
This has been exposed by commit 70109354fed2 ("drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl"), which now causes the driver to fail to probe.
Fix by not overwriting the surface depth.
--- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +0 -1
@@ -71,7 +71,6 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper,DRM_DEBUG_DRIVER ("surface width(%d), height(%d) and bpp(%d)\n" , sizes->surface_width, sizes->surface_height, sizes->surface_bpp); - sizes->surface_depth =32 ; bytes_per_pixel =DIV_ROUND_UP (sizes->surface_bpp,8 );
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 8/671 ALSA: hda: fix unused variable warning
In reply to Sasha LevinFrom: Anders Roxell <[email protected]>
[ Upstream commit 5b03006d5c58ddd31caf542eef4d0269bcf265b3 ]
When CONFIG_X86=n function azx_snoop doesn't use the variable chip it only returns true.
sound/pci/hda/hda_intel.c: In function ‘dma_alloc_pages’:sound/pci/hda/hda_intel.c:2002:14: warning: unused variable ‘chip’ [-Wunused-variable]
struct azx *chip = bus_to_azx(bus);
^~~~Create a inline function of azx_snoop.
--- sound/pci/hda/hda_controller.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
sound/pci/hda/hda_controller.h +4 -5
@@ -176,11 +176,10 @@ struct azx {#define azx_bus (chip) (&(chip)->bus.core)#define bus_to_azx (_bus) container_of(_bus, struct azx, bus.core) -#ifdef CONFIG_X86 -#define azx_snoop (chip) ((chip)->snoop) -#else -#define azx_snoop (chip) true -#endif +static inline bool azx_snoop (struct azx *chip) +{ +return !IS_ENABLED (CONFIG_X86 ) || chip->snoop; +}/* * macros for easy use
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/671 apparmor: don't try to replace stale label in ptrace access check
In reply to Sasha LevinFrom: Jann Horn <[email protected]>
[ Upstream commit 1f8266ff58840d698a1e96d2274189de1bdf7969 ]
As a comment above begin_current_label_crit_section() explains, begin_current_label_crit_section() must run in sleepable context because when label_is_stale() is true, aa_replace_current_label() runs, which uses prepare_creds(), which can sleep.
Until now, the ptrace access check (which runs with a task lock held) violated this rule.
Also add a might_sleep() assertion to begin_current_label_crit_section(), because asserts are less likely to be ignored than comments.
--- security/apparmor/include/cred.h | 2 ++ security/apparmor/lsm.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-)
security/apparmor/include/cred.h +2 -0
@@ -151,6 +151,8 @@ static inline struct aa_label *begin_current_label_crit_section(void) {struct aa_label *label =aa_current_raw_label (); +might_sleep (); +if (label_is_stale (label)) { label =aa_get_newest_label (label);if (aa_replace_current_label (label) ==0 )
security/apparmor/lsm.c +2 -2
@@ -114,13 +114,13 @@ static int apparmor_ptrace_access_check(struct task_struct *child,struct aa_label *tracer, *tracee;int error; - tracer =begin_current_label_crit_section (); + tracer =__begin_current_label_crit_section (); tracee =aa_get_task_label (child); error =aa_may_ptrace (tracer, tracee, (mode &PTRACE_MODE_READ ) ?AA_PTRACE_READ :AA_PTRACE_TRACE );aa_put_label (tracee); -end_current_label_crit_section (tracer); +__end_current_label_crit_section (tracer);return error; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/671 ASoC: wm9712: fix unused variable warning
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 18380dcc52cc8965e5144ce33fdfad7e168679a5 ]
The 'ret' variable is now only used in an #ifdef, and causes a warning if it is declared outside of that block:
sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':sound/soc/codecs/wm9712.c:641:6: error: unused variable 'ret' [-Werror=unused-variable]
--- sound/soc/codecs/wm9712.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
sound/soc/codecs/wm9712.c +2 -1
@@ -638,13 +638,14 @@ static int wm9712_soc_probe(struct snd_soc_component *component) {struct wm9712_priv *wm9712 =snd_soc_component_get_drvdata (component);struct regmap *regmap; -int ret;if (wm9712->mfd_pdata) { wm9712->ac97 = wm9712->mfd_pdata->ac97; regmap = wm9712->mfd_pdata->regmap; }else {#ifdef CONFIG_SND_SOC_AC97_BUS +int ret; + wm9712->ac97 =snd_soc_new_ac97_component (component,WM9712_VENDOR_ID ,WM9712_VENDOR_ID_MASK );if (IS_ERR (wm9712->ac97)) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/671 IB/rxe: replace kvfree with vfree
In reply to Sasha LevinFrom: Zhu Yanjun <[email protected]>
[ Upstream commit 721ad7e643f7002efa398838693f90284ea216d1 ]
The buf is allocated by vmalloc_user in the function rxe_queue_init. So it is better to free it by vfree.
--- drivers/infiniband/sw/rxe/rxe_cq.c | 4 ++-- drivers/infiniband/sw/rxe/rxe_qp.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/infiniband/sw/rxe/rxe_cq.c +2 -2
@@ -30,7 +30,7 @@* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ - +#include <linux/vmalloc.h> #include "rxe.h" #include "rxe_loc.h" #include "rxe_queue.h"
@@ -97,7 +97,7 @@ int rxe_cq_from_init(struct rxe_dev *rxe, struct rxe_cq *cq, int cqe, err =do_mmap_info (rxe, uresp ? &uresp->mi :NULL , context, cq->queue->buf, cq->queue->buf_size, &cq->queue->ip);if (err) { -kvfree (cq->queue->buf); +vfree (cq->queue->buf);kfree (cq->queue);return err; }
drivers/infiniband/sw/rxe/rxe_qp.c +3 -2
@@ -34,6 +34,7 @@#include <linux/skbuff.h> #include <linux/delay.h> #include <linux/sched.h> +#include <linux/vmalloc.h> #include "rxe.h" #include "rxe_loc.h"
@@ -247,7 +248,7 @@ static int rxe_qp_init_req(struct rxe_dev *rxe, struct rxe_qp *qp, &qp->sq.queue->ip);if (err) { -kvfree (qp->sq.queue->buf); +vfree (qp->sq.queue->buf);kfree (qp->sq.queue);return err; }
@@ -300,7 +301,7 @@ static int rxe_qp_init_resp(struct rxe_dev *rxe, struct rxe_qp *qp, qp->rq.queue->buf, qp->rq.queue->buf_size, &qp->rq.queue->ip);if (err) { -kvfree (qp->rq.queue->buf); +vfree (qp->rq.queue->buf);kfree (qp->rq.queue);return err; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 20/671 IB/hfi1: Add mtu check for operational data VLs
In reply to Sasha LevinFrom: Alex Estrin <[email protected]>
[ Upstream commit eb50130964e8c1379f37c3d3bab33a411ec62e98 ]
Since Virtual Lanes BCT credits and MTU are set through separate MADs, we have to ensure both are valid, and data VLs are ready for transmission before we allow port transition to Armed state.
--- drivers/infiniband/hw/hfi1/chip.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-)
drivers/infiniband/hw/hfi1/chip.c +22 -4
@@ -10580,12 +10580,29 @@ void set_link_down_reason(struct hfi1_pportdata *ppd, u8 lcl_reason, } } -/* -* Verify if BCT for data VLs is non-zero. +/** +* data_vls_operational() - Verify if data VL BCT credits and MTU +* are both set. +* @ppd: pointer to hfi1_pportdata structure +* +* Return: true - Ok, false -otherwise. */ static inline bool data_vls_operational (struct hfi1_pportdata *ppd) { -return !!ppd->actual_vls_operational; +int i; +u64 reg; + +if (!ppd->actual_vls_operational) +return false; + +for (i =0 ; i < ppd->vls_supported; i++) { + reg =read_csr (ppd->dd,SEND_CM_CREDIT_VL + (8 * i)); +if ((reg && !ppd->dd->vld[i].mtu) || + (!reg && ppd->dd->vld[i].mtu)) +return false; + } + +return true; }/*
@@ -10698,7 +10715,8 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)if (!data_vls_operational (ppd)) {dd_dev_err (dd, -"%s: data VLs not operational\n" , __func__); +"%s: Invalid data VL credits or mtu\n" , + __func__); ret = -EINVAL ;break ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/671 firmware: coreboot: Let OF core populate platform device
In reply to Sasha LevinFrom: Stephen Boyd <[email protected]>
[ Upstream commit 09ed061a4f56d50758851ca3997510f27115f81b ]
Now that the /firmware/coreboot node in DT is populated by the core DT platform code with commit 3aa0582fdb82 ("of: platform: populate /firmware/ node from of_platform_default_populate_init()") we should and can remove the platform device creation here. Otherwise, the of_platform_device_create() call will fail, the coreboot of driver won't be registered, and this driver will never bind. At the same time, we should move this driver to use MODULE_DEVICE_TABLE so that module auto-load works properly when the coreboot device is auto-populated and we should drop the of_node handling that was presumably placed here to hold a reference to the DT node created during module init that no longer happens.
--- drivers/firmware/google/coreboot_table-of.c | 28 +++------------------ 1 file changed, 3 insertions(+), 25 deletions(-)
drivers/firmware/google/coreboot_table-of.c +3 -25
@@ -19,7 +19,6 @@#include <linux/io.h> #include <linux/module.h> #include <linux/of_address.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> #include "coreboot_table.h"
@@ -30,7 +29,6 @@ static int coreboot_table_of_probe(struct platform_device *pdev)void __iomem *ptr; ptr =of_iomap (fw_dn,0 ); -of_node_put (fw_dn);if (!ptr)return -ENOMEM ;
@@ -44,8 +42,9 @@ static int coreboot_table_of_remove(struct platform_device *pdev)static const struct of_device_id coreboot_of_match[] = { { .compatible ="coreboot" }, - {}, + {} }; +MODULE_DEVICE_TABLE (of, coreboot_of_match);static struct platform_driver coreboot_table_of_driver = { .probe = coreboot_table_of_probe,
@@ -55,28 +54,7 @@ static struct platform_driver coreboot_table_of_driver = { .of_match_table = coreboot_of_match, }, }; - -static int __init platform_coreboot_table_of_init (void ) -{ -struct platform_device *pdev; -struct device_node *of_node; - -/* Limit device creation to the presence of /firmware/coreboot node */ - of_node =of_find_node_by_path ("/firmware/coreboot" ); -if (!of_node) -return -ENODEV ; - -if (!of_match_node (coreboot_of_match, of_node)) -return -ENODEV ; - - pdev =of_platform_device_create (of_node,"coreboot_table_of" ,NULL ); -if (!pdev) -return -ENODEV ; - -return platform_driver_register (&coreboot_table_of_driver); -} - -module_init (platform_coreboot_table_of_init); +module_platform_driver (coreboot_table_of_driver);MODULE_AUTHOR ("Google, Inc." );MODULE_LICENSE ("GPL" );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 21/671 genirq/debugfs: Reinstate full OF path for domain name
In reply to Sasha LevinFrom: Marc Zyngier <[email protected]>
[ Upstream commit 94967b55ebf3b603f2fe750ecedd896042585a1c ]
On a DT based system, we use the of_node full name to name the corresponding irq domain. We expect that name to be unique, so so that domains with the same base name won't clash (this happens on multi-node topologies, for example).
Since a7e4cfb0a7ca ("of/fdt: only store the device node basename in full_name"), of_node_full_name() lies and only returns the basename. This breaks the above requirement, and we end-up with only a subset of the domains in /sys/kernel/debug/irq/domains.
Let's reinstate the feature by using the fancy new %pOF format specifier, which happens to do the right thing.
--- kernel/irq/irqdomain.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irqdomain.c +1 -1
@@ -183,7 +183,7 @@ struct irq_domain *__irq_domain_add(struct fwnode_handle *fwnode, int size,* unhappy about. Replace them with ':', which does * the trick and is not as offensive as '\'... */ - name =kstrdup (of_node_full_name (of_node),GFP_KERNEL ); + name =kasprintf (GFP_KERNEL ,"%pOF" , of_node);if (!name) {kfree (domain);return NULL ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 23/671 usb: gadget: fsl_udc_core: check allocation return value and cleanup on failure
In reply to Sasha LevinFrom: Nicholas Mc Guire <[email protected]>
[ Upstream commit 4ab2b48c98f2ec9712452d520a381917f91ac3d2 ]
The allocation with fsl_alloc_request() and kmalloc() were unchecked fixed this up with a NULL check and appropriate cleanup.
Additionally udc->ep_qh_size was reset to 0 on failure of allocation. Similar udc->phy_mode is initially 0 (as udc_controller was allocated with kzalloc in fsl_udc_probe()) so reset it to 0 as well so that this function is side-effect free on failure. Not clear if this is necessary or sensible as fsl_udc_release() probably can not be called if fsl_udc_probe() failed - but it should not hurt.
--- drivers/usb/gadget/udc/fsl_udc_core.c | 30 +++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-)
drivers/usb/gadget/udc/fsl_udc_core.c +26 -4
@@ -2247,8 +2247,10 @@ static int struct_udc_setup(struct fsl_udc *udc, udc->phy_mode = pdata->phy_mode; udc->eps =kcalloc (udc->max_ep,sizeof (struct fsl_ep ),GFP_KERNEL ); -if (!udc->eps) -return -1 ; +if (!udc->eps) { +ERR ("kmalloc udc endpoint status failed\n" ); + goto eps_alloc_failed; + }/* initialized QHs, take care of alignment */ size = udc->max_ep *sizeof (struct ep_queue_head );
@@ -2262,8 +2264,7 @@ static int struct_udc_setup(struct fsl_udc *udc, &udc->ep_qh_dma, GFP_KERNEL);if (!udc->ep_qh) {ERR ("malloc QHs for udc failed\n" ); -kfree (udc->eps); -return -1 ; + goto ep_queue_alloc_failed; } udc->ep_qh_size = size;
@@ -2272,8 +2273,17 @@ static int struct_udc_setup(struct fsl_udc *udc,/* FIXME: fsl_alloc_request() ignores ep argument */ udc->status_req =container_of (fsl_alloc_request (NULL ,GFP_KERNEL ), struct fsl_req, req); +if (!udc->status_req) { +ERR ("kzalloc for udc status request failed\n" ); + goto udc_status_alloc_failed; + } +/* allocate a small amount of memory to get valid address */ udc->status_req->req.buf =kmalloc (8 ,GFP_KERNEL ); +if (!udc->status_req->req.buf) { +ERR ("kzalloc for udc request buffer failed\n" ); + goto udc_req_buf_alloc_failed; + } udc->resume_state =USB_STATE_NOTATTACHED ; udc->usb_state =USB_STATE_POWERED ;
@@ -2281,6 +2291,18 @@ static int struct_udc_setup(struct fsl_udc *udc, udc->remote_wakeup =0 ;/* default to 0 on reset */ return 0 ; + +udc_req_buf_alloc_failed: +kfree (udc->status_req); +udc_status_alloc_failed: +kfree (udc->ep_qh); + udc->ep_qh_size =0 ; +ep_queue_alloc_failed: +kfree (udc->eps); +eps_alloc_failed: + udc->phy_mode =0 ; +return -1 ; + }/*----------------------------------------------------------------
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 24/671 cfg80211: regulatory: make initialization more robust
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 71e5e886806ee3f8e0c44ed945eb2e4d6659c6e3 ]
Since my change to split out the regulatory init to occur later, any issues during earlier cfg80211_init() or errors during the platform device allocation would lead to crashes later. Make this more robust by checking that the earlier initialization succeeded.
--- net/wireless/reg.c | 9 +++++++++ 1 file changed, 9 insertions(+)
net/wireless/reg.c +9 -0
@@ -3870,6 +3870,15 @@ static int __init regulatory_init_db(void) {int err; +/* +* It's possible that - due to other bugs/issues - cfg80211 +* never called regulatory_init() below, or that it failed; +* in that case, don't try to do any further work here as +* it's doomed to lead to crashes. +*/ +if (IS_ERR_OR_NULL (reg_pdev)) +return -EINVAL ; + err =load_builtin_regdb_keys ();if (err)return err;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 18/671 mailbox: mediatek: Add check for possible failure of kzalloc
In reply to Sasha LevinFrom: Houlong Wei <[email protected]>
[ Upstream commit 9f0a0a381c5db56e7922dbeea6831f27db58372f ]
The patch 623a6143a845("mailbox: mediatek: Add Mediatek CMDQ driver") introduce the following static checker warning:
drivers/mailbox/mtk-cmdq-mailbox.c:366 cmdq_mbox_send_data()
error: potential null dereference 'task'. (kzalloc returns null)
--- drivers/mailbox/mtk-cmdq-mailbox.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/mailbox/mtk-cmdq-mailbox.c +3 -0
@@ -363,6 +363,9 @@ static int cmdq_mbox_send_data(struct mbox_chan *chan, void *data)WARN_ON (cmdq->suspended); task =kzalloc (sizeof (*task),GFP_ATOMIC ); +if (!task) +return -ENOMEM ; + task->cmdq = cmdq;INIT_LIST_HEAD (&task->list_entry); task->pa_base = pkt->pa_base;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 27/671 drm/msm: fix unsigned comparison with less than zero
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit dfdb3be43ef1195c491e6c3760b922acb52e3575 ]
The return from the call to _mixer_stages can be a negative error code however this is being assigned to an unsigned variable 'stages' hence the check is always false. Fix this by making 'stages' an int.
Detected by Coccinelle ("Unsigned expression compared with zero:
stages < 0")
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +1 -1
@@ -310,7 +310,7 @@ static void dpu_hw_ctl_setup_blendstage(struct dpu_hw_ctl *ctx,u32 mixercfg =0 , mixercfg_ext =0 , mix, ext;u32 mixercfg_ext2 =0 , mixercfg_ext3 =0 ;int i, j; -u8 stages; +int stages;int pipes_per_stage; stages =_mixer_stages (ctx->mixer_hw_caps, ctx->mixer_count, lm);
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 41/671 drm/sun4i: hdmi: Fix double flag assignation
In reply to Sasha LevinFrom: Maxime Ripard <[email protected]>
[ Upstream commit 1e0ff648940e603cab6c52cf3723017d30d78f30 ]
The is_double flag is a boolean currently assigned to the value of the d variable, that is either 1 or 2. It means that this is_double variable is always set to true, even though the initial intent was to have it set to true when d is 2.
Fix this.
--- drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_tmds_clk.c +1 -1
@@ -52,7 +52,7 @@ static unsigned long sun4i_tmds_calc_divider(unsigned long rate, (rate - tmp_rate) < (rate - best_rate)) { best_rate = tmp_rate; best_m = m; - is_double = d; + is_double = (d ==2 ) ? true : false; } } }
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 28/671 of: Fix property name in of_node_get_device_type
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 5d5a0ab1a7918fce5ca5c0fb1871a3e2000f85de ]
Commit 0413bedabc88 ("of: Add device_type access helper functions") added a new helper not yet used in preparation for some treewide clean up of accesses to 'device_type' properties. Unfortunately, there's an error and 'type' was used for the property name. Fix this.
--- include/linux/of.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/of.h +1 -1
@@ -1001,7 +1001,7 @@ static inline struct device_node *of_find_matching_node(static inline const char *of_node_get_device_type (const struct device_node *np) { -return of_get_property (np,"type" ,NULL ); +return of_get_property (np,"device_type" ,NULL ); }static inline bool of_node_is_type (const struct device_node *np,const char *type)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 45/671 NTB: ntb_hw_idt: replace IS_ERR_OR_NULL with regular NULL checks
In reply to Sasha LevinFrom: "Gustavo A. R. Silva" <[email protected]>
[ Upstream commit 1b7619828d0c341612f58683e73f279c37e70bbc ]
Both devm_kcalloc() and devm_kzalloc() return NULL on error. They never return error pointers.
The use of IS_ERR_OR_NULL is currently applied to the wrong context.
Fix this by replacing IS_ERR_OR_NULL with regular NULL checks.
--- drivers/ntb/hw/idt/ntb_hw_idt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ntb/hw/idt/ntb_hw_idt.c +4 -4
@@ -1105,9 +1105,9 @@ static struct idt_mw_cfg *idt_scan_mws(struct idt_ntb_dev *ndev, int port, }/* Allocate memory for memory window descriptors */ - ret_mws =devm_kcalloc (&ndev->ntb.pdev->dev, *mw_cnt, -sizeof (*ret_mws),GFP_KERNEL ); -if (IS_ERR_OR_NULL (ret_mws)) + ret_mws =devm_kcalloc (&ndev->ntb.pdev->dev, *mw_cnt,sizeof (*ret_mws), +GFP_KERNEL ); +if (!ret_mws)return ERR_PTR (-ENOMEM );/* Copy the info of detected memory windows */
@@ -2390,7 +2390,7 @@ static struct idt_ntb_dev *idt_create_dev(struct pci_dev *pdev,/* Allocate memory for the IDT PCIe-device descriptor */ ndev =devm_kzalloc (&pdev->dev,sizeof (*ndev),GFP_KERNEL ); -if (IS_ERR_OR_NULL (ndev)) { +if (!ndev) {dev_err (&pdev->dev,"Memory allocation failed for descriptor" );return ERR_PTR (-ENOMEM ); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 30/671 iwlwifi: nvm: get num of hw addresses from firmware
In reply to Sasha LevinFrom: Naftali Goldstein <[email protected]>
[ Upstream commit e7eeee08434873c2f781dc1afaa42b03a014b95d ]
With NICs that don't read the NVM directly and instead rely on getting the relevant data from the firmware, the number of reserved MAC addresses was not added to the API. This caused the driver to assume there is only one address which results in all interfaces getting the same address. Update the API to fix this.
While at it, fix-up the comments with firmware api names to actually match what we have in the firmware.
--- .../net/wireless/intel/iwlwifi/fw/api/nvm-reg.h | 14 +++++++------- drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 10 +++++++++- 2 files changed, 16 insertions(+), 8 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h +7 -7
@@ -165,7 +165,7 @@ struct iwl_nvm_access_resp {*/ struct iwl_nvm_get_info {__le32 reserved; -} __packed;/* GRP_REGULATORY_NVM_GET_INFO_CMD_S_VER_1 */ +} __packed;/* REGULATORY_NVM_GET_INFO_CMD_API_S_VER_1 */ /** * enum iwl_nvm_info_general_flags - flags in NVM_GET_INFO resp
@@ -180,14 +180,14 @@ enum iwl_nvm_info_general_flags {* @flags: bit 0: 1 - empty, 0 - non-empty * @nvm_version: nvm version * @board_type: board type -* @reserved: reserved +* @n_hw_addrs: number of reserved MAC addresses */ struct iwl_nvm_get_info_general {__le32 flags;__le16 nvm_version;u8 board_type; -u8 reserved; -} __packed;/* GRP_REGULATORY_NVM_GET_INFO_GENERAL_S_VER_1 */ +u8 n_hw_addrs; +} __packed;/* REGULATORY_NVM_GET_INFO_GENERAL_S_VER_2 */ /** * enum iwl_nvm_mac_sku_flags - flags in &iwl_nvm_get_info_sku
@@ -231,7 +231,7 @@ struct iwl_nvm_get_info_sku {struct iwl_nvm_get_info_phy {__le32 tx_chains;__le32 rx_chains; -} __packed;/* GRP_REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */ +} __packed;/* REGULATORY_NVM_GET_INFO_PHY_SKU_SECTION_S_VER_1 */ #define IWL_NUM_CHANNELS (51)
@@ -245,7 +245,7 @@ struct iwl_nvm_get_info_regulatory {__le32 lar_enabled;__le16 channel_profile[IWL_NUM_CHANNELS ];__le16 reserved; -} __packed;/* GRP_REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */ +} __packed;/* REGULATORY_NVM_GET_INFO_REGULATORY_S_VER_1 */ /** * struct iwl_nvm_get_info_rsp - response to get NVM data
@@ -259,7 +259,7 @@ struct iwl_nvm_get_info_rsp {struct iwl_nvm_get_info_sku mac_sku;struct iwl_nvm_get_info_phy phy_sku;struct iwl_nvm_get_info_regulatory regulatory; -} __packed;/* GRP_REGULATORY_NVM_GET_INFO_CMD_RSP_S_VER_2 */ +} __packed;/* REGULATORY_NVM_GET_INFO_RSP_API_S_VER_3 */ /** * struct iwl_nvm_access_complete_cmd - NVM_ACCESS commands are completed
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c +9 -1
@@ -1315,6 +1315,7 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans,bool lar_fw_supported = !iwlwifi_mod_params.lar_disable &&fw_has_capa (&fw->ucode_capa,IWL_UCODE_TLV_CAPA_LAR_SUPPORT ); +bool empty_otp;u32 mac_flags;u32 sbands_flags =0 ;
@@ -1330,7 +1331,9 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans, } rsp = (void *)hcmd.resp_pkt->data; -if (le32_to_cpu (rsp->general.flags) &NVM_GENERAL_FLAGS_EMPTY_OTP ) + empty_otp = !!(le32_to_cpu (rsp->general.flags) & +NVM_GENERAL_FLAGS_EMPTY_OTP ); +if (empty_otp)IWL_INFO (trans,"OTP is empty\n" ); nvm = kzalloc(sizeof(*nvm) +
@@ -1354,6 +1357,11 @@ struct iwl_nvm_data *iwl_get_nvm(struct iwl_trans *trans,/* Initialize general data */ nvm->nvm_version =le16_to_cpu (rsp->general.nvm_version); + nvm->n_hw_addrs = rsp->general.n_hw_addrs; +if (nvm->n_hw_addrs ==0 ) +IWL_WARN (trans, +"Firmware declares no reserved mac addresses. OTP is empty: %d\n" , + empty_otp);/* Initialize MAC sku data */ mac_flags =le32_to_cpu (rsp->mac_sku.mac_sku_flags);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 44/671 mlxsw: spectrum: Set minimum shaper on MC TCs
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit 0fe64023162aef123de2f1993ba13a35a786e1de ]
An MC-aware mode was introduced in commit 7b8195306694 ("mlxsw:
spectrum: Configure MC-aware mode on mlxsw ports"). In MC-aware mode, BUM traffic gets a special treatment by being assigned to a separate set of traffic classes 8..15. Pairs of TCs 0 and 8, 1 and 9, etc., are then configured to strictly prioritize the lower-numbered ones. The intention is to prevent BUM traffic from flooding the switch and push out all UC traffic, which would otherwise happen, and instead give UC traffic precedence.
However strictly prioritizing UC traffic has the effect that UC overload pushes out all BUM traffic, such as legitimate ARP queries. These packets are kept in queues for a while, but under sustained UC overload, their lifetime eventually expires and these packets are dropped. That is detrimental to network performance as well.
Therefore configure the MC TCs (8..15) with minimum shaper of 200Mbps (a minimum permitted value) to allow a trickle of necessary control traffic to get through.
--- .../net/ethernet/mellanox/mlxsw/spectrum.c | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +25 -0
@@ -2750,6 +2750,21 @@ int mlxsw_sp_port_ets_maxrate_set(struct mlxsw_sp_port *mlxsw_sp_port,return mlxsw_reg_write (mlxsw_sp->core,MLXSW_REG (qeec), qeec_pl); } +static int mlxsw_sp_port_min_bw_set (struct mlxsw_sp_port *mlxsw_sp_port, +enum mlxsw_reg_qeec_hr hr,u8 index, +u8 next_index,u32 minrate) +{ +struct mlxsw_sp *mlxsw_sp = mlxsw_sp_port->mlxsw_sp; +char qeec_pl[MLXSW_REG_QEEC_LEN ]; + +mlxsw_reg_qeec_pack (qeec_pl, mlxsw_sp_port->local_port, hr, index, + next_index); +mlxsw_reg_qeec_mise_set (qeec_pl, true); +mlxsw_reg_qeec_min_shaper_rate_set (qeec_pl, minrate); + +return mlxsw_reg_write (mlxsw_sp->core,MLXSW_REG (qeec), qeec_pl); +} +int mlxsw_sp_port_prio_tc_set (struct mlxsw_sp_port *mlxsw_sp_port,u8 switch_prio,u8 tclass) {
@@ -2827,6 +2842,16 @@ static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port)return err; } +/* Configure the min shaper for multicast TCs. */ +for (i =0 ; i <IEEE_8021QAZ_MAX_TCS ; i++) { + err =mlxsw_sp_port_min_bw_set (mlxsw_sp_port, +MLXSW_REG_QEEC_HIERARCY_TC , + i +8 , i, +MLXSW_REG_QEEC_MIS_MIN ); +if (err) +return err; + } +/* Map all priorities to traffic class 0. */ for (i =0 ; i <IEEE_8021QAZ_MAX_TCS ; i++) { err =mlxsw_sp_port_prio_tc_set (mlxsw_sp_port, i,0 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 31/671 staging: comedi: ni_mio_common: protect register write overflow
In reply to Sasha LevinFrom: "Spencer E. Olson" <[email protected]>
[ Upstream commit 1cbca5852d6c16e85a21487a15d211195aacd4a1 ]
Fixes two problems introduced as early as
commit 03aef4b6dc12 ("Staging: comedi: add ni_mio_common code"):
(1) Ensures that the last four bits of NISTC_RTSI_TRIGB_OUT_REG register is not unduly overwritten on e-series devices. On e-series devices, the first three of the last four bits are reserved. The last bit defines the output selection of the RGOUT0 pin, otherwise known as RTSI_Sub_Selection. For m-series devices, these last four bits are indeed used as the output selection of the RTSI7 pin (and the RTSI_Sub_Selection bit for the RGOUT0 pin is moved to the RTSI_Trig_Direction register.
(2) Allows all 4 RTSI_BRD lines to be treated as valid sources for RTSI lines.
This patch also cleans up the ni_get_rtsi_routing command for readability.
--- .../staging/comedi/drivers/ni_mio_common.c | 24 +++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-)
drivers/staging/comedi/drivers/ni_mio_common.c +17 -7
@@ -4984,7 +4984,10 @@ static int ni_valid_rtsi_output_source(struct comedi_device *dev,case NI_RTSI_OUTPUT_G_SRC0 :case NI_RTSI_OUTPUT_G_GATE0 :case NI_RTSI_OUTPUT_RGOUT0 : -case NI_RTSI_OUTPUT_RTSI_BRD_0 : +case NI_RTSI_OUTPUT_RTSI_BRD (0 ): +case NI_RTSI_OUTPUT_RTSI_BRD (1 ): +case NI_RTSI_OUTPUT_RTSI_BRD (2 ): +case NI_RTSI_OUTPUT_RTSI_BRD (3 ):return 1 ;case NI_RTSI_OUTPUT_RTSI_OSC :return (devpriv->is_m_series) ?1 :0 ;
@@ -5005,11 +5008,18 @@ static int ni_set_rtsi_routing(struct comedi_device *dev, devpriv->rtsi_trig_a_output_reg |=NISTC_RTSI_TRIG (chan, src);ni_stc_writew (dev, devpriv->rtsi_trig_a_output_reg,NISTC_RTSI_TRIGA_OUT_REG ); - }else if (chan <8 ) { + }else if (chan <NISTC_RTSI_TRIG_NUM_CHAN (devpriv->is_m_series)) { devpriv->rtsi_trig_b_output_reg &= ~NISTC_RTSI_TRIG_MASK (chan); devpriv->rtsi_trig_b_output_reg |=NISTC_RTSI_TRIG (chan, src);ni_stc_writew (dev, devpriv->rtsi_trig_b_output_reg,NISTC_RTSI_TRIGB_OUT_REG ); + }else if (chan !=NISTC_RTSI_TRIG_OLD_CLK_CHAN ) { +/* probably should never reach this, since the +* ni_valid_rtsi_output_source above errors out if chan is too +* high +*/ +dev_err (dev->class_dev,"%s: unknown rtsi channel\n" , __func__); +return -EINVAL ; }return 2 ; }
@@ -5025,12 +5035,12 @@ static unsigned int ni_get_rtsi_routing(struct comedi_device *dev, }else if (chan <NISTC_RTSI_TRIG_NUM_CHAN (devpriv->is_m_series)) {return NISTC_RTSI_TRIG_TO_SRC (chan, devpriv->rtsi_trig_b_output_reg); - }else { -if (chan ==NISTC_RTSI_TRIG_OLD_CLK_CHAN ) -return NI_RTSI_OUTPUT_RTSI_OSC ; -dev_err (dev->class_dev,"bug! should never get here?\n" ); -return 0 ; + }else if (chan ==NISTC_RTSI_TRIG_OLD_CLK_CHAN ) { +return NI_RTSI_OUTPUT_RTSI_OSC ; } + +dev_err (dev->class_dev,"%s: unknown rtsi channel\n" , __func__); +return -EINVAL ; } static int ni_rtsi_insn_config(struct comedi_device *dev,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 40/671 net: socionext: Add dummy PHY register read in phy_write()
In reply to Sasha LevinFrom: Masahisa Kojima <[email protected]>
[ Upstream commit a3241a91de6429051a211b5ce04d6946157caec7 ]
There is a compatibility issue between RTL8211E implemented in Developerbox and netsec ethernet controller IP.
Our MDIO controller stops MDC clock right after the write access, but RTL8211E expects MDC clock must be kept toggling for several clock cycle with MDIO high before entering the IDLE state. Without keeping clock after write access, write access is not correctly handled and register is not updated.
To meet this requirement, netsec driver needs to issue dummy read(e.g. read PHYID1(offset 0x2) register) right after write access, to keep MDC clock.
We think this compatibility issue is a problem specific to our MDIO controller and RTL8211E.
--- drivers/net/ethernet/socionext/netsec.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
drivers/net/ethernet/socionext/netsec.c +16 -2
@@ -432,9 +432,12 @@ static int netsec_mac_update_to_phy_state(struct netsec_priv *priv)return 0 ; } +static int netsec_phy_read (struct mii_bus *bus,int phy_addr,int reg_addr); +static int netsec_phy_write (struct mii_bus *bus,int phy_addr,int reg,u16 val) { +int status;struct netsec_priv *priv = bus->priv;if (netsec_mac_write (priv,GMAC_REG_GDR , val))
@@ -447,8 +450,19 @@ static int netsec_phy_write(struct mii_bus *bus, GMAC_REG_SHIFT_CR_GAR)))return -ETIMEDOUT ; -return netsec_mac_wait_while_busy (priv,GMAC_REG_GAR , -NETSEC_GMAC_GAR_REG_GB ); + status =netsec_mac_wait_while_busy (priv,GMAC_REG_GAR , +NETSEC_GMAC_GAR_REG_GB ); + +/* Developerbox implements RTL8211E PHY and there is +* a compatibility problem with F_GMAC4. +* RTL8211E expects MDC clock must be kept toggling for several +* clock cycle with MDIO high before entering the IDLE state. +* To meet this requirement, netsec driver needs to issue dummy +* read(e.g. read PHYID1(offset 0x2) register) right after write. +*/ +netsec_phy_read (bus, phy_addr,MII_PHYSID1 ); + +return status; }static int netsec_phy_read (struct mii_bus *bus,int phy_addr,int reg_addr)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 50/671 pinctrl: meson-gxl: remove invalid GPIOX tsin_a pins
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit d801064cb871806e6843738ecad38993646f53f7 ]
The GPIOX tsin_a pins wrongly uses the SDCard pinctrl bits, this patch completely removes these pins entries until we find out what are the correct bits and registers to be used instead.
--- drivers/pinctrl/meson/pinctrl-meson-gxl.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/pinctrl/meson/pinctrl-meson-gxl.c +2 -10
@@ -239,13 +239,9 @@ static const unsigned int eth_link_led_pins[] = { GPIOZ_14 };static const unsigned int eth_act_led_pins[] = {GPIOZ_15 };static const unsigned int tsin_a_d0_pins[] = {GPIODV_0 }; -static const unsigned int tsin_a_d0_x_pins[] = {GPIOX_10 };static const unsigned int tsin_a_clk_pins[] = {GPIODV_8 }; -static const unsigned int tsin_a_clk_x_pins[] = {GPIOX_11 };static const unsigned int tsin_a_sop_pins[] = {GPIODV_9 }; -static const unsigned int tsin_a_sop_x_pins[] = {GPIOX_8 };static const unsigned int tsin_a_d_valid_pins[] = {GPIODV_10 }; -static const unsigned int tsin_a_d_valid_x_pins[] = {GPIOX_9 };static const unsigned int tsin_a_fail_pins[] = {GPIODV_11 };static const unsigned int tsin_a_dp_pins[] = {GPIODV_1 ,GPIODV_2 ,GPIODV_3 ,GPIODV_4 ,GPIODV_5 ,GPIODV_6 ,GPIODV_7 ,
@@ -432,10 +428,6 @@ static struct meson_pmx_group meson_gxl_periphs_groups[] = {GROUP (spi_miso,5 ,2 ),GROUP (spi_ss0,5 ,1 ),GROUP (spi_sclk,5 ,0 ), -GROUP (tsin_a_sop_x,6 ,3 ), -GROUP (tsin_a_d_valid_x,6 ,2 ), -GROUP (tsin_a_d0_x,6 ,1 ), -GROUP (tsin_a_clk_x,6 ,0 ),/* Bank Z */ GROUP(eth_mdio, 4, 23),
@@ -698,8 +690,8 @@ static const char * const eth_led_groups[] = { };static const char *const tsin_a_groups[] = { -"tsin_a_clk" ,"tsin_a_clk_x" ,"tsin_a_sop" ,"tsin_a_sop_x" , -"tsin_a_d_valid" ,"tsin_a_d_valid_x" ,"tsin_a_d0" ,"tsin_a_d0_x" , +"tsin_a_clk" ,"tsin_a_sop" , +"tsin_a_d_valid" ,"tsin_a_d0" ,"tsin_a_dp" ,"tsin_a_fail" , };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 52/671 exportfs: fix 'passing zero to ERR_PTR()' warning
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 909e22e05353a783c526829427e9a8de122fba9c ]
Fix a static code checker warning:
fs/exportfs/expfs.c:171 reconnect_one() warn: passing zero to 'ERR_PTR'
The error path for lookup_one_len_unlocked failure should set err to PTR_ERR.
--- fs/exportfs/expfs.c | 1 + 1 file changed, 1 insertion(+)
fs/exportfs/expfs.c +1 -0
@@ -147,6 +147,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt, tmp =lookup_one_len_unlocked (nbuf, parent,strlen (nbuf));if (IS_ERR (tmp)) {dprintk ("%s: lookup failed: %d\n" , __func__,PTR_ERR (tmp)); + err =PTR_ERR (tmp); goto out_err; }if (tmp != dentry) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 53/671 drm: rcar-du: Fix the return value in case of error in 'rcar_du_crtc_set_crc_source()'
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 4d486f18d91b1876040bf87e9ad78981a08b15a6 ]
We return 0 unconditionally in 'rcar_du_crtc_set_crc_source()'. However, 'ret' is set to some error codes if some function calls fail.
Return 'ret' instead to propagate the error code.
--- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_crtc.c +1 -1
@@ -837,7 +837,7 @@ static int rcar_du_crtc_set_crc_source(struct drm_crtc *crtc,drm_modeset_drop_locks (&ctx);drm_modeset_acquire_fini (&ctx); -return 0 ; +return ret; }static const struct drm_crtc_funcs crtc_funcs_gen2 = {
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 54/671 drm: rcar-du: Fix vblank initialization
In reply to Sasha LevinFrom: Laurent Pinchart <[email protected]>
[ Upstream commit 3d61fe5f59dd3e6f96fc0772156d257cb04dc656 ]
The drm_vblank_init() takes the total number of CRTCs as an argument, but the rcar-du driver passes a bitmask of the CRTC indices. Fix it.
--- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/rcar-du/rcar_du_kms.c +1 -1
@@ -544,7 +544,7 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)* Initialize vertical blanking interrupts handling. Start with vblank * disabled for all CRTCs. */ - ret =drm_vblank_init (dev, (1 << rcdu->num_crtcs) -1 ); + ret =drm_vblank_init (dev, rcdu->num_crtcs);if (ret <0 )return ret;
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 55/671 net: always initialize pagedlen
In reply to Sasha LevinFrom: Willem de Bruijn <[email protected]>
[ Upstream commit aba36930a35e7f1fe1319b203f25c05d6c119936 ]
In ip packet generation, pagedlen is initialized for each skb at the start of the loop in __ip(6)_append_data, before label alloc_new_skb.
Depending on compiler options, code can be generated that jumps to this label, triggering use of an an uninitialized variable.
In practice, at -O2, the generated code moves the initialization below the label. But the code should not rely on that for correctness.
--- net/ipv4/ip_output.c | 3 ++- net/ipv6/ip6_output.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
net/ipv4/ip_output.c +2 -1
@@ -940,7 +940,7 @@ static int __ip_append_data(struct sock *sk,unsigned int fraglen;unsigned int fraggap;unsigned int alloclen; -unsigned int pagedlen =0 ; +unsigned int pagedlen;struct sk_buff *skb_prev; alloc_new_skb: skb_prev = skb;
@@ -957,6 +957,7 @@ static int __ip_append_data(struct sock *sk,if (datalen > mtu - fragheaderlen) datalen = maxfraglen - fragheaderlen; fraglen = datalen + fragheaderlen; + pagedlen =0 ;if ((flags &MSG_MORE ) && !(rt->dst.dev->features&NETIF_F_SG ))
net/ipv6/ip6_output.c +2 -1
@@ -1357,7 +1357,7 @@ static int __ip6_append_data(struct sock *sk,unsigned int fraglen;unsigned int fraggap;unsigned int alloclen; -unsigned int pagedlen =0 ; +unsigned int pagedlen; alloc_new_skb:/* There's no room in the current skb */ if (skb)
@@ -1381,6 +1381,7 @@ static int __ip6_append_data(struct sock *sk,if (datalen > (cork->length <= mtu && !(cork->flags &IPCORK_ALLFRAG ) ? mtu : maxfraglen) - fragheaderlen) datalen = maxfraglen - fragheaderlen - rt->dst.trailer_len; fraglen = datalen + fragheaderlen; + pagedlen =0 ;if ((flags &MSG_MORE ) && !(rt->dst.dev->features&NETIF_F_SG ))
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 56/671 drm/dp_mst: Skip validating ports during destruction, just ref
In reply to Sasha LevinFrom: Lyude Paul <[email protected]>
[ Upstream commit c54c7374ff44de5e609506aca7c0deae4703b6d1 ]
Jerry Zuo pointed out a rather obscure hotplugging issue that it seems I accidentally introduced into DRM two years ago.
Pretend we have a topology like this:
|- DP-1: mst_primary
|- DP-4: active display
|- DP-5: disconnected
|- DP-6: active hub
|- DP-7: active display
|- DP-8: disconnected
|- DP-9: disconnectedIf we unplug DP-6, the topology starting at DP-7 will be destroyed but it's payloads will live on in DP-1's VCPI allocations and thus require removal. However, this removal currently fails because drm_dp_update_payload_part1() will (rightly so) try to validate the port before accessing it, fail then abort. If we keep going, eventually we run the MST hub out of bandwidth and all new allocations will start to fail (or in my case; all new displays just start flickering a ton).
We could just teach drm_dp_update_payload_part1() not to drop the port ref in this case, but then we also need to teach drm_dp_destroy_payload_step1() to do the same thing, then hope no one ever adds anything to the that requires a validated port reference in drm_dp_destroy_connector_work(). Kind of sketchy.
So let's go with a more clever solution: any port that drm_dp_destroy_connector_work() interacts with is guaranteed to still exist in memory until we say so. While said port might not be valid we don't really care: that's the whole reason we're destroying it in the first place! So, teach drm_dp_get_validated_port_ref() to use the all mighty current_work() function to avoid attempting to validate ports from the context of mgr->destroy_connector_work. I can't see any situation where this wouldn't be safe, and this avoids having to play whack-a-mole in the future of trying to work around port validation.
--- drivers/gpu/drm/drm_dp_mst_topology.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_dp_mst_topology.c +13 -2
@@ -1022,9 +1022,20 @@ static struct drm_dp_mst_port *drm_dp_mst_get_port_ref_locked(struct drm_dp_mst_static struct drm_dp_mst_port *drm_dp_get_validated_port_ref (struct drm_dp_mst_topology_mgr *mgr,struct drm_dp_mst_port *port) {struct drm_dp_mst_port *rport =NULL ; +mutex_lock (&mgr->lock); -if (mgr->mst_primary) - rport =drm_dp_mst_get_port_ref_locked (mgr->mst_primary, port); +/* +* Port may or may not be 'valid' but we don't care about that when +* destroying the port and we are guaranteed that the port pointer +* will be valid until we've finished +*/ +if (current_work () == &mgr->destroy_connector_work) { +kref_get (&port->kref); + rport = port; + }else if (mgr->mst_primary) { + rport =drm_dp_mst_get_port_ref_locked (mgr->mst_primary, + port); + }mutex_unlock (&mgr->lock);return rport; }
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 59/671 net: phy: Fix not to call phy_resume() if PHY is not attached
In reply to Sasha LevinFrom: Yoshihiro Shimoda <[email protected]>
[ Upstream commit ef1b5bf506b1f0ee3edc98533e1f3ecb105eb46a ]
This patch fixes an issue that mdio_bus_phy_resume() doesn't call phy_resume() if the PHY is not attached.
--- drivers/net/phy/phy_device.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/net/phy/phy_device.c +6 -5
@@ -76,7 +76,7 @@ static LIST_HEAD(phy_fixup_list);static DEFINE_MUTEX (phy_fixup_lock);#ifdef CONFIG_PM -static bool mdio_bus_phy_may_suspend (struct phy_device *phydev) +static bool mdio_bus_phy_may_suspend (struct phy_device *phydev,bool suspend) {struct device_driver *drv = phydev->mdio.dev.driver;struct phy_driver *phydrv =to_phy_driver (drv);
@@ -88,10 +88,11 @@ static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)/* PHY not attached? May suspend if the PHY has not already been * suspended as part of a prior call to phy_disconnect() -> * phy_detach() -> phy_suspend() because the parent netdev might be the -* MDIO bus driver and clock gated at this point. +* MDIO bus driver and clock gated at this point. Also may resume if +* PHY is not attached. */ if (!netdev) -return !phydev->suspended; +return suspend ? !phydev->suspended : phydev->suspended;if (netdev->wol_enabled)return false;
@@ -126,7 +127,7 @@ static int mdio_bus_phy_suspend(struct device *dev)if (phydev->attached_dev && phydev->adjust_link)phy_stop_machine (phydev); -if (!mdio_bus_phy_may_suspend (phydev)) +if (!mdio_bus_phy_may_suspend (phydev, true))return 0 ;return phy_suspend (phydev);
@@ -137,7 +138,7 @@ static int mdio_bus_phy_resume(struct device *dev)struct phy_device *phydev =to_phy_device (dev);int ret; -if (!mdio_bus_phy_may_suspend (phydev)) +if (!mdio_bus_phy_may_suspend (phydev, false)) goto no_resume; ret =phy_resume (phydev);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 62/671 IB/rxe: Fix incorrect cache cleanup in error flow
In reply to Sasha LevinFrom: Yuval Shaia <[email protected]>
[ Upstream commit 6db21d8986e14e2e86573a3b055b05296188bd2c ]
Array iterator stays at the same slot, fix it.
--- drivers/infiniband/sw/rxe/rxe_pool.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-)
drivers/infiniband/sw/rxe/rxe_pool.c +14 -12
@@ -112,6 +112,18 @@ static inline struct kmem_cache *pool_cache(struct rxe_pool *pool)return rxe_type_info[pool->type].cache; } +static void rxe_cache_clean (size_t cnt) +{ +int i; +struct rxe_type_info *type; + +for (i =0 ; i < cnt; i++) { + type = &rxe_type_info[i]; +kmem_cache_destroy (type->cache); + type->cache =NULL ; + } +} +int rxe_cache_init (void ) {int err;
@@ -136,24 +148,14 @@ int rxe_cache_init(void)return 0 ; err1: -while (--i >=0 ) { -kmem_cache_destroy (type->cache); - type->cache =NULL ; - } +rxe_cache_clean (i);return err; }void rxe_cache_exit (void ) { -int i; -struct rxe_type_info *type; - -for (i =0 ; i <RXE_NUM_TYPES ; i++) { - type = &rxe_type_info[i]; -kmem_cache_destroy (type->cache); - type->cache =NULL ; - } +rxe_cache_clean (RXE_NUM_TYPES ); }static int rxe_pool_init_index (struct rxe_pool *pool,u32 max,u32 min)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 60/671 IB/hfi1: Correctly process FECN and BECN in packets
In reply to Sasha LevinFrom: Mitko Haralanov <[email protected]>
[ Upstream commit fe4dd4239277486ca3a468e7bbeafd7ef3a5634e ]
A CA is supposed to ignore FECN bits in multicast, ACK, and CNP packets. This patch corrects the behavior of the HFI1 driver in this regard by ignoring FECNs in those packet types.
While fixing the above behavior, fix the extraction of the FECN and BECN bits from the packet headers for both 9B and 16B packets.
Furthermore, this patch corrects the driver's response to a FECN in RDMA READ RESPONSE packets. Instead of sending an "empty" ACK, the driver now sends a CNP packet. While editing that code path, add the missing trace for CNP packets.
--- drivers/infiniband/hw/hfi1/driver.c | 70 ++++++++++++++++++++--------- drivers/infiniband/hw/hfi1/hfi.h | 35 ++++++++++----- drivers/infiniband/hw/hfi1/rc.c | 30 +++++-------- drivers/infiniband/hw/hfi1/uc.c | 2 +- drivers/infiniband/hw/hfi1/ud.c | 33 ++++++++------ 5 files changed, 104 insertions(+), 66 deletions(-)
drivers/infiniband/hw/hfi1/driver.c +48 -22
@@ -430,40 +430,60 @@ static const hfi1_handle_cnp hfi1_handle_cnp_tbl[2] = { [HFI1_PKT_TYPE_16B ] = &return_cnp_16B }; -void hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt, -bool do_cnp) +/** +* hfi1_process_ecn_slowpath - Process FECN or BECN bits +* @qp: The packet's destination QP +* @pkt: The packet itself. +* @prescan: Is the caller the RXQ prescan +* +* Process the packet's FECN or BECN bits. By now, the packet +* has already been evaluated whether processing of those bit should +* be done. +* The significance of the @prescan argument is that if the caller +* is the RXQ prescan, a CNP will be send out instead of waiting for the +* normal packet processing to send an ACK with BECN set (or a CNP). +*/ +bool hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt, +bool prescan) {struct hfi1_ibport *ibp =to_iport (qp->ibqp.device, qp->port_num);struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);struct ib_other_headers *ohdr = pkt->ohdr;struct ib_grh *grh = pkt->grh; -u32 rqpn =0 , bth1; +u32 rqpn =0 ;u16 pkey;u32 rlid, slid, dlid =0 ; -u8 hdr_type, sc, svc_type; -bool is_mcast = false; +u8 hdr_type, sc, svc_type, opcode; +bool is_mcast = false, ignore_fecn = false, do_cnp = false, + fecn, becn;/* can be called from prescan */ if (pkt->etype ==RHF_RCV_TYPE_BYPASS ) { - is_mcast =hfi1_is_16B_mcast (dlid); pkey =hfi1_16B_get_pkey (pkt->hdr); sc =hfi1_16B_get_sc (pkt->hdr); dlid =hfi1_16B_get_dlid (pkt->hdr); slid =hfi1_16B_get_slid (pkt->hdr); + is_mcast =hfi1_is_16B_mcast (dlid); + opcode =ib_bth_get_opcode (ohdr); hdr_type =HFI1_PKT_TYPE_16B ; + fecn =hfi1_16B_get_fecn (pkt->hdr); + becn =hfi1_16B_get_becn (pkt->hdr); }else { - is_mcast = (dlid >be16_to_cpu (IB_MULTICAST_LID_BASE )) && - (dlid !=be16_to_cpu (IB_LID_PERMISSIVE )); pkey =ib_bth_get_pkey (ohdr); sc =hfi1_9B_get_sc5 (pkt->hdr, pkt->rhf); - dlid =ib_get_dlid (pkt->hdr); + dlid = qp->ibqp.qp_type !=IB_QPT_UD ?ib_get_dlid (pkt->hdr) : + ppd->lid; slid =ib_get_slid (pkt->hdr); + is_mcast = (dlid >be16_to_cpu (IB_MULTICAST_LID_BASE )) && + (dlid !=be16_to_cpu (IB_LID_PERMISSIVE )); + opcode =ib_bth_get_opcode (ohdr); hdr_type =HFI1_PKT_TYPE_9B ; + fecn =ib_bth_get_fecn (ohdr); + becn =ib_bth_get_becn (ohdr); }switch (qp->ibqp.qp_type) {case IB_QPT_UD : - dlid = ppd->lid; rlid = slid; rqpn =ib_get_sqpn (pkt->ohdr); svc_type =IB_CC_SVCTYPE_UD ;
@@ -485,22 +505,31 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt, svc_type =IB_CC_SVCTYPE_RC ;break ;default : -return ; +return false; } - bth1 =be32_to_cpu (ohdr->bth[1 ]); + ignore_fecn = is_mcast || (opcode ==IB_OPCODE_CNP ) || + (opcode ==IB_OPCODE_RC_ACKNOWLEDGE ); +/* +* ACKNOWLEDGE packets do not get a CNP but this will be +* guarded by ignore_fecn above. +*/ + do_cnp = prescan || + (opcode >=IB_OPCODE_RC_RDMA_READ_RESPONSE_FIRST && + opcode <=IB_OPCODE_RC_ATOMIC_ACKNOWLEDGE ); +/* Call appropriate CNP handler */ -if (do_cnp && (bth1 &IB_FECN_SMASK )) +if (!ignore_fecn && do_cnp && fecn) hfi1_handle_cnp_tbl[hdr_type](ibp, qp, rqpn, pkey, dlid, rlid, sc, grh); -if (!is_mcast && (bth1 &IB_BECN_SMASK )) { -u32 lqpn = bth1 &RVT_QPN_MASK ; +if (becn) { +u32 lqpn =be32_to_cpu (ohdr->bth[1 ]) &RVT_QPN_MASK ;u8 sl = ibp->sc_to_sl[sc];process_becn (ppd, sl, rlid, lqpn, rqpn, svc_type); } - +return !ignore_fecn && fecn; }struct ps_mdata {
@@ -599,7 +628,6 @@ static void __prescan_rxq(struct hfi1_packet *packet)struct rvt_dev_info *rdi = &rcd->dd->verbs_dev.rdi;u64 rhf =rhf_to_cpu (rhf_addr);u32 etype =rhf_rcv_type (rhf), qpn, bth1; -int is_ecn =0 ;u8 lnh;if (ps_done (&mdata, rhf, rcd))
@@ -625,12 +653,10 @@ static void __prescan_rxq(struct hfi1_packet *packet) goto next;/* just in case */ } - bth1 =be32_to_cpu (packet->ohdr->bth[1 ]); - is_ecn = !!(bth1 & (IB_FECN_SMASK |IB_BECN_SMASK )); - -if (!is_ecn) +if (!hfi1_may_ecn (packet)) goto next; + bth1 =be32_to_cpu (packet->ohdr->bth[1 ]); qpn = bth1 &RVT_QPN_MASK ;rcu_read_lock (); qp =rvt_lookup_qpn (rdi, &ibp->rvp, qpn);
@@ -640,7 +666,7 @@ static void __prescan_rxq(struct hfi1_packet *packet) goto next; } -process_ecn (qp, packet, true); +hfi1_process_ecn_slowpath (qp, packet, true);rcu_read_unlock ();/* turn off BECN, FECN */
drivers/infiniband/hw/hfi1/hfi.h +25 -10
@@ -1797,13 +1797,20 @@ static inline struct hfi1_ibport *rcd_to_iport(struct hfi1_ctxtdata *rcd)return &rcd->ppd->ibport_data; } -void hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt, -bool do_cnp); -static inline bool process_ecn (struct rvt_qp *qp,struct hfi1_packet *pkt, -bool do_cnp) +/** +* hfi1_may_ecn - Check whether FECN or BECN processing should be done +* @pkt: the packet to be evaluated +* +* Check whether the FECN or BECN bits in the packet's header are +* enabled, depending on packet type. +* +* This function only checks for FECN and BECN bits. Additional checks +* are done in the slowpath (hfi1_process_ecn_slowpath()) in order to +* ensure correct handling. +*/ +static inline bool hfi1_may_ecn (struct hfi1_packet *pkt) { -bool becn; -bool fecn; +bool fecn, becn;if (pkt->etype ==RHF_RCV_TYPE_BYPASS ) { fecn =hfi1_16B_get_fecn (pkt->hdr);
@@ -1812,10 +1819,18 @@ static inline bool process_ecn(struct rvt_qp *qp, struct hfi1_packet *pkt, fecn =ib_bth_get_fecn (pkt->ohdr); becn =ib_bth_get_becn (pkt->ohdr); } -if (unlikely (fecn || becn)) { -hfi1_process_ecn_slowpath (qp, pkt, do_cnp); -return fecn; - } +return fecn || becn; +} + +bool hfi1_process_ecn_slowpath (struct rvt_qp *qp,struct hfi1_packet *pkt, +bool prescan); +static inline bool process_ecn (struct rvt_qp *qp,struct hfi1_packet *pkt) +{ +bool do_work; + + do_work =hfi1_may_ecn (pkt); +if (unlikely (do_work)) +return hfi1_process_ecn_slowpath (qp, pkt, false);return false; }
drivers/infiniband/hw/hfi1/rc.c +10 -20
@@ -2049,8 +2049,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)struct ib_reth *reth;unsigned long flags;int ret; -bool is_fecn = false; -bool copy_last = false; +bool copy_last = false, fecn;u32 rkey;u8 extra_bytes = pad + packet->extra_byte + (SIZE_OF_CRC <<2 );
@@ -2059,7 +2058,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)if (hfi1_ruc_check_hdr (ibp, packet))return ; - is_fecn =process_ecn (qp, packet, false); + fecn =process_ecn (qp, packet);/* * Process responses (ACKs) before anything else. Note that the
@@ -2070,8 +2069,6 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)if (opcode >=OP (RDMA_READ_RESPONSE_FIRST ) && opcode <=OP (ATOMIC_ACKNOWLEDGE )) {rc_rcv_resp (packet); -if (is_fecn) - goto send_ack;return ; }
@@ -2347,11 +2344,11 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)/* Schedule the send engine. */ qp->s_flags |=RVT_S_RESP_PENDING ; +if (fecn) + qp->s_flags |=RVT_S_ECN ;hfi1_schedule_send (qp);spin_unlock_irqrestore (&qp->s_lock, flags); -if (is_fecn) - goto send_ack;return ; }
@@ -2413,11 +2410,11 @@ void hfi1_rc_rcv(struct hfi1_packet *packet)/* Schedule the send engine. */ qp->s_flags |=RVT_S_RESP_PENDING ; +if (fecn) + qp->s_flags |=RVT_S_ECN ;hfi1_schedule_send (qp);spin_unlock_irqrestore (&qp->s_lock, flags); -if (is_fecn) - goto send_ack;return ; }
@@ -2430,16 +2427,9 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) qp->r_ack_psn = psn; qp->r_nak_state =0 ;/* Send an ACK if requested or required. */ -if (psn &IB_BTH_REQ_ACK ) { -if (packet->numpkt ==0 ) { -rc_cancel_ack (qp); - goto send_ack; - } -if (qp->r_adefered >=HFI1_PSN_CREDIT ) { -rc_cancel_ack (qp); - goto send_ack; - } -if (unlikely (is_fecn)) { +if (psn &IB_BTH_REQ_ACK || fecn) { +if (packet->numpkt ==0 || fecn || + qp->r_adefered >=HFI1_PSN_CREDIT ) {rc_cancel_ack (qp); goto send_ack; }
@@ -2480,7 +2470,7 @@ void hfi1_rc_rcv(struct hfi1_packet *packet) qp->r_nak_state =IB_NAK_REMOTE_ACCESS_ERROR ; qp->r_ack_psn = qp->r_psn; send_ack: -hfi1_send_rc_ack (packet, is_fecn); +hfi1_send_rc_ack (packet, fecn); } void hfi1_rc_hdrerr(
drivers/infiniband/hw/hfi1/uc.c +1 -1
@@ -321,7 +321,7 @@ void hfi1_uc_rcv(struct hfi1_packet *packet)if (hfi1_ruc_check_hdr (ibp, packet))return ; -process_ecn (qp, packet, true); +process_ecn (qp, packet); psn =ib_bth_get_psn (ohdr);/* Compare the PSN verses the expected PSN. */
drivers/infiniband/hw/hfi1/ud.c +20 -13
@@ -51,6 +51,7 @@#include "hfi.h" #include "mad.h" #include "verbs_txreq.h" +#include "trace_ibhdrs.h" #include "qp.h" /* We support only two types - 9B and 16B for now */
@@ -656,18 +657,19 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp,u32 bth0, plen, vl, hwords =7 ;u16 len;u8 l4; -struct hfi1_16b_header hdr; +struct hfi1_opa_header hdr;struct ib_other_headers *ohdr;struct pio_buf *pbuf;struct send_context *ctxt =qp_to_send_context (qp, sc5);struct hfi1_pportdata *ppd =ppd_from_ibp (ibp);u32 nwords; + hdr.hdr_type =HFI1_PKT_TYPE_16B ;/* Populate length */ nwords = ((hfi1_get_16b_padding (hwords <<2 ,0 ) +SIZE_OF_LT ) >>2 ) +SIZE_OF_CRC ;if (old_grh) { -struct ib_grh *grh = &hdr.u.l.grh; +struct ib_grh *grh = &hdr.opah.u.l.grh; grh->version_tclass_flow = old_grh->version_tclass_flow; grh->paylen = cpu_to_be16(
@@ -675,11 +677,11 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, grh->hop_limit =0xff ; grh->sgid = old_grh->dgid; grh->dgid = old_grh->sgid; - ohdr = &hdr.u.l.oth; + ohdr = &hdr.opah.u.l.oth; l4 =OPA_16B_L4_IB_GLOBAL ; hwords +=sizeof (struct ib_grh ) /sizeof (u32); }else { - ohdr = &hdr.u.oth; + ohdr = &hdr.opah.u.oth; l4 =OPA_16B_L4_IB_LOCAL ; }
@@ -693,7 +695,7 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp,/* Convert dwords to flits */ len = (hwords + nwords) >>1 ; -hfi1_make_16b_hdr (&hdr, slid, dlid, len, pkey,1 ,0 , l4, sc5); +hfi1_make_16b_hdr (&hdr.opah, slid, dlid, len, pkey,1 ,0 , l4, sc5); plen =2 /* PBC */ + hwords + nwords; pbc_flags |=PBC_PACKET_BYPASS |PBC_INSERT_BYPASS_ICRC ;
@@ -701,9 +703,11 @@ void return_cnp_16B(struct hfi1_ibport *ibp, struct rvt_qp *qp, pbc =create_pbc (ppd, pbc_flags, qp->srate_mbps, vl, plen);if (ctxt) { pbuf =sc_buffer_alloc (ctxt, plen,NULL ,NULL ); -if (pbuf) +if (pbuf) { +trace_pio_output_ibhdr (ppd->dd, &hdr, sc5); ppd->dd->pio_inline_send (ppd->dd, pbuf, pbc, &hdr, hwords); + } } }
@@ -715,14 +719,15 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,u32 bth0, plen, vl, hwords =5 ;u16 lrh0;u8 sl = ibp->sc_to_sl[sc5]; -struct ib_header hdr; +struct hfi1_opa_header hdr;struct ib_other_headers *ohdr;struct pio_buf *pbuf;struct send_context *ctxt =qp_to_send_context (qp, sc5);struct hfi1_pportdata *ppd =ppd_from_ibp (ibp); + hdr.hdr_type =HFI1_PKT_TYPE_9B ;if (old_grh) { -struct ib_grh *grh = &hdr.u.l.grh; +struct ib_grh *grh = &hdr.ibh.u.l.grh; grh->version_tclass_flow = old_grh->version_tclass_flow; grh->paylen = cpu_to_be16(
@@ -730,11 +735,11 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, grh->hop_limit =0xff ; grh->sgid = old_grh->dgid; grh->dgid = old_grh->sgid; - ohdr = &hdr.u.l.oth; + ohdr = &hdr.ibh.u.l.oth; lrh0 =HFI1_LRH_GRH ; hwords +=sizeof (struct ib_grh ) /sizeof (u32); }else { - ohdr = &hdr.u.oth; + ohdr = &hdr.ibh.u.oth; lrh0 =HFI1_LRH_BTH ; }
@@ -746,16 +751,18 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn, ohdr->bth[1 ] =cpu_to_be32 (remote_qpn | (1 <<IB_BECN_SHIFT )); ohdr->bth[2 ] =0 ;/* PSN 0 */ -hfi1_make_ib_hdr (&hdr, lrh0, hwords +SIZE_OF_CRC , dlid, slid); +hfi1_make_ib_hdr (&hdr.ibh, lrh0, hwords +SIZE_OF_CRC , dlid, slid); plen =2 /* PBC */ + hwords; pbc_flags |= (ib_is_sc5 (sc5) <<PBC_DC_INFO_SHIFT ); vl =sc_to_vlt (ppd->dd, sc5); pbc =create_pbc (ppd, pbc_flags, qp->srate_mbps, vl, plen);if (ctxt) { pbuf =sc_buffer_alloc (ctxt, plen,NULL ,NULL ); -if (pbuf) +if (pbuf) { +trace_pio_output_ibhdr (ppd->dd, &hdr, sc5); ppd->dd->pio_inline_send (ppd->dd, pbuf, pbc, &hdr, hwords); + } } }
@@ -912,7 +919,7 @@ void hfi1_ud_rcv(struct hfi1_packet *packet) src_qp =hfi1_16B_get_src_qpn (packet->mgmt); } -process_ecn (qp, packet, (opcode !=IB_OPCODE_CNP )); +process_ecn (qp, packet);/* * Get the number of bytes the message was padded by * and drop incomplete packets.
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 66/671 switchtec: Remove immediate status check after submitting MRPC command
In reply to Sasha LevinFrom: Kelvin Cao <[email protected]>
[ Upstream commit 526180408b815aa7b96fd48bd23cdd33ef04e38e ]
After submitting a Firmware Download MRPC command, Switchtec firmware will delay Management EP BAR MemRd TLP responses by more than 10ms. This is a firmware limitation. Delayed MemRd completions are a problem for systems with a low Completion Timeout (CTO).
The current driver checks the MRPC status immediately after submitting an MRPC command, which results in a delayed MemRd completion that may cause a Completion Timeout.
Remove the immediate status check and rely on the check after receiving an interrupt or timing out.
This is only a software workaround to the READ issue and a proper fix of this should be done in firmware.
--- drivers/pci/switch/switchtec.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/pci/switch/switchtec.c +0 -4
@@ -134,10 +134,6 @@ static void mrpc_cmd_submit(struct switchtec_dev *stdev) stuser->data, stuser->data_len);iowrite32 (stuser->cmd, &stdev->mmio_mrpc->cmd); - stuser->status =ioread32 (&stdev->mmio_mrpc->status); -if (stuser->status !=SWITCHTEC_MRPC_STATUS_INPROGRESS ) -mrpc_complete_cmd (stdev); -schedule_delayed_work (&stdev->mrpc_timeout,msecs_to_jiffies (500 )); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 67/671 ipv6: add missing tx timestamping on IPPROTO_RAW
In reply to Sasha LevinFrom: Willem de Bruijn <[email protected]>
[ Upstream commit fbfb2321e950918b430e7225546296b2dcadf725 ]
Raw sockets support tx timestamping, but one case is missing.
IPPROTO_RAW takes a separate packet construction path. raw_send_hdrinc has an explicit call to sock_tx_timestamp, but rawv6_send_hdrinc does not. Add it.
--- net/ipv6/raw.c | 2 ++ 1 file changed, 2 insertions(+)
net/ipv6/raw.c +2 -0
@@ -660,6 +660,8 @@ static int rawv6_send_hdrinc(struct sock *sk, struct msghdr *msg, int length, skb->ip_summed =CHECKSUM_NONE ; +sock_tx_timestamp (sk, sockc->tsflags, &skb_shinfo (skb)->tx_flags); +if (flags &MSG_CONFIRM )skb_set_dst_pending_confirm (skb,1 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 68/671 pinctrl: sh-pfc: r8a7740: Add missing REF125CK pin to gether_gmii group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 1ebc589a7786f17f97b9e87b44e0fb4d0290d8f8 ]
The gether_gmii_mux[] array contains the REF125CK pin mark, but the gether_gmii_pins[] array lacks the corresponding pin number.
--- drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-r8a7740.c +1 -1
@@ -1982,7 +1982,7 @@ static const unsigned int gether_gmii_pins[] = {*/ 185 ,186 ,187 ,188 ,189 ,190 ,191 ,192 ,174 ,161 ,204 ,171 ,170 ,169 ,168 ,167 ,166 ,173 ,172 ,176 ,184 ,183 ,203 , - 205, 163, 206, 207, + 205, 163, 206, 207, 158, };static const unsigned int gether_gmii_mux[] = { ET_ERXD0_MARK, ET_ERXD1_MARK, ET_ERXD2_MARK, ET_ERXD3_MARK,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 70/671 pinctrl: sh-pfc: r8a7791: Remove bogus ctrl marks from qspi_data4_b group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 884fa25fb6e5e63ab970d612a628313bb68f37cc ]
The qspi_data4_b_mux[] array contains pin marks for the clock and chip select pins. The qspi_data4_b_pins[] array rightfully does not contain the corresponding pin numbers, as the control pins are provided by a separate group (qspi_ctrl_b).
--- drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +1 -2
@@ -3220,8 +3220,7 @@ static const unsigned int qspi_data4_b_pins[] = { RCAR_GP_PIN(6, 4), };static const unsigned int qspi_data4_b_mux[] = { -SPCLK_B_MARK ,MOSI_IO0_B_MARK ,MISO_IO1_B_MARK , -IO2_B_MARK ,IO3_B_MARK ,SSL_B_MARK , +MOSI_IO0_B_MARK ,MISO_IO1_B_MARK ,IO2_B_MARK ,IO3_B_MARK , };/* - SCIF0 ------------------------------------------------------------------ */ static const unsigned int scif0_data_pins[] = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 73/671 pinctrl: sh-pfc: r8a7794: Remove bogus IPSR9 field
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 6a6c195d98a1a5e70faa87f594d7564af1dd1bed ]
The Peripheral Function Select Register 9 contains 12 fields, but the variable field descriptor contains a 13th bogus field of 3 bits.
--- drivers/pinctrl/sh-pfc/pfc-r8a7794.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-r8a7794.c +1 -1
@@ -5215,7 +5215,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { FN_AVB_MDC, FN_SSI_SDATA6_B, 0, 0, } }, { PINMUX_CFG_REG_VAR("IPSR9", 0xE6060044, 32, - 1, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3, 3) { + 1, 3, 3, 3, 3, 2, 2, 3, 3, 3, 3, 3) {/* IP9_31 [1] */ 0, 0,/* IP9_30_28 [3] */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 75/671 pinctrl: sh-pfc: r8a77980: Add missing MOD_SEL0 field
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit b0f77269f6bba385f1f4dce44e7756cf8fbc0176 ]
The Module Select Register 0 contains 20 (= 5 x 4) reserved bits, and 12 single-bit fields, but the variable field descriptor lacks a field of 4 reserved bits.
--- drivers/pinctrl/sh-pfc/pfc-r8a77980.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-r8a77980.c +1 -1
@@ -2751,7 +2751,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {#define F_ (x, y) x,#define FM (x) FN_##x, {PINMUX_CFG_REG_VAR ("MOD_SEL0" ,0xe6060500 ,32 , -4 ,4 ,4 ,4 , +4 ,4 ,4 ,4 ,4 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) {/* RESERVED 31, 30, 29, 28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 76/671 pinctrl: sh-pfc: sh7734: Add missing IPSR11 field
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 94482af7055e1ffa211c1135256b85590ebcac99 ]
The Peripheral Function Select Register 11 contains 3 reserved bits and 15 variable-width fields, but the variable field descriptor does not contain the 3-bit field IP11[25:23].
--- drivers/pinctrl/sh-pfc/pfc-sh7734.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-sh7734.c +1 -1
@@ -2237,7 +2237,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { FN_LCD_DATA15_B, 0, 0, 0 } }, {PINMUX_CFG_REG_VAR ("IPSR11" ,0xFFFC0048 ,32 , - 3, 1, 2, 2, 2, 3, 3, 1, 2, 3, 3, 1, 1, 1, 1) { + 3, 1, 2, 3, 2, 2, 3, 3, 1, 2, 3, 3, 1, 1, 1, 1) {/* IP11_31_29 [3] */ 0, 0, 0, 0, 0, 0, 0, 0,/* IP11_28 [1] */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 80/671 net: hns3: fix error handling int the hns3_get_vector_ring_chain
In reply to Sasha LevinFrom: Huazhong Tan <[email protected]>
[ Upstream commit cda69d244585bc4497d3bb878c22fe2b6ad647c1 ]
When hns3_get_vector_ring_chain() failed in the hns3_nic_init_vector_data(), it should do the error handling instead of return directly.
Also, cur_chain should be freed instead of chain and head->next should be set to NULL in error handling of hns3_get_vector_ring_chain.
This patch fixes them.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +3 -2
@@ -2605,9 +2605,10 @@ static int hns3_get_vector_ring_chain(struct hns3_enet_tqp_vector *tqp_vector, cur_chain = head->next;while (cur_chain) { chain = cur_chain->next; -devm_kfree (&pdev->dev, chain); +devm_kfree (&pdev->dev, cur_chain); cur_chain = chain; } + head->next =NULL ;return -ENOMEM ; }
@@ -2679,7 +2680,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv) ret =hns3_get_vector_ring_chain (tqp_vector, &vector_ring_chain);if (ret) -return ret; + goto map_ring_fail; ret = h->ae_algo->ops->map_ring_to_vector (h, tqp_vector->vector_irq, &vector_ring_chain);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 81/671 vxlan: changelink: Fix handling of default remotes
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit ce5e098f7a10b4bf8e948c12fa350320c5c3afad ]
Default remotes are stored as FDB entries with an Ethernet address of 00:00:00:00:00:00. When a request is made to change a remote address of a VXLAN device, vxlan_changelink() first deletes the existing default remote, and then creates a new FDB entry.
This works well as long as the list of default remotes matches exactly the configuration of a VXLAN remote address. Thus when the VXLAN device has a remote of X, there should be exactly one default remote FDB entry X. If the VXLAN device has no remote address, there should be no such entry.
Besides using "ip link set", it is possible to manipulate the list of default remotes by using the "bridge fdb". It is therefore easy to break the above condition. Under such circumstances, the __vxlan_fdb_delete() call doesn't delete the FDB entry itself, but just one remote. The following vxlan_fdb_create() then creates a new FDB entry, leading to a situation where two entries exist for the address 00:00:00:00:00:00, each with a different subset of default remotes.
An even more obvious breakage rooted in the same cause can be observed when a remote address is configured for a VXLAN device that did not have one before. In that case vxlan_changelink() doesn't remove any remote, and just creates a new FDB entry for the new address:
$ ip link add name vx up type vxlan id 2000 dstport 4789 $ bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.20 self permanent $ bridge fdb ap dev vx 00:00:00:00:00:00 dst 192.0.2.30 self permanent $ ip link set dev vx type vxlan remote 192.0.2.30 $ bridge fdb sh dev vx | grep 00:00:00:00:00:00 00:00:00:00:00:00 dst 192.0.2.30 self permanent <- new entry, 1 rdst 00:00:00:00:00:00 dst 192.0.2.20 self permanent <- orig. entry, 2 rdsts 00:00:00:00:00:00 dst 192.0.2.30 self permanent
To fix this, instead of calling vxlan_fdb_create() directly, defer to vxlan_fdb_update(). That has logic to handle the duplicates properly. Additionally, it also handles notifications, so drop that call from changelink as well.
--- drivers/net/vxlan.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/net/vxlan.c +3 -4
@@ -3496,7 +3496,6 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[],struct vxlan_rdst *dst = &vxlan->default_dst;struct vxlan_rdst old_dst;struct vxlan_config conf; -struct vxlan_fdb *f =NULL ;int err; err = vxlan_nl2conf(tb, data,
@@ -3522,19 +3521,19 @@ static int vxlan_changelink(struct net_device *dev, struct nlattr *tb[], old_dst.remote_ifindex, 0);if (!vxlan_addr_any (&dst->remote_ip)) { - err =vxlan_fdb_create (vxlan, all_zeros_mac, + err =vxlan_fdb_update (vxlan, all_zeros_mac, &dst->remote_ip,NUD_REACHABLE |NUD_PERMANENT , +NLM_F_APPEND |NLM_F_CREATE , vxlan->cfg.dst_port, dst->remote_vni, dst->remote_vni, dst->remote_ifindex, -NTF_SELF , &f); +NTF_SELF );if (err) {spin_unlock_bh (&vxlan->hash_lock);return err; } -vxlan_fdb_notify (vxlan, f,first_remote_rtnl (f),RTM_NEWNEIGH ); }spin_unlock_bh (&vxlan->hash_lock); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 86/671 clk: ti: fix refcount leak in ti_dt_clocks_register()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 2274d8001fbb5e1942fbcab5ad2eb15553b09ed2 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/ti/clk.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clk/ti/clk.c +6 -2
@@ -188,9 +188,13 @@ void __init ti_dt_clocks_register(struct ti_dt_clk oclks[])clkdev_add (&c->lk); }else {if (num_args && !has_clkctrl_data) { -if (of_find_compatible_node (NULL ,NULL , -"ti,clkctrl" )) { +struct device_node *np; + + np =of_find_compatible_node (NULL ,NULL , +"ti,clkctrl" ); +if (np) { has_clkctrl_data = true; +of_node_put (np); }else { clkctrl_nodes_missing = true;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 83/671 fork,memcg: fix crash in free_thread_stack on memcg charge fail
In reply to Sasha LevinFrom: Rik van Riel <[email protected]>
[ Upstream commit 5eed6f1dff87bfb5e545935def3843edf42800f2 ]
Commit 9b6f7e163cd0 ("mm: rework memcg kernel stack accounting") will result in fork failing if allocating a kernel stack for a task in dup_task_struct exceeds the kernel memory allowance for that cgroup.
Unfortunately, it also results in a crash.
This is due to the code jumping to free_stack and calling free_thread_stack when the memcg kernel stack charge fails, but without tsk->stack pointing at the freshly allocated stack.
This in turn results in the vfree_atomic in free_thread_stack oopsing with a backtrace like this:
#5 [ffffc900244efc88] die at ffffffff8101f0ab
#6 [ffffc900244efcb8] do_general_protection at ffffffff8101cb86 #7 [ffffc900244efce0] general_protection at ffffffff818ff082
[exception RIP: llist_add_batch+7]
RIP: ffffffff8150d487 RSP: ffffc900244efd98 RFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff88085ef55980 RCX: 0000000000000000
RDX: ffff88085ef55980 RSI: 343834343531203a RDI: 343834343531203a
RBP: ffffc900244efd98 R8: 0000000000000001 R9: ffff8808578c3600
R10: 0000000000000000 R11: 0000000000000001 R12: ffff88029f6c21c0
R13: 0000000000000286 R14: ffff880147759b00 R15: 0000000000000000
ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018 #8 [ffffc900244efda0] vfree_atomic at ffffffff811df2c7 #9 [ffffc900244efdb8] copy_process at ffffffff81086e37
#10 [ffffc900244efe98] _do_fork at ffffffff810884e0 #11 [ffffc900244eff10] sys_vfork at ffffffff810887ff #12 [ffffc900244eff20] do_syscall_64 at ffffffff81002a43
RIP: 000000000049b948 RSP: 00007ffcdb307830 RFLAGS: 00000246
RAX: ffffffffffffffda RBX: 0000000000896030 RCX: 000000000049b948
RDX: 0000000000000000 RSI: 00007ffcdb307790 RDI: 00000000005d7421
RBP: 000000000067370f R8: 00007ffcdb3077b0 R9: 000000000001ed00
R10: 0000000000000008 R11: 0000000000000246 R12: 0000000000000040
R13: 000000000000000f R14: 0000000000000000 R15: 000000000088d018
ORIG_RAX: 000000000000003a CS: 0033 SS: 002bThe simplest fix is to assign tsk->stack right where it is allocated.
--- kernel/fork.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
kernel/fork.c +7 -2
@@ -230,8 +230,10 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node)* free_thread_stack() can be called in interrupt context, * so cache the vm_struct. */ -if (stack) +if (stack) { tsk->stack_vm_area =find_vm_area (stack); + tsk->stack = stack; + }return stack;#else struct page *page = alloc_pages_node(node, THREADINFO_GFP,
@@ -268,7 +270,10 @@ static struct kmem_cache *thread_stack_cache;static unsigned long *alloc_thread_stack_node (struct task_struct *tsk,int node) { -return kmem_cache_alloc_node (thread_stack_cache,THREADINFO_GFP , node); +unsigned long *stack; + stack =kmem_cache_alloc_node (thread_stack_cache,THREADINFO_GFP , node); + tsk->stack = stack; +return stack; }static void free_thread_stack (struct task_struct *tsk)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 84/671 clk: highbank: fix refcount leak in hb_clk_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 5eb8ba90958de1285120dae5d3a5d2b1a360b3b4 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/clk-highbank.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/clk-highbank.c +1 -0
@@ -293,6 +293,7 @@ static __init struct clk *hb_clk_init(struct device_node *node, const struct clk/* Map system registers */ srnp =of_find_compatible_node (NULL ,NULL ,"calxeda,hb-sregs" ); hb_clk->reg =of_iomap (srnp,0 ); +of_node_put (srnp);BUG_ON (!hb_clk->reg); hb_clk->reg += reg;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 87/671 clk: socfpga: fix refcount leak
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 7f9705beeb3759e69165e7aff588f6488ff6c1ac ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/socfpga/clk-pll-a10.c | 1 + drivers/clk/socfpga/clk-pll.c | 1 + 2 files changed, 2 insertions(+)
drivers/clk/socfpga/clk-pll-a10.c +1 -0
@@ -95,6 +95,7 @@ static struct clk * __init __socfpga_pll_init(struct device_node *node, clkmgr_np =of_find_compatible_node (NULL ,NULL ,"altr,clk-mgr" ); clk_mgr_a10_base_addr =of_iomap (clkmgr_np,0 ); +of_node_put (clkmgr_np);BUG_ON (!clk_mgr_a10_base_addr); pll_clk->hw.reg = clk_mgr_a10_base_addr + reg;
drivers/clk/socfpga/clk-pll.c +1 -0
@@ -100,6 +100,7 @@ static __init struct clk *__socfpga_pll_init(struct device_node *node, clkmgr_np =of_find_compatible_node (NULL ,NULL ,"altr,clk-mgr" ); clk_mgr_base_addr =of_iomap (clkmgr_np,0 ); +of_node_put (clkmgr_np);BUG_ON (!clk_mgr_base_addr); pll_clk->hw.reg = clk_mgr_base_addr + reg;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 94/671 clk: kirkwood: fix refcount leak in kirkwood_clk_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit e7beeab9c61591cd0e690d8733d534c3f4278ff8 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/mvebu/kirkwood.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/mvebu/kirkwood.c +2 -0
@@ -333,6 +333,8 @@ static void __init kirkwood_clk_init(struct device_node *np)if (cgnp) {mvebu_clk_gating_setup (cgnp, kirkwood_gating_desc);kirkwood_clk_muxing_setup (cgnp, kirkwood_mux_desc); + +of_node_put (cgnp); } } CLK_OF_DECLARE(kirkwood_clk, "marvell,kirkwood-core-clock",
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 89/671 clk: imx6q: fix refcount leak in imx6q_clocks_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit c9ec1d8fef31b5fc9e90e99f9bd685db5caa7c5e ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/imx/clk-imx6q.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/imx/clk-imx6q.c +1 -0
@@ -424,6 +424,7 @@ static void __init imx6q_clocks_init(struct device_node *ccm_node) np =of_find_compatible_node (NULL ,NULL ,"fsl,imx6q-anatop" ); anatop_base = base =of_iomap (np,0 );WARN_ON (!base); +of_node_put (np);/* Audio/video PLL post dividers do not work on i.MX6q revision 1.0 */ if (clk_on_imx6q () &&imx_get_soc_revision () ==IMX_CHIP_REVISION_1_0 ) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 95/671 clk: armada-xp: fix refcount leak in axp_clk_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit db20a90a4b6745dad62753f8bd2f66afdd5abc84 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/mvebu/armada-xp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/mvebu/armada-xp.c +3 -1
@@ -228,7 +228,9 @@ static void __init axp_clk_init(struct device_node *np)mvebu_coreclk_setup (np, &axp_coreclks); -if (cgnp) +if (cgnp) {mvebu_clk_gating_setup (cgnp, axp_gating_desc); +of_node_put (cgnp); + } }CLK_OF_DECLARE (axp_clk,"marvell,armada-xp-core-clock" , axp_clk_init);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 96/671 clk: mv98dx3236: fix refcount leak in mv98dx3236_clk_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 9b4eedf627045ae5ddcff60a484200cdd554c413 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/mvebu/mv98dx3236.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/mvebu/mv98dx3236.c +3 -1
@@ -174,7 +174,9 @@ static void __init mv98dx3236_clk_init(struct device_node *np)mvebu_coreclk_setup (np, &mv98dx3236_core_clocks); -if (cgnp) +if (cgnp) {mvebu_clk_gating_setup (cgnp, mv98dx3236_gating_desc); +of_node_put (cgnp); + } }CLK_OF_DECLARE (mv98dx3236_clk,"marvell,mv98dx3236-core-clock" , mv98dx3236_clk_init);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 90/671 clk: imx6sx: fix refcount leak in imx6sx_clocks_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 1731e14fb30212dd8c1e9f8fc1af061e56498c55 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/imx/clk-imx6sx.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/imx/clk-imx6sx.c +1 -0
@@ -151,6 +151,7 @@ static void __init imx6sx_clocks_init(struct device_node *ccm_node) np =of_find_compatible_node (NULL ,NULL ,"fsl,imx6sx-anatop" ); base =of_iomap (np,0 );WARN_ON (!base); +of_node_put (np); clks[IMX6SX_PLL1_BYPASS_SRC ] =imx_clk_mux ("pll1_bypass_src" , base +0x00 ,14 ,1 , pll_bypass_src_sels,ARRAY_SIZE (pll_bypass_src_sels)); clks[IMX6SX_PLL2_BYPASS_SRC ] =imx_clk_mux ("pll2_bypass_src" , base +0x30 ,14 ,1 , pll_bypass_src_sels,ARRAY_SIZE (pll_bypass_src_sels));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 100/671 remoteproc: qcom: q6v5-mss: Add missing clocks for MSM8996
In reply to Sasha LevinFrom: Sibi Sankar <[email protected]>
[ Upstream commit 80ec419c3404106c563aaf56aa6b516a59c4cdfb ]
Proxy vote for QDSS clock and remove vote on handover interrupt to provide MSS PBL with access to STM hardware registers during boot. Add "snoc_axi" and "mnoc_axi" to the active clock list. Rename "gpll0_mss_clk" to "gpll0_mss" for consistency across SoCs.
--- drivers/remoteproc/qcom_q6v5_pil.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/remoteproc/qcom_q6v5_pil.c +4 -1
@@ -1271,13 +1271,16 @@ static const struct rproc_hexagon_res msm8996_mss = { .proxy_clk_names = (char*[]){"xo" ,"pnoc" , +"qdss" ,NULL }, .active_clk_names = (char *[]){"iface" ,"bus" ,"mem" , -"gpll0_mss_clk" , +"gpll0_mss" , +"snoc_axi" , +"mnoc_axi" ,NULL }, .need_mem_protection = true,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 101/671 remoteproc: qcom: q6v5-mss: Add missing regulator for MSM8996
In reply to Sasha LevinFrom: Sibi Sankar <[email protected]>
[ Upstream commit 47b874748d500020026ee43b386b5598e20f3a68 ]
Add proxy vote for pll supply on MSM8996 SoC.
--- drivers/remoteproc/qcom_q6v5_pil.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/remoteproc/qcom_q6v5_pil.c +7 -0
@@ -1268,6 +1268,13 @@ static const struct rproc_hexagon_res sdm845_mss = {static const struct rproc_hexagon_res msm8996_mss = { .hexagon_mba_image ="mba.mbn" , + .proxy_supply = (struct qcom_mss_reg_res []) { + { + .supply ="pll" , + .uA =100000 , + }, + {} + }, .proxy_clk_names = (char *[]){"xo" ,"pnoc" ,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 102/671 drm: Fix error handling in drm_legacy_addctx
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit c39191feed4540fed98badeb484833dcf659bb96 ]
'ctx->handle' is unsigned, it never less than zero. This patch use int 'tmp_handle' to handle the err condition.
--- drivers/gpu/drm/drm_context.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_context.c +9 -6
@@ -361,23 +361,26 @@ int drm_legacy_addctx(struct drm_device *dev, void *data, {struct drm_ctx_list *ctx_entry;struct drm_ctx *ctx = data; +int tmp_handle;if (!drm_core_check_feature (dev,DRIVER_KMS_LEGACY_CONTEXT ) && !drm_core_check_feature (dev,DRIVER_LEGACY ))return -EINVAL ; - ctx->handle =drm_legacy_ctxbitmap_next (dev); -if (ctx->handle ==DRM_KERNEL_CONTEXT ) { + tmp_handle =drm_legacy_ctxbitmap_next (dev); +if (tmp_handle ==DRM_KERNEL_CONTEXT ) {/* Skip kernel's context and get a new one. */ - ctx->handle =drm_legacy_ctxbitmap_next (dev); + tmp_handle =drm_legacy_ctxbitmap_next (dev); } -DRM_DEBUG ("%d\n" , ctx->handle); -if (ctx->handle <0 ) { +DRM_DEBUG ("%d\n" , tmp_handle); +if (tmp_handle <0 ) {DRM_DEBUG ("Not enough free contexts.\n" );/* Should this return -EBUSY instead? */ -return -ENOMEM ; +return tmp_handle; } + ctx->handle = tmp_handle; + ctx_entry =kmalloc (sizeof (*ctx_entry),GFP_KERNEL );if (!ctx_entry) {DRM_DEBUG ("out of memory\n" );
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 105/671 drm/etnaviv: fix some off by one bugs
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit f5fd9fd4000984f19db689282054953981a50534 ]
The ->nr_signal is the supposed to be the number of elements in the ->signal array. There was one place where it was 5 but it was supposed to be 4. That looks like a copy and paste bug. There were also two checks that were off by one.
--- drivers/gpu/drm/etnaviv/etnaviv_perfmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/etnaviv/etnaviv_perfmon.c +3 -3
@@ -113,7 +113,7 @@ static const struct etnaviv_pm_domain doms_3d[] = { .name = "PE", .profile_read = VIVS_MC_PROFILE_PE_READ, .profile_config = VIVS_MC_PROFILE_CONFIG0, - .nr_signals = 5, + .nr_signals = 4, .signal = (const struct etnaviv_pm_signal []) { {"PIXEL_COUNT_KILLED_BY_COLOR_PIPE" ,
@@ -435,7 +435,7 @@ int etnaviv_pm_query_sig(struct etnaviv_gpu *gpu, dom = meta->domains + signal->domain; -if (signal->iter > dom->nr_signals) +if (signal->iter >= dom->nr_signals)return -EINVAL ; sig = &dom->signal[signal->iter];
@@ -461,7 +461,7 @@ int etnaviv_pm_req_validate(const struct drm_etnaviv_gem_submit_pmr *r, dom = meta->domains + r->domain; -if (r->signal > dom->nr_signals) +if (r->signal >= dom->nr_signals)return -EINVAL ;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 106/671 drm/fb-helper: generic: Fix setup error path
In reply to Sasha LevinFrom: Noralf Trønnes <[email protected]>
[ Upstream commit 6e1490cf439aa86b104e5124c36275b964238e1f ]
If register_framebuffer() fails during fbdev setup we will leak the framebuffer, the GEM buffer and the shadow buffer for defio. This is because drm_fb_helper_fbdev_setup() just calls drm_fb_helper_fini() on error not taking into account that register_framebuffer() can fail.
Since the generic emulation uses DRM client for its framebuffer and backing buffer in addition to a shadow buffer, it's necessary to open code drm_fb_helper_fbdev_setup() to properly handle the error path.
Error cleanup is removed from .fb_probe and is handled by one function for all paths.
--- drivers/gpu/drm/drm_fb_helper.c | 98 +++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 40 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +58 -40
@@ -2979,18 +2979,16 @@ static int drm_fbdev_fb_release(struct fb_info *info, int user)return 0 ; } -/* -* fb_ops.fb_destroy is called by the last put_fb_info() call at the end of -* unregister_framebuffer() or fb_release(). -*/ -static void drm_fbdev_fb_destroy (struct fb_info *info) +static void drm_fbdev_cleanup (struct drm_fb_helper *fb_helper) { -struct drm_fb_helper *fb_helper = info->par;struct fb_info *fbi = fb_helper->fbdev;struct fb_ops *fbops =NULL ;void *shadow =NULL ; -if (fbi->fbdefio) { +if (!fb_helper->dev) +return ; + +if (fbi && fbi->fbdefio) {fb_deferred_io_cleanup (fbi); shadow = fbi->screen_buffer; fbops = fbi->fbops;
@@ -3004,6 +3002,12 @@ static void drm_fbdev_fb_destroy(struct fb_info *info) }drm_client_framebuffer_delete (fb_helper->buffer); +} + +static void drm_fbdev_release (struct drm_fb_helper *fb_helper) +{ +drm_fbdev_cleanup (fb_helper); +/* * FIXME: * Remove conditional when all CMA drivers have been moved over to using
@@ -3015,6 +3019,15 @@ static void drm_fbdev_fb_destroy(struct fb_info *info) } } +/* +* fb_ops.fb_destroy is called by the last put_fb_info() call at the end of +* unregister_framebuffer() or fb_release(). +*/ +static void drm_fbdev_fb_destroy (struct fb_info *info) +{ +drm_fbdev_release (info->par); +} +static int drm_fbdev_fb_mmap (struct fb_info *info,struct vm_area_struct *vma) {struct drm_fb_helper *fb_helper = info->par;
@@ -3065,7 +3078,6 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,struct drm_framebuffer *fb;struct fb_info *fbi;u32 format; -int ret; DRM_DEBUG_KMS("surface width(%d), height(%d) and bpp(%d)\n", sizes->surface_width, sizes->surface_height,
@@ -3082,10 +3094,8 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, fb = buffer->fb; fbi =drm_fb_helper_alloc_fbi (fb_helper); -if (IS_ERR (fbi)) { - ret =PTR_ERR (fbi); - goto err_free_buffer; - } +if (IS_ERR (fbi)) +return PTR_ERR (fbi); fbi->par = fb_helper; fbi->fbops = &drm_fbdev_fb_ops;
@@ -3116,8 +3126,7 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper,if (!fbops || !shadow) {kfree (fbops);vfree (shadow); - ret = -ENOMEM ; - goto err_fb_info_destroy; +return -ENOMEM ; } *fbops = *fbi->fbops;
@@ -3129,13 +3138,6 @@ int drm_fb_helper_generic_probe(struct drm_fb_helper *fb_helper, }return 0 ; - -err_fb_info_destroy: -drm_fb_helper_fini (fb_helper); -err_free_buffer: -drm_client_framebuffer_delete (buffer); - -return ret; }EXPORT_SYMBOL (drm_fb_helper_generic_probe);
@@ -3147,18 +3149,11 @@ static void drm_fbdev_client_unregister(struct drm_client_dev *client) {struct drm_fb_helper *fb_helper =drm_fb_helper_from_client (client); -if (fb_helper->fbdev) { -drm_fb_helper_unregister_fbi (fb_helper); +if (fb_helper->fbdev)/* drm_fbdev_fb_destroy() takes care of cleanup */ -return ; - } - -/* Did drm_fb_helper_fbdev_setup() run? */ -if (fb_helper->dev) -drm_fb_helper_fini (fb_helper); - -drm_client_release (client); -kfree (fb_helper); +drm_fb_helper_unregister_fbi (fb_helper); +else +drm_fbdev_release (fb_helper); }static int drm_fbdev_client_restore (struct drm_client_dev *client)
@@ -3174,7 +3169,7 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client)struct drm_device *dev = client->dev;int ret; -/* If drm_fb_helper_fbdev_setup() failed, we only try once */ +/* Setup is not retried if it has failed */ if (!fb_helper->dev && fb_helper->funcs)return 0 ;
@@ -3184,15 +3179,34 @@ static int drm_fbdev_client_hotplug(struct drm_client_dev *client)if (!dev->mode_config.num_connector)return 0 ; - ret =drm_fb_helper_fbdev_setup (dev, fb_helper, &drm_fb_helper_generic_funcs, - fb_helper->preferred_bpp,0 ); -if (ret) { - fb_helper->dev =NULL ; - fb_helper->fbdev =NULL ; -return ret; - } +drm_fb_helper_prepare (dev, fb_helper, &drm_fb_helper_generic_funcs); + + ret =drm_fb_helper_init (dev, fb_helper, dev->mode_config.num_connector); +if (ret) + goto err; + + ret =drm_fb_helper_single_add_all_connectors (fb_helper); +if (ret) + goto err_cleanup; + +if (!drm_drv_uses_atomic_modeset (dev)) +drm_helper_disable_unused_functions (dev); + + ret =drm_fb_helper_initial_config (fb_helper, fb_helper->preferred_bpp); +if (ret) + goto err_cleanup;return 0 ; + +err_cleanup: +drm_fbdev_cleanup (fb_helper); +err: + fb_helper->dev =NULL ; + fb_helper->fbdev =NULL ; + +DRM_DEV_ERROR (dev->dev,"fbdev: Failed to setup generic emulation (ret=%d)\n" , ret); + +return ret; }static const struct drm_client_funcs drm_fbdev_client_funcs = {
@@ -3245,6 +3259,10 @@ int drm_fbdev_generic_setup(struct drm_device *dev, unsigned int preferred_bpp)drm_client_add (&fb_helper->client); +if (!preferred_bpp) + preferred_bpp = dev->mode_config.preferred_depth; +if (!preferred_bpp) + preferred_bpp =32 ; fb_helper->preferred_bpp = preferred_bpp;drm_fbdev_client_hotplug (&fb_helper->client);
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 107/671 fork, memcg: fix cached_stacks case
In reply to Sasha LevinFrom: Shakeel Butt <[email protected]>
[ Upstream commit ba4a45746c362b665e245c50b870615f02f34781 ]
Commit 5eed6f1dff87 ("fork,memcg: fix crash in free_thread_stack on memcg charge fail") fixes a crash caused due to failed memcg charge of the kernel stack. However the fix misses the cached_stacks case which this patch fixes. So, the same crash can happen if the memcg charge of a cached stack is failed.
--- kernel/fork.c | 1 + 1 file changed, 1 insertion(+)
kernel/fork.c +1 -0
@@ -216,6 +216,7 @@ static unsigned long *alloc_thread_stack_node(struct task_struct *tsk, int node)memset (s->addr,0 ,THREAD_SIZE ); tsk->stack_vm_area = s; + tsk->stack = s->addr;return s->addr; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 103/671 ARM: dts: r8a7743: Remove generic compatible string from iic3
In reply to Sasha LevinFrom: Biju Das <[email protected]>
[ Upstream commit 072b817589b17660ef19c31d89f7b981dbed3fd2 ]
The iic3 block on RZ/G1M does not support automatic transmission, unlike other R-Car SoC's. So dropping the compatibility with the generic version.
--- arch/arm/boot/dts/r8a7743.dtsi | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/boot/dts/r8a7743.dtsi +1 -3
@@ -565,9 +565,7 @@ /* doesn't need pinmux */ #address-cells = <1>; #size-cells = <0>; - compatible = "renesas,iic-r8a7743", - "renesas,rcar-gen2-iic", - "renesas,rmobile-iic"; + compatible = "renesas,iic-r8a7743"; reg = <0 0xe60b0000 0 0x425>; interrupts = <GIC_SPI 173 IRQ_TYPE_LEVEL_HIGH>; clocks = <&cpg CPG_MOD 926>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 111/671 drm/shmob: Fix return value check in shmob_drm_probe
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 06c3bbd3c12737a50c2e981821b5585e1786e73d ]
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR().
--- drivers/gpu/drm/shmobile/shmob_drm_drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/shmobile/shmob_drm_drv.c +2 -2
@@ -233,8 +233,8 @@ static int shmob_drm_probe(struct platform_device *pdev) res =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); sdev->mmio =devm_ioremap_resource (&pdev->dev, res); -if (sdev->mmio ==NULL ) -return -ENOMEM ; +if (IS_ERR (sdev->mmio)) +return PTR_ERR (sdev->mmio); ret =shmob_drm_setup_clocks (sdev, pdata->clk_source);if (ret <0 )
Signature · 6 lines
2.20.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 115/671 net: phy: micrel: set soft_reset callback to genphy_soft_reset for KSZ9031
In reply to Sasha LevinFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 1d16073a326891c2a964e4cb95bc18fbcafb5f74 ]
So far genphy_soft_reset was used automatically if the PHY driver didn't implement the soft_reset callback. This changed with the mentioned commit and broke KSZ9031. To fix this configure the KSZ9031 PHY driver to use genphy_soft_reset.
--- drivers/net/phy/micrel.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/phy/micrel.c +1 -0
@@ -977,6 +977,7 @@ static struct phy_driver ksphy_driver[] = { .driver_data = &ksz9021_type, .probe = kszphy_probe, .config_init = ksz9031_config_init, + .soft_reset = genphy_soft_reset, .read_status = ksz9031_read_status, .ack_interrupt = kszphy_ack_interrupt, .config_intr = kszphy_config_intr,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 112/671 arm64: dts: apq8016-sbc: Increase load on l11 for SDCARD
In reply to Sasha LevinFrom: Loic Poulain <[email protected]>
[ Upstream commit af61bef513ba179559e56908b8c465e587bc3890 ]
In the same way as for msm8974-hammerhead, l11 load, used for SDCARD VMMC, needs to be increased in order to prevent any voltage drop issues (due to limited current) happening with some SDCARDS or during specific operations (e.g. write).
Tested on Dragonboard-410c and DART-SD410 boards.
--- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +2 -0
@@ -630,6 +630,8 @@ l11 { regulator-min-microvolt = <1750000>; regulator-max-microvolt = <3337000>; + regulator-allow-set-load; + regulator-system-load = <200000>; }; l12 {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 110/671 RDMA/qedr: Fix out of bounds index check in query pkey
In reply to Sasha LevinFrom: Gal Pressman <[email protected]>
[ Upstream commit dbe30dae487e1a232158c24b432d45281c2805b7 ]
The pkey table size is QEDR_ROCE_PKEY_TABLE_LEN, index should be tested for >= QEDR_ROCE_PKEY_TABLE_LEN instead of > QEDR_ROCE_PKEY_TABLE_LEN.
--- drivers/infiniband/hw/qedr/verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/qedr/verbs.c +1 -1
@@ -67,7 +67,7 @@ static inline int qedr_ib_copy_to_udata(struct ib_udata *udata, void *src,int qedr_query_pkey (struct ib_device *ibdev,u8 port,u16 index,u16 *pkey) { -if (index >QEDR_ROCE_PKEY_TABLE_LEN ) +if (index >=QEDR_ROCE_PKEY_TABLE_LEN )return -EINVAL ; *pkey =QEDR_ROCE_PKEY_DEFAULT ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 114/671 RDMA/iw_cxgb4: Fix the unchecked ep dereference
In reply to Sasha LevinFrom: Raju Rangoju <[email protected]>
[ Upstream commit 3352976c892301fd576a2e9ff0ac7337b2e2ca48 ]
The patch 944661dd97f4: "RDMA/iw_cxgb4: atomically lookup ep and get a reference" from May 6, 2016, leads to the following Smatch complaint:
drivers/infiniband/hw/cxgb4/cm.c:2953 terminate()
error: we previously assumed 'ep' could be null (see line 2945)
--- drivers/infiniband/hw/cxgb4/cm.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
drivers/infiniband/hw/cxgb4/cm.c +10 -7
@@ -2947,15 +2947,18 @@ static int terminate(struct c4iw_dev *dev, struct sk_buff *skb) ep =get_ep_from_tid (dev, tid); -if (ep && ep->com.qp) { -pr_warn ("TERM received tid %u qpid %u\n" , - tid, ep->com.qp->wq.sq.qid); - attrs.next_state =C4IW_QP_STATE_TERMINATE ; -c4iw_modify_qp (ep->com.qp->rhp, ep->com.qp, -C4IW_QP_ATTR_NEXT_STATE , &attrs,1 ); +if (ep) { +if (ep->com.qp) { +pr_warn ("TERM received tid %u qpid %u\n" , tid, + ep->com.qp->wq.sq.qid); + attrs.next_state =C4IW_QP_STATE_TERMINATE ; +c4iw_modify_qp (ep->com.qp->rhp, ep->com.qp, +C4IW_QP_ATTR_NEXT_STATE , &attrs,1 ); + } + +c4iw_put_ep (&ep->com); }else pr_warn ("TERM received tid %u no ep/qp\n" , tid); -c4iw_put_ep (&ep->com);return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 109/671 RDMA/ocrdma: Fix out of bounds index check in query pkey
In reply to Sasha LevinFrom: Gal Pressman <[email protected]>
[ Upstream commit b188940796c7be31c1b8c25a9a0e0842c2e7a49e ]
The pkey table size is one element, index should be tested for > 0 instead of > 1.
--- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/ocrdma/ocrdma_verbs.c +1 -1
@@ -55,7 +55,7 @@int ocrdma_query_pkey (struct ib_device *ibdev,u8 port,u16 index,u16 *pkey) { -if (index >1 ) +if (index >0 )return -EINVAL ; *pkey =0xffff ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 108/671 IB/usnic: Fix out of bounds index check in query pkey
In reply to Sasha LevinFrom: Gal Pressman <[email protected]>
[ Upstream commit 4959d5da5737dd804255c75b8cea0a2929ce279a ]
The pkey table size is one element, index should be tested for > 0 instead of > 1.
--- drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/usnic/usnic_ib_verbs.c +1 -1
@@ -447,7 +447,7 @@ struct net_device *usnic_get_netdev(struct ib_device *device, u8 port_num)int usnic_ib_query_pkey (struct ib_device *ibdev,u8 port,u16 index,u16 *pkey) { -if (index >1 ) +if (index >0 )return -EINVAL ; *pkey =0xffff ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 104/671 ARM: dts: r8a7743: Fix sorting of rwdt node
In reply to Sasha LevinFrom: Biju Das <[email protected]>
[ Upstream commit 383f6024981d32425fa453bf2e66b546fdbc1314 ]
Watchdog node is incorrectly placed on r8a7743 SoC dtsi. This patch fixes the sorting order.
--- arch/arm/boot/dts/r8a7743.dtsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
arch/arm/boot/dts/r8a7743.dtsi +10 -10
@@ -154,6 +154,16 @@ #size-cells = <2>; ranges; + rwdt: watchdog@e6020000 { + compatible = "renesas,r8a7743-wdt", + "renesas,rcar-gen2-wdt"; + reg = <0 0xe6020000 0 0x0c>; + clocks = <&cpg CPG_MOD 402>; + power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; + resets = <&cpg 402>; + status = "disabled"; + }; + gpio0: gpio@e6050000 { compatible = "renesas,gpio-r8a7743", "renesas,rcar-gen2-gpio";
@@ -310,16 +320,6 @@ reg = <0 0xe6160000 0 0x100>; }; - rwdt: watchdog@e6020000 { - compatible = "renesas,r8a7743-wdt", - "renesas,rcar-gen2-wdt"; - reg = <0 0xe6020000 0 0x0c>; - clocks = <&cpg CPG_MOD 402>; - power-domains = <&sysc R8A7743_PD_ALWAYS_ON>; - resets = <&cpg 402>; - status = "disabled"; - }; - sysc: system-controller@e6180000 { compatible = "renesas,r8a7743-sysc"; reg = <0 0xe6180000 0 0x200>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 98/671 MIPS: BCM63XX: drop unused and broken DSP platform device
In reply to Sasha LevinFrom: Jonas Gorski <[email protected]>
[ Upstream commit 682fee802843b332f9c51ffc8e062de5ff773f2e ]
Trying to register the DSP platform device results in a null pointer access:
[ 0.124184] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 804e305c, ra == 804e6f20 [ 0.135208] Oops[#1]: [ 0.137514] CPU: 0 PID: 1 Comm: swapper Not tainted 4.14.87 ... [ 0.197117] epc : 804e305c bcm63xx_dsp_register+0x80/0xa4 [ 0.202838] ra : 804e6f20 board_register_devices+0x258/0x390
...
This happens because it tries to copy the passed platform data over the platform_device's unpopulated platform_data.
Since this code has been broken since its submission, no driver was ever submitted for it, and apparently nobody was using it, just remove it instead of trying to fix it.
--- arch/mips/bcm63xx/Makefile | 6 +- arch/mips/bcm63xx/boards/board_bcm963xx.c | 20 ------- arch/mips/bcm63xx/dev-dsp.c | 56 ------------------- .../asm/mach-bcm63xx/bcm63xx_dev_dsp.h | 14 ----- .../include/asm/mach-bcm63xx/board_bcm963xx.h | 5 -- 5 files changed, 3 insertions(+), 98 deletions(-) delete mode 100644 arch/mips/bcm63xx/dev-dsp.c delete mode 100644 arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h
arch/mips/bcm63xx/Makefile +3 -3
@@ -1,8 +1,8 @@ # SPDX-License-Identifier: GPL-2.0 obj-y += clk.o cpu.o cs.o gpio.o irq.o nvram.o prom.o reset.o \ - setup.o timer.o dev-dsp.o dev-enet.o dev-flash.o \ - dev-pcmcia.o dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o \ - dev-wdt.o dev-usb-usbd.o + setup.o timer.o dev-enet.o dev-flash.o dev-pcmcia.o \ + dev-rng.o dev-spi.o dev-hsspi.o dev-uart.o dev-wdt.o \ + dev-usb-usbd.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-y += boards/
arch/mips/bcm63xx/boards/board_bcm963xx.c +0 -20
@@ -23,7 +23,6 @@#include <bcm63xx_nvram.h> #include <bcm63xx_dev_pci.h> #include <bcm63xx_dev_enet.h> -#include <bcm63xx_dev_dsp.h> #include <bcm63xx_dev_flash.h> #include <bcm63xx_dev_hsspi.h> #include <bcm63xx_dev_pcmcia.h>
@@ -289,14 +288,6 @@ static struct board_info __initdata board_96348gw_10 = { .has_pccard = 1, .has_ehci0 = 1, - .has_dsp = 1, - .dsp = { - .gpio_rst = 6, - .gpio_int = 34, - .cs = 2, - .ext_irq = 2, - }, - .leds = { { .name = "adsl-fail",
@@ -401,14 +392,6 @@ static struct board_info __initdata board_96348gw = { .has_ohci0 = 1, - .has_dsp = 1, - .dsp = { - .gpio_rst = 6, - .gpio_int = 34, - .ext_irq = 2, - .cs = 2, - }, - .leds = { { .name = "adsl-fail",
@@ -898,9 +881,6 @@ int __init board_register_devices(void)if (board.has_usbd)bcm63xx_usbd_register (&board.usbd); -if (board.has_dsp) -bcm63xx_dsp_register (&board.dsp); -/* Generate MAC address for WLAN and register our SPROM, * do this after registering enet devices */
arch/mips/bcm63xx/dev-dsp.c deleted +0 -56
56 lines not on this page · raw message
arch/mips/include/asm/mach-bcm63xx/bcm63xx_dev_dsp.h deleted +0 -14
@@ -1,14 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef __BCM63XX_DSP_H -#define __BCM63XX_DSP_H - -struct bcm63xx_dsp_platform_data { -unsigned gpio_rst; -unsigned gpio_int; -unsigned cs; -unsigned ext_irq; -}; - -int __init bcm63xx_dsp_register (const struct bcm63xx_dsp_platform_data *pd); - -#endif /* __BCM63XX_DSP_H */
arch/mips/include/asm/mach-bcm63xx/board_bcm963xx.h +0 -5
@@ -7,7 +7,6 @@#include <linux/leds.h> #include <bcm63xx_dev_enet.h> #include <bcm63xx_dev_usb_usbd.h> -#include <bcm63xx_dev_dsp.h> /* * flash mapping
@@ -31,7 +30,6 @@ struct board_info { unsigned int has_ohci0:1; unsigned int has_ehci0:1; unsigned int has_usbd:1; - unsigned int has_dsp:1; unsigned int has_uart0:1; unsigned int has_uart1:1;
@@ -43,9 +41,6 @@ struct board_info {/* USB config */ struct bcm63xx_usbd_platform_data usbd; -/* DSP config */ -struct bcm63xx_dsp_platform_data dsp; -/* GPIO LEDs */ struct gpio_led leds[5 ];
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 99/671 arm64: defconfig: Re-enable bcm2835-thermal driver
In reply to Sasha LevinFrom: Stefan Wahren <[email protected]>
[ Upstream commit 4d9226fd9a0d747030575d7cb184b30c6e64f155 ]
The bcm2835-thermal driver was added with commit ac178e4280e6 ("ARM64: bcm2835: add thermal driver to default config"). Unfortunately this was accidentally dropped by commit eb1e6716cc9c
("arm64: defconfig: sync with savedefconfig"). So enable the driver again.
--- arch/arm64/configs/defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm64/configs/defconfig +1 -0
@@ -365,6 +365,7 @@ CONFIG_THERMAL_EMULATION=y CONFIG_ROCKCHIP_THERMAL=m CONFIG_RCAR_GEN3_THERMAL=y CONFIG_ARMADA_THERMAL=y +CONFIG_BCM2835_THERMAL=m CONFIG_BRCMSTB_THERMAL=m CONFIG_EXYNOS_THERMAL=y CONFIG_TEGRA_BPMP_THERMAL=m
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 97/671 clk: dove: fix refcount leak in dove_clk_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 8d726c5128298386b907963033be93407b0c4275 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/mvebu/dove.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/clk/mvebu/dove.c +6 -2
@@ -190,10 +190,14 @@ static void __init dove_clk_init(struct device_node *np)mvebu_coreclk_setup (np, &dove_coreclks); -if (ddnp) +if (ddnp) {dove_divider_clk_init (ddnp); +of_node_put (ddnp); + } -if (cgnp) +if (cgnp) {mvebu_clk_gating_setup (cgnp, dove_gating_desc); +of_node_put (cgnp); + } }CLK_OF_DECLARE (dove_clk,"marvell,dove-core-clock" , dove_clk_init);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 93/671 clk: armada-370: fix refcount leak in a370_clk_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit a3c24050bdf70c958a8d98c2823b66ea761e6a31 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/mvebu/armada-370.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/clk/mvebu/armada-370.c +3 -1
@@ -177,8 +177,10 @@ static void __init a370_clk_init(struct device_node *np)mvebu_coreclk_setup (np, &a370_coreclks); -if (cgnp) +if (cgnp) {mvebu_clk_gating_setup (cgnp, a370_gating_desc); +of_node_put (cgnp); + } }CLK_OF_DECLARE (a370_clk,"marvell,armada-370-core-clock" , a370_clk_init);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 92/671 clk: vf610: fix refcount leak in vf610_clocks_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 567177024e0313e4f0dcba7ba10c0732e50e655d ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/imx/clk-vf610.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/imx/clk-vf610.c +1 -0
@@ -203,6 +203,7 @@ static void __init vf610_clocks_init(struct device_node *ccm_node) np =of_find_compatible_node (NULL ,NULL ,"fsl,vf610-anatop" ); anatop_base =of_iomap (np,0 );BUG_ON (!anatop_base); +of_node_put (np); np = ccm_node; ccm_base =of_iomap (np,0 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 91/671 clk: imx7d: fix refcount leak in imx7d_clocks_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 5f8c183a996b76bb09748073c856e4246fd4ce95 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/imx/clk-imx7d.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/imx/clk-imx7d.c +1 -0
@@ -413,6 +413,7 @@ static void __init imx7d_clocks_init(struct device_node *ccm_node) np =of_find_compatible_node (NULL ,NULL ,"fsl,imx7d-anatop" ); base =of_iomap (np,0 );WARN_ON (!base); +of_node_put (np); clks[IMX7D_PLL_ARM_MAIN_SRC ] =imx_clk_mux ("pll_arm_main_src" , base +0x60 ,14 ,2 , pll_bypass_src_sel,ARRAY_SIZE (pll_bypass_src_sel)); clks[IMX7D_PLL_DRAM_MAIN_SRC ] =imx_clk_mux ("pll_dram_main_src" , base +0x70 ,14 ,2 , pll_bypass_src_sel,ARRAY_SIZE (pll_bypass_src_sel));
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/671 ARM: dts: at91: nattis: make the SD-card slot work
In reply to Sasha LevinFrom: Peter Rosin <[email protected]>
[ Upstream commit f52eb2067929d533babe106fbc131c88db3eff3d ]
The cd-gpios signal is assumed active-low by the driver, and the cd-inverted property is needed if it is, in fact, active-high. Fix this oversight.
--- arch/arm/boot/dts/at91-nattis-2-natte-2.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/at91-nattis-2-natte-2.dts +1 -0
@@ -221,6 +221,7 @@ reg = <0>; bus-width = <4>; cd-gpios = <&pioD 5 GPIO_ACTIVE_HIGH>; + cd-inverted; }; };
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 88/671 clk: samsung: exynos4: fix refcount leak in exynos4_get_xom()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit cee82eb9532090cd1dc953e845d71f9b1445c84e ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/samsung/clk-exynos4.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/samsung/clk-exynos4.c +1 -0
@@ -1226,6 +1226,7 @@ static unsigned long __init exynos4_get_xom(void) xom =readl (chipid_base +8 );iounmap (chipid_base); +of_node_put (np); }return xom;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/671 ARM: qcom_defconfig: Enable MAILBOX
In reply to Sasha LevinFrom: Frank Rowand <[email protected]>
[ Upstream commit 54c2678cd198f61555796bbda5e1727e6e1858f1 ]
Problem:ab460a2e72da ("rpmsg: qcom_smd: Access APCS through mailbox framework" added a "depends on MAILBOX") to RPMSG_QCOM_SMD, thus RPMSG_QCOM_SMD becomes unset since MAILBOX was not enabled in qcom_defconfig and is not otherwise selected for the dragonboard. When the resulting kernel is booted the mmc device which contains the root file system is not available.
Fix:
add CONFIG_MAILBOX to qcom_defconfig
added a "depends on MAILBOX")
--- arch/arm/configs/qcom_defconfig | 1 + 1 file changed, 1 insertion(+)
arch/arm/configs/qcom_defconfig +1 -0
@@ -207,6 +207,7 @@ CONFIG_MSM_MMCC_8974=y CONFIG_MSM_IOMMU=y CONFIG_HWSPINLOCK=y CONFIG_HWSPINLOCK_QCOM=y +CONFIG_MAILBOX=y CONFIG_REMOTEPROC=y CONFIG_QCOM_ADSP_PIL=y CONFIG_QCOM_Q6V5_PIL=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 12/671 PCI: iproc: Remove PAXC slot check to allow VF support
In reply to Sasha LevinFrom: Jitendra Bhivare <[email protected]>
[ Upstream commit 4da6b4480766e5bc9c4d7bc14bf1d0939a1a5fa7 ]
Fix previous incorrect logic that limits PAXC slot number to zero only. In order for SRIOV/VF to work, we need to allow the slot number to be greater than zero.
--- drivers/pci/controller/pcie-iproc.c | 8 -------- 1 file changed, 8 deletions(-)
drivers/pci/controller/pcie-iproc.c +0 -8
@@ -630,14 +630,6 @@ static void __iomem *iproc_pcie_map_cfg_bus(struct iproc_pcie *pcie,return (pcie->base + offset); } -/* -* PAXC is connected to an internally emulated EP within the SoC. It -* allows only one device. -*/ -if (pcie->ep_is_internal) -if (slot >0 ) -return NULL ; -return iproc_pcie_map_ep_cfg_reg (pcie, busno, slot, fn, where); }
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 47/671 ARM: dts: bcm283x: Correct mailbox register sizes
In reply to Sasha LevinFrom: Phil Elwell <[email protected]>
[ Upstream commit 227fa865061470a568858baa404a508f6c030fe4 ]
The size field in a Device Tree "reg" property is encoded in bytes, not words.
--- arch/arm/boot/dts/bcm2835-rpi.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/bcm2835-rpi.dtsi +1 -1
@@ -32,7 +32,7 @@ mailbox@7e00b840 { compatible = "brcm,bcm2835-vchiq"; - reg = <0x7e00b840 0xf>; + reg = <0x7e00b840 0x3c>; interrupts = <0 2>; }; };
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 49/671 ASoC: sun8i-codec: add missing route for ADC
In reply to Sasha LevinFrom: Vasily Khoruzhick <[email protected]>
[ Upstream commit 9ee325d029c4abb75716851ce38863845911d605 ]
sun8i-codec misses a route from ADC to AIF1 Slot 0 ADC. Add it to the driver to avoid adding it to every dts.
--- sound/soc/sunxi/sun8i-codec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/soc/sunxi/sun8i-codec.c +5 -1
@@ -465,7 +465,11 @@ static const struct snd_soc_dapm_route sun8i_codec_dapm_routes[] = { {"Right Digital DAC Mixer" ,"AIF1 Slot 0 Digital DAC Playback Switch" , "AIF1 Slot 0 Right"}, -/* ADC routes */ +/* ADC Routes */ + { "AIF1 Slot 0 Right ADC", NULL, "ADC" }, + { "AIF1 Slot 0 Left ADC", NULL, "ADC" }, + +/* ADC Mixer Routes */ { "Left Digital ADC Mixer", "AIF1 Data Digital ADC Capture Switch", "AIF1 Slot 0 Left ADC" }, { "Right Digital ADC Mixer", "AIF1 Data Digital ADC Capture Switch",
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 57/671 arm64: dts: meson-gx: Add hdmi_5v regulator as hdmi tx supply
In reply to Sasha LevinFrom: Neil Armstrong <[email protected]>
[ Upstream commit e1f2163deac059ad39f07aba9e314ebe605d5a7a ]
The hdmi_5v regulator must be enabled to provide power to the physical HDMI PHY and enables the HDMI 5V presence loopback for the monitor.
--- arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 1 + arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts | 1 + arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts | 1 + 5 files changed, 5 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +1 -0
@@ -125,6 +125,7 @@ status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; }; &hdmi_tx_tmds_port {
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +1 -0
@@ -78,6 +78,7 @@ status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; }; &hdmi_tx_tmds_port {
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +1 -0
@@ -155,6 +155,7 @@ status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; }; &hdmi_tx_tmds_port {
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dts +1 -0
@@ -51,6 +51,7 @@ status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; }; &hdmi_tx_tmds_port {
arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts +1 -0
@@ -271,6 +271,7 @@ status = "okay"; pinctrl-0 = <&hdmi_hpd_pins>, <&hdmi_i2c_pins>; pinctrl-names = "default"; + hdmi-supply = <&hdmi_5v>; }; &hdmi_tx_tmds_port {
Signature · 7 lines
2.20.1 _______________________________________________ linux-amlogic mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-amlogic
Sasha Levin
maintainerPATCH 64/671 staging: bcm2835-camera: Abort probe if there is no camera
In reply to Sasha LevinFrom: Stefan Wahren <[email protected]>
[ Upstream commit 7566f39dfdc11f8a97d5810c6e6295a88f97ef91 ]
Abort the probing of the camera driver in case there isn't a camera actually connected to the Raspberry Pi. This solution also avoids a NULL ptr dereference of mmal instance on driver unload.
--- .../vc04_services/bcm2835-camera/bcm2835-camera.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +9 -0
@@ -1854,6 +1854,12 @@ static int bcm2835_mmal_probe(struct platform_device *pdev) num_cameras =get_num_cameras (instance, resolutions,MAX_BCM2835_CAMERAS ); + +if (num_cameras <1 ) { + ret = -ENODEV ; + goto cleanup_mmal; + } +if (num_cameras >MAX_BCM2835_CAMERAS ) num_cameras =MAX_BCM2835_CAMERAS ;
@@ -1953,6 +1959,9 @@ static int bcm2835_mmal_probe(struct platform_device *pdev)pr_info ("%s: error %d while loading driver\n" ,BM2835_MMAL_MODULE_NAME , ret); +cleanup_mmal: +vchiq_mmal_finalise (instance); +return ret; }
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 65/671 staging: bcm2835-camera: fix module autoloading
In reply to Sasha LevinFrom: Stefan Wahren <[email protected]>
[ Upstream commit 3a2c20024a2b47adbf514e7f3ab79342739c3926 ]
In order to make the module bcm2835-camera load automatically, we need to add a module alias.
--- drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +1 -0
@@ -47,6 +47,7 @@ MODULE_DESCRIPTION("Broadcom 2835 MMAL video capture");MODULE_AUTHOR ("Vincent Sanders" );MODULE_LICENSE ("GPL" );MODULE_VERSION (BM2835_MMAL_VERSION ); +MODULE_ALIAS ("platform:bcm2835-camera" );int bcm2835_v4l2_debug;module_param_named (debug, bcm2835_v4l2_debug, int,0644 );
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 29/671 ALSA: usb-audio: update quirk for B&W PX to remove microphone
In reply to Sasha LevinFrom: Nicolas Huaman <[email protected]>
[ Upstream commit c369c8db15d51fa175d2ba85928f79d16af6b562 ]
A quirk in snd-usb-audio was added to automate setting sample rate to 4800k and remove the previously exposed nonfunctional microphone for the Bowers & Wilkins PX:
commit 240a8af929c7c57dcde28682725b29cf8474e8e5
https://lore.kernel.org/patchwork/patch/919689/
However the headphones where updated shortly after that to remove the unintentional microphone functionality. I guess because of this the headphones now crash when connecting them via USB while the quirk is active. Dmesg:
snd-usb-audio: probe of 2-3:1.0 failed with error -22 usb 2-3: 2:1: cannot get min/max values for control 2 (id 2)
This patch removes the microfone and allows the headphones to connect and work out of the box. It is based on the current mainline kernel
and successfully applied an tested on my machine (4.18.10.arch1-1).
--- sound/usb/quirks-table.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
sound/usb/quirks-table.h +2 -7
@@ -3349,19 +3349,14 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"), .ifnum = 0, .type = QUIRK_AUDIO_STANDARD_MIXER, }, - /* Capture */ - { - .ifnum = 1, - .type = QUIRK_IGNORE_INTERFACE, - },/* Playback */ { - .ifnum = 2, + .ifnum = 1, .type = QUIRK_AUDIO_FIXED_ENDPOINT, .data = &(const struct audioformat) { .formats = SNDRV_PCM_FMTBIT_S16_LE, .channels = 2, - .iface = 2, + .iface = 1, .altsetting = 1, .altset_idx = 1, .attributes = UAC_EP_CS_ATTR_FILL_MAX |
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 46/671 ASoC: wm97xx: fix uninitialized regmap pointer problem
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 576ce4075bfa0f03e0e91a89eecc539b3b828b08 ]
gcc notices that without either the ac97 bus or the pdata, we never initialize the regmap pointer, which leads to an uninitialized variable access:
sound/soc/codecs/wm9712.c: In function 'wm9712_soc_probe':sound/soc/codecs/wm9712.c:666:2: error: 'regmap' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Since that configuration is invalid, it's better to return an error here. I tried to avoid adding complexity to the conditions, and turned the #ifdef into a regular if(IS_ENABLED()) check for readability. This in turn requires moving some header file declarations out of an #ifdef.
The same code is used in three drivers, all of which I'm changing the same way.
--- include/sound/soc.h | 2 +- sound/soc/codecs/wm9705.c | 10 ++++------ sound/soc/codecs/wm9712.c | 10 ++++------ sound/soc/codecs/wm9713.c | 10 ++++------ 4 files changed, 13 insertions(+), 19 deletions(-)
include/sound/soc.h +1 -1
@@ -548,12 +548,12 @@ static inline void snd_soc_jack_free_gpios(struct snd_soc_jack *jack, int count, }#endif -#ifdef CONFIG_SND_SOC_AC97_BUS struct snd_ac97 *snd_soc_alloc_ac97_component (struct snd_soc_component *component);struct snd_ac97 *snd_soc_new_ac97_component (struct snd_soc_component *component,unsigned int id,unsigned int id_mask);void snd_soc_free_ac97_component (struct snd_ac97 *ac97); +#ifdef CONFIG_SND_SOC_AC97_BUS int snd_soc_set_ac97_ops (struct snd_ac97_bus_ops *ops);int snd_soc_set_ac97_ops_of_reset (struct snd_ac97_bus_ops *ops,struct platform_device *pdev);
sound/soc/codecs/wm9705.c +4 -6
@@ -325,8 +325,7 @@ static int wm9705_soc_probe(struct snd_soc_component *component)if (wm9705->mfd_pdata) { wm9705->ac97 = wm9705->mfd_pdata->ac97; regmap = wm9705->mfd_pdata->regmap; - }else { -#ifdef CONFIG_SND_SOC_AC97_BUS + }else if (IS_ENABLED (CONFIG_SND_SOC_AC97_BUS )) { wm9705->ac97 =snd_soc_new_ac97_component (component,WM9705_VENDOR_ID ,WM9705_VENDOR_ID_MASK );if (IS_ERR (wm9705->ac97)) {
@@ -339,7 +338,8 @@ static int wm9705_soc_probe(struct snd_soc_component *component)snd_soc_free_ac97_component (wm9705->ac97);return PTR_ERR (regmap); } -#endif + }else { +return -ENXIO ; }snd_soc_component_set_drvdata (component, wm9705->ac97);
@@ -350,14 +350,12 @@ static int wm9705_soc_probe(struct snd_soc_component *component)static void wm9705_soc_remove (struct snd_soc_component *component) { -#ifdef CONFIG_SND_SOC_AC97_BUS struct wm9705_priv *wm9705 =snd_soc_component_get_drvdata (component); -if (!wm9705->mfd_pdata) { +if (IS_ENABLED (CONFIG_SND_SOC_AC97_BUS ) && !wm9705->mfd_pdata) {snd_soc_component_exit_regmap (component);snd_soc_free_ac97_component (wm9705->ac97); } -#endif }static const struct snd_soc_component_driver soc_component_dev_wm9705 = {
sound/soc/codecs/wm9712.c +4 -6
@@ -642,8 +642,7 @@ static int wm9712_soc_probe(struct snd_soc_component *component)if (wm9712->mfd_pdata) { wm9712->ac97 = wm9712->mfd_pdata->ac97; regmap = wm9712->mfd_pdata->regmap; - }else { -#ifdef CONFIG_SND_SOC_AC97_BUS + }else if (IS_ENABLED (CONFIG_SND_SOC_AC97_BUS )) {int ret; wm9712->ac97 = snd_soc_new_ac97_component(component, WM9712_VENDOR_ID,
@@ -660,7 +659,8 @@ static int wm9712_soc_probe(struct snd_soc_component *component)snd_soc_free_ac97_component (wm9712->ac97);return PTR_ERR (regmap); } -#endif + }else { +return -ENXIO ; }snd_soc_component_init_regmap (component, regmap);
@@ -673,14 +673,12 @@ static int wm9712_soc_probe(struct snd_soc_component *component)static void wm9712_soc_remove (struct snd_soc_component *component) { -#ifdef CONFIG_SND_SOC_AC97_BUS struct wm9712_priv *wm9712 =snd_soc_component_get_drvdata (component); -if (!wm9712->mfd_pdata) { +if (IS_ENABLED (CONFIG_SND_SOC_AC97_BUS ) && !wm9712->mfd_pdata) {snd_soc_component_exit_regmap (component);snd_soc_free_ac97_component (wm9712->ac97); } -#endif }static const struct snd_soc_component_driver soc_component_dev_wm9712 = {
sound/soc/codecs/wm9713.c +4 -6
@@ -1214,8 +1214,7 @@ static int wm9713_soc_probe(struct snd_soc_component *component)if (wm9713->mfd_pdata) { wm9713->ac97 = wm9713->mfd_pdata->ac97; regmap = wm9713->mfd_pdata->regmap; - }else { -#ifdef CONFIG_SND_SOC_AC97_BUS + }else if (IS_ENABLED (CONFIG_SND_SOC_AC97_BUS )) { wm9713->ac97 =snd_soc_new_ac97_component (component,WM9713_VENDOR_ID ,WM9713_VENDOR_ID_MASK );if (IS_ERR (wm9713->ac97))
@@ -1225,7 +1224,8 @@ static int wm9713_soc_probe(struct snd_soc_component *component)snd_soc_free_ac97_component (wm9713->ac97);return PTR_ERR (regmap); } -#endif + }else { +return -ENXIO ; }snd_soc_component_init_regmap (component, regmap);
@@ -1238,14 +1238,12 @@ static int wm9713_soc_probe(struct snd_soc_component *component)static void wm9713_soc_remove (struct snd_soc_component *component) { -#ifdef CONFIG_SND_SOC_AC97_BUS struct wm9713_priv *wm9713 =snd_soc_component_get_drvdata (component); -if (!wm9713->mfd_pdata) { +if (IS_ENABLED (CONFIG_SND_SOC_AC97_BUS ) && !wm9713->mfd_pdata) {snd_soc_component_exit_regmap (component);snd_soc_free_ac97_component (wm9713->ac97); } -#endif }static const struct snd_soc_component_driver soc_component_dev_wm9713 = {
Signature · 6 lines
2.20.1 _______________________________________________ Alsa-devel mailing list [email protected] https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Sasha Levin
maintainerPATCH 34/671 powerpc/pseries/memory-hotplug: Fix return value type of find_aa_index
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit b45e9d761ba2d60044b610297e3ef9f947ac157f ]
The variable 'aa_index' is defined as an unsigned value in update_lmb_associativity_index(), but find_aa_index() may return -1 when dlpar_clone_property() fails. So change find_aa_index() to return a bool, which indicates whether 'aa_index' was found or not.
--- .../platforms/pseries/hotplug-memory.c | 61 +++++++++---------- 1 file changed, 28 insertions(+), 33 deletions(-)
arch/powerpc/platforms/pseries/hotplug-memory.c +28 -33
@@ -101,11 +101,12 @@ static struct property *dlpar_clone_property(struct property *prop,return new_prop; } -static u32 find_aa_index (struct device_node *dr_node, -struct property *ala_prop,const u32 *lmb_assoc) +static bool find_aa_index (struct device_node *dr_node, +struct property *ala_prop, +const u32 *lmb_assoc,u32 *aa_index) { -u32 *assoc_arrays; -u32 aa_index; +u32 *assoc_arrays, new_prop_size; +struct property *new_prop;int aa_arrays, aa_array_entries, aa_array_sz;int i, index;
@@ -121,46 +122,39 @@ static u32 find_aa_index(struct device_node *dr_node, aa_array_entries =be32_to_cpu (assoc_arrays[1 ]); aa_array_sz = aa_array_entries *sizeof (u32); - aa_index =-1 ;for (i =0 ; i < aa_arrays; i++) { index = (i * aa_array_entries) +2 ;if (memcmp (&assoc_arrays[index], &lmb_assoc[1 ], aa_array_sz))continue ; - aa_index = i; -break ; + *aa_index = i; +return true; } -if (aa_index ==-1 ) { -struct property *new_prop; -u32 new_prop_size; - - new_prop_size = ala_prop->length + aa_array_sz; - new_prop =dlpar_clone_property (ala_prop, new_prop_size); -if (!new_prop) -return -1 ; - - assoc_arrays = new_prop->value; + new_prop_size = ala_prop->length + aa_array_sz; + new_prop =dlpar_clone_property (ala_prop, new_prop_size); +if (!new_prop) +return false; -/* increment the number of entries in the lookup array */ - assoc_arrays[0 ] =cpu_to_be32 (aa_arrays +1 ); + assoc_arrays = new_prop->value; -/* copy the new associativity into the lookup array */ - index = aa_arrays * aa_array_entries +2 ; -memcpy (&assoc_arrays[index], &lmb_assoc[1 ], aa_array_sz); +/* increment the number of entries in the lookup array */ + assoc_arrays[0 ] =cpu_to_be32 (aa_arrays +1 ); -of_update_property (dr_node, new_prop); +/* copy the new associativity into the lookup array */ + index = aa_arrays * aa_array_entries +2 ; +memcpy (&assoc_arrays[index], &lmb_assoc[1 ], aa_array_sz); -/* -* The associativity lookup array index for this lmb is -* number of entries - 1 since we added its associativity -* to the end of the lookup array. -*/ - aa_index =be32_to_cpu (assoc_arrays[0 ]) -1 ; - } +of_update_property (dr_node, new_prop); -return aa_index; +/* +* The associativity lookup array index for this lmb is +* number of entries - 1 since we added its associativity +* to the end of the lookup array. +*/ + *aa_index =be32_to_cpu (assoc_arrays[0 ]) -1 ; +return true; }static int update_lmb_associativity_index (struct drmem_lmb *lmb)
@@ -169,6 +163,7 @@ static int update_lmb_associativity_index(struct drmem_lmb *lmb)struct property *ala_prop;const u32 *lmb_assoc;u32 aa_index; +bool found; parent =of_find_node_by_path ("/" );if (!parent)
@@ -200,12 +195,12 @@ static int update_lmb_associativity_index(struct drmem_lmb *lmb)return -ENODEV ; } - aa_index =find_aa_index (dr_node, ala_prop, lmb_assoc); + found =find_aa_index (dr_node, ala_prop, lmb_assoc, &aa_index);of_node_put (dr_node);dlpar_free_cc_nodes (lmb_node); -if (aa_index <0 ) { +if (!found) {pr_err ("Could not find LMB associativity\n" );return -1 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 38/671 powerpc/kgdb: add kgdb_arch_set/remove_breakpoint()
In reply to Sasha LevinFrom: Christophe Leroy <[email protected]>
[ Upstream commit fb978ca207743badfe7efd9eebe68bcbb4969f79 ]
Generic implementation fails to remove breakpoints after init when CONFIG_STRICT_KERNEL_RWX is selected:
[ 13.251285] KGDB: BP remove failed: c001c338 [ 13.259587] kgdbts: ERROR PUT: end of test buffer on 'do_fork_test' line 8 expected OK got $E14#aa [ 13.268969] KGDB: re-enter exception: ALL breakpoints killed [ 13.275099] CPU: 0 PID: 1 Comm: init Not tainted 4.18.0-g82bbb913ffd8 #860 [ 13.282836] Call Trace: [ 13.285313] [c60e1ba0] [c0080ef0] kgdb_handle_exception+0x6f4/0x720 (unreliable) [ 13.292618] [c60e1c30] [c000e97c] kgdb_handle_breakpoint+0x3c/0x98 [ 13.298709] [c60e1c40] [c000af54] program_check_exception+0x104/0x700 [ 13.305083] [c60e1c60] [c000e45c] ret_from_except_full+0x0/0x4 [ 13.310845] [c60e1d20] [c02a22ac] run_simple_test+0x2b4/0x2d4 [ 13.316532] [c60e1d30] [c0081698] put_packet+0xb8/0x158 [ 13.321694] [c60e1d60] [c00820b4] gdb_serial_stub+0x230/0xc4c [ 13.327374] [c60e1dc0] [c0080af8] kgdb_handle_exception+0x2fc/0x720 [ 13.333573] [c60e1e50] [c000e928] kgdb_singlestep+0xb4/0xcc [ 13.339068] [c60e1e70] [c000ae1c] single_step_exception+0x90/0xac [ 13.345100] [c60e1e80] [c000e45c] ret_from_except_full+0x0/0x4 [ 13.350865] [c60e1f40] [c000e11c] ret_from_syscall+0x0/0x38 [ 13.356346] Kernel panic - not syncing: Recursive entry to debugger
This patch creates powerpc specific version of kgdb_arch_set_breakpoint() and kgdb_arch_remove_breakpoint() using patch_instruction()
--- arch/powerpc/include/asm/kgdb.h | 5 +++- arch/powerpc/kernel/kgdb.c | 43 +++++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 9 deletions(-)
arch/powerpc/include/asm/kgdb.h +4 -1
@@ -26,9 +26,12 @@#define BREAK_INSTR_SIZE 4#define BUFMAX ((NUMREGBYTES * 2) + 512)#define OUTBUFMAX ((NUMREGBYTES * 2) + 512) + +#define BREAK_INSTR 0x7d821008/* twge r2, r2 */ +static inline void arch_kgdb_breakpoint (void ) { - asm(".long 0x7d821008" );/* twge r2, r2 */ + asm(stringify_in_c(.long BREAK_INSTR)); }#define CACHE_FLUSH_IS_SAFE 1#define DBG_MAX_REG_NUM 70
arch/powerpc/kernel/kgdb.c +35 -8
64 lines not on this page · raw message
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 85/671 clk: qoriq: fix refcount leak in clockgen_init()
In reply to Sasha LevinFrom: Yangtao Li <[email protected]>
[ Upstream commit 70af6c5b5270e8101f318c4b69cc98a726edfab9 ]
The of_find_compatible_node() returns a node pointer with refcount incremented, but there is the lack of use of the of_node_put() when done. Add the missing of_node_put() to release the refcount.
--- drivers/clk/clk-qoriq.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/clk-qoriq.c +1 -0
@@ -1389,6 +1389,7 @@ static void __init clockgen_init(struct device_node *np)pr_err ("%s: Couldn't map %pOF regs\n" , __func__, guts); } +of_node_put (guts); } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 77/671 pinctrl: sh-pfc: r8a77995: Remove bogus SEL_PWM[0-3]_3 configurations
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit e28dc3f09c9d2555a9bd982f0847988591052226 ]
While the SEL_PWM[0-3] fields in the Module Select Register 0 support 4 possible configurations per PWM pin, only the first 3 are valid.
Replace the invalid and unused configurations for SEL_PWM[0-3]_3 by dummies.
--- drivers/pinctrl/sh-pfc/pfc-r8a77995.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a77995.c +4 -4
@@ -391,10 +391,10 @@ FM(IP12_31_28) IP12_31_28 \#define MOD_SEL0_27 FM(SEL_MSIOF3_0) FM(SEL_MSIOF3_1)#define MOD_SEL0_26 FM(SEL_HSCIF3_0) FM(SEL_HSCIF3_1)#define MOD_SEL0_25 FM(SEL_SCIF4_0) FM(SEL_SCIF4_1) -#define MOD_SEL0_24_23 FM(SEL_PWM0_0) FM(SEL_PWM0_1) FM(SEL_PWM0_2) FM(SEL_PWM0_3) -#define MOD_SEL0_22_21 FM(SEL_PWM1_0) FM(SEL_PWM1_1) FM(SEL_PWM1_2) FM(SEL_PWM1_3) -#define MOD_SEL0_20_19 FM(SEL_PWM2_0) FM(SEL_PWM2_1) FM(SEL_PWM2_2) FM(SEL_PWM2_3) -#define MOD_SEL0_18_17 FM(SEL_PWM3_0) FM(SEL_PWM3_1) FM(SEL_PWM3_2) FM(SEL_PWM3_3) +#define MOD_SEL0_24_23 FM(SEL_PWM0_0) FM(SEL_PWM0_1) FM(SEL_PWM0_2) F_(0, 0) +#define MOD_SEL0_22_21 FM(SEL_PWM1_0) FM(SEL_PWM1_1) FM(SEL_PWM1_2) F_(0, 0) +#define MOD_SEL0_20_19 FM(SEL_PWM2_0) FM(SEL_PWM2_1) FM(SEL_PWM2_2) F_(0, 0) +#define MOD_SEL0_18_17 FM(SEL_PWM3_0) FM(SEL_PWM3_1) FM(SEL_PWM3_2) F_(0, 0)#define MOD_SEL0_15 FM(SEL_IRQ_0_0) FM(SEL_IRQ_0_1)#define MOD_SEL0_14 FM(SEL_IRQ_1_0) FM(SEL_IRQ_1_1)#define MOD_SEL0_13 FM(SEL_IRQ_2_0) FM(SEL_IRQ_2_1)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 82/671 Input: nomadik-ske-keypad - fix a loop timeout test
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 4d8f727b83bcd6702c2d210330872c9122d2d360 ]
The loop exits with "timeout" set to -1 not to 0.
--- drivers/input/keyboard/nomadik-ske-keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/keyboard/nomadik-ske-keypad.c +1 -1
@@ -100,7 +100,7 @@ static int __init ske_keypad_chip_init(struct ske_keypad *keypad)while ((readl (keypad->reg_base +SKE_RIS ) !=0x00000000 ) && timeout--)cpu_relax (); -if (!timeout) +if (timeout ==-1 )return -EINVAL ;/*
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 79/671 pinctrl: sh-pfc: sh7734: Remove bogus IPSR10 value
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 4d374bacd7c9665179f9752a52d5d602c45d8190 ]
The IP10[5:3] field in Peripheral Function Select Register 10 has a width of 3 bits, i.e. it allows programming one out of 8 different configurations.
However, 9 values are provided instead of 8, overflowing into the subsequent field in the register, and thus breaking the configuration of the latter.
Fix this by dropping a bogus zero value.
--- drivers/pinctrl/sh-pfc/pfc-sh7734.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-sh7734.c +1 -1
@@ -2231,7 +2231,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {FN_LCD_CL1_B ,0 ,0 ,/* IP10_5_3 [3] */ FN_SSI_WS23 ,FN_VI1_5_B ,FN_TX1_D ,FN_HSCK0_C ,FN_FALE_B , -FN_LCD_DON_B ,0 ,0 ,0 , +FN_LCD_DON_B ,0 ,0 ,/* IP10_2_0 [3] */ FN_SSI_SCK23 ,FN_VI1_4_B ,FN_RX1_D ,FN_FCLE_B , FN_LCD_DATA15_B, 0, 0, 0 }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 78/671 pinctrl: sh-pfc: sh7269: Add missing PCIOR0 field
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 9540cbdfcd861caf67a6f0e4bb7f46d41c4aad86 ]
The Port C I/O Register 0 contains 7 reserved bits, but the descriptor contains only dummy configuration values for 6 reserved bits, thus breaking the configuration of all subsequent fields in the register.
Fix this by adding the two missing configuration values.
--- drivers/pinctrl/sh-pfc/pfc-sh7269.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-sh7269.c +1 -1
@@ -2119,7 +2119,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = { }, { PINMUX_CFG_REG("PCIOR0", 0xfffe3852, 16, 1) { -0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , +0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,PC8_IN ,PC8_OUT ,PC7_IN ,PC7_OUT , PC6_IN, PC6_OUT,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 71/671 pinctrl: sh-pfc: r8a7791: Remove bogus marks from vin1_b_data18 group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0d6256cb880166a4111bebce35790019e56b6e1b ]
The vin1_b_data18_mux[] arrays contains pin marks for the 2 LSB bits of the color components. The vin1_b_data18_pins[] array rightfully does not include the corresponding pin numbers, as RGB18 is subset of RGB24, containing only the 6 MSB bits of each component.
--- drivers/pinctrl/sh-pfc/pfc-r8a7791.c | 3 --- 1 file changed, 3 deletions(-)
drivers/pinctrl/sh-pfc/pfc-r8a7791.c +0 -3
@@ -4374,17 +4374,14 @@ static const unsigned int vin1_b_data18_pins[] = { };static const unsigned int vin1_b_data18_mux[] = {/* B */ -VI1_DATA0_B_MARK ,VI1_DATA1_B_MARK ,VI1_DATA2_B_MARK ,VI1_DATA3_B_MARK ,VI1_DATA4_B_MARK ,VI1_DATA5_B_MARK ,VI1_DATA6_B_MARK ,VI1_DATA7_B_MARK ,/* G */ -VI1_G0_B_MARK ,VI1_G1_B_MARK ,VI1_G2_B_MARK ,VI1_G3_B_MARK ,VI1_G4_B_MARK ,VI1_G5_B_MARK ,VI1_G6_B_MARK ,VI1_G7_B_MARK ,/* R */ -VI1_R0_B_MARK ,VI1_R1_B_MARK ,VI1_R2_B_MARK ,VI1_R3_B_MARK ,VI1_R4_B_MARK ,VI1_R5_B_MARK ,VI1_R6_B_MARK ,VI1_R7_B_MARK ,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 74/671 pinctrl: sh-pfc: r8a77970: Add missing MOD_SEL0 field
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 67d7745bc78e16ec6b3af02bc1da6c8c868cbd89 ]
The Module Select Register 0 contains 20 (= 5 x 4) reserved bits, and 12 single-bit fields, but the variable field descriptor lacks a field of 4 reserved bits.
--- drivers/pinctrl/sh-pfc/pfc-r8a77970.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/sh-pfc/pfc-r8a77970.c +1 -1
@@ -2354,7 +2354,7 @@ static const struct pinmux_cfg_reg pinmux_config_regs[] = {#define F_ (x, y) x,#define FM (x) FN_##x, {PINMUX_CFG_REG_VAR ("MOD_SEL0" ,0xe6060500 ,32 , -4 ,4 ,4 ,4 , +4 ,4 ,4 ,4 ,4 , 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) {/* RESERVED 31, 30, 29, 28 */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 72/671 pinctrl: sh-pfc: sh73a0: Add missing TO pin to tpu4_to3 group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 124cde98f856b6206b804acbdec3b7c80f8c3427 ]
The tpu4_to3_mux[] array contains the TPU4TO3 pin mark, but the tpu4_to3_pins[] array lacks the corresponding pin number.
Add the missing pin number, for non-GPIO pin F26.
--- drivers/pinctrl/sh-pfc/pfc-sh73a0.c | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/sh-pfc/pfc-sh73a0.c +1 -0
@@ -3086,6 +3086,7 @@ static const unsigned int tpu4_to2_mux[] = { };static const unsigned int tpu4_to3_pins[] = {/* TO */ +PIN_NUMBER (6 ,26 ), };static const unsigned int tpu4_to3_mux[] = {TPU4TO3_MARK ,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 69/671 pinctrl: sh-pfc: r8a7740: Add missing LCD0 marks to lcd0_data24_1 group
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 96bb2a6ab4eca10e5b6490b3f0738e9f7ec22c2b ]
The lcd0_data24_1_pins[] array contains the LCD0 D1[2-5] pin numbers, but the lcd0_data24_1_mux[] array lacks the corresponding pin marks.
--- drivers/pinctrl/sh-pfc/pfc-r8a7740.c | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/sh-pfc/pfc-r8a7740.c +1 -0
@@ -2154,6 +2154,7 @@ static const unsigned int lcd0_data24_1_mux[] = {LCD0_D0_MARK ,LCD0_D1_MARK ,LCD0_D2_MARK ,LCD0_D3_MARK ,LCD0_D4_MARK ,LCD0_D5_MARK ,LCD0_D6_MARK ,LCD0_D7_MARK ,LCD0_D8_MARK ,LCD0_D9_MARK ,LCD0_D10_MARK ,LCD0_D11_MARK , +LCD0_D12_MARK ,LCD0_D13_MARK ,LCD0_D14_MARK ,LCD0_D15_MARK ,LCD0_D16_MARK ,LCD0_D17_MARK ,LCD0_D18_PORT163_MARK ,LCD0_D19_PORT162_MARK ,LCD0_D20_PORT161_MARK ,LCD0_D21_PORT158_MARK , LCD0_D22_PORT160_MARK, LCD0_D23_PORT159_MARK,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 63/671 mailbox: ti-msgmgr: Off by one in ti_msgmgr_of_xlate()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 78f3ff524fca63e7d2a57149a34ade23d2c12798 ]
The > comparison should be >= or we access one element beyond the end of the array.
(The inst->qinsts[] array is allocated in the ti_msgmgr_probe() function and it has ->num_valid_queues elements.)
--- drivers/mailbox/ti-msgmgr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mailbox/ti-msgmgr.c +1 -1
@@ -547,7 +547,7 @@ static struct mbox_chan *ti_msgmgr_of_xlate(struct mbox_controller *mbox, }if (d->is_sproxy) { -if (req_pid > d->num_valid_queues) +if (req_pid >= d->num_valid_queues) goto err; qinst = &inst->qinsts[req_pid];return qinst->chan;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 61/671 OPP: Fix missing debugfs supply directory for OPPs
In reply to Sasha LevinFrom: Viresh Kumar <[email protected]>
[ Upstream commit 46f48aca2e5aef3f430e95d1a5fb68227ec8ec85 ]
There is one case where we may end up with no "supply" directory for the OPPs in debugfs. That happens when the OPP core isn't managing the regulators for the device and the device's OPP do have microvolt property. It happens because the opp_table->regulator_count remains set to 0 and the debugfs routines don't add any supply directory in such a case.
This commit fixes that by setting opp_table->regulator_count to 1 in that particular case. But to make everything work nicely and not break other parts of the core, regulator_count is defined as "int" now instead of "unsigned int" and it can have different special values now. It is set to -1 initially to mark it "uninitialized" and later only we set it to 0 or positive values after checking how many supplies are there.
This also helps in finding the bugs where only few of the OPPs have the "opp-microvolt" property set and not all.
--- drivers/opp/core.c | 12 +++++++++--- drivers/opp/of.c | 20 ++++++++++++++++---- drivers/opp/opp.h | 6 ++++-- 3 files changed, 29 insertions(+), 9 deletions(-)
drivers/opp/core.c +9 -3
@@ -793,6 +793,9 @@ static struct opp_table *_allocate_opp_table(struct device *dev)INIT_LIST_HEAD (&opp_table->dev_list); +/* Mark regulator count uninitialized */ + opp_table->regulator_count =-1 ; + opp_dev =_add_opp_dev (dev, opp_table);if (!opp_dev) {kfree (opp_table);
@@ -955,7 +958,7 @@ struct dev_pm_opp *_opp_allocate(struct opp_table *table)int count, supply_size;/* Allocate space for at least one supply */ - count = table->regulator_count ? table->regulator_count :1 ; + count = table->regulator_count >0 ? table->regulator_count :1 ; supply_size =sizeof (*opp->supplies) * count;/* allocate new OPP node and supplies structures */
@@ -1363,7 +1366,7 @@ struct opp_table *dev_pm_opp_set_regulators(struct device *dev,kfree (opp_table->regulators); opp_table->regulators =NULL ; - opp_table->regulator_count =0 ; + opp_table->regulator_count =-1 ; err:dev_pm_opp_put_opp_table (opp_table);
@@ -1392,7 +1395,7 @@ void dev_pm_opp_put_regulators(struct opp_table *opp_table)kfree (opp_table->regulators); opp_table->regulators =NULL ; - opp_table->regulator_count =0 ; + opp_table->regulator_count =-1 ; put_opp_table:dev_pm_opp_put_opp_table (opp_table);
@@ -1545,6 +1548,9 @@ int dev_pm_opp_add(struct device *dev, unsigned long freq, unsigned long u_volt)if (!opp_table)return -ENOMEM ; +/* Fix regulator count for dynamic OPPs */ + opp_table->regulator_count =1 ; + ret =_opp_add_v1 (opp_table, dev, freq, u_volt, true);dev_pm_opp_put_opp_table (opp_table);
drivers/opp/of.c +16 -4
@@ -113,12 +113,10 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, struct opp_table *opp_table) {u32 *microvolt, *microamp =NULL ; -int supplies, vcount, icount, ret, i, j; +int supplies = opp_table->regulator_count, vcount, icount, ret, i, j;struct property *prop =NULL ;char name[NAME_MAX ]; - supplies = opp_table->regulator_count ? opp_table->regulator_count :1 ; -/* Search for "opp-microvolt-<name>" */ if (opp_table->prop_name) { snprintf(name, sizeof(name), "opp-microvolt-%s",
@@ -133,7 +131,13 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,/* Missing property isn't a problem, but an invalid entry is */ if (!prop) { -if (!opp_table->regulator_count) +if (unlikely (supplies ==-1 )) { +/* Initialize regulator_count */ + opp_table->regulator_count =0 ; +return 0 ; + } + +if (!supplies)return 0 ; dev_err(dev, "%s: opp-microvolt missing although OPP managing regulators\n",
@@ -142,6 +146,14 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev, } } +if (unlikely (supplies ==-1 )) { +/* Initialize regulator_count */ + supplies = opp_table->regulator_count =1 ; + }else if (unlikely (!supplies)) { +dev_err (dev,"%s: opp-microvolt wasn't expected\n" , __func__); +return -EINVAL ; + } + vcount =of_property_count_u32_elems (opp->np, name);if (vcount <0 ) { dev_err(dev, "%s: Invalid %s property (%d)\n",
drivers/opp/opp.h +4 -2
@@ -136,7 +136,9 @@ enum opp_table_access {* @prop_name: A name to postfix to many DT properties, while parsing them. * @clk: Device's clock handle * @regulators: Supply regulators -* @regulator_count: Number of power supply regulators +* @regulator_count: Number of power supply regulators. Its value can be -1 +* (uninitialized), 0 (no opp-microvolt property) or > 0 (has opp-microvolt +* property). * @genpd_performance_state: Device's power domain support performance state. * @set_opp: Platform specific set_opp callback * @set_opp_data: Data to be passed to set_opp callback
@@ -172,7 +174,7 @@ struct opp_table {const char *prop_name;struct clk *clk;struct regulator **regulators; -unsigned int regulator_count; +int regulator_count;bool genpd_performance_state;int (*set_opp)(struct dev_pm_set_opp_data *data);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 58/671 arm64: dts: renesas: r8a7795-es1: Add missing power domains to IPMMU nodes
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 41e30b515a003a90e336b7a456c7c82d8c3aa6a7 ]
While commit 3b7e7848f0e88b36 ("arm64: dts: renesas: r8a7795: Add IPMMU device nodes") for R-Car H3 ES2.0 did include power-domains properties, they were forgotten in the counterpart for older R-Car H3 ES1.x SoCs.
--- arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/renesas/r8a7795-es1.dtsi +2 -0
@@ -28,6 +28,7 @@ compatible = "renesas,ipmmu-r8a7795"; reg = <0 0xec680000 0 0x1000>; renesas,ipmmu-main = <&ipmmu_mm 5>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; #iommu-cells = <1>; };
@@ -35,6 +36,7 @@ compatible = "renesas,ipmmu-r8a7795"; reg = <0 0xe7730000 0 0x1000>; renesas,ipmmu-main = <&ipmmu_mm 8>; + power-domains = <&sysc R8A7795_PD_ALWAYS_ON>; #iommu-cells = <1>; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 42/671 net: hns3: add error handler for hns3_nic_init_vector_data()
In reply to Sasha LevinFrom: Huazhong Tan <[email protected]>
[ Upstream commit ece4bf46e98c9f3775a488f3932a531508d3b1a2 ]
When hns3_nic_init_vector_data() fails to map ring to vector, it should cancel the netif_napi_add() that has been successfully done and then exits.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +8 -2
@@ -2642,7 +2642,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)struct hnae3_handle *h = priv->ae_handle;struct hns3_enet_tqp_vector *tqp_vector;int ret =0 ; -u16 i; +int i;for (i =0 ; i < priv->vector_num; i++) { tqp_vector = &priv->tqp_vector[i];
@@ -2687,13 +2687,19 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)hns3_free_vector_ring_chain (tqp_vector, &vector_ring_chain);if (ret) -return ret; + goto map_ring_fail;netif_napi_add (priv->netdev, &tqp_vector->napi, hns3_nic_common_poll,NAPI_POLL_WEIGHT ); }return 0 ; + +map_ring_fail: +while (i--) +netif_napi_del (&priv->tqp_vector[i].napi); + +return ret; }static int hns3_nic_alloc_vector_data (struct hns3_nic_priv *priv)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 48/671 pcrypt: use format specifier in kobject_add
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit b1e3874c75ab15288f573b3532e507c37e8e7656 ]
Passing string 'name' as the format specifier is potentially hazardous because name could (although very unlikely to) have a format specifier embedded in it causing issues when parsing the non-existent arguments to these. Follow best practice by using the "%s" format string for the string 'name'.
Cleans up clang warning:crypto/pcrypt.c:397:40: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
--- crypto/pcrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/pcrypt.c +1 -1
@@ -394,7 +394,7 @@ static int pcrypt_sysfs_add(struct padata_instance *pinst, const char *name)int ret; pinst->kobj.kset = pcrypt_kset; - ret =kobject_add (&pinst->kobj,NULL , name); + ret =kobject_add (&pinst->kobj,NULL ,"%s" , name);if (!ret)kobject_uevent (&pinst->kobj,KOBJ_ADD );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 43/671 mlxsw: reg: QEEC: Add minimum shaper fields
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit 8b931821aa04823e2e5df0ae93937baabbd23286 ]
Add QEEC.mise (minimum shaper enable) and QEEC.min_shaper_rate to enable configuration of minimum shaper.
Increase the QEEC length to 0x20 as well: that's the length that the register has had for a long time now, but with the configurations that mlxsw typically exercises, the firmware tolerated 0x1C-sized packets. With mise=true however, FW rejects packets unless they have the full required length.
--- drivers/net/ethernet/mellanox/mlxsw/reg.h | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlxsw/reg.h +21 -1
@@ -3215,7 +3215,7 @@ static inline void mlxsw_reg_qtct_pack(char *payload, u8 local_port,* Configures the ETS elements. */ #define MLXSW_REG_QEEC_ID 0x400D -#define MLXSW_REG_QEEC_LEN 0x1C +#define MLXSW_REG_QEEC_LEN 0x20MLXSW_REG_DEFINE (qeec,MLXSW_REG_QEEC_ID ,MLXSW_REG_QEEC_LEN );
@@ -3257,6 +3257,15 @@ MLXSW_ITEM32(reg, qeec, element_index, 0x04, 0, 8);*/ MLXSW_ITEM32 (reg, qeec, next_element_index,0x08 ,0 ,8 ); +/* reg_qeec_mise +* Min shaper configuration enable. Enables configuration of the min +* shaper on this ETS element +* 0 - Disable +* 1 - Enable +* Access: RW +*/ +MLXSW_ITEM32 (reg, qeec, mise,0x0C ,31 ,1 ); +enum {MLXSW_REG_QEEC_BYTES_MODE ,MLXSW_REG_QEEC_PACKETS_MODE ,
@@ -3273,6 +3282,17 @@ enum {*/ MLXSW_ITEM32 (reg, qeec, pb,0x0C ,28 ,1 ); +/* The smallest permitted min shaper rate. */ +#define MLXSW_REG_QEEC_MIS_MIN 200000/* Kbps */ + +/* reg_qeec_min_shaper_rate +* Min shaper information rate. +* For CPU port, can only be configured for port hierarchy. +* When in bytes mode, value is specified in units of 1000bps. +* Access: RW +*/ +MLXSW_ITEM32 (reg, qeec, min_shaper_rate,0x0C ,0 ,28 ); +/* reg_qeec_mase * Max shaper configuration enable. Enables configuration of the max * shaper on this ETS element.
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 25/671 regulator: fixed: Default enable high on DT regulators
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit 28be5f15df2ee6882b0a122693159c96a28203c7 ]
commit efdfeb079cc3
("regulator: fixed: Convert to use GPIO descriptor only") switched to use gpiod_get() to look up the regulator from the gpiolib core whether that is device tree or boardfile.
This meant that we activate the code ina603a2b8d86e ("gpio: of: Add special quirk to parse regulator flags") which means the descriptors coming from the device tree already have the right inversion and open drain semantics set up from the gpiolib core.
As the fixed regulator was inspected again we got the inverted inversion and things broke.
Fix it by ignoring the config in the device tree for now: the later patches in the series will push all inversion handling over to the gpiolib core and set it up properly in the boardfiles for legacy devices, but I did not finish that for this kernel cycle.
--- drivers/regulator/fixed.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/regulator/fixed.c +8 -3
@@ -84,9 +84,14 @@ of_get_fixed_voltage_config(struct device *dev,of_property_read_u32 (np,"startup-delay-us" , &config->startup_delay); - config->enable_high =of_property_read_bool (np,"enable-active-high" ); - config->gpio_is_open_drain =of_property_read_bool (np, -"gpio-open-drain" ); +/* +* FIXME: we pulled active low/high and open drain handling into +* gpiolib so it will be handled there. Delete this in the second +* step when we also remove the custom inversion handling for all +* legacy boardfiles. +*/ + config->enable_high =1 ; + config->gpio_is_open_drain =0 ;if (of_find_property (np,"vin-supply" ,NULL )) config->input_supply ="vin" ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 39/671 tipc: eliminate message disordering during binding table update
In reply to Sasha LevinFrom: Jon Maloy <[email protected]>
[ Upstream commit 988f3f1603d4650409db5334355cbf7b13ef50c3 ]
We have seen the following race scenario:
1) named_distribute() builds a "bulk" message, containing a PUBLISH item for a certain publication. This is based on the contents of the binding tables's 'cluster_scope' list.
2) tipc_named_withdraw() removes the same publication from the list, bulds a WITHDRAW message and distributes it to all cluster nodes.
3) tipc_named_node_up(), which was calling named_distribute(), sends out the bulk message built under 1)
4) The WITHDRAW message arrives at the just detected node, finds no corresponding publication, and is dropped.
5) The PUBLISH item arrives at the same node, is added to its binding table, and remains there forever.
This arrival disordering was earlier taken care of by the backlog queue, originally added for a different purpose, which was removed in the commit referred to below, but we now need a different solution. In this commit, we replace the rcu lock protecting the 'cluster_scope' list with a regular RW lock which comprises even the sending of the bulk message. This both guarantees both the list integrity and the message sending order. We will later add a commit which cleans up this code further.
Note that this commit needs recently added commit d3092b2efca1 ("tipc:
fix unsafe rcu locking when accessing publication list") to apply cleanly.
--- net/tipc/name_distr.c | 18 ++++++++++-------- net/tipc/name_table.c | 1 + net/tipc/name_table.h | 1 + 3 files changed, 12 insertions(+), 8 deletions(-)
net/tipc/name_distr.c +10 -8
@@ -94,8 +94,9 @@ struct sk_buff *tipc_named_publish(struct net *net, struct publication *publ)list_add_tail_rcu (&publ->binding_node, &nt->node_scope);return NULL ; } -list_add_tail_rcu (&publ->binding_node, &nt->cluster_scope); - +write_lock_bh (&nt->cluster_scope_lock); +list_add_tail (&publ->binding_node, &nt->cluster_scope); +write_unlock_bh (&nt->cluster_scope_lock); skb =named_prepare_buf (net,PUBLICATION ,ITEM_SIZE ,0 );if (!skb) {pr_warn ("Publication distribution failure\n" );
@@ -112,11 +113,13 @@ struct sk_buff *tipc_named_publish(struct net *net, struct publication *publ)*/ struct sk_buff *tipc_named_withdraw (struct net *net,struct publication *publ) { +struct name_table *nt =tipc_name_table (net);struct sk_buff *buf;struct distr_item *item; -list_del_rcu (&publ->binding_node); - +write_lock_bh (&nt->cluster_scope_lock); +list_del (&publ->binding_node); +write_unlock_bh (&nt->cluster_scope_lock);if (publ->scope ==TIPC_NODE_SCOPE )return NULL ;
@@ -147,7 +150,7 @@ static void named_distribute(struct net *net, struct sk_buff_head *list, ITEM_SIZE) * ITEM_SIZE;u32 msg_rem = msg_dsz; -list_for_each_entry_rcu (publ, pls, binding_node) { +list_for_each_entry (publ, pls, binding_node) {/* Prepare next buffer: */ if (!skb) { skb = named_prepare_buf(net, PUBLICATION, msg_rem,
@@ -189,11 +192,10 @@ void tipc_named_node_up(struct net *net, u32 dnode)__skb_queue_head_init (&head); -rcu_read_lock (); +read_lock_bh (&nt->cluster_scope_lock);named_distribute (net, &head, dnode, &nt->cluster_scope); -rcu_read_unlock (); -tipc_node_xmit (net, &head, dnode,0 ); +read_unlock_bh (&nt->cluster_scope_lock); }/**
net/tipc/name_table.c +1 -0
@@ -744,6 +744,7 @@ int tipc_nametbl_init(struct net *net)INIT_LIST_HEAD (&nt->node_scope);INIT_LIST_HEAD (&nt->cluster_scope); +rwlock_init (&nt->cluster_scope_lock); tn->nametbl = nt;spin_lock_init (&tn->nametbl_lock);return 0 ;
net/tipc/name_table.h +1 -0
@@ -100,6 +100,7 @@ struct name_table {struct hlist_head services[TIPC_NAMETBL_SIZE ];struct list_head node_scope;struct list_head cluster_scope; +rwlock_t cluster_scope_lock;u32 local_publ_count; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 36/671 RDMA/bnxt_re: Add missing spin lock initialization
In reply to Sasha LevinFrom: Selvin Xavier <[email protected]>
[ Upstream commit 5a23e0b1dd51fe0efae666b03fdb15e1301f437a ]
Add the missing initalization of the cq_lock and qplib.flush_lock.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 1 + drivers/infiniband/hw/bnxt_re/qplib_fp.c | 1 + 2 files changed, 2 insertions(+)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +1 -0
@@ -2664,6 +2664,7 @@ struct ib_cq *bnxt_re_create_cq(struct ib_device *ibdev, nq->budget++;atomic_inc (&rdev->cq_count); +spin_lock_init (&cq->cq_lock);if (context) {struct bnxt_re_cq_resp resp;
drivers/infiniband/hw/bnxt_re/qplib_fp.c +1 -0
@@ -1970,6 +1970,7 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)INIT_LIST_HEAD (&cq->sqf_head);INIT_LIST_HEAD (&cq->rqf_head);spin_lock_init (&cq->compl_lock); +spin_lock_init (&cq->flush_lock);bnxt_qplib_arm_cq_enable (cq);return 0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 37/671 netfilter: nf_flow_table: do not remove offload when other netns's interface is down
In reply to Sasha LevinFrom: Taehee Yoo <[email protected]>
[ Upstream commit a3fb3698cadf27dc142b24394c401625e14d80d0 ]
When interface is down, offload cleanup function(nf_flow_table_do_cleanup) is called and that checks whether interface index of offload and index of link down interface is same. but only interface index checking is not enough because flowtable is not pernet list.
So that, if other netns's interface that has index is same with offload is down, that offload will be removed.
This patch adds netns checking code to the offload cleanup routine.
--- net/netfilter/nf_flow_table_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
net/netfilter/nf_flow_table_core.c +6 -3
@@ -491,14 +491,17 @@ EXPORT_SYMBOL_GPL(nf_flow_table_init);static void nf_flow_table_do_cleanup (struct flow_offload *flow,void *data) {struct net_device *dev = data; +struct flow_offload_entry *e; + + e = container_of(flow, struct flow_offload_entry, flow);if (!dev) {flow_offload_teardown (flow);return ; } - -if (flow->tuplehash[0 ].tuple.iifidx == dev->ifindex || - flow->tuplehash[1 ].tuple.iifidx == dev->ifindex) +if (net_eq (nf_ct_net (e->ct),dev_net (dev)) && + (flow->tuplehash[0 ].tuple.iifidx == dev->ifindex || + flow->tuplehash[1 ].tuple.iifidx == dev->ifindex))flow_offload_dead (flow); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 35/671 rtlwifi: rtl8821ae: replace _rtl8821ae_mrate_idx_to_arfr_id with generic version
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit c894696188d5c2af1e636e458190e80c53fb893d ]
Function _rtl8821ae_mrate_idx_to_arfr_id is functionally identical to the generic version rtl_mrate_idx_to_arfr_id, so remove _rtl8821ae_mrate_idx_to_arfr_id and use the generic one instead.
This also fixes a missing break statement found by CoverityScan in _rtl8821ae_mrate_idx_to_arfr_id, namely: CID#1167237 ("Missing break in switch")
Thanks to Joe Perches for spotting this when I submitted an earlier patch.
--- .../wireless/realtek/rtlwifi/rtl8821ae/hw.c | 71 +------------------ 1 file changed, 1 insertion(+), 70 deletions(-)
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c +1 -70
@@ -3404,75 +3404,6 @@ static void rtl8821ae_update_hal_rate_table(struct ieee80211_hw *hw, "%x\n", rtl_read_dword(rtlpriv, REG_ARFR0)); } -static u8 _rtl8821ae_mrate_idx_to_arfr_id ( -struct ieee80211_hw *hw,u8 rate_index, -enum wireless_mode wirelessmode) -{ -struct rtl_priv *rtlpriv =rtl_priv (hw); -struct rtl_phy *rtlphy = &rtlpriv->phy; -u8 ret =0 ; -switch (rate_index) { -case RATR_INX_WIRELESS_NGB : -if (rtlphy->rf_type ==RF_1T1R ) - ret =1 ; -else - ret =0 ; - ;break ; -case RATR_INX_WIRELESS_N : -case RATR_INX_WIRELESS_NG : -if (rtlphy->rf_type ==RF_1T1R ) - ret =5 ; -else - ret =4 ; - ;break ; -case RATR_INX_WIRELESS_NB : -if (rtlphy->rf_type ==RF_1T1R ) - ret =3 ; -else - ret =2 ; - ;break ; -case RATR_INX_WIRELESS_GB : - ret =6 ; -break ; -case RATR_INX_WIRELESS_G : - ret =7 ; -break ; -case RATR_INX_WIRELESS_B : - ret =8 ; -break ; -case RATR_INX_WIRELESS_MC : -if ((wirelessmode ==WIRELESS_MODE_B ) - || (wirelessmode ==WIRELESS_MODE_G ) - || (wirelessmode ==WIRELESS_MODE_N_24G ) - || (wirelessmode ==WIRELESS_MODE_AC_24G )) - ret =6 ; -else - ret =7 ; -case RATR_INX_WIRELESS_AC_5N : -if (rtlphy->rf_type ==RF_1T1R ) - ret =10 ; -else - ret =9 ; -break ; -case RATR_INX_WIRELESS_AC_24N : -if (rtlphy->current_chan_bw ==HT_CHANNEL_WIDTH_80 ) { -if (rtlphy->rf_type ==RF_1T1R ) - ret =10 ; -else - ret =9 ; - }else { -if (rtlphy->rf_type ==RF_1T1R ) - ret =11 ; -else - ret =12 ; - } -break ; -default : - ret =0 ;break ; - } -return ret; -} -static u32 _rtl8821ae_rate_to_bitmap_2ssvht (__le16 vht_rate) {u8 i, j, tmp_rate;
@@ -3761,7 +3692,7 @@ static void rtl8821ae_update_hal_rate_mask(struct ieee80211_hw *hw,break ; } - ratr_index =_rtl8821ae_mrate_idx_to_arfr_id (hw, ratr_index, wirelessmode); + ratr_index =rtl_mrate_idx_to_arfr_id (hw, ratr_index, wirelessmode); sta_entry->ratr_index = ratr_index; ratr_bitmap =_rtl8821ae_set_ra_vht_ratr_bitmap (hw, wirelessmode, ratr_bitmap);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 32/671 netfilter: nft_osf: usage from output path is not valid
In reply to Sasha LevinFrom: Fernando Fernandez Mancera <[email protected]>
[ Upstream commit 4a3e71b7b7dbaf3562be9d508260935aa13cb48b ]
The nft_osf extension, like xt_osf, is not supported from the output path.
--- net/netfilter/nft_osf.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
net/netfilter/nft_osf.c +10 -0
@@ -69,6 +69,15 @@ static int nft_osf_dump(struct sk_buff *skb, const struct nft_expr *expr)return -1 ; } +static int nft_osf_validate (const struct nft_ctx *ctx, +const struct nft_expr *expr, +const struct nft_data **data) +{ +return nft_chain_validate_hooks (ctx->chain, (1 <<NF_INET_LOCAL_IN ) | + (1 <<NF_INET_PRE_ROUTING ) | + (1 <<NF_INET_FORWARD )); +} +static struct nft_expr_type nft_osf_type;static const struct nft_expr_ops nft_osf_op = { .eval = nft_osf_eval,
@@ -76,6 +85,7 @@ static const struct nft_expr_ops nft_osf_op = { .init = nft_osf_init, .dump = nft_osf_dump, .type = &nft_osf_type, + .validate = nft_osf_validate, };static struct nft_expr_type nft_osf_type__read_mostly = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 26/671 mei: replace POLL* with EPOLL* for write queues.
In reply to Sasha LevinFrom: Tomas Winkler <[email protected]>
[ Upstream commit 03b2cbb6ea3c73e08fcf72d9ef8e286c4dcbd1fe ]
Looks like during merging the bulk POLL* -> EPOLL* replacement missed the patch
'commit af336cabe083 ("mei: limit the number of queued writes")'
Fix sparse warning:drivers/misc/mei/main.c:602:13: warning: restricted __poll_t degrades to integer drivers/misc/mei/main.c:605:30: warning: invalid assignment: |=drivers/misc/mei/main.c:605:30: left side has type restricted __poll_tdrivers/misc/mei/main.c:605:30: right side has type int
--- drivers/misc/mei/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/misc/mei/main.c +2 -2
@@ -599,10 +599,10 @@ static __poll_t mei_poll(struct file *file, poll_table *wait)mei_cl_read_start (cl,mei_cl_mtu (cl), file); } -if (req_events & (POLLOUT |POLLWRNORM )) { +if (req_events & (EPOLLOUT |EPOLLWRNORM )) {poll_wait (file, &cl->tx_wait, wait);if (cl->tx_cb_queued < dev->tx_queue_limit) - mask |=POLLOUT |POLLWRNORM ; + mask |=EPOLLOUT |EPOLLWRNORM ; } out:
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 22/671 usb: dwc3: add EXTCON dependency for qcom
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 3def4031b3e3fbb524cbd01555b057a6cef0d5e6 ]
Like the omap back-end, we get a link error with CONFIG_EXTCON=m when building the qcom back-end into the kernel:
drivers/usb/dwc3/dwc3-qcom.o: In function `dwc3_qcom_probe':
dwc3-qcom.c:(.text+0x13dc): undefined reference to extcon_get_edev_by_phandle' dwc3-qcom.c:(.text+0x1b18): undefined reference to devm_extcon_register_notifier' dwc3-qcom.c:(.text+0x1b9c): undefined reference to `extcon_get_state'
Do the same thing as OMAP and add an explicit dependency on EXTCON.
--- drivers/usb/dwc3/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/Kconfig +1 -1
@@ -113,7 +113,7 @@ config USB_DWC3_ST config USB_DWC3_QCOM tristate "Qualcomm Platform" - depends on ARCH_QCOM || COMPILE_TEST + depends on EXTCON && (ARCH_QCOM || COMPILE_TEST) depends on OF default USB_DWC3 help
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/671 iio: fix position relative kernel version
In reply to Sasha LevinFrom: Eugen Hristev <[email protected]>
[ Upstream commit 21eab7861688aa4c69fcb88440cc0c4a422bdcd6 ]
Position relative channel type was added in 4.19 kernel version
--- Documentation/ABI/testing/sysfs-bus-iio | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-bus-iio +1 -1
@@ -199,7 +199,7 @@ Description: What: /sys/bus/iio/devices/iio:deviceX/in_positionrelative_x_raw What: /sys/bus/iio/devices/iio:deviceX/in_positionrelative_y_raw -KernelVersion: 4.18 +KernelVersion: 4.19 Contact: [email protected] Description: Relative position in direction x or y on a pad (may be
Signature · 1 line
2.20.1
Re: [PATCH AUTOSEL 4.19 104/671] ARM: dts: r8a7743: Fix sorting of rwdt node
In reply to Sasha LevinHello!
Quoted 9 lines · Sasha Levin
From: Biju Das <[email protected]>
[ Upstream commit
383f6024981d32425fa453bf2e66b546fdbc1314]Watchdog node is incorrectly placed on r8a7743 SoC dtsi. This patch fixes the sorting order.
Fixes b5beb5d4c81c358f50a8310108 ("ARM: dts: r8a7743: Add watchdog support to SoC dtsi")
Quoted 7 lines
Signed-off-by Biju Das <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Simon Horman <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- arch/arm/boot/dts/r8a7743.dtsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
I doubt that the DT node reordering is worth merging into the -stable
kernels...
MBR, Sergei
Sasha Levin
maintainerRe: [PATCH AUTOSEL 4.19 104/671] ARM: dts: r8a7743: Fix sorting of rwdt node
Quoted 21 lines · Sergei Shtylyov
Hello!
Quoted 9 lines · Sasha Levin
From: Biju Das <[email protected]>
[ Upstream commit
383f6024981d32425fa453bf2e66b546fdbc1314]Watchdog node is incorrectly placed on r8a7743 SoC dtsi. This patch fixes the sorting order.
Fixes b5beb5d4c81c358f50a8310108 ("ARM: dts: r8a7743: Add watchdog support to SoC dtsi")Quoted 7 lines
Signed-off-by Biju Das <[email protected]>Reviewed-by Geert Uytterhoeven <[email protected]>Signed-off-by Simon Horman <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- arch/arm/boot/dts/r8a7743.dtsi | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
Quoted 2 lines
I doubt that the DT node reordering is worth merging into the
-stable kernels...
You're right, I'll drop it. Thanks!
Signature · 2 lines
Thanks, Sasha