4.19.89-stable review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 10/243 serial: ifx6x60: add missed pm_runtime_disable
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
commit 50b2b571c5f3df721fc81bf9a12c521dfbe019ba upstream.
The driver forgets to call pm_runtime_disable in remove. Add the missed calls to fix it.
--- drivers/tty/serial/ifx6x60.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/tty/serial/ifx6x60.c +3 -0
@@ -1230,6 +1230,9 @@ static int ifx_spi_spi_remove(struct spistruct ifx_spi_device *ifx_dev =spi_get_drvdata (spi);/* stop activity */ tasklet_kill (&ifx_dev->io_work_tasklet); + +pm_runtime_disable (&spi->dev); +/* free irq */ free_irq (gpio_to_irq (ifx_dev->gpio.reset_out), ifx_dev);free_irq (gpio_to_irq (ifx_dev->gpio.srdy), ifx_dev);
Greg Kroah-Hartman
maintainerPATCH 11/243 autofs: fix a leak in autofs_expire_indirect()
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
[ Upstream commit 03ad0d703df75c43f78bd72e16124b5b94a95188 ]
if the second call of should_expire() in there ends up grabbing and returning a new reference to dentry, we need to drop it before continuing.
--- fs/autofs/expire.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/autofs/expire.c +3 -2
@@ -501,9 +501,10 @@ static struct dentry *autofs_expire_indirect(struct super_block *sb,*/ how &= ~AUTOFS_EXP_LEAVES ; found =should_expire (expired, mnt, timeout, how); -if (!found || found != expired) -/* Something has changed, continue */ +if (found != expired) {// something has changed, continue +dput (found); goto next; + }if (expired != dentry)dput (dentry);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 12/243 RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN
In reply to Greg Kroah-HartmanFrom: Sirong Wang <[email protected]>
[ Upstream commit 531eb45b3da4267fc2a64233ba256c8ffb02edd2 ]
Size of pointer to buf field of struct hns_roce_hem_chunk should be considered when calculating HNS_ROCE_HEM_CHUNK_LEN, or sg table size will be larger than expected when allocating hem.
--- drivers/infiniband/hw/hns/hns_roce_hem.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_hem.h +1 -1
@@ -54,7 +54,7 @@ enum {#define HNS_ROCE_HEM_CHUNK_LEN \ ((256 - sizeof(struct list_head) - 2 * sizeof(int)) / \ - (sizeof(struct scatterlist))) + (sizeof(struct scatterlist) + sizeof(void *)))#define check_whether_bt_num_3 (type, hop_num) \ (type < HEM_TYPE_MTT && hop_num == 2)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 13/243 iwlwifi: pcie: dont consider IV len in A-MSDU
In reply to Greg Kroah-HartmanFrom: Mordechay Goodstein <[email protected]>
[ Upstream commit cb1a4badf59275eb7221dcec621e8154917eabd1 ]
Quoted 1 line
From gen2 PN is totally offloaded to hardware (also the space for the
IV isn't part of the skb). As you can see in mvm/mac80211.c:3545, the MAC for cipher types CCMP/GCMP doesn't set IEEE80211_KEY_FLAG_PUT_IV_SPACE for gen2 NICs.
This causes all the AMSDU data to be corrupted with cipher enabled.
--- .../net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-)
drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c +7 -13
@@ -242,27 +242,23 @@ static int iwl_pcie_gen2_build_amsdu(struct iwl_trans *trans,struct ieee80211_hdr *hdr = (void *)skb->data;unsigned int snap_ip_tcp_hdrlen, ip_hdrlen, total_len, hdr_room;unsigned int mss =skb_shinfo (skb)->gso_size; -u16 length, iv_len, amsdu_pad; +u16 length, amsdu_pad;u8 *start_hdr;struct iwl_tso_hdr_page *hdr_page;struct page **page_ptr;struct tso_t tso; -/* if the packet is protected, then it must be CCMP or GCMP */ - iv_len =ieee80211_has_protected (hdr->frame_control) ? -IEEE80211_CCMP_HDR_LEN :0 ; -trace_iwlwifi_dev_tx (trans->dev, skb, tfd,sizeof (*tfd), &dev_cmd->hdr, start_len,0 ); ip_hdrlen =skb_transport_header (skb) -skb_network_header (skb); snap_ip_tcp_hdrlen =8 + ip_hdrlen +tcp_hdrlen (skb); - total_len = skb->len - snap_ip_tcp_hdrlen - hdr_len - iv_len; + total_len = skb->len - snap_ip_tcp_hdrlen - hdr_len; amsdu_pad =0 ;/* total amount of header we may need for this A-MSDU */ hdr_room =DIV_ROUND_UP (total_len, mss) * - (3 + snap_ip_tcp_hdrlen +sizeof (struct ethhdr )) + iv_len; + (3 + snap_ip_tcp_hdrlen +sizeof (struct ethhdr ));/* Our device supports 9 segments at most, it will fit in 1 page */ hdr_page =get_page_hdr (trans, hdr_room);
@@ -273,14 +269,12 @@ static int iwl_pcie_gen2_build_amsdu(struct iwl_trans *trans, start_hdr = hdr_page->pos; page_ptr = (void *)((u8 *)skb->cb + trans_pcie->page_offs); *page_ptr = hdr_page->page; -memcpy (hdr_page->pos, skb->data + hdr_len, iv_len); - hdr_page->pos += iv_len;/* -* Pull the ieee80211 header + IV to be able to use TSO core, +* Pull the ieee80211 header to be able to use TSO core, * we will restore it for the tx_status flow. */ -skb_pull (skb, hdr_len + iv_len); +skb_pull (skb, hdr_len);/* * Remove the length of all the headers that we don't actually
@@ -355,8 +349,8 @@ static int iwl_pcie_gen2_build_amsdu(struct iwl_trans *trans, } } -/* re -add the WiFi header and IV */ -skb_push (skb, hdr_len + iv_len); +/* re -add the WiFi header */ +skb_push (skb, hdr_len);return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 14/243 exportfs_decode_fh(): negative pinned may become positive without the parent locked
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
[ Upstream commit a2ece088882666e1dc7113744ac912eb161e3f87 ]
--- fs/exportfs/expfs.c | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-)
fs/exportfs/expfs.c +19 -12
@@ -517,26 +517,33 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,* inode is actually connected to the parent. */ err =exportfs_get_name (mnt, target_dir, nbuf, result); -if (!err) { -inode_lock (target_dir->d_inode); - nresult =lookup_one_len (nbuf, target_dir, -strlen (nbuf)); -inode_unlock (target_dir->d_inode); -if (!IS_ERR (nresult)) { -if (nresult->d_inode) { -dput (result); - result = nresult; - }else -dput (nresult); - } +if (err) { +dput (target_dir); + goto err_result; } +inode_lock (target_dir->d_inode); + nresult =lookup_one_len (nbuf, target_dir,strlen (nbuf)); +if (!IS_ERR (nresult)) { +if (unlikely (nresult->d_inode != result->d_inode)) { +dput (nresult); + nresult =ERR_PTR (-ESTALE ); + } + } +inode_unlock (target_dir->d_inode);/* * At this point we are done with the parent, but it's pinned * by the child dentry anyway. */ dput (target_dir); +if (IS_ERR (nresult)) { + err =PTR_ERR (nresult); + goto err_result; + } +dput (result); + result = nresult; +/* * And finally make sure the dentry is actually acceptable * to NFSD.
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 16/243 NFC: nxp-nci: Fix NULL pointer dereference after I2C communication error
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit a71a29f50de1ef97ab55c151a1598eb12dde379d ]
I2C communication errors (-EREMOTEIO) during the IRQ handler of nxp-nci result in a NULL pointer dereference at the moment:
BUG: kernel NULL pointer dereference, address: 0000000000000000
Oops: 0002 [#1] PREEMPT SMP NOPTI
CPU: 1 PID: 355 Comm: irq/137-nxp-nci Not tainted 5.4.0-rc6 #1
RIP: 0010:skb_queue_tail+0x25/0x50
Call Trace:
nci_recv_frame+0x36/0x90 [nci]
nxp_nci_i2c_irq_thread_fn+0xd1/0x285 [nxp_nci_i2c]
? preempt_count_add+0x68/0xa0
? irq_forced_thread_fn+0x80/0x80
irq_thread_fn+0x20/0x60
irq_thread+0xee/0x180
? wake_threads_waitq+0x30/0x30
kthread+0xfb/0x130
? irq_thread_check_affinity+0xd0/0xd0
? kthread_park+0x90/0x90
ret_from_fork+0x1f/0x40Afterward the kernel must be rebooted to work properly again.
This happens because it attempts to call nci_recv_frame() with skb == NULL. However, unlike nxp_nci_fw_recv_frame(), nci_recv_frame() does not have any NULL checks for skb, causing the NULL pointer dereference.
Change the code to call only nxp_nci_fw_recv_frame() in case of an error. Make sure to log it so it is obvious that a communication error occurred. The error above then becomes:
nxp-nci_i2c i2c-NXP1001:00: NFC: Read failed with error -121
nci: __nci_request: wait_for_completion_interruptible_timeout failed 0
nxp-nci_i2c i2c-NXP1001:00: NFC: Read failed with error -121--- drivers/nfc/nxp-nci/i2c.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/nfc/nxp-nci/i2c.c +4 -2
@@ -236,8 +236,10 @@ static irqreturn_t nxp_nci_i2c_irq_thread_fn(int irq, void *phy_id)if (r == -EREMOTEIO ) { phy->hard_fault = r; - skb =NULL ; - }else if (r <0 ) { +if (info->mode ==NXP_NCI_MODE_FW ) +nxp_nci_fw_recv_frame (phy->ndev,NULL ); + } +if (r <0 ) {nfc_err (&client->dev,"Read failed with error %d\n" , r); goto exit_irq_handled; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 15/243 audit_get_nd(): dont unlock parent too early
In reply to Greg Kroah-HartmanFrom: Al Viro <[email protected]>
[ Upstream commit 69924b89687a2923e88cc42144aea27868913d0e ]
if the child has been negative and just went positive under us, we want coherent d_is_positive() and ->d_inode. Don't unlock the parent until we'd done that work...
--- kernel/audit_watch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/audit_watch.c +1 -1
@@ -366,12 +366,12 @@ static int audit_get_nd(struct audit_watch *watch, struct path *parent)struct dentry *d =kern_path_locked (watch->path, parent);if (IS_ERR (d))return PTR_ERR (d); -inode_unlock (d_backing_inode (parent->dentry));if (d_is_positive (d)) {/* update watch filter fields */ watch->dev = d->d_sb->s_dev; watch->ino =d_backing_inode (d)->i_ino; } +inode_unlock (d_backing_inode (parent->dentry));dput (d);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 17/243 xfrm: release device reference for invalid state
In reply to Greg Kroah-HartmanFrom: Xiaodong Xu <[email protected]>
[ Upstream commit 4944a4b1077f74d89073624bd286219d2fcbfce3 ]
An ESP packet could be decrypted in async mode if the input handler for this packet returns -EINPROGRESS in xfrm_input(). At this moment the device reference in skb is held. Later xfrm_input() will be invoked again to resume the processing.
If the transform state is still valid it would continue to release the device reference and there won't be a problem; however if the transform state is not valid when async resumption happens, the packet will be dropped while the device reference is still being held.
When the device is deleted for some reason and the reference to this device is not properly released, the kernel will keep logging like:
unregister_netdevice: waiting for ppp2 to become free. Usage count = 1
The issue is observed when running IPsec traffic over a PPPoE device based on a bridge interface. By terminating the PPPoE connection on the server end for multiple times, the PPPoE device on the client side will eventually get stuck on the above warning message.
This patch will check the async mode first and continue to release device reference in async resumption, before it is dropped due to invalid state.
v2: Do not assign address family from outer_mode in the transform if the state is invalid
v3: Release device reference in the error path instead of jumping to resume
--- net/xfrm/xfrm_input.c | 3 +++ 1 file changed, 3 insertions(+)
net/xfrm/xfrm_input.c +3 -0
@@ -246,6 +246,9 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)else XFRM_INC_STATS (net,LINUX_MIB_XFRMINSTATEINVALID ); + +if (encap_type ==-1 ) +dev_put (skb->dev); goto drop; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 19/243 sched/core: Avoid spurious lock dependencies
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
[ Upstream commit ff51ff84d82aea5a889b85f2b9fb3aa2b8691668 ]
While seemingly harmless, __sched_fork() does hrtimer_init(), which, when DEBUG_OBJETS, can end up doing allocations.
This then results in the following lock order:
rq->lock
zone->lock.rlock
batched_entropy_u64.lockWhich in turn causes deadlocks when we do wakeups while holding that batched_entropy lock -- as the random code does.
Solve this by moving __sched_fork() out from under rq->lock. This is safe because nothing there relies on rq->lock, as also evident from the other __sched_fork() callsite.
--- kernel/sched/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/sched/core.c +2 -1
@@ -5413,10 +5413,11 @@ void init_idle(struct task_struct *idle, int cpu)struct rq *rq =cpu_rq (cpu);unsigned long flags; +__sched_fork (0 , idle); +raw_spin_lock_irqsave (&idle->pi_lock, flags);raw_spin_lock (&rq->lock); -__sched_fork (0 , idle); idle->state =TASK_RUNNING ; idle->se.exec_start =sched_clock (); idle->flags |=PF_IDLE ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 2/243 arm64: tegra: Fix active-low warning for Jetson TX1 regulator
In reply to Greg Kroah-HartmanFrom: Jon Hunter <[email protected]>
commit 1e5e929c009559bd7e898ac8e17a5d01037cb057 upstream.
Commit 34993594181d ("arm64: tegra: Enable HDMI on Jetson TX1") added a regulator for HDMI on the Jetson TX1 platform. This regulator has an active high enable, but the GPIO specifier for enabling the regulator incorrectly defines it as active-low. This causes the following warning to occur on boot ...
WARNING KERN regulator@10 GPIO handle specifies active low - ignored
The fixed-regulator binding does not use the active-low flag from the gpio specifier and purely relies of the presence of the 'enable-active-high' property to determine if it is active high or low (if this property is omitted). Fix this warning by setting the GPIO to active-high in the GPIO specifier which aligns with the presense of the 'enable-active-high' property.
--- arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi +1 -1
@@ -1589,7 +1589,7 @@ regulator-name = "VDD_HDMI_5V0"; regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; - gpio = <&exp1 12 GPIO_ACTIVE_LOW>; + gpio = <&exp1 12 GPIO_ACTIVE_HIGH>; enable-active-high; vin-supply = <&vdd_5v0_sys>; };
Greg Kroah-Hartman
maintainerPATCH 20/243 perf/core: Consistently fail fork on allocation failures
In reply to Greg Kroah-HartmanFrom: Alexander Shishkin <[email protected]>
[ Upstream commit 697d877849d4b34ab58d7078d6930bad0ef6fc66 ]
Commit:
313ccb9615948 ("perf: Allocate context task_ctx_data for child event")
makes the inherit path skip over the current event in case of task_ctx_data allocation failure. This, however, is inconsistent with allocation failures in perf_event_alloc(), which would abort the fork.
Correct this by returning an error code on task_ctx_data allocation failure and failing the fork in that case.
--- kernel/events/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/core.c +1 -1
@@ -11377,7 +11377,7 @@ inherit_event(struct perf_event *parent_event, GFP_KERNEL);if (!child_ctx->task_ctx_data) {free_event (child_event); -return NULL ; +return ERR_PTR (-ENOMEM ); } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 21/243 ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed()
In reply to Greg Kroah-HartmanFrom: paulhsia <[email protected]>
[ Upstream commit f5cdc9d4003a2f66ea57b3edd3e04acc2b1a4439 ]
If the nullity check for substream->runtime is outside of the lock region, it is possible to have a null runtime in the critical section if snd_pcm_detach_substream is called right before the lock.
--- sound/core/pcm_lib.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
sound/core/pcm_lib.c +6 -2
@@ -1797,11 +1797,14 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream)struct snd_pcm_runtime *runtime;unsigned long flags; -if (PCM_RUNTIME_CHECK (substream)) +if (snd_BUG_ON (!substream))return ; - runtime = substream->runtime;snd_pcm_stream_lock_irqsave (substream, flags); +if (PCM_RUNTIME_CHECK (substream)) + goto _unlock; + runtime = substream->runtime; +if (!snd_pcm_running (substream) ||snd_pcm_update_hw_ptr0 (substream,1 ) <0 ) goto _end;
@@ -1812,6 +1815,7 @@ void snd_pcm_period_elapsed(struct snd_pcm_substream *substream)#endif _end:kill_fasync (&runtime->fasync,SIGIO ,POLL_IN ); + _unlock:snd_pcm_stream_unlock_irqrestore (substream, flags); }EXPORT_SYMBOL (snd_pcm_period_elapsed);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 23/243 selftests: kvm: fix build with glibc >= 2.30
In reply to Greg Kroah-HartmanFrom: Vitaly Kuznetsov <[email protected]>
[ Upstream commit e37f9f139f62deddff90c7298ae3a85026a71067 ]
Glibc-2.30 gained gettid() wrapper, selftests fail to compile:
lib/assert.c:58:14: error: static declaration of ‘gettid’ follows non-static declaration
58 | static pid_t gettid(void)
| ^~~~~~
In file included from /usr/include/unistd.h:1170,
from include/test_util.h:18,
from lib/assert.c:10:
/usr/include/bits/unistd_ext.h:34:16: note: previous declaration of ‘gettid’ was here
34 | extern __pid_t gettid (void) __THROW;
| ^~~~~~--- tools/testing/selftests/kvm/lib/assert.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/selftests/kvm/lib/assert.c +2 -2
@@ -56,7 +56,7 @@ static void test_dump_stack(void)#pragma GCC diagnostic pop } -static pid_t gettid (void ) +static pid_t _gettid (void ) {return syscall (SYS_gettid); }
@@ -73,7 +73,7 @@ test_assert(bool exp, const char *exp_str,fprintf (stderr,"==== Test Assertion Failure ====\n" " %s:%u: %s\n" " pid=%d tid=%d - %s\n" , - file, line, exp_str,getpid (),gettid (), + file, line, exp_str,getpid (),_gettid (),strerror (errno));test_dump_stack ();if (fmt) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 25/243 net: ep93xx_eth: fix mismatch of request_mem_region in remove
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
[ Upstream commit 3df70afe8d33f4977d0e0891bdcfb639320b5257 ]
The driver calls release_resource in remove to match request_mem_region in probe, which is incorrect.
Fix it by using the right one, release_mem_region.
--- drivers/net/ethernet/cirrus/ep93xx_eth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/cirrus/ep93xx_eth.c +3 -2
@@ -767,6 +767,7 @@ static int ep93xx_eth_remove(struct platform_device *pdev) {struct net_device *dev;struct ep93xx_priv *ep; +struct resource *mem; dev =platform_get_drvdata (pdev);if (dev ==NULL )
@@ -782,8 +783,8 @@ static int ep93xx_eth_remove(struct platform_device *pdev)iounmap (ep->base_addr);if (ep->res !=NULL ) { -release_resource (ep->res); -kfree (ep->res); + mem =platform_get_resource (pdev,IORESOURCE_MEM ,0 ); +release_mem_region (mem->start,resource_size (mem)); }free_netdev (dev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 26/243 i2c: core: fix use after free in of_i2c_notify
In reply to Greg Kroah-HartmanFrom: Wen Yang <[email protected]>
[ Upstream commit a4c2fec16f5e6a5fee4865e6e0e91e2bc2d10f37 ]
We can't use "adap->dev" after it has been freed.
--- drivers/i2c/i2c-core-of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/i2c/i2c-core-of.c +2 -2
@@ -253,14 +253,14 @@ static int of_i2c_notify(struct notifier_block *nb, unsigned long action, } client =of_i2c_register_device (adap, rd->dn); -put_device (&adap->dev); -if (IS_ERR (client)) {dev_err (&adap->dev,"failed to create client for '%pOF'\n" , rd->dn); +put_device (&adap->dev);of_node_clear_flag (rd->dn,OF_POPULATED );return notifier_from_errno (PTR_ERR (client)); } +put_device (&adap->dev);break ;case OF_RECONFIG_CHANGE_REMOVE :/* already depopulated? */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 3/243 sparc64: implement ioremap_uc
In reply to Greg Kroah-HartmanFrom: Tuowen Zhao <[email protected]>
commit 38e45d81d14e5f78cd67922596b1c37b4c22ec74 upstream.
On sparc64, the whole physical IO address space is accessible using physically addressed loads and stores. *_uc does nothing like the others.
--- arch/sparc/include/asm/io_64.h | 1 + 1 file changed, 1 insertion(+)
arch/sparc/include/asm/io_64.h +1 -0
@@ -409,6 +409,7 @@ static inline void __iomem *ioremap(unsi }#define ioremap_nocache (X ,Y ) ioremap((X),(Y)) +#define ioremap_uc (X ,Y ) ioremap((X),(Y))#define ioremap_wc (X ,Y ) ioremap((X),(Y))#define ioremap_wt (X ,Y ) ioremap((X),(Y))
Greg Kroah-Hartman
maintainerPATCH 5/243 usb: gadget: u_serial: add missing port entry locking
In reply to Greg Kroah-HartmanFrom: Michał Mirosław <[email protected]>
commit daf82bd24e308c5a83758047aff1bd81edda4f11 upstream.
gserial_alloc_line() misses locking (for a release barrier) while resetting port entry on TTY allocation failure. Fix this.
--- drivers/usb/gadget/function/u_serial.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/gadget/function/u_serial.c +2 -0
@@ -1246,8 +1246,10 @@ int gserial_alloc_line(unsigned char *li __func__, port_num, PTR_ERR(tty_dev)); ret =PTR_ERR (tty_dev); +mutex_lock (&ports[port_num].lock); port = ports[port_num].port; ports[port_num].port =NULL ; +mutex_unlock (&ports[port_num].lock);gserial_free_port (port); goto err; }
Greg Kroah-Hartman
maintainerPATCH 6/243 tty: serial: fsl_lpuart: use the sg count from dma_map_sg
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
commit 487ee861de176090b055eba5b252b56a3b9973d6 upstream.
The dmaengine_prep_slave_sg needs to use sg count returned by dma_map_sg, not use sport->dma_tx_nents, because the return value of dma_map_sg is not always same with "nents".
When enabling iommu for lpuart + edma, iommu framework may concatenate two sgs into one.
--- drivers/tty/serial/fsl_lpuart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/fsl_lpuart.c +2 -2
@@ -376,8 +376,8 @@ static void lpuart_dma_tx(struct lpuart_ } sport->dma_tx_desc =dmaengine_prep_slave_sg (sport->dma_tx_chan, sgl, - sport->dma_tx_nents, -DMA_MEM_TO_DEV ,DMA_PREP_INTERRUPT ); + ret,DMA_MEM_TO_DEV , +DMA_PREP_INTERRUPT );if (!sport->dma_tx_desc) {dma_unmap_sg (dev, sgl, sport->dma_tx_nents,DMA_TO_DEVICE );dev_err (dev,"Cannot prepare TX slave DMA!\n" );
Greg Kroah-Hartman
maintainerPATCH 7/243 tty: serial: msm_serial: Fix flow control
In reply to Greg Kroah-HartmanFrom: Jeffrey Hugo <[email protected]>
commit b027ce258369cbfa88401a691c23dad01deb9f9b upstream.
hci_qca interfaces to the wcn3990 via a uart_dm on the msm8998 mtp and Lenovo Miix 630 laptop. As part of initializing the wcn3990, hci_qca disables flow, configures the uart baudrate, and then reenables flow - at which point an event is expected to be received over the uart from the wcn3990. It is observed that this event comes after the baudrate change but before hci_qca re-enables flow. This is unexpected, and is a result of msm_reset() being broken.
According to the uart_dm hardware documentation, it is recommended that automatic hardware flow control be enabled by setting RX_RDY_CTL. Auto hw flow control will manage RFR based on the configured watermark. When there is space to receive data, the hw will assert RFR. When the watermark is hit, the hw will de-assert RFR.
The hardware documentation indicates that RFR can me manually managed via CR when RX_RDY_CTL is not set. SET_RFR asserts RFR, and RESET_RFR de-asserts RFR.
msm_reset() is broken because after resetting the hardware, it unconditionally asserts RFR via SET_RFR. This enables flow regardless of the current configuration, and would undo a previous flow disable operation. It should instead de-assert RFR via RESET_RFR to block flow until the hardware is reconfigured. msm_serial should rely on the client to specify that flow should be enabled, either via mctrl() or the termios structure, and only assert RFR in response to those triggers.
--- drivers/tty/serial/msm_serial.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/tty/serial/msm_serial.c +5 -1
@@ -980,6 +980,7 @@ static unsigned int msm_get_mctrl(structstatic void msm_reset (struct uart_port *port) {struct msm_port *msm_port =UART_TO_MSM (port); +unsigned int mr;/* reset everything */ msm_write (port,UART_CR_CMD_RESET_RX ,UART_CR );
@@ -987,7 +988,10 @@ static void msm_reset(struct uart_port *msm_write (port,UART_CR_CMD_RESET_ERR ,UART_CR );msm_write (port,UART_CR_CMD_RESET_BREAK_INT ,UART_CR );msm_write (port,UART_CR_CMD_RESET_CTS ,UART_CR ); -msm_write (port,UART_CR_CMD_SET_RFR ,UART_CR ); +msm_write (port,UART_CR_CMD_RESET_RFR ,UART_CR ); + mr =msm_read (port,UART_MR1 ); + mr &= ~UART_MR1_RX_RDY_CTL ; +msm_write (port, mr,UART_MR1 );/* Disable DM modes */ if (msm_port->is_uartdm)
Greg Kroah-Hartman
maintainerPATCH 9/243 serial: serial_core: Perform NULL checks for break_ctl ops
In reply to Greg Kroah-HartmanFrom: Jiangfeng Xiao <[email protected]>
commit 7d73170e1c282576419f8b50a771f1fcd2b81a94 upstream.
Doing fuzz test on sbsa uart device, causes a kernel crash due to NULL pointer dereference:
------------[ cut here ]------------ Unable to handle kernel paging request at virtual address fffffffffffffffc pgd = ffffffe331723000 [fffffffffffffffc] *pgd=0000002333595003, *pud=0000002333595003, *pmd=00000 Internal error: Oops: 96000005 [#1] PREEMPT SMP Modules linked in: ping(O) jffs2 rtos_snapshot(O) pramdisk(O) hisi_sfc(O)
Drv_Nandc_K(O) Drv_SysCtl_K(O) Drv_SysClk_K(O) bsp_reg(O) hns3(O) hns3_uio_enet(O) hclgevf(O) hclge(O) hnae3(O) mdio_factory(O) mdio_registry(O) mdio_dev(O) mdio(O) hns3_info(O) rtos_kbox_panic(O) uart_suspend(O) rsm(O) stp llc tunnel4 xt_tcpudp ipt_REJECT nf_reject_ipv4 iptable_filter ip_tables x_tables sd_mod xhci_plat_hcd xhci_pci xhci_hcd usbmon usbhid usb_storage ohci_platform ohci_pci ohci_hcd hid_generic hid ehci_platform ehci_pci ehci_hcd vfat fat usbcore usb_common scsi_mod yaffs2multi(O) ext4 jbd2 ext2 mbcache ofpart i2c_dev i2c_core uio ubi nand nand_ecc nand_ids cfi_cmdset_0002 cfi_cmdset_0001 cfi_probe gen_probe cmdlinepart chipreg mtdblock mtd_blkdevs mtd nfsd auth_rpcgss oid_registry nfsv3 nfs nfs_acl lockd sunrpc grace autofs4
CPU: 2 PID: 2385 Comm: tty_fuzz_test Tainted: G O 4.4.193 #1 task: ffffffe32b23f110 task.stack: ffffffe32bda4000 PC is at uart_break_ctl+0x44/0x84 LR is at uart_break_ctl+0x34/0x84 pc : [<ffffff8393196098>] lr : [<ffffff8393196088>] pstate: 80000005
sp : ffffffe32bda7cc0
x29: ffffffe32bda7cc0 x28: ffffffe32b23f110
x27: ffffff8393402000 x26: 0000000000000000
x25: ffffffe32b233f40 x24: ffffffc07a8ec680
x23: 0000000000005425 x22: 00000000ffffffff
x21: ffffffe33ed73c98 x20: 0000000000000000
x19: ffffffe33ed94168 x18: 0000000000000004
x17: 0000007f92ae9d30 x16: ffffff8392fa6064
x15: 0000000000000010 x14: 0000000000000000
x13: 0000000000000000 x12: 0000000000000000
x11: 0000000000000020 x10: 0000007ffdac1708
x9 : 0000000000000078 x8 : 000000000000001d
x7 : 0000000052a64887 x6 : ffffffe32bda7e08
x5 : ffffffe32b23c000 x4 : 0000005fbc5b0000
x3 : ffffff83938d5018 x2 : 0000000000000080
x1 : ffffffe32b23c040 x0 : ffffff83934428f8
virtual start addr offset is 38ac00000
module base offset is 2cd4cf1000
linear region base offset is : 0
Process tty_fuzz_test (pid: 2385, stack limit = 0xffffffe32bda4000)
Stack: (0xffffffe32bda7cc0 to 0xffffffe32bda8000)
7cc0: ffffffe32bda7cf0 ffffff8393177718 ffffffc07a8ec680 ffffff8393196054 7ce0: 000000001739f2e0 0000007ffdac1978 ffffffe32bda7d20 ffffff8393179a1c 7d00: 0000000000000000 ffffff8393c0a000 ffffffc07a8ec680 cb88537fdc8ba600 7d20: ffffffe32bda7df0 ffffff8392fa5a40 ffffff8393c0a000 0000000000005425 7d40: 0000007ffdac1978 ffffffe32b233f40 ffffff8393178dcc 0000000000000003 7d60: 000000000000011d 000000000000001d ffffffe32b23f110 000000000000029e 7d80: ffffffe34fe8d5d0 0000000000000000 ffffffe32bda7e14 cb88537fdc8ba600 7da0: ffffffe32bda7e30 ffffff8393042cfc ffffff8393c41720 ffffff8393c46410 7dc0: ffffff839304fa68 ffffffe32b233f40 0000000000005425 0000007ffdac1978 7de0: 000000000000011d cb88537fdc8ba600 ffffffe32bda7e70 ffffff8392fa60cc 7e00: 0000000000000000 ffffffe32b233f40 ffffffe32b233f40 0000000000000003 7e20: 0000000000005425 0000007ffdac1978 ffffffe32bda7e70 ffffff8392fa60b0 7e40: 0000000000000280 ffffffe32b233f40 ffffffe32b233f40 0000000000000003 7e60: 0000000000005425 cb88537fdc8ba600 0000000000000000 ffffff8392e02e78 7e80: 0000000000000280 0000005fbc5b0000 ffffffffffffffff 0000007f92ae9d3c 7ea0: 0000000060000000 0000000000000015 0000000000000003 0000000000005425 7ec0: 0000007ffdac1978 0000000000000000 00000000a54c910e 0000007f92b95014 7ee0: 0000007f92b95090 0000000052a64887 000000000000001d 0000000000000078 7f00: 0000007ffdac1708 0000000000000020 0000000000000000 0000000000000000 7f20: 0000000000000000 0000000000000010 000000556acf0090 0000007f92ae9d30 7f40: 0000000000000004 000000556acdef10 0000000000000000 000000556acdebd0 7f60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000 7f80: 0000000000000000 0000000000000000 0000000000000000 0000007ffdac1840 7fa0: 000000556acdedcc 0000007ffdac1840 0000007f92ae9d3c 0000000060000000 7fc0: 0000000000000000 0000000000000000 0000000000000003 000000000000001d 7fe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
Call trace: Exception stack(0xffffffe32bda7ab0 to 0xffffffe32bda7bf0)
7aa0: 0000000000001000 0000007fffffffff
7ac0: ffffffe32bda7cc0 ffffff8393196098 0000000080000005 0000000000000025 7ae0: ffffffe32b233f40 ffffff83930d777c ffffffe32bda7b30 ffffff83930d777c 7b00: ffffffe32bda7be0 ffffff83938d5000 ffffffe32bda7be0 ffffffe32bda7c20 7b20: ffffffe32bda7b60 ffffff83930d777c ffffffe32bda7c10 ffffff83938d5000 7b40: ffffffe32bda7c10 ffffffe32bda7c50 ffffff8393c0a000 ffffffe32b23f110 7b60: ffffffe32bda7b70 ffffff8392e09df4 ffffffe32bda7bb0 cb88537fdc8ba600 7b80: ffffff83934428f8 ffffffe32b23c040 0000000000000080 ffffff83938d5018 7ba0: 0000005fbc5b0000 ffffffe32b23c000 ffffffe32bda7e08 0000000052a64887 7bc0: 000000000000001d 0000000000000078 0000007ffdac1708 0000000000000020 7be0: 0000000000000000 0000000000000000
[<ffffff8393196098>] uart_break_ctl+0x44/0x84 [<ffffff8393177718>] send_break+0xa0/0x114 [<ffffff8393179a1c>] tty_ioctl+0xc50/0xe84 [<ffffff8392fa5a40>] do_vfs_ioctl+0xc4/0x6e8 [<ffffff8392fa60cc>] SyS_ioctl+0x68/0x9c [<ffffff8392e02e78>] __sys_trace_return+0x0/0x4 Code: b9410ea0 34000160 f9408aa0 f9402814 (b85fc280) ---[ end trace 8606094f1960c5e0 ]--- Kernel panic - not syncing: Fatal exception
Fix this problem by adding NULL checks prior to calling break_ctl ops.
--- drivers/tty/serial/serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/serial_core.c +1 -1
@@ -1112,7 +1112,7 @@ static int uart_break_ctl(struct tty_strif (!uport) goto out; -if (uport->type !=PORT_UNKNOWN ) +if (uport->type !=PORT_UNKNOWN && uport->ops->break_ctl) uport->ops->break_ctl (uport, break_state); ret =0 ; out:
Greg Kroah-Hartman
maintainercover 4.19.89-stable review
This is the start of the stable review cycle for the 4.19.89 release. There are 243 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 Fri, 13 Dec 2019 14:56:06 +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/v4.x/stable-review/patch-4.19.89-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-4.19.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 4.19.89-rc1
Jann Horn <[email protected]>
binder: Handle start==NULL in binder_update_page_range()
Jann Horn <[email protected]>
binder: Fix race between mmap() and binder_alloc_print_pages()
Nicolas Pitre <[email protected]>
vcs: prevent write access to vcsu devices
Wei Wang <[email protected]>
thermal: Fix deadlock in thermal thermal_zone_device_check
Jan Kara <[email protected]>
iomap: Fix pipe page leakage during splicing
Viresh Kumar <[email protected]>
RDMA/qib: Validate ->show()/store() callbacks before calling them
Johan Hovold <[email protected]>
can: ucan: fix non-atomic allocation in completion handler
Sharvari Harisangam <[email protected]>
mwifiex: update set_mac_address logic
Gregory CLEMENT <[email protected]>
spi: atmel: Fix CS high support
Navid Emamdoost <[email protected]>
crypto: user - fix memory leak in crypto_report
Ard Biesheuvel <[email protected]>
crypto: ecdh - fix big endian bug in ECC library
Mark Salter <[email protected]>
crypto: ccp - fix uninitialized list head
Ayush Sawal <[email protected]>
crypto: af_alg - cast ki_complete ternary op to int
Tudor Ambarus <[email protected]>
crypto: atmel-aes - Fix IV handling when req->nbytes < ivsize
Christian Lamparter <[email protected]>
crypto: crypto4xx - fix double-free in crypto4xx_destroy_sdr
Sean Christopherson <[email protected]>
KVM: x86: Grab KVM's srcu lock when setting nested state
Paolo Bonzini <[email protected]>
KVM: x86: fix presentation of TSX feature in ARCH_CAPABILITIES
Paolo Bonzini <[email protected]>
KVM: x86: do not modify masked bits of shared MSRs
Zenghui Yu <[email protected]>
KVM: arm/arm64: vgic: Don't rely on the wrong pending table
Marek Szyprowski <[email protected]>
arm64: dts: exynos: Revert "Remove unneeded address space mapping for soc node"
Dan Carpenter <[email protected]>
drm/i810: Prevent underflow in ioctl
Johan Hovold <[email protected]>
drm/msm: fix memleak on release
Jan Kara <[email protected]>
jbd2: Fix possible overflow in jbd2_log_space_left()
Tejun Heo <[email protected]>
kernfs: fix ino wrap-around detection
Jouni Hogander <[email protected]>
can: slcan: Fix use-after-free Read in slcan_open
Dmitry Torokhov <[email protected]>
tty: vt: keyboard: reject invalid keycodes
Pavel Shilovsky <[email protected]>
CIFS: Fix SMB2 oplock break processing
Pavel Shilovsky <[email protected]>
CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
Nicolas Dichtel <[email protected]>
xfrm interface: fix management of phydev
Nicolas Dichtel <[email protected]>
xfrm interface: fix list corruption for x-netns
Nicolas Dichtel <[email protected]>
xfrm interface: avoid corruption on changelink
Nicolas Dichtel <[email protected]>
xfrm interface: fix memory leak on creation
Kai-Heng Feng <[email protected]>
x86/PCI: Avoid AMD FCH XHCI USB PME# from D0 defect
Joerg Roedel <[email protected]>
x86/mm/32: Sync only to VMALLOC_END in vmalloc_sync_all()
Navid Emamdoost <[email protected]>
Input: Fix memory leak in psxpad_spi_probe
Mike Leach <[email protected]>
coresight: etm4x: Fix input validation for sysfs.
Hans de Goede <[email protected]>
Input: goodix - add upside-down quirk for Teclast X89 tablet
Hans Verkuil <[email protected]>
Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers
Lucas Stach <[email protected]>
Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash
Hans Verkuil <[email protected]>
Input: synaptics - switch another X1 Carbon 6 to RMI/SMbus
Kai-Heng Feng <[email protected]>
ALSA: hda - Add mute led support for HP ProBook 645 G4
Takashi Iwai <[email protected]>
ALSA: pcm: oss: Avoid potential buffer overflows
Kailang Yang <[email protected]>
ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236
Hui Wang <[email protected]>
ALSA: hda/realtek - Enable the headset-mic on a Xiaomi's laptop
Jian-Hong Pan <[email protected]>
ALSA: hda/realtek - Enable internal speaker of ASUS UX431FLC
Miklos Szeredi <[email protected]>
fuse: verify attributes
Miklos Szeredi <[email protected]>
fuse: verify nlink
Xuewei Zhang <[email protected]>
sched/fair: Scale bandwidth quota and period without losing quota/period ratio precision
Dmitry Bogdanov <[email protected]>
net: aquantia: fix RSS table and key sizes
Helen Fornazier <[email protected]>
media: vimc: fix start stream when link is disabled
Felix Brack <[email protected]>
ARM: dts: am335x-pdu001: Fix polarity of card detection input
Rob Herring <[email protected]>
ARM: dts: sunxi: Fix PMU compatible strings
Ladislav Michl <[email protected]>
ASoC: max9867: Fix power management
Niklas Söderlund <[email protected]>
clk: renesas: rcar-gen3: Set state when registering SD clocks
YueHaibing <[email protected]>
usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handler
Qian Cai <[email protected]>
mlx4: Use snprintf instead of complicated strcpy
Mike Marciniszyn <[email protected]>
IB/hfi1: Close VNIC sdma_progress sleep window
Kaike Wan <[email protected]>
IB/hfi1: Ignore LNI errors before DC8051 transitions to Polling state
Chen-Yu Tsai <[email protected]>
ARM: dts: sun8i: a23/a33: Fix up RTC device node
Nir Dotan <[email protected]>
mlxsw: spectrum_router: Relax GRE decap matching check
Geert Uytterhoeven <[email protected]>
soc: renesas: r8a77990-sysc: Fix initialization order of 3DG-{A,B}Jakub Audykowicz <[email protected]>
sctp: frag_point sanity check
Bjorn Andersson <[email protected]>
clk: qcom: gcc-msm8998: Disable halt check of UFS clocks
Jonathan Marek <[email protected]>
firmware: qcom: scm: fix compilation error when disabled
Andreas Pape <[email protected]>
media: stkwebcam: Bugfix for wrong return values
Dmitry Safonov <[email protected]>
tty: Don't block on IO when ldisc change is pending
Paul Kocialkowski <[email protected]>
ARM: dts: sun8i: h3: Fix the system-control register range
Ryan Case <[email protected]>
tty: serial: qcom_geni_serial: Fix softlock
Kieran Bingham <[email protected]>
media: uvcvideo: Abstract streaming object lifetime
zhengbin <[email protected]>
nfsd: Return EPERM, not EACCES, in some SETATTR cases
Aaro Koskinen <[email protected]>
MIPS: OCTEON: cvmx_pko_mem_debug8: use oldest forward compatible definition
Geert Uytterhoeven <[email protected]>
clk: renesas: r8a77995: Correct parent clock of DU
Takeshi Kihara <[email protected]>
clk: renesas: r8a77990: Correct parent clock of DU
Joel Stanley <[email protected]>
powerpc/math-emu: Update macros from GCC
Kees Cook <[email protected]>
pstore/ram: Avoid NULL deref in ftrace merging failure path
Erez Alfasi <[email protected]>
net/mlx4_core: Fix return codes of unsupported operations
David Teigland <[email protected]>
dlm: fix invalid cluster name warning
Rob Herring <[email protected]>
ARM: dts: realview: Fix some more duplicate regulator nodes
Neil Armstrong <[email protected]>
media: cxd2880-spi: fix probe when dvb_attach fails
Jeffrey Hugo <[email protected]>
clk: qcom: Fix MSM8998 resets
Chen-Yu Tsai <[email protected]>
clk: sunxi-ng: h3/h5: Fix CSI_MCLK parent
Martin Blumenstingl <[email protected]>
clk: meson: meson8b: fix the offset of vid_pll_dco's N value
Daniel Mack <[email protected]>
ARM: dts: pxa: clean up USB controller nodes
Miquel Raynal <[email protected]>
mtd: fix mtd_oobavail() incoherent returned value
Masahiro Yamada <[email protected]>
kbuild: fix single target build for external module
Paul Walmsley <[email protected]>
modpost: skip ELF local symbols during section mismatch check
Yuchung Cheng <[email protected]>
tcp: fix SNMP TCP timeout under-estimation
Yuchung Cheng <[email protected]>
tcp: fix SNMP under-estimation on failed retransmission
Yuchung Cheng <[email protected]>
tcp: fix off-by-one bug on aborting window-probing socket
Rob Herring <[email protected]>
ARM: dts: realview-pbx: Fix duplicate regulator nodes
Lubomir Rintel <[email protected]>
ARM: dts: mmp2: fix the gpio interrupt cell number
Eric Dumazet <[email protected]>
tcp: make tcp_space() aware of socket backlog
Rob Herring <[email protected]>
kbuild: disable dtc simple_bus_reg warnings by default
Geert Uytterhoeven <[email protected]>
soc: renesas: r8a77980-sysc: Correct A3VIP[012] power domain hierarchy
Geert Uytterhoeven <[email protected]>
soc: renesas: r8a77980-sysc: Correct names of A2DP[01] power domains
Geert Uytterhoeven <[email protected]>
soc: renesas: r8a77970-sysc: Correct names of A2DP/A2CN power domains
Stephen Boyd <[email protected]>
clk: mediatek: Drop more __init markings for driver probe
Stephen Boyd <[email protected]>
clk: mediatek: Drop __init from mtk_clk_register_cpumuxes()
Yonghong Song <[email protected]>
tools/bpf: make libbpf _GNU_SOURCE friendly
Martin Schiller <[email protected]>
net/x25: fix null_x25_address handling
Martin Schiller <[email protected]>
net/x25: fix called/calling length calculation in x25_parse_address_block
Neil Armstrong <[email protected]>
arm64: dts: meson-gxl-khadas-vim: fix GPIO lines names
Neil Armstrong <[email protected]>
arm64: dts: meson-gxbb-odroidc2: fix GPIO lines names
Neil Armstrong <[email protected]>
arm64: dts: meson-gxbb-nanopi-k2: fix GPIO lines names
Neil Armstrong <[email protected]>
arm64: dts: meson-gxl-libretech-cc: fix GPIO lines names
Aaro Koskinen <[email protected]>
ARM: OMAP1/2: fix SoC name printing
Linus Walleij <[email protected]>
gpio: OF: Parse MMC-specific CD and WP properties
Young_X <[email protected]>
ASoC: au8540: use 64-bit arithmetic instead of 32-bit
Yonghong Song <[email protected]>
tools: bpftool: fix a bitfield pretty print issue
Yonghong Song <[email protected]>
bpf: btf: check name validity for various types
Yonghong Song <[email protected]>
bpf: btf: implement btf_name_valid_identifier()
Scott Mayhew <[email protected]>
nfsd: fix a warning in __cld_pipe_upcall()
YueHaibing <[email protected]>
can: xilinx: fix return type of ndo_start_xmit function
Clément Péron <[email protected]>
ARM: debug: enable UART1 for socfpga Cyclone5
Wen Yang <[email protected]>
dlm: NULL check before kmem_cache_destroy is not needed
Maxime Ripard <[email protected]>
ARM: dts: sun8i: v3s: Change pinctrl nodes to avoid warning
Maxime Ripard <[email protected]>
ARM: dts: sun8i: a23/a33: Fix OPP DTC warnings
Maxime Ripard <[email protected]>
ARM: dts: sun7i: Fix HDMI output DTC warning
Laurent Pinchart <[email protected]>
ARM: dts: r8a779[01]: Disable unconnected LVDS encoders
Maxime Ripard <[email protected]>
ARM: dts: sun5i: a10s: Fix HDMI output DTC warning
Maxime Ripard <[email protected]>
ARM: dts: sun4i: Fix HDMI output DTC warning
Maxime Ripard <[email protected]>
ARM: dts: sun4i: Fix gpio-keys warning
Kuninori Morimoto <[email protected]>
ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()
Joerg Roedel <[email protected]>
iommu/amd: Fix line-break in error log reporting
Xin Long <[email protected]>
sctp: increase sk_wmem_alloc when head->truesize is increased
J. Bruce Fields <[email protected]>
lockd: fix decoding of TEST results
Thierry Reding <[email protected]>
gpu: host1x: Fix syncpoint ID field size on Tegra186
Neil Armstrong <[email protected]>
clk: meson: Fix GXL HDMI PLL fractional bits width
Lucas Stach <[email protected]>
i2c: imx: don't print error message on probe defer
Stefan Agner <[email protected]>
serial: imx: fix error handling in console_setup
Colin Ian King <[email protected]>
altera-stapl: check for a null key before strcasecmp'ing it
Srinivas Kandagatla <[email protected]>
slimbus: ngd: Fix build error on x86
Niklas Söderlund <[email protected]>
dma-mapping: fix return type of dma_set_max_seg_size()
Keith Busch <[email protected]>
nvme: Free ctrl device name on init failure
David Miller <[email protected]>
sparc: Correct ctx->saw_frame_pointer logic.
David Miller <[email protected]>
sparc: Fix JIT fused branch convergance.
Sahitya Tummala <[email protected]>
f2fs: fix to allow node segment for GC by ioctl path
Otavio Salvador <[email protected]>
ARM: dts: rockchip: Assign the proper GPIO clocks for rv1108
Otavio Salvador <[email protected]>
ARM: dts: rockchip: Fix the PMU interrupt number for rv1108
Yunlong Song <[email protected]>
f2fs: change segment to section in f2fs_ioc_gc_range
Yunlong Song <[email protected]>
f2fs: fix count of seg_freed to make sec_freed correct
Chao Yu <[email protected]>
f2fs: fix to account preflush command for noflush_merge mode
Alexey Dobriyan <[email protected]>
ACPI: fix acpi_find_child_device() invocation in acpi_preset_companion()
Brian Norris <[email protected]>
usb: dwc3: don't log probe deferrals; but do log other error codes
Thinh Nguyen <[email protected]>
usb: dwc3: debugfs: Properly print/set link state for HS
Breno Leitao <[email protected]>
selftests/powerpc: Skip test instead of failing
Breno Leitao <[email protected]>
selftests/powerpc: Allocate base registers
Colin Ian King <[email protected]>
net: qualcomm: rmnet: move null check on dev before dereferecing it
Christian Lamparter <[email protected]>
dmaengine: dw-dmac: implement dma protection control setting
Vinod Koul <[email protected]>
dmaengine: coh901318: Remove unused variable
Jia-Ju Bai <[email protected]>
dmaengine: coh901318: Fix a double-lock bug
Hangbin Liu <[email protected]>
net/ipv6: re-do dad when interface has IFF_NOARP flag change
Magnus Damm <[email protected]>
ravb: Clean up duplex handling
Luca Coelho <[email protected]>
iwlwifi: fix cfg structs for 22000 with different RF modules
Hans Verkuil <[email protected]>
media: cec: report Vendor ID after initialization
Hans Verkuil <[email protected]>
media: pulse8-cec: return 0 when invalidating the logical address
Philipp Zabel <[email protected]>
media: coda: fix memory corruption in case more than 32 instances are opened
Marek Szyprowski <[email protected]>
ARM: dts: exynos: Use Samsung SoC specific compatible for DWC2 module
Baruch Siach <[email protected]>
rtc: dt-binding: abx80x: fix resistance scale
Christophe JAILLET <[email protected]>
rtc: max8997: Fix the returned value in case of error in 'max8997_rtc_read_alarm()'
Nylon Chen <[email protected]>
nds32: Fix the items of hwcap_str ordering issue.
Vincent Chen <[email protected]>
math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning
Ursula Braun <[email protected]>
net/smc: use after free fix in smc_wr_tx_put_slot()
Aaro Koskinen <[email protected]>
MIPS: OCTEON: octeon-platform: fix typing
Steve Wise <[email protected]>
iw_cxgb4: only reconnect with MPAv1 if the peer aborts
Dave Chinner <[email protected]>
iomap: readpages doesn't zero page tail beyond EOF
Dave Chinner <[email protected]>
iomap: dio data corruption and spurious errors when pipes fill
Dave Chinner <[email protected]>
iomap: sub-block dio needs to zeroout beyond EOF
Dave Chinner <[email protected]>
iomap: FUA is wrong for DIO O_DSYNC writes into unwritten extents
Bruce Allan <[email protected]>
ice: Fix possible NULL pointer de-reference
Dave Ertman <[email protected]>
ice: Fix return value from NAPI poll
Xue Chaojing <[email protected]>
net-next/hinic: fix a bug in rx data flow
Xue Chaojing <[email protected]>
net-next/hinic:fix a bug in set mac address
Dave Chinner <[email protected]>
xfs: extent shifting doesn't fully invalidate page cache
Ji-Ze Hong (Peter Hong) <[email protected]>
USB: serial: f81534: fix reading old/new IC config
Mark Brown <[email protected]>
regulator: Fix return value of _set_load() stub
Xin Long <[email protected]>
sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit
Katsuhiro Suzuki <[email protected]>
clk: rockchip: fix ID of 8ch clock of I2S1 for rk3328
Katsuhiro Suzuki <[email protected]>
clk: rockchip: fix I2S1 clock gate register for rk3328
Janne Huttunen <[email protected]>
mm/vmstat.c: fix NUMA statistics updates
James Hughes <[email protected]>
firmware: raspberrypi: Fix firmware calls with large buffers
Shreeya Patel <[email protected]>
Staging: iio: adt7316: Fix i2c data reading, set the data field
Brian Masney <[email protected]>
pinctrl: qcom: ssbi-gpio: fix gpio-hog related boot issues
Michal Simek <[email protected]>
arm64: dts: zynqmp: Fix node names which contain "_"
Raveendra Padasalagi <[email protected]>
crypto: bcm - fix normal/non key hash algorithm failure
Vitaly Chikunov <[email protected]>
crypto: ecc - check for invalid values in the key verification test
Lucas Stach <[email protected]>
ARM: dts: imx6: RDU2: fix eGalax touchscreen node
Tony Lindgren <[email protected]>
bus: ti-sysc: Fix getting optional clocks in clock_roles
Maxime Jourdan <[email protected]>
drivers: soc: Allow building the amlogic drivers without ARCH_MESON
Steffen Maier <[email protected]>
scsi: zfcp: drop default switch case which might paper over missing case
Steffen Maier <[email protected]>
scsi: zfcp: update kernel message for invalid FCP_CMND length, it's not the CDB
Andrew Lunn <[email protected]>
net: dsa: mv88e6xxx: Work around mv886e6161 SERDES missing MII_PHYSID2
Maciej W. Rozycki <[email protected]>
MIPS: SiByte: Enable ZONE_DMA32 for LittleSur
David Teigland <[email protected]>
dlm: fix missing idr_destroy for recover_idr
John Keeping <[email protected]>
ARM: dts: rockchip: Fix rk3288-rock2 vcc_flash name
Heiko Stuebner <[email protected]>
clk: rockchip: fix rk3188 sclk_mac_lbtest parameter ordering
Finley Xiao <[email protected]>
clk: rockchip: fix rk3188 sclk_smc gate data
Alice Michael <[email protected]>
virtchnl: Fix off by one error
Mitch Williams <[email protected]>
i40e: don't restart nway if autoneg not supported
Christophe JAILLET <[email protected]>
rtc: max77686: Fix the returned value in case of error in 'max77686_rtc_read_time()'
Marek Szyprowski <[email protected]>
rtc: s3c-rtc: Avoid using broken ALMYEAR register
Ivan Khoronzhuk <[email protected]>
net: ethernet: ti: cpts: correct debug for expired txq skb
Marek Szyprowski <[email protected]>
extcon: max8997: Fix lack of path setting in USB device mode
Anand Moon <[email protected]>
ARM: dts: exynos: Fix LDO13 min values on Odroid XU3/XU4/HC1
Denis V. Lunev <[email protected]>
dlm: fix possible call to kfree() for non-initialized pointer
Lev Faerman <[email protected]>
ice: Fix NVM mask defines
Jagan Teki <[email protected]>
clk: sunxi-ng: a64: Fix gate bit of DSI DPHY
Moni Shoua <[email protected]>
net/mlx5: Release resource on error flow
Eugeniy Paltsev <[email protected]>
ARC: IOC: panic if kernel was started with previously enabled IOC
Florian Westphal <[email protected]>
netfilter: nf_tables: don't use position attribute on rule replacement
Jan Kara <[email protected]>
audit: Embed key into chunk
Vincent Whitchurch <[email protected]>
ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+
Andrei Otcheretianski <[email protected]>
iwlwifi: mvm: Send non offchannel traffic via AP sta
Shahar S Matityahu <[email protected]>
iwlwifi: trans: Clear persistence bit when starting the FW
Johannes Berg <[email protected]>
iwlwifi: mvm: synchronize TID queue removal
Arjun Vynipadath <[email protected]>
cxgb4vf: fix memleak in mac_hlist initialization
Douglas Anderson <[email protected]>
serial: core: Allow processing sysrq at port unlock time
Wen Yang <[email protected]>
i2c: core: fix use after free in of_i2c_notify
Chuhong Yuan <[email protected]>
net: ep93xx_eth: fix mismatch of request_mem_region in remove
Chuhong Yuan <[email protected]>
rsxx: add missed destroy_workqueue calls in remove
Vitaly Kuznetsov <[email protected]>
selftests: kvm: fix build with glibc >= 2.30
Yunhao Tian <[email protected]>
drm/sun4i: tcon: Set min division of TCON0_DCLK to 1.
paulhsia <[email protected]>
ALSA: pcm: Fix stream lock usage in snd_pcm_period_elapsed()
Alexander Shishkin <[email protected]>
perf/core: Consistently fail fork on allocation failures
Peter Zijlstra <[email protected]>
sched/core: Avoid spurious lock dependencies
Pan Bian <[email protected]>
Input: cyttsp4_core - fix use after free bug
Xiaodong Xu <[email protected]>
xfrm: release device reference for invalid state
Stephan Gerhold <[email protected]>
NFC: nxp-nci: Fix NULL pointer dereference after I2C communication error
Al Viro <[email protected]>
audit_get_nd(): don't unlock parent too early
Al Viro <[email protected]>
exportfs_decode_fh(): negative pinned may become positive without the parent locked
Mordechay Goodstein <[email protected]>
iwlwifi: pcie: don't consider IV len in A-MSDU
Sirong Wang <[email protected]>
RDMA/hns: Correct the value of HNS_ROCE_HEM_CHUNK_LEN
Al Viro <[email protected]>
autofs: fix a leak in autofs_expire_indirect()
Chuhong Yuan <[email protected]>
serial: ifx6x60: add missed pm_runtime_disable
Jiangfeng Xiao <[email protected]>
serial: serial_core: Perform NULL checks for break_ctl ops
Vincent Whitchurch <[email protected]>
serial: pl011: Fix DMA ->flush_buffer()
Jeffrey Hugo <[email protected]>
tty: serial: msm_serial: Fix flow control
Peng Fan <[email protected]>
tty: serial: fsl_lpuart: use the sg count from dma_map_sg
Michał Mirosław <[email protected]>
usb: gadget: u_serial: add missing port entry locking
Arnd Bergmann <[email protected]>
lp: fix sparc64 LPSETTIMEOUT ioctl
Tuowen Zhao <[email protected]>
sparc64: implement ioremap_uc
Jon Hunter <[email protected]>
arm64: tegra: Fix 'active-low' warning for Jetson TX1 regulator
Navid Emamdoost <[email protected]>
rsi: release skb if rsi_prepare_beacon fails
-------------
Diffstat:
.../devicetree/bindings/rtc/abracon,abx80x.txt | 2 +- Makefile | 15 +-- arch/arc/include/asm/cache.h | 2 + arch/arc/mm/cache.c | 20 +++- arch/arm/Kconfig.debug | 23 ++-- arch/arm/boot/dts/am335x-pdu001.dts | 2 +- arch/arm/boot/dts/arm-realview-pb1176.dts | 4 +- arch/arm/boot/dts/arm-realview-pb11mp.dts | 4 +- arch/arm/boot/dts/arm-realview-pbx.dtsi | 5 +- arch/arm/boot/dts/exynos3250.dtsi | 2 +- arch/arm/boot/dts/exynos5422-odroid-core.dtsi | 2 +- arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 5 +- arch/arm/boot/dts/mmp2.dtsi | 2 +- arch/arm/boot/dts/pxa27x.dtsi | 2 +- arch/arm/boot/dts/pxa2xx.dtsi | 7 -- arch/arm/boot/dts/pxa3xx.dtsi | 2 +- arch/arm/boot/dts/r8a7790-lager.dts | 2 - arch/arm/boot/dts/r8a7791-koelsch.dts | 2 - arch/arm/boot/dts/r8a7791-porter.dts | 2 - arch/arm/boot/dts/rk3288-rock2-som.dtsi | 2 +- arch/arm/boot/dts/rv1108.dtsi | 10 +- arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts | 2 - arch/arm/boot/dts/sun4i-a10-pcduino.dts | 2 - arch/arm/boot/dts/sun4i-a10.dtsi | 2 - arch/arm/boot/dts/sun5i-a10s.dtsi | 2 - arch/arm/boot/dts/sun6i-a31.dtsi | 2 +- arch/arm/boot/dts/sun7i-a20.dtsi | 4 +- arch/arm/boot/dts/sun8i-a23-a33.dtsi | 6 +- arch/arm/boot/dts/sun8i-h3.dtsi | 8 +- arch/arm/boot/dts/sun8i-r16-bananapi-m2m.dts | 4 +- arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 4 +- arch/arm/boot/dts/sun8i-v3s.dtsi | 10 +- arch/arm/include/asm/uaccess.h | 18 +++ arch/arm/lib/getuser.S | 11 ++ arch/arm/lib/putuser.S | 20 ++-- arch/arm/mach-omap1/id.c | 6 +- arch/arm/mach-omap2/id.c | 4 +- .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 4 +- .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 4 +- .../dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 +- .../dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 4 +- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 6 +- arch/arm64/boot/dts/exynos/exynos7.dtsi | 6 +- arch/arm64/boot/dts/nvidia/tegra210-p2597.dtsi | 2 +- arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi | 4 +- arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts | 4 +- arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts | 10 +- arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts | 2 +- arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts | 2 +- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 +- arch/mips/Kconfig | 1 + arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c | 2 +- arch/mips/cavium-octeon/octeon-platform.c | 2 +- arch/mips/include/asm/octeon/cvmx-pko.h | 2 +- arch/nds32/kernel/setup.c | 3 +- arch/powerpc/include/asm/sfp-machine.h | 92 +++++--------- arch/sparc/include/asm/io_64.h | 1 + arch/sparc/net/bpf_jit_comp_64.c | 89 +++++++++----- arch/x86/kvm/x86.c | 17 ++- arch/x86/mm/fault.c | 2 +- arch/x86/pci/fixup.c | 11 ++ crypto/af_alg.c | 2 +- crypto/crypto_user.c | 4 +- crypto/ecc.c | 45 ++++--- drivers/android/binder_alloc.c | 30 +++-- drivers/block/rsxx/core.c | 2 + drivers/bus/ti-sysc.c | 9 +- drivers/char/lp.c | 4 + drivers/clk/mediatek/clk-cpumux.c | 8 +- drivers/clk/mediatek/clk-mt7622.c | 4 +- drivers/clk/meson/gxbb.c | 8 +- drivers/clk/meson/meson8b.c | 2 +- drivers/clk/qcom/gcc-msm8998.c | 44 +++---- drivers/clk/renesas/r8a77990-cpg-mssr.c | 4 +- drivers/clk/renesas/r8a77995-cpg-mssr.c | 4 +- drivers/clk/renesas/rcar-gen3-cpg.c | 16 +-- drivers/clk/rockchip/clk-rk3188.c | 8 +- drivers/clk/rockchip/clk-rk3328.c | 2 +- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 2 +- drivers/crypto/amcc/crypto4xx_core.c | 6 +- drivers/crypto/atmel-aes.c | 53 +++++---- drivers/crypto/bcm/cipher.c | 6 +- drivers/crypto/ccp/ccp-dmaengine.c | 1 + drivers/dma/coh901318.c | 5 - drivers/dma/dw/core.c | 2 + drivers/dma/dw/platform.c | 6 + drivers/dma/dw/regs.h | 4 + drivers/extcon/extcon-max8997.c | 10 +- drivers/firmware/raspberrypi.c | 35 +++--- drivers/gpio/gpiolib-of.c | 39 ++++++ drivers/gpu/drm/i810/i810_dma.c | 4 +- drivers/gpu/drm/msm/msm_debugfs.c | 6 +- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 +- drivers/gpu/host1x/hw/hw_host1x06_uclass.h | 2 +- .../hwtracing/coresight/coresight-etm4x-sysfs.c | 21 ++-- drivers/i2c/busses/i2c-imx.c | 3 +- drivers/i2c/i2c-core-of.c | 4 +- drivers/infiniband/hw/cxgb4/cm.c | 3 +- drivers/infiniband/hw/hfi1/chip.c | 47 +++++++- drivers/infiniband/hw/hfi1/vnic_sdma.c | 15 +-- drivers/infiniband/hw/hns/hns_roce_hem.h | 2 +- drivers/infiniband/hw/mlx4/sysfs.c | 12 +- drivers/infiniband/hw/qib/qib_sysfs.c | 6 + drivers/input/joystick/psxpad-spi.c | 2 +- drivers/input/mouse/synaptics.c | 1 + drivers/input/rmi4/rmi_f34v7.c | 3 + drivers/input/rmi4/rmi_smbus.c | 2 - drivers/input/touchscreen/cyttsp4_core.c | 7 -- drivers/input/touchscreen/goodix.c | 9 ++ drivers/iommu/amd_iommu.c | 22 ++-- drivers/media/cec/cec-adap.c | 7 ++ drivers/media/platform/coda/coda-common.c | 26 ++-- drivers/media/platform/coda/coda.h | 3 +- drivers/media/platform/vimc/vimc-common.c | 2 + drivers/media/spi/cxd2880-spi.c | 1 + drivers/media/usb/pulse8-cec/pulse8-cec.c | 2 +- drivers/media/usb/stkwebcam/stk-webcam.c | 6 +- drivers/media/usb/uvc/uvc_driver.c | 54 ++++++--- drivers/misc/altera-stapl/altera.c | 3 +- drivers/net/can/slcan.c | 1 + drivers/net/can/usb/ucan.c | 2 +- drivers/net/can/xilinx_can.c | 2 +- drivers/net/dsa/mv88e6xxx/chip.c | 21 +++- drivers/net/ethernet/aquantia/atlantic/aq_cfg.h | 4 +- drivers/net/ethernet/aquantia/atlantic/aq_nic.c | 2 +- .../net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 +- drivers/net/ethernet/cirrus/ep93xx_eth.c | 5 +- drivers/net/ethernet/huawei/hinic/hinic_main.c | 7 +- drivers/net/ethernet/huawei/hinic/hinic_rx.c | 2 +- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 10 +- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 6 +- drivers/net/ethernet/intel/ice/ice_switch.c | 3 + drivers/net/ethernet/intel/ice/ice_txrx.c | 3 +- drivers/net/ethernet/mellanox/mlx4/main.c | 11 +- drivers/net/ethernet/mellanox/mlx5/core/qp.c | 4 +- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 +- drivers/net/ethernet/qualcomm/rmnet/rmnet_config.c | 5 +- drivers/net/ethernet/renesas/ravb.h | 1 - drivers/net/ethernet/renesas/ravb_main.c | 19 +-- drivers/net/ethernet/ti/cpts.c | 4 +- drivers/net/wireless/intel/iwlwifi/cfg/22000.c | 1 - drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 7 ++ drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 15 +++ drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 10 ++ drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 +- drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 34 +++++- drivers/net/wireless/intel/iwlwifi/pcie/tx-gen2.c | 20 ++-- drivers/net/wireless/marvell/mwifiex/main.c | 6 +- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 1 + drivers/nfc/nxp-nci/i2c.c | 6 +- drivers/nvme/host/core.c | 2 +- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 23 +++- drivers/rtc/rtc-max77686.c | 2 +- drivers/rtc/rtc-max8997.c | 2 +- drivers/rtc/rtc-s3c.c | 6 - drivers/s390/scsi/zfcp_erp.c | 3 - drivers/s390/scsi/zfcp_fsf.c | 7 +- drivers/slimbus/qcom-ngd-ctrl.c | 5 +- drivers/soc/Makefile | 2 +- drivers/soc/renesas/r8a77970-sysc.c | 4 +- drivers/soc/renesas/r8a77980-sysc.c | 10 +- drivers/soc/renesas/r8a77990-sysc.c | 23 +--- drivers/spi/spi-atmel.c | 6 +- drivers/staging/iio/addac/adt7316-i2c.c | 2 + drivers/thermal/thermal_core.c | 4 +- drivers/tty/n_hdlc.c | 4 +- drivers/tty/n_r3964.c | 2 +- drivers/tty/n_tty.c | 8 +- drivers/tty/serial/amba-pl011.c | 6 +- drivers/tty/serial/fsl_lpuart.c | 4 +- drivers/tty/serial/ifx6x60.c | 3 + drivers/tty/serial/imx.c | 2 +- drivers/tty/serial/msm_serial.c | 6 +- drivers/tty/serial/qcom_geni_serial.c | 56 ++++++--- drivers/tty/serial/serial_core.c | 2 +- drivers/tty/tty_ldisc.c | 7 ++ drivers/tty/vt/keyboard.c | 2 +- drivers/tty/vt/vc_screen.c | 3 + drivers/usb/dwc3/core.c | 3 +- drivers/usb/dwc3/debug.h | 29 +++++ drivers/usb/dwc3/debugfs.c | 19 ++- drivers/usb/gadget/function/u_serial.c | 2 + drivers/usb/mtu3/mtu3_qmu.c | 2 +- drivers/usb/serial/f81534.c | 20 +++- fs/autofs/expire.c | 5 +- fs/cifs/file.c | 7 +- fs/cifs/smb2misc.c | 7 +- fs/dlm/lockspace.c | 1 + fs/dlm/member.c | 2 +- fs/dlm/memory.c | 9 +- fs/dlm/user.c | 3 +- fs/exportfs/expfs.c | 31 +++-- fs/f2fs/file.c | 2 +- fs/f2fs/gc.c | 10 +- fs/f2fs/segment.c | 2 + fs/fuse/dir.c | 27 +++-- fs/fuse/fuse_i.h | 2 + fs/iomap.c | 62 ++++++++-- fs/kernfs/dir.c | 5 +- fs/lockd/clnt4xdr.c | 22 +--- fs/lockd/clntxdr.c | 22 +--- fs/nfsd/nfs4recover.c | 17 +-- fs/nfsd/vfs.c | 17 ++- fs/pstore/ram.c | 2 +- fs/xfs/xfs_bmap_util.c | 8 +- include/dt-bindings/clock/rk3328-cru.h | 2 +- include/dt-bindings/power/r8a77970-sysc.h | 6 +- include/dt-bindings/power/r8a77980-sysc.h | 6 +- include/linux/acpi.h | 2 +- include/linux/avf/virtchnl.h | 4 +- include/linux/dma-mapping.h | 3 +- include/linux/jbd2.h | 4 +- include/linux/kernfs.h | 1 + include/linux/mtd/mtd.h | 2 +- include/linux/platform_data/dma-dw.h | 6 + include/linux/qcom_scm.h | 3 + include/linux/regulator/consumer.h | 2 +- include/linux/serial_core.h | 37 +++++- include/linux/tty.h | 7 ++ include/math-emu/soft-fp.h | 2 +- include/net/sctp/sctp.h | 5 + include/net/tcp.h | 2 +- include/net/xfrm.h | 1 - kernel/audit_tree.c | 27 ++--- kernel/audit_watch.c | 2 +- kernel/bpf/btf.c | 82 +++++++++++++ kernel/events/core.c | 2 +- kernel/sched/core.c | 3 +- kernel/sched/fair.c | 36 +++--- mm/vmstat.c | 7 +- net/ipv4/tcp_output.c | 2 +- net/ipv4/tcp_timer.c | 10 +- net/ipv6/addrconf.c | 19 ++- net/netfilter/nf_tables_api.c | 17 ++- net/sctp/chunk.c | 6 + net/sctp/output.c | 22 +--- net/sctp/socket.c | 3 +- net/smc/smc_wr.c | 4 +- net/x25/af_x25.c | 18 +-- net/xfrm/xfrm_input.c | 3 + net/xfrm/xfrm_interface.c | 132 +++++++-------------- scripts/Makefile.lib | 1 + scripts/mod/modpost.c | 12 ++ sound/core/oss/linear.c | 2 + sound/core/oss/mulaw.c | 2 + sound/core/oss/route.c | 2 + sound/core/pcm_lib.c | 8 +- sound/pci/hda/patch_conexant.c | 1 + sound/pci/hda/patch_realtek.c | 18 ++- sound/soc/codecs/max9867.c | 72 ++++++----- sound/soc/codecs/max9867.h | 2 +- sound/soc/codecs/nau8540.c | 2 +- sound/soc/sh/rcar/core.c | 12 ++ sound/soc/sh/rcar/dvc.c | 8 -- tools/bpf/bpftool/btf_dumper.c | 6 +- tools/lib/bpf/libbpf.c | 2 + tools/lib/bpf/libbpf_errno.c | 1 + tools/testing/selftests/kvm/lib/assert.c | 4 +- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 5 +- .../testing/selftests/powerpc/ptrace/ptrace-gpr.c | 2 +- .../selftests/powerpc/ptrace/ptrace-tm-gpr.c | 4 +- .../selftests/powerpc/ptrace/ptrace-tm-spd-tar.c | 2 +- .../selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c | 3 +- .../selftests/powerpc/ptrace/ptrace-tm-spr.c | 2 +- .../selftests/powerpc/ptrace/ptrace-tm-tar.c | 2 +- .../selftests/powerpc/ptrace/ptrace-tm-vsx.c | 3 +- virt/kvm/arm/vgic/vgic-v3.c | 6 +- 268 files changed, 1563 insertions(+), 1024 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 28/243 cxgb4vf: fix memleak in mac_hlist initialization
From: Arjun Vynipadath <[email protected]>
[ Upstream commit 24357e06ba511ad874d664d39475dbb01c1ca450 ]
mac_hlist was initialized during adapter_up, which will be called every time a vf device is first brought up, or every time when device is brought up again after bringing all devices down. This means our state of previous list is lost, causing a memleak if entries are present in the list. To fix that, move list init to the condition that performs initial one time adapter setup.
--- drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +4 -2
@@ -722,6 +722,10 @@ static int adapter_up(struct adapter *adapter)if (adapter->flags &USING_MSIX )name_msix_vecs (adapter); + +/* Initialize hash mac addr list*/ +INIT_LIST_HEAD (&adapter->mac_hlist); + adapter->flags |=FULL_INIT_DONE ; }
@@ -747,8 +751,6 @@ static int adapter_up(struct adapter *adapter)enable_rx (adapter);t4vf_sge_start (adapter); -/* Initialize hash mac addr list*/ -INIT_LIST_HEAD (&adapter->mac_hlist);return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 38/243 ice: Fix NVM mask defines
In reply to Greg Kroah-HartmanFrom: Lev Faerman <[email protected]>
[ Upstream commit 6263e811f4d4418660c20b36a08063c6d2c3fb9d ]
Fixes bad masks that would break compilation when evaluated.
--- drivers/net/ethernet/intel/ice/ice_adminq_cmd.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/intel/ice/ice_adminq_cmd.h +3 -3
@@ -1056,10 +1056,10 @@ struct ice_aqc_nvm {#define ICE_AQC_NVM_LAST_CMD BIT(0)#define ICE_AQC_NVM_PCIR_REQ BIT(0)/* Used by NVM Update reply */ #define ICE_AQC_NVM_PRESERVATION_S 1 -#define ICE_AQC_NVM_PRESERVATION_M (3 << CSR_AQ_NVM_PRESERVATION_S) -#define ICE_AQC_NVM_NO_PRESERVATION (0 << CSR_AQ_NVM_PRESERVATION_S) +#define ICE_AQC_NVM_PRESERVATION_M (3 << ICE_AQC_NVM_PRESERVATION_S) +#define ICE_AQC_NVM_NO_PRESERVATION (0 << ICE_AQC_NVM_PRESERVATION_S)#define ICE_AQC_NVM_PRESERVE_ALL BIT(1) -#define ICE_AQC_NVM_PRESERVE_SELECTED (3 << CSR_AQ_NVM_PRESERVATION_S) +#define ICE_AQC_NVM_PRESERVE_SELECTED (3 << ICE_AQC_NVM_PRESERVATION_S)#define ICE_AQC_NVM_FLASH_ONLY BIT(7)__le16 module_typeid;__le16 length;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 37/243 clk: sunxi-ng: a64: Fix gate bit of DSI DPHY
In reply to Greg Kroah-HartmanFrom: Jagan Teki <[email protected]>
[ Upstream commit ee678706e46d0d185c27cc214ad97828e0643159 ]
DSI DPHY gate bit on MIPI DSI clock register is bit 15 not bit 30.
--- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +1 -1
@@ -582,7 +582,7 @@ static const char * const dsi_dphy_parents[] = { "pll-video0", "pll-periph0" };static const u8 dsi_dphy_table[] = {0 ,2 , }; static SUNXI_CCU_M_WITH_MUX_TABLE_GATE(dsi_dphy_clk, "dsi-dphy", dsi_dphy_parents, dsi_dphy_table, - 0x168, 0, 4, 8, 2, BIT(31), CLK_SET_RATE_PARENT); + 0x168, 0, 4, 8, 2, BIT(15), CLK_SET_RATE_PARENT); static SUNXI_CCU_M_WITH_GATE(gpu_clk, "gpu", "pll-gpu", 0x1a0, 0, 3, BIT(31), CLK_SET_RATE_PARENT);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 40/243 ARM: dts: exynos: Fix LDO13 min values on Odroid XU3/XU4/HC1
In reply to Greg Kroah-HartmanFrom: Anand Moon <[email protected]>
[ Upstream commit 8fe325fa9d065aa54db4914fdaccab2169fd67a8 ]
Quoted 1 line
From Odroid XU3/XU4/HC1 schematics the LDO13 regulator for SD2, can be
set on 1.8V or 2.8V so the minimal value should be fixed to 1.8V. This is necessary to support UHS-I tuning (otherwise card won't be detected during boot).
--- arch/arm/boot/dts/exynos5422-odroid-core.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/exynos5422-odroid-core.dtsi +1 -1
@@ -224,7 +224,7 @@ ldo13_reg: LDO13 { regulator-name = "vddq_mmc2"; - regulator-min-microvolt = <2800000>; + regulator-min-microvolt = <1800000>; regulator-max-microvolt = <2800000>; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 41/243 extcon: max8997: Fix lack of path setting in USB device mode
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
[ Upstream commit a2dc50914744eea9f83a70a5db0486be625e5dc0 ]
MAX8997 driver disables automatic path selection from MicroUSB connector and manually sets path to either UART or USB lines. However the code for setting USB path worked only for USB host mode (when ID pin is set to ground). When standard USB cable (USB device mode) is connected, path registers are not touched. This means that once the non-USB accessory is connected to MAX8997-operated micro USB port, the path is no longer set to USB and USB device mode doesn't work. This patch fixes it by setting USB path both for USB and USB host modes.
--- drivers/extcon/extcon-max8997.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/extcon/extcon-max8997.c +4 -6
@@ -321,12 +321,10 @@ static int max8997_muic_handle_usb(struct max8997_muic_info *info, {int ret =0 ; -if (usb_type ==MAX8997_USB_HOST ) { - ret =max8997_muic_set_path (info, info->path_usb, attached); -if (ret <0 ) { -dev_err (info->dev,"failed to update muic register\n" ); -return ret; - } + ret =max8997_muic_set_path (info, info->path_usb, attached); +if (ret <0 ) { +dev_err (info->dev,"failed to update muic register\n" ); +return ret; }switch (usb_type) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 43/243 rtc: s3c-rtc: Avoid using broken ALMYEAR register
In reply to Greg Kroah-HartmanFrom: Marek Szyprowski <[email protected]>
[ Upstream commit 50c8aec4212a966817e868056efc9bfbb73337c0 ]
(RTC,ALM)YEAR registers of Exynos built-in RTC device contains 3 BCD characters. s3c-rtc driver uses only 2 lower of them and supports years from 2000..2099 range. The third BCD value is typically set to 0, but it looks that handling of it is broken in the hardware. It sometimes defaults to a random (even non-BCD) value. This is not an issue for handling RTCYEAR register, because bcd2bin() properly handles only 8bit values (2 BCD characters, the third one is skipped). The problem is however with ALMYEAR register and proper RTC alarm operation. When YEAREN bit is set for the configured alarm, RTC hardware triggers alarm only when ALMYEAR and RTCYEAR matches. This usually doesn't happen because of the random noise on the third BCD character.
Fix this by simply skipping setting ALMYEAR register in alarm configuration. This workaround fixes broken alarm operation on Exynos built-in rtc device. My tests revealed that the issue happens on the following Exynos series: 3250, 4210, 4412, 5250 and 5410.
--- drivers/rtc/rtc-s3c.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/rtc/rtc-s3c.c +0 -6
@@ -327,7 +327,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)struct rtc_time *tm = &alrm->time;unsigned int alrm_en;int ret; -int year = tm->tm_year -100 ; dev_dbg(dev, "s3c_rtc_setalarm: %d, %04d.%02d.%02d %02d:%02d:%02d\n", alrm->enabled,
@@ -356,11 +355,6 @@ static int s3c_rtc_setalarm(struct device *dev, struct rtc_wkalrm *alrm)writeb (bin2bcd (tm->tm_hour), info->base +S3C2410_ALMHOUR ); } -if (year <100 && year >=0 ) { - alrm_en |=S3C2410_RTCALM_YEAREN ; -writeb (bin2bcd (year), info->base +S3C2410_ALMYEAR ); - } -if (tm->tm_mon <12 && tm->tm_mon >=0 ) { alrm_en |=S3C2410_RTCALM_MONEN ;writeb (bin2bcd (tm->tm_mon +1 ), info->base +S3C2410_ALMMON );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 44/243 rtc: max77686: Fix the returned value in case of error in max77686_rtc_read_time()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit b28cc6cec3d814f5184cbebb2d1f987e769f534a ]
In case of error, we return 0.
This is spurious and not consistent with the other functions of the driver. Commit e115a2bf1426 has modified more than what is said in the commit message. Reverse part of it znd return an error when needed, as it was previously.
--- drivers/rtc/rtc-max77686.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-max77686.c +1 -1
@@ -360,7 +360,7 @@ static int max77686_rtc_read_time(struct device *dev, struct rtc_time *tm) out:mutex_unlock (&info->lock); -return 0 ; +return ret; }static int max77686_rtc_set_time (struct device *dev,struct rtc_time *tm)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 45/243 i40e: dont restart nway if autoneg not supported
In reply to Greg Kroah-HartmanFrom: Mitch Williams <[email protected]>
[ Upstream commit 7c3758f7839377ab67529cc50264a640636c47af ]
On link types that do not support autoneg, we cannot attempt to restart nway negotiation. This results in a dead link that requires a power cycle to remedy.
Fix this by saving off the autoneg state and checking this value before we try to restart nway.
--- drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/intel/i40e/i40e_ethtool.c +5 -5
@@ -1136,6 +1136,7 @@ static int i40e_set_pauseparam(struct net_device *netdev,i40e_status status;u8 aq_failures;int err =0 ; +u32 is_an;/* Changing the port's flow control is not supported if this isn't the * port's controlling PF
@@ -1148,15 +1149,14 @@ static int i40e_set_pauseparam(struct net_device *netdev,if (vsi != pf->vsi[pf->lan_vsi])return -EOPNOTSUPP ; -if (pause->autoneg != ((hw_link_info->an_info &I40E_AQ_AN_COMPLETED ) ? -AUTONEG_ENABLE :AUTONEG_DISABLE )) { + is_an = hw_link_info->an_info &I40E_AQ_AN_COMPLETED ; +if (pause->autoneg != is_an) {netdev_info (netdev,"To change autoneg please use: ethtool -s <dev> autoneg <on|off>\n" );return -EOPNOTSUPP ; }/* If we have link and don't have autoneg */ -if (!test_bit (__I40E_DOWN, pf->state) && - !(hw_link_info->an_info &I40E_AQ_AN_COMPLETED )) { +if (!test_bit (__I40E_DOWN, pf->state) && !is_an) {/* Send message that it might not necessarily work*/ netdev_info (netdev,"Autoneg did not complete so changing settings may not result in an actual change.\n" ); }
@@ -1207,7 +1207,7 @@ static int i40e_set_pauseparam(struct net_device *netdev, err = -EAGAIN ; } -if (!test_bit (__I40E_DOWN, pf->state)) { +if (!test_bit (__I40E_DOWN, pf->state) && is_an) {/* Give it a little more time to try to come back */ msleep (75 );if (!test_bit (__I40E_DOWN, pf->state))
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 46/243 virtchnl: Fix off by one error
In reply to Greg Kroah-HartmanFrom: Alice Michael <[email protected]>
[ Upstream commit 843faff87af261bf55eda719a06087af0486a168 ]
When calculating the valid length for a VIRTCHNL_OP_ENABLE_CHANNELS message, we accidentally allowed messages with one extra virtchnl_channel_info structure on the end. This happened due to an off by one error, because we forgot that valid_len already accounted for one virtchnl_channel_info structure, so we need to subtract one from the num_tc value.
--- include/linux/avf/virtchnl.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/linux/avf/virtchnl.h +2 -2
@@ -798,8 +798,8 @@ virtchnl_vc_validate_vf_msg(struct virtchnl_version_info *ver, u32 v_opcode,if (msglen >= valid_len) {struct virtchnl_tc_info *vti = (struct virtchnl_tc_info *)msg; - valid_len += vti->num_tc * -sizeof (struct virtchnl_channel_info ); + valid_len += (vti->num_tc -1 ) * +sizeof (struct virtchnl_channel_info );if (vti->num_tc ==0 ) err_msg_format = true; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 29/243 iwlwifi: mvm: synchronize TID queue removal
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit 06bc6f6ed4ae0246a5e52094d1be90906a1361c7 ]
When we mark a TID as no longer having a queue, there's no guarantee the TX path isn't using this txq_id right now, having accessed it just before we reset the value. To fix this, add synchronize_net() when we change the TIDs from having a queue to not having one, so that we can then be sure that the TX path is no longer accessing that queue.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +10 -0
@@ -440,6 +440,16 @@ static int iwl_mvm_remove_sta_queue_marking(struct iwl_mvm *mvm, int queue)rcu_read_unlock (); +/* +* The TX path may have been using this TXQ_ID from the tid_data, +* so make sure it's no longer running so that we can safely reuse +* this TXQ later. We've set all the TIDs to IWL_MVM_INVALID_QUEUE +* above, but nothing guarantees we've stopped using them. Thus, +* without this, we could get to iwl_mvm_disable_txq() and remove +* the queue while still sending frames to it. +*/ +synchronize_net (); +return disable_agg_tids; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 47/243 clk: rockchip: fix rk3188 sclk_smc gate data
In reply to Greg Kroah-HartmanFrom: Finley Xiao <[email protected]>
[ Upstream commit a9f0c0e563717b9f63b3bb1c4a7c2df436a206d9 ]
Fix sclk_smc gate data.
Change variable order, flags come before the register address.
--- drivers/clk/rockchip/clk-rk3188.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/rockchip/clk-rk3188.c +2 -2
@@ -391,8 +391,8 @@ static struct rockchip_clk_branch common_clk_branches[] __initdata = {* Clock-Architecture Diagram 4 */ -GATE (SCLK_SMC ,"sclk_smc" ,"hclk_peri" , -RK2928_CLKGATE_CON (2 ),4 ,0 ,GFLAGS ), +GATE (SCLK_SMC ,"sclk_smc" ,"hclk_peri" ,0 , +RK2928_CLKGATE_CON (2 ),4 ,GFLAGS ), COMPOSITE_NOMUX(SCLK_SPI0, "sclk_spi0", "pclk_peri", 0, RK2928_CLKSEL_CON(25), 0, 7, DFLAGS,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 49/243 ARM: dts: rockchip: Fix rk3288-rock2 vcc_flash name
In reply to Greg Kroah-HartmanFrom: John Keeping <[email protected]>
[ Upstream commit 03d9f8fa2bfdc791865624d3adc29070cf67814e ]
There is no functional change from this, but it is confusing to find two copies of vcc_sys and no vcc_flash when looking in /sys/class/regulator/*/name.
--- arch/arm/boot/dts/rk3288-rock2-som.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/rk3288-rock2-som.dtsi +1 -1
@@ -25,7 +25,7 @@ vcc_flash: flash-regulator { compatible = "regulator-fixed"; - regulator-name = "vcc_sys"; + regulator-name = "vcc_flash"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; startup-delay-us = <150>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 50/243 dlm: fix missing idr_destroy for recover_idr
In reply to Greg Kroah-HartmanFrom: David Teigland <[email protected]>
[ Upstream commit 8fc6ed9a3508a0435b9270c313600799d210d319 ]
Which would leak memory for the idr internals.
--- fs/dlm/lockspace.c | 1 + 1 file changed, 1 insertion(+)
fs/dlm/lockspace.c +1 -0
@@ -807,6 +807,7 @@ static int release_lockspace(struct dlm_ls *ls, int force)dlm_delete_debug_file (ls); +idr_destroy (&ls->ls_recover_idr);kfree (ls->ls_recover_buf);/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 51/243 MIPS: SiByte: Enable ZONE_DMA32 for LittleSur
In reply to Greg Kroah-HartmanFrom: Maciej W. Rozycki <[email protected]>
[ Upstream commit 756d6d836dbfb04a5a486bc2ec89397aa4533737 ]
The LittleSur board is marked for high memory support and therefore clearly must provide a way to have enough memory installed for some to be present outside the low 4GiB physical address range. With the memory map of the BCM1250 SOC it has been built around it means over 1GiB of actual DRAM, as only the first 1GiB is mapped in the low 4GiB physical address range[1].
Complement commit cce335ae47e2 ("[MIPS] 64-bit Sibyte kernels need DMA32.") then and also enable ZONE_DMA32 for LittleSur.
[1] "BCM1250/BCM1125/BCM1125H User Manual", Revision 1250_1125-UM100-R, Broadcom Corporation, 21 Oct 2002, Section 3: "System Overview", "Memory Map", pp. 34-38
Patchwork: https://patchwork.linux-mips.org/patch/21107/
--- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
@@ -806,6 +806,7 @@ config SIBYTE_LITTLESUR select SYS_SUPPORTS_BIG_ENDIAN select SYS_SUPPORTS_HIGHMEM select SYS_SUPPORTS_LITTLE_ENDIAN + select ZONE_DMA32 if 64BIT config SIBYTE_SENTOSA bool "Sibyte BCM91250E-Sentosa"
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 52/243 net: dsa: mv88e6xxx: Work around mv886e6161 SERDES missing MII_PHYSID2
In reply to Greg Kroah-HartmanFrom: Andrew Lunn <[email protected]>
[ Upstream commit ddc49acb659a2d8bfc5fdb0de0ef197712c11d75 ]
We already have a workaround for a couple of switches whose internal PHYs only have the Marvel OUI, but no model number. We detect such PHYs and give them the 6390 ID as the model number. However the mv88e6161 has two SERDES interfaces in the same address range as its internal PHYs. These suffer from the same problem, the Marvell OUI, but no model number. As a result, these SERDES interfaces were getting the same PHY ID as the mv88e6390, even though they are not PHYs, and the Marvell PHY driver was trying to drive them.
Add a special case to stop this from happen.
--- drivers/net/dsa/mv88e6xxx/chip.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +16 -5
@@ -2645,11 +2645,22 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg)mutex_unlock (&chip->reg_lock);if (reg ==MII_PHYSID2 ) { -/* Some internal PHYS don't have a model number. Use -* the mv88e6390 family model number instead. -*/ -if (!(val &0x3f0 )) - val |=MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >>4 ; +/* Some internal PHYs don't have a model number. */ +if (chip->info->family !=MV88E6XXX_FAMILY_6165 ) +/* Then there is the 6165 family. It gets is +* PHYs correct. But it can also have two +* SERDES interfaces in the PHY address +* space. And these don't have a model +* number. But they are not PHYs, so we don't +* want to give them something a PHY driver +* will recognise. +* +* Use the mv88e6390 family model number +* instead, for anything which really could be +* a PHY, +*/ +if (!(val &0x3f0 )) + val |=MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >>4 ; }return err ? err : val;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 53/243 scsi: zfcp: update kernel message for invalid FCP_CMND length, its not the CDB
In reply to Greg Kroah-HartmanFrom: Steffen Maier <[email protected]>
[ Upstream commit 724e144387f4d7e7668d3da913d0efc44a9b4664 ]
The CDB is just a part inside of FCP_CMND, see zfcp_fc_scsi_to_fcp(). While at it, fix the device driver reaction: adapter not LUN shutdown.
--- drivers/s390/scsi/zfcp_fsf.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/s390/scsi/zfcp_fsf.c +2 -5
@@ -2104,11 +2104,8 @@ static void zfcp_fsf_fcp_handler_common(struct zfcp_fsf_req *req,break ;case FSF_CMND_LENGTH_NOT_VALID :dev_err (&req->adapter->ccw_device->dev, -"Incorrect CDB length %d, LUN 0x%016Lx on " -"port 0x%016Lx closed\n" , - req->qtcb->bottom.io.fcp_cmnd_length, - (unsigned long long )zfcp_scsi_dev_lun (sdev), - (unsigned long long )zfcp_sdev->port->wwpn); +"Incorrect FCP_CMND length %d, FCP device closed\n" , + req->qtcb->bottom.io.fcp_cmnd_length);zfcp_erp_adapter_shutdown (req->adapter,0 ,"fssfch4" ); req->status |=ZFCP_STATUS_FSFREQ_ERROR ;break ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 54/243 scsi: zfcp: drop default switch case which might paper over missing case
In reply to Greg Kroah-HartmanFrom: Steffen Maier <[email protected]>
[ Upstream commit 0c902936e55cff9335b27ed632fc45e7115ced75 ]
This was introduced with v4.18 commit 8c3d20aada70 ("scsi: zfcp: fix missing REC trigger trace for all objects in ERP_FAILED") but would now suppress helpful -Wswitch compiler warnings when building with W=1 such as the following forced example:
drivers/s390/scsi/zfcp_erp.c: In function 'zfcp_erp_handle_failed':drivers/s390/scsi/zfcp_erp.c:126:2: warning: enumeration value 'ZFCP_ERP_ACTION_REOPEN_PORT_FORCED' not handled in switch [-Wswitch]
switch (want) {
^~~~~~
But then again, only with W=1 we would notice unhandled enum cases. Without the default cases and a missed unhandled enum case, the code might perform unforeseen things we might not want...
As of today, we never run through the removed default case, so removing it is no functional change. In the future, we never should run through a default case but introduce the necessary specific case(s) to handle new functionality.
--- drivers/s390/scsi/zfcp_erp.c | 3 --- 1 file changed, 3 deletions(-)
drivers/s390/scsi/zfcp_erp.c +0 -3
@@ -172,9 +172,6 @@ static int zfcp_erp_handle_failed(int want, struct zfcp_adapter *adapter, adapter, ZFCP_STATUS_COMMON_ERP_FAILED); }break ; -default : - need =0 ; -break ; }return need;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 55/243 drivers: soc: Allow building the amlogic drivers without ARCH_MESON
In reply to Greg Kroah-HartmanFrom: Maxime Jourdan <[email protected]>
[ Upstream commit 41bb5769b7f4b7a85e4b92c37429228279b4f569 ]
The current condition makes it difficult to compile the amlogic/ drivers with COMPILE_TEST, or without ARCH_MESON in general.
Fixes kbuild errors with patch series that depend on drivers in that directory, for instance the meson video decoder.
--- drivers/soc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/Makefile +1 -1
@@ -13,7 +13,7 @@ obj-$(CONFIG_ARCH_GEMINI) += gemini/ obj-$(CONFIG_ARCH_MXC) += imx/ obj-$(CONFIG_SOC_XWAY) += lantiq/ obj-y += mediatek/ -obj-$(CONFIG_ARCH_MESON) += amlogic/ +obj-y += amlogic/ obj-y += qcom/ obj-y += renesas/ obj-$(CONFIG_ARCH_ROCKCHIP) += rockchip/
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 30/243 iwlwifi: trans: Clear persistence bit when starting the FW
In reply to Greg Kroah-HartmanFrom: Shahar S Matityahu <[email protected]>
[ Upstream commit 8954e1eb2270fa2effffd031b4839253952c76f2 ]
In D3 suspend flow in 9260 gen2 HW, the NIC receives two PERST signals. The first PERST is expected and indicates the device on coming resume flow. The second PERST causes FW restart FW restart.
In order to avoid this issue, the FW set the persistence bit on. Once this bit is set, the FW ignores reset attempts.
The problem is when the FW gets assert during D3 and then the persistence bit is set and causes the FW to ignore reset.
To handle this issue, the FW opens the preg bit which allows access to the persistence bit, so that the driver clear the persistence bit and reset the NIC.
The flow is as follows:
the driver checks if the persistence bit is set.
If the bit is set, the driver checks if he can clear the bit. If the driver can not clear the bit then there is no point to continue configuring the NIC since it will fail.
The fix was added is in start HW flow instead of the resume flow since in general, if the persistence bit is set, the driver can not start the FW. So it is good to check it when we start configuring the NIC.
The driver does not need to close the preg bit since the FW close it during the start flow.
--- drivers/net/wireless/intel/iwlwifi/iwl-prph.h | 7 +++++++ drivers/net/wireless/intel/iwlwifi/pcie/trans.c | 12 ++++++++++++ 2 files changed, 19 insertions(+)
drivers/net/wireless/intel/iwlwifi/iwl-prph.h +7 -0
@@ -8,6 +8,7 @@* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH * Copyright(c) 2016 Intel Deutschland GmbH +* Copyright (C) 2018 Intel Corporation * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as
@@ -35,6 +36,7 @@* Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH * Copyright(c) 2016 Intel Deutschland GmbH +* Copyright (C) 2018 Intel Corporation * All rights reserved. * * Redistribution and use in source and binary forms, with or without
@@ -399,6 +401,7 @@ enum aux_misc_master1_en {#define AUX_MISC_MASTER1_SMPHR_STATUS 0xA20800#define RSA_ENABLE 0xA24B08#define PREG_AUX_BUS_WPROT_0 0xA04CC0 +#define PREG_PRPH_WPROT_0 0xA04CE0#define SB_CPU_1_STATUS 0xA01E30#define SB_CPU_2_STATUS 0xA01E34#define UMAG_SB_CPU_1_STATUS 0xA038C0
@@ -425,4 +428,8 @@ enum {#define UREG_CHICK (0xA05C00)#define UREG_CHICK_MSI_ENABLE BIT(24)#define UREG_CHICK_MSIX_ENABLE BIT(25) + +#define HPM_DEBUG 0xA03440 +#define PERSISTENCE_BIT BIT(12) +#define PREG_WFPM_ACCESS BIT(12)#endif /* __iwl_prph_h__ */
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +12 -0
@@ -1747,6 +1747,7 @@ static int iwl_pcie_init_msix_handler(struct pci_dev *pdev,static int _iwl_trans_pcie_start_hw (struct iwl_trans *trans,bool low_power) {struct iwl_trans_pcie *trans_pcie =IWL_TRANS_GET_PCIE_TRANS (trans); +u32 hpm;int err;lockdep_assert_held (&trans_pcie->mutex);
@@ -1757,6 +1758,17 @@ static int _iwl_trans_pcie_start_hw(struct iwl_trans *trans, bool low_power)return err; } + hpm =iwl_trans_read_prph (trans,HPM_DEBUG ); +if (hpm !=0xa5a5a5a0 && (hpm &PERSISTENCE_BIT )) { +if (iwl_trans_read_prph (trans,PREG_PRPH_WPROT_0 ) & +PREG_WFPM_ACCESS ) { +IWL_ERR (trans, +"Error, can not clear persistence bit\n" ); +return -EPERM ; + } +iwl_trans_write_prph (trans,HPM_DEBUG , hpm & ~PERSISTENCE_BIT ); + } +iwl_trans_pcie_sw_reset (trans); err =iwl_pcie_apm_init (trans);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 56/243 bus: ti-sysc: Fix getting optional clocks in clock_roles
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 7b4f8ac2f1acdff3c0cce23d8c3b86434a6e768a ]
We can have holes in clock_roles with interface clock missing for example. Currently getting an optional clock will fail if there are only a functional clock and an optional clock.
--- drivers/bus/ti-sysc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +7 -2
@@ -217,8 +217,13 @@ static int sysc_get_clocks(struct sysc *ddata)if (!ddata->clocks)return -ENOMEM ; -for (i =0 ; i < ddata->nr_clocks; i++) { - error =sysc_get_one_clock (ddata, ddata->clock_roles[i]); +for (i =0 ; i <SYSC_MAX_CLOCKS ; i++) { +const char *name = ddata->clock_roles[i]; + +if (!name) +continue ; + + error =sysc_get_one_clock (ddata, name);if (error && error != -ENOENT )return error; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 58/243 crypto: ecc - check for invalid values in the key verification test
In reply to Greg Kroah-HartmanFrom: Vitaly Chikunov <[email protected]>
[ Upstream commit 2eb4942b6609d35a4e835644a33203b0aef7443d ]
Currently used scalar multiplication algorithm (Matthieu Rivain, 2011) have invalid values for scalar == 1, n-1, and for regularized version n-2, which was previously not checked. Verify that they are not used as private keys.
--- crypto/ecc.c | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-)
crypto/ecc.c +26 -16
@@ -912,30 +912,43 @@ static inline void ecc_swap_digits(const u64 *in, u64 *out, out[i] =__swab64 (in[ndigits -1 - i]); } -int ecc_is_key_valid (unsigned int curve_id,unsigned int ndigits, -const u64 *private_key,unsigned int private_key_len) +static int __ecc_is_key_valid (const struct ecc_curve *curve, +const u64 *private_key,unsigned int ndigits) { -int nbytes; -const struct ecc_curve *curve =ecc_get_curve (curve_id); +u64 one[ECC_MAX_DIGITS ] = {1 , }; +u64 res[ECC_MAX_DIGITS ];if (!private_key)return -EINVAL ; - nbytes = ndigits <<ECC_DIGITS_TO_BYTES_SHIFT ; - -if (private_key_len != nbytes) +if (curve->g.ndigits != ndigits)return -EINVAL ; -if (vli_is_zero (private_key, ndigits)) +/* Make sure the private key is in the range [2, n-3]. */ +if (vli_cmp (one, private_key, ndigits) !=-1 )return -EINVAL ; - -/* Make sure the private key is in the range [1, n-1]. */ -if (vli_cmp (curve->n, private_key, ndigits) !=1 ) +vli_sub (res, curve->n, one, ndigits); +vli_sub (res, res, one, ndigits); +if (vli_cmp (res, private_key, ndigits) !=1 )return -EINVAL ;return 0 ; } +int ecc_is_key_valid (unsigned int curve_id,unsigned int ndigits, +const u64 *private_key,unsigned int private_key_len) +{ +int nbytes; +const struct ecc_curve *curve =ecc_get_curve (curve_id); + + nbytes = ndigits <<ECC_DIGITS_TO_BYTES_SHIFT ; + +if (private_key_len != nbytes) +return -EINVAL ; + +return __ecc_is_key_valid (curve, private_key, ndigits); +} +/* * ECC private keys are generated using the method of extra random bits, * equivalent to that described in FIPS 186-4, Appendix B.4.1.
@@ -979,11 +992,8 @@ int ecc_gen_privkey(unsigned int curve_id, unsigned int ndigits, u64 *privkey)if (err)return err; -if (vli_is_zero (priv, ndigits)) -return -EINVAL ; - -/* Make sure the private key is in the range [1, n-1]. */ -if (vli_cmp (curve->n, priv, ndigits) !=1 ) +/* Make sure the private key is in the valid range. */ +if (__ecc_is_key_valid (curve, priv, ndigits))return -EINVAL ;ecc_swap_digits (priv, privkey, ndigits);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 59/243 crypto: bcm - fix normal/non key hash algorithm failure
In reply to Greg Kroah-HartmanFrom: Raveendra Padasalagi <[email protected]>
[ Upstream commit 4f0129d13e69bad0363fd75553fb22897b32c379 ]
Remove setkey() callback handler for normal/non key hash algorithms and keep it for AES-CBC/CMAC which needs key.
--- drivers/crypto/bcm/cipher.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/crypto/bcm/cipher.c +5 -1
@@ -4634,12 +4634,16 @@ static int spu_register_ahash(struct iproc_alg_s *driver_alg) hash->halg.statesize =sizeof (struct spu_hash_export_s );if (driver_alg->auth_info.mode !=HASH_MODE_HMAC ) { - hash->setkey = ahash_setkey; hash->init = ahash_init; hash->update = ahash_update; hash->final = ahash_final; hash->finup = ahash_finup; hash->digest = ahash_digest; +if ((driver_alg->auth_info.alg ==HASH_ALG_AES ) && + ((driver_alg->auth_info.mode ==HASH_MODE_XCBC ) || + (driver_alg->auth_info.mode ==HASH_MODE_CMAC ))) { + hash->setkey = ahash_setkey; + } }else { hash->setkey = ahash_hmac_setkey; hash->init = ahash_hmac_init;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 60/243 arm64: dts: zynqmp: Fix node names which contain "_"
In reply to Greg Kroah-HartmanFrom: Michal Simek <[email protected]>
[ Upstream commit d1d4445abffb2b17e841d37b555b6f1364b571c1 ]
s/_/-/ for node names.
It fixes warnings like this:
... Warning (node_name_chars_strict): /cpu_opp_table:
Character '_' not recommended in node name ...
Issues reported by make dtbs W=12
--- arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi | 4 ++-- arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts | 4 ++-- arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts | 10 +++++----- arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts | 2 +- arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts | 2 +- arch/arm64/boot/dts/xilinx/zynqmp.dtsi | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-)
arch/arm64/boot/dts/xilinx/zynqmp-clk.dtsi +2 -2
@@ -58,13 +58,13 @@ clock-accuracy = <100>; }; - dpdma_clk: dpdma_clk { + dpdma_clk: dpdma-clk { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <533000000>; }; - drm_clock: drm_clock { + drm_clock: drm-clock { compatible = "fixed-clock"; #clock-cells = <0x0>; clock-frequency = <262750000>;
arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dts +2 -2
@@ -82,7 +82,7 @@ linux,default-trigger = "bluetooth-power"; }; - vbus_det { /* U5 USB5744 VBUS detection via MIO25 */ + vbus-det { /* U5 USB5744 VBUS detection via MIO25 */ label = "vbus_det"; gpios = <&gpio 25 GPIO_ACTIVE_HIGH>; default-state = "on";
@@ -98,7 +98,7 @@ regulator-boot-on; }; - sdio_pwrseq: sdio_pwrseq { + sdio_pwrseq: sdio-pwrseq { compatible = "mmc-pwrseq-simple"; reset-gpios = <&gpio 7 GPIO_ACTIVE_LOW>; /* WIFI_EN */ post-power-on-delay-ms = <10>;
arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dts +5 -5
@@ -53,7 +53,7 @@ leds { compatible = "gpio-leds"; - heartbeat_led { + heartbeat-led { label = "heartbeat"; gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat";
@@ -139,25 +139,25 @@ * 7, 10 - 17 - not connected */ - gtr_sel0 { + gtr-sel0 { gpio-hog; gpios = <0 0>; output-low; /* PCIE = 0, DP = 1 */ line-name = "sel0"; }; - gtr_sel1 { + gtr-sel1 { gpio-hog; gpios = <1 0>; output-high; /* PCIE = 0, DP = 1 */ line-name = "sel1"; }; - gtr_sel2 { + gtr-sel2 { gpio-hog; gpios = <2 0>; output-high; /* PCIE = 0, USB0 = 1 */ line-name = "sel2"; }; - gtr_sel3 { + gtr-sel3 { gpio-hog; gpios = <3 0>; output-high; /* PCIE = 0, SATA = 1 */
arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dts +1 -1
@@ -53,7 +53,7 @@ leds { compatible = "gpio-leds"; - heartbeat_led { + heartbeat-led { label = "heartbeat"; gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat";
arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dts +1 -1
@@ -53,7 +53,7 @@ leds { compatible = "gpio-leds"; - heartbeat_led { + heartbeat-led { label = "heartbeat"; gpios = <&gpio 23 GPIO_ACTIVE_HIGH>; linux,default-trigger = "heartbeat";
arch/arm64/boot/dts/xilinx/zynqmp.dtsi +2 -2
@@ -71,7 +71,7 @@ }; }; - cpu_opp_table: cpu_opp_table { + cpu_opp_table: cpu-opp-table { compatible = "operating-points-v2"; opp-shared; opp00 {
@@ -124,7 +124,7 @@ <1 10 0xf08>; }; - amba_apu: amba_apu@0 { + amba_apu: amba-apu@0 { compatible = "simple-bus"; #address-cells = <2>; #size-cells = <1>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 61/243 pinctrl: qcom: ssbi-gpio: fix gpio-hog related boot issues
In reply to Greg Kroah-HartmanFrom: Brian Masney <[email protected]>
[ Upstream commit 7ed07855773814337b9814f1c3e866df52ebce68 ]
When attempting to setup up a gpio hog, device probing will repeatedly fail with -EPROBE_DEFERED errors. It is caused by a circular dependency between the gpio and pinctrl frameworks. If the gpio-ranges property is present in device tree, then the gpio framework will handle the gpio pin registration and eliminate the circular dependency.
See Christian Lamparter's commit a86caa9ba5d7 ("pinctrl: msm: fix gpio-hog related boot issues") for a detailed commit message that explains the issue in much more detail. The code comment in this commit came from Christian's commit.
I did not test this change against any hardware supported by this particular driver, however I was able to validate this same fix works for pinctrl-spmi-gpio.c using a LG Nexus 5 (hammerhead) phone.
--- drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-)
drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +17 -6
@@ -762,12 +762,23 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)return ret; } - ret =gpiochip_add_pin_range (&pctrl->chip, -dev_name (pctrl->dev), -0 ,0 , pctrl->chip.ngpio); -if (ret) { -dev_err (pctrl->dev,"failed to add pin range\n" ); - goto unregister_gpiochip; +/* +* For DeviceTree-supported systems, the gpio core checks the +* pinctrl's device node for the "gpio-ranges" property. +* If it is present, it takes care of adding the pin ranges +* for the driver. In this case the driver can skip ahead. +* +* In order to remain compatible with older, existing DeviceTree +* files which don't set the "gpio-ranges" property or systems that +* utilize ACPI the driver has to call gpiochip_add_pin_range(). +*/ +if (!of_property_read_bool (pctrl->dev->of_node,"gpio-ranges" )) { + ret =gpiochip_add_pin_range (&pctrl->chip,dev_name (pctrl->dev), +0 ,0 , pctrl->chip.ngpio); +if (ret) { +dev_err (pctrl->dev,"failed to add pin range\n" ); + goto unregister_gpiochip; + } }platform_set_drvdata (pdev, pctrl);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 64/243 mm/vmstat.c: fix NUMA statistics updates
In reply to Greg Kroah-HartmanFrom: Janne Huttunen <[email protected]>
[ Upstream commit 13c9aaf7fa01cc7600c61981609feadeef3354ec ]
Scan through the whole array to see if an update is needed. While we're at it, use sizeof() to be safe against any possible type changes in the future.
The bug here is that we wouldn't sync per-cpu counters into global ones if there was an update of numa_stats for higher cpus. Highly theoretical one though because it is much more probable that zone_stats are updated so we would refresh anyway. So I wouldn't bother to mark this for stable, yet something nice to fix.
--- mm/vmstat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
mm/vmstat.c +4 -3
@@ -1826,12 +1826,13 @@ static bool need_update(int cpu)/* * The fast way of checking if there are any vmstat diffs. -* This works because the diffs are byte sized items. */ -if (memchr_inv (p->vm_stat_diff,0 ,NR_VM_ZONE_STAT_ITEMS )) +if (memchr_inv (p->vm_stat_diff,0 ,NR_VM_ZONE_STAT_ITEMS * +sizeof (p->vm_stat_diff[0 ])))return true;#ifdef CONFIG_NUMA -if (memchr_inv (p->vm_numa_stat_diff,0 ,NR_VM_NUMA_STAT_ITEMS )) +if (memchr_inv (p->vm_numa_stat_diff,0 ,NR_VM_NUMA_STAT_ITEMS * +sizeof (p->vm_numa_stat_diff[0 ])))return true;#endif }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 66/243 clk: rockchip: fix ID of 8ch clock of I2S1 for rk3328
In reply to Greg Kroah-HartmanFrom: Katsuhiro Suzuki <[email protected]>
[ Upstream commit df7b1f2e0a4ae0fceff261e29cde63dafcf2360f ]
This patch fixes mistakes in HCLK_I2S1_8CH for running I2S1 successfully.
--- include/dt-bindings/clock/rk3328-cru.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/dt-bindings/clock/rk3328-cru.h +1 -1
@@ -178,7 +178,7 @@#define HCLK_TSP 309#define HCLK_GMAC 310#define HCLK_I2S0_8CH 311 -#define HCLK_I2S1_8CH 313 +#define HCLK_I2S1_8CH 312#define HCLK_I2S2_2CH 313#define HCLK_SPDIF_8CH 314#define HCLK_VOP 315
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 65/243 clk: rockchip: fix I2S1 clock gate register for rk3328
In reply to Greg Kroah-HartmanFrom: Katsuhiro Suzuki <[email protected]>
[ Upstream commit 5c73ac2f8b70834a603eb2d92eb0bb464634420b ]
This patch fixes definition of I2S1 clock gate register for rk3328. Current setting is not related I2S clocks.
- bit6 of CRU_CLKGATE_CON0 means clk_ddrmon_en
- bit6 of CRU_CLKGATE_CON1 means clk_i2s1_en
--- drivers/clk/rockchip/clk-rk3328.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/rockchip/clk-rk3328.c +1 -1
@@ -392,7 +392,7 @@ static struct rockchip_clk_branch rk3328_clk_branches[] __initdata = { RK3328_CLKGATE_CON(1), 5, GFLAGS, &rk3328_i2s1_fracmux),GATE (SCLK_I2S1 ,"clk_i2s1" ,"i2s1_pre" ,CLK_SET_RATE_PARENT , -RK3328_CLKGATE_CON (0 ),6 ,GFLAGS ), +RK3328_CLKGATE_CON (1 ),6 ,GFLAGS ),COMPOSITE_NODIV (SCLK_I2S1_OUT ,"i2s1_out" , mux_i2s1out_p,0 ,RK3328_CLKSEL_CON (8 ),12 ,1 ,MFLAGS , RK3328_CLKGATE_CON(1), 7, GFLAGS),
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 33/243 audit: Embed key into chunk
In reply to Greg Kroah-HartmanFrom: Jan Kara <[email protected]>
[ Upstream commit 8d20d6e9301d7b3777d66d47dd5b89acd645cd39 ]
Currently chunk hash key (which is in fact pointer to the inode) is derived as chunk->mark.conn->obj. It is tricky to make this dereference reliable for hash table lookups only under RCU as mark can get detached from the connector and connector gets freed independently of the running lookup. Thus there is a possible use after free / NULL ptr dereference issue:
CPU1 CPU2
untag_chunk()
...
audit_tree_lookup()
list_for_each_entry_rcu(p, list, hash) {
list_del_rcu(&chunk->hash);
fsnotify_destroy_mark(entry);
fsnotify_put_mark(entry)
chunk_to_key(p)
if (!chunk->mark.connector)
...
hlist_del_init_rcu(&mark->obj_list);
if (hlist_empty(&conn->list)) {
inode = fsnotify_detach_connector_from_object(conn);
mark->connector = NULL;
...
frees connector from workqueue
chunk->mark.connector->objThis race is probably impossible to hit in practice as the race window on CPU1 is very narrow and CPU2 has a lot of code to execute. Still it's better to have this fixed. Since the inode the chunk is attached to is constant during chunk's lifetime it is easy to cache the key in the chunk itself and thus avoid these issues.
--- kernel/audit_tree.c | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
kernel/audit_tree.c +8 -19
@@ -24,6 +24,7 @@ struct audit_tree {struct audit_chunk {struct list_head hash; +unsigned long key;struct fsnotify_mark mark;struct list_head trees;/* with root here */ int dead;
@@ -172,21 +173,6 @@ static unsigned long inode_to_key(const struct inode *inode)return (unsigned long )&inode->i_fsnotify_marks; } -/* -* Function to return search key in our hash from chunk. Key 0 is special and -* should never be present in the hash. -*/ -static unsigned long chunk_to_key (struct audit_chunk *chunk) -{ -/* -* We have a reference to the mark so it should be attached to a -* connector. -*/ -if (WARN_ON_ONCE (!chunk->mark.connector)) -return 0 ; -return (unsigned long )chunk->mark.connector->obj; -} -static inline struct list_head *chunk_hash (unsigned long key) {unsigned long n = key /L1_CACHE_BYTES ;
@@ -196,12 +182,12 @@ static inline struct list_head *chunk_hash(unsigned long key)/* hash_lock & entry->lock is held by caller */ static void insert_hash (struct audit_chunk *chunk) { -unsigned long key =chunk_to_key (chunk);struct list_head *list;if (!(chunk->mark.flags &FSNOTIFY_MARK_FLAG_ATTACHED ))return ; - list =chunk_hash (key); +WARN_ON_ONCE (!chunk->key); + list =chunk_hash (chunk->key);list_add_rcu (&chunk->hash, list); }
@@ -213,7 +199,7 @@ struct audit_chunk *audit_tree_lookup(const struct inode *inode)struct audit_chunk *p;list_for_each_entry_rcu (p, list, hash) { -if (chunk_to_key (p) == key) { +if (p->key == key) {atomic_long_inc (&p->refs);return p; }
@@ -297,6 +283,7 @@ static void untag_chunk(struct node *p) chunk->dead =1 ;spin_lock (&hash_lock); + new->key = chunk->key;list_replace_init (&chunk->trees, &new->trees);if (owner->root == chunk) {list_del_init (&owner->same_root);
@@ -378,6 +365,7 @@ static int create_chunk(struct inode *inode, struct audit_tree *tree) tree->root = chunk;list_add (&tree->same_root, &chunk->trees); } + chunk->key =inode_to_key (inode);insert_hash (chunk);spin_unlock (&hash_lock);spin_unlock (&entry->lock);
@@ -462,6 +450,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)fsnotify_put_mark (old_entry);return 0 ; } + chunk->key = old->key;list_replace_init (&old->trees, &chunk->trees);for (n =0 , p = chunk->owners; n < old->count; n++, p++) {struct audit_tree *s = old->owners[n].owner;
@@ -661,7 +650,7 @@ void audit_trim_trees(void)/* this could be NULL if the watch is dying else where... */ node->index |=1U <<31 ;if (iterate_mounts (compare_root, - (void *)chunk_to_key (chunk), + (void *)(chunk->key), root_mnt)) node->index &= ~(1U <<31 ); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 34/243 netfilter: nf_tables: dont use position attribute on rule replacement
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
[ Upstream commit 447750f281abef547be44fdcfe3bc4447b3115a8 ]
Its possible to set both HANDLE and POSITION when replacing a rule. In this case, the rule at POSITION gets replaced using the userspace-provided handle. Rule handles are supposed to be generated by the kernel only.
Duplicate handles should be harmless, however better disable this "feature" by only checking for the POSITION attribute on insert operations.
--- net/netfilter/nf_tables_api.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-)
net/netfilter/nf_tables_api.c +7 -10
@@ -2610,17 +2610,14 @@ static int nf_tables_newrule(struct net *net, struct sock *nlsk,if (chain->use ==UINT_MAX )return -EOVERFLOW ; - } - -if (nla[NFTA_RULE_POSITION ]) { -if (!(nlh->nlmsg_flags &NLM_F_CREATE )) -return -EOPNOTSUPP ; - pos_handle =be64_to_cpu (nla_get_be64 (nla[NFTA_RULE_POSITION ])); - old_rule =__nft_rule_lookup (chain, pos_handle); -if (IS_ERR (old_rule)) { -NL_SET_BAD_ATTR (extack, nla[NFTA_RULE_POSITION ]); -return PTR_ERR (old_rule); +if (nla[NFTA_RULE_POSITION ]) { + pos_handle =be64_to_cpu (nla_get_be64 (nla[NFTA_RULE_POSITION ])); + old_rule =__nft_rule_lookup (chain, pos_handle); +if (IS_ERR (old_rule)) { +NL_SET_BAD_ATTR (extack, nla[NFTA_RULE_POSITION ]); +return PTR_ERR (old_rule); + } } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 32/243 ARM: 8813/1: Make aligned 2-byte getuser()/putuser() atomic on ARMv6+
In reply to Greg Kroah-HartmanFrom: Vincent Whitchurch <[email protected]>
[ Upstream commit 344eb5539abf3e0b6ce22568c03e86450073e097 ]
getuser() and putuser() (and there underscored variants) use two strb[t]/ldrb[t] instructions when they are asked to get/put 16-bits. This means that the read/write is not atomic even when performed to a 16-bit-aligned address.
This leads to problems with vhost: vhost uses __getuser() to read the vring's 16-bit avail.index field, and if it happens to observe a partial update of the index, wrong descriptors will be used which will lead to a breakdown of the virtio communication. A similar problem exists for __putuser() which is used to write to the vring's used.index field.
The reason these functions use strb[t]/ldrb[t] is because strht/ldrht instructions did not exist until ARMv6T2/ARMv7. So we should be easily able to fix this on ARMv7. Also, since all ARMv6 processors also don't actually use the unprivileged instructions anymore for uaccess (since CONFIG_CPU_USE_DOMAINS is not used) we can easily fix them too.
--- arch/arm/include/asm/uaccess.h | 18 ++++++++++++++++++ arch/arm/lib/getuser.S | 11 +++++++++++ arch/arm/lib/putuser.S | 20 ++++++++++---------- 3 files changed, 39 insertions(+), 10 deletions(-)
arch/arm/include/asm/uaccess.h +18 -0
@@ -349,6 +349,13 @@ do { \#define __get_user_asm_byte (x, addr, err) \ __get_user_asm(x, addr, err, ldrb) +#if __LINUX_ARM_ARCH__ >=6 + +#define __get_user_asm_half (x, addr, err) \ + __get_user_asm(x, addr, err, ldrh) + +#else +#ifndef __ARMEB__#define __get_user_asm_half (x, __gu_addr, err) \ ({ \
@@ -367,6 +374,8 @@ do { \ })#endif +#endif /* __LINUX_ARM_ARCH__ >= 6 */ +#define __get_user_asm_word (x, addr, err) \ __get_user_asm(x, addr, err, ldr)#endif
@@ -442,6 +451,13 @@ do { \#define __put_user_asm_byte (x, __pu_addr, err) \ __put_user_asm(x, __pu_addr, err, strb) +#if __LINUX_ARM_ARCH__ >=6 + +#define __put_user_asm_half (x, __pu_addr, err) \ + __put_user_asm(x, __pu_addr, err, strh) + +#else +#ifndef __ARMEB__#define __put_user_asm_half (x, __pu_addr, err) \ ({ \
@@ -458,6 +474,8 @@ do { \ })#endif +#endif /* __LINUX_ARM_ARCH__ >= 6 */ +#define __put_user_asm_word (x, __pu_addr, err) \ __put_user_asm(x, __pu_addr, err, str)
arch/arm/lib/getuser.S +11 -0
@@ -42,6 +42,12 @@ _ASM_NOKPROBE(__get_user_1) ENTRY(__get_user_2) check_uaccess r0, 2, r1, r2, __get_user_bad +#if __LINUX_ARM_ARCH__ >= 6 + +2: TUSER(ldrh) r2, [r0] + +#else + #ifdef CONFIG_CPU_USE_DOMAINS rb .req ip 2: ldrbt r2, [r0], #1
@@ -56,6 +62,9 @@ rb .req r0 #else orr r2, rb, r2, lsl #8 #endif + +#endif /* __LINUX_ARM_ARCH__ >= 6 */ + mov r0, #0 ret lr ENDPROC(__get_user_2)
@@ -145,7 +154,9 @@ _ASM_NOKPROBE(__get_user_bad8) .pushsection __ex_table, "a" .long 1b, __get_user_bad .long 2b, __get_user_bad +#if __LINUX_ARM_ARCH__ < 6 .long 3b, __get_user_bad +#endif .long 4b, __get_user_bad .long 5b, __get_user_bad8 .long 6b, __get_user_bad8
arch/arm/lib/putuser.S +10 -10
@@ -41,16 +41,13 @@ ENDPROC(__put_user_1) ENTRY(__put_user_2) check_uaccess r0, 2, r1, ip, __put_user_bad - mov ip, r2, lsr #8 -#ifdef CONFIG_THUMB2_KERNEL -#ifndef __ARMEB__ -2: TUSER(strb) r2, [r0] -3: TUSER(strb) ip, [r0, #1] +#if __LINUX_ARM_ARCH__ >= 6 + +2: TUSER(strh) r2, [r0] + #else -2: TUSER(strb) ip, [r0] -3: TUSER(strb) r2, [r0, #1] -#endif -#else /* !CONFIG_THUMB2_KERNEL */ + + mov ip, r2, lsr #8 #ifndef __ARMEB__ 2: TUSER(strb) r2, [r0], #1 3: TUSER(strb) ip, [r0]
@@ -58,7 +55,8 @@ ENTRY(__put_user_2) 2: TUSER(strb) ip, [r0], #1 3: TUSER(strb) r2, [r0] #endif -#endif /* CONFIG_THUMB2_KERNEL */ + +#endif /* __LINUX_ARM_ARCH__ >= 6 */ mov r0, #0 ret lr ENDPROC(__put_user_2)
@@ -91,7 +89,9 @@ ENDPROC(__put_user_bad) .pushsection __ex_table, "a" .long 1b, __put_user_bad .long 2b, __put_user_bad +#if __LINUX_ARM_ARCH__ < 6 .long 3b, __put_user_bad +#endif .long 4b, __put_user_bad .long 5b, __put_user_bad .long 6b, __put_user_bad
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 36/243 net/mlx5: Release resource on error flow
In reply to Greg Kroah-HartmanFrom: Moni Shoua <[email protected]>
[ Upstream commit 698114968a22f6c0c9f42e983ba033cc36bb7217 ]
Fix reference counting leakage when the event handler aborts due to an unsupported event for the resource type.
--- drivers/net/ethernet/mellanox/mlx5/core/qp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/qp.c +2 -2
@@ -132,7 +132,7 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type)if (!is_event_type_allowed ((rsn >>MLX5_USER_INDEX_LEN ), event_type)) {mlx5_core_warn (dev,"event 0x%.2x is not allowed on resource 0x%.8x\n" , event_type, rsn); -return ; + goto out; }switch (common->res) {
@@ -150,7 +150,7 @@ void mlx5_rsc_event(struct mlx5_core_dev *dev, u32 rsn, int event_type)default :mlx5_core_warn (dev,"invalid resource type for 0x%x\n" , rsn); } - +out:mlx5_core_put_rsc (common); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 68/243 regulator: Fix return value of _set_load() stub
In reply to Greg Kroah-HartmanFrom: Mark Brown <[email protected]>
[ Upstream commit f1abf67217de91f5cd3c757ae857632ca565099a ]
The stub implementation of _set_load() returns a mode value which is within the bounds of valid return codes for success (the documentation just says that failures are negative error codes) but not sensible or what the actual implementation does. Fix it to just return 0.
--- include/linux/regulator/consumer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/regulator/consumer.h +1 -1
@@ -508,7 +508,7 @@ static inline int regulator_get_error_flags(struct regulator *regulator,static inline int regulator_set_load (struct regulator *regulator,int load_uA) { -return REGULATOR_MODE_NORMAL ; +return 0 ; } static inline int regulator_allow_bypass(struct regulator *regulator,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 77/243 iomap: dio data corruption and spurious errors when pipes fill
In reply to Greg Kroah-HartmanFrom: Dave Chinner <[email protected]>
[ Upstream commit 4721a6010990971440b4ffefbdf014976b8eda2f ]
When doing direct IO to a pipe for do_splice_direct(), then pipe is trivial to fill up and overflow as it can only hold 16 pages. At this point bio_iov_iter_get_pages() then returns -EFAULT, and we abort the IO submission process. Unfortunately, iomap_dio_rw() propagates the error back up the stack.
The error is converted from the EFAULT to EAGAIN in generic_file_splice_read() to tell the splice layers that the pipe is full. do_splice_direct() completely fails to handle EAGAIN errors (it aborts on error) and returns EAGAIN to the caller.
copy_file_write() then completely fails to handle EAGAIN as well, and so returns EAGAIN to userspace, having failed to copy the data it was asked to.
Avoid this whole steaming pile of fail by having iomap_dio_rw() silently swallow EFAULT errors and so do short reads.
To make matters worse, iomap_dio_actor() has a stale data exposure bug bio_iov_iter_get_pages() fails - it does not zero the tail block that it may have been left uncovered by partial IO. Fix the error handling case to drop to the sub-block zeroing rather than immmediately returning the -EFAULT error.
--- fs/iomap.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-)
fs/iomap.c +19 -3
@@ -1603,7 +1603,7 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,struct bio *bio;bool need_zeroout = false;bool use_fua = false; -int nr_pages, ret; +int nr_pages, ret =0 ;size_t copied =0 ;if ((pos | length | align) & ((1 << blkbits) -1 ))
@@ -1668,8 +1668,14 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, ret =bio_iov_iter_get_pages (bio, &iter);if (unlikely (ret)) { +/* +* We have to stop part way through an IO. We must fall +* through to the sub-block tail zeroing here, otherwise +* this short IO may expose stale data in the tail of +* the block we haven't written data to. +*/ bio_put (bio); -return copied ? copied : ret; + goto zero_tail; } n = bio->bi_iter.bi_size;
@@ -1706,6 +1712,7 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,* the block tail in the latter case, we can expose stale data via mmap * reads of the EOF block. */ +zero_tail:if (need_zeroout || ((dio->flags &IOMAP_DIO_WRITE ) && pos >=i_size_read (inode))) {/* zero out from the end of the write to the end of the block */
@@ -1713,7 +1720,7 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,if (pad)iomap_dio_zero (dio, iomap, pos, fs_block_size - pad); } -return copied; +return copied ? copied : ret; } static loff_t
@@ -1888,6 +1895,15 @@ iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, wait_for_completion = true; ret =0 ; } + +/* +* Splicing to pipes can fail on a full pipe. We have to +* swallow this to make it look like a short IO +* otherwise the higher splice layers will completely +* mishandle the error and stop moving data. +*/ +if (ret == -EFAULT ) + ret =0 ;break ; } pos += ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 78/243 iomap: readpages doesnt zero page tail beyond EOF
In reply to Greg Kroah-HartmanFrom: Dave Chinner <[email protected]>
[ Upstream commit 8c110d43c6bca4b24dd13272a9d4e0ba6f2ec957 ]
When we read the EOF page of the file via readpages, we need to zero the region beyond EOF that we either do not read or should not contain data so that mmap does not expose stale data to user applications.
However, iomap_adjust_read_range() fails to detect EOF correctly, and so fsx on 1k block size filesystems fails very quickly with mapreads exposing data beyond EOF. There are two problems here.
Firstly, when calculating the end block of the EOF byte, we have to round the size by one to avoid a block aligned EOF from reporting a block too large. i.e. a size of 1024 bytes is 1 block, which in index terms is block 0. Therefore we have to calculate the end block from (isize - 1), not isize.
The second bug is determining if the current page spans EOF, and so whether we need split it into two half, one for the IO, and the other for zeroing. Unfortunately, the code that checks whether we should split the block doesn't actually check if we span EOF, it just checks if the read spans the /offset in the page/ that EOF sits on. So it splits every read into two if EOF is not page aligned, regardless of whether we are reading the EOF block or not.
Hence we need to restrict the "does the read span EOF" check to just the page that spans EOF, not every page we read.
This patch results in correct EOF detection through readpages:
xfs_vm_readpages: dev 259:0 ino 0x43 nr_pages 24 xfs_iomap_found: dev 259:0 ino 0x43 size 0x66c00 offset 0x4f000 count 98304 type hole startoff 0x13c startblock 1368 blockcount 0x4 iomap_readpage_actor: orig pos 323584 pos 323584, length 4096, poff 0 plen 4096, isize 420864 xfs_iomap_found: dev 259:0 ino 0x43 size 0x66c00 offset 0x50000 count 94208 type hole startoff 0x140 startblock 1497 blockcount 0x5c iomap_readpage_actor: orig pos 327680 pos 327680, length 94208, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 331776 pos 331776, length 90112, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 335872 pos 335872, length 86016, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 339968 pos 339968, length 81920, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 344064 pos 344064, length 77824, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 348160 pos 348160, length 73728, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 352256 pos 352256, length 69632, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 356352 pos 356352, length 65536, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 360448 pos 360448, length 61440, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 364544 pos 364544, length 57344, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 368640 pos 368640, length 53248, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 372736 pos 372736, length 49152, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 376832 pos 376832, length 45056, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 380928 pos 380928, length 40960, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 385024 pos 385024, length 36864, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 389120 pos 389120, length 32768, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 393216 pos 393216, length 28672, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 397312 pos 397312, length 24576, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 401408 pos 401408, length 20480, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 405504 pos 405504, length 16384, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 409600 pos 409600, length 12288, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 413696 pos 413696, length 8192, poff 0 plen 4096, isize 420864 iomap_readpage_actor: orig pos 417792 pos 417792, length 4096, poff 0 plen 3072, isize 420864 iomap_readpage_actor: orig pos 420864 pos 420864, length 1024, poff 3072 plen 1024, isize 420864
As you can see, it now does full page reads until the last one which is split correctly at the block aligned EOF, reading 3072 bytes and zeroing the last 1024 bytes. The original version of the patch got this right, but it got another case wrong.
The EOF detection crossing really needs to the the original length as plen, while it starts at the end of the block, will be shortened as up-to-date blocks are found on the page. This means "orig_pos + plen" no longer points to the end of the page, and so will not correctly detect EOF crossing. Hence we have to use the length passed in to detect this partial page case:
xfs_filemap_fault: dev 259:1 ino 0x43 write_fault 0 xfs_vm_readpage: dev 259:1 ino 0x43 nr_pages 1 xfs_iomap_found: dev 259:1 ino 0x43 size 0x2cc00 offset 0x2c000 count 4096 type hole startoff 0xb0 startblock 282 blockcount 0x4 iomap_readpage_actor: orig pos 180224 pos 181248, length 4096, poff 1024 plen 2048, isize 183296 xfs_iomap_found: dev 259:1 ino 0x43 size 0x2cc00 offset 0x2cc00 count 1024 type hole startoff 0xb3 startblock 285 blockcount 0x1 iomap_readpage_actor: orig pos 183296 pos 183296, length 1024, poff 3072 plen 1024, isize 183296
Heere we see a trace where the first block on the EOF page is up to date, hence poff = 1024 bytes. The offset into the page of EOF is 3072, so the range we want to read is 1024 - 3071, and the range we want to zero is 3072 - 4095. You can see this is split correctly now.
This fixes the stale data beyond EOF problem that fsx quickly uncovers on 1k block size filesystems.
--- fs/iomap.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
fs/iomap.c +8 -3
@@ -150,13 +150,14 @@ static void iomap_adjust_read_range(struct inode *inode, struct iomap_page *iop, loff_t *pos, loff_t length, unsigned *offp, unsigned *lenp) { + loff_t orig_pos = *pos; +loff_t isize =i_size_read (inode);unsigned block_bits = inode->i_blkbits;unsigned block_size = (1 << block_bits);unsigned poff =offset_in_page (*pos);unsigned plen =min_t (loff_t,PAGE_SIZE - poff, length);unsigned first = poff >> block_bits;unsigned last = (poff + plen -1 ) >> block_bits; -unsigned end =offset_in_page (i_size_read (inode)) >> block_bits;/* * If the block size is smaller than the page size we need to check the
@@ -191,8 +192,12 @@ iomap_adjust_read_range(struct inode *inode, struct iomap_page *iop,* handle both halves separately so that we properly zero data in the * page cache for blocks that are entirely outside of i_size. */ -if (first <= end && last > end) - plen -= (last - end) * block_size; +if (orig_pos <= isize && orig_pos + length > isize) { +unsigned end =offset_in_page (isize -1 ) >> block_bits; + +if (first <= end && last > end) + plen -= (last - end) * block_size; + } *offp = poff; *lenp = plen;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 79/243 iw_cxgb4: only reconnect with MPAv1 if the peer aborts
In reply to Greg Kroah-HartmanFrom: Steve Wise <[email protected]>
[ Upstream commit 9828ca654b52848e7eb7dcc9b0994ff130dd4546 ]
Only retry connection setup with MPAv1 if the peer actually aborted the connection upon receiving the MPAv2 start message. This avoids retrying with MPAv1 in the case where the connection was aborted due to retransmit timeouts.
--- drivers/infiniband/hw/cxgb4/cm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/cxgb4/cm.c +2 -1
@@ -2798,7 +2798,8 @@ static int peer_abort(struct c4iw_dev *dev, struct sk_buff *skb)break ;case MPA_REQ_SENT : (void )stop_ep_timer (ep); -if (mpa_rev ==1 || (mpa_rev ==2 && ep->tried_with_mpa_v1)) +if (status !=CPL_ERR_CONN_RESET || mpa_rev ==1 || + (mpa_rev ==2 && ep->tried_with_mpa_v1))connect_reply_upcall (ep, -ECONNRESET );else {/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 81/243 net/smc: use after free fix in smc_wr_tx_put_slot()
In reply to Greg Kroah-HartmanFrom: Ursula Braun <[email protected]>
[ Upstream commit e438bae43c1e08e688c09c410407b59fc1c173b4 ]
In smc_wr_tx_put_slot() field pend->idx is used after being cleared. That means always idx 0 is cleared in the wr_tx_mask. This results in a broken administration of available WR send payload buffers.
--- net/smc/smc_wr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/smc/smc_wr.c +3 -1
@@ -215,12 +215,14 @@ int smc_wr_tx_put_slot(struct smc_link *link, pend = container_of(wr_pend_priv, struct smc_wr_tx_pend, priv);if (pend->idx < link->wr_tx_cnt) { +u32 idx = pend->idx; +/* clear the full struct smc_wr_tx_pend including .priv */ memset (&link->wr_tx_pends[pend->idx],0 ,sizeof (link->wr_tx_pends[pend->idx]));memset (&link->wr_tx_bufs[pend->idx],0 ,sizeof (link->wr_tx_bufs[pend->idx])); -test_and_clear_bit (pend->idx, link->wr_tx_mask); +test_and_clear_bit (idx, link->wr_tx_mask);return 1 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 80/243 MIPS: OCTEON: octeon-platform: fix typing
In reply to Greg Kroah-HartmanFrom: Aaro Koskinen <[email protected]>
[ Upstream commit 2cf1c8933dd93088cfb5f8f58b3bb9bbdf1781b9 ]
Use correct type for fdt_property nameoff field.
Patchwork: https://patchwork.linux-mips.org/patch/21204/
--- arch/mips/cavium-octeon/octeon-platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/cavium-octeon/octeon-platform.c +1 -1
@@ -501,7 +501,7 @@ static void __init octeon_fdt_set_phy(int eth, int phy_addr)if (phy_addr >=256 && alt_phy >0 ) {const struct fdt_property *phy_prop;struct fdt_property *alt_prop; -u32 phy_handle_name; +fdt32_t phy_handle_name;/* Use the alt phy node instead.*/ phy_prop =fdt_get_property (initial_boot_params, eth,"phy-handle" ,NULL );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 82/243 math-emu/soft-fp.h: (_FP_ROUND_ZERO) cast 0 to void to fix warning
In reply to Greg Kroah-HartmanFrom: Vincent Chen <[email protected]>
[ Upstream commit 83312f1b7ae205dca647bf52bbe2d51303cdedfb ]
_FP_ROUND_ZERO is defined as 0 and used as a statemente in macro _FP_ROUND. This generates "error: statement with no effect [-Werror=unused-value]" from gcc. Defining _FP_ROUND_ZERO as (void)0 to fix it.
This modification is quoted from glibc 'commit <In libc/:> (8ed1e7d5894000c155acbd06f)'
--- include/math-emu/soft-fp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/math-emu/soft-fp.h +1 -1
@@ -138,7 +138,7 @@ do { \ _FP_FRAC_ADDI_##wc(X, _FP_WORK_ROUND); \ } while (0) -#define _FP_ROUND_ZERO (wc,X ) 0 +#define _FP_ROUND_ZERO (wc,X ) (void)0#define _FP_ROUND_PINF (wc,X ) \ do { \
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 83/243 nds32: Fix the items of hwcap_str ordering issue.
In reply to Greg Kroah-HartmanFrom: Nylon Chen <[email protected]>
[ Upstream commit a5234068e6dc18ae5300d678fbf3e129d9b93f78 ]
The hwcap_str should be set in a correct order according to HWCAP_xx. We also add the missing "fpu_dp" to it.
--- arch/nds32/kernel/setup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/nds32/kernel/setup.c +2 -1
@@ -71,8 +71,9 @@ static const char *hwcap_str[] = {"div" ,"mac" ,"l2c" , -"dx_regs" , +"fpu_dp" ,"v2" , +"dx_regs" , NULL, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 84/243 rtc: max8997: Fix the returned value in case of error in max8997_rtc_read_alarm()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 41ef3878203cd9218d92eaa07df4b85a2cb128fb ]
In case of error, we return 0.
This is spurious and not consistent with the other functions of the driver. Propagate the error code instead.
--- drivers/rtc/rtc-max8997.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/rtc/rtc-max8997.c +1 -1
@@ -215,7 +215,7 @@ static int max8997_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) out:mutex_unlock (&info->lock); -return 0 ; +return ret; }static int max8997_rtc_stop_alarm (struct max8997_rtc_info *info)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 85/243 rtc: dt-binding: abx80x: fix resistance scale
In reply to Greg Kroah-HartmanFrom: Baruch Siach <[email protected]>
[ Upstream commit 73852e56827f5cb5db9d6e8dd8191fc2f2e8f424 ]
The abracon,tc-resistor property value is in kOhm.
--- Documentation/devicetree/bindings/rtc/abracon,abx80x.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/rtc/abracon,abx80x.txt +1 -1
@@ -27,4 +27,4 @@ and valid to enable charging: - "abracon,tc-diode": should be "standard" (0.6V) or "schottky" (0.3V) - "abracon,tc-resistor": should be <0>, <3>, <6> or <11>. 0 disables the output - resistor, the other values are in ohm. + resistor, the other values are in kOhm.
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 69/243 USB: serial: f81534: fix reading old/new IC config
In reply to Greg Kroah-HartmanFrom: Ji-Ze Hong (Peter Hong) <[email protected]>
[ Upstream commit ab60075f2a4eebca1abb04f712569963fb4d9d6c ]
The F81532/534 had a internal configuration space to save & control IC state with address F81534_CUSTOM_ADDRESS_START (0x2f00). Layout as following:
+00h: to indicate the section is valid
+01h~04h: UART Mode & port availability +05h~08h: Output pin control on IC power on +09h~12h: Output pin control on working <-- New added
Old driver will use +05~08h as default on working, but newer IC will configed with shutdown mode(7) in 05h~08h and working mode with RS232(1) in 09h~12h. It'll make mainstream driver not working.
This patch will make mainstream driver compatible older and newer IC. If using a old IC, the +05h~08h will be 00h~06h, we'll direct apply it. If using a new IC, the +05h~08h will be 07h or larger, we'll read +09h~12h to apply newer configuration.
--- drivers/usb/serial/f81534.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-)
drivers/usb/serial/f81534.c +17 -3
@@ -45,14 +45,17 @@#define F81534_CONFIG1_REG (0x09 + F81534_UART_BASE_ADDRESS)#define F81534_DEF_CONF_ADDRESS_START 0x3000 -#define F81534_DEF_CONF_SIZE 8 +#define F81534_DEF_CONF_SIZE 12#define F81534_CUSTOM_ADDRESS_START 0x2f00#define F81534_CUSTOM_DATA_SIZE 0x10#define F81534_CUSTOM_NO_CUSTOM_DATA 0xff#define F81534_CUSTOM_VALID_TOKEN 0xf0#define F81534_CONF_OFFSET 1 -#define F81534_CONF_GPIO_OFFSET 4 +#define F81534_CONF_INIT_GPIO_OFFSET 4 +#define F81534_CONF_WORK_GPIO_OFFSET 8 +#define F81534_CONF_GPIO_SHUTDOWN 7 +#define F81534_CONF_GPIO_RS232 1#define F81534_MAX_DATA_BLOCK 64#define F81534_MAX_BUS_RETRY 20
@@ -1359,8 +1362,19 @@ static int f81534_set_port_output_pin(struct usb_serial_port *port) serial_priv =usb_get_serial_data (serial); port_priv =usb_get_serial_port_data (port); - idx =F81534_CONF_GPIO_OFFSET + port_priv->phy_num; + idx =F81534_CONF_INIT_GPIO_OFFSET + port_priv->phy_num; value = serial_priv->conf_data[idx]; +if (value >=F81534_CONF_GPIO_SHUTDOWN ) { +/* +* Newer IC configure will make transceiver in shutdown mode on +* initial power on. We need enable it before using UARTs. +*/ + idx =F81534_CONF_WORK_GPIO_OFFSET + port_priv->phy_num; + value = serial_priv->conf_data[idx]; +if (value >=F81534_CONF_GPIO_SHUTDOWN ) + value =F81534_CONF_GPIO_RS232 ; + } + pins = &f81534_port_out_pins[port_priv->phy_num];for (i =0 ; i <ARRAY_SIZE (pins->pin); ++i) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 88/243 media: pulse8-cec: return 0 when invalidating the logical address
In reply to Greg Kroah-HartmanFrom: Hans Verkuil <[email protected]>
[ Upstream commit 2e84eb9affac43eeaf834992888b72426a8cd442 ]
Return 0 when invalidating the logical address. The cec core produces a warning for drivers that do this.
--- drivers/media/usb/pulse8-cec/pulse8-cec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/pulse8-cec/pulse8-cec.c +1 -1
@@ -585,7 +585,7 @@ unlock:else pulse8->config_pending = true;mutex_unlock (&pulse8->config_lock); -return err; +return log_addr ==CEC_LOG_ADDR_INVALID ?0 : err; } static int pulse8_cec_adap_transmit(struct cec_adapter *adap, u8 attempts,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 89/243 media: cec: report Vendor ID after initialization
In reply to Greg Kroah-HartmanFrom: Hans Verkuil <[email protected]>
[ Upstream commit 7f02ac77c768ba2bcdd0ce719c1fca0870ffe2fb ]
The CEC specification requires that the Vendor ID (if any) is reported after a logical address was claimed.
This was never done, so add support for this.
--- drivers/media/cec/cec-adap.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/media/cec/cec-adap.c +7 -0
@@ -1437,6 +1437,13 @@ configured: las->log_addr[i], cec_phys_addr_exp(adap->phys_addr));cec_transmit_msg_fh (adap, &msg,NULL , false); + +/* Report Vendor ID */ +if (adap->log_addrs.vendor_id !=CEC_VENDOR_ID_NONE ) { +cec_msg_device_vendor_id (&msg, + adap->log_addrs.vendor_id); +cec_transmit_msg_fh (adap, &msg,NULL , false); + } } adap->kthread_config =NULL ;complete (&adap->config_completion);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 90/243 iwlwifi: fix cfg structs for 22000 with different RF modules
In reply to Greg Kroah-HartmanFrom: Luca Coelho <[email protected]>
[ Upstream commit b1bbc1a636505ebdd6336ff781e417123226d4f7 ]
We have to choose different configuration and different firmwares depending on the external RF module that is installed. Since the external module is not represented in the PCI IDs, we need to change the configuration at runtime, after checking the RF ID of the module installed. We have a bit of a mess in the code that does this, because it applies cfg's according to the RF ID only, ignoring the integrated module that is in use.
Fix that for some devices by adding correct configurations for them and not ignoring the integrated module's type when making the decision.
--- .../net/wireless/intel/iwlwifi/cfg/22000.c | 1 - drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 2 +- .../net/wireless/intel/iwlwifi/pcie/trans.c | 22 +++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/cfg/22000.c +0 -1
@@ -321,7 +321,6 @@ MODULE_FIRMWARE(IWL_22000_HR_MODULE_FIRMWARE(IWL_22000_UCODE_API_MAX));MODULE_FIRMWARE (IWL_22000_JF_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_HR_A_F0_QNJ_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_HR_B_F0_QNJ_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX )); -MODULE_FIRMWARE (IWL_22000_QU_B_HR_B_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_HR_B_QNJ_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_JF_B0_QNJ_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));MODULE_FIRMWARE (IWL_22000_HR_A0_QNJ_MODULE_FIRMWARE (IWL_22000_UCODE_API_MAX ));
drivers/net/wireless/intel/iwlwifi/pcie/drv.c +1 -1
@@ -888,7 +888,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = { {IWL_PCI_DEVICE(0x34F0, 0x0040, iwl22000_2ax_cfg_hr)}, {IWL_PCI_DEVICE(0x34F0, 0x0070, iwl22000_2ax_cfg_hr)}, {IWL_PCI_DEVICE(0x34F0, 0x0078, iwl22000_2ax_cfg_hr)}, - {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl22000_2ac_cfg_jf)}, + {IWL_PCI_DEVICE(0x34F0, 0x0310, iwl22000_2ax_cfg_hr)}, {IWL_PCI_DEVICE(0x40C0, 0x0000, iwl22560_2ax_cfg_su_cdb)}, {IWL_PCI_DEVICE(0x40C0, 0x0010, iwl22560_2ax_cfg_su_cdb)}, {IWL_PCI_DEVICE(0x40c0, 0x0090, iwl22560_2ax_cfg_su_cdb)},
drivers/net/wireless/intel/iwlwifi/pcie/trans.c +20 -2
@@ -3415,8 +3415,26 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,#if IS_ENABLED (CONFIG_IWLMVM ) trans->hw_rf_id =iwl_read32 (trans,CSR_HW_RF_ID ); -if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == -CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR )) { +if (cfg == &iwl22000_2ax_cfg_hr) { +if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == +CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR )) { + trans->cfg = &iwl22000_2ax_cfg_hr; + }else if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == +CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_JF )) { + trans->cfg = &iwl22000_2ax_cfg_jf; + }else if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == +CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HRCDB )) { +IWL_ERR (trans,"RF ID HRCDB is not supported\n" ); + ret = -EINVAL ; + goto out_no_pci; + }else { +IWL_ERR (trans,"Unrecognized RF ID 0x%08x\n" , +CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id)); + ret = -EINVAL ; + goto out_no_pci; + } + }else if (CSR_HW_RF_ID_TYPE_CHIP_ID (trans->hw_rf_id) == +CSR_HW_RF_ID_TYPE_CHIP_ID (CSR_HW_RF_ID_TYPE_HR )) {u32 hw_status; hw_status =iwl_read_prph (trans,UMAG_GEN_HW_STATUS );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 91/243 ravb: Clean up duplex handling
In reply to Greg Kroah-HartmanFrom: Magnus Damm <[email protected]>
[ Upstream commit 08b43857804dd0eca48f5c5a84885cf0079586e0 ]
Since only full-duplex operation is supported by the hardware, remove duplex handling code and keep the register setting of ECMR.DM fixed at 1.
This updates the driver implementation to follow the data sheet text "This bit should always be set to 1."
--- drivers/net/ethernet/renesas/ravb.h | 1 - drivers/net/ethernet/renesas/ravb_main.c | 19 +------------------ 2 files changed, 1 insertion(+), 19 deletions(-)
drivers/net/ethernet/renesas/ravb.h +0 -1
@@ -1029,7 +1029,6 @@ struct ravb_private {phy_interface_t phy_interface;int msg_enable;int speed; -int duplex;int emac_irq;enum ravb_chip_id chip_id;int rx_irqs[NUM_RX_QUEUE ];
drivers/net/ethernet/renesas/ravb_main.c +1 -18
@@ -82,13 +82,6 @@ static int ravb_config(struct net_device *ndev)return error; } -static void ravb_set_duplex (struct net_device *ndev) -{ -struct ravb_private *priv =netdev_priv (ndev); - -ravb_modify (ndev,ECMR ,ECMR_DM , priv->duplex ?ECMR_DM :0 ); -} -static void ravb_set_rate (struct net_device *ndev) {struct ravb_private *priv =netdev_priv (ndev);
@@ -398,13 +391,11 @@ error:/* E-MAC init function */ static void ravb_emac_init (struct net_device *ndev) { -struct ravb_private *priv =netdev_priv (ndev); -/* Receive frame limit set register */ ravb_write (ndev, ndev->mtu +ETH_HLEN +VLAN_HLEN +ETH_FCS_LEN ,RFLR );/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */ -ravb_write (ndev,ECMR_ZPF | (priv->duplex ?ECMR_DM :0 ) | +ravb_write (ndev,ECMR_ZPF |ECMR_DM | (ndev->features &NETIF_F_RXCSUM ?ECMR_RCSC :0 ) |ECMR_TE |ECMR_RE ,ECMR );
@@ -992,12 +983,6 @@ static void ravb_adjust_link(struct net_device *ndev)ravb_rcv_snd_disable (ndev);if (phydev->link) { -if (phydev->duplex != priv->duplex) { - new_state = true; - priv->duplex = phydev->duplex; -ravb_set_duplex (ndev); - } -if (phydev->speed != priv->speed) { new_state = true; priv->speed = phydev->speed;
@@ -1012,7 +997,6 @@ static void ravb_adjust_link(struct net_device *ndev) new_state = true; priv->link =0 ; priv->speed =0 ; - priv->duplex =-1 ; }/* Enable TX and RX right over here, if E-MAC change is ignored */
@@ -1042,7 +1026,6 @@ static int ravb_phy_init(struct net_device *ndev) priv->link =0 ; priv->speed =0 ; - priv->duplex =-1 ;/* Try connecting to PHY */ pn =of_parse_phandle (np,"phy-handle" ,0 );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 94/243 dmaengine: coh901318: Remove unused variable
In reply to Greg Kroah-HartmanFrom: Vinod Koul <[email protected]>
commit 35faaf0df42d285b40f8a6310afbe096720f7758 upstream.
Commit 627469e4445b ("dmaengine: coh901318: Fix a double-lock bug") left flags variable unused, so remove it to fix the warning.
drivers/dma/coh901318.c: In function 'coh901318_config':drivers/dma/coh901318.c:1805:16: warning: unused variable 'flags' [-Wunused-variable]
unsigned long flags;
^~~~~--- drivers/dma/coh901318.c | 1 - 1 file changed, 1 deletion(-)
drivers/dma/coh901318.c +0 -1
@@ -1797,7 +1797,6 @@ static struct dma_chan *coh901318_xlate(static int coh901318_config (struct coh901318_chan *cohc,struct coh901318_params *param) { -unsigned long flags;const struct coh901318_params *p;int channel = cohc->id;void __iomem *virtbase = cohc->base->virtbase;
Greg Kroah-Hartman
maintainerPATCH 93/243 dmaengine: coh901318: Fix a double-lock bug
In reply to Greg Kroah-HartmanFrom: Jia-Ju Bai <[email protected]>
[ Upstream commit 627469e4445b9b12e0229b3bdf8564d5ce384dd7 ]
The function coh901318_alloc_chan_resources() calls spin_lock_irqsave() before calling coh901318_config().
But coh901318_config() calls spin_lock_irqsave() again in its definition, which may cause a double-lock bug.
Because coh901318_config() is only called by coh901318_alloc_chan_resources(), the bug fix is to remove the calls to spin-lock and -unlock functions in coh901318_config().
--- drivers/dma/coh901318.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/dma/coh901318.c +0 -4
@@ -1802,8 +1802,6 @@ static int coh901318_config(struct coh90int channel = cohc->id;void __iomem *virtbase = cohc->base->virtbase; -spin_lock_irqsave (&cohc->lock, flags); -if (param) p = param;else
@@ -1823,8 +1821,6 @@ static int coh901318_config(struct coh90coh901318_set_conf (cohc, p->config);coh901318_set_ctrl (cohc, p->ctrl_lli_last); -spin_unlock_irqrestore (&cohc->lock, flags); -return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 95/243 dmaengine: dw-dmac: implement dma protection control setting
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
[ Upstream commit 7b0c03ecc42fb223baf015877fee9d517c2c8af1 ]
This patch adds a new device-tree property that allows to specify the dma protection control bits for the all of the DMA controller's channel uniformly.
Setting the "correct" bits can have a huge impact on the PPC460EX and APM82181 that use this DMA engine in combination with a DesignWare' SATA-II core (sata_dwc_460ex driver).
In the OpenWrt Forum, the user takimata reported that:
|It seems your patch unleashed the full power of the SATA port. |Where I was previously hitting a really hard limit at around |82 MB/s for reading and 27 MB/s for writing, I am now getting this: | |root@OpenWrt:/mnt# time dd if=/dev/zero of=tempfile bs=1M count=1024 |1024+0 records in |1024+0 records out |real 0m 13.65s |user 0m 0.01s |sys 0m 11.89s | |root@OpenWrt:/mnt# time dd if=tempfile of=/dev/null bs=1M count=1024 |1024+0 records in |1024+0 records out |real 0m 8.41s |user 0m 0.01s |sys 0m 4.70s | |This means: 121 MB/s reading and 75 MB/s writing! | |The drive is a WD Green WD10EARX taken from an older MBL Single. |I repeated the test a few times with even larger files to rule out |any caching, I'm still seeing the same great performance. OpenWrt is |now completely on par with the original MBL firmware's performance.
Another user And.short reported:
|I can report that your fix worked! Boots up fine with two |drives even with more partitions, and no more reboot on |concurrent disk access!
A closer look into the sata_dwc_460ex code revealed that the driver did initally set the correct protection control bits. However, this feature was lost when the sata_dwc_460ex driver was converted to the generic DMA driver framework.
--- drivers/dma/dw/core.c | 2 ++ drivers/dma/dw/platform.c | 6 ++++++ drivers/dma/dw/regs.h | 4 ++++ include/linux/platform_data/dma-dw.h | 6 ++++++ 4 files changed, 18 insertions(+)
drivers/dma/dw/core.c +2 -0
@@ -160,12 +160,14 @@ static void dwc_initialize_chan_idma32(struct dw_dma_chan *dwc)static void dwc_initialize_chan_dw (struct dw_dma_chan *dwc) { +struct dw_dma *dw =to_dw_dma (dwc->chan.device);u32 cfghi =DWC_CFGH_FIFO_MODE ;u32 cfglo =DWC_CFGL_CH_PRIOR (dwc->priority);bool hs_polarity = dwc->dws.hs_polarity; cfghi |=DWC_CFGH_DST_PER (dwc->dws.dst_id); cfghi |=DWC_CFGH_SRC_PER (dwc->dws.src_id); + cfghi |=DWC_CFGH_PROTCTL (dw->pdata->protctl);/* Set polarity of handshake interface */ cfglo |= hs_polarity ?DWC_CFGL_HS_DST_POL |DWC_CFGL_HS_SRC_POL :0 ;
drivers/dma/dw/platform.c +6 -0
@@ -162,6 +162,12 @@ dw_dma_parse_dt(struct platform_device *pdev) pdata->multi_block[tmp] = 1; } +if (!of_property_read_u32 (np,"snps,dma-protection-control" , &tmp)) { +if (tmp >CHAN_PROTCTL_MASK ) +return NULL ; + pdata->protctl = tmp; + } +return pdata; }#else
drivers/dma/dw/regs.h +4 -0
@@ -200,6 +200,10 @@ enum dw_dma_msize {#define DWC_CFGH_FCMODE (1 << 0)#define DWC_CFGH_FIFO_MODE (1 << 1)#define DWC_CFGH_PROTCTL (x) ((x) << 2) +#define DWC_CFGH_PROTCTL_DATA (0 << 2)/* data access - always set */ +#define DWC_CFGH_PROTCTL_PRIV (1 << 2)/* privileged -> AHB HPROT[1] */ +#define DWC_CFGH_PROTCTL_BUFFER (2 << 2)/* bufferable -> AHB HPROT[2] */ +#define DWC_CFGH_PROTCTL_CACHE (4 << 2)/* cacheable -> AHB HPROT[3] */ #define DWC_CFGH_DS_UPD_EN (1 << 5)#define DWC_CFGH_SS_UPD_EN (1 << 6)#define DWC_CFGH_SRC_PER (x) ((x) << 7)
include/linux/platform_data/dma-dw.h +6 -0
@@ -49,6 +49,7 @@ struct dw_dma_slave {* @data_width: Maximum data width supported by hardware per AHB master * (in bytes, power of 2) * @multi_block: Multi block transfers supported by hardware per channel. +* @protctl: Protection control signals setting per channel. */ struct dw_dma_platform_data {unsigned int nr_channels;
@@ -65,6 +66,11 @@ struct dw_dma_platform_data {unsigned char nr_masters;unsigned char data_width[DW_DMA_MAX_NR_MASTERS ];unsigned char multi_block[DW_DMA_MAX_NR_CHANNELS ]; +#define CHAN_PROTCTL_PRIVILEGED BIT(0) +#define CHAN_PROTCTL_BUFFERABLE BIT(1) +#define CHAN_PROTCTL_CACHEABLE BIT(2) +#define CHAN_PROTCTL_MASK GENMASK(2, 0) + unsigned char protctl; };#endif /* _PLATFORM_DATA_DMA_DW_H */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 70/243 xfs: extent shifting doesnt fully invalidate page cache
In reply to Greg Kroah-HartmanFrom: Dave Chinner <[email protected]>
[ Upstream commit 7f9f71be84bcab368e58020a42f6d0dd97adf0ce ]
The extent shifting code uses a flush and invalidate mechainsm prior to shifting extents around. This is similar to what xfs_free_file_space() does, but it doesn't take into account things like page cache vs block size differences, and it will fail if there is a page that it currently busy.
xfs_flush_unmap_range() handles all of these cases, so just convert xfs_prepare_shift() to us that mechanism rather than having it's own special sauce.
--- fs/xfs/xfs_bmap_util.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
fs/xfs/xfs_bmap_util.c +1 -7
@@ -1244,13 +1244,7 @@ xfs_prepare_shift(* Writeback and invalidate cache for the remainder of the file as we're * about to shift down every extent from offset to EOF. */ - error =filemap_write_and_wait_range (VFS_I (ip)->i_mapping, offset,-1 ); -if (error) -return error; - error =invalidate_inode_pages2_range (VFS_I (ip)->i_mapping, - offset >>PAGE_SHIFT ,-1 ); -if (error) -return error; + error =xfs_flush_unmap_range (ip, offset,XFS_ISIZE (ip));/* * Clean out anything hanging around in the cow fork now that
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 97/243 selftests/powerpc: Allocate base registers
In reply to Greg Kroah-HartmanFrom: Breno Leitao <[email protected]>
[ Upstream commit 5249497a7bb6334fcc128588d6a7e1e21786515a ]
Some ptrace selftests are passing input operands using a constraint that can allocate any register for the operand, and using these registers on load/store operations.
If the register allocated by the compiler happens to be zero (r0), it might cause an invalid memory address access, since load and store operations consider the content of 0x0 address if the base register is r0, instead of the content of the r0 register. For example:
r1 := 0xdeadbeef r0 := 0xdeadbeef ld r2, 0(1) /* will load into r2 the content of r1 address */ ld r2, 0(0) /* will load into r2 the content of 0x0 */
In order to avoid this possible problem, the inline assembly constraint should be aware that these registers will be used as a base register, thus, r0 should not be allocated.
Other than that, this patch removes inline assembly operands that are not used by the tests.
--- tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c | 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c | 4 ++-- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c | 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c | 3 +-- tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c | 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c | 2 +- tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c | 3 +-- 7 files changed, 8 insertions(+), 10 deletions(-)
tools/testing/selftests/powerpc/ptrace/ptrace-gpr.c +1 -1
@@ -31,7 +31,7 @@ void gpr(void) ASM_LOAD_GPR_IMMED(gpr_1) ASM_LOAD_FPR_SINGLE_PRECISION(flt_1) : - : [gpr_1]"i"(GPR_1), [flt_1] "r" (&a) + : [gpr_1]"i"(GPR_1), [flt_1] "b" (&a) : "memory", "r6", "r7", "r8", "r9", "r10"," r11", " r12", " r13", " r14", " r15", " r16", " r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24",
tools/testing/selftests/powerpc/ptrace/ptrace-tm-gpr.c +2 -2
@@ -59,8 +59,8 @@ trans:"3: ;" : [res] "=r" (result), [texasr] "=r" (texasr) : [gpr_1]"i"(GPR_1), [gpr_2]"i"(GPR_2), - [sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "r" (&a), - [flt_2] "r" (&b), [cptr1] "r" (&cptr[1]) + [sprn_texasr] "i" (SPRN_TEXASR), [flt_1] "b" (&a), + [flt_2] "b" (&b), [cptr1] "b" (&cptr[1]) : "memory", "r7", "r8", "r9", "r10"," r11", " r12", " r13", " r14", " r15", " r16", "r17", "r18", "r19", "r20", "r21", "r22",
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-tar.c +1 -1
@@ -72,7 +72,7 @@ trans:"3: ;" : [res] "=r" (result), [texasr] "=r" (texasr) - : [val] "r" (cptr[1]), [sprn_dscr]"i"(SPRN_DSCR), + : [sprn_dscr]"i"(SPRN_DSCR), [sprn_tar]"i"(SPRN_TAR), [sprn_ppr]"i"(SPRN_PPR), [sprn_texasr]"i"(SPRN_TEXASR), [tar_1]"i"(TAR_1), [dscr_1]"i"(DSCR_1), [tar_2]"i"(TAR_2), [dscr_2]"i"(DSCR_2),
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spd-vsx.c +1 -2
@@ -77,8 +77,7 @@ trans: "3: ;" : [res] "=r" (result), [texasr] "=r" (texasr) - : [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt), - [sprn_texasr] "i" (SPRN_TEXASR) + : [sprn_texasr] "i" (SPRN_TEXASR) : "memory", "r0", "r1", "r3", "r4","r7" ,"r8" ,"r9" ,"r10" ,"r11" );
tools/testing/selftests/powerpc/ptrace/ptrace-tm-spr.c +1 -1
@@ -74,7 +74,7 @@ trans:"3: ;" : [tfhar] "=r" (tfhar), [res] "=r" (result), - [texasr] "=r" (texasr), [cptr1] "=r" (cptr1) + [texasr] "=r" (texasr), [cptr1] "=b" (cptr1) : [sprn_texasr] "i" (SPRN_TEXASR) : "memory", "r0", "r8", "r31" );
tools/testing/selftests/powerpc/ptrace/ptrace-tm-tar.c +1 -1
@@ -65,7 +65,7 @@ trans: : [sprn_dscr]"i"(SPRN_DSCR), [sprn_tar]"i"(SPRN_TAR), [sprn_ppr]"i"(SPRN_PPR), [sprn_texasr]"i"(SPRN_TEXASR), [tar_1]"i"(TAR_1), [dscr_1]"i"(DSCR_1), [tar_2]"i"(TAR_2), - [dscr_2]"i"(DSCR_2), [cptr1] "r" (&cptr[1]) + [dscr_2]"i"(DSCR_2), [cptr1] "b" (&cptr[1]) : "memory", "r0", "r1", "r3", "r4", "r5", "r6" );
tools/testing/selftests/powerpc/ptrace/ptrace-tm-vsx.c +1 -2
@@ -65,8 +65,7 @@ trans:"3: ;" : [res] "=r" (result), [texasr] "=r" (texasr) - : [fp_load] "r" (fp_load), [fp_load_ckpt] "r" (fp_load_ckpt), - [sprn_texasr] "i" (SPRN_TEXASR), [cptr1] "r" (&cptr[1]) + : [sprn_texasr] "i" (SPRN_TEXASR), [cptr1] "b" (&cptr[1]) : "memory", "r0", "r1", "r3", "r4", "r7", "r8", "r9", "r10", "r11" );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 99/243 usb: dwc3: debugfs: Properly print/set link state for HS
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
[ Upstream commit 0d36dede457873404becd7c9cb9d0f2bcfd0dcd9 ]
Highspeed device and below has different state names than superspeed and higher. Add proper checks and printouts of link states for highspeed and below.
--- drivers/usb/dwc3/debug.h | 29 +++++++++++++++++++++++++++++ drivers/usb/dwc3/debugfs.c | 19 +++++++++++++++++-- 2 files changed, 46 insertions(+), 2 deletions(-)
drivers/usb/dwc3/debug.h +29 -0
@@ -116,6 +116,35 @@ dwc3_gadget_link_string(enum dwc3_link_state link_state) } } +/** +* dwc3_gadget_hs_link_string - returns highspeed and below link name +* @link_state: link state code +*/ +static inline const char * +dwc3_gadget_hs_link_string (enum dwc3_link_state link_state) +{ +switch (link_state) { +case DWC3_LINK_STATE_U0 : +return "On" ; +case DWC3_LINK_STATE_U2 : +return "Sleep" ; +case DWC3_LINK_STATE_U3 : +return "Suspend" ; +case DWC3_LINK_STATE_SS_DIS : +return "Disconnected" ; +case DWC3_LINK_STATE_RX_DET : +return "Early Suspend" ; +case DWC3_LINK_STATE_RECOV : +return "Recovery" ; +case DWC3_LINK_STATE_RESET : +return "Reset" ; +case DWC3_LINK_STATE_RESUME : +return "Resume" ; +default : +return "UNKNOWN link state\n" ; + } +} +/** * dwc3_trb_type_string - returns TRB type as a string * @type: the type of the TRB
drivers/usb/dwc3/debugfs.c +17 -2
@@ -433,13 +433,17 @@ static int dwc3_link_state_show(struct seq_file *s, void *unused)unsigned long flags;enum dwc3_link_state state;u32 reg; +u8 speed;spin_lock_irqsave (&dwc->lock, flags); reg =dwc3_readl (dwc->regs,DWC3_DSTS ); state =DWC3_DSTS_USBLNKST (reg); -spin_unlock_irqrestore (&dwc->lock, flags); + speed = reg &DWC3_DSTS_CONNECTSPD ; -seq_printf (s,"%s\n" ,dwc3_gadget_link_string (state)); +seq_printf (s,"%s\n" , (speed >=DWC3_DSTS_SUPERSPEED ) ? +dwc3_gadget_link_string (state) : +dwc3_gadget_hs_link_string (state)); +spin_unlock_irqrestore (&dwc->lock, flags);return 0 ; }
@@ -457,6 +461,8 @@ static ssize_t dwc3_link_state_write(struct file *file,unsigned long flags;enum dwc3_link_state state =0 ;char buf[32 ]; +u32 reg; +u8 speed;if (copy_from_user (&buf, ubuf,min_t (size_t,sizeof (buf) -1 , count)))return -EFAULT ;
@@ -477,6 +483,15 @@ static ssize_t dwc3_link_state_write(struct file *file,return -EINVAL ;spin_lock_irqsave (&dwc->lock, flags); + reg =dwc3_readl (dwc->regs,DWC3_DSTS ); + speed = reg &DWC3_DSTS_CONNECTSPD ; + +if (speed <DWC3_DSTS_SUPERSPEED && + state !=DWC3_LINK_STATE_RECOV ) { +spin_unlock_irqrestore (&dwc->lock, flags); +return -EINVAL ; + } +dwc3_gadget_set_link_state (dwc, state);spin_unlock_irqrestore (&dwc->lock, flags);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 98/243 selftests/powerpc: Skip test instead of failing
In reply to Greg Kroah-HartmanFrom: Breno Leitao <[email protected]>
[ Upstream commit eafcd8e3fbad4f426a40ed2b6a8c697c3a4ef36a ]
Current core-pkey selftest fails if the test runs without privileges to write into the core pattern file (/proc/sys/kernel/core_pattern). This causes the test to fail and give the impression that the subsystem being tested is broken, when, in fact, the test is being executed without the proper privileges. This is the current error:
test: core_pkey tags: git_version:v4.19-3-g9e3363be9bce-dirty Error writing to core_pattern file: Permission denied failure: core_pkey
This patch simply skips this test if it runs without the proper privileges, avoiding this undesired failure.
--- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
tools/testing/selftests/powerpc/ptrace/core-pkey.c +1 -4
@@ -352,10 +352,7 @@ static int write_core_pattern(const char *core_pattern)FILE *f; f =fopen (core_pattern_file,"w" ); -if (!f) { -perror ("Error writing to core_pattern file" ); -return TEST_FAIL ; - } +SKIP_IF_MSG (!f,"Try with root privileges" ); ret =fwrite (core_pattern,1 , len, f);fclose (f);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 100/243 usb: dwc3: dont log probe deferrals; but do log other error codes
In reply to Greg Kroah-HartmanFrom: Brian Norris <[email protected]>
[ Upstream commit 408d3ba006af57380fa48858b39f72fde6405031 ]
It's not very useful to repeat a bunch of probe deferral errors. And it's also not very useful to log "failed" without telling the error code.
--- drivers/usb/dwc3/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/dwc3/core.c +2 -1
@@ -1481,7 +1481,8 @@ static int dwc3_probe(struct platform_device *pdev) ret =dwc3_core_init (dwc);if (ret) { -dev_err (dev,"failed to initialize core\n" ); +if (ret != -EPROBE_DEFER ) +dev_err (dev,"failed to initialize core: %d\n" , ret); goto err4; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 101/243 ACPI: fix acpi_find_child_device() invocation in acpi_preset_companion()
In reply to Greg Kroah-HartmanFrom: Alexey Dobriyan <[email protected]>
[ Upstream commit f8c6d1402b89f22a3647705d63cbd171aa19a77e ]
acpi_find_child_device() accepts boolean not pointer as last argument.
--- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/acpi.h +1 -1
@@ -101,7 +101,7 @@ static inline bool has_acpi_companion(struct device *dev)static inline void acpi_preset_companion (struct device *dev,struct acpi_device *parent,u64 addr) { -ACPI_COMPANION_SET (dev,acpi_find_child_device (parent, addr,NULL )); +ACPI_COMPANION_SET (dev,acpi_find_child_device (parent, addr, false)); }static inline const char *acpi_dev_name (struct acpi_device *adev)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 104/243 f2fs: change segment to section in f2fs_ioc_gc_range
In reply to Greg Kroah-HartmanFrom: Yunlong Song <[email protected]>
[ Upstream commit 67b0e42b768c9ddc3fd5ca1aee3db815cfaa635c ]
f2fs_ioc_gc_range skips blocks_per_seg each time, however, f2fs_gc moves blocks of section each time, so fix it from segment to section.
--- fs/f2fs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/file.c +1 -1
@@ -2143,7 +2143,7 @@ do_more: } ret =f2fs_gc (sbi, range.sync, true,GET_SEGNO (sbi, range.start)); - range.start += sbi->blocks_per_seg; + range.start +=BLKS_PER_SEC (sbi);if (range.start <= end) goto do_more; out:
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 71/243 net-next/hinic:fix a bug in set mac address
In reply to Greg Kroah-HartmanFrom: Xue Chaojing <[email protected]>
[ Upstream commit 9ea72dc9430306b77c73a8a21beb51437cde1d6d ]
In add_mac_addr(), if the MAC address is a muliticast address, it will not be set, which causes the network card fail to receive the multicast packet. This patch fixes this bug.
--- drivers/net/ethernet/huawei/hinic/hinic_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/net/ethernet/huawei/hinic/hinic_main.c +4 -3
@@ -600,9 +600,6 @@ static int add_mac_addr(struct net_device *netdev, const u8 *addr)u16 vid =0 ;int err; -if (!is_valid_ether_addr (addr)) -return -EADDRNOTAVAIL ; -netif_info (nic_dev, drv, netdev,"set mac addr = %02x %02x %02x %02x %02x %02x\n" , addr[0 ], addr[1 ], addr[2 ], addr[3 ], addr[4 ], addr[5 ]);
@@ -726,6 +723,7 @@ static void set_rx_mode(struct work_struct *work) {struct hinic_rx_mode_work *rx_mode_work =work_to_rx_mode_work (work);struct hinic_dev *nic_dev =rx_mode_work_to_nic_dev (rx_mode_work); +struct netdev_hw_addr *ha;netif_info (nic_dev, drv, nic_dev->netdev,"set rx mode work\n" );
@@ -733,6 +731,9 @@ static void set_rx_mode(struct work_struct *work)__dev_uc_sync (nic_dev->netdev, add_mac_addr, remove_mac_addr);__dev_mc_sync (nic_dev->netdev, add_mac_addr, remove_mac_addr); + +netdev_for_each_mc_addr (ha, nic_dev->netdev) +add_mac_addr (nic_dev->netdev, ha->addr); }static void hinic_set_rx_mode (struct net_device *netdev)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 106/243 ARM: dts: rockchip: Assign the proper GPIO clocks for rv1108
In reply to Greg Kroah-HartmanFrom: Otavio Salvador <[email protected]>
[ Upstream commit efc2e0bd9594060915696a418564aefd0270b1d6 ]
It is not correct to assign the 24MHz clock oscillator to the GPIO ports.
Fix it by assigning the proper GPIO clocks instead.
--- arch/arm/boot/dts/rv1108.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/rv1108.dtsi +4 -4
@@ -541,7 +541,7 @@ compatible = "rockchip,gpio-bank"; reg = <0x20030000 0x100>; interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&xin24m>; + clocks = <&cru PCLK_GPIO0_PMU>; gpio-controller; #gpio-cells = <2>;
@@ -554,7 +554,7 @@ compatible = "rockchip,gpio-bank"; reg = <0x10310000 0x100>; interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&xin24m>; + clocks = <&cru PCLK_GPIO1>; gpio-controller; #gpio-cells = <2>;
@@ -567,7 +567,7 @@ compatible = "rockchip,gpio-bank"; reg = <0x10320000 0x100>; interrupts = <GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&xin24m>; + clocks = <&cru PCLK_GPIO2>; gpio-controller; #gpio-cells = <2>;
@@ -580,7 +580,7 @@ compatible = "rockchip,gpio-bank"; reg = <0x10330000 0x100>; interrupts = <GIC_SPI 43 IRQ_TYPE_LEVEL_HIGH>; - clocks = <&xin24m>; + clocks = <&cru PCLK_GPIO3>; gpio-controller; #gpio-cells = <2>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 107/243 f2fs: fix to allow node segment for GC by ioctl path
In reply to Greg Kroah-HartmanFrom: Sahitya Tummala <[email protected]>
[ Upstream commit 08ac9a3870f6babb2b1fff46118536ca8a71ef19 ]
Allow node type segments also to be GC'd via f2fs ioctl F2FS_IOC_GARBAGE_COLLECT_RANGE.
--- fs/f2fs/gc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/f2fs/gc.c +1 -2
@@ -318,8 +318,7 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi, p.min_cost =get_max_cost (sbi, &p);if (*result !=NULL_SEGNO ) { -if (IS_DATASEG (get_seg_entry (sbi, *result)->type) && -get_valid_blocks (sbi, *result, false) && +if (get_valid_blocks (sbi, *result, false) && !sec_usage_check (sbi,GET_SEC_FROM_SEG (sbi, *result))) p.min_segno = *result; goto out;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 72/243 net-next/hinic: fix a bug in rx data flow
In reply to Greg Kroah-HartmanFrom: Xue Chaojing <[email protected]>
[ Upstream commit b1a200484143a727ce293e0f200a543cc7584152 ]
In rx_alloc_pkts(), there is a loop call of tasklet, which causes 100% cpu utilization, even no packets are being received. This patch fixes this bug.
--- drivers/net/ethernet/huawei/hinic/hinic_rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/huawei/hinic/hinic_rx.c +1 -1
@@ -207,9 +207,9 @@ skb_out:wmb ();/* write all the wqes before update PI */ hinic_rq_update (rxq->rq, prod_idx); +tasklet_schedule (&rxq->rx_task); } -tasklet_schedule (&rxq->rx_task);return i; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 73/243 ice: Fix return value from NAPI poll
In reply to Greg Kroah-HartmanFrom: Dave Ertman <[email protected]>
[ Upstream commit e0c9fd9b77a7334032ec407d9e14d7c3cac1ac4f ]
ice_napi_poll is hard-coded to return zero when it's done. It should instead return the work done (if any work was done). The only time it should return zero is if an interrupt or poll is handled and no work is performed. So change the return value to be the minimum of work done or budget-1.
--- drivers/net/ethernet/intel/ice/ice_txrx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_txrx.c +2 -1
@@ -1106,7 +1106,8 @@ int ice_napi_poll(struct napi_struct *napi, int budget)napi_complete_done (napi, work_done);if (test_bit (ICE_FLAG_MSIX_ENA , pf->flags))ice_irq_dynamic_ena (&vsi->back->hw, vsi, q_vector); -return 0 ; + +return min (work_done, budget -1 ); }/* helper function for building cmd/type/offset */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 74/243 ice: Fix possible NULL pointer de-reference
In reply to Greg Kroah-HartmanFrom: Bruce Allan <[email protected]>
[ Upstream commit f25dad19ba70f7cc135da78ec013325042cd8c52 ]
A recent update to smatch is causing it to report the error "we previously assumed 'm_entry->vsi_list_info' could be null". Fix that.
--- drivers/net/ethernet/intel/ice/ice_switch.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/ice/ice_switch.c +3 -0
@@ -1023,6 +1023,9 @@ ice_handle_vsi_list_mgmt(struct ice_hw *hw,u16 vsi_id = new_fltr->fwd_id.vsi_id;enum ice_adminq_opc opcode; +if (!m_entry->vsi_list_info) +return ICE_ERR_CFG ; +/* A rule already exists with the new VSI being added */ if (test_bit (vsi_id, m_entry->vsi_list_info->vsi_map))return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 75/243 iomap: FUA is wrong for DIO O_DSYNC writes into unwritten extents
In reply to Greg Kroah-HartmanFrom: Dave Chinner <[email protected]>
[ Upstream commit 0929d8580071c6a1cec1a7916a8f674c243ceee1 ]
When we write into an unwritten extent via direct IO, we dirty metadata on IO completion to convert the unwritten extent to written. However, when we do the FUA optimisation checks, the inode may be clean and so we issue a FUA write into the unwritten extent. This means we then bypass the generic_write_sync() call after unwritten extent conversion has ben done and we don't force the modified metadata to stable storage.
This violates O_DSYNC semantics. The window of exposure is a single IO, as the next DIO write will see the inode has dirty metadata and hence will not use the FUA optimisation. Calling generic_write_sync() after completion of the second IO will also sync the first write and it's metadata.
Fix this by avoiding the FUA optimisation when writing to unwritten extents.
--- fs/iomap.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
fs/iomap.c +6 -5
@@ -1619,12 +1619,13 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,if (iomap->flags &IOMAP_F_NEW ) { need_zeroout = true; - }else { + }else if (iomap->type ==IOMAP_MAPPED ) {/* -* Use a FUA write if we need datasync semantics, this -* is a pure data IO that doesn't require any metadata -* updates and the underlying device supports FUA. This -* allows us to avoid cache flushes on IO completion. +* Use a FUA write if we need datasync semantics, this is a pure +* data IO that doesn't require any metadata updates (including +* after IO completion such as unwritten extent conversion) and +* the underlying device supports FUA. This allows us to avoid +* cache flushes on IO completion. */ if (!(iomap->flags & (IOMAP_F_SHARED|IOMAP_F_DIRTY)) && (dio->flags & IOMAP_DIO_WRITE_FUA) &&
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 76/243 iomap: sub-block dio needs to zeroout beyond EOF
In reply to Greg Kroah-HartmanFrom: Dave Chinner <[email protected]>
[ Upstream commit b450672fb66b4a991a5b55ee24209ac7ae7690ce ]
If we are doing sub-block dio that extends EOF, we need to zero the unused tail of the block to initialise the data in it it. If we do not zero the tail of the block, then an immediate mmap read of the EOF block will expose stale data beyond EOF to userspace. Found with fsx running sub-block DIO sizes vs MAPREAD/MAPWRITE operations.
Fix this by detecting if the end of the DIO write is beyond EOF and zeroing the tail if necessary.
--- fs/iomap.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
fs/iomap.c +8 -1
@@ -1700,7 +1700,14 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length, dio->submit.cookie =submit_bio (bio); }while (nr_pages); -if (need_zeroout) { +/* +* We need to zeroout the tail of a sub-block write if the extent type +* requires zeroing or the write extends beyond EOF. If we don't zero +* the block tail in the latter case, we can expose stale data via mmap +* reads of the EOF block. +*/ +if (need_zeroout || + ((dio->flags &IOMAP_DIO_WRITE ) && pos >=i_size_read (inode))) {/* zero out from the end of the write to the end of the block */ pad = pos & (fs_block_size -1 );if (pad)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 109/243 sparc: Correct ctx->saw_frame_pointer logic.
In reply to Greg Kroah-HartmanFrom: David Miller <[email protected]>
[ Upstream commit e2ac579a7a18bcd9e8cf14cf42eac0b8a2ba6c4b ]
We need to initialize the frame pointer register not just if it is seen as a source operand, but also if it is seen as the destination operand of a store or an atomic instruction (which effectively is a source operand).
This is exercised by test_verifier's "non-invalid fp arithmetic"
--- arch/sparc/net/bpf_jit_comp_64.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
arch/sparc/net/bpf_jit_comp_64.c +12 -0
@@ -1270,6 +1270,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)const u8 tmp2 = bpf2sparc[TMP_REG_2 ];u32 opcode =0 , rs2; +if (insn->dst_reg ==BPF_REG_FP ) + ctx->saw_frame_pointer = true; + ctx->tmp_2_used = true;emit_loadimm (imm, tmp2, ctx);
@@ -1308,6 +1311,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)const u8 tmp = bpf2sparc[TMP_REG_1 ];u32 opcode =0 , rs2; +if (insn->dst_reg ==BPF_REG_FP ) + ctx->saw_frame_pointer = true; +switch (BPF_SIZE (code)) {case BPF_W : opcode =ST32 ;
@@ -1340,6 +1346,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)const u8 tmp2 = bpf2sparc[TMP_REG_2 ];const u8 tmp3 = bpf2sparc[TMP_REG_3 ]; +if (insn->dst_reg ==BPF_REG_FP ) + ctx->saw_frame_pointer = true; + ctx->tmp_1_used = true; ctx->tmp_2_used = true; ctx->tmp_3_used = true;
@@ -1360,6 +1369,9 @@ static int build_insn(const struct bpf_insn *insn, struct jit_ctx *ctx)const u8 tmp2 = bpf2sparc[TMP_REG_2 ];const u8 tmp3 = bpf2sparc[TMP_REG_3 ]; +if (insn->dst_reg ==BPF_REG_FP ) + ctx->saw_frame_pointer = true; + ctx->tmp_1_used = true; ctx->tmp_2_used = true; ctx->tmp_3_used = true;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 118/243 lockd: fix decoding of TEST results
In reply to Greg Kroah-HartmanFrom: J. Bruce Fields <[email protected]>
[ Upstream commit b8db159239b3f51e2b909859935cc25cb3ff3eed ]
We fail to advance the read pointer when reading the stat.oh field that identifies the lock-holder in a TEST result.
This turns out not to matter if the server is knfsd, which always returns a zero-length field. But other servers (Ganesha is an example) may not do this. The result is bad values in fcntl F_GETLK results.
Fix this.
--- fs/lockd/clnt4xdr.c | 22 ++++++---------------- fs/lockd/clntxdr.c | 22 ++++++---------------- 2 files changed, 12 insertions(+), 32 deletions(-)
fs/lockd/clnt4xdr.c +6 -16
@@ -128,24 +128,14 @@ static void encode_netobj(struct xdr_stream *xdr,static int decode_netobj (struct xdr_stream *xdr,struct xdr_netobj *obj) { -u32 length; -__be32 *p; +ssize_t ret; - p =xdr_inline_decode (xdr,4 ); -if (unlikely (p ==NULL )) - goto out_overflow; - length =be32_to_cpup (p++); -if (unlikely (length >XDR_MAX_NETOBJ )) - goto out_size; - obj->len = length; - obj->data = (u8 *)p; + ret =xdr_stream_decode_opaque_inline (xdr, (void *)&obj->data, +XDR_MAX_NETOBJ ); +if (unlikely (ret <0 )) +return -EIO ; + obj->len = ret;return 0 ; -out_size: -dprintk ("NFS: returned netobj was too long: %u\n" , length); -return -EIO ; -out_overflow: -print_overflow_msg (__func__, xdr); -return -EIO ; }/*
fs/lockd/clntxdr.c +6 -16
@@ -125,24 +125,14 @@ static void encode_netobj(struct xdr_stream *xdr,static int decode_netobj (struct xdr_stream *xdr,struct xdr_netobj *obj) { -u32 length; -__be32 *p; +ssize_t ret; - p =xdr_inline_decode (xdr,4 ); -if (unlikely (p ==NULL )) - goto out_overflow; - length =be32_to_cpup (p++); -if (unlikely (length >XDR_MAX_NETOBJ )) - goto out_size; - obj->len = length; - obj->data = (u8 *)p; + ret =xdr_stream_decode_opaque_inline (xdr, (void *)&obj->data, +XDR_MAX_NETOBJ ); +if (unlikely (ret <0 )) +return -EIO ; + obj->len = ret;return 0 ; -out_size: -dprintk ("NFS: returned netobj was too long: %u\n" , length); -return -EIO ; -out_overflow: -print_overflow_msg (__func__, xdr); -return -EIO ; }/*
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 119/243 sctp: increase sk_wmem_alloc when head->truesize is increased
In reply to Greg Kroah-HartmanFrom: Xin Long <[email protected]>
[ Upstream commit 0d32f17717e65e76cbdb248374dd162acdfe2fff ]
I changed to count sk_wmem_alloc by skb truesize instead of 1 to fix the sk_wmem_alloc leak caused by later truesize's change in xfrm in Commit 02968ccf0125 ("sctp: count sk_wmem_alloc by skb truesize in sctp_packet_transmit").
But I should have also increased sk_wmem_alloc when head->truesize is increased in sctp_packet_gso_append() as xfrm does. Otherwise, sctp gso packet will cause sk_wmem_alloc underflow.
--- net/sctp/output.c | 1 + 1 file changed, 1 insertion(+)
net/sctp/output.c +1 -0
@@ -410,6 +410,7 @@ static void sctp_packet_gso_append(struct sk_buff *head, struct sk_buff *skb) head->truesize += skb->truesize; head->data_len += skb->len; head->len += skb->len; +refcount_add (skb->truesize, &head->sk->sk_wmem_alloc);__skb_header_release (skb); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 120/243 iommu/amd: Fix line-break in error log reporting
In reply to Greg Kroah-HartmanFrom: Joerg Roedel <[email protected]>
[ Upstream commit 1a21ee1aabf7ff9484f2eb122476d80c7f60a620 ]
With the switch to dev_err for reporting errors from the iommu log there was an unwanted newline introduced. The reason was that the reporting was done in multiple dev_err() calls, and dev_err adds a newline after every call.
Fix it by printing the log messages with only one dev_err() call.
--- drivers/iommu/amd_iommu.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
drivers/iommu/amd_iommu.c +10 -12
@@ -549,7 +549,7 @@ static void amd_iommu_report_page_fault(u16 devid, u16 domain_id, dev_data =get_dev_data (&pdev->dev);if (dev_data &&__ratelimit (&dev_data->rs)) { -dev_err (&pdev->dev,"AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x%04x address=0x%016llx flags=0x%04x]\n" , +dev_err (&pdev->dev,"Event logged [IO_PAGE_FAULT domain=0x%04x address=0x%016llx flags=0x%04x]\n" , domain_id, address, flags); }else if (printk_ratelimit ()) { pr_err("AMD-Vi: Event logged [IO_PAGE_FAULT device=%02x:%02x.%x domain=0x%04x address=0x%016llx flags=0x%04x]\n",
@@ -589,43 +589,41 @@ retry:if (type ==EVENT_TYPE_IO_FAULT ) {amd_iommu_report_page_fault (devid, pasid, address, flags);return ; - }else { -dev_err (dev,"AMD-Vi: Event logged [" ); }switch (type) {case EVENT_TYPE_ILL_DEV : -dev_err (dev,"ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n" , +dev_err (dev,"Event logged [ILLEGAL_DEV_TABLE_ENTRY device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n" ,PCI_BUS_NUM (devid),PCI_SLOT (devid),PCI_FUNC (devid), pasid, address, flags);dump_dte_entry (devid);break ;case EVENT_TYPE_DEV_TAB_ERR : -dev_err (dev,"DEV_TAB_HARDWARE_ERROR device=%02x:%02x.%x " +dev_err (dev,"Event logged [DEV_TAB_HARDWARE_ERROR device=%02x:%02x.%x " "address=0x%016llx flags=0x%04x]\n" ,PCI_BUS_NUM (devid),PCI_SLOT (devid),PCI_FUNC (devid), address, flags);break ;case EVENT_TYPE_PAGE_TAB_ERR : -dev_err (dev,"PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x domain=0x%04x address=0x%016llx flags=0x%04x]\n" , +dev_err (dev,"Event logged [PAGE_TAB_HARDWARE_ERROR device=%02x:%02x.%x domain=0x%04x address=0x%016llx flags=0x%04x]\n" ,PCI_BUS_NUM (devid),PCI_SLOT (devid),PCI_FUNC (devid), pasid, address, flags);break ;case EVENT_TYPE_ILL_CMD : -dev_err (dev,"ILLEGAL_COMMAND_ERROR address=0x%016llx]\n" , address); +dev_err (dev,"Event logged [ILLEGAL_COMMAND_ERROR address=0x%016llx]\n" , address);dump_command (address);break ;case EVENT_TYPE_CMD_HARD_ERR : -dev_err (dev,"COMMAND_HARDWARE_ERROR address=0x%016llx flags=0x%04x]\n" , +dev_err (dev,"Event logged [COMMAND_HARDWARE_ERROR address=0x%016llx flags=0x%04x]\n" , address, flags);break ;case EVENT_TYPE_IOTLB_INV_TO : -dev_err (dev,"IOTLB_INV_TIMEOUT device=%02x:%02x.%x address=0x%016llx]\n" , +dev_err (dev,"Event logged [IOTLB_INV_TIMEOUT device=%02x:%02x.%x address=0x%016llx]\n" ,PCI_BUS_NUM (devid),PCI_SLOT (devid),PCI_FUNC (devid), address);break ;case EVENT_TYPE_INV_DEV_REQ : -dev_err (dev,"INVALID_DEVICE_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n" , +dev_err (dev,"Event logged [INVALID_DEVICE_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n" ,PCI_BUS_NUM (devid),PCI_SLOT (devid),PCI_FUNC (devid), pasid, address, flags);break ;
@@ -633,12 +631,12 @@ retry: pasid = ((event[0 ] >>16 ) &0xFFFF ) | ((event[1 ] <<6 ) &0xF0000 ); tag = event[1 ] &0x03FF ; -dev_err (dev,"INVALID_PPR_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n" , +dev_err (dev,"Event logged [INVALID_PPR_REQUEST device=%02x:%02x.%x pasid=0x%05x address=0x%016llx flags=0x%04x]\n" ,PCI_BUS_NUM (devid),PCI_SLOT (devid),PCI_FUNC (devid), pasid, address, flags);break ;default : -dev_err (dev,"UNKNOWN event[0]=0x%08x event[1]=0x%08x event[2]=0x%08x event[3]=0x%08x\n" , +dev_err (dev,"Event logged [UNKNOWN event[0]=0x%08x event[1]=0x%08x event[2]=0x%08x event[3]=0x%08x\n" , event[0 ], event[1 ], event[2 ], event[3 ]); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 121/243 ASoC: rsnd: tidyup registering method for rsnd_kctrl_new()
In reply to Greg Kroah-HartmanFrom: Kuninori Morimoto <[email protected]>
[ Upstream commit 9c698e8481a15237a5b1db5f8391dd66d59e42a4 ]
Current rsnd dvc.c is using flags to avoid duplicating register for MIXer case. OTOH, commit e894efef9ac7 ("ASoC: core: add support to card rebind") allows to rebind sound card without rebinding all drivers.
Because of above patch and dvc.c flags, it can't re-register kctrl if only sound card was rebinded, because dvc is keeping old flags. (Of course it will be no problem if rsnd driver also be rebinded, but it is not purpose of above patch).
This patch checks current card registered kctrl when registering. In MIXer case, it can avoid duplicate register if card already has same kctrl. In rebind case, it can re-register kctrl because card registered kctl had been removed when unbinding.
This patch is updated version of commit b918f1bc7f1ce ("ASoC: rsnd: DVC kctrl sets once")
--- sound/soc/sh/rcar/core.c | 12 ++++++++++++ sound/soc/sh/rcar/dvc.c | 8 -------- 2 files changed, 12 insertions(+), 8 deletions(-)
sound/soc/sh/rcar/core.c +12 -0
@@ -1344,6 +1344,18 @@ int rsnd_kctrl_new(struct rsnd_mod *mod, };int ret; +/* +* 1) Avoid duplicate register (ex. MIXer case) +* 2) re-register if card was rebinded +*/ +list_for_each_entry (kctrl, &card->controls, list) { +struct rsnd_kctrl_cfg *c = kctrl->private_data; + +if (strcmp (kctrl->id.name, name) ==0 && + c->mod == mod) +return 0 ; + } +if (size >RSND_MAX_CHANNELS )return -EINVAL ;
sound/soc/sh/rcar/dvc.c +0 -8
@@ -40,11 +40,8 @@ struct rsnd_dvc {struct rsnd_kctrl_cfg_s ren;/* Ramp Enable */ struct rsnd_kctrl_cfg_s rup;/* Ramp Rate Up */ struct rsnd_kctrl_cfg_s rdown;/* Ramp Rate Down */ -u32 flags; }; -#define KCTRL_INITIALIZED (1 << 0) -#define rsnd_dvc_get (priv, id) ((struct rsnd_dvc *)(priv->dvc) + id)#define rsnd_dvc_nr (priv) ((priv)->dvc_nr)
@@ -227,9 +224,6 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,int channels =rsnd_rdai_channels_get (rdai);int ret; -if (rsnd_flags_has (dvc,KCTRL_INITIALIZED )) -return 0 ; -/* Volume */ ret = rsnd_kctrl_new_m(mod, io, rtd, is_play ?
@@ -285,8 +279,6 @@ static int rsnd_dvc_pcm_new(struct rsnd_mod *mod,if (ret <0 )return ret; -rsnd_flags_set (dvc,KCTRL_INITIALIZED ); -return 0 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 122/243 ARM: dts: sun4i: Fix gpio-keys warning
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit c9b543404c5e1fd51a7ac375294519be5064bf80 ]
Fix the 'unnecessary #address-cells/#size-cells without "ranges" or child "reg" property' DTC warning for the gpio-keys DT node on A10 boards.
--- arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts | 2 -- arch/arm/boot/dts/sun4i-a10-pcduino.dts | 2 -- 2 files changed, 4 deletions(-)
arch/arm/boot/dts/sun4i-a10-inet9f-rev03.dts +0 -2
@@ -63,8 +63,6 @@ compatible = "gpio-keys-polled"; pinctrl-names = "default"; pinctrl-0 = <&key_pins_inet9f>; - #address-cells = <1>; - #size-cells = <0>; poll-interval = <20>; left-joystick-left {
arch/arm/boot/dts/sun4i-a10-pcduino.dts +0 -2
@@ -76,8 +76,6 @@ gpio-keys { compatible = "gpio-keys"; - #address-cells = <1>; - #size-cells = <0>; back { label = "Key Back";
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 123/243 ARM: dts: sun4i: Fix HDMI output DTC warning
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit 123b796d3fac60d69a3737d81901ab483c4efd6e ]
Our HDMI output endpoint on the A10 DTSI has a warning under DTC: "graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary". Fix this by removing those properties.
--- arch/arm/boot/dts/sun4i-a10.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm/boot/dts/sun4i-a10.dtsi +0 -2
@@ -530,8 +530,6 @@ }; hdmi_out: port@1 { - #address-cells = <1>; - #size-cells = <0>; reg = <1>; }; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 124/243 ARM: dts: sun5i: a10s: Fix HDMI output DTC warning
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit ed5fc60b909427be6ca93d3e07a0a5f296d7000a ]
Our HDMI output endpoint on the A10s DTSI has a warning under DTC: "graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary". Fix this by removing those properties.
--- arch/arm/boot/dts/sun5i-a10s.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm/boot/dts/sun5i-a10s.dtsi +0 -2
@@ -104,8 +104,6 @@ }; hdmi_out: port@1 { - #address-cells = <1>; - #size-cells = <0>; reg = <1>; }; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 125/243 ARM: dts: r8a779[01]: Disable unconnected LVDS encoders
In reply to Greg Kroah-HartmanFrom: Laurent Pinchart <[email protected]>
[ Upstream commit 89862542fab10fed8a3c2f9c167622ef4287351d ]
The LVDS0 encoder on Koelsh and Porter, and the LVDS1 encoder on Lager, are enabled in DT but have no device connected to their output. This result in spurious messages being printed to the kernel log such as
rcar-du feb00000.display: no connector for encoder /soc/lvds@feb90000, skipping
Fix it by disabling the encoders.
--- arch/arm/boot/dts/r8a7790-lager.dts | 2 -- arch/arm/boot/dts/r8a7791-koelsch.dts | 2 -- arch/arm/boot/dts/r8a7791-porter.dts | 2 -- 3 files changed, 6 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +0 -2
@@ -489,8 +489,6 @@ }; &lvds1 { - status = "okay"; - ports { port@1 { lvds_connector: endpoint {
arch/arm/boot/dts/r8a7791-koelsch.dts +0 -2
@@ -479,8 +479,6 @@ }; &lvds0 { - status = "okay"; - ports { port@1 { lvds_connector: endpoint {
arch/arm/boot/dts/r8a7791-porter.dts +0 -2
@@ -482,8 +482,6 @@ }; &lvds0 { - status = "okay"; - ports { port@1 { lvds_connector: endpoint {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 126/243 ARM: dts: sun7i: Fix HDMI output DTC warning
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit 4d9a06979b1ae0c802440cb4433dfcd85fc7bdd3 ]
Our HDMI output endpoint on the A10s DTSI has a warning under DTC: "graph node has single child node 'endpoint', #address-cells/#size-cells are not necessary". Fix this by removing those properties.
--- arch/arm/boot/dts/sun7i-a20.dtsi | 2 -- 1 file changed, 2 deletions(-)
arch/arm/boot/dts/sun7i-a20.dtsi +0 -2
@@ -639,8 +639,6 @@ }; hdmi_out: port@1 { - #address-cells = <1>; - #size-cells = <0>; reg = <1>; }; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 110/243 nvme: Free ctrl device name on init failure
In reply to Greg Kroah-HartmanFrom: Keith Busch <[email protected]>
[ Upstream commit d6a2b9535d1e52bea269c138614c4801469d10e1 ]
Free the kobject name that was allocated for the controller device on failure rather than its parent.
--- drivers/nvme/host/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
@@ -3652,7 +3652,7 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev,return 0 ; out_free_name: -kfree_const (dev->kobj.name); +kfree_const (ctrl->device->kobj.name); out_release_instance:ida_simple_remove (&nvme_instance_ida, ctrl->instance); out:
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 128/243 ARM: dts: sun8i: v3s: Change pinctrl nodes to avoid warning
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit 438a44ce7e51ce571f942433c6c7cb87c4c0effd ]
All our pinctrl nodes were using a node name convention with a unit-address to differentiate the different muxing options. However, since those nodes didn't have a reg property, they were generating warnings in DTC.
In order to accomodate for this, convert the old nodes to the syntax we've been using for the new SoCs, including removing the letter suffix of the node labels to the bank of those pins to make things more readable.
--- arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts | 4 ++-- arch/arm/boot/dts/sun8i-v3s.dtsi | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-)
arch/arm/boot/dts/sun8i-v3s-licheepi-zero.dts +2 -2
@@ -78,7 +78,7 @@ }; &mmc0 { - pinctrl-0 = <&mmc0_pins_a>; + pinctrl-0 = <&mmc0_pins>; pinctrl-names = "default"; broken-cd; bus-width = <4>;
@@ -87,7 +87,7 @@ }; &uart0 { - pinctrl-0 = <&uart0_pins_a>; + pinctrl-0 = <&uart0_pb_pins>; pinctrl-names = "default"; status = "okay"; };
arch/arm/boot/dts/sun8i-v3s.dtsi +5 -5
@@ -292,17 +292,17 @@ interrupt-controller; #interrupt-cells = <3>; - i2c0_pins: i2c0 { + i2c0_pins: i2c0-pins { pins = "PB6", "PB7"; function = "i2c0"; }; - uart0_pins_a: uart0@0 { + uart0_pb_pins: uart0-pb-pins { pins = "PB8", "PB9"; function = "uart0"; }; - mmc0_pins_a: mmc0@0 { + mmc0_pins: mmc0-pins { pins = "PF0", "PF1", "PF2", "PF3", "PF4", "PF5"; function = "mmc0";
@@ -310,7 +310,7 @@ bias-pull-up; }; - mmc1_pins: mmc1 { + mmc1_pins: mmc1-pins { pins = "PG0", "PG1", "PG2", "PG3", "PG4", "PG5"; function = "mmc1";
@@ -318,7 +318,7 @@ bias-pull-up; }; - spi0_pins: spi0 { + spi0_pins: spi0-pins { pins = "PC0", "PC1", "PC2", "PC3"; function = "spi0"; };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 129/243 dlm: NULL check before kmem_cache_destroy is not needed
In reply to Greg Kroah-HartmanFrom: Wen Yang <[email protected]>
[ Upstream commit f31a89692830061bceba8469607e4e4b0f900159 ]
kmem_cache_destroy(NULL) is safe, so removes NULL check before freeing the mem. This patch also fix ifnullfree.cocci warnings.
--- fs/dlm/memory.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
fs/dlm/memory.c +3 -6
@@ -38,10 +38,8 @@ int __init dlm_memory_init(void)void dlm_memory_exit (void ) { -if (lkb_cache) -kmem_cache_destroy (lkb_cache); -if (rsb_cache) -kmem_cache_destroy (rsb_cache); +kmem_cache_destroy (lkb_cache); +kmem_cache_destroy (rsb_cache); }char *dlm_allocate_lvb (struct dlm_ls *ls)
@@ -86,8 +84,7 @@ void dlm_free_lkb(struct dlm_lkb *lkb)struct dlm_user_args *ua; ua = lkb->lkb_ua;if (ua) { -if (ua->lksb.sb_lvbptr) -kfree (ua->lksb.sb_lvbptr); +kfree (ua->lksb.sb_lvbptr);kfree (ua); } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 130/243 ARM: debug: enable UART1 for socfpga Cyclone5
In reply to Greg Kroah-HartmanFrom: Clément Péron <[email protected]>
[ Upstream commit f6628486c8489e91c513b62608f89ccdb745600d ]
Cyclone5 and Arria10 doesn't have the same memory map for UART1.
Split the SOCFPGA_UART1 into 2 options to allow debugging on UART1 for Cyclone5.
--- arch/arm/Kconfig.debug | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-)
arch/arm/Kconfig.debug +16 -7
@@ -1079,14 +1079,21 @@ choice Say Y here if you want kernel low-level debugging support on SOCFPGA(Cyclone 5 and Arria 5) based platforms. - config DEBUG_SOCFPGA_UART1 + config DEBUG_SOCFPGA_ARRIA10_UART1 depends on ARCH_SOCFPGA - bool "Use SOCFPGA UART1 for low-level debug" + bool "Use SOCFPGA Arria10 UART1 for low-level debug" select DEBUG_UART_8250 help Say Y here if you want kernel low-level debugging support on SOCFPGA(Arria 10) based platforms. + config DEBUG_SOCFPGA_CYCLONE5_UART1 + depends on ARCH_SOCFPGA + bool "Use SOCFPGA Cyclone 5 UART1 for low-level debug" + select DEBUG_UART_8250 + help + Say Y here if you want kernel low-level debugging support + on SOCFPGA(Cyclone 5 and Arria 5) based platforms. config DEBUG_SUN9I_UART0 bool "Kernel low-level debugging messages via sun9i UART0"
@@ -1647,7 +1654,8 @@ config DEBUG_UART_PHYS default 0xfe800000 if ARCH_IOP32X default 0xff690000 if DEBUG_RK32_UART2 default 0xffc02000 if DEBUG_SOCFPGA_UART0 - default 0xffc02100 if DEBUG_SOCFPGA_UART1 + default 0xffc02100 if DEBUG_SOCFPGA_ARRIA10_UART1 + default 0xffc03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 default 0xffd82340 if ARCH_IOP13XX default 0xffe40000 if DEBUG_RCAR_GEN1_SCIF0 default 0xffe42000 if DEBUG_RCAR_GEN1_SCIF2
@@ -1754,7 +1762,8 @@ config DEBUG_UART_VIRT default 0xfeb30c00 if DEBUG_KEYSTONE_UART0 default 0xfeb31000 if DEBUG_KEYSTONE_UART1 default 0xfec02000 if DEBUG_SOCFPGA_UART0 - default 0xfec02100 if DEBUG_SOCFPGA_UART1 + default 0xfec02100 if DEBUG_SOCFPGA_ARRIA10_UART1 + default 0xfec03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 default 0xfec12000 if (DEBUG_MVEBU_UART0 || DEBUG_MVEBU_UART0_ALTERNATE) && ARCH_MVEBU default 0xfec12100 if DEBUG_MVEBU_UART1_ALTERNATE default 0xfec10000 if DEBUG_SIRFATLAS7_UART0
@@ -1803,9 +1812,9 @@ config DEBUG_UART_8250_WORD depends on DEBUG_LL_UART_8250 || DEBUG_UART_8250 depends on DEBUG_UART_8250_SHIFT >= 2 default y if DEBUG_PICOXCELL_UART || \ - DEBUG_SOCFPGA_UART0 || DEBUG_SOCFPGA_UART1 || \ - DEBUG_KEYSTONE_UART0 || DEBUG_KEYSTONE_UART1 || \ - DEBUG_ALPINE_UART0 || \ + DEBUG_SOCFPGA_UART0 || DEBUG_SOCFPGA_ARRIA10_UART1 || \ + DEBUG_SOCFPGA_CYCLONE5_UART1 || DEBUG_KEYSTONE_UART0 || \ + DEBUG_KEYSTONE_UART1 || DEBUG_ALPINE_UART0 || \ DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \ DEBUG_DAVINCI_DA8XX_UART2 || DEBUG_BCM_IPROC_UART3 || \ DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 131/243 can: xilinx: fix return type of ndo_start_xmit function
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit 81de0cd60fd492575b24d97667f38b8b833fb058 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/can/xilinx_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/xilinx_can.c +1 -1
@@ -612,7 +612,7 @@ static int xcan_start_xmit_mailbox(struct sk_buff *skb, struct net_device *ndev)* * Return: NETDEV_TX_OK on success and NETDEV_TX_BUSY when the tx queue is full */ -static int xcan_start_xmit (struct sk_buff *skb,struct net_device *ndev) +static netdev_tx_t xcan_start_xmit (struct sk_buff *skb,struct net_device *ndev) {struct xcan_priv *priv =netdev_priv (ndev);int ret;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 133/243 bpf: btf: implement btf_name_valid_identifier()
In reply to Greg Kroah-HartmanFrom: Yonghong Song <[email protected]>
[ Upstream commit cdbb096adddb3f42584cecb5ec2e07c26815b71f ]
Function btf_name_valid_identifier() have been implemented in bpf-next commit 2667a2626f4d ("bpf: btf: Add BTF_KIND_FUNC and BTF_KIND_FUNC_PROTO"). Backport this function so later patch can use it.
--- kernel/bpf/btf.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
kernel/bpf/btf.c +25 -0
@@ -5,6 +5,7 @@#include <uapi/linux/types.h> #include <linux/seq_file.h> #include <linux/compiler.h> +#include <linux/ctype.h> #include <linux/errno.h> #include <linux/slab.h> #include <linux/anon_inodes.h>
@@ -426,6 +427,30 @@ static bool btf_name_offset_valid(const struct btf *btf, u32 offset) offset < btf->hdr.str_len; } +/* Only C-style identifier is permitted. This can be relaxed if +* necessary. +*/ +static bool btf_name_valid_identifier (const struct btf *btf,u32 offset) +{ +/* offset must be valid */ +const char *src = &btf->strings[offset]; +const char *src_limit; + +if (!isalpha (*src) && *src !='_' ) +return false; + +/* set a limit on identifier length */ + src_limit = src +KSYM_NAME_LEN ; + src++; +while (*src && src < src_limit) { +if (!isalnum (*src) && *src !='_' ) +return false; + src++; + } + +return !*src; +} +static const char *btf_name_by_offset (const struct btf *btf,u32 offset) {if (!offset)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 132/243 nfsd: fix a warning in __cld_pipe_upcall()
In reply to Greg Kroah-HartmanFrom: Scott Mayhew <[email protected]>
[ Upstream commit b493fd31c0b89d9453917e977002de58bebc3802 ]
__cld_pipe_upcall() emits a "do not call blocking ops when !TASK_RUNNING" warning due to the dput() call in rpc_queue_upcall(). Fix it by using a completion instead of hand coding the wait.
--- fs/nfsd/nfs4recover.c | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-)
fs/nfsd/nfs4recover.c +6 -11
@@ -662,7 +662,7 @@ struct cld_net {struct cld_upcall {struct list_head cu_list;struct cld_net *cu_net; -struct task_struct *cu_task; +struct completion cu_done;struct cld_msg cu_msg; };
@@ -671,23 +671,18 @@ __cld_pipe_upcall(struct rpc_pipe *pipe, struct cld_msg *cmsg) {int ret;struct rpc_pipe_msg msg; + struct cld_upcall *cup = container_of(cmsg, struct cld_upcall, cu_msg);memset (&msg,0 ,sizeof (msg)); msg.data = cmsg; msg.len =sizeof (*cmsg); -/* -* Set task state before we queue the upcall. That prevents -* wake_up_process in the downcall from racing with schedule. -*/ -set_current_state (TASK_UNINTERRUPTIBLE ); ret =rpc_queue_upcall (pipe, &msg);if (ret <0 ) { -set_current_state (TASK_RUNNING ); goto out; } -schedule (); +wait_for_completion (&cup->cu_done);if (msg.errno <0 ) ret = msg.errno;
@@ -754,7 +749,7 @@ cld_pipe_downcall(struct file *filp, const char __user *src, size_t mlen)if (copy_from_user (&cup->cu_msg, src, mlen) !=0 )return -EFAULT ; -wake_up_process (cup->cu_task); +complete (&cup->cu_done);return mlen; }
@@ -769,7 +764,7 @@ cld_pipe_destroy_msg(struct rpc_pipe_msg *msg)if (msg->errno >=0 )return ; -wake_up_process (cup->cu_task); +complete (&cup->cu_done); }static const struct rpc_pipe_ops cld_upcall_ops = {
@@ -900,7 +895,7 @@ restart_search: goto restart_search; } } - new->cu_task = current; +init_completion (&new->cu_done); new->cu_msg.cm_vers =CLD_UPCALL_VERSION ;put_unaligned (cn->cn_xid++, &new->cu_msg.cm_xid); new->cu_net = cn;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 134/243 bpf: btf: check name validity for various types
In reply to Greg Kroah-HartmanFrom: Yonghong Song <[email protected]>
[ Upstream commit eb04bbb608e683f8fd3ef7f716e2fa32dd90861f ]
This patch added name checking for the following types:
. BTF_KIND_PTR, BTF_KIND_ARRAY, BTF_KIND_VOLATILE,
BTF_KIND_CONST, BTF_KIND_RESTRICT:
the name must be null
. BTF_KIND_STRUCT, BTF_KIND_UNION: the struct/member name
is either null or a valid identifier
. BTF_KIND_ENUM: the enum type name is either null or a valid
identifier; the enumerator name must be a valid identifier.
. BTF_KIND_FWD: the name must be a valid identifier
. BTF_KIND_TYPEDEF: the name must be a valid identifier
For those places a valid name is required, the name must be a valid C identifier. This can be relaxed later if we found use cases for a different (non-C) frontend.
--- kernel/bpf/btf.c | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+)
kernel/bpf/btf.c +57 -0
@@ -1168,6 +1168,22 @@ static int btf_ref_type_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* typedef type must have a valid name, and other ref types, +* volatile, const, restrict, should have a null name. +*/ +if (BTF_INFO_KIND (t->info) ==BTF_KIND_TYPEDEF ) { +if (!t->name_off || + !btf_name_valid_identifier (env->btf, t->name_off)) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } + }else { +if (t->name_off) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } + } +btf_verifier_log_type (env, t,NULL );return 0 ;
@@ -1325,6 +1341,13 @@ static s32 btf_fwd_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* fwd type must have a valid name */ +if (!t->name_off || + !btf_name_valid_identifier (env->btf, t->name_off)) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } +btf_verifier_log_type (env, t,NULL );return 0 ;
@@ -1381,6 +1404,12 @@ static s32 btf_array_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* array type should not have a name */ +if (t->name_off) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } +if (btf_type_vlen (t)) {btf_verifier_log_type (env, t,"vlen != 0" );return -EINVAL ;
@@ -1557,6 +1586,13 @@ static s32 btf_struct_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* struct type either no name or a valid one */ +if (t->name_off && + !btf_name_valid_identifier (env->btf, t->name_off)) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } +btf_verifier_log_type (env, t,NULL ); last_offset =0 ;
@@ -1568,6 +1604,12 @@ static s32 btf_struct_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* struct member either no name or a valid one */ +if (member->name_off && + !btf_name_valid_identifier (btf, member->name_off)) { +btf_verifier_log_member (env, t, member,"Invalid name" ); +return -EINVAL ; + }/* A member cannot be in type void */ if (!member->type || !BTF_TYPE_ID_VALID (member->type)) { btf_verifier_log_member(env, t, member,
@@ -1755,6 +1797,13 @@ static s32 btf_enum_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* enum type either no name or a valid one */ +if (t->name_off && + !btf_name_valid_identifier (env->btf, t->name_off)) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } +btf_verifier_log_type (env, t,NULL );for (i =0 ; i < nr_enums; i++) {
@@ -1764,6 +1813,14 @@ static s32 btf_enum_check_meta(struct btf_verifier_env *env,return -EINVAL ; } +/* enum member must have a valid name */ +if (!enums[i].name_off || + !btf_name_valid_identifier (btf, enums[i].name_off)) { +btf_verifier_log_type (env, t,"Invalid name" ); +return -EINVAL ; + } + +btf_verifier_log (env,"\t%s val=%d\n" ,btf_name_by_offset (btf, enums[i].name_off), enums[i].val);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 135/243 tools: bpftool: fix a bitfield pretty print issue
In reply to Greg Kroah-HartmanFrom: Yonghong Song <[email protected]>
[ Upstream commit 528bff0cdb6649f97f2c4802e4ac7a4b50645f2f ]
Commit b12d6ec09730 ("bpf: btf: add btf print functionality") added btf pretty print functionality to bpftool. There is a problem though in printing a bitfield whose type has modifiers.
For example, for a type like
typedef int ___int;
struct tmp_t {
int a:3;
___int b:3; };
Suppose we have a map
struct bpf_map_def SEC("maps") tmpmap = {
.type = BPF_MAP_TYPE_HASH, .key_size = sizeof(__u32), .value_size = sizeof(struct tmp_t), .max_entries = 1,
};
and the hash table is populated with one element with key 0 and value (.a = 1 and .b = 2).
In BTF, the struct member "b" will have a type "typedef" which points to an int type. The current implementation does not pass the bit offset during transition from typedef to int type, hence incorrectly print the value as
$ bpftool m d id 79
[{
"key": 0,
"value": {
"a": 0x1,
"b": 0x1
}
}
]This patch fixed the issue by carrying bit_offset along the type chain during bit_field print. The correct result can be printed as
$ bpftool m d id 76
[{
"key": 0,
"value": {
"a": 0x1,
"b": 0x2
}
}
]The kernel pretty print is implemented correctly and does not have this issue.
--- tools/bpf/bpftool/btf_dumper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/bpf/bpftool/btf_dumper.c +3 -3
@@ -32,7 +32,7 @@ static void btf_dumper_ptr(const void *data, json_writer_t *jw, }static int btf_dumper_modifier (const struct btf_dumper *d,__u32 type_id, -const void *data) +__u8 bit_offset,const void *data) {int actual_type_id;
@@ -40,7 +40,7 @@ static int btf_dumper_modifier(const struct btf_dumper *d, __u32 type_id,if (actual_type_id <0 )return actual_type_id; -return btf_dumper_do_type (d, actual_type_id,0 , data); +return btf_dumper_do_type (d, actual_type_id, bit_offset, data); }static void btf_dumper_enum (const void *data,json_writer_t *jw)
@@ -237,7 +237,7 @@ static int btf_dumper_do_type(const struct btf_dumper *d, __u32 type_id,case BTF_KIND_VOLATILE :case BTF_KIND_CONST :case BTF_KIND_RESTRICT : -return btf_dumper_modifier (d, type_id, data); +return btf_dumper_modifier (d, type_id, bit_offset, data);default :jsonw_printf (d->jw,"(unsupported-kind" );return -EINVAL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 136/243 ASoC: au8540: use 64-bit arithmetic instead of 32-bit
In reply to Greg Kroah-HartmanFrom: Young_X <[email protected]>
[ Upstream commit cd7fdc45bc69a62b4e22c6e875f1f1aea566256d ]
Add suffix ULL to constant 256 in order to give the compiler complete information about the proper arithmetic to use.
Notice that such constant is used in a context that expects an expression of type u64 (64 bits, unsigned) and the following expression is currently being evaluated using 32-bit arithmetic:
256 * fs * 2 * mclk_src_scaling[i].param
--- sound/soc/codecs/nau8540.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/nau8540.c +1 -1
@@ -585,7 +585,7 @@ static int nau8540_calc_fll_param(unsigned int fll_in, fvco_max =0 ; fvco_sel =ARRAY_SIZE (mclk_src_scaling);for (i =0 ; i <ARRAY_SIZE (mclk_src_scaling); i++) { - fvco =256 * fs *2 * mclk_src_scaling[i].param; + fvco =256ULL * fs *2 * mclk_src_scaling[i].param;if (fvco >NAU_FVCO_MIN && fvco <NAU_FVCO_MAX && fvco_max < fvco) { fvco_max = fvco;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 137/243 gpio: OF: Parse MMC-specific CD and WP properties
In reply to Greg Kroah-HartmanFrom: Linus Walleij <[email protected]>
[ Upstream commit 81c85ec15a1946f2e347ec0bf66936121eb97ce7 ]
When retrieveing CD (card detect) and WP (write protect) GPIO handles from the device tree, make sure to assign them active low by default unless the "cd-inverted" or "wp-inverted" properties are set. These properties mean that respective signal is active HIGH since the SDHCI specification stipulates that this kind of signals should be treated as active LOW.
If the twocell GPIO flag is also specified as active low, well that's nice and we will silently ignore the tautological specification.
If however the GPIO line is specified as active low in the GPIO flasg cell and "cd-inverted" or "wp-inverted" is also specified, the latter takes precedence and we print a warning.
The current effect on the MMC slot-gpio core are as follows:
For CD GPIOs: no effect. The current code in mmc/core/host.c calls mmc_gpiod_request_cd() with the "override_active_level" argument set to true, which means that whatever the GPIO descriptor thinks about active low/high will be ignored, the core will use the MMC_CAP2_CD_ACTIVE_HIGH to keep track of this and reads the raw value from the GPIO descriptor, totally bypassing gpiolibs inversion semantics. I plan to clean this up at a later point passing the handling of inversion semantics over to gpiolib, so this patch prepares the ground for that.
Fow WP GPIOs: this is probably fixing a bug, because the code in mmc/core/host.c calls mmc_gpiod_request_ro() with the "override_active_level" argument set to false, which means it will respect the inversion semantics of the gpiolib and ignore the MMC_CAP2_RO_ACTIVE_HIGH flag for everyone using this through device tree. However the code in host.c confusingly goes to great lengths setting up the MMC_CAP2_RO_ACTIVE_HIGH flag from the GPIO descriptor and by reading the "wp-inverted" property of the node. As far as I can tell this is all in vain and the inversion is broken: device trees that use "wp-inverted" do not work as intended, instead the only way to actually get inversion on a line is by setting the second cell flag to GPIO_ACTIVE_HIGH (which will be the default) or GPIO_ACTIVE_LOW if they want the proper MMC semantics. Presumably all device trees do this right but we need to parse and handle this properly.
--- drivers/gpio/gpiolib-of.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
drivers/gpio/gpiolib-of.c +39 -0
@@ -60,6 +60,45 @@ static struct gpio_desc *of_xlate_and_get_gpiod_flags(struct gpio_chip *chip,static void of_gpio_flags_quirks (struct device_node *np,enum of_gpio_flags *flags) { +/* +* Handle MMC "cd-inverted" and "wp-inverted" semantics. +*/ +if (IS_ENABLED (CONFIG_MMC )) { +if (of_property_read_bool (np,"cd-gpios" )) { +if (of_property_read_bool (np,"cd-inverted" )) { +if (*flags &OF_GPIO_ACTIVE_LOW ) { +/* "cd-inverted" takes precedence */ + *flags &= ~OF_GPIO_ACTIVE_LOW ; +pr_warn ("%s GPIO handle specifies CD active low - ignored\n" , +of_node_full_name (np)); + } + }else { +/* +* Active low is the default according to the +* SDHCI specification. If the GPIO handle +* specifies the same thing - good. +*/ + *flags |=OF_GPIO_ACTIVE_LOW ; + } + } +if (of_property_read_bool (np,"wp-gpios" )) { +if (of_property_read_bool (np,"wp-inverted" )) { +/* "wp-inverted" takes precedence */ +if (*flags &OF_GPIO_ACTIVE_LOW ) { + *flags &= ~OF_GPIO_ACTIVE_LOW ; +pr_warn ("%s GPIO handle specifies WP active low - ignored\n" , +of_node_full_name (np)); + } + }else { +/* +* Active low is the default according to the +* SDHCI specification. If the GPIO handle +* specifies the same thing - good. +*/ + *flags |=OF_GPIO_ACTIVE_LOW ; + } + } + }/* * Some GPIO fixed regulator quirks. * Note that active low is the default.
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 111/243 dma-mapping: fix return type of dma_set_max_seg_size()
In reply to Greg Kroah-HartmanFrom: Niklas Söderlund <[email protected]>
[ Upstream commit c9d76d0655c06b8c1f944e46c4fd9e9cf4b331c0 ]
The function dma_set_max_seg_size() can return either 0 on success or -EIO on error. Change its return type from unsigned int to int to capture this.
--- include/linux/dma-mapping.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/linux/dma-mapping.h +1 -2
@@ -674,8 +674,7 @@ static inline unsigned int dma_get_max_seg_size(struct device *dev)return SZ_64K ; } -static inline unsigned int dma_set_max_seg_size (struct device *dev, -unsigned int size) +static inline int dma_set_max_seg_size (struct device *dev,unsigned int size) {if (dev->dma_parms) { dev->dma_parms->max_segment_size = size;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 140/243 arm64: dts: meson-gxbb-nanopi-k2: fix GPIO lines names
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit f0783f5edb52af14ecaae6c5ce4f38e0a358f5d8 ]
The gpio line names were set in the pinctrl node instead of the gpio node, at the time it was merged, it worked, but was obviously wrong. This patch moves the properties to the gpio nodes.
--- arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +2 -2
@@ -191,7 +191,7 @@ pinctrl-names = "default"; }; -&pinctrl_aobus { +&gpio_ao { gpio-line-names = "UART TX", "UART RX", "Power Control", "Power Key In", "VCCK En", "CON1 Header Pin31", "I2S Header Pin6", "IR In", "I2S Header Pin7",
@@ -201,7 +201,7 @@ ""; }; -&pinctrl_periphs { +&gpio { gpio-line-names = /* Bank GPIOZ */ "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk", "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 141/243 arm64: dts: meson-gxbb-odroidc2: fix GPIO lines names
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit 2165b006b65d609140dafafcb14cce5a4aaacbab ]
The gpio line names were set in the pinctrl node instead of the gpio node, at the time it was merged, it worked, but was obviously wrong. This patch moves the properties to the gpio nodes.
--- arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +2 -2
@@ -187,7 +187,7 @@ pinctrl-names = "default"; }; -&pinctrl_aobus { +&gpio_ao { gpio-line-names = "UART TX", "UART RX", "VCCK En", "TF 3V3/1V8 En", "USB HUB nRESET", "USB OTG Power En", "J7 Header Pin2", "IR In", "J7 Header Pin4",
@@ -197,7 +197,7 @@ ""; }; -&pinctrl_periphs { +&gpio { gpio-line-names = /* Bank GPIOZ */ "Eth MDIO", "Eth MDC", "Eth RGMII RX Clk", "Eth RX DV", "Eth RX D0", "Eth RX D1", "Eth RX D2",
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 142/243 arm64: dts: meson-gxl-khadas-vim: fix GPIO lines names
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit 5b78012636f537344bd551934387f5772c38ba80 ]
The gpio line names were set in the pinctrl node instead of the gpio node, at the time it was merged, it worked, but was obviously wrong. This patch moves the properties to the gpio nodes.
--- arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts +2 -2
@@ -112,7 +112,7 @@ linux,rc-map-name = "rc-geekbox"; }; -&pinctrl_aobus { +&gpio_ao { gpio-line-names = "UART TX", "UART RX", "Power Key In",
@@ -127,7 +127,7 @@ ""; }; -&pinctrl_periphs { +&gpio { gpio-line-names = /* Bank GPIOZ */ "", "", "", "", "", "", "", "", "", "", "", "", "", "",
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 143/243 net/x25: fix called/calling length calculation in x25_parse_address_block
In reply to Greg Kroah-HartmanFrom: Martin Schiller <[email protected]>
[ Upstream commit d449ba3d581ed29f751a59792fdc775572c66904 ]
The length of the called and calling address was not calculated correctly (BCD encoding).
--- net/x25/af_x25.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/x25/af_x25.c +1 -1
@@ -100,7 +100,7 @@ int x25_parse_address_block(struct sk_buff *skb, } len = *skb->data; - needed =1 + (len >>4 ) + (len &0x0f ); + needed =1 + ((len >>4 ) + (len &0x0f ) +1 ) /2 ;if (!pskb_may_pull (skb, needed)) {/* packet is too short to hold the addresses it claims
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 144/243 net/x25: fix null_x25_address handling
In reply to Greg Kroah-HartmanFrom: Martin Schiller <[email protected]>
[ Upstream commit 06137619f061f498c2924f6543fa45b7d39f0501 ]
o x25_find_listener(): the compare for the null_x25_address was wrong. We have to check the x25_addr of the listener socket instead of the x25_addr of the incomming call.
o x25_bind(): it was not possible to bind a socket to null_x25_address
--- net/x25/af_x25.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
net/x25/af_x25.c +10 -6
@@ -288,7 +288,7 @@ static struct sock *x25_find_listener(struct x25_address *addr,sk_for_each (s, &x25_list)if ((!strcmp (addr->x25_addr,x25_sk (s)->source_addr.x25_addr) || - !strcmp (addr->x25_addr, + !strcmp (x25_sk (s)->source_addr.x25_addr, null_x25_address.x25_addr)) && s->sk_state ==TCP_LISTEN ) {/*
@@ -685,11 +685,15 @@ static int x25_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) goto out; } - len =strlen (addr->sx25_addr.x25_addr); -for (i =0 ; i < len; i++) { -if (!isdigit (addr->sx25_addr.x25_addr[i])) { - rc = -EINVAL ; - goto out; +/* check for the null_x25_address */ +if (strcmp (addr->sx25_addr.x25_addr, null_x25_address.x25_addr)) { + + len =strlen (addr->sx25_addr.x25_addr); +for (i =0 ; i < len; i++) { +if (!isdigit (addr->sx25_addr.x25_addr[i])) { + rc = -EINVAL ; + goto out; + } } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 145/243 tools/bpf: make libbpf _GNU_SOURCE friendly
In reply to Greg Kroah-HartmanFrom: Yonghong Song <[email protected]>
[ Upstream commit b42699547fc9fb1057795bccc21a6445743a7fde ]
During porting libbpf to bcc, I got some warnings like below:
...
[ 2%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/libbpf.c.o /home/yhs/work/bcc2/src/cc/libbpf/src/libbpf.c:12:0:
warning: "_GNU_SOURCE" redefined [enabled by default]
#define _GNU_SOURCE
...
[ 3%] Building C object src/cc/CMakeFiles/bpf-shared.dir/libbpf/src/libbpf_errno.c.o /home/yhs/work/bcc2/src/cc/libbpf/src/libbpf_errno.c: In function ‘libbpf_strerror’:
/home/yhs/work/bcc2/src/cc/libbpf/src/libbpf_errno.c:45:7:
warning: assignment makes integer from pointer without a cast [enabled by default]
ret = strerror_r(err, buf, size);
...
bcc is built with _GNU_SOURCE defined and this caused the above warning. This patch intends to make libpf _GNU_SOURCE friendly by
. define _GNU_SOURCE in libbpf.c unless it is not defined . undefine _GNU_SOURCE as non-gnu version of strerror_r is expected.
--- tools/lib/bpf/libbpf.c | 2 ++ tools/lib/bpf/libbpf_errno.c | 1 + 2 files changed, 3 insertions(+)
tools/lib/bpf/libbpf.c +2 -0
@@ -22,7 +22,9 @@* License along with this program; if not, see <http://www.gnu.org/licenses> */ +#ifndef _GNU_SOURCE#define _GNU_SOURCE +#endif #include <stdlib.h> #include <stdio.h> #include <stdarg.h>
tools/lib/bpf/libbpf_errno.c +1 -0
@@ -20,6 +20,7 @@* License along with this program; if not, see <http://www.gnu.org/licenses> */ +#undef _GNU_SOURCE#include <stdio.h> #include <string.h>
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 146/243 clk: mediatek: Drop __init from mtk_clk_register_cpumuxes()
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
commit 28f1186a26f7e4e5df7be454710da26c810effb6 upstream.
This function is used from more places than just __init code. Removing __init silences a section mismatch warning here.
--- drivers/clk/mediatek/clk-cpumux.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/mediatek/clk-cpumux.c +4 -4
@@ -53,7 +53,7 @@ static const struct clk_ops clk_cpumux_o .set_parent = clk_cpumux_set_parent, }; -static struct clk __init * +static struct clk *mtk_clk_register_cpumux (const struct mtk_composite *mux,struct regmap *regmap) {
@@ -84,9 +84,9 @@ mtk_clk_register_cpumux(const struct mtkreturn clk; } -int __init mtk_clk_register_cpumuxes (struct device_node *node, -const struct mtk_composite *clks,int num, -struct clk_onecell_data *clk_data) +int mtk_clk_register_cpumuxes (struct device_node *node, +const struct mtk_composite *clks,int num, +struct clk_onecell_data *clk_data) {int i;struct clk *clk;
Greg Kroah-Hartman
maintainerPATCH 147/243 clk: mediatek: Drop more __init markings for driver probe
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit 553604c041b8c18cd6a8e1d785a77f3e4be61cdb ]
This function is called from driver probe, which isn't the same as __init code because driver probe can happen later. Drop the __init marking here to fix this potential problem.
--- drivers/clk/mediatek/clk-mt7622.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/mediatek/clk-mt7622.c +2 -2
@@ -513,7 +513,7 @@ static const struct mtk_gate peri_clks[] GATE_PERI1(CLK_PERI_IRTX_PD, "peri_irtx_pd", "irtx_sel", 2), }; -static struct mtk_composite infra_muxes[]__initdata = { +static struct mtk_composite infra_muxes[] = {MUX (CLK_INFRA_MUX1_SEL ,"infra_mux1_sel" , infra_mux1_parents,0x000 ,2 ,2 ), };
@@ -652,7 +652,7 @@ static int mtk_topckgen_init(struct platreturn of_clk_add_provider (node, of_clk_src_onecell_get, clk_data); } -static int __init mtk_infrasys_init (struct platform_device *pdev) +static int mtk_infrasys_init (struct platform_device *pdev) {struct device_node *node = pdev->dev.of_node;struct clk_onecell_data *clk_data;
Greg Kroah-Hartman
maintainerPATCH 113/243 altera-stapl: check for a null key before strcasecmping it
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
[ Upstream commit 9ccb645683ef46e3c52c12c088a368baa58447d4 ]
Currently the null check on key is occurring after the strcasecmp on the key, hence there is a potential null pointer dereference on key. Fix this by checking if key is null first. Also replace the == 0 check on strcasecmp with just the ! operator.
Detected by CoverityScan, CID#1248787 ("Dereference before null check")
--- drivers/misc/altera-stapl/altera.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/altera-stapl/altera.c +1 -2
@@ -2176,8 +2176,7 @@ static int altera_get_note(u8 *p, s32 program_size, key_ptr = &p[note_strings +get_unaligned_be32 ( &p[note_table + (8 * i)])]; -if ((strncasecmp (key, key_ptr,strlen (key_ptr)) ==0 ) && - (key !=NULL )) { +if (key && !strncasecmp (key, key_ptr,strlen (key_ptr))) { status =0 ; value_ptr = &p[note_strings +
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 112/243 slimbus: ngd: Fix build error on x86
In reply to Greg Kroah-HartmanFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit 458a445deb9c9fb13cec46fe9b179a84d2ff514f ]
on non DT platforms like x86 of_match_node is set to NULL, dereferencing directly would throw an error.
Fix this by doing this in two steps, get the match then the data.
--- drivers/slimbus/qcom-ngd-ctrl.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/slimbus/qcom-ngd-ctrl.c +3 -2
@@ -1326,11 +1326,12 @@ static int of_qcom_slim_ngd_register(struct device *parent, {const struct ngd_reg_offset_data *data;struct qcom_slim_ngd *ngd; +const struct of_device_id *match;struct device_node *node;u32 id; - data =of_match_node (qcom_slim_ngd_dt_match, parent->of_node)->data; - + match =of_match_node (qcom_slim_ngd_dt_match, parent->of_node); + data = match->data;for_each_available_child_of_node (parent->of_node, node) {if (of_property_read_u32 (node,"reg" , &id))continue ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 114/243 serial: imx: fix error handling in console_setup
In reply to Greg Kroah-HartmanFrom: Stefan Agner <[email protected]>
[ Upstream commit 63fd4b94b948c14eeb27a3bbf50ea0f7f0593bad ]
The ipg clock only needs to be unprepared in case preparing per clock fails. The ipg clock has already disabled at the point.
--- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/imx.c +1 -1
@@ -2071,7 +2071,7 @@ imx_uart_console_setup(struct console *co, char *options) retval =clk_prepare (sport->clk_per);if (retval) -clk_disable_unprepare (sport->clk_ipg); +clk_unprepare (sport->clk_ipg); error_console:return retval;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 116/243 clk: meson: Fix GXL HDMI PLL fractional bits width
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit 21310c39ec01e82ef3ef9bf8ac385b53ccdc158c ]
The GXL Documentation specifies 12 bits for the Fractional bit field, bit the last bits have a different purpose that we cannot handle right now, so update the bitwidth to have correct fractional calculations.
--- drivers/clk/meson/gxbb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/clk/meson/gxbb.c +7 -1
@@ -295,6 +295,12 @@ static struct clk_regmap gxl_hdmi_pll = { .shift = 9, .width = 5, }, +/* +* On gxl, there is a register shift due to +* HHI_HDMI_PLL_CNTL1 which does not exist on gxbb, +* so we use the HHI_HDMI_PLL_CNTL2 define from GXBB +* instead which is defined at the same offset. +*/ .frac = {/* * On gxl, there is a register shift due to
@@ -304,7 +310,7 @@ static struct clk_regmap gxl_hdmi_pll = {*/ .reg_off = HHI_HDMI_PLL_CNTL + 4, .shift = 0, - .width = 12, + .width = 10, }, .od = { .reg_off = HHI_HDMI_PLL_CNTL + 8,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 115/243 i2c: imx: dont print error message on probe defer
In reply to Greg Kroah-HartmanFrom: Lucas Stach <[email protected]>
[ Upstream commit fece4978510e43f09c8cd386fee15210e8c68493 ]
Probe deferral is a normal operating condition in the probe function, so don't spam the log with an error in this case.
--- drivers/i2c/busses/i2c-imx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/i2c/busses/i2c-imx.c +2 -1
@@ -1090,7 +1090,8 @@ static int i2c_imx_probe(struct platform_device *pdev)/* Get I2C clock */ i2c_imx->clk =devm_clk_get (&pdev->dev,NULL );if (IS_ERR (i2c_imx->clk)) { -dev_err (&pdev->dev,"can't get I2C clock\n" ); +if (PTR_ERR (i2c_imx->clk) != -EPROBE_DEFER ) +dev_err (&pdev->dev,"can't get I2C clock\n" );return PTR_ERR (i2c_imx->clk); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 117/243 gpu: host1x: Fix syncpoint ID field size on Tegra186
In reply to Greg Kroah-HartmanFrom: Thierry Reding <[email protected]>
[ Upstream commit 2fc777ba8422e4a38cae61537ad6a26435a86fb8 ]
The number of syncpoints on Tegra186 is 576 and therefore no longer fits into 8 bits. Increase the size of the syncpoint ID field to 10 in order to accomodate all syncpoints.
--- drivers/gpu/host1x/hw/hw_host1x06_uclass.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/host1x/hw/hw_host1x06_uclass.h +1 -1
@@ -59,7 +59,7 @@ static inline u32 host1x_uclass_incr_syncpt_r(void) host1x_uclass_incr_syncpt_r()static inline u32 host1x_uclass_incr_syncpt_cond_f (u32 v) { -return (v &0xff ) <<8 ; +return (v &0xff ) <<10 ; }#define HOST1X_UCLASS_INCR_SYNCPT_COND_F (v) \ host1x_uclass_incr_syncpt_cond_f(v)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 108/243 sparc: Fix JIT fused branch convergance.
In reply to Greg Kroah-HartmanFrom: David Miller <[email protected]>
[ Upstream commit c44768a33da81b4a0986e79bbf0588f1a0651dec ]
On T4 and later sparc64 cpus we can use the fused compare and branch instruction.
However, it can only be used if the branch destination is in the range of a signed 10-bit immediate offset. This amounts to 1024 instructions forwards or backwards.
After the commit referenced in the Fixes: tag, the largest possible size program seen by the JIT explodes by a significant factor.
As a result of this convergance takes many more passes since the expanded "BPF_LDX | BPF_MSH | BPF_B" code sequence, for example, contains several embedded branch on condition instructions.
On each pass, as suddenly new fused compare and branch instances become valid, this makes thousands more in range for the next pass. And so on and so forth.
This is most greatly exemplified by "BPF_MAXINSNS: exec all MSH" which takes 35 passes to converge, and shrinks the image by about 64K.
To decrease the cost of this number of convergance passes, do the convergance pass before we have the program image allocated, just like other JITs (such as x86) do.
--- arch/sparc/net/bpf_jit_comp_64.c | 77 ++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 28 deletions(-)
arch/sparc/net/bpf_jit_comp_64.c +49 -28
@@ -1425,12 +1425,12 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)struct bpf_prog *tmp, *orig_prog = prog;struct sparc64_jit_data *jit_data;struct bpf_binary_header *header; +u32 prev_image_size, image_size;bool tmp_blinded = false;bool extra_pass = false;struct jit_ctx ctx; -u32 image_size;u8 *image_ptr; -int pass; +int pass, i;if (!prog->jit_requested)return orig_prog;
@@ -1461,61 +1461,82 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) header = jit_data->header; extra_pass = true; image_size =sizeof (u32) * ctx.idx; + prev_image_size = image_size; + pass =1 ; goto skip_init_ctx; }memset (&ctx,0 ,sizeof (ctx)); ctx.prog = prog; - ctx.offset =kcalloc (prog->len,sizeof (unsigned int ),GFP_KERNEL ); + ctx.offset =kmalloc_array (prog->len,sizeof (unsigned int ),GFP_KERNEL );if (ctx.offset ==NULL ) { prog = orig_prog; goto out_off; } -/* Fake pass to detect features used, and get an accurate assessment -* of what the final image size will be. +/* Longest sequence emitted is for bswap32, 12 instructions. Pre-cook +* the offset array so that we converge faster. */ -if (build_body (&ctx)) { - prog = orig_prog; - goto out_off; - } -build_prologue (&ctx); -build_epilogue (&ctx); +for (i =0 ; i < prog->len; i++) + ctx.offset[i] = i * (12 *4 ); -/* Now we know the actual image size. */ - image_size =sizeof (u32) * ctx.idx; - header =bpf_jit_binary_alloc (image_size, &image_ptr, -sizeof (u32), jit_fill_hole); -if (header ==NULL ) { - prog = orig_prog; - goto out_off; - } - - ctx.image = (u32 *)image_ptr; -skip_init_ctx: -for (pass =1 ; pass <3 ; pass++) { + prev_image_size = ~0U ; +for (pass =1 ; pass <40 ; pass++) { ctx.idx =0 ;build_prologue (&ctx); -if (build_body (&ctx)) { -bpf_jit_binary_free (header); prog = orig_prog; goto out_off; } -build_epilogue (&ctx);if (bpf_jit_enable >1 ) -pr_info ("Pass %d: shrink = %d, seen = [%c%c%c%c%c%c]\n" , pass, - image_size - (ctx.idx *4 ), +pr_info ("Pass %d: size = %u, seen = [%c%c%c%c%c%c]\n" , pass, + ctx.idx *4 , ctx.tmp_1_used ?'1' :' ' , ctx.tmp_2_used ?'2' :' ' , ctx.tmp_3_used ?'3' :' ' , ctx.saw_frame_pointer ?'F' :' ' , ctx.saw_call ?'C' :' ' , ctx.saw_tail_call ?'T' :' ' ); + +if (ctx.idx *4 == prev_image_size) +break ; + prev_image_size = ctx.idx *4 ; +cond_resched (); + } + +/* Now we know the actual image size. */ + image_size =sizeof (u32) * ctx.idx; + header =bpf_jit_binary_alloc (image_size, &image_ptr, +sizeof (u32), jit_fill_hole); +if (header ==NULL ) { + prog = orig_prog; + goto out_off; + } + + ctx.image = (u32 *)image_ptr; +skip_init_ctx: + ctx.idx =0 ; + +build_prologue (&ctx); + +if (build_body (&ctx)) { +bpf_jit_binary_free (header); + prog = orig_prog; + goto out_off; + } + +build_epilogue (&ctx); + +if (ctx.idx *4 != prev_image_size) { +pr_err ("bpf_jit: Failed to converge, prev_size=%u size=%d\n" , + prev_image_size, ctx.idx *4 ); +bpf_jit_binary_free (header); + prog = orig_prog; + goto out_off; }if (bpf_jit_enable >1 )
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 158/243 modpost: skip ELF local symbols during section mismatch check
In reply to Greg Kroah-HartmanFrom: Paul Walmsley <[email protected]>
[ Upstream commit a4d26f1a0958bb1c2b60c6f1e67c6f5d43e2647b ]
During development of a serial console driver with a gcc 8.2.0 toolchain for RISC-V, the following modpost warning appeared:
----
WARNING: vmlinux.o(.data+0x19b10): Section mismatch in reference from the variable .LANCHOR1 to the function .init.text:sifive_serial_console_setup() The variable .LANCHOR1 references
the function __init sifive_serial_console_setup()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
----
".LANCHOR1" is an ELF local symbol, automatically created by gcc's section anchor generation code:
https://gcc.gnu.org/onlinedocs/gccint/Anchored-Addresses.html
This was verified by compiling the kernel with -fno-section-anchors and observing that the ".LANCHOR1" ELF local symbol disappeared, and modpost no longer warned about the section mismatch. The serial driver code idiom triggering the warning is standard Linux serial driver practice that has a specific whitelist inclusion in modpost.c.
I'm neither a modpost nor an ELF expert, but naively, it doesn't seem useful for modpost to report section mismatch warnings caused by ELF local symbols by default. Local symbols have compiler-generated names, and thus bypass modpost's whitelisting algorithm, which relies on the presence of a non-autogenerated symbol name. This increases the likelihood that false positive warnings will be generated (as in the above case).
Thus, disable section mismatch reporting on ELF local symbols. The rationale here is similar to that of commit 2e3a10a1551d ("ARM: avoid ARM binutils leaking ELF local symbols") and of similar code already present in modpost.c:
This third version of the patch implements a suggestion from Masahiro Yamada <[email protected]> to restructure the code as an additional pattern matching step inside secref_whitelist(), and further improves the patch description.
--- scripts/mod/modpost.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
scripts/mod/modpost.c +12 -0
@@ -1163,6 +1163,14 @@ static const struct sectioncheck *section_mismatch(* fromsec = text section * refsymname = *.constprop.* * +* Pattern 6: +* Hide section mismatch warnings for ELF local symbols. The goal +* is to eliminate false positive modpost warnings caused by +* compiler-generated ELF local symbol names such as ".LANCHOR1". +* Autogenerated symbol names bypass modpost's "Pattern 2" +* whitelisting, which relies on pattern-matching against symbol +* names to work. (One situation where gcc can autogenerate ELF +* local symbols is when "-fsection-anchors" is used.) **/ static int secref_whitelist(const struct sectioncheck *mismatch, const char *fromsec, const char *fromsym,
@@ -1201,6 +1209,10 @@ static int secref_whitelist(const struct sectioncheck *mismatch, match(fromsym, optim_symbols))return 0 ; +/* Check for pattern 6 */ +if (strstarts (fromsym,".L" )) +return 0 ; +return 1 ; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 159/243 kbuild: fix single target build for external module
In reply to Greg Kroah-HartmanFrom: Masahiro Yamada <[email protected]>
[ Upstream commit e07db28eea38ed4e332b3a89f3995c86b713cb5b ]
Building a single target in an external module fails due to missing .tmp_versions directory.
For example,
$ make -C /lib/modules/$(uname -r)/build M=$PWD foo.o
will fail in the following way:
CC [M] /home/masahiro/foo/foo.o/bin/sh: 1: cannot create /home/masahiro/foo/.tmp_versions/foo.mod: Directory nonexistent
This is because $(cmd_crmodverdir) is executed only before building /, %/, %.ko single targets of external modules. Create .tmp_versions in the 'prepare' target.
--- Makefile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
Makefile +3 -8
@@ -1507,9 +1507,6 @@ else # KBUILD_EXTMOD # We are always building modules KBUILD_MODULES := 1 -PHONY += crmodverdir -crmodverdir: - $(cmd_crmodverdir) PHONY += $(objtree)/Module.symvers $(objtree)/Module.symvers:
@@ -1521,7 +1518,7 @@ $(objtree)/Module.symvers: module-dirs := $(addprefix _module_,$(KBUILD_EXTMOD)) PHONY += $(module-dirs) modules -$(module-dirs): crmodverdir $(objtree)/Module.symvers +$(module-dirs): prepare $(objtree)/Module.symvers $(Q)$(MAKE) $(build)=$(patsubst _module_%,%,$@) modules: $(module-dirs)
@@ -1562,7 +1559,8 @@ help: # Dummies... PHONY += prepare scripts -prepare: ; +prepare: + $(cmd_crmodverdir) scripts: ; endif # KBUILD_EXTMOD
@@ -1689,17 +1687,14 @@ endif # Modules /: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) # Make sure the latest headers are built for Documentation Documentation/ samples/: headers_install %/: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) %.ko: prepare scripts FORCE - $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) $(@:.ko=.o) $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 160/243 mtd: fix mtd_oobavail() incoherent returned value
In reply to Greg Kroah-HartmanFrom: Miquel Raynal <[email protected]>
[ Upstream commit 4348433d8c0234f44adb6e12112e69343f50f0c5 ]
mtd_oobavail() returns either mtd->oovabail or mtd->oobsize. Both values are unsigned 32-bit entities, so there is no reason to pretend returning a signed one.
--- include/linux/mtd/mtd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/mtd/mtd.h +1 -1
@@ -386,7 +386,7 @@ static inline struct device_node *mtd_get_of_node(struct mtd_info *mtd)return dev_of_node (&mtd->dev); } -static inline int mtd_oobavail (struct mtd_info *mtd,struct mtd_oob_ops *ops) +static inline u32 mtd_oobavail (struct mtd_info *mtd,struct mtd_oob_ops *ops) {return ops->mode ==MTD_OPS_AUTO_OOB ? mtd->oobavail : mtd->oobsize; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 161/243 ARM: dts: pxa: clean up USB controller nodes
In reply to Greg Kroah-HartmanFrom: Daniel Mack <[email protected]>
[ Upstream commit c40ad24254f1dbd54f2df5f5f524130dc1862122 ]
PXA25xx SoCs don't have a USB controller, so drop the node from the common pxa2xx.dtsi base file. Both pxa27x and pxa3xx have a dedicated node already anyway.
While at it, unify the names for the nodes across all pxa platforms.
--- arch/arm/boot/dts/pxa27x.dtsi | 2 +- arch/arm/boot/dts/pxa2xx.dtsi | 7 ------- arch/arm/boot/dts/pxa3xx.dtsi | 2 +- 3 files changed, 2 insertions(+), 9 deletions(-)
arch/arm/boot/dts/pxa27x.dtsi +1 -1
@@ -35,7 +35,7 @@ clocks = <&clks CLK_NONE>; }; - pxa27x_ohci: usb@4c000000 { + usb0: usb@4c000000 { compatible = "marvell,pxa-ohci"; reg = <0x4c000000 0x10000>; interrupts = <3>;
arch/arm/boot/dts/pxa2xx.dtsi +0 -7
@@ -117,13 +117,6 @@ status = "disabled"; }; - usb0: ohci@4c000000 { - compatible = "marvell,pxa-ohci"; - reg = <0x4c000000 0x10000>; - interrupts = <3>; - status = "disabled"; - }; - mmc0: mmc@41100000 { compatible = "marvell,pxa-mmc"; reg = <0x41100000 0x1000>;
arch/arm/boot/dts/pxa3xx.dtsi +1 -1
@@ -204,7 +204,7 @@ status = "disabled"; }; - pxa3xx_ohci: usb@4c000000 { + usb0: usb@4c000000 { compatible = "marvell,pxa-ohci"; reg = <0x4c000000 0x10000>; interrupts = <3>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 164/243 clk: qcom: Fix MSM8998 resets
In reply to Greg Kroah-HartmanFrom: Jeffrey Hugo <[email protected]>
[ Upstream commit 4f89f7b59a6ea17e81cff212c18a0b580ff5ff27 ]
The offsets for the defined BCR reset registers does not match the hardware documentation. Update the values to match the hardware documentation.
--- drivers/clk/qcom/gcc-msm8998.c | 38 +++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/clk/qcom/gcc-msm8998.c +19 -19
@@ -2743,25 +2743,25 @@ static struct gdsc *gcc_msm8998_gdscs[] = { };static const struct qcom_reset_map gcc_msm8998_resets[] = { - [GCC_BLSP1_QUP1_BCR ] = {0x102400 }, - [GCC_BLSP1_QUP2_BCR ] = {0x110592 }, - [GCC_BLSP1_QUP3_BCR ] = {0x118784 }, - [GCC_BLSP1_QUP4_BCR ] = {0x126976 }, - [GCC_BLSP1_QUP5_BCR ] = {0x135168 }, - [GCC_BLSP1_QUP6_BCR ] = {0x143360 }, - [GCC_BLSP2_QUP1_BCR ] = {0x155648 }, - [GCC_BLSP2_QUP2_BCR ] = {0x163840 }, - [GCC_BLSP2_QUP3_BCR ] = {0x172032 }, - [GCC_BLSP2_QUP4_BCR ] = {0x180224 }, - [GCC_BLSP2_QUP5_BCR ] = {0x188416 }, - [GCC_BLSP2_QUP6_BCR ] = {0x196608 }, - [GCC_PCIE_0_BCR ] = {0x438272 }, - [GCC_PDM_BCR ] = {0x208896 }, - [GCC_SDCC2_BCR ] = {0x81920 }, - [GCC_SDCC4_BCR ] = {0x90112 }, - [GCC_TSIF_BCR ] = {0x221184 }, - [GCC_UFS_BCR ] = {0x479232 }, - [GCC_USB_30_BCR ] = {0x61440 }, + [GCC_BLSP1_QUP1_BCR ] = {0x19000 }, + [GCC_BLSP1_QUP2_BCR ] = {0x1b000 }, + [GCC_BLSP1_QUP3_BCR ] = {0x1d000 }, + [GCC_BLSP1_QUP4_BCR ] = {0x1f000 }, + [GCC_BLSP1_QUP5_BCR ] = {0x21000 }, + [GCC_BLSP1_QUP6_BCR ] = {0x23000 }, + [GCC_BLSP2_QUP1_BCR ] = {0x26000 }, + [GCC_BLSP2_QUP2_BCR ] = {0x28000 }, + [GCC_BLSP2_QUP3_BCR ] = {0x2a000 }, + [GCC_BLSP2_QUP4_BCR ] = {0x2c000 }, + [GCC_BLSP2_QUP5_BCR ] = {0x2e000 }, + [GCC_BLSP2_QUP6_BCR ] = {0x30000 }, + [GCC_PCIE_0_BCR ] = {0x6b000 }, + [GCC_PDM_BCR ] = {0x33000 }, + [GCC_SDCC2_BCR ] = {0x14000 }, + [GCC_SDCC4_BCR ] = {0x16000 }, + [GCC_TSIF_BCR ] = {0x36000 }, + [GCC_UFS_BCR ] = {0x75000 }, + [GCC_USB_30_BCR ] = {0xf000 }, };static const struct regmap_config gcc_msm8998_regmap_config = {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 165/243 media: cxd2880-spi: fix probe when dvb_attach fails
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
[ Upstream commit 458ffce1cb46e46e3cec48b625ed142250475708 ]
When dvb_attach fails, probe returns 0, and remove crashes afterwards. This patch sets the return value to -ENODEV when attach fails.
--- drivers/media/spi/cxd2880-spi.c | 1 + 1 file changed, 1 insertion(+)
drivers/media/spi/cxd2880-spi.c +1 -0
@@ -536,6 +536,7 @@ cxd2880_spi_probe(struct spi_device *spi)if (!dvb_attach (cxd2880_attach, &dvb_spi->dvb_fe, &config)) {pr_err ("cxd2880_attach failed\n" ); + ret = -ENODEV ; goto fail_attach; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 167/243 dlm: fix invalid cluster name warning
In reply to Greg Kroah-HartmanFrom: David Teigland <[email protected]>
[ Upstream commit 3595c559326d0b660bb088a88e22e0ca630a0e35 ]
The warning added in commit 3b0e761ba83
"dlm: print log message when cluster name is not set"
did not account for the fact that lockspaces created from userland do not supply a cluster name, so bogus warnings are printed every time a userland lockspace is created.
--- fs/dlm/user.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/dlm/user.c +2 -1
@@ -25,6 +25,7 @@#include "lvb_table.h" #include "user.h" #include "ast.h" +#include "config.h" static const char name_prefix[] ="dlm" ;static const struct file_operations device_fops;
@@ -404,7 +405,7 @@ static int device_create_lockspace(struct dlm_lspace_params *params)if (!capable (CAP_SYS_ADMIN ))return -EPERM ; - error =dlm_new_lockspace (params->name,NULL , params->flags, + error =dlm_new_lockspace (params->name, dlm_config.ci_cluster_name, params->flags,DLM_USER_LVB_LEN ,NULL ,NULL ,NULL , &lockspace);if (error)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 166/243 ARM: dts: realview: Fix some more duplicate regulator nodes
In reply to Greg Kroah-HartmanFrom: Rob Herring <[email protected]>
[ Upstream commit f3b2f758ec1e6cdb13c925647cbd8ad4938b78fb ]
There's a bug in dtc in checking for duplicate node names when there's another section (e.g. "/ { };"). In this case, skeleton.dtsi provides another section. Upon removal of skeleton.dtsi, the dtb fails to build due to a duplicate node 'fixedregulator@0'. As both nodes were pretty much the same 3.3V fixed regulator, it hasn't really mattered. Fix this by renaming the nodes to something unique. In the process, drop the unit-address which shouldn't be present wtihout reg property.
--- arch/arm/boot/dts/arm-realview-pb1176.dts | 4 ++-- arch/arm/boot/dts/arm-realview-pb11mp.dts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/arm-realview-pb1176.dts +2 -2
@@ -45,7 +45,7 @@ }; /* The voltage to the MMC card is hardwired at 3.3V */ - vmmc: fixedregulator@0 { + vmmc: regulator-vmmc { compatible = "regulator-fixed"; regulator-name = "vmmc"; regulator-min-microvolt = <3300000>;
@@ -53,7 +53,7 @@ regulator-boot-on; }; - veth: fixedregulator@0 { + veth: regulator-veth { compatible = "regulator-fixed"; regulator-name = "veth"; regulator-min-microvolt = <3300000>;
arch/arm/boot/dts/arm-realview-pb11mp.dts +2 -2
@@ -145,7 +145,7 @@ }; /* The voltage to the MMC card is hardwired at 3.3V */ - vmmc: fixedregulator@0 { + vmmc: regulator-vmmc { compatible = "regulator-fixed"; regulator-name = "vmmc"; regulator-min-microvolt = <3300000>;
@@ -153,7 +153,7 @@ regulator-boot-on; }; - veth: fixedregulator@0 { + veth: regulator-veth { compatible = "regulator-fixed"; regulator-name = "veth"; regulator-min-microvolt = <3300000>;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 168/243 net/mlx4_core: Fix return codes of unsupported operations
In reply to Greg Kroah-HartmanFrom: Erez Alfasi <[email protected]>
[ Upstream commit 95aac2cdafd8c8298c9b2589c52f44db0d824e0e ]
Functions __set_port_type and mlx4_check_port_params returned -EINVAL while the proper return code is -EOPNOTSUPP as a result of an unsupported operation. All drivers should generate this and all users should check for it when detecting an unsupported functionality.
--- drivers/net/ethernet/mellanox/mlx4/main.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/net/ethernet/mellanox/mlx4/main.c +5 -6
@@ -313,7 +313,7 @@ int mlx4_check_port_params(struct mlx4_dev *dev,for (i =0 ; i < dev->caps.num_ports -1 ; i++) {if (port_type[i] != port_type[i +1 ]) {mlx4_err (dev,"Only same port types supported on this HCA, aborting\n" ); -return -EINVAL ; +return -EOPNOTSUPP ; } } }
@@ -322,7 +322,7 @@ int mlx4_check_port_params(struct mlx4_dev *dev,if (!(port_type[i] & dev->caps.supported_type[i+1 ])) {mlx4_err (dev,"Requested port type for port %d is not supported on this HCA\n" , i +1 ); -return -EINVAL ; +return -EOPNOTSUPP ; } }return 0 ;
@@ -1188,8 +1188,7 @@ static int __set_port_type(struct mlx4_port_info *info,mlx4_err (mdev,"Requested port type for port %d is not supported on this HCA\n" , info->port); - err = -EINVAL ; - goto err_sup; +return -EOPNOTSUPP ; }mlx4_stop_sense (mdev);
@@ -1211,7 +1210,7 @@ static int __set_port_type(struct mlx4_port_info *info,for (i =1 ; i <= mdev->caps.num_ports; i++) {if (mdev->caps.possible_type[i] ==MLX4_PORT_TYPE_AUTO ) { mdev->caps.possible_type[i] = mdev->caps.port_type[i]; - err = -EINVAL ; + err = -EOPNOTSUPP ; } } }
@@ -1237,7 +1236,7 @@ static int __set_port_type(struct mlx4_port_info *info, out:mlx4_start_sense (mdev);mutex_unlock (&priv->port_mutex); -err_sup: +return err; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 169/243 pstore/ram: Avoid NULL deref in ftrace merging failure path
In reply to Greg Kroah-HartmanFrom: Kees Cook <[email protected]>
[ Upstream commit 8665569e97dd52920713b95675409648986b5b0d ]
Given corruption in the ftrace records, it might be possible to allocate tmp_prz without assigning prz to it, but still marking it as needing to be freed, which would cause at least a NULL dereference.
smatch warnings:fs/pstore/ram.c:340 ramoops_pstore_read() error: we previously assumed 'prz' could be null (see line 255)
https://lists.01.org/pipermail/kbuild-all/2018-December/055528.html
--- fs/pstore/ram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/pstore/ram.c +1 -1
@@ -301,6 +301,7 @@ static ssize_t ramoops_pstore_read(struct pstore_record *record) GFP_KERNEL);if (!tmp_prz)return -ENOMEM ; + prz = tmp_prz; free_prz = true;while (cxt->ftrace_read_cnt < cxt->max_ftrace_cnt) {
@@ -323,7 +324,6 @@ static ssize_t ramoops_pstore_read(struct pstore_record *record) goto out; } record->id =0 ; - prz = tmp_prz; } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 170/243 powerpc/math-emu: Update macros from GCC
In reply to Greg Kroah-HartmanFrom: Joel Stanley <[email protected]>
[ Upstream commit b682c8692442711684befe413cf93cf01c5324ea ]
The add_ssaaaa, sub_ddmmss, umul_ppmm and udiv_qrnnd macros originate from GCC's longlong.h which in turn was copied from GMP's longlong.h a few decades ago.
This was found when compiling with clang:
arch/powerpc/math-emu/fnmsub.c:46:2: error: invalid use of a cast in a inline asm context requiring an l-value: remove the cast or build with -fheinous-gnu-extensions
FP_ADD_D(R, T, B);
^~~~~~~~~~~~~~~~~...
./arch/powerpc/include/asm/sfp-machine.h:283:27: note: expanded from
macro 'sub_ddmmss'
: "=r" ((USItype)(sh)), \
~~~~~~~~~~^~~Segher points out: this was fixed in GCC over 16 years ago ( https://gcc.gnu.org/r56600 ), and in GMP (where it comes from) presumably before that.
Update the add_ssaaaa, sub_ddmmss, umul_ppmm and udiv_qrnnd macros to the latest GCC version in order to git rid of the invalid casts. These were taken as-is from GCC's longlong in order to make future syncs obvious. Other parts of sfp-machine.h were left as-is as the file contains more features than present in longlong.h.
--- arch/powerpc/include/asm/sfp-machine.h | 92 ++++++++------------------ 1 file changed, 29 insertions(+), 63 deletions(-)
arch/powerpc/include/asm/sfp-machine.h +29 -63
@@ -213,30 +213,18 @@* respectively. The result is placed in HIGH_SUM and LOW_SUM. Overflow * (i.e. carry out) is not stored anywhere, and is lost. */ -#define add_ssaaaa (sh, sl, ah, al, bh, bl) \ +#define add_ssaaaa (sh, sl, ah, al, bh, bl) \ do { \ if (__builtin_constant_p (bh) && (bh) == 0) \ - __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "%r" ((USItype)(ah)), \ - "%r" ((USItype)(al)), \ - "rI" ((USItype)(bl))); \ - else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \ - __asm__ ("{a%I4|add%I4c} %1,%3,%4\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "%r" ((USItype)(ah)), \ - "%r" ((USItype)(al)), \ - "rI" ((USItype)(bl))); \ + __asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ + else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \ + __asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl));\ else \ - __asm__ ("{a%I5|add%I5c} %1,%4,%5\n\t{ae|adde} %0,%2,%3" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "%r" ((USItype)(ah)), \ - "r" ((USItype)(bh)), \ - "%r" ((USItype)(al)), \ - "rI" ((USItype)(bl))); \ + __asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \ + : "=r" (sh), "=&r" (sl) \ + : "%r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \ } while (0)/* sub_ddmmss is used in op-2.h and udivmodti4.c and should be equivalent to
@@ -248,44 +236,24 @@* and LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere, * and is lost. */ -#define sub_ddmmss (sh, sl, ah, al, bh, bl) \ +#define sub_ddmmss (sh, sl, ah, al, bh, bl) \ do { \ if (__builtin_constant_p (ah) && (ah) == 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfze|subfze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(bh)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ - else if (__builtin_constant_p (ah) && (ah) ==~(USItype) 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{sfme|subfme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(bh)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ + __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\ + else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0) \ + __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\ else if (__builtin_constant_p (bh) && (bh) == 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{ame|addme} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(ah)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ - else if (__builtin_constant_p (bh) && (bh) ==~(USItype) 0) \ - __asm__ ("{sf%I3|subf%I3c} %1,%4,%3\n\t{aze|addze} %0,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(ah)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ + __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\ + else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \ + __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \ + : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\ else \ - __asm__ ("{sf%I4|subf%I4c} %1,%5,%4\n\t{sfe|subfe} %0,%3,%2" \ - : "=r" ((USItype)(sh)), \ - "=&r" ((USItype)(sl)) \ - : "r" ((USItype)(ah)), \ - "r" ((USItype)(bh)), \ - "rI" ((USItype)(al)), \ - "r" ((USItype)(bl))); \ + __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \ + : "=r" (sh), "=&r" (sl) \ + : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \ } while (0)/* asm fragments for mul and div */
@@ -294,13 +262,10 @@* UWtype integers MULTIPLER and MULTIPLICAND, and generates a two UWtype * word product in HIGH_PROD and LOW_PROD. */ -#define umul_ppmm (ph, pl, m0, m1) \ +#define umul_ppmm (ph, pl, m0, m1) \ do { \ USItype __m0 = (m0), __m1 = (m1); \ - __asm__ ("mulhwu %0,%1,%2" \ - : "=r" ((USItype)(ph)) \ - : "%r" (__m0), \ - "r" (__m1)); \ + __asm__ ("mulhwu %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \ (pl) = __m0 * __m1; \ } while (0)
@@ -312,9 +277,10 @@* significant bit of DENOMINATOR must be 1, then the pre-processor symbol * UDIV_NEEDS_NORMALIZATION is defined to 1. */ -#define udiv_qrnnd (q, r, n1, n0, d) \ +#define udiv_qrnnd (q, r, n1, n0, d) \ do { \ - UWtype __d1, __d0, __q1, __q0, __r1, __r0, __m; \ + UWtype __d1, __d0, __q1, __q0; \ + UWtype __r1, __r0, __m; \ __d1 = __ll_highpart (d); \ __d0 = __ll_lowpart (d); \ \
@@ -325,7 +291,7 @@if (__r1 < __m) \ { \ __q1--, __r1 += (d); \ -if (__r1 >= (d))/* we didn't get carry when adding to __r1 */ \ +if (__r1 >= (d))/* i.e. we didn't get carry when adding to __r1 */ \if (__r1 < __m) \ __q1--, __r1 += (d); \ } \
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 172/243 clk: renesas: r8a77995: Correct parent clock of DU
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 515b2915ee08060ad4f6a3b3de38c5c2c5258e8b ]
According to the R-Car Gen3 Hardware Manual Rev 1.00, the parent clock of the DU module clocks on R-Car D3 is S1D1.
--- drivers/clk/renesas/r8a77995-cpg-mssr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/renesas/r8a77995-cpg-mssr.c +2 -2
@@ -141,8 +141,8 @@ static const struct mssr_mod_clk r8a77995_mod_clks[] __initconst = {DEF_MOD ("vspbs" ,627 ,R8A77995_CLK_S0D1 ),DEF_MOD ("ehci0" ,703 ,R8A77995_CLK_S3D2 ),DEF_MOD ("hsusb" ,704 ,R8A77995_CLK_S3D2 ), -DEF_MOD ("du1" ,723 ,R8A77995_CLK_S2D1 ), -DEF_MOD ("du0" ,724 ,R8A77995_CLK_S2D1 ), +DEF_MOD ("du1" ,723 ,R8A77995_CLK_S1D1 ), +DEF_MOD ("du0" ,724 ,R8A77995_CLK_S1D1 ),DEF_MOD ("lvds" ,727 ,R8A77995_CLK_S2D1 ),DEF_MOD ("vin7" ,804 ,R8A77995_CLK_S1D2 ), DEF_MOD("vin6", 805, R8A77995_CLK_S1D2),
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 173/243 MIPS: OCTEON: cvmx_pko_mem_debug8: use oldest forward compatible definition
In reply to Greg Kroah-HartmanFrom: Aaro Koskinen <[email protected]>
[ Upstream commit 1c6121c39677175bd372076020948e184bad4b6b ]
cn58xx is compatible with cn50xx, so use the latter.
--- arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c | 2 +- arch/mips/include/asm/octeon/cvmx-pko.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/mips/cavium-octeon/executive/cvmx-cmd-queue.c +1 -1
@@ -266,7 +266,7 @@ int cvmx_cmd_queue_length(cvmx_cmd_queue_id_t queue_id) }else {union cvmx_pko_mem_debug8 debug8; debug8.u64 =cvmx_read_csr (CVMX_PKO_MEM_DEBUG8 ); -return debug8.cn58xx.doorbell; +return debug8.cn50xx.doorbell; }case CVMX_CMD_QUEUE_ZIP :case CVMX_CMD_QUEUE_DFA :
arch/mips/include/asm/octeon/cvmx-pko.h +1 -1
@@ -611,7 +611,7 @@ static inline void cvmx_pko_get_port_status(uint64_t port_num, uint64_t clear, pko_reg_read_idx.s.index =cvmx_pko_get_base_queue (port_num);cvmx_write_csr (CVMX_PKO_REG_READ_IDX , pko_reg_read_idx.u64); debug8.u64 =cvmx_read_csr (CVMX_PKO_MEM_DEBUG8 ); - status->doorbell = debug8.cn58xx.doorbell; + status->doorbell = debug8.cn50xx.doorbell; } }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 174/243 nfsd: Return EPERM, not EACCES, in some SETATTR cases
In reply to Greg Kroah-HartmanFrom: zhengbin <[email protected]>
[ Upstream commit 255fbca65137e25b12bced18ec9a014dc77ecda0 ]
As the man(2) page for utime/utimes states, EPERM is returned when the second parameter of utime or utimes is not NULL, the caller's effective UID does not match the owner of the file, and the caller is not privileged.
However, in a NFS directory mounted from knfsd, it will return EACCES (from nfsd_setattr-> fh_verify->nfsd_permission). This patch fixes that.
--- fs/nfsd/vfs.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
fs/nfsd/vfs.c +15 -2
@@ -396,10 +396,23 @@ nfsd_setattr(struct svc_rqst *rqstp, struct svc_fh *fhp, struct iattr *iap,bool get_write_count;bool size_change = (iap->ia_valid &ATTR_SIZE ); -if (iap->ia_valid & (ATTR_ATIME |ATTR_MTIME |ATTR_SIZE )) +if (iap->ia_valid &ATTR_SIZE ) { accmode |=NFSD_MAY_WRITE |NFSD_MAY_OWNER_OVERRIDE ; -if (iap->ia_valid &ATTR_SIZE ) ftype =S_IFREG ; + } + +/* +* If utimes(2) and friends are called with times not NULL, we should +* not set NFSD_MAY_WRITE bit. Otherwise fh_verify->nfsd_permission +* will return EACCESS, when the caller's effective UID does not match +* the owner of the file, and the caller is not privileged. In this +* situation, we should return EPERM(notify_change will return this). +*/ +if (iap->ia_valid & (ATTR_ATIME |ATTR_MTIME )) { + accmode |=NFSD_MAY_OWNER_OVERRIDE ; +if (!(iap->ia_valid & (ATTR_ATIME_SET |ATTR_MTIME_SET ))) + accmode |=NFSD_MAY_WRITE ; + }/* Callers that do fh_verify should do the fh_want_write: */ get_write_count = !fhp->fh_dentry;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 175/243 media: uvcvideo: Abstract streaming object lifetime
In reply to Greg Kroah-HartmanFrom: Kieran Bingham <[email protected]>
[ Upstream commit ece41454c6a5ed8f301ef1c37710ab222e577823 ]
The streaming object is a key part of handling the UVC device. Although not critical, we are currently missing a call to destroy the mutex on clean up paths, and we are due to extend the objects complexity in the near future.
Facilitate easy management of a stream object by creating a pair of functions to handle creating and destroying the allocation. The new uvc_stream_delete() function also performs the missing mutex_destroy() operation.
Previously a failed streaming object allocation would cause uvc_parse_streaming() to return -EINVAL, which is inappropriate. If the constructor failes, we will instead return -ENOMEM.
While we're here, fix the trivial spelling error in the function banner of uvc_delete().
--- drivers/media/usb/uvc/uvc_driver.c | 54 +++++++++++++++++++++--------- 1 file changed, 38 insertions(+), 16 deletions(-)
drivers/media/usb/uvc/uvc_driver.c +38 -16
@@ -390,6 +390,39 @@ static struct uvc_streaming *uvc_stream_by_id(struct uvc_device *dev, int id)return NULL ; } +/* ------------------------------------------------------------------------ +* Streaming Object Management +*/ + +static void uvc_stream_delete (struct uvc_streaming *stream) +{ +mutex_destroy (&stream->mutex); + +usb_put_intf (stream->intf); + +kfree (stream->format); +kfree (stream->header.bmaControls); +kfree (stream); +} + +static struct uvc_streaming *uvc_stream_new (struct uvc_device *dev, +struct usb_interface *intf) +{ +struct uvc_streaming *stream; + + stream =kzalloc (sizeof (*stream),GFP_KERNEL ); +if (stream ==NULL ) +return NULL ; + +mutex_init (&stream->mutex); + + stream->dev = dev; + stream->intf =usb_get_intf (intf); + stream->intfnum = intf->cur_altsetting->desc.bInterfaceNumber; + +return stream; +} +/* ------------------------------------------------------------------------ * Descriptors parsing */
@@ -682,17 +715,12 @@ static int uvc_parse_streaming(struct uvc_device *dev,return -EINVAL ; } - streaming =kzalloc (sizeof (*streaming),GFP_KERNEL ); + streaming =uvc_stream_new (dev, intf);if (streaming ==NULL ) {usb_driver_release_interface (&uvc_driver.driver, intf); -return -EINVAL ; +return -ENOMEM ; } -mutex_init (&streaming->mutex); - streaming->dev = dev; - streaming->intf =usb_get_intf (intf); - streaming->intfnum = intf->cur_altsetting->desc.bInterfaceNumber; -/* The Pico iMage webcam has its class-specific interface descriptors * after the endpoint descriptors. */
@@ -899,10 +927,7 @@ static int uvc_parse_streaming(struct uvc_device *dev, error:usb_driver_release_interface (&uvc_driver.driver, intf); -usb_put_intf (intf); -kfree (streaming->format); -kfree (streaming->header.bmaControls); -kfree (streaming); +uvc_stream_delete (streaming);return ret; }
@@ -1818,7 +1843,7 @@ static int uvc_scan_device(struct uvc_device *dev)* is released. * * As this function is called after or during disconnect(), all URBs have -* already been canceled by the USB core. There is no need to kill the +* already been cancelled by the USB core. There is no need to kill the * interrupt URB manually. */ static void uvc_delete (struct kref *kref)
@@ -1856,10 +1881,7 @@ static void uvc_delete(struct kref *kref) streaming = list_entry(p, struct uvc_streaming, list);usb_driver_release_interface (&uvc_driver.driver, streaming->intf); -usb_put_intf (streaming->intf); -kfree (streaming->format); -kfree (streaming->header.bmaControls); -kfree (streaming); +uvc_stream_delete (streaming); }kfree (dev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 176/243 tty: serial: qcom_geni_serial: Fix softlock
In reply to Greg Kroah-HartmanFrom: Ryan Case <[email protected]>
[ Upstream commit a1fee899e5bed457afc20a6a2ff3915a95cc5942 ]
Transfers were being divided into device FIFO sized (64 byte max) operations which would poll for completion within a spin_lock_irqsave / spin_unlock_irqrestore block. This both made things slow by waiting for the FIFO to completely drain before adding further data and would also result in softlocks on large transmissions.
This patch allows larger transfers with continuous FIFO additions as space becomes available and removes polling from the interrupt handler.
--- drivers/tty/serial/qcom_geni_serial.c | 56 +++++++++++++++++++-------- 1 file changed, 39 insertions(+), 17 deletions(-)
drivers/tty/serial/qcom_geni_serial.c +39 -17
@@ -113,6 +113,8 @@ struct qcom_geni_serial_port {u32 *rx_fifo;u32 loopback;bool brk; + +unsigned int tx_remaining; };static const struct uart_ops qcom_geni_console_pops;
@@ -435,6 +437,7 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,struct qcom_geni_serial_port *port;bool locked = true;unsigned long flags; +u32 geni_status;WARN_ON (co->index <0 || co->index >=GENI_UART_CONS_PORTS );
@@ -448,6 +451,8 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s,else spin_lock_irqsave (&uport->lock, flags); + geni_status =readl_relaxed (uport->membase +SE_GENI_STATUS ); +/* Cancel the current write to log the fault */ if (!locked) {geni_se_cancel_m_cmd (&port->se);
@@ -461,9 +466,19 @@ static void qcom_geni_serial_console_write(struct console *co, const char *s, }writel_relaxed (M_CMD_CANCEL_EN , uport->membase +SE_GENI_M_IRQ_CLEAR ); + }else if ((geni_status &M_GENI_CMD_ACTIVE ) && !port->tx_remaining) { +/* +* It seems we can't interrupt existing transfers if all data +* has been sent, in which case we need to look for done first. +*/ +qcom_geni_serial_poll_tx_done (uport); }__qcom_geni_serial_console_write (uport, s, count); + +if (port->tx_remaining) +qcom_geni_serial_setup_tx (uport, port->tx_remaining); +if (locked)spin_unlock_irqrestore (&uport->lock, flags); }
@@ -694,40 +709,45 @@ static void qcom_geni_serial_handle_rx(struct uart_port *uport, bool drop) port->handle_rx (uport, total_bytes, drop); } -static void qcom_geni_serial_handle_tx (struct uart_port *uport) +static void qcom_geni_serial_handle_tx (struct uart_port *uport,bool done, +bool active) {struct qcom_geni_serial_port *port =to_dev_port (uport, uport);struct circ_buf *xmit = &uport->state->xmit;size_t avail;size_t remaining; +size_t pending;int i;u32 status;unsigned int chunk;int tail; -u32 irq_en; - chunk =uart_circ_chars_pending (xmit); status =readl_relaxed (uport->membase +SE_GENI_TX_FIFO_STATUS ); -/* Both FIFO and framework buffer are drained */ -if (!chunk && !status) { + +/* Complete the current tx command before taking newly added data */ +if (active) + pending = port->tx_remaining; +else + pending =uart_circ_chars_pending (xmit); + +/* All data has been transmitted and acknowledged as received */ +if (!pending && !status && done) {qcom_geni_serial_stop_tx (uport); goto out_write_wakeup; } -if (!uart_console (uport)) { - irq_en =readl_relaxed (uport->membase +SE_GENI_M_IRQ_EN ); - irq_en &= ~(M_TX_FIFO_WATERMARK_EN ); -writel_relaxed (0 , uport->membase +SE_GENI_TX_WATERMARK_REG ); -writel_relaxed (irq_en, uport->membase +SE_GENI_M_IRQ_EN ); - } + avail = port->tx_fifo_depth - (status &TX_FIFO_WC ); + avail *= port->tx_bytes_pw; - avail = (port->tx_fifo_depth - port->tx_wm) * port->tx_bytes_pw; tail = xmit->tail; - chunk =min3 ((size_t )chunk, (size_t )(UART_XMIT_SIZE - tail), avail); + chunk =min3 (avail, pending, (size_t )(UART_XMIT_SIZE - tail));if (!chunk) goto out_write_wakeup; -qcom_geni_serial_setup_tx (uport, chunk); +if (!port->tx_remaining) { +qcom_geni_serial_setup_tx (uport, pending); + port->tx_remaining = pending; + } remaining = chunk;for (i =0 ; i < chunk; ) {
@@ -746,11 +766,10 @@ static void qcom_geni_serial_handle_tx(struct uart_port *uport) tail += tx_bytes; uport->icount.tx += tx_bytes; remaining -= tx_bytes; + port->tx_remaining -= tx_bytes; } xmit->tail = tail & (UART_XMIT_SIZE -1 ); -if (uart_console (uport)) -qcom_geni_serial_poll_tx_done (uport); out_write_wakeup:if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (uport);
@@ -760,6 +779,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev) {unsigned int m_irq_status;unsigned int s_irq_status; +unsigned int geni_status;struct uart_port *uport = dev;unsigned long flags;unsigned int m_irq_en;
@@ -773,6 +793,7 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev)spin_lock_irqsave (&uport->lock, flags); m_irq_status =readl_relaxed (uport->membase +SE_GENI_M_IRQ_STATUS ); s_irq_status =readl_relaxed (uport->membase +SE_GENI_S_IRQ_STATUS ); + geni_status =readl_relaxed (uport->membase +SE_GENI_STATUS ); m_irq_en =readl_relaxed (uport->membase +SE_GENI_M_IRQ_EN );writel_relaxed (m_irq_status, uport->membase +SE_GENI_M_IRQ_CLEAR );writel_relaxed (s_irq_status, uport->membase +SE_GENI_S_IRQ_CLEAR );
@@ -787,7 +808,8 @@ static irqreturn_t qcom_geni_serial_isr(int isr, void *dev)if (m_irq_status & (M_TX_FIFO_WATERMARK_EN |M_CMD_DONE_EN ) && m_irq_en & (M_TX_FIFO_WATERMARK_EN |M_CMD_DONE_EN )) -qcom_geni_serial_handle_tx (uport); +qcom_geni_serial_handle_tx (uport, m_irq_status &M_CMD_DONE_EN , + geni_status &M_GENI_CMD_ACTIVE );if (s_irq_status &S_GP_IRQ_0_EN || s_irq_status &S_GP_IRQ_1_EN ) {if (s_irq_status &S_GP_IRQ_0_EN )
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 151/243 kbuild: disable dtc simple_bus_reg warnings by default
In reply to Greg Kroah-HartmanFrom: Rob Herring <[email protected]>
[ Upstream commit 70523a3ce5ff928faa43bb2cad554dc63438e3e7 ]
The updated version of dtc has a bug fix for simple_bus_reg warnings and lots of warnings are generated now. So disable this warning by default.
--- scripts/Makefile.lib | 1 + 1 file changed, 1 insertion(+)
scripts/Makefile.lib +1 -0
@@ -252,6 +252,7 @@ DTC_FLAGS += -Wno-unit_address_vs_reg \ -Wno-alias_paths \ -Wno-graph_child_address \ -Wno-graph_port \ + -Wno-simple_bus_reg \ -Wno-unique_unit_address \ -Wno-pci_device_reg endif
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 178/243 tty: Dont block on IO when ldisc change is pending
In reply to Greg Kroah-HartmanFrom: Dmitry Safonov <[email protected]>
[ Upstream commit c96cf923a98d1b094df9f0cf97a83e118817e31b ]
There might be situations where tty_ldisc_lock() has blocked, but there is already IO on tty and it prevents line discipline changes. It might theoretically turn into dead-lock.
Basically, provide more priority to pending tty_ldisc_lock() than to servicing reads/writes over tty.
User-visible issue was reported by Mikulas where on pa-risc with Debian 5 reboot took either 80 seconds, 3 minutes or 3:25 after proper locking in tty_reopen().
--- drivers/tty/n_hdlc.c | 4 ++-- drivers/tty/n_r3964.c | 2 +- drivers/tty/n_tty.c | 8 ++++---- drivers/tty/tty_ldisc.c | 7 +++++++ include/linux/tty.h | 7 +++++++ 5 files changed, 21 insertions(+), 7 deletions(-)
drivers/tty/n_hdlc.c +2 -2
@@ -613,7 +613,7 @@ static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, }/* no data */ -if (file->f_flags &O_NONBLOCK ) { +if (tty_io_nonblock (tty, file)) { ret = -EAGAIN ;break ; }
@@ -680,7 +680,7 @@ static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,if (tbuf)break ; -if (file->f_flags &O_NONBLOCK ) { +if (tty_io_nonblock (tty, file)) { error = -EAGAIN ;break ; }
drivers/tty/n_r3964.c +1 -1
@@ -1078,7 +1078,7 @@ static ssize_t r3964_read(struct tty_struct *tty, struct file *file, pMsg =remove_msg (pInfo, pClient);if (pMsg ==NULL ) {/* no messages available. */ -if (file->f_flags &O_NONBLOCK ) { +if (tty_io_nonblock (tty, file)) { ret = -EAGAIN ; goto unlock; }
drivers/tty/n_tty.c +4 -4
@@ -1702,7 +1702,7 @@ n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp,down_read (&tty->termios_rwsem); -while (1 ) { + do { /* * When PARMRK is set, each input char may take up to 3 chars * in the read buf; reduce the buffer space avail by 3x
@@ -1744,7 +1744,7 @@ n_tty_receive_buf_common(struct tty_struct *tty, const unsigned char *cp, fp += n; count -= n; rcvd += n; - } + }while (!test_bit (TTY_LDISC_CHANGING , &tty->flags)); tty->receive_room = room;
@@ -2211,7 +2211,7 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file,break ;if (!timeout)break ; -if (file->f_flags &O_NONBLOCK ) { +if (tty_io_nonblock (tty, file)) { retval = -EAGAIN ;break ; }
@@ -2365,7 +2365,7 @@ static ssize_t n_tty_write(struct tty_struct *tty, struct file *file, }if (!nr)break ; -if (file->f_flags &O_NONBLOCK ) { +if (tty_io_nonblock (tty, file)) { retval = -EAGAIN ;break ; }
drivers/tty/tty_ldisc.c +7 -0
@@ -336,6 +336,11 @@ int tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout) {int ret; +/* Kindly asking blocked readers to release the read side */ +set_bit (TTY_LDISC_CHANGING , &tty->flags); +wake_up_interruptible_all (&tty->read_wait); +wake_up_interruptible_all (&tty->write_wait); + ret =__tty_ldisc_lock (tty, timeout);if (!ret)return -EBUSY ;
@@ -346,6 +351,8 @@ int tty_ldisc_lock(struct tty_struct *tty, unsigned long timeout)void tty_ldisc_unlock (struct tty_struct *tty) {clear_bit (TTY_LDISC_HALTED , &tty->flags); +/* Can be cleared here - ldisc_unlock will wake up writers firstly */ +clear_bit (TTY_LDISC_CHANGING , &tty->flags);__tty_ldisc_unlock (tty); }
include/linux/tty.h +7 -0
@@ -366,6 +366,7 @@ struct tty_file_private {#define TTY_NO_WRITE_SPLIT 17/* Preserve write boundaries to driver */ #define TTY_HUPPED 18/* Post driver->hangup() */ #define TTY_HUPPING 19/* Hangup in progress */ +#define TTY_LDISC_CHANGING 20/* Change pending - non-block IO */ #define TTY_LDISC_HALTED 22/* Line discipline is halted */ /* Values for tty->flow_change */
@@ -383,6 +384,12 @@ static inline void tty_set_flow_change(struct tty_struct *tty, int val)smp_mb (); } +static inline bool tty_io_nonblock (struct tty_struct *tty,struct file *file) +{ +return file->f_flags &O_NONBLOCK || +test_bit (TTY_LDISC_CHANGING , &tty->flags); +} +static inline bool tty_io_error (struct tty_struct *tty) {return test_bit (TTY_IO_ERROR , &tty->flags);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 179/243 media: stkwebcam: Bugfix for wrong return values
In reply to Greg Kroah-HartmanFrom: Andreas Pape <[email protected]>
[ Upstream commit 3c28b91380dd1183347d32d87d820818031ebecf ]
usb_control_msg returns in case of a successfully sent message the number of sent bytes as a positive number. Don't use this value as a return value for stk_camera_read_reg, as a non-zero return value is used as an error condition in some cases when stk_camera_read_reg is called.
--- drivers/media/usb/stkwebcam/stk-webcam.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/media/usb/stkwebcam/stk-webcam.c +5 -1
@@ -164,7 +164,11 @@ int stk_camera_read_reg(struct stk_camera *dev, u16 index, u8 *value) *value = *buf;kfree (buf); -return ret; + +if (ret <0 ) +return ret; +else +return 0 ; }static int stk_start_stream (struct stk_camera *dev)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 181/243 clk: qcom: gcc-msm8998: Disable halt check of UFS clocks
In reply to Greg Kroah-HartmanFrom: Bjorn Andersson <[email protected]>
[ Upstream commit 2abf856202fd3e4883e4c518acaa9a023b0dbe54 ]
Drop the halt check of the UFS symbol clocks, in accordance with other platforms. This makes clk_disable_unused() happy and makes it possible to turn the clocks on again without an error.
--- drivers/clk/qcom/gcc-msm8998.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/clk/qcom/gcc-msm8998.c +3 -3
@@ -2402,7 +2402,7 @@ static struct clk_branch gcc_ufs_phy_aux_clk = {static struct clk_branch gcc_ufs_rx_symbol_0_clk = { .halt_reg =0x75014 , - .halt_check =BRANCH_HALT , + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x75014 , .enable_mask =BIT (0 ),
@@ -2415,7 +2415,7 @@ static struct clk_branch gcc_ufs_rx_symbol_0_clk = {static struct clk_branch gcc_ufs_rx_symbol_1_clk = { .halt_reg =0x7605c , - .halt_check =BRANCH_HALT , + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x7605c , .enable_mask =BIT (0 ),
@@ -2428,7 +2428,7 @@ static struct clk_branch gcc_ufs_rx_symbol_1_clk = {static struct clk_branch gcc_ufs_tx_symbol_0_clk = { .halt_reg =0x75010 , - .halt_check =BRANCH_HALT , + .halt_check =BRANCH_HALT_SKIP , .clkr = { .enable_reg =0x75010 , .enable_mask =BIT (0 ),
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 180/243 firmware: qcom: scm: fix compilation error when disabled
In reply to Greg Kroah-HartmanFrom: Jonathan Marek <[email protected]>
[ Upstream commit 16ad9501b1f2edebe24f8cf3c09da0695871986b ]
This fixes the case when CONFIG_QCOM_SCM is not enabled, and linux/errno.h has not been included previously.
--- include/linux/qcom_scm.h | 3 +++ 1 file changed, 3 insertions(+)
include/linux/qcom_scm.h +3 -0
@@ -65,6 +65,9 @@ extern int qcom_scm_iommu_secure_ptbl_init(u64 addr, u32 size, u32 spare);extern int qcom_scm_io_readl (phys_addr_t addr,unsigned int *val);extern int qcom_scm_io_writel (phys_addr_t addr,unsigned int val);#else + +#include <linux/errno.h> +static inline int qcom_scm_set_cold_boot_addr (void *entry,const cpumask_t *cpus) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 183/243 soc: renesas: r8a77990-sysc: Fix initialization order of 3DG-{A,B}
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit b0d7fbf8b174168c580bb310964c3c809e5569a9 ]
The workaround for the wrong hierarchy of the 3DG-{A,B} power domains on R-Car E3 ES1.0 corrected the parent domains. However, the 3DG-{A,B} power domains were still initialized and powered in the wrong order, causing 3DG operation to fail.
Fix this by changing the order in the table at runtime, when running on an affected SoC.
--- drivers/soc/renesas/r8a77990-sysc.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-)
drivers/soc/renesas/r8a77990-sysc.c +4 -19
@@ -28,19 +28,6 @@ static struct rcar_sysc_area r8a77990_areas[] __initdata = { { "3dg-b", 0x100, 1, R8A77990_PD_3DG_B, R8A77990_PD_3DG_A }, }; -static void __init rcar_sysc_fix_parent (struct rcar_sysc_area *areas, -unsigned int num_areas,u8 id, -int new_parent) -{ -unsigned int i; - -for (i =0 ; i < num_areas; i++) -if (areas[i].isr_bit == id) { - areas[i].parent = new_parent; -return ; - } -} -/* Fixups for R-Car E3 ES1.0 revision */ static const struct soc_device_attribute r8a77990[]__initconst = { { .soc_id = "r8a77990", .revision = "ES1.0" },
@@ -50,12 +37,10 @@ static const struct soc_device_attribute r8a77990[] __initconst = {static int __init r8a77990_sysc_init (void ) {if (soc_device_match (r8a77990)) { -rcar_sysc_fix_parent (r8a77990_areas, -ARRAY_SIZE (r8a77990_areas), -R8A77990_PD_3DG_A ,R8A77990_PD_3DG_B ); -rcar_sysc_fix_parent (r8a77990_areas, -ARRAY_SIZE (r8a77990_areas), -R8A77990_PD_3DG_B ,R8A77990_PD_ALWAYS_ON ); +/* Fix incorrect 3DG hierarchy */ +swap (r8a77990_areas[7 ], r8a77990_areas[8 ]); + r8a77990_areas[7 ].parent =R8A77990_PD_ALWAYS_ON ; + r8a77990_areas[8 ].parent =R8A77990_PD_3DG_B ; }return 0 ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 182/243 sctp: frag_point sanity check
In reply to Greg Kroah-HartmanFrom: Jakub Audykowicz <[email protected]>
[ Upstream commit afd0a8006e98b1890908f81746c94ca5dae29d7c ]
If for some reason an association's fragmentation point is zero, sctp_datamsg_from_user will try to endlessly try to divide a message into zero-sized chunks. This eventually causes kernel panic due to running out of memory.
Although this situation is quite unlikely, it has occurred before as reported. I propose to add this simple last-ditch sanity check due to the severity of the potential consequences.
--- include/net/sctp/sctp.h | 5 +++++ net/sctp/chunk.c | 6 ++++++ net/sctp/socket.c | 3 +-- 3 files changed, 12 insertions(+), 2 deletions(-)
include/net/sctp/sctp.h +5 -0
@@ -620,4 +620,9 @@ static inline bool sctp_transport_pmtu_check(struct sctp_transport *t) return false; } +static inline __u32 sctp_min_frag_point (struct sctp_sock *sp,__u16 datasize) +{ +return sctp_mtu_payload (sp,SCTP_DEFAULT_MINSEGMENT , datasize); +} +#endif /* __net_sctp_h__ */
net/sctp/chunk.c +6 -0
@@ -191,6 +191,12 @@ struct sctp_datamsg *sctp_datamsg_from_user(struct sctp_association *asoc,* the packet */ max_data = asoc->frag_point; +if (unlikely (!max_data)) { + max_data =sctp_min_frag_point (sctp_sk (asoc->base.sk), +sctp_datachk_len (&asoc->stream)); +pr_warn_ratelimited ("%s: asoc:%p frag_point is zero, forcing max_data to default minimum (%Zu)" , + __func__, asoc, max_data); + }/* If the the peer requested that we authenticate DATA chunks * we need to account for bundling of the AUTH chunks along with
net/sctp/socket.c +1 -2
@@ -3328,8 +3328,7 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, unsigned__u16 datasize = asoc ?sctp_datachk_len (&asoc->stream) :sizeof (struct sctp_data_chunk ); - min_len =sctp_mtu_payload (sp,SCTP_DEFAULT_MINSEGMENT , - datasize); + min_len =sctp_min_frag_point (sp, datasize); max_len =SCTP_MAX_CHUNK_LEN - datasize;if (val < min_len || val > max_len)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 184/243 mlxsw: spectrum_router: Relax GRE decap matching check
In reply to Greg Kroah-HartmanFrom: Nir Dotan <[email protected]>
[ Upstream commit da93d2913fdf43d5cde3c5a53ac9cc29684d5c7c ]
GRE decap offload is configured when local routes prefix correspond to the local address of one of the offloaded GRE tunnels. The matching check was found to be too strict, such that for a flat GRE configuration, in which the overlay and underlay traffic share the same non-default VRF, decap flow was not offloaded.
Relax the check for decap flow offloading. A match occurs if the local address of the tunnel matches the local route address while both share the same VRF table.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +1 -4
@@ -1215,15 +1215,12 @@ mlxsw_sp_ipip_entry_matches_decap(struct mlxsw_sp *mlxsw_sp, {u32 ul_tb_id =l3mdev_fib_table (ul_dev) ? :RT_TABLE_MAIN ;enum mlxsw_sp_ipip_type ipipt = ipip_entry->ipipt; -struct net_device *ipip_ul_dev;if (mlxsw_sp->router->ipip_ops_arr[ipipt]->ul_proto != ul_proto)return false; - ipip_ul_dev =__mlxsw_sp_ipip_netdev_ul_dev_get (ipip_entry->ol_dev);return mlxsw_sp_ipip_entry_saddr_matches (mlxsw_sp, ul_proto, ul_dip, - ul_tb_id, ipip_entry) && - (!ipip_ul_dev || ipip_ul_dev == ul_dev); + ul_tb_id, ipip_entry); }/* Given decap parameters, find the corresponding IPIP entry. */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 186/243 IB/hfi1: Ignore LNI errors before DC8051 transitions to Polling state
In reply to Greg Kroah-HartmanFrom: Kaike Wan <[email protected]>
[ Upstream commit c1a797c0818e0122c7ec8422edd971cfec9b15ea ]
When it is requested to change its physical state back to Offline while in the process to go up, DC8051 will set the ERROR field in the DC8051_DBG_ERR_INFO_SET_BY_8051 register. This ERROR field will remain until the next time when DC8051 transitions from Offline to Polling. Subsequently, when the host requests DC8051 to change its physical state to Polling again, it may receive a DC8051 interrupt with the stale ERROR field still in DC8051_DBG_ERR_INFO_SET_BY_8051. If the host link state has been changed to Polling, this stale ERROR will force the host to transition to Offline state, resulting in a vicious cycle of Polling ->Offline->Polling->Offline. On the other hand, if the host link state is still Offline when the stale ERROR is received, the stale ERROR will be ignored, and the link will come up correctly. This patch implements the correct behavior by changing host link state to Polling only after DC8051 changes its physical state to Polling.
--- drivers/infiniband/hw/hfi1/chip.c | 47 ++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/chip.c +46 -1
@@ -1074,6 +1074,8 @@ static void log_state_transition(struct hfi1_pportdata *ppd, u32 state);static void log_physical_state (struct hfi1_pportdata *ppd,u32 state);static int wait_physical_linkstate (struct hfi1_pportdata *ppd,u32 state,int msecs); +static int wait_phys_link_out_of_offline (struct hfi1_pportdata *ppd, +int msecs);static void read_planned_down_reason_code (struct hfi1_devdata *dd,u8 *pdrrc);static void read_link_down_reason (struct hfi1_devdata *dd,u8 *ldr);static void handle_temp_err (struct hfi1_devdata *dd);
@@ -10769,13 +10771,15 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state)break ; ppd->port_error_action =0 ; - ppd->host_link_state =HLS_DN_POLL ;if (quick_linkup) {/* quick linkup does not go into polling */ ret =do_quick_linkup (dd); }else { ret1 =set_physical_link_state (dd,PLS_POLLING ); +if (!ret1) + ret1 =wait_phys_link_out_of_offline (ppd, +3000 );if (ret1 !=HCMD_SUCCESS ) { dd_dev_err(dd, "Failed to transition to Polling link state, return 0x%x\n",
@@ -10783,6 +10787,14 @@ int set_link_state(struct hfi1_pportdata *ppd, u32 state) ret = -EINVAL ; } } + +/* +* Change the host link state after requesting DC8051 to +* change its physical state so that we can ignore any +* interrupt with stale LNI(XX) error, which will not be +* cleared until DC8051 transitions to Polling state. +*/ + ppd->host_link_state =HLS_DN_POLL ; ppd->offline_disabled_reason =HFI1_ODR_MASK (OPA_LINKDOWN_REASON_NONE );/*
@@ -12914,6 +12926,39 @@ static int wait_phys_link_offline_substates(struct hfi1_pportdata *ppd,return read_state; } +/* +* wait_phys_link_out_of_offline - wait for any out of offline state +* @ppd: port device +* @msecs: the number of milliseconds to wait +* +* Wait up to msecs milliseconds for any out of offline physical link +* state change to occur. +* Returns 0 if at least one state is reached, otherwise -ETIMEDOUT. +*/ +static int wait_phys_link_out_of_offline (struct hfi1_pportdata *ppd, +int msecs) +{ +u32 read_state; +unsigned long timeout; + + timeout = jiffies +msecs_to_jiffies (msecs); +while (1 ) { + read_state =read_physical_state (ppd->dd); +if ((read_state &0xF0 ) !=PLS_OFFLINE ) +break ; +if (time_after (jiffies, timeout)) { +dd_dev_err (ppd->dd, +"timeout waiting for phy link out of offline. Read state 0x%x, %dms\n" , + read_state, msecs); +return -ETIMEDOUT ; + } +usleep_range (1950 ,2050 );/* sleep 2ms-ish */ + } + +log_state_transition (ppd, read_state); +return read_state; +} +#define CLEAR_STATIC_RATE_CONTROL_SMASK (r) \ (r &= ~SEND_CTXT_CHECK_ENABLE_DISALLOW_PBC_STATIC_RATE_CONTROL_SMASK)
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 187/243 IB/hfi1: Close VNIC sdma_progress sleep window
In reply to Greg Kroah-HartmanFrom: Mike Marciniszyn <[email protected]>
[ Upstream commit 18912c4524385dd6532c682cb9d4f6aa39ba8d47 ]
The call to sdma_progress() is called outside the wait lock.
In this case, there is a race condition where sdma_progress() can return false and the sdma_engine can idle. If that happens, there will be no more sdma interrupts to cause the wakeup and the vnic_sdma xmit will hang.
Fix by moving the lock to enclose the sdma_progress() call.
Also, delete the tx_retry. The need for this was removed by:
commit bcad29137a97 ("IB/hfi1: Serve the most starved iowait entry first")
--- drivers/infiniband/hw/hfi1/vnic_sdma.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
drivers/infiniband/hw/hfi1/vnic_sdma.c +5 -10
@@ -57,7 +57,6 @@#define HFI1_VNIC_TXREQ_NAME_LEN 32#define HFI1_VNIC_SDMA_DESC_WTRMRK 64 -#define HFI1_VNIC_SDMA_RETRY_COUNT 1/* * struct vnic_txreq - VNIC transmit descriptor
@@ -67,7 +66,6 @@* @pad: pad buffer * @plen: pad length * @pbc_val: pbc value -* @retry_count: tx retry count */ struct vnic_txreq {struct sdma_txreq txreq;
@@ -77,8 +75,6 @@ struct vnic_txreq {unsigned char pad[HFI1_VNIC_MAX_PAD ];u16 plen;__le64 pbc_val; - -u32 retry_count; }; static void vnic_sdma_complete(struct sdma_txreq *txreq,
@@ -196,7 +192,6 @@ int hfi1_vnic_send_dma(struct hfi1_devdata *dd, u8 q_idx, ret =build_vnic_tx_desc (sde, tx, pbc);if (unlikely (ret)) goto free_desc; - tx->retry_count =0 ; ret =sdma_send_txreq (sde, &vnic_sdma->wait, &tx->txreq, vnic_sdma->pkts_sent);
@@ -238,14 +233,14 @@ static int hfi1_vnic_sdma_sleep(struct sdma_engine *sde,struct hfi1_vnic_sdma *vnic_sdma = container_of(wait, struct hfi1_vnic_sdma, wait);struct hfi1_ibdev *dev = &vnic_sdma->dd->verbs_dev; - struct vnic_txreq *tx = container_of(txreq, struct vnic_txreq, txreq); -if (sdma_progress (sde, seq, txreq)) -if (tx->retry_count++ <HFI1_VNIC_SDMA_RETRY_COUNT ) -return -EAGAIN ; +write_seqlock (&dev->iowait_lock); +if (sdma_progress (sde, seq, txreq)) { +write_sequnlock (&dev->iowait_lock); +return -EAGAIN ; + } vnic_sdma->state =HFI1_VNIC_SDMA_Q_DEFERRED ; -write_seqlock (&dev->iowait_lock);if (list_empty (&vnic_sdma->wait.list))iowait_queue (pkts_sent, wait, &sde->dmawait);write_sequnlock (&dev->iowait_lock);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 152/243 tcp: make tcp_space() aware of socket backlog
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 85bdf7db5b53cdcc7a901db12bcb3d0063e3866d ]
Jean-Louis Dupond reported poor iscsi TCP receive performance that we tracked to backlog drops.
Apparently we fail to send window updates reflecting the fact that we are under stress.
Note that we might lack a proper window increase when backlog is fully processed, since __release_sock() clears sk->sk_backlog.len _after_ all skbs have been processed.
This should not matter in practice. If we had a significant load through socket backlog, we are in a dangerous situation.
--- include/net/tcp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/net/tcp.h +1 -1
@@ -1353,7 +1353,7 @@ static inline int tcp_win_from_space(const struct sock *sk, int space)/* Note: caller must be prepared to deal with negative returns */ static inline int tcp_space (const struct sock *sk) { -return tcp_win_from_space (sk, sk->sk_rcvbuf - +return tcp_win_from_space (sk, sk->sk_rcvbuf - sk->sk_backlog.len -atomic_read (&sk->sk_rmem_alloc)); }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 154/243 ARM: dts: realview-pbx: Fix duplicate regulator nodes
In reply to Greg Kroah-HartmanFrom: Rob Herring <[email protected]>
[ Upstream commit 7f4b001b7f6e0480b5bdab9cd8ce1711e43e5cb5 ]
There's a bug in dtc in checking for duplicate node names when there's another section (e.g. "/ { };"). In this case, skeleton.dtsi provides another section. Upon removal of skeleton.dtsi, the dtb fails to build due to a duplicate node 'fixedregulator@0'. As both nodes were pretty much the same 3.3V fixed regulator, it hasn't really mattered. Fix this by renaming the nodes to something unique. In the process, drop the unit-address which shouldn't be present wtihout reg property.
--- arch/arm/boot/dts/arm-realview-pbx.dtsi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/arm/boot/dts/arm-realview-pbx.dtsi +2 -3
@@ -44,7 +44,7 @@ }; /* The voltage to the MMC card is hardwired at 3.3V */ - vmmc: fixedregulator@0 { + vmmc: regulator-vmmc { compatible = "regulator-fixed"; regulator-name = "vmmc"; regulator-min-microvolt = <3300000>;
@@ -52,7 +52,7 @@ regulator-boot-on; }; - veth: fixedregulator@0 { + veth: regulator-veth { compatible = "regulator-fixed"; regulator-name = "veth"; regulator-min-microvolt = <3300000>;
@@ -567,4 +567,3 @@ }; }; }; -
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 153/243 ARM: dts: mmp2: fix the gpio interrupt cell number
In reply to Greg Kroah-HartmanFrom: Lubomir Rintel <[email protected]>
[ Upstream commit 400583983f8a8e95ec02c9c9e2b50188753a87fb ]
gpio-pxa uses two cell to encode the interrupt source: the pin number and the trigger type. Adjust the device node accordingly.
--- arch/arm/boot/dts/mmp2.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/mmp2.dtsi +1 -1
@@ -180,7 +180,7 @@ clocks = <&soc_clocks MMP2_CLK_GPIO>; resets = <&soc_clocks MMP2_CLK_GPIO>; interrupt-controller; - #interrupt-cells = <1>; + #interrupt-cells = <2>; ranges; gcb0: gpio@d4019000 {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 155/243 tcp: fix off-by-one bug on aborting window-probing socket
In reply to Greg Kroah-HartmanFrom: Yuchung Cheng <[email protected]>
[ Upstream commit 3976535af0cb9fe34a55f2ffb8d7e6b39a2f8188 ]
Previously there is an off-by-one bug on determining when to abort a stalled window-probing socket. This patch fixes that so it is consistent with tcp_write_timeout().
--- net/ipv4/tcp_timer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/tcp_timer.c +1 -1
@@ -378,7 +378,7 @@ static void tcp_probe_timer(struct sock *sk)return ; } -if (icsk->icsk_probes_out > max_probes) { +if (icsk->icsk_probes_out >= max_probes) { abort:tcp_write_err (sk); }else {/* Only send another probe if we didn't close things up. */
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 157/243 tcp: fix SNMP TCP timeout under-estimation
In reply to Greg Kroah-HartmanFrom: Yuchung Cheng <[email protected]>
[ Upstream commit e1561fe2dd69dc5dddd69bd73aa65355bdfb048b ]
Previously the SNMP TCPTIMEOUTS counter has inconsistent accounting:
1. It counts all SYN and SYN-ACK timeouts
2. It counts timeouts in other states except recurring timeouts and timeouts after fast recovery or disorder state.
Such selective accounting makes analysis difficult and complicated. For example the monitoring system needs to collect many other SNMP counters to infer the total amount of timeout events. This patch makes TCPTIMEOUTS counter simply counts all the retransmit timeout (SYN or data or FIN).
--- net/ipv4/tcp_timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/ipv4/tcp_timer.c +4 -4
@@ -482,11 +482,12 @@ void tcp_retransmit_timer(struct sock *sk) goto out_reset_timer; } +__NET_INC_STATS (sock_net (sk),LINUX_MIB_TCPTIMEOUTS );if (tcp_write_timeout (sk)) goto out;if (icsk->icsk_retransmits ==0 ) { -int mib_idx; +int mib_idx =0 ;if (icsk->icsk_ca_state == TCP_CA_Recovery) {if (tcp_is_sack (tp))
@@ -501,10 +502,9 @@ void tcp_retransmit_timer(struct sock *sk) mib_idx =LINUX_MIB_TCPSACKFAILURES ; else mib_idx =LINUX_MIB_TCPRENOFAILURES ; - }else { - mib_idx =LINUX_MIB_TCPTIMEOUTS ; } -__NET_INC_STATS (sock_net (sk), mib_idx); +if (mib_idx) +__NET_INC_STATS (sock_net (sk), mib_idx); }tcp_enter_loss (sk);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 189/243 usb: mtu3: fix dbginfo in qmu_tx_zlp_error_handler
In reply to Greg Kroah-HartmanFrom: YueHaibing <[email protected]>
[ Upstream commit f770e3bc236ee954a3b4052bdf55739e26ee25db ]
Fixes gcc '-Wunused-but-set-variable' warning:
drivers/usb/mtu3/mtu3_qmu.c: In function 'qmu_tx_zlp_error_handler':drivers/usb/mtu3/mtu3_qmu.c:385:22: warning:
variable 'req' set but not used [-Wunused-but-set-variable]
It seems dbginfo original intention is print 'req' other than 'mreq'
--- drivers/usb/mtu3/mtu3_qmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/mtu3/mtu3_qmu.c +1 -1
@@ -427,7 +427,7 @@ static void qmu_tx_zlp_error_handler(struct mtu3 *mtu, u8 epnum)return ; } -dev_dbg (mtu->dev,"%s send ZLP for req=%p\n" , __func__, mreq); +dev_dbg (mtu->dev,"%s send ZLP for req=%p\n" , __func__, req);mtu3_clrbits (mbase,MU3D_EP_TXCR0 (mep->epnum),TX_DMAREQEN );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 148/243 soc: renesas: r8a77970-sysc: Correct names of A2DP/A2CN power domains
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit b5eb730e031acaba2d25e8f522ac5966a70885ae ]
The R-Car Gen3 HardWare Manual Errata for Rev. 0.80 (Feb 28, 2018) renamed the A2IR2 and A2IR3 power domains on R-Car V3M to A2DP resp. A2CN.
As these definitions are not yet used from DT, they can just be renamed.
While at it, fix the indentation of the A3IR definition.
--- drivers/soc/renesas/r8a77970-sysc.c | 4 ++-- include/dt-bindings/power/r8a77970-sysc.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/soc/renesas/r8a77970-sysc.c +2 -2
@@ -27,8 +27,8 @@ static const struct rcar_sysc_area r8a77970_areas[] __initconst = { { "a3ir", 0x180, 0, R8A77970_PD_A3IR, R8A77970_PD_ALWAYS_ON }, { "a2ir0", 0x400, 0, R8A77970_PD_A2IR0, R8A77970_PD_A3IR }, { "a2ir1", 0x400, 1, R8A77970_PD_A2IR1, R8A77970_PD_A3IR }, - { "a2ir2", 0x400, 2, R8A77970_PD_A2IR2, R8A77970_PD_A3IR }, - { "a2ir3", 0x400, 3, R8A77970_PD_A2IR3, R8A77970_PD_A3IR }, + { "a2dp", 0x400, 2, R8A77970_PD_A2DP, R8A77970_PD_A3IR }, + { "a2cn", 0x400, 3, R8A77970_PD_A2CN, R8A77970_PD_A3IR }, { "a2sc0", 0x400, 4, R8A77970_PD_A2SC0, R8A77970_PD_A3IR }, { "a2sc1", 0x400, 5, R8A77970_PD_A2SC1, R8A77970_PD_A3IR }, };
include/dt-bindings/power/r8a77970-sysc.h +3 -3
@@ -19,10 +19,10 @@#define R8A77970_PD_CR7 13#define R8A77970_PD_CA53_SCU 21#define R8A77970_PD_A2IR0 23 -#define R8A77970_PD_A3IR 24 +#define R8A77970_PD_A3IR 24#define R8A77970_PD_A2IR1 27 -#define R8A77970_PD_A2IR2 28 -#define R8A77970_PD_A2IR3 29 +#define R8A77970_PD_A2DP 28 +#define R8A77970_PD_A2CN 29#define R8A77970_PD_A2SC0 30#define R8A77970_PD_A2SC1 31
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 198/243 fuse: verify attributes
In reply to Greg Kroah-HartmanFrom: Miklos Szeredi <[email protected]>
commit eb59bd17d2fa6e5e84fba61a5ebdea984222e6d5 upstream.
If a filesystem returns negative inode sizes, future reads on the file were causing the cpu to spin on truncate_pagecache.
Create a helper to validate the attributes. This now does two things:
- check the file mode
- check if the file size fits in i_size without overflowing
--- fs/fuse/dir.c | 24 +++++++++++++++++------- fs/fuse/fuse_i.h | 2 ++ 2 files changed, 19 insertions(+), 7 deletions(-)
fs/fuse/dir.c +17 -7
@@ -234,7 +234,8 @@ static int fuse_dentry_revalidate(structkfree (forget);if (ret == -ENOMEM ) goto out; -if (ret || (outarg.attr.mode ^ inode->i_mode) &S_IFMT ) +if (ret ||fuse_invalid_attr (&outarg.attr) || + (outarg.attr.mode ^ inode->i_mode) &S_IFMT ) goto invalid;forget_all_cached_acls (inode);
@@ -297,6 +298,12 @@ int fuse_valid_type(int m)S_ISBLK (m) ||S_ISFIFO (m) ||S_ISSOCK (m); } +bool fuse_invalid_attr (struct fuse_attr *attr) +{ +return !fuse_valid_type (attr->mode) || + attr->size >LLONG_MAX ; +} +int fuse_lookup_name (struct super_block *sb,u64 nodeid,const struct qstr *name,struct fuse_entry_out *outarg,struct inode **inode) {
@@ -328,7 +335,7 @@ int fuse_lookup_name(struct super_block err = -EIO ;if (!outarg->nodeid) goto out_put_forget; -if (!fuse_valid_type (outarg->attr.mode)) +if (fuse_invalid_attr (&outarg->attr)) goto out_put_forget; *inode = fuse_iget(sb, outarg->nodeid, outarg->generation,
@@ -451,7 +458,8 @@ static int fuse_create_open(struct inode goto out_free_ff; err = -EIO ; -if (!S_ISREG (outentry.attr.mode) ||invalid_nodeid (outentry.nodeid)) +if (!S_ISREG (outentry.attr.mode) ||invalid_nodeid (outentry.nodeid) || +fuse_invalid_attr (&outentry.attr)) goto out_free_ff; ff->fh = outopen.fh;
@@ -558,7 +566,7 @@ static int create_new_entry(struct fuse_ goto out_put_forget_req; err = -EIO ; -if (invalid_nodeid (outarg.nodeid)) +if (invalid_nodeid (outarg.nodeid) ||fuse_invalid_attr (&outarg.attr)) goto out_put_forget_req;if ((outarg.attr.mode ^ mode) &S_IFMT )
@@ -918,7 +926,8 @@ static int fuse_do_getattr(struct inode args.out.args[0 ].value = &outarg; err =fuse_simple_request (fc, &args);if (!err) { -if ((inode->i_mode ^ outarg.attr.mode) &S_IFMT ) { +if (fuse_invalid_attr (&outarg.attr) || + (inode->i_mode ^ outarg.attr.mode) &S_IFMT ) {make_bad_inode (inode); err = -EIO ; }else {
@@ -1230,7 +1239,7 @@ static int fuse_direntplus_link(struct fif (invalid_nodeid (o->nodeid))return -EIO ; -if (!fuse_valid_type (o->attr.mode)) +if (fuse_invalid_attr (&o->attr))return -EIO ; fc =get_fuse_conn (dir);
@@ -1707,7 +1716,8 @@ int fuse_do_setattr(struct dentry *dentr goto error; } -if ((inode->i_mode ^ outarg.attr.mode) &S_IFMT ) { +if (fuse_invalid_attr (&outarg.attr) || + (inode->i_mode ^ outarg.attr.mode) &S_IFMT ) {make_bad_inode (inode); err = -EIO ; goto error;
fs/fuse/fuse_i.h +2 -0
@@ -909,6 +909,8 @@ void fuse_ctl_remove_conn(struct fuse_co*/ int fuse_valid_type (int m); +bool fuse_invalid_attr (struct fuse_attr *attr); +/** * Is current process allowed to perform filesystem operation? */
Greg Kroah-Hartman
maintainerPATCH 200/243 ALSA: hda/realtek - Enable the headset-mic on a Xiaomis laptop
In reply to Greg Kroah-HartmanFrom: Hui Wang <[email protected]>
commit 695d1ec3994f9de2cefae80ee2087c95d2e5a2f3 upstream.
The headset on this machine is not defined, after applying the quirk ALC256_FIXUP_ASUS_HEADSET_MIC, the headset-mic works well
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -7038,6 +7038,7 @@ static const struct snd_pci_quirk alc269SND_PCI_QUIRK (0x17aa ,0x9e54 ,"LENOVO NB" ,ALC269_FIXUP_LENOVO_EAPD ),SND_PCI_QUIRK (0x19e5 ,0x3204 ,"Huawei MBXP" ,ALC256_FIXUP_HUAWEI_MBXP_PINS ),SND_PCI_QUIRK (0x1b7d ,0xa831 ,"Ordissimo EVE2 " ,ALC269VB_FIXUP_ORDISSIMO_EVE2 ),/* Also known as Malata PC-B1303 */ +SND_PCI_QUIRK (0x1d72 ,0x1901 ,"RedmiBook 14" ,ALC256_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x10ec ,0x118c ,"Medion EE4254 MD62100" ,ALC256_FIXUP_MEDION_HEADSET_NO_PRESENCE ), #if 0
Greg Kroah-Hartman
maintainerPATCH 201/243 ALSA: hda/realtek - Dell headphone has noise on unmute for ALC236
In reply to Greg Kroah-HartmanFrom: Kailang Yang <[email protected]>
commit e1e8c1fdce8b00fce08784d9d738c60ebf598ebc upstream.
headphone have noise even the volume is very small. Let it fill up pcbeep hidden register to default value. The issue was gone.
--- sound/pci/hda/patch_realtek.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
sound/pci/hda/patch_realtek.c +5 -2
@@ -379,9 +379,7 @@ static void alc_fill_eapd_coef(struct hdcase 0x10ec0215 :case 0x10ec0233 :case 0x10ec0235 : -case 0x10ec0236 :case 0x10ec0255 : -case 0x10ec0256 :case 0x10ec0257 :case 0x10ec0282 :case 0x10ec0283 :
@@ -393,6 +391,11 @@ static void alc_fill_eapd_coef(struct hdcase 0x10ec0300 :alc_update_coef_idx (codec,0x10 ,1 <<9 ,0 );break ; +case 0x10ec0236 : +case 0x10ec0256 : +alc_write_coef_idx (codec,0x36 ,0x5757 ); +alc_update_coef_idx (codec,0x10 ,1 <<9 ,0 ); +break ;case 0x10ec0275 :alc_update_coef_idx (codec,0xe ,0 ,1 <<0 );break ;
Greg Kroah-Hartman
maintainerPATCH 202/243 ALSA: pcm: oss: Avoid potential buffer overflows
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit 4cc8d6505ab82db3357613d36e6c58a297f57f7c upstream.
syzkaller reported an invalid access in PCM OSS read, and this seems to be an overflow of the internal buffer allocated for a plugin. Since the rate plugin adjusts its transfer size dynamically, the calculation for the chained plugin might be bigger than the given buffer size in some extreme cases, which lead to such an buffer overflow as caught by KASAN.
Fix it by limiting the max transfer size properly by checking against the destination size in each plugin transfer callback.
--- sound/core/oss/linear.c | 2 ++ sound/core/oss/mulaw.c | 2 ++ sound/core/oss/route.c | 2 ++ 3 files changed, 6 insertions(+)
sound/core/oss/linear.c +2 -0
@@ -107,6 +107,8 @@ static snd_pcm_sframes_t linear_transfer } }#endif +if (frames > dst_channels[0 ].frames) + frames = dst_channels[0 ].frames;convert (plugin, src_channels, dst_channels, frames);return frames; }
sound/core/oss/mulaw.c +2 -0
@@ -269,6 +269,8 @@ static snd_pcm_sframes_t mulaw_transfer( } }#endif +if (frames > dst_channels[0 ].frames) + frames = dst_channels[0 ].frames; data = (struct mulaw_priv *)plugin->extra_data; data->func (plugin, src_channels, dst_channels, frames);return frames;
sound/core/oss/route.c +2 -0
@@ -57,6 +57,8 @@ static snd_pcm_sframes_t route_transfer(return -ENXIO ;if (frames ==0 )return 0 ; +if (frames > dst_channels[0 ].frames) + frames = dst_channels[0 ].frames; nsrcs = plugin->src_format.channels; ndsts = plugin->dst_format.channels;
Greg Kroah-Hartman
maintainerPATCH 203/243 ALSA: hda - Add mute led support for HP ProBook 645 G4
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
commit e190de6941db14813032af87873f5550ad5764fe upstream.
Mic mute led does not work on HP ProBook 645 G4. We can use CXT_FIXUP_MUTE_LED_GPIO fixup to support it.
--- sound/pci/hda/patch_conexant.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_conexant.c +1 -0
@@ -923,6 +923,7 @@ static const struct snd_pci_quirk cxt506SND_PCI_QUIRK (0x103c ,0x837f ,"HP ProBook 470 G5" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x8299 ,"HP 800 G3 SFF" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x829a ,"HP 800 G3 DM" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), +SND_PCI_QUIRK (0x103c ,0x8402 ,"HP ProBook 645 G4" ,CXT_FIXUP_MUTE_LED_GPIO ),SND_PCI_QUIRK (0x103c ,0x8455 ,"HP Z2 G4" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ),SND_PCI_QUIRK (0x103c ,0x8456 ,"HP Z2 G4 SFF" ,CXT_FIXUP_HP_MIC_NO_PRESENCE ), SND_PCI_QUIRK(0x103c, 0x8457, "HP Z2 G4 mini", CXT_FIXUP_HP_MIC_NO_PRESENCE),
Greg Kroah-Hartman
maintainerPATCH 204/243 Input: synaptics - switch another X1 Carbon 6 to RMI/SMbus
In reply to Greg Kroah-HartmanFrom: Hans Verkuil <[email protected]>
commit fc1156f373e3927e0dcf06678906c367588bfdd6 upstream.
Some Lenovo X1 Carbon Gen 6 laptops report LEN0091. Add this to the smbus_pnp_ids list.
--- drivers/input/mouse/synaptics.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/mouse/synaptics.c +1 -0
@@ -175,6 +175,7 @@ static const char * const smbus_pnp_ids["LEN0071" ,/* T480 */ "LEN0072" ,/* X1 Carbon Gen 5 (2017) - Elan/ALPS trackpoint */ "LEN0073" ,/* X1 Carbon G5 (Elantech) */ +"LEN0091" ,/* X1 Carbon 6 */ "LEN0092" ,/* X1 Carbon 6 */ "LEN0093" ,/* T480 */ "LEN0096", /* X280 */
Greg Kroah-Hartman
maintainerPATCH 206/243 Input: synaptics-rmi4 - dont increment rmiaddr for SMBus transfers
In reply to Greg Kroah-HartmanFrom: Hans Verkuil <[email protected]>
commit a284e11c371e446371675668d8c8120a27227339 upstream.
This increment of rmi_smbus in rmi_smb_read/write_block() causes garbage to be read/written.
The first read of SMB_MAX_COUNT bytes is fine, but after that it is nonsense. Trial-and-error showed that by dropping the increment of rmiaddr everything is fine and the F54 function properly works.
I tried a hack with rmi_smb_write_block() as well (writing to the same F54 touchpad data area, then reading it back), and that suggests that there too the rmiaddr increment has to be dropped. It makes sense that if it has to be dropped for read, then it has to be dropped for write as well.
It looks like the initial work with F54 was done using i2c, not smbus, and it seems nobody ever tested F54 with smbus. The other functions all read/write less than SMB_MAX_COUNT as far as I can tell, so this issue was never noticed with non-F54 functions.
With this change I can read out the touchpad data correctly on my Lenovo X1 Carbon 6th Gen laptop.
--- drivers/input/rmi4/rmi_smbus.c | 2 -- 1 file changed, 2 deletions(-)
drivers/input/rmi4/rmi_smbus.c +0 -2
@@ -166,7 +166,6 @@ static int rmi_smb_write_block(struct rm/* prepare to write next block of bytes */ cur_len -=SMB_MAX_COUNT ; databuff +=SMB_MAX_COUNT ; - rmiaddr +=SMB_MAX_COUNT ; } exit:mutex_unlock (&rmi_smb->page_mutex);
@@ -218,7 +217,6 @@ static int rmi_smb_read_block(struct rmi/* prepare to read next block of bytes */ cur_len -=SMB_MAX_COUNT ; databuff +=SMB_MAX_COUNT ; - rmiaddr +=SMB_MAX_COUNT ; } retval =0 ;
Greg Kroah-Hartman
maintainerPATCH 190/243 clk: renesas: rcar-gen3: Set state when registering SD clocks
In reply to Greg Kroah-HartmanFrom: Niklas Söderlund <[email protected]>
[ Upstream commit ecda0a09fa9933bcd67e33c952f778f0872392ed ]
The driver tries to figure out which state a SD clock is in when the clock is registered, instead of setting a known state. This can be problematic for two reasons.
1. If the clock driver can't figure out the state of the clock, registration of the clock fails, and setting of a known state by a clock user is not possible.
2. The state of the clock depends on if and how the bootloader configured it. The driver only checks that the rate is known, not if the clock is stopped or not for example.
Fix this by setting a known state and making sure the clock is stopped.
--- drivers/clk/renesas/rcar-gen3-cpg.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
drivers/clk/renesas/rcar-gen3-cpg.c +4 -12
@@ -361,7 +361,7 @@ static struct clk * __init cpg_sd_clk_register(const struct cpg_core_clk *core,struct sd_clock *clock;struct clk *clk;unsigned int i; -u32 sd_fc; +u32 val; clock =kzalloc (sizeof (*clock),GFP_KERNEL );if (!clock)
@@ -378,17 +378,9 @@ static struct clk * __init cpg_sd_clk_register(const struct cpg_core_clk *core, clock->div_table = cpg_sd_div_table; clock->div_num =ARRAY_SIZE (cpg_sd_div_table); - sd_fc =readl (clock->csn.reg) &CPG_SD_FC_MASK ; -for (i =0 ; i < clock->div_num; i++) -if (sd_fc == (clock->div_table[i].val &CPG_SD_FC_MASK )) -break ; - -if (WARN_ON (i >= clock->div_num)) { -kfree (clock); -return ERR_PTR (-EINVAL ); - } - - clock->cur_div_idx = i; + val =readl (clock->csn.reg) & ~CPG_SD_FC_MASK ; + val |=CPG_SD_STP_MASK | (clock->div_table[0 ].val &CPG_SD_FC_MASK ); +writel (val, clock->csn.reg); clock->div_max = clock->div_table[0 ].div; clock->div_min = clock->div_max;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 209/243 Input: Fix memory leak in psxpad_spi_probe
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
In the implementation of psxpad_spi_probe() the allocated memory for pdev is leaked if psxpad_spi_init_ff() or input_register_polled_device() fail. The solution is using device managed allocation, like the one used for pad. Perform the allocation using devm_input_allocate_polled_device().
--- drivers/input/joystick/psxpad-spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/joystick/psxpad-spi.c +1 -1
@@ -292,7 +292,7 @@ static int psxpad_spi_probe(struct spi_dif (!pad)return -ENOMEM ; - pdev =input_allocate_polled_device (); + pdev =devm_input_allocate_polled_device (&spi->dev);if (!pdev) {dev_err (&spi->dev,"failed to allocate input device\n" );return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 210/243 x86/mm/32: Sync only to VMALLOC_END in vmalloc_sync_all()
In reply to Greg Kroah-HartmanFrom: Joerg Roedel <[email protected]>
commit 9a62d20027da3164a22244d9f022c0c987261687 upstream.
The job of vmalloc_sync_all() is to help the lazy freeing of vmalloc()
ranges: before such vmap ranges are reused we make sure that they are unmapped from every task's page tables.
This is really easy on pagetable setups where the kernel page tables are shared between all tasks - this is the case on 32-bit kernels with SHARED_KERNEL_PMD = 1.
But on !SHARED_KERNEL_PMD 32-bit kernels this involves iterating over the pgd_list and clearing all pmd entries in the pgds that are cleared in the init_mm.pgd, which is the reference pagetable that the vmalloc() code uses.
In that context the current practice of vmalloc_sync_all() iterating until FIX_ADDR_TOP is buggy:
for (address = VMALLOC_START & PMD_MASK;
address >= TASK_SIZE_MAX && address < FIXADDR_TOP;
address += PMD_SIZE) {
struct page *page;Because iterating up to FIXADDR_TOP will involve a lot of non-vmalloc address ranges:
VMALLOC -> PKMAP -> LDT -> CPU_ENTRY_AREA -> FIX_ADDR
This is mostly harmless for the FIX_ADDR and CPU_ENTRY_AREA ranges that don't clear their pmds, but it's lethal for the LDT range, which relies on having different mappings in different processes, and 'synchronizing' them in the vmalloc sense corrupts those pagetable entries (clearing them).
This got particularly prominent with PTI, which turns SHARED_KERNEL_PMD off and makes this the dominant mapping mode on 32-bit.
To make LDT working again vmalloc_sync_all() must only iterate over the volatile parts of the kernel address range that are identical between all processes.
So the correct check in vmalloc_sync_all() is "address < VMALLOC_END" to make sure the VMALLOC areas are synchronized and the LDT mapping is not falsely overwritten.
The CPU_ENTRY_AREA and the FIXMAP area are no longer synced either, but this is not really a proplem since their PMDs get established during bootup and never change.
This change fixes the ldt_gdt selftest in my setup.
[ mingo: Fixed up the changelog to explain the logic and modified the
copying to only happen up until VMALLOC_END. ]
--- arch/x86/mm/fault.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/fault.c +1 -1
@@ -281,7 +281,7 @@ void vmalloc_sync_all(void)return ;for (address =VMALLOC_START &PMD_MASK ; - address >=TASK_SIZE_MAX && address <FIXADDR_TOP ; + address >=TASK_SIZE_MAX && address <VMALLOC_END ; address +=PMD_SIZE ) {struct page *page;
Greg Kroah-Hartman
maintainerPATCH 212/243 xfrm interface: fix memory leak on creation
In reply to Greg Kroah-HartmanFrom: Nicolas Dichtel <[email protected]>
commit 56c5ee1a5823e9cf5288b84ae6364cb4112f8225 upstream.
The following commands produce a backtrace and return an error but the xfrm interface is created (in the wrong netns):
$ ip netns add foo
$ ip netns add bar
$ ip -n foo netns set bar 0
$ ip -n foo link add xfrmi0 link-netnsid 0 type xfrm dev lo if_id 23
RTNETLINK answers: Invalid argument
$ ip -n bar link ls xfrmi0
2: xfrmi0@lo: <NOARP,M-DOWN> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/none 00:00:00:00:00:00 brd 00:00:00:00:00:00Here is the backtrace:
[ 79.879174] WARNING: CPU: 0 PID: 1178 at net/core/dev.c:8172 rollback_registered_many+0x86/0x3c1 [ 79.880260] Modules linked in: xfrm_interface nfsv3 nfs_acl auth_rpcgss nfsv4 nfs lockd grace sunrpc fscache button parport_pc parport serio_raw evdev pcspkr loop ext4 crc16 mbcache jbd2 crc32c_generic ide_cd_mod ide_gd_mod cdrom ata_$ eneric ata_piix libata scsi_mod 8139too piix psmouse i2c_piix4 ide_core 8139cp mii i2c_core floppy [ 79.883698] CPU: 0 PID: 1178 Comm: ip Not tainted 5.2.0-rc6+ #106 [ 79.884462] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1 04/01/2014 [ 79.885447] RIP: 0010:rollback_registered_many+0x86/0x3c1 [ 79.886120] Code: 01 e8 d7 7d c6 ff 0f 0b 48 8b 45 00 4c 8b 20 48 8d 58 90 49 83 ec 70 48 8d 7b 70 48 39 ef 74 44 8a 83 d0 04 00 00 84 c0 75 1f <0f> 0b e8 61 cd ff ff 48 b8 00 01 00 00 00 00 ad de 48 89 43 70 66 [ 79.888667] RSP: 0018:ffffc900015ab740 EFLAGS: 00010246 [ 79.889339] RAX: ffff8882353e5700 RBX: ffff8882353e56a0 RCX: ffff8882353e5710 [ 79.890174] RDX: ffffc900015ab7e0 RSI: ffffc900015ab7e0 RDI: ffff8882353e5710 [ 79.891029] RBP: ffffc900015ab7e0 R08: ffffc900015ab7e0 R09: ffffc900015ab7e0 [ 79.891866] R10: ffffc900015ab7a0 R11: ffffffff82233fec R12: ffffc900015ab770 [ 79.892728] R13: ffffffff81eb7ec0 R14: ffff88822ed6cf00 R15: 00000000ffffffea [ 79.893557] FS: 00007ff350f31740(0000) GS:ffff888237a00000(0000) knlGS:0000000000000000 [ 79.894581] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 79.895317] CR2: 00000000006c8580 CR3: 000000022c272000 CR4: 00000000000006f0 [ 79.896137] Call Trace: [ 79.896464] unregister_netdevice_many+0x12/0x6c [ 79.896998] __rtnl_newlink+0x6e2/0x73b [ 79.897446] ? __kmalloc_node_track_caller+0x15e/0x185 [ 79.898039] ? pskb_expand_head+0x5f/0x1fe [ 79.898556] ? stack_access_ok+0xd/0x2c [ 79.899009] ? deref_stack_reg+0x12/0x20 [ 79.899462] ? stack_access_ok+0xd/0x2c [ 79.899927] ? stack_access_ok+0xd/0x2c [ 79.900404] ? __module_text_address+0x9/0x4f [ 79.900910] ? is_bpf_text_address+0x5/0xc [ 79.901390] ? kernel_text_address+0x67/0x7b [ 79.901884] ? __kernel_text_address+0x1a/0x25 [ 79.902397] ? unwind_get_return_address+0x12/0x23 [ 79.903122] ? __cmpxchg_double_slab.isra.37+0x46/0x77 [ 79.903772] rtnl_newlink+0x43/0x56 [ 79.904217] rtnetlink_rcv_msg+0x200/0x24c
In fact, each time a xfrm interface was created, a netdev was allocated by __rtnl_newlink()/rtnl_create_link() and then another one by xfrmi_newlink()/xfrmi_create(). Only the second one was registered, it's why the previous commands produce a backtrace: dev_change_net_namespace() was called on a netdev with reg_state set to NETREG_UNINITIALIZED (the first one).
--- net/xfrm/xfrm_interface.c | 98 +++++++++++++--------------------------------- 1 file changed, 28 insertions(+), 70 deletions(-)
net/xfrm/xfrm_interface.c +28 -70
@@ -133,7 +133,7 @@ static void xfrmi_dev_free(struct net_defree_percpu (dev->tstats); } -static int xfrmi_create2 (struct net_device *dev) +static int xfrmi_create (struct net_device *dev) {struct xfrm_if *xi =netdev_priv (dev);struct net *net =dev_net (dev);
@@ -156,54 +156,7 @@ out:return err; } -static struct xfrm_if *xfrmi_create (struct net *net,struct xfrm_if_parms *p) -{ -struct net_device *dev; -struct xfrm_if *xi; -char name[IFNAMSIZ ]; -int err; - -if (p->name[0 ]) { -strlcpy (name, p->name,IFNAMSIZ ); - }else { - err = -EINVAL ; - goto failed; - } - - dev =alloc_netdev (sizeof (*xi), name,NET_NAME_UNKNOWN , xfrmi_dev_setup); -if (!dev) { - err = -EAGAIN ; - goto failed; - } - -dev_net_set (dev, net); - - xi =netdev_priv (dev); - xi->p = *p; - xi->net = net; - xi->dev = dev; - xi->phydev =dev_get_by_index (net, p->link); -if (!xi->phydev) { - err = -ENODEV ; - goto failed_free; - } - - err =xfrmi_create2 (dev); -if (err <0 ) - goto failed_dev_put; - -return xi; - -failed_dev_put: -dev_put (xi->phydev); -failed_free: -free_netdev (dev); -failed: -return ERR_PTR (err); -} - -static struct xfrm_if *xfrmi_locate (struct net *net,struct xfrm_if_parms *p, -int create) +static struct xfrm_if *xfrmi_locate (struct net *net,struct xfrm_if_parms *p) {struct xfrm_if __rcu **xip;struct xfrm_if *xi;
@@ -211,17 +164,11 @@ static struct xfrm_if *xfrmi_locate(strufor (xip = &xfrmn->xfrmi[0 ]; (xi =rtnl_dereference (*xip)) !=NULL ; - xip = &xi->next) { -if (xi->p.if_id == p->if_id) { -if (create) -return ERR_PTR (-EEXIST ); - + xip = &xi->next) +if (xi->p.if_id == p->if_id)return xi; - } - } -if (!create) -return ERR_PTR (-ENODEV ); -return xfrmi_create (net, p); + +return NULL ; }static void xfrmi_dev_uninit (struct net_device *dev)
@@ -689,21 +636,33 @@ static int xfrmi_newlink(struct net *src struct netlink_ext_ack *extack) {struct net *net =dev_net (dev); -struct xfrm_if_parms *p; +struct xfrm_if_parms p;struct xfrm_if *xi; +int err; - xi =netdev_priv (dev); - p = &xi->p; - -xfrmi_netlink_parms (data, p); +xfrmi_netlink_parms (data, &p);if (!tb[IFLA_IFNAME ])return -EINVAL ; -nla_strlcpy (p->name, tb[IFLA_IFNAME ],IFNAMSIZ ); +nla_strlcpy (p.name, tb[IFLA_IFNAME ],IFNAMSIZ ); - xi =xfrmi_locate (net, p,1 ); -return PTR_ERR_OR_ZERO (xi); + xi =xfrmi_locate (net, &p); +if (xi) +return -EEXIST ; + + xi =netdev_priv (dev); + xi->p = p; + xi->net = net; + xi->dev = dev; + xi->phydev =dev_get_by_index (net, p.link); +if (!xi->phydev) +return -ENODEV ; + + err =xfrmi_create (dev); +if (err <0 ) +dev_put (xi->phydev); +return err; }static void xfrmi_dellink (struct net_device *dev,struct list_head *head)
@@ -720,9 +679,8 @@ static int xfrmi_changelink(struct net_dxfrmi_netlink_parms (data, &xi->p); - xi =xfrmi_locate (net, &xi->p,0 ); - -if (IS_ERR_OR_NULL (xi)) { + xi =xfrmi_locate (net, &xi->p); +if (!xi) { xi =netdev_priv (dev); }else {if (xi->dev != dev)
Greg Kroah-Hartman
maintainerPATCH 213/243 xfrm interface: avoid corruption on changelink
In reply to Greg Kroah-HartmanFrom: Nicolas Dichtel <[email protected]>
commit e9e7e85d75f3731079ffd77c1a66f037aef04fe7 upstream.
The new parameters must not be stored in the netdev_priv() before validation, it may corrupt the interface. Note also that if data is NULL, only a memset() is done.
$ ip link add xfrm1 type xfrm dev lo if_id 1
$ ip link add xfrm2 type xfrm dev lo if_id 2
$ ip link set xfrm1 type xfrm dev lo if_id 2
RTNETLINK answers: File exists
$ ip -d link list dev xfrm1
5: xfrm1@lo: <NOARP> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
link/none 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 minmtu 68 maxmtu 1500
xfrm if_id 0x2 addrgenmode eui64 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535=> "if_id 0x2"
--- net/xfrm/xfrm_interface.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/xfrm/xfrm_interface.c +5 -5
@@ -674,12 +674,12 @@ static int xfrmi_changelink(struct net_dstruct nlattr *data[], struct netlink_ext_ack *extack) { - struct xfrm_if *xi = netdev_priv(dev); struct net *net = dev_net(dev); +struct xfrm_if_parms p; +struct xfrm_if *xi; -xfrmi_netlink_parms (data, &xi->p); - - xi =xfrmi_locate (net, &xi->p); +xfrmi_netlink_parms (data, &p); + xi =xfrmi_locate (net, &p);if (!xi) { xi =netdev_priv (dev); }else {
@@ -687,7 +687,7 @@ static int xfrmi_changelink(struct net_dreturn -EEXIST ; } -return xfrmi_update (xi, &xi->p); +return xfrmi_update (xi, &p); }static size_t xfrmi_get_size (const struct net_device *dev)
Greg Kroah-Hartman
maintainerPATCH 214/243 xfrm interface: fix list corruption for x-netns
In reply to Greg Kroah-HartmanFrom: Nicolas Dichtel <[email protected]>
commit c5d1030f23002430c2a336b2b629b9d6f72b3564 upstream.
dev_net(dev) is the netns of the device and xi->net is the link netns, where the device has been linked.changelink() must operate in the link netns to avoid a corruption of the xfrm lists.
Note that xi->net and dev_net(xi->physdev) are always the same.
Before the patch, the xfrmi lists may be corrupted and can later trigger a kernel panic.
--- net/xfrm/xfrm_interface.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/xfrm/xfrm_interface.c +4 -4
@@ -505,7 +505,7 @@ static int xfrmi_change(struct xfrm_if *static int xfrmi_update (struct xfrm_if *xi,struct xfrm_if_parms *p) { -struct net *net =dev_net (xi->dev); +struct net *net = xi->net;struct xfrmi_net *xfrmn =net_generic (net, xfrmi_net_id);int err;
@@ -674,9 +674,9 @@ static int xfrmi_changelink(struct net_dstruct nlattr *data[], struct netlink_ext_ack *extack) { - struct net *net = dev_net(dev); + struct xfrm_if *xi = netdev_priv(dev); +struct net *net = xi->net;struct xfrm_if_parms p; -struct xfrm_if *xi;xfrmi_netlink_parms (data, &p); xi =xfrmi_locate (net, &p);
@@ -718,7 +718,7 @@ struct net *xfrmi_get_link_net(const str {struct xfrm_if *xi =netdev_priv (dev); -return dev_net (xi->phydev); +return xi->net; }static const struct nla_policy xfrmi_policy[IFLA_XFRM_MAX +1 ] = {
Greg Kroah-Hartman
maintainerPATCH 215/243 xfrm interface: fix management of phydev
In reply to Greg Kroah-HartmanFrom: Nicolas Dichtel <[email protected]>
commit 22d6552f827ef76ade3edf6bbb3f05048a0a7d8b upstream.
With the current implementation, phydev cannot be removed:
$ ip link add dummy type dummy $ ip link add xfrm1 type xfrm dev dummy if_id 1 $ ip l d dummy kernel:[77938.465445] unregister_netdevice: waiting for dummy to become free. Usage count = 1
Manage it like in ip tunnels, ie just keep the ifindex. Not that the side effect, is that the phydev is now optional.
--- include/net/xfrm.h | 1 - net/xfrm/xfrm_interface.c | 34 ++++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-)
include/net/xfrm.h +0 -1
@@ -1062,7 +1062,6 @@ struct xfrm_if_parms {struct xfrm_if {struct xfrm_if __rcu *next;/* next interface in list */ struct net_device *dev;/* virtual device associated with interface */ -struct net_device *phydev;/* physical device */ struct net *net;/* netns for packet i/o */ struct xfrm_if_parms p;/* interface parms */
net/xfrm/xfrm_interface.c +18 -16
@@ -177,7 +177,6 @@ static void xfrmi_dev_uninit(struct net_struct xfrmi_net *xfrmn =net_generic (xi->net, xfrmi_net_id);xfrmi_unlink (xfrmn, xi); -dev_put (xi->phydev);dev_put (dev); }
@@ -364,7 +363,7 @@ static netdev_tx_t xfrmi_xmit(struct sk_ goto tx_err; } - fl.flowi_oif = xi->phydev->ifindex; + fl.flowi_oif = xi->p.link; ret =xfrmi_xmit2 (skb, dev, &fl);if (ret <0 )
@@ -553,7 +552,7 @@ static int xfrmi_get_iflink(const struct {struct xfrm_if *xi =netdev_priv (dev); -return xi->phydev->ifindex; +return xi->p.link; }
@@ -579,12 +578,14 @@ static void xfrmi_dev_setup(struct net_d dev->needs_free_netdev = true; dev->priv_destructor = xfrmi_dev_free;netif_keep_dst (dev); + +eth_broadcast_addr (dev->broadcast); }static int xfrmi_dev_init (struct net_device *dev) {struct xfrm_if *xi =netdev_priv (dev); -struct net_device *phydev = xi->phydev; +struct net_device *phydev =__dev_get_by_index (xi->net, xi->p.link);int err; dev->tstats = netdev_alloc_pcpu_stats(struct pcpu_sw_netstats);
@@ -599,13 +600,19 @@ static int xfrmi_dev_init(struct net_dev dev->features |=NETIF_F_LLTX ; - dev->needed_headroom = phydev->needed_headroom; - dev->needed_tailroom = phydev->needed_tailroom; - -if (is_zero_ether_addr (dev->dev_addr)) -eth_hw_addr_inherit (dev, phydev); -if (is_zero_ether_addr (dev->broadcast)) -memcpy (dev->broadcast, phydev->broadcast, dev->addr_len); +if (phydev) { + dev->needed_headroom = phydev->needed_headroom; + dev->needed_tailroom = phydev->needed_tailroom; + +if (is_zero_ether_addr (dev->dev_addr)) +eth_hw_addr_inherit (dev, phydev); +if (is_zero_ether_addr (dev->broadcast)) +memcpy (dev->broadcast, phydev->broadcast, + dev->addr_len); + }else { +eth_hw_addr_random (dev); +eth_broadcast_addr (dev->broadcast); + }return 0 ; }
@@ -655,13 +662,8 @@ static int xfrmi_newlink(struct net *src xi->p = p; xi->net = net; xi->dev = dev; - xi->phydev =dev_get_by_index (net, p.link); -if (!xi->phydev) -return -ENODEV ; err =xfrmi_create (dev); -if (err <0 ) -dev_put (xi->phydev);return err; }
Greg Kroah-Hartman
maintainerPATCH 216/243 CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
In reply to Greg Kroah-HartmanFrom: Pavel Shilovsky <[email protected]>
commit 6f582b273ec23332074d970a7fb25bef835df71f upstream.
Currently when the client creates a cifsFileInfo structure for a newly opened file, it allocates a list of byte-range locks with a pointer to the new cfile and attaches this list to the inode's lock list. The latter happens before initializing all other fields, e.g. cfile->tlink. Thus a partially initialized cifsFileInfo structure becomes available to other threads that walk through the inode's lock list. One example of such a thread may be an oplock break worker thread that tries to push all cached byte-range locks. This causes NULL-pointer dereference in smb2_push_mandatory_locks() when accessing cfile->tlink:
[598428.945633] BUG: kernel NULL pointer dereference, address: 0000000000000038 ... [598428.945749] Workqueue: cifsoplockd cifs_oplock_break [cifs] [598428.945793] RIP: 0010:smb2_push_mandatory_locks+0xd6/0x5a0 [cifs] ... [598428.945834] Call Trace: [598428.945870] ? cifs_revalidate_mapping+0x45/0x90 [cifs] [598428.945901] cifs_oplock_break+0x13d/0x450 [cifs] [598428.945909] process_one_work+0x1db/0x380 [598428.945914] worker_thread+0x4d/0x400 [598428.945921] kthread+0x104/0x140 [598428.945925] ? process_one_work+0x380/0x380 [598428.945931] ? kthread_park+0x80/0x80 [598428.945937] ret_from_fork+0x35/0x40
Fix this by reordering initialization steps of the cifsFileInfo
structure: initialize all the fields first and then add the new byte-range lock list to the inode's lock list.
--- fs/cifs/file.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
fs/cifs/file.c +4 -3
@@ -312,9 +312,6 @@ cifs_new_fileinfo(struct cifs_fid *fid,INIT_LIST_HEAD (&fdlocks->locks); fdlocks->cfile = cfile; cfile->llist = fdlocks; -cifs_down_write (&cinode->lock_sem); -list_add (&fdlocks->llist, &cinode->llist); -up_write (&cinode->lock_sem); cfile->count =1 ; cfile->pid = current->tgid;
@@ -338,6 +335,10 @@ cifs_new_fileinfo(struct cifs_fid *fid, oplock =0 ; } +cifs_down_write (&cinode->lock_sem); +list_add (&fdlocks->llist, &cinode->llist); +up_write (&cinode->lock_sem); +spin_lock (&tcon->open_file_lock);if (fid->pending_open->oplock !=CIFS_OPLOCK_NO_CHANGE && oplock) oplock = fid->pending_open->oplock;
Greg Kroah-Hartman
maintainerPATCH 217/243 CIFS: Fix SMB2 oplock break processing
In reply to Greg Kroah-HartmanFrom: Pavel Shilovsky <[email protected]>
commit fa9c2362497fbd64788063288dc4e74daf977ebb upstream.
Even when mounting modern protocol version the server may be configured without supporting SMB2.1 leases and the client uses SMB2 oplock to optimize IO performance through local caching.
However there is a problem in oplock break handling that leads to missing a break notification on the client who has a file opened. It latter causes big latencies to other clients that are trying to open the same file.
The problem reproduces when there are multiple shares from the same server mounted on the client. The processing code tries to match persistent and volatile file ids from the break notification with an open file but it skips all share besides the first one. Fix this by looking up in all shares belonging to the server that issued the oplock break.
--- fs/cifs/smb2misc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
fs/cifs/smb2misc.c +3 -4
@@ -673,10 +673,10 @@ smb2_is_valid_oplock_break(char *buffer,spin_lock (&cifs_tcp_ses_lock);list_for_each (tmp, &server->smb_ses_list) { ses = list_entry(tmp, struct cifs_ses, smb_ses_list); +list_for_each (tmp1, &ses->tcon_list) { tcon = list_entry(tmp1, struct cifs_tcon, tcon_list); -cifs_stats_inc (&tcon->stats.cifs_stats.num_oplock_brks);spin_lock (&tcon->open_file_lock);list_for_each (tmp2, &tcon->openFileList) { cfile = list_entry(tmp2, struct cifsFileInfo,
@@ -688,6 +688,8 @@ smb2_is_valid_oplock_break(char *buffer,continue ;cifs_dbg (FYI ,"file id match, oplock break\n" ); +cifs_stats_inc ( + &tcon->stats.cifs_stats.num_oplock_brks); cinode =CIFS_I (d_inode (cfile->dentry));spin_lock (&cfile->file_info_lock); if (!CIFS_CACHE_WRITE(cinode) &&
@@ -720,9 +722,6 @@ smb2_is_valid_oplock_break(char *buffer,return true; }spin_unlock (&tcon->open_file_lock); -spin_unlock (&cifs_tcp_ses_lock); -cifs_dbg (FYI ,"No matching file for oplock break\n" ); -return true; } }spin_unlock (&cifs_tcp_ses_lock);
Greg Kroah-Hartman
maintainerPATCH 218/243 tty: vt: keyboard: reject invalid keycodes
In reply to Greg Kroah-HartmanFrom: Dmitry Torokhov <[email protected]>
commit b2b2dd71e0859436d4e05b2f61f86140250ed3f8 upstream.
Do not try to handle keycodes that are too big, otherwise we risk doing out-of-bounds writes:
BUG: KASAN: global-out-of-bounds in clear_bit include/asm-generic/bitops-instrumented.h:56 [inline] BUG: KASAN: global-out-of-bounds in kbd_keycode drivers/tty/vt/keyboard.c:1411 [inline] BUG: KASAN: global-out-of-bounds in kbd_event+0xe6b/0x3790 drivers/tty/vt/keyboard.c:1495 Write of size 8 at addr ffffffff89a1b2d8 by task syz-executor108/1722 ... kbd_keycode drivers/tty/vt/keyboard.c:1411 [inline] kbd_event+0xe6b/0x3790 drivers/tty/vt/keyboard.c:1495 input_to_handler+0x3b6/0x4c0 drivers/input/input.c:118 input_pass_values.part.0+0x2e3/0x720 drivers/input/input.c:145 input_pass_values drivers/input/input.c:949 [inline] input_set_keycode+0x290/0x320 drivers/input/input.c:954 evdev_handle_set_keycode_v2+0xc4/0x120 drivers/input/evdev.c:882 evdev_do_ioctl drivers/input/evdev.c:1150 [inline]
In this case we were dealing with a fuzzed HID device that declared over 12K buttons, and while HID layer should not be reporting to us such big keycodes, we should also be defensive and reject invalid data ourselves as well.
--- drivers/tty/vt/keyboard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/vt/keyboard.c +1 -1
@@ -1491,7 +1491,7 @@ static void kbd_event(struct input_handlif (event_type ==EV_MSC && event_code ==MSC_RAW &&HW_RAW (handle->dev))kbd_rawcode (value); -if (event_type ==EV_KEY ) +if (event_type ==EV_KEY && event_code <=KEY_MAX )kbd_keycode (event_code, value,HW_RAW (handle->dev));spin_unlock (&kbd_event_lock);