From: Greg Kroah-Hartman Date: Mon, 24 May 2021 09:01:12 +0000 (+0200) Subject: 5.10-stable patches X-Git-Tag: v4.4.270~59 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fd55fb9aaa51783e4dbf51b2378d1a37f7f31022;p=thirdparty%2Fkernel%2Fstable-queue.git 5.10-stable patches added patches: alsa-dice-fix-stream-format-at-middle-sampling-rate-for-alesis-io-26.patch alsa-dice-fix-stream-format-for-tc-electronic-konnekt-live-at-high-sampling-transfer-frequency.patch alsa-firewire-lib-fix-amdtp_packet-tracepoints-event-for-packet_index-field.patch alsa-intel8x0-don-t-update-period-unless-prepared.patch alsa-line6-fix-racy-initialization-of-line6-midi.patch btrfs-avoid-rcu-stalls-while-running-delayed-iputs.patch cifs-fix-memory-leak-in-smb2_copychunk_range.patch misc-eeprom-at24-check-suspend-status-before-disable-regulator.patch --- diff --git a/queue-5.10/alsa-dice-fix-stream-format-at-middle-sampling-rate-for-alesis-io-26.patch b/queue-5.10/alsa-dice-fix-stream-format-at-middle-sampling-rate-for-alesis-io-26.patch new file mode 100644 index 00000000000..119af0d4027 --- /dev/null +++ b/queue-5.10/alsa-dice-fix-stream-format-at-middle-sampling-rate-for-alesis-io-26.patch @@ -0,0 +1,39 @@ +From 1b6604896e78969baffc1b6cc6bc175f95929ac4 Mon Sep 17 00:00:00 2001 +From: Takashi Sakamoto +Date: Thu, 13 May 2021 21:56:48 +0900 +Subject: ALSA: dice: fix stream format at middle sampling rate for Alesis iO 26 + +From: Takashi Sakamoto + +commit 1b6604896e78969baffc1b6cc6bc175f95929ac4 upstream. + +Alesis iO 26 FireWire has two pairs of digital optical interface. It +delivers PCM frames from the interfaces by second isochronous packet +streaming. Although both of the interfaces are available at 44.1/48.0 +kHz, first one of them is only available at 88.2/96.0 kHz. It reduces +the number of PCM samples to 4 in Multi Bit Linear Audio data channel +of data blocks on the second isochronous packet streaming. + +This commit fixes hardcoded stream formats. + +Cc: +Fixes: 28b208f600a3 ("ALSA: dice: add parameters of stream formats for models produced by Alesis") +Signed-off-by: Takashi Sakamoto +Link: https://lore.kernel.org/r/20210513125652.110249-2-o-takashi@sakamocchi.jp +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/firewire/dice/dice-alesis.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/sound/firewire/dice/dice-alesis.c ++++ b/sound/firewire/dice/dice-alesis.c +@@ -16,7 +16,7 @@ alesis_io14_tx_pcm_chs[MAX_STREAMS][SND_ + static const unsigned int + alesis_io26_tx_pcm_chs[MAX_STREAMS][SND_DICE_RATE_MODE_COUNT] = { + {10, 10, 4}, /* Tx0 = Analog + S/PDIF. */ +- {16, 8, 0}, /* Tx1 = ADAT1 + ADAT2. */ ++ {16, 4, 0}, /* Tx1 = ADAT1 + ADAT2 (available at low rate). */ + }; + + int snd_dice_detect_alesis_formats(struct snd_dice *dice) diff --git a/queue-5.10/alsa-dice-fix-stream-format-for-tc-electronic-konnekt-live-at-high-sampling-transfer-frequency.patch b/queue-5.10/alsa-dice-fix-stream-format-for-tc-electronic-konnekt-live-at-high-sampling-transfer-frequency.patch new file mode 100644 index 00000000000..4367366079f --- /dev/null +++ b/queue-5.10/alsa-dice-fix-stream-format-for-tc-electronic-konnekt-live-at-high-sampling-transfer-frequency.patch @@ -0,0 +1,37 @@ +From 4c6fe8c547e3c9e8c15dabdd23c569ee0df3adb1 Mon Sep 17 00:00:00 2001 +From: Takashi Sakamoto +Date: Tue, 18 May 2021 10:26:12 +0900 +Subject: ALSA: dice: fix stream format for TC Electronic Konnekt Live at high sampling transfer frequency + +From: Takashi Sakamoto + +commit 4c6fe8c547e3c9e8c15dabdd23c569ee0df3adb1 upstream. + +At high sampling transfer frequency, TC Electronic Konnekt Live +transfers/receives 6 audio data frames in multi bit linear audio data +channel of data block in CIP payload. Current hard-coded stream format +is wrong. + +Cc: +Fixes: f1f0f330b1d0 ("ALSA: dice: add parameters of stream formats for models produced by TC Electronic") +Signed-off-by: Takashi Sakamoto +Link: https://lore.kernel.org/r/20210518012612.37268-1-o-takashi@sakamocchi.jp +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/firewire/dice/dice-tcelectronic.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/sound/firewire/dice/dice-tcelectronic.c ++++ b/sound/firewire/dice/dice-tcelectronic.c +@@ -38,8 +38,8 @@ static const struct dice_tc_spec konnekt + }; + + static const struct dice_tc_spec konnekt_live = { +- .tx_pcm_chs = {{16, 16, 16}, {0, 0, 0} }, +- .rx_pcm_chs = {{16, 16, 16}, {0, 0, 0} }, ++ .tx_pcm_chs = {{16, 16, 6}, {0, 0, 0} }, ++ .rx_pcm_chs = {{16, 16, 6}, {0, 0, 0} }, + .has_midi = true, + }; + diff --git a/queue-5.10/alsa-firewire-lib-fix-amdtp_packet-tracepoints-event-for-packet_index-field.patch b/queue-5.10/alsa-firewire-lib-fix-amdtp_packet-tracepoints-event-for-packet_index-field.patch new file mode 100644 index 00000000000..2fb8ccaffeb --- /dev/null +++ b/queue-5.10/alsa-firewire-lib-fix-amdtp_packet-tracepoints-event-for-packet_index-field.patch @@ -0,0 +1,116 @@ +From 814b43127f4ac69332e809152e30773941438aff Mon Sep 17 00:00:00 2001 +From: Takashi Sakamoto +Date: Thu, 13 May 2021 21:56:52 +0900 +Subject: ALSA: firewire-lib: fix amdtp_packet tracepoints event for packet_index field + +From: Takashi Sakamoto + +commit 814b43127f4ac69332e809152e30773941438aff upstream. + +The snd_firewire_lib:amdtp_packet tracepoints event includes index of +packet processed in a context handling. However in IR context, it is not +calculated as expected. + +Cc: +Fixes: 753e717986c2 ("ALSA: firewire-lib: use packet descriptor for IR context") +Signed-off-by: Takashi Sakamoto +Link: https://lore.kernel.org/r/20210513125652.110249-6-o-takashi@sakamocchi.jp +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/firewire/amdtp-stream-trace.h | 6 +++--- + sound/firewire/amdtp-stream.c | 15 +++++++++------ + 2 files changed, 12 insertions(+), 9 deletions(-) + +--- a/sound/firewire/amdtp-stream-trace.h ++++ b/sound/firewire/amdtp-stream-trace.h +@@ -14,8 +14,8 @@ + #include + + TRACE_EVENT(amdtp_packet, +- TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int data_blocks, unsigned int data_block_counter, unsigned int index), +- TP_ARGS(s, cycles, cip_header, payload_length, data_blocks, data_block_counter, index), ++ TP_PROTO(const struct amdtp_stream *s, u32 cycles, const __be32 *cip_header, unsigned int payload_length, unsigned int data_blocks, unsigned int data_block_counter, unsigned int packet_index, unsigned int index), ++ TP_ARGS(s, cycles, cip_header, payload_length, data_blocks, data_block_counter, packet_index, index), + TP_STRUCT__entry( + __field(unsigned int, second) + __field(unsigned int, cycle) +@@ -48,7 +48,7 @@ TRACE_EVENT(amdtp_packet, + __entry->payload_quadlets = payload_length / sizeof(__be32); + __entry->data_blocks = data_blocks; + __entry->data_block_counter = data_block_counter, +- __entry->packet_index = s->packet_index; ++ __entry->packet_index = packet_index; + __entry->irq = !!in_interrupt(); + __entry->index = index; + ), +--- a/sound/firewire/amdtp-stream.c ++++ b/sound/firewire/amdtp-stream.c +@@ -526,7 +526,7 @@ static void build_it_pkt_header(struct a + } + + trace_amdtp_packet(s, cycle, cip_header, payload_length, data_blocks, +- data_block_counter, index); ++ data_block_counter, s->packet_index, index); + } + + static int check_cip_header(struct amdtp_stream *s, const __be32 *buf, +@@ -630,7 +630,7 @@ static int parse_ir_ctx_header(struct am + unsigned int *payload_length, + unsigned int *data_blocks, + unsigned int *data_block_counter, +- unsigned int *syt, unsigned int index) ++ unsigned int *syt, unsigned int packet_index, unsigned int index) + { + const __be32 *cip_header; + int err; +@@ -662,7 +662,7 @@ static int parse_ir_ctx_header(struct am + } + + trace_amdtp_packet(s, cycle, cip_header, *payload_length, *data_blocks, +- *data_block_counter, index); ++ *data_block_counter, packet_index, index); + + return err; + } +@@ -701,12 +701,13 @@ static int generate_device_pkt_descs(str + unsigned int packets) + { + unsigned int dbc = s->data_block_counter; ++ unsigned int packet_index = s->packet_index; ++ unsigned int queue_size = s->queue_size; + int i; + int err; + + for (i = 0; i < packets; ++i) { + struct pkt_desc *desc = descs + i; +- unsigned int index = (s->packet_index + i) % s->queue_size; + unsigned int cycle; + unsigned int payload_length; + unsigned int data_blocks; +@@ -715,7 +716,7 @@ static int generate_device_pkt_descs(str + cycle = compute_cycle_count(ctx_header[1]); + + err = parse_ir_ctx_header(s, cycle, ctx_header, &payload_length, +- &data_blocks, &dbc, &syt, i); ++ &data_blocks, &dbc, &syt, packet_index, i); + if (err < 0) + return err; + +@@ -723,13 +724,15 @@ static int generate_device_pkt_descs(str + desc->syt = syt; + desc->data_blocks = data_blocks; + desc->data_block_counter = dbc; +- desc->ctx_payload = s->buffer.packets[index].buffer; ++ desc->ctx_payload = s->buffer.packets[packet_index].buffer; + + if (!(s->flags & CIP_DBC_IS_END_EVENT)) + dbc = (dbc + desc->data_blocks) & 0xff; + + ctx_header += + s->ctx_data.tx.ctx_header_size / sizeof(*ctx_header); ++ ++ packet_index = (packet_index + 1) % queue_size; + } + + s->data_block_counter = dbc; diff --git a/queue-5.10/alsa-intel8x0-don-t-update-period-unless-prepared.patch b/queue-5.10/alsa-intel8x0-don-t-update-period-unless-prepared.patch new file mode 100644 index 00000000000..970307384d2 --- /dev/null +++ b/queue-5.10/alsa-intel8x0-don-t-update-period-unless-prepared.patch @@ -0,0 +1,72 @@ +From c1f0616124c455c5c762b6f123e40bba5df759e6 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Sun, 16 May 2021 18:17:55 +0200 +Subject: ALSA: intel8x0: Don't update period unless prepared + +From: Takashi Iwai + +commit c1f0616124c455c5c762b6f123e40bba5df759e6 upstream. + +The interrupt handler of intel8x0 calls snd_intel8x0_update() whenever +the hardware sets the corresponding status bit for each stream. This +works fine for most cases as long as the hardware behaves properly. +But when the hardware gives a wrong bit set, this leads to a zero- +division Oops, and reportedly, this seems what happened on a VM. + +For fixing the crash, this patch adds a internal flag indicating that +the stream is ready to be updated, and check it (as well as the flag +being in suspended) to ignore such spurious update. + +Cc: +Reported-and-tested-by: Sergey Senozhatsky +Link: https://lore.kernel.org/r/s5h5yzi7uh0.wl-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/pci/intel8x0.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/sound/pci/intel8x0.c ++++ b/sound/pci/intel8x0.c +@@ -354,6 +354,7 @@ struct ichdev { + unsigned int ali_slot; /* ALI DMA slot */ + struct ac97_pcm *pcm; + int pcm_open_flag; ++ unsigned int prepared:1; + unsigned int suspended: 1; + }; + +@@ -714,6 +715,9 @@ static inline void snd_intel8x0_update(s + int status, civ, i, step; + int ack = 0; + ++ if (!ichdev->prepared || ichdev->suspended) ++ return; ++ + spin_lock_irqsave(&chip->reg_lock, flags); + status = igetbyte(chip, port + ichdev->roff_sr); + civ = igetbyte(chip, port + ICH_REG_OFF_CIV); +@@ -904,6 +908,7 @@ static int snd_intel8x0_hw_params(struct + if (ichdev->pcm_open_flag) { + snd_ac97_pcm_close(ichdev->pcm); + ichdev->pcm_open_flag = 0; ++ ichdev->prepared = 0; + } + err = snd_ac97_pcm_open(ichdev->pcm, params_rate(hw_params), + params_channels(hw_params), +@@ -925,6 +930,7 @@ static int snd_intel8x0_hw_free(struct s + if (ichdev->pcm_open_flag) { + snd_ac97_pcm_close(ichdev->pcm); + ichdev->pcm_open_flag = 0; ++ ichdev->prepared = 0; + } + return 0; + } +@@ -999,6 +1005,7 @@ static int snd_intel8x0_pcm_prepare(stru + ichdev->pos_shift = (runtime->sample_bits > 16) ? 2 : 1; + } + snd_intel8x0_setup_periods(chip, ichdev); ++ ichdev->prepared = 1; + return 0; + } + diff --git a/queue-5.10/alsa-line6-fix-racy-initialization-of-line6-midi.patch b/queue-5.10/alsa-line6-fix-racy-initialization-of-line6-midi.patch new file mode 100644 index 00000000000..b1bd808ffcc --- /dev/null +++ b/queue-5.10/alsa-line6-fix-racy-initialization-of-line6-midi.patch @@ -0,0 +1,85 @@ +From 05ca447630334c323c9e2b788b61133ab75d60d3 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Tue, 18 May 2021 10:39:39 +0200 +Subject: ALSA: line6: Fix racy initialization of LINE6 MIDI + +From: Takashi Iwai + +commit 05ca447630334c323c9e2b788b61133ab75d60d3 upstream. + +The initialization of MIDI devices that are found on some LINE6 +drivers are currently done in a racy way; namely, the MIDI buffer +instance is allocated and initialized in each private_init callback +while the communication with the interface is already started via +line6_init_cap_control() call before that point. This may lead to +Oops in line6_data_received() when a spurious event is received, as +reported by syzkaller. + +This patch moves the MIDI initialization to line6_init_cap_control() +as well instead of the too-lately-called private_init for avoiding the +race. Also this reduces slightly more lines, so it's a win-win +change. + +Reported-by: syzbot+0d2b3feb0a2887862e06@syzkallerlkml..appspotmail.com +Link: https://lore.kernel.org/r/000000000000a4be9405c28520de@google.com +Link: https://lore.kernel.org/r/20210517132725.GA50495@hyeyoo +Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com> +Cc: +Link: https://lore.kernel.org/r/20210518083939.1927-1-tiwai@suse.de +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman +--- + sound/usb/line6/driver.c | 4 ++++ + sound/usb/line6/pod.c | 5 ----- + sound/usb/line6/variax.c | 6 ------ + 3 files changed, 4 insertions(+), 11 deletions(-) + +--- a/sound/usb/line6/driver.c ++++ b/sound/usb/line6/driver.c +@@ -699,6 +699,10 @@ static int line6_init_cap_control(struct + line6->buffer_message = kmalloc(LINE6_MIDI_MESSAGE_MAXLEN, GFP_KERNEL); + if (!line6->buffer_message) + return -ENOMEM; ++ ++ ret = line6_init_midi(line6); ++ if (ret < 0) ++ return ret; + } else { + ret = line6_hwdep_init(line6); + if (ret < 0) +--- a/sound/usb/line6/pod.c ++++ b/sound/usb/line6/pod.c +@@ -376,11 +376,6 @@ static int pod_init(struct usb_line6 *li + if (err < 0) + return err; + +- /* initialize MIDI subsystem: */ +- err = line6_init_midi(line6); +- if (err < 0) +- return err; +- + /* initialize PCM subsystem: */ + err = line6_init_pcm(line6, &pod_pcm_properties); + if (err < 0) +--- a/sound/usb/line6/variax.c ++++ b/sound/usb/line6/variax.c +@@ -159,7 +159,6 @@ static int variax_init(struct usb_line6 + const struct usb_device_id *id) + { + struct usb_line6_variax *variax = line6_to_variax(line6); +- int err; + + line6->process_message = line6_variax_process_message; + line6->disconnect = line6_variax_disconnect; +@@ -172,11 +171,6 @@ static int variax_init(struct usb_line6 + if (variax->buffer_activate == NULL) + return -ENOMEM; + +- /* initialize MIDI subsystem: */ +- err = line6_init_midi(&variax->line6); +- if (err < 0) +- return err; +- + /* initiate startup procedure: */ + schedule_delayed_work(&line6->startup_work, + msecs_to_jiffies(VARIAX_STARTUP_DELAY1)); diff --git a/queue-5.10/btrfs-avoid-rcu-stalls-while-running-delayed-iputs.patch b/queue-5.10/btrfs-avoid-rcu-stalls-while-running-delayed-iputs.patch new file mode 100644 index 00000000000..c57e7b6ffa3 --- /dev/null +++ b/queue-5.10/btrfs-avoid-rcu-stalls-while-running-delayed-iputs.patch @@ -0,0 +1,76 @@ +From 71795ee590111e3636cc3c148289dfa9fa0a5fc3 Mon Sep 17 00:00:00 2001 +From: Josef Bacik +Date: Thu, 29 Apr 2021 10:51:34 -0400 +Subject: btrfs: avoid RCU stalls while running delayed iputs + +From: Josef Bacik + +commit 71795ee590111e3636cc3c148289dfa9fa0a5fc3 upstream. + +Generally a delayed iput is added when we might do the final iput, so +usually we'll end up sleeping while processing the delayed iputs +naturally. However there's no guarantee of this, especially for small +files. In production we noticed 5 instances of RCU stalls while testing +a kernel release overnight across 1000 machines, so this is relatively +common: + + host count: 5 + rcu: INFO: rcu_sched self-detected stall on CPU + rcu: ....: (20998 ticks this GP) idle=59e/1/0x4000000000000002 softirq=12333372/12333372 fqs=3208 + (t=21031 jiffies g=27810193 q=41075) NMI backtrace for cpu 1 + CPU: 1 PID: 1713 Comm: btrfs-cleaner Kdump: loaded Not tainted 5.6.13-0_fbk12_rc1_5520_gec92bffc1ec9 #1 + Call Trace: + dump_stack+0x50/0x70 + nmi_cpu_backtrace.cold.6+0x30/0x65 + ? lapic_can_unplug_cpu.cold.30+0x40/0x40 + nmi_trigger_cpumask_backtrace+0xba/0xca + rcu_dump_cpu_stacks+0x99/0xc7 + rcu_sched_clock_irq.cold.90+0x1b2/0x3a3 + ? trigger_load_balance+0x5c/0x200 + ? tick_sched_do_timer+0x60/0x60 + ? tick_sched_do_timer+0x60/0x60 + update_process_times+0x24/0x50 + tick_sched_timer+0x37/0x70 + __hrtimer_run_queues+0xfe/0x270 + hrtimer_interrupt+0xf4/0x210 + smp_apic_timer_interrupt+0x5e/0x120 + apic_timer_interrupt+0xf/0x20 + RIP: 0010:queued_spin_lock_slowpath+0x17d/0x1b0 + RSP: 0018:ffffc9000da5fe48 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 + RAX: 0000000000000000 RBX: ffff889fa81d0cd8 RCX: 0000000000000029 + RDX: ffff889fff86c0c0 RSI: 0000000000080000 RDI: ffff88bfc2da7200 + RBP: ffff888f2dcdd768 R08: 0000000001040000 R09: 0000000000000000 + R10: 0000000000000001 R11: ffffffff82a55560 R12: ffff88bfc2da7200 + R13: 0000000000000000 R14: ffff88bff6c2a360 R15: ffffffff814bd870 + ? kzalloc.constprop.57+0x30/0x30 + list_lru_add+0x5a/0x100 + inode_lru_list_add+0x20/0x40 + iput+0x1c1/0x1f0 + run_delayed_iput_locked+0x46/0x90 + btrfs_run_delayed_iputs+0x3f/0x60 + cleaner_kthread+0xf2/0x120 + kthread+0x10b/0x130 + +Fix this by adding a cond_resched_lock() to the loop processing delayed +iputs so we can avoid these sort of stalls. + +CC: stable@vger.kernel.org # 4.9+ +Reviewed-by: Rik van Riel +Signed-off-by: Josef Bacik +Reviewed-by: David Sterba +Signed-off-by: David Sterba +Signed-off-by: Greg Kroah-Hartman +--- + fs/btrfs/inode.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/fs/btrfs/inode.c ++++ b/fs/btrfs/inode.c +@@ -2967,6 +2967,7 @@ void btrfs_run_delayed_iputs(struct btrf + inode = list_first_entry(&fs_info->delayed_iputs, + struct btrfs_inode, delayed_iput); + run_delayed_iput_locked(fs_info, inode); ++ cond_resched_lock(&fs_info->delayed_iput_lock); + } + spin_unlock(&fs_info->delayed_iput_lock); + } diff --git a/queue-5.10/cifs-fix-memory-leak-in-smb2_copychunk_range.patch b/queue-5.10/cifs-fix-memory-leak-in-smb2_copychunk_range.patch new file mode 100644 index 00000000000..3aad119d745 --- /dev/null +++ b/queue-5.10/cifs-fix-memory-leak-in-smb2_copychunk_range.patch @@ -0,0 +1,36 @@ +From d201d7631ca170b038e7f8921120d05eec70d7c5 Mon Sep 17 00:00:00 2001 +From: Ronnie Sahlberg +Date: Wed, 19 May 2021 08:40:11 +1000 +Subject: cifs: fix memory leak in smb2_copychunk_range + +From: Ronnie Sahlberg + +commit d201d7631ca170b038e7f8921120d05eec70d7c5 upstream. + +When using smb2_copychunk_range() for large ranges we will +run through several iterations of a loop calling SMB2_ioctl() +but never actually free the returned buffer except for the final +iteration. +This leads to memory leaks everytime a large copychunk is requested. + +Fixes: 9bf0c9cd4314 ("CIFS: Fix SMB2/SMB3 Copy offload support (refcopy) for large files") +Cc: +Reviewed-by: Aurelien Aptel +Signed-off-by: Ronnie Sahlberg +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/smb2ops.c | 2 ++ + 1 file changed, 2 insertions(+) + +--- a/fs/cifs/smb2ops.c ++++ b/fs/cifs/smb2ops.c +@@ -1764,6 +1764,8 @@ smb2_copychunk_range(const unsigned int + cpu_to_le32(min_t(u32, len, tcon->max_bytes_chunk)); + + /* Request server copy to target from src identified by key */ ++ kfree(retbuf); ++ retbuf = NULL; + rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid, + trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE, + true /* is_fsctl */, (char *)pcchunk, diff --git a/queue-5.10/misc-eeprom-at24-check-suspend-status-before-disable-regulator.patch b/queue-5.10/misc-eeprom-at24-check-suspend-status-before-disable-regulator.patch new file mode 100644 index 00000000000..7623d40a07f --- /dev/null +++ b/queue-5.10/misc-eeprom-at24-check-suspend-status-before-disable-regulator.patch @@ -0,0 +1,45 @@ +From 2962484dfef8dbb7f9059822bc26ce8a04d0e47c Mon Sep 17 00:00:00 2001 +From: Hsin-Yi Wang +Date: Tue, 20 Apr 2021 21:30:50 +0800 +Subject: misc: eeprom: at24: check suspend status before disable regulator + +From: Hsin-Yi Wang + +commit 2962484dfef8dbb7f9059822bc26ce8a04d0e47c upstream. + +cd5676db0574 ("misc: eeprom: at24: support pm_runtime control") disables +regulator in runtime suspend. If runtime suspend is called before +regulator disable, it will results in regulator unbalanced disabling. + +Fixes: cd5676db0574 ("misc: eeprom: at24: support pm_runtime control") +Cc: stable +Acked-by: Bartosz Golaszewski +Signed-off-by: Hsin-Yi Wang +Link: https://lore.kernel.org/r/20210420133050.377209-1-hsinyi@chromium.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/misc/eeprom/at24.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/misc/eeprom/at24.c ++++ b/drivers/misc/eeprom/at24.c +@@ -763,7 +763,8 @@ static int at24_probe(struct i2c_client + at24->nvmem = devm_nvmem_register(dev, &nvmem_config); + if (IS_ERR(at24->nvmem)) { + pm_runtime_disable(dev); +- regulator_disable(at24->vcc_reg); ++ if (!pm_runtime_status_suspended(dev)) ++ regulator_disable(at24->vcc_reg); + return PTR_ERR(at24->nvmem); + } + +@@ -774,7 +775,8 @@ static int at24_probe(struct i2c_client + err = at24_read(at24, 0, &test_byte, 1); + if (err) { + pm_runtime_disable(dev); +- regulator_disable(at24->vcc_reg); ++ if (!pm_runtime_status_suspended(dev)) ++ regulator_disable(at24->vcc_reg); + return -ENODEV; + } + diff --git a/queue-5.10/series b/queue-5.10/series index 0bd2ae9e457..713d7887a91 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -28,3 +28,11 @@ perf-x86-avoid-touching-lbr_tos-msr-for-arch-lbr.patch locking-lockdep-correct-calling-tracepoints.patch locking-mutex-clear-mutex_flags-if-wait_list-is-empt.patch powerpc-fix-early-setup-to-make-early_ioremap-work.patch +btrfs-avoid-rcu-stalls-while-running-delayed-iputs.patch +cifs-fix-memory-leak-in-smb2_copychunk_range.patch +misc-eeprom-at24-check-suspend-status-before-disable-regulator.patch +alsa-dice-fix-stream-format-for-tc-electronic-konnekt-live-at-high-sampling-transfer-frequency.patch +alsa-intel8x0-don-t-update-period-unless-prepared.patch +alsa-firewire-lib-fix-amdtp_packet-tracepoints-event-for-packet_index-field.patch +alsa-line6-fix-racy-initialization-of-line6-midi.patch +alsa-dice-fix-stream-format-at-middle-sampling-rate-for-alesis-io-26.patch