Skip to content

arm64: dts: qcom: common dtsi for Xiaomi SDM660-family (upstream prep)#166

Closed
M0Rf30 wants to merge 7 commits into
sdm660-mainline:masterfrom
M0Rf30:upstreaming/xiaomi-common-v1
Closed

arm64: dts: qcom: common dtsi for Xiaomi SDM660-family (upstream prep)#166
M0Rf30 wants to merge 7 commits into
sdm660-mainline:masterfrom
M0Rf30:upstreaming/xiaomi-common-v1

Conversation

@M0Rf30

@M0Rf30 M0Rf30 commented Jan 14, 2026

Copy link
Copy Markdown

Per discussion in #161 and #165, this prepares the common dtsi for upstream submission.

Based on torvalds/master (mainline).

Patchset:

  1. Create sdm660-xiaomi-common.dtsi, refactor lavender to use it
  2. dt-bindings for tulip, whyred, jasmine, platina
  3. Add tulip DTS (Redmi Note 6 Pro)
  4. Add whyred DTS (Redmi Note 5 Pro)
  5. Add jasmine DTS (Mi A2)
  6. Add platina DTS (Mi 8 Lite)

Validation:

  • checkpatch.pl --strict: 0 errors
  • make CHECK_DTBS=y: passed
  • All DTBs build

Please review before I send to linux-arm-msm@vger.kernel.org.

@setotau

setotau commented Jan 14, 2026

Copy link
Copy Markdown

there are over 10000 commits, how can we review these changes?

@setotau

setotau commented Jan 14, 2026

Copy link
Copy Markdown

there are over 10000 commits, how can we review these changes?

nvm, there are last commits I see

@M0Rf30
M0Rf30 changed the base branch from qcom-sdm660-6.18.y to master January 14, 2026 21:15
@okias

okias commented Jan 14, 2026

Copy link
Copy Markdown

I'll drop some nitpicks:

chosen > framebuffer - use

memory-region = <&framebufer_mem>;

instead of reg =

Except this small improvements, looks pretty good.

Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-jasmine.dts
@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch 2 times, most recently from d1d4031 to 94987e4 Compare January 14, 2026 21:47
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi Outdated
@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch 2 times, most recently from b2134b9 to 0c3ae74 Compare January 14, 2026 22:25
@M0Rf30
M0Rf30 requested review from minlexx, okias and setotau January 15, 2026 13:08

@setotau setotau left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

lgtm

@okias okias left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, last nitpick:
arm64: dts: qcom: add sdm660-xiaomi-common.dtsi for Xiaomi SDM660-family devices

should more like rather than "add" say something like "extract common parts into xiaomi-common". you can omit .dtsi in the commit msg

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from 0c3ae74 to fdc6544 Compare January 15, 2026 13:53
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi Outdated
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi Outdated
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-jasmine.dts
Comment thread arch/arm64/boot/dts/qcom/sdm636-xiaomi-tulip.dts Outdated
Comment thread arch/arm64/boot/dts/qcom/sdm636-xiaomi-tulip.dts Outdated
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi Outdated
@minlexx

minlexx commented Jan 15, 2026

Copy link
Copy Markdown
Member

And I think SoB chain is wrong in most commit messages where several authors are involved (missing co-developed-by?)

At least commit messages for whyred and platina

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from fdc6544 to feaec76 Compare January 15, 2026 14:06
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi Outdated
@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch 2 times, most recently from 3beb0a2 to 0910450 Compare January 15, 2026 14:24
@M0Rf30
M0Rf30 requested review from minlexx and okias January 15, 2026 14:26
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-common.dtsi
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-platina.dts Outdated
@minlexx

minlexx commented Jan 15, 2026

Copy link
Copy Markdown
Member

And I think SoB chain is wrong in most commit messages where several authors are involved (missing co-developed-by?)

At least commit messages for whyred and platina

I think in commit messages SoB chain should go top-to-bottom in chronological order: https://docs.kernel.org/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by

So, for whyred:

Co-developed-by: Mathesh Velayudan <123v.mathesh@gmail.com>
Signed-off-by: Mathesh Velayudan <123v.mathesh@gmail.com>
Co-developed-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

for platina also Angelo was the original author, so:

Co-developed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Co-developed-by: Molly Sophia <mollysophia379@gmail.com>
Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>

@minlexx

minlexx commented Jan 15, 2026

Copy link
Copy Markdown
Member

Also your every device's commit message says "..USB support for debugging." but it's a normal USB, not just for debugging? 😺

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch 2 times, most recently from 4194251 to 48c56f2 Compare January 16, 2026 23:44
@minlexx

minlexx commented Jan 17, 2026

Copy link
Copy Markdown
Member

I am thinking about maybe another base could be made sdm660-pm660.dtsi for all devices what we have. This approach what msm8916-mainline developers have done.

https://github.com/msm8916-mainline/linux/blob/msm8916/6.17-rc6/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi

And then what to put in it? It will be question every time. I think it's very hard to justify its existence for 3 nodes - it doesn't do much. I think it was much better in the first revision where common regulators were in sdm660-xiaomi-common (sorry!). Also I think it's better to keep this patchset limited to only xiaomi devices and not touch any other Inforce or Sony boards. Thing is, regulators setup is not final yet and will require more patches (like xiaomi-specific setting l3b to always-on) and maybe some more (raising voltage for SD stability one). Maybe such optimisation can be postponed for later, and for now better to keep this patchset as simple as possible?

IMO previous iteration was fine except missing pinctrl for gpio keys and second major issue is missing touchscreen support for boards, but touch can be added later I think and is not related to having common dtsi 🤔 .

Let's decide where to put xiaomi regulators (@M0Rf30 if you think it's possible to have them all in common then OK).

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch 2 times, most recently from a9d4fa9 to 33cd41d Compare January 17, 2026 14:19
@minlexx

minlexx commented Jan 17, 2026

Copy link
Copy Markdown
Member

Should be fine for first revision. I doubt we can find more issues here (but upstream probably can). Instead of arguing here for more days maybe it's time to move the rest questionable subjects to upstream discussion and send it. Of course, if patcheset compiles fine when applied on top of current torvalds/master, checkpatch reports no warnings and dtbs-check also :)

P.S> Sadly our CI doesn't run on master branch, I was thinking of adding checkpatch step to it also.

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from 33cd41d to 106a906 Compare January 17, 2026 14:44
@okias

okias commented Jan 17, 2026

Copy link
Copy Markdown

Pretty good, last request: sort the nodes. After this I'm happy to put R-b on the series (it's better to do after it's send, just add me into

Cc: David Heidelberg <david@ixit.cz>

@M0Rf30

M0Rf30 commented Jan 17, 2026

Copy link
Copy Markdown
Author

I am thinking about maybe another base could be made sdm660-pm660.dtsi for all devices what we have. This approach what msm8916-mainline developers have done.
https://github.com/msm8916-mainline/linux/blob/msm8916/6.17-rc6/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi

And then what to put in it? It will be question every time. I think it's very hard to justify its existence for 3 nodes - it doesn't do much. I think it was much better in the first revision where common regulators were in sdm660-xiaomi-common (sorry!). Also I think it's better to keep this patchset limited to only xiaomi devices and not touch any other Inforce or Sony boards. Thing is, regulators setup is not final yet and will require more patches (like xiaomi-specific setting l3b to always-on) and maybe some more (raising voltage for SD stability one). Maybe such optimisation can be postponed for later, and for now better to keep this patchset as simple as possible?

IMO previous iteration was fine except missing pinctrl for gpio keys and second major issue is missing touchscreen support for boards, but touch can be added later I think and is not related to having common dtsi 🤔 .

Let's decide where to put xiaomi regulators (@M0Rf30 if you think it's possible to have them all in common then OK).

I leave regulators there (only 3 of them are common).
I added touchscreen where possible:

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch 2 times, most recently from f434bb8 to b39d8b4 Compare January 17, 2026 15:06
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-platina.dts
Comment thread arch/arm64/boot/dts/qcom/sdm636-xiaomi-whyred.dts Outdated
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-jasmine.dts Outdated
Comment thread arch/arm64/boot/dts/qcom/sdm660-xiaomi-platina.dts Outdated
@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from b39d8b4 to 3070fb2 Compare January 17, 2026 17:15
@M0Rf30
M0Rf30 requested a review from barni2000 January 17, 2026 17:21
@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from 3070fb2 to 5a0a89e Compare January 17, 2026 17:37

@barni2000 barni2000 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Send it! =)

@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from 5a0a89e to 9882591 Compare January 19, 2026 19:37
Add device tree bindings for:
- Xiaomi Redmi Note 6 Pro (tulip) - SDM636
- Xiaomi Redmi Note 5 Pro (whyred) - SDM636
- Xiaomi Mi A2 (jasmine) - SDM660
- Xiaomi Mi 8 Lite (platina) - SDM660

These are Android-based smartphones that can boot mainline Linux
with simple-framebuffer and USB support.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Create a shared device tree include file for Xiaomi smartphones and tablets
based on Qualcomm SDM636/SDM660 SoCs. This reduces code duplication when
adding new Xiaomi devices and ensures consistent configuration across the
family.

The common dtsi includes:
- PM660/PM660L PMIC configuration with volume/power buttons
- Serial console (blsp1_uart2, blsp2_uart1)
- Hall effect sensor (disabled by default)
- USB (qusb2phy0, usb3) in peripheral mode
- SD card (sdhc_2) pinctrl and supplies
- eMMC (sdhc_1) with HS400 support
- Backlight (pm660l_wled)
- Framebuffer memory reservation
- WiFi (wcn3990)
- Bluetooth (wcn3990)

Also refactor sdm660-xiaomi-lavender.dts to use the new common include,
removing duplicated code.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Fix regulator configurations to ensure stable operation:
- vreg_l2b_2p95: Increase max voltage from 2696mV to 3100mV to support
  proper SD card voltage signaling
- vreg_l3b_3p3: Add regulator-always-on to keep the regulator enabled
  during boot
- vreg_l10a_1p8: Add regulator-system-load of 14000uA for proper USB PHY
  PLL operation

Also enable the SD card controller (sdhc_2) which was left disabled.

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Add initial device tree support for the Xiaomi Redmi Note 6 Pro
(codename: tulip), a smartphone based on Qualcomm SDM636 SoC with
4GB RAM and a 6.26" 1080x2280 display.

This enables:
- Booting to a framebuffer console
- USB support
- Hall effect sensor
- Battery monitoring
- Charging (pm660_charger)
- Status LED (pm660l_lpg)

Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Add initial device tree support for the Xiaomi Redmi Note 5 Pro
(codename: whyred), a smartphone based on Qualcomm SDM636 SoC with
4/6GB RAM and a 5.99" 1080x2160 display.

This enables:
- Booting to a framebuffer console
- USB support
- Hall effect sensor
- Touchscreen (Synaptics RMI4)
- Battery monitoring
- Charging (pm660_charger)
- Status LED (pm660l_lpg)

Co-developed-by: Mathesh Velayudan <123v.mathesh@gmail.com>
Signed-off-by: Mathesh Velayudan <123v.mathesh@gmail.com>
Co-developed-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Alexey Minnekhanov <alexeymin@postmarketos.org>
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Add initial device tree support for the Xiaomi Mi A2
(codename: jasmine), a smartphone based on Qualcomm SDM660 SoC with
4/6GB RAM and a 5.99" 1080x2160 display.

This enables:
- Booting to a framebuffer console
- USB support
- Touchscreen (Novatek NT36672A)
- Battery monitoring
- Charging (pm660_charger)

Co-developed-by: Joe Mason <buddyjojo06@outlook.com>
Signed-off-by: Joe Mason <buddyjojo06@outlook.com>
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
Add initial device tree support for the Xiaomi Mi 8 Lite
(codename: platina), a smartphone based on Qualcomm SDM660 SoC with
4/6GB RAM and a 6.26" 1080x2280 display.

This enables:
- Booting to a framebuffer console
- USB support
- Hall effect sensor
- Touchscreen (Novatek NT36672A)
- Battery monitoring
- Charging (pm660_charger)

Co-developed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Co-developed-by: Molly Sophia <mollysophia379@gmail.com>
Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
Signed-off-by: Gianluca Boiano <morf3089@gmail.com>
@M0Rf30
M0Rf30 force-pushed the upstreaming/xiaomi-common-v1 branch from 9882591 to f2ab2e6 Compare January 20, 2026 17:41
@M0Rf30

M0Rf30 commented Jan 20, 2026

Copy link
Copy Markdown
Author

sent
https://lore.kernel.org/linux-arm-msm/20260120180052.1031231-1-morf3089@gmail.com/

🤞

@okias

okias commented Jan 20, 2026

Copy link
Copy Markdown

Nice! If there will be next revision, you can throw in

Cc: phone-devel@vger.kernel.org

into cover letter.

@minlexx

minlexx commented Jan 22, 2026

Copy link
Copy Markdown
Member

This can be closed now, because local review is finished and series sent?

@M0Rf30 M0Rf30 closed this Jan 22, 2026
minlexx pushed a commit that referenced this pull request Jul 11, 2026
Raw Packet QPs are unique in that they support separate send and receive
queues, using 2 different user-provided buffers.
They can also be created with one of the queues having size 0, allowing
a send-only or receive-only QP.

The Raw Packet RQ umem is created in the common user QP creation path,
which allows zero-length queues. Add a later validation of the RQ umem
in Raw Packet QP creation path when an RQ was requested.

This prevents possible null-ptr dereference crashes, as seen in the
below trace:

  Oops: general protection fault, probably for non-canonical address 0xdffffc0000000006: 0000 [#1] SMP KASAN
  KASAN: null-ptr-deref in range [0x0000000000000030-0x0000000000000037]
  CPU: 6 UID: 0 PID: 3539 Comm: raw_packet_umem Not tainted 6.19.0-rc1+ #166 NONE
  Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.16.3-0-ga6ed6b701f0a-prebuilt.qemu.org 04/01/2014
  RIP: 0010:__mlx5_umem_find_best_quantized_pgoff+0x37/0x280 [mlx5_ib]
  Code: ff df 41 57 49 89 ff 41 56 41 55 41 89 d5 41 54 4d 89 cc 4c 8d 4f 30 55 4c 89 ca 48 89 f5 53 48 c1 ea 03 48 89 cb 48 83 ec 18 <80> 3c 02 00 44 89 04 24 0f 85 01 02 00 00 48 ba 00 00 00 00 00 fc
  RSP: 0018:ff1100013966f4e0 EFLAGS: 00010282
  RAX: dffffc0000000000 RBX: 00000000ffffffc0 RCX: 00000000ffffffc0
  RDX: 0000000000000006 RSI: 00000ffffffff000 RDI: 0000000000000000
  RBP: 00000ffffffff000 R08: 0000000000000040 R09: 0000000000000030
  R10: 0000000000000000 R11: 0000000000000000 R12: ff1100013966f648
  R13: 0000000000000005 R14: ff1100013966f980 R15: 0000000000000000
  FS:  00007fae6c82f740(0000) GS:ff11000898ba1000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
  CR2: 0000200000000000 CR3: 000000010f96c005 CR4: 0000000000373eb0
  Call Trace:
   <TASK>
   create_qp+0x747d/0xc740 [mlx5_ib]
   ? is_module_address+0x18/0x110
   ? _create_user_qp.constprop.0+0x18e0/0x18e0 [mlx5_ib]
   ? __module_address+0x49/0x210
   ? is_module_address+0x68/0x110
   ? static_obj+0x67/0x90
   ? lockdep_init_map_type+0x58/0x200
   mlx5_ib_create_qp+0xc85/0x2620 [mlx5_ib]
   ? find_held_lock+0x2b/0x80
   ? create_qp+0xc740/0xc740 [mlx5_ib]
   ? lock_release+0xcb/0x260
   ? lockdep_init_map_type+0x58/0x200
   ? __init_swait_queue_head+0xcb/0x150
   create_qp.part.0+0x558/0x7c0 [ib_core]
   ib_create_qp_user+0xa0/0x4f0 [ib_core]
   ? rdma_lookup_get_uobject+0x1e4/0x400 [ib_uverbs]
   create_qp+0xe4f/0x1d10 [ib_uverbs]
   ? ib_uverbs_rereg_mr+0xd40/0xd40 [ib_uverbs]
   ? ib_uverbs_cq_event_handler+0x120/0x120 [ib_uverbs]
   ? __might_fault+0x81/0x100
   ? lock_release+0xcb/0x260
   ? _copy_from_user+0x3e/0x90
   ib_uverbs_create_qp+0x10a/0x150 [ib_uverbs]
   ? ib_uverbs_ex_create_qp+0xe0/0xe0 [ib_uverbs]
   ? __might_fault+0x81/0x100
   ? lock_release+0xcb/0x260
   ib_uverbs_write+0x7e5/0xc90 [ib_uverbs]
   ? uverbs_devnode+0xc0/0xc0 [ib_uverbs]
   ? lock_acquire+0xfa/0x2b0
   ? find_held_lock+0x2b/0x80
   ? finish_task_switch.isra.0+0x189/0x6c0
   vfs_write+0x1c0/0xf70
   ? lockdep_hardirqs_on_prepare+0xde/0x170
   ? kernel_write+0x5a0/0x5a0
   ? __switch_to+0x527/0xe60
   ? __schedule+0x10a3/0x3950
   ? io_schedule_timeout+0x110/0x110
   ksys_write+0x170/0x1c0
   ? __x64_sys_read+0xb0/0xb0
   ? trace_hardirqs_off.part.0+0x4e/0xe0
   do_syscall_64+0x70/0x1360
   entry_SYSCALL_64_after_hwframe+0x4b/0x53
  RIP: 0033:0x7fae6ca3118d
  Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 5b cc 0c 00 f7 d8 64 89 01 48
  RSP: 002b:00007ffe678ca308 EFLAGS: 00000213 ORIG_RAX: 0000000000000001
  RAX: ffffffffffffffda RBX: 00007ffe678ca448 RCX: 00007fae6ca3118d
  RDX: 0000000000000070 RSI: 0000200000000280 RDI: 0000000000000003
  RBP: 00007ffe678ca320 R08: 00000000ffffffff R09: 00007fae6c8ec5b8
  R10: 0000000000000064 R11: 0000000000000213 R12: 0000000000000001
  R13: 0000000000000000 R14: 00007fae6cb71000 R15: 0000000000404df0
   </TASK>
  Modules linked in: mlx5_ib mlx5_fwctl mlx5_core bonding ip6_gre ip6_tunnel tunnel6 ip_gre gre rdma_ucm ib_uverbs rdma_cm iw_cm ib_ipoib ib_cm ib_umad ib_core rpcsec_gss_krb5 auth_rpcgss oid_registry overlay nfnetlink zram zsmalloc fuse scsi_transport_iscsi [last unloaded: mlx5_core]
  ---[ end trace 0000000000000000 ]---
  RIP: 0010:__mlx5_umem_find_best_quantized_pgoff+0x37/0x280 [mlx5_ib]

Fixes: 0fb2ed6 ("IB/mlx5: Add create and destroy functionality for Raw Packet QP")
Link: https://patch.msgid.link/r/20260427-security-bug-fixes-v3-5-4621fa52de0e@nvidia.com
Signed-off-by: Michael Guralnik <michaelgur@nvidia.com>
Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Edward Srouji <edwards@nvidia.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants