summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2026-04-06ARM: dts: imx: b850v3: Disable unused usdhc4Ian Ray1-0/+4
Disable the unused interface, to fix print an error message during boot: mmc3: Failed to initialize a non-removable card Signed-off-by: Ian Ray <ian.ray@gehealthcare.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: b850v3: Define GPIO line namesIan Ray1-0/+12
Define GPIO line names for gpio4. Signed-off-by: Ian Ray <ian.ray@gehealthcare.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: b850v3: Use alphabetical sortingIan Ray1-19/+19
Use alphabetical sorting of references modification. Signed-off-by: Ian Ray <ian.ray@gehealthcare.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: bx50v3: Configure phy-mode to eliminate a warningIan Ray3-0/+3
Set `phy-mode' on network switch CPU ports to eliminate a warning: mv88e6085 gpio-0:00: OF node /mdio-gpio/switch@0/ports/port@4 of CPU port 4 lacks the required "phy-mode" property Signed-off-by: Ian Ray <ian.ray@gehealthcare.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: bx50v3: Configure switch PHY max-speed to 100MbpsIan Ray1-0/+4
Configure maximum speed for the switch PHYs according to the electrical connections from PHY to RJ45 connector. Signed-off-by: Ian Ray <ian.ray@gehealthcare.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx7ulp: Add CPU clock and OPP table supportPeng Fan1-0/+28
Add missing CPU clock definitions and operating-points-v2 table for the Cortex-A7 on i.MX7ULP to enable proper CPU frequency scaling and integration with the cpufreq/OPP frameworks. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx7-mba7: Deassert BOOT_EN after bootAlexander Feilke1-0/+9
Deassert BOOT_EN after boot to separate BOOT_CFG circuits from LCD signals. Signed-off-by: Alexander Feilke <Alexander.Feilke@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: tqma7: add boot phase propertiesAlexander Feilke2-0/+9
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. Adds boot phase properties to essential resources in tqma7 device trees. This includes UART, SD-Card, eMMC and QSPI. Signed-off-by: Alexander Feilke <Alexander.Feilke@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx7s: add boot phase propertiesAlexander Feilke1-0/+5
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. Adds boot phase properties to essential resources in imx7s device trees. This includes the buses aips1-3, iomuxc and SOC access. Signed-off-by: Alexander Feilke <Alexander.Feilke@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: tqma6ul[l]: correct spelling of TQ-SystemsMax Merchel3-4/+4
TQ-Systems is written with a hyphen. Correct the spelling. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: mba6ulx: add boot phase propertiesMax Merchel1-0/+6
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. MBa6ULx need regulator, SD-Card, UART and watchdog access during boot process. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6ul[l]-tqma6ul[l]: add boot phase propertiesMax Merchel7-0/+16
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. TQMa6UL need eMMC, I2C, GPIO and QSPI access during boot process. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6ul/imx6ull: add boot phase propertiesMax Merchel2-0/+8
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. All SoCs require buses (aips and spba), clock, iomuxc and SOC access during boot process. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6qdl-mba6: add boot phase propertiesMax Merchel1-0/+12
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. MBa6 need I2C, GPIO, SD-Card, UART and watchdog access during boot process. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6qdl-tqma6: add boot phase propertiesMax Merchel3-0/+14
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. TQMa6 need eMMC, I2C, GPIO, regulator and QSPI access during boot process. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6qdl: add boot phase propertiesMax Merchel1-0/+6
dtschema/schemas/bootph.yaml describe various node usage during boot phases with DT. All SoCs require buses (aips and spba), clock, iomuxc, ipu and SOC access during boot process. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6qdl-tqma6: add missing labelsMax Merchel2-4/+4
Add the missing labels for the temperature sensor and the EEPROM. In SoM variants A and B, the components are connected to different I2C buses. These labels are needed to reference them in subsequent device trees. Signed-off-by: Max Merchel <Max.Merchel@ew.tq-group.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: add required clocks and clock-names for ccmFrank Li10-20/+21
Add required clocks and clock-names for ccm to fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/imx/imx6dl-alti6p.dtb: clock-controller@20c4000 (fsl,imx6q-ccm): clock-names:0: 'osc' was expected from schema $id: http://devicetree.org/schemas/clock/imx6q-clock.yaml# Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6qdl: add label for system clocksFrank Li1-3/+15
Add label for system clocks and add two missing clocks anaclk[1,2]. Prepare for fixing ccm related CHECK_DTB warnings. Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx28-tx28: remove undocumented aliasesFrank Li1-5/+0
Remove undocumented aliases, which is not used in kernel to fix CHECK_DTBS warnings. arch/arm/boot/dts/nxp/mxs/imx28-tx28.dtb: aliases: 'lcdif_23bit_pins', 'lcdif_24bit_pins', 'reg_can_xcvr', 'spi_gpio', 'spi_mxs' do not match any of the regexes: '^[a-z][a-z0-9\\-]*$', '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/aliases.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx28-tx28: rename compatible to "edt,edt-ft5206"Frank Li1-1/+1
The compatible string "edt,edt-ft5x06" is neither documented nor used. According to drivers/input/touchscreen/edt-ft5x06.c, ft5206, ft5306 and ft5406 are compatible. Use "edt,edt-ft5206" instead, as the datasheet does not specify the exact touchscreen model. Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx28-sps1: remove undocumented fallback compatible "mr25h256"Frank Li1-1/+1
Remove the undocumented fallback compatible string "mr25h256", as the SPI core strips the vendor prefix. Fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/mxs/imx28-sps1.dtb: /apb@80000000/apbh-bus@80000000/spi@80014000/flash@0: failed to match any schema with compatible: ['everspin,mr25h256', 'mr25h256'] Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx28: rename gpios-reset to reset-gpios of hx8357Frank Li3-3/+3
Rename gpios-reset to reset-gpios of hx8357 node to fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/mxs/imx28-cfa10055.dtb: hx8357@0 (himax,hx8357b): Unevaluated properties are not allowed ('gpios-reset' was unexpected) Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx23/28: add "led-" prefix to LED subnodesFrank Li11-17/+17
Add the "led-" prefix to LED subnodes to fix the below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/mxs/imx23-olinuxino.dtb: leds (gpio-leds): 'user' does not match any of the regexes: '(^led-[0-9a-f]$|led)', '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/leds/leds-gpio.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx23: fix interrupt names for dma-controller@80024000Frank Li1-3/+3
There are duplicate "empty" entries in the interrupt-names property of the DMA controller. Rename them to "empty<n>" to fix below CHECK_DTBS warnings. arch/arm/boot/dts/nxp/mxs/imx23-olinuxino.dtb: dma-controller@80024000 (fsl,imx23-dma-apbx): interrupt-names:15: 'empty5' was expected Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx27: remove fsl,imx-osc26m from fixed-clock nodeFrank Li1-1/+1
Remove fsl,imx-osc26m from fixed-clock node to fix below CHECK_DTB warnings: arch/arm/boot/dts/nxp/imx/imx27-apf27.dtb: osc26m (fsl,imx-osc26m): compatible: ['fsl,imx-osc26m', 'fixed-clock'] is too long from schema $id: http://devicetree.org/schemas/clock/fixed-clock.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx27-eukrea-cpuimx27: rename uart8250 to serialFrank Li1-4/+4
Rename node name uart8250 to serial to fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/imx/imx27-eukrea-mbimxsd27-baseboard.dtb: uart8250@3,200000 (ns8250): $nodename:0: 'uart8250@3,200000' does not match '^serial(@.*)?$' Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx27-eukrea: replace interrupts with interrupts-extendedFrank Li2-5/+5
The property interrupts use default interrupt controllers. But pass down gpio<n> as phandle. Correct it by use interrupts-extended. Fixes: d8cae888aa2bc ("ARM: dts: Add support for the cpuimx27 board from Eukrea and its baseboard") Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: remove redundant intermediate node in pinmux hierarchyFrank Li15-1015/+985
Remove the redundant intermediate node between the pinmux and group nodes, and add the missing "grp" suffix to the group node names. Fix below CHECK_DTBS warnings: arm/boot/dts/nxp/imx/imx27-apf27dev.dtb: iomuxc@10015000 (fsl,imx27-iomuxc): Unevaluated properties are not allowed ('imx27-apf27', 'imx27-apf27dev' were unexpected) from schema $id: http://devicetree.org/schemas/pinctrl/fsl,imx27-iomuxc.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx: rename iomuxc to pinmuxFrank Li3-3/+3
Rename node name iomuxc to pinmux. Fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/imx/imx1-apf9328.dtb: iomuxc@21c000 (fsl,imx1-iomuxc): $nodename:0: 'iomuxc@21c000' does not match '^(pinctrl|pinmux)(@[0-9a-f]+)?$' from schema $id: http://devicetree.org/schemas/pinctrl/fsl,imx27-iomuxc.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6ull-dhcor: Handle both 1DX and 1YN WiFi on i.MX6ULL DHCORMarek Vasut1-2/+2
The muRata 1DX WiFi/BT chip is mounted on the DHCOM i.MX6ULL. This chip has been discontinued and replaced by the muRata 1YN chip. The new chip is a drop-in replacement of the old chip. To support both chips for the i.MX6ULL DHCOR, drop the more specific compatible string and let the driver auto-detect the chip type. Currently, there are no known quirks that would apply only to one or the other chip. Signed-off-by: Marek Vasut <marex@nabladev.com> Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx7s-warp: Remove data-lanes and clock-lanes for ov2680Frank Li1-2/+0
The ov2680 only support 1 lane. Needn't additional property to descript it. Remove it to fix below DTB_CHECK warnings: camera@36 (ovti,ov2680): port:endpoint: 'clock-lanes', 'data-lanes' do not match any of the regexes: '^pinctrl-[0-9]+$' from schema $id: http://devicetree.org/schemas/media/i2c/ovti,ov2680.yaml Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx53-smd: Add power supply node for fsl,sgtl5000Frank Li1-0/+18
Add power supply, #sound-dai-cells and clock nodes for fsl,sgtl5000 to fix below CHECK_DTB warnings: arch/arm/boot/dts/nxp/imx/imx53-smd.dtb: sgtl5000@a (fsl,sgtl5000): '#sound-dai-cells' is a required property from schema $id: http://devicetree.org/schemas/sound/fsl,sgtl5000.yaml# arch/arm/boot/dts/nxp/imx/imx53-smd.dtb: sgtl5000@a (fsl,sgtl5000): 'clocks' is a required property from schema $id: http://devicetree.org/schemas/sound/fsl,sgtl5000.yaml# arch/arm/boot/dts/nxp/imx/imx53-smd.dtb: sgtl5000@a (fsl,sgtl5000): 'VDDA-supply' is a required property from schema $id: http://devicetree.org/schemas/sound/fsl,sgtl5000.yaml# arch/arm/boot/dts/nxp/imx/imx53-smd.dtb: sgtl5000@a (fsl,sgtl5000): 'VDDIO-supply' is a required property Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06ARM: dts: imx6qdl-sr-som-ti: use fixed-clock instead of clock-frequencyFrank Li1-1/+7
Replace the clock-frequency property with a fixed-clock providing the 32kHz input to the gpio-gate-clock. Fix the following CHECK_DTBS warning: ti-wifi-clock (gpio-gate-clock): 'clock-frequency' does not match any of the regexes: '^pinctrl-[0-9]+$' Signed-off-by: Frank Li <Frank.Li@nxp.com>
2026-04-06gpu: nova-core: fix missing colon in SEC2 boot debug messageDavid Carlier1-1/+1
The SEC2 mailbox debug output formats MBOX1 without a colon separator, producing "MBOX10xdead" instead of "MBOX1: 0xdead". The GSP debug message a few lines above uses the correct format. Fixes: 5949d419c193 ("gpu: nova-core: gsp: Boot GSP") Signed-off-by: David Carlier <devnexen@gmail.com> Link: https://patch.msgid.link/20260331103744.605683-1-devnexen@gmail.com Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
2026-04-06smb: client: Remove unnecessary selection of CRYPTO_ECBEric Biggers2-2/+0
Since the SMB client never uses any ecb(...) algorithm from the crypto_skcipher API, selecting CRYPTO_ECB is unnecessary. Specifically, it has been unnecessary since commit 06deeec77a5a ("cifs: Fix smbencrypt() to stop pointing a scatterlist at the stack") in 2016. Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: move smb2maperror declarations to smb2proto.hZhangGuoDong3-8/+8
For `smb2_error_map_table_test` and `smb2_error_map_num`, if their types are changed in `smb2maperror.c` but the corresponding extern declarations in `smb2maperror_test.c` are not updated, the compiler will not report an error. Moving them to a common header file allows the compiler to catch type mismatches. Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: introduce KUnit tests to check DOS/SRV err mapping searchYouling Tang4-5/+59
Check whether all elements can be correctly found in the arrays. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: check if SMB1 DOS/SRV error mapping arrays are sortedYouling Tang1-0/+12
Although the arrays are sorted at build time, verify the ordering again when cifs.ko is loaded to avoid potential regressions introduced by future script changes. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: use binary search for SMB1 DOS/SRV error mappingHuiwen He1-30/+37
Currently, map_smb_to_linux_error() uses linear searches for both mapping_table_ERRDOS[] and mapping_table_ERRSRV[]. Refactor this by introducing search_mapping_table_ERRDOS() and search_mapping_table_ERRSRV() that implements binary search(as the tables are sorted).This improves lookup performance and reduces code duplication. Also remove the sentinel entries from the mapping tables as they are no longer needed with ARRAY_SIZE(). Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: autogenerate SMB1 DOS/SRV to POSIX error mappingHuiwen He5-79/+62
Extend the `gen_smb1_mapping` script to support generating sorted POSIX error mapping tables for both ERRDOS and ERRSRV classes at compile time. The script parses annotations from smberr.h to generate smb1_err_dos_map.c and smb1_err_srv_map.c, which are included as the contents of the arrays mapping_table_ERRDOS[] and mapping_table_ERRSRV[], respectively. This ensures that the mapping logic remains synchronized with the source headers and prepares for faster error lookups using binary search in the future. Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: annotate smberr.h with POSIX error codesHuiwen He1-142/+256
Annotate SMB1 error definitions in smberr.h with their corresponding POSIX error codes. To facilitate automated processing and ensure consistent formatting, existing inline comments (/* ... */) in smberr.h were first moved to the lines preceding the #define statements. This provides the source data for generating sorted mapping tables, allowing the implementation of binary search for faster error mapping lookups in later commits. The annotations were performed based on the manual mapping_table_ERRDOS[] and mapping_table_ERRSRV[] arrays in smb1maperror.c using the following python script: #!/usr/bin/env python3 import re import os MAP_FILE = "fs/smb/client/smb1maperror.c" SMBERR_FILE = "fs/smb/client/smberr.h" def get_mappings(): mappings = {} if not os.path.exists(MAP_FILE): return mappings with open(MAP_FILE, "r") as f: content = f.read() for table in ["mapping_table_ERRDOS", "mapping_table_ERRSRV"]: pattern = ( rf'static const struct smb_to_posix_error {table}\[\] = ' r'\{([\s\S]+?)\};' ) match = re.search(pattern, content) if match: entry_pattern = ( r'\{\s*([A-Za-z0-9_]+)\s*,\s*' r'(-[A-Z0-9_]+)\s*\}' ) entries = re.findall(entry_pattern, match.group(1)) for name, posix in entries: if name != "0": mappings[name] = posix return mappings def format_comment(comment_lines): """ Formats comment lines to comply with Linux kernel coding style. Single-line comments remain on one line. Multi-line comments use the standard block format. """ raw_text = [] for line in comment_lines: line = line.strip() if line.startswith('/*'): line = line[2:] if line.endswith('*/'): line = line[:-2] line = line.lstrip(' *').strip() if line: raw_text.append(line) if not raw_text: return [] # If it's a single line of text, keep it simple if len(raw_text) == 1: return [f"/* {raw_text[0]} */"] # Multi-line: Standard Kernel Block Comment Format formatted = ["/*"] for text in raw_text: formatted.append(f" * {text}") formatted.append(" */") return formatted def fix_content(content, mappings): lines = content.splitlines() new_lines, i = [], 0 while i < len(lines): line = lines[i] # Match #define with inline comment define_re = ( r'^(\s*#define\s+([A-Za-z0-9_]+)\s+' r'[^\s/]+)\s*/\*' ) match = re.match(define_re, line) if match: prefix, name = match.group(1), match.group(2) # Extract full comment block comment_block = [line[line.find('/*'):].strip()] if '*/' not in line: while i + 1 < len(lines): i += 1 comment_block.append(lines[i].strip()) if '*/' in lines[i]: break # Format and add comment new_lines.extend(format_comment(comment_block)) # Add define with tab-separated POSIX code new_define = prefix.rstrip() if name in mappings: new_define += '\t// ' + mappings[name] new_lines.append(new_define) else: no_comment_re = ( r'^(\s*#define\s+([A-Za-z0-9_]+)\s+' r'[^\s/]+)\s*$' ) match_no_comment = re.match(no_comment_re, line) if match_no_comment: prefix = match_no_comment.group(1) name = match_no_comment.group(2) new_define = prefix.rstrip() if name in mappings: new_define += '\t// ' + mappings[name] new_lines.append(new_define) else: new_lines.append(line) i += 1 return '\n'.join(new_lines) if __name__ == "__main__": m = get_mappings() if os.path.exists(SMBERR_FILE): with open(SMBERR_FILE, "r") as f: content = f.read() fixed = fix_content(content, m) with open(SMBERR_FILE, "w") as f: f.write(fixed + '\n') print(f"Successfully processed {SMBERR_FILE}") Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: move ERRnetlogonNotStarted to DOS error classHuiwen He1-1/+1
In smb1maperror.c, ERRnetlogonNotStarted is included in the mapping_table_ERRDOS array. However, in the smberr.h header file, this macro was incorrectly placed under the ERRSRV (server) error class section. Move the macro definition to the ERRDOS section in smberr.h to maintain consistency between the error classification in the header file and its actual usage in the mapping tables. Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: introduce KUnit test to check ntstatus_to_dos_map searchYouling Tang5-0/+95
Check whether all elements can be correctly found in the array. Introduce CONFIG_SMB1_KUNIT_TESTS for smb1maperror_test.ko since smb1maperror.o is only built when CONFIG_CIFS_ALLOW_INSECURE_LEGACY is enabled. We are going to define 3 functions to check the search results, introduce the macro DEFINE_CHECK_SEARCH_FUNC() to reduce duplicate code. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: check if ntstatus_to_dos_map is sortedYouling Tang3-0/+39
Although the array is sorted at build time, verify the ordering again when cifs.ko is loaded to avoid potential regressions introduced by future script changes. We are going to define 3 functions to check the sort results, introduce the macro DEFINE_CHECK_SORT_FUNC() to reduce duplicate code. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: use binary search for NT status to DOS mappingHuiwen He1-13/+19
The ntstatus_to_dos_map[] table is sorted now. Replace the linear search with binary search to improve lookup performance. Also remove the sentinel entry as it is no longer needed with ARRAY_SIZE(). Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: refactor ntstatus_to_dos() to return mapping entryHuiwen He1-32/+19
Refactor ntstatus_to_dos() to return a pointer to the mapping entry instead of using output parameters. This allows callers to access all fields of the entry directly. In map_smb_to_linux_error(), integrate the printing logic directly to avoid redundant lookups previously performed by cifs_print_status(), which is now removed. Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: replace nt_errs with ntstatus_to_dos_mapHuiwen He4-719/+12
The ntstatus_to_dos_map[] array now contains the NT error strings, making the nt_errs[] array redundant. Introduce `struct ntstatus_to_dos_err` instead of an anonymous struct. This allows cifs_print_status() to look up error strings directly from a single table. Remove nterr.c, as nt_errs[] was its only functional content. Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: autogenerate SMB1 NT status to DOS error mappingHuiwen He5-555/+122
Introduce `gen_smb1_mapping` script to autogenerate the NT status to DOS error mapping table for SMB1. This script parses nterr.h to generate smb1_mapping_table.c, which is then directly included as the content of the ntstatus_to_dos_map[] array at compile time. The generated array is numerically sorted during the build process to ensure a consistent structure, providing the necessary groundwork for future introduction of binary search lookups. Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>
2026-04-06smb/client: annotate nterr.h with DOS error codesHuiwen He1-533/+534
Add comments to NT_STATUS definitions in nterr.h indicating the corresponding DOS error class and code. To ensure formatting consistency and facilitate automated processing, existing human-readable comments in nterr.h were first moved to the line preceding the #define statements. This provides the source data for generating sorted mapping tables, allowing the implementation of binary search for faster error mapping lookups in later commits. The mapping data is extracted from the existing manual ntstatus_to_dos_map[] array in smb1maperror.c using the following python script: #!/usr/bin/env python3 import re import os MAP_FILE = "fs/smb/client/smb1maperror.c" NTERR_FILE = "fs/smb/client/nterr.h" def move_comments(file_path): """ Moves existing inline comments (/* ... */ or // ...) to the preceding line to ensure formatting consistency. """ if not os.path.exists(file_path): return with open(file_path, "r") as f: lines = f.readlines() new_lines = [] # Match #define statements with inline comments re_str = r'^(\s*#define\s+[A-Za-z0-9_]+\s+.*?)\s*(/\*.*?\*/|//.*)$' pattern = re.compile(re_str) for line in lines: match = pattern.match(line.rstrip()) if match: define_part, comment_part = match.groups() # Do not move if it's already an auto-generated mapping comment if re.search(r'//\s*[A-Z0-9_]+\s*,\s*[A-Za-z0-9_]+', comment_part): new_lines.append(line) continue indent = " " * (len(line) - len(line.lstrip())) # Move old comment to previous line new_lines.append(indent + comment_part + "\n") # Keep the define part new_lines.append(define_part.rstrip() + "\n") else: new_lines.append(line) with open(file_path, "w") as f: f.writelines(new_lines) def annotate_nterr(): """ Extracts DOS error mappings from smb1maperror.c and appends them as comments to NT_STATUS defines in nterr.h, ensuring proper alignment. """ mapping = {} if not os.path.exists(MAP_FILE) or not os.path.exists(NTERR_FILE): return # Extract mappings from the source mapping table with open(MAP_FILE, "r") as f: content = f.read() # Strip comments from source to ensure robust parsing content = re.sub(r'/\*.*?\*/', '', content, flags=re.DOTALL) content = re.sub(r'//.*', '', content) # Match [Class], [Code], [NT_STATUS] triplets using regex map_re = r'([A-Z0-9_]+)\s*,\s*([A-Za-z0-9_]+)\s*,\s*(NT_STATUS_[A-Z0-9_]+)' matches = re.findall(map_re, content) for m in matches: mapping[m[2]] = (m[0], m[1]) with open(NTERR_FILE, "r") as f: lines = f.readlines() new_lines = [] for line in lines: stripped = line.strip() if stripped.startswith("#define NT_STATUS_"): # Remove any existing // comments before re-annotating base_line = re.sub(r'\s*//.*$', '', line.rstrip()) parts = base_line.split() if len(parts) >= 2: name = parts[1] # Append comment, ensuring proper alignment if name == "NT_STATUS_OK": line = f"{base_line}\t// SUCCESS, 0\n" elif name in mapping: d_class, d_code = mapping[name] line = f"{base_line}\t// {d_class}, {d_code}\n" else: line = f"{base_line}\t// ERRHRD, ERRgeneral\n" new_lines.append(line) with open(NTERR_FILE, "w") as f: f.writelines(new_lines) if __name__ == "__main__": # Step 1: Clean existing inline comments and move them to separate lines move_comments(NTERR_FILE) # Step 2: Annotate with DOS codes, ensuring proper DOS codes comments annotate_nterr() print("Successfully processed nterr.h with DOS codes comments.") Signed-off-by: Huiwen He <hehuiwen@kylinos.cn> Reviewed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com>