| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/26 15:06 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies the Wiznet W5100/W5200/W5500 SPI Ethernet driver (drivers/net/ethernet/wiznet/w5100.c), devicetree bindings, and MAINTAINERS. This driver is for standalone SPI Ethernet controller ASICs that are not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/26 15:06 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 21294587d147bb5b16aba72907dc28efd6540963\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sat Sep 26 15:06:13 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/Documentation/devicetree/bindings/net/wiznet,w5100.yaml b/Documentation/devicetree/bindings/net/wiznet,w5100.yaml\nnew file mode 100644\nindex 0000000000000..b0d1e1d699dc6\n--- /dev/null\n+++ b/Documentation/devicetree/bindings/net/wiznet,w5100.yaml\n@@ -0,0 +1,88 @@\n+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)\n+%YAML 1.2\n+---\n+$id: http://devicetree.org/schemas/net/wiznet,w5100.yaml#\n+$schema: http://devicetree.org/meta-schemas/core.yaml#\n+\n+title: Wiznet w5100/w5200/w5500 SPI Ethernet Controller\n+\n+maintainers:\n+ - Arthur Crepin Leblond \u003carthur@marmottus.net\u003e\n+\n+description: |\n+ This is a standalone 10/100 MBit Ethernet controller with SPI interface.\n+\n+properties:\n+ compatible:\n+ enum:\n+ - wiznet,w5100\n+ - wiznet,w5200\n+ - wiznet,w5500\n+\n+ interrupts:\n+ minItems: 1\n+ description:\n+ The main interrupt (INT pin) is mandatory on all devices. The w5500\n+ additionally supports an optional second interrupt for link status changes\n+ (LINKLED pin). If it is not specified, link state changes will not be\n+ reported.\n+ items:\n+ - description: Main interrupt (INT pin on the device).\n+ - description:\n+ Optional interrupt for link status changes (LINKLED pin on w5500).\n+\n+ reg:\n+ maxItems: 1\n+\n+ spi-max-frequency:\n+ description:\n+ According to the datasheets, w5500 and w5200 allow a maximum of 80 MHz\n+ while w5100 is reported by users to allow a maximum of 14 MHz. However,\n+ board designs may need to limit this value.\n+ maximum: 80000000\n+\n+required:\n+ - compatible\n+ - reg\n+ - interrupts\n+\n+allOf:\n+ - $ref: /schemas/net/ethernet-controller.yaml#\n+ - $ref: /schemas/spi/spi-peripheral-props.yaml#\n+ - if:\n+ not:\n+ properties:\n+ compatible:\n+ contains:\n+ enum:\n+ - wiznet,w5500\n+ then:\n+ properties:\n+ interrupts:\n+ maxItems: 1\n+\n+unevaluatedProperties: false\n+\n+examples:\n+ - |\n+ /* Example (for Raspberry Pi with pin control stuff for GPIO irq) */\n+\n+ #include \u003cdt-bindings/interrupt-controller/irq.h\u003e\n+\n+ spi {\n+ #address-cells = \u003c1\u003e;\n+ #size-cells = \u003c0\u003e;\n+\n+ ethernet@0 {\n+ compatible = \"wiznet,w5500\";\n+ reg = \u003c0\u003e;\n+ interrupt-parent = \u003c\u0026gpio\u003e;\n+ interrupts = \u003c25 IRQ_TYPE_LEVEL_LOW\u003e,\n+ \u003c24 IRQ_TYPE_EDGE_BOTH\u003e;\n+ local-mac-address = [ a0 b0 c0 d0 e0 f0 ];\n+ pinctrl-0 = \u003c\u0026eth1_pins\u003e;\n+ pinctrl-names = \"default\";\n+ spi-max-frequency = \u003c30000000\u003e;\n+ };\n+ };\n+...\ndiff --git a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt b/Documentation/devicetree/bindings/net/wiznet,w5x00.txt\ndeleted file mode 100644\nindex e9665798c4be6..0000000000000\n--- a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt\n+++ /dev/null\n@@ -1,50 +0,0 @@\n-* Wiznet w5x00\n-\n-This is a standalone 10/100 MBit Ethernet controller with SPI interface.\n-\n-For each device connected to a SPI bus, define a child node within\n-the SPI master node.\n-\n-Required properties:\n-- compatible: Should be one of the following strings:\n-\t \"wiznet,w5100\"\n-\t \"wiznet,w5200\"\n-\t \"wiznet,w5500\"\n-- reg: Specify the SPI chip select the chip is wired to.\n-- interrupts: Specify the interrupt index within the interrupt controller (referred\n- to above in interrupt-parent) and interrupt type. w5x00 natively\n- generates falling edge interrupts, however, additional board logic\n- might invert the signal.\n-- pinctrl-names: List of assigned state names, see pinctrl binding documentation.\n-- pinctrl-0: List of phandles to configure the GPIO pin used as interrupt line,\n- see also generic and your platform specific pinctrl binding\n- documentation.\n-\n-Optional properties:\n-- spi-max-frequency: Maximum frequency of the SPI bus when accessing the w5500.\n- According to the w5500 datasheet, the chip allows a maximum of 80 MHz, however,\n- board designs may need to limit this value.\n-- local-mac-address: See ethernet.txt in the same directory.\n-\n-\n-Example (for Raspberry Pi with pin control stuff for GPIO irq):\n-\n-\u0026spi {\n-\tethernet@0: w5500@0 {\n-\t\tcompatible = \"wiznet,w5500\";\n-\t\treg = \u003c0\u003e;\n-\t\tpinctrl-names = \"default\";\n-\t\tpinctrl-0 = \u003c\u0026eth1_pins\u003e;\n-\t\tinterrupt-parent = \u003c\u0026gpio\u003e;\n-\t\tinterrupts = \u003c25 IRQ_TYPE_EDGE_FALLING\u003e;\n-\t\tspi-max-frequency = \u003c30000000\u003e;\n-\t};\n-};\n-\n-\u0026gpio {\n-\teth1_pins: eth1_pins {\n-\t\tbrcm,pins = \u003c25\u003e;\n-\t\tbrcm,function = \u003c0\u003e; /* in */\n-\t\tbrcm,pull = \u003c0\u003e; /* none */\n-\t};\n-};\ndiff --git a/MAINTAINERS b/MAINTAINERS\nindex e3ce77c839b0b..e6028e8e564ce 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -29451,6 +29451,13 @@ M:\tMiloslav Trmac \u003cmitr@volny.cz\u003e\n S:\tMaintained\n F:\tdrivers/input/misc/wistron_btns.c\n \n+WIZNET W5100 ETHERNET DRIVER\n+M:\tArthur Crepin Leblond \u003carthur@marmottus.net\u003e\n+L:\tnetdev@vger.kernel.org\n+S:\tMaintained\n+F:\tDocumentation/devicetree/bindings/net/wiznet,w5100.yaml\n+F:\tdrivers/net/ethernet/wiznet/\n+\n WMI BINARY MOF DRIVER\n M:\tArmin Wolf \u003cW_Armin@gmx.de\u003e\n R:\tThomas Weißschuh \u003clinux@weissschuh.net\u003e\ndiff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c\nindex 53d8dc642fbd6..dff39ba8103c4 100644\n--- a/drivers/net/ethernet/wiznet/w5100.c\n+++ b/drivers/net/ethernet/wiznet/w5100.c\n@@ -18,9 +18,11 @@\n #include \u003clinux/delay.h\u003e\n #include \u003clinux/slab.h\u003e\n #include \u003clinux/spinlock.h\u003e\n+#include \u003clinux/mutex.h\u003e\n #include \u003clinux/io.h\u003e\n #include \u003clinux/ioport.h\u003e\n #include \u003clinux/interrupt.h\u003e\n+#include \u003clinux/property.h\u003e\n #include \u003clinux/irq.h\u003e\n \n #include \"w5100.h\"\n@@ -124,6 +126,8 @@ MODULE_LICENSE(\"GPL\");\n */\n #define W5500_SIMR\t\t0x0018 /* Socket Interrupt Mask Register */\n #define W5500_RTR\t\t0x0019 /* Retry Time-value Register */\n+#define W5500_PHYCFGR\t\t0x002e /* PHY Configuration Register */\n+#define PHYCFGR_LNK\t\t 0x01 /* Link status */\n \n #define W5500_S0_REGS\t\t0x10000\n \n@@ -154,6 +158,9 @@ struct w5100_priv {\n \tu16 s0_rx_buf_size;\n \n \tint irq;\n+\tint link_irq;\n+\t/* Protects link state and carrier updates */\n+\tstruct mutex link_lock;\n \n \tstruct napi_struct napi;\n \tstruct net_device *ndev;\n@@ -345,6 +352,82 @@ static void w5500_memory_configure(struct w5100_priv *priv)\n \t}\n }\n \n+static int w5500_get_phycfgr_lnk(struct net_device *ndev)\n+{\n+\tstruct w5100_priv *priv = netdev_priv(ndev);\n+\tint retries = 3;\n+\tint ret;\n+\n+\tdo {\n+\t\tret = w5100_read(priv, W5500_PHYCFGR);\n+\t\tif (ret \u003c 0)\n+\t\t\tnetif_err(priv, link, ndev,\n+\t\t\t\t \"failed to read link status: %d\\n\", ret);\n+\t} while (ret \u003c 0 \u0026\u0026 --retries);\n+\n+\tif (ret \u003c 0)\n+\t\treturn ret;\n+\n+\treturn ret \u0026 PHYCFGR_LNK;\n+}\n+\n+static void w5500_report_carrier_state(struct net_device *ndev)\n+{\n+\tstruct w5100_priv *priv = netdev_priv(ndev);\n+\tint state;\n+\n+\tmutex_lock(\u0026priv-\u003elink_lock);\n+\n+\tstate = w5500_get_phycfgr_lnk(ndev);\n+\tif (state \u003e 0) {\n+\t\tnetif_info(priv, link, ndev, \"link is up\\n\");\n+\t\tnetif_carrier_on(ndev);\n+\t} else if (state == 0) {\n+\t\tnetif_info(priv, link, ndev, \"link is down\\n\");\n+\t\tnetif_carrier_off(ndev);\n+\t}\n+\n+\tmutex_unlock(\u0026priv-\u003elink_lock);\n+}\n+\n+static irqreturn_t w5500_detect_link_interrupt(int irq, void *ndev_instance)\n+{\n+\tstruct net_device *ndev = ndev_instance;\n+\n+\tif (netif_running(ndev))\n+\t\tw5500_report_carrier_state(ndev);\n+\n+\treturn IRQ_HANDLED;\n+}\n+\n+static u32 w5500_get_link(struct net_device *ndev)\n+{\n+\tstruct w5100_priv *priv = netdev_priv(ndev);\n+\tint state;\n+\tbool link;\n+\n+\tmutex_lock(\u0026priv-\u003elink_lock);\n+\n+\tif (!netif_device_present(ndev)) {\n+\t\tlink = netif_carrier_ok(ndev);\n+\t\tgoto out;\n+\t}\n+\n+\tstate = w5500_get_phycfgr_lnk(ndev);\n+\n+\tif (state \u003c 0) {\n+\t\tlink = netif_carrier_ok(ndev);\n+\t\tgoto out;\n+\t}\n+\n+\tlink = state \u003e 0;\n+\n+out:\n+\tmutex_unlock(\u0026priv-\u003elink_lock);\n+\n+\treturn link;\n+}\n+\n static int w5100_hw_reset(struct w5100_priv *priv)\n {\n \tu32 rtr;\n@@ -448,12 +531,28 @@ static void w5100_restart(struct net_device *ndev)\n {\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n+\tif (!netif_running(ndev) || !netif_device_present(ndev))\n+\t\treturn;\n+\n+\tdisable_irq(priv-\u003eirq);\n+\tif (priv-\u003elink_irq \u003e 0)\n+\t\tdisable_irq(priv-\u003elink_irq);\n+\n \tnetif_stop_queue(ndev);\n+\tw5100_hw_close(priv);\n+\tflush_work(\u0026priv-\u003erx_work);\n+\tflush_work(\u0026priv-\u003etx_work);\n \tw5100_hw_reset(priv);\n+\tenable_irq(priv-\u003eirq);\n \tw5100_hw_start(priv);\n \tndev-\u003estats.tx_errors++;\n \tnetif_trans_update(ndev);\n \tnetif_wake_queue(ndev);\n+\n+\tif (priv-\u003elink_irq \u003e 0) {\n+\t\tenable_irq(priv-\u003elink_irq);\n+\t\tw5500_report_carrier_state(ndev);\n+\t}\n }\n \n static void w5100_restart_work(struct work_struct *work)\n@@ -468,10 +567,7 @@ static void w5100_tx_timeout(struct net_device *ndev, unsigned int txqueue)\n {\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n-\tif (priv-\u003eops-\u003emay_sleep)\n-\t\tschedule_work(\u0026priv-\u003erestart_work);\n-\telse\n-\t\tw5100_restart(ndev);\n+\tschedule_work(\u0026priv-\u003erestart_work);\n }\n \n static void w5100_tx_skb(struct net_device *ndev, struct sk_buff *skb)\n@@ -564,7 +660,8 @@ static void w5100_rx_work(struct work_struct *work)\n \twhile ((skb = w5100_rx_skb(priv-\u003endev)))\n \t\tnetif_rx(skb);\n \n-\tw5100_enable_intr(priv);\n+\tif (netif_running(priv-\u003endev))\n+\t\tw5100_enable_intr(priv);\n }\n \n static int w5100_napi_poll(struct napi_struct *napi, int budget)\n@@ -656,9 +753,17 @@ static int w5100_open(struct net_device *ndev)\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n \tnetif_info(priv, ifup, ndev, \"enabling\\n\");\n+\tw5100_hw_reset(priv);\n+\tenable_irq(priv-\u003eirq);\n \tw5100_hw_start(priv);\n \tnapi_enable(\u0026priv-\u003enapi);\n \tnetif_start_queue(ndev);\n+\n+\tif (priv-\u003elink_irq \u003e 0) {\n+\t\tenable_irq(priv-\u003elink_irq);\n+\t\tw5500_report_carrier_state(ndev);\n+\t}\n+\n \treturn 0;\n }\n \n@@ -667,13 +772,40 @@ static int w5100_stop(struct net_device *ndev)\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n \tnetif_info(priv, ifdown, ndev, \"shutting down\\n\");\n-\tw5100_hw_close(priv);\n-\tnetif_carrier_off(ndev);\n+\n+\tdisable_irq(priv-\u003eirq);\n+\tif (priv-\u003elink_irq \u003e 0)\n+\t\tdisable_irq(priv-\u003elink_irq);\n+\n \tnetif_stop_queue(ndev);\n \tnapi_disable(\u0026priv-\u003enapi);\n+\n+\tcancel_work_sync(\u0026priv-\u003erestart_work);\n+\tcancel_work_sync(\u0026priv-\u003esetrx_work);\n+\n+\tw5100_hw_close(priv);\n+\n+\tflush_work(\u0026priv-\u003erx_work);\n+\tflush_work(\u0026priv-\u003etx_work);\n+\n+\tif (priv-\u003elink_irq \u003e 0) {\n+\t\tmutex_lock(\u0026priv-\u003elink_lock);\n+\t\tnetif_carrier_off(ndev);\n+\t\tmutex_unlock(\u0026priv-\u003elink_lock);\n+\t}\n+\n \treturn 0;\n }\n \n+static const struct ethtool_ops w5500_ethtool_ops = {\n+\t.get_drvinfo\t\t= w5100_get_drvinfo,\n+\t.get_msglevel\t\t= w5100_get_msglevel,\n+\t.set_msglevel\t\t= w5100_set_msglevel,\n+\t.get_link\t\t= w5500_get_link,\n+\t.get_regs_len\t\t= w5100_get_regs_len,\n+\t.get_regs\t\t= w5100_get_regs,\n+};\n+\n static const struct ethtool_ops w5100_ethtool_ops = {\n \t.get_drvinfo\t\t= w5100_get_drvinfo,\n \t.get_msglevel\t\t= w5100_get_msglevel,\n@@ -721,6 +853,8 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \tdev_set_drvdata(dev, ndev);\n \tpriv = netdev_priv(ndev);\n \n+\tmutex_init(\u0026priv-\u003elink_lock);\n+\n \tswitch (ops-\u003echip_id) {\n \tcase W5100:\n \t\tpriv-\u003es0_regs = W5100_S0_REGS;\n@@ -745,15 +879,27 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \t\tbreak;\n \tdefault:\n \t\terr = -EINVAL;\n-\t\tgoto err_register;\n+\t\tgoto err_mutex;\n \t}\n \n \tpriv-\u003endev = ndev;\n \tpriv-\u003eops = ops;\n \tpriv-\u003eirq = irq;\n \n+\tpriv-\u003elink_irq = -EINVAL;\n+\tif (ops-\u003echip_id == W5500) {\n+\t\tpriv-\u003elink_irq = fwnode_irq_get(dev_fwnode(dev), 1);\n+\t\tif (priv-\u003elink_irq == -EPROBE_DEFER) {\n+\t\t\terr = dev_err_probe(dev, priv-\u003elink_irq,\n+\t\t\t\t\t \"failed to get link irq\\n\");\n+\t\t\tgoto err_mutex;\n+\t\t}\n+\t}\n+\n \tndev-\u003enetdev_ops = \u0026w5100_netdev_ops;\n-\tndev-\u003eethtool_ops = \u0026w5100_ethtool_ops;\n+\tndev-\u003eethtool_ops = priv-\u003elink_irq \u003e 0 ? \u0026w5500_ethtool_ops :\n+\t\t\t\t\t\t \u0026w5100_ethtool_ops;\n+\n \tnetif_napi_add_weight(ndev, \u0026priv-\u003enapi, w5100_napi_poll, 16);\n \n \t/* This chip doesn't support VLAN packets with normal MTU,\n@@ -761,15 +907,11 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \t */\n \tndev-\u003efeatures |= NETIF_F_VLAN_CHALLENGED;\n \n-\terr = register_netdev(ndev);\n-\tif (err \u003c 0)\n-\t\tgoto err_register;\n-\n \tpriv-\u003exfer_wq = alloc_workqueue(\"%s\", WQ_MEM_RECLAIM | WQ_PERCPU, 0,\n-\t\t\t\t\tnetdev_name(ndev));\n+\t\t\t\t\tdev_name(dev));\n \tif (!priv-\u003exfer_wq) {\n \t\terr = -ENOMEM;\n-\t\tgoto err_wq;\n+\t\tgoto err_mutex;\n \t}\n \n \tINIT_WORK(\u0026priv-\u003erx_work, w5100_rx_work);\n@@ -794,22 +936,45 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n \n \tif (ops-\u003emay_sleep) {\n \t\terr = request_threaded_irq(priv-\u003eirq, NULL, w5100_interrupt,\n-\t\t\t\t\t IRQF_TRIGGER_LOW | IRQF_ONESHOT,\n-\t\t\t\t\t netdev_name(ndev), ndev);\n+\t\t\t\t\t IRQF_TRIGGER_LOW | IRQF_ONESHOT |\n+\t\t\t\t\t IRQF_NO_AUTOEN,\n+\t\t\t\t\t dev_name(dev), ndev);\n \t} else {\n \t\terr = request_irq(priv-\u003eirq, w5100_interrupt,\n-\t\t\t\t IRQF_TRIGGER_LOW, netdev_name(ndev), ndev);\n+\t\t\t\t IRQF_TRIGGER_LOW | IRQF_NO_AUTOEN,\n+\t\t\t\t dev_name(dev), ndev);\n \t}\n \tif (err)\n \t\tgoto err_hw;\n \n+\tif (priv-\u003elink_irq \u003e 0) {\n+\t\terr = request_threaded_irq(priv-\u003elink_irq, NULL,\n+\t\t\t\t\t w5500_detect_link_interrupt,\n+\t\t\t\t\t IRQF_TRIGGER_RISING |\n+\t\t\t\t\t IRQF_TRIGGER_FALLING |\n+\t\t\t\t\t IRQF_ONESHOT | IRQF_NO_AUTOEN,\n+\t\t\t\t\t \"w5100-link\", ndev);\n+\t\tif (err \u003c 0)\n+\t\t\tgoto err_irq;\n+\n+\t\tnetif_carrier_off(ndev);\n+\t}\n+\n+\terr = register_netdev(ndev);\n+\tif (err \u003c 0)\n+\t\tgoto err_link_irq;\n+\n \treturn 0;\n \n+err_link_irq:\n+\tif (priv-\u003elink_irq \u003e 0)\n+\t\tfree_irq(priv-\u003elink_irq, ndev);\n+err_irq:\n+\tfree_irq(priv-\u003eirq, ndev);\n err_hw:\n \tdestroy_workqueue(priv-\u003exfer_wq);\n-err_wq:\n-\tunregister_netdev(ndev);\n-err_register:\n+err_mutex:\n+\tmutex_destroy(\u0026priv-\u003elink_lock);\n \tfree_netdev(ndev);\n \treturn err;\n }\n@@ -820,14 +985,21 @@ void w5100_remove(struct device *dev)\n \tstruct net_device *ndev = dev_get_drvdata(dev);\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n-\tw5100_hw_reset(priv);\n+\tunregister_netdev(ndev);\n+\n+\tif (priv-\u003elink_irq \u003e 0)\n+\t\tfree_irq(priv-\u003elink_irq, ndev);\n \tfree_irq(priv-\u003eirq, ndev);\n \n-\tflush_work(\u0026priv-\u003esetrx_work);\n-\tflush_work(\u0026priv-\u003erestart_work);\n-\tdestroy_workqueue(priv-\u003exfer_wq);\n+\tcancel_work_sync(\u0026priv-\u003esetrx_work);\n+\tcancel_work_sync(\u0026priv-\u003erestart_work);\n+\tflush_work(\u0026priv-\u003erx_work);\n+\tflush_work(\u0026priv-\u003etx_work);\n \n-\tunregister_netdev(ndev);\n+\tw5100_hw_reset(priv);\n+\n+\tdestroy_workqueue(priv-\u003exfer_wq);\n+\tmutex_destroy(\u0026priv-\u003elink_lock);\n \tfree_netdev(ndev);\n }\n EXPORT_SYMBOL_GPL(w5100_remove);\n@@ -839,10 +1011,11 @@ static int w5100_suspend(struct device *dev)\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n \tif (netif_running(ndev)) {\n-\t\tnetif_carrier_off(ndev);\n+\t\tmutex_lock(\u0026priv-\u003elink_lock);\n \t\tnetif_device_detach(ndev);\n+\t\tmutex_unlock(\u0026priv-\u003elink_lock);\n \n-\t\tw5100_hw_close(priv);\n+\t\tw5100_stop(ndev);\n \t}\n \treturn 0;\n }\n@@ -853,10 +1026,11 @@ static int w5100_resume(struct device *dev)\n \tstruct w5100_priv *priv = netdev_priv(ndev);\n \n \tif (netif_running(ndev)) {\n-\t\tw5100_hw_reset(priv);\n-\t\tw5100_hw_start(priv);\n+\t\tw5100_open(ndev);\n \n+\t\tmutex_lock(\u0026priv-\u003elink_lock);\n \t\tnetif_device_attach(ndev);\n+\t\tmutex_unlock(\u0026priv-\u003elink_lock);\n \t}\n \treturn 0;\n }\n"
} |
| 2/1 | 2026/09/26 15:06 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the Wiznet W5100/W5200/W5500 SPI Ethernet driver (drivers/net/ethernet/wiznet/w5100.c), devicetree bindings, and MAINTAINERS. This driver is for standalone SPI Ethernet controller ASICs that are not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit 21294587d147bb5b16aba72907dc28efd6540963
Author: syz-cluster <triage@syzkaller.com>
Date: Sat Sep 26 15:06:13 2026 +0000
syz-cluster: applied patch under review
diff --git a/Documentation/devicetree/bindings/net/wiznet,w5100.yaml b/Documentation/devicetree/bindings/net/wiznet,w5100.yaml
new file mode 100644
index 0000000000000..b0d1e1d699dc6
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/wiznet,w5100.yaml
@@ -0,0 +1,88 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/wiznet,w5100.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Wiznet w5100/w5200/w5500 SPI Ethernet Controller
+
+maintainers:
+ - Arthur Crepin Leblond <arthur@marmottus.net>
+
+description: |
+ This is a standalone 10/100 MBit Ethernet controller with SPI interface.
+
+properties:
+ compatible:
+ enum:
+ - wiznet,w5100
+ - wiznet,w5200
+ - wiznet,w5500
+
+ interrupts:
+ minItems: 1
+ description:
+ The main interrupt (INT pin) is mandatory on all devices. The w5500
+ additionally supports an optional second interrupt for link status changes
+ (LINKLED pin). If it is not specified, link state changes will not be
+ reported.
+ items:
+ - description: Main interrupt (INT pin on the device).
+ - description:
+ Optional interrupt for link status changes (LINKLED pin on w5500).
+
+ reg:
+ maxItems: 1
+
+ spi-max-frequency:
+ description:
+ According to the datasheets, w5500 and w5200 allow a maximum of 80 MHz
+ while w5100 is reported by users to allow a maximum of 14 MHz. However,
+ board designs may need to limit this value.
+ maximum: 80000000
+
+required:
+ - compatible
+ - reg
+ - interrupts
+
+allOf:
+ - $ref: /schemas/net/ethernet-controller.yaml#
+ - $ref: /schemas/spi/spi-peripheral-props.yaml#
+ - if:
+ not:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - wiznet,w5500
+ then:
+ properties:
+ interrupts:
+ maxItems: 1
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ /* Example (for Raspberry Pi with pin control stuff for GPIO irq) */
+
+ #include <dt-bindings/interrupt-controller/irq.h>
+
+ spi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ ethernet@0 {
+ compatible = "wiznet,w5500";
+ reg = <0>;
+ interrupt-parent = <&gpio>;
+ interrupts = <25 IRQ_TYPE_LEVEL_LOW>,
+ <24 IRQ_TYPE_EDGE_BOTH>;
+ local-mac-address = [ a0 b0 c0 d0 e0 f0 ];
+ pinctrl-0 = <ð1_pins>;
+ pinctrl-names = "default";
+ spi-max-frequency = <30000000>;
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt b/Documentation/devicetree/bindings/net/wiznet,w5x00.txt
deleted file mode 100644
index e9665798c4be6..0000000000000
--- a/Documentation/devicetree/bindings/net/wiznet,w5x00.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-* Wiznet w5x00
-
-This is a standalone 10/100 MBit Ethernet controller with SPI interface.
-
-For each device connected to a SPI bus, define a child node within
-the SPI master node.
-
-Required properties:
-- compatible: Should be one of the following strings:
- "wiznet,w5100"
- "wiznet,w5200"
- "wiznet,w5500"
-- reg: Specify the SPI chip select the chip is wired to.
-- interrupts: Specify the interrupt index within the interrupt controller (referred
- to above in interrupt-parent) and interrupt type. w5x00 natively
- generates falling edge interrupts, however, additional board logic
- might invert the signal.
-- pinctrl-names: List of assigned state names, see pinctrl binding documentation.
-- pinctrl-0: List of phandles to configure the GPIO pin used as interrupt line,
- see also generic and your platform specific pinctrl binding
- documentation.
-
-Optional properties:
-- spi-max-frequency: Maximum frequency of the SPI bus when accessing the w5500.
- According to the w5500 datasheet, the chip allows a maximum of 80 MHz, however,
- board designs may need to limit this value.
-- local-mac-address: See ethernet.txt in the same directory.
-
-
-Example (for Raspberry Pi with pin control stuff for GPIO irq):
-
-&spi {
- ethernet@0: w5500@0 {
- compatible = "wiznet,w5500";
- reg = <0>;
- pinctrl-names = "default";
- pinctrl-0 = <ð1_pins>;
- interrupt-parent = <&gpio>;
- interrupts = <25 IRQ_TYPE_EDGE_FALLING>;
- spi-max-frequency = <30000000>;
- };
-};
-
-&gpio {
- eth1_pins: eth1_pins {
- brcm,pins = <25>;
- brcm,function = <0>; /* in */
- brcm,pull = <0>; /* none */
- };
-};
diff --git a/MAINTAINERS b/MAINTAINERS
index e3ce77c839b0b..e6028e8e564ce 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -29451,6 +29451,13 @@ M: Miloslav Trmac <mitr@volny.cz>
S: Maintained
F: drivers/input/misc/wistron_btns.c
+WIZNET W5100 ETHERNET DRIVER
+M: Arthur Crepin Leblond <arthur@marmottus.net>
+L: netdev@vger.kernel.org
+S: Maintained
+F: Documentation/devicetree/bindings/net/wiznet,w5100.yaml
+F: drivers/net/ethernet/wiznet/
+
WMI BINARY MOF DRIVER
M: Armin Wolf <W_Armin@gmx.de>
R: Thomas Weißschuh <linux@weissschuh.net>
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index 53d8dc642fbd6..dff39ba8103c4 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -18,9 +18,11 @@
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/spinlock.h>
+#include <linux/mutex.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/interrupt.h>
+#include <linux/property.h>
#include <linux/irq.h>
#include "w5100.h"
@@ -124,6 +126,8 @@ MODULE_LICENSE("GPL");
*/
#define W5500_SIMR 0x0018 /* Socket Interrupt Mask Register */
#define W5500_RTR 0x0019 /* Retry Time-value Register */
+#define W5500_PHYCFGR 0x002e /* PHY Configuration Register */
+#define PHYCFGR_LNK 0x01 /* Link status */
#define W5500_S0_REGS 0x10000
@@ -154,6 +158,9 @@ struct w5100_priv {
u16 s0_rx_buf_size;
int irq;
+ int link_irq;
+ /* Protects link state and carrier updates */
+ struct mutex link_lock;
struct napi_struct napi;
struct net_device *ndev;
@@ -345,6 +352,82 @@ static void w5500_memory_configure(struct w5100_priv *priv)
}
}
+static int w5500_get_phycfgr_lnk(struct net_device *ndev)
+{
+ struct w5100_priv *priv = netdev_priv(ndev);
+ int retries = 3;
+ int ret;
+
+ do {
+ ret = w5100_read(priv, W5500_PHYCFGR);
+ if (ret < 0)
+ netif_err(priv, link, ndev,
+ "failed to read link status: %d\n", ret);
+ } while (ret < 0 && --retries);
+
+ if (ret < 0)
+ return ret;
+
+ return ret & PHYCFGR_LNK;
+}
+
+static void w5500_report_carrier_state(struct net_device *ndev)
+{
+ struct w5100_priv *priv = netdev_priv(ndev);
+ int state;
+
+ mutex_lock(&priv->link_lock);
+
+ state = w5500_get_phycfgr_lnk(ndev);
+ if (state > 0) {
+ netif_info(priv, link, ndev, "link is up\n");
+ netif_carrier_on(ndev);
+ } else if (state == 0) {
+ netif_info(priv, link, ndev, "link is down\n");
+ netif_carrier_off(ndev);
+ }
+
+ mutex_unlock(&priv->link_lock);
+}
+
+static irqreturn_t w5500_detect_link_interrupt(int irq, void *ndev_instance)
+{
+ struct net_device *ndev = ndev_instance;
+
+ if (netif_running(ndev))
+ w5500_report_carrier_state(ndev);
+
+ return IRQ_HANDLED;
+}
+
+static u32 w5500_get_link(struct net_device *ndev)
+{
+ struct w5100_priv *priv = netdev_priv(ndev);
+ int state;
+ bool link;
+
+ mutex_lock(&priv->link_lock);
+
+ if (!netif_device_present(ndev)) {
+ link = netif_carrier_ok(ndev);
+ goto out;
+ }
+
+ state = w5500_get_phycfgr_lnk(ndev);
+
+ if (state < 0) {
+ link = netif_carrier_ok(ndev);
+ goto out;
+ }
+
+ link = state > 0;
+
+out:
+ mutex_unlock(&priv->link_lock);
+
+ return link;
+}
+
static int w5100_hw_reset(struct w5100_priv *priv)
{
u32 rtr;
@@ -448,12 +531,28 @@ static void w5100_restart(struct net_device *ndev)
{
struct w5100_priv *priv = netdev_priv(ndev);
+ if (!netif_running(ndev) || !netif_device_present(ndev))
+ return;
+
+ disable_irq(priv->irq);
+ if (priv->link_irq > 0)
+ disable_irq(priv->link_irq);
+
netif_stop_queue(ndev);
+ w5100_hw_close(priv);
+ flush_work(&priv->rx_work);
+ flush_work(&priv->tx_work);
w5100_hw_reset(priv);
+ enable_irq(priv->irq);
w5100_hw_start(priv);
ndev->stats.tx_errors++;
netif_trans_update(ndev);
netif_wake_queue(ndev);
+
+ if (priv->link_irq > 0) {
+ enable_irq(priv->link_irq);
+ w5500_report_carrier_state(ndev);
+ }
}
static void w5100_restart_work(struct work_struct *work)
@@ -468,10 +567,7 @@ static void w5100_tx_timeout(struct net_device *ndev, unsigned int txqueue)
{
struct w5100_priv *priv = netdev_priv(ndev);
- if (priv->ops->may_sleep)
- schedule_work(&priv->restart_work);
- else
- w5100_restart(ndev);
+ schedule_work(&priv->restart_work);
}
static void w5100_tx_skb(struct net_device *ndev, struct sk_buff *skb)
@@ -564,7 +660,8 @@ static void w5100_rx_work(struct work_struct *work)
while ((skb = w5100_rx_skb(priv->ndev)))
netif_rx(skb);
- w5100_enable_intr(priv);
+ if (netif_running(priv->ndev))
+ w5100_enable_intr(priv);
}
static int w5100_napi_poll(struct napi_struct *napi, int budget)
@@ -656,9 +753,17 @@ static int w5100_open(struct net_device *ndev)
struct w5100_priv *priv = netdev_priv(ndev);
netif_info(priv, ifup, ndev, "enabling\n");
+ w5100_hw_reset(priv);
+ enable_irq(priv->irq);
w5100_hw_start(priv);
napi_enable(&priv->napi);
netif_start_queue(ndev);
+
+ if (priv->link_irq > 0) {
+ enable_irq(priv->link_irq);
+ w5500_report_carrier_state(ndev);
+ }
+
return 0;
}
@@ -667,13 +772,40 @@ static int w5100_stop(struct net_device *ndev)
struct w5100_priv *priv = netdev_priv(ndev);
netif_info(priv, ifdown, ndev, "shutting down\n");
- w5100_hw_close(priv);
- netif_carrier_off(ndev);
+
+ disable_irq(priv->irq);
+ if (priv->link_irq > 0)
+ disable_irq(priv->link_irq);
+
netif_stop_queue(ndev);
napi_disable(&priv->napi);
+
+ cancel_work_sync(&priv->restart_work);
+ cancel_work_sync(&priv->setrx_work);
+
+ w5100_hw_close(priv);
+
+ flush_work(&priv->rx_work);
+ flush_work(&priv->tx_work);
+
+ if (priv->link_irq > 0) {
+ mutex_lock(&priv->link_lock);
+ netif_carrier_off(ndev);
+ mutex_unlock(&priv->link_lock);
+ }
+
return 0;
}
+static const struct ethtool_ops w5500_ethtool_ops = {
+ .get_drvinfo = w5100_get_drvinfo,
+ .get_msglevel = w5100_get_msglevel,
+ .set_msglevel = w5100_set_msglevel,
+ .get_link = w5500_get_link,
+ .get_regs_len = w5100_get_regs_len,
+ .get_regs = w5100_get_regs,
+};
+
static const struct ethtool_ops w5100_ethtool_ops = {
.get_drvinfo = w5100_get_drvinfo,
.get_msglevel = w5100_get_msglevel,
@@ -721,6 +853,8 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
dev_set_drvdata(dev, ndev);
priv = netdev_priv(ndev);
+ mutex_init(&priv->link_lock);
+
switch (ops->chip_id) {
case W5100:
priv->s0_regs = W5100_S0_REGS;
@@ -745,15 +879,27 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
break;
default:
err = -EINVAL;
- goto err_register;
+ goto err_mutex;
}
priv->ndev = ndev;
priv->ops = ops;
priv->irq = irq;
+ priv->link_irq = -EINVAL;
+ if (ops->chip_id == W5500) {
+ priv->link_irq = fwnode_irq_get(dev_fwnode(dev), 1);
+ if (priv->link_irq == -EPROBE_DEFER) {
+ err = dev_err_probe(dev, priv->link_irq,
+ "failed to get link irq\n");
+ goto err_mutex;
+ }
+ }
+
ndev->netdev_ops = &w5100_netdev_ops;
- ndev->ethtool_ops = &w5100_ethtool_ops;
+ ndev->ethtool_ops = priv->link_irq > 0 ? &w5500_ethtool_ops :
+ &w5100_ethtool_ops;
+
netif_napi_add_weight(ndev, &priv->napi, w5100_napi_poll, 16);
/* This chip doesn't support VLAN packets with normal MTU,
@@ -761,15 +907,11 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
*/
ndev->features |= NETIF_F_VLAN_CHALLENGED;
- err = register_netdev(ndev);
- if (err < 0)
- goto err_register;
-
priv->xfer_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM | WQ_PERCPU, 0,
- netdev_name(ndev));
+ dev_name(dev));
if (!priv->xfer_wq) {
err = -ENOMEM;
- goto err_wq;
+ goto err_mutex;
}
INIT_WORK(&priv->rx_work, w5100_rx_work);
@@ -794,22 +936,45 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
if (ops->may_sleep) {
err = request_threaded_irq(priv->irq, NULL, w5100_interrupt,
- IRQF_TRIGGER_LOW | IRQF_ONESHOT,
- netdev_name(ndev), ndev);
+ IRQF_TRIGGER_LOW | IRQF_ONESHOT |
+ IRQF_NO_AUTOEN,
+ dev_name(dev), ndev);
} else {
err = request_irq(priv->irq, w5100_interrupt,
- IRQF_TRIGGER_LOW, netdev_name(ndev), ndev);
+ IRQF_TRIGGER_LOW | IRQF_NO_AUTOEN,
+ dev_name(dev), ndev);
}
if (err)
goto err_hw;
+ if (priv->link_irq > 0) {
+ err = request_threaded_irq(priv->link_irq, NULL,
+ w5500_detect_link_interrupt,
+ IRQF_TRIGGER_RISING |
+ IRQF_TRIGGER_FALLING |
+ IRQF_ONESHOT | IRQF_NO_AUTOEN,
+ "w5100-link", ndev);
+ if (err < 0)
+ goto err_irq;
+
+ netif_carrier_off(ndev);
+ }
+
+ err = register_netdev(ndev);
+ if (err < 0)
+ goto err_link_irq;
+
return 0;
+err_link_irq:
+ if (priv->link_irq > 0)
+ free_irq(priv->link_irq, ndev);
+err_irq:
+ free_irq(priv->irq, ndev);
err_hw:
destroy_workqueue(priv->xfer_wq);
-err_wq:
- unregister_netdev(ndev);
-err_register:
+err_mutex:
+ mutex_destroy(&priv->link_lock);
free_netdev(ndev);
return err;
}
@@ -820,14 +985,21 @@ void w5100_remove(struct device *dev)
struct net_device *ndev = dev_get_drvdata(dev);
struct w5100_priv *priv = netdev_priv(ndev);
- w5100_hw_reset(priv);
+ unregister_netdev(ndev);
+
+ if (priv->link_irq > 0)
+ free_irq(priv->link_irq, ndev);
free_irq(priv->irq, ndev);
- flush_work(&priv->setrx_work);
- flush_work(&priv->restart_work);
- destroy_workqueue(priv->xfer_wq);
+ cancel_work_sync(&priv->setrx_work);
+ cancel_work_sync(&priv->restart_work);
+ flush_work(&priv->rx_work);
+ flush_work(&priv->tx_work);
- unregister_netdev(ndev);
+ w5100_hw_reset(priv);
+
+ destroy_workqueue(priv->xfer_wq);
+ mutex_destroy(&priv->link_lock);
free_netdev(ndev);
}
EXPORT_SYMBOL_GPL(w5100_remove);
@@ -839,10 +1011,11 @@ static int w5100_suspend(struct device *dev)
struct w5100_priv *priv = netdev_priv(ndev);
if (netif_running(ndev)) {
- netif_carrier_off(ndev);
+ mutex_lock(&priv->link_lock);
netif_device_detach(ndev);
+ mutex_unlock(&priv->link_lock);
- w5100_hw_close(priv);
+ w5100_stop(ndev);
}
return 0;
}
@@ -853,10 +1026,11 @@ static int w5100_resume(struct device *dev)
struct w5100_priv *priv = netdev_priv(ndev);
if (netif_running(ndev)) {
- w5100_hw_reset(priv);
- w5100_hw_start(priv);
+ w5100_open(ndev);
+ mutex_lock(&priv->link_lock);
netif_device_attach(ndev);
+ mutex_unlock(&priv->link_lock);
}
return 0;
}
|
| 3/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9353 output: 27 thoughts: 171 Thoughts: **Analyzing This Patch: A Device Tree and Driver Update** Okay, here's what's running through my head as I look at this patch. My immediate focus is on the impact and potential implications of these changes. We're looking at modifications to a few key areas, specifically a new YAML file for a `wiznet,w5100` device tree binding, the removal of an older text binding, updates to the `MAINTAINERS` file (which is always crucial), and, most importantly, changes within the `w5100.c` driver. My initial line of thought is to dive straight into `w5100.c`. I need to understand its role. What does this driver *do*? How is it integrated into the system? What bus is it designed for (SPI, I2C, etc.)? Are there any potential hardware accessibility issues? Is this hardware structurally unreachable under certain circumstances? Wait a moment… before I dig *too* deep into the C code, I need the bigger picture. I should check the overall directory, `drivers/net/ethernet/wiznet/`. I need to assess its overall structure, and review the associated Kconfig file. This should give me a better understanding of the wider context of this driver and how it's enabled or disabled in the kernel. Now, if I need more context, a quick grepper or codesearch query is probably the best way to get a bird's eye view of the code and how it's being used. |
| 4/2 | 2026/09/26 15:06 | tool | codesearch-dir-index |
0mArgs:{
"Dir": "drivers/net/ethernet/wiznet"
}Results: {
"Files": [
"w5100-spi.c",
"w5100.c",
"w5100.h"
],
"Subdirs": null
} |
| 5/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 9920 output: 32 thoughts: 30 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Kconfig Location Check** Right, let's get down to brass tacks. I need to figure out where the configuration options for this particular network driver are located within the kernel tree. My instinct, based on past experience and standard kernel organization, tells me that the relevant Kconfig files are most likely nestled within the `drivers/net/ethernet/` directory. Given the specific mention of Wiznet, the first place I'll probe is `drivers/net/ethernet/wiznet/Kconfig`. That's a logical starting point, considering Wiznet often has its own subdirectory. If I don't find what I'm looking for there, I'll broaden the scope and check the more general `drivers/net/ethernet/Kconfig` file. That's usually the fallback for more generic or shared Ethernet controller options. I'm expecting to find conditional compilation options related to that hardware's features, but also likely things like DMA and interrupt configurations. |
| 6/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "W5100",
"PathPrefix": "drivers/net/ethernet/"
}Results: {
"Output": "drivers/net/ethernet/wiznet/Kconfig=17=if NET_VENDOR_WIZNET\ndrivers/net/ethernet/wiznet/Kconfig-18-\ndrivers/net/ethernet/wiznet/Kconfig:19:config WIZNET_W5100\ndrivers/net/ethernet/wiznet/Kconfig:20:\ttristate \"WIZnet W5100/W5200/W5500 Ethernet support for SPI mode\"\ndrivers/net/ethernet/wiznet/Kconfig-21-\tdepends on SPI\ndrivers/net/ethernet/wiznet/Kconfig-22-\thelp\ndrivers/net/ethernet/wiznet/Kconfig:23:\t Support for WIZnet W5100 chips.\ndrivers/net/ethernet/wiznet/Kconfig-24-\ndrivers/net/ethernet/wiznet/Kconfig:25:\t W5100 is a single chip with integrated 10/100 Ethernet MAC,\ndrivers/net/ethernet/wiznet/Kconfig-26-\t PHY and hardware TCP/IP stack, but this driver is limited to\n--\ndrivers/net/ethernet/wiznet/Makefile-1-# SPDX-License-Identifier: GPL-2.0-only\ndrivers/net/ethernet/wiznet/Makefile:2:obj-$(CONFIG_WIZNET_W5100) += w5100.o w5100-spi.o\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-2-/*\ndrivers/net/ethernet/wiznet/w5100-spi.c:3: * Ethernet driver for the WIZnet W5100/W5200/W5500 chip.\ndrivers/net/ethernet/wiznet/w5100-spi.c-4- *\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-7- * Datasheet:\ndrivers/net/ethernet/wiznet/w5100-spi.c:8: * http://www.wiznet.co.kr/wp-content/uploads/wiznethome/Chip/W5100/Document/W5100_Datasheet_v1.2.6.pdf\ndrivers/net/ethernet/wiznet/w5100-spi.c-9- * http://wiznethome.cafe24.com/wp-content/uploads/wiznethome/Chip/W5200/Documents/W5200_DS_V140E.pdf\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-22-\ndrivers/net/ethernet/wiznet/w5100-spi.c:23:#define W5100_SPI_WRITE_OPCODE 0xf0\ndrivers/net/ethernet/wiznet/w5100-spi.c:24:#define W5100_SPI_READ_OPCODE 0x0f\ndrivers/net/ethernet/wiznet/w5100-spi.c-25-\ndrivers/net/ethernet/wiznet/w5100-spi.c=26=static int w5100_spi_read(struct net_device *ndev, u32 addr)\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-28-\tstruct spi_device *spi = to_spi_device(ndev-\u003edev.parent);\ndrivers/net/ethernet/wiznet/w5100-spi.c:29:\tu8 cmd[3] = { W5100_SPI_READ_OPCODE, addr \u003e\u003e 8, addr \u0026 0xff };\ndrivers/net/ethernet/wiznet/w5100-spi.c-30-\tu8 data;\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c=38=static int w5100_spi_write(struct net_device *ndev, u32 addr, u8 data)\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-40-\tstruct spi_device *spi = to_spi_device(ndev-\u003edev.parent);\ndrivers/net/ethernet/wiznet/w5100-spi.c:41:\tu8 cmd[4] = { W5100_SPI_WRITE_OPCODE, addr \u003e\u003e 8, addr \u0026 0xff, data};\ndrivers/net/ethernet/wiznet/w5100-spi.c-42-\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c=102=static const struct w5100_ops w5100_spi_ops = {\ndrivers/net/ethernet/wiznet/w5100-spi.c-103-\t.may_sleep = true,\ndrivers/net/ethernet/wiznet/w5100-spi.c:104:\t.chip_id = W5100,\ndrivers/net/ethernet/wiznet/w5100-spi.c-105-\t.read = w5100_spi_read,\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c=413=static const struct of_device_id w5100_of_match[] = {\ndrivers/net/ethernet/wiznet/w5100-spi.c:414:\t{ .compatible = \"wiznet,w5100\", .data = (const void*)W5100, },\ndrivers/net/ethernet/wiznet/w5100-spi.c-415-\t{ .compatible = \"wiznet,w5200\", .data = (const void*)W5200, },\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c=421=static int w5100_spi_probe(struct spi_device *spi)\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-436-\tswitch (driver_data) {\ndrivers/net/ethernet/wiznet/w5100-spi.c:437:\tcase W5100:\ndrivers/net/ethernet/wiznet/w5100-spi.c-438-\t\tops = \u0026w5100_spi_ops;\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c=461=static const struct spi_device_id w5100_spi_ids[] = {\ndrivers/net/ethernet/wiznet/w5100-spi.c:462:\t{ \"w5100\", W5100 },\ndrivers/net/ethernet/wiznet/w5100-spi.c-463-\t{ \"w5200\", W5200 },\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c=479=module_spi_driver(w5100_spi_driver);\ndrivers/net/ethernet/wiznet/w5100-spi.c-480-\ndrivers/net/ethernet/wiznet/w5100-spi.c:481:MODULE_DESCRIPTION(\"WIZnet W5100/W5200/W5500 Ethernet driver for SPI mode\");\ndrivers/net/ethernet/wiznet/w5100-spi.c-482-MODULE_AUTHOR(\"Akinobu Mita \u003cakinobu.mita@gmail.com\u003e\");\n--\ndrivers/net/ethernet/wiznet/w5100.c-2-/*\ndrivers/net/ethernet/wiznet/w5100.c:3: * Ethernet driver for the WIZnet W5100 chip.\ndrivers/net/ethernet/wiznet/w5100.c-4- *\n--\ndrivers/net/ethernet/wiznet/w5100.c-32-\ndrivers/net/ethernet/wiznet/w5100.c:33:MODULE_DESCRIPTION(\"WIZnet W5100 Ethernet driver v\"DRV_VERSION);\ndrivers/net/ethernet/wiznet/w5100.c-34-MODULE_AUTHOR(\"Mike Sinkovsky \u003cmsink@permonline.ru\u003e\");\n--\ndrivers/net/ethernet/wiznet/w5100.c=36=MODULE_LICENSE(\"GPL\");\n--\ndrivers/net/ethernet/wiznet/w5100.c-38-/*\ndrivers/net/ethernet/wiznet/w5100.c:39: * W5100/W5200/W5500 common registers\ndrivers/net/ethernet/wiznet/w5100.c-40- */\ndrivers/net/ethernet/wiznet/w5100.c:41:#define W5100_COMMON_REGS\t0x0000\ndrivers/net/ethernet/wiznet/w5100.c:42:#define W5100_MR\t\t0x0000 /* Mode Register */\ndrivers/net/ethernet/wiznet/w5100.c-43-#define MR_RST\t\t 0x80 /* S/W reset */\n--\ndrivers/net/ethernet/wiznet/w5100.c-46-#define MR_IND\t\t 0x01 /* Indirect mode */\ndrivers/net/ethernet/wiznet/w5100.c:47:#define W5100_SHAR\t\t0x0009 /* Source MAC address */\ndrivers/net/ethernet/wiznet/w5100.c:48:#define W5100_IR\t\t0x0015 /* Interrupt Register */\ndrivers/net/ethernet/wiznet/w5100.c:49:#define W5100_COMMON_REGS_LEN\t0x0040\ndrivers/net/ethernet/wiznet/w5100.c-50-\ndrivers/net/ethernet/wiznet/w5100.c:51:#define W5100_Sn_MR\t\t0x0000 /* Sn Mode Register */\ndrivers/net/ethernet/wiznet/w5100.c:52:#define W5100_Sn_CR\t\t0x0001 /* Sn Command Register */\ndrivers/net/ethernet/wiznet/w5100.c:53:#define W5100_Sn_IR\t\t0x0002 /* Sn Interrupt Register */\ndrivers/net/ethernet/wiznet/w5100.c:54:#define W5100_Sn_SR\t\t0x0003 /* Sn Status Register */\ndrivers/net/ethernet/wiznet/w5100.c:55:#define W5100_Sn_TX_FSR\t\t0x0020 /* Sn Transmit free memory size */\ndrivers/net/ethernet/wiznet/w5100.c:56:#define W5100_Sn_TX_RD\t\t0x0022 /* Sn Transmit memory read pointer */\ndrivers/net/ethernet/wiznet/w5100.c:57:#define W5100_Sn_TX_WR\t\t0x0024 /* Sn Transmit memory write pointer */\ndrivers/net/ethernet/wiznet/w5100.c:58:#define W5100_Sn_RX_RSR\t\t0x0026 /* Sn Receive free memory size */\ndrivers/net/ethernet/wiznet/w5100.c:59:#define W5100_Sn_RX_RD\t\t0x0028 /* Sn Receive memory read pointer */\ndrivers/net/ethernet/wiznet/w5100.c-60-\n--\ndrivers/net/ethernet/wiznet/w5100.c-62-\ndrivers/net/ethernet/wiznet/w5100.c:63:#define W5100_S0_MR(priv)\t(S0_REGS(priv) + W5100_Sn_MR)\ndrivers/net/ethernet/wiznet/w5100.c-64-#define S0_MR_MACRAW\t\t 0x04 /* MAC RAW mode */\ndrivers/net/ethernet/wiznet/w5100.c:65:#define S0_MR_MF\t\t 0x40 /* MAC Filter for W5100 and W5200 */\ndrivers/net/ethernet/wiznet/w5100.c-66-#define W5500_S0_MR_MF\t 0x80 /* MAC Filter for W5500 */\ndrivers/net/ethernet/wiznet/w5100.c:67:#define W5100_S0_CR(priv)\t(S0_REGS(priv) + W5100_Sn_CR)\ndrivers/net/ethernet/wiznet/w5100.c-68-#define S0_CR_OPEN\t\t 0x01 /* OPEN command */\n--\ndrivers/net/ethernet/wiznet/w5100.c-71-#define S0_CR_RECV\t\t 0x40 /* RECV command */\ndrivers/net/ethernet/wiznet/w5100.c:72:#define W5100_S0_IR(priv)\t(S0_REGS(priv) + W5100_Sn_IR)\ndrivers/net/ethernet/wiznet/w5100.c-73-#define S0_IR_SENDOK\t\t 0x10 /* complete sending */\ndrivers/net/ethernet/wiznet/w5100.c-74-#define S0_IR_RECV\t\t 0x04 /* receiving data */\ndrivers/net/ethernet/wiznet/w5100.c:75:#define W5100_S0_SR(priv)\t(S0_REGS(priv) + W5100_Sn_SR)\ndrivers/net/ethernet/wiznet/w5100.c-76-#define S0_SR_MACRAW\t\t 0x42 /* mac raw mode */\ndrivers/net/ethernet/wiznet/w5100.c:77:#define W5100_S0_TX_FSR(priv)\t(S0_REGS(priv) + W5100_Sn_TX_FSR)\ndrivers/net/ethernet/wiznet/w5100.c:78:#define W5100_S0_TX_RD(priv)\t(S0_REGS(priv) + W5100_Sn_TX_RD)\ndrivers/net/ethernet/wiznet/w5100.c:79:#define W5100_S0_TX_WR(priv)\t(S0_REGS(priv) + W5100_Sn_TX_WR)\ndrivers/net/ethernet/wiznet/w5100.c:80:#define W5100_S0_RX_RSR(priv)\t(S0_REGS(priv) + W5100_Sn_RX_RSR)\ndrivers/net/ethernet/wiznet/w5100.c:81:#define W5100_S0_RX_RD(priv)\t(S0_REGS(priv) + W5100_Sn_RX_RD)\ndrivers/net/ethernet/wiznet/w5100.c-82-\ndrivers/net/ethernet/wiznet/w5100.c:83:#define W5100_S0_REGS_LEN\t0x0040\ndrivers/net/ethernet/wiznet/w5100.c-84-\ndrivers/net/ethernet/wiznet/w5100.c-85-/*\ndrivers/net/ethernet/wiznet/w5100.c:86: * W5100 and W5200 common registers\ndrivers/net/ethernet/wiznet/w5100.c-87- */\ndrivers/net/ethernet/wiznet/w5100.c:88:#define W5100_IMR\t\t0x0016 /* Interrupt Mask Register */\ndrivers/net/ethernet/wiznet/w5100.c-89-#define IR_S0\t\t\t 0x01 /* S0 interrupt */\ndrivers/net/ethernet/wiznet/w5100.c:90:#define W5100_RTR\t\t0x0017 /* Retry Time-value Register */\ndrivers/net/ethernet/wiznet/w5100.c-91-#define RTR_DEFAULT\t\t 2000 /* =0x07d0 (2000) */\n--\ndrivers/net/ethernet/wiznet/w5100.c-93-/*\ndrivers/net/ethernet/wiznet/w5100.c:94: * W5100 specific register and memory\ndrivers/net/ethernet/wiznet/w5100.c-95- */\ndrivers/net/ethernet/wiznet/w5100.c:96:#define W5100_RMSR\t\t0x001a /* Receive Memory Size */\ndrivers/net/ethernet/wiznet/w5100.c:97:#define W5100_TMSR\t\t0x001b /* Transmit Memory Size */\ndrivers/net/ethernet/wiznet/w5100.c-98-\ndrivers/net/ethernet/wiznet/w5100.c:99:#define W5100_S0_REGS\t\t0x0400\ndrivers/net/ethernet/wiznet/w5100.c-100-\ndrivers/net/ethernet/wiznet/w5100.c:101:#define W5100_TX_MEM_START\t0x4000\ndrivers/net/ethernet/wiznet/w5100.c:102:#define W5100_TX_MEM_SIZE\t0x2000\ndrivers/net/ethernet/wiznet/w5100.c:103:#define W5100_RX_MEM_START\t0x6000\ndrivers/net/ethernet/wiznet/w5100.c:104:#define W5100_RX_MEM_SIZE\t0x2000\ndrivers/net/ethernet/wiznet/w5100.c-105-\n--\ndrivers/net/ethernet/wiznet/w5100.c=256=static int w5100_reset(struct w5100_priv *priv)\n--\ndrivers/net/ethernet/wiznet/w5100.c-260-\ndrivers/net/ethernet/wiznet/w5100.c:261:\tw5100_write(priv, W5100_MR, MR_RST);\ndrivers/net/ethernet/wiznet/w5100.c-262-\tmdelay(5);\ndrivers/net/ethernet/wiznet/w5100.c:263:\tw5100_write(priv, W5100_MR, MR_PB);\ndrivers/net/ethernet/wiznet/w5100.c-264-\n--\ndrivers/net/ethernet/wiznet/w5100.c=268=static int w5100_command(struct w5100_priv *priv, u16 cmd)\n--\ndrivers/net/ethernet/wiznet/w5100.c-271-\ndrivers/net/ethernet/wiznet/w5100.c:272:\tw5100_write(priv, W5100_S0_CR(priv), cmd);\ndrivers/net/ethernet/wiznet/w5100.c-273-\n--\ndrivers/net/ethernet/wiznet/w5100.c-275-\ndrivers/net/ethernet/wiznet/w5100.c:276:\twhile (w5100_read(priv, W5100_S0_CR(priv)) != 0) {\ndrivers/net/ethernet/wiznet/w5100.c-277-\t\tif (time_after(jiffies, timeout))\n--\ndrivers/net/ethernet/wiznet/w5100.c=285=static void w5100_write_macaddr(struct w5100_priv *priv)\n--\ndrivers/net/ethernet/wiznet/w5100.c-288-\ndrivers/net/ethernet/wiznet/w5100.c:289:\tw5100_writebulk(priv, W5100_SHAR, ndev-\u003edev_addr, ETH_ALEN);\ndrivers/net/ethernet/wiznet/w5100.c-290-}\n--\ndrivers/net/ethernet/wiznet/w5100.c=292=static void w5100_socket_intr_mask(struct w5100_priv *priv, u8 mask)\n--\ndrivers/net/ethernet/wiznet/w5100.c-298-\telse\ndrivers/net/ethernet/wiznet/w5100.c:299:\t\timr = W5100_IMR;\ndrivers/net/ethernet/wiznet/w5100.c-300-\n--\ndrivers/net/ethernet/wiznet/w5100.c=314=static void w5100_memory_configure(struct w5100_priv *priv)\n--\ndrivers/net/ethernet/wiznet/w5100.c-318-\t */\ndrivers/net/ethernet/wiznet/w5100.c:319:\tw5100_write(priv, W5100_RMSR, 0x03);\ndrivers/net/ethernet/wiznet/w5100.c:320:\tw5100_write(priv, W5100_TMSR, 0x03);\ndrivers/net/ethernet/wiznet/w5100.c-321-}\n--\ndrivers/net/ethernet/wiznet/w5100.c=431=static int w5100_hw_reset(struct w5100_priv *priv)\n--\ndrivers/net/ethernet/wiznet/w5100.c-440-\tswitch (priv-\u003eops-\u003echip_id) {\ndrivers/net/ethernet/wiznet/w5100.c:441:\tcase W5100:\ndrivers/net/ethernet/wiznet/w5100.c-442-\t\tw5100_memory_configure(priv);\ndrivers/net/ethernet/wiznet/w5100.c:443:\t\trtr = W5100_RTR;\ndrivers/net/ethernet/wiznet/w5100.c-444-\t\tbreak;\n--\ndrivers/net/ethernet/wiznet/w5100.c-446-\t\tw5200_memory_configure(priv);\ndrivers/net/ethernet/wiznet/w5100.c:447:\t\trtr = W5100_RTR;\ndrivers/net/ethernet/wiznet/w5100.c-448-\t\tbreak;\n--\ndrivers/net/ethernet/wiznet/w5100.c=463=static void w5100_hw_start(struct w5100_priv *priv)\n--\ndrivers/net/ethernet/wiznet/w5100.c-473-\ndrivers/net/ethernet/wiznet/w5100.c:474:\tw5100_write(priv, W5100_S0_MR(priv), mode);\ndrivers/net/ethernet/wiznet/w5100.c-475-\tw5100_command(priv, S0_CR_OPEN);\n--\ndrivers/net/ethernet/wiznet/w5100.c=514=static int w5100_get_regs_len(struct net_device *ndev)\ndrivers/net/ethernet/wiznet/w5100.c-515-{\ndrivers/net/ethernet/wiznet/w5100.c:516:\treturn W5100_COMMON_REGS_LEN + W5100_S0_REGS_LEN;\ndrivers/net/ethernet/wiznet/w5100.c-517-}\n--\ndrivers/net/ethernet/wiznet/w5100.c=519=static void w5100_get_regs(struct net_device *ndev,\n--\ndrivers/net/ethernet/wiznet/w5100.c-524-\tregs-\u003eversion = 1;\ndrivers/net/ethernet/wiznet/w5100.c:525:\tw5100_readbulk(priv, W5100_COMMON_REGS, buf, W5100_COMMON_REGS_LEN);\ndrivers/net/ethernet/wiznet/w5100.c:526:\tbuf += W5100_COMMON_REGS_LEN;\ndrivers/net/ethernet/wiznet/w5100.c:527:\tw5100_readbulk(priv, S0_REGS(priv), buf, W5100_S0_REGS_LEN);\ndrivers/net/ethernet/wiznet/w5100.c-528-}\n--\ndrivers/net/ethernet/wiznet/w5100.c=573=static void w5100_tx_skb(struct net_device *ndev, struct sk_buff *skb)\n--\ndrivers/net/ethernet/wiznet/w5100.c-577-\ndrivers/net/ethernet/wiznet/w5100.c:578:\toffset = w5100_read16(priv, W5100_S0_TX_WR(priv));\ndrivers/net/ethernet/wiznet/w5100.c-579-\tw5100_writebuf(priv, offset, skb-\u003edata, skb-\u003elen);\ndrivers/net/ethernet/wiznet/w5100.c:580:\tw5100_write16(priv, W5100_S0_TX_WR(priv), offset + skb-\u003elen);\ndrivers/net/ethernet/wiznet/w5100.c-581-\tndev-\u003estats.tx_bytes += skb-\u003elen;\n--\ndrivers/net/ethernet/wiznet/w5100.c=618=static struct sk_buff *w5100_rx_skb(struct net_device *ndev)\n--\ndrivers/net/ethernet/wiznet/w5100.c-624-\tu8 header[2];\ndrivers/net/ethernet/wiznet/w5100.c:625:\tu16 rx_buf_len = w5100_read16(priv, W5100_S0_RX_RSR(priv));\ndrivers/net/ethernet/wiznet/w5100.c-626-\n--\ndrivers/net/ethernet/wiznet/w5100.c-629-\ndrivers/net/ethernet/wiznet/w5100.c:630:\toffset = w5100_read16(priv, W5100_S0_RX_RD(priv));\ndrivers/net/ethernet/wiznet/w5100.c-631-\tw5100_readbuf(priv, offset, header, 2);\n--\ndrivers/net/ethernet/wiznet/w5100.c-635-\tif (unlikely(!skb)) {\ndrivers/net/ethernet/wiznet/w5100.c:636:\t\tw5100_write16(priv, W5100_S0_RX_RD(priv), offset + rx_buf_len);\ndrivers/net/ethernet/wiznet/w5100.c-637-\t\tw5100_command(priv, S0_CR_RECV);\n--\ndrivers/net/ethernet/wiznet/w5100.c-643-\tw5100_readbuf(priv, offset + 2, skb-\u003edata, rx_len);\ndrivers/net/ethernet/wiznet/w5100.c:644:\tw5100_write16(priv, W5100_S0_RX_RD(priv), offset + 2 + rx_len);\ndrivers/net/ethernet/wiznet/w5100.c-645-\tw5100_command(priv, S0_CR_RECV);\n--\ndrivers/net/ethernet/wiznet/w5100.c=689=static irqreturn_t w5100_interrupt(int irq, void *ndev_instance)\n--\ndrivers/net/ethernet/wiznet/w5100.c-693-\ndrivers/net/ethernet/wiznet/w5100.c:694:\tint ir = w5100_read(priv, W5100_S0_IR(priv));\ndrivers/net/ethernet/wiznet/w5100.c-695-\tif (!ir)\ndrivers/net/ethernet/wiznet/w5100.c-696-\t\treturn IRQ_NONE;\ndrivers/net/ethernet/wiznet/w5100.c:697:\tw5100_write(priv, W5100_S0_IR(priv), ir);\ndrivers/net/ethernet/wiznet/w5100.c-698-\n--\ndrivers/net/ethernet/wiznet/w5100.c=834=int w5100_probe(struct device *dev, const struct w5100_ops *ops,\n--\ndrivers/net/ethernet/wiznet/w5100.c-858-\tswitch (ops-\u003echip_id) {\ndrivers/net/ethernet/wiznet/w5100.c:859:\tcase W5100:\ndrivers/net/ethernet/wiznet/w5100.c:860:\t\tpriv-\u003es0_regs = W5100_S0_REGS;\ndrivers/net/ethernet/wiznet/w5100.c:861:\t\tpriv-\u003es0_tx_buf = W5100_TX_MEM_START;\ndrivers/net/ethernet/wiznet/w5100.c:862:\t\tpriv-\u003es0_tx_buf_size = W5100_TX_MEM_SIZE;\ndrivers/net/ethernet/wiznet/w5100.c:863:\t\tpriv-\u003es0_rx_buf = W5100_RX_MEM_START;\ndrivers/net/ethernet/wiznet/w5100.c:864:\t\tpriv-\u003es0_rx_buf_size = W5100_RX_MEM_SIZE;\ndrivers/net/ethernet/wiznet/w5100.c-865-\t\tbreak;\n--\ndrivers/net/ethernet/wiznet/w5100.h-2-/*\ndrivers/net/ethernet/wiznet/w5100.h:3: * Ethernet driver for the WIZnet W5100 chip.\ndrivers/net/ethernet/wiznet/w5100.h-4- *\n--\ndrivers/net/ethernet/wiznet/w5100.h=9=enum {\ndrivers/net/ethernet/wiznet/w5100.h:10:\tW5100,\ndrivers/net/ethernet/wiznet/w5100.h-11-\tW5200,\n"
} |
| 7/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18362 output: 38 thoughts: 30 Thoughts: Here's my thought process, as if I were considering this myself: **Examining Wiznet Driver Configurations** Okay, so I need to get a handle on the `wiznet` drivers within the kernel. My first instinct is to dive into the configuration file, so let's check `drivers/net/ethernet/wiznet/Kconfig`. That should give me the full picture: all the available options, the dependencies, and, critically, a complete list of the drivers that are currently supported or can be compiled within that specific subsystem. This is the best place to start. I want to see what's *there* before I start digging into the code itself. Kconfig will lay it all out for me – gives me the big picture of what I'm working with. It's the standard entry point. |
| 8/2 | 2026/09/26 15:06 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/wiznet/Kconfig",
"FirstLine": 1,
"LineCount": 40
}Results: {
"Contents": " 1:\t# SPDX-License-Identifier: GPL-2.0-only\n 2:\t#\n 3:\t# WIZnet devices configuration\n 4:\t#\n 5:\t\n 6:\tconfig NET_VENDOR_WIZNET\n 7:\t\tbool \"WIZnet devices\"\n 8:\t\tdefault y\n 9:\t\thelp\n 10:\t\t If you have a network (Ethernet) card belonging to this class, say Y.\n 11:\t\n 12:\t\t Note that the answer to this question doesn't directly affect the\n 13:\t\t kernel: saying N will just cause the configurator to skip all\n 14:\t\t the questions about WIZnet devices. If you say Y, you will be asked\n 15:\t\t for your specific card in the following questions.\n 16:\t\n 17:\tif NET_VENDOR_WIZNET\n 18:\t\n 19:\tconfig WIZNET_W5100\n 20:\t\ttristate \"WIZnet W5100/W5200/W5500 Ethernet support for SPI mode\"\n 21:\t\tdepends on SPI\n 22:\t\thelp\n 23:\t\t Support for WIZnet W5100 chips.\n 24:\t\n 25:\t\t W5100 is a single chip with integrated 10/100 Ethernet MAC,\n 26:\t\t PHY and hardware TCP/IP stack, but this driver is limited to\n 27:\t\t the MAC and PHY functions only, onchip TCP/IP is unused.\n 28:\t\n 29:\t\t To compile this driver as a module, choose M here: the module\n 30:\t\t will be called w5100.\n 31:\t\n 32:\tendif # NET_VENDOR_WIZNET\n"
} |
| 9/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19066 output: 21 thoughts: 358 Thoughts: **My Assessment of the WIZNET W5100 Fuzzing Feasibility** Okay, let's break this down. First, `CONFIG_WIZNET_W5100` depends on `SPI`. Right, that's expected. Now, the real question: how do I even *probe* or *fuzz* a SPI-based Ethernet driver like the W5100 in a standard QEMU or syzkaller setup? Can syzkaller even *emulate* SPI? I need to know if it can instantiate SPI devices because, as far as I know, it doesn't support arbitrary SPI slave emulation unless there is a virtual SPI bus or a USB-to-SPI or platform device or mock device. Let me do a quick search within syzkaller and the kernel for anything SPI-controller or SPI-slave related. Okay, I'm getting a sinking feeling… it's looking like syzkaller probably *doesn't* offer direct SPI slave emulation. Alright, let's step back and re-read Section 2 of the instructions. The bit about "Structurally unreachable hardware" – things like vendor-specific PCIe switches, SmartNICs, GPU drivers… that require physical ASICs or PCIe cards not emulated in standard QEMU. Wait a minute, does this apply to SPI devices too? I have to find out. Now, let's go back and check Section 1. "REACHABILITY IS THE PRIMARY GATE". Essentially, fuzzing is only effective if the code can actually *execute* in a standard virtualized environment (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap). If the code is structurally unreachable, then forget it, regardless of the logic complexity or added assertions. Okay, so the question is, *can* the WIZNET W5100 be probed in QEMU? And *can* it be probed via a platform device or some other mechanism? I need to find out *how* it's connected in the kernel. Time to reach for `git grep` and look for all the callers of `w5100` across the entire tree. That's the key to figuring this out. |
| 10/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "w5100_probe"
}Results: {
"Output": "drivers/net/ethernet/wiznet/w5100-spi.c=421=static int w5100_spi_probe(struct spi_device *spi)\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-452-\ndrivers/net/ethernet/wiznet/w5100-spi.c:453:\treturn w5100_probe(\u0026spi-\u003edev, ops, priv_size, mac, spi-\u003eirq);\ndrivers/net/ethernet/wiznet/w5100-spi.c-454-}\n--\ndrivers/net/ethernet/wiznet/w5100.c=832=EXPORT_SYMBOL_GPL(w5100_ops_priv);\ndrivers/net/ethernet/wiznet/w5100.c-833-\ndrivers/net/ethernet/wiznet/w5100.c:834:int w5100_probe(struct device *dev, const struct w5100_ops *ops,\ndrivers/net/ethernet/wiznet/w5100.c-835-\t\tint sizeof_ops_priv, const void *mac_addr, int irq)\n--\ndrivers/net/ethernet/wiznet/w5100.c-980-}\ndrivers/net/ethernet/wiznet/w5100.c:981:EXPORT_SYMBOL_GPL(w5100_probe);\ndrivers/net/ethernet/wiznet/w5100.c-982-\n--\ndrivers/net/ethernet/wiznet/w5100.h=29=void *w5100_ops_priv(const struct net_device *ndev);\ndrivers/net/ethernet/wiznet/w5100.h-30-\ndrivers/net/ethernet/wiznet/w5100.h:31:int w5100_probe(struct device *dev, const struct w5100_ops *ops,\ndrivers/net/ethernet/wiznet/w5100.h-32-\t\tint sizeof_ops_priv, const void *mac_addr, int irq);\n"
} |
| 11/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 20488 output: 23 thoughts: 81 Thoughts: Here's my thought process, as if I were reviewing this code: **Code Analysis: w5100_probe Callers** Okay, so `w5100_probe` is called, and my initial instinct is to pinpoint *where* that happens within the codebase. The text indicates it's exclusively called by `w5100_spi_probe` within `drivers/net/ethernet/wiznet/w5100-spi.c`. That seems straightforward enough, but I always triple-check these things. Just because the code *says* that's the only call site, I need to verify that there are no hidden calls through another route, or from other files. It's too easy to miss something that way. I'm going to quickly grep the project for `w5100_spi_driver` and `w5100` just to be absolutely certain there aren't any other references, especially indirect ones that could also be calling `w5100_probe`. That should give me a solid picture of where this probe function is actually used, and if there are any other potential issues. |
| 12/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "w5100_spi_driver"
}Results: {
"Output": "drivers/net/ethernet/wiznet/w5100-spi.c=467=MODULE_DEVICE_TABLE(spi, w5100_spi_ids);\ndrivers/net/ethernet/wiznet/w5100-spi.c-468-\ndrivers/net/ethernet/wiznet/w5100-spi.c:469:static struct spi_driver w5100_spi_driver = {\ndrivers/net/ethernet/wiznet/w5100-spi.c-470-\t.driver\t\t= {\n--\ndrivers/net/ethernet/wiznet/w5100-spi.c-478-};\ndrivers/net/ethernet/wiznet/w5100-spi.c:479:module_spi_driver(w5100_spi_driver);\ndrivers/net/ethernet/wiznet/w5100-spi.c-480-\n"
} |
| 13/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21087 output: 26 thoughts: 118 Thoughts: **Examining the W5100 SPI Driver** Okay, let's take a look at this `w5100_spi_driver` code. Right, it's defined as an `spi_driver` structure – nothing too surprising there. Now, wait a second... how does the Linux kernel typically handle the instantiation of SPI devices again? Right, it's usually through Device Tree, ACPI, or those classic board files, using `spi_board_info` and `spi_register_board_info`. But I'm pondering, what about userspace? Can a userspace application directly instantiate SPI devices? I seem to recall I2C having a handy sysfs interface, like that `new_device` entry... I should check if there's an analogous `new_device` in SPI's sysfs interface. That would be interesting, and worth investigating. |
| 14/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "new_device",
"PathPrefix": "drivers/spi"
}Results: {
"Output": "drivers/spi/spi-altera-dfl.c=124=static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)\n--\ndrivers/spi/spi-altera-dfl.c-174-\ndrivers/spi/spi-altera-dfl.c:175:\tif (!spi_new_device(host, \u0026board_info)) {\ndrivers/spi/spi-altera-dfl.c-176-\t\tdev_err(dev, \"%s failed to create SPI device: %s\\n\",\n--\ndrivers/spi/spi-altera-platform.c=35=static int altera_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-altera-platform.c-116-\t\tfor (i = 0; i \u003c pdata-\u003enum_devices; i++) {\ndrivers/spi/spi-altera-platform.c:117:\t\t\tif (!spi_new_device(host, pdata-\u003edevices + i))\ndrivers/spi/spi-altera-platform.c-118-\t\t\t\tdev_warn(\u0026pdev-\u003edev,\n--\ndrivers/spi/spi-butterfly.c=176=static void butterfly_attach(struct parport *p)\n--\ndrivers/spi/spi-butterfly.c-265-\tpp-\u003einfo[0].controller_data = pp;\ndrivers/spi/spi-butterfly.c:266:\tpp-\u003edataflash = spi_new_device(pp-\u003ebitbang.ctlr, \u0026pp-\u003einfo[0]);\ndrivers/spi/spi-butterfly.c-267-\tif (pp-\u003edataflash)\n--\ndrivers/spi/spi-ch341.c=141=static int ch341_probe(struct usb_interface *intf,\n--\ndrivers/spi/spi-ch341.c-206-\ndrivers/spi/spi-ch341.c:207:\tch341-\u003espidev = spi_new_device(ctrl, \u0026chip);\ndrivers/spi/spi-ch341.c-208-\tif (!ch341-\u003espidev) {\n--\ndrivers/spi/spi-cs42l43.c=312=static int cs42l43_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cs42l43.c-426-\ndrivers/spi/spi-cs42l43.c:427:\t\tif (!spi_new_device(priv-\u003ectlr, ampl_info))\ndrivers/spi/spi-cs42l43.c-428-\t\t\treturn dev_err_probe(priv-\u003edev, -ENODEV,\n--\ndrivers/spi/spi-cs42l43.c-430-\ndrivers/spi/spi-cs42l43.c:431:\t\tif (!spi_new_device(priv-\u003ectlr, ampr_info))\ndrivers/spi/spi-cs42l43.c-432-\t\t\treturn dev_err_probe(priv-\u003edev, -ENODEV,\n--\ndrivers/spi/spi-intel.c=1375=static int intel_spi_populate_chip(struct intel_spi *ispi)\n--\ndrivers/spi/spi-intel.c-1401-\ndrivers/spi/spi-intel.c:1402:\tif (!spi_new_device(ispi-\u003ehost, \u0026chip))\ndrivers/spi/spi-intel.c-1403-\t\treturn -ENODEV;\n--\ndrivers/spi/spi-intel.c-1430-\ndrivers/spi/spi-intel.c:1431:\tif (!spi_new_device(ispi-\u003ehost, \u0026chip))\ndrivers/spi/spi-intel.c-1432-\t\treturn -ENODEV;\n--\ndrivers/spi/spi-kspi2.c=310=static int kspi2_register_devices(struct kspi2 *kspi)\n--\ndrivers/spi/spi-kspi2.c-316-\tfor (i = 0; i \u003c kspi-\u003eauxdev-\u003einfo_size; i++) {\ndrivers/spi/spi-kspi2.c:317:\t\tstruct spi_device *device = spi_new_device(kspi-\u003ehost, \u0026info[i]);\ndrivers/spi/spi-kspi2.c-318-\n--\ndrivers/spi/spi-lm70llp.c=188=static void spi_lm70llp_attach(struct parport *p)\n--\ndrivers/spi/spi-lm70llp.c-266-\tpp-\u003einfo.controller_data = pp;\ndrivers/spi/spi-lm70llp.c:267:\tpp-\u003espidev_lm70 = spi_new_device(pp-\u003ebitbang.ctlr, \u0026pp-\u003einfo);\ndrivers/spi/spi-lm70llp.c-268-\tif (pp-\u003espidev_lm70)\n--\ndrivers/spi/spi-lm70llp.c-271-\telse {\ndrivers/spi/spi-lm70llp.c:272:\t\tdev_warn(\u0026pd-\u003edev, \"spi_new_device failed\\n\");\ndrivers/spi/spi-lm70llp.c-273-\t\tstatus = -ENODEV;\n--\ndrivers/spi/spi-xilinx.c=402=static int xilinx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-xilinx.c-509-\t\tfor (i = 0; i \u003c pdata-\u003enum_devices; i++)\ndrivers/spi/spi-xilinx.c:510:\t\t\tspi_new_device(host, pdata-\u003edevices + i);\ndrivers/spi/spi-xilinx.c-511-\t}\n--\ndrivers/spi/spi.c=297=static const struct attribute_group spi_controller_statistics_group = {\n--\ndrivers/spi/spi.c-304-/*\ndrivers/spi/spi.c:305: * new_device_store - instantiate a new SPI device from userspace\ndrivers/spi/spi.c-306- *\n--\ndrivers/spi/spi.c-309- * Examples:\ndrivers/spi/spi.c:310: * echo spidev 0 \u003e new_device\ndrivers/spi/spi.c:311: * echo spidev 0 10000000 \u003e new_device\ndrivers/spi/spi.c:312: * echo spidev 0 10000000 3 \u003e new_device\ndrivers/spi/spi.c-313- */\ndrivers/spi/spi.c=314=static ssize_t\ndrivers/spi/spi.c:315:new_device_store(struct device *dev, struct device_attribute *attr,\ndrivers/spi/spi.c-316-\t\t const char *buf, size_t count)\n--\ndrivers/spi/spi.c-329-\tif (!blank) {\ndrivers/spi/spi.c:330:\t\tdev_err(dev, \"new_device: Missing parameters\\n\");\ndrivers/spi/spi.c-331-\t\treturn -EINVAL;\n--\ndrivers/spi/spi.c-334-\tif (blank == buf || blank - buf \u003e SPI_NAME_SIZE - 1) {\ndrivers/spi/spi.c:335:\t\tdev_err(dev, \"new_device: Invalid device name\\n\");\ndrivers/spi/spi.c-336-\t\treturn -EINVAL;\n--\ndrivers/spi/spi.c-348-\tif (sscanf(++blank, \"%u %u %u\", \u0026chip_select, \u0026max_speed_hz, \u0026mode) \u003c 1) {\ndrivers/spi/spi.c:349:\t\tdev_err(dev, \"new_device: Can't parse chip select\\n\");\ndrivers/spi/spi.c-350-\t\treturn -EINVAL;\n--\ndrivers/spi/spi.c-359-\tif (chip_select \u003e U8_MAX || chip_select \u003e= ctlr-\u003enum_chipselect) {\ndrivers/spi/spi.c:360:\t\tdev_err(dev, \"new_device: Chip select %u out of range (num_chipselect=%u)\\n\",\ndrivers/spi/spi.c-361-\t\t\tchip_select, ctlr-\u003enum_chipselect);\n--\ndrivers/spi/spi.c-372-\tif (mode \u0026 ~(u32)SPI_MODE_USER_MASK) {\ndrivers/spi/spi.c:373:\t\tdev_err(dev, \"new_device: Invalid mode bits 0x%x\\n\",\ndrivers/spi/spi.c-374-\t\t\tmode \u0026 ~(u32)SPI_MODE_USER_MASK);\n--\ndrivers/spi/spi.c-401-\t/*\ndrivers/spi/spi.c:402:\t * spi_unregister_controller() removes the new_device/delete_device\ndrivers/spi/spi.c-403-\t * sysfs group before taking add_lock, so kernfs_drain() has already\n--\ndrivers/spi/spi.c-421-\ndrivers/spi/spi.c:422:\tdev_info(dev, \"new_device: Instantiated device %s at CS%u\\n\",\ndrivers/spi/spi.c-423-\t\t modalias, chip_select);\n--\ndrivers/spi/spi.c-425-}\ndrivers/spi/spi.c:426:static DEVICE_ATTR_IGNORE_LOCKDEP(new_device, 0200, NULL, new_device_store);\ndrivers/spi/spi.c-427-\n--\ndrivers/spi/spi.c=471=static struct attribute *spi_controller_userspace_attrs[] = {\ndrivers/spi/spi.c:472:\t\u0026dev_attr_new_device.attr,\ndrivers/spi/spi.c-473-\t\u0026dev_attr_delete_device.attr,\n--\ndrivers/spi/spi.c=477=static const struct attribute_group spi_controller_userspace_group = {\n--\ndrivers/spi/spi.c-484- * spi_controller_userspace_group is registered manually for host controllers\ndrivers/spi/spi.c:485: * at the end of spi_register_controller() so new_device/delete_device only\ndrivers/spi/spi.c-486- * appear after DT/ACPI children and the queue are set up.\n--\ndrivers/spi/spi.c=979=EXPORT_SYMBOL_GPL(spi_add_device);\n--\ndrivers/spi/spi.c-981-/**\ndrivers/spi/spi.c:982: * spi_new_device - instantiate one new SPI device\ndrivers/spi/spi.c-983- * @ctlr: Controller to which device is connected\n--\ndrivers/spi/spi.c-994- */\ndrivers/spi/spi.c:995:struct spi_device *spi_new_device(struct spi_controller *ctlr,\ndrivers/spi/spi.c-996-\t\t\t\t struct spi_board_info *chip)\n--\ndrivers/spi/spi.c-1050-}\ndrivers/spi/spi.c:1051:EXPORT_SYMBOL_GPL(spi_new_device);\ndrivers/spi/spi.c-1052-\n--\ndrivers/spi/spi.c=1081=static void spi_match_controller_to_boardinfo(struct spi_controller *ctlr,\n--\ndrivers/spi/spi.c-1088-\ndrivers/spi/spi.c:1089:\tdev = spi_new_device(ctlr, bi);\ndrivers/spi/spi.c-1090-\tif (!dev)\n--\ndrivers/spi/spi.c=3652=int spi_register_controller(struct spi_controller *ctlr)\n--\ndrivers/spi/spi.c-3757-\t/*\ndrivers/spi/spi.c:3758:\t * Register the new_device/delete_device sysfs interface as the\ndrivers/spi/spi.c-3759-\t * final step of host controller bringup, only after the queue,\n--\ndrivers/spi/spi.c=3838=void spi_unregister_controller(struct spi_controller *ctlr)\n--\ndrivers/spi/spi.c-3843-\t/*\ndrivers/spi/spi.c:3844:\t * Drain in-flight new_device/delete_device sysfs stores and\ndrivers/spi/spi.c-3845-\t * prevent new ones from starting. Must happen before we take\n"
} |
| 15/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 24598 output: 47 thoughts: 429 Thoughts: **My Line of Inquiry: SPI Host Controller Investigation** Okay, hold on a second! Before I dive too deep, I should check the standard places. My instinct says to look at `drivers/spi/spi-ch341.c` and other USB-to-SPI drivers – that's a common path. Then, I should probably check `drivers/spi/spi.c` and specifically the `new_device_store` function – that's a likely point of interest. Now, a crucial question pops up: does QEMU, or syzkaller, provide an SPI host controller? I need to know if there's a virtual controller available within those environments, particularly in standard QEMU or GCE x86/amd64 setups. I'm thinking I need to find out whether there are any virtual or emulated SPI host controllers, any potential USB routes to SPI devices, or if virtual platform devices are in play. Alright, time to search the syzkaller repository and descriptions for "spi." But wait! *Critical* reminder: I *cannot* use this tool to search syzkaller's syzlang descriptions or expressions that contain "long syz_"! That's a key restriction. Those pseudo-syscalls are not actually in the Linux kernel and will throw me off. I need to utilize `read-syz-spec` and `syz-grepper` tools instead for those tasks. But... are `syz-spec` or `syz-grepper` available to me? Let's check the tool declaration list. Okay, I see: `default_api:grepper`, `default_api:codesearch-dir-index`, `default_api:read-file`, and `default_api:set-results`. *Hmm*, neither `syz-spec` nor `syz-grepper` are listed here. Looks like I don't have those tools at my disposal for this round of investigation. Okay, new angle. Can I instantiate `w5100`? That seems like a viable starting point. Let's examine `w5100_spi_probe` in `drivers/net/ethernet/wiznet/w5100-spi.c`. I'm going to dig into the `w5100-spi.c` source code now to see what's what. |
| 16/2 | 2026/09/26 15:06 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/wiznet/w5100-spi.c",
"FirstLine": 410,
"LineCount": 80
}Results: {
"Contents": " 410:\t\t.init = w5500_spi_init,\n 411:\t};\n 412:\t\n 413:\tstatic const struct of_device_id w5100_of_match[] = {\n 414:\t\t{ .compatible = \"wiznet,w5100\", .data = (const void*)W5100, },\n 415:\t\t{ .compatible = \"wiznet,w5200\", .data = (const void*)W5200, },\n 416:\t\t{ .compatible = \"wiznet,w5500\", .data = (const void*)W5500, },\n 417:\t\t{ },\n 418:\t};\n 419:\tMODULE_DEVICE_TABLE(of, w5100_of_match);\n 420:\t\n 421:\tstatic int w5100_spi_probe(struct spi_device *spi)\n 422:\t{\n 423:\t\tconst struct w5100_ops *ops;\n 424:\t\tkernel_ulong_t driver_data;\n 425:\t\tconst void *mac = NULL;\n 426:\t\tu8 tmpmac[ETH_ALEN];\n 427:\t\tint priv_size;\n 428:\t\tint ret;\n 429:\t\n 430:\t\tret = of_get_mac_address(spi-\u003edev.of_node, tmpmac);\n 431:\t\tif (!ret)\n 432:\t\t\tmac = tmpmac;\n 433:\t\n 434:\t\tdriver_data = (uintptr_t)spi_get_device_match_data(spi);\n 435:\t\n 436:\t\tswitch (driver_data) {\n 437:\t\tcase W5100:\n 438:\t\t\tops = \u0026w5100_spi_ops;\n 439:\t\t\tpriv_size = 0;\n 440:\t\t\tbreak;\n 441:\t\tcase W5200:\n 442:\t\t\tops = \u0026w5200_ops;\n 443:\t\t\tpriv_size = sizeof(struct w5200_spi_priv);\n 444:\t\t\tbreak;\n 445:\t\tcase W5500:\n 446:\t\t\tops = \u0026w5500_ops;\n 447:\t\t\tpriv_size = sizeof(struct w5500_spi_priv);\n 448:\t\t\tbreak;\n 449:\t\tdefault:\n 450:\t\t\treturn -EINVAL;\n 451:\t\t}\n 452:\t\n 453:\t\treturn w5100_probe(\u0026spi-\u003edev, ops, priv_size, mac, spi-\u003eirq);\n 454:\t}\n 455:\t\n 456:\tstatic void w5100_spi_remove(struct spi_device *spi)\n 457:\t{\n 458:\t\tw5100_remove(\u0026spi-\u003edev);\n 459:\t}\n 460:\t\n 461:\tstatic const struct spi_device_id w5100_spi_ids[] = {\n 462:\t\t{ \"w5100\", W5100 },\n 463:\t\t{ \"w5200\", W5200 },\n 464:\t\t{ \"w5500\", W5500 },\n 465:\t\t{}\n 466:\t};\n 467:\tMODULE_DEVICE_TABLE(spi, w5100_spi_ids);\n 468:\t\n 469:\tstatic struct spi_driver w5100_spi_driver = {\n 470:\t\t.driver\t\t= {\n 471:\t\t\t.name\t= \"w5100\",\n 472:\t\t\t.pm\t= \u0026w5100_pm_ops,\n 473:\t\t\t.of_match_table = w5100_of_match,\n 474:\t\t},\n 475:\t\t.probe\t\t= w5100_spi_probe,\n 476:\t\t.remove\t\t= w5100_spi_remove,\n 477:\t\t.id_table\t= w5100_spi_ids,\n 478:\t};\n 479:\tmodule_spi_driver(w5100_spi_driver);\n 480:\t\n 481:\tMODULE_DESCRIPTION(\"WIZnet W5100/W5200/W5500 Ethernet driver for SPI mode\");\n 482:\tMODULE_AUTHOR(\"Akinobu Mita \u003cakinobu.mita@gmail.com\u003e\");\n 483:\tMODULE_LICENSE(\"GPL\");\n"
} |
| 17/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26817 output: 35 thoughts: 54 Thoughts: Okay, let's dive into this. Here's how I'd approach this task, walking through my thought process: **Diving into the `new_device_store` Function** Alright, my immediate thought is to zero in on `new_device_store` within `drivers/spi/spi.c`. Before I even start analyzing the function itself, I want to get a sense of its history. Knowing when `new_device_store` was introduced into the codebase could offer significant context. It could help me understand the rationale behind its implementation and give me a timeframe to look back on any potential related commits. I'm going to quickly check the commit logs for that one, it's the first step. Then, after I have an idea about when the function first appeared, I'll go directly to the source code to get the lay of the land. I will look for the line number provided, around line 310, as a starting point. I don't want to get lost in the function. Line 310 is likely to be a crucial point, and it'll give me a key to contextualize the location. I'll read the code near that line, and begin to form a good picture of the area around `new_device_store`. From that perspective, I can better evaluate its function and integration. |
| 18/2 | 2026/09/26 15:06 | tool | read-file |
0mArgs:{
"File": "drivers/spi/spi.c",
"FirstLine": 310,
"LineCount": 80
}Results: {
"Contents": " 310:\t * echo spidev 0 \u003e new_device\n 311:\t * echo spidev 0 10000000 \u003e new_device\n 312:\t * echo spidev 0 10000000 3 \u003e new_device\n 313:\t */\n 314:\tstatic ssize_t\n 315:\tnew_device_store(struct device *dev, struct device_attribute *attr,\n 316:\t\t\t const char *buf, size_t count)\n 317:\t{\n 318:\t\tstruct spi_controller *ctlr = container_of(dev, struct spi_controller,\n 319:\t\t\t\t\t\t\t dev);\n 320:\t\tstruct spi_device *spi;\n 321:\t\tchar modalias[SPI_NAME_SIZE];\n 322:\t\tunsigned int chip_select;\n 323:\t\tu32 max_speed_hz = 0;\n 324:\t\tu32 mode = 0;\n 325:\t\tchar *blank;\n 326:\t\tint status;\n 327:\t\n 328:\t\tblank = strchr(buf, ' ');\n 329:\t\tif (!blank) {\n 330:\t\t\tdev_err(dev, \"new_device: Missing parameters\\n\");\n 331:\t\t\treturn -EINVAL;\n 332:\t\t}\n 333:\t\n 334:\t\tif (blank == buf || blank - buf \u003e SPI_NAME_SIZE - 1) {\n 335:\t\t\tdev_err(dev, \"new_device: Invalid device name\\n\");\n 336:\t\t\treturn -EINVAL;\n 337:\t\t}\n 338:\t\n 339:\t\tmemset(modalias, 0, sizeof(modalias));\n 340:\t\tmemcpy(modalias, buf, blank - buf);\n 341:\t\n 342:\t\t/*\n 343:\t\t * sscanf fills only the fields it matches; unmatched optional\n 344:\t\t * fields (max_speed_hz, mode) stay zero from initialisation above.\n 345:\t\t * max_speed_hz == 0 is clamped to the controller max by spi_setup().\n 346:\t\t * mode == 0 selects SPI mode 0 (CPOL=0, CPHA=0).\n 347:\t\t */\n 348:\t\tif (sscanf(++blank, \"%u %u %u\", \u0026chip_select, \u0026max_speed_hz, \u0026mode) \u003c 1) {\n 349:\t\t\tdev_err(dev, \"new_device: Can't parse chip select\\n\");\n 350:\t\t\treturn -EINVAL;\n 351:\t\t}\n 352:\t\n 353:\t\t/*\n 354:\t\t * spi_device.chip_select[] is u8, so cap at U8_MAX independently of\n 355:\t\t * ctlr-\u003enum_chipselect (which is u16 and may exceed 255). Without\n 356:\t\t * this, values in (U8_MAX, num_chipselect) would silently truncate\n 357:\t\t * inside spi_set_chipselect() and select the wrong CS.\n 358:\t\t */\n 359:\t\tif (chip_select \u003e U8_MAX || chip_select \u003e= ctlr-\u003enum_chipselect) {\n 360:\t\t\tdev_err(dev, \"new_device: Chip select %u out of range (num_chipselect=%u)\\n\",\n 361:\t\t\t\tchip_select, ctlr-\u003enum_chipselect);\n 362:\t\t\treturn -EINVAL;\n 363:\t\t}\n 364:\t\n 365:\t\t/*\n 366:\t\t * Reject kernel-internal mode bits (SPI_NO_TX, SPI_NO_RX,\n 367:\t\t * SPI_TPM_HW_FLOW, ...). These are set only by in-kernel drivers\n 368:\t\t * that know they are safe on their controller/device pair and must\n 369:\t\t * not be settable through a userspace-writable sysfs. Matches\n 370:\t\t * spidev's SPI_IOC_WR_MODE32 handling (drivers/spi/spidev.c).\n 371:\t\t */\n 372:\t\tif (mode \u0026 ~(u32)SPI_MODE_USER_MASK) {\n 373:\t\t\tdev_err(dev, \"new_device: Invalid mode bits 0x%x\\n\",\n 374:\t\t\t\tmode \u0026 ~(u32)SPI_MODE_USER_MASK);\n 375:\t\t\treturn -EINVAL;\n 376:\t\t}\n 377:\t\n 378:\t\tspi = spi_alloc_device(ctlr);\n 379:\t\tif (!spi)\n 380:\t\t\treturn -ENOMEM;\n 381:\t\n 382:\t\tspi_set_chipselect(spi, 0, chip_select);\n 383:\t\tspi-\u003emax_speed_hz = max_speed_hz;\n 384:\t\tspi-\u003emode = mode;\n 385:\t\tspi-\u003ecs_index_mask = BIT(0);\n 386:\t\tstrscpy(spi-\u003emodalias, modalias, sizeof(spi-\u003emodalias));\n 387:\t\n 388:\t\t/*\n 389:\t\t * Set driver_override so that the device binds to the driver\n"
} |
| 19/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 28579 output: 19 thoughts: 67 Thoughts: Here's my take on those thoughts: **Analyzing `new_device_store` in `spi.c`** Alright, my eye immediately lands on `new_device_store` in `drivers/spi/spi.c`. Hmm, a potential new SPI device driver? Interesting. But before I get too excited, I need to ground myself in reality. The question that pops up immediately is: are we even dealing with a typical environment, like QEMU or syzkaller? Are there any SPI controllers *actually* available in that setup? I can't just assume anything, especially when dealing with such low-level stuff. Gotta verify. Okay, time to fire up a quick search. Let's see what controllers the environment is configured with. I'll grep for variations of "spi controller" and "virtual spi controller". See what we're working with here, and if `new_device_store` is even relevant in this context. Gotta figure out if there's an actual target for that store function. |
| 20/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "spi_register_controller"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 953 lines.\nUse more precise expression if possible.\n\nDocumentation/driver-api/driver-model/devres.rst=458=SPI\n--\nDocumentation/driver-api/driver-model/devres.rst-461- devm_spi_optimize_message()\nDocumentation/driver-api/driver-model/devres.rst:462: devm_spi_register_controller()\nDocumentation/driver-api/driver-model/devres.rst-463- devm_spi_register_host()\n--\nDocumentation/spi/spi-summary.rst=491=its own internal state. (See below about bus numbering and those methods.)\nDocumentation/spi/spi-summary.rst-492-\nDocumentation/spi/spi-summary.rst:493:After you initialize the spi_controller, then use spi_register_controller() to\nDocumentation/spi/spi-summary.rst-494-publish it to the rest of the system. At that time, device nodes for the\n--\nDocumentation/spi/spi-summary.rst=498=If you need to remove your SPI controller driver, spi_unregister_controller()\nDocumentation/spi/spi-summary.rst:499:will reverse the effect of spi_register_controller().\nDocumentation/spi/spi-summary.rst-500-\n--\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c=173=int netup_spi_init(struct netup_unidvb_dev *ndev)\n--\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c-197-\tndev-\u003espi = nspi;\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c:198:\tif (spi_register_controller(ctlr)) {\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c-199-\t\tndev-\u003espi = NULL;\n--\ndrivers/media/usb/msi2500/msi2500.c=1176=static int msi2500_probe(struct usb_interface *intf,\n--\ndrivers/media/usb/msi2500/msi2500.c-1248-\tspi_controller_set_devdata(ctlr, dev);\ndrivers/media/usb/msi2500/msi2500.c:1249:\tret = spi_register_controller(ctlr);\ndrivers/media/usb/msi2500/msi2500.c-1250-\tif (ret)\n--\ndrivers/spi/atmel-quadspi.c=1403=static int atmel_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/atmel-quadspi.c-1506-\ndrivers/spi/atmel-quadspi.c:1507:\terr = spi_register_controller(ctrl);\ndrivers/spi/atmel-quadspi.c-1508-\tif (err)\n--\ndrivers/spi/spi-airoha-snfi.c=1060=static int airoha_snand_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-airoha-snfi.c-1131-\ndrivers/spi/spi-airoha-snfi.c:1132:\treturn devm_spi_register_controller(dev, ctrl);\ndrivers/spi/spi-airoha-snfi.c-1133-}\n--\ndrivers/spi/spi-altera-dfl.c=124=static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)\n--\ndrivers/spi/spi-altera-dfl.c-160-\ndrivers/spi/spi-altera-dfl.c:161:\terr = devm_spi_register_controller(dev, host);\ndrivers/spi/spi-altera-dfl.c-162-\tif (err)\n--\ndrivers/spi/spi-altera-platform.c=35=static int altera_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-altera-platform.c-110-\ndrivers/spi/spi-altera-platform.c:111:\terr = devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-altera-platform.c-112-\tif (err)\n--\ndrivers/spi/spi-amd.c=821=int amd_spi_probe_common(struct device *dev, struct spi_controller *host)\n--\ndrivers/spi/spi-amd.c-839-\t/* Register the controller with SPI framework */\ndrivers/spi/spi-amd.c:840:\terr = devm_spi_register_controller(dev, host);\ndrivers/spi/spi-amd.c-841-\tif (err)\n--\ndrivers/spi/spi-amlogic-spifc-a1.c=326=static int amlogic_spifc_a1_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spifc-a1.c-368-\ndrivers/spi/spi-amlogic-spifc-a1.c:369:\tret = devm_spi_register_controller(spifc-\u003edev, ctrl);\ndrivers/spi/spi-amlogic-spifc-a1.c-370-\tif (ret)\n--\ndrivers/spi/spi-amlogic-spifc-a4.c=1093=static int aml_sfc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spifc-a4.c-1177-\ndrivers/spi/spi-amlogic-spifc-a4.c:1178:\treturn devm_spi_register_controller(dev, ctrl);\ndrivers/spi/spi-amlogic-spifc-a4.c-1179-}\n--\ndrivers/spi/spi-amlogic-spisg.c=712=static int aml_spisg_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spisg.c-799-\ndrivers/spi/spi-amlogic-spisg.c:800:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-amlogic-spisg.c-801-\tif (ret) {\n--\ndrivers/spi/spi-apple.c=457=static int apple_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-apple.c-504-\ndrivers/spi/spi-apple.c:505:\tret = devm_spi_register_controller(\u0026pdev-\u003edev, ctlr);\ndrivers/spi/spi-apple.c-506-\tif (ret \u003c 0)\ndrivers/spi/spi-apple.c:507:\t\treturn dev_err_probe(\u0026pdev-\u003edev, ret, \"devm_spi_register_controller failed\\n\");\ndrivers/spi/spi-apple.c-508-\n--\ndrivers/spi/spi-ar934x.c=165=static int ar934x_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ar934x.c-207-\ndrivers/spi/spi-ar934x.c:208:\treturn spi_register_controller(ctlr);\ndrivers/spi/spi-ar934x.c-209-}\n--\ndrivers/spi/spi-armada-3700.c=813=static int a3700_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-armada-3700.c-874-\ndrivers/spi/spi-armada-3700.c:875:\tret = devm_spi_register_controller(dev, host);\ndrivers/spi/spi-armada-3700.c-876-\tif (ret) {\n--\ndrivers/spi/spi-aspeed-smc.c=957=static int aspeed_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-aspeed-smc.c-1023-\ndrivers/spi/spi-aspeed-smc.c:1024:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-aspeed-smc.c-1025-\tif (ret)\ndrivers/spi/spi-aspeed-smc.c:1026:\t\tdev_err(\u0026pdev-\u003edev, \"spi_register_controller failed\\n\");\ndrivers/spi/spi-aspeed-smc.c-1027-\n--\ndrivers/spi/spi-at91-usart.c=476=static int at91_usart_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-at91-usart.c-554-\ndrivers/spi/spi-at91-usart.c:555:\tret = spi_register_controller(controller);\ndrivers/spi/spi-at91-usart.c-556-\tif (ret)\n--\ndrivers/spi/spi-atcspi200.c=545=static int atcspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-atcspi200.c-588-\ndrivers/spi/spi-atcspi200.c:589:\tret = devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-atcspi200.c-590-\tif (ret)\n--\ndrivers/spi/spi-atmel.c=1287=static int atmel_spi_setup(struct spi_device *spi)\n--\ndrivers/spi/spi-atmel.c-1303-\ndrivers/spi/spi-atmel.c:1304:\t/* Setup() is called during spi_register_controller(aka\ndrivers/spi/spi-atmel.c-1305-\t * spi_register_master) but after all membmers of the cs_gpiod\n--\ndrivers/spi/spi-atmel.c=1550=static int atmel_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-atmel.c-1668-\ndrivers/spi/spi-atmel.c:1669:\tret = spi_register_controller(host);\ndrivers/spi/spi-atmel.c-1670-\tif (ret)\n--\ndrivers/spi/spi-axi-spi-engine.c=1104=static int spi_engine_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-axi-spi-engine.c-1239-\ndrivers/spi/spi-axi-spi-engine.c:1240:\treturn devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-axi-spi-engine.c-1241-}\n--\ndrivers/spi/spi-axiado.c=752=static int ax_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-axiado.c-846-\ndrivers/spi/spi-axiado.c:847:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-axiado.c-848-\tif (ret) {\ndrivers/spi/spi-axiado.c:849:\t\tdev_err(\u0026pdev-\u003edev, \"spi_register_controller failed\\n\");\ndrivers/spi/spi-axiado.c-850-\t\tgoto err_disable_rpm;\n--\ndrivers/spi/spi-bcm-qspi.c=1482=int bcm_qspi_probe(struct platform_device *pdev,\n--\ndrivers/spi/spi-bcm-qspi.c-1659-\ndrivers/spi/spi-bcm-qspi.c:1660:\tret = spi_register_controller(host);\ndrivers/spi/spi-bcm-qspi.c-1661-\tif (ret \u003c 0) {\n--\ndrivers/spi/spi-bcm2835.c=1349=static int bcm2835_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm2835.c-1406-\ndrivers/spi/spi-bcm2835.c:1407:\terr = spi_register_controller(ctlr);\ndrivers/spi/spi-bcm2835.c-1408-\tif (err) {\n--\ndrivers/spi/spi-bcm2835aux.c=474=static int bcm2835aux_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm2835aux.c-543-\ndrivers/spi/spi-bcm2835aux.c:544:\terr = spi_register_controller(host);\ndrivers/spi/spi-bcm2835aux.c-545-\tif (err) {\n--\ndrivers/spi/spi-bcm63xx-hsspi.c=742=static int bcm63xx_hsspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm63xx-hsspi.c-857-\t/* register and we are done */\ndrivers/spi/spi-bcm63xx-hsspi.c:858:\tret = spi_register_controller(host);\ndrivers/spi/spi-bcm63xx-hsspi.c-859-\tif (ret)\n--\ndrivers/spi/spi-bcm63xx.c=491=static int bcm63xx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm63xx.c-599-\t/* register and we are done */\ndrivers/spi/spi-bcm63xx.c:600:\tret = spi_register_controller(host);\ndrivers/spi/spi-bcm63xx.c-601-\tif (ret) {\n--\ndrivers/spi/spi-bcmbca-hsspi.c=432=static int bcmbca_hsspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcmbca-hsspi.c-540-\t/* register and we are done */\ndrivers/spi/spi-bcmbca-hsspi.c:541:\tret = spi_register_controller(host);\ndrivers/spi/spi-bcmbca-hsspi.c-542-\tif (ret)\n--\ndrivers/spi/spi-bitbang.c=424=int spi_bitbang_start(struct spi_bitbang *bitbang)\n--\ndrivers/spi/spi-bitbang.c-435-\t */\ndrivers/spi/spi-bitbang.c:436:\treturn spi_register_controller(ctlr);\ndrivers/spi/spi-bitbang.c-437-}\n--\ndrivers/spi/spi-cadence-quadspi.c=1785=static int cqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence-quadspi.c-1978-\ndrivers/spi/spi-cadence-quadspi.c:1979:\tret = spi_register_controller(host);\ndrivers/spi/spi-cadence-quadspi.c-1980-\tif (ret) {\n--\ndrivers/spi/spi-cadence-xspi.c=1180=static int cdns_xspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence-xspi.c-1298-\ndrivers/spi/spi-cadence-xspi.c:1299:\tret = devm_spi_register_controller(dev, host);\ndrivers/spi/spi-cadence-xspi.c-1300-\tif (ret) {\n--\ndrivers/spi/spi-cadence.c=642=static int cdns_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence.c-748-\t}\ndrivers/spi/spi-cadence.c:749:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-cadence.c-750-\tif (ret) {\ndrivers/spi/spi-cadence.c:751:\t\tdev_err(\u0026pdev-\u003edev, \"spi_register_controller failed\\n\");\ndrivers/spi/spi-cadence.c-752-\t\tgoto err_disable_rpm;\n--\ndrivers/spi/spi-cavium-octeon.c=19=static int octeon_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cavium-octeon.c-54-\ndrivers/spi/spi-cavium-octeon.c:55:\terr = spi_register_controller(host);\ndrivers/spi/spi-cavium-octeon.c-56-\tif (err) {\n--\ndrivers/spi/spi-cavium-thunderx.c=19=static int thunderx_spi_probe(struct pci_dev *pdev,\n--\ndrivers/spi/spi-cavium-thunderx.c-68-\ndrivers/spi/spi-cavium-thunderx.c:69:\treturn spi_register_controller(host);\ndrivers/spi/spi-cavium-thunderx.c-70-}\n--\ndrivers/spi/spi-ch341.c=141=static int ch341_probe(struct usb_interface *intf,\n--\ndrivers/spi/spi-ch341.c-202-\ndrivers/spi/spi-ch341.c:203:\tret = spi_register_controller(ctrl);\ndrivers/spi/spi-ch341.c-204-\tif (ret)\n--\ndrivers/spi/spi-clps711x.c=91=static int spi_clps711x_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-clps711x.c-137-\ndrivers/spi/spi-clps711x.c:138:\treturn devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-clps711x.c-139-}\n--\ndrivers/spi/spi-coldfire-qspi.c=338=static int mcfqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-coldfire-qspi.c-406-\ndrivers/spi/spi-coldfire-qspi.c:407:\tstatus = spi_register_controller(host);\ndrivers/spi/spi-coldfire-qspi.c-408-\tif (status) {\n--\ndrivers/spi/spi-cs42l43.c=312=static int cs42l43_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cs42l43.c-409-\ndrivers/spi/spi-cs42l43.c:410:\tret = devm_spi_register_controller(priv-\u003edev, priv-\u003ectlr);\ndrivers/spi/spi-cs42l43.c-411-\tif (ret)\n--\ndrivers/spi/spi-dln2.c=680=static int dln2_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-dln2.c-758-\ndrivers/spi/spi-dln2.c:759:\tret = spi_register_controller(host);\ndrivers/spi/spi-dln2.c-760-\tif (ret \u003c 0) {\n--\ndrivers/spi/spi-dw-core.c=1289=int dw_spi_add_controller(struct device *dev, struct dw_spi *dws)\n--\ndrivers/spi/spi-dw-core.c-1368-\ndrivers/spi/spi-dw-core.c:1369:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-dw-core.c-1370-\tif (ret) {\n--\ndrivers/spi/spi-ep93xx.c=623=static int ep93xx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ep93xx.c-692-\ndrivers/spi/spi-ep93xx.c:693:\terror = spi_register_controller(host);\ndrivers/spi/spi-ep93xx.c-694-\tif (error) {\n--\ndrivers/spi/spi-falcon.c=391=static int falcon_sflash_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-falcon.c-407-\ndrivers/spi/spi-falcon.c:408:\treturn devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-falcon.c-409-}\n--\ndrivers/spi/spi-fsi.c=531=static int fsi_spi_probe(struct fsi_device *fsi)\n--\ndrivers/spi/spi-fsi.c-571-\ndrivers/spi/spi-fsi.c:572:\t\trc = devm_spi_register_controller(dev, ctlr);\ndrivers/spi/spi-fsi.c-573-\t\tif (rc)\n--\ndrivers/spi/spi-fsl-dspi.c=1541=static int dspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-dspi.c-1693-\ndrivers/spi/spi-fsl-dspi.c:1694:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-fsl-dspi.c-1695-\tif (ret != 0) {\n--\ndrivers/spi/spi-fsl-espi.c=661=static int fsl_espi_probe(struct device *dev, struct resource *mem,\n--\ndrivers/spi/spi-fsl-espi.c-715-\ndrivers/spi/spi-fsl-espi.c:716:\tret = spi_register_controller(host);\ndrivers/spi/spi-fsl-espi.c-717-\tif (ret \u003c 0)\n--\ndrivers/spi/spi-fsl-lpspi.c=890=static int fsl_lpspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-lpspi.c-1001-\ndrivers/spi/spi-fsl-lpspi.c:1002:\tret = spi_register_controller(controller);\ndrivers/spi/spi-fsl-lpspi.c-1003-\tif (ret \u003c 0) {\ndrivers/spi/spi-fsl-lpspi.c:1004:\t\tdev_err_probe(\u0026pdev-\u003edev, ret, \"spi_register_controller error\\n\");\ndrivers/spi/spi-fsl-lpspi.c-1005-\t\tgoto free_dma;\n--\ndrivers/spi/spi-fsl-qspi.c=894=static int fsl_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-qspi.c-988-\ndrivers/spi/spi-fsl-qspi.c:989:\tret = devm_spi_register_controller(dev, ctlr);\ndrivers/spi/spi-fsl-qspi.c-990-\tif (ret)\n--\ndrivers/spi/spi-fsl-spi.c=528=static struct spi_controller *fsl_spi_probe(struct device *dev,\n--\ndrivers/spi/spi-fsl-spi.c-616-\ndrivers/spi/spi-fsl-spi.c:617:\tret = spi_register_controller(host);\ndrivers/spi/spi-fsl-spi.c-618-\tif (ret \u003c 0)\n--\ndrivers/spi/spi-geni-qcom.c=1069=static int spi_geni_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-geni-qcom.c-1156-\ndrivers/spi/spi-geni-qcom.c:1157:\treturn devm_spi_register_controller(dev, spi);\ndrivers/spi/spi-geni-qcom.c-1158-}\n--\ndrivers/spi/spi-gpio.c=339=static int spi_gpio_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-gpio.c-412-\ndrivers/spi/spi-gpio.c:413:\treturn devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-gpio.c-414-}\n--\ndrivers/spi/spi-gxp.c=250=static int gxp_spifi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-gxp.c-287-\ndrivers/spi/spi-gxp.c:288:\tret = devm_spi_register_controller(dev, ctlr);\ndrivers/spi/spi-gxp.c-289-\tif (ret) {\n--\ndrivers/spi/spi-hisi-kunpeng.c=461=static int hisi_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-hisi-kunpeng.c-523-\ndrivers/spi/spi-hisi-kunpeng.c:524:\tret = spi_register_controller(host);\ndrivers/spi/spi-hisi-kunpeng.c-525-\tif (ret)\n--\ndrivers/spi/spi-hisi-sfc-v3xx.c=430=static int hisi_sfc_v3xx_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-hisi-sfc-v3xx.c-496-\ndrivers/spi/spi-hisi-sfc-v3xx.c:497:\tret = devm_spi_register_controller(dev, ctlr);\ndrivers/spi/spi-hisi-sfc-v3xx.c-498-\tif (ret)\n--\ndrivers/spi/spi-img-spfi.c=525=static int img_spfi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-img-spfi.c-641-\ndrivers/spi/spi-img-spfi.c:642:\tret = spi_register_controller(host);\ndrivers/spi/spi-img-spfi.c-643-\tif (ret)\n--\ndrivers/spi/spi-imx.c=2219=static int spi_imx_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-imx.c-2359-\ndrivers/spi/spi-imx.c:2360:\tret = spi_register_controller(controller);\ndrivers/spi/spi-imx.c-2361-\tif (ret) {\n--\ndrivers/spi/spi-ingenic.c=383=static int spi_ingenic_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ingenic.c-454-\ndrivers/spi/spi-ingenic.c:455:\tret = devm_spi_register_controller(dev, ctlr);\ndrivers/spi/spi-ingenic.c-456-\tif (ret)\n--\ndrivers/spi/spi-intel.c=1489=int intel_spi_probe(struct device *dev, void __iomem *base,\n--\ndrivers/spi/spi-intel.c-1512-\ndrivers/spi/spi-intel.c:1513:\tret = devm_spi_register_controller(dev, host);\ndrivers/spi/spi-intel.c-1514-\tif (ret)\n--\ndrivers/spi/spi-jcore.c=141=static int jcore_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-jcore.c-201-\t/* Register our spi controller */\ndrivers/spi/spi-jcore.c:202:\treturn devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-jcore.c-203-}\n--\ndrivers/spi/spi-kspi2.c=338=static int kspi2_probe(struct auxiliary_device *auxdev,\n--\ndrivers/spi/spi-kspi2.c-392-\thost-\u003etransfer_one = kspi2_transfer_one;\ndrivers/spi/spi-kspi2.c:393:\tret = devm_spi_register_controller(dev, host);\ndrivers/spi/spi-kspi2.c-394-\tif (ret) {\n--\ndrivers/spi/spi-lantiq-ssc.c=904=static int lantiq_ssc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-lantiq-ssc.c-990-\ndrivers/spi/spi-lantiq-ssc.c:991:\terr = spi_register_controller(host);\ndrivers/spi/spi-lantiq-ssc.c-992-\tif (err) {\n--\ndrivers/spi/spi-ljca.c=218=static int ljca_spi_probe(struct auxiliary_device *auxdev,\n--\ndrivers/spi/spi-ljca.c-242-\ndrivers/spi/spi-ljca.c:243:\tret = spi_register_controller(controller);\ndrivers/spi/spi-ljca.c-244-\tif (ret)\n--\ndrivers/spi/spi-loongson-core.c=196=int loongson_spi_init_controller(struct device *dev, void __iomem *regs)\n--\ndrivers/spi/spi-loongson-core.c-227-\ndrivers/spi/spi-loongson-core.c:228:\treturn devm_spi_register_controller(dev, controller);\ndrivers/spi/spi-loongson-core.c-229-}\n--\ndrivers/spi/spi-lp8841-rtc.c=182=spi_lp8841_rtc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-lp8841-rtc.c-212-\t/* register with the SPI framework */\ndrivers/spi/spi-lp8841-rtc.c:213:\tret = devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-lp8841-rtc.c-214-\tif (ret) {\n--\ndrivers/spi/spi-ma35d1-qspi.c=592=static int nuvoton_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ma35d1-qspi.c-659-\ndrivers/spi/spi-ma35d1-qspi.c:660:\tret = devm_spi_register_controller(dev, ctlr);\ndrivers/spi/spi-ma35d1-qspi.c-661-\tif (ret)\n--\ndrivers/spi/spi-meson-spicc.c=978=static int meson_spicc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-meson-spicc.c-1074-\ndrivers/spi/spi-meson-spicc.c:1075:\tret = spi_register_controller(host);\ndrivers/spi/spi-meson-spicc.c-1076-\tif (ret) {\n--\ndrivers/spi/spi-meson-spifc.c=285=static int meson_spifc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-meson-spifc.c-331-\ndrivers/spi/spi-meson-spifc.c:332:\tret = devm_spi_register_controller(spifc-\u003edev, host);\ndrivers/spi/spi-meson-spifc.c-333-\tif (ret)\n--\ndrivers/spi/spi-microchip-core-qspi.c=719=static int mchp_coreqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-microchip-core-qspi.c-792-\ndrivers/spi/spi-microchip-core-qspi.c:793:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-microchip-core-qspi.c-794-\tif (ret)\ndrivers/spi/spi-microchip-core-qspi.c-795-\t\treturn dev_err_probe(\u0026pdev-\u003edev, ret,\ndrivers/spi/spi-microchip-core-qspi.c:796:\t\t\t\t \"spi_register_controller failed\\n\");\ndrivers/spi/spi-microchip-core-qspi.c-797-\n--\ndrivers/spi/spi-microchip-core-spi.c=287=static int mchp_corespi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-microchip-core-spi.c-386-\ndrivers/spi/spi-microchip-core-spi.c:387:\tret = spi_register_controller(host);\ndrivers/spi/spi-microchip-core-spi.c-388-\tif (ret) {\n--\ndrivers/spi/spi-mpc512x-psc.c=458=static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpc512x-psc.c-513-\ndrivers/spi/spi-mpc512x-psc.c:514:\treturn devm_spi_register_controller(dev, host);\ndrivers/spi/spi-mpc512x-psc.c-515-}\n--\ndrivers/spi/spi-mpc52xx-psc.c=294=static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpc52xx-psc.c-343-\ndrivers/spi/spi-mpc52xx-psc.c:344:\treturn devm_spi_register_controller(dev, host);\ndrivers/spi/spi-mpc52xx-psc.c-345-}\n--\ndrivers/spi/spi-mpc52xx.c=387=static int mpc52xx_spi_probe(struct platform_device *op)\n--\ndrivers/spi/spi-mpc52xx.c-504-\tdev_dbg(\u0026op-\u003edev, \"registering spi_controller struct\\n\");\ndrivers/spi/spi-mpc52xx.c:505:\trc = spi_register_controller(host);\ndrivers/spi/spi-mpc52xx.c-506-\tif (rc)\n--\ndrivers/spi/spi-mpfs.c=527=static int mpfs_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpfs.c-576-\ndrivers/spi/spi-mpfs.c:577:\tret = spi_register_controller(host);\ndrivers/spi/spi-mpfs.c-578-\tif (ret) {\n--\ndrivers/spi/spi-mt65xx.c=1175=static int mtk_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mt65xx.c-1327-\ndrivers/spi/spi-mt65xx.c:1328:\tret = spi_register_controller(host);\ndrivers/spi/spi-mt65xx.c-1329-\tif (ret) {\n--\ndrivers/spi/spi-mt7621.c=316=static int mt7621_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mt7621.c-369-\ndrivers/spi/spi-mt7621.c:370:\treturn devm_spi_register_controller(\u0026pdev-\u003edev, host);\ndrivers/spi/spi-mt7621.c-371-}\n--\ndrivers/spi/spi-mtk-nor.c=810=static int mtk_nor_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mtk-nor.c-920-\ndrivers/spi/spi-mtk-nor.c:921:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-mtk-nor.c-922-\tif (ret \u003c 0)\n--\ndrivers/spi/spi-mtk-snfi.c=1338=static int mtk_snand_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mtk-snfi.c-1464-\tctlr-\u003emode_bits = SPI_RX_DUAL | SPI_RX_QUAD | SPI_TX_DUAL | SPI_TX_QUAD;\ndrivers/spi/spi-mtk-snfi.c:1465:\tret = spi_register_controller(ctlr);\ndrivers/spi/spi-mtk-snfi.c-1466-\tif (ret) {\ndrivers/spi/spi-mtk-snfi.c:1467:\t\tdev_err(\u0026pdev-\u003edev, \"spi_register_controller failed.\\n\");\ndrivers/spi/spi-mtk-snfi.c-1468-\t\tgoto free_buf;\n--\ndrivers/spi/spi-mux.c=126=static int spi_mux_probe(struct spi_device *spi)\n--\ndrivers/spi/spi-mux.c-164-\ndrivers/spi/spi-mux.c:165:\treturn devm_spi_register_controller(\u0026spi-\u003edev, ctlr);\ndrivers/spi/spi-mux.c-166-}\n--\ndrivers/spi/spi-mxic.c=754=static int mxic_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mxic.c-818-\ndrivers/spi/spi-mxic.c:819:\tret = spi_register_controller(host);\ndrivers/spi/spi-mxic.c-820-\tif (ret) {\ndrivers/spi/spi-mxic.c:821:\t\tdev_err(\u0026pdev-\u003edev, \"spi_register_controller failed\\n\");\ndrivers/spi/spi-mxic.c-822-\t\tpm_runtime_disable(\u0026pdev-\u003edev);\n--\ndrivers/spi/spi-mxs.c=528=static int mxs_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mxs.c-620-\ndrivers/spi/spi-mxs.c:621:\tret = spi_register_controller(host);\ndrivers/spi/spi-mxs.c-622-\tif (ret) {\n--\ndrivers/spi/spi-npcm-fiu.c=690=static int npcm_fiu_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-npcm-fiu.c-747-\ndrivers/spi/spi-npcm-fiu.c:748:\treturn devm_spi_register_controller(dev, ctrl);\ndrivers/spi/spi-npcm-fiu.c-749-}\n--\n\n"
} |
| 21/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 39027 output: 28 thoughts: 93 Thoughts: Okay, let's break this down. **Investigating USB-Based SPI Controller Implementations** Alright, so I'm thinking about the landscape of SPI controllers, particularly those accessible via USB. My initial question is: are there any virtual or USB-based SPI controller implementations out there that I can leverage? I need to check for existing drivers. My instinct is to dive into the kernel sources. Specifically, I should look at `drivers/spi/spi-ch341.c`, `drivers/spi/spi-dl2n.c`, `drivers/spi/spi-cp2130.c`, and other similar drivers, as a starting point. These are likely candidates. The core question now is, are any of these actually emulating SPI communication via the USB bus, or are they providing a more direct physical interface? The USB connection is key here. Therefore, I need to thoroughly examine those USB-based SPI controllers, like `spi-ch341.c` to see precisely how the USB interface is being used to handle SPI commands and data transfers. Let's see how they handle the low level detail. |
| 22/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "module_usb_driver",
"PathPrefix": "drivers/spi"
}Results: {
"Output": "drivers/spi/spi-ch341.c=244=static struct usb_driver ch341a_usb_driver = {\n--\ndrivers/spi/spi-ch341.c-249-};\ndrivers/spi/spi-ch341.c:250:module_usb_driver(ch341a_usb_driver);\ndrivers/spi/spi-ch341.c-251-\n"
} |
| 23/2 | 2026/09/26 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 39509 output: 33 thoughts: 19 Thoughts: Here's my thought process, as if I were considering this issue: **Delving Deeper: USB-to-SPI across the Driver Landscape** Okay, so we're looking at USB-to-SPI interactions. Before we go any further down this particular rabbit hole, let's step back for a moment and broaden the scope. I need to make sure we're not missing something fundamental. I need a comprehensive overview of how USB-to-SPI is handled across the entire driver ecosystem. I mean, we can't assume a local or isolated issue. This needs a global audit of the `drivers/` directory for any USB-to-SPI implementation. Are there other drivers that might be interfering? Are there common dependencies we might have overlooked? Are there established best practices for this type of interface that we are not aware of? We need to get the "big picture" before we get too deep in the weeds. A broader check is required. |
| 24/2 | 2026/09/26 15:06 | tool | grepper |
0mArgs:{
"Expression": "spi_alloc_host|spi_alloc_master",
"PathPrefix": "drivers/"
}Results: {
"Output": "\nFull output is too long, showing 500 out of 874 lines.\nUse more precise expression if possible.\n\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c=173=int netup_spi_init(struct netup_unidvb_dev *ndev)\n--\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c-177-\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c:178:\tctlr = devm_spi_alloc_host(\u0026ndev-\u003epci_dev-\u003edev,\ndrivers/media/pci/netup_unidvb/netup_unidvb_spi.c-179-\t\t\t\t sizeof(struct netup_spi));\n--\ndrivers/media/usb/msi2500/msi2500.c=1176=static int msi2500_probe(struct usb_interface *intf,\n--\ndrivers/media/usb/msi2500/msi2500.c-1237-\t/* SPI host adapter */\ndrivers/media/usb/msi2500/msi2500.c:1238:\tctlr = spi_alloc_host(dev-\u003edev, 0);\ndrivers/media/usb/msi2500/msi2500.c-1239-\tif (ctlr == NULL) {\n--\ndrivers/spi/atmel-quadspi.c=1403=static int atmel_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/atmel-quadspi.c-1410-\ndrivers/spi/atmel-quadspi.c:1411:\tctrl = devm_spi_alloc_host(dev, sizeof(*aq));\ndrivers/spi/atmel-quadspi.c-1412-\tif (!ctrl)\n--\ndrivers/spi/spi-airoha-snfi.c=1060=static int airoha_snand_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-airoha-snfi.c-1069-\ndrivers/spi/spi-airoha-snfi.c:1070:\tctrl = devm_spi_alloc_host(dev, sizeof(*as_ctrl));\ndrivers/spi/spi-airoha-snfi.c-1071-\tif (!ctrl)\n--\ndrivers/spi/spi-altera-dfl.c=124=static int dfl_spi_altera_probe(struct dfl_device *dfl_dev)\n--\ndrivers/spi/spi-altera-dfl.c-132-\ndrivers/spi/spi-altera-dfl.c:133:\thost = devm_spi_alloc_host(dev, sizeof(struct altera_spi));\ndrivers/spi/spi-altera-dfl.c-134-\tif (!host)\n--\ndrivers/spi/spi-altera-platform.c=35=static int altera_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-altera-platform.c-44-\ndrivers/spi/spi-altera-platform.c:45:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct altera_spi));\ndrivers/spi/spi-altera-platform.c-46-\tif (!host)\n--\ndrivers/spi/spi-amd-pci.c=30=static int amd_spi_pci_probe(struct pci_dev *pdev,\n--\ndrivers/spi/spi-amd-pci.c-38-\t/* Allocate storage for host and driver private data */\ndrivers/spi/spi-amd-pci.c:39:\thost = devm_spi_alloc_host(dev, sizeof(struct amd_spi));\ndrivers/spi/spi-amd-pci.c-40-\tif (!host)\n--\ndrivers/spi/spi-amd.c=851=static int amd_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amd.c-857-\t/* Allocate storage for host and driver private data */\ndrivers/spi/spi-amd.c:858:\thost = devm_spi_alloc_host(dev, sizeof(struct amd_spi));\ndrivers/spi/spi-amd.c-859-\tif (!host)\n--\ndrivers/spi/spi-amlogic-spifc-a1.c=326=static int amlogic_spifc_a1_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spifc-a1.c-331-\ndrivers/spi/spi-amlogic-spifc-a1.c:332:\tctrl = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spifc));\ndrivers/spi/spi-amlogic-spifc-a1.c-333-\tif (!ctrl)\n--\ndrivers/spi/spi-amlogic-spifc-a4.c=1093=static int aml_sfc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spifc-a4.c-1109-\ndrivers/spi/spi-amlogic-spifc-a4.c:1110:\tctrl = devm_spi_alloc_host(dev, sizeof(*sfc));\ndrivers/spi/spi-amlogic-spifc-a4.c-1111-\tif (!ctrl)\n--\ndrivers/spi/spi-amlogic-spisg.c=712=static int aml_spisg_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-amlogic-spisg.c-729-\telse\ndrivers/spi/spi-amlogic-spisg.c:730:\t\tctlr = devm_spi_alloc_host(dev, sizeof(*spisg));\ndrivers/spi/spi-amlogic-spisg.c-731-\tif (!ctlr)\n--\ndrivers/spi/spi-apple.c=457=static int apple_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-apple.c-462-\ndrivers/spi/spi-apple.c:463:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct apple_spi));\ndrivers/spi/spi-apple.c-464-\tif (!ctlr)\n--\ndrivers/spi/spi-ar934x.c=165=static int ar934x_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ar934x.c-181-\ndrivers/spi/spi-ar934x.c:182:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*sp));\ndrivers/spi/spi-ar934x.c-183-\tif (!ctlr) {\n--\ndrivers/spi/spi-armada-3700.c=813=static int a3700_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-armada-3700.c-820-\ndrivers/spi/spi-armada-3700.c:821:\thost = devm_spi_alloc_host(dev, sizeof(*spi));\ndrivers/spi/spi-armada-3700.c-822-\tif (!host)\n--\ndrivers/spi/spi-aspeed-smc.c=957=static int aspeed_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-aspeed-smc.c-969-\ndrivers/spi/spi-aspeed-smc.c:970:\tctlr = devm_spi_alloc_host(dev, sizeof(*aspi));\ndrivers/spi/spi-aspeed-smc.c-971-\tif (!ctlr)\n--\ndrivers/spi/spi-at91-usart.c=476=static int at91_usart_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-at91-usart.c-497-\ndrivers/spi/spi-at91-usart.c:498:\tcontroller = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*aus));\ndrivers/spi/spi-at91-usart.c-499-\tif (!controller)\n--\ndrivers/spi/spi-atcspi200.c=545=static int atcspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-atcspi200.c-551-\ndrivers/spi/spi-atcspi200.c:552:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi));\ndrivers/spi/spi-atcspi200.c-553-\tif (!host)\n--\ndrivers/spi/spi-ath79.c=169=static int ath79_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ath79.c-175-\ndrivers/spi/spi-ath79.c:176:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*sp));\ndrivers/spi/spi-ath79.c-177-\tif (host == NULL) {\n--\ndrivers/spi/spi-atmel.c=1550=static int atmel_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-atmel.c-1570-\t/* setup spi core then atmel-specific driver state */\ndrivers/spi/spi-atmel.c:1571:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*as));\ndrivers/spi/spi-atmel.c-1572-\tif (!host)\n--\ndrivers/spi/spi-au1550.c=714=static int au1550_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-au1550.c-720-\ndrivers/spi/spi-au1550.c:721:\thost = spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct au1550_spi));\ndrivers/spi/spi-au1550.c-722-\tif (host == NULL) {\n--\ndrivers/spi/spi-axi-spi-engine.c=1104=static int spi_engine_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-axi-spi-engine.c-1114-\ndrivers/spi/spi-axi-spi-engine.c:1115:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi_engine));\ndrivers/spi/spi-axi-spi-engine.c-1116-\tif (!host)\n--\ndrivers/spi/spi-axiado.c=752=static int ax_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-axiado.c-758-\ndrivers/spi/spi-axiado.c:759:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*xspi));\ndrivers/spi/spi-axiado.c-760-\tif (!ctlr)\n--\ndrivers/spi/spi-bcm-qspi.c=1482=int bcm_qspi_probe(struct platform_device *pdev,\n--\ndrivers/spi/spi-bcm-qspi.c-1506-\ndrivers/spi/spi-bcm-qspi.c:1507:\thost = devm_spi_alloc_host(dev, sizeof(struct bcm_qspi));\ndrivers/spi/spi-bcm-qspi.c-1508-\tif (!host) {\n--\ndrivers/spi/spi-bcm2835.c=1349=static int bcm2835_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm2835.c-1354-\ndrivers/spi/spi-bcm2835.c:1355:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcm2835.c-1356-\tif (!ctlr)\n--\ndrivers/spi/spi-bcm2835aux.c=474=static int bcm2835aux_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm2835aux.c-480-\ndrivers/spi/spi-bcm2835aux.c:481:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcm2835aux.c-482-\tif (!host)\n--\ndrivers/spi/spi-bcm63xx-hsspi.c=742=static int bcm63xx_hsspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm63xx-hsspi.c-785-\ndrivers/spi/spi-bcm63xx-hsspi.c:786:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcm63xx-hsspi.c-787-\tif (!host)\n--\ndrivers/spi/spi-bcm63xx.c=491=static int bcm63xx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcm63xx.c-542-\ndrivers/spi/spi-bcm63xx.c:543:\thost = devm_spi_alloc_host(dev, sizeof(*bs));\ndrivers/spi/spi-bcm63xx.c-544-\tif (!host)\n--\ndrivers/spi/spi-bcmbca-hsspi.c=432=static int bcmbca_hsspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-bcmbca-hsspi.c-474-\ndrivers/spi/spi-bcmbca-hsspi.c:475:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*bs));\ndrivers/spi/spi-bcmbca-hsspi.c-476-\tif (!host)\n--\ndrivers/spi/spi-butterfly.c=176=static void butterfly_attach(struct parport *p)\n--\ndrivers/spi/spi-butterfly.c-191-\ndrivers/spi/spi-butterfly.c:192:\thost = spi_alloc_host(dev, sizeof(*pp));\ndrivers/spi/spi-butterfly.c-193-\tif (!host) {\n--\ndrivers/spi/spi-cadence-quadspi.c=1785=static int cqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence-quadspi.c-1794-\ndrivers/spi/spi-cadence-quadspi.c:1795:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*cqspi));\ndrivers/spi/spi-cadence-quadspi.c-1796-\tif (!host)\n--\ndrivers/spi/spi-cadence-xspi.c=1180=static int cdns_xspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence-xspi.c-1187-\ndrivers/spi/spi-cadence-xspi.c:1188:\thost = devm_spi_alloc_host(dev, sizeof(*cdns_xspi));\ndrivers/spi/spi-cadence-xspi.c-1189-\tif (!host)\n--\ndrivers/spi/spi-cadence.c=642=static int cdns_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cadence.c-653-\telse\ndrivers/spi/spi-cadence.c:654:\t\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*xspi));\ndrivers/spi/spi-cadence.c-655-\n--\ndrivers/spi/spi-cavium-octeon.c=19=static int octeon_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cavium-octeon.c-25-\ndrivers/spi/spi-cavium-octeon.c:26:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct octeon_spi));\ndrivers/spi/spi-cavium-octeon.c-27-\tif (!host)\n--\ndrivers/spi/spi-cavium-thunderx.c=19=static int thunderx_spi_probe(struct pci_dev *pdev,\n--\ndrivers/spi/spi-cavium-thunderx.c-26-\ndrivers/spi/spi-cavium-thunderx.c:27:\thost = devm_spi_alloc_host(dev, sizeof(struct octeon_spi));\ndrivers/spi/spi-cavium-thunderx.c-28-\tif (!host)\n--\ndrivers/spi/spi-ch341.c=141=static int ch341_probe(struct usb_interface *intf,\n--\ndrivers/spi/spi-ch341.c-154-\ndrivers/spi/spi-ch341.c:155:\tctrl = devm_spi_alloc_host(\u0026intf-\u003edev, sizeof(struct ch341_spi_dev));\ndrivers/spi/spi-ch341.c-156-\tif (!ctrl)\n--\ndrivers/spi/spi-clps711x.c=91=static int spi_clps711x_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-clps711x.c-101-\ndrivers/spi/spi-clps711x.c:102:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*hw));\ndrivers/spi/spi-clps711x.c-103-\tif (!host)\n--\ndrivers/spi/spi-coldfire-qspi.c=338=static int mcfqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-coldfire-qspi.c-355-\ndrivers/spi/spi-coldfire-qspi.c:356:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*mcfqspi));\ndrivers/spi/spi-coldfire-qspi.c-357-\tif (host == NULL)\n--\ndrivers/spi/spi-cs42l43.c=312=static int cs42l43_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-cs42l43.c-325-\ndrivers/spi/spi-cs42l43.c:326:\tpriv-\u003ectlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*priv-\u003ectlr));\ndrivers/spi/spi-cs42l43.c-327-\tif (!priv-\u003ectlr)\n--\ndrivers/spi/spi-davinci.c=922=static int davinci_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-davinci.c-930-\ndrivers/spi/spi-davinci.c:931:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct davinci_spi));\ndrivers/spi/spi-davinci.c-932-\tif (host == NULL) {\n--\ndrivers/spi/spi-dln2.c=680=static int dln2_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-dln2.c-686-\ndrivers/spi/spi-dln2.c:687:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*dln2));\ndrivers/spi/spi-dln2.c-688-\tif (!host)\n--\ndrivers/spi/spi-dw-core.c=1289=int dw_spi_add_controller(struct device *dev, struct dw_spi *dws)\n--\ndrivers/spi/spi-dw-core.c-1301-\telse\ndrivers/spi/spi-dw-core.c:1302:\t\tctlr = spi_alloc_host(dev, 0);\ndrivers/spi/spi-dw-core.c-1303-\n--\ndrivers/spi/spi-ep93xx.c=623=static int ep93xx_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ep93xx.c-634-\ndrivers/spi/spi-ep93xx.c:635:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*espi));\ndrivers/spi/spi-ep93xx.c-636-\tif (!host)\n--\ndrivers/spi/spi-falcon.c=391=static int falcon_sflash_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-falcon.c-395-\ndrivers/spi/spi-falcon.c:396:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*priv));\ndrivers/spi/spi-falcon.c-397-\tif (!host)\n--\ndrivers/spi/spi-fsi.c=531=static int fsi_spi_probe(struct fsi_device *fsi)\n--\ndrivers/spi/spi-fsi.c-556-\ndrivers/spi/spi-fsi.c:557:\t\tctlr = devm_spi_alloc_host(dev, sizeof(*ctx));\ndrivers/spi/spi-fsi.c-558-\t\tif (!ctlr)\n--\ndrivers/spi/spi-fsl-dspi.c=1541=static int dspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-dspi.c-1558-\telse\ndrivers/spi/spi-fsl-dspi.c:1559:\t\tctlr = spi_alloc_host(\u0026pdev-\u003edev, 0);\ndrivers/spi/spi-fsl-dspi.c-1560-\tif (!ctlr)\n--\ndrivers/spi/spi-fsl-espi.c=661=static int fsl_espi_probe(struct device *dev, struct resource *mem,\n--\ndrivers/spi/spi-fsl-espi.c-667-\ndrivers/spi/spi-fsl-espi.c:668:\thost = devm_spi_alloc_host(dev, sizeof(struct fsl_espi));\ndrivers/spi/spi-fsl-espi.c-669-\tif (!host)\n--\ndrivers/spi/spi-fsl-lpspi.c=890=static int fsl_lpspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-lpspi.c-909-\telse\ndrivers/spi/spi-fsl-lpspi.c:910:\t\tcontroller = devm_spi_alloc_host(\u0026pdev-\u003edev,\ndrivers/spi/spi-fsl-lpspi.c-911-\t\t\t\t\t\t sizeof(struct fsl_lpspi_data));\n--\ndrivers/spi/spi-fsl-qspi.c=894=static int fsl_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-fsl-qspi.c-902-\ndrivers/spi/spi-fsl-qspi.c:903:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*q));\ndrivers/spi/spi-fsl-qspi.c-904-\tif (!ctlr)\n--\ndrivers/spi/spi-fsl-spi.c=528=static struct spi_controller *fsl_spi_probe(struct device *dev,\n--\ndrivers/spi/spi-fsl-spi.c-537-\ndrivers/spi/spi-fsl-spi.c:538:\thost = devm_spi_alloc_host(dev, sizeof(struct mpc8xxx_spi));\ndrivers/spi/spi-fsl-spi.c-539-\tif (host == NULL) {\n--\ndrivers/spi/spi-geni-qcom.c=1069=static int spi_geni_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-geni-qcom.c-1091-\telse\ndrivers/spi/spi-geni-qcom.c:1092:\t\tspi = devm_spi_alloc_host(dev, sizeof(*mas));\ndrivers/spi/spi-geni-qcom.c-1093-\n--\ndrivers/spi/spi-gpio.c=339=static int spi_gpio_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-gpio.c-347-\ndrivers/spi/spi-gpio.c:348:\thost = devm_spi_alloc_host(dev, sizeof(*spi_gpio));\ndrivers/spi/spi-gpio.c-349-\tif (!host)\n--\ndrivers/spi/spi-gxp.c=250=static int gxp_spifi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-gxp.c-259-\ndrivers/spi/spi-gxp.c:260:\tctlr = devm_spi_alloc_host(dev, sizeof(*spifi));\ndrivers/spi/spi-gxp.c-261-\tif (!ctlr)\n--\ndrivers/spi/spi-hisi-kunpeng.c=461=static int hisi_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-hisi-kunpeng.c-472-\ndrivers/spi/spi-hisi-kunpeng.c:473:\thost = devm_spi_alloc_host(dev, sizeof(*hs));\ndrivers/spi/spi-hisi-kunpeng.c-474-\tif (!host)\n--\ndrivers/spi/spi-hisi-sfc-v3xx.c=430=static int hisi_sfc_v3xx_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-hisi-sfc-v3xx.c-437-\ndrivers/spi/spi-hisi-sfc-v3xx.c:438:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/spi/spi-hisi-sfc-v3xx.c-439-\tif (!ctlr)\n--\ndrivers/spi/spi-img-spfi.c=525=static int img_spfi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-img-spfi.c-532-\ndrivers/spi/spi-img-spfi.c:533:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spfi));\ndrivers/spi/spi-img-spfi.c-534-\tif (!host)\n--\ndrivers/spi/spi-imx.c=2219=static int spi_imx_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-imx.c-2235-\telse\ndrivers/spi/spi-imx.c:2236:\t\tcontroller = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi_imx));\ndrivers/spi/spi-imx.c-2237-\tif (!controller)\n--\ndrivers/spi/spi-ingenic.c=383=static int spi_ingenic_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ingenic.c-397-\ndrivers/spi/spi-ingenic.c:398:\tctlr = devm_spi_alloc_host(dev, sizeof(*priv));\ndrivers/spi/spi-ingenic.c-399-\tif (!ctlr) {\n--\ndrivers/spi/spi-intel.c=1489=int intel_spi_probe(struct device *dev, void __iomem *base,\n--\ndrivers/spi/spi-intel.c-1495-\ndrivers/spi/spi-intel.c:1496:\thost = devm_spi_alloc_host(dev, sizeof(*ispi));\ndrivers/spi/spi-intel.c-1497-\tif (!host)\n--\ndrivers/spi/spi-jcore.c=141=static int jcore_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-jcore.c-149-\ndrivers/spi/spi-jcore.c:150:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct jcore_spi));\ndrivers/spi/spi-jcore.c-151-\tif (!host)\n--\ndrivers/spi/spi-kspi2.c=338=static int kspi2_probe(struct auxiliary_device *auxdev,\n--\ndrivers/spi/spi-kspi2.c-346-\ndrivers/spi/spi-kspi2.c:347:\thost = devm_spi_alloc_host(dev, sizeof(struct kspi2));\ndrivers/spi/spi-kspi2.c-348-\tif (!host)\n--\ndrivers/spi/spi-lantiq-ssc.c=904=static int lantiq_ssc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-lantiq-ssc.c-915-\ndrivers/spi/spi-lantiq-ssc.c:916:\thost = devm_spi_alloc_host(dev, sizeof(struct lantiq_ssc_spi));\ndrivers/spi/spi-lantiq-ssc.c-917-\tif (!host)\n--\ndrivers/spi/spi-ljca.c=218=static int ljca_spi_probe(struct auxiliary_device *auxdev,\n--\ndrivers/spi/spi-ljca.c-225-\ndrivers/spi/spi-ljca.c:226:\tcontroller = devm_spi_alloc_host(\u0026auxdev-\u003edev, sizeof(*ljca_spi));\ndrivers/spi/spi-ljca.c-227-\tif (!controller)\n--\ndrivers/spi/spi-lm70llp.c=188=static void spi_lm70llp_attach(struct parport *p)\n--\ndrivers/spi/spi-lm70llp.c-204-\ndrivers/spi/spi-lm70llp.c:205:\thost = spi_alloc_host(p-\u003ephysport-\u003edev, sizeof(*pp));\ndrivers/spi/spi-lm70llp.c-206-\tif (!host) {\n--\ndrivers/spi/spi-loongson-core.c=196=int loongson_spi_init_controller(struct device *dev, void __iomem *regs)\n--\ndrivers/spi/spi-loongson-core.c-201-\ndrivers/spi/spi-loongson-core.c:202:\tcontroller = devm_spi_alloc_host(dev, sizeof(struct loongson_spi));\ndrivers/spi/spi-loongson-core.c-203-\tif (controller == NULL)\n--\ndrivers/spi/spi-lp8841-rtc.c=182=spi_lp8841_rtc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-lp8841-rtc.c-187-\ndrivers/spi/spi-lp8841-rtc.c:188:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*data));\ndrivers/spi/spi-lp8841-rtc.c-189-\tif (!host)\n--\ndrivers/spi/spi-ma35d1-qspi.c=592=static int nuvoton_qspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-ma35d1-qspi.c-600-\ndrivers/spi/spi-ma35d1-qspi.c:601:\tctlr = devm_spi_alloc_host(dev, sizeof(*qspi));\ndrivers/spi/spi-ma35d1-qspi.c-602-\tif (!ctlr)\n--\ndrivers/spi/spi-meson-spicc.c=978=static int meson_spicc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-meson-spicc.c-983-\ndrivers/spi/spi-meson-spicc.c:984:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spicc));\ndrivers/spi/spi-meson-spicc.c-985-\tif (!host) {\n--\ndrivers/spi/spi-meson-spifc.c=285=static int meson_spifc_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-meson-spifc.c-292-\ndrivers/spi/spi-meson-spifc.c:293:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct meson_spifc));\ndrivers/spi/spi-meson-spifc.c-294-\tif (!host)\n--\ndrivers/spi/spi-microchip-core-qspi.c=719=static int mchp_coreqspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-microchip-core-qspi.c-727-\ndrivers/spi/spi-microchip-core-qspi.c:728:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*qspi));\ndrivers/spi/spi-microchip-core-qspi.c-729-\tif (!ctlr)\n--\ndrivers/spi/spi-microchip-core-spi.c=287=static int mchp_corespi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-microchip-core-spi.c-297-\ndrivers/spi/spi-microchip-core-spi.c:298:\thost = devm_spi_alloc_host(dev, sizeof(*spi));\ndrivers/spi/spi-microchip-core-spi.c-299-\tif (!host)\n--\ndrivers/spi/spi-mpc512x-psc.c=458=static int mpc512x_psc_spi_of_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpc512x-psc.c-466-\ndrivers/spi/spi-mpc512x-psc.c:467:\thost = devm_spi_alloc_host(dev, sizeof(*mps));\ndrivers/spi/spi-mpc512x-psc.c-468-\tif (host == NULL)\n--\ndrivers/spi/spi-mpc52xx-psc.c=294=static int mpc52xx_psc_spi_of_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpc52xx-psc.c-301-\ndrivers/spi/spi-mpc52xx-psc.c:302:\thost = devm_spi_alloc_host(dev, sizeof(*mps));\ndrivers/spi/spi-mpc52xx-psc.c-303-\tif (host == NULL)\n--\ndrivers/spi/spi-mpc52xx.c=387=static int mpc52xx_spi_probe(struct platform_device *op)\n--\ndrivers/spi/spi-mpc52xx.c-435-\tdev_dbg(\u0026op-\u003edev, \"allocating spi_controller struct\\n\");\ndrivers/spi/spi-mpc52xx.c:436:\thost = spi_alloc_host(\u0026op-\u003edev, sizeof(*ms));\ndrivers/spi/spi-mpc52xx.c-437-\tif (!host) {\n--\ndrivers/spi/spi-mpfs.c=527=static int mpfs_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mpfs.c-534-\ndrivers/spi/spi-mpfs.c:535:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi));\ndrivers/spi/spi-mpfs.c-536-\tif (!host)\n--\ndrivers/spi/spi-mt65xx.c=1175=static int mtk_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mt65xx.c-1181-\ndrivers/spi/spi-mt65xx.c:1182:\thost = devm_spi_alloc_host(dev, sizeof(*mdata));\ndrivers/spi/spi-mt65xx.c-1183-\tif (!host)\n--\ndrivers/spi/spi-mt7621.c=316=static int mt7621_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mt7621.c-337-\ndrivers/spi/spi-mt7621.c:338:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*rs));\ndrivers/spi/spi-mt7621.c-339-\tif (!host) {\n--\ndrivers/spi/spi-mtk-nor.c=810=static int mtk_nor_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mtk-nor.c-846-\ndrivers/spi/spi-mtk-nor.c:847:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*sp));\ndrivers/spi/spi-mtk-nor.c-848-\tif (!ctlr) {\n--\ndrivers/spi/spi-mtk-snfi.c=1338=static int mtk_snand_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mtk-snfi.c-1351-\ndrivers/spi/spi-mtk-snfi.c:1352:\tctlr = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*ms));\ndrivers/spi/spi-mtk-snfi.c-1353-\tif (!ctlr)\n--\ndrivers/spi/spi-mux.c=126=static int spi_mux_probe(struct spi_device *spi)\n--\ndrivers/spi/spi-mux.c-130-\ndrivers/spi/spi-mux.c:131:\tctlr = devm_spi_alloc_host(\u0026spi-\u003edev, sizeof(*priv));\ndrivers/spi/spi-mux.c-132-\tif (!ctlr)\n--\ndrivers/spi/spi-mxic.c=754=static int mxic_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mxic.c-760-\ndrivers/spi/spi-mxic.c:761:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(struct mxic_spi));\ndrivers/spi/spi-mxic.c-762-\tif (!host)\n--\ndrivers/spi/spi-mxs.c=528=static int mxs_spi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-mxs.c-565-\ndrivers/spi/spi-mxs.c:566:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*spi));\ndrivers/spi/spi-mxs.c-567-\tif (!host)\n--\ndrivers/spi/spi-npcm-fiu.c=690=static int npcm_fiu_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-npcm-fiu.c-698-\ndrivers/spi/spi-npcm-fiu.c:699:\tctrl = devm_spi_alloc_host(dev, sizeof(*fiu));\ndrivers/spi/spi-npcm-fiu.c-700-\tif (!ctrl)\n--\ndrivers/spi/spi-npcm-pspi.c=340=static int npcm_pspi_probe(struct platform_device *pdev)\n--\ndrivers/spi/spi-npcm-pspi.c-347-\ndrivers/spi/spi-npcm-pspi.c:348:\thost = devm_spi_alloc_host(\u0026pdev-\u003edev, sizeof(*priv));\ndrivers/spi/spi-npcm-pspi.c-349-\tif (!host)\n--\ndrivers/spi/spi-nxp-fspi.c=1394=static int nxp_fspi_probe(struct platform_device *pdev)\n--\n\n"
} |
| 25/2 | 2026/09/26 15:07 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 50268 output: 46 thoughts: 257 Thoughts: **Investigating USB-to-SPI Emulation Potential** Okay, so I'm looking at `drivers/spi/spi-ch341.c`. It's a USB-based driver, declared as a `module_usb_driver`. But the gears are turning – what about USB raw or gadget functionality? Could we potentially emulate a USB device like the CH341, or DLN2, or MSI2500, using the USB raw/dummy_hcd approach? I know Syzkaller leverages that (`raw_gadget`/`dummy_hcd`) for USB driver fuzzing. The question is: if one of these emulated USB devices is "attached," could we then trigger SPI device creation through sysfs via `new_device`? Hold on…does Syzkaller even go down that path? I need to check if it does something similar. Does it have any specific support for `new_device` for either network devices or SPI? I should probably start looking for `new_device` calls in the kernel source or consider other ways to probe something like the `w5100`. Thinking about the `w5100`, could it be probed even without any hardware? Can `w5100_probe` succeed in a hardware-free environment? That’s what I need to look into - let's dive into `w5100_probe`. |
| 26/2 | 2026/09/26 15:07 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/wiznet/w5100.c",
"FirstLine": 850,
"LineCount": 100
}Results: {
"Contents": " 850:\t\tif (!ndev)\n 851:\t\t\treturn -ENOMEM;\n 852:\t\tSET_NETDEV_DEV(ndev, dev);\n 853:\t\tdev_set_drvdata(dev, ndev);\n 854:\t\tpriv = netdev_priv(ndev);\n 855:\t\n 856:\t\tmutex_init(\u0026priv-\u003elink_lock);\n 857:\t\n 858:\t\tswitch (ops-\u003echip_id) {\n 859:\t\tcase W5100:\n 860:\t\t\tpriv-\u003es0_regs = W5100_S0_REGS;\n 861:\t\t\tpriv-\u003es0_tx_buf = W5100_TX_MEM_START;\n 862:\t\t\tpriv-\u003es0_tx_buf_size = W5100_TX_MEM_SIZE;\n 863:\t\t\tpriv-\u003es0_rx_buf = W5100_RX_MEM_START;\n 864:\t\t\tpriv-\u003es0_rx_buf_size = W5100_RX_MEM_SIZE;\n 865:\t\t\tbreak;\n 866:\t\tcase W5200:\n 867:\t\t\tpriv-\u003es0_regs = W5200_S0_REGS;\n 868:\t\t\tpriv-\u003es0_tx_buf = W5200_TX_MEM_START;\n 869:\t\t\tpriv-\u003es0_tx_buf_size = W5200_TX_MEM_SIZE;\n 870:\t\t\tpriv-\u003es0_rx_buf = W5200_RX_MEM_START;\n 871:\t\t\tpriv-\u003es0_rx_buf_size = W5200_RX_MEM_SIZE;\n 872:\t\t\tbreak;\n 873:\t\tcase W5500:\n 874:\t\t\tpriv-\u003es0_regs = W5500_S0_REGS;\n 875:\t\t\tpriv-\u003es0_tx_buf = W5500_TX_MEM_START;\n 876:\t\t\tpriv-\u003es0_tx_buf_size = W5500_TX_MEM_SIZE;\n 877:\t\t\tpriv-\u003es0_rx_buf = W5500_RX_MEM_START;\n 878:\t\t\tpriv-\u003es0_rx_buf_size = W5500_RX_MEM_SIZE;\n 879:\t\t\tbreak;\n 880:\t\tdefault:\n 881:\t\t\terr = -EINVAL;\n 882:\t\t\tgoto err_mutex;\n 883:\t\t}\n 884:\t\n 885:\t\tpriv-\u003endev = ndev;\n 886:\t\tpriv-\u003eops = ops;\n 887:\t\tpriv-\u003eirq = irq;\n 888:\t\n 889:\t\tpriv-\u003elink_irq = -EINVAL;\n 890:\t\tif (ops-\u003echip_id == W5500) {\n 891:\t\t\tpriv-\u003elink_irq = fwnode_irq_get(dev_fwnode(dev), 1);\n 892:\t\t\tif (priv-\u003elink_irq == -EPROBE_DEFER) {\n 893:\t\t\t\terr = dev_err_probe(dev, priv-\u003elink_irq,\n 894:\t\t\t\t\t\t \"failed to get link irq\\n\");\n 895:\t\t\t\tgoto err_mutex;\n 896:\t\t\t}\n 897:\t\t}\n 898:\t\n 899:\t\tndev-\u003enetdev_ops = \u0026w5100_netdev_ops;\n 900:\t\tndev-\u003eethtool_ops = priv-\u003elink_irq \u003e 0 ? \u0026w5500_ethtool_ops :\n 901:\t\t\t\t\t\t\t \u0026w5100_ethtool_ops;\n 902:\t\n 903:\t\tnetif_napi_add_weight(ndev, \u0026priv-\u003enapi, w5100_napi_poll, 16);\n 904:\t\n 905:\t\t/* This chip doesn't support VLAN packets with normal MTU,\n 906:\t\t * so disable VLAN for this device.\n 907:\t\t */\n 908:\t\tndev-\u003efeatures |= NETIF_F_VLAN_CHALLENGED;\n 909:\t\n 910:\t\tpriv-\u003exfer_wq = alloc_workqueue(\"%s\", WQ_MEM_RECLAIM | WQ_PERCPU, 0,\n 911:\t\t\t\t\t\tdev_name(dev));\n 912:\t\tif (!priv-\u003exfer_wq) {\n 913:\t\t\terr = -ENOMEM;\n 914:\t\t\tgoto err_mutex;\n 915:\t\t}\n 916:\t\n 917:\t\tINIT_WORK(\u0026priv-\u003erx_work, w5100_rx_work);\n 918:\t\tINIT_WORK(\u0026priv-\u003etx_work, w5100_tx_work);\n 919:\t\tINIT_WORK(\u0026priv-\u003esetrx_work, w5100_setrx_work);\n 920:\t\tINIT_WORK(\u0026priv-\u003erestart_work, w5100_restart_work);\n 921:\t\n 922:\t\tif (mac_addr)\n 923:\t\t\teth_hw_addr_set(ndev, mac_addr);\n 924:\t\telse\n 925:\t\t\teth_hw_addr_random(ndev);\n 926:\t\n 927:\t\tif (priv-\u003eops-\u003einit) {\n 928:\t\t\terr = priv-\u003eops-\u003einit(priv-\u003endev);\n 929:\t\t\tif (err)\n 930:\t\t\t\tgoto err_hw;\n 931:\t\t}\n 932:\t\n 933:\t\terr = w5100_hw_reset(priv);\n 934:\t\tif (err)\n 935:\t\t\tgoto err_hw;\n 936:\t\n 937:\t\tif (ops-\u003emay_sleep) {\n 938:\t\t\terr = request_threaded_irq(priv-\u003eirq, NULL, w5100_interrupt,\n 939:\t\t\t\t\t\t IRQF_TRIGGER_LOW | IRQF_ONESHOT |\n 940:\t\t\t\t\t\t IRQF_NO_AUTOEN,\n 941:\t\t\t\t\t\t dev_name(dev), ndev);\n 942:\t\t} else {\n 943:\t\t\terr = request_irq(priv-\u003eirq, w5100_interrupt,\n 944:\t\t\t\t\t IRQF_TRIGGER_LOW | IRQF_NO_AUTOEN,\n 945:\t\t\t\t\t dev_name(dev), ndev);\n 946:\t\t}\n 947:\t\tif (err)\n 948:\t\t\tgoto err_hw;\n 949:\t\n"
} |
| 27/2 | 2026/09/26 15:07 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 52634 output: 45 thoughts: 56 Thoughts: Here's my analysis of the provided code snippet, thinking out loud as I process it: **Deconstructing w5100_hw_reset(priv)** Okay, so I'm looking at this `w5100_hw_reset(priv)` function. My initial question is: *what exactly does this do*? It's pretty self-explanatory, but I always want to be precise. Let's delve into its implementation to understand its behavior. Right, let's head over to `w5100.c` and specifically examine lines 430-450, where I'd expect to find the function's definition and guts. This will give me the meat of the operation. I'm looking for the hardware-level details, any manipulation of control lines, or register operations. Gotta see what this reset entails. |
| 28/2 | 2026/09/26 15:07 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/wiznet/w5100.c",
"FirstLine": 425,
"LineCount": 40
}Results: {
"Contents": " 425:\tout:\n 426:\t\tmutex_unlock(\u0026priv-\u003elink_lock);\n 427:\t\n 428:\t\treturn link;\n 429:\t}\n 430:\t\n 431:\tstatic int w5100_hw_reset(struct w5100_priv *priv)\n 432:\t{\n 433:\t\tu32 rtr;\n 434:\t\n 435:\t\tw5100_reset(priv);\n 436:\t\n 437:\t\tw5100_disable_intr(priv);\n 438:\t\tw5100_write_macaddr(priv);\n 439:\t\n 440:\t\tswitch (priv-\u003eops-\u003echip_id) {\n 441:\t\tcase W5100:\n 442:\t\t\tw5100_memory_configure(priv);\n 443:\t\t\trtr = W5100_RTR;\n 444:\t\t\tbreak;\n 445:\t\tcase W5200:\n 446:\t\t\tw5200_memory_configure(priv);\n 447:\t\t\trtr = W5100_RTR;\n 448:\t\t\tbreak;\n 449:\t\tcase W5500:\n 450:\t\t\tw5500_memory_configure(priv);\n 451:\t\t\trtr = W5500_RTR;\n 452:\t\t\tbreak;\n 453:\t\tdefault:\n 454:\t\t\treturn -EINVAL;\n 455:\t\t}\n 456:\t\n 457:\t\tif (w5100_read16(priv, rtr) != RTR_DEFAULT)\n 458:\t\t\treturn -ENODEV;\n 459:\t\n 460:\t\treturn 0;\n 461:\t}\n 462:\t\n 463:\tstatic void w5100_hw_start(struct w5100_priv *priv)\n 464:\t{\n"
} |
| 29/2 | 2026/09/26 15:07 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 53470 output: 125 thoughts: 2490 Thoughts: **Analysis of the Wiznet W5100 Driver for Fuzzing Eligibility** Okay, let's break this down. Line 457 immediately flags a potential issue: the `w5100_read16` function. If the hardware doesn't respond with `RTR_DEFAULT`, we get `-ENODEV`. That's a red flag. What *is* a W5100, anyway? Let's carefully refer to Section 2 of the instructions. The guiding principle is clear: fuzz only what's reachable. We need to assess if this code is *structurally* unreachable. The criteria list specific examples of unreachable hardware, and the W5100 immediately triggers a thought. The instructions specifically state that "Fuzzing can only discover bugs in code that can actually execute in standard virtualized environments (GCE or QEMU, utilizing software-emulated devices...)." The W5100 is a "standalone 10/100 MBit Ethernet controller with SPI interface." An SPI Ethernet controller! Does QEMU emulate that? Let's consider the target architecture: `amd64`. No. QEMU does *not* emulate a W5100 SPI chip. It has various network devices, but not the W5100. Even if QEMU had an SPI bus on x86 (which it doesn't, standard QEMU has no exposed or emulated SPI bus), it wouldn't emulate a W5100. We can't use USB emulation either; even with a USB-to-SPI adapter, the SPI device is a physical W5100 chip. Even if someone tried to instantiate the W5100 driver, it would immediately fail during initialization, because the `w5100_read16` function would return -ENODEV. There is no mock interface, no platform device fallback, nothing! Checking the code, the probe is called only by `w5100-spi.c`. The driver is a SPI driver. It requires the physical chip. The DT binding example confirms this: it's for embedded boards like Raspberry Pi. On `amd64`, this is *completely* unreachable. Let's circle back to Section 2: "Structurally unreachable hardware... requiring physical ASIC/PCIe cards not emulated in standard QEMU." The W5100 is an ASIC Ethernet controller connected via SPI! It's not emulated. It's an SPI chip. The patch itself touches `Documentation/devicetree/bindings/net/wiznet,w5100.yaml`, `Documentation/devicetree/bindings/net/wiznet,w5x00.txt`, `MAINTAINERS`, and `drivers/net/ethernet/wiznet/w5100.c`. Those are documentation, maintainer entries, and the driver itself. Let's make sure there is no other path to it: The makefile only links it via SPI. It's only called from `w5100-spi.c`. The W5100 probe is inside `w5100_probe` and it requires the chip to be functional. Section 1 hammers the point home: "REACHABILITY IS THE PRIMARY GATE...". If the modified code is unreachable, it's not worth fuzzing. The code *is* unreachable! It needs a physical chip. The rest are documentation files. Reviewing the diff, we can see it confirms the changes: - DT binding. - Old DT binding deletion. - `MAINTAINERS` change. - `drivers/net/ethernet/wiznet/w5100.c`. The core driver logic. All the code is related to the SPI driver for an external chip, unreachable in standard QEMU. Therefore: * `WorthFuzzing`: `false` * `EnableConfigs`: `[]` (empty list) * `FocusSymbols`: `[]` (empty list) * `Reasoning`: The code requires a physical Wiznet W5100/W5200/W5500 SPI Ethernet ASIC not emulated in standard QEMU/GCE test environments, making it structurally unreachable on the target architecture. |
| 30/2 | 2026/09/26 15:07 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies the Wiznet W5100/W5200/W5500 SPI Ethernet driver (drivers/net/ethernet/wiznet/w5100.c), devicetree bindings, and MAINTAINERS. This driver is for standalone SPI Ethernet controller ASICs that are not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the Wiznet W5100/W5200/W5500 SPI Ethernet driver (drivers/net/ethernet/wiznet/w5100.c), devicetree bindings, and MAINTAINERS. This driver is for standalone SPI Ethernet controller ASICs that are not emulated in standard QEMU or GCE virtualized environments on amd64, making the modified code structurally unreachable.",
"WorthFuzzing": false
} |
| 31/1 | 2026/09/26 15:07 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|