Skip to content

spacewar: 6.17 rebase#14

Open
fekz115 wants to merge 12 commits into
sc7280-mainline:sc7280-6.17.yfrom
mainlining:fekz115/spacewar-6.17-rebase
Open

spacewar: 6.17 rebase#14
fekz115 wants to merge 12 commits into
sc7280-mainline:sc7280-6.17.yfrom
mainlining:fekz115/spacewar-6.17-rebase

Conversation

@fekz115

@fekz115 fekz115 commented Oct 11, 2025

Copy link
Copy Markdown

Here is actual changes for nothing-spacewar. I created this PR as we have plan to merge our pmaports to postmarketos upstream.

  • new focaltech driver wip, but actually working
  • wcd938x driver wip, microphone doesn't work
  • sony imx471 works
  • samsung s5kjn1 works
  • tfa987x (tfa9873) works as driver allows(no TPM and other features)

@fekz115 fekz115 force-pushed the fekz115/spacewar-6.17-rebase branch 7 times, most recently from 659a8ef to 7b449ba Compare October 11, 2025 18:13
N1kroks and others added 11 commits October 11, 2025 21:15
DW9800 is a 10 bit DAC from Dongwoon, designed for linear
control of voice coil motor.

This driver creates a V4L2 subdevice and
provides control to set the desired focus.

Signed-off-by: Vitalii Skorkin <nikroksm@mail.ru>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Add support for ak7377 VCM, which has 10-bit position values, requiring
a shift of 6 bits. It also has a different standby mode setting (0x10
instead of 0x40) and a significantly longer control delay. The maximum
focus position is 1023, and the control step count is increased to 100.

Tested on sm7325-nothing-spacewar phone.

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
It appears to sometimes take longer than two seconds for the tx_sdw_dev
to appear, to increase the timeout.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Signed-off-by: Eugene Lepshy <fekz115@gmail.com>
…r from DS

This is some preparation for rewriting the driver:
- Drop downstream pinctrl, point report check, gesture, pen, ESD, drm
notifier implementation
- Drop unused code
- Drop old firmware files
- Switch to tabs in main files
- Refactor regulators & reset gpio implementation
- Drop FTS macros & use kernel log func calls
- And other minor changes...

Signed-off-by: Danila Tikhonov <danila@jiaxyga.com>
Co-developed-by: Eugene Lepshy <fekz115@gmail.com>
Signed-off-by: Eugene Lepshy <fekz115@gmail.com>
* pkt_per_line will be equal to slice per intf for now.
*/
pkt_per_line = slice_per_intf;
pkt_per_line = slice_per_intf * 2; // HACK

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you guard this under of_machine_is_compatible("nothing,spacewar")?

I assume https://lore.kernel.org/linux-arm-msm/20251001135914.13754-3-caojunjie650@gmail.com/ would be the proper fix? Do you know anything about that?

Comment thread drivers/media/i2c/Kconfig

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try if dongwoon,dw9800k (on the lists, but also in sc7280 6.17.y branch) works instead? Then we can drop this custom dw9800 driver.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not sure if this version or https://lore.kernel.org/linux-arm-msm/20251009-ak7377-driver-v1-2-29e4f6e16ed3@fairphone.com/ is more correct. Do you have any extra insights there?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JIaxyga Do you have any input here?

compatible = "qcom,sm7325-lpassaudiocc",
"qcom,qcm6490-lpassaudiocc";
/delete-property/ power-domains;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/delete-property/ power-domains;
};

&lpass_cpu { status = "disabled"; };

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is already disabled in sc7280.dtsi?


&lpass_dmic23_data {
bias-pull-down;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unsure whether all this stuff, not just dmic should go into sm7325.dtsi or into the device itself.

It's per-se not really sm7325-specific, when an SM7325 device gets an Android 16 upgrade (looks like the Nothing phone 1 is already basically EOL, wtf?) the ADSP firmware from my understanding should be doing Audioreach instead of Elite, no q6afecc anymore. This opens a whole other can of worms, so not sure...

#size-cells = <2>;
ranges;

bootargs = "clk_ignore_unused pd_ignore_unused";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

"TX SWR_INPUT0", "ADC1_OUTPUT", // txmacro >= v9.2
"TX SWR_INPUT1", "ADC2_OUTPUT",
"TX SWR_INPUT4", "ADC3_OUTPUT",
"TX SWR_INPUT5", "ADC4_OUTPUT";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clean up this list?


platform {
sound-dai = <&q6routing>;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alphabetically: codec < cpu < platform


platform {
sound-dai = <&q6routing>;
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does microphone work by now? Last I heard it's broken

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the commit message for touchscreen commit to be fixup! $your_original_commit so it gets auto-squashed in the next rebase?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feel free to also add some options to fp5_defconfig, Alex also wants it renamed to sc7280_defconfig. Personally my muscle memory is already with fp5_defconfig ;)

@luka177 luka177 mentioned this pull request Feb 20, 2026
wrenix pushed a commit to wrenix/linux that referenced this pull request May 7, 2026
commit a355eef upstream.

Currently, the initialization of loongarch_jump_ops does not contain an
assignment to its .free field. This causes disasm_line__free() to fall
through to ins_ops__delete() for LoongArch jump instructions.

ins_ops__delete() will free ins_operands.source.raw and
ins_operands.source.name, and these fields overlaps with
ins_operands.jump.raw_comment and ins_operands.jump.raw_func_start.
Since in loongarch_jump__parse(), these two fields are populated by
strchr()-ing the same buffer, trying to free them will lead to undefined
behavior.

This invalid free usually leads to crashes:

        Process 1712902 (perf) of user 1000 dumped core.
        Stack trace of thread 1712902:
        #0  0x00007fffef155c58 n/a (libc.so.6 + 0x95c58)
        sc7280-mainline#1  0x00007fffef0f7a94 raise (libc.so.6 + 0x37a94)
        sc7280-mainline#2  0x00007fffef0dd6a8 abort (libc.so.6 + 0x1d6a8)
        sc7280-mainline#3  0x00007fffef145490 n/a (libc.so.6 + 0x85490)
        sc7280-mainline#4  0x00007fffef1646f4 n/a (libc.so.6 + 0xa46f4)
        sc7280-mainline#5  0x00007fffef164718 n/a (libc.so.6 + 0xa4718)
        sc7280-mainline#6  0x00005555583a6764 __zfree (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x106764)
        sc7280-mainline#7  0x000055555854fb70 disasm_line__free (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x2afb70)
        sc7280-mainline#8  0x000055555853d618 annotated_source__purge (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x29d618)
        sc7280-mainline#9  0x000055555852300c __hist_entry__tui_annotate (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x28300c)
        sc7280-mainline#10 0x0000555558526718 do_annotate (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x286718)
        sc7280-mainline#11 0x000055555852ed94 evsel__hists_browse (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x28ed94)
        sc7280-mainline#12 0x000055555831fdd0 cmd_report (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x7fdd0)
        sc7280-mainline#13 0x000055555839b644 handle_internal_command (/home/csmantle/dist/linux-arch/tools/perf/perf + 0xfb644)
        sc7280-mainline#14 0x00005555582fe6ac main (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x5e6ac)
        sc7280-mainline#15 0x00007fffef0ddd90 n/a (libc.so.6 + 0x1dd90)
        sc7280-mainline#16 0x00007fffef0ddf0c __libc_start_main (libc.so.6 + 0x1df0c)
        sc7280-mainline#17 0x00005555582fed10 _start (/home/csmantle/dist/linux-arch/tools/perf/perf + 0x5ed10)
        ELF object binary architecture: LoongArch

... and it can be confirmed with Valgrind:

        ==1721834== Invalid free() / delete / delete[] / realloc()
        ==1721834==    at 0x4EA9014: free (in /usr/lib/valgrind/vgpreload_memcheck-loongarch64-linux.so)
        ==1721834==    by 0x4106287: __zfree (zalloc.c:13)
        ==1721834==    by 0x42ADC8F: disasm_line__free (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x429B737: annotated_source__purge (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x42811EB: __hist_entry__tui_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x42848D7: do_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x428CF33: evsel__hists_browse (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==  Address 0x7d34303 is 35 bytes inside a block of size 62 alloc'd
        ==1721834==    at 0x4EA59B8: malloc (in /usr/lib/valgrind/vgpreload_memcheck-loongarch64-linux.so)
        ==1721834==    by 0x6B80B6F: strdup (strdup.c:42)
        ==1721834==    by 0x42AD917: disasm_line__new (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x42AE5A3: symbol__disassemble_objdump (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x42AF0A7: symbol__disassemble (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x429B3CF: symbol__annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x429C233: symbol__annotate2 (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x42804D3: __hist_entry__tui_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x42848D7: do_annotate (in /home/csmantle/dist/linux-arch/tools/perf/perf)
        ==1721834==    by 0x428CF33: evsel__hists_browse (in /home/csmantle/dist/linux-arch/tools/perf/perf)

This patch adds the missing free() specialization in loongarch_jump_ops,
which prevents disasm_line__free() from invoking the default cleanup
function.

Fixes: fb7fd2a ("perf annotate: Move raw_comment and raw_func_start fields out of 'struct ins_operands'")
Cc: stable@vger.kernel.org
Cc: WANG Rui <wangrui@loongson.cn>
Cc: Huacai Chen <chenhuacai@kernel.org>
Cc: WANG Xuerui <kernel@xen0n.name>
Cc: loongarch@lists.linux.dev
Signed-off-by: Rong Bao <rong.bao@csmantle.top>
Tested-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants