History

ASoC: Merge up fixes

Merge branch 'for-7.0' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-7.1 for both ASoC and general bug fixes to support testing.

Mark Brown committed 7 months ago

Commit 2a740dc2 parents 1e28cde 8ec017c403 files · +5213 −2083Browse files

Showing the changes to include/linux (12 of 403 files). Show all

Unified · Split

12 files
  1. include/linux/damon.h +6 −0
  2. include/linux/dma-mapping.h +13 −6
  3. include/linux/fs/super_types.h +1 −0
  4. include/linux/leafops.h +21 −11
  5. include/linux/mempolicy.h +1 −0
  6. include/linux/netfs.h +0 −1
  7. include/linux/pagemap.h +0 −11
  8. include/linux/security.h +1 −0
  9. include/linux/spi/spi.h +0 −5
  10. include/linux/srcutiny.h +4 −0
  11. include/linux/srcutree.h +5 −4
  12. include/linux/virtio_net.h +49 −4
include/linux/damon.h+6−0
@@ -810,6 +810,12 @@ struct damon_ctx { · 809 unmodified lines
810810 struct damos_walk_control *walk_control;
811811 struct mutex walk_control_lock;
812812
813+ /*
814+ * indicate if this may be corrupted. Currentonly this is set only for
815+ * damon_commit_ctx() failure.
816+ */
817+ bool maybe_corrupted;
818+
813819 /* Working thread of the given DAMON context */
814820 struct task_struct *kdamond;
815821 /* Protects @kdamond field access */
include/linux/dma-mapping.h+13−6
@@ -80,11 +80,18 @@ · 79 unmodified lines
8080 #define DMA_ATTR_MMIO (1UL << 10)
8181
8282 /*
83− * DMA_ATTR_CPU_CACHE_CLEAN: Indicates the CPU will not dirty any cacheline
84− * overlapping this buffer while it is mapped for DMA. All mappings sharing
85− * a cacheline must have this attribute for this to be considered safe.
83+ * DMA_ATTR_DEBUGGING_IGNORE_CACHELINES: Indicates the CPU cache line can be
84+ * overlapped. All mappings sharing a cacheline must have this attribute for
85+ * this to be considered safe.
8686 */
87−#define DMA_ATTR_CPU_CACHE_CLEAN (1UL << 11)
87+#define DMA_ATTR_DEBUGGING_IGNORE_CACHELINES (1UL << 11)
88+
89+/*
90+ * DMA_ATTR_REQUIRE_COHERENT: Indicates that DMA coherency is required.
91+ * All mappings that carry this attribute can't work with SWIOTLB and cache
92+ * flushing.
93+ */
94+#define DMA_ATTR_REQUIRE_COHERENT (1UL << 12)
8895
8996 /*
9097 * A dma_addr_t can hold any valid DMA or bus address for the platform. It can
@@ -248,8 +255,8 @@ static inline void *dma_alloc_attrs(struct device *dev, size_t size, · 157 unmodified lines
248255 {
249256 return NULL;
250257 }
251−static void dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
252− dma_addr_t dma_handle, unsigned long attrs)
258+static inline void dma_free_attrs(struct device *dev, size_t size,
259+ void *cpu_addr, dma_addr_t dma_handle, unsigned long attrs)
253260 {
254261 }
255262 static inline void *dmam_alloc_attrs(struct device *dev, size_t size,
include/linux/fs/super_types.h+1−0
@@ -338,5 +338,6 @@ struct super_block { · 337 unmodified lines
338338 #define SB_I_NOUMASK 0x00001000 /* VFS does not apply umask */
339339 #define SB_I_NOIDMAP 0x00002000 /* No idmapped mounts on this superblock */
340340 #define SB_I_ALLOW_HSM 0x00004000 /* Allow HSM events on this superblock */
341+#define SB_I_NO_DATA_INTEGRITY 0x00008000 /* fs cannot guarantee data persistence on sync */
341342
342343 #endif /* _LINUX_FS_SUPER_TYPES_H */
include/linux/leafops.h+21−11
@@ -363,6 +363,23 @@ static inline unsigned long softleaf_to_pfn(softleaf_t entry) · 362 unmodified lines
363363 return swp_offset(entry) & SWP_PFN_MASK;
364364 }
365365
366+static inline void softleaf_migration_sync(softleaf_t entry,
367+ struct folio *folio)
368+{
369+ /*
370+ * Ensure we do not race with split, which might alter tail pages into new
371+ * folios and thus result in observing an unlocked folio.
372+ * This matches the write barrier in __split_folio_to_order().
373+ */
374+ smp_rmb();
375+
376+ /*
377+ * Any use of migration entries may only occur while the
378+ * corresponding page is locked
379+ */
380+ VM_WARN_ON_ONCE(!folio_test_locked(folio));
381+}
382+
366383 /**
367384 * softleaf_to_page() - Obtains struct page for PFN encoded within leaf entry.
368385 * @entry: Leaf entry, softleaf_has_pfn(@entry) must return true.
@@ -374,11 +391,8 @@ static inline struct page *softleaf_to_page(softleaf_t entry) · 5 unmodified lines
374391 struct page *page = pfn_to_page(softleaf_to_pfn(entry));
375392
376393 VM_WARN_ON_ONCE(!softleaf_has_pfn(entry));
377− /*
378− * Any use of migration entries may only occur while the
379− * corresponding page is locked
380− */
381− VM_WARN_ON_ONCE(softleaf_is_migration(entry) && !PageLocked(page));
394+ if (softleaf_is_migration(entry))
395+ softleaf_migration_sync(entry, page_folio(page));
382396
383397 return page;
384398 }
@@ -394,12 +408,8 @@ static inline struct folio *softleaf_to_folio(softleaf_t entry) · 9 unmodified lines
394408 struct folio *folio = pfn_folio(softleaf_to_pfn(entry));
395409
396410 VM_WARN_ON_ONCE(!softleaf_has_pfn(entry));
397− /*
398− * Any use of migration entries may only occur while the
399− * corresponding folio is locked.
400− */
401− VM_WARN_ON_ONCE(softleaf_is_migration(entry) &&
402− !folio_test_locked(folio));
411+ if (softleaf_is_migration(entry))
412+ softleaf_migration_sync(entry, folio);
403413
404414 return folio;
405415 }
include/linux/mempolicy.h+1−0
@@ -55,6 +55,7 @@ struct mempolicy { · 54 unmodified lines
5555 nodemask_t cpuset_mems_allowed; /* relative to these nodes */
5656 nodemask_t user_nodemask; /* nodemask passed by user */
5757 } w;
58+ struct rcu_head rcu;
5859 };
5960
6061 /*
include/linux/netfs.h+0−1
@@ -140,7 +140,6 @@ struct netfs_io_stream { · 139 unmodified lines
140140 void (*issue_write)(struct netfs_io_subrequest *subreq);
141141 /* Collection tracking */
142142 struct list_head subrequests; /* Contributory I/O operations */
143− struct netfs_io_subrequest *front; /* Op being collected */
144143 unsigned long long collected_to; /* Position we've collected results to */
145144 size_t transferred; /* The amount transferred from this stream */
146145 unsigned short error; /* Aggregate error for the stream */
include/linux/pagemap.h+0−11
@@ -210,7 +210,6 @@ enum mapping_flags { · 209 unmodified lines
210210 AS_WRITEBACK_MAY_DEADLOCK_ON_RECLAIM = 9,
211211 AS_KERNEL_FILE = 10, /* mapping for a fake kernel file that shouldn't
212212 account usage to user cgroups */
213− AS_NO_DATA_INTEGRITY = 11, /* no data integrity guarantees */
214213 /* Bits 16-25 are used for FOLIO_ORDER */
215214 AS_FOLIO_ORDER_BITS = 5,
216215 AS_FOLIO_ORDER_MIN = 16,
@@ -346,16 +345,6 @@ static inline bool mapping_writeback_may_deadlock_on_reclaim(const struct addres · 129 unmodified lines
346345 return test_bit(AS_WRITEBACK_MAY_DEADLOCK_ON_RECLAIM, &mapping->flags);
347346 }
348347
349−static inline void mapping_set_no_data_integrity(struct address_space *mapping)
350−{
351− set_bit(AS_NO_DATA_INTEGRITY, &mapping->flags);
352−}
353−
354−static inline bool mapping_no_data_integrity(const struct address_space *mapping)
355−{
356− return test_bit(AS_NO_DATA_INTEGRITY, &mapping->flags);
357−}
358−
359348 static inline gfp_t mapping_gfp_mask(const struct address_space *mapping)
360349 {
361350 return mapping->gfp_mask;
include/linux/security.h+1−0
@@ -145,6 +145,7 @@ enum lockdown_reason { · 144 unmodified lines
145145 LOCKDOWN_BPF_WRITE_USER,
146146 LOCKDOWN_DBG_WRITE_KERNEL,
147147 LOCKDOWN_RTAS_ERROR_INJECTION,
148+ LOCKDOWN_XEN_USER_ACTIONS,
148149 LOCKDOWN_INTEGRITY_MAX,
149150 LOCKDOWN_KCORE,
150151 LOCKDOWN_KPROBES,
include/linux/spi/spi.h+0−5
@@ -159,10 +159,6 @@ extern void spi_transfer_cs_change_delay_exec(struct spi_message *msg, · 158 unmodified lines
159159 * @modalias: Name of the driver to use with this device, or an alias
160160 * for that name. This appears in the sysfs "modalias" attribute
161161 * for driver coldplugging, and in uevents used for hotplugging
162− * @driver_override: If the name of a driver is written to this attribute, then
163− * the device will bind to the named driver and only the named driver.
164− * Do not set directly, because core frees it; use driver_set_override() to
165− * set or clear it.
166162 * @pcpu_statistics: statistics for the spi_device
167163 * @word_delay: delay to be inserted between consecutive
168164 * words of a transfer
@@ -224,7 +220,6 @@ struct spi_device { · 55 unmodified lines
224220 void *controller_state;
225221 void *controller_data;
226222 char modalias[SPI_NAME_SIZE];
227− const char *driver_override;
228223
229224 /* The statistics */
230225 struct spi_statistics __percpu *pcpu_statistics;
include/linux/srcutiny.h+4−0
@@ -11,6 +11,7 @@ · 10 unmodified lines
1111 #ifndef _LINUX_SRCU_TINY_H
1212 #define _LINUX_SRCU_TINY_H
1313
14+#include <linux/irq_work_types.h>
1415 #include <linux/swait.h>
1516
1617 struct srcu_struct {
@@ -24,18 +25,21 @@ struct srcu_struct { · 7 unmodified lines
2425 struct rcu_head *srcu_cb_head; /* Pending callbacks: Head. */
2526 struct rcu_head **srcu_cb_tail; /* Pending callbacks: Tail. */
2627 struct work_struct srcu_work; /* For driving grace periods. */
28+ struct irq_work srcu_irq_work; /* Defer schedule_work() to irq work. */
2729 #ifdef CONFIG_DEBUG_LOCK_ALLOC
2830 struct lockdep_map dep_map;
2931 #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
3032 };
3133
3234 void srcu_drive_gp(struct work_struct *wp);
35+void srcu_tiny_irq_work(struct irq_work *irq_work);
3336
3437 #define __SRCU_STRUCT_INIT(name, __ignored, ___ignored, ____ignored) \
3538 { \
3639 .srcu_wq = __SWAIT_QUEUE_HEAD_INITIALIZER(name.srcu_wq), \
3740 .srcu_cb_tail = &name.srcu_cb_head, \
3841 .srcu_work = __WORK_INITIALIZER(name.srcu_work, srcu_drive_gp), \
42+ .srcu_irq_work = { .func = srcu_tiny_irq_work }, \
3943 __SRCU_DEP_MAP_INIT(name) \
4044 }
4145
include/linux/srcutree.h+5−4
@@ -34,7 +34,7 @@ struct srcu_data { · 33 unmodified lines
3434 /* Values: SRCU_READ_FLAVOR_.* */
3535
3636 /* Update-side state. */
37− spinlock_t __private lock ____cacheline_internodealigned_in_smp;
37+ raw_spinlock_t __private lock ____cacheline_internodealigned_in_smp;
3838 struct rcu_segcblist srcu_cblist; /* List of callbacks.*/
3939 unsigned long srcu_gp_seq_needed; /* Furthest future GP needed. */
4040 unsigned long srcu_gp_seq_needed_exp; /* Furthest future exp GP. */
@@ -55,7 +55,7 @@ struct srcu_data { · 14 unmodified lines
5555 * Node in SRCU combining tree, similar in function to rcu_data.
5656 */
5757 struct srcu_node {
58− spinlock_t __private lock;
58+ raw_spinlock_t __private lock;
5959 unsigned long srcu_have_cbs[4]; /* GP seq for children having CBs, but only */
6060 /* if greater than ->srcu_gp_seq. */
6161 unsigned long srcu_data_have_cbs[4]; /* Which srcu_data structs have CBs for given GP? */
@@ -74,7 +74,7 @@ struct srcu_usage { · 12 unmodified lines
7474 /* First node at each level. */
7575 int srcu_size_state; /* Small-to-big transition state. */
7676 struct mutex srcu_cb_mutex; /* Serialize CB preparation. */
77− spinlock_t __private lock; /* Protect counters and size state. */
77+ raw_spinlock_t __private lock; /* Protect counters and size state. */
7878 struct mutex srcu_gp_mutex; /* Serialize GP work. */
7979 unsigned long srcu_gp_seq; /* Grace-period seq #. */
8080 unsigned long srcu_gp_seq_needed; /* Latest gp_seq needed. */
@@ -95,6 +95,7 @@ struct srcu_usage { · 14 unmodified lines
9595 unsigned long reschedule_jiffies;
9696 unsigned long reschedule_count;
9797 struct delayed_work work;
98+ struct irq_work irq_work;
9899 struct srcu_struct *srcu_ssp;
99100 };
100101
@@ -156,7 +157,7 @@ struct srcu_struct { · 55 unmodified lines
156157
157158 #define __SRCU_USAGE_INIT(name) \
158159 { \
159− .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
160+ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
160161 .srcu_gp_seq = SRCU_GP_SEQ_INITIAL_VAL, \
161162 .srcu_gp_seq_needed = SRCU_GP_SEQ_INITIAL_VAL_WITH_STATE, \
162163 .srcu_gp_seq_needed_exp = SRCU_GP_SEQ_INITIAL_VAL, \
include/linux/virtio_net.h+49−4
@@ -207,6 +207,39 @@ static inline int virtio_net_hdr_to_skb(struct sk_buff *skb, · 206 unmodified lines
207207 return __virtio_net_hdr_to_skb(skb, hdr, little_endian, hdr->gso_type);
208208 }
209209
210+/* This function must be called after virtio_net_hdr_from_skb(). */
211+static inline void __virtio_net_set_hdrlen(const struct sk_buff *skb,
212+ struct virtio_net_hdr *hdr,
213+ bool little_endian)
214+{
215+ u16 hdr_len;
216+
217+ hdr_len = skb_transport_offset(skb);
218+
219+ if (hdr->gso_type == VIRTIO_NET_HDR_GSO_UDP_L4)
220+ hdr_len += sizeof(struct udphdr);
221+ else
222+ hdr_len += tcp_hdrlen(skb);
223+
224+ hdr->hdr_len = __cpu_to_virtio16(little_endian, hdr_len);
225+}
226+
227+/* This function must be called after virtio_net_hdr_from_skb(). */
228+static inline void __virtio_net_set_tnl_hdrlen(const struct sk_buff *skb,
229+ struct virtio_net_hdr *hdr)
230+{
231+ u16 hdr_len;
232+
233+ hdr_len = skb_inner_transport_offset(skb);
234+
235+ if (hdr->gso_type == VIRTIO_NET_HDR_GSO_UDP_L4)
236+ hdr_len += sizeof(struct udphdr);
237+ else
238+ hdr_len += inner_tcp_hdrlen(skb);
239+
240+ hdr->hdr_len = __cpu_to_virtio16(true, hdr_len);
241+}
242+
210243 static inline int virtio_net_hdr_from_skb(const struct sk_buff *skb,
211244 struct virtio_net_hdr *hdr,
212245 bool little_endian,
@@ -385,7 +418,8 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb, · 172 unmodified lines
385418 bool tnl_hdr_negotiated,
386419 bool little_endian,
387420 int vlan_hlen,
388− bool has_data_valid)
421+ bool has_data_valid,
422+ bool feature_hdrlen)
389423 {
390424 struct virtio_net_hdr *hdr = (struct virtio_net_hdr *)vhdr;
391425 unsigned int inner_nh, outer_th;
@@ -394,9 +428,17 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb, · 2 unmodified lines
394428
395429 tnl_gso_type = skb_shinfo(skb)->gso_type & (SKB_GSO_UDP_TUNNEL |
396430 SKB_GSO_UDP_TUNNEL_CSUM);
397− if (!tnl_gso_type)
398− return virtio_net_hdr_from_skb(skb, hdr, little_endian,
399− has_data_valid, vlan_hlen);
431+ if (!tnl_gso_type) {
432+ ret = virtio_net_hdr_from_skb(skb, hdr, little_endian,
433+ has_data_valid, vlan_hlen);
434+ if (ret)
435+ return ret;
436+
437+ if (feature_hdrlen && hdr->hdr_len)
438+ __virtio_net_set_hdrlen(skb, hdr, little_endian);
439+
440+ return ret;
441+ }
400442
401443 /* Tunnel support not negotiated but skb ask for it. */
402444 if (!tnl_hdr_negotiated)
@@ -414,6 +456,9 @@ virtio_net_hdr_tnl_from_skb(const struct sk_buff *skb, · 11 unmodified lines
414456 if (ret)
415457 return ret;
416458
459+ if (feature_hdrlen && hdr->hdr_len)
460+ __virtio_net_set_tnl_hdrlen(skb, hdr);
461+
417462 if (skb->protocol == htons(ETH_P_IPV6))
418463 hdr->gso_type |= VIRTIO_NET_HDR_GSO_UDP_TUNNEL_IPV6;
419464 else