5.4.40-rc1 review
Greg Kroah-Hartman
maintainercover 5.4.40-rc1 review
This is the start of the stable review cycle for the 5.4.40 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 10 May 2020 12:29:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.40-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.40-rc1
Marek Szyprowski <[email protected]>
PM / devfreq: Add missing locking while setting suspend_freq
Willem de Bruijn <[email protected]>
udp: document udp_rcv_segment special case for looped packets
Arnaldo Carvalho de Melo <[email protected]>
tools headers UAPI: Sync copy of arm64's asm/unistd.h with the kernel sources
Zhan Liu <[email protected]>
Revert "drm/amd/display: setting the DIG_MODE to the correct value."
Will Deacon <[email protected]>
mm/mremap: Add comment explaining the untagging behaviour of mremap()
Thadeu Lima de Souza Cascardo <[email protected]>
libbpf: Fix readelf output parsing for Fedora
Jiri Slaby <[email protected]>
cgroup, netclassid: remove double cond_resched
Thomas Pedersen <[email protected]>
mac80211: add ieee80211_is_any_nullfunc()
Rafael J. Wysocki <[email protected]>
ACPI: PM: s2idle: Fix comment in acpi_s2idle_prepare_late()
Hans de Goede <[email protected]>
platform/x86: GPD pocket fan: Fix error message when temp-limits are out of range
Christoph Hellwig <[email protected]>
dma-direct: exclude dma_direct_map_resource from the min_low_pfn check
Qian Cai <[email protected]>
x86/kvm: fix a missing-prototypes "vmread_error"
Takashi Iwai <[email protected]>
ALSA: hda: Match both PCI ID and SSID for driver blacklist
Nick Desaulniers <[email protected]>
hexagon: define ioremap_uc
Christoph Hellwig <[email protected]>
hexagon: clean up ioremap
Tuowen Zhao <[email protected]>
mfd: intel-lpss: Use devm_ioremap_uc for MMIO
Tuowen Zhao <[email protected]>
lib: devres: add a helper function for ioremap_uc
Brendan Higgins <[email protected]>
Revert "software node: Simplify software_node_release() function"
Aaron Ma <[email protected]>
drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
Jere Leppänen <[email protected]>
sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
Matt Roper <[email protected]>
drm/i915: Extend WaDisableDARBFClkGating to icl,ehl,tgl
Doug Berger <[email protected]>
net: systemport: suppress warnings on failed Rx SKB allocations
Doug Berger <[email protected]>
net: bcmgenet: suppress warnings on failed Rx SKB allocations
Madhuparna Bhowmik <[email protected]>
mac80211: sta_info: Add lockdep condition for RCU list usage
Nathan Chancellor <[email protected]>
lib/mpi: Fix building for powerpc with clang
Vamshi K Sthambamkadi <[email protected]>
tracing: Fix memory leaks in trace_events_hist.c
Paulo Alcantara <[email protected]>
cifs: do not share tcons with DFS
Jeremie Francois (on alpha) <[email protected]>
scripts/config: allow colons in option strings for sed
Ronnie Sahlberg <[email protected]>
cifs: protect updating server->dstaddr with a spinlock
Matthias Blankertz <[email protected]>
ASoC: rsnd: Fix "status check failed" spam for multi-SSI
Matthias Blankertz <[email protected]>
ASoC: rsnd: Don't treat master SSI in multi SSI setup as parent
Julien Beraud <[email protected]>
net: stmmac: Fix sub-second increment
Julien Beraud <[email protected]>
net: stmmac: fix enabling socfpga's ptp_ref_clock
Xiyu Yang <[email protected]>
wimax/i2400m: Fix potential urb refcnt leak
Sandeep Raghuraman <[email protected]>
drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii)
Alex Elder <[email protected]>
remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe()
Amadeusz Sławiński <[email protected]>
ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
Matthias Blankertz <[email protected]>
ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode
Matthias Blankertz <[email protected]>
ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode
Thinh Nguyen <[email protected]>
usb: dwc3: gadget: Properly set maxpacket limit
Amadeusz Sławiński <[email protected]>
ASoC: topology: Fix endianness issue
Sebastian Reichel <[email protected]>
ASoC: sgtl5000: Fix VAG power-on handling
Tyler Hicks <[email protected]>
selftests/ipc: Fix test failure seen after initial test run
Amadeusz Sławiński <[email protected]>
ASoC: topology: Check return value of soc_tplg_dai_config
Amadeusz Sławiński <[email protected]>
ASoC: topology: Check return value of pcm_new_ver
Amadeusz Sławiński <[email protected]>
ASoC: topology: Check soc_tplg_add_route return value
Amadeusz Sławiński <[email protected]>
ASoC: topology: Check return value of soc_tplg_*_create
Amadeusz Sławiński <[email protected]>
ASoC: topology: Check return value of soc_tplg_create_tlv
Marek Szyprowski <[email protected]>
drm/bridge: analogix_dp: Split bind() into probe() and real bind()
Jia He <[email protected]>
vhost: vsock: kick send_pkt worker once device is started
-------------
Diffstat:
Makefile | 4 +- arch/hexagon/include/asm/io.h | 12 ++--- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- arch/x86/kernel/amd_gart_64.c | 4 +- arch/x86/kvm/vmx/ops.h | 1 + drivers/acpi/sleep.c | 5 +- drivers/base/swnode.c | 14 +++--- drivers/devfreq/devfreq.c | 4 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 +- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 9 ---- .../gpu/drm/amd/powerplay/hwmgr/processpptables.c | 26 +++++++++++ drivers/gpu/drm/bridge/analogix/analogix_dp_core.c | 33 +++++++++----- drivers/gpu/drm/exynos/exynos_dp.c | 29 +++++++----- drivers/gpu/drm/i915/display/intel_display.c | 7 ++- drivers/gpu/drm/rockchip/analogix_dp-rockchip.c | 36 ++++++++------- drivers/mfd/intel-lpss.c | 2 +- drivers/net/ethernet/broadcom/bcmsysport.c | 3 +- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 +- .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 9 ++-- .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 12 +++-- drivers/net/wimax/i2400m/usb-fw.c | 1 + drivers/platform/x86/gpd-pocket-fan.c | 2 +- drivers/remoteproc/qcom_q6v5_mss.c | 2 +- drivers/usb/dwc3/core.h | 4 ++ drivers/usb/dwc3/gadget.c | 52 ++++++++++++++++----- drivers/vhost/vsock.c | 5 ++ drivers/xen/swiotlb-xen.c | 4 +- fs/cifs/connect.c | 6 +++ include/drm/bridge/analogix_dp.h | 5 +- include/linux/dma-direct.h | 5 +- include/linux/ieee80211.h | 9 ++++ include/linux/io.h | 2 + include/net/udp.h | 7 +++ kernel/dma/direct.c | 4 +- kernel/dma/swiotlb.c | 2 +- kernel/trace/trace_events_hist.c | 7 +++ lib/devres.c | 19 ++++++++ lib/mpi/longlong.h | 34 +++++++------- mm/mremap.c | 10 ++++ net/core/netclassid_cgroup.c | 4 +- net/mac80211/mlme.c | 2 +- net/mac80211/rx.c | 8 ++-- net/mac80211/sta_info.c | 3 +- net/mac80211/status.c | 5 +- net/mac80211/tx.c | 2 +- net/sctp/sm_make_chunk.c | 6 ++- scripts/config | 5 +- sound/pci/hda/hda_intel.c | 9 ++-- sound/soc/codecs/hdac_hdmi.c | 6 +-- sound/soc/codecs/sgtl5000.c | 34 ++++++++++++++ sound/soc/codecs/sgtl5000.h | 1 + sound/soc/sh/rcar/ssi.c | 11 ++++- sound/soc/sh/rcar/ssiu.c | 2 +- sound/soc/soc-topology.c | 53 ++++++++++++++++------ tools/arch/arm64/include/uapi/asm/unistd.h | 1 + tools/lib/bpf/Makefile | 2 + tools/testing/selftests/ipc/msgque.c | 2 +- 58 files changed, 390 insertions(+), 166 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/50 vhost: vsock: kick send_pkt worker once device is started
From: Jia He <[email protected]>
commit 0b841030625cde5f784dd62aec72d6a766faae70 upstream.
Ning Bo reported an abnormal 2-second gap when booting Kata container [1]. The unconditional timeout was caused by VSOCK_DEFAULT_CONNECT_TIMEOUT of connecting from the client side. The vhost vsock client tries to connect an initializing virtio vsock server.
The abnormal flow looks like:
host-userspace vhost vsock guest vsock
============== =========== ============
connect() --------> vhost_transport_send_pkt_work() initializing
| vq->private_data==NULL
| will not be queued
V
schedule_timeout(2s)
vhost_vsock_start() <--------- device ready
set vq->private_datawait for 2s and failedconnect() again vq->private_data!=NULL recv connecting pkt
Details:
1. Host userspace sends a connect pkt, at that time, guest vsock is under initializing, hence the vhost_vsock_start has not been called. So vq->private_data==NULL, and the pkt is not been queued to send to guest
2. Then it sleeps for 2s
3. After guest vsock finishes initializing, vq->private_data is set
4. When host userspace wakes up after 2s, send connecting pkt again, everything is fine.
As suggested by Stefano Garzarella, this fixes it by additional kicking the send_pkt worker in vhost_vsock_start once the virtio device is started. This makes the pending pkt sent again.
After this patch, kata-runtime (with vsock enabled) boot time is reduced from 3s to 1s on a ThunderX2 arm64 server.
[1] https://github.com/kata-containers/runtime/issues/1917
--- drivers/vhost/vsock.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/vhost/vsock.c +5 -0
@@ -500,6 +500,11 @@ static int vhost_vsock_start(struct vhosmutex_unlock (&vq->mutex); } +/* Some packets may have been queued before the device was started, +* let's kick the send worker to send them. +*/ +vhost_work_queue (&vsock->dev, &vsock->send_pkt_work); +mutex_unlock (&vsock->dev.mutex);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 2/50 drm/bridge: analogix_dp: Split bind() into probe() and real bind()
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
[ Upstream commit 83a196773b8bc6702f49df1eddc848180e350340 ]
Analogix_dp driver acquires all its resources in the ->bind() callback, what is a bit against the component driver based approach, where the driver initialization is split into a probe(), where all resources are gathered, and a bind(), where all objects are created and a compound driver is initialized.
Extract all the resource related operations to analogix_dp_probe() and analogix_dp_remove(), then call them before/after registration of the device components from the main Exynos DP and Rockchip DP drivers. Also move the plat_data initialization to the probe() to make it available for the analogix_dp_probe() function.
This fixes the multiple calls to the bind() of the DRM compound driver when the DP PHY driver is not yet loaded/probed:
[drm] Exynos DRM: using 14400000.fimd device for DMA mapping operations
exynos-drm exynos-drm: bound 14400000.fimd (ops fimd_component_ops [exynosdrm]) exynos-drm exynos-drm: bound 14450000.mixer (ops mixer_component_ops [exynosdrm]) exynos-dp 145b0000.dp-controller: no DP phy configured
exynos-drm exynos-drm: failed to bind 145b0000.dp-controller (ops exynos_dp_ops [exynosdrm]): -517 exynos-drm exynos-drm: master bind failed: -517
...
[drm] Exynos DRM: using 14400000.fimd device for DMA mapping operations
exynos-drm exynos-drm: bound 14400000.fimd (ops hdmi_enable [exynosdrm]) exynos-drm exynos-drm: bound 14450000.mixer (ops hdmi_enable [exynosdrm]) exynos-drm exynos-drm: bound 145b0000.dp-controller (ops hdmi_enable [exynosdrm]) exynos-drm exynos-drm: bound 14530000.hdmi (ops hdmi_enable [exynosdrm])
[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
Console: switching to colour frame buffer device 170x48
exynos-drm exynos-drm: fb0: exynosdrmfb frame buffer device
[drm] Initialized exynos 1.1.0 20180330 for exynos-drm on minor 1
...
--- .../drm/bridge/analogix/analogix_dp_core.c | 33 +++++++++++------ drivers/gpu/drm/exynos/exynos_dp.c | 29 ++++++++------- .../gpu/drm/rockchip/analogix_dp-rockchip.c | 36 ++++++++++--------- include/drm/bridge/analogix_dp.h | 5 +-- 4 files changed, 61 insertions(+), 42 deletions(-)
drivers/gpu/drm/bridge/analogix/analogix_dp_core.c +22 -11
@@ -1635,8 +1635,7 @@ static ssize_t analogix_dpaux_transfer(struct drm_dp_aux *aux, }struct analogix_dp_device * -analogix_dp_bind (struct device *dev,struct drm_device *drm_dev, -struct analogix_dp_plat_data *plat_data) +analogix_dp_probe (struct device *dev,struct analogix_dp_plat_data *plat_data) {struct platform_device *pdev =to_platform_device (dev);struct analogix_dp_device *dp;
@@ -1739,22 +1738,30 @@ analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, irq_flags, "analogix-dp", dp);if (ret) {dev_err (&pdev->dev,"failed to request irq\n" ); - goto err_disable_pm_runtime; +return ERR_PTR (ret); }disable_irq (dp->irq); +return dp; +} +EXPORT_SYMBOL_GPL (analogix_dp_probe); + +int analogix_dp_bind (struct analogix_dp_device *dp,struct drm_device *drm_dev) +{ +int ret; + dp->drm_dev = drm_dev; dp->encoder = dp->plat_data->encoder; dp->aux.name ="DP-AUX" ; dp->aux.transfer = analogix_dpaux_transfer; - dp->aux.dev = &pdev->dev; + dp->aux.dev = dp->dev; ret =drm_dp_aux_register (&dp->aux);if (ret) -return ERR_PTR (ret); +return ret; -pm_runtime_enable (dev); +pm_runtime_enable (dp->dev); ret =analogix_dp_create_bridge (drm_dev, dp);if (ret) {
@@ -1762,13 +1769,12 @@ analogix_dp_bind(struct device *dev, struct drm_device *drm_dev, goto err_disable_pm_runtime; } -return dp; +return 0 ; err_disable_pm_runtime: +pm_runtime_disable (dp->dev); -pm_runtime_disable (dev); - -return ERR_PTR (ret); +return ret; }EXPORT_SYMBOL_GPL (analogix_dp_bind);
@@ -1785,10 +1791,15 @@ void analogix_dp_unbind(struct analogix_dp_device *dp)drm_dp_aux_unregister (&dp->aux);pm_runtime_disable (dp->dev); -clk_disable_unprepare (dp->clock); }EXPORT_SYMBOL_GPL (analogix_dp_unbind); +void analogix_dp_remove (struct analogix_dp_device *dp) +{ +clk_disable_unprepare (dp->clock); +} +EXPORT_SYMBOL_GPL (analogix_dp_remove); +#ifdef CONFIG_PM int analogix_dp_suspend (struct analogix_dp_device *dp) {
drivers/gpu/drm/exynos/exynos_dp.c +17 -12
@@ -158,15 +158,8 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)struct drm_device *drm_dev = data;int ret; - dp->dev = dev; dp->drm_dev = drm_dev; - dp->plat_data.dev_type =EXYNOS_DP ; - dp->plat_data.power_on_start = exynos_dp_poweron; - dp->plat_data.power_off = exynos_dp_poweroff; - dp->plat_data.attach = exynos_dp_bridge_attach; - dp->plat_data.get_modes = exynos_dp_get_modes; -if (!dp->plat_data.panel && !dp->ptn_bridge) { ret =exynos_dp_dt_parse_panel (dp);if (ret)
@@ -184,13 +177,11 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data) dp->plat_data.encoder = encoder; - dp->adp =analogix_dp_bind (dev, dp->drm_dev, &dp->plat_data); -if (IS_ERR (dp->adp)) { + ret =analogix_dp_bind (dp->adp, dp->drm_dev); +if (ret) dp->encoder.funcs->destroy (&dp->encoder); -return PTR_ERR (dp->adp); - } -return 0 ; +return ret; } static void exynos_dp_unbind(struct device *dev, struct device *master,
@@ -221,6 +212,7 @@ static int exynos_dp_probe(struct platform_device *pdev)if (!dp)return -ENOMEM ; + dp->dev = dev;/* * We just use the drvdata until driver run into component * add function, and then we would set drvdata to null, so
@@ -246,16 +238,29 @@ static int exynos_dp_probe(struct platform_device *pdev)/* The remote port can be either a panel or a bridge */ dp->plat_data.panel = panel; + dp->plat_data.dev_type =EXYNOS_DP ; + dp->plat_data.power_on_start = exynos_dp_poweron; + dp->plat_data.power_off = exynos_dp_poweroff; + dp->plat_data.attach = exynos_dp_bridge_attach; + dp->plat_data.get_modes = exynos_dp_get_modes; dp->plat_data.skip_connector = !!bridge; + dp->ptn_bridge = bridge; out: + dp->adp =analogix_dp_probe (dev, &dp->plat_data); +if (IS_ERR (dp->adp)) +return PTR_ERR (dp->adp); +return component_add (&pdev->dev, &exynos_dp_ops); }static int exynos_dp_remove (struct platform_device *pdev) { +struct exynos_dp_device *dp =platform_get_drvdata (pdev); +component_del (&pdev->dev, &exynos_dp_ops); +analogix_dp_remove (dp->adp);return 0 ; }
drivers/gpu/drm/rockchip/analogix_dp-rockchip.c +19 -17
@@ -325,15 +325,9 @@ static int rockchip_dp_bind(struct device *dev, struct device *master, void *data) {struct rockchip_dp_device *dp =dev_get_drvdata (dev); -const struct rockchip_dp_chip_data *dp_data;struct drm_device *drm_dev = data;int ret; - dp_data =of_device_get_match_data (dev); -if (!dp_data) -return -ENODEV ; - - dp->data = dp_data; dp->drm_dev = drm_dev; ret =rockchip_dp_drm_create_encoder (dp);
@@ -344,16 +338,9 @@ static int rockchip_dp_bind(struct device *dev, struct device *master, dp->plat_data.encoder = &dp->encoder; - dp->plat_data.dev_type = dp->data->chip_type; - dp->plat_data.power_on_start = rockchip_dp_poweron_start; - dp->plat_data.power_off = rockchip_dp_powerdown; - dp->plat_data.get_modes = rockchip_dp_get_modes; - - dp->adp =analogix_dp_bind (dev, dp->drm_dev, &dp->plat_data); -if (IS_ERR (dp->adp)) { - ret =PTR_ERR (dp->adp); + ret =analogix_dp_bind (dp->adp, drm_dev); +if (ret) goto err_cleanup_encoder; - }return 0 ; err_cleanup_encoder:
@@ -368,8 +355,6 @@ static void rockchip_dp_unbind(struct device *dev, struct device *master,analogix_dp_unbind (dp->adp); dp->encoder.funcs->destroy (&dp->encoder); - - dp->adp =ERR_PTR (-ENODEV ); }static const struct component_ops rockchip_dp_component_ops = {
@@ -380,10 +365,15 @@ static const struct component_ops rockchip_dp_component_ops = {static int rockchip_dp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; +const struct rockchip_dp_chip_data *dp_data;struct drm_panel *panel =NULL ;struct rockchip_dp_device *dp;int ret; + dp_data =of_device_get_match_data (dev); +if (!dp_data) +return -ENODEV ; + ret =drm_of_find_panel_or_bridge (dev->of_node,1 ,0 , &panel,NULL );if (ret <0 )return ret;
@@ -394,7 +384,12 @@ static int rockchip_dp_probe(struct platform_device *pdev) dp->dev = dev; dp->adp =ERR_PTR (-ENODEV ); + dp->data = dp_data; dp->plat_data.panel = panel; + dp->plat_data.dev_type = dp->data->chip_type; + dp->plat_data.power_on_start = rockchip_dp_poweron_start; + dp->plat_data.power_off = rockchip_dp_powerdown; + dp->plat_data.get_modes = rockchip_dp_get_modes; ret =rockchip_dp_of_probe (dp);if (ret <0 )
@@ -402,12 +397,19 @@ static int rockchip_dp_probe(struct platform_device *pdev)platform_set_drvdata (pdev, dp); + dp->adp =analogix_dp_probe (dev, &dp->plat_data); +if (IS_ERR (dp->adp)) +return PTR_ERR (dp->adp); +return component_add (dev, &rockchip_dp_component_ops); }static int rockchip_dp_remove (struct platform_device *pdev) { +struct rockchip_dp_device *dp =platform_get_drvdata (pdev); +component_del (&pdev->dev, &rockchip_dp_component_ops); +analogix_dp_remove (dp->adp);return 0 ; }
include/drm/bridge/analogix_dp.h +3 -2
@@ -42,9 +42,10 @@ int analogix_dp_resume(struct analogix_dp_device *dp);int analogix_dp_suspend (struct analogix_dp_device *dp);struct analogix_dp_device * -analogix_dp_bind (struct device *dev,struct drm_device *drm_dev, -struct analogix_dp_plat_data *plat_data); +analogix_dp_probe (struct device *dev,struct analogix_dp_plat_data *plat_data); +int analogix_dp_bind (struct analogix_dp_device *dp,struct drm_device *drm_dev);void analogix_dp_unbind (struct analogix_dp_device *dp); +void analogix_dp_remove (struct analogix_dp_device *dp);int analogix_dp_start_crc (struct drm_connector *connector);int analogix_dp_stop_crc (struct drm_connector *connector);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 3/50 ASoC: topology: Check return value of soc_tplg_create_tlv
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit 482db55ae87f3749db05810a38b1d618dfd4407c ]
Function soc_tplg_create_tlv can fail, so we should check if it succeded or not and proceed appropriately.
--- sound/soc/soc-topology.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-)
sound/soc/soc-topology.c +14 -2
@@ -893,7 +893,13 @@ static int soc_tplg_dmixer_create(struct soc_tplg *tplg, unsigned int count, }/* create any TLV data */ -soc_tplg_create_tlv (tplg, &kc, &mc->hdr); + err =soc_tplg_create_tlv (tplg, &kc, &mc->hdr); +if (err <0 ) { +dev_err (tplg->dev,"ASoC: failed to create TLV %s\n" , + mc->hdr.name); +kfree (sm); +continue ; + }/* pass control to driver for optional further init */ err = soc_tplg_init_kcontrol(tplg, &kc,
@@ -1354,7 +1360,13 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_dmixer_create( }/* create any TLV data */ -soc_tplg_create_tlv (tplg, &kc[i], &mc->hdr); + err =soc_tplg_create_tlv (tplg, &kc[i], &mc->hdr); +if (err <0 ) { +dev_err (tplg->dev,"ASoC: failed to create TLV %s\n" , + mc->hdr.name); +kfree (sm); +continue ; + }/* pass control to driver for optional further init */ err = soc_tplg_init_kcontrol(tplg, &kc[i],
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 4/50 ASoC: topology: Check return value of soc_tplg_*_create
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit 2ae548f30d7f6973388fc3769bb3c2f6fd13652b ]
Functions soc_tplg_denum_create, soc_tplg_dmixer_create, soc_tplg_dbytes_create can fail, so their return values should be checked and error should be propagated.
--- sound/soc/soc-topology.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-)
sound/soc/soc-topology.c +12 -6
@@ -1123,6 +1123,7 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg, struct snd_soc_tplg_hdr *hdr) {struct snd_soc_tplg_ctl_hdr *control_hdr; +int ret;int i;if (tplg->pass !=SOC_TPLG_PASS_MIXER ) {
@@ -1151,25 +1152,30 @@ static int soc_tplg_kcontrol_elems_load(struct soc_tplg *tplg,case SND_SOC_TPLG_CTL_RANGE :case SND_SOC_TPLG_DAPM_CTL_VOLSW :case SND_SOC_TPLG_DAPM_CTL_PIN : -soc_tplg_dmixer_create (tplg,1 , -le32_to_cpu (hdr->payload_size)); + ret =soc_tplg_dmixer_create (tplg,1 , +le32_to_cpu (hdr->payload_size));break ;case SND_SOC_TPLG_CTL_ENUM :case SND_SOC_TPLG_CTL_ENUM_VALUE :case SND_SOC_TPLG_DAPM_CTL_ENUM_DOUBLE :case SND_SOC_TPLG_DAPM_CTL_ENUM_VIRT :case SND_SOC_TPLG_DAPM_CTL_ENUM_VALUE : -soc_tplg_denum_create (tplg,1 , -le32_to_cpu (hdr->payload_size)); + ret =soc_tplg_denum_create (tplg,1 , +le32_to_cpu (hdr->payload_size));break ;case SND_SOC_TPLG_CTL_BYTES : -soc_tplg_dbytes_create (tplg,1 , -le32_to_cpu (hdr->payload_size)); + ret =soc_tplg_dbytes_create (tplg,1 , +le32_to_cpu (hdr->payload_size));break ;default :soc_bind_err (tplg, control_hdr, i);return -EINVAL ; } +if (ret <0 ) { +dev_err (tplg->dev,"ASoC: invalid control\n" ); +return ret; + } + }return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 5/50 ASoC: topology: Check soc_tplg_add_route return value
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit 6856e887eae3efc0fe56899cb3f969fe063171c5 ]
Function soc_tplg_add_route can propagate error code from callback, we should check its return value and handle fail in correct way.
--- sound/soc/soc-topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/soc-topology.c +3 -1
@@ -1283,7 +1283,9 @@ static int soc_tplg_dapm_graph_elems_load(struct soc_tplg *tplg, routes[i]->dobj.index = tplg->index;list_add (&routes[i]->dobj.list, &tplg->comp->dobj_list); -soc_tplg_add_route (tplg, routes[i]); + ret =soc_tplg_add_route (tplg, routes[i]); +if (ret <0 ) +break ;/* add route, but keep going if some fail */ snd_soc_dapm_add_routes (dapm, routes[i],1 );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 6/50 ASoC: topology: Check return value of pcm_new_ver
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit b3677fc3d68dd942c92de52f0bd9dd8b472a40e6 ]
Function pcm_new_ver can fail, so we should check it's return value and handle possible error.
--- sound/soc/soc-topology.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
sound/soc/soc-topology.c +3 -1
@@ -2092,7 +2092,9 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg, _pcm = pcm; }else { abi_match = false; -pcm_new_ver (tplg, pcm, &_pcm); + ret =pcm_new_ver (tplg, pcm, &_pcm); +if (ret <0 ) +return ret; }/* create the FE DAIs and DAI links */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 7/50 ASoC: topology: Check return value of soc_tplg_dai_config
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit dd8e871d4e560eeb8d22af82dde91457ad835a63 ]
Function soc_tplg_dai_config can fail, check for and handle possible failure.
--- sound/soc/soc-topology.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
sound/soc/soc-topology.c +7 -2
@@ -2431,7 +2431,7 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, {struct snd_soc_tplg_dai *dai;int count; -int i; +int i, ret; count =le32_to_cpu (hdr->count);
@@ -2446,7 +2446,12 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg,return -EINVAL ; } -soc_tplg_dai_config (tplg, dai); + ret =soc_tplg_dai_config (tplg, dai); +if (ret <0 ) { +dev_err (tplg->dev,"ASoC: failed to configure DAI\n" ); +return ret; + } + tplg->pos += (sizeof (*dai) +le32_to_cpu (dai->priv.size)); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 8/50 selftests/ipc: Fix test failure seen after initial test run
In reply to Greg Kroah-HartmanFrom: Tyler Hicks <[email protected]>
[ Upstream commit b87080eab4c1377706c113fc9c0157f19ea8fed1 ]
After successfully running the IPC msgque test once, subsequent runs result in a test failure:
$ sudo ./run_kselftest.sh TAP version 13 1..1 # selftests: ipc: msgque # Failed to get stats for IPC queue with id 0 # Failed to dump queue: -22 # Bail out! # # Pass 0 Fail 0 Xfail 0 Xpass 0 Skip 0 Error 0 not ok 1 selftests: ipc: msgque # exit=1
The dump_queue() function loops through the possible message queue index values using calls to msgctl(kern_id, MSG_STAT, ...) where kern_id represents the index value. The first time the test is ran, the initial index value of 0 is valid and the test is able to complete. The index value of 0 is not valid in subsequent test runs and the loop attempts to try index values of 1, 2, 3, and so on until a valid index value is found that corresponds to the message queue created earlier in the test.
The msgctl() syscall returns -1 and sets errno to EINVAL when invalid index values are used. The test failure is caused by incorrectly comparing errno to -EINVAL when cycling through possible index values.
Fix invalid test failures on subsequent runs of the msgque test by correctly comparing errno values to a non-negated EINVAL.
--- tools/testing/selftests/ipc/msgque.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/ipc/msgque.c +1 -1
@@ -137,7 +137,7 @@ int dump_queue(struct msgque_data *msgque)for (kern_id =0 ; kern_id <256 ; kern_id++) { ret =msgctl (kern_id,MSG_STAT , &ds);if (ret <0 ) { -if (errno == -EINVAL ) +if (errno ==EINVAL )continue ;printf ("Failed to get stats for IPC queue with id %d\n" , kern_id);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 9/50 ASoC: sgtl5000: Fix VAG power-on handling
In reply to Greg Kroah-HartmanFrom: Sebastian Reichel <[email protected]>
[ Upstream commit aa7812737f2877e192d57626cbe8825cc7cf6de9 ]
As mentioned slightly out of patch context in the code, there is no reset routine for the chip. On boards where the chip is supplied by a fixed regulator, it might not even be resetted during (e.g. watchdog) reboot and can be in any state.
If the device is probed with VAG enabled, the driver's probe routine will generate a loud pop sound when ANA_POWER is being programmed. Avoid this by properly disabling just the VAG bit and waiting the required power down time.
--- sound/soc/codecs/sgtl5000.c | 34 ++++++++++++++++++++++++++++++++++ sound/soc/codecs/sgtl5000.h | 1 + 2 files changed, 35 insertions(+)
sound/soc/codecs/sgtl5000.c +34 -0
@@ -1645,6 +1645,40 @@ static int sgtl5000_i2c_probe(struct i2c_client *client,dev_err (&client->dev,"Error %d initializing CHIP_CLK_CTRL\n" , ret); +/* Mute everything to avoid pop from the following power-up */ + ret =regmap_write (sgtl5000->regmap,SGTL5000_CHIP_ANA_CTRL , +SGTL5000_CHIP_ANA_CTRL_DEFAULT ); +if (ret) { +dev_err (&client->dev, +"Error %d muting outputs via CHIP_ANA_CTRL\n" , ret); + goto disable_clk; + } + +/* +* If VAG is powered-on (e.g. from previous boot), it would be disabled +* by the write to ANA_POWER in later steps of the probe code. This +* may create a loud pop even with all outputs muted. The proper way +* to circumvent this is disabling the bit first and waiting the proper +* cool-down time. +*/ + ret =regmap_read (sgtl5000->regmap,SGTL5000_CHIP_ANA_POWER , &value); +if (ret) { +dev_err (&client->dev,"Failed to read ANA_POWER: %d\n" , ret); + goto disable_clk; + } +if (value &SGTL5000_VAG_POWERUP ) { + ret =regmap_update_bits (sgtl5000->regmap, +SGTL5000_CHIP_ANA_POWER , +SGTL5000_VAG_POWERUP , +0 ); +if (ret) { +dev_err (&client->dev,"Error %d disabling VAG\n" , ret); + goto disable_clk; + } + +msleep (SGTL5000_VAG_POWERDOWN_DELAY ); + } +/* Follow section 2.2.1.1 of AN3663 */ ana_pwr =SGTL5000_ANA_POWER_DEFAULT ;if (sgtl5000->num_supplies <=VDDD ) {
sound/soc/codecs/sgtl5000.h +1 -0
@@ -233,6 +233,7 @@/* * SGTL5000_CHIP_ANA_CTRL */ +#define SGTL5000_CHIP_ANA_CTRL_DEFAULT 0x0133#define SGTL5000_LINE_OUT_MUTE 0x0100#define SGTL5000_HP_SEL_MASK 0x0040#define SGTL5000_HP_SEL_SHIFT 6
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 10/50 ASoC: topology: Fix endianness issue
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit 26d87881590fd55ccdd8f829498d7b3033f81990 ]
As done in already existing cases, we should use le32_to_cpu macro while accessing hdr->magic. Found with sparse.
--- sound/soc/soc-topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-topology.c +1 -1
@@ -2559,7 +2559,7 @@ static int soc_valid_header(struct soc_tplg *tplg, }/* big endian firmware objects not supported atm */ -if (hdr->magic ==SOC_TPLG_MAGIC_BIG_ENDIAN ) { +if (le32_to_cpu (hdr->magic) ==SOC_TPLG_MAGIC_BIG_ENDIAN ) { dev_err(tplg->dev, "ASoC: pass %d big endian not supported header got %x at offset 0x%lx size 0x%zx.\n", tplg->pass, hdr->magic,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 11/50 usb: dwc3: gadget: Properly set maxpacket limit
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
[ Upstream commit d94ea5319813658ad5861d161ae16a194c2abf88 ]
Currently the calculation of max packet size limit for IN endpoints is too restrictive. This prevents a matching of a capable hardware endpoint during configuration. Below is the minimum recommended HW configuration to support a particular endpoint setup from the databook:
For OUT endpoints, the databook recommended the minimum RxFIFO size to be at least 3x MaxPacketSize + 3x setup packets size (8 bytes each) + clock crossing margin (16 bytes).
For IN endpoints, the databook recommended the minimum TxFIFO size to be at least 3x MaxPacketSize for endpoints that support burst. If the endpoint doesn't support burst or when the device is operating in USB 2.0 mode, a minimum TxFIFO size of 2x MaxPacketSize is recommended.
Base on these recommendations, we can calculate the MaxPacketSize limit of each endpoint. This patch revises the IN endpoint MaxPacketSize limit and also sets the MaxPacketSize limit for OUT endpoints.
Reference: Databook 3.30a section 3.2.2 and 3.2.3
--- drivers/usb/dwc3/core.h | 4 +++ drivers/usb/dwc3/gadget.c | 52 ++++++++++++++++++++++++++++++--------- 2 files changed, 45 insertions(+), 11 deletions(-)
drivers/usb/dwc3/core.h +4 -0
@@ -310,6 +310,10 @@#define DWC3_GTXFIFOSIZ_TXFDEF (n) ((n) & 0xffff)#define DWC3_GTXFIFOSIZ_TXFSTADDR (n) ((n) & 0xffff0000) +/* Global RX Fifo Size Register */ +#define DWC31_GRXFIFOSIZ_RXFDEP (n) ((n) & 0x7fff)/* DWC_usb31 only */ +#define DWC3_GRXFIFOSIZ_RXFDEP (n) ((n) & 0xffff) +/* Global Event Size Registers */ #define DWC3_GEVNTSIZ_INTMASK BIT(31)#define DWC3_GEVNTSIZ_SIZE (n) ((n) & 0xffff)
drivers/usb/dwc3/gadget.c +41 -11
73 lines not on this page · raw message
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 12/50 ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode
In reply to Greg Kroah-HartmanFrom: Matthias Blankertz <[email protected]>
[ Upstream commit a09fb3f28a60ba3e928a1fa94b0456780800299d ]
The parent SSI of a multi-SSI setup must be fully setup, started and stopped since it is also part of the playback/capture setup. So only skip the SSI (as per commit 203cdf51f288 ("ASoC: rsnd: SSI parent cares SWSP bit") and commit 597b046f0d99 ("ASoC: rsnd: control SSICR::EN correctly")) if the SSI is parent outside of a multi-SSI setup.
--- sound/soc/sh/rcar/ssi.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
sound/soc/sh/rcar/ssi.c +4 -4
@@ -407,7 +407,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,* We shouldn't exchange SWSP after running. * This means, parent needs to care it. */ -if (rsnd_ssi_is_parent (mod, io)) +if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io)) goto init_end;if (rsnd_io_is_play (io))
@@ -559,7 +559,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod,* EN is for data output. * SSI parent EN is not needed. */ -if (rsnd_ssi_is_parent (mod, io)) +if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io))return 0 ; ssi->cr_en =EN ;
@@ -582,7 +582,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod,if (!rsnd_ssi_is_run_mods (mod, io))return 0 ; -if (rsnd_ssi_is_parent (mod, io)) +if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io))return 0 ; cr = ssi->cr_own |
@@ -620,7 +620,7 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,if (rsnd_is_gen1 (priv))return 0 ; -if (rsnd_ssi_is_parent (mod, io)) +if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io))return 0 ;if (!rsnd_ssi_is_run_mods (mod, io))
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 13/50 ASoC: rsnd: Fix HDMI channel mapping for multi-SSI mode
In reply to Greg Kroah-HartmanFrom: Matthias Blankertz <[email protected]>
[ Upstream commit b94e164759b82d0c1c80d4b1c8f12c9bee83f11d ]
The HDMI?_SEL register maps up to four stereo SSI data lanes onto the sdata[0..3] inputs of the HDMI output block. The upper half of the register contains four blocks of 4 bits, with the most significant controlling the sdata3 line and the least significant the sdata0 line.
The shift calculation has an off-by-one error, causing the parent SSI to be mapped to sdata3, the first multi-SSI child to sdata0 and so forth. As the parent SSI transmits the stereo L/R channels, and the HDMI core expects it on the sdata0 line, this causes no audio to be output when playing stereo audio on a multichannel capable HDMI out, and multichannel audio has permutated channels.
Fix the shift calculation to map the parent SSI to sdata0, the first child to sdata1 etc.
--- sound/soc/sh/rcar/ssiu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/sh/rcar/ssiu.c +1 -1
@@ -221,7 +221,7 @@ static int rsnd_ssiu_init_gen2(struct rsnd_mod *mod, i;for_each_rsnd_mod_array (i, pos, io, rsnd_ssi_array) { - shift = (i *4 ) +16 ; + shift = (i *4 ) +20 ; val = (val & ~(0xF << shift)) |rsnd_mod_id (pos) << shift; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 14/50 ASoC: codecs: hdac_hdmi: Fix incorrect use of list_for_each_entry
In reply to Greg Kroah-HartmanFrom: Amadeusz Sławiński <[email protected]>
[ Upstream commit 326b509238171d37402dbe308e154cc234ed1960 ]
If we don't find any pcm, pcm will point at address at an offset from the the list head and not a meaningful structure. Fix this by returning correct pcm if found and NULL if not. Found with coccinelle.
--- sound/soc/codecs/hdac_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
sound/soc/codecs/hdac_hdmi.c +3 -3
@@ -150,14 +150,14 @@ static struct hdac_hdmi_pcm * hdac_hdmi_get_pcm_from_cvt(struct hdac_hdmi_priv *hdmi, struct hdac_hdmi_cvt *cvt) { - struct hdac_hdmi_pcm *pcm = NULL; + struct hdac_hdmi_pcm *pcm;list_for_each_entry (pcm, &hdmi->pcm_list, head) {if (pcm->cvt == cvt) -break ; +return pcm; } -return pcm; +return NULL ; } static void hdac_hdmi_jack_report(struct hdac_hdmi_pcm *pcm,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 15/50 remoteproc: qcom_q6v5_mss: fix a bug in q6v5_probe()
In reply to Greg Kroah-HartmanFrom: Alex Elder <[email protected]>
[ Upstream commit 13c060b50a341dd60303e5264d12108b5747f200 ]
If looking up the DT "firmware-name" property fails in q6v6_probe(), the function returns without freeing the remoteproc structure that has been allocated. Fix this by jumping to the free_rproc label, which takes care of this.
--- drivers/remoteproc/qcom_q6v5_mss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/remoteproc/qcom_q6v5_mss.c +1 -1
@@ -1440,7 +1440,7 @@ static int q6v5_probe(struct platform_device *pdev) ret =of_property_read_string_index (pdev->dev.of_node,"firmware-name" ,1 , &qproc->hexagon_mdt_image);if (ret <0 && ret != -EINVAL ) -return ret; + goto free_rproc;platform_set_drvdata (pdev, qproc);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 16/50 drm/amdgpu: Correctly initialize thermal controller for GPUs with Powerplay table v0 (e.g Hawaii)
In reply to Greg Kroah-HartmanFrom: Sandeep Raghuraman <[email protected]>
[ Upstream commit bbc25dadc7ed19f9d6b2e30980f0eb4c741bb8bf ]
Initialize thermal controller fields in the PowerPlay table for Hawaii GPUs, so that fan speeds are reported.
--- .../drm/amd/powerplay/hwmgr/processpptables.c | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+)
drivers/gpu/drm/amd/powerplay/hwmgr/processpptables.c +26 -0
@@ -984,6 +984,32 @@ static int init_thermal_controller(struct pp_hwmgr *hwmgr, const ATOM_PPLIB_POWERPLAYTABLE *powerplay_table) { + hwmgr->thermal_controller.ucType = + powerplay_table->sThermalController.ucType; + hwmgr->thermal_controller.ucI2cLine = + powerplay_table->sThermalController.ucI2cLine; + hwmgr->thermal_controller.ucI2cAddress = + powerplay_table->sThermalController.ucI2cAddress; + + hwmgr->thermal_controller.fanInfo.bNoFan = + (0 != (powerplay_table->sThermalController.ucFanParameters & +ATOM_PP_FANPARAMETERS_NOFAN )); + + hwmgr->thermal_controller.fanInfo.ucTachometerPulsesPerRevolution = + powerplay_table->sThermalController.ucFanParameters & +ATOM_PP_FANPARAMETERS_TACHOMETER_PULSES_PER_REVOLUTION_MASK ; + + hwmgr->thermal_controller.fanInfo.ulMinRPM + = powerplay_table->sThermalController.ucFanMinRPM *100UL ; + hwmgr->thermal_controller.fanInfo.ulMaxRPM + = powerplay_table->sThermalController.ucFanMaxRPM *100UL ; + +set_hw_cap (hwmgr, +ATOM_PP_THERMALCONTROLLER_NONE != hwmgr->thermal_controller.ucType, + PHM_PlatformCaps_ThermalController); + + hwmgr->thermal_controller.use_hw_fan_control =1 ; +return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 17/50 wimax/i2400m: Fix potential urb refcnt leak
In reply to Greg Kroah-HartmanFrom: Xiyu Yang <[email protected]>
[ Upstream commit 7717cbec172c3554d470023b4020d5781961187e ]
i2400mu_bus_bm_wait_for_ack() invokes usb_get_urb(), which increases the refcount of the "notif_urb".
When i2400mu_bus_bm_wait_for_ack() returns, local variable "notif_urb" becomes invalid, so the refcount should be decreased to keep refcount balanced.
The issue happens in all paths of i2400mu_bus_bm_wait_for_ack(), which forget to decrease the refcnt increased by usb_get_urb(), causing a refcnt leak.
Fix this issue by calling usb_put_urb() before the i2400mu_bus_bm_wait_for_ack() returns.
--- drivers/net/wimax/i2400m/usb-fw.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wimax/i2400m/usb-fw.c +1 -0
@@ -354,6 +354,7 @@ ssize_t i2400mu_bus_bm_wait_for_ack(struct i2400m *i2400m,usb_autopm_put_interface (i2400mu->usb_iface);d_fnend (8 , dev,"(i2400m %p ack %p size %zu) = %ld\n" , i2400m, ack, ack_size, (long ) result); +usb_put_urb (¬if_urb);return result; error_exceeded:
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 18/50 net: stmmac: fix enabling socfpgas ptp_ref_clock
In reply to Greg Kroah-HartmanFrom: Julien Beraud <[email protected]>
[ Upstream commit 15ce30609d1e88d42fb1cd948f453e6d5f188249 ]
There are 2 registers to write to enable a ptp ref clock coming from the fpga.
One that enables the usage of the clock from the fpga for emac0 and emac1 as a ptp ref clock, and the other to allow signals from the fpga to reach emac0 and emac1.
Currently, if the dwmac-socfpga has phymode set to PHY_INTERFACE_MODE_MII, PHY_INTERFACE_MODE_GMII, or PHY_INTERFACE_MODE_SGMII, both registers will be written and the ptp ref clock will be set as coming from the fpga. Separate the 2 register writes to only enable signals from the fpga to reach emac0 or emac1 when ptp ref clock is not coming from the fpga.
--- drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +6 -3
@@ -291,16 +291,19 @@ static int socfpga_gen5_set_phy_mode(struct socfpga_dwmac *dwmac) phymode == PHY_INTERFACE_MODE_MII || phymode == PHY_INTERFACE_MODE_GMII || phymode == PHY_INTERFACE_MODE_SGMII) { - ctrl |=SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift /2 );regmap_read (sys_mgr_base_addr,SYSMGR_FPGAGRP_MODULE_REG , &module); module |= (SYSMGR_FPGAGRP_MODULE_EMAC << (reg_shift /2 ));regmap_write (sys_mgr_base_addr,SYSMGR_FPGAGRP_MODULE_REG , module); - } else { - ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift /2 )); } +if (dwmac->f2h_ptp_ref_clk) + ctrl |=SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << (reg_shift /2 ); +else + ctrl &= ~(SYSMGR_EMACGRP_CTRL_PTP_REF_CLK_MASK << + (reg_shift /2 )); +regmap_write (sys_mgr_base_addr, reg_offset, ctrl);/* Deassert reset for the phy configuration to be sampled by
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 19/50 net: stmmac: Fix sub-second increment
In reply to Greg Kroah-HartmanFrom: Julien Beraud <[email protected]>
[ Upstream commit 91a2559c1dc5b0f7e1256d42b1508935e8eabfbf ]
In fine adjustement mode, which is the current default, the sub-second
increment register is the number of nanoseconds that will be added to the clock when the accumulator overflows. At each clock cycle, the value of the addend register is added to the accumulator. Currently, we use 20ns = 1e09ns / 50MHz as this value whatever the frequency of the ptp clock actually is.
The adjustment is then done on the addend register, only incrementing every X clock cycles X being the ratio between 50MHz and ptp_clock_rate (addend = 2^32 * 50MHz/ptp_clock_rate).
This causes the following issues :
- In case the frequency of the ptp clock is inferior or equal to 50MHz, the addend value calculation will overflow and the default addend value will be set to 0, causing the clock to not work at all. (For instance, for ptp_clock_rate = 50MHz, addend = 2^32).
- The resolution of the timestamping clock is limited to 20ns while it is not needed, thus limiting the accuracy of the timestamping to 20ns.
Fix this by setting sub-second increment to 2e09ns / ptp_clock_rate. It will allow to reach the minimum possible frequency for ptp_clk_ref, which is 5MHz for GMII 1000Mps Full-Duplex by setting the sub-second-increment to a higher value. For instance, for 25MHz, it gives ssinc = 80ns and default_addend = 2^31.
It will also allow to use a lower value for sub-second-increment, thus improving the timestamping accuracy with frequencies higher than 100MHz, for instance, for 200MHz, ssinc = 10ns and default_addend = 2^31.
v1->v2:
- Remove modifications to the calculation of default addend, which broke compatibility with clock frequencies for which 2000000000 / ptp_clk_freq is not an integer.
- Modify description according to discussions.
--- .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +8 -4
@@ -26,12 +26,16 @@ static void config_sub_second_increment(void __iomem *ioaddr,unsigned long data;u32 reg_value; -/* For GMAC3.x, 4.x versions, convert the ptp_clock to nano second -* formula = (1/ptp_clock) * 1000000000 -* where ptp_clock is 50MHz if fine method is used to update system +/* For GMAC3.x, 4.x versions, in "fine adjustement mode" set sub-second +* increment to twice the number of nanoseconds of a clock cycle. +* The calculation of the default_addend value by the caller will set it +* to mid-range = 2^31 when the remainder of this division is zero, +* which will make the accumulator overflow once every 2 ptp_clock +* cycles, adding twice the number of nanoseconds of a clock cycle : +* 2000000000ULL / ptp_clock. */ if (value &PTP_TCR_TSCFUPDT ) - data = (1000000000ULL /50000000 ); + data = (2000000000ULL / ptp_clock);else data = (1000000000ULL / ptp_clock);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 20/50 ASoC: rsnd: Dont treat master SSI in multi SSI setup as parent
In reply to Greg Kroah-HartmanFrom: Matthias Blankertz <[email protected]>
[ Upstream commit 0c258657ddfe81b4fc0183378d800c97ba0b7cdd ]
The master SSI of a multi-SSI setup was attached both to the RSND_MOD_SSI slot and the RSND_MOD_SSIP slot of the rsnd_dai_stream. This is not correct wrt. the meaning of being "parent" in the rest of the SSI code, where it seems to indicate an SSI that provides clock and word sync but is not transmitting/receiving audio data.
Not treating the multi-SSI master as parent allows removal of various special cases to the rsnd_ssi_is_parent conditions introduced in commit a09fb3f28a60 ("ASoC: rsnd: Fix parent SSI start/stop in multi-SSI mode"). It also fixes the issue that operations performed via rsnd_dai_call() were performed twice for the master SSI. This caused some "status check failed" spam when stopping a multi-SSI stream as the driver attempted to stop the master SSI twice.
--- sound/soc/sh/rcar/ssi.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
sound/soc/sh/rcar/ssi.c +7 -4
@@ -407,7 +407,7 @@ static void rsnd_ssi_config_init(struct rsnd_mod *mod,* We shouldn't exchange SWSP after running. * This means, parent needs to care it. */ -if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io)) +if (rsnd_ssi_is_parent (mod, io)) goto init_end;if (rsnd_io_is_play (io))
@@ -559,7 +559,7 @@ static int rsnd_ssi_start(struct rsnd_mod *mod,* EN is for data output. * SSI parent EN is not needed. */ -if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io)) +if (rsnd_ssi_is_parent (mod, io))return 0 ; ssi->cr_en =EN ;
@@ -582,7 +582,7 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod,if (!rsnd_ssi_is_run_mods (mod, io))return 0 ; -if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io)) +if (rsnd_ssi_is_parent (mod, io))return 0 ; cr = ssi->cr_own |
@@ -620,7 +620,7 @@ static int rsnd_ssi_irq(struct rsnd_mod *mod,if (rsnd_is_gen1 (priv))return 0 ; -if (rsnd_ssi_is_parent (mod, io) && !rsnd_ssi_multi_slaves (io)) +if (rsnd_ssi_is_parent (mod, io))return 0 ;if (!rsnd_ssi_is_run_mods (mod, io))
@@ -737,6 +737,9 @@ static void rsnd_ssi_parent_attach(struct rsnd_mod *mod,if (!rsnd_rdai_is_clk_master (rdai))return ; +if (rsnd_ssi_is_multi_slave (mod, io)) +return ; +switch (rsnd_mod_id (mod)) {case 1 :case 2 :
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 21/50 ASoC: rsnd: Fix "status check failed" spam for multi-SSI
In reply to Greg Kroah-HartmanFrom: Matthias Blankertz <[email protected]>
[ Upstream commit 54cb6221688660670a2e430892d7f4e6370263b8 ]
Fix the rsnd_ssi_stop function to skip disabling the individual SSIs of a multi-SSI setup, as the actual stop is performed by rsnd_ssiu_stop_gen2
- the same logic as in rsnd_ssi_start. The attempt to disable these SSIs was harmless, but caused a "status check failed" message to be printed for every SSI in the multi-SSI setup.
The disabling of interrupts is still performed, as they are enabled for all SSIs in rsnd_ssi_init, but care is taken to not accidentally set the EN bit for an SSI where it was not set by rsnd_ssi_start.
--- sound/soc/sh/rcar/ssi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
sound/soc/sh/rcar/ssi.c +7 -1
@@ -594,10 +594,16 @@ static int rsnd_ssi_stop(struct rsnd_mod *mod,* Capture: It might not receave data. Do nothing */ if (rsnd_io_is_play (io)) { -rsnd_mod_write (mod,SSICR , cr |EN ); +rsnd_mod_write (mod,SSICR , cr | ssi->cr_en);rsnd_ssi_status_check (mod,DIRQ ); } +/* In multi-SSI mode, stop is performed by setting ssi0129 in +* SSI_CONTROL to 0 (in rsnd_ssio_stop_gen2). Do nothing here. +*/ +if (rsnd_ssi_multi_slaves_runtime (io)) +return 0 ; +/* * disable SSI, * and, wait idle state
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 22/50 cifs: protect updating server->dstaddr with a spinlock
In reply to Greg Kroah-HartmanFrom: Ronnie Sahlberg <[email protected]>
[ Upstream commit fada37f6f62995cc449b36ebba1220594bfe55fe ]
We use a spinlock while we are reading and accessing the destination address for a server. We need to also use this spinlock to protect when we are modifying this address from reconn_set_ipaddr().
--- fs/cifs/connect.c | 2 ++ 1 file changed, 2 insertions(+)
fs/cifs/connect.c +2 -0
@@ -371,8 +371,10 @@ static int reconn_set_ipaddr(struct TCP_Server_Info *server)return rc; } +spin_lock (&cifs_tcp_ses_lock); rc =cifs_convert_address ((struct sockaddr *)&server->dstaddr, ipaddr,strlen (ipaddr)); +spin_unlock (&cifs_tcp_ses_lock);kfree (ipaddr);return !rc ?-1 :0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 23/50 scripts/config: allow colons in option strings for sed
In reply to Greg Kroah-HartmanFrom: Jeremie Francois (on alpha) <[email protected]>
[ Upstream commit e461bc9f9ab105637b86065d24b0b83f182d477c ]
Sed broke on some strings as it used colon as a separator. I made it more robust by using \001, which is legit POSIX AFAIK.
E.g. ./config --set-str CONFIG_USBNET_DEVADDR "de:ad:be:ef:00:01" failed with: sed: -e expression #1, char 55: unknown option to `s'
--- scripts/config | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
scripts/config +4 -1
@@ -7,6 +7,9 @@ myname=${0##*/} # If no prefix forced, use the default CONFIG_ CONFIG_="${CONFIG_-CONFIG_}" +# We use an uncommon delimiter for sed substitutions +SED_DELIM=$(echo -en "\001") + usage() { cat >&2 <<EOL Manipulate options in a .config file from the command line.
@@ -83,7 +86,7 @@ txt_subst() { local infile="$3" local tmpfile="$infile.swp" - sed -e "s:$before:$after:" "$infile" >"$tmpfile" + sed -e "s$SED_DELIM$before$SED_DELIM$after$SED_DELIM" "$infile" >"$tmpfile" # replace original file with the edited one mv "$tmpfile" "$infile" }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 24/50 cifs: do not share tcons with DFS
In reply to Greg Kroah-HartmanFrom: Paulo Alcantara <[email protected]>
[ Upstream commit 65303de829dd6d291a4947c1a31de31896f8a060 ]
This disables tcon re-use for DFS shares.
tcon->dfs_path stores the path that the tcon should connect to when doing failing over.
If that tcon is used multiple times e.g. 2 mounts using it with different prefixpath, each will need a different dfs_path but there is only one tcon. The other solution would be to split the tcon in 2 tcons during failover but that is much harder.
tcons could not be shared with DFS in cifs.ko because in a DFS namespace like:
//domain/dfsroot -> /serverA/dfsroot, /serverB/dfsroot
//serverA/dfsroot/link -> /serverA/target1/aa/bb
//serverA/dfsroot/link2 -> /serverA/target1/cc/ddyou can see that link and link2 are two DFS links that both resolve to the same target share (/serverA/target1), so cifs.ko will only contain a single tcon for both link and link2.
The problem with that is, if we (auto)mount "link" and "link2", cifs.ko will only contain a single tcon for both DFS links so we couldn't perform failover or refresh the DFS cache for both links because tcon->dfs_path was set to either "link" or "link2", but not both -- which is wrong.
--- fs/cifs/connect.c | 4 ++++ 1 file changed, 4 insertions(+)
fs/cifs/connect.c +4 -0
@@ -3362,6 +3362,10 @@ cifs_find_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)spin_lock (&cifs_tcp_ses_lock);list_for_each (tmp, &ses->tcon_list) { tcon = list_entry(tmp, struct cifs_tcon, tcon_list); +#ifdef CONFIG_CIFS_DFS_UPCALL +if (tcon->dfs_path) +continue ; +#endif if (!match_tcon (tcon, volume_info))continue ; ++tcon->tc_count;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 25/50 tracing: Fix memory leaks in trace_events_hist.c
In reply to Greg Kroah-HartmanFrom: Vamshi K Sthambamkadi <[email protected]>
[ Upstream commit 9da73974eb9c965dd9989befb593b8c8da9e4bdc ]
kmemleak report 1:
[<9092c50b>] kmem_cache_alloc_trace+0x138/0x270
[<05a2c9ed>] create_field_var+0xcf/0x180
[<528a2d68>] action_create+0xe2/0xc80
[<63f50b61>] event_hist_trigger_func+0x15b5/0x1920
[<28ea5d3d>] trigger_process_regex+0x7b/0xc0
[<3138e86f>] event_trigger_write+0x4d/0xb0
[<ffd66c19>] __vfs_write+0x30/0x200
[<4f424a0d>] vfs_write+0x96/0x1b0
[<da59a290>] ksys_write+0x53/0xc0
[<3717101a>] __ia32_sys_write+0x15/0x20
[<c5f23497>] do_fast_syscall_32+0x70/0x250
[<46e2629c>] entry_SYSENTER_32+0xaf/0x102This is because save_vars[] of struct hist_trigger_data are not destroyed
kmemleak report 2:
[<9092c50b>] kmem_cache_alloc_trace+0x138/0x270
[<6e5e97c5>] create_var+0x3c/0x110
[<de82f1b9>] create_field_var+0xaf/0x180
[<528a2d68>] action_create+0xe2/0xc80
[<63f50b61>] event_hist_trigger_func+0x15b5/0x1920
[<28ea5d3d>] trigger_process_regex+0x7b/0xc0
[<3138e86f>] event_trigger_write+0x4d/0xb0
[<ffd66c19>] __vfs_write+0x30/0x200
[<4f424a0d>] vfs_write+0x96/0x1b0
[<da59a290>] ksys_write+0x53/0xc0
[<3717101a>] __ia32_sys_write+0x15/0x20
[<c5f23497>] do_fast_syscall_32+0x70/0x250
[<46e2629c>] entry_SYSENTER_32+0xaf/0x102struct hist_field allocated through create_var() do not initialize "ref" field to 1. The code in __destroy_hist_field() does not destroy object if "ref" is initialized to zero, the condition
if (--hist_field->ref > 1) always passes since unsigned int wraps.
kmemleak report 3:
[<f8666fcc>] __kmalloc_track_caller+0x139/0x2b0
[<bb7f80a5>] kstrdup+0x27/0x50
[<39d70006>] init_var_ref+0x58/0xd0
[<8ca76370>] create_var_ref+0x89/0xe0
[<f045fc39>] action_create+0x38f/0xc80
[<7c146821>] event_hist_trigger_func+0x15b5/0x1920
[<07de3f61>] trigger_process_regex+0x7b/0xc0
[<e87daf8f>] event_trigger_write+0x4d/0xb0
[<19bf1512>] __vfs_write+0x30/0x200
[<64ce4d27>] vfs_write+0x96/0x1b0
[<a6f34170>] ksys_write+0x53/0xc0
[<7d4230cd>] __ia32_sys_write+0x15/0x20
[<8eadca00>] do_fast_syscall_32+0x70/0x250
[<235cf985>] entry_SYSENTER_32+0xaf/0x102hist_fields (system & event_name) are not freed
--- kernel/trace/trace_events_hist.c | 7 +++++++ 1 file changed, 7 insertions(+)
kernel/trace/trace_events_hist.c +7 -0
@@ -2466,6 +2466,9 @@ static void __destroy_hist_field(struct hist_field *hist_field)kfree (hist_field->name);kfree (hist_field->type); +kfree (hist_field->system); +kfree (hist_field->event_name); +kfree (hist_field); }
@@ -3528,6 +3531,7 @@ static struct hist_field *create_var(struct hist_trigger_data *hist_data, goto out; } + var->ref =1 ; var->flags =HIST_FIELD_FL_VAR ; var->var.idx = idx; var->var.hist_data = var->hist_data = hist_data;
@@ -4157,6 +4161,9 @@ static void destroy_field_vars(struct hist_trigger_data *hist_data)for (i =0 ; i < hist_data->n_field_vars; i++)destroy_field_var (hist_data->field_vars[i]); + +for (i =0 ; i < hist_data->n_save_vars; i++) +destroy_field_var (hist_data->save_vars[i]); } static void save_field_var(struct hist_trigger_data *hist_data,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 26/50 lib/mpi: Fix building for powerpc with clang
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 5990cdee689c6885b27c6d969a3d58b09002b0bc ]
0day reports over and over on an powerpc randconfig with clang:
lib/mpi/generic_mpih-mul1.c:37:13: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
Remove the superfluous casts, which have been done previously for x86 and arm32 in commit dea632cadd12 ("lib/mpi: fix build with clang") and commit 7b7c1df2883d ("lib/mpi/longlong.h: fix building with 32-bit x86").
--- lib/mpi/longlong.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
lib/mpi/longlong.h +17 -17
@@ -722,22 +722,22 @@ do { \ do { \ if (__builtin_constant_p(bh) && (bh) == 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "%r" ((USItype)(al)), \ "rI" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "%r" ((USItype)(al)), \ "rI" ((USItype)(bl))); \ else \ __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "%r" ((USItype)(ah)), \ "r" ((USItype)(bh)), \ "%r" ((USItype)(al)), \
@@ -747,36 +747,36 @@ do { \ do { \ if (__builtin_constant_p(ah) && (ah) == 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(ah) && (ah) == ~(USItype) 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(ah)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else if (__builtin_constant_p(bh) && (bh) == ~(USItype) 0) \ __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(ah)), \ "rI" ((USItype)(al)), \ "r" ((USItype)(bl))); \ else \ __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ + : "=r" (sh), \ + "=&r" (sl) \ : "r" ((USItype)(ah)), \ "r" ((USItype)(bh)), \ "rI" ((USItype)(al)), \
@@ -787,7 +787,7 @@ do { \ do { \ USItype __m0 = (m0), __m1 = (m1); \ __asm__ ("mulhwu %0,%1,%2" \ - : "=r" ((USItype) ph) \ + : "=r" (ph) \ : "%r" (__m0), \ "r" (__m1)); \ (pl) = __m0 * __m1; \
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 27/50 mac80211: sta_info: Add lockdep condition for RCU list usage
In reply to Greg Kroah-HartmanFrom: Madhuparna Bhowmik <[email protected]>
[ Upstream commit 8ca47eb9f9e4e10e7e7fa695731a88941732c38d ]
The function sta_info_get_by_idx() uses RCU list primitive. It is called with local->sta_mtx held from mac80211/cfg.c. Add lockdep expression to avoid any false positive RCU list warnings.
--- net/mac80211/sta_info.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/sta_info.c +2 -1
@@ -217,7 +217,8 @@ struct sta_info *sta_info_get_by_idx(struct ieee80211_sub_if_data *sdata,struct sta_info *sta;int i =0 ; -list_for_each_entry_rcu (sta, &local->sta_list, list) { +list_for_each_entry_rcu (sta, &local->sta_list, list, +lockdep_is_held (&local->sta_mtx)) {if (sdata != sta->sdata)continue ;if (i < idx) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 28/50 net: bcmgenet: suppress warnings on failed Rx SKB allocations
In reply to Greg Kroah-HartmanFrom: Doug Berger <[email protected]>
[ Upstream commit ecaeceb8a8a145d93c7e136f170238229165348f ]
The driver is designed to drop Rx packets and reclaim the buffers when an allocation fails, and the network interface needs to safely handle this packet loss. Therefore, an allocation failure of Rx SKBs is relatively benign.
However, the output of the warning message occurs with a high scheduling priority that can cause excessive jitter/latency for other high priority processing.
This commit suppresses the warning messages to prevent scheduling problems while retaining the failure count in the statistics of the network interface.
--- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/genet/bcmgenet.c +2 -1
@@ -1697,7 +1697,8 @@ static struct sk_buff *bcmgenet_rx_refill(struct bcmgenet_priv *priv,dma_addr_t mapping;/* Allocate a new Rx skb */ - skb =netdev_alloc_skb (priv->dev, priv->rx_buf_len +SKB_ALIGNMENT ); + skb =__netdev_alloc_skb (priv->dev, priv->rx_buf_len +SKB_ALIGNMENT , +GFP_ATOMIC | __GFP_NOWARN);if (!skb) { priv->mib.alloc_rx_buff_failed++; netif_err(priv, rx_err, priv->dev,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 29/50 net: systemport: suppress warnings on failed Rx SKB allocations
In reply to Greg Kroah-HartmanFrom: Doug Berger <[email protected]>
[ Upstream commit 3554e54a46125030c534820c297ed7f6c3907e24 ]
The driver is designed to drop Rx packets and reclaim the buffers when an allocation fails, and the network interface needs to safely handle this packet loss. Therefore, an allocation failure of Rx SKBs is relatively benign.
However, the output of the warning message occurs with a high scheduling priority that can cause excessive jitter/latency for other high priority processing.
This commit suppresses the warning messages to prevent scheduling problems while retaining the failure count in the statistics of the network interface.
--- drivers/net/ethernet/broadcom/bcmsysport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bcmsysport.c +2 -1
@@ -666,7 +666,8 @@ static struct sk_buff *bcm_sysport_rx_refill(struct bcm_sysport_priv *priv,dma_addr_t mapping;/* Allocate a new SKB for a new packet */ - skb =netdev_alloc_skb (priv->netdev,RX_BUF_LENGTH ); + skb =__netdev_alloc_skb (priv->netdev,RX_BUF_LENGTH , +GFP_ATOMIC | __GFP_NOWARN);if (!skb) { priv->mib.alloc_rx_buff_failed++;netif_err (priv, rx_err, ndev,"SKB alloc failed\n" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 30/50 drm/i915: Extend WaDisableDARBFClkGating to icl,ehl,tgl
In reply to Greg Kroah-HartmanFrom: Matt Roper <[email protected]>
commit 1e1a139d62d1c11e3083c8638d31a9744bec3918 upstream.
WaDisableDARBFClkGating, now known as Wa_14010480278, has been added to the workaround tables for ICL, EHL, and TGL so we need to extend our platform test accordingly.
Bspec: 33450
Bspec: 33451
Bspec: 52890
--- drivers/gpu/drm/i915/display/intel_display.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_display.c +5 -2
@@ -16860,8 +16860,11 @@ get_encoder_power_domains(struct drm_i91static void intel_early_display_was (struct drm_i915_private *dev_priv) { -/* Display WA #1185 WaDisableDARBFClkGating:cnl,glk */ -if (IS_CANNONLAKE (dev_priv) ||IS_GEMINILAKE (dev_priv)) +/* +* Display WA #1185 WaDisableDARBFClkGating:cnl,glk,icl,ehl,tgl +* Also known as Wa_14010480278. +*/ +if (IS_GEN_RANGE (dev_priv,10 ,12 ) ||IS_GEMINILAKE (dev_priv))I915_WRITE (GEN9_CLKGATE_DIS_0 ,I915_READ (GEN9_CLKGATE_DIS_0 ) |DARBF_GATING_DIS );
Greg Kroah-Hartman
maintainerPATCH 31/50 sctp: Fix SHUTDOWN CTSN Ack in the peer restart case
In reply to Greg Kroah-HartmanFrom: Jere Leppänen <[email protected]>
commit 12dfd78e3a74825e6f0bc8df7ef9f938fbc6bfe3 upstream.
When starting shutdown in sctp_sf_do_dupcook_a(), get the value for SHUTDOWN Cumulative TSN Ack from the new association, which is reconstructed from the cookie, instead of the old association, which the peer doesn't have anymore.
Otherwise the SHUTDOWN is either ignored or replied to with an ABORT by the peer because CTSN Ack doesn't match the peer's Initial TSN.
--- net/sctp/sm_make_chunk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/sctp/sm_make_chunk.c +5 -1
@@ -858,7 +858,11 @@ struct sctp_chunk *sctp_make_shutdown(costruct sctp_chunk *retval;__u32 ctsn; - ctsn =sctp_tsnmap_get_ctsn (&asoc->peer.tsn_map); +if (chunk && chunk->asoc) + ctsn =sctp_tsnmap_get_ctsn (&chunk->asoc->peer.tsn_map); +else + ctsn =sctp_tsnmap_get_ctsn (&asoc->peer.tsn_map); + shut.cum_tsn_ack =htonl (ctsn); retval = sctp_make_control(asoc, SCTP_CID_SHUTDOWN, 0,
Greg Kroah-Hartman
maintainerPATCH 32/50 drm/amdgpu: Fix oops when pp_funcs is unset in ACPI event
In reply to Greg Kroah-HartmanFrom: Aaron Ma <[email protected]>
commit 5932d260a8d85a103bd6c504fbb85ff58b156bf9 upstream.
On ARCTURUS and RENOIR, powerplay is not supported yet. When plug in or unplug power jack, ACPI event will issue. Then kernel NULL pointer BUG will be triggered. Check for NULL pointers before calling.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +2 -1
@@ -90,7 +90,8 @@ void amdgpu_pm_acpi_event_handler(struct adev->pm.ac_power = true; else adev->pm.ac_power = false; -if (adev->powerplay.pp_funcs->enable_bapm) +if (adev->powerplay.pp_funcs && + adev->powerplay.pp_funcs->enable_bapm)amdgpu_dpm_enable_bapm (adev, adev->pm.ac_power);mutex_unlock (&adev->pm.mutex); }
Greg Kroah-Hartman
maintainerPATCH 33/50 Revert "software node: Simplify software_node_release() function"
In reply to Greg Kroah-HartmanFrom: Brendan Higgins <[email protected]>
commit 7589238a8cf37331607c3222a64ac3140b29532d upstream.
This reverts commit 3df85a1ae51f6b256982fe9d17c2dc5bfb4cc402.
The reverted commit says "It's possible to release the node ID immediately when fwnode_remove_software_node() is called, no need to wait for software_node_release() with that." However, releasing the node ID before waiting for software_node_release() to be called causes the node ID to be released before the kobject and the underlying sysfs entry; this means there is a period of time where a sysfs entry exists that is associated with an unallocated node ID.
Once consequence of this is that there is a race condition where it is possible to call fwnode_create_software_node() with no parent node specified (NULL) and have it fail with -EEXIST because the node ID that was assigned is still associated with a stale sysfs entry that hasn't been cleaned up yet.
Although it is difficult to reproduce this race condition under normal conditions, it can be deterministically reproduced with the following minconfig on UML:
CONFIG_KUNIT_DRIVER_PE_TEST=yCONFIG_DEBUG_KERNEL=yCONFIG_DEBUG_OBJECTS=yCONFIG_DEBUG_OBJECTS_TIMERS=yCONFIG_DEBUG_KOBJECT_RELEASE=yCONFIG_KUNIT=y
Running the tests with this configuration causes the following failure:
<snip>
kobject: 'node0' ((____ptrval____)): kobject_release, parent (____ptrval____) (delayed 400)
ok 1 - pe_test_uints
sysfs: cannot create duplicate filename '/kernel/software_nodes/node0'
CPU: 0 PID: 28 Comm: kunit_try_catch Not tainted 5.6.0-rc3-next-20200227 #14
<snip>kobject_add_internal failed for node0 with -EEXIST, don't try to register things with the same name in the same directory.
kobject: 'node0' ((____ptrval____)): kobject_release, parent (____ptrval____) (delayed 100)
# pe_test_uint_arrays: ASSERTION FAILED at drivers/base/test/property-entry-test.c:123 Expected node is not error, but is: -17
not ok 2 - pe_test_uint_arrays
<snip>
--- drivers/base/swnode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/base/swnode.c +7 -7
@@ -679,6 +679,13 @@ static void software_node_release(struct {struct swnode *swnode =kobj_to_swnode (kobj); +if (swnode->parent) { +ida_simple_remove (&swnode->parent->child_ids, swnode->id); +list_del (&swnode->entry); + }else { +ida_simple_remove (&swnode_root_ids, swnode->id); + } +if (swnode->allocated) {property_entries_free (swnode->node->properties);kfree (swnode->node);
@@ -844,13 +851,6 @@ void fwnode_remove_software_node(structif (!swnode)return ; -if (swnode->parent) { -ida_simple_remove (&swnode->parent->child_ids, swnode->id); -list_del (&swnode->entry); - }else { -ida_simple_remove (&swnode_root_ids, swnode->id); - } -kobject_put (&swnode->kobj); }EXPORT_SYMBOL_GPL (fwnode_remove_software_node);
Greg Kroah-Hartman
maintainerPATCH 34/50 lib: devres: add a helper function for ioremap_uc
In reply to Greg Kroah-HartmanFrom: Tuowen Zhao <[email protected]>
[ Upstream commit e537654b7039aacfe8ae629d49655c0e5692ad44 ]
Implement a resource managed strongly uncachable ioremap function.
--- include/linux/io.h | 2 ++ lib/devres.c | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+)
include/linux/io.h +2 -0
@@ -64,6 +64,8 @@ static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr)void __iomem *devm_ioremap (struct device *dev,resource_size_t offset,resource_size_t size); +void __iomem *devm_ioremap_uc (struct device *dev,resource_size_t offset, +resource_size_t size);void __iomem *devm_ioremap_nocache (struct device *dev,resource_size_t offset,resource_size_t size); void __iomem *devm_ioremap_wc(struct device *dev, resource_size_t offset,
lib/devres.c +19 -0
@@ -9,6 +9,7 @@enum devm_ioremap_type {DEVM_IOREMAP =0 ,DEVM_IOREMAP_NC , +DEVM_IOREMAP_UC ,DEVM_IOREMAP_WC , };
@@ -39,6 +40,9 @@ static void __iomem *__devm_ioremap(struct device *dev, resource_size_t offset,case DEVM_IOREMAP_NC : addr =ioremap_nocache (offset, size);break ; +case DEVM_IOREMAP_UC : + addr =ioremap_uc (offset, size); +break ;case DEVM_IOREMAP_WC : addr =ioremap_wc (offset, size);break ;
@@ -68,6 +72,21 @@ void __iomem *devm_ioremap(struct device *dev, resource_size_t offset, }EXPORT_SYMBOL (devm_ioremap); +/** +* devm_ioremap_uc - Managed ioremap_uc() +* @dev: Generic device to remap IO address for +* @offset: Resource address to map +* @size: Size of map +* +* Managed ioremap_uc(). Map is automatically unmapped on driver detach. +*/ +void __iomem *devm_ioremap_uc (struct device *dev,resource_size_t offset, +resource_size_t size) +{ +return __devm_ioremap (dev, offset, size,DEVM_IOREMAP_UC ); +} +EXPORT_SYMBOL_GPL (devm_ioremap_uc); +/** * devm_ioremap_nocache - Managed ioremap_nocache() * @dev: Generic device to remap IO address for
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 35/50 mfd: intel-lpss: Use devm_ioremap_uc for MMIO
In reply to Greg Kroah-HartmanFrom: Tuowen Zhao <[email protected]>
commit a8ff78f7f773142eb8a8befe5a95dd6858ebd635 upstream.
Some BIOS erroneously specifies write-combining BAR for intel-lpss-pci in MTRR. This will cause the system to hang during boot. If possible, this bug could be corrected with a firmware update.
This patch use devm_ioremap_uc to overwrite/ignore the MTRR settings by forcing the use of strongly uncachable pages for intel-lpss.
The BIOS bug is present on Dell XPS 13 7390 2-in-1:
[ 0.001734] 5 base 4000000000 mask 6000000000 write-combining
4000000000-7fffffffff : PCI Bus 0000:00
4000000000-400fffffff : 0000:00:02.0 (i915) 4010000000-4010000fff : 0000:00:15.0 (intel-lpss-pci)
--- drivers/mfd/intel-lpss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mfd/intel-lpss.c +1 -1
@@ -384,7 +384,7 @@ int intel_lpss_probe(struct device *dev,if (!lpss)return -ENOMEM ; - lpss->priv =devm_ioremap (dev, info->mem->start +LPSS_PRIV_OFFSET , + lpss->priv =devm_ioremap_uc (dev, info->mem->start +LPSS_PRIV_OFFSET ,LPSS_PRIV_SIZE );if (!lpss->priv)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 36/50 hexagon: clean up ioremap
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit ac32292c8552f7e8517be184e65dd09786e991f9 upstream.
Use ioremap as the main implemented function, and defined ioremap_nocache to it as a deprecated alias.
--- arch/hexagon/include/asm/io.h | 11 ++--------- arch/hexagon/kernel/hexagon_ksyms.c | 2 +- arch/hexagon/mm/ioremap.c | 2 +- 3 files changed, 4 insertions(+), 11 deletions(-)
arch/hexagon/include/asm/io.h +2 -9
@@ -171,16 +171,9 @@ static inline void writel(u32 data, vola#define writew_relaxed __raw_writew#define writel_relaxed __raw_writel -/* -* Need an mtype somewhere in here, for cache type deals? -* This is probably too long for an inline. -*/ -void __iomem *ioremap_nocache (unsigned long phys_addr,unsigned long size); +void __iomem *ioremap (unsigned long phys_addr,unsigned long size); +#define ioremap_nocache ioremap -static inline void __iomem *ioremap (unsigned long phys_addr,unsigned long size) -{ -return ioremap_nocache (phys_addr, size); -}static inline void iounmap (volatile void __iomem *addr) {
arch/hexagon/kernel/hexagon_ksyms.c +1 -1
@@ -20,7 +20,7 @@ EXPORT_SYMBOL(__vmgetie);EXPORT_SYMBOL (__vmsetie);EXPORT_SYMBOL (__vmyield);EXPORT_SYMBOL (empty_zero_page); -EXPORT_SYMBOL (ioremap_nocache); +EXPORT_SYMBOL (ioremap);EXPORT_SYMBOL (memcpy);EXPORT_SYMBOL (memset);
arch/hexagon/mm/ioremap.c +1 -1
@@ -9,7 +9,7 @@#include <linux/vmalloc.h> #include <linux/mm.h> -void __iomem *ioremap_nocache (unsigned long phys_addr,unsigned long size) +void __iomem *ioremap (unsigned long phys_addr,unsigned long size) {unsigned long last_addr, addr;unsigned long offset = phys_addr & ~PAGE_MASK ;
Greg Kroah-Hartman
maintainerPATCH 37/50 hexagon: define ioremap_uc
In reply to Greg Kroah-HartmanFrom: Nick Desaulniers <[email protected]>
commit 7312b70699252074d753c5005fc67266c547bbe3 upstream.
Similar to commit 38e45d81d14e ("sparc64: implement ioremap_uc") define ioremap_uc for hexagon to avoid errors from -Wimplicit-function-definition.
--- arch/hexagon/include/asm/io.h | 1 + 1 file changed, 1 insertion(+)
arch/hexagon/include/asm/io.h +1 -0
@@ -173,6 +173,7 @@ static inline void writel(u32 data, volavoid __iomem *ioremap (unsigned long phys_addr,unsigned long size);#define ioremap_nocache ioremap +#define ioremap_uc (X ,Y ) ioremap((X), (Y))static inline void iounmap (volatile void __iomem *addr)
Greg Kroah-Hartman
maintainerPATCH 38/50 ALSA: hda: Match both PCI ID and SSID for driver blacklist
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 977dfef40c8996b69afe23a9094d184049efb7bb upstream.
The commit 3c6fd1f07ed0 ("ALSA: hda: Add driver blacklist") added a new blacklist for the devices that are known to have empty codecs, and one of the entries was ASUS ROG Zenith II (PCI SSID 1043:874f). However, it turned out that the very same PCI SSID is used for the previous model that does have the valid HD-audio codecs and the change broke the sound on it.
Since the empty codec problem appear on the certain AMD platform (PCI ID 1022:1487), this patch changes the blacklist matching to both PCI ID and SSID using pci_match_id(). Also, the entry that was removed by the previous fix for ASUS ROG Zenigh II is re-added.
--- sound/pci/hda/hda_intel.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
sound/pci/hda/hda_intel.c +5 -4
@@ -2023,9 +2023,10 @@ static void pcm_mmap_prepare(struct snd_* some HD-audio PCI entries are exposed without any codecs, and such devices * should be ignored from the beginning. */ -static const struct snd_pci_quirk driver_blacklist[] = { -SND_PCI_QUIRK (0x1462 ,0xcb59 ,"MSI TRX40 Creator" ,0 ), -SND_PCI_QUIRK (0x1462 ,0xcb60 ,"MSI TRX40" ,0 ), +static const struct pci_device_id driver_blacklist[] = { + {PCI_DEVICE_SUB (0x1022 ,0x1487 ,0x1043 ,0x874f ) },/* ASUS ROG Zenith II / Strix */ + {PCI_DEVICE_SUB (0x1022 ,0x1487 ,0x1462 ,0xcb59 ) },/* MSI TRX40 Creator */ + {PCI_DEVICE_SUB (0x1022 ,0x1487 ,0x1462 ,0xcb60 ) },/* MSI TRX40 */ {} };
@@ -2064,7 +2065,7 @@ static int azx_probe(struct pci_dev *pcibool schedule_probe;int err; -if (snd_pci_quirk_lookup (pci, driver_blacklist)) { +if (pci_match_id (driver_blacklist, pci)) {dev_info (&pci->dev,"Skipping the blacklisted device\n" );return -ENODEV ; }
Greg Kroah-Hartman
maintainerPATCH 39/50 x86/kvm: fix a missing-prototypes "vmread_error"
In reply to Greg Kroah-HartmanFrom: Qian Cai <[email protected]>
commit 514ccc194971d0649e4e7ec8a9b3a6e33561d7bf upstream.
The commit 842f4be95899 ("KVM: VMX: Add a trampoline to fix VMREAD error handling") removed the declaration of vmread_error() causes a W=1 build failure with KVM_WERROR=y. Fix it by adding it back.
arch/x86/kvm/vmx/vmx.c:359:17: error: no previous prototype for 'vmread_error' [-Werror=missing-prototypes]
asmlinkage void vmread_error(unsigned long field, bool fault)
^~~~~~~~~~~~
Message-Id: <[email protected]>
--- arch/x86/kvm/vmx/ops.h | 1 + 1 file changed, 1 insertion(+)
arch/x86/kvm/vmx/ops.h +1 -0
@@ -12,6 +12,7 @@#define __ex (x) __kvm_handle_fault_on_reboot(x) +asmlinkage void vmread_error(unsigned long field, bool fault); __attribute__((regparm (0 )))void vmread_error_trampoline (unsigned long field,bool fault);void vmwrite_error (unsigned long field,unsigned long value);
Greg Kroah-Hartman
maintainerPATCH 40/50 dma-direct: exclude dma_direct_map_resource from the min_low_pfn check
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit 68a33b1794665ba8a1d1ef1d3bfcc7c587d380a6 upstream.
The valid memory address check in dma_capable only makes sense when mapping normal memory, not when using dma_map_resource to map a device resource. Add a new boolean argument to dma_capable to exclude that check for the dma_map_resource case.
--- arch/x86/kernel/amd_gart_64.c | 4 ++-- drivers/xen/swiotlb-xen.c | 4 ++-- include/linux/dma-direct.h | 5 +++-- kernel/dma/direct.c | 4 ++-- kernel/dma/swiotlb.c | 2 +- 5 files changed, 10 insertions(+), 9 deletions(-)
arch/x86/kernel/amd_gart_64.c +2 -2
@@ -185,13 +185,13 @@ static void iommu_full(struct device *destatic inline int need_iommu (struct device *dev,unsigned long addr,size_t size) { -return force_iommu || !dma_capable (dev, addr, size); +return force_iommu || !dma_capable (dev, addr, size, true); }static inline int nonforced_iommu (struct device *dev,unsigned long addr,size_t size) { -return !dma_capable (dev, addr, size); +return !dma_capable (dev, addr, size, true); }/* Map a single continuous physical area into the IOMMU.
drivers/xen/swiotlb-xen.c +2 -2
@@ -375,7 +375,7 @@ static dma_addr_t xen_swiotlb_map_page(s* we can safely return the device addr and not worry about bounce * buffering it. */ -if (dma_capable (dev, dev_addr, size) && +if (dma_capable (dev, dev_addr, size, true) && !range_straddles_page_boundary (phys, size) && !xen_arch_need_swiotlb (dev, phys, dev_addr) && swiotlb_force !=SWIOTLB_FORCE )
@@ -397,7 +397,7 @@ static dma_addr_t xen_swiotlb_map_page(s/* * Ensure that the address returned is DMA'ble */ -if (unlikely (!dma_capable (dev, dev_addr, size))) { +if (unlikely (!dma_capable (dev, dev_addr, size, true))) {swiotlb_tbl_unmap_single (dev, map, size, size, dir, attrs |DMA_ATTR_SKIP_CPU_SYNC );return DMA_MAPPING_ERROR ;
include/linux/dma-direct.h +3 -2
@@ -25,14 +25,15 @@ static inline phys_addr_t __dma_to_phys(return paddr + ((phys_addr_t )dev->dma_pfn_offset <<PAGE_SHIFT ); } -static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size) +static inline bool dma_capable (struct device *dev,dma_addr_t addr,size_t size, +bool is_ram) {dma_addr_t end = addr + size -1 ;if (!dev->dma_mask)return false; -if (!IS_ENABLED (CONFIG_ARCH_DMA_ADDR_T_64BIT ) && +if (is_ram && !IS_ENABLED (CONFIG_ARCH_DMA_ADDR_T_64BIT ) &&min (addr, end) <phys_to_dma (dev,PFN_PHYS (min_low_pfn)))return false;
kernel/dma/direct.c +2 -2
@@ -327,7 +327,7 @@ static inline bool dma_direct_possible(s size_t size) {return swiotlb_force !=SWIOTLB_FORCE && -dma_capable (dev, dma_addr, size); +dma_capable (dev, dma_addr, size, true); } dma_addr_t dma_direct_map_page(struct device *dev, struct page *page,
@@ -376,7 +376,7 @@ dma_addr_t dma_direct_map_resource(struc {dma_addr_t dma_addr = paddr; -if (unlikely (!dma_capable (dev, dma_addr, size))) { +if (unlikely (!dma_capable (dev, dma_addr, size, false))) {report_addr (dev, dma_addr, size);return DMA_MAPPING_ERROR ; }
kernel/dma/swiotlb.c +1 -1
@@ -678,7 +678,7 @@ bool swiotlb_map(struct device *dev, phy/* Ensure that the address returned is DMA'ble */ *dma_addr =__phys_to_dma (dev, *phys); -if (unlikely (!dma_capable (dev, *dma_addr, size))) { +if (unlikely (!dma_capable (dev, *dma_addr, size, true))) {swiotlb_tbl_unmap_single (dev, *phys, size, size, dir, attrs |DMA_ATTR_SKIP_CPU_SYNC );return false;
Re: [PATCH 5.4 40/50] dma-direct: exclude dma_direct_map_resource from the min_low_pfn check
Quoted 10 lines · Greg Kroah-Hartman
From: Christoph Hellwig <[email protected]>
commit
68a33b1794665ba8a1d1ef1d3bfcc7c587d380a6upstream.The valid memory address check in
dma_capableonly makes sense when mapping normal memory, not when usingdma_map_resourceto map a device resource. Add a new boolean argument todma_capableto exclude that check for thedma_map_resourcecase.
Quoted 6 lines
Fixes b12d66278dd6 ("dma-direct: check for overflows on 32 bit DMA addresses")Reported-by Marek Szyprowski <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>Acked-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>
<trim>
kernel/dma/direct.c static inline bool dma_direct_possible(s · line 330
Quoted 9 lines
kernel/dma/direct.c +1
-1@@ -327,7 +327,7 @@ static inline bool dma_direct_possible(s size_t size) {return swiotlb_force !=SWIOTLB_FORCE && -dma_capable (dev, dma_addr, size); +dma_capable (dev, dma_addr, size, true);
While building kernel Image for arm architecture the following error noticed on stale-rc 5.4 kernel branch.
# make -sk KBUILD_BUILD_USER=TuxBuild -C/linux -j16 ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf- HOSTCC=gcc CC="sccache
arm-linux-gnueabihf-gcc" O=build zImage
#
../kernel/dma/direct.c: In function ‘dma_direct_possible’:
../kernel/dma/direct.c:330:3: error: too many arguments to function
‘dma_capable’
330 | dma_capable(dev, dma_addr, size, true);
| ^~~~~~~~~~~
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/direct.c:10:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~~
In file included from ../include/linux/init.h:5,
from ../include/linux/memblock.h:12,
from ../kernel/dma/direct.c:7:
../kernel/dma/direct.c: In function ‘dma_direct_map_resource’:
../kernel/dma/direct.c:379:16: error: too many arguments to function
‘dma_capable’
379 | if (unlikely(!dma_capable(dev, dma_addr, size, false))) {
| ^~~~~~~~~~~
../include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/direct.c:10:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~~
make[3]: *** [../scripts/Makefile.build:266: kernel/dma/direct.o] Error 1
In file included from ../include/linux/string.h:6,
from ../include/linux/dma-mapping.h:6,
from ../include/linux/dma-direct.h:5,
from ../kernel/dma/swiotlb.c:24:
../kernel/dma/swiotlb.c: In function ‘swiotlb_map’:
../kernel/dma/swiotlb.c:681:16: error: too many arguments to function
‘dma_capable’
681 | if (unlikely(!dma_capable(dev, *dma_addr, size, true))) {
| ^~~~~~~~~~~
../include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/swiotlb.c:24:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~~Greg Kroah-Hartman
maintainerRe: [PATCH 5.4 40/50] dma-direct: exclude dma_direct_map_resource from the min_low_pfn check
Quoted 75 lines · Naresh Kamboju
Quoted 10 lines · Greg Kroah-Hartman
From: Christoph Hellwig <[email protected]>
commit
68a33b1794665ba8a1d1ef1d3bfcc7c587d380a6upstream.The valid memory address check in
dma_capableonly makes sense when mapping normal memory, not when usingdma_map_resourceto map a device resource. Add a new boolean argument todma_capableto exclude that check for thedma_map_resourcecase.Quoted 6 lines
Fixes b12d66278dd6 ("dma-direct: check for overflows on 32 bit DMA addresses")Reported-by Marek Szyprowski <[email protected]>Signed-off-by Christoph Hellwig <[email protected]>Acked-by Marek Szyprowski <[email protected]>Tested-by Marek Szyprowski <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]><trim>
kernel/dma/direct.c static inline bool dma_direct_possible(s · line 330
Quoted 9 lines
kernel/dma/direct.c +1
-1@@ -327,7 +327,7 @@ static inline bool dma_direct_possible(s size_t size) {return swiotlb_force !=SWIOTLB_FORCE && -dma_capable (dev, dma_addr, size); +dma_capable (dev, dma_addr, size, true);While building kernel Image for arm architecture the following error noticed on stale-rc 5.4 kernel branch.
# make -sk KBUILD_BUILD_USER=TuxBuild -C/linux -j16 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- HOSTCC=gcc CC="sccache arm-linux-gnueabihf-gcc" O=build zImage # ../kernel/dma/direct.c: In function ‘dma_direct_possible’: ../kernel/dma/direct.c:330:3: error: too many arguments to function ‘dma_capable’ 330 | dma_capable(dev, dma_addr, size, true); | ^~~~~~~~~~~ In file included from ../include/linux/dma-direct.h:12, from ../kernel/dma/direct.c:10: ../arch/arm/include/asm/dma-direct.h:17:20: note: declared here 17 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | ^~~~~~~~~~~ In file included from ../include/linux/init.h:5, from ../include/linux/memblock.h:12, from ../kernel/dma/direct.c:7: ../kernel/dma/direct.c: In function ‘dma_direct_map_resource’: ../kernel/dma/direct.c:379:16: error: too many arguments to function ‘dma_capable’ 379 | if (unlikely(!dma_capable(dev, dma_addr, size, false))) { | ^~~~~~~~~~~ ../include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’ 78 | # define unlikely(x) __builtin_expect(!!(x), 0) | ^ In file included from ../include/linux/dma-direct.h:12, from ../kernel/dma/direct.c:10: ../arch/arm/include/asm/dma-direct.h:17:20: note: declared here 17 | static inline bool dma_capable(struct device *dev, dma_addr_t addr, size_t size) | ^~~~~~~~~~~ make[3]: *** [../scripts/Makefile.build:266: kernel/dma/direct.o] Error 1 In file included from ../include/linux/string.h:6, from ../include/linux/dma-mapping.h:6, from ../include/linux/dma-direct.h:5, from ../kernel/dma/swiotlb.c:24: ../kernel/dma/swiotlb.c: In function ‘swiotlb_map’: ../kernel/dma/swiotlb.c:681:16: error: too many arguments to function ‘dma_capable’ 681 | if (unlikely(!dma_capable(dev, *dma_addr, size, true))) { | ^~~~~~~~~~~ ../include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
Quoted 8 lines
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/swiotlb.c:24:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~Ah crap, I think I remember trying to apply this in the past and running into these issues. I'll go drop it now and push out a -rc2, thanks!
greg k-h
Greg Kroah-Hartman
maintainerPATCH 41/50 platform/x86: GPD pocket fan: Fix error message when temp-limits are out of range
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 1d6f8c5bac93cceb2d4ac8e6331050652004d802 upstream.
Commit 1f27dbd8265d ("platform/x86: GPD pocket fan: Allow somewhat lower/higher temperature limits") changed the module-param sanity check to accept temperature limits between 20 and 90 degrees celcius.
But the error message printed when the module params are outside this range was not updated. This commit updates the error message to match the new min and max value for the temp-limits.
--- drivers/platform/x86/gpd-pocket-fan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/gpd-pocket-fan.c +1 -1
@@ -128,7 +128,7 @@ static int gpd_pocket_fan_probe(struct pfor (i =0 ; i <ARRAY_SIZE (temp_limits); i++) {if (temp_limits[i] <20000 || temp_limits[i] >90000 ) { -dev_err (&pdev->dev,"Invalid temp-limit %d (must be between 40000 and 70000)\n" , +dev_err (&pdev->dev,"Invalid temp-limit %d (must be between 20000 and 90000)\n" , temp_limits[i]); temp_limits[0 ] =TEMP_LIMIT0_DEFAULT ; temp_limits[1 ] =TEMP_LIMIT1_DEFAULT ;
Greg Kroah-Hartman
maintainerPATCH 42/50 ACPI: PM: s2idle: Fix comment in acpi_s2idle_prepare_late()
In reply to Greg Kroah-HartmanFrom: Rafael J. Wysocki <[email protected]>
commit 243a98894dc525ad2fbeb608722fcb682be3186d upstream.
Fix a comment in acpi_s2idle_prepare_late() that has become outdated after commit f0ac20c3f613 ("ACPI: EC: Fix flushing of pending work").
--- drivers/acpi/sleep.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/acpi/sleep.c +1 -4
@@ -979,10 +979,7 @@ static int acpi_s2idle_prepare_late(voidstatic void acpi_s2idle_sync (void ) { -/* -* The EC driver uses the system workqueue and an additional special -* one, so those need to be flushed too. -*/ +/* The EC driver uses special workqueues that need to be flushed. */ acpi_ec_flush_work ();acpi_os_wait_events_complete ();/* synchronize Notify handling */ }
Greg Kroah-Hartman
maintainerPATCH 43/50 mac80211: add ieee80211_is_any_nullfunc()
In reply to Greg Kroah-HartmanFrom: Thomas Pedersen <[email protected]>
commit 30b2f0be23fb40e58d0ad2caf8702c2a44cda2e1 upstream.
commit 08a5bdde3812 ("mac80211: consider QoS Null frames for STA_NULLFUNC_ACKED") Fixed a bug where we failed to take into account a
nullfunc frame can be either non-QoS or QoS. It turns out
there is at least one more bug inieee80211_sta_tx_notify(), introduced in
commit 7b6ddeaf27ec ("mac80211: use QoS NDP for AP probing"),
where we forgot to check for the QoS variant and so
assumed the QoS nullfunc frame never went out
Fix this by adding a helper ieee80211_is_any_nullfunc() which consolidates the check for non-QoS and QoS nullfunc frames. Replace existing compound conditionals and add a couple more missing checks for QoS variant.
--- include/linux/ieee80211.h | 9 +++++++++ net/mac80211/mlme.c | 2 +- net/mac80211/rx.c | 8 +++----- net/mac80211/status.c | 5 ++--- net/mac80211/tx.c | 2 +- 5 files changed, 16 insertions(+), 10 deletions(-)
include/linux/ieee80211.h +9 -0
@@ -620,6 +620,15 @@ static inline bool ieee80211_is_qos_null }/** +* ieee80211_is_any_nullfunc - check if frame is regular or QoS nullfunc frame +* @fc: frame control bytes in little-endian byteorder +*/ +static inline bool ieee80211_is_any_nullfunc (__le16 fc) +{ +return (ieee80211_is_nullfunc (fc) ||ieee80211_is_qos_nullfunc (fc)); +} + +/** * ieee80211_is_bufferable_mmpdu - check if frame is bufferable MMPDU * @fc: frame control field in little-endian byteorder */
net/mac80211/mlme.c +1 -1
@@ -2460,7 +2460,7 @@ void ieee80211_sta_tx_notify(struct ieeeif (!ieee80211_is_data (hdr->frame_control))return ; -if (ieee80211_is_nullfunc (hdr->frame_control) && +if (ieee80211_is_any_nullfunc (hdr->frame_control) && sdata->u.mgd.probe_send_count >0 ) {if (ack)ieee80211_sta_reset_conn_monitor (sdata);
net/mac80211/rx.c +3 -5
@@ -1450,8 +1450,7 @@ ieee80211_rx_h_check_dup(struct ieee8021return RX_CONTINUE ;if (ieee80211_is_ctl (hdr->frame_control) || -ieee80211_is_nullfunc (hdr->frame_control) || -ieee80211_is_qos_nullfunc (hdr->frame_control) || +ieee80211_is_any_nullfunc (hdr->frame_control) ||is_multicast_ether_addr (hdr->addr1))return RX_CONTINUE ;
@@ -1838,8 +1837,7 @@ ieee80211_rx_h_sta_process(struct ieee80* Drop (qos-)data::nullfunc frames silently, since they * are used only to control station power saving mode. */ -if (ieee80211_is_nullfunc (hdr->frame_control) || -ieee80211_is_qos_nullfunc (hdr->frame_control)) { +if (ieee80211_is_any_nullfunc (hdr->frame_control)) {I802_DEBUG_INC (rx->local->rx_handlers_drop_nullfunc);/*
@@ -2319,7 +2317,7 @@ static int ieee80211_drop_unencrypted(st/* Drop unencrypted frames if key is set. */ if (unlikely (!ieee80211_has_protected (fc) && - !ieee80211_is_nullfunc (fc) && + !ieee80211_is_any_nullfunc (fc) &&ieee80211_is_data (fc) && rx->key))return -EACCES ;
net/mac80211/status.c +2 -3
@@ -643,8 +643,7 @@ static void ieee80211_report_ack_skb(strrcu_read_lock (); sdata =ieee80211_sdata_from_skb (local, skb);if (sdata) { -if (ieee80211_is_nullfunc (hdr->frame_control) || -ieee80211_is_qos_nullfunc (hdr->frame_control)) +if (ieee80211_is_any_nullfunc (hdr->frame_control)) cfg80211_probe_status(sdata->dev, hdr->addr1, cookie, acked, info->status.ack_signal,
@@ -1030,7 +1029,7 @@ static void __ieee80211_tx_status(structI802_DEBUG_INC (local->dot11FailedCount); } - if ((ieee80211_is_nullfunc(fc) || ieee80211_is_qos_nullfunc(fc)) && + if (ieee80211_is_any_nullfunc(fc) && ieee80211_has_pm(fc) && ieee80211_hw_check(&local->hw, REPORTS_TX_ACK_STATUS) && !(info->flags & IEEE80211_TX_CTL_INJECTED) &&
net/mac80211/tx.c +1 -1
@@ -297,7 +297,7 @@ ieee80211_tx_h_check_assoc(struct ieee80if (unlikely (test_bit (SCAN_SW_SCANNING , &tx->local->scanning)) &&test_bit (SDATA_STATE_OFFCHANNEL , &tx->sdata->state) && !ieee80211_is_probe_req (hdr->frame_control) && - !ieee80211_is_nullfunc (hdr->frame_control)) + !ieee80211_is_any_nullfunc (hdr->frame_control))/* * When software scanning only nullfunc frames (to notify * the sleep state to the AP) and probe requests (for the
Greg Kroah-Hartman
maintainerPATCH 44/50 cgroup, netclassid: remove double cond_resched
In reply to Greg Kroah-HartmanFrom: Jiri Slaby <[email protected]>
commit 526f3d96b8f83b1b13d73bd0b5c79cc2c487ec8e upstream.
Commit 018d26fcd12a ("cgroup, netclassid: periodically release file_lock on classid") added a second cond_resched to write_classid indirectly by update_classid_task. Remove the one in write_classid.
--- net/core/netclassid_cgroup.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
net/core/netclassid_cgroup.c +1 -3
@@ -127,10 +127,8 @@ static int write_classid(struct cgroup_s cs->classid = (u32 )value;css_task_iter_start (css,0 , &it); -while ((p =css_task_iter_next (&it))) { +while ((p =css_task_iter_next (&it)))update_classid_task (p, cs->classid); -cond_resched (); - }css_task_iter_end (&it);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 45/50 libbpf: Fix readelf output parsing for Fedora
In reply to Greg Kroah-HartmanFrom: Thadeu Lima de Souza Cascardo <[email protected]>
commit aa915931ac3e53ccf371308e6750da510e3591dd upstream.
Fedora binutils has been patched to show "other info" for a symbol at the end of the line. This was done in order to support unmaintained scripts that would break with the extra info. [1]
[1] https://src.fedoraproject.org/rpms/binutils/c/b8265c46f7ddae23a792ee8306fbaaeacba83bf8
This in turn has been done to fix the build of ruby, because of checksec.
[2] Thanks Michael Ellerman for the pointer.
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1479302
As libbpf Makefile is not unmaintained, we can simply deal with either output format, by just removing the "other info" field, as it always comes inside brackets.
--- tools/lib/bpf/Makefile | 2 ++ 1 file changed, 2 insertions(+)
tools/lib/bpf/Makefile +2 -0
@@ -145,6 +145,7 @@ PC_FILE := $(addprefix $(OUTPUT),$(PC_F GLOBAL_SYM_COUNT = $(shell readelf -s --wide $(BPF_IN_SHARED) | \ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \ + sed 's/\[.*\]//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}' | \ sort -u | wc -l) VERSIONED_SYM_COUNT = $(shell readelf -s --wide $(OUTPUT)libbpf.so | \
@@ -217,6 +218,7 @@ check_abi: $(OUTPUT)libbpf.so "versioned in $(VERSION_SCRIPT)." >&2; \ readelf -s --wide $(BPF_IN_SHARED) | \ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \ + sed 's/\[.*\]//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$NF}'| \ sort -u > $(OUTPUT)libbpf_global_syms.tmp; \ readelf -s --wide $(OUTPUT)libbpf.so | \
Greg Kroah-Hartman
maintainerPATCH 46/50 mm/mremap: Add comment explaining the untagging behaviour of mremap()
In reply to Greg Kroah-HartmanFrom: Will Deacon <[email protected]>
commit b2a84de2a2deb76a6a51609845341f508c518c03 upstream.
Commit dcde237319e6 ("mm: Avoid creating virtual address aliases in brk()/mmap()/mremap()") changed mremap() so that only the 'old' address is untagged, leaving the 'new' address in the form it was passed from userspace. This prevents the unexpected creation of aliasing virtual mappings in userspace, but looks a bit odd when you read the code.
Add a comment justifying the untagging behaviour in mremap().
--- mm/mremap.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
mm/mremap.c +10 -0
@@ -606,6 +606,16 @@ SYSCALL_DEFINE5(mremap, unsigned long, aLIST_HEAD (uf_unmap_early);LIST_HEAD (uf_unmap); +/* +* There is a deliberate asymmetry here: we strip the pointer tag +* from the old address but leave the new address alone. This is +* for consistency with mmap(), where we prevent the creation of +* aliasing mappings in userspace by leaving the tag bits of the +* mapping address intact. A non-zero tag will cause the subsequent +* range checks to reject the address as invalid. +* +* See Documentation/arm64/tagged-address-abi.rst for more information. +*/ addr =untagged_addr (addr);if (flags & ~(MREMAP_FIXED |MREMAP_MAYMOVE ))
Greg Kroah-Hartman
maintainerPATCH 47/50 Revert "drm/amd/display: setting the DIG_MODE to the correct value."
In reply to Greg Kroah-HartmanFrom: Zhan Liu <[email protected]>
commit b73b7f48895a6a944a76a2d8cdd7feee72bb1f0b upstream.
This reverts commit 967a3b85bac91c55eff740e61bf270c2732f48b2.
Reason for revert: Root cause of this issue is found. The workaround is not needed anymore.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 9 --------- 1 file changed, 9 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -9
@@ -2768,15 +2768,6 @@ void core_link_enable_stream( CONTROLLER_DP_TEST_PATTERN_VIDEOMODE, COLOR_DEPTH_UNDEFINED); -/* This second call is needed to reconfigure the DIG -* as a workaround for the incorrect value being applied -* from transmitter control. -*/ -if (!dc_is_virtual_signal (pipe_ctx->stream->signal)) - stream->link->link_enc->funcs->setup ( - stream->link->link_enc, - pipe_ctx->stream->signal); -#ifdef CONFIG_DRM_AMD_DC_DSC_SUPPORT if (pipe_ctx->stream->timing.flags.DSC) { if (dc_is_dp_signal(pipe_ctx->stream->signal) ||
Greg Kroah-Hartman
maintainerPATCH 48/50 tools headers UAPI: Sync copy of arm64s asm/unistd.h with the kernel sources
In reply to Greg Kroah-HartmanFrom: Arnaldo Carvalho de Melo <[email protected]>
commit c75bec79fc080039e4575a0f239ea7b111aabe88 upstream.
To get the changes in:
3e3c8ca5a351 ("arm64: Move __ARCH_WANT_SYS_CLONE3 definition to uapi headers")
Silencing this tools/perf/ build warning:
Warning: Kernel ABI header at 'tools/arch/arm64/include/uapi/asm/unistd.h' differs from latest version at 'arch/arm64/include/uapi/asm/unistd.h' diff -u tools/arch/arm64/include/uapi/asm/unistd.h arch/arm64/include/uapi/asm/unistd.h
Which will probably end up enabling the use of "clone3" in 'perf trace -e', haven't checked the build with this change on an arm64 system.
--- tools/arch/arm64/include/uapi/asm/unistd.h | 1 + 1 file changed, 1 insertion(+)
tools/arch/arm64/include/uapi/asm/unistd.h +1 -0
@@ -19,5 +19,6 @@#define __ARCH_WANT_NEW_STAT#define __ARCH_WANT_SET_GET_RLIMIT#define __ARCH_WANT_TIME32_SYSCALLS +#define __ARCH_WANT_SYS_CLONE3#include <asm-generic/unistd.h>
Greg Kroah-Hartman
maintainerPATCH 49/50 udp: document udp_rcv_segment special case for looped packets
In reply to Greg Kroah-HartmanFrom: Willem de Bruijn <[email protected]>
commit d0208bf4da97f76237300afb83c097de25645de6 upstream.
Commit 6cd021a58c18a ("udp: segment looped gso packets correctly") fixes an issue with rare udp gso multicast packets looped onto the receive path.
The stable backport makes the narrowest change to target only these packets, when needed. As opposed to, say, expanding __udp_gso_segment, which is harder to reason to be free from unintended side-effects.
But the resulting code is hardly self-describing.
Document its purpose and rationale.
--- include/net/udp.h | 7 +++++++ 1 file changed, 7 insertions(+)
include/net/udp.h +7 -0
@@ -476,6 +476,13 @@ static inline struct sk_buff *udp_rcv_seif (!inet_get_convert_csum (sk)) features |=NETIF_F_IP_CSUM |NETIF_F_IPV6_CSUM ; +/* UDP segmentation expects packets of type CHECKSUM_PARTIAL or +* CHECKSUM_NONE in __udp_gso_segment. UDP GRO indeed builds partial +* packets in udp_gro_complete_segment. As does UDP GSO, verified by +* udp_send_skb. But when those packets are looped in dev_loopback_xmit +* their ip_summed is set to CHECKSUM_UNNECESSARY. Reset in this +* specific case, where PARTIAL is both correct and required. +*/ if (skb->pkt_type ==PACKET_LOOPBACK ) skb->ip_summed =CHECKSUM_PARTIAL ;
Greg Kroah-Hartman
maintainerPATCH 50/50 PM / devfreq: Add missing locking while setting suspend_freq
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
commit e1e047ace8cef6d143f38c7d769753f133becbe6 upstream.
Commit 2abb0d5268ae ("PM / devfreq: Lock devfreq in trans_stat_show") revealed a missing locking while calling devfreq_update_status() function during suspend/resume cycle.
Code analysis revealed that devfreq_set_target() function was called without needed locks held for setting device specific suspend_freq if such has been defined. This patch fixes that by adding the needed locking, what fixes following kernel warning on Exynos4412-based OdroidU3 board during system suspend:
PM: suspend entry (deep)
Filesystems sync: 0.002 seconds
Freezing user space processes ... (elapsed 0.001 seconds) done. OOM killer disabled.
Freezing remaining freezable tasks ... (elapsed 0.001 seconds) done.
------------[ cut here ]------------ WARNING: CPU: 2 PID: 1385 at drivers/devfreq/devfreq.c:204 devfreq_update_status+0xc0/0x188 Modules linked in: CPU: 2 PID: 1385 Comm: rtcwake Not tainted 5.4.0-rc6-next-20191111 #6848 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [<c0112588>] (unwind_backtrace) from [<c010e070>] (show_stack+0x10/0x14) [<c010e070>] (show_stack) from [<c0afb010>] (dump_stack+0xb4/0xe0) [<c0afb010>] (dump_stack) from [<c01272e0>] (__warn+0xf4/0x10c) [<c01272e0>] (__warn) from [<c01273a8>] (warn_slowpath_fmt+0xb0/0xb8) [<c01273a8>] (warn_slowpath_fmt) from [<c07d105c>] (devfreq_update_status+0xc0/0x188) [<c07d105c>] (devfreq_update_status) from [<c07d2d70>] (devfreq_set_target+0xb0/0x15c) [<c07d2d70>] (devfreq_set_target) from [<c07d3598>] (devfreq_suspend+0x2c/0x64) [<c07d3598>] (devfreq_suspend) from [<c05de0b0>] (dpm_suspend+0xa4/0x57c) [<c05de0b0>] (dpm_suspend) from [<c05def74>] (dpm_suspend_start+0x98/0xa0) [<c05def74>] (dpm_suspend_start) from [<c0195b58>] (suspend_devices_and_enter+0xec/0xc74) [<c0195b58>] (suspend_devices_and_enter) from [<c0196a20>] (pm_suspend+0x340/0x410) [<c0196a20>] (pm_suspend) from [<c019480c>] (state_store+0x6c/0xc8) [<c019480c>] (state_store) from [<c033fc50>] (kernfs_fop_write+0x10c/0x228) [<c033fc50>] (kernfs_fop_write) from [<c02a6d3c>] (__vfs_write+0x30/0x1d0) [<c02a6d3c>] (__vfs_write) from [<c02a9afc>] (vfs_write+0xa4/0x180) [<c02a9afc>] (vfs_write) from [<c02a9d58>] (ksys_write+0x60/0xd8) [<c02a9d58>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28) Exception stack(0xed3d7fa8 to 0xed3d7ff0) ... irq event stamp: 9667 hardirqs last enabled at (9679): [<c0b1e7c4>] _raw_spin_unlock_irq+0x20/0x58 hardirqs last disabled at (9698): [<c0b16a20>] __schedule+0xd8/0x818 softirqs last enabled at (9694): [<c01026fc>] __do_softirq+0x4fc/0x5fc softirqs last disabled at (9719): [<c012fe68>] irq_exit+0x16c/0x170 ---[ end trace 41ac5b57d046bdbc ]--- ------------[ cut here ]------------
--- drivers/devfreq/devfreq.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/devfreq/devfreq.c +4 -0
@@ -902,7 +902,9 @@ int devfreq_suspend_device(struct devfre }if (devfreq->suspend_freq) { +mutex_lock (&devfreq->lock); ret =devfreq_set_target (devfreq, devfreq->suspend_freq,0 ); +mutex_unlock (&devfreq->lock);if (ret)return ret; }
@@ -930,7 +932,9 @@ int devfreq_resume_device(struct devfreqreturn 0 ;if (devfreq->resume_freq) { +mutex_lock (&devfreq->lock); ret =devfreq_set_target (devfreq, devfreq->resume_freq,0 ); +mutex_unlock (&devfreq->lock);if (ret)return ret; }
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.40 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 10 May 2020 12:29:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.40-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
<trim>
Quoted 2 lines
Christoph Hellwig <[email protected]>
dma-direct: excludedma_direct_map_resourcefrom themin_low_pfncheck
While building kernel Image for arm architecture the following error noticed on stable-rc 5.4 kernel branch.
# make -sk KBUILD_BUILD_USER=TuxBuild -C/linux -j16 ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf- HOSTCC=gcc CC="sccache
arm-linux-gnueabihf-gcc" O=build zImage
#
../kernel/dma/direct.c: In function ‘dma_direct_possible’:
../kernel/dma/direct.c:330:3: error: too many arguments to function
‘dma_capable’
330 | dma_capable(dev, dma_addr, size, true);
| ^~~~~~~~~~~
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/direct.c:10:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~~
In file included from ../include/linux/init.h:5,
from ../include/linux/memblock.h:12,
from ../kernel/dma/direct.c:7:
../kernel/dma/direct.c: In function ‘dma_direct_map_resource’:
../kernel/dma/direct.c:379:16: error: too many arguments to function
‘dma_capable’
379 | if (unlikely(!dma_capable(dev, dma_addr, size, false))) {
| ^~~~~~~~~~~
../include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/direct.c:10:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~~
make[3]: *** [../scripts/Makefile.build:266: kernel/dma/direct.o] Error 1
In file included from ../include/linux/string.h:6,
from ../include/linux/dma-mapping.h:6,
from ../include/linux/dma-direct.h:5,
from ../kernel/dma/swiotlb.c:24:
../kernel/dma/swiotlb.c: In function ‘swiotlb_map’:
../kernel/dma/swiotlb.c:681:16: error: too many arguments to function
‘dma_capable’
681 | if (unlikely(!dma_capable(dev, *dma_addr, size, true))) {
| ^~~~~~~~~~~
../include/linux/compiler.h:78:42: note: in definition of macro ‘unlikely’
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
In file included from ../include/linux/dma-direct.h:12,
from ../kernel/dma/swiotlb.c:24:
../arch/arm/include/asm/dma-direct.h:17:20: note: declared here
17 | static inline bool dma_capable(struct device *dev, dma_addr_t
addr, size_t size)
| ^~~~~~~~~~~Full build log,
https://gitlab.com/Linaro/lkft/kernel-runs/-/jobs/544288767
Signature · 2 lines
Linaro LKFT https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.40 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 10 May 2020 12:29:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.40-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. I am seeing the following regression in dmesg and with a new emergency message.
Initramfs unpacking failed: Decoding failed
I don't know why yet. I will debug and let you know.
thanks,
-- Shuah
Quoted 20 lines · shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.40 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 10 May 2020 12:29:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.40-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Quoted 6 lines
Compiled and booted on my test system. I am seeing the following regression in dmesg and with a new emergency message.
Initramfs unpacking failed: Decoding failed
I don't know why yet. I will debug and let you know.
At a guess: you upgraded to Ubuntu 20.04, and the default initramfs compression changed to lz4. Or something like that.
Ben.
Signature · 3 lines
Ben Hutchings, Software Developer Codethink Ltd
https://www.codethink.co.uk/ Dale House, 35 Dale Street
Manchester, M1 2HF, United KingdomQuoted 24 lines · Ben Hutchings
Quoted 23 lines · shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.40 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 10 May 2020 12:29:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.40-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. I am seeing the following regression in dmesg and with a new emergency message.
Quoted 7 lines
Quoted 3 lines
Initramfs unpacking failed: Decoding failed
I don't know why yet. I will debug and let you know.
At a guess: you upgraded to Ubuntu 20.04, and the default initramfs compression changed to lz4. Or something like that.
Right, I remembered I ran into a similar problem after upgrading to 19.10 and went looking for info. instead of doing bisect.
That is what I found in the following thread:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1835660
Oddly it started showing up before I upgraded on Ubuntu 19.10.
thanks,
-- Shuah
thanks,
-- Shuah
Quoted 24 lines · Ben Hutchings
Quoted 23 lines · shuah
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.40 release. There are 50 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sun, 10 May 2020 12:29:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.40-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. I am seeing the following regression in dmesg and with a new emergency message.
Quoted 7 lines
Quoted 3 lines
Initramfs unpacking failed: Decoding failed
I don't know why yet. I will debug and let you know.
At a guess: you upgraded to Ubuntu 20.04, and the default initramfs compression changed to lz4. Or something like that.
Sounds like a reasonable guess. I looked into the 4.9.y changes since v4.9.222, and nothing in there even remotely points to an initramfs related change.
Guenter