5.4.53-rc1 review
Greg Kroah-Hartman
maintainerPATCH 127/215 soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data
In reply to Greg Kroah-HartmanFrom: Maulik Shah <[email protected]>
commit f5ac95f9ca2f439179a5baf48e1c0f22f83d936e upstream.
TCSes have previously programmed data when rpmh_flush() is called. This can cause old data to trigger along with newly flushed.
Fix this by cleaning SLEEP and WAKE TCSes before new data is flushed.
With this there is no need to invoke rpmh_rsc_invalidate() call from rpmh_invalidate().
Simplify rpmh_invalidate() by moving invalidate_batch() inside.
--- drivers/soc/qcom/rpmh.c | 41 ++++++++++++++++++----------------------- 1 file changed, 18 insertions(+), 23 deletions(-)
drivers/soc/qcom/rpmh.c +18 -23
@@ -317,19 +317,6 @@ static int flush_batch(struct rpmh_ctrlrreturn ret; } -static void invalidate_batch (struct rpmh_ctrlr *ctrlr) -{ -struct batch_cache_req *req, *tmp; -unsigned long flags; - -spin_lock_irqsave (&ctrlr->cache_lock, flags); -list_for_each_entry_safe (req, tmp, &ctrlr->batch_cache, list) -kfree (req); -INIT_LIST_HEAD (&ctrlr->batch_cache); - ctrlr->dirty = true; -spin_unlock_irqrestore (&ctrlr->cache_lock, flags); -} -/** * rpmh_write_batch: Write multiple sets of RPMH commands and wait for the * batch to finish.
@@ -469,6 +456,13 @@ int rpmh_flush(const struct device *dev)return 0 ; } +/* Invalidate the TCSes first to avoid stale data */ +do { + ret =rpmh_rsc_invalidate (ctrlr_to_drv (ctrlr)); + }while (ret == -EAGAIN ); +if (ret) +return ret; +/* First flush the cached batch requests */ ret =flush_batch (ctrlr);if (ret)
@@ -500,24 +494,25 @@ int rpmh_flush(const struct device *dev)EXPORT_SYMBOL (rpmh_flush);/** -* rpmh_invalidate: Invalidate all sleep and active sets -* sets. +* rpmh_invalidate: Invalidate sleep and wake sets in batch_cache * * @dev: The device making the request * -* Invalidate the sleep and active values in the TCS blocks. +* Invalidate the sleep and wake values in batch_cache. */ int rpmh_invalidate (const struct device *dev) {struct rpmh_ctrlr *ctrlr =get_rpmh_ctrlr (dev); -int ret; - -invalidate_batch (ctrlr); +struct batch_cache_req *req, *tmp; +unsigned long flags; -do { - ret =rpmh_rsc_invalidate (ctrlr_to_drv (ctrlr)); - }while (ret == -EAGAIN ); +spin_lock_irqsave (&ctrlr->cache_lock, flags); +list_for_each_entry_safe (req, tmp, &ctrlr->batch_cache, list) +kfree (req); +INIT_LIST_HEAD (&ctrlr->batch_cache); + ctrlr->dirty = true; +spin_unlock_irqrestore (&ctrlr->cache_lock, flags); -return ret; +return 0 ; }EXPORT_SYMBOL (rpmh_invalidate);
Greg Kroah-Hartman
maintainerPATCH 126/215 soc: qcom: rpmh: Update dirty flag only when data changes
In reply to Greg Kroah-HartmanFrom: Maulik Shah <[email protected]>
commit bb7000677a1b287206c8d4327c62442fa3050a8f upstream.
Currently rpmh ctrlr dirty flag is set for all cases regardless of data is really changed or not. Add changes to update dirty flag when data is changed to newer values. Update dirty flag everytime when data in batch cache is updated since rpmh_flush() may get invoked from any CPU instead of only last CPU going to low power mode.
Also move dirty flag updates to happen from within cache_lock and remove unnecessary INIT_LIST_HEAD() call and a default case from switch.
--- drivers/soc/qcom/rpmh.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/soc/qcom/rpmh.c +11 -8
@@ -119,6 +119,7 @@ static struct cache_req *cache_rpm_reque {struct cache_req *req;unsigned long flags; +u32 old_sleep_val, old_wake_val;spin_lock_irqsave (&ctrlr->cache_lock, flags); req =__find_req (ctrlr, cmd->addr);
@@ -133,26 +134,27 @@ static struct cache_req *cache_rpm_reque req->addr = cmd->addr; req->sleep_val = req->wake_val =UINT_MAX ; -INIT_LIST_HEAD (&req->list);list_add_tail (&req->list, &ctrlr->cache); existing: + old_sleep_val = req->sleep_val; + old_wake_val = req->wake_val; +switch (state) {case RPMH_ACTIVE_ONLY_STATE : -if (req->sleep_val !=UINT_MAX ) - req->wake_val = cmd->data; -break ;case RPMH_WAKE_ONLY_STATE : req->wake_val = cmd->data;break ;case RPMH_SLEEP_STATE : req->sleep_val = cmd->data;break ; -default : -break ; } - ctrlr->dirty = true; + ctrlr->dirty = (req->sleep_val != old_sleep_val || + req->wake_val != old_wake_val) && + req->sleep_val !=UINT_MAX && + req->wake_val !=UINT_MAX ; + unlock:spin_unlock_irqrestore (&ctrlr->cache_lock, flags);
@@ -287,6 +289,7 @@ static void cache_batch(struct rpmh_ctrlspin_lock_irqsave (&ctrlr->cache_lock, flags);list_add_tail (&req->list, &ctrlr->batch_cache); + ctrlr->dirty = true;spin_unlock_irqrestore (&ctrlr->cache_lock, flags); }
@@ -323,6 +326,7 @@ static void invalidate_batch(struct rpmhlist_for_each_entry_safe (req, tmp, &ctrlr->batch_cache, list)kfree (req);INIT_LIST_HEAD (&ctrlr->batch_cache); + ctrlr->dirty = true;spin_unlock_irqrestore (&ctrlr->cache_lock, flags); }
@@ -509,7 +513,6 @@ int rpmh_invalidate(const struct deviceint ret;invalidate_batch (ctrlr); - ctrlr->dirty = true; do { ret = rpmh_rsc_invalidate(ctrlr_to_drv(ctrlr));
Greg Kroah-Hartman
maintainerPATCH 124/215 PCI/PM: Call .bridge_d3() hook only if non-NULL
In reply to Greg Kroah-HartmanFrom: Bjorn Helgaas <[email protected]>
commit c3aaf086701d05a82c8156ee8620af41e5a7d6fe upstream.
26ad34d510a8 ("PCI / ACPI: Whitelist D3 for more PCIe hotplug ports") added the struct pci_platform_pm_ops.bridge_d3() function pointer and platform_pci_bridge_d3() to use it.
The .bridge_d3() op is implemented by acpi_pci_platform_pm, but not by mid_pci_platform_pm. We don't expect platform_pci_bridge_d3() to be called on Intel MID platforms, but nothing in the code itself would prevent that.
Check the .bridge_d3() pointer for NULL before calling it.
--- drivers/pci/pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/pci/pci.c +3 -1
@@ -802,7 +802,9 @@ static inline bool platform_pci_need_resstatic inline bool platform_pci_bridge_d3 (struct pci_dev *dev) { -return pci_platform_pm ? pci_platform_pm->bridge_d3 (dev) : false; +if (pci_platform_pm && pci_platform_pm->bridge_d3) +return pci_platform_pm->bridge_d3 (dev); +return false; }/**
Greg Kroah-Hartman
maintainerPATCH 118/215 regmap: debugfs: Dont sleep while atomic for fast_io regmaps
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 299632e54b2e692d2830af84be51172480dc1e26 ]
If a regmap has "fast_io" set then its lock function uses a spinlock. That doesn't work so well with the functions:
* regmap_cache_only_write_file()
* regmap_cache_bypass_write_file()
Both of the above functions have the pattern:
1. Lock the regmap.
2. Call:
debugfs_write_file_bool()
copy_from_user()
__might_fault()
__might_sleep()Let's reorder things a bit so that we do all of our sleepable functions before we grab the lock.
--- drivers/base/regmap/regmap-debugfs.c | 52 ++++++++++++++++------------ 1 file changed, 29 insertions(+), 23 deletions(-)
drivers/base/regmap/regmap-debugfs.c +29 -23
@@ -457,29 +457,31 @@ static ssize_t regmap_cache_only_write_file(struct file *file, {struct regmap *map =container_of (file->private_data, struct regmap, cache_only); -ssize_t result; -bool was_enabled, require_sync = false; +bool new_val, require_sync = false;int err; - map->lock (map->lock_arg); + err =kstrtobool_from_user (user_buf, count, &new_val); +/* Ignore malforned data like debugfs_write_file_bool() */ +if (err) +return count; - was_enabled = map->cache_only; + err =debugfs_file_get (file->f_path.dentry); +if (err) +return err; - result =debugfs_write_file_bool (file, user_buf, count, ppos); -if (result <0 ) { - map->unlock (map->lock_arg); -return result; - } + map->lock (map->lock_arg); -if (map->cache_only && !was_enabled) { +if (new_val && !map->cache_only) {dev_warn (map->dev,"debugfs cache_only=Y forced\n" );add_taint (TAINT_USER ,LOCKDEP_STILL_OK ); - }else if (!map->cache_only && was_enabled) { + }else if (!new_val && map->cache_only) {dev_warn (map->dev,"debugfs cache_only=N forced: syncing cache\n" ); require_sync = true; } + map->cache_only = new_val; map->unlock (map->lock_arg); +debugfs_file_put (file->f_path.dentry);if (require_sync) { err =regcache_sync (map);
@@ -487,7 +489,7 @@ static ssize_t regmap_cache_only_write_file(struct file *file,dev_err (map->dev,"Failed to sync cache %d\n" , err); } -return result; +return count; }static const struct file_operations regmap_cache_only_fops = {
@@ -502,28 +504,32 @@ static ssize_t regmap_cache_bypass_write_file(struct file *file, {struct regmap *map =container_of (file->private_data, struct regmap, cache_bypass); -ssize_t result; -bool was_enabled; +bool new_val; +int err; - map->lock (map->lock_arg); + err =kstrtobool_from_user (user_buf, count, &new_val); +/* Ignore malforned data like debugfs_write_file_bool() */ +if (err) +return count; - was_enabled = map->cache_bypass; + err =debugfs_file_get (file->f_path.dentry); +if (err) +return err; - result =debugfs_write_file_bool (file, user_buf, count, ppos); -if (result <0 ) - goto out; + map->lock (map->lock_arg); -if (map->cache_bypass && !was_enabled) { +if (new_val && !map->cache_bypass) {dev_warn (map->dev,"debugfs cache_bypass=Y forced\n" );add_taint (TAINT_USER ,LOCKDEP_STILL_OK ); - }else if (!map->cache_bypass && was_enabled) { + }else if (!new_val && map->cache_bypass) {dev_warn (map->dev,"debugfs cache_bypass=N forced\n" ); } + map->cache_bypass = new_val; -out: map->unlock (map->lock_arg); +debugfs_file_put (file->f_path.dentry); -return result; +return count; }static const struct file_operations regmap_cache_bypass_fops = {
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 119/215 copy_xstate_to_kernel: Fix typo which caused GDB regression
In reply to Greg Kroah-HartmanFrom: Kevin Buettner <[email protected]>
commit 5714ee50bb4375bd586858ad800b1d9772847452 upstream.
This fixes a regression encountered while running the gdb.base/corefile.exp test in GDB's test suite.
In my testing, the typo prevented the sw_reserved field of struct fxregs_state from being output to the kernel XSAVES area. Thus the correct mask corresponding to XCR0 was not present in the core file for GDB to interrogate, resulting in the following behavior:
[kev@f32-1 gdb]$ ./gdb -q testsuite/outputs/gdb.base/corefile/corefile testsuite/outputs/gdb.base/corefile/corefile.core Reading symbols from testsuite/outputs/gdb.base/corefile/corefile...
[New LWP 232880]
warning: Unexpected size of section `.reg-xstate/232880' in core file.
With the typo fixed, the test works again as expected.
--- arch/x86/kernel/fpu/xstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/fpu/xstate.c +1 -1
@@ -1017,7 +1017,7 @@ int copy_xstate_to_kernel(void *kbuf, stcopy_part (offsetof(struct fxregs_state , st_space),128 , &xsave->i387.st_space, &kbuf, &offset_start, &count);if (header.xfeatures &XFEATURE_MASK_SSE ) -copy_part (xstate_offsets[XFEATURE_MASK_SSE ],256 , +copy_part (xstate_offsets[XFEATURE_SSE ],256 , &xsave->i387.xmm_space, &kbuf, &offset_start, &count);/* * Fill xsave->i387.sw_reserved value for ptrace frame:
Greg Kroah-Hartman
maintainerPATCH 113/215 Revert "thermal: mediatek: fix register index error"
In reply to Greg Kroah-HartmanFrom: Enric Balletbo i Serra <[email protected]>
[ Upstream commit a8f62f183021be389561570ab5f8c701a5e70298 ]
This reverts commit eb9aecd90d1a39601e91cd08b90d5fee51d321a6
The above patch is supposed to fix a register index error on mt2701. It is not clear if the problem solved is a hang or just an invalid value returned, my guess is the second. The patch introduces, though, a new hang on MT8173 device making them unusable. So, seems reasonable, revert the patch because introduces a worst issue.
The reason I send a revert instead of trying to fix the issue for MT8173 is because the information needed to fix the issue is in the datasheet and is not public. So I am not really able to fix it.
Fixes the following bug when CONFIG_MTK_THERMAL is set on MT8173 devices.
[ 2.222488] Unable to handle kernel paging request at virtual address ffff8000125f5001 [ 2.230421] Mem abort info: [ 2.233207] ESR = 0x96000021 [ 2.236261] EC = 0x25: DABT (current EL), IL = 32 bits [ 2.241571] SET = 0, FnV = 0 [ 2.244623] EA = 0, S1PTW = 0 [ 2.247762] Data abort info: [ 2.250640] ISV = 0, ISS = 0x00000021 [ 2.254473] CM = 0, WnR = 0 [ 2.257544] swapper pgtable: 4k pages, 48-bit VAs, pgdp=0000000041850000 [ 2.264251] [ffff8000125f5001] pgd=000000013ffff003, pud=000000013fffe003, pmd=000000013fff9003, pte=006800001100b707 [ 2.274867] Internal error: Oops: 96000021 [#1] PREEMPT SMP [ 2.280432] Modules linked in: [ 2.283483] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.7.0-rc6+ #162 [ 2.289914] Hardware name: Google Elm (DT) [ 2.294003] pstate: 20000005 (nzCv daif -PAN -UAO) [ 2.298792] pc : mtk_read_temp+0xb8/0x1c8 [ 2.302793] lr : mtk_read_temp+0x7c/0x1c8 [ 2.306794] sp : ffff80001003b930 [ 2.310100] x29: ffff80001003b930 x28: 0000000000000000 [ 2.315404] x27: 0000000000000002 x26: ffff0000f9550b10 [ 2.320709] x25: ffff0000f9550a80 x24: 0000000000000090 [ 2.326014] x23: ffff80001003ba24 x22: 00000000610344c0 [ 2.331318] x21: 0000000000002710 x20: 00000000000001f4 [ 2.336622] x19: 0000000000030d40 x18: ffff800011742ec0 [ 2.341926] x17: 0000000000000001 x16: 0000000000000001 [ 2.347230] x15: ffffffffffffffff x14: ffffff0000000000 [ 2.352535] x13: ffffffffffffffff x12: 0000000000000028 [ 2.357839] x11: 0000000000000003 x10: ffff800011295ec8 [ 2.363143] x9 : 000000000000291b x8 : 0000000000000002 [ 2.368447] x7 : 00000000000000a8 x6 : 0000000000000004 [ 2.373751] x5 : 0000000000000000 x4 : ffff800011295cb0 [ 2.379055] x3 : 0000000000000002 x2 : ffff8000125f5001 [ 2.384359] x1 : 0000000000000001 x0 : ffff0000f9550a80 [ 2.389665] Call trace: [ 2.392105] mtk_read_temp+0xb8/0x1c8 [ 2.395760] of_thermal_get_temp+0x2c/0x40 [ 2.399849] thermal_zone_get_temp+0x78/0x160 [ 2.404198] thermal_zone_device_update.part.0+0x3c/0x1f8 [ 2.409589] thermal_zone_device_update+0x34/0x48 [ 2.414286] of_thermal_set_mode+0x58/0x88 [ 2.418375] thermal_zone_of_sensor_register+0x1a8/0x1d8 [ 2.423679] devm_thermal_zone_of_sensor_register+0x64/0xb0 [ 2.429242] mtk_thermal_probe+0x690/0x7d0 [ 2.433333] platform_drv_probe+0x5c/0xb0 [ 2.437335] really_probe+0xe4/0x448 [ 2.440901] driver_probe_device+0xe8/0x140 [ 2.445077] device_driver_attach+0x7c/0x88 [ 2.449252] __driver_attach+0xac/0x178 [ 2.453082] bus_for_each_dev+0x78/0xc8 [ 2.456909] driver_attach+0x2c/0x38 [ 2.460476] bus_add_driver+0x14c/0x230 [ 2.464304] driver_register+0x6c/0x128 [ 2.468131] __platform_driver_register+0x50/0x60 [ 2.472831] mtk_thermal_driver_init+0x24/0x30 [ 2.477268] do_one_initcall+0x50/0x298 [ 2.481098] kernel_init_freeable+0x1ec/0x264 [ 2.485450] kernel_init+0x1c/0x110 [ 2.488931] ret_from_fork+0x10/0x1c [ 2.492502] Code: f9401081 f9400402 b8a67821 8b010042 (b9400042) [ 2.498599] ---[ end trace e43e3105ed27dc99 ]--- [ 2.503367] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b [ 2.511020] SMP: stopping secondary CPUs [ 2.514941] Kernel Offset: disabled [ 2.518421] CPU features: 0x090002,25006005 [ 2.522595] Memory Limit: none [ 2.525644] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]--
--- drivers/thermal/mtk_thermal.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/thermal/mtk_thermal.c +2 -4
@@ -594,8 +594,7 @@ static int mtk_thermal_bank_temperature(struct mtk_thermal_bank *bank)u32 raw;for (i =0 ; i < conf->bank_data[bank->id].num_sensors; i++) { - raw =readl (mt->thermal_base + - conf->msr[conf->bank_data[bank->id].sensors[i]]); + raw =readl (mt->thermal_base + conf->msr[i]); temp = raw_to_mcelsius(mt, conf->bank_data[bank->id].sensors[i],
@@ -736,8 +735,7 @@ static void mtk_thermal_init_bank(struct mtk_thermal *mt, int num,for (i =0 ; i < conf->bank_data[num].num_sensors; i++)writel (conf->sensor_mux_values[conf->bank_data[num].sensors[i]], - mt->thermal_base + - conf->adcpnp[conf->bank_data[num].sensors[i]]); + mt->thermal_base + conf->adcpnp[i]);writel ((1 << conf->bank_data[num].num_sensors) -1 , controller_base +TEMP_MONCTL0 );
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 110/215 NFS: Fix interrupted slots by sending a solo SEQUENCE operation
In reply to Greg Kroah-HartmanFrom: Anna Schumaker <[email protected]>
[ Upstream commit 913fadc5b105c3619d9e8d0fe8899ff1593cc737 ]
We used to do this before 3453d5708b33, but this was changed to better handle the NFS4ERR_SEQ_MISORDERED error code. This commit fixed the slot re-use case when the server doesn't receive the interrupted operation, but if the server does receive the operation then it could still end up replying to the client with mis-matched operations from the reply cache.
We can fix this by sending a SEQUENCE to the server while recovering from a SEQ_MISORDERED error when we detect that we are in an interrupted slot situation.
--- fs/nfs/nfs4proc.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +18 -2
@@ -774,6 +774,14 @@ static void nfs4_slot_sequence_acked(struct nfs4_slot *slot, slot->seq_nr_last_acked = seqnr; } +static void nfs4_probe_sequence (struct nfs_client *client,const struct cred *cred, +struct nfs4_slot *slot) +{ +struct rpc_task *task =_nfs41_proc_sequence (client, cred, slot, true); +if (!IS_ERR (task)) +rpc_put_task_async (task); +} +static int nfs41_sequence_process (struct rpc_task *task,struct nfs4_sequence_res *res) {
@@ -790,6 +798,7 @@ static int nfs41_sequence_process(struct rpc_task *task, goto out; session = slot->table->session; + clp = session->clp;trace_nfs4_sequence_done (session, res);
@@ -804,7 +813,6 @@ static int nfs41_sequence_process(struct rpc_task *task,nfs4_slot_sequence_acked (slot, slot->seq_nr);/* Update the slot's sequence and clientid lease timer */ slot->seq_done =1 ; - clp = session->clp;do_renew_lease (clp, res->sr_timestamp);/* Check sequence flags */ nfs41_handle_sequence_flag_errors(clp, res->sr_status_flags,
@@ -852,10 +860,18 @@ static int nfs41_sequence_process(struct rpc_task *task,/* * Were one or more calls using this slot interrupted? * If the server never received the request, then our -* transmitted slot sequence number may be too high. +* transmitted slot sequence number may be too high. However, +* if the server did receive the request then it might +* accidentally give us a reply with a mismatched operation. +* We can sort this out by sending a lone sequence operation +* to the server on the same slot. */ if ((s32)(slot->seq_nr - slot->seq_nr_last_acked) >1 ) { slot->seq_nr--; +if (task->tk_msg.rpc_proc != &nfs4_procedures[NFSPROC4_CLNT_SEQUENCE ]) { +nfs4_probe_sequence (clp, task->tk_msg.rpc_cred, slot); + res->sr_slot =NULL ; + } goto retry_nowait; }/*
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 67/215 ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879
In reply to Greg Kroah-HartmanFrom: Suman Anna <[email protected]>
[ Upstream commit 2f14101a1d760db72393910d481fbf7768c44530 ]
Errata Title:
i879: DSP MStandby requires CD_EMU in SW_WKUP
Description:
The DSP requires the internal emulation clock to be actively toggling in order to successfully enter a low power mode via execution of the IDLE instruction and PRCM MStandby/Idle handshake. This assumes that other prerequisites and software sequence are followed.
Workaround:
The emulation clock to the DSP is free-running anytime CCS is connected via JTAG debugger to the DSP subsystem or when the CD_EMU clock domain is set in SW_WKUP mode. The CD_EMU domain can be set in SW_WKUP mode via the CM_EMU_CLKSTCTRL [1:0]CLKTRCTRL field.
Implementation:
This patch implements this workaround by denying the HW_AUTO mode for the EMU clockdomain during the power-up of any DSP processor and re-enabling the HW_AUTO mode during the shutdown of the last DSP processor (actually done during the enabling and disabling of the respective DSP MDMA MMUs). Reference counting has to be used to manage the independent sequencing between the multiple DSP processors.
This switching is done at runtime rather than a static clockdomain flags value to meet the target power domain state for the EMU power domain during suspend.
Note that the DSP MStandby behavior is not consistent across all boards prior to this fix. Please see commit 45f871eec6c0 ("ARM:
OMAP2+: Extend DRA7 IPU1 MMU pdata quirks to DSP MDMA MMUs") for details.
--- arch/arm/mach-omap2/omap-iommu.c | 43 +++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-)
arch/arm/mach-omap2/omap-iommu.c +40 -3
@@ -11,14 +11,43 @@#include "omap_hwmod.h" #include "omap_device.h" +#include "clockdomain.h" #include "powerdomain.h" +static void omap_iommu_dra7_emu_swsup_config (struct platform_device *pdev, +bool enable) +{ +static struct clockdomain *emu_clkdm; +static DEFINE_SPINLOCK (emu_lock); +static atomic_t count; +struct device_node *np = pdev->dev.of_node; + +if (!of_device_is_compatible (np,"ti,dra7-dsp-iommu" )) +return ; + +if (!emu_clkdm) { + emu_clkdm =clkdm_lookup ("emu_clkdm" ); +if (WARN_ON_ONCE (!emu_clkdm)) +return ; + } + +spin_lock (&emu_lock); + +if (enable && (atomic_inc_return (&count) ==1 )) +clkdm_deny_idle (emu_clkdm); +else if (!enable && (atomic_dec_return (&count) ==0 )) +clkdm_allow_idle (emu_clkdm); + +spin_unlock (&emu_lock); +} +int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev,bool request,u8 *pwrst) {struct powerdomain *pwrdm;struct omap_device *od;u8 next_pwrst; +int ret =0 ; od =to_omap_device (pdev);if (!od)
@@ -31,13 +60,21 @@ int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request,if (!pwrdm)return -EINVAL ; -if (request) +if (request) { *pwrst =pwrdm_read_next_pwrst (pwrdm); +omap_iommu_dra7_emu_swsup_config (pdev, true); + }if (*pwrst >PWRDM_POWER_RET ) -return 0 ; + goto out; next_pwrst = request ?PWRDM_POWER_ON : *pwrst; -return pwrdm_set_next_pwrst (pwrdm, next_pwrst); + ret =pwrdm_set_next_pwrst (pwrdm, next_pwrst); + +out: +if (!request) +omap_iommu_dra7_emu_swsup_config (pdev, false); + +return ret; }
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 62/215 Revert "usb/ehci-platform: Set PM runtime as active on resume"
In reply to Greg Kroah-HartmanThis reverts commit 335d720bb4bd9d2808cae5af6f3c636c87f19596.
Eugeniu Rosca writes:
Quoted 12 lines · Eugeniu Rosca
After integrating v4.14.186 commit
5410d158ca2a50("usb/ehci-platform:
Set PM runtime as active on resume") into downstream v4.14.x, we started to consistently experience below panic [1] on every second s2ram of R-Car H3 Salvator-X Renesas reference board.After some investigations, we concluded the following:
- the issue does not exist in vanilla v5.8-rc4+
- [bisecting shows that] the panic on v4.14.186 is caused by the lack of v5.6-rc1 commit987351e1ea7772("phy: core: Add consumer device link support"). Getting evidence for that is easy. Reverting987351e1ea7772in vanilla leads to a similar backtrace [2].
Quoted 9 lines
Questions:
- Backporting987351e1ea7772("phy: core: Add consumer device link support") to v4.14.187 looks challenging enough, so probably not worth it. Anybody to contradict this?
- Assuming no plans to backport the missing mainline commit to v4.14.x, should the following three v4.14.186 commits be reverted on v4.14.x?
*baef809ea497a4("usb/ohci-platform: Fix a warning when hibernating")
*9f33eff4958885("usb/xhci-plat: Set PM runtime as active on resume")
*5410d158ca2a50("usb/ehci-platform: Set PM runtime as active on resume")
--- drivers/usb/host/ehci-platform.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/usb/host/ehci-platform.c +0 -4
@@ -455,10 +455,6 @@ static int ehci_platform_resume(struct device *dev)ehci_resume (hcd, priv->reset_on_resume); -pm_runtime_disable (dev); -pm_runtime_set_active (dev); -pm_runtime_enable (dev); -if (priv->quirk_poll)quirk_poll_init (priv);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 70/215 HID: quirks: Remove ITE 8595 entry from hid_have_special_driver
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 3045696d0ce663d67c95dcb8206d3de57f6841ec ]
The ITE 8595 chip used in various 2-in-1 keyboard docks works fine with the hid-generic driver (minus the RF_KILL key) and also keeps working fine when swapping drivers, so there is no need to have it in the hid_have_special_driver list.
Note the other 2 USB ids in hid-ite.c were never added to hid_have_special_driver.
--- drivers/hid/hid-quirks.c | 3 --- 1 file changed, 3 deletions(-)
drivers/hid/hid-quirks.c +0 -3
@@ -400,9 +400,6 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) }, #endif -#if IS_ENABLED(CONFIG_HID_ITE) - { HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) }, -#endif #if IS_ENABLED(CONFIG_HID_ICADE) { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, #endif
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 65/215 net: sfp: add some quirks for GPON modules
In reply to Greg Kroah-HartmanFrom: Russell King <[email protected]>
[ Upstream commit b0eae33b2583dceb36224619f9fd85e6140ae594 ]
Marc Micalizzi reports that Huawei MA5671A and Alcatel/Lucent G-010S-P modules are capable of 2500base-X, but incorrectly report their capabilities in the EEPROM. It seems rather common that GPON modules mis-report.
Let's fix these modules by adding some quirks.
--- drivers/net/phy/sfp-bus.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
drivers/net/phy/sfp-bus.c +25 -0
@@ -37,7 +37,32 @@ struct sfp_bus {bool started; }; +static void sfp_quirk_2500basex (const struct sfp_eeprom_id *id, +unsigned long *modes) +{ + phylink_set(modes, 2500baseX_Full); +} +static const struct sfp_quirk sfp_quirks[] = { + { +// Alcatel Lucent G-010S-P can operate at 2500base-X, but +// incorrectly report 2500MBd NRZ in their EEPROM + .vendor ="ALCATELLUCENT" , + .part ="G010SP" , + .modes = sfp_quirk_2500basex, + }, { +// Alcatel Lucent G-010S-A can operate at 2500base-X, but +// report 3.2GBd NRZ in their EEPROM + .vendor ="ALCATELLUCENT" , + .part ="3FE46541AA" , + .modes = sfp_quirk_2500basex, + }, { +// Huawei MA5671A can operate at 2500base-X, but report 1.2GBd +// NRZ in their EEPROM + .vendor ="HUAWEI" , + .part ="MA5671A" , + .modes = sfp_quirk_2500basex, + }, };static size_t sfp_strlen (const char *str,size_t maxlen)
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 68/215 ARM: OMAP2+: use separate IOMMU pdata to fix DRA7 IPU1 boot
In reply to Greg Kroah-HartmanFrom: Suman Anna <[email protected]>
[ Upstream commit 4601832f40501efc3c2fd264a5a69bd1ac17d520 ]
The IPU1 MMU has been using common IOMMU pdata quirks defined and used by all IPU IOMMU devices on OMAP4 and beyond. Separate out the pdata for IPU1 MMU with the additional .set_pwrdm_constraint ops plugged in, so that the IPU1 power domain can be restricted to ON state during the boot and active period of the IPU1 remote processor. This eliminates the pre-conditions for the IPU1 boot issue as described in commit afe518400bdb ("iommu/omap: fix boot issue on remoteprocs with AMMU/Unicache").
NOTE:
1. RET is not a valid target power domain state on DRA7 platforms, and IPU power domain is normally programmed for OFF. The IPU1 still fails to boot though, and an unclearable l3_noc error is thrown currently on 4.14 kernel without this fix. This behavior is slightly different from previous 4.9 LTS kernel.
2. The fix is currently applied only to IPU1 on DRA7xx SoC, as the other affected processors on OMAP4/OMAP5/DRA7 are in domains that are not entering RET. IPU2 on DRA7 is in CORE power domain which is only programmed for ON power state. The fix can be easily scaled if these domains do hit RET in the future.
3. The issue was not seen on current DRA7 platforms if any of the DSP remote processors were booted and using one of the GPTimers 5, 6, 7 or 8 on previous 4.9 LTS kernel. This was due to the errata fix for i874 implemented in commit 1cbabcb9807e ("ARM:
DRA7: clockdomain: Implement timer workaround for errata i874") which keeps the IPU1 power domain from entering RET when the timers are active. But the timer workaround did not make any difference on 4.14 kernel, and an l3_noc error was seen still without this fix.
--- arch/arm/mach-omap2/pdata-quirks.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
arch/arm/mach-omap2/pdata-quirks.c +21 -0
@@ -44,6 +44,17 @@ struct pdata_init {static struct of_dev_auxdata omap_auxdata_lookup[];static struct twl4030_gpio_platform_data twl_gpio_auxdata; +#if IS_ENABLED (CONFIG_OMAP_IOMMU ) +int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev,bool request, +u8 *pwrst); +#else +static inline int omap_iommu_set_pwrdm_constraint (struct platform_device *pdev, +bool request,u8 *pwrst) +{ +return 0 ; +} +#endif +#ifdef CONFIG_MACH_NOKIA_N8X0 static void __init omap2420_n8x0_legacy_init (void ) {
@@ -326,6 +337,10 @@ static void __init omap5_uevm_legacy_init(void)#endif #ifdef CONFIG_SOC_DRA7XX +static struct iommu_platform_data dra7_ipu1_dsp_iommu_pdata = { + .set_pwrdm_constraint = omap_iommu_set_pwrdm_constraint, +}; +static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc1;static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc2;static struct omap_hsmmc_platform_data dra7_hsmmc_data_mmc3;
@@ -547,6 +562,12 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { &dra7_hsmmc_data_mmc2),OF_DEV_AUXDATA ("ti,dra7-hsmmc" ,0x480ad000 ,"480ad000.mmc" , &dra7_hsmmc_data_mmc3), +OF_DEV_AUXDATA ("ti,dra7-dsp-iommu" ,0x40d01000 ,"40d01000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), +OF_DEV_AUXDATA ("ti,dra7-dsp-iommu" ,0x41501000 ,"41501000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), +OF_DEV_AUXDATA ("ti,dra7-iommu" ,0x58882000 ,"58882000.mmu" , + &dra7_ipu1_dsp_iommu_pdata), #endif/* Common auxdata */ OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata),
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 66/215 ARM: OMAP4+: remove pdata quirks for omap4+ iommus
In reply to Greg Kroah-HartmanFrom: Tero Kristo <[email protected]>
[ Upstream commit e4c4b540e1e6c21ff8b987e92b2bd170ee006a94 ]
IOMMU driver will be using ti-sysc bus driver for power management control going forward, and the pdata quirks are not needed for anything anymore.
--- arch/arm/mach-omap2/pdata-quirks.c | 14 -------------- 1 file changed, 14 deletions(-)
arch/arm/mach-omap2/pdata-quirks.c +0 -14
@@ -311,16 +311,6 @@ static void __init omap3_pandora_legacy_init(void) }#endif /* CONFIG_ARCH_OMAP3 */ -#if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) -static struct iommu_platform_data omap4_iommu_pdata = { - .reset_name ="mmu_cache" , - .assert_reset = omap_device_assert_hardreset, - .deassert_reset = omap_device_deassert_hardreset, - .device_enable = omap_device_enable, - .device_idle = omap_device_idle, -}; -#endif -#if defined(CONFIG_SOC_AM33XX ) || defined(CONFIG_SOC_AM43XX )static struct wkup_m3_platform_data wkup_m3_data = { .reset_name = "wkup_m3",
@@ -543,10 +533,6 @@ static struct of_dev_auxdata omap_auxdata_lookup[] = { &wkup_m3_data),#endif #if defined(CONFIG_ARCH_OMAP4 ) || defined(CONFIG_SOC_OMAP5 ) -OF_DEV_AUXDATA ("ti,omap4-iommu" ,0x4a066000 ,"4a066000.mmu" , - &omap4_iommu_pdata), -OF_DEV_AUXDATA ("ti,omap4-iommu" ,0x55082000 ,"55082000.mmu" , - &omap4_iommu_pdata),OF_DEV_AUXDATA ("ti,omap4-smartreflex-iva" ,0x4a0db000 ,"4a0db000.smartreflex" , &omap_sr_pdata[OMAP_SR_IVA ]), OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000,
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 94/215 soundwire: intel: fix memory leak with devm_kasprintf
In reply to Greg Kroah-HartmanFrom: Pierre-Louis Bossart <[email protected]>
[ Upstream commit bf6d6e68d2028a2d82f4c106f50ec75cc1e6ef89 ]
The dais are allocated with devm_kcalloc() but their name isn't resourced managed and never freed. Fix by also using devm_ for the dai names as well.
--- drivers/soundwire/intel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/soundwire/intel.c +3 -2
@@ -842,8 +842,9 @@ static int intel_create_dai(struct sdw_cdns *cdns,/* TODO: Read supported rates/formats from hardware */ for (i = off; i < (off + num); i++) { - dais[i].name =kasprintf (GFP_KERNEL ,"SDW%d Pin%d" , - cdns->instance, i); + dais[i].name =devm_kasprintf (cdns->dev,GFP_KERNEL , +"SDW%d Pin%d" , + cdns->instance, i);if (!dais[i].name)return -ENOMEM ;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 93/215 iio:health:afe4404 Fix timestamp alignment and prevent data leak.
In reply to Greg Kroah-HartmanFrom: Jonathan Cameron <[email protected]>
[ Upstream commit f88ecccac4be348bbcc6d056bdbc622a8955c04d ]
One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 40 byte array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment explicitly requested. This data is allocated with kzalloc so no data can leak appart from previous readings.
--- drivers/iio/health/afe4404.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/iio/health/afe4404.c +5 -3
@@ -83,6 +83,7 @@ static const struct reg_field afe4404_reg_fields[] = {* @regulator: Pointer to the regulator for the IC * @trig: IIO trigger for this device * @irq: ADC_RDY line interrupt number +* @buffer: Used to construct a scan to push to the iio buffer. */ struct afe4404_data {struct device *dev;
@@ -91,6 +92,7 @@ struct afe4404_data {struct regulator *regulator;struct iio_trigger *trig;int irq; +s32 buffer[10 ]__aligned(8) ; };enum afe4404_chan_id {
@@ -328,17 +330,17 @@ static irqreturn_t afe4404_trigger_handler(int irq, void *private)struct iio_dev *indio_dev = pf->indio_dev;struct afe4404_data *afe =iio_priv (indio_dev);int ret, bit, i =0 ; -s32 buffer[10 ];for_each_set_bit (bit, indio_dev->active_scan_mask, indio_dev->masklength) { ret =regmap_read (afe->regmap, afe4404_channel_values[bit], - &buffer[i++]); + &afe->buffer[i++]);if (ret) goto err; } -iio_push_to_buffers_with_timestamp (indio_dev, buffer, pf->timestamp); +iio_push_to_buffers_with_timestamp (indio_dev, afe->buffer, + pf->timestamp); err:iio_trigger_notify_done (indio_dev->trig);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 92/215 ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Flight S
In reply to Greg Kroah-HartmanFrom: Christoffer Nielsen <[email protected]>
[ Upstream commit 73094608b8e214952444fb104651704c98a37aeb ]
Similar to the Kingston HyperX AMP, the Kingston HyperX Cloud Alpha S (0951:0x16ea) uses two interfaces, but only the second interface contains the capture stream. This patch delays the registration until the second interface appears.
--- sound/usb/quirks.c | 1 + 1 file changed, 1 insertion(+)
sound/usb/quirks.c +1 -0
@@ -1815,6 +1815,7 @@ struct registration_quirk {static const struct registration_quirk registration_quirks[] = {REG_QUIRK_ENTRY (0x0951 ,0x16d8 ,2 ),/* Kingston HyperX AMP */ REG_QUIRK_ENTRY (0x0951 ,0x16ed ,2 ),/* Kingston HyperX Cloud Alpha S */ +REG_QUIRK_ENTRY (0x0951 ,0x16ea ,2 ),/* Kingston HyperX Cloud Flight S */ {0 }/* terminator */ };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 91/215 bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit d46f9fbec71997420e4fb83c04d9affdf423f879 ]
Some modules reset automatically when idled, and when re-enabled, we must wait for the automatic OCP softreset to complete. And if optional clocks are configured, we need to keep the clocks on while waiting for the reset to complete.
Let's fix the issue by moving the OCP softreset code to a separate function sysc_wait_softreset(), and call it also from sysc_enable_module() with the optional clocks enabled.
This is based on what we're already doing for legacy platform data booting in _enable_sysc().
--- drivers/bus/ti-sysc.c | 80 ++++++++++++++++++++++++++++++++----------- 1 file changed, 60 insertions(+), 20 deletions(-)
drivers/bus/ti-sysc.c +60 -20
@@ -186,6 +186,35 @@ static u32 sysc_read_sysstatus(struct sysc *ddata)return sysc_read (ddata, offset); } +/* Poll on reset status */ +static int sysc_wait_softreset (struct sysc *ddata) +{ +u32 sysc_mask, syss_done, rstval; +int syss_offset, error =0 ; + + syss_offset = ddata->offsets[SYSC_SYSSTATUS ]; + sysc_mask =BIT (ddata->cap->regbits->srst_shift); + +if (ddata->cfg.quirks &SYSS_QUIRK_RESETDONE_INVERTED ) + syss_done =0 ; +else + syss_done = ddata->cfg.syss_mask; + +if (syss_offset >=0 ) { + error =readx_poll_timeout (sysc_read_sysstatus, ddata, rstval, + (rstval & ddata->cfg.syss_mask) == + syss_done, +100 ,MAX_MODULE_SOFTRESET_WAIT ); + + }else if (ddata->cfg.quirks &SYSC_QUIRK_RESET_STATUS ) { + error =readx_poll_timeout (sysc_read_sysconfig, ddata, rstval, + !(rstval & sysc_mask), +100 ,MAX_MODULE_SOFTRESET_WAIT ); + } + +return error; +} +static int sysc_add_named_clock_from_child (struct sysc *ddata,const char *name,const char *optfck_name)
@@ -892,8 +921,34 @@ static int sysc_enable_module(struct device *dev)struct sysc *ddata;const struct sysc_regbits *regbits;u32 reg, idlemodes, best_mode; +int error; ddata =dev_get_drvdata (dev); + +/* +* Some modules like DSS reset automatically on idle. Enable optional +* reset clocks and wait for OCP softreset to complete. +*/ +if (ddata->cfg.quirks &SYSC_QUIRK_OPT_CLKS_IN_RESET ) { + error =sysc_enable_opt_clocks (ddata); +if (error) { +dev_err (ddata->dev, +"Optional clocks failed for enable: %i\n" , + error); +return error; + } + } + error =sysc_wait_softreset (ddata); +if (error) +dev_warn (ddata->dev,"OCP softreset timed out\n" ); +if (ddata->cfg.quirks &SYSC_QUIRK_OPT_CLKS_IN_RESET ) +sysc_disable_opt_clocks (ddata); + +/* +* Some subsystem private interconnects, like DSS top level module, +* need only the automatic OCP softreset handling with no sysconfig +* register bits to configure. +*/ if (ddata->offsets[SYSC_SYSCONFIG ] == -ENODEV )return 0 ;
@@ -1691,11 +1746,10 @@ static int sysc_rstctrl_reset_deassert(struct sysc *ddata, bool reset)*/ static int sysc_reset (struct sysc *ddata) { -int sysc_offset, syss_offset, sysc_val, rstval, error =0 ; -u32 sysc_mask, syss_done; +int sysc_offset, sysc_val, error; +u32 sysc_mask; sysc_offset = ddata->offsets[SYSC_SYSCONFIG ]; - syss_offset = ddata->offsets[SYSC_SYSSTATUS ]; if (ddata->legacy_mode || sysc_offset < 0 || ddata->cap->regbits->srst_shift < 0 ||
@@ -1704,11 +1758,6 @@ static int sysc_reset(struct sysc *ddata) sysc_mask =BIT (ddata->cap->regbits->srst_shift); -if (ddata->cfg.quirks &SYSS_QUIRK_RESETDONE_INVERTED ) - syss_done =0 ; -else - syss_done = ddata->cfg.syss_mask; -if (ddata->pre_reset_quirk) ddata->pre_reset_quirk (ddata);
@@ -1723,18 +1772,9 @@ static int sysc_reset(struct sysc *ddata)if (ddata->post_reset_quirk) ddata->post_reset_quirk (ddata); -/* Poll on reset status */ -if (syss_offset >=0 ) { - error =readx_poll_timeout (sysc_read_sysstatus, ddata, rstval, - (rstval & ddata->cfg.syss_mask) == - syss_done, -100 ,MAX_MODULE_SOFTRESET_WAIT ); - - }else if (ddata->cfg.quirks &SYSC_QUIRK_RESET_STATUS ) { - error =readx_poll_timeout (sysc_read_sysconfig, ddata, rstval, - !(rstval & sysc_mask), -100 ,MAX_MODULE_SOFTRESET_WAIT ); - } + error =sysc_wait_softreset (ddata); +if (error) +dev_warn (ddata->dev,"OCP softreset timed out\n" );if (ddata->reset_done_quirk) ddata->reset_done_quirk (ddata);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 90/215 ACPI: video: Use native backlight on Acer TravelMate 5735Z
In reply to Greg Kroah-HartmanFrom: Paul Menzel <[email protected]>
[ Upstream commit c41c36e900a337b4132b12ccabc97f5578248b44 ]
Currently, changing the brightness of the internal display of the Acer TravelMate 5735Z does not work. Pressing the function keys or changing the slider, GNOME Shell 3.36.2 displays the OSD (five steps), but the brightness does not change.
The Acer TravelMate 5735Z shipped with Windows 7 and as such does not trigger our "win8 ready" heuristic for preferring the native backlight interface.
Still ACPI backlight control doesn't work on this model, where as the native (intel_video) backlight interface does work by adding acpi_backlight=native or acpi_backlight=none to Linux’ command line.
So, add a quirk to force using native backlight control on this model.
--- drivers/acpi/video_detect.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/acpi/video_detect.c +10 -0
@@ -345,6 +345,16 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_BOARD_NAME, "JV50"), }, }, + { + /* https://bugzilla.kernel.org/show_bug.cgi?id=207835 */ + .callback = video_detect_force_native, + .ident = "Acer TravelMate 5735Z", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 5735Z"), + DMI_MATCH(DMI_BOARD_NAME, "BA51_MV"), + }, + },/* * Desktops which falsely report a backlight and which our heuristics
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 89/215 Input: mms114 - add extra compatible for mms345l
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit 7842087b0196d674ed877d768de8f2a34d7fdc53 ]
MMS345L is another first generation touch screen from Melfas, which uses mostly the same registers as MMS152.
However, there is some garbage printed during initialization. Apparently MMS345L does not have the MMS152_COMPAT_GROUP register that is read+printed during initialization.
TSP FW Rev: bootloader 0x6 / core 0x26 / config 0x26, Compat group: \x06
On earlier kernel versions the compat group was actually printed as an ASCII control character, seems like it gets escaped now.
But we probably shouldn't print something from a random register.
Add a separate "melfas,mms345l" compatible that avoids reading from the MMS152_COMPAT_GROUP register. This might also help in case there is some other device-specific quirk in the future.
--- drivers/input/touchscreen/mms114.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/input/touchscreen/mms114.c +15 -2
@@ -54,6 +54,7 @@enum mms_type {TYPE_MMS114 =114 ,TYPE_MMS152 =152 , +TYPE_MMS345L =345 , };struct mms114_data {
@@ -250,6 +251,15 @@ static int mms114_get_version(struct mms114_data *data)int error;switch (data->type) { +case TYPE_MMS345L : + error =__mms114_read_reg (data,MMS152_FW_REV ,3 , buf); +if (error) +return error; + +dev_info (dev,"TSP FW Rev: bootloader 0x%x / core 0x%x / config 0x%x\n" , + buf[0 ], buf[1 ], buf[2 ]); +break ; +case TYPE_MMS152 : error =__mms114_read_reg (data,MMS152_FW_REV ,3 , buf);if (error)
@@ -287,8 +297,8 @@ static int mms114_setup_regs(struct mms114_data *data)if (error <0 )return error; -/* MMS152 has no configuration or power on registers */ -if (data->type ==TYPE_MMS152 ) +/* Only MMS114 has configuration and power on registers */ +if (data->type !=TYPE_MMS114 )return 0 ; error =mms114_set_active (data, true);
@@ -598,6 +608,9 @@ static const struct of_device_id mms114_dt_match[] = { }, { .compatible = "melfas,mms152", .data = (void *)TYPE_MMS152, + }, { + .compatible = "melfas,mms345l", + .data = (void *)TYPE_MMS345L, }, { } };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 87/215 ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Alpha S
In reply to Greg Kroah-HartmanFrom: Emmanuel Pescosta <[email protected]>
[ Upstream commit fd60e0683e8e9107e09cd2e4798f3e27e85d2705 ]
Similar to the Kingston HyperX AMP, the Kingston HyperX Cloud Alpha S (0951:16d8) uses two interfaces, but only the second interface contains the capture stream. This patch delays the registration until the second interface appears.
--- sound/usb/quirks.c | 1 + 1 file changed, 1 insertion(+)
sound/usb/quirks.c +1 -0
@@ -1801,6 +1801,7 @@ struct registration_quirk {static const struct registration_quirk registration_quirks[] = {REG_QUIRK_ENTRY (0x0951 ,0x16d8 ,2 ),/* Kingston HyperX AMP */ +REG_QUIRK_ENTRY (0x0951 ,0x16ed ,2 ),/* Kingston HyperX Cloud Alpha S */ {0 }/* terminator */ };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 86/215 ACPI: video: Use native backlight on Acer Aspire 5783z
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 1c8fbc1f9bfb804ef2f0d4ee9397ab800e33f23a ]
The Acer Aspire 5783z shipped with Windows 7 and as such does not trigger our "win8 ready" heuristic for prefering the native backlight interface.
Still ACPI backlight control doesn't work on this model, where as the native (intel_video) backlight interface does work. Add a quirk to force using native backlight control on this model.
--- drivers/acpi/video_detect.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/acpi/video_detect.c +9 -0
@@ -336,6 +336,15 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Precision 7510"), }, }, + { + .callback = video_detect_force_native, + .ident = "Acer Aspire 5738z", + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5738"), + DMI_MATCH(DMI_BOARD_NAME, "JV50"), + }, + },/* * Desktops which falsely report a backlight and which our heuristics
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 85/215 ALSA: usb-audio: Rewrite registration quirk handling
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
[ Upstream commit d8695bc5b1fe88305396b1f788d3b5f218e28a30 ]
A slight refactoring of the registration quirk code. Now it uses the table lookup for easy additions in future. Also the return type was changed to bool, and got a few more comments.
--- sound/usb/card.c | 2 +- sound/usb/quirks.c | 40 ++++++++++++++++++++++++++++++---------- sound/usb/quirks.h | 3 +-- 3 files changed, 32 insertions(+), 13 deletions(-)
sound/usb/card.c +1 -1
@@ -662,7 +662,7 @@ static int usb_audio_probe(struct usb_interface *intf,/* we are allowed to call snd_card_register() many times, but first * check to see if a device needs to skip it or do anything special */ -if (snd_usb_registration_quirk (chip, ifnum) ==0 ) { +if (!snd_usb_registration_quirk (chip, ifnum)) { err =snd_card_register (chip->card);if (err <0 ) goto __error;
sound/usb/quirks.c +30 -10
@@ -1783,16 +1783,36 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip, } } -int snd_usb_registration_quirk (struct snd_usb_audio *chip, -int iface) +/* +* registration quirk: +* the registration is skipped if a device matches with the given ID, +* unless the interface reaches to the defined one. This is for delaying +* the registration until the last known interface, so that the card and +* devices appear at the same time. +*/ + +struct registration_quirk { +unsigned int usb_id;/* composed via USB_ID() */ +unsigned int interface;/* the interface to trigger register */ +}; + +#define REG_QUIRK_ENTRY (vendor, product, iface) \ + { .usb_id = USB_ID(vendor, product), .interface = (iface) } + +static const struct registration_quirk registration_quirks[] = { +REG_QUIRK_ENTRY (0x0951 ,0x16d8 ,2 ),/* Kingston HyperX AMP */ + {0 }/* terminator */ +}; + +/* return true if skipping registration */ +bool snd_usb_registration_quirk (struct snd_usb_audio *chip,int iface) { -switch (chip->usb_id) { -case USB_ID (0x0951 ,0x16d8 ):/* Kingston HyperX AMP */ -/* Register only when we reach interface 2 so that streams can -* merge correctly into PCMs from interface 0 -*/ -return (iface !=2 ); - } +const struct registration_quirk *q; + +for (q = registration_quirks; q->usb_id; q++) +if (chip->usb_id == q->usb_id) +return iface != q->interface; +/* Register as normal */ -return 0 ; +return false; }
sound/usb/quirks.h +1 -2
@@ -51,7 +51,6 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,struct audioformat *fp, int stream); -int snd_usb_registration_quirk (struct snd_usb_audio *chip, -int iface); +bool snd_usb_registration_quirk (struct snd_usb_audio *chip,int iface);#endif /* __USBAUDIO_QUIRKS_H */
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 64/215 net: sfp: add support for module quirks
In reply to Greg Kroah-HartmanFrom: Russell King <[email protected]>
[ Upstream commit b34bb2cb5b62c7397c28fcc335e8047a687eada4 ]
Add support for applying module quirks to the list of supported ethtool link modes.
--- drivers/net/phy/sfp-bus.c | 54 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+)
drivers/net/phy/sfp-bus.c +54 -0
@@ -9,6 +9,12 @@#include "sfp.h" +struct sfp_quirk { +const char *vendor; +const char *part; +void (*modes)(const struct sfp_eeprom_id *id,unsigned long *modes); +}; +/** * struct sfp_bus - internal representation of a sfp bus */
@@ -21,6 +27,7 @@ struct sfp_bus {const struct sfp_socket_ops *socket_ops;struct device *sfp_dev;struct sfp *sfp; +const struct sfp_quirk *sfp_quirk;const struct sfp_upstream_ops *upstream_ops;void *upstream;
@@ -30,6 +37,46 @@ struct sfp_bus {bool started; }; +static const struct sfp_quirk sfp_quirks[] = { +}; + +static size_t sfp_strlen (const char *str,size_t maxlen) +{ +size_t size, i; + +/* Trailing characters should be filled with space chars */ +for (i =0 , size =0 ; i < maxlen; i++) +if (str[i] !=' ' ) + size = i +1 ; + +return size; +} + +static bool sfp_match (const char *qs,const char *str,size_t len) +{ +if (!qs) +return true; +if (strlen (qs) != len) +return false; +return !strncmp (qs, str, len); +} + +static const struct sfp_quirk *sfp_lookup_quirk (const struct sfp_eeprom_id *id) +{ +const struct sfp_quirk *q; +unsigned int i; +size_t vs, ps; + + vs =sfp_strlen (id->base.vendor_name,ARRAY_SIZE (id->base.vendor_name)); + ps =sfp_strlen (id->base.vendor_pn,ARRAY_SIZE (id->base.vendor_pn)); + +for (i =0 , q = sfp_quirks; i <ARRAY_SIZE (sfp_quirks); i++, q++) +if (sfp_match (q->vendor, id->base.vendor_name, vs) && +sfp_match (q->part, id->base.vendor_pn, ps)) +return q; + +return NULL ; +}/** * sfp_parse_port() - Parse the EEPROM base ID, setting the port type * @bus: a pointer to the &struct sfp_bus structure for the sfp module
@@ -233,6 +280,9 @@ void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, phylink_set(modes, 1000baseX_Full); } +if (bus->sfp_quirk) + bus->sfp_quirk->modes (id, modes); +bitmap_or (support, support, modes, __ETHTOOL_LINK_MODE_MASK_NBITS);phylink_set (support, Autoneg);
@@ -553,6 +603,8 @@ int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id)const struct sfp_upstream_ops *ops =sfp_get_upstream_ops (bus);int ret =0 ; + bus->sfp_quirk =sfp_lookup_quirk (id); +if (ops && ops->module_insert) ret = ops->module_insert (bus->upstream, id);
@@ -566,6 +618,8 @@ void sfp_module_remove(struct sfp_bus *bus)if (ops && ops->module_remove) ops->module_remove (bus->upstream); + + bus->sfp_quirk =NULL ; }EXPORT_SYMBOL_GPL (sfp_module_remove);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 82/215 ALSA: usb-audio: Create a registration quirk for Kingston HyperX Amp (0951:16d8)
In reply to Greg Kroah-HartmanFrom: Chris Wulff <[email protected]>
[ Upstream commit 55f7326170d9e83e2d828591938e1101982a679c ]
Create a quirk that allows special processing and/or skipping the call to snd_card_register.
For HyperX AMP, which uses two interfaces, but only has a capture stream in the second, this allows the capture stream to merge with the first PCM.
--- sound/usb/card.c | 12 ++++++++---- sound/usb/quirks.c | 14 ++++++++++++++ sound/usb/quirks.h | 3 +++ 3 files changed, 25 insertions(+), 4 deletions(-)
sound/usb/card.c +8 -4
@@ -659,10 +659,14 @@ static int usb_audio_probe(struct usb_interface *intf, goto __error; } -/* we are allowed to call snd_card_register() many times */ - err =snd_card_register (chip->card); -if (err <0 ) - goto __error; +/* we are allowed to call snd_card_register() many times, but first +* check to see if a device needs to skip it or do anything special +*/ +if (snd_usb_registration_quirk (chip, ifnum) ==0 ) { + err =snd_card_register (chip->card); +if (err <0 ) + goto __error; + }if (quirk && quirk->shares_media_device) {/* don't want to fail when snd_media_device_create() fails */
sound/usb/quirks.c +14 -0
@@ -1782,3 +1782,17 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,break ; } } + +int snd_usb_registration_quirk (struct snd_usb_audio *chip, +int iface) +{ +switch (chip->usb_id) { +case USB_ID (0x0951 ,0x16d8 ):/* Kingston HyperX AMP */ +/* Register only when we reach interface 2 so that streams can +* merge correctly into PCMs from interface 0 +*/ +return (iface !=2 ); + } +/* Register as normal */ +return 0 ; +}
sound/usb/quirks.h +3 -0
@@ -51,4 +51,7 @@ void snd_usb_audioformat_attributes_quirk(struct snd_usb_audio *chip,struct audioformat *fp, int stream); +int snd_usb_registration_quirk (struct snd_usb_audio *chip, +int iface); +#endif /* __USBAUDIO_QUIRKS_H */
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 74/215 bus: ti-sysc: Rename clk related quirks to pre_reset and post_reset quirks
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit e64c021fd92467e34b9d970a651bcaa8f326f3f2 ]
The clk_disable_quirk and clk_enable_quirk should really be called pre_reset_quirk and post_reset_quirk to avoid confusion like we had with hdq1w reset.
Let's also rename the related functions so the code is easier to follow. Note that we also have reset_done_quirk that is needed in some cases after checking the separate register for reset done bit.
--- drivers/bus/ti-sysc.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
drivers/bus/ti-sysc.c +16 -16
@@ -70,8 +70,8 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {* @child_needs_resume: runtime resume needed for child on resume from suspend * @disable_on_idle: status flag used for disabling modules with resets * @idle_work: work structure used to perform delayed idle on a module -* @clk_enable_quirk: module specific clock enable quirk -* @clk_disable_quirk: module specific clock disable quirk +* @pre_reset_quirk: module specific pre-reset quirk +* @post_reset_quirk: module specific post-reset quirk * @reset_done_quirk: module specific reset done quirk * @module_enable_quirk: module specific enable quirk * @module_disable_quirk: module specific disable quirk
@@ -97,8 +97,8 @@ struct sysc { unsigned int needs_resume:1; unsigned int child_needs_resume:1;struct delayed_work idle_work; -void (*clk_enable_quirk)(struct sysc *sysc); -void (*clk_disable_quirk)(struct sysc *sysc); +void (*pre_reset_quirk)(struct sysc *sysc); +void (*post_reset_quirk)(struct sysc *sysc);void (*reset_done_quirk)(struct sysc *sysc);void (*module_enable_quirk)(struct sysc *sysc);void (*module_disable_quirk)(struct sysc *sysc);
@@ -1433,7 +1433,7 @@ static void sysc_module_enable_quirk_aess(struct sysc *ddata)sysc_write (ddata, offset,1 ); } -/* I2C needs extra enable bit toggling for reset */ +/* I2C needs to be disabled for reset */ static void sysc_clk_quirk_i2c (struct sysc *ddata,bool enable) {int offset;
@@ -1454,14 +1454,14 @@ static void sysc_clk_quirk_i2c(struct sysc *ddata, bool enable)sysc_write (ddata, offset, val); } -static void sysc_clk_enable_quirk_i2c (struct sysc *ddata) +static void sysc_pre_reset_quirk_i2c (struct sysc *ddata) { -sysc_clk_quirk_i2c (ddata, true); +sysc_clk_quirk_i2c (ddata, false); } -static void sysc_clk_disable_quirk_i2c (struct sysc *ddata) +static void sysc_post_reset_quirk_i2c (struct sysc *ddata) { -sysc_clk_quirk_i2c (ddata, false); +sysc_clk_quirk_i2c (ddata, true); }/* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */
@@ -1503,14 +1503,14 @@ static void sysc_init_module_quirks(struct sysc *ddata)return ;if (ddata->cfg.quirks &SYSC_MODULE_QUIRK_HDQ1W ) { - ddata->clk_disable_quirk = sysc_pre_reset_quirk_hdq1w; + ddata->pre_reset_quirk = sysc_pre_reset_quirk_hdq1w;return ; }if (ddata->cfg.quirks &SYSC_MODULE_QUIRK_I2C ) { - ddata->clk_enable_quirk = sysc_clk_enable_quirk_i2c; - ddata->clk_disable_quirk = sysc_clk_disable_quirk_i2c; + ddata->pre_reset_quirk = sysc_pre_reset_quirk_i2c; + ddata->post_reset_quirk = sysc_post_reset_quirk_i2c;return ; }
@@ -1629,8 +1629,8 @@ static int sysc_reset(struct sysc *ddata)else syss_done = ddata->cfg.syss_mask; -if (ddata->clk_disable_quirk) - ddata->clk_disable_quirk (ddata); +if (ddata->pre_reset_quirk) + ddata->pre_reset_quirk (ddata); sysc_val =sysc_read_sysconfig (ddata); sysc_val |= sysc_mask;
@@ -1640,8 +1640,8 @@ static int sysc_reset(struct sysc *ddata)usleep_range (ddata->cfg.srst_udelay, ddata->cfg.srst_udelay *2 ); -if (ddata->clk_enable_quirk) - ddata->clk_enable_quirk (ddata); +if (ddata->post_reset_quirk) + ddata->post_reset_quirk (ddata);/* Poll on reset status */ if (syss_offset >=0 ) {
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 77/215 bus: ti-sysc: Detect display subsystem related devices
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 77dfece2e6d8bedb6ecd4d61379ae3dc52f389bd ]
In order to prepare probing display subsystem (DSS) with ti-sysc interconnect target module driver and device tree data, let's detect DSS related modules.
We need to also add reset quirk handling for DSS, but until that's done, let's just enable the optional clock quirks for DSS and omap4 HDMI. The rest is just naming of modules if CONFIG_DEBUG is set.
--- drivers/bus/ti-sysc.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/bus/ti-sysc.c +19 -0
@@ -1282,10 +1282,18 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { SYSC_MODULE_QUIRK_AESS),SYSC_QUIRK ("dcan" ,0x48480000 ,0x20 , -ENODEV , -ENODEV ,0xa3170504 ,0xffffffff ,SYSC_QUIRK_CLKDM_NOAUTO ), +SYSC_QUIRK ("dss" ,0x4832a000 ,0 ,0x10 ,0x14 ,0x00000020 ,0xffffffff , +SYSC_QUIRK_OPT_CLKS_IN_RESET ), +SYSC_QUIRK ("dss" ,0x58000000 ,0 , -ENODEV ,0x14 ,0x00000040 ,0xffffffff , +SYSC_QUIRK_OPT_CLKS_IN_RESET ), +SYSC_QUIRK ("dss" ,0x58000000 ,0 , -ENODEV ,0x14 ,0x00000061 ,0xffffffff , +SYSC_QUIRK_OPT_CLKS_IN_RESET ),SYSC_QUIRK ("dwc3" ,0x48880000 ,0 ,0x10 , -ENODEV ,0x500a0200 ,0xffffffff ,SYSC_QUIRK_CLKDM_NOAUTO ),SYSC_QUIRK ("dwc3" ,0x488c0000 ,0 ,0x10 , -ENODEV ,0x500a0200 ,0xffffffff ,SYSC_QUIRK_CLKDM_NOAUTO ), +SYSC_QUIRK ("hdmi" ,0 ,0 ,0x10 , -ENODEV ,0x50030200 ,0xffffffff , +SYSC_QUIRK_OPT_CLKS_NEEDED ),SYSC_QUIRK ("hdq1w" ,0 ,0 ,0x14 ,0x18 ,0x00000006 ,0xffffffff ,SYSC_MODULE_QUIRK_HDQ1W ), SYSC_QUIRK("hdq1w", 0, 0, 0x14, 0x18, 0x0000000a, 0xffffffff,
@@ -1322,13 +1330,21 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { 0xffff00f0, 0),SYSC_QUIRK ("dcan" ,0 ,0x20 , -ENODEV , -ENODEV ,0xa3170504 ,0xffffffff ,0 ),SYSC_QUIRK ("dcan" ,0 ,0x20 , -ENODEV , -ENODEV ,0x4edb1902 ,0xffffffff ,0 ), +SYSC_QUIRK ("dispc" ,0x4832a400 ,0 ,0x10 ,0x14 ,0x00000030 ,0xffffffff ,0 ), +SYSC_QUIRK ("dispc" ,0x58001000 ,0 ,0x10 ,0x14 ,0x00000040 ,0xffffffff ,0 ), +SYSC_QUIRK ("dispc" ,0x58001000 ,0 ,0x10 ,0x14 ,0x00000051 ,0xffffffff ,0 ),SYSC_QUIRK ("dmic" ,0 ,0 ,0x10 , -ENODEV ,0x50010000 ,0xffffffff ,0 ), +SYSC_QUIRK ("dsi" ,0x58004000 ,0 ,0x10 ,0x14 ,0x00000030 ,0xffffffff ,0 ), +SYSC_QUIRK ("dsi" ,0x58005000 ,0 ,0x10 ,0x14 ,0x00000030 ,0xffffffff ,0 ), +SYSC_QUIRK ("dsi" ,0x58005000 ,0 ,0x10 ,0x14 ,0x00000040 ,0xffffffff ,0 ), +SYSC_QUIRK ("dsi" ,0x58009000 ,0 ,0x10 ,0x14 ,0x00000040 ,0xffffffff ,0 ),SYSC_QUIRK ("dwc3" ,0 ,0 ,0x10 , -ENODEV ,0x500a0200 ,0xffffffff ,0 ),SYSC_QUIRK ("d2d" ,0x4a0b6000 ,0 ,0x10 ,0x14 ,0x00000010 ,0xffffffff ,0 ),SYSC_QUIRK ("d2d" ,0x4a0cd000 ,0 ,0x10 ,0x14 ,0x00000010 ,0xffffffff ,0 ),SYSC_QUIRK ("epwmss" ,0 ,0 ,0x4 , -ENODEV ,0x47400001 ,0xffffffff ,0 ),SYSC_QUIRK ("gpu" ,0 ,0x1fc00 ,0x1fc10 , -ENODEV ,0 ,0 ,0 ),SYSC_QUIRK ("gpu" ,0 ,0xfe00 ,0xfe10 , -ENODEV ,0x40000000 ,0xffffffff ,0 ), +SYSC_QUIRK ("hdmi" ,0 ,0 ,0x10 , -ENODEV ,0x50031d00 ,0xffffffff ,0 ),SYSC_QUIRK ("hsi" ,0 ,0 ,0x10 ,0x14 ,0x50043101 ,0xffffffff ,0 ),SYSC_QUIRK ("iss" ,0 ,0 ,0x10 , -ENODEV ,0x40000101 ,0xffffffff ,0 ), SYSC_QUIRK("lcdc", 0, 0, 0x54, -ENODEV, 0x4f201000, 0xffffffff, 0),
@@ -1346,6 +1362,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {SYSC_QUIRK ("prcm" ,0 ,0 , -ENODEV , -ENODEV ,0x40000100 ,0xffffffff ,0 ),SYSC_QUIRK ("prcm" ,0 ,0 , -ENODEV , -ENODEV ,0x00004102 ,0xffffffff ,0 ),SYSC_QUIRK ("prcm" ,0 ,0 , -ENODEV , -ENODEV ,0x40000400 ,0xffffffff ,0 ), +SYSC_QUIRK ("rfbi" ,0x4832a800 ,0 ,0x10 ,0x14 ,0x00000010 ,0xffffffff ,0 ), +SYSC_QUIRK ("rfbi" ,0x58002000 ,0 ,0x10 ,0x14 ,0x00000010 ,0xffffffff ,0 ),SYSC_QUIRK ("scm" ,0 ,0 ,0x10 , -ENODEV ,0x40000900 ,0xffffffff ,0 ),SYSC_QUIRK ("scm" ,0 ,0 , -ENODEV , -ENODEV ,0x4e8b0100 ,0xffffffff ,0 ), SYSC_QUIRK("scm", 0, 0, -ENODEV, -ENODEV, 0x4f000100, 0xffffffff, 0),
@@ -1363,6 +1381,7 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {SYSC_QUIRK ("usbhstll" ,0 ,0 ,0x10 ,0x14 ,0x00000008 ,0xffffffff ,0 ),SYSC_QUIRK ("usb_host_hs" ,0 ,0 ,0x10 ,0x14 ,0x50700100 ,0xffffffff ,0 ),SYSC_QUIRK ("usb_host_hs" ,0 ,0 ,0x10 , -ENODEV ,0x50700101 ,0xffffffff ,0 ), +SYSC_QUIRK ("venc" ,0x58003000 ,0 , -ENODEV , -ENODEV ,0x00000002 ,0xffffffff ,0 ), SYSC_QUIRK("vfpe", 0, 0, 0x104, -ENODEV, 0x4d001200, 0xffffffff, 0), #endif };
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 76/215 bus: ti-sysc: Handle module unlock quirk needed for some RTC
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit e8639e1c986a8a9d0f94549170f6db579376c3ae ]
The RTC modules on am3 and am4 need quirk handling to unlock and lock them for reset so let's add the quirk handling based on what we already have for legacy platform data. In later patches we will simply drop the RTC related platform data and the old quirk handling.
--- drivers/bus/ti-sysc.c | 74 ++++++++++++++++++++++++--- include/linux/platform_data/ti-sysc.h | 1 + 2 files changed, 69 insertions(+), 6 deletions(-)
drivers/bus/ti-sysc.c +68 -6
@@ -75,6 +75,8 @@ static const char * const clock_names[SYSC_MAX_CLOCKS] = {* @reset_done_quirk: module specific reset done quirk * @module_enable_quirk: module specific enable quirk * @module_disable_quirk: module specific disable quirk +* @module_unlock_quirk: module specific sysconfig unlock quirk +* @module_lock_quirk: module specific sysconfig lock quirk */ struct sysc {struct device *dev;
@@ -102,6 +104,8 @@ struct sysc {void (*reset_done_quirk)(struct sysc *sysc);void (*module_enable_quirk)(struct sysc *sysc);void (*module_disable_quirk)(struct sysc *sysc); +void (*module_unlock_quirk)(struct sysc *sysc); +void (*module_lock_quirk)(struct sysc *sysc); }; static void sysc_parse_dts_quirks(struct sysc *ddata, struct device_node *np,
@@ -863,6 +867,22 @@ static void sysc_show_registers(struct sysc *ddata) buf); } +/** +* sysc_write_sysconfig - handle sysconfig quirks for register write +* @ddata: device driver data +* @value: register value +*/ +static void sysc_write_sysconfig (struct sysc *ddata,u32 value) +{ +if (ddata->module_unlock_quirk) + ddata->module_unlock_quirk (ddata); + +sysc_write (ddata, ddata->offsets[SYSC_SYSCONFIG ], value); + +if (ddata->module_lock_quirk) + ddata->module_lock_quirk (ddata); +} +#define SYSC_IDLE_MASK (SYSC_NR_IDLEMODES - 1)#define SYSC_CLOCACT_ICK 2
@@ -912,7 +932,7 @@ static int sysc_enable_module(struct device *dev) reg &= ~(SYSC_IDLE_MASK << regbits->sidle_shift); reg |= best_mode << regbits->sidle_shift; -sysc_write (ddata, ddata->offsets[SYSC_SYSCONFIG ], reg); +sysc_write_sysconfig (ddata, reg); set_midle:/* Set MIDLE mode */
@@ -931,14 +951,14 @@ set_midle: reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); reg |= best_mode << regbits->midle_shift; -sysc_write (ddata, ddata->offsets[SYSC_SYSCONFIG ], reg); +sysc_write_sysconfig (ddata, reg); set_autoidle:/* Autoidle bit must enabled separately if available */ if (regbits->autoidle_shift >=0 && ddata->cfg.sysc_val &BIT (regbits->autoidle_shift)) { reg |=1 << regbits->autoidle_shift; -sysc_write (ddata, ddata->offsets[SYSC_SYSCONFIG ], reg); +sysc_write_sysconfig (ddata, reg); }/* Flush posted write */
@@ -999,7 +1019,7 @@ static int sysc_disable_module(struct device *dev) reg &= ~(SYSC_IDLE_MASK << regbits->midle_shift); reg |= best_mode << regbits->midle_shift; -sysc_write (ddata, ddata->offsets[SYSC_SYSCONFIG ], reg); +sysc_write_sysconfig (ddata, reg); set_sidle:/* Set SIDLE mode */
@@ -1022,7 +1042,7 @@ set_sidle:if (regbits->autoidle_shift >=0 && ddata->cfg.sysc_val &BIT (regbits->autoidle_shift)) reg |=1 << regbits->autoidle_shift; -sysc_write (ddata, ddata->offsets[SYSC_SYSCONFIG ], reg); +sysc_write_sysconfig (ddata, reg);/* Flush posted write */ sysc_read (ddata, ddata->offsets[SYSC_SYSCONFIG ]);
@@ -1281,6 +1301,8 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {SYSC_QUIRK ("gpu" ,0x50000000 ,0x14 , -ENODEV , -ENODEV ,0x00010201 ,0xffffffff ,0 ),SYSC_QUIRK ("gpu" ,0x50000000 ,0xfe00 ,0xfe10 , -ENODEV ,0x40000000 ,0xffffffff ,SYSC_MODULE_QUIRK_SGX ), +SYSC_QUIRK ("rtc" ,0 ,0x74 ,0x78 , -ENODEV ,0x4eb01908 ,0xffff00f0 , +SYSC_MODULE_QUIRK_RTC_UNLOCK ),SYSC_QUIRK ("usb_otg_hs" ,0 ,0x400 ,0x404 ,0x408 ,0x00000050 ,0xffffffff ,SYSC_QUIRK_SWSUP_SIDLE |SYSC_QUIRK_SWSUP_MSTANDBY ), SYSC_QUIRK("usb_otg_hs", 0, 0, 0x10, -ENODEV, 0x4ea2080d, 0xffffffff,
@@ -1336,7 +1358,6 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = {SYSC_QUIRK ("slimbus" ,0 ,0 ,0x10 , -ENODEV ,0x40002903 ,0xffffffff ,0 ),SYSC_QUIRK ("spinlock" ,0 ,0 ,0x10 , -ENODEV ,0x50020000 ,0xffffffff ,0 ),SYSC_QUIRK ("rng" ,0 ,0x1fe0 ,0x1fe4 , -ENODEV ,0x00000020 ,0xffffffff ,0 ), -SYSC_QUIRK ("rtc" ,0 ,0x74 ,0x78 , -ENODEV ,0x4eb01908 ,0xffff00f0 ,0 ),SYSC_QUIRK ("timer32k" ,0 ,0 ,0x4 , -ENODEV ,0x00000060 ,0xffffffff ,0 ),SYSC_QUIRK ("usbhstll" ,0 ,0 ,0x10 ,0x14 ,0x00000004 ,0xffffffff ,0 ), SYSC_QUIRK("usbhstll", 0, 0, 0x10, 0x14, 0x00000008, 0xffffffff, 0),
@@ -1458,6 +1479,40 @@ static void sysc_post_reset_quirk_i2c(struct sysc *ddata)sysc_clk_quirk_i2c (ddata, true); } +/* RTC on am3 and 4 needs to be unlocked and locked for sysconfig */ +static void sysc_quirk_rtc (struct sysc *ddata,bool lock) +{ +u32 val, kick0_val =0 , kick1_val =0 ; +unsigned long flags; +int error; + +if (!lock) { + kick0_val =0x83e70b13 ; + kick1_val =0x95a4f1e0 ; + } + +local_irq_save (flags); +/* RTC_STATUS BUSY bit may stay active for 1/32768 seconds (~30 usec) */ + error =readl_poll_timeout (ddata->module_va +0x44 , val, + !(val &BIT (0 )),100 ,50 ); +if (error) +dev_warn (ddata->dev,"rtc busy timeout\n" ); +/* Now we have ~15 microseconds to read/write various registers */ +sysc_write (ddata,0x6c , kick0_val); +sysc_write (ddata,0x70 , kick1_val); +local_irq_restore (flags); +} + +static void sysc_module_unlock_quirk_rtc (struct sysc *ddata) +{ +sysc_quirk_rtc (ddata, false); +} + +static void sysc_module_lock_quirk_rtc (struct sysc *ddata) +{ +sysc_quirk_rtc (ddata, true); +} +/* 36xx SGX needs a quirk for to bypass OCP IPG interrupt logic */ static void sysc_module_enable_quirk_sgx (struct sysc *ddata) {
@@ -1512,6 +1567,13 @@ static void sysc_init_module_quirks(struct sysc *ddata)if (ddata->cfg.quirks &SYSC_MODULE_QUIRK_AESS ) ddata->module_enable_quirk = sysc_module_enable_quirk_aess; +if (ddata->cfg.quirks &SYSC_MODULE_QUIRK_RTC_UNLOCK ) { + ddata->module_unlock_quirk = sysc_module_unlock_quirk_rtc; + ddata->module_lock_quirk = sysc_module_lock_quirk_rtc; + +return ; + } +if (ddata->cfg.quirks &SYSC_MODULE_QUIRK_SGX ) ddata->module_enable_quirk = sysc_module_enable_quirk_sgx;
include/linux/platform_data/ti-sysc.h +1 -0
@@ -49,6 +49,7 @@ struct sysc_regbits {s8 emufree_shift; }; +#define SYSC_MODULE_QUIRK_RTC_UNLOCK BIT(22)#define SYSC_QUIRK_CLKDM_NOAUTO BIT(21)#define SYSC_QUIRK_FORCE_MSTANDBY BIT(20)#define SYSC_MODULE_QUIRK_AESS BIT(19)
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 36/215 blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags
In reply to Greg Kroah-HartmanFrom: Hou Tao <[email protected]>
[ Upstream commit bfe373f608cf81b7626dfeb904001b0e867c5110 ]
Else there may be magic numbers in /sys/kernel/debug/block/*/state.
--- block/blk-mq-debugfs.c | 3 +++ include/linux/blkdev.h | 1 + 2 files changed, 4 insertions(+)
block/blk-mq-debugfs.c +3 -0
@@ -125,6 +125,9 @@ static const char *const blk_queue_flag_name[] = {QUEUE_FLAG_NAME (REGISTERED ),QUEUE_FLAG_NAME (SCSI_PASSTHROUGH ),QUEUE_FLAG_NAME (QUIESCED ), +QUEUE_FLAG_NAME (PCI_P2PDMA ), +QUEUE_FLAG_NAME (ZONE_RESETALL ), + QUEUE_FLAG_NAME(RQ_ALLOC_TIME), };#undef QUEUE_FLAG_NAME
include/linux/blkdev.h +1 -0
@@ -592,6 +592,7 @@ struct request_queue {u64 write_hints[BLK_MAX_WRITE_HINTS ]; }; +/* Keep blk_queue_flag_name[] in sync with the definitions below */ #define QUEUE_FLAG_STOPPED 0/* queue is stopped */ #define QUEUE_FLAG_DYING 1/* queue being torn down */ #define QUEUE_FLAG_NOMERGES 3/* disable merge attempts */
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 35/215 thermal/drivers: imx: Fix missing of_node_put() at probe time
In reply to Greg Kroah-HartmanFrom: Anson Huang <[email protected]>
[ Upstream commit b45fd13be340e4ed0a2a9673ba299eb2a71ba829 ]
After finishing using cpu node got from of_get_cpu_node(), of_node_put() needs to be called.
--- drivers/thermal/imx_thermal.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/thermal/imx_thermal.c +4 -3
@@ -656,7 +656,7 @@ MODULE_DEVICE_TABLE(of, of_imx_thermal_match);static int imx_thermal_register_legacy_cooling (struct imx_thermal_data *data) {struct device_node *np; -int ret; +int ret =0 ; data->policy =cpufreq_cpu_get (0 );if (!data->policy) {
@@ -671,11 +671,12 @@ static int imx_thermal_register_legacy_cooling(struct imx_thermal_data *data)if (IS_ERR (data->cdev)) { ret =PTR_ERR (data->cdev);cpufreq_cpu_put (data->policy); -return ret; } } -return 0 ; +of_node_put (np); + +return ret; }static void imx_thermal_unregister_legacy_cooling (struct imx_thermal_data *data)
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 54/215 iio:health:afe4403 Fix timestamp alignment and prevent data leak.
In reply to Greg Kroah-HartmanFrom: Jonathan Cameron <[email protected]>
commit 3f9c6d38797e9903937b007a341dad0c251765d6 upstream.
One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses a 32 byte array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data with alignment explicitly requested. This data is allocated with kzalloc so no data can leak appart from previous readings.
--- drivers/iio/health/afe4403.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/iio/health/afe4403.c +8 -5
@@ -63,6 +63,7 @@ static const struct reg_field afe4403_re* @regulator: Pointer to the regulator for the IC * @trig: IIO trigger for this device * @irq: ADC_RDY line interrupt number +* @buffer: Used to construct data layout to push into IIO buffer. */ struct afe4403_data {struct device *dev;
@@ -72,6 +73,8 @@ struct afe4403_data {struct regulator *regulator;struct iio_trigger *trig;int irq; +/* Ensure suitable alignment for timestamp */ +s32 buffer[8 ]__aligned(8) ; };enum afe4403_chan_id {
@@ -309,7 +312,6 @@ static irqreturn_t afe4403_trigger_handlstruct iio_dev *indio_dev = pf->indio_dev;struct afe4403_data *afe =iio_priv (indio_dev);int ret, bit, i =0 ; -s32 buffer[8 ];u8 tx[4 ] = {AFE440X_CONTROL0 ,0x0 ,0x0 ,AFE440X_CONTROL0_READ };u8 rx[3 ];
@@ -326,9 +328,9 @@ static irqreturn_t afe4403_trigger_handlif (ret) goto err; - buffer[i++] = (rx[0 ] <<16 ) | - (rx[1 ] <<8 ) | - (rx[2 ]); + afe->buffer[i++] = (rx[0 ] <<16 ) | + (rx[1 ] <<8 ) | + (rx[2 ]); }/* Disable reading from the device */
@@ -337,7 +339,8 @@ static irqreturn_t afe4403_trigger_handlif (ret) goto err; -iio_push_to_buffers_with_timestamp (indio_dev, buffer, pf->timestamp); +iio_push_to_buffers_with_timestamp (indio_dev, afe->buffer, + pf->timestamp); err:iio_trigger_notify_done (indio_dev->trig);
Greg Kroah-Hartman
maintainerPATCH 56/215 net: dsa: bcm_sf2: Fix node reference count
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
[ Upstream commit 8dbe4c5d5e40fe140221024f7b16bec9f310bf70 ]
of_find_node_by_name() will do an of_node_put() on the "from" argument. With CONFIG_OF_DYNAMIC enabled which checks for device_node reference counts, we would be getting a warning like this:
[ 6.347230] refcount_t: increment on 0; use-after-free. [ 6.352498] WARNING: CPU: 3 PID: 77 at lib/refcount.c:156 refcount_inc_checked+0x38/0x44 [ 6.360601] Modules linked in: [ 6.363661] CPU: 3 PID: 77 Comm: kworker/3:1 Tainted: G W 5.4.46-gb78b3e9956e6 #13 [ 6.372546] Hardware name: BCM97278SV (DT) [ 6.376649] Workqueue: events deferred_probe_work_func [ 6.381796] pstate: 60000005 (nZCv daif -PAN -UAO) [ 6.386595] pc : refcount_inc_checked+0x38/0x44 [ 6.391133] lr : refcount_inc_checked+0x38/0x44 ... [ 6.478791] Call trace: [ 6.481243] refcount_inc_checked+0x38/0x44 [ 6.485433] kobject_get+0x3c/0x4c [ 6.488840] of_node_get+0x24/0x34 [ 6.492247] of_irq_find_parent+0x3c/0xe0 [ 6.496263] of_irq_parse_one+0xe4/0x1d0 [ 6.500191] irq_of_parse_and_map+0x44/0x84 [ 6.504381] bcm_sf2_sw_probe+0x22c/0x844 [ 6.508397] platform_drv_probe+0x58/0xa8 [ 6.512413] really_probe+0x238/0x3fc [ 6.516081] driver_probe_device+0x11c/0x12c [ 6.520358] __device_attach_driver+0xa8/0x100 [ 6.524808] bus_for_each_drv+0xb4/0xd0 [ 6.528650] __device_attach+0xd0/0x164 [ 6.532493] device_initial_probe+0x24/0x30 [ 6.536682] bus_probe_device+0x38/0x98 [ 6.540524] deferred_probe_work_func+0xa8/0xd4 [ 6.545061] process_one_work+0x178/0x288 [ 6.549078] process_scheduled_works+0x44/0x48 [ 6.553529] worker_thread+0x218/0x270 [ 6.557285] kthread+0xdc/0xe4 [ 6.560344] ret_from_fork+0x10/0x18 [ 6.563925] ---[ end trace 68f65caf69bb152a ]---
Fix this by adding a of_node_get() to increment the reference count prior to the call.
--- drivers/net/dsa/bcm_sf2.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/dsa/bcm_sf2.c +2 -0
@@ -1116,6 +1116,8 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev)set_bit (0 , priv->cfp.used);set_bit (0 , priv->cfp.unique); +/* Balance of_node_put() done by of_find_node_by_name() */ +of_node_get (dn); ports =of_find_node_by_name (dn,"ports" );if (ports) {bcm_sf2_identify_ports (priv, ports);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 53/215 iio:pressure:ms5611 Fix buffer element alignment
In reply to Greg Kroah-HartmanFrom: Jonathan Cameron <[email protected]>
commit 8db4afe163bbdd93dca6fcefbb831ef12ecc6b4d upstream.
One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. Here there is no data leak possibility so use an explicit structure on the stack to ensure alignment and nice readable fashion.
The forced alignment of ts isn't strictly necessary in this driver as the padding will be correct anyway (there isn't any). However it is probably less fragile to have it there and it acts as documentation of the requirement.
--- drivers/iio/pressure/ms5611_core.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/iio/pressure/ms5611_core.c +8 -3
@@ -212,16 +212,21 @@ static irqreturn_t ms5611_trigger_handlestruct iio_poll_func *pf = p;struct iio_dev *indio_dev = pf->indio_dev;struct ms5611_state *st =iio_priv (indio_dev); -s32 buf[4 ];/* s32 (pressure) + s32 (temp) + 2 * s32 (timestamp) */ +/* Ensure buffer elements are naturally aligned */ +struct { +s32 channels[2 ]; +s64 ts__aligned(8) ; + } scan;int ret;mutex_lock (&st->lock); - ret =ms5611_read_temp_and_pressure (indio_dev, &buf[1 ], &buf[0 ]); + ret =ms5611_read_temp_and_pressure (indio_dev, &scan.channels[1 ], + &scan.channels[0 ]);mutex_unlock (&st->lock);if (ret <0 ) goto err; -iio_push_to_buffers_with_timestamp (indio_dev, buf, +iio_push_to_buffers_with_timestamp (indio_dev, &scan,iio_get_time_ns (indio_dev)); err:
Greg Kroah-Hartman
maintainerPATCH 49/215 iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers
In reply to Greg Kroah-HartmanFrom: Matt Ranostay <[email protected]>
commit 25f02d3242ab4d16d0cee2dec0d89cedb3747fa9 upstream.
Add missing strings to iio_modifier_names[] for proper modification of channels.
--- drivers/iio/industrialio-core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/iio/industrialio-core.c +2 -0
@@ -130,6 +130,8 @@ static const char * const iio_modifier_n [IIO_MOD_PM2P5] = "pm2p5", [IIO_MOD_PM4] = "pm4", [IIO_MOD_PM10] = "pm10", + [IIO_MOD_ETHANOL] = "ethanol", + [IIO_MOD_H2] = "h2", };/* relies on pairs of these shared then separate */
Greg Kroah-Hartman
maintainerPATCH 32/215 drm/exynos: Properly propagate return value in drm_iommu_attach_device()
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
[ Upstream commit b9c633882de4601015625f9136f248e9abca8a7a ]
Propagate the proper error codes from the called functions instead of unconditionally returning 0.
Merge conflict so merged it manually.
--- drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_dma.c +2 -2
@@ -61,7 +61,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev, struct device *subdrv_dev, void **dma_priv) { struct exynos_drm_private *priv = drm_dev->dev_private; -int ret; +int ret =0 ;if (get_dma_ops (priv->dma_dev) !=get_dma_ops (subdrv_dev)) { DRM_DEV_ERROR(subdrv_dev, "Device %s lacks support for IOMMU\n",
@@ -92,7 +92,7 @@ static int drm_iommu_attach_device(struct drm_device *drm_dev,if (ret)clear_dma_max_seg_size (subdrv_dev); -return 0 ; +return ret; }/*
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 43/215 gfs2: read-only mounts should grab the sd_freeze_gl glock
In reply to Greg Kroah-HartmanFrom: Bob Peterson <[email protected]>
[ Upstream commit b780cc615ba4795a7ef0e93b19424828a5ad456a ]
Before this patch, only read-write mounts would grab the freeze glock in read-only mode, as part of gfs2_make_fs_rw. So the freeze glock was never initialized. That meant requests to freeze, which request the glock in EX, were granted without any state transition. That meant you could mount a gfs2 file system, which is currently frozen on a different cluster node, in read-only mode.
This patch makes read-only mounts lock the freeze glock in SH mode, which will block for file systems that are frozen on another node.
--- fs/gfs2/ops_fstype.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
fs/gfs2/ops_fstype.c +11 -1
@@ -1168,7 +1168,17 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) goto fail_per_node; } -if (!sb_rdonly (sb)) { +if (sb_rdonly (sb)) { +struct gfs2_holder freeze_gh; + + error =gfs2_glock_nq_init (sdp->sd_freeze_gl,LM_ST_SHARED , +GL_EXACT , &freeze_gh); +if (error) { +fs_err (sdp,"can't make FS RO: %d\n" , error); + goto fail_per_node; + } +gfs2_glock_dq_uninit (&freeze_gh); + }else { error =gfs2_make_fs_rw (sdp);if (error) {fs_err (sdp,"can't make FS RW: %d\n" , error);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 46/215 iio:magnetometer:ak8974: Fix alignment and data leak issues
In reply to Greg Kroah-HartmanFrom: Jonathan Cameron <[email protected]>
commit 838e00b13bfd4cac8b24df25bfc58e2eb99bcc70 upstream.
One of a class of bugs pointed out by Lars in a recent review. iio_push_to_buffers_with_timestamp assumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in the iio_priv() data.
This data is allocated with kzalloc so no data can leak appart from previous readings.
--- drivers/iio/magnetometer/ak8974.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/iio/magnetometer/ak8974.c +7 -3
@@ -185,6 +185,11 @@ struct ak8974 {bool drdy_irq;struct completion drdy_complete;bool drdy_active_low; +/* Ensure timestamp is naturally aligned */ +struct { +__le16 channels[3 ]; +s64 ts__aligned(8) ; + } scan; };static const char ak8974_reg_avdd[] ="avdd" ;
@@ -581,7 +586,6 @@ static void ak8974_fill_buffer(struct ii {struct ak8974 *ak8974 =iio_priv (indio_dev);int ret; -__le16 hw_values[8 ];/* Three axes + 64bit padding */ pm_runtime_get_sync (&ak8974->i2c->dev);mutex_lock (&ak8974->lock);
@@ -591,13 +595,13 @@ static void ak8974_fill_buffer(struct iidev_err (&ak8974->i2c->dev,"error triggering measure\n" ); goto out_unlock; } - ret =ak8974_getresult (ak8974, hw_values); + ret =ak8974_getresult (ak8974, ak8974->scan.channels);if (ret) {dev_err (&ak8974->i2c->dev,"error getting measures\n" ); goto out_unlock; } -iio_push_to_buffers_with_timestamp (indio_dev, hw_values, +iio_push_to_buffers_with_timestamp (indio_dev, &ak8974->scan,iio_get_time_ns (indio_dev)); out_unlock:
Greg Kroah-Hartman
maintainerPATCH 42/215 tpm_tis: extra chip->ops check on error path in tpm_tis_core_init
In reply to Greg Kroah-HartmanFrom: Vasily Averin <[email protected]>
[ Upstream commit ccf6fb858e17a8f8a914a1c6444d277cfedfeae6 ]
Found by smatch:drivers/char/tpm/tpm_tis_core.c:1088 tpm_tis_core_init() warn:
variable dereferenced before check 'chip->ops' (see line 979)
'chip->ops' is assigned in the beginning of function in tpmm_chip_alloc->tpm_chip_alloc
and is used before first possible goto to error path.
--- drivers/char/tpm/tpm_tis_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/char/tpm/tpm_tis_core.c +1 -1
@@ -1006,7 +1006,7 @@ int tpm_tis_core_init(struct device *dev, struct tpm_tis_data *priv, int irq,return 0 ; out_err: -if ((chip->ops !=NULL ) && (chip->ops->clk_enable !=NULL )) +if (chip->ops->clk_enable !=NULL ) chip->ops->clk_enable (chip, false);tpm_tis_remove (chip);
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 41/215 arm64/alternatives: use subsections for replacement sequences
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit f7b93d42945cc71e1346dd5ae07c59061d56745e ]
When building very large kernels, the logic that emits replacement sequences for alternatives fails when relative branches are present in the code that is emitted into the .altinstr_replacement section and patched in at the original site and fixed up. The reason is that the linker will insert veneers if relative branches go out of range, and due to the relative distance of the .altinstr_replacement from the .text section where its branch targets usually live, veneers may be emitted at the end of the .altinstr_replacement section, with the relative branches in the sequence pointed at the veneers instead of the actual target.
The alternatives patching logic will attempt to fix up the branch to point to its original target, which will be the veneer in this case, but given that the patch site is likely to be far away as well, it will be out of range and so patching will fail. There are other cases where these veneers are problematic, e.g., when the target of the branch is in .text while the patch site is in .init.text, in which case putting the replacement sequence inside .text may not help either.
So let's use subsections to emit the replacement code as closely as possible to the patch site, to ensure that veneers are only likely to be emitted if they are required at the patch site as well, in which case they will be in range for the replacement sequence both before and after it is transported to the patch site.
This will prevent alternative sequences in non-init code from being released from memory after boot, but this is tolerable given that the entire section is only 512 KB on an allyesconfig build (which weighs in at 500+ MB for the entire Image). Also, note that modules today carry the replacement sequences in non-init sections as well, and any of those that target init code will be emitted into init sections after this change.
This fixes an early crash when booting an allyesconfig kernel on a system where any of the alternatives sequences containing relative branches are activated at boot (e.g., ARM64_HAS_PAN on TX2)
--- arch/arm64/include/asm/alternative.h | 16 ++++++++-------- arch/arm64/kernel/vmlinux.lds.S | 3 --- 2 files changed, 8 insertions(+), 11 deletions(-)
arch/arm64/include/asm/alternative.h +8 -8
@@ -73,11 +73,11 @@ static inline void apply_alternatives_module(void *start, size_t length) { }".pushsection .altinstructions,\"a\"\n" \ ALTINSTR_ENTRY(feature) \".popsection\n" \ -".pushsection .altinstr_replacement, \"a\"\n" \ +".subsection 1\n" \"663:\n\t" \ newinstr"\n" \"664:\n\t" \ -".popsection\n\t" \ +".previous\n\t" \".org . - (664b-663b) + (662b-661b)\n\t" \".org . - (662b-661b) + (664b-663b)\n" \".endif\n"
@@ -117,9 +117,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } 662: .pushsection .altinstructions, "a" altinstruction_entry 661b, 663f, \cap, 662b-661b, 664f-663f .popsection - .pushsection .altinstr_replacement,"ax" + .subsection 1 663: \insn2 -664: .popsection +664: .previous .org . - (664b-663b) + (662b-661b) .org . - (662b-661b) + (664b-663b) .endif
@@ -160,7 +160,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } .pushsection .altinstructions, "a" altinstruction_entry 663f, 661f, \cap, 664f-663f, 662f-661f .popsection - .pushsection .altinstr_replacement, "ax" + .subsection 1 .align 2 /* So GAS knows label 661 is suitably aligned */ 661: .endm
@@ -179,9 +179,9 @@ static inline void apply_alternatives_module(void *start, size_t length) { } .macro alternative_else 662: .if .Lasm_alt_mode==0 - .pushsection .altinstr_replacement,"ax" + .subsection 1 .else - .popsection + .previous .endif 663: .endm
@@ -192,7 +192,7 @@ static inline void apply_alternatives_module(void *start, size_t length) { } .macro alternative_endif 664: .if .Lasm_alt_mode==0 - .popsection + .previous .endif .org . - (664b-663b) + (662b-661b) .org . - (662b-661b) + (664b-663b)
arch/arm64/kernel/vmlinux.lds.S +0 -3
@@ -172,9 +172,6 @@ SECTIONS *(.altinstructions) __alt_instructions_end = .; } - .altinstr_replacement : { - *(.altinstr_replacement) - } . = ALIGN(PAGE_SIZE); __inittext_end = .;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainerPATCH 40/215 cifs: prevent truncation from long to int in wait_for_free_credits
In reply to Greg Kroah-HartmanFrom: Ronnie Sahlberg <[email protected]>
[ Upstream commit 19e888678bac8c82206eb915eaf72741b2a2615c ]
The wait_event_... defines evaluate to long so we should not assign it an int as this may truncate the value.
--- fs/cifs/transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/transport.c +1 -1
@@ -528,7 +528,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int num_credits, const int timeout, const int flags, unsigned int *instance) { - int rc; + long rc;int *credits;int optype;long int t;
Signature · 1 line
2.25.1
Greg Kroah-Hartman
maintainercover 5.4.53-rc1 review
This is the start of the stable review cycle for the 5.4.53 release. There are 215 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 Wed, 22 Jul 2020 15:27:31 +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.53-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.53-rc1
Andy Shevchenko <[email protected]>
gpio: pca953x: disable regmap locking for automatic address incrementing
Colin Xu <[email protected]>
drm/i915/gvt: Fix two CFL MMIO handling caused by regression.
Lu Baolu <[email protected]>
iommu/vt-d: Make Intel SVM code 64-bit only
Shannon Nelson <[email protected]>
ionic: export features for vlans to use
Lingling Xu <[email protected]>
spi: sprd: switch the sequence of setting WDG_LOAD_LOW and _HIGH
David Howells <[email protected]>
rxrpc: Fix trace string
Ilya Dryomov <[email protected]>
libceph: don't omit recovery_deletes in target_copy()
Ming Lei <[email protected]>
block: fix get_max_segment_size() overflow on 32bit arch
Ming Lei <[email protected]>
block: fix splitting segments on boundary masks
Chris Wilson <[email protected]>
drm/i915/gt: Ignore irq enabling on the virtual engines
Xiaojie Yuan <[email protected]>
drm/amdgpu/sdma5: fix wptr overwritten in ->get_wptr()
Thomas Gleixner <[email protected]>
genirq/affinity: Handle affinity setting on inactive interrupts correctly
Vincent Guittot <[email protected]>
sched/fair: handle case of task_h_load() returning 0
Mathieu Desnoyers <[email protected]>
sched: Fix unreliable rseq cpu_id for new tasks
Will Deacon <[email protected]>
arm64: compat: Ensure upper 32 bits of x0 are zero on syscall return
Will Deacon <[email protected]>
arm64: ptrace: Consistently use pseudo-singlestep exceptions
Will Deacon <[email protected]>
arm64: ptrace: Override SPSR.SS when single-stepping is enabled
Finley Xiao <[email protected]>
thermal/drivers/cpufreq_cooling: Fix wrong frequency converted from power
Alex Hung <[email protected]>
thermal: int3403_thermal: Downgrade error message
Michał Mirosław <[email protected]>
misc: atmel-ssc: lock with mutex instead of spinlock
Robin Gong <[email protected]>
dmaengine: fsl-edma-common: correct DSIZE_32BYTE
Krzysztof Kozlowski <[email protected]>
dmaengine: mcf-edma: Fix NULL pointer exception in mcf_edma_tx_handler
Krzysztof Kozlowski <[email protected]>
dmaengine: fsl-edma: Fix NULL pointer exception in fsl_edma_tx_handler
Alexander Shishkin <[email protected]>
intel_th: Fix a NULL dereference when hub driver is not loaded
Alexander Shishkin <[email protected]>
intel_th: pci: Add Emmitsburg PCH support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Tiger Lake PCH-H support
Alexander Shishkin <[email protected]>
intel_th: pci: Add Jasper Lake CPU support
Satheesh Rajendran <[email protected]>
powerpc/pseries/svm: Fix incorrect check for shared_lppaca_size
Aneesh Kumar K.V <[email protected]>
powerpc/book3s64/pkeys: Fix pkey_access_permitted() for execute disable pkey
Vishwas M <[email protected]>
hwmon: (emc2103) fix unable to change fan pwm1_enable attribute
Andreas Schwab <[email protected]>
riscv: use 16KB kernel stack on 64-bit
Frederic Weisbecker <[email protected]>
timer: Fix wheel index calculation on last level
Frederic Weisbecker <[email protected]>
timer: Prevent base->clk from moving backward
Chandrakanth Patil <[email protected]>
scsi: megaraid_sas: Remove undefined ENABLE_IRQ_POLL macro
Esben Haabendal <[email protected]>
uio_pdrv_genirq: fix use without device tree and no interrupt
Esben Haabendal <[email protected]>
uio_pdrv_genirq: Remove warning when irq is not specified
Dave Wang <[email protected]>
Input: elan_i2c - add more hardware ID for Lenovo laptops
David Pedersen <[email protected]>
Input: i8042 - add Lenovo XiaoXin Air 12 to i8042 nomux list
Alexander Usyskin <[email protected]>
mei: bus: don't clean driver pointer
Wade Mealing <[email protected]>
Revert "zram: convert remaining CLASS_ATTR() to CLASS_ATTR_RO()"
Chirantan Ekbote <[email protected]>
fuse: Fix parameter for FS_IOC_{GET,SET}FLAGS
Miklos Szeredi <[email protected]>
fuse: use ->reconfigure() instead of ->remount_fs()
Miklos Szeredi <[email protected]>
fuse: ignore 'data' argument of mount(..., MS_REMOUNT)
Amir Goldstein <[email protected]>
ovl: fix unneeded call to ovl_change_flags()
Amir Goldstein <[email protected]>
ovl: relax WARN_ON() when decoding lower directory file handle
youngjun <[email protected]>
ovl: inode reference leak in ovl_is_inuse true case.
Amir Goldstein <[email protected]>
ovl: fix regression with re-formatted lower squashfs
Chuhong Yuan <[email protected]>
serial: mxs-auart: add missed iounmap() in probe failure and remove
Alexander Lobakin <[email protected]>
virtio: virtio_console: add missing MODULE_DEVICE_TABLE() for rproc serial
Jan Kiszka <[email protected]>
Revert "tty: xilinx_uartps: Fix missing id assignment to the console"
Hans de Goede <[email protected]>
virt: vbox: Fix guest capabilities mask check
Hans de Goede <[email protected]>
virt: vbox: Fix VBGL_IOCTL_VMMDEV_REQUEST_BIG and _LOG req numbers to match upstream
AceLan Kao <[email protected]>
USB: serial: option: add Quectel EG95 LTE modem
Jörgen Storvist <[email protected]>
USB: serial: option: add GosunCn GM500 series
Igor Moura <[email protected]>
USB: serial: ch341: add new Product ID for CH340
James Hilliard <[email protected]>
USB: serial: cypress_m8: enable Simply Automated UPB PIM
Johan Hovold <[email protected]>
USB: serial: iuu_phoenix: fix memory corruption
Zhang Qiang <[email protected]>
usb: gadget: function: fix missing spinlock in f_uac1_legacy
Peter Chen <[email protected]>
usb: chipidea: core: add wakeup support for extcon
Minas Harutyunyan <[email protected]>
usb: dwc2: Fix shutdown callback in platform
Tom Rix <[email protected]>
USB: c67x00: fix use after free in c67x00_giveback_urb
Kailang Yang <[email protected]>
ALSA: hda/realtek - Enable Speaker for ASUS UX563
Kailang Yang <[email protected]>
ALSA: hda/realtek - Enable Speaker for ASUS UX533 and UX534
Jian-Hong Pan <[email protected]>
ALSA: hda/realtek: Enable headset mic of Acer TravelMate B311R-31 with ALC256
Armas Spann <[email protected]>
ALSA: hda/realtek: enable headset mic of ASUS ROG Zephyrus G14(G401) series with ALC289
Kailang Yang <[email protected]>
ALSA: hda/realtek - change to suitable link model for ASUS platform
Takashi Iwai <[email protected]>
ALSA: usb-audio: Fix race against the error recovery URB submission
Takashi Iwai <[email protected]>
ALSA: line6: Sync the pending work cancel at disconnection
Takashi Iwai <[email protected]>
ALSA: line6: Perform sanity check for each URB creation
James Hilliard <[email protected]>
HID: quirks: Ignore Simply Automated UPB PIM
Sebastian Parschauer <[email protected]>
HID: quirks: Always poll Obins Anne Pro 2 keyboard
Dmitry Torokhov <[email protected]>
HID: magicmouse: do not set up autorepeat
Maciej S. Szmigiero <[email protected]>
HID: logitech-hidpp: avoid repeated "multiplier = " log messages
Saravana Kannan <[email protected]>
slimbus: core: Fix mismatch in of_node_get/put
Vinod Koul <[email protected]>
clk: qcom: gcc: Add missing UFS clocks for SM8150
Vinod Koul <[email protected]>
clk: qcom: gcc: Add GPU and NPU clocks for SM8150
Miquel Raynal <[email protected]>
mtd: rawnand: oxnas: Release all devices in the _remove() path
Miquel Raynal <[email protected]>
mtd: rawnand: oxnas: Unregister all devices on error
Miquel Raynal <[email protected]>
mtd: rawnand: oxnas: Keep track of registered devices
Álvaro Fernández Rojas <[email protected]>
mtd: rawnand: brcmnand: fix CS0 layout
Álvaro Fernández Rojas <[email protected]>
mtd: rawnand: brcmnand: correctly verify erased pages
Miquel Raynal <[email protected]>
mtd: rawnand: timings: Fix default tR_max and tCCS_min timings
Miquel Raynal <[email protected]>
mtd: rawnand: marvell: Fix probe error path
Miquel Raynal <[email protected]>
mtd: rawnand: marvell: Use nand_cleanup() when the device is not yet registered
Miquel Raynal <[email protected]>
mtd: rawnand: marvell: Fix the condition on a return code
Aharon Landau <[email protected]>
RDMA/mlx5: Verify that QP is created with RQ or SQ
Maulik Shah <[email protected]>
soc: qcom: rpmh-rsc: Allow using free WAKE TCS for active request
Raju P.L.S.S.S.N <[email protected]>
soc: qcom: rpmh-rsc: Clear active mode configuration for wake TCS
Maulik Shah <[email protected]>
soc: qcom: rpmh: Invalidate SLEEP and WAKE TCSes before flushing new data
Maulik Shah <[email protected]>
soc: qcom: rpmh: Update dirty flag only when data changes
Jin Yao <[email protected]>
perf stat: Zero all the 'ena' and 'run' array slot stats for interval mode
Bjorn Helgaas <[email protected]>
PCI/PM: Call .bridge_d3() hook only if non-NULL
Tomer Tayar <[email protected]>
habanalabs: Align protection bits configuration of all TPCs
John Johansen <[email protected]>
apparmor: ensure that dfa state tables have entries
Srinivas Kandagatla <[email protected]>
soc: qcom: socinfo: add missing soc_id sysfs entry
Sean Wang <[email protected]>
arm: dts: mt7623: add phy-mode property for gmac2
Kevin Buettner <[email protected]>
copy_xstate_to_kernel: Fix typo which caused GDB regression
Douglas Anderson <[email protected]>
regmap: debugfs: Don't sleep while atomic for fast_io regmaps
Wei Yongjun <[email protected]>
keys: asymmetric: fix error return code in software_key_query()
Krzysztof Kozlowski <[email protected]>
arm64: dts: spcfpga: Align GIC, NAND and UART nodenames with dtschema
Krzysztof Kozlowski <[email protected]>
ARM: dts: socfpga: Align L2 cache-controller nodename with dtschema
Colin Ian King <[email protected]>
xprtrdma: fix incorrect header size calculations
Enric Balletbo i Serra <[email protected]>
Revert "thermal: mediatek: fix register index error"
dillon min <[email protected]>
ARM: dts: Fix dcan driver probe failed on am437x platform
Vasily Averin <[email protected]>
fuse: don't ignore errors from fuse_writepages_fill()
Anna Schumaker <[email protected]>
NFS: Fix interrupted slots by sending a solo SEQUENCE operation
Eddie James <[email protected]>
clk: AST2600: Add mux for EMMC clock
Nathan Chancellor <[email protected]>
clk: mvebu: ARMADA_AP_CPU_CLK needs to select ARMADA_AP_CP_HELPER
Dan Carpenter <[email protected]>
staging: comedi: verify array index is correct before using it
Michał Mirosław <[email protected]>
usb: gadget: udc: atmel: fix uninitialized read in debug printk
Marc Kleine-Budde <[email protected]>
spi: spi-sun6i: sun6i_spi_transfer_one(): fix setting of clock rate
Peter Ujfalusi <[email protected]>
dmaengine: dmatest: stop completed threads when running without set channel
Andy Shevchenko <[email protected]>
dmaengine: dw: Initialize channel before each transfer
Christophe JAILLET <[email protected]>
iio: adc: ad7780: Fix a resource handling path in 'ad7780_probe()'
Tony Lindgren <[email protected]>
bus: ti-sysc: Do not disable on suspend for no-idle
Tony Lindgren <[email protected]>
bus: ti-sysc: Fix sleeping function called from invalid context for RTC quirk
Tony Lindgren <[email protected]>
bus: ti-sysc: Fix wakeirq sleeping function called from invalid context
Neil Armstrong <[email protected]>
arm64: dts: meson-gxl-s805x: reduce initial Mali450 core frequency
Jerome Brunet <[email protected]>
arm64: dts: meson: add missing gxl rng clock
Colin Ian King <[email protected]>
phy: sun4i-usb: fix dereference of pointer phy0 before it is null checked
Yoshihiro Shimoda <[email protected]>
dmaengine: sh: usb-dmac: set tx_result parameters
Pierre-Louis Bossart <[email protected]>
soundwire: intel: fix memory leak with devm_kasprintf
Jonathan Cameron <[email protected]>
iio:health:afe4404 Fix timestamp alignment and prevent data leak.
Christoffer Nielsen <[email protected]>
ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Flight S
Tony Lindgren <[email protected]>
bus: ti-sysc: Use optional clocks on for enable and wait for softreset bit
Paul Menzel <[email protected]>
ACPI: video: Use native backlight on Acer TravelMate 5735Z
Stephan Gerhold <[email protected]>
Input: mms114 - add extra compatible for mms345l
Gregor Pintar <[email protected]>
ALSA: usb-audio: Add quirk for Focusrite Scarlett 2i2
Emmanuel Pescosta <[email protected]>
ALSA: usb-audio: Add registration quirk for Kingston HyperX Cloud Alpha S
Hans de Goede <[email protected]>
ACPI: video: Use native backlight on Acer Aspire 5783z
Takashi Iwai <[email protected]>
ALSA: usb-audio: Rewrite registration quirk handling
Haibo Chen <[email protected]>
mmc: sdhci: do not enable card detect interrupt for gpio cd type
Neil Armstrong <[email protected]>
doc: dt: bindings: usb: dwc3: Update entries for disabling SS instances in park mode
Chris Wulff <[email protected]>
ALSA: usb-audio: Create a registration quirk for Kingston HyperX Amp (0951:16d8)
Sergei A. Trusov <[email protected]>
Input: goodix - fix touch coordinates on Cube I15-TC
Alexander Tsoy <[email protected]>
ALSA: usb-audio: Add support for MOTU MicroBook IIc
Tony Lindgren <[email protected]>
bus: ti-sysc: Detect EDMA and set quirk flags for tptc
Neil Armstrong <[email protected]>
arm64: dts: g12-common: add parkmode_disable_ss_quirk on DWC3 controller
Tony Lindgren <[email protected]>
bus: ti-sysc: Detect display subsystem related devices
Tony Lindgren <[email protected]>
bus: ti-sysc: Handle module unlock quirk needed for some RTC
Tony Lindgren <[email protected]>
bus: ti-sysc: Consider non-existing registers too when matching quirks
Tony Lindgren <[email protected]>
bus: ti-sysc: Rename clk related quirks to pre_reset and post_reset quirks
Diego Elio Pettenò <[email protected]>
scsi: sr: remove references to BLK_DEV_SR_VENDOR, leave it enabled
Andrey Lebedev <[email protected]>
drm/sun4i: tcon: Separate quirks for tcon0 and tcon1 on A20
Claudiu Beznea <[email protected]>
ARM: at91: pm: add quirk for sam9x60's ulp1
Hans de Goede <[email protected]>
HID: quirks: Remove ITE 8595 entry from hid_have_special_driver
Linus Walleij <[email protected]>
mmc: mmci: Support any block sizes for ux500v2 and qcom variant
Suman Anna <[email protected]>
ARM: OMAP2+: use separate IOMMU pdata to fix DRA7 IPU1 boot
Suman Anna <[email protected]>
ARM: OMAP2+: Add workaround for DRA7 DSP MStandby errata i879
Tero Kristo <[email protected]>
ARM: OMAP4+: remove pdata quirks for omap4+ iommus
Russell King <[email protected]>
net: sfp: add some quirks for GPON modules
Russell King <[email protected]>
net: sfp: add support for module quirks
Sasha Levin <[email protected]>
Revert "usb/xhci-plat: Set PM runtime as active on resume"
Sasha Levin <[email protected]>
Revert "usb/ehci-platform: Set PM runtime as active on resume"
Sasha Levin <[email protected]>
Revert "usb/ohci-platform: Fix a warning when hibernating"
Sascha Hauer <[email protected]>
net: ethernet: mvneta: Add back interface mode validation
Sascha Hauer <[email protected]>
net: ethernet: mvneta: Do not error out in non serdes modes
Sasha Levin <[email protected]>
net: macb: call pm_runtime_put_sync on failure path
Florian Fainelli <[email protected]>
of: of_mdio: Correct loop scanning logic
Florian Fainelli <[email protected]>
net: dsa: bcm_sf2: Fix node reference count
Krzysztof Kozlowski <[email protected]>
spi: spi-fsl-dspi: Fix lockup if device is shutdown during SPI transfer
Jonathan Cameron <[email protected]>
iio:health:afe4403 Fix timestamp alignment and prevent data leak.
Jonathan Cameron <[email protected]>
iio:pressure:ms5611 Fix buffer element alignment
Jonathan Cameron <[email protected]>
iio:humidity:hts221 Fix alignment and data leak issues
Navid Emamdoost <[email protected]>
iio: pressure: zpa2326: handle pm_runtime_get_sync failure
Chuhong Yuan <[email protected]>
iio: mma8452: Add missed iio_device_unregister() call in mma8452_probe()
Matt Ranostay <[email protected]>
iio: core: add missing IIO_MOD_H2/ETHANOL string identifiers
Dinghao Liu <[email protected]>
iio: magnetometer: ak8974: Fix runtime PM imbalance on error
Jonathan Cameron <[email protected]>
iio:humidity:hdc100x Fix alignment and data leak issues
Jonathan Cameron <[email protected]>
iio:magnetometer:ak8974: Fix alignment and data leak issues
Ard Biesheuvel <[email protected]>
arm64/alternatives: don't patch up internal branches
Andy Shevchenko <[email protected]>
i2c: eg20t: Load module automatically if ID matches
Bob Peterson <[email protected]>
gfs2: read-only mounts should grab the sd_freeze_gl glock
Vasily Averin <[email protected]>
tpm_tis: extra chip->ops check on error path in tpm_tis_core_init
Ard Biesheuvel <[email protected]>
arm64/alternatives: use subsections for replacement sequences
Ronnie Sahlberg <[email protected]>
cifs: prevent truncation from long to int in wait_for_free_credits
Kangmin Park <[email protected]>
dt-bindings: mailbox: zynqmp_ipi: fix unit address
Angelo Dureghello <[email protected]>
m68k: mm: fix node memblock init
Mike Rapoport <[email protected]>
m68k: nommu: register start of the memory with memblock
Hou Tao <[email protected]>
blk-mq-debugfs: update blk_queue_flag_name[] accordingly for new flags
Anson Huang <[email protected]>
thermal/drivers: imx: Fix missing of_node_put() at probe time
Petteri Aimonen <[email protected]>
x86/fpu: Reset MXCSR to default in kernel_fpu_begin()
Navid Emamdoost <[email protected]>
drm/exynos: fix ref count leak in mic_pre_enable
Marek Szyprowski <[email protected]>
drm/exynos: Properly propagate return value in drm_iommu_attach_device()
Krishna Manikandan <[email protected]>
drm/msm/dpu: allow initialization of encoder locks during encoder init
Bernard Zhao <[email protected]>
drm/msm: fix potential memleak in error branch
Marc Zyngier <[email protected]>
arm64: arch_timer: Disable the compat vdso for cores affected by ARM64_WORKAROUND_1418040
Marc Zyngier <[email protected]>
arm64: arch_timer: Allow an workaround descriptor to disable compat vdso
Marc Zyngier <[email protected]>
arm64: Introduce a way to disable the 32bit vdso
Willem de Bruijn <[email protected]>
ip: Fix SO_MARK in RST, ACK and ICMP packets
Cong Wang <[email protected]>
cgroup: Fix sock_cgroup_data on big-endian.
Cong Wang <[email protected]>
cgroup: fix cgroup_sk_alloc() for sk_clone_lock()
Eric Dumazet <[email protected]>
tcp: md5: allow changing MD5 keys in all socket states
Eric Dumazet <[email protected]>
tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers
Toke Høiland-Jørgensen <[email protected]>
vlan: consolidate VLAN parsing code and limit max parsing depth
Eric Dumazet <[email protected]>
tcp: md5: do not send silly options in SYNCOOKIES
Eric Dumazet <[email protected]>
tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()
Christoph Paasch <[email protected]>
tcp: make sure listeners don't initialize congestion-control state
Eric Dumazet <[email protected]>
tcp: fix SO_RCVLOWAT possible hangs under high mem pressure
Toke Høiland-Jørgensen <[email protected]>
sched: consistently handle layer3 header accesses in the presence of VLANs
AceLan Kao <[email protected]>
net: usb: qmi_wwan: add support for Quectel EG95 LTE modem
Cong Wang <[email protected]>
net_sched: fix a memory leak in atm_tc_init()
Codrin Ciubotariu <[email protected]>
net: dsa: microchip: set the correct number of ports
Martin Varghese <[email protected]>
net: Added pointer check for dst->ops->neigh_lookup in dst_neigh_lookup_skb
Eric Dumazet <[email protected]>
llc: make sure applications use ARPHRD_ETHER
Xin Long <[email protected]>
l2tp: remove skb_dst_set() from l2tp_xmit_skb()
David Ahern <[email protected]>
ipv6: Fix use of anycast address with loopback
David Ahern <[email protected]>
ipv6: fib6_select_path can not use out path for nexthop objects
Sabrina Dubroca <[email protected]>
ipv4: fill fl4_icmp_{type,code} in ping_v4_sendmsg
Sean Tranchetti <[email protected]>
genetlink: remove genl_bind
Linus Lüssing <[email protected]>
bridge: mcast: Fix MLD2 Report IPv6 payload length check
Taehee Yoo <[email protected]>
net: rmnet: fix lower interface leak
Dmitry Bogdanov <[email protected]>
net: atlantic: fix ip dst and ipv6 address filters
YueHaibing <[email protected]>
crypto: atmel - Fix build error of CRYPTO_AUTHENC
Tudor Ambarus <[email protected]>
crypto: atmel - Fix selection of CRYPTO_AUTHENC
-------------
Diffstat:
.../bindings/mailbox/xlnx,zynqmp-ipi-mailbox.txt | 2 +- Documentation/devicetree/bindings/usb/dwc3.txt | 2 + Makefile | 4 +- arch/alpha/configs/defconfig | 1 - arch/arm/boot/dts/am437x-l4.dtsi | 14 +- arch/arm/boot/dts/mt7623n-rfb-emmc.dts | 1 + arch/arm/boot/dts/socfpga.dtsi | 2 +- arch/arm/boot/dts/socfpga_arria10.dtsi | 2 +- arch/arm/configs/rpc_defconfig | 1 - arch/arm/configs/s3c2410_defconfig | 1 - arch/arm/include/asm/clocksource.h | 11 +- arch/arm/kernel/vdso.c | 2 +- arch/arm/mach-at91/pm_suspend.S | 4 + arch/arm/mach-omap2/omap-iommu.c | 43 ++- arch/arm/mach-omap2/pdata-quirks.c | 35 ++- arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi | 8 +- arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi | 1 + .../dts/amlogic/meson-gxl-s805x-libretech-ac.dts | 2 +- .../boot/dts/amlogic/meson-gxl-s805x-p241.dts | 2 +- arch/arm64/boot/dts/amlogic/meson-gxl-s805x.dtsi | 24 ++ arch/arm64/boot/dts/amlogic/meson-gxl.dtsi | 5 + arch/arm64/include/asm/alternative.h | 16 +- arch/arm64/include/asm/arch_timer.h | 1 + arch/arm64/include/asm/clocksource.h | 5 +- arch/arm64/include/asm/debug-monitors.h | 2 + arch/arm64/include/asm/syscall.h | 12 +- arch/arm64/include/asm/thread_info.h | 1 + arch/arm64/include/asm/vdso/clocksource.h | 14 + arch/arm64/include/asm/vdso/compat_gettimeofday.h | 5 +- arch/arm64/include/asm/vdso/gettimeofday.h | 6 +- arch/arm64/include/asm/vdso/vsyscall.h | 4 +- arch/arm64/kernel/alternative.c | 16 +- arch/arm64/kernel/debug-monitors.c | 20 +- arch/arm64/kernel/ptrace.c | 29 +- arch/arm64/kernel/signal.c | 11 +- arch/arm64/kernel/syscall.c | 5 +- arch/arm64/kernel/vmlinux.lds.S | 3 - arch/ia64/configs/zx1_defconfig | 1 - arch/m68k/configs/amiga_defconfig | 1 - arch/m68k/configs/apollo_defconfig | 1 - arch/m68k/configs/atari_defconfig | 1 - arch/m68k/configs/bvme6000_defconfig | 1 - arch/m68k/configs/hp300_defconfig | 1 - arch/m68k/configs/mac_defconfig | 1 - arch/m68k/configs/multi_defconfig | 1 - arch/m68k/configs/mvme147_defconfig | 1 - arch/m68k/configs/mvme16x_defconfig | 1 - arch/m68k/configs/q40_defconfig | 1 - arch/m68k/configs/sun3_defconfig | 1 - arch/m68k/configs/sun3x_defconfig | 1 - arch/m68k/kernel/setup_no.c | 3 +- arch/m68k/mm/mcfmmu.c | 2 +- arch/mips/configs/bigsur_defconfig | 1 - arch/mips/configs/fuloong2e_defconfig | 1 - arch/mips/configs/ip27_defconfig | 1 - arch/mips/configs/ip32_defconfig | 1 - arch/mips/configs/jazz_defconfig | 1 - arch/mips/configs/malta_defconfig | 1 - arch/mips/configs/malta_kvm_defconfig | 1 - arch/mips/configs/malta_kvm_guest_defconfig | 1 - arch/mips/configs/maltaup_xpa_defconfig | 1 - arch/mips/configs/rm200_defconfig | 1 - arch/powerpc/configs/85xx-hw.config | 1 - arch/powerpc/configs/amigaone_defconfig | 1 - arch/powerpc/configs/chrp32_defconfig | 1 - arch/powerpc/configs/g5_defconfig | 1 - arch/powerpc/configs/maple_defconfig | 1 - arch/powerpc/configs/pasemi_defconfig | 1 - arch/powerpc/configs/pmac32_defconfig | 1 - arch/powerpc/configs/powernv_defconfig | 1 - arch/powerpc/configs/ppc64_defconfig | 1 - arch/powerpc/configs/ppc64e_defconfig | 1 - arch/powerpc/configs/ppc6xx_defconfig | 1 - arch/powerpc/configs/pseries_defconfig | 1 - arch/powerpc/configs/skiroot_defconfig | 1 - arch/powerpc/kernel/paca.c | 2 +- arch/powerpc/mm/book3s64/pkeys.c | 12 +- arch/riscv/include/asm/thread_info.h | 4 + arch/sh/configs/sh03_defconfig | 1 - arch/sparc/configs/sparc64_defconfig | 1 - arch/x86/configs/i386_defconfig | 1 - arch/x86/configs/x86_64_defconfig | 1 - arch/x86/include/asm/fpu/internal.h | 5 + arch/x86/kernel/apic/vector.c | 22 +- arch/x86/kernel/fpu/core.c | 6 + arch/x86/kernel/fpu/xstate.c | 2 +- block/blk-merge.c | 23 +- block/blk-mq-debugfs.c | 3 + crypto/asymmetric_keys/public_key.c | 1 + drivers/acpi/video_detect.c | 19 ++ drivers/base/regmap/regmap-debugfs.c | 52 ++-- drivers/block/zram/zram_drv.c | 3 +- drivers/bus/ti-sysc.c | 331 ++++++++++++++------- drivers/char/tpm/tpm_tis_core.c | 2 +- drivers/char/virtio_console.c | 3 +- drivers/clk/clk-ast2600.c | 49 ++- drivers/clk/mvebu/Kconfig | 1 + drivers/clk/qcom/gcc-sm8150.c | 148 +++++++++ drivers/clocksource/arm_arch_timer.c | 19 +- drivers/crypto/Kconfig | 8 +- drivers/dma/dmatest.c | 2 + drivers/dma/dw/core.c | 12 - drivers/dma/fsl-edma-common.h | 2 +- drivers/dma/fsl-edma.c | 7 + drivers/dma/mcf-edma.c | 7 + drivers/dma/sh/usb-dmac.c | 2 + drivers/gpio/gpio-pca953x.c | 1 + drivers/gpu/drm/amd/amdgpu/sdma_v5_0.c | 26 +- drivers/gpu/drm/exynos/exynos_drm_dma.c | 4 +- drivers/gpu/drm/exynos/exynos_drm_mic.c | 4 +- drivers/gpu/drm/i915/gt/intel_lrc.c | 1 + drivers/gpu/drm/i915/gvt/handlers.c | 4 +- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 4 +- drivers/gpu/drm/msm/msm_submitqueue.c | 4 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 + drivers/hid/hid-ids.h | 3 + drivers/hid/hid-logitech-hidpp.c | 2 +- drivers/hid/hid-magicmouse.c | 6 + drivers/hid/hid-quirks.c | 5 +- drivers/hwmon/emc2103.c | 2 +- drivers/hwtracing/intel_th/core.c | 21 +- drivers/hwtracing/intel_th/pci.c | 15 + drivers/hwtracing/intel_th/sth.c | 4 +- drivers/i2c/busses/i2c-eg20t.c | 1 + drivers/iio/accel/mma8452.c | 5 +- drivers/iio/adc/ad7780.c | 2 +- drivers/iio/health/afe4403.c | 13 +- drivers/iio/health/afe4404.c | 8 +- drivers/iio/humidity/hdc100x.c | 10 +- drivers/iio/humidity/hts221.h | 7 +- drivers/iio/humidity/hts221_buffer.c | 9 +- drivers/iio/industrialio-core.c | 2 + drivers/iio/magnetometer/ak8974.c | 29 +- drivers/iio/pressure/ms5611_core.c | 11 +- drivers/iio/pressure/zpa2326.c | 4 +- drivers/infiniband/hw/mlx5/qp.c | 2 + drivers/input/serio/i8042-x86ia64io.h | 7 + drivers/input/touchscreen/goodix.c | 22 ++ drivers/input/touchscreen/mms114.c | 17 +- drivers/iommu/Kconfig | 2 +- drivers/misc/atmel-ssc.c | 24 +- drivers/misc/habanalabs/goya/goya_security.c | 99 +++++- drivers/misc/mei/bus.c | 3 +- drivers/mmc/host/mmci.c | 34 ++- drivers/mmc/host/mmci.h | 8 +- drivers/mmc/host/sdhci.c | 2 +- drivers/mtd/nand/raw/brcmnand/brcmnand.c | 24 +- drivers/mtd/nand/raw/marvell_nand.c | 27 +- drivers/mtd/nand/raw/nand_timings.c | 5 +- drivers/mtd/nand/raw/oxnas_nand.c | 24 +- drivers/net/dsa/bcm_sf2.c | 2 + drivers/net/dsa/microchip/ksz8795.c | 3 + drivers/net/dsa/microchip/ksz9477.c | 3 + .../ethernet/aquantia/atlantic/hw_atl/hw_atl_llh.c | 4 +- .../aquantia/atlantic/hw_atl/hw_atl_llh_internal.h | 2 +- drivers/net/ethernet/cadence/macb_main.c | 6 +- drivers/net/ethernet/marvell/mvneta.c | 24 +- drivers/net/ethernet/pensando/ionic/ionic_lif.c | 1 + drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 19 +- drivers/net/phy/sfp-bus.c | 79 +++++ drivers/net/usb/qmi_wwan.c | 1 + drivers/of/of_mdio.c | 9 +- drivers/pci/pci.c | 4 +- drivers/phy/allwinner/phy-sun4i-usb.c | 5 +- drivers/scsi/Kconfig | 9 - drivers/scsi/megaraid/megaraid_sas_fusion.c | 2 - drivers/scsi/sr_vendor.c | 8 - drivers/slimbus/core.c | 1 + drivers/soc/qcom/rpmh-rsc.c | 98 +++--- drivers/soc/qcom/rpmh.c | 56 ++-- drivers/soc/qcom/socinfo.c | 2 + drivers/soundwire/intel.c | 5 +- drivers/spi/spi-fsl-dspi.c | 15 +- drivers/spi/spi-sprd-adi.c | 2 +- drivers/spi/spi-sun6i.c | 14 +- drivers/staging/comedi/drivers/addi_apci_1500.c | 10 +- drivers/thermal/cpu_cooling.c | 6 +- drivers/thermal/imx_thermal.c | 7 +- .../intel/int340x_thermal/int3403_thermal.c | 2 +- drivers/thermal/mtk_thermal.c | 6 +- drivers/tty/serial/mxs-auart.c | 12 +- drivers/tty/serial/xilinx_uartps.c | 1 - drivers/uio/uio_pdrv_genirq.c | 4 +- drivers/usb/c67x00/c67x00-sched.c | 2 +- drivers/usb/chipidea/core.c | 24 ++ drivers/usb/dwc2/platform.c | 3 +- drivers/usb/gadget/function/f_uac1_legacy.c | 2 + drivers/usb/gadget/udc/atmel_usba_udc.c | 2 +- drivers/usb/host/ehci-platform.c | 4 - drivers/usb/host/ohci-platform.c | 5 - drivers/usb/host/xhci-plat.c | 10 +- drivers/usb/serial/ch341.c | 1 + drivers/usb/serial/cypress_m8.c | 2 + drivers/usb/serial/cypress_m8.h | 3 + drivers/usb/serial/iuu_phoenix.c | 8 +- drivers/usb/serial/option.c | 6 + drivers/virt/vboxguest/vboxguest_core.c | 6 +- drivers/virt/vboxguest/vboxguest_core.h | 15 + drivers/virt/vboxguest/vboxguest_linux.c | 3 +- drivers/virt/vboxguest/vmmdev.h | 2 + fs/cifs/transport.c | 2 +- fs/fuse/file.c | 14 +- fs/fuse/inode.c | 15 +- fs/gfs2/ops_fstype.c | 12 +- fs/nfs/nfs4proc.c | 20 +- fs/overlayfs/export.c | 2 +- fs/overlayfs/file.c | 10 +- fs/overlayfs/super.c | 23 +- include/linux/blkdev.h | 1 + include/linux/cgroup-defs.h | 8 +- include/linux/cgroup.h | 4 +- include/linux/if_vlan.h | 29 +- include/linux/input/elan-i2c-ids.h | 7 + include/linux/platform_data/ti-sysc.h | 1 + include/net/dst.h | 10 +- include/net/genetlink.h | 8 - include/net/inet_ecn.h | 25 +- include/net/pkt_sched.h | 11 - include/trace/events/rxrpc.h | 2 +- include/uapi/linux/vboxguest.h | 4 +- kernel/cgroup/cgroup.c | 31 +- kernel/irq/manage.c | 37 ++- kernel/sched/core.c | 2 + kernel/sched/fair.c | 16 +- kernel/time/timer.c | 21 +- net/bridge/br_multicast.c | 2 +- net/ceph/osd_client.c | 1 + net/core/filter.c | 10 +- net/core/sock.c | 2 +- net/ipv4/icmp.c | 4 +- net/ipv4/ip_output.c | 2 +- net/ipv4/ping.c | 3 + net/ipv4/tcp.c | 15 +- net/ipv4/tcp_cong.c | 2 +- net/ipv4/tcp_input.c | 2 + net/ipv4/tcp_ipv4.c | 15 +- net/ipv4/tcp_output.c | 8 +- net/ipv6/icmp.c | 4 +- net/ipv6/route.c | 7 +- net/l2tp/l2tp_core.c | 5 +- net/llc/af_llc.c | 10 +- net/netlink/genetlink.c | 49 --- net/sched/act_connmark.c | 9 +- net/sched/act_csum.c | 2 +- net/sched/act_ct.c | 9 +- net/sched/act_ctinfo.c | 9 +- net/sched/act_mpls.c | 2 +- net/sched/act_skbedit.c | 2 +- net/sched/cls_api.c | 2 +- net/sched/cls_flow.c | 8 +- net/sched/cls_flower.c | 2 +- net/sched/em_ipset.c | 2 +- net/sched/em_ipt.c | 2 +- net/sched/em_meta.c | 2 +- net/sched/sch_atm.c | 8 +- net/sched/sch_cake.c | 4 +- net/sched/sch_dsmark.c | 6 +- net/sched/sch_teql.c | 2 +- net/sunrpc/xprtrdma/rpc_rdma.c | 4 +- security/apparmor/match.c | 5 + sound/pci/hda/patch_realtek.c | 27 +- sound/usb/card.c | 12 +- sound/usb/clock.c | 59 +++- sound/usb/line6/capture.c | 2 + sound/usb/line6/driver.c | 2 +- sound/usb/line6/playback.c | 2 + sound/usb/midi.c | 17 +- sound/usb/pcm.c | 7 +- sound/usb/quirks-table.h | 86 +----- sound/usb/quirks.c | 67 ++++- sound/usb/quirks.h | 2 + tools/perf/util/stat.c | 6 +- tools/testing/selftests/net/fib_nexthops.sh | 13 + 273 files changed, 2041 insertions(+), 935 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 9/215 ipv6: Fix use of anycast address with loopback
From: David Ahern <[email protected]>
[ Upstream commit aea23c323d89836bcdcee67e49def997ffca043b ]
Thomas reported a regression with IPv6 and anycast using the following reproducer:
echo 1 > /proc/sys/net/ipv6/conf/all/forwarding ip -6 a add fc12::1/16 dev lo
sleep 2
echo "pinging lo"
ping6 -c 2 fc12::
The conversion of addrconf_f6i_alloc to use ip6_route_info_create missed the use of fib6_is_reject which checks addresses added to the loopback interface and sets the REJECT flag as needed. Update fib6_is_reject for loopback checks to handle RTF_ANYCAST addresses.
--- net/ipv6/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/route.c +1 -1
@@ -3409,7 +3409,7 @@ static bool fib6_is_reject(u32 flags, stif ((flags &RTF_REJECT ) || (dev && (dev->flags &IFF_LOOPBACK ) && !(addr_type &IPV6_ADDR_LOOPBACK ) && - !(flags &RTF_LOCAL ))) + !(flags & (RTF_ANYCAST |RTF_LOCAL ))))return true;return false;
Greg Kroah-Hartman
maintainerPATCH 29/215 arm64: arch_timer: Disable the compat vdso for cores affected by ARM64_WORKAROUND_1418040
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit 4b661d6133c5d3a7c9aca0b4ee5a78c7766eff3f upstream.
ARM64_WORKAROUND_1418040 requires that AArch32 EL0 accesses to the virtual counter register are trapped and emulated by the kernel. This makes the vdso pretty pointless, and in some cases livelock prone.
Provide a workaround entry that limits the vdso to 64bit tasks.
--- drivers/clocksource/arm_arch_timer.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/clocksource/arm_arch_timer.c +8 -0
@@ -476,6 +476,14 @@ static const struct arch_timer_erratum_w .set_next_event_virt = erratum_set_next_event_tval_virt, },#endif +#ifdef CONFIG_ARM64_ERRATUM_1418040 + { + .match_type = ate_match_local_cap_id, + .id = (void *)ARM64_WORKAROUND_1418040, + .desc = "ARM erratum 1418040", + .disable_compat_vdso = true, + }, +#endif }; typedef bool (*ate_match_fn_t)(const struct arch_timer_erratum_workaround *,
Greg Kroah-Hartman
maintainerPATCH 6/215 genetlink: remove genl_bind
In reply to Greg Kroah-HartmanFrom: Sean Tranchetti <[email protected]>
[ Upstream commit 1e82a62fec613844da9e558f3493540a5b7a7b67 ]
A potential deadlock can occur during registering or unregistering a new generic netlink family between the main nl_table_lock and the cb_lock where each thread wants the lock held by the other, as demonstrated below.
1) Thread 1 is performing a netlink_bind() operation on a socket. As part of this call, it will call netlink_lock_table(), incrementing the nl_table_users count to 1.
2) Thread 2 is registering (or unregistering) a genl_family via the genl_(un)register_family() API. The cb_lock semaphore will be taken for writing.
3) Thread 1 will call genl_bind() as part of the bind operation to handle subscribing to GENL multicast groups at the request of the user. It will attempt to take the cb_lock semaphore for reading, but it will fail and be scheduled away, waiting for Thread 2 to finish the write.
4) Thread 2 will call netlink_table_grab() during the (un)registration call. However, as Thread 1 has incremented nl_table_users, it will not be able to proceed, and both threads will be stuck waiting for the other.
genl_bind() is a noop, unless a genl_family implements the mcast_bind() function to handle setting up family-specific multicast operations. Since no one in-tree uses this functionality as Cong pointed out, simply removing the genl_bind() function will remove the possibility for deadlock, as there is no attempt by Thread 1 above to take the cb_lock semaphore.
--- include/net/genetlink.h | 8 ------- net/netlink/genetlink.c | 49 ------------------------------------------------ 2 files changed, 57 deletions(-)
include/net/genetlink.h +0 -8
@@ -35,12 +35,6 @@ struct genl_info;* do additional, common, filtering and return an error * @post_doit: called after an operation's doit callback, it may * undo operations done by pre_doit, for example release locks -* @mcast_bind: a socket bound to the given multicast group (which -* is given as the offset into the groups array) -* @mcast_unbind: a socket was unbound from the given multicast group. -* Note that unbind() will not be called symmetrically if the -* generic netlink family is removed while there are still open -* sockets. * @attrbuf: buffer to store parsed attributes (private) * @mcgrps: multicast groups used by this family * @n_mcgrps: number of multicast groups
@@ -64,8 +58,6 @@ struct genl_family {void (*post_doit)(const struct genl_ops *ops,struct sk_buff *skb,struct genl_info *info); -int (*mcast_bind)(struct net *net,int group); -void (*mcast_unbind)(struct net *net,int group);struct nlattr ** attrbuf;/* private */ const struct genl_ops * ops;const struct genl_multicast_group *mcgrps;
net/netlink/genetlink.c +0 -49
60 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 27/215 arm64: Introduce a way to disable the 32bit vdso
In reply to Greg Kroah-HartmanFrom: Marc Zyngier <[email protected]>
commit 97884ca8c2925d14c32188e865069f21378b4b4f upstream.
[this is a redesign rather than a backport]
We have a class of errata (grouped under the ARM64_WORKAROUND_1418040 banner) that force the trapping of counter access from 32bit EL0.
We would normally disable the whole vdso for such defect, except that it would disable it for 64bit userspace as well, which is a shame.
Instead, add a new vdso_clock_mode, which signals that the vdso isn't usable for compat tasks. This gets checked in the new vdso_clocksource_ok() helper, now provided for the 32bit vdso.
--- arch/arm/include/asm/clocksource.h | 11 ++++++++++- arch/arm/kernel/vdso.c | 2 +- arch/arm64/include/asm/clocksource.h | 5 ++++- arch/arm64/include/asm/vdso/clocksource.h | 14 ++++++++++++++ arch/arm64/include/asm/vdso/compat_gettimeofday.h | 5 +++-- arch/arm64/include/asm/vdso/gettimeofday.h | 6 ++++-- arch/arm64/include/asm/vdso/vsyscall.h | 4 +--- drivers/clocksource/arm_arch_timer.c | 8 ++++---- 8 files changed, 41 insertions(+), 14 deletions(-)
arch/arm/include/asm/clocksource.h +10 -1
@@ -1,8 +1,17 @@#ifndef _ASM_CLOCKSOURCE_H#define _ASM_CLOCKSOURCE_H +enum vdso_arch_clockmode { +/* vdso clocksource not usable */ +VDSO_CLOCKMODE_NONE , +/* vdso clocksource usable */ +VDSO_CLOCKMODE_ARCHTIMER , +VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT =VDSO_CLOCKMODE_ARCHTIMER , +}; +struct arch_clocksource_data { -bool vdso_direct;/* Usable for direct VDSO access? */ +/* Usable for direct VDSO access? */ +enum vdso_arch_clockmode clock_mode; };#endif
arch/arm/kernel/vdso.c +1 -1
@@ -281,7 +281,7 @@ static bool tk_is_cntvct(const struct tiif (!IS_ENABLED (CONFIG_ARM_ARCH_TIMER ))return false; -if (!tk->tkr_mono.clock->archdata.vdso_direct) +if (tk->tkr_mono.clock->archdata.clock_mode !=VDSO_CLOCKMODE_ARCHTIMER )return false;return true;
arch/arm64/include/asm/clocksource.h +4 -1
@@ -2,8 +2,11 @@#ifndef _ASM_CLOCKSOURCE_H#define _ASM_CLOCKSOURCE_H +#include <asm/vdso/clocksource.h> +struct arch_clocksource_data { -bool vdso_direct;/* Usable for direct VDSO access? */ +/* Usable for direct VDSO access? */ +enum vdso_arch_clockmode clock_mode; };#endif
arch/arm64/include/asm/vdso/clocksource.h new file +14 -0
@@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_VDSOCLOCKSOURCE_H +#define __ASM_VDSOCLOCKSOURCE_H + +enum vdso_arch_clockmode { +/* vdso clocksource not usable */ +VDSO_CLOCKMODE_NONE , +/* vdso clocksource for both 32 and 64bit tasks */ +VDSO_CLOCKMODE_ARCHTIMER , +/* vdso clocksource for 64bit tasks only */ +VDSO_CLOCKMODE_ARCHTIMER_NOCOMPAT , +}; + +#endif
arch/arm64/include/asm/vdso/compat_gettimeofday.h +3 -2
@@ -10,6 +10,7 @@#include <asm/unistd.h> #include <uapi/linux/time.h> +#include <asm/vdso/clocksource.h> #include <asm/vdso/compat_barrier.h> #define __VDSO_USE_SYSCALL ULLONG_MAX
@@ -117,10 +118,10 @@ static __always_inline u64 __arch_get_hwu64 res;/* -* clock_mode == 0 implies that vDSO are enabled otherwise +* clock_mode == ARCHTIMER implies that vDSO are enabled otherwise * fallback on syscall. */ -if (clock_mode) +if (clock_mode !=VDSO_CLOCKMODE_ARCHTIMER )return __VDSO_USE_SYSCALL;/*
arch/arm64/include/asm/vdso/gettimeofday.h +4 -2
@@ -10,6 +10,8 @@#include <asm/unistd.h> #include <uapi/linux/time.h> +#include <asm/vdso/clocksource.h> +#define __VDSO_USE_SYSCALL ULLONG_MAX#define VDSO_HAS_CLOCK_GETRES 1
@@ -71,10 +73,10 @@ static __always_inline u64 __arch_get_hwu64 res;/* -* clock_mode == 0 implies that vDSO are enabled otherwise +* clock_mode != NONE implies that vDSO are enabled otherwise * fallback on syscall. */ -if (clock_mode) +if (clock_mode ==VDSO_CLOCKMODE_NONE )return __VDSO_USE_SYSCALL;/*
arch/arm64/include/asm/vdso/vsyscall.h +1 -3
@@ -24,9 +24,7 @@ struct vdso_data *__arm64_get_k_vdso_datstatic __always_inline int __arm64_get_clock_mode(struct timekeeper *tk) { -u32 use_syscall = !tk->tkr_mono.clock->archdata.vdso_direct; - -return use_syscall; +return tk->tkr_mono.clock->archdata.clock_mode; }#define __arch_get_clock_mode __arm64_get_clock_mode
drivers/clocksource/arm_arch_timer.c +4 -4
@@ -69,7 +69,7 @@ static enum arch_timer_ppi_nr arch_timerstatic bool arch_timer_c3stop;static bool arch_timer_mem_use_virtual;static bool arch_counter_suspend_stop; -static bool vdso_default = true; +static enum vdso_arch_clockmode vdso_default =VDSO_CLOCKMODE_ARCHTIMER ;static cpumask_t evtstrm_available =CPU_MASK_NONE ;static bool evtstrm_enable =IS_ENABLED (CONFIG_ARM_ARCH_TIMER_EVTSTREAM );
@@ -560,8 +560,8 @@ void arch_timer_enable_workaround(const* change both the default value and the vdso itself. */ if (wa->read_cntvct_el0) { - clocksource_counter.archdata.vdso_direct = false; - vdso_default = false; + clocksource_counter.archdata.clock_mode =VDSO_CLOCKMODE_NONE ; + vdso_default =VDSO_CLOCKMODE_NONE ; } }
@@ -979,7 +979,7 @@ static void __init arch_counter_register } arch_timer_read_counter = rd; - clocksource_counter.archdata.vdso_direct = vdso_default; + clocksource_counter.archdata.clock_mode = vdso_default; }else { arch_timer_read_counter = arch_counter_get_cntvct_mem; }
Greg Kroah-Hartman
maintainerPATCH 26/215 ip: Fix SO_MARK in RST, ACK and ICMP packets
In reply to Greg Kroah-HartmanFrom: Willem de Bruijn <[email protected]>
[ Upstream commit 0da7536fb47f51df89ccfcb1fa09f249d9accec5 ]
When no full socket is available, skbs are sent over a per-netns control socket. Its sk_mark is temporarily adjusted to match that of the real (request or timewait) socket or to reflect an incoming skb, so that the outgoing skb inherits this in __ip_make_skb.
Introduction of the socket cookie mark field broke this. Now the skb is set through the cookie and cork:
<caller> # init sockc.mark from sk_mark or cmsgip_append_data
ip_setup_cork # convert sockc.mark to cork markip_push_pending_frames
ip_finish_skb
__ip_make_skb # set skb->mark to cork mark
But I missed these special control sockets. Update all callers of __ip(6)_make_skb that were originally missed.
For IPv6, the same two icmp(v6) paths are affected. The third case is not, as commit 92e55f412cff ("tcp: don't annotate mark on control socket from tcp_v6_send_response()") replaced the ctl_sk->sk_mark with passing the mark field directly as a function argument. That commit predates the commit that introduced the bug.
--- net/ipv4/icmp.c | 4 ++-- net/ipv4/ip_output.c | 2 +- net/ipv6/icmp.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
net/ipv4/icmp.c +2 -2
@@ -427,7 +427,7 @@ static void icmp_reply(struct icmp_bxm *ipcm_init (&ipc); inet->tos =ip_hdr (skb)->tos; - sk->sk_mark = mark; + ipc.sockc.mark = mark; daddr = ipc.addr =ip_hdr (skb)->saddr; saddr =fib_compute_spec_dst (skb);
@@ -709,10 +709,10 @@ void __icmp_send(struct sk_buff *skb_in, icmp_param.skb = skb_in; icmp_param.offset =skb_network_offset (skb_in);inet_sk (sk)->tos = tos; - sk->sk_mark = mark;ipcm_init (&ipc); ipc.addr = iph->saddr; ipc.opt = &icmp_param.replyopts.opt; + ipc.sockc.mark = mark; rt =icmp_route_lookup (net, &fl4, skb_in, iph, saddr, tos, mark, type, code, &icmp_param);
net/ipv4/ip_output.c +1 -1
@@ -1704,7 +1704,7 @@ void ip_send_unicast_reply(struct sock * sk->sk_protocol =ip_hdr (skb)->protocol; sk->sk_bound_dev_if = arg->bound_dev_if; sk->sk_sndbuf = sysctl_wmem_default; - sk->sk_mark = fl4.flowi4_mark; + ipc.sockc.mark = fl4.flowi4_mark; err =ip_append_data (sk, &fl4, ip_reply_glue_bits, arg->iov->iov_base, len,0 , &ipc, &rt,MSG_DONTWAIT );if (unlikely (err)) {
net/ipv6/icmp.c +2 -2
@@ -535,7 +535,6 @@ static void icmp6_send(struct sk_buff *sif (!sk) goto out_bh_enable; - sk->sk_mark = mark; np =inet6_sk (sk);if (!icmpv6_xrlim_allow (sk, type, &fl6))
@@ -552,6 +551,7 @@ static void icmp6_send(struct sk_buff *s fl6.flowi6_oif = np->ucast_oif;ipcm6_init_sk (&ipc6, np); + ipc6.sockc.mark = mark; fl6.flowlabel =ip6_make_flowinfo (ipc6.tclass, fl6.flowlabel); dst =icmpv6_route_lookup (net, skb, sk, &fl6);
@@ -720,7 +720,6 @@ static void icmpv6_echo_reply(struct sk_ sk =icmpv6_xmit_lock (net);if (!sk) goto out_bh_enable; - sk->sk_mark = mark; np =inet6_sk (sk);if (!fl6.flowi6_oif &&ipv6_addr_is_multicast (&fl6.daddr))
@@ -748,6 +747,7 @@ static void icmpv6_echo_reply(struct sk_ipcm6_init_sk (&ipc6, np); ipc6.hlimit =ip6_sk_dst_hoplimit (np, &fl6, dst); ipc6.tclass =ipv6_get_dsfield (ipv6_hdr (skb)); + ipc6.sockc.mark = mark; if (ip6_append_data(sk, icmpv6_getfrag, &msg, skb->len + sizeof(struct icmp6hdr),
Greg Kroah-Hartman
maintainerPATCH 23/215 tcp: md5: allow changing MD5 keys in all socket states
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 1ca0fafd73c5268e8fc4b997094b8bb2bfe8deea ]
This essentially reverts commit 721230326891 ("tcp: md5: reject TCP_MD5SIG or TCP_MD5SIG_EXT on established sockets")
Mathieu reported that many vendors BGP implementations can actually switch TCP MD5 on established flows.
Quoting Mathieu :
Here is a list of a few network vendors along with their behavior with respect to TCP MD5:
- Cisco: Allows for password to be changed, but within the hold-down
timer (~180 seconds).
- Juniper: When password is initially set on active connection it will reset, but after that any subsequent password changes no network resets.
- Nokia: No notes on if they flap the tcp connection or not.
- Ericsson/RedBack: Allows for 2 password (old/new) to co-exist until both sides are ok with new passwords.
- Meta-Switch: Expects the password to be set before a connection is attempted, but no further info on whether they reset the TCP connection on a change.
- Avaya: Disable the neighbor, then set password, then re-enable.
- Zebos: Would normally allow the change when socket connected.
We can revert my prior change because commit 9424e2e7ad93 ("tcp: md5: fix potential overestimation of TCP option space") removed the leak of 4 kernel bytes to the wire that was the main reason for my patch.
While doing my investigations, I found a bug when a MD5 key is changed, leading to these commits that stable teams want to consider before backporting this revert :
Commit 6a2febec338d ("tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()") Commit e6ced831ef11 ("tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers")
--- net/ipv4/tcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
net/ipv4/tcp.c +1 -4
@@ -3088,10 +3088,7 @@ static int do_tcp_setsockopt(struct sock#ifdef CONFIG_TCP_MD5SIG case TCP_MD5SIG :case TCP_MD5SIG_EXT : -if ((1 << sk->sk_state) & (TCPF_CLOSE |TCPF_LISTEN )) - err = tp->af_specific->md5_parse (sk, optname, optval, optlen); -else - err = -EINVAL ; + err = tp->af_specific->md5_parse (sk, optname, optval, optlen);break ;#endif case TCP_USER_TIMEOUT :
Greg Kroah-Hartman
maintainerPATCH 22/215 tcp: md5: refine tcp_md5_do_add()/tcp_md5_hash_key() barriers
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit e6ced831ef11a2a06e8d00aad9d4fc05b610bf38 ]
My prior fix went a bit too far, according to Herbert and Mathieu.
Since we accept that concurrent TCP MD5 lookups might see inconsistent keys, we can use READ_ONCE()/WRITE_ONCE() instead of smp_rmb()/smp_wmb()
Clearing all key->key[] is needed to avoid possible KMSAN reports, if key->keylen is increased. Since tcp_md5_do_add() is not fast path, using __GFP_ZERO to clear all struct tcp_md5sig_key is simpler.
data_race() was added in linux-5.8 and will prevent KCSAN reports, this can safely be removed in stable backports, if data_race() is not yet backported.
v2: use data_race() both in tcp_md5_hash_key() and tcp_md5_do_add()
--- net/ipv4/tcp.c | 6 +++--- net/ipv4/tcp_ipv4.c | 14 ++++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-)
net/ipv4/tcp.c +3 -3
@@ -3847,13 +3847,13 @@ EXPORT_SYMBOL(tcp_md5_hash_skb_data);int tcp_md5_hash_key (struct tcp_md5sig_pool *hp,const struct tcp_md5sig_key *key) { -u8 keylen = key->keylen; +u8 keylen =READ_ONCE (key->keylen);/* paired with WRITE_ONCE() in tcp_md5_do_add */ struct scatterlist sg; -smp_rmb ();/* paired with smp_wmb() in tcp_md5_do_add() */ -sg_init_one (&sg, key->key, keylen);ahash_request_set_crypt (hp->md5_req, &sg,NULL , keylen); + +/* tcp_md5_do_add() might change key->key under us */ return crypto_ahash_update (hp->md5_req); }EXPORT_SYMBOL (tcp_md5_hash_key);
net/ipv4/tcp_ipv4.c +10 -4
@@ -1077,12 +1077,18 @@ int tcp_md5_do_add(struct sock *sk, cons key =tcp_md5_do_lookup_exact (sk, addr, family, prefixlen);if (key) { -/* Pre-existing entry - just update that one. */ +/* Pre-existing entry - just update that one. +* Note that the key might be used concurrently. +*/ memcpy (key->key, newkey, newkeylen); -smp_wmb ();/* pairs with smp_rmb() in tcp_md5_hash_key() */ +/* Pairs with READ_ONCE() in tcp_md5_hash_key(). +* Also note that a reader could catch new key->keylen value +* but old key->key[], this is the reason we use __GFP_ZERO +* at sock_kmalloc() time below these lines. +*/ +WRITE_ONCE (key->keylen, newkeylen); - key->keylen = newkeylen;return 0 ; }
@@ -1098,7 +1104,7 @@ int tcp_md5_do_add(struct sock *sk, consrcu_assign_pointer (tp->md5sig_info, md5sig); } - key =sock_kmalloc (sk,sizeof (*key), gfp); + key =sock_kmalloc (sk,sizeof (*key), gfp | __GFP_ZERO);if (!key)return -ENOMEM ;if (!tcp_alloc_md5sig_pool ()) {
Greg Kroah-Hartman
maintainerPATCH 21/215 vlan: consolidate VLAN parsing code and limit max parsing depth
In reply to Greg Kroah-HartmanFrom: "Toke H�iland-J�rgensen" <[email protected]>
[ Upstream commit 469aceddfa3ed16e17ee30533fae45e90f62efd8 ]
Toshiaki pointed out that we now have two very similar functions to extract the L3 protocol number in the presence of VLAN tags. And Daniel pointed out that the unbounded parsing loop makes it possible for maliciously crafted packets to loop through potentially hundreds of tags.
Fix both of these issues by consolidating the two parsing functions and limiting the VLAN tag parsing to a max depth of 8 tags. As part of this, switch over __vlan_get_protocol() to use skb_header_pointer() instead of pskb_may_pull(), to avoid the possible side effects of the latter and keep the skb pointer 'const' through all the parsing functions.
v2:
- Use limit of 8 tags instead of 32 (matching XMIT_RECURSION_LIMIT)
--- include/linux/if_vlan.h | 57 ++++++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 35 deletions(-)
include/linux/if_vlan.h +22 -35
@@ -25,6 +25,8 @@#define VLAN_ETH_DATA_LEN 1500/* Max. octets in payload */ #define VLAN_ETH_FRAME_LEN 1518/* Max. octets in frame sans FCS */ +#define VLAN_MAX_DEPTH 8/* Max. number of nested VLAN tags parsed */ +/* * struct vlan_hdr - vlan header * @h_vlan_TCI: priority and VLAN ID
@@ -308,34 +310,6 @@ static inline bool eth_type_vlan(__be16 } } -/* A getter for the SKB protocol field which will handle VLAN tags consistently -* whether VLAN acceleration is enabled or not. -*/ -static inline __be16 skb_protocol (const struct sk_buff *skb,bool skip_vlan) -{ -unsigned int offset =skb_mac_offset (skb) +sizeof (struct ethhdr ); -__be16 proto = skb->protocol; - -if (!skip_vlan) -/* VLAN acceleration strips the VLAN header from the skb and -* moves it to skb->vlan_proto -*/ -return skb_vlan_tag_present (skb) ? skb->vlan_proto : proto; - -while (eth_type_vlan (proto)) { -struct vlan_hdr vhdr, *vh; - - vh =skb_header_pointer (skb, offset,sizeof (vhdr), &vhdr); -if (!vh) -break ; - - proto = vh->h_vlan_encapsulated_proto; - offset +=sizeof (vhdr); - } - -return proto; -} -static inline bool vlan_hw_offload_capable (netdev_features_t features,__be16 proto) {
@@ -605,10 +579,10 @@ static inline int vlan_get_tag(const str* Returns the EtherType of the packet, regardless of whether it is * vlan encapsulated (normal or hardware accelerated) or not. */ -static inline __be16 __vlan_get_protocol (struct sk_buff *skb,__be16 type, +static inline __be16 __vlan_get_protocol (const struct sk_buff *skb,__be16 type,int *depth) { -unsigned int vlan_depth = skb->mac_len; +unsigned int vlan_depth = skb->mac_len, parse_depth =VLAN_MAX_DEPTH ;/* if type is 802.1Q/AD then the header should already be * present at mac_len - VLAN_HLEN (if mac_len > 0), or at
@@ -623,13 +597,12 @@ static inline __be16 __vlan_get_protocol vlan_depth =ETH_HLEN ; }do { -struct vlan_hdr *vh; +struct vlan_hdr vhdr, *vh; -if (unlikely (!pskb_may_pull (skb, - vlan_depth +VLAN_HLEN ))) + vh =skb_header_pointer (skb, vlan_depth,sizeof (vhdr), &vhdr); +if (unlikely (!vh || !--parse_depth))return 0 ; - vh = (struct vlan_hdr *)(skb->data + vlan_depth); type = vh->h_vlan_encapsulated_proto; vlan_depth +=VLAN_HLEN ; }while (eth_type_vlan (type));
@@ -648,11 +621,25 @@ static inline __be16 __vlan_get_protocol* Returns the EtherType of the packet, regardless of whether it is * vlan encapsulated (normal or hardware accelerated) or not. */ -static inline __be16 vlan_get_protocol (struct sk_buff *skb) +static inline __be16 vlan_get_protocol (const struct sk_buff *skb) {return __vlan_get_protocol (skb, skb->protocol,NULL ); } +/* A getter for the SKB protocol field which will handle VLAN tags consistently +* whether VLAN acceleration is enabled or not. +*/ +static inline __be16 skb_protocol (const struct sk_buff *skb,bool skip_vlan) +{ +if (!skip_vlan) +/* VLAN acceleration strips the VLAN header from the skb and +* moves it to skb->vlan_proto +*/ +return skb_vlan_tag_present (skb) ? skb->vlan_proto : skb->protocol; + +return vlan_get_protocol (skb); +} +static inline void vlan_set_encap_proto (struct sk_buff *skb,struct vlan_hdr *vhdr) {
Greg Kroah-Hartman
maintainerPATCH 2/215 crypto: atmel - Fix build error of CRYPTO_AUTHENC
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
commit aee1f9f3c30e1e20e7f74729ced61eac7d74ca68 upstream.
If CRYPTO_DEV_ATMEL_AUTHENC is m, CRYPTO_DEV_ATMEL_SHA is m, but CRYPTO_DEV_ATMEL_AES is y, building will fail:
drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_init_tfm':
atmel-aes.c:(.text+0x670): undefined reference to atmel_sha_authenc_get_reqsize' atmel-aes.c:(.text+0x67a): undefined reference to atmel_sha_authenc_spawn' drivers/crypto/atmel-aes.o: In function `atmel_aes_authenc_setkey':
atmel-aes.c:(.text+0x7e5): undefined reference to `atmel_sha_authenc_setkey'
Make CRYPTO_DEV_ATMEL_AUTHENC depend on CRYPTO_DEV_ATMEL_AES, and select CRYPTO_DEV_ATMEL_SHA and CRYPTO_AUTHENC for it under there.
--- drivers/crypto/Kconfig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/crypto/Kconfig +4 -4
@@ -491,10 +491,9 @@ if CRYPTO_DEV_UX500 endif # if CRYPTO_DEV_UX500 config CRYPTO_DEV_ATMEL_AUTHENC - tristate "Support for Atmel IPSEC/SSL hw accelerator" + bool "Support for Atmel IPSEC/SSL hw accelerator" depends on ARCH_AT91 || COMPILE_TEST - select CRYPTO_DEV_ATMEL_AES - select CRYPTO_DEV_ATMEL_SHA + depends on CRYPTO_DEV_ATMEL_AES help Some Atmel processors can combine the AES and SHA hw accelerators to enhance support of IPSEC/SSL.
@@ -507,7 +506,8 @@ config CRYPTO_DEV_ATMEL_AES select CRYPTO_AES select CRYPTO_AEAD select CRYPTO_BLKCIPHER - select CRYPTO_AUTHENC + select CRYPTO_AUTHENC if CRYPTO_DEV_ATMEL_AUTHENC + select CRYPTO_DEV_ATMEL_SHA if CRYPTO_DEV_ATMEL_AUTHENC help Some Atmel processors have AES hw accelerator. Select this if you want to use the Atmel module for
Greg Kroah-Hartman
maintainerPATCH 19/215 tcp: md5: add missing memory barriers in tcp_md5_do_add()/tcp_md5_hash_key()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 6a2febec338df7e7699a52d00b2e1207dcf65b28 ]
MD5 keys are read with RCU protection, and tcp_md5_do_add() might update in-place a prior key.
Normally, typical RCU updates would allocate a new piece of memory. In this case only key->key and key->keylen might be updated, and we do not care if an incoming packet could see the old key, the new one, or some intermediate value, since changing the key on a live flow is known to be problematic anyway.
We only want to make sure that in the case key->keylen is changed, cpus in tcp_md5_hash_key() wont try to use uninitialized data, or crash because key->keylen was read twice to feed sg_init_one() and ahash_request_set_crypt()
--- net/ipv4/tcp.c | 7 +++++-- net/ipv4/tcp_ipv4.c | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-)
net/ipv4/tcp.c +5 -2
@@ -3847,10 +3847,13 @@ EXPORT_SYMBOL(tcp_md5_hash_skb_data);int tcp_md5_hash_key (struct tcp_md5sig_pool *hp,const struct tcp_md5sig_key *key) { +u8 keylen = key->keylen;struct scatterlist sg; -sg_init_one (&sg, key->key, key->keylen); -ahash_request_set_crypt (hp->md5_req, &sg,NULL , key->keylen); +smp_rmb ();/* paired with smp_wmb() in tcp_md5_do_add() */ + +sg_init_one (&sg, key->key, keylen); +ahash_request_set_crypt (hp->md5_req, &sg,NULL , keylen);return crypto_ahash_update (hp->md5_req); }EXPORT_SYMBOL (tcp_md5_hash_key);
net/ipv4/tcp_ipv4.c +3 -0
@@ -1079,6 +1079,9 @@ int tcp_md5_do_add(struct sock *sk, consif (key) {/* Pre-existing entry - just update that one. */ memcpy (key->key, newkey, newkeylen); + +smp_wmb ();/* pairs with smp_rmb() in tcp_md5_hash_key() */ + key->keylen = newkeylen;return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 15/215 net: usb: qmi_wwan: add support for Quectel EG95 LTE modem
In reply to Greg Kroah-HartmanFrom: AceLan Kao <[email protected]>
[ Upstream commit f815dd5cf48b905eeecf0a2b990e9b7ab048b4f1 ]
Add support for Quectel Wireless Solutions Co., Ltd. EG95 LTE modem
T: Bus=01 Lev=01 Prnt=01 Port=02 Cnt=02 Dev#= 5 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=ef(misc ) Sub=02 Prot=01 MxPS=64 #Cfgs= 1 P: Vendor=2c7c ProdID=0195 Rev=03.18 S: Manufacturer=Android S: Product=Android C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=500mA I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none) I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=(none) I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
--- drivers/net/usb/qmi_wwan.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/usb/qmi_wwan.c +1 -0
@@ -1370,6 +1370,7 @@ static const struct usb_device_id produc {QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */ {QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */ + {QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */ {QMI_FIXED_INTF(0x2c7c, 0x0296, 4)}, /* Quectel BG96 */ {QMI_QUIRK_SET_DTR(0x2cb7, 0x0104, 4)}, /* Fibocom NL678 series */ {QMI_FIXED_INTF(0x0489, 0xe0b4, 0)}, /* Foxconn T77W968 LTE */
Greg Kroah-Hartman
maintainerPATCH 13/215 net: dsa: microchip: set the correct number of ports
In reply to Greg Kroah-HartmanFrom: Codrin Ciubotariu <[email protected]>
[ Upstream commit af199a1a9cb02ec0194804bd46c174b6db262075 ]
The number of ports is incorrectly set to the maximum available for a DSA switch. Even if the extra ports are not used, this causes some functions to be called later, like port_disable() and port_stp_state_set(). If the driver doesn't check the port index, it will end up modifying unknown registers.
--- drivers/net/dsa/microchip/ksz8795.c | 3 +++ drivers/net/dsa/microchip/ksz9477.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/net/dsa/microchip/ksz8795.c +3 -0
@@ -1270,6 +1270,9 @@ static int ksz8795_switch_init(struct ks/* set the real number of ports */ dev->ds->num_ports = dev->port_cnt; +/* set the real number of ports */ + dev->ds->num_ports = dev->port_cnt; +return 0 ; }
drivers/net/dsa/microchip/ksz9477.c +3 -0
@@ -515,6 +515,9 @@ static int ksz9477_port_vlan_filtering(s PORT_VLAN_LOOKUP_VID_0, false); } +/* set the real number of ports */ + dev->ds->num_ports = dev->port_cnt; +return 0 ; }
Re: [PATCH 5.4 047/215] iio:humidity:hdc100x Fix alignment and data leak issues
In reply to Greg Kroah-HartmanQuoted 4 lines · Greg Kroah-Hartman
From: Jonathan Cameron <[email protected]>
commit
ea5e7a7bb6205d24371373cd80325db1bc15ededupstream.
Quoted 9 lines
One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestampassumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in theiio_priv()data. This data is allocated with kzalloc so no data can leak apart from previous readings.
[]
drivers/iio/humidity/hdc100x.c struct hdc100x_data { · line 44
Quoted 9 lines
+++
b/drivers/iio/humidity/hdc100x.cdrivers/iio/humidity/hdc100x.c +4
-0@@ -38,6 +38,11 @@ struct hdc100x_data {/* integration time of the sensor */ int adc_int_us[2 ]; +/* Ensure natural alignment of timestamp */ +struct { +__be16 channels[2 ]; +s64 ts__aligned(8) ;
Why does an s64 need __aligned(8) ?
This seems needlessly redundant.
Isn't this naturally aligned by the compiler?
The struct isn't packed.
Re: [PATCH 5.4 047/215] iio:humidity:hdc100x Fix alignment and data leak issues
Quoted 19 lines · Joe Perches
Quoted 4 lines · Greg Kroah-Hartman
From: Jonathan Cameron <[email protected]>
commit
ea5e7a7bb6205d24371373cd80325db1bc15ededupstream.Quoted 9 lines
One of a class of bugs pointed out by Lars in a recent review.
iio_push_to_buffers_with_timestampassumes the buffer used is aligned to the size of the timestamp (8 bytes). This is not guaranteed in this driver which uses an array of smaller elements on the stack. As Lars also noted this anti pattern can involve a leak of data to userspace and that indeed can happen here. We close both issues by moving to a suitable structure in theiio_priv()data. This data is allocated with kzalloc so no data can leak apart from previous readings.[]
Quoted 3 lines
+++
b/drivers/iio/humidity/hdc100x.c(quoted diff) +0
-0@@ -38,6 +38,11 @@ struct hdc100x_data {
Quoted 8 lines
drivers/iio/humidity/hdc100x.c struct hdc100x_data { · line 44
Quoted 6 lines
drivers/iio/humidity/hdc100x.c +4
-0/* integration time of the sensor */ int adc_int_us[2 ]; +/* Ensure natural alignment of timestamp */ +struct { +__be16 channels[2 ]; +s64 ts__aligned(8) ;Why does an s64 need
__aligned(8)?
This is due to on 32-bit x86 it is aligned to 4 bytes by default.
- Matt
Quoted 6 lines
This seems needlessly redundant.
Isn't this naturally aligned by the compiler?
The struct isn't packed.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.53 release. There are 215 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 Wed, 22 Jul 2020 15:27:31 +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.53-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. No dmesg regressions.
thanks,
-- Shuah
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.53 release. There are 215 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 Wed, 22 Jul 2020 15:27:31 +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.53-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
Results from Linaro’s test farm. Regressions detected on arm and arm64 (Juno-r2)
perf test cases failed
perf:
* perf_record_test
* perf_report_test
* Track-with-sched_switch (ignore intermittent failure)
Bad case:
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.002 MB perf-lava-test.data ]
when it was pass it prints number of samples like below,
Good case:
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.004 MB perf-lava-test.data (46 samples) ]
steps to reproduce:
# perf record -e cycles -o perf-lava-test.data ls -a 2>&1 | tee perf-record.log
Link to full test:
https://qa-reports.linaro.org/lkft/linux-stable-rc-5.4-oe/build/v5.4.52-216-g95f1079149bd/testrun/2969631/suite/perf/test/perf_record_test/log
test case:
https://github.com/Linaro/test-definitions/blob/master/automated/linux/perf/perf.sh
Summary
------------------------------------------------------------------------
kernel: 5.4.53-rc1
git repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git branch: linux-5.4.y
git commit: 95f1079149bd5596df492ff3dd12dacdd264e0ea
git describe: v5.4.52-216-g95f1079149bd
Test details: https://qa-reports.linaro.org/lkft/linux-stable-rc-5.4-oe/build/v5.4.52-216-g95f1079149bd
Regressions (compared to build v5.4.52)
------------------------------------------------------------------------
perf:
* perf_record_test
* perf_report_test
* Track-with-sched_switch (ignore intermittent failure)
No fixes (compared to build v5.4.52)
Ran 36089 total tests in the following environments and test suites.
Environments
--------------
- dragonboard-410c
- hi6220-hikey
- i386
- juno-r2
- juno-r2-compat
- juno-r2-kasan
- nxp-ls2088
- qemu_arm
- qemu_arm64
- qemu_i386
- qemu_x86_64
- x15
- x86
- x86-kasan
Test Suites
-----------
* build
* install-android-platform-tools-r2600
* install-android-platform-tools-r2800
* kselftest
* kselftest/drivers
* kselftest/filesystems
* kselftest/net
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* perf
* v4l2-compliance
* kvm-unit-tests
* ltp-commands-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fs-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* network-basic-tests
* ltp-open-posix-tests
* kselftest-vsyscall-mode-native
* kselftest-vsyscall-mode-native/drivers
* kselftest-vsyscall-mode-native/filesystems
* kselftest-vsyscall-mode-native/net
* kselftest-vsyscall-mode-none
* kselftest-vsyscall-mode-none/drivers
* kselftest-vsyscall-mode-none/filesystems
* kselftest-vsyscall-mode-none/net
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.53 release. There are 215 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 Wed, 22 Jul 2020 15:27:31 +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.53-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
All tests passing for Tegra ...
Test results for stable-v5.4:
11 builds: 11 pass, 0 fail
26 boots: 26 pass, 0 fail
56 tests: 56 pass, 0 failLinux version: 5.4.53-rc1-g95f1079149bd
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Cheers,
Thierry
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.53 release. There are 215 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 Wed, 22 Jul 2020 15:27:31 +0000. Anything received after that time might be too late.
Build results:
total: 157 pass: 157 fail: 0 Qemu test results: total: 430 pass: 430 fail: 0
Guenter