5.10.11-rc1 review
Subsystems (3)
Greg Kroah-Hartman
maintainerPATCH 100/199 platform/x86: intel-vbtn: Drop HP Stream x360 Convertible PC 11 from allow-list
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit 070222731be52d741e55d8967b1764482b81e54c ]
THe HP Stream x360 Convertible PC 11 DSDT has the following VGBS function:
Method (VGBS, 0, Serialized)
{
If ((^^PCI0.LPCB.EC0.ROLS == Zero))
{
VBDS = Zero
}
Else
{
VBDS = Zero
}
Return (VBDS) /* \_SB_.VGBI.VBDS */
}Which is obviously wrong, because it always returns 0 independent of the 2-in-1 being in laptop or tablet mode. This causes the intel-vbtn driver to initially report SW_TABLET_MODE = 1 to userspace, which is known to cause problems when the 2-in-1 is actually in laptop mode.
During earlier testing this turned out to not be a problem because the 2-in-1 would do a Notify(..., 0xCC) or Notify(..., 0xCD) soon after the intel-vbtn driver loaded, correcting the SW_TABLET_MODE state.
Further testing however has shown that this Notify() soon after the intel-vbtn driver loads, does not always happen. When the Notify does not happen, then intel-vbtn reports SW_TABLET_MODE = 1 resulting in a non-working touchpad.
IOW the tablet-mode reporting is not reliable on this device, so it should be dropped from the allow-list, fixing the touchpad sometimes not working.
--- drivers/platform/x86/intel-vbtn.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/platform/x86/intel-vbtn.c +0 -6
@@ -204,12 +204,6 @@ static const struct dmi_system_id dmi_switches_allow_list[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"), }, }, - { - .matches = { -DMI_MATCH (DMI_SYS_VENDOR ,"Hewlett-Packard" ), - DMI_MATCH(DMI_PRODUCT_NAME, "HP Stream x360 Convertible PC 11"), - }, - }, { .matches = { DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 90/199 arm64: entry: remove redundant IRQ flag tracing
In reply to Greg Kroah-HartmanFrom: Mark Rutland <[email protected]>
[ Upstream commit df06824767cc9a32fbdb0e3d3b7e169292a5b5fe ]
All EL0 returns go via ret_to_user(), which masks IRQs and notifies lockdep and tracing before calling into do_notify_resume(). Therefore, there's no need for do_notify_resume() to call trace_hardirqs_off(), and the comment is stale. The call is simply redundant.
In ret_to_user() we call exit_to_user_mode(), which notifies lockdep and tracing the IRQs will be enabled in userspace, so there's no need for el0_svc_common() to call trace_hardirqs_on() before returning. Further, at the start of ret_to_user() we call trace_hardirqs_off(), so not only is this redundant, but it is immediately undone.
In addition to being redundant, the trace_hardirqs_on() in el0_svc_common() leaves lockdep inconsistent with the hardware state, and is liable to cause issues for any C code or instrumentation between this and the call to trace_hardirqs_off() which undoes it in ret_to_user().
This patch removes the redundant tracing calls and associated stale comments.
--- arch/arm64/kernel/signal.c | 7 ------- arch/arm64/kernel/syscall.c | 9 +-------- 2 files changed, 1 insertion(+), 15 deletions(-)
arch/arm64/kernel/signal.c +0 -7
@@ -914,13 +914,6 @@ static void do_signal(struct pt_regs *regs) asmlinkage void do_notify_resume(struct pt_regs *regs,unsigned long thread_flags) { -/* -* The assembly code enters us with IRQs off, but it hasn't -* informed the tracing code of that for efficiency reasons. -* Update the trace code with the current status. -*/ -trace_hardirqs_off (); - do { /* Check valid user FS if needed */ addr_limit_user_check();
arch/arm64/kernel/syscall.c +1 -8
@@ -165,15 +165,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,if (!has_syscall_work (flags) && !IS_ENABLED (CONFIG_DEBUG_RSEQ )) {local_daif_mask (); flags =current_thread_info ()->flags; -if (!has_syscall_work (flags) && !(flags & _TIF_SINGLESTEP)) { -/* -* We're off to userspace, where interrupts are -* always enabled after we restore the flags from -* the SPSR. -*/ -trace_hardirqs_on (); +if (!has_syscall_work (flags) && !(flags & _TIF_SINGLESTEP))return ; - }local_daif_restore (DAIF_PROCCTX ); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 107/199 can: vxcan: vxcan_xmit: fix use after free bug
In reply to Greg Kroah-HartmanFrom: Vincent Mailhol <[email protected]>
[ Upstream commit 75854cad5d80976f6ea0f0431f8cedd3bcc475cb ]
After calling netif_rx_ni(skb), dereferencing skb is unsafe. Especially, the canfd_frame cfd which aliases skb memory is accessed after the netif_rx_ni().
--- drivers/net/can/vxcan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/can/vxcan.c +4 -2
@@ -39,6 +39,7 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev)struct net_device *peer;struct canfd_frame *cfd = (struct canfd_frame *)skb->data;struct net_device_stats *peerstats, *srcstats = &dev->stats; +u8 len;if (can_dropped_invalid_skb (dev, skb))return NETDEV_TX_OK ;
@@ -61,12 +62,13 @@ static netdev_tx_t vxcan_xmit(struct sk_buff *skb, struct net_device *dev) skb->dev = peer; skb->ip_summed =CHECKSUM_UNNECESSARY ; + len = cfd->len;if (netif_rx_ni (skb) ==NET_RX_SUCCESS ) { srcstats->tx_packets++; - srcstats->tx_bytes += cfd->len; + srcstats->tx_bytes += len; peerstats = &peer->stats; peerstats->rx_packets++; - peerstats->rx_bytes += cfd->len; + peerstats->rx_bytes += len; } out_unlock:
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 109/199 perf evlist: Fix id index for heterogeneous systems
In reply to Greg Kroah-HartmanFrom: Adrian Hunter <[email protected]>
[ Upstream commit fc705fecf3a0c9128933cc6db59159c050aaca33 ]
perf_evlist__set_sid_idx() updates perf_sample_id with the evlist map index, CPU number and TID. It is passed indexes to the evsel's cpu and thread maps, but references the evlist's maps instead. That results in using incorrect CPU numbers on heterogeneous systems. Fix it by using evsel maps.
The id index (PERF_RECORD_ID_INDEX) is used by AUX area tracing when in sampling mode. Having an incorrect CPU number causes the trace data to be attributed to the wrong CPU, and can result in decoder errors because the trace data is then associated with the wrong process.
Committer notes:
Keep the class prefix convention in the function name, switching from perf_evlist__set_sid_idx() to perf_evsel__set_sid_idx().
--- tools/lib/perf/evlist.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-)
tools/lib/perf/evlist.c +4 -13
@@ -367,21 +367,13 @@ static struct perf_mmap* perf_evlist__alloc_mmap(struct perf_evlist *evlist, booreturn map; } -static void perf_evlist__set_sid_idx (struct perf_evlist *evlist, -struct perf_evsel *evsel,int idx,int cpu, -int thread) +static void perf_evsel__set_sid_idx (struct perf_evsel *evsel,int idx,int cpu,int thread) {struct perf_sample_id *sid =SID (evsel, cpu, thread); sid->idx = idx; -if (evlist->cpus && cpu >=0 ) - sid->cpu = evlist->cpus->map[cpu]; -else - sid->cpu =-1 ; -if (!evsel->system_wide && evlist->threads && thread >=0 ) - sid->tid =perf_thread_map__pid (evlist->threads, thread); -else - sid->tid =-1 ; + sid->cpu =perf_cpu_map__cpu (evsel->cpus, cpu); + sid->tid =perf_thread_map__pid (evsel->threads, thread); } static struct perf_mmap*
@@ -500,8 +492,7 @@ mmap_per_evsel(struct perf_evlist *evlist, struct perf_evlist_mmap_ops *ops,if (perf_evlist__id_add_fd (evlist, evsel, cpu, thread, fd) <0 )return -1 ; -perf_evlist__set_sid_idx (evlist, evsel, idx, cpu, - thread); +perf_evsel__set_sid_idx (evsel, idx, cpu, thread); } }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 117/199 cifs: do not fail __smb_send_rqst if non-fatal signals are pending
In reply to Greg Kroah-HartmanFrom: Ronnie Sahlberg <[email protected]>
commit 214a5ea081e77346e4963dd6d20c5539ff8b6ae6 upstream.
RHBZ 1848178
The original intent of returning an error in this function in the patch:
"CIFS: Mask off signals when sending SMB packets"
was to avoid interrupting packet send in the middle of sending the data (and thus breaking an SMB connection), but we also don't want to fail the request for non-fatal signals even before we have had a chance to try to send it (the reported problem could be reproduced e.g. by exiting a child process when the parent process was in the midst of calling futimens to update a file's timestamps).
In addition, since the signal may remain pending when we enter the sending loop, we may end up not sending the whole packet before TCP buffers become full. In this case the code returns -EINTR but what we need here is to return -ERESTARTSYS instead to allow system calls to be restarted.
--- fs/cifs/transport.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/transport.c +2 -2
@@ -338,7 +338,7 @@ __smb_send_rqst(struct TCP_Server_Info *if (ssocket ==NULL )return -EAGAIN ; -if (signal_pending (current)) { +if (fatal_signal_pending (current)) {cifs_dbg (FYI ,"signal pending before send request\n" );return -ERESTARTSYS ; }
@@ -429,7 +429,7 @@ unmask:if (signal_pending (current) && (total_len != send_length)) {cifs_dbg (FYI ,"signal is pending after attempt to send\n" ); - rc = -EINTR ; + rc = -ERESTARTSYS ; }/* uncork it */
Greg Kroah-Hartman
maintainerPATCH 92/199 drm/amdkfd: Fix out-of-bounds read in kdf_create_vcrat_image_cpu()
In reply to Greg Kroah-HartmanFrom: Jeremy Cline <[email protected]>
[ Upstream commit 8b335bff643f3b39935c7377dbcd361c5b605d98 ]
KASAN reported a slab-out-of-bounds read of size 1 in kdf_create_vcrat_image_cpu().
This occurs when, for example, when on an x86_64 with a single NUMA node because kfd_fill_iolink_info_for_cpu() is a no-op, but afterwards the sub_type_hdr->length, which is out-of-bounds, is read and multiplied by entries. Fortunately, entries is 0 in this case so the overall crat_table->length is still correct.
Check if there were any entries before de-referencing sub_type_hdr which may be pointing to out-of-bounds memory.
--- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_crat.c +7 -4
@@ -1034,11 +1034,14 @@ static int kfd_create_vcrat_image_cpu(void *pcrat_image, size_t *size) (struct crat_subtype_iolink *)sub_type_hdr);if (ret <0 )return ret; - crat_table->length += (sub_type_hdr->length * entries); - crat_table->total_entries += entries; - sub_type_hdr = (typeof (sub_type_hdr))((char *)sub_type_hdr + - sub_type_hdr->length * entries); +if (entries) { + crat_table->length += (sub_type_hdr->length * entries); + crat_table->total_entries += entries; + + sub_type_hdr = (typeof (sub_type_hdr))((char *)sub_type_hdr + + sub_type_hdr->length * entries); + }#else pr_info ("IO link not available for non x86 platforms\n" );#endif
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 96/199 printk: fix kmsg_dump_get_buffer length calulations
In reply to Greg Kroah-HartmanFrom: John Ogness <[email protected]>
[ Upstream commit 89ccf18f032f26946e2ea6258120472eec6aa745 ]
kmsg_dump_get_buffer() uses @syslog to determine if the syslog prefix should be written to the buffer. However, when calculating the maximum number of records that can fit into the buffer, it always counts the bytes from the syslog prefix.
Use @syslog when calculating the maximum number of records that can fit into the buffer.
--- kernel/printk/printk.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/printk/printk.c +2 -2
@@ -3376,7 +3376,7 @@ bool kmsg_dump_get_buffer(struct kmsg_duwhile (prb_read_valid_info (prb, seq, &info, &line_count)) {if (r.info->seq >= dumper->next_seq)break ; - l +=get_record_print_text_size (&info, line_count, true, time); + l +=get_record_print_text_size (&info, line_count, syslog, time); seq = r.info->seq +1 ; }
@@ -3386,7 +3386,7 @@ bool kmsg_dump_get_buffer(struct kmsg_du &info, &line_count)) {if (r.info->seq >= dumper->next_seq)break ; - l -=get_record_print_text_size (&info, line_count, true, time); + l -=get_record_print_text_size (&info, line_count, syslog, time); seq = r.info->seq +1 ; }
Greg Kroah-Hartman
maintainerPATCH 97/199 iov_iter: fix the uaccess area in copy_compat_iovec_from_user
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
[ Upstream commit a959a9782fa87669feeed095ced5d78181a7c02d ]
sizeof needs to be called on the compat pointer, not the native one.
--- lib/iov_iter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/iov_iter.c +1 -1
@@ -1658,7 +1658,7 @@ static int copy_compat_iovec_from_user(struct iovec *iov, (const struct compat_iovec __user *)uvec;int ret = -EFAULT , i; -if (!user_access_begin (uvec, nr_segs *sizeof (*uvec))) +if (!user_access_begin (uiov, nr_segs *sizeof (*uiov)))return -EFAULT ;for (i =0 ; i < nr_segs; i++) {
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 122/199 mm: fix initialization of struct page for holes in memory layout
In reply to Greg Kroah-HartmanFrom: Mike Rapoport <[email protected]>
commit d3921cb8be29ce5668c64e23ffdaeec5f8c69399 upstream.
There could be struct pages that are not backed by actual physical memory. This can happen when the actual memory bank is not a multiple of SECTION_SIZE or when an architecture does not register memory holes reserved by the firmware as memblock.memory.
Such pages are currently initialized using init_unavailable_mem() function that iterates through PFNs in holes in memblock.memory and if there is a struct page corresponding to a PFN, the fields if this page are set to default values and the page is marked as Reserved.
init_unavailable_mem() does not take into account zone and node the page belongs to and sets both zone and node links in struct page to zero.
On a system that has firmware reserved holes in a zone above ZONE_DMA, for instance in a configuration below:
# grep -A1 E820 /proc/iomem 7a17b000-7a216fff : Unknown E820 type 7a217000-7bffffff : System RAM
unset zone link in struct page will trigger
VM_BUG_ON_PAGE(!zone_spans_pfn(page_zone(page), pfn), page);
because there are pages in both ZONE_DMA32 and ZONE_DMA (unset zone link in struct page) in the same pageblock.
Update init_unavailable_mem() to use zone constraints defined by an architecture to properly setup the zone link and use node ID of the adjacent range in memblock.memory to set the node link.
--- mm/page_alloc.c | 84 +++++++++++++++++++++++++++++++++----------------------- 1 file changed, 50 insertions(+), 34 deletions(-)
mm/page_alloc.c +50 -34
@@ -7003,23 +7003,26 @@ void __init free_area_init_memoryless_no* Initialize all valid struct pages in the range [spfn, epfn) and mark them * PageReserved(). Return the number of struct pages that were initialized. */ -static u64 __init init_unavailable_range (unsigned long spfn,unsigned long epfn) +static u64 __init init_unavailable_range (unsigned long spfn,unsigned long epfn, +int zone,int nid) { -unsigned long pfn; +unsigned long pfn, zone_spfn, zone_epfn;u64 pgcnt =0 ; + zone_spfn = arch_zone_lowest_possible_pfn[zone]; + zone_epfn = arch_zone_highest_possible_pfn[zone]; + + spfn =clamp (spfn, zone_spfn, zone_epfn); + epfn =clamp (epfn, zone_spfn, zone_epfn); +for (pfn = spfn; pfn < epfn; pfn++) {if (!pfn_valid (ALIGN_DOWN (pfn, pageblock_nr_pages))) { pfn =ALIGN_DOWN (pfn, pageblock_nr_pages) + pageblock_nr_pages -1 ;continue ; } -/* -* Use a fake node/zone (0) for now. Some of these pages -* (in memblock.reserved but not in memblock.memory) will -* get re-initialized via reserve_bootmem_region() later. -*/ -__init_single_page (pfn_to_page (pfn), pfn,0 ,0 ); + +__init_single_page (pfn_to_page (pfn), pfn, zone, nid);__SetPageReserved (pfn_to_page (pfn)); pgcnt++; }
@@ -7028,51 +7031,64 @@ static u64 __init init_unavailable_range }/* -* Only struct pages that are backed by physical memory are zeroed and -* initialized by going through __init_single_page(). But, there are some -* struct pages which are reserved in memblock allocator and their fields -* may be accessed (for example page_to_pfn() on some configuration accesses -* flags). We must explicitly initialize those struct pages. +* Only struct pages that correspond to ranges defined by memblock.memory +* are zeroed and initialized by going through __init_single_page() during +* memmap_init(). * -* This function also addresses a similar issue where struct pages are left -* uninitialized because the physical address range is not covered by -* memblock.memory or memblock.reserved. That could happen when memblock -* layout is manually configured via memmap=, or when the highest physical -* address (max_pfn) does not end on a section boundary. +* But, there could be struct pages that correspond to holes in +* memblock.memory. This can happen because of the following reasons: +* - phyiscal memory bank size is not necessarily the exact multiple of the +* arbitrary section size +* - early reserved memory may not be listed in memblock.memory +* - memory layouts defined with memmap= kernel parameter may not align +* nicely with memmap sections +* +* Explicitly initialize those struct pages so that: +* - PG_Reserved is set +* - zone link is set accorging to the architecture constrains +* - node is set to node id of the next populated region except for the +* trailing hole where last node id is used */ -static void __init init_unavailable_mem (void ) +static void __init init_zone_unavailable_mem (int zone) { -phys_addr_t start, end; -u64 i, pgcnt; -phys_addr_t next =0 ; +unsigned long start, end; +int i, nid; +u64 pgcnt; +unsigned long next =0 ;/* -* Loop through unavailable ranges not covered by memblock.memory. +* Loop through holes in memblock.memory and initialize struct +* pages corresponding to these holes */ pgcnt =0 ; -for_each_mem_range (i, &start, &end) { +for_each_mem_pfn_range (i,MAX_NUMNODES , &start, &end, &nid) {if (next < start) - pgcnt +=init_unavailable_range (PFN_DOWN (next), -PFN_UP (start)); + pgcnt +=init_unavailable_range (next, start, zone, nid); next = end; }/* -* Early sections always have a fully populated memmap for the whole -* section - see pfn_valid(). If the last section has holes at the -* end and that section is marked "online", the memmap will be -* considered initialized. Make sure that memmap has a well defined -* state. +* Last section may surpass the actual end of memory (e.g. we can +* have 1Gb section and 512Mb of RAM pouplated). +* Make sure that memmap has a well defined state in this case. */ - pgcnt +=init_unavailable_range (PFN_DOWN (next), -round_up (max_pfn,PAGES_PER_SECTION )); + end =round_up (max_pfn,PAGES_PER_SECTION ); + pgcnt +=init_unavailable_range (next, end, zone, nid);/* * Struct pages that do not have backing memory. This could be because * firmware is using some of this memory, or for some other reasons. */ if (pgcnt) -pr_info ("Zeroed struct page in unavailable ranges: %lld pages" , pgcnt); +pr_info ("Zone %s: zeroed struct page in unavailable ranges: %lld pages" , zone_names[zone], pgcnt); +} + +static void __init init_unavailable_mem (void ) +{ +int zone; + +for (zone =0 ; zone <ZONE_MOVABLE ; zone++) +init_zone_unavailable_mem (zone); }#else static inline void __init init_unavailable_mem (void )
Greg Kroah-Hartman
maintainerPATCH 136/199 usb: udc: core: Use lock when write to soft_connect
In reply to Greg Kroah-HartmanFrom: Thinh Nguyen <[email protected]>
commit c28095bc99073ddda65e4f31f6ae0d908d4d5cd8 upstream.
Use lock to guard against concurrent access for soft-connect/disconnect operations when writing to soft_connect sysfs.
--- drivers/usb/gadget/udc/core.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/usb/gadget/udc/core.c +10 -3
@@ -1532,10 +1532,13 @@ static ssize_t soft_connect_store(struct struct device_attribute *attr, const char *buf, size_t n) { struct usb_udc *udc = container_of(dev, struct usb_udc, dev); +ssize_t ret; +mutex_lock (&udc_lock);if (!udc->driver) {dev_err (dev,"soft-connect without a gadget driver\n" ); -return -EOPNOTSUPP ; + ret = -EOPNOTSUPP ; + goto out; }if (sysfs_streq (buf,"connect" )) {
@@ -1546,10 +1549,14 @@ static ssize_t soft_connect_store(structusb_gadget_udc_stop (udc); }else {dev_err (dev,"unsupported command '%s'\n" , buf); -return -EINVAL ; + ret = -EINVAL ; + goto out; } -return n; + ret = n; +out: +mutex_unlock (&udc_lock); +return ret; }static DEVICE_ATTR_WO (soft_connect);
Greg Kroah-Hartman
maintainerPATCH 143/199 driver core: Fix device link device name collision
In reply to Greg Kroah-HartmanFrom: Saravana Kannan <[email protected]>
commit e020ff611ba9be54e959e6b548038f8a020da1c9 upstream.
The device link device's name was of the form:
<supplier-dev-name>--<consumer-dev-name>
This can cause name collision as reported here [1] as device names are not globally unique. Since device names have to be unique within the bus/class, add the bus/class name as a prefix to the device names used to construct the device link device name.
So the devuce link device's name will be of the form:
<supplier-bus-name>:<supplier-dev-name>--<consumer-bus-name>:<consumer-dev-name>
[1] - https://lore.kernel.org/lkml/[email protected]/
--- Documentation/ABI/testing/sysfs-class-devlink | 4 +-- Documentation/ABI/testing/sysfs-devices-consumer | 5 ++-- Documentation/ABI/testing/sysfs-devices-supplier | 5 ++-- drivers/base/core.c | 27 ++++++++++++----------- include/linux/device.h | 12 ++++++++++ 5 files changed, 35 insertions(+), 18 deletions(-)
Documentation/ABI/testing/sysfs-class-devlink +2 -2
@@ -5,8 +5,8 @@ Description: Provide a place in sysfs for the device link objects in the kernel at any given time. The name of a device link directory, denoted as ... above, is of the form <supplier>--<consumer> - where <supplier> is the supplier device name and <consumer> is - the consumer device name. + where <supplier> is the supplier bus:device name and <consumer> + is the consumer bus:device name. What: /sys/class/devlink/.../auto_remove_on Date: May 2020
Documentation/ABI/testing/sysfs-devices-consumer +3 -2
@@ -4,5 +4,6 @@ Contact: Saravana Kannan <saravanak@goog Description: The /sys/devices/.../consumer:<consumer> are symlinks to device links where this device is the supplier. <consumer> denotes the - name of the consumer in that device link. There can be zero or - more of these symlinks for a given device. + name of the consumer in that device link and is of the form + bus:device name. There can be zero or more of these symlinks + for a given device.
Documentation/ABI/testing/sysfs-devices-supplier +3 -2
@@ -4,5 +4,6 @@ Contact: Saravana Kannan <saravanak@goog Description: The /sys/devices/.../supplier:<supplier> are symlinks to device links where this device is the consumer. <supplier> denotes the - name of the supplier in that device link. There can be zero or - more of these symlinks for a given device. + name of the supplier in that device link and is of the form + bus:device name. There can be zero or more of these symlinks + for a given device.
drivers/base/core.c +15 -12
@@ -363,7 +363,9 @@ static int devlink_add_symlinks(struct dstruct device *con = link->consumer;char *buf; - len =max (strlen (dev_name (sup)),strlen (dev_name (con))); + len =max (strlen (dev_bus_name (sup)) +strlen (dev_name (sup)), +strlen (dev_bus_name (con)) +strlen (dev_name (con))); + len +=strlen (":" ); len +=strlen ("supplier:" ) +1 ; buf =kzalloc (len,GFP_KERNEL );if (!buf)
@@ -377,12 +379,12 @@ static int devlink_add_symlinks(struct dif (ret) goto err_con; -snprintf (buf, len,"consumer:%s" ,dev_name (con)); +snprintf (buf, len,"consumer:%s:%s" ,dev_bus_name (con),dev_name (con)); ret =sysfs_create_link (&sup->kobj, &link->link_dev.kobj, buf);if (ret) goto err_con_dev; -snprintf (buf, len,"supplier:%s" ,dev_name (sup)); +snprintf (buf, len,"supplier:%s:%s" ,dev_bus_name (sup),dev_name (sup)); ret =sysfs_create_link (&con->kobj, &link->link_dev.kobj, buf);if (ret) goto err_sup_dev;
@@ -390,7 +392,7 @@ static int devlink_add_symlinks(struct d goto out; err_sup_dev: -snprintf (buf, len,"consumer:%s" ,dev_name (con)); +snprintf (buf, len,"consumer:%s:%s" ,dev_bus_name (con),dev_name (con));sysfs_remove_link (&sup->kobj, buf); err_con_dev:sysfs_remove_link (&link->link_dev.kobj,"consumer" );
@@ -413,7 +415,9 @@ static void devlink_remove_symlinks(strusysfs_remove_link (&link->link_dev.kobj,"consumer" );sysfs_remove_link (&link->link_dev.kobj,"supplier" ); - len =max (strlen (dev_name (sup)),strlen (dev_name (con))); + len =max (strlen (dev_bus_name (sup)) +strlen (dev_name (sup)), +strlen (dev_bus_name (con)) +strlen (dev_name (con))); + len +=strlen (":" ); len +=strlen ("supplier:" ) +1 ; buf =kzalloc (len,GFP_KERNEL );if (!buf) {
@@ -421,9 +425,9 @@ static void devlink_remove_symlinks(strureturn ; } -snprintf (buf, len,"supplier:%s" ,dev_name (sup)); +snprintf (buf, len,"supplier:%s:%s" ,dev_bus_name (sup),dev_name (sup));sysfs_remove_link (&con->kobj, buf); -snprintf (buf, len,"consumer:%s" ,dev_name (con)); +snprintf (buf, len,"consumer:%s:%s" ,dev_bus_name (con),dev_name (con));sysfs_remove_link (&sup->kobj, buf);kfree (buf); }
@@ -633,8 +637,9 @@ struct device_link *device_link_add(stru link->link_dev.class = &devlink_class;device_set_pm_not_required (&link->link_dev); -dev_set_name (&link->link_dev,"%s--%s" , -dev_name (supplier),dev_name (consumer)); +dev_set_name (&link->link_dev,"%s:%s--%s:%s" , +dev_bus_name (supplier),dev_name (supplier), +dev_bus_name (consumer),dev_name (consumer));if (device_register (&link->link_dev)) {put_device (consumer);put_device (supplier);
@@ -1652,9 +1657,7 @@ const char *dev_driver_string(const stru* never change once they are set, so they don't need special care. */ drv =READ_ONCE (dev->driver); -return drv ? drv->name : - (dev->bus ? dev->bus->name : - (dev->class ? dev->class->name :"" )); +return drv ? drv->name :dev_bus_name (dev); }EXPORT_SYMBOL (dev_driver_string);
include/linux/device.h +12 -0
@@ -615,6 +615,18 @@ static inline const char *dev_name(constreturn kobject_name (&dev->kobj); } +/** +* dev_bus_name - Return a device's bus/class name, if at all possible +* @dev: struct device to get the bus/class name of +* +* Will return the name of the bus/class the device is attached to. If it is +* not attached to a bus/class, an empty string will be returned. +*/ +static inline const char *dev_bus_name (const struct device *dev) +{ +return dev->bus ? dev->bus->name : (dev->class ? dev->class->name :"" ); +} + __printf(2, 3) int dev_set_name(struct device *dev, const char *name, ...);#ifdef CONFIG_NUMA
Greg Kroah-Hartman
maintainerPATCH 141/199 xhci: tegra: Delay for disabling LFPS detector
In reply to Greg Kroah-HartmanFrom: JC Kuo <[email protected]>
commit da7e0c3c2909a3d9bf8acfe1db3cb213bd7febfb upstream.
Occasionally, we are seeing some SuperSpeed devices resumes right after being directed to U3. This commits add 500us delay to ensure LFPS detector is disabled before sending ACK to firmware.
[ 16.099363] tegra-xusb 70090000.usb: entering ELPG [ 16.104343] tegra-xusb 70090000.usb: 2-1 isn't suspended: 0x0c001203 [ 16.114576] tegra-xusb 70090000.usb: not all ports suspended: -16 [ 16.120789] tegra-xusb 70090000.usb: entering ELPG failed
The register write passes through a few flop stages of 32KHz clock domain. NVIDIA ASIC designer reviewed RTL and suggests 500us delay.
--- drivers/usb/host/xhci-tegra.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/host/xhci-tegra.c +7 -0
@@ -623,6 +623,13 @@ static void tegra_xusb_mbox_handle(struc enable);if (err <0 )break ; + +/* +* wait 500us for LFPS detector to be disabled before +* sending ACK +*/ +if (!enable) +usleep_range (500 ,1000 ); }if (err <0 ) {
Greg Kroah-Hartman
maintainerPATCH 149/199 cls_flower: call nla_ok() before nla_next()
In reply to Greg Kroah-HartmanFrom: Cong Wang <[email protected]>
commit c96adff95619178e2118925578343ad54857c80c upstream.
fl_set_enc_opt() simply checks if there are still bytes left to parse, but this is not sufficent as syzbot seems to be able to generate malformatted netlink messages. nla_ok() is more strict so should be used to validate the next nlattr here.
And nla_validate_nested_deprecated() has less strict check too, it is probably too late to switch to the strict version, but we can just call nla_ok() too after it.
--- net/sched/cls_flower.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-)
net/sched/cls_flower.c +13 -9
@@ -1272,6 +1272,10 @@ static int fl_set_enc_opt(struct nlattr nla_opt_msk =nla_data (tb[TCA_FLOWER_KEY_ENC_OPTS_MASK ]); msk_depth =nla_len (tb[TCA_FLOWER_KEY_ENC_OPTS_MASK ]); +if (!nla_ok (nla_opt_msk, msk_depth)) { +NL_SET_ERR_MSG (extack,"Invalid nested attribute for masks" ); +return -EINVAL ; + } } nla_for_each_attr(nla_opt_key, nla_enc_key,
@@ -1307,9 +1311,6 @@ static int fl_set_enc_opt(struct nlattrNL_SET_ERR_MSG (extack,"Key and mask miss aligned" );return -EINVAL ; } - -if (msk_depth) - nla_opt_msk =nla_next (nla_opt_msk, &msk_depth);break ;case TCA_FLOWER_KEY_ENC_OPTS_VXLAN :if (key->enc_opts.dst_opt_type) {
@@ -1340,9 +1341,6 @@ static int fl_set_enc_opt(struct nlattrNL_SET_ERR_MSG (extack,"Key and mask miss aligned" );return -EINVAL ; } - -if (msk_depth) - nla_opt_msk =nla_next (nla_opt_msk, &msk_depth);break ;case TCA_FLOWER_KEY_ENC_OPTS_ERSPAN :if (key->enc_opts.dst_opt_type) {
@@ -1373,14 +1371,20 @@ static int fl_set_enc_opt(struct nlattrNL_SET_ERR_MSG (extack,"Key and mask miss aligned" );return -EINVAL ; } - -if (msk_depth) - nla_opt_msk =nla_next (nla_opt_msk, &msk_depth);break ;default :NL_SET_ERR_MSG (extack,"Unknown tunnel option type" );return -EINVAL ; } + +if (!msk_depth) +continue ; + +if (!nla_ok (nla_opt_msk, msk_depth)) { +NL_SET_ERR_MSG (extack,"A mask attribute is invalid" ); +return -EINVAL ; + } + nla_opt_msk =nla_next (nla_opt_msk, &msk_depth); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 129/199 intel_th: pci: Add Alder Lake-P support
In reply to Greg Kroah-HartmanFrom: Alexander Shishkin <[email protected]>
commit cb5c681ab9037e25fcca20689c82cf034566d610 upstream.
This adds support for the Trace Hub in Alder Lake-P.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -269,6 +269,11 @@ static const struct pci_device_id intel_ .driver_data = (kernel_ulong_t)&intel_th_2x, }, { +/* Alder Lake-P */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x51a6), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, + {/* Alder Lake CPU */ PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x466f ), .driver_data = (kernel_ulong_t)&intel_th_2x,
Greg Kroah-Hartman
maintainerPATCH 150/199 netfilter: rpfilter: mask ecn bits before fib lookup
In reply to Greg Kroah-HartmanFrom: Guillaume Nault <[email protected]>
commit 2e5a6266fbb11ae93c468dfecab169aca9c27b43 upstream.
RT_TOS() only masks one of the two ECN bits. Therefore rpfilter_mt() treats Not-ECT or ECT(1) packets in a different way than those with ECT(0) or CE.
Reproducer:
Create two netns, connected with a veth:
$ ip netns add ns0 $ ip netns add ns1 $ ip link add name veth01 netns ns0 type veth peer name veth10 netns ns1 $ ip -netns ns0 link set dev veth01 up $ ip -netns ns1 link set dev veth10 up $ ip -netns ns0 address add 192.0.2.10/32 dev veth01 $ ip -netns ns1 address add 192.0.2.11/32 dev veth10
Add a route to ns1 in ns0:
$ ip -netns ns0 route add 192.0.2.11/32 dev veth01
In ns1, only packets with TOS 4 can be routed to ns0:
$ ip -netns ns1 route add 192.0.2.10/32 tos 4 dev veth10
Ping from ns0 to ns1 works regardless of the ECN bits, as long as TOS is 4:
$ ip netns exec ns0 ping -Q 4 192.0.2.11 # TOS 4, Not-ECT
... 0% packet loss ...
$ ip netns exec ns0 ping -Q 5 192.0.2.11 # TOS 4, ECT(1)
... 0% packet loss ...
$ ip netns exec ns0 ping -Q 6 192.0.2.11 # TOS 4, ECT(0)
... 0% packet loss ...
$ ip netns exec ns0 ping -Q 7 192.0.2.11 # TOS 4, CE
... 0% packet loss ...Now use iptable's rpfilter module in ns1:
$ ip netns exec ns1 iptables-legacy -t raw -A PREROUTING -m rpfilter --invert -j DROP
Not-ECT and ECT(1) packets still pass:
$ ip netns exec ns0 ping -Q 4 192.0.2.11 # TOS 4, Not-ECT
... 0% packet loss ...
$ ip netns exec ns0 ping -Q 5 192.0.2.11 # TOS 4, ECT(1)
... 0% packet loss ...But ECT(0) and ECN packets are dropped:
$ ip netns exec ns0 ping -Q 6 192.0.2.11 # TOS 4, ECT(0)
... 100% packet loss ...
$ ip netns exec ns0 ping -Q 7 192.0.2.11 # TOS 4, CE
... 100% packet loss ...After this patch, rpfilter doesn't drop ECT(0) and CE packets anymore.
--- net/ipv4/netfilter/ipt_rpfilter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/netfilter/ipt_rpfilter.c +1 -1
@@ -76,7 +76,7 @@ static bool rpfilter_mt(const struct sk_ flow.daddr = iph->saddr; flow.saddr =rpfilter_get_saddr (iph->daddr); flow.flowi4_mark = info->flags &XT_RPFILTER_VALID_MARK ? skb->mark :0 ; - flow.flowi4_tos =RT_TOS (iph->tos); + flow.flowi4_tos = iph->tos &IPTOS_RT_MASK ; flow.flowi4_scope =RT_SCOPE_UNIVERSE ; flow.flowi4_oif =l3mdev_master_ifindex_rcu (xt_in (par));
Greg Kroah-Hartman
maintainerPATCH 130/199 stm class: Fix module init return on allocation failure
In reply to Greg Kroah-HartmanFrom: Wang Hui <[email protected]>
commit 927633a6d20af319d986f3e42c3ef9f6d7835008 upstream.
In stm_heartbeat_init(): return value gets reset after the first iteration by stm_source_register_device(), so allocation failures after that will, after a clean up, return success. Fix that.
--- drivers/hwtracing/stm/heartbeat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwtracing/stm/heartbeat.c +4 -2
@@ -64,7 +64,7 @@ static void stm_heartbeat_unlink(structstatic int stm_heartbeat_init (void ) { -int i, ret = -ENOMEM ; +int i, ret;if (nr_devs <0 || nr_devs >STM_HEARTBEAT_MAX )return -EINVAL ;
@@ -72,8 +72,10 @@ static int stm_heartbeat_init(void)for (i =0 ; i < nr_devs; i++) { stm_heartbeat[i].data.name =kasprintf (GFP_KERNEL ,"heartbeat.%d" , i); -if (!stm_heartbeat[i].data.name) +if (!stm_heartbeat[i].data.name) { + ret = -ENOMEM ; goto fail_unregister; + } stm_heartbeat[i].data.nr_chans =1 ; stm_heartbeat[i].data.link = stm_heartbeat_link;
Greg Kroah-Hartman
maintainerPATCH 164/199 cachefiles: Drop superfluous readpages aops NULL check
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit db58465f1121086b524be80be39d1fedbe5387f3 upstream.
After the recent actions to convert readpages aops to readahead, the NULL checks of readpages aops in cachefiles_read_or_alloc_page() may hit falsely. More badly, it's an ASSERT() call, and this panics.
Drop the superfluous NULL checks for fixing this regression.
[DH: Note that cachefiles never actually used readpages, so this check was
never actually necessary]
--- fs/cachefiles/rdwr.c | 2 -- 1 file changed, 2 deletions(-)
fs/cachefiles/rdwr.c +0 -2
@@ -413,7 +413,6 @@ int cachefiles_read_or_alloc_page(struct inode =d_backing_inode (object->backer);ASSERT (S_ISREG (inode->i_mode)); -ASSERT (inode->i_mapping->a_ops->readpages);/* calculate the shift required to use bmap */ shift =PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
@@ -713,7 +712,6 @@ int cachefiles_read_or_alloc_pages(struc inode =d_backing_inode (object->backer);ASSERT (S_ISREG (inode->i_mode)); -ASSERT (inode->i_mapping->a_ops->readpages);/* calculate the shift required to use bmap */ shift =PAGE_SHIFT - inode->i_sb->s_blocksize_bits;
Greg Kroah-Hartman
maintainerPATCH 125/199 mm: fix numa stats for thp migration
In reply to Greg Kroah-HartmanFrom: Shakeel Butt <[email protected]>
commit 5c447d274f3746fbed6e695e7b9a2d7bd8b31b71 upstream.
Currently the kernel is not correctly updating the numa stats for NR_FILE_PAGES and NR_SHMEM on THP migration. Fix that.
For NR_FILE_DIRTY and NR_ZONE_WRITE_PENDING, although at the moment there is no need to handle THP migration as kernel still does not have write support for file THP but to be more future proof, this patch adds the THP support for those stats as well.
--- mm/migrate.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
mm/migrate.c +12 -11
@@ -406,6 +406,7 @@ int migrate_page_move_mapping(struct addstruct zone *oldzone, *newzone;int dirty;int expected_count =expected_page_refs (mapping, page) + extra_count; +int nr =thp_nr_pages (page);if (!mapping) {/* Anonymous page without mapping */
@@ -441,7 +442,7 @@ int migrate_page_move_mapping(struct add*/ newpage->index = page->index; newpage->mapping = page->mapping; -page_ref_add (newpage,thp_nr_pages (page));/* add cache reference */ +page_ref_add (newpage, nr);/* add cache reference */ if (PageSwapBacked (page)) {__SetPageSwapBacked (newpage);if (PageSwapCache (page)) {
@@ -463,7 +464,7 @@ int migrate_page_move_mapping(struct addif (PageTransHuge (page)) {int i; -for (i =1 ; i <HPAGE_PMD_NR ; i++) { +for (i =1 ; i < nr; i++) {xas_next (&xas);xas_store (&xas, newpage); }
@@ -474,7 +475,7 @@ int migrate_page_move_mapping(struct add* to one less reference. * We know this isn't the last reference. */ -page_ref_unfreeze (page, expected_count -thp_nr_pages (page)); +page_ref_unfreeze (page, expected_count - nr);xas_unlock (&xas);/* Leave irq disabled to prevent preemption while updating stats */
@@ -497,17 +498,17 @@ int migrate_page_move_mapping(struct add old_lruvec =mem_cgroup_lruvec (memcg, oldzone->zone_pgdat); new_lruvec =mem_cgroup_lruvec (memcg, newzone->zone_pgdat); -__dec_lruvec_state (old_lruvec,NR_FILE_PAGES ); -__inc_lruvec_state (new_lruvec,NR_FILE_PAGES ); +__mod_lruvec_state (old_lruvec,NR_FILE_PAGES , -nr); +__mod_lruvec_state (new_lruvec,NR_FILE_PAGES , nr);if (PageSwapBacked (page) && !PageSwapCache (page)) { -__dec_lruvec_state (old_lruvec,NR_SHMEM ); -__inc_lruvec_state (new_lruvec,NR_SHMEM ); +__mod_lruvec_state (old_lruvec,NR_SHMEM , -nr); +__mod_lruvec_state (new_lruvec,NR_SHMEM , nr); }if (dirty &&mapping_can_writeback (mapping)) { -__dec_lruvec_state (old_lruvec,NR_FILE_DIRTY ); -__dec_zone_state (oldzone,NR_ZONE_WRITE_PENDING ); -__inc_lruvec_state (new_lruvec,NR_FILE_DIRTY ); -__inc_zone_state (newzone,NR_ZONE_WRITE_PENDING ); +__mod_lruvec_state (old_lruvec,NR_FILE_DIRTY , -nr); +__mod_zone_page_state (oldzone,NR_ZONE_WRITE_PENDING , -nr); +__mod_lruvec_state (new_lruvec,NR_FILE_DIRTY , nr); +__mod_zone_page_state (newzone,NR_ZONE_WRITE_PENDING , nr); } }local_irq_enable ();
Greg Kroah-Hartman
maintainerPATCH 127/199 io_uring: fix SQPOLL IORING_OP_CLOSE cancelation state
In reply to Greg Kroah-HartmanFrom: Jens Axboe <[email protected]>
commit 607ec89ed18f49ca59689572659b9c0076f1991f upstream.
IORING_OP_CLOSE is special in terms of cancelation, since it has an intermediate state where we've removed the file descriptor but hasn't closed the file yet. For that reason, it's currently marked with IO_WQ_WORK_NO_CANCEL to prevent cancelation. This ensures that the op is always run even if canceled, to prevent leaving us with a live file but an fd that is gone. However, with SQPOLL, since a cancel request doesn't carry any resources on behalf of the request being canceled, if we cancel before any of the close op has been run, we can end up with io-wq not having the ->files assigned. This can result in the following oops reported by Joseph:
BUG: kernel NULL pointer dereference, address: 00000000000000d8 PGD 800000010b76f067 P4D 800000010b76f067 PUD 10b462067 PMD 0 Oops: 0000 [#1] SMP PTI CPU: 1 PID: 1788 Comm: io_uring-sq Not tainted 5.11.0-rc4 #1 Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011 RIP: 0010:__lock_acquire+0x19d/0x18c0 Code: 00 00 8b 1d fd 56 dd 08 85 db 0f 85 43 05 00 00 48 c7 c6 98 7b 95 82 48 c7 c7 57 96 93 82 e8 9a bc f5 ff 0f 0b e9 2b 05 00 00 <48> 81 3f c0 ca 67 8a b8 00 00 00 00 41 0f 45 c0 89 04 24 e9 81 fe RSP: 0018:ffffc90001933828 EFLAGS: 00010002 RAX: 0000000000000001 RBX: 0000000000000001 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 00000000000000d8 RBP: 0000000000000246 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000 R13: 0000000000000000 R14: ffff888106e8a140 R15: 00000000000000d8 FS: 0000000000000000(0000) GS:ffff88813bd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000000000d8 CR3: 0000000106efa004 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: lock_acquire+0x31a/0x440 ? close_fd_get_file+0x39/0x160 ? __lock_acquire+0x647/0x18c0 _raw_spin_lock+0x2c/0x40 ? close_fd_get_file+0x39/0x160 close_fd_get_file+0x39/0x160 io_issue_sqe+0x1334/0x14e0 ? lock_acquire+0x31a/0x440 ? __io_free_req+0xcf/0x2e0 ? __io_free_req+0x175/0x2e0 ? find_held_lock+0x28/0xb0 ? io_wq_submit_work+0x7f/0x240 io_wq_submit_work+0x7f/0x240 io_wq_cancel_cb+0x161/0x580 ? io_wqe_wake_worker+0x114/0x360 ? io_uring_get_socket+0x40/0x40 io_async_find_and_cancel+0x3b/0x140 io_issue_sqe+0xbe1/0x14e0 ? __lock_acquire+0x647/0x18c0 ? __io_queue_sqe+0x10b/0x5f0 __io_queue_sqe+0x10b/0x5f0 ? io_req_prep+0xdb/0x1150 ? mark_held_locks+0x6d/0xb0 ? mark_held_locks+0x6d/0xb0 ? io_queue_sqe+0x235/0x4b0 io_queue_sqe+0x235/0x4b0 io_submit_sqes+0xd7e/0x12a0 ? _raw_spin_unlock_irq+0x24/0x30 ? io_sq_thread+0x3ae/0x940 io_sq_thread+0x207/0x940 ? do_wait_intr_irq+0xc0/0xc0 ? __ia32_sys_io_uring_enter+0x650/0x650 kthread+0x134/0x180 ? kthread_create_worker_on_cpu+0x90/0x90 ret_from_fork+0x1f/0x30
Fix this by moving the IO_WQ_WORK_NO_CANCEL until _after_ we've modified the fdtable. Canceling before this point is totally fine, and running it in the io-wq context _after_ that point is also fine.
For 5.12, we'll handle this internally and get rid of the no-cancel flag, as IORING_OP_CLOSE is the only user of it.
--- fs/io_uring.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/io_uring.c +2 -1
@@ -4250,7 +4250,6 @@ static int io_close_prep(struct io_kiocb* io_wq_work.flags, so initialize io_wq_work firstly. */ io_req_init_async (req); - req->work.flags |=IO_WQ_WORK_NO_CANCEL ;if (unlikely (req->ctx->flags & (IORING_SETUP_IOPOLL |IORING_SETUP_SQPOLL )))return -EINVAL ;
@@ -4283,6 +4282,8 @@ static int io_close(struct io_kiocb *req/* if the file has a flush method, be safe and punt to async */ if (close->put_file->f_op->flush && force_nonblock) { +/* not safe to cancel at this point */ + req->work.flags |=IO_WQ_WORK_NO_CANCEL ;/* was never set, but play safe */ req->flags &= ~REQ_F_NOWAIT ;/* avoid grabbing files - we don't need the files */
Greg Kroah-Hartman
maintainerPATCH 166/199 skbuff: back tiny skbs with kmalloc() in __netdev_alloc_skb() too
In reply to Greg Kroah-HartmanFrom: Alexander Lobakin <[email protected]>
commit 66c556025d687dbdd0f748c5e1df89c977b6c02a upstream.
Commit 3226b158e67c ("net: avoid 32 x truesize under-estimation for tiny skbs") ensured that skbs with data size lower than 1025 bytes will be kmalloc'ed to avoid excessive page cache fragmentation and memory consumption.
However, the fix adressed only __napi_alloc_skb() (primarily for virtio_net and napi_get_frags()), but the issue can still be achieved through __netdev_alloc_skb(), which is still used by several drivers. Drivers often allocate a tiny skb for headers and place the rest of the frame to frags (so-called copybreak).
Mirror the condition to __netdev_alloc_skb() to handle this case too.
Since v1 [0]:
- fix "Fixes:" tag;
- refine commit message (mention copybreak usecase).
[0] https://lore.kernel.org/netdev/[email protected]
--- net/core/skbuff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/core/skbuff.c +5 -1
@@ -432,7 +432,11 @@ struct sk_buff *__netdev_alloc_skb(struc len +=NET_SKB_PAD ; -if ((len >SKB_WITH_OVERHEAD (PAGE_SIZE )) || +/* If requested length is either too small or too big, +* we use kmalloc() for skb->head allocation. +*/ +if (len <=SKB_WITH_OVERHEAD (1024 ) || + len >SKB_WITH_OVERHEAD (PAGE_SIZE ) || (gfp_mask & (__GFP_DIRECT_RECLAIM |GFP_DMA ))) { skb =__alloc_skb (len, gfp_mask,SKB_ALLOC_RX ,NUMA_NO_NODE );if (!skb)
Greg Kroah-Hartman
maintainerPATCH 167/199 kasan: fix unaligned address is unhandled in kasan_remove_zero_shadow
In reply to Greg Kroah-HartmanFrom: Lecopzer Chen <[email protected]>
commit a11a496ee6e2ab6ed850233c96b94caf042af0b9 upstream.
During testing kasan_populate_early_shadow and kasan_remove_zero_shadow, if the shadow start and end address in kasan_remove_zero_shadow() is not aligned to PMD_SIZE, the remain unaligned PTE won't be removed.
In the test case for kasan_remove_zero_shadow():
shadow_start: 0xffffffb802000000, shadow end: 0xffffffbfbe000000
3-level page table:
PUD_SIZE: 0x40000000 PMD_SIZE: 0x200000 PAGE_SIZE: 4K0xffffffbf80000000 ~ 0xffffffbfbdf80000 will not be removed because in kasan_remove_pud_table(), kasan_pmd_table(*pud) is true but the next address is 0xffffffbfbdf80000 which is not aligned to PUD_SIZE.
In the correct condition, this should fallback to the next level kasan_remove_pmd_table() but the condition flow always continue to skip the unaligned part.
Fix by correcting the condition when next and addr are neither aligned.
--- mm/kasan/init.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
mm/kasan/init.c +12 -8
@@ -377,9 +377,10 @@ static void kasan_remove_pmd_table(pmd_tif (kasan_pte_table (*pmd)) {if (IS_ALIGNED (addr,PMD_SIZE ) && -IS_ALIGNED (next,PMD_SIZE )) +IS_ALIGNED (next,PMD_SIZE )) {pmd_clear (pmd); -continue ; +continue ; + } } pte =pte_offset_kernel (pmd, addr);kasan_remove_pte_table (pte, addr, next);
@@ -402,9 +403,10 @@ static void kasan_remove_pud_table(pud_tif (kasan_pmd_table (*pud)) {if (IS_ALIGNED (addr,PUD_SIZE ) && -IS_ALIGNED (next,PUD_SIZE )) +IS_ALIGNED (next,PUD_SIZE )) {pud_clear (pud); -continue ; +continue ; + } } pmd =pmd_offset (pud, addr); pmd_base =pmd_offset (pud,0 );
@@ -428,9 +430,10 @@ static void kasan_remove_p4d_table(p4d_tif (kasan_pud_table (*p4d)) {if (IS_ALIGNED (addr,P4D_SIZE ) && -IS_ALIGNED (next,P4D_SIZE )) +IS_ALIGNED (next,P4D_SIZE )) {p4d_clear (p4d); -continue ; +continue ; + } } pud =pud_offset (p4d, addr);kasan_remove_pud_table (pud, addr, next);
@@ -462,9 +465,10 @@ void kasan_remove_zero_shadow(void *starif (kasan_p4d_table (*pgd)) {if (IS_ALIGNED (addr,PGDIR_SIZE ) && -IS_ALIGNED (next,PGDIR_SIZE )) +IS_ALIGNED (next,PGDIR_SIZE )) {pgd_clear (pgd); -continue ; +continue ; + } } p4d =p4d_offset (pgd, addr);
Greg Kroah-Hartman
maintainerPATCH 168/199 kasan: fix incorrect arguments passing in kasan_add_zero_shadow
In reply to Greg Kroah-HartmanFrom: Lecopzer Chen <[email protected]>
commit 5dabd1712cd056814f9ab15f1d68157ceb04e741 upstream.
kasan_remove_zero_shadow() shall use original virtual address, start and size, instead of shadow address.
--- mm/kasan/init.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
mm/kasan/init.c +1 -2
@@ -492,7 +492,6 @@ int kasan_add_zero_shadow(void *start, u ret =kasan_populate_early_shadow (shadow_start, shadow_end);if (ret) -kasan_remove_zero_shadow (shadow_start, - size >>KASAN_SHADOW_SCALE_SHIFT ); +kasan_remove_zero_shadow (start, size);return ret; }
Greg Kroah-Hartman
maintainerPATCH 171/199 udp: mask TOS bits in udp_v4_early_demux()
In reply to Greg Kroah-HartmanFrom: Guillaume Nault <[email protected]>
commit 8d2b51b008c25240914984208b2ced57d1dd25a5 upstream.
udp_v4_early_demux() is the only function that calls ip_mc_validate_source() with a TOS that hasn't been masked with IPTOS_RT_MASK.
This results in different behaviours for incoming multicast UDPv4 packets, depending on if ip_mc_validate_source() is called from the early-demux path (udp_v4_early_demux) or from the regular input path (ip_route_input_noref).
ECN would normally not be used with UDP multicast packets, so the practical consequences should be limited on that side. However, IPTOS_RT_MASK is used to also masks the TOS' high order bits, to align with the non-early-demux path behaviour.
Reproducer:
Setup two netns, connected with veth:
$ ip netns add ns0 $ ip netns add ns1 $ ip -netns ns0 link set dev lo up $ ip -netns ns1 link set dev lo up $ ip link add name veth01 netns ns0 type veth peer name veth10 netns ns1 $ ip -netns ns0 link set dev veth01 up $ ip -netns ns1 link set dev veth10 up $ ip -netns ns0 address add 192.0.2.10 peer 192.0.2.11/32 dev veth01 $ ip -netns ns1 address add 192.0.2.11 peer 192.0.2.10/32 dev veth10
In ns0, add route to multicast address 224.0.2.0/24 using source address 198.51.100.10:
$ ip -netns ns0 address add 198.51.100.10/32 dev lo $ ip -netns ns0 route add 224.0.2.0/24 dev veth01 src 198.51.100.10
In ns1, define route to 198.51.100.10, only for packets with TOS 4:
$ ip -netns ns1 route add 198.51.100.10/32 tos 4 dev veth10
Also activate rp_filter in ns1, so that incoming packets not matching the above route get dropped:
$ ip netns exec ns1 sysctl -wq net.ipv4.conf.veth10.rp_filter=1
Now try to receive packets on 224.0.2.11:
$ ip netns exec ns1 socat UDP-RECVFROM:1111,ip-add-membership=224.0.2.11:veth10,ignoreeof -
In ns0, send packet to 224.0.2.11 with TOS 4 and ECT(0) (that is, tos 6 for socat):
$ echo test0 | ip netns exec ns0 socat - UDP-DATAGRAM:224.0.2.11:1111,bind=:1111,tos=6
The "test0" message is properly received by socat in ns1, because early-demux has no cached dst to use, so source address validation is done by ip_route_input_mc(), which receives a TOS that has the ECN bits masked.
Now send another packet to 224.0.2.11, still with TOS 4 and ECT(0):
$ echo test1 | ip netns exec ns0 socat - UDP-DATAGRAM:224.0.2.11:1111,bind=:1111,tos=6
The "test1" message isn't received by socat in ns1, because, now, early-demux has a cached dst to use and calls ip_mc_validate_source() immediately, without masking the ECN bits.
--- net/ipv4/udp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/ipv4/udp.c +2 -1
@@ -2553,7 +2553,8 @@ int udp_v4_early_demux(struct sk_buff *s*/ if (!inet_sk (sk)->inet_daddr && in_dev)return ip_mc_validate_source (skb, iph->daddr, - iph->saddr, iph->tos, + iph->saddr, + iph->tos &IPTOS_RT_MASK , skb->dev, in_dev, &itag); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 169/199 tcp: fix TCP socket rehash stats mis-accounting
In reply to Greg Kroah-HartmanFrom: Yuchung Cheng <[email protected]>
commit 9c30ae8398b0813e237bde387d67a7f74ab2db2d upstream.
The previous commit 32efcc06d2a1 ("tcp: export count for rehash attempts") would mis-account rehashing SNMP and socket stats:
a. During handshake of an active open, only counts the first
SYN timeout
b. After handshake of passive and active open, stop updating
after (roughly) TCP_RETRIES1 recurring RTOs
c. After the socket aborts, over count timeout_rehash by 1
This patch fixes this by checking the rehash result from sk_rethink_txhash.
--- include/net/sock.h | 17 ++++++++++++----- net/ipv4/tcp_input.c | 5 ++--- net/ipv4/tcp_timer.c | 22 ++++++++-------------- 3 files changed, 22 insertions(+), 22 deletions(-)
include/net/sock.h +12 -5
@@ -1903,10 +1903,13 @@ static inline void sk_set_txhash(struct sk->sk_txhash =net_tx_rndhash (); } -static inline void sk_rethink_txhash (struct sock *sk) +static inline bool sk_rethink_txhash (struct sock *sk) { -if (sk->sk_txhash) +if (sk->sk_txhash) {sk_set_txhash (sk); +return true; + } +return false; } static inline struct dst_entry *
@@ -1929,12 +1932,10 @@ sk_dst_get(struct sock *sk)return dst; } -static inline void dst_negative_advice (struct sock *sk) +static inline void __dst_negative_advice (struct sock *sk) {struct dst_entry *ndst, *dst =__sk_dst_get (sk); -sk_rethink_txhash (sk); -if (dst && dst->ops->negative_advice) { ndst = dst->ops->negative_advice (dst);
@@ -1946,6 +1947,12 @@ static inline void dst_negative_advice(s } } +static inline void dst_negative_advice (struct sock *sk) +{ +sk_rethink_txhash (sk); +__dst_negative_advice (sk); +} +static inline void __sk_dst_set (struct sock *sk,struct dst_entry *dst) {
net/ipv4/tcp_input.c +2 -3
@@ -4379,10 +4379,9 @@ static void tcp_rcv_spurious_retrans(str* The receiver remembers and reflects via DSACKs. Leverage the * DSACK state and change the txhash to re-route speculatively. */ -if (TCP_SKB_CB (skb)->seq ==tcp_sk (sk)->duplicate_sack[0 ].start_seq) { -sk_rethink_txhash (sk); +if (TCP_SKB_CB (skb)->seq ==tcp_sk (sk)->duplicate_sack[0 ].start_seq && +sk_rethink_txhash (sk))NET_INC_STATS (sock_net (sk),LINUX_MIB_TCPDUPLICATEDATAREHASH ); - } }static void tcp_send_dupack (struct sock *sk,const struct sk_buff *skb)
net/ipv4/tcp_timer.c +8 -14
@@ -219,14 +219,8 @@ static int tcp_write_timeout(struct sockint retry_until;if ((1 << sk->sk_state) & (TCPF_SYN_SENT |TCPF_SYN_RECV )) { -if (icsk->icsk_retransmits) { -dst_negative_advice (sk); - }else { -sk_rethink_txhash (sk); - tp->timeout_rehash++; -__NET_INC_STATS (sock_net (sk), -LINUX_MIB_TCPTIMEOUTREHASH ); - } +if (icsk->icsk_retransmits) +__dst_negative_advice (sk); retry_until = icsk->icsk_syn_retries ? : net->ipv4.sysctl_tcp_syn_retries; expired = icsk->icsk_retransmits >= retry_until; }else {
@@ -234,12 +228,7 @@ static int tcp_write_timeout(struct sock/* Black hole detection */ tcp_mtu_probing (icsk, sk); -dst_negative_advice (sk); - }else { -sk_rethink_txhash (sk); - tp->timeout_rehash++; -__NET_INC_STATS (sock_net (sk), -LINUX_MIB_TCPTIMEOUTREHASH ); +__dst_negative_advice (sk); } retry_until = net->ipv4.sysctl_tcp_retries2;
@@ -270,6 +259,11 @@ static int tcp_write_timeout(struct sockreturn 1 ; } +if (sk_rethink_txhash (sk)) { + tp->timeout_rehash++; +__NET_INC_STATS (sock_net (sk),LINUX_MIB_TCPTIMEOUTREHASH ); + } +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 170/199 net_sched: gen_estimator: support large ewma log
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit dd5e073381f2ada3630f36be42833c6e9c78b75e upstream.
syzbot report reminded us that very big ewma_log were supported in the past, even if they made litle sense.
tc qdisc replace dev xxx root est 1sec 131072sec ...
While fixing the bug, also add boundary checks for ewma_log, in line with range supported by iproute2.
UBSAN: shift-out-of-bounds in net/core/gen_estimator.c:83:38 shift exponent -1 is negative CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.10.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: <IRQ> __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 ubsan_epilogue+0xb/0x5a lib/ubsan.c:148 __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:395 est_timer.cold+0xbb/0x12d net/core/gen_estimator.c:83 call_timer_fn+0x1a5/0x710 kernel/time/timer.c:1417 expire_timers kernel/time/timer.c:1462 [inline] __run_timers.part.0+0x692/0xa80 kernel/time/timer.c:1731 __run_timers kernel/time/timer.c:1712 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1744 __do_softirq+0x2bc/0xa77 kernel/softirq.c:343 asm_call_irq_on_stack+0xf/0x20 </IRQ> __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:226 [inline] __irq_exit_rcu+0x17f/0x200 kernel/softirq.c:420 irq_exit_rcu+0x5/0x20 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:native_save_fl arch/x86/include/asm/irqflags.h:29 [inline] RIP: 0010:arch_local_save_flags arch/x86/include/asm/irqflags.h:79 [inline] RIP: 0010:arch_irqs_disabled arch/x86/include/asm/irqflags.h:169 [inline] RIP: 0010:acpi_safe_halt drivers/acpi/processor_idle.c:111 [inline] RIP: 0010:acpi_idle_do_entry+0x1c9/0x250 drivers/acpi/processor_idle.c:516
--- net/core/gen_estimator.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
net/core/gen_estimator.c +7 -4
@@ -80,11 +80,11 @@ static void est_timer(struct timer_listu64 rate, brate;est_fetch_counters (est, &b); - brate = (b.bytes - est->last_bytes) << (10 - est->ewma_log - est->intvl_log); - brate -= (est->avbps >> est->ewma_log); + brate = (b.bytes - est->last_bytes) << (10 - est->intvl_log); + brate = (brate >> est->ewma_log) - (est->avbps >> est->ewma_log); - rate = (b.packets - est->last_packets) << (10 - est->ewma_log - est->intvl_log); - rate -= (est->avpps >> est->ewma_log); + rate = (b.packets - est->last_packets) << (10 - est->intvl_log); + rate = (rate >> est->ewma_log) - (est->avpps >> est->ewma_log);write_seqcount_begin (&est->seq); est->avbps += brate;
@@ -143,6 +143,9 @@ int gen_new_estimator(struct gnet_stats_if (parm->interval <-2 || parm->interval >3 )return -EINVAL ; +if (parm->ewma_log ==0 || parm->ewma_log >=31 ) +return -EINVAL ; + est =kzalloc (sizeof (*est),GFP_KERNEL );if (!est)return -ENOBUFS ;
Greg Kroah-Hartman
maintainerPATCH 182/199 net: core: devlink: use right genl user_ptr when handling port param get/set
In reply to Greg Kroah-HartmanFrom: Oleksandr Mazur <[email protected]>
commit 7e238de8283acd32c26c2bc2a50672d0ea862ff7 upstream.
Fix incorrect user_ptr dereferencing when handling port param get/set:
idx [0] stores the 'struct devlink' pointer;
idx [1] stores the 'struct devlink_port' pointer;--- net/core/devlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/core/devlink.c +2 -2
@@ -4134,7 +4134,7 @@ out:static int devlink_nl_cmd_port_param_get_doit (struct sk_buff *skb,struct genl_info *info) { -struct devlink_port *devlink_port = info->user_ptr[0 ]; +struct devlink_port *devlink_port = info->user_ptr[1 ];struct devlink_param_item *param_item;struct sk_buff *msg;int err;
@@ -4163,7 +4163,7 @@ static int devlink_nl_cmd_port_param_getstatic int devlink_nl_cmd_port_param_set_doit (struct sk_buff *skb,struct genl_info *info) { -struct devlink_port *devlink_port = info->user_ptr[0 ]; +struct devlink_port *devlink_port = info->user_ptr[1 ]; return __devlink_nl_cmd_param_set_doit(devlink_port->devlink, devlink_port->index,
Greg Kroah-Hartman
maintainerPATCH 183/199 pinctrl: qcom: Allow SoCs to specify a GPIO function thats not 0
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
commit a82e537807d5c85706cd4c16fd2de77a8495dc8d upstream.
There's currently a comment in the code saying function 0 is GPIO. Instead of hardcoding it, let's add a member where an SoC can specify it. No known SoCs use a number other than 0, but this just makes the code clearer. NOTE: no SoC code needs to be updated since we can rely on zero-initialization.
--- drivers/pinctrl/qcom/pinctrl-msm.c | 3 +-- drivers/pinctrl/qcom/pinctrl-msm.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/pinctrl/qcom/pinctrl-msm.c +1 -2
@@ -210,8 +210,7 @@ static int msm_pinmux_request_gpio(strucif (!g->nfuncs)return 0 ; -/* For now assume function 0 is GPIO because it always is */ -return msm_pinmux_set_mux (pctldev, g->funcs[0 ], offset); +return msm_pinmux_set_mux (pctldev, g->funcs[pctrl->soc->gpio_func], offset); }static const struct pinmux_ops msm_pinmux_ops = {
drivers/pinctrl/qcom/pinctrl-msm.h +2 -0
@@ -118,6 +118,7 @@ struct msm_gpio_wakeirq_map {* @wakeirq_dual_edge_errata: If true then GPIOs using the wakeirq_map need * to be aware that their parent can't handle dual * edge interrupts. +* @gpio_func: Which function number is GPIO (usually 0). */ struct msm_pinctrl_soc_data {const struct pinctrl_pin_desc *pins;
@@ -134,6 +135,7 @@ struct msm_pinctrl_soc_data {const struct msm_gpio_wakeirq_map *wakeirq_map;unsigned int nwakeirq_map;bool wakeirq_dual_edge_errata; +unsigned int gpio_func; };extern const struct dev_pm_ops msm_pinctrl_dev_pm_ops;
Greg Kroah-Hartman
maintainerPATCH 157/199 ASoC: SOF: Intel: fix page fault at probe if i915 init fails
In reply to Greg Kroah-HartmanFrom: Kai Vehmanen <[email protected]>
commit 9c25af250214e45f6d1c21ff6239a1ffeeedf20e upstream.
The earlier commit to fix runtime PM in case i915 init fails, introduces a possibility to hit a page fault.
snd_hdac_ext_bus_device_exit() is designed to be called from dev.release(). Calling it outside device reference counting, is not safe and may lead to calling the device_exit() function twice. Additionally, as part of ext_bus_device_init(), the device is also registered with snd_hdac_device_register(). Thus before calling device_exit(), the device must be removed from device hierarchy first.
Fix the issue by rolling back init actions by calling hdac_device_unregister() and then releasing device with put_device(). This matches with existing code in hdac-ext module.
To complete the fix, add handling for the case where hda_codec_load_module() returns -ENODEV, and clean up the hdac_ext resources also in this case.
In future work, hdac-ext interface should be extended to allow clients more flexibility to handle the life-cycle of individual devices, beyond just the current snd_hdac_ext_bus_device_remove(), which removes all devices.
--- sound/soc/sof/intel/hda-codec.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
sound/soc/sof/intel/hda-codec.c +9 -9
@@ -156,7 +156,8 @@ static int hda_codec_probe(struct snd_soif (!hdev->bus->audio_component) {dev_dbg (sdev->dev,"iDisp hw present but no driver\n" ); - goto error; + ret = -ENOENT ; + goto out; } hda_priv->need_display_power = true; }
@@ -173,24 +174,23 @@ static int hda_codec_probe(struct snd_so* other return codes without modification */ if (ret ==0 ) - goto error; + ret = -ENOENT; } -return ret; - -error: -snd_hdac_ext_bus_device_exit (hdev); -return -ENOENT ; - +out: +if (ret <0 ) { +snd_hdac_device_unregister (hdev); +put_device (&hdev->dev); + }#else hdev =devm_kzalloc (sdev->dev,sizeof (*hdev),GFP_KERNEL );if (!hdev)return -ENOMEM ; ret =snd_hdac_ext_bus_device_init (&hbus->core, address, hdev,HDA_DEV_ASOC ); +#endif return ret; -#endif }/* Codec initialization */
Greg Kroah-Hartman
maintainerPATCH 175/199 ipv6: set multicast flag on the multicast route
In reply to Greg Kroah-HartmanFrom: Matteo Croce <[email protected]>
commit ceed9038b2783d14e0422bdc6fd04f70580efb4c upstream.
The multicast route ff00::/8 is created with type RTN_UNICAST:
$ ip -6 -d route unicast ::1 dev lo proto kernel scope global metric 256 pref medium unicast fe80::/64 dev eth0 proto kernel scope global metric 256 pref medium unicast ff00::/8 dev eth0 proto kernel scope global metric 256 pref medium
Set the type to RTN_MULTICAST which is more appropriate.
--- net/ipv6/addrconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv6/addrconf.c +1 -1
@@ -2466,7 +2466,7 @@ static void addrconf_add_mroute(struct n .fc_ifindex = dev->ifindex, .fc_dst_len = 8, .fc_flags = RTF_UP, - .fc_type = RTN_UNICAST, + .fc_type = RTN_MULTICAST, .fc_nlinfo.nl_net = dev_net(dev), .fc_protocol = RTPROT_KERNEL, };
Greg Kroah-Hartman
maintainerPATCH 176/199 net: mscc: ocelot: allow offloading of bridge on top of LAG
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
commit 79267ae22615496655feee2db0848f6786bcf67a upstream.
The blamed commit was too aggressive, and it made ocelot_netdevice_event react only to network interface events emitted for the ocelot switch ports.
In fact, only the PRECHANGEUPPER should have had that check.
When we ignore all events that are not for us, we miss the fact that the upper of the LAG changes, and the bonding interface gets enslaved to a bridge. This is an operation we could offload under certain conditions.
--- drivers/net/ethernet/mscc/ocelot_net.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/ethernet/mscc/ocelot_net.c +1 -3
@@ -952,10 +952,8 @@ static int ocelot_netdevice_event(structstruct net_device *dev =netdev_notifier_info_to_dev (ptr);int ret =0 ; -if (!ocelot_netdevice_dev_check (dev)) -return 0 ; -if (event ==NETDEV_PRECHANGEUPPER && +ocelot_netdevice_dev_check (dev) &&netif_is_lag_master (info->upper_dev)) {struct netdev_lag_upper_info *lag_upper_info = info->upper_info;struct netlink_ext_ack *extack;
Greg Kroah-Hartman
maintainerPATCH 177/199 net: Disable NETIF_F_HW_TLS_RX when RXCSUM is disabled
In reply to Greg Kroah-HartmanFrom: Tariq Toukan <[email protected]>
commit a3eb4e9d4c9218476d05c52dfd2be3d6fdce6b91 upstream.
With NETIF_F_HW_TLS_RX packets are decrypted in HW. This cannot be logically done when RXCSUM offload is off.
--- net/core/dev.c | 5 +++++ 1 file changed, 5 insertions(+)
net/core/dev.c +5 -0
@@ -9602,6 +9602,11 @@ static netdev_features_t netdev_fix_feat } } +if ((features &NETIF_F_HW_TLS_RX ) && !(features &NETIF_F_RXCSUM )) { +netdev_dbg (dev,"Dropping TLS RX HW offload feature since no RXCSUM feature.\n" ); + features &= ~NETIF_F_HW_TLS_RX ; + } +return features; }
Greg Kroah-Hartman
maintainerPATCH 178/199 net: dsa: b53: fix an off by one in checking "vlan->vid"
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit 8e4052c32d6b4b39c1e13c652c7e33748d447409 upstream.
The > comparison should be >= to prevent accessing one element beyond the end of the dev->vlans[] array in the caller function, b53_vlan_add(). The "dev->vlans" array is allocated in the b53_switch_init() function and it has "dev->num_vlans" elements.
--- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_common.c +1 -1
@@ -1404,7 +1404,7 @@ int b53_vlan_prepare(struct dsa_switch * !(vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED))return -EINVAL ; -if (vlan->vid_end > dev->num_vlans) +if (vlan->vid_end >= dev->num_vlans)return -ERANGE ;b53_enable_vlan (dev, true, ds->vlan_filtering);
Greg Kroah-Hartman
maintainerPATCH 198/199 kernfs: wire up ->splice_read and ->splice_write
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit f2d6c2708bd84ca953fa6b6ca5717e79eb0140c7 upstream.
Wire up the splice_read and splice_write methods to the default helpers using ->read_iter and ->write_iter now that those are implemented for kernfs. This restores support to use splice and sendfile on kernfs files.
--- fs/kernfs/file.c | 2 ++ 1 file changed, 2 insertions(+)
fs/kernfs/file.c +2 -0
@@ -949,6 +949,8 @@ const struct file_operations kernfs_file .release = kernfs_fop_release, .poll = kernfs_fop_poll, .fsync = noop_fsync, + .splice_read = generic_file_splice_read, + .splice_write = iter_file_splice_write, };/**
Greg Kroah-Hartman
maintainerPATCH 162/199 nvme-pci: refactor nvme_unmap_data
In reply to Greg Kroah-HartmanFrom: Christoph Hellwig <[email protected]>
commit 9275c206f88e5c49cb3e71932c81c8561083db9e upstream.
Split out three helpers from nvme_unmap_data that will allow finer grained unwinding from nvme_map_data.
--- drivers/nvme/host/pci.c | 77 ++++++++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 28 deletions(-)
drivers/nvme/host/pci.c +49 -28
@@ -542,50 +542,71 @@ static inline bool nvme_pci_use_sgls(strreturn true; } -static void nvme_unmap_data (struct nvme_dev *dev,struct request *req) +static void nvme_free_prps (struct nvme_dev *dev,struct request *req) { -struct nvme_iod *iod =blk_mq_rq_to_pdu (req);const int last_prp =NVME_CTRL_PAGE_SIZE /sizeof (__le64) -1 ; -dma_addr_t dma_addr = iod->first_dma, next_dma_addr; +struct nvme_iod *iod =blk_mq_rq_to_pdu (req); +dma_addr_t dma_addr = iod->first_dma;int i; -if (iod->dma_len) { -dma_unmap_page (dev->dev, dma_addr, iod->dma_len, -rq_dma_dir (req)); -return ; +for (i =0 ; i < iod->npages; i++) { +__le64 *prp_list =nvme_pci_iod_list (req)[i]; +dma_addr_t next_dma_addr =le64_to_cpu (prp_list[last_prp]); + +dma_pool_free (dev->prp_page_pool, prp_list, dma_addr); + dma_addr = next_dma_addr; } -WARN_ON_ONCE (!iod->nents); +} -if (is_pci_p2pdma_page (sg_page (iod->sg))) -pci_p2pdma_unmap_sg (dev->dev, iod->sg, iod->nents, -rq_dma_dir (req)); -else -dma_unmap_sg (dev->dev, iod->sg, iod->nents,rq_dma_dir (req)); +static void nvme_free_sgls (struct nvme_dev *dev,struct request *req) +{ +const int last_sg =SGES_PER_PAGE -1 ; +struct nvme_iod *iod =blk_mq_rq_to_pdu (req); +dma_addr_t dma_addr = iod->first_dma; +int i; +for (i =0 ; i < iod->npages; i++) { +struct nvme_sgl_desc *sg_list =nvme_pci_iod_list (req)[i]; +dma_addr_t next_dma_addr =le64_to_cpu ((sg_list[last_sg]).addr); -if (iod->npages ==0 ) -dma_pool_free (dev->prp_small_pool,nvme_pci_iod_list (req)[0 ], - dma_addr); +dma_pool_free (dev->prp_page_pool, sg_list, dma_addr); + dma_addr = next_dma_addr; + } -for (i =0 ; i < iod->npages; i++) { -void *addr =nvme_pci_iod_list (req)[i]; +} -if (iod->use_sgl) { -struct nvme_sgl_desc *sg_list = addr; +static void nvme_unmap_sg (struct nvme_dev *dev,struct request *req) +{ +struct nvme_iod *iod =blk_mq_rq_to_pdu (req); - next_dma_addr = -le64_to_cpu ((sg_list[SGES_PER_PAGE -1 ]).addr); - }else { -__le64 *prp_list = addr; +if (is_pci_p2pdma_page (sg_page (iod->sg))) +pci_p2pdma_unmap_sg (dev->dev, iod->sg, iod->nents, +rq_dma_dir (req)); +else +dma_unmap_sg (dev->dev, iod->sg, iod->nents,rq_dma_dir (req)); +} - next_dma_addr =le64_to_cpu (prp_list[last_prp]); - } +static void nvme_unmap_data (struct nvme_dev *dev,struct request *req) +{ +struct nvme_iod *iod =blk_mq_rq_to_pdu (req); -dma_pool_free (dev->prp_page_pool, addr, dma_addr); - dma_addr = next_dma_addr; +if (iod->dma_len) { +dma_unmap_page (dev->dev, iod->first_dma, iod->dma_len, +rq_dma_dir (req)); +return ; } +WARN_ON_ONCE (!iod->nents); + +nvme_unmap_sg (dev, req); +if (iod->npages ==0 ) +dma_pool_free (dev->prp_small_pool,nvme_pci_iod_list (req)[0 ], + iod->first_dma); +else if (iod->use_sgl) +nvme_free_sgls (dev, req); +else +nvme_free_prps (dev, req);mempool_free (iod->sg, dev->iod_mempool); }
Greg Kroah-Hartman
maintainerPATCH 199/199 interconnect: imx8mq: Use icc_sync_state
In reply to Greg Kroah-HartmanFrom: Martin Kepplinger <[email protected]>
commit 67288f74d4837b82ef937170da3389b0779c17be upstream.
Add the icc_sync_state callback to notify the framework when consumers are probed and the bandwidth doesn't have to be kept at maximum anymore.
--- drivers/interconnect/imx/imx8mq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/interconnect/imx/imx8mq.c +2 -0
@@ -7,6 +7,7 @@#include <linux/module.h> #include <linux/platform_device.h> +#include <linux/interconnect-provider.h> #include <dt-bindings/interconnect/imx8mq.h> #include "imx.h"
@@ -94,6 +95,7 @@ static struct platform_driver imx8mq_icc .remove = imx8mq_icc_remove, .driver = { .name = "imx8mq-interconnect", + .sync_state = icc_sync_state, }, };
Re: [PATCH 5.10 119/199] x86/mmx: Use KFPU_387 for MMX string operations
In reply to Greg Kroah-HartmanHi,
I think for both 5.4-stable and 5.10-stable we also need https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e45122893a9870813f9bd7b4add4f613e6f29008 - "x86/fpu: Add kernel_fpu_begin_mask() to selectively initialize state"
Without this, there is no kernel_fpu_begin_mask().
Thanks,
Krzysztof
Quoted 91 lines · Greg Kroah-Hartman
From: Andy Lutomirski <[email protected]>
commit
67de8dca50c027ca0fa3b62a488ee5035036a0daupstream.The default
kernel_fpu_begin()doesn't work on systems that support XMM but haven't yet enabled CR4.OSFXSR. This causes crashes when_mmx_memcpy()is called too early because LDMXCSR generates #UD when the aforementioned bit is clear.Fix it by using
kernel_fpu_begin_mask(KFPU_387)explicitly.Fixes 7ad816762f9b ("x86/fpu: Reset MXCSR to default in kernel_fpu_begin()")Reported-by Krzysztof Mazur <[email protected]>Signed-off-by Andy Lutomirski <[email protected]>Signed-off-by Borislav Petkov <[email protected]>Tested-by Krzysztof Mazur <[email protected]>Cc <[email protected]>Link https://lkml.kernel.org/r/e7bf21855fe99e5f3baa27446e32623358f69e8d.1611205691.git.luto@kernel.org open hereSigned-off-by Greg Kroah-Hartman <[email protected]>--- arch/x86/lib/mmx_32.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-)arch/x86/lib/mmx_32.c +15
-5@@ -26,6 +26,16 @@#include <asm/fpu/api.h> #include <asm/asm.h> +/* +* Use KFPU_387. MMX instructions are not affected by MXCSR, +* but both AMD and Intel documentation states that even integer MMX +* operations will result in #MF if an exception is pending in FCW. +* +* EMMS is not needed afterwards because, after calling kernel_fpu_end(), +* any subsequent user of the 387 stack will reinitialize it using +* KFPU_387. +*/ +void *_mmx_memcpy (void *to,const void *from,size_t len) {void *p;@@ -37,7 +47,7 @@ void *_mmx_memcpy(void *to, const void * p = to; i = len >>6 ;/* len/64 */ -kernel_fpu_begin (); +kernel_fpu_begin_mask (KFPU_387 ); __asm__ __volatile__ ( "1: prefetch (%0)\n" /* This set is 28 bytes */@@ -127,7 +137,7 @@ static void fast_clear_page(void *page) {int i; -kernel_fpu_begin (); +kernel_fpu_begin_mask (KFPU_387 ); __asm__ __volatile__ ( " pxor %%mm0, %%mm0\n" : :@@ -160,7 +170,7 @@ static void fast_copy_page(void *to, voi {int i; -kernel_fpu_begin (); +kernel_fpu_begin_mask (KFPU_387 );/* * maybe the prefetch stuff can go before the expensive fnsave... @@ -247,7 +257,7 @@ static void fast_clear_page(void *page) {int i; -kernel_fpu_begin (); +kernel_fpu_begin_mask (KFPU_387 ); __asm__ __volatile__ ( " pxor %%mm0, %%mm0\n" : :@@ -282,7 +292,7 @@ static void fast_copy_page(void *to, voi {int i; -kernel_fpu_begin (); +kernel_fpu_begin_mask (KFPU_387 ); __asm__ __volatile__ ( "1: prefetch (%0)\n"
Greg Kroah-Hartman
maintainerPATCH 123/199 mm: memcg/slab: optimize objcg stock draining
In reply to Greg Kroah-HartmanFrom: Roman Gushchin <[email protected]>
commit 3de7d4f25a7438f09fef4e71ef111f1805cd8e7c upstream.
Imran Khan reported a 16% regression in hackbench results caused by the commit f2fe7b09a52b ("mm: memcg/slab: charge individual slab objects instead of pages"). The regression is noticeable in the case of a consequent allocation of several relatively large slab objects, e.g. skb's. As soon as the amount of stocked bytes exceeds PAGE_SIZE, drain_obj_stock() and __memcg_kmem_uncharge() are called, and it leads to a number of atomic operations in page_counter_uncharge().
The corresponding call graph is below (provided by Imran Khan):
|__alloc_skb | | | |__kmalloc_reserve.isra.61 | | | | | |__kmalloc_node_track_caller | | | | | | | |slab_pre_alloc_hook.constprop.88 | | | obj_cgroup_charge | | | | | | | | | |__memcg_kmem_charge | | | | | | | | | | | |page_counter_try_charge | | | | | | | | | |refill_obj_stock | | | | | | | | | | | |drain_obj_stock.isra.68 | | | | | | | | | | | | | |__memcg_kmem_uncharge | | | | | | | | | | | | | | | |page_counter_uncharge | | | | | | | | | | | | | | | | | |page_counter_cancel | | | | | | | | | | | |__slab_alloc | | | | | | | | | |___slab_alloc | | | | | | | | |slab_post_alloc_hook
Instead of directly uncharging the accounted kernel memory, it's possible to refill the generic page-sized per-cpu stock instead. It's a much faster operation, especially on a default hierarchy. As a bonus, __memcg_kmem_uncharge_page() will also get faster, so the freeing of page-sized kernel allocations (e.g. large kmallocs) will become faster.
A similar change has been done earlier for the socket memory by the commit 475d0487a2ad ("mm: memcontrol: use per-cpu stocks for socket memory uncharging").
--- mm/memcontrol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
mm/memcontrol.c +1 -3
@@ -3083,9 +3083,7 @@ void __memcg_kmem_uncharge(struct mem_cgif (!cgroup_subsys_on_dfl (memory_cgrp_subsys))page_counter_uncharge (&memcg->kmem, nr_pages); -page_counter_uncharge (&memcg->memory, nr_pages); -if (do_memsw_account ()) -page_counter_uncharge (&memcg->memsw, nr_pages); +refill_stock (memcg, nr_pages); }/**
Greg Kroah-Hartman
maintainerPATCH 140/199 xhci: make sure TRB is fully written before giving it to the controller
In reply to Greg Kroah-HartmanFrom: Mathias Nyman <[email protected]>
commit 576667bad341516edc4e18eb85acb0a2b4c9c9d9 upstream.
Once the command ring doorbell is rung the xHC controller will parse all command TRBs on the command ring that have the cycle bit set properly.
If the driver just started writing the next command TRB to the ring when hardware finished the previous TRB, then HW might fetch an incomplete TRB as long as its cycle bit set correctly.
A command TRB is 16 bytes (128 bits) long.
Driver writes the command TRB in four 32 bit chunks, with the chunk containing the cycle bit last. This does however not guarantee that chunks actually get written in that order.
This was detected in stress testing when canceling URBs with several connected USB devices.
Two consecutive "Set TR Dequeue pointer" commands got queued right after each other, and the second one was only partially written when the controller parsed it, causing the dequeue pointer to be set to bogus values. This was seen as error messages:
"Mismatch between completed Set TR Deq Ptr command & xHCI internal state"
Solution is to add a write memory barrier before writing the cycle bit.
--- drivers/usb/host/xhci-ring.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/host/xhci-ring.c +2 -0
@@ -2930,6 +2930,8 @@ static void queue_trb(struct xhci_hcd *x trb->field[0 ] =cpu_to_le32 (field1); trb->field[1 ] =cpu_to_le32 (field2); trb->field[2 ] =cpu_to_le32 (field3); +/* make sure TRB is fully written before giving it to the controller */ +wmb (); trb->field[3 ] =cpu_to_le32 (field4);trace_xhci_queue_trb (ring, trb);
Greg Kroah-Hartman
maintainerPATCH 101/199 platform/x86: hp-wmi: Dont log a warning on HPWMI_RET_UNKNOWN_COMMAND errors
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit d35c9a029a73e84d84337403d20b060494890570 ]
The recently added thermal policy support makes a hp_wmi_perform_query(0x4c, ...) call on older devices which do not support thermal policies this causes the following warning to be logged (seen on a HP Stream x360 Convertible PC 11):
[ 26.805305] hp_wmi: query 0x4c returned error 0x3
Error 0x3 is HPWMI_RET_UNKNOWN_COMMAND error. This commit silences the warning for unknown-command errors, silencing the new warning.
--- drivers/platform/x86/hp-wmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/hp-wmi.c +2 -1
@@ -247,7 +247,8 @@ static int hp_wmi_perform_query(int query, enum hp_wmi_command command, ret = bios_return->return_code;if (ret) { -if (ret !=HPWMI_RET_UNKNOWN_CMDTYPE ) +if (ret !=HPWMI_RET_UNKNOWN_COMMAND && + ret !=HPWMI_RET_UNKNOWN_CMDTYPE )pr_warn ("query 0x%x returned error 0x%x\n" , query, ret); goto out_free; }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 87/199 bpf: Prevent double bpf_prog_put call from bpf_tracing_prog_attach
In reply to Greg Kroah-HartmanFrom: Jiri Olsa <[email protected]>
[ Upstream commit 5541075a348b6ca6ac668653f7d2c423ae8e00b6 ]
The bpf_tracing_prog_attach error path calls bpf_prog_put on prog, which causes refcount underflow when it's called from link_create function.
link_create
prog = bpf_prog_get <-- get
...
tracing_bpf_link_attach(prog..
bpf_tracing_prog_attach(prog..
out_put_prog:
bpf_prog_put(prog); <-- put
if (ret < 0)
bpf_prog_put(prog); <-- put
Removing bpf_prog_put call from bpf_tracing_prog_attach and making sure its callers call it instead.
--- kernel/bpf/syscall.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
kernel/bpf/syscall.c +4 -2
@@ -2717,7 +2717,6 @@ out_unlock: out_put_prog:if (tgt_prog_fd && tgt_prog)bpf_prog_put (tgt_prog); -bpf_prog_put (prog);return err; }
@@ -2830,7 +2829,10 @@ static int bpf_raw_tracepoint_open(const union bpf_attr *attr) tp_name = prog->aux->attach_func_name;break ; } -return bpf_tracing_prog_attach (prog,0 ,0 ); + err =bpf_tracing_prog_attach (prog,0 ,0 ); +if (err >=0 ) +return err; + goto out_put_prog;case BPF_PROG_TYPE_RAW_TRACEPOINT :case BPF_PROG_TYPE_RAW_TRACEPOINT_WRITABLE : if (strncpy_from_user(buf,
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 63/199 HID: logitech-hidpp: Add product ID for MX Ergo in Bluetooth mode
In reply to Greg Kroah-HartmanFrom: Nicholas Miell <[email protected]>
[ Upstream commit 7de843dbaaa68aa514090e6226ed7c6374fd7e49 ]
The Logitech MX Ergo trackball supports HID++ 4.5 over Bluetooth. Add its product ID to the table so we can get battery monitoring support. (The hid-logitech-hidpp driver already recognizes it when connected via a Unifying Receiver.)
--- drivers/hid/hid-logitech-hidpp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hid-logitech-hidpp.c +2 -0
@@ -4051,6 +4051,8 @@ static const struct hid_device_id hidpp_devices[] = { {/* MX Master mouse over Bluetooth */ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb012), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, + { /* MX Ergo trackball over Bluetooth */ + HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01d) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 0xb01e), .driver_data = HIDPP_QUIRK_HI_RES_SCROLL_X2121 }, { /* MX Master 3 mouse over Bluetooth */
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 99/199 drm/vc4: Unify PCM cards driver_name
In reply to Greg Kroah-HartmanFrom: Nicolas Saenz Julienne <[email protected]>
[ Upstream commit 33c74535b03ecf11359de14bc88302595b1de44f ]
User-space ALSA matches a card's driver name against an internal list of aliases in order to select the correct configuration for the system. When the driver name isn't defined, the match is performed against the card's name.
With the introduction of RPi4 we now have two HDMI ports with two distinct audio cards. This is reflected in their names, making them different from previous RPi versions. With this, ALSA ultimately misses the board's configuration on RPi4.
In order to avoid this, set "card->driver_name" to "vc4-hdmi" unanimously.
--- drivers/gpu/drm/vc4/vc4_hdmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/vc4/vc4_hdmi.c +1 -0
@@ -1268,6 +1268,7 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) card->dai_link = dai_link; card->num_links =1 ; card->name = vc4_hdmi->variant->card_name; + card->driver_name ="vc4-hdmi" ; card->dev = dev; card->owner =THIS_MODULE ;
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 46/199 riscv: Fix kernel time_init()
In reply to Greg Kroah-HartmanFrom: Damien Le Moal <[email protected]>
[ Upstream commit 11f4c2e940e2f317c9d8fb5a79702f2a4a02ff98 ]
If of_clk_init() is not called in time_init(), clock providers defined in the system device tree are not initialized, resulting in failures for other devices to initialize due to missing clocks.
Similarly to other architectures and to the default kernel time_init() implementation, call of_clk_init() before executing timer_probe() in time_init().
--- arch/riscv/kernel/time.c | 3 +++ 1 file changed, 3 insertions(+)
arch/riscv/kernel/time.c +3 -0
@@ -4,6 +4,7 @@* Copyright (C) 2017 SiFive */ +#include <linux/of_clk.h> #include <linux/clocksource.h> #include <linux/delay.h> #include <asm/sbi.h>
@@ -24,6 +25,8 @@ void __init time_init(void) riscv_timebase = prop; lpj_fine = riscv_timebase /HZ ; + +of_clk_init (NULL );timer_probe (); }
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerPATCH 34/199 ASoC: Intel: haswell: Add missing pm_ops
In reply to Greg Kroah-HartmanFrom: Cezary Rojewski <[email protected]>
[ Upstream commit bb224c3e3e41d940612d4cc9573289cdbd5cb8f5 ]
haswell machine board is missing pm_ops what prevents it from undergoing suspend-resume procedure successfully. Assign default snd_soc_pm_ops so this is no longer the case.
--- sound/soc/intel/boards/haswell.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/boards/haswell.c +1 -0
@@ -189,6 +189,7 @@ static struct platform_driver haswell_audio = { .probe = haswell_audio_probe, .driver = { .name = "haswell-audio", + .pm = &snd_soc_pm_ops, }, };
Signature · 1 line
2.27.0
Greg Kroah-Hartman
maintainerQuoted 43 lines · Guenter Roeck
Quoted 25 lines · Daniel Díaz
Hello!
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.11 release. There are 199 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 27 Jan 2021 18:31:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Sanity results from Linaro’s test farm.
Regressions detected.[ ... ]
Quoted 12 lines
Errors look like the following:
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/tmp ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc' /builds/1nZbYji0zW0SkEnWMrDznWWzerI/arch/x86/kernel/cpu/amd.c: In function '
bsp_init_amd':
/builds/1nZbYji0zW0SkEnWMrDznWWzerI/arch/x86/kernel/cpu/amd.c:572:3: error: '__max_die_per_package' undeclared (first use in this function); did you mean 'topology_max_die_per_package'?572 | __max_die_per_package = nodes_per_socket = ((ecx >> 8) & 7) + 1; | ^~~~~~~~~~~~~~~~~~~~~ | topology_max_die_per_packageWill find out more soon.
This may be due to commit
76e2fc63ca40("x86/cpu/amd: Set__max_die_per_packageon AMD").
Quoted 7 lines
Our patches robot tells me:
SHA
76e2fc63ca40recursively fixed by:1eb8f690bcb5I don't see commit
1eb8f690bcb5("x86/topology: Make__max_die_per_packageavailable unconditionally") in the commit log. I have not checked, but it is at least possible that applying it fixes the problem.
Argh, the one time I don't run my "are there any fixes for the patches in the queue" script, and this pops up...
Thanks for this, turns out there's another patch missing as well. I'll be doing a -rc2 soon for two queues...
thanks,
greg k-h
Greg Kroah-Hartman
maintainerRe: [PATCH 5.10 119/199] x86/mmx: Use KFPU_387 for MMX string operations
In reply to Krzysztof OlędzkiQuoted 6 lines · Krzysztof Olędzki
Hi,
I think for both 5.4-stable and 5.10-stable we also need https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e45122893a9870813f9bd7b4add4f613e6f29008
- "x86/fpu: Addkernel_fpu_begin_mask()to selectively initialize state"Without this, there is no
kernel_fpu_begin_mask().
Thank you, I have now added this to both trees.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.11 release. There are 199 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 27 Jan 2021 18:31:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.10.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 16 lines · Shuah Khan
Quoted 15 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.10.11 release. There are 199 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 27 Jan 2021 18:31:44 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.11-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.10.y and the diffstat can be found below.
Quoted 9 lines
Quoted 4 lines
thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
Tested-by Shuah Khan <[email protected]>
Please ignore this. I tested rc2.
thanks,
-- Shuah