| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/11/20 07:16 | flow | patch-triage |
1mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch modifies the SDIO bus transport layer (rtw88_sdio) for Realtek wireless devices. This code requires physical SDIO hardware (such as RTL8723BS or RTL8822BS/CS) and cannot be instantiated or probed in standard virtualized environments (QEMU/GCE) since there is no virtual SDIO emulation or gadget interface available to syzkaller. Consequently, the modified code is structurally unreachable for fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/11/20 07:16 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 81f4a84e5c796e056d2c5eef96408d5ec97c9f19\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Fri Nov 20 07:16:28 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c\nindex 83e9b301ae9be5..f0feca2bf207ec 100644\n--- a/drivers/net/wireless/realtek/rtw88/sdio.c\n+++ b/drivers/net/wireless/realtek/rtw88/sdio.c\n@@ -22,11 +22,26 @@\n #define RTW_SDIO_INDIRECT_RW_RETRIES\t\t\t50\n #define RTW_SDIO_OQT_TIMEOUT_MS\t\t\t\t1000\n \n-/* Bounds the queueing latency of the unbounded per-AC software FIFO. */\n+/*\n+ * Bound the queueing latency of the per-AC software FIFO, so that the\n+ * backlog stays in mac80211, where it is scheduled fairly between flows and\n+ * stations. The 88xx chips send up to RTW_SDIO_TX_AGG_MAX_NUM frames per\n+ * transfer and need a deeper FIFO to keep doing that.\n+ */\n #define RTW_SDIO_TX_FIFO_HIWATER\t\t\t16\n #define RTW_SDIO_TX_FIFO_LOWATER\t\t\t8\n+#define RTW_SDIO_88XX_TX_FIFO_HIWATER\t\t\t64\n+#define RTW_SDIO_88XX_TX_FIFO_LOWATER\t\t\t32\n #define RTW_SDIO_TX_RETRY_DELAY\t\t\tmsecs_to_jiffies(1)\n \n+/*\n+ * The interrupt handler holds the host while it reads RX data. Bound how much\n+ * it reads per interrupt, and with frames waiting to be sent, let the TX path\n+ * have the host after a smaller amount.\n+ */\n+#define RTW_SDIO_RX_BUDGET\t\t\t\tSZ_64K\n+#define RTW_SDIO_RX_BUDGET_TX_PENDING\t\t\tSZ_8K\n+\n static bool rtw_sdio_is_bus_addr(u32 addr)\n {\n \treturn !!(addr \u0026 RTW_SDIO_BUS_MSK);\n@@ -675,6 +690,178 @@ static atomic_t *rtw_sdio_8723bs_free_txpg(struct rtw_dev *rtwdev, u8 queue)\n \t}\n }\n \n+/*\n+ * The other chips with a non-8051 MCU (RTL8822BS, RTL8822CS, RTL8821CS) report\n+ * their free pages in three registers, one 12 bit count per FIFO, and the\n+ * free entries of the AC output queue in the third. Reading them for every\n+ * transfer costs three register reads, more bus time than the transfer of a\n+ * small frame. The chip only frees pages and entries, so counts read earlier\n+ * and reduced by every transfer since then never exceed what is really free:\n+ * keep them and read the registers again only when they say a transfer does\n+ * not fit.\n+ */\n+/*\n+ * Read consecutive SDIO local registers with one transfer instead of one per\n+ * register. buf must be DMA-safe. Like rtw_sdio_readl(), this only uses CMD53\n+ * while the chip is powered on; otherwise it fails with -EAGAIN and the caller\n+ * reads the registers one by one.\n+ */\n+static int rtw_sdio_read_local_regs(struct rtw_dev *rtwdev, u32 addr,\n+\t\t\t\t __le32 *buf, unsigned int num)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\tbool bus_claim;\n+\tint ret;\n+\n+\tif (!rtw_sdio_use_memcpy_io(rtwdev, addr, 4))\n+\t\treturn -EAGAIN;\n+\n+\tbus_claim = rtw_sdio_bus_claim_needed(rtwsdio);\n+\n+\tif (bus_claim)\n+\t\tsdio_claim_host(rtwsdio-\u003esdio_func);\n+\n+\tret = sdio_memcpy_fromio(rtwsdio-\u003esdio_func, buf,\n+\t\t\t\t rtw_sdio_to_io_address(rtwdev, addr, true),\n+\t\t\t\t num * sizeof(*buf));\n+\n+\tif (bus_claim)\n+\t\tsdio_release_host(rtwsdio-\u003esdio_func);\n+\n+\tif (ret)\n+\t\trtw_warn(rtwdev, \"sdio read of %u registers at 0x%x failed: %d\",\n+\t\t\t num, addr, ret);\n+\n+\treturn ret;\n+}\n+\n+static void rtw_sdio_88xx_sync_free_txpg(struct rtw_dev *rtwdev)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\t__le32 *regs = rtwsdio-\u003etxpg_regs;\n+\tu32 free_txpg[3];\n+\n+\tlockdep_assert_held(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\tif (regs \u0026\u0026 !rtw_sdio_read_local_regs(rtwdev, REG_SDIO_FREE_TXPG,\n+\t\t\t\t\t regs, 3)) {\n+\t\tfree_txpg[0] = le32_to_cpu(regs[0]);\n+\t\tfree_txpg[1] = le32_to_cpu(regs[1]);\n+\t\tfree_txpg[2] = le32_to_cpu(regs[2]);\n+\t} else {\n+\t\tfree_txpg[0] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG);\n+\t\tfree_txpg[1] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 4);\n+\t\tfree_txpg[2] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 8);\n+\t}\n+\n+\tatomic_set(\u0026rtwsdio-\u003efree_pg_high, free_txpg[0] \u0026 0xfff);\n+\tatomic_set(\u0026rtwsdio-\u003efree_pg_normal, (free_txpg[0] \u003e\u003e 16) \u0026 0xfff);\n+\tatomic_set(\u0026rtwsdio-\u003efree_pg_low, free_txpg[1] \u0026 0xfff);\n+\tatomic_set(\u0026rtwsdio-\u003efree_pg_pub, (free_txpg[1] \u003e\u003e 16) \u0026 0xfff);\n+\tatomic_set(\u0026rtwsdio-\u003efree_pg_extra, free_txpg[2] \u0026 0xfff);\n+\tatomic_set(\u0026rtwsdio-\u003etx_oqt_free, (free_txpg[2] \u003e\u003e 16) \u0026 0xff);\n+\n+\trtwsdio-\u003efree_txpg_valid = true;\n+}\n+\n+static void rtw_sdio_88xx_invalidate_free_txpg(struct rtw_dev *rtwdev)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\n+\tguard(mutex)(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\trtwsdio-\u003efree_txpg_valid = false;\n+}\n+\n+static atomic_t *rtw_sdio_88xx_free_txpg(struct rtw_dev *rtwdev, u8 queue)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\n+\tswitch (queue) {\n+\tcase RTW_TX_QUEUE_BCN:\n+\tcase RTW_TX_QUEUE_H2C:\n+\tcase RTW_TX_QUEUE_HI0:\n+\t\treturn \u0026rtwsdio-\u003efree_pg_high;\n+\tcase RTW_TX_QUEUE_VI:\n+\tcase RTW_TX_QUEUE_VO:\n+\t\treturn \u0026rtwsdio-\u003efree_pg_normal;\n+\tcase RTW_TX_QUEUE_BE:\n+\tcase RTW_TX_QUEUE_BK:\n+\t\treturn \u0026rtwsdio-\u003efree_pg_low;\n+\tcase RTW_TX_QUEUE_MGMT:\n+\t\treturn \u0026rtwsdio-\u003efree_pg_extra;\n+\tdefault:\n+\t\treturn NULL;\n+\t}\n+}\n+\n+static bool rtw_sdio_queue_is_ac(u8 queue)\n+{\n+\treturn queue \u003c= RTW_TX_QUEUE_VO;\n+}\n+\n+static bool rtw_sdio_88xx_txpg_fits(struct rtw_dev *rtwdev, atomic_t *dedicated,\n+\t\t\t\t u8 queue, unsigned int pages,\n+\t\t\t\t unsigned int frames)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\n+\tif (atomic_read(dedicated) + atomic_read(\u0026rtwsdio-\u003efree_pg_pub) \u003c pages)\n+\t\treturn false;\n+\n+\t/* every frame of an AC queue takes an entry of the output queue */\n+\tif (rtw_sdio_queue_is_ac(queue) \u0026\u0026\n+\t atomic_read(\u0026rtwsdio-\u003etx_oqt_free) \u003c frames)\n+\t\treturn false;\n+\n+\treturn true;\n+}\n+\n+/*\n+ * Reserve the pages and output queue entries for a transfer of @frames frames\n+ * needing @pages pages, from the queue's dedicated pages first and then from\n+ * the public ones, as the chip charges them. The caller holds tx_credit_lock\n+ * until the transfer is done, so that the counts are never read back from the\n+ * chip while a transfer they were already reduced for has not reached it.\n+ */\n+static int rtw_sdio_88xx_reserve_txpg(struct rtw_dev *rtwdev, u8 queue,\n+\t\t\t\t unsigned int pages, unsigned int frames)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\tatomic_t *dedicated;\n+\tunsigned int taken;\n+\n+\tlockdep_assert_held(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\tdedicated = rtw_sdio_88xx_free_txpg(rtwdev, queue);\n+\tif (!dedicated) {\n+\t\trtw_warn(rtwdev, \"Unknown mapping for queue %u\\n\", queue);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (!rtwsdio-\u003efree_txpg_valid ||\n+\t !rtw_sdio_88xx_txpg_fits(rtwdev, dedicated, queue, pages, frames))\n+\t\trtw_sdio_88xx_sync_free_txpg(rtwdev);\n+\n+\tif (!rtw_sdio_88xx_txpg_fits(rtwdev, dedicated, queue, pages, frames)) {\n+\t\trtw_dbg(rtwdev, RTW_DBG_SDIO,\n+\t\t\t\"Not enough free pages (%u needed, %u free) or output queue entries (%u needed, %u free) in queue %u\\n\",\n+\t\t\tpages, atomic_read(dedicated) +\n+\t\t\tatomic_read(\u0026rtwsdio-\u003efree_pg_pub), frames,\n+\t\t\tatomic_read(\u0026rtwsdio-\u003etx_oqt_free), queue);\n+\t\treturn -EBUSY;\n+\t}\n+\n+\ttaken = min_t(unsigned int, pages, atomic_read(dedicated));\n+\tatomic_sub(taken, dedicated);\n+\tatomic_sub(pages - taken, \u0026rtwsdio-\u003efree_pg_pub);\n+\n+\tif (rtw_sdio_queue_is_ac(queue))\n+\t\tatomic_sub(frames, \u0026rtwsdio-\u003etx_oqt_free);\n+\n+\treturn 0;\n+}\n+\n static int rtw_sdio_check_free_txpg(struct rtw_dev *rtwdev, u8 queue,\n \t\t\t\t size_t count)\n {\n@@ -727,40 +914,8 @@ static int rtw_sdio_check_free_txpg(struct rtw_dev *rtwdev, u8 queue,\n \t\t/* add the pages from the public queue */\n \t\tpages_free += (free_txpg \u003e\u003e 24) \u0026 0xff;\n \t} else {\n-\t\tu32 free_txpg[3];\n-\n-\t\tfree_txpg[0] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG);\n-\t\tfree_txpg[1] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 4);\n-\t\tfree_txpg[2] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 8);\n-\n-\t\tswitch (queue) {\n-\t\tcase RTW_TX_QUEUE_BCN:\n-\t\tcase RTW_TX_QUEUE_H2C:\n-\t\tcase RTW_TX_QUEUE_HI0:\n-\t\t\t/* high */\n-\t\t\tpages_free = free_txpg[0] \u0026 0xfff;\n-\t\t\tbreak;\n-\t\tcase RTW_TX_QUEUE_VI:\n-\t\tcase RTW_TX_QUEUE_VO:\n-\t\t\t/* normal */\n-\t\t\tpages_free = (free_txpg[0] \u003e\u003e 16) \u0026 0xfff;\n-\t\t\tbreak;\n-\t\tcase RTW_TX_QUEUE_BE:\n-\t\tcase RTW_TX_QUEUE_BK:\n-\t\t\t/* low */\n-\t\t\tpages_free = free_txpg[1] \u0026 0xfff;\n-\t\t\tbreak;\n-\t\tcase RTW_TX_QUEUE_MGMT:\n-\t\t\t/* extra */\n-\t\t\tpages_free = free_txpg[2] \u0026 0xfff;\n-\t\t\tbreak;\n-\t\tdefault:\n-\t\t\trtw_warn(rtwdev, \"Unknown mapping for queue %u\\n\", queue);\n-\t\t\treturn -EINVAL;\n-\t\t}\n-\n-\t\t/* add the pages from the public queue */\n-\t\tpages_free += (free_txpg[1] \u003e\u003e 16) \u0026 0xfff;\n+\t\t/* the other chips use rtw_sdio_88xx_reserve_txpg() */\n+\t\treturn -EINVAL;\n \t}\n \n \tpages_needed = DIV_ROUND_UP(count, rtwdev-\u003echip-\u003epage_size);\n@@ -822,16 +977,16 @@ static void rtw_sdio_8723bs_consume_txpg(struct rtw_dev *rtwdev, u8 queue,\n \t\tatomic_set(\u0026rtwsdio-\u003efree_pg_pub, 0);\n }\n \n-static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,\n-\t\t\t\t enum rtw_tx_queue_type queue, u32 txaddr,\n-\t\t\t\t size_t write_size)\n+static int rtw_sdio_write_buf_to_port(struct rtw_dev *rtwdev, void *buf,\n+\t\t\t\t enum rtw_tx_queue_type queue, u32 txaddr,\n+\t\t\t\t size_t write_size)\n {\n \tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n \tbool bus_claim;\n \tint ret;\n \n-\tif (!IS_ALIGNED((unsigned long)skb-\u003edata, RTW_SDIO_DATA_PTR_ALIGN))\n-\t\trtw_warn(rtwdev, \"Got unaligned SKB in %s() for queue %u\\n\",\n+\tif (!IS_ALIGNED((unsigned long)buf, RTW_SDIO_DATA_PTR_ALIGN))\n+\t\trtw_warn(rtwdev, \"Got unaligned buffer in %s() for queue %u\\n\",\n \t\t\t __func__, queue);\n \n \tbus_claim = rtw_sdio_bus_claim_needed(rtwsdio);\n@@ -839,8 +994,7 @@ static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,\n \tif (bus_claim)\n \t\tsdio_claim_host(rtwsdio-\u003esdio_func);\n \n-\tret = sdio_memcpy_toio(rtwsdio-\u003esdio_func, txaddr, skb-\u003edata,\n-\t\t\t write_size);\n+\tret = sdio_memcpy_toio(rtwsdio-\u003esdio_func, txaddr, buf, write_size);\n \n \tif (bus_claim)\n \t\tsdio_release_host(rtwsdio-\u003esdio_func);\n@@ -853,6 +1007,14 @@ static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,\n \treturn ret;\n }\n \n+static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,\n+\t\t\t\t enum rtw_tx_queue_type queue, u32 txaddr,\n+\t\t\t\t size_t write_size)\n+{\n+\treturn rtw_sdio_write_buf_to_port(rtwdev, skb-\u003edata, queue, txaddr,\n+\t\t\t\t\t write_size);\n+}\n+\n static int rtw_sdio_write_port_8723bs(struct rtw_dev *rtwdev,\n \t\t\t\t struct sk_buff *skb,\n \t\t\t\t enum rtw_tx_queue_type queue, u32 txaddr,\n@@ -889,6 +1051,32 @@ static int rtw_sdio_write_port_8723bs(struct rtw_dev *rtwdev,\n \treturn 0;\n }\n \n+static int rtw_sdio_write_port_88xx(struct rtw_dev *rtwdev,\n+\t\t\t\t struct sk_buff *skb,\n+\t\t\t\t enum rtw_tx_queue_type queue, u32 txaddr,\n+\t\t\t\t size_t write_size)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\tunsigned int pages;\n+\tint ret;\n+\n+\t/* the chip charges pages by frame length, not by the padded transfer */\n+\tpages = DIV_ROUND_UP(skb-\u003elen, rtwdev-\u003echip-\u003epage_size);\n+\n+\tguard(mutex)(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\tret = rtw_sdio_88xx_reserve_txpg(rtwdev, queue, pages, 1);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = rtw_sdio_write_to_port(rtwdev, skb, queue, txaddr, write_size);\n+\tif (ret)\n+\t\t/* the pages may or may not have been used, read them again */\n+\t\trtwsdio-\u003efree_txpg_valid = false;\n+\n+\treturn ret;\n+}\n+\n static int rtw_sdio_write_port_generic(struct rtw_dev *rtwdev,\n \t\t\t\t struct sk_buff *skb,\n \t\t\t\t enum rtw_tx_queue_type queue, u32 txaddr,\n@@ -933,6 +1121,10 @@ static int rtw_sdio_write_port(struct rtw_dev *rtwdev, struct sk_buff *skb,\n \t\treturn rtw_sdio_write_port_8723bs(rtwdev, skb, queue, txaddr,\n \t\t\t\t\t\t write_size);\n \n+\tif (!rtw_chip_wcpu_8051(rtwdev))\n+\t\treturn rtw_sdio_write_port_88xx(rtwdev, skb, queue, txaddr,\n+\t\t\t\t\t\twrite_size);\n+\n \treturn rtw_sdio_write_port_generic(rtwdev, skb, queue, txaddr,\n \t\t\t\t\t write_size);\n }\n@@ -1067,6 +1259,9 @@ static int rtw_sdio_start(struct rtw_dev *rtwdev)\n \t\t\treturn ret;\n \t}\n \n+\tif (!rtw_chip_wcpu_8051(rtwdev))\n+\t\trtw_sdio_88xx_invalidate_free_txpg(rtwdev);\n+\n \trtw_sdio_enable_rx_aggregation(rtwdev);\n \n \tif (rtw_is_8723bs(rtwdev)) {\n@@ -1083,6 +1278,9 @@ static int rtw_sdio_start(struct rtw_dev *rtwdev)\n static void rtw_sdio_stop(struct rtw_dev *rtwdev)\n {\n \trtw_sdio_disable_interrupt(rtwdev);\n+\n+\tif (!rtw_chip_wcpu_8051(rtwdev))\n+\t\trtw_sdio_88xx_invalidate_free_txpg(rtwdev);\n }\n \n static void rtw_sdio_deep_ps_enter(struct rtw_dev *rtwdev)\n@@ -1251,19 +1449,43 @@ static int rtw_sdio_write_data_h2c(struct rtw_dev *rtwdev, u8 *buf, u32 size)\n \treturn rtw_sdio_write_data(rtwdev, \u0026pkt_info, skb, RTW_TX_QUEUE_H2C);\n }\n \n+static bool rtw_sdio_tx_queue_limited(struct rtw_dev *rtwdev,\n+\t\t\t\t enum rtw_tx_queue_type queue)\n+{\n+\tif (queue \u003e= RTW_TX_QUEUE_BCN)\n+\t\treturn false;\n+\n+\treturn rtw_is_8723bs(rtwdev) || !rtw_chip_wcpu_8051(rtwdev);\n+}\n+\n+static u32 rtw_sdio_tx_fifo_hiwater(struct rtw_dev *rtwdev)\n+{\n+\tif (rtw_chip_wcpu_8051(rtwdev))\n+\t\treturn RTW_SDIO_TX_FIFO_HIWATER;\n+\n+\treturn RTW_SDIO_88XX_TX_FIFO_HIWATER;\n+}\n+\n+static u32 rtw_sdio_tx_fifo_lowater(struct rtw_dev *rtwdev)\n+{\n+\tif (rtw_chip_wcpu_8051(rtwdev))\n+\t\treturn RTW_SDIO_TX_FIFO_LOWATER;\n+\n+\treturn RTW_SDIO_88XX_TX_FIFO_LOWATER;\n+}\n+\n /*\n * Both this and the wake below hold the TX queue lock across the length check\n * and the flag update, so a queue is only ever stopped while it really is\n * above the watermark, and the drain path always sees the flag the producer\n * set.\n */\n-static void rtw_sdio_8723bs_stop_tx_queue(struct rtw_dev *rtwdev,\n-\t\t\t\t\t enum rtw_tx_queue_type queue,\n-\t\t\t\t\t u16 q_map)\n+static void rtw_sdio_stop_tx_queue(struct rtw_dev *rtwdev,\n+\t\t\t\t enum rtw_tx_queue_type queue, u16 q_map)\n {\n \tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n \n-\tif (!rtw_is_8723bs(rtwdev) || queue \u003e= RTW_TX_QUEUE_BCN)\n+\tif (!rtw_sdio_tx_queue_limited(rtwdev, queue))\n \t\treturn;\n \n \tguard(spinlock_irqsave)(\u0026rtwsdio-\u003etx_queue[queue].lock);\n@@ -1271,20 +1493,20 @@ static void rtw_sdio_8723bs_stop_tx_queue(struct rtw_dev *rtwdev,\n \tif (rtwsdio-\u003etx_queue_stopped[queue])\n \t\treturn;\n \n-\tif (skb_queue_len(\u0026rtwsdio-\u003etx_queue[queue]) \u003c RTW_SDIO_TX_FIFO_HIWATER)\n+\tif (skb_queue_len(\u0026rtwsdio-\u003etx_queue[queue]) \u003c\n+\t rtw_sdio_tx_fifo_hiwater(rtwdev))\n \t\treturn;\n \n \trtwsdio-\u003etx_queue_stopped[queue] = true;\n \tieee80211_stop_queue(rtwdev-\u003ehw, q_map);\n }\n \n-static void rtw_sdio_8723bs_wake_tx_queue(struct rtw_dev *rtwdev,\n-\t\t\t\t\t enum rtw_tx_queue_type queue,\n-\t\t\t\t\t u16 q_map)\n+static void rtw_sdio_wake_tx_queue(struct rtw_dev *rtwdev,\n+\t\t\t\t enum rtw_tx_queue_type queue, u16 q_map)\n {\n \tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n \n-\tif (!rtw_is_8723bs(rtwdev) || queue \u003e= RTW_TX_QUEUE_BCN)\n+\tif (!rtw_sdio_tx_queue_limited(rtwdev, queue))\n \t\treturn;\n \n \tguard(spinlock_irqsave)(\u0026rtwsdio-\u003etx_queue[queue].lock);\n@@ -1292,7 +1514,8 @@ static void rtw_sdio_8723bs_wake_tx_queue(struct rtw_dev *rtwdev,\n \tif (!rtwsdio-\u003etx_queue_stopped[queue])\n \t\treturn;\n \n-\tif (skb_queue_len(\u0026rtwsdio-\u003etx_queue[queue]) \u003e RTW_SDIO_TX_FIFO_LOWATER)\n+\tif (skb_queue_len(\u0026rtwsdio-\u003etx_queue[queue]) \u003e\n+\t rtw_sdio_tx_fifo_lowater(rtwdev))\n \t\treturn;\n \n \trtwsdio-\u003etx_queue_stopped[queue] = false;\n@@ -1319,7 +1542,7 @@ static int rtw_sdio_tx_write(struct rtw_dev *rtwdev,\n \t/* The TX worker may already have freed the skb, so do not touch it. */\n \tskb_queue_tail(\u0026rtwsdio-\u003etx_queue[queue], skb);\n \n-\trtw_sdio_8723bs_stop_tx_queue(rtwdev, queue, q_map);\n+\trtw_sdio_stop_tx_queue(rtwdev, queue, q_map);\n \n \treturn 0;\n }\n@@ -1421,12 +1644,43 @@ static void rtw_sdio_rxfifo_recv(struct rtw_dev *rtwdev, u32 rx_len)\n \t}\n }\n \n-static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev)\n+static bool rtw_sdio_tx_pending(struct rtw_dev *rtwdev)\n {\n-\tu32 rx_len, hisr, total_rx_bytes = 0;\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\tint queue;\n+\n+\tfor (queue = 0; queue \u003c= RTW_TX_QUEUE_VO; queue++)\n+\t\tif (!skb_queue_empty(\u0026rtwsdio-\u003etx_queue[queue]))\n+\t\t\treturn true;\n+\n+\treturn false;\n+}\n+\n+static bool rtw_sdio_rx_budget_left(struct rtw_dev *rtwdev, u32 rx_bytes)\n+{\n+\tif (rx_bytes \u003e= RTW_SDIO_RX_BUDGET)\n+\t\treturn false;\n+\n+\t/*\n+\t * The 8051 chips send one frame per transfer and are not limited by\n+\t * the bus in the same way, keep their behaviour.\n+\t */\n+\tif (rtw_chip_wcpu_8051(rtwdev))\n+\t\treturn true;\n+\n+\treturn rx_bytes \u003c RTW_SDIO_RX_BUDGET_TX_PENDING ||\n+\t !rtw_sdio_tx_pending(rtwdev);\n+}\n+\n+/* rx_len: the RX request length if it was read together with HISR, or 0 */\n+static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev, u32 rx_len)\n+{\n+\tu32 hisr, total_rx_bytes = 0;\n \n \tdo {\n-\t\tif (rtw_chip_wcpu_8051(rtwdev))\n+\t\tif (rx_len)\n+\t\t\t;\n+\t\telse if (rtw_chip_wcpu_8051(rtwdev))\n \t\t\trx_len = rtw_read16(rtwdev, REG_SDIO_RX0_REQ_LEN);\n \t\telse\n \t\t\trx_len = rtw_read32(rtwdev, REG_SDIO_RX0_REQ_LEN);\n@@ -1437,6 +1691,7 @@ static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev)\n \t\trtw_sdio_rxfifo_recv(rtwdev, rx_len);\n \n \t\ttotal_rx_bytes += rx_len;\n+\t\trx_len = 0;\n \n \t\tif (rtw_chip_wcpu_8051(rtwdev)) {\n \t\t\t/* Stop if no more RX requests are pending, even if\n@@ -1455,7 +1710,8 @@ static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev)\n \t\t\t */\n \t\t\thisr = REG_SDIO_HISR_RX_REQUEST;\n \t\t}\n-\t} while (total_rx_bytes \u003c SZ_64K \u0026\u0026 hisr \u0026 REG_SDIO_HISR_RX_REQUEST);\n+\t} while (rtw_sdio_rx_budget_left(rtwdev, total_rx_bytes) \u0026\u0026\n+\t\t hisr \u0026 REG_SDIO_HISR_RX_REQUEST);\n }\n \n static void rtw_sdio_handle_interrupt(struct sdio_func *sdio_func)\n@@ -1463,20 +1719,28 @@ static void rtw_sdio_handle_interrupt(struct sdio_func *sdio_func)\n \tstruct ieee80211_hw *hw = sdio_get_drvdata(sdio_func);\n \tstruct rtw_sdio *rtwsdio;\n \tstruct rtw_dev *rtwdev;\n-\tu32 hisr;\n+\tu32 hisr, rx_len = 0;\n \n \trtwdev = hw-\u003epriv;\n \trtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n \n \trtwsdio-\u003eirq_thread = current;\n \n-\thisr = rtw_read32(rtwdev, REG_SDIO_HISR);\n+\t/* RX0_REQ_LEN follows HISR, read both at once where possible */\n+\tif (rtwsdio-\u003erx_regs \u0026\u0026\n+\t !rtw_sdio_read_local_regs(rtwdev, REG_SDIO_HISR,\n+\t\t\t\t rtwsdio-\u003erx_regs, 2)) {\n+\t\thisr = le32_to_cpu(rtwsdio-\u003erx_regs[0]);\n+\t\trx_len = le32_to_cpu(rtwsdio-\u003erx_regs[1]);\n+\t} else {\n+\t\thisr = rtw_read32(rtwdev, REG_SDIO_HISR);\n+\t}\n \n \tif (hisr \u0026 REG_SDIO_HISR_TXERR)\n \t\trtw_sdio_tx_err_isr(rtwdev);\n \tif (hisr \u0026 REG_SDIO_HISR_RX_REQUEST) {\n \t\thisr \u0026= ~REG_SDIO_HISR_RX_REQUEST;\n-\t\trtw_sdio_rx_isr(rtwdev);\n+\t\trtw_sdio_rx_isr(rtwdev, rx_len);\n \t}\n \n \t/*\n@@ -1623,6 +1887,154 @@ static void rtw_sdio_indicate_tx_status(struct rtw_dev *rtwdev,\n \tieee80211_tx_status_irqsafe(hw, skb);\n }\n \n+/* the access category of a data frame's TX descriptor queue select (TID) */\n+static u8 rtw_sdio_skb_qsel_ac(struct sk_buff *skb)\n+{\n+\tstatic const u8 tid_to_ac[] = {\n+\t\tIEEE80211_AC_BE, IEEE80211_AC_BK, IEEE80211_AC_BK,\n+\t\tIEEE80211_AC_BE, IEEE80211_AC_VI, IEEE80211_AC_VI,\n+\t\tIEEE80211_AC_VO, IEEE80211_AC_VO,\n+\t};\n+\tstruct rtw_tx_desc *tx_desc = (struct rtw_tx_desc *)skb-\u003edata;\n+\tu8 qsel = le32_get_bits(tx_desc-\u003ew1, RTW_TX_DESC_W1_QSEL);\n+\n+\treturn qsel \u003c ARRAY_SIZE(tid_to_ac) ? tid_to_ac[qsel] : U8_MAX;\n+}\n+\n+static unsigned int rtw_sdio_agg_pages(struct rtw_dev *rtwdev,\n+\t\t\t\t struct sk_buff_head *agg)\n+{\n+\tunsigned int pages = 0;\n+\tstruct sk_buff *skb;\n+\n+\t/* the chip charges every frame of an aggregate its own pages */\n+\tskb_queue_walk(agg, skb)\n+\t\tpages += DIV_ROUND_UP(skb-\u003elen, rtwdev-\u003echip-\u003epage_size);\n+\n+\treturn pages;\n+}\n+\n+/*\n+ * Send several frames of an AC queue with one transfer, for the 88xx chips:\n+ * each frame, TX descriptor and payload, starts 8 byte aligned and the first\n+ * descriptor carries the number of frames, as for USB TX aggregation. This\n+ * saves a transfer, and its interrupts, per frame. The chip takes the frames\n+ * of one access category only, which an AC queue holds anyway, but check the\n+ * queue select of every frame to be sure.\n+ *\n+ * Returns 0 when frames were written, 1 when the queue was empty, -E2BIG when\n+ * the first frame does not fit the buffer and another negative errno when\n+ * the write failed. In both error cases the frames are back in the queue.\n+ */\n+static int rtw_sdio_process_tx_agg(struct rtw_dev *rtwdev,\n+\t\t\t\t enum rtw_tx_queue_type queue)\n+{\n+\tstruct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n+\tstruct sk_buff_head *list = \u0026rtwsdio-\u003etx_queue[queue];\n+\tstruct rtw_tx_pkt_info pkt_info = {};\n+\tu8 *buf = rtwsdio-\u003etx_agg_buf;\n+\tstruct rtw_tx_desc *tx_desc;\n+\tsize_t len = 0, write_size;\n+\tstruct sk_buff_head agg;\n+\tunsigned int num = 0;\n+\tstruct sk_buff *skb;\n+\tu8 ac = U8_MAX;\n+\tu32 txaddr;\n+\tu16 q_map;\n+\tint ret;\n+\n+\t__skb_queue_head_init(\u0026agg);\n+\n+\twhile (num \u003c RTW_SDIO_TX_AGG_MAX_NUM) {\n+\t\tskb = skb_dequeue(list);\n+\t\tif (!skb)\n+\t\t\tbreak;\n+\n+\t\tif (!num) {\n+\t\t\tif (skb-\u003elen \u003e RTW_SDIO_TX_AGG_MAX_SIZE) {\n+\t\t\t\tskb_queue_head(list, skb);\n+\t\t\t\treturn -E2BIG;\n+\t\t\t}\n+\t\t\tac = rtw_sdio_skb_qsel_ac(skb);\n+\t\t} else if (ALIGN(len, 8) + skb-\u003elen \u003e RTW_SDIO_TX_AGG_MAX_SIZE ||\n+\t\t\t rtw_sdio_skb_qsel_ac(skb) != ac) {\n+\t\t\tskb_queue_head(list, skb);\n+\t\t\tbreak;\n+\t\t}\n+\n+\t\tlen = (num ? ALIGN(len, 8) : 0) + skb-\u003elen;\n+\t\t__skb_queue_tail(\u0026agg, skb);\n+\t\tnum++;\n+\t}\n+\n+\tif (!num)\n+\t\treturn 1;\n+\n+\tmutex_lock(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\t/* shrink the aggregate until it fits the free pages and entries */\n+\tfor (;;) {\n+\t\tret = rtw_sdio_88xx_reserve_txpg(rtwdev, queue,\n+\t\t\t\t\t\t rtw_sdio_agg_pages(rtwdev, \u0026agg),\n+\t\t\t\t\t\t num);\n+\t\tif (!ret)\n+\t\t\tbreak;\n+\t\tif (ret != -EBUSY || num == 1)\n+\t\t\tgoto err_requeue;\n+\n+\t\tskb_queue_head(list, __skb_dequeue_tail(\u0026agg));\n+\t\tnum--;\n+\t}\n+\n+\tlen = 0;\n+\tskb_queue_walk(\u0026agg, skb) {\n+\t\tlen = ALIGN(len, 8);\n+\t\tmemcpy(buf + len, skb-\u003edata, skb-\u003elen);\n+\t\tlen += skb-\u003elen;\n+\t}\n+\n+\tif (num \u003e 1) {\n+\t\ttx_desc = (struct rtw_tx_desc *)buf;\n+\t\tle32p_replace_bits(\u0026tx_desc-\u003ew7, num,\n+\t\t\t\t RTW_TX_DESC_W7_DMA_TXAGG_NUM);\n+\t\tpkt_info.pkt_offset = le32_get_bits(tx_desc-\u003ew1,\n+\t\t\t\t\t\t RTW_TX_DESC_W1_PKT_OFFSET);\n+\t\trtw_tx_fill_txdesc_checksum(rtwdev, \u0026pkt_info, buf);\n+\t}\n+\n+\ttxaddr = rtw_sdio_get_tx_addr(rtwdev, len, queue);\n+\twrite_size = sdio_align_size(rtwsdio-\u003esdio_func, len);\n+\tmemset(buf + len, 0, write_size - len);\n+\n+\tret = rtw_sdio_write_buf_to_port(rtwdev, buf, queue, txaddr,\n+\t\t\t\t\t write_size);\n+\tif (ret) {\n+\t\t/* the pages may or may not have been used, read them again */\n+\t\trtwsdio-\u003efree_txpg_valid = false;\n+\t\tgoto err_requeue;\n+\t}\n+\n+\tmutex_unlock(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\t/* all frames are of the same AC, and the skbs are consumed below */\n+\tq_map = skb_get_queue_mapping(skb_peek(\u0026agg));\n+\n+\twhile ((skb = __skb_dequeue(\u0026agg)))\n+\t\trtw_sdio_indicate_tx_status(rtwdev, skb);\n+\n+\trtw_sdio_wake_tx_queue(rtwdev, queue, q_map);\n+\n+\treturn 0;\n+\n+err_requeue:\n+\tmutex_unlock(\u0026rtwsdio-\u003etx_credit_lock);\n+\n+\twhile ((skb = __skb_dequeue_tail(\u0026agg)))\n+\t\tskb_queue_head(list, skb);\n+\n+\treturn ret;\n+}\n+\n /*\n * Send one frame from @queue. Returns 0 when a frame was written, 1 when the\n * queue was empty and a negative errno when the write failed, in which case\n@@ -1636,6 +2048,13 @@ static int rtw_sdio_process_tx_queue(struct rtw_dev *rtwdev,\n \tu16 q_map;\n \tint ret;\n \n+\tif (rtwsdio-\u003etx_agg_buf \u0026\u0026 rtw_sdio_queue_is_ac(queue) \u0026\u0026\n+\t skb_queue_len(\u0026rtwsdio-\u003etx_queue[queue]) \u003e 1) {\n+\t\tret = rtw_sdio_process_tx_agg(rtwdev, queue);\n+\t\tif (ret != -E2BIG)\n+\t\t\treturn ret;\n+\t}\n+\n \tskb = skb_dequeue(\u0026rtwsdio-\u003etx_queue[queue]);\n \tif (!skb)\n \t\treturn 1;\n@@ -1651,7 +2070,7 @@ static int rtw_sdio_process_tx_queue(struct rtw_dev *rtwdev,\n \n \trtw_sdio_indicate_tx_status(rtwdev, skb);\n \n-\trtw_sdio_8723bs_wake_tx_queue(rtwdev, queue, q_map);\n+\trtw_sdio_wake_tx_queue(rtwdev, queue, q_map);\n \n \treturn 0;\n }\n@@ -1697,6 +2116,7 @@ static void rtw_sdio_tx_handler(struct work_struct *work)\n \tstruct rtw_sdio *rtwsdio;\n \tstruct rtw_dev *rtwdev;\n \tint limit, queue, ret;\n+\tbool resched = false;\n \n \trtwdev = work_data-\u003ertwdev;\n \trtwsdio = (struct rtw_sdio *)rtwdev-\u003epriv;\n@@ -1717,7 +2137,19 @@ static void rtw_sdio_tx_handler(struct work_struct *work)\n \t\t\tif (skb_queue_empty(\u0026rtwsdio-\u003etx_queue[queue]))\n \t\t\t\tbreak;\n \t\t}\n+\n+\t\t/*\n+\t\t * A stopped queue is handed no further frames, so nothing\n+\t\t * else would kick this work item if the chip stayed full for\n+\t\t * the whole loop.\n+\t\t */\n+\t\tif (ret == -EBUSY \u0026\u0026 !rtw_chip_wcpu_8051(rtwdev))\n+\t\t\tresched = true;\n \t}\n+\n+\tif (resched)\n+\t\tqueue_delayed_work(rtwsdio-\u003etxwq, \u0026work_data-\u003ework,\n+\t\t\t\t RTW_SDIO_TX_RETRY_DELAY);\n }\n \n static void rtw_sdio_free_irq(struct rtw_dev *rtwdev,\n@@ -1741,6 +2173,20 @@ static int rtw_sdio_init_tx(struct rtw_dev *rtwdev)\n \n \tmutex_init(\u0026rtwsdio-\u003etx_credit_lock);\n \n+\t/*\n+\t * TX aggregation relies on the free page and output queue counts\n+\t * that only the non-8051 chips keep; without the buffer, frames are\n+\t * sent one by one.\n+\t */\n+\tif (!rtw_chip_wcpu_8051(rtwdev)) {\n+\t\trtwsdio-\u003etx_agg_buf = kmalloc(RTW_SDIO_TX_AGG_MAX_SIZE +\n+\t\t\t\t\t RTW_SDIO_BLOCK_SIZE, GFP_KERNEL);\n+\t\t/* without these, the registers are read one by one */\n+\t\trtwsdio-\u003erx_regs = kmalloc_array(2, sizeof(__le32), GFP_KERNEL);\n+\t\trtwsdio-\u003etxpg_regs = kmalloc_array(3, sizeof(__le32),\n+\t\t\t\t\t\t GFP_KERNEL);\n+\t}\n+\n \tfor (i = 0; i \u003c RTK_MAX_TX_QUEUE_NUM; i++) {\n \t\tskb_queue_head_init(\u0026rtwsdio-\u003etx_queue[i]);\n \t\trtwsdio-\u003etx_queue_stopped[i] = false;\n@@ -1755,6 +2201,9 @@ static int rtw_sdio_init_tx(struct rtw_dev *rtwdev)\n \treturn 0;\n \n err_destroy_wq:\n+\tkfree(rtwsdio-\u003etx_agg_buf);\n+\tkfree(rtwsdio-\u003erx_regs);\n+\tkfree(rtwsdio-\u003etxpg_regs);\n \tmutex_destroy(\u0026rtwsdio-\u003etx_credit_lock);\n \tdestroy_workqueue(rtwsdio-\u003etxwq);\n \treturn -ENOMEM;\n@@ -1772,6 +2221,9 @@ static void rtw_sdio_deinit_tx(struct rtw_dev *rtwdev)\n \tfor (i = 0; i \u003c RTK_MAX_TX_QUEUE_NUM; i++)\n \t\tieee80211_purge_tx_queue(rtwdev-\u003ehw, \u0026rtwsdio-\u003etx_queue[i]);\n \n+\tkfree(rtwsdio-\u003etx_agg_buf);\n+\tkfree(rtwsdio-\u003erx_regs);\n+\tkfree(rtwsdio-\u003etxpg_regs);\n \tmutex_destroy(\u0026rtwsdio-\u003etx_credit_lock);\n }\n \ndiff --git a/drivers/net/wireless/realtek/rtw88/sdio.h b/drivers/net/wireless/realtek/rtw88/sdio.h\nindex 6e7e6009744b03..6aa59ed3db21fd 100644\n--- a/drivers/net/wireless/realtek/rtw88/sdio.h\n+++ b/drivers/net/wireless/realtek/rtw88/sdio.h\n@@ -148,6 +148,10 @@\n \n #define RTW_SDIO_DATA_PTR_ALIGN\t\t\t8\n \n+/* TX aggregation of the 88xx chips: at most this much per transfer */\n+#define RTW_SDIO_TX_AGG_MAX_SIZE\t\t(20 * 1024)\n+#define RTW_SDIO_TX_AGG_MAX_NUM\t\t\t32\n+\n struct sdio_func;\n struct sdio_device_id;\n \n@@ -178,7 +182,16 @@ struct rtw_sdio {\n \tatomic_t free_pg_normal;\n \tatomic_t free_pg_low;\n \tatomic_t free_pg_pub;\n+\tatomic_t free_pg_extra;\n \tatomic_t tx_oqt_free;\n+\t/* the non-8051 chips' counters hold what the chip last reported */\n+\tbool free_txpg_valid;\n+\t/* TX aggregation buffer of the non-8051 chips, under tx_credit_lock */\n+\tu8 *tx_agg_buf;\n+\t/* non-8051 chips: HISR + RX0_REQ_LEN, read by the interrupt handler */\n+\t__le32 *rx_regs;\n+\t/* non-8051 chips: the REG_SDIO_FREE_TXPG words, under tx_credit_lock */\n+\t__le32 *txpg_regs;\n \t/* one writer at a time between the credit check and the accounting */\n \tstruct mutex tx_credit_lock;\n };\n"
} |
| 2/1 | 2026/11/20 07:16 | agent | patch-evaluator |
1mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the SDIO bus transport layer (rtw88_sdio) for Realtek wireless devices. This code requires physical SDIO hardware (such as RTL8723BS or RTL8822BS/CS) and cannot be instantiated or probed in standard virtualized environments (QEMU/GCE) since there is no virtual SDIO emulation or gadget interface available to syzkaller. Consequently, the modified code is structurally unreachable for fuzzing.",
"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 81f4a84e5c796e056d2c5eef96408d5ec97c9f19
Author: syz-cluster <triage@syzkaller.com>
Date: Fri Nov 20 07:16:28 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/wireless/realtek/rtw88/sdio.c b/drivers/net/wireless/realtek/rtw88/sdio.c
index 83e9b301ae9be5..f0feca2bf207ec 100644
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
@@ -22,11 +22,26 @@
#define RTW_SDIO_INDIRECT_RW_RETRIES 50
#define RTW_SDIO_OQT_TIMEOUT_MS 1000
-/* Bounds the queueing latency of the unbounded per-AC software FIFO. */
+/*
+ * Bound the queueing latency of the per-AC software FIFO, so that the
+ * backlog stays in mac80211, where it is scheduled fairly between flows and
+ * stations. The 88xx chips send up to RTW_SDIO_TX_AGG_MAX_NUM frames per
+ * transfer and need a deeper FIFO to keep doing that.
+ */
#define RTW_SDIO_TX_FIFO_HIWATER 16
#define RTW_SDIO_TX_FIFO_LOWATER 8
+#define RTW_SDIO_88XX_TX_FIFO_HIWATER 64
+#define RTW_SDIO_88XX_TX_FIFO_LOWATER 32
#define RTW_SDIO_TX_RETRY_DELAY msecs_to_jiffies(1)
+/*
+ * The interrupt handler holds the host while it reads RX data. Bound how much
+ * it reads per interrupt, and with frames waiting to be sent, let the TX path
+ * have the host after a smaller amount.
+ */
+#define RTW_SDIO_RX_BUDGET SZ_64K
+#define RTW_SDIO_RX_BUDGET_TX_PENDING SZ_8K
+
static bool rtw_sdio_is_bus_addr(u32 addr)
{
return !!(addr & RTW_SDIO_BUS_MSK);
@@ -675,6 +690,178 @@ static atomic_t *rtw_sdio_8723bs_free_txpg(struct rtw_dev *rtwdev, u8 queue)
}
}
+/*
+ * The other chips with a non-8051 MCU (RTL8822BS, RTL8822CS, RTL8821CS) report
+ * their free pages in three registers, one 12 bit count per FIFO, and the
+ * free entries of the AC output queue in the third. Reading them for every
+ * transfer costs three register reads, more bus time than the transfer of a
+ * small frame. The chip only frees pages and entries, so counts read earlier
+ * and reduced by every transfer since then never exceed what is really free:
+ * keep them and read the registers again only when they say a transfer does
+ * not fit.
+ */
+/*
+ * Read consecutive SDIO local registers with one transfer instead of one per
+ * register. buf must be DMA-safe. Like rtw_sdio_readl(), this only uses CMD53
+ * while the chip is powered on; otherwise it fails with -EAGAIN and the caller
+ * reads the registers one by one.
+ */
+static int rtw_sdio_read_local_regs(struct rtw_dev *rtwdev, u32 addr,
+ __le32 *buf, unsigned int num)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ bool bus_claim;
+ int ret;
+
+ if (!rtw_sdio_use_memcpy_io(rtwdev, addr, 4))
+ return -EAGAIN;
+
+ bus_claim = rtw_sdio_bus_claim_needed(rtwsdio);
+
+ if (bus_claim)
+ sdio_claim_host(rtwsdio->sdio_func);
+
+ ret = sdio_memcpy_fromio(rtwsdio->sdio_func, buf,
+ rtw_sdio_to_io_address(rtwdev, addr, true),
+ num * sizeof(*buf));
+
+ if (bus_claim)
+ sdio_release_host(rtwsdio->sdio_func);
+
+ if (ret)
+ rtw_warn(rtwdev, "sdio read of %u registers at 0x%x failed: %d",
+ num, addr, ret);
+
+ return ret;
+}
+
+static void rtw_sdio_88xx_sync_free_txpg(struct rtw_dev *rtwdev)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ __le32 *regs = rtwsdio->txpg_regs;
+ u32 free_txpg[3];
+
+ lockdep_assert_held(&rtwsdio->tx_credit_lock);
+
+ if (regs && !rtw_sdio_read_local_regs(rtwdev, REG_SDIO_FREE_TXPG,
+ regs, 3)) {
+ free_txpg[0] = le32_to_cpu(regs[0]);
+ free_txpg[1] = le32_to_cpu(regs[1]);
+ free_txpg[2] = le32_to_cpu(regs[2]);
+ } else {
+ free_txpg[0] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG);
+ free_txpg[1] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 4);
+ free_txpg[2] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 8);
+ }
+
+ atomic_set(&rtwsdio->free_pg_high, free_txpg[0] & 0xfff);
+ atomic_set(&rtwsdio->free_pg_normal, (free_txpg[0] >> 16) & 0xfff);
+ atomic_set(&rtwsdio->free_pg_low, free_txpg[1] & 0xfff);
+ atomic_set(&rtwsdio->free_pg_pub, (free_txpg[1] >> 16) & 0xfff);
+ atomic_set(&rtwsdio->free_pg_extra, free_txpg[2] & 0xfff);
+ atomic_set(&rtwsdio->tx_oqt_free, (free_txpg[2] >> 16) & 0xff);
+
+ rtwsdio->free_txpg_valid = true;
+}
+
+static void rtw_sdio_88xx_invalidate_free_txpg(struct rtw_dev *rtwdev)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+
+ guard(mutex)(&rtwsdio->tx_credit_lock);
+
+ rtwsdio->free_txpg_valid = false;
+}
+
+static atomic_t *rtw_sdio_88xx_free_txpg(struct rtw_dev *rtwdev, u8 queue)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+
+ switch (queue) {
+ case RTW_TX_QUEUE_BCN:
+ case RTW_TX_QUEUE_H2C:
+ case RTW_TX_QUEUE_HI0:
+ return &rtwsdio->free_pg_high;
+ case RTW_TX_QUEUE_VI:
+ case RTW_TX_QUEUE_VO:
+ return &rtwsdio->free_pg_normal;
+ case RTW_TX_QUEUE_BE:
+ case RTW_TX_QUEUE_BK:
+ return &rtwsdio->free_pg_low;
+ case RTW_TX_QUEUE_MGMT:
+ return &rtwsdio->free_pg_extra;
+ default:
+ return NULL;
+ }
+}
+
+static bool rtw_sdio_queue_is_ac(u8 queue)
+{
+ return queue <= RTW_TX_QUEUE_VO;
+}
+
+static bool rtw_sdio_88xx_txpg_fits(struct rtw_dev *rtwdev, atomic_t *dedicated,
+ u8 queue, unsigned int pages,
+ unsigned int frames)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+
+ if (atomic_read(dedicated) + atomic_read(&rtwsdio->free_pg_pub) < pages)
+ return false;
+
+ /* every frame of an AC queue takes an entry of the output queue */
+ if (rtw_sdio_queue_is_ac(queue) &&
+ atomic_read(&rtwsdio->tx_oqt_free) < frames)
+ return false;
+
+ return true;
+}
+
+/*
+ * Reserve the pages and output queue entries for a transfer of @frames frames
+ * needing @pages pages, from the queue's dedicated pages first and then from
+ * the public ones, as the chip charges them. The caller holds tx_credit_lock
+ * until the transfer is done, so that the counts are never read back from the
+ * chip while a transfer they were already reduced for has not reached it.
+ */
+static int rtw_sdio_88xx_reserve_txpg(struct rtw_dev *rtwdev, u8 queue,
+ unsigned int pages, unsigned int frames)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ atomic_t *dedicated;
+ unsigned int taken;
+
+ lockdep_assert_held(&rtwsdio->tx_credit_lock);
+
+ dedicated = rtw_sdio_88xx_free_txpg(rtwdev, queue);
+ if (!dedicated) {
+ rtw_warn(rtwdev, "Unknown mapping for queue %u\n", queue);
+ return -EINVAL;
+ }
+
+ if (!rtwsdio->free_txpg_valid ||
+ !rtw_sdio_88xx_txpg_fits(rtwdev, dedicated, queue, pages, frames))
+ rtw_sdio_88xx_sync_free_txpg(rtwdev);
+
+ if (!rtw_sdio_88xx_txpg_fits(rtwdev, dedicated, queue, pages, frames)) {
+ rtw_dbg(rtwdev, RTW_DBG_SDIO,
+ "Not enough free pages (%u needed, %u free) or output queue entries (%u needed, %u free) in queue %u\n",
+ pages, atomic_read(dedicated) +
+ atomic_read(&rtwsdio->free_pg_pub), frames,
+ atomic_read(&rtwsdio->tx_oqt_free), queue);
+ return -EBUSY;
+ }
+
+ taken = min_t(unsigned int, pages, atomic_read(dedicated));
+ atomic_sub(taken, dedicated);
+ atomic_sub(pages - taken, &rtwsdio->free_pg_pub);
+
+ if (rtw_sdio_queue_is_ac(queue))
+ atomic_sub(frames, &rtwsdio->tx_oqt_free);
+
+ return 0;
+}
+
static int rtw_sdio_check_free_txpg(struct rtw_dev *rtwdev, u8 queue,
size_t count)
{
@@ -727,40 +914,8 @@ static int rtw_sdio_check_free_txpg(struct rtw_dev *rtwdev, u8 queue,
/* add the pages from the public queue */
pages_free += (free_txpg >> 24) & 0xff;
} else {
- u32 free_txpg[3];
-
- free_txpg[0] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG);
- free_txpg[1] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 4);
- free_txpg[2] = rtw_sdio_read32(rtwdev, REG_SDIO_FREE_TXPG + 8);
-
- switch (queue) {
- case RTW_TX_QUEUE_BCN:
- case RTW_TX_QUEUE_H2C:
- case RTW_TX_QUEUE_HI0:
- /* high */
- pages_free = free_txpg[0] & 0xfff;
- break;
- case RTW_TX_QUEUE_VI:
- case RTW_TX_QUEUE_VO:
- /* normal */
- pages_free = (free_txpg[0] >> 16) & 0xfff;
- break;
- case RTW_TX_QUEUE_BE:
- case RTW_TX_QUEUE_BK:
- /* low */
- pages_free = free_txpg[1] & 0xfff;
- break;
- case RTW_TX_QUEUE_MGMT:
- /* extra */
- pages_free = free_txpg[2] & 0xfff;
- break;
- default:
- rtw_warn(rtwdev, "Unknown mapping for queue %u\n", queue);
- return -EINVAL;
- }
-
- /* add the pages from the public queue */
- pages_free += (free_txpg[1] >> 16) & 0xfff;
+ /* the other chips use rtw_sdio_88xx_reserve_txpg() */
+ return -EINVAL;
}
pages_needed = DIV_ROUND_UP(count, rtwdev->chip->page_size);
@@ -822,16 +977,16 @@ static void rtw_sdio_8723bs_consume_txpg(struct rtw_dev *rtwdev, u8 queue,
atomic_set(&rtwsdio->free_pg_pub, 0);
}
-static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
- enum rtw_tx_queue_type queue, u32 txaddr,
- size_t write_size)
+static int rtw_sdio_write_buf_to_port(struct rtw_dev *rtwdev, void *buf,
+ enum rtw_tx_queue_type queue, u32 txaddr,
+ size_t write_size)
{
struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
bool bus_claim;
int ret;
- if (!IS_ALIGNED((unsigned long)skb->data, RTW_SDIO_DATA_PTR_ALIGN))
- rtw_warn(rtwdev, "Got unaligned SKB in %s() for queue %u\n",
+ if (!IS_ALIGNED((unsigned long)buf, RTW_SDIO_DATA_PTR_ALIGN))
+ rtw_warn(rtwdev, "Got unaligned buffer in %s() for queue %u\n",
__func__, queue);
bus_claim = rtw_sdio_bus_claim_needed(rtwsdio);
@@ -839,8 +994,7 @@ static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
if (bus_claim)
sdio_claim_host(rtwsdio->sdio_func);
- ret = sdio_memcpy_toio(rtwsdio->sdio_func, txaddr, skb->data,
- write_size);
+ ret = sdio_memcpy_toio(rtwsdio->sdio_func, txaddr, buf, write_size);
if (bus_claim)
sdio_release_host(rtwsdio->sdio_func);
@@ -853,6 +1007,14 @@ static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
return ret;
}
+static int rtw_sdio_write_to_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
+ enum rtw_tx_queue_type queue, u32 txaddr,
+ size_t write_size)
+{
+ return rtw_sdio_write_buf_to_port(rtwdev, skb->data, queue, txaddr,
+ write_size);
+}
+
static int rtw_sdio_write_port_8723bs(struct rtw_dev *rtwdev,
struct sk_buff *skb,
enum rtw_tx_queue_type queue, u32 txaddr,
@@ -889,6 +1051,32 @@ static int rtw_sdio_write_port_8723bs(struct rtw_dev *rtwdev,
return 0;
}
+static int rtw_sdio_write_port_88xx(struct rtw_dev *rtwdev,
+ struct sk_buff *skb,
+ enum rtw_tx_queue_type queue, u32 txaddr,
+ size_t write_size)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ unsigned int pages;
+ int ret;
+
+ /* the chip charges pages by frame length, not by the padded transfer */
+ pages = DIV_ROUND_UP(skb->len, rtwdev->chip->page_size);
+
+ guard(mutex)(&rtwsdio->tx_credit_lock);
+
+ ret = rtw_sdio_88xx_reserve_txpg(rtwdev, queue, pages, 1);
+ if (ret)
+ return ret;
+
+ ret = rtw_sdio_write_to_port(rtwdev, skb, queue, txaddr, write_size);
+ if (ret)
+ /* the pages may or may not have been used, read them again */
+ rtwsdio->free_txpg_valid = false;
+
+ return ret;
+}
+
static int rtw_sdio_write_port_generic(struct rtw_dev *rtwdev,
struct sk_buff *skb,
enum rtw_tx_queue_type queue, u32 txaddr,
@@ -933,6 +1121,10 @@ static int rtw_sdio_write_port(struct rtw_dev *rtwdev, struct sk_buff *skb,
return rtw_sdio_write_port_8723bs(rtwdev, skb, queue, txaddr,
write_size);
+ if (!rtw_chip_wcpu_8051(rtwdev))
+ return rtw_sdio_write_port_88xx(rtwdev, skb, queue, txaddr,
+ write_size);
+
return rtw_sdio_write_port_generic(rtwdev, skb, queue, txaddr,
write_size);
}
@@ -1067,6 +1259,9 @@ static int rtw_sdio_start(struct rtw_dev *rtwdev)
return ret;
}
+ if (!rtw_chip_wcpu_8051(rtwdev))
+ rtw_sdio_88xx_invalidate_free_txpg(rtwdev);
+
rtw_sdio_enable_rx_aggregation(rtwdev);
if (rtw_is_8723bs(rtwdev)) {
@@ -1083,6 +1278,9 @@ static int rtw_sdio_start(struct rtw_dev *rtwdev)
static void rtw_sdio_stop(struct rtw_dev *rtwdev)
{
rtw_sdio_disable_interrupt(rtwdev);
+
+ if (!rtw_chip_wcpu_8051(rtwdev))
+ rtw_sdio_88xx_invalidate_free_txpg(rtwdev);
}
static void rtw_sdio_deep_ps_enter(struct rtw_dev *rtwdev)
@@ -1251,19 +1449,43 @@ static int rtw_sdio_write_data_h2c(struct rtw_dev *rtwdev, u8 *buf, u32 size)
return rtw_sdio_write_data(rtwdev, &pkt_info, skb, RTW_TX_QUEUE_H2C);
}
+static bool rtw_sdio_tx_queue_limited(struct rtw_dev *rtwdev,
+ enum rtw_tx_queue_type queue)
+{
+ if (queue >= RTW_TX_QUEUE_BCN)
+ return false;
+
+ return rtw_is_8723bs(rtwdev) || !rtw_chip_wcpu_8051(rtwdev);
+}
+
+static u32 rtw_sdio_tx_fifo_hiwater(struct rtw_dev *rtwdev)
+{
+ if (rtw_chip_wcpu_8051(rtwdev))
+ return RTW_SDIO_TX_FIFO_HIWATER;
+
+ return RTW_SDIO_88XX_TX_FIFO_HIWATER;
+}
+
+static u32 rtw_sdio_tx_fifo_lowater(struct rtw_dev *rtwdev)
+{
+ if (rtw_chip_wcpu_8051(rtwdev))
+ return RTW_SDIO_TX_FIFO_LOWATER;
+
+ return RTW_SDIO_88XX_TX_FIFO_LOWATER;
+}
+
/*
* Both this and the wake below hold the TX queue lock across the length check
* and the flag update, so a queue is only ever stopped while it really is
* above the watermark, and the drain path always sees the flag the producer
* set.
*/
-static void rtw_sdio_8723bs_stop_tx_queue(struct rtw_dev *rtwdev,
- enum rtw_tx_queue_type queue,
- u16 q_map)
+static void rtw_sdio_stop_tx_queue(struct rtw_dev *rtwdev,
+ enum rtw_tx_queue_type queue, u16 q_map)
{
struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
- if (!rtw_is_8723bs(rtwdev) || queue >= RTW_TX_QUEUE_BCN)
+ if (!rtw_sdio_tx_queue_limited(rtwdev, queue))
return;
guard(spinlock_irqsave)(&rtwsdio->tx_queue[queue].lock);
@@ -1271,20 +1493,20 @@ static void rtw_sdio_8723bs_stop_tx_queue(struct rtw_dev *rtwdev,
if (rtwsdio->tx_queue_stopped[queue])
return;
- if (skb_queue_len(&rtwsdio->tx_queue[queue]) < RTW_SDIO_TX_FIFO_HIWATER)
+ if (skb_queue_len(&rtwsdio->tx_queue[queue]) <
+ rtw_sdio_tx_fifo_hiwater(rtwdev))
return;
rtwsdio->tx_queue_stopped[queue] = true;
ieee80211_stop_queue(rtwdev->hw, q_map);
}
-static void rtw_sdio_8723bs_wake_tx_queue(struct rtw_dev *rtwdev,
- enum rtw_tx_queue_type queue,
- u16 q_map)
+static void rtw_sdio_wake_tx_queue(struct rtw_dev *rtwdev,
+ enum rtw_tx_queue_type queue, u16 q_map)
{
struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
- if (!rtw_is_8723bs(rtwdev) || queue >= RTW_TX_QUEUE_BCN)
+ if (!rtw_sdio_tx_queue_limited(rtwdev, queue))
return;
guard(spinlock_irqsave)(&rtwsdio->tx_queue[queue].lock);
@@ -1292,7 +1514,8 @@ static void rtw_sdio_8723bs_wake_tx_queue(struct rtw_dev *rtwdev,
if (!rtwsdio->tx_queue_stopped[queue])
return;
- if (skb_queue_len(&rtwsdio->tx_queue[queue]) > RTW_SDIO_TX_FIFO_LOWATER)
+ if (skb_queue_len(&rtwsdio->tx_queue[queue]) >
+ rtw_sdio_tx_fifo_lowater(rtwdev))
return;
rtwsdio->tx_queue_stopped[queue] = false;
@@ -1319,7 +1542,7 @@ static int rtw_sdio_tx_write(struct rtw_dev *rtwdev,
/* The TX worker may already have freed the skb, so do not touch it. */
skb_queue_tail(&rtwsdio->tx_queue[queue], skb);
- rtw_sdio_8723bs_stop_tx_queue(rtwdev, queue, q_map);
+ rtw_sdio_stop_tx_queue(rtwdev, queue, q_map);
return 0;
}
@@ -1421,12 +1644,43 @@ static void rtw_sdio_rxfifo_recv(struct rtw_dev *rtwdev, u32 rx_len)
}
}
-static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev)
+static bool rtw_sdio_tx_pending(struct rtw_dev *rtwdev)
{
- u32 rx_len, hisr, total_rx_bytes = 0;
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ int queue;
+
+ for (queue = 0; queue <= RTW_TX_QUEUE_VO; queue++)
+ if (!skb_queue_empty(&rtwsdio->tx_queue[queue]))
+ return true;
+
+ return false;
+}
+
+static bool rtw_sdio_rx_budget_left(struct rtw_dev *rtwdev, u32 rx_bytes)
+{
+ if (rx_bytes >= RTW_SDIO_RX_BUDGET)
+ return false;
+
+ /*
+ * The 8051 chips send one frame per transfer and are not limited by
+ * the bus in the same way, keep their behaviour.
+ */
+ if (rtw_chip_wcpu_8051(rtwdev))
+ return true;
+
+ return rx_bytes < RTW_SDIO_RX_BUDGET_TX_PENDING ||
+ !rtw_sdio_tx_pending(rtwdev);
+}
+
+/* rx_len: the RX request length if it was read together with HISR, or 0 */
+static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev, u32 rx_len)
+{
+ u32 hisr, total_rx_bytes = 0;
do {
- if (rtw_chip_wcpu_8051(rtwdev))
+ if (rx_len)
+ ;
+ else if (rtw_chip_wcpu_8051(rtwdev))
rx_len = rtw_read16(rtwdev, REG_SDIO_RX0_REQ_LEN);
else
rx_len = rtw_read32(rtwdev, REG_SDIO_RX0_REQ_LEN);
@@ -1437,6 +1691,7 @@ static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev)
rtw_sdio_rxfifo_recv(rtwdev, rx_len);
total_rx_bytes += rx_len;
+ rx_len = 0;
if (rtw_chip_wcpu_8051(rtwdev)) {
/* Stop if no more RX requests are pending, even if
@@ -1455,7 +1710,8 @@ static void rtw_sdio_rx_isr(struct rtw_dev *rtwdev)
*/
hisr = REG_SDIO_HISR_RX_REQUEST;
}
- } while (total_rx_bytes < SZ_64K && hisr & REG_SDIO_HISR_RX_REQUEST);
+ } while (rtw_sdio_rx_budget_left(rtwdev, total_rx_bytes) &&
+ hisr & REG_SDIO_HISR_RX_REQUEST);
}
static void rtw_sdio_handle_interrupt(struct sdio_func *sdio_func)
@@ -1463,20 +1719,28 @@ static void rtw_sdio_handle_interrupt(struct sdio_func *sdio_func)
struct ieee80211_hw *hw = sdio_get_drvdata(sdio_func);
struct rtw_sdio *rtwsdio;
struct rtw_dev *rtwdev;
- u32 hisr;
+ u32 hisr, rx_len = 0;
rtwdev = hw->priv;
rtwsdio = (struct rtw_sdio *)rtwdev->priv;
rtwsdio->irq_thread = current;
- hisr = rtw_read32(rtwdev, REG_SDIO_HISR);
+ /* RX0_REQ_LEN follows HISR, read both at once where possible */
+ if (rtwsdio->rx_regs &&
+ !rtw_sdio_read_local_regs(rtwdev, REG_SDIO_HISR,
+ rtwsdio->rx_regs, 2)) {
+ hisr = le32_to_cpu(rtwsdio->rx_regs[0]);
+ rx_len = le32_to_cpu(rtwsdio->rx_regs[1]);
+ } else {
+ hisr = rtw_read32(rtwdev, REG_SDIO_HISR);
+ }
if (hisr & REG_SDIO_HISR_TXERR)
rtw_sdio_tx_err_isr(rtwdev);
if (hisr & REG_SDIO_HISR_RX_REQUEST) {
hisr &= ~REG_SDIO_HISR_RX_REQUEST;
- rtw_sdio_rx_isr(rtwdev);
+ rtw_sdio_rx_isr(rtwdev, rx_len);
}
/*
@@ -1623,6 +1887,154 @@ static void rtw_sdio_indicate_tx_status(struct rtw_dev *rtwdev,
ieee80211_tx_status_irqsafe(hw, skb);
}
+/* the access category of a data frame's TX descriptor queue select (TID) */
+static u8 rtw_sdio_skb_qsel_ac(struct sk_buff *skb)
+{
+ static const u8 tid_to_ac[] = {
+ IEEE80211_AC_BE, IEEE80211_AC_BK, IEEE80211_AC_BK,
+ IEEE80211_AC_BE, IEEE80211_AC_VI, IEEE80211_AC_VI,
+ IEEE80211_AC_VO, IEEE80211_AC_VO,
+ };
+ struct rtw_tx_desc *tx_desc = (struct rtw_tx_desc *)skb->data;
+ u8 qsel = le32_get_bits(tx_desc->w1, RTW_TX_DESC_W1_QSEL);
+
+ return qsel < ARRAY_SIZE(tid_to_ac) ? tid_to_ac[qsel] : U8_MAX;
+}
+
+static unsigned int rtw_sdio_agg_pages(struct rtw_dev *rtwdev,
+ struct sk_buff_head *agg)
+{
+ unsigned int pages = 0;
+ struct sk_buff *skb;
+
+ /* the chip charges every frame of an aggregate its own pages */
+ skb_queue_walk(agg, skb)
+ pages += DIV_ROUND_UP(skb->len, rtwdev->chip->page_size);
+
+ return pages;
+}
+
+/*
+ * Send several frames of an AC queue with one transfer, for the 88xx chips:
+ * each frame, TX descriptor and payload, starts 8 byte aligned and the first
+ * descriptor carries the number of frames, as for USB TX aggregation. This
+ * saves a transfer, and its interrupts, per frame. The chip takes the frames
+ * of one access category only, which an AC queue holds anyway, but check the
+ * queue select of every frame to be sure.
+ *
+ * Returns 0 when frames were written, 1 when the queue was empty, -E2BIG when
+ * the first frame does not fit the buffer and another negative errno when
+ * the write failed. In both error cases the frames are back in the queue.
+ */
+static int rtw_sdio_process_tx_agg(struct rtw_dev *rtwdev,
+ enum rtw_tx_queue_type queue)
+{
+ struct rtw_sdio *rtwsdio = (struct rtw_sdio *)rtwdev->priv;
+ struct sk_buff_head *list = &rtwsdio->tx_queue[queue];
+ struct rtw_tx_pkt_info pkt_info = {};
+ u8 *buf = rtwsdio->tx_agg_buf;
+ struct rtw_tx_desc *tx_desc;
+ size_t len = 0, write_size;
+ struct sk_buff_head agg;
+ unsigned int num = 0;
+ struct sk_buff *skb;
+ u8 ac = U8_MAX;
+ u32 txaddr;
+ u16 q_map;
+ int ret;
+
+ __skb_queue_head_init(&agg);
+
+ while (num < RTW_SDIO_TX_AGG_MAX_NUM) {
+ skb = skb_dequeue(list);
+ if (!skb)
+ break;
+
+ if (!num) {
+ if (skb->len > RTW_SDIO_TX_AGG_MAX_SIZE) {
+ skb_queue_head(list, skb);
+ return -E2BIG;
+ }
+ ac = rtw_sdio_skb_qsel_ac(skb);
+ } else if (ALIGN(len, 8) + skb->len > RTW_SDIO_TX_AGG_MAX_SIZE ||
+ rtw_sdio_skb_qsel_ac(skb) != ac) {
+ skb_queue_head(list, skb);
+ break;
+ }
+
+ len = (num ? ALIGN(len, 8) : 0) + skb->len;
+ __skb_queue_tail(&agg, skb);
+ num++;
+ }
+
+ if (!num)
+ return 1;
+
+ mutex_lock(&rtwsdio->tx_credit_lock);
+
+ /* shrink the aggregate until it fits the free pages and entries */
+ for (;;) {
+ ret = rtw_sdio_88xx_reserve_txpg(rtwdev, queue,
+ rtw_sdio_agg_pages(rtwdev, &agg),
+ num);
+ if (!ret)
+ break;
+ if (ret != -EBUSY || num == 1)
+ goto err_requeue;
+
+ skb_queue_head(list, __skb_dequeue_tail(&agg));
+ num--;
+ }
+
+ len = 0;
+ skb_queue_walk(&agg, skb) {
+ len = ALIGN(len, 8);
+ memcpy(buf + len, skb->data, skb->len);
+ len += skb->len;
+ }
+
+ if (num > 1) {
+ tx_desc = (struct rtw_tx_desc *)buf;
+ le32p_replace_bits(&tx_desc->w7, num,
+ RTW_TX_DESC_W7_DMA_TXAGG_NUM);
+ pkt_info.pkt_offset = le32_get_bits(tx_desc->w1,
+ RTW_TX_DESC_W1_PKT_OFFSET);
+ rtw_tx_fill_txdesc_checksum(rtwdev, &pkt_info, buf);
+ }
+
+ txaddr = rtw_sdio_get_tx_addr(rtwdev, len, queue);
+ write_size = sdio_align_size(rtwsdio->sdio_func, len);
+ memset(buf + len, 0, write_size - len);
+
+ ret = rtw_sdio_write_buf_to_port(rtwdev, buf, queue, txaddr,
+ write_size);
+ if (ret) {
+ /* the pages may or may not have been used, read them again */
+ rtwsdio->free_txpg_valid = false;
+ goto err_requeue;
+ }
+
+ mutex_unlock(&rtwsdio->tx_credit_lock);
+
+ /* all frames are of the same AC, and the skbs are consumed below */
+ q_map = skb_get_queue_mapping(skb_peek(&agg));
+
+ while ((skb = __skb_dequeue(&agg)))
+ rtw_sdio_indicate_tx_status(rtwdev, skb);
+
+ rtw_sdio_wake_tx_queue(rtwdev, queue, q_map);
+
+ return 0;
+
+err_requeue:
+ mutex_unlock(&rtwsdio->tx_credit_lock);
+
+ while ((skb = __skb_dequeue_tail(&agg)))
+ skb_queue_head(list, skb);
+
+ return ret;
+}
+
/*
* Send one frame from @queue. Returns 0 when a frame was written, 1 when the
* queue was empty and a negative errno when the write failed, in which case
@@ -1636,6 +2048,13 @@ static int rtw_sdio_process_tx_queue(struct rtw_dev *rtwdev,
u16 q_map;
int ret;
+ if (rtwsdio->tx_agg_buf && rtw_sdio_queue_is_ac(queue) &&
+ skb_queue_len(&rtwsdio->tx_queue[queue]) > 1) {
+ ret = rtw_sdio_process_tx_agg(rtwdev, queue);
+ if (ret != -E2BIG)
+ return ret;
+ }
+
skb = skb_dequeue(&rtwsdio->tx_queue[queue]);
if (!skb)
return 1;
@@ -1651,7 +2070,7 @@ static int rtw_sdio_process_tx_queue(struct rtw_dev *rtwdev,
rtw_sdio_indicate_tx_status(rtwdev, skb);
- rtw_sdio_8723bs_wake_tx_queue(rtwdev, queue, q_map);
+ rtw_sdio_wake_tx_queue(rtwdev, queue, q_map);
return 0;
}
@@ -1697,6 +2116,7 @@ static void rtw_sdio_tx_handler(struct work_struct *work)
struct rtw_sdio *rtwsdio;
struct rtw_dev *rtwdev;
int limit, queue, ret;
+ bool resched = false;
rtwdev = work_data->rtwdev;
rtwsdio = (struct rtw_sdio *)rtwdev->priv;
@@ -1717,7 +2137,19 @@ static void rtw_sdio_tx_handler(struct work_struct *work)
if (skb_queue_empty(&rtwsdio->tx_queue[queue]))
break;
}
+
+ /*
+ * A stopped queue is handed no further frames, so nothing
+ * else would kick this work item if the chip stayed full for
+ * the whole loop.
+ */
+ if (ret == -EBUSY && !rtw_chip_wcpu_8051(rtwdev))
+ resched = true;
}
+
+ if (resched)
+ queue_delayed_work(rtwsdio->txwq, &work_data->work,
+ RTW_SDIO_TX_RETRY_DELAY);
}
static void rtw_sdio_free_irq(struct rtw_dev *rtwdev,
@@ -1741,6 +2173,20 @@ static int rtw_sdio_init_tx(struct rtw_dev *rtwdev)
mutex_init(&rtwsdio->tx_credit_lock);
+ /*
+ * TX aggregation relies on the free page and output queue counts
+ * that only the non-8051 chips keep; without the buffer, frames are
+ * sent one by one.
+ */
+ if (!rtw_chip_wcpu_8051(rtwdev)) {
+ rtwsdio->tx_agg_buf = kmalloc(RTW_SDIO_TX_AGG_MAX_SIZE +
+ RTW_SDIO_BLOCK_SIZE, GFP_KERNEL);
+ /* without these, the registers are read one by one */
+ rtwsdio->rx_regs = kmalloc_array(2, sizeof(__le32), GFP_KERNEL);
+ rtwsdio->txpg_regs = kmalloc_array(3, sizeof(__le32),
+ GFP_KERNEL);
+ }
+
for (i = 0; i < RTK_MAX_TX_QUEUE_NUM; i++) {
skb_queue_head_init(&rtwsdio->tx_queue[i]);
rtwsdio->tx_queue_stopped[i] = false;
@@ -1755,6 +2201,9 @@ static int rtw_sdio_init_tx(struct rtw_dev *rtwdev)
return 0;
err_destroy_wq:
+ kfree(rtwsdio->tx_agg_buf);
+ kfree(rtwsdio->rx_regs);
+ kfree(rtwsdio->txpg_regs);
mutex_destroy(&rtwsdio->tx_credit_lock);
destroy_workqueue(rtwsdio->txwq);
return -ENOMEM;
@@ -1772,6 +2221,9 @@ static void rtw_sdio_deinit_tx(struct rtw_dev *rtwdev)
for (i = 0; i < RTK_MAX_TX_QUEUE_NUM; i++)
ieee80211_purge_tx_queue(rtwdev->hw, &rtwsdio->tx_queue[i]);
+ kfree(rtwsdio->tx_agg_buf);
+ kfree(rtwsdio->rx_regs);
+ kfree(rtwsdio->txpg_regs);
mutex_destroy(&rtwsdio->tx_credit_lock);
}
diff --git a/drivers/net/wireless/realtek/rtw88/sdio.h b/drivers/net/wireless/realtek/rtw88/sdio.h
index 6e7e6009744b03..6aa59ed3db21fd 100644
--- a/drivers/net/wireless/realtek/rtw88/sdio.h
+++ b/drivers/net/wireless/realtek/rtw88/sdio.h
@@ -148,6 +148,10 @@
#define RTW_SDIO_DATA_PTR_ALIGN 8
+/* TX aggregation of the 88xx chips: at most this much per transfer */
+#define RTW_SDIO_TX_AGG_MAX_SIZE (20 * 1024)
+#define RTW_SDIO_TX_AGG_MAX_NUM 32
+
struct sdio_func;
struct sdio_device_id;
@@ -178,7 +182,16 @@ struct rtw_sdio {
atomic_t free_pg_normal;
atomic_t free_pg_low;
atomic_t free_pg_pub;
+ atomic_t free_pg_extra;
atomic_t tx_oqt_free;
+ /* the non-8051 chips' counters hold what the chip last reported */
+ bool free_txpg_valid;
+ /* TX aggregation buffer of the non-8051 chips, under tx_credit_lock */
+ u8 *tx_agg_buf;
+ /* non-8051 chips: HISR + RX0_REQ_LEN, read by the interrupt handler */
+ __le32 *rx_regs;
+ /* non-8051 chips: the REG_SDIO_FREE_TXPG words, under tx_credit_lock */
+ __le32 *txpg_regs;
/* one writer at a time between the credit check and the accounting */
struct mutex tx_credit_lock;
};
|
| 3/2 | 2026/11/20 07:16 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14820 output: 48 thoughts: 475 Thoughts: **Evaluating the Realtek rtw88 SDIO Patch Series: A Reachability First Approach** Okay, so I need to evaluate this patch series affecting `drivers/net/wireless/realtek/rtw88/sdio.c` and `drivers/net/wireless/realtek/rtw88/sdio.h`. Before I even start digging into the code, my immediate concern is reachability. I know from experience that fuzzing is only effective if the target code can actually *execute* within a standard virtualized environment like GCE or QEMU, the kind that Syzkaller uses, which rely on software-emulated devices. The critical question here is whether the rtw88 SDIO driver is *reachable* in such an environment. I need to make sure this driver isn't a dead end. I'll need to check the instructions – sections 1, 2, and 3. I already know reachability is the primary gate: if it's structurally unreachable, there's no point in fuzzing it, regardless of the complexity. Section 2 provides a good list of what I need to watch out for. I immediately think of vendor-specific PCIe switches, SmartNICs, or GPU drivers that require specific hardware that wouldn't be present in standard QEMU. Also, I know that driver teardown callbacks are usually a dead end for standard fuzzing. Section 3 clarifies what *is* typically reachable – drivers accessible via virtual buses. Virtio, USB gadgets, loopback, netlink, binder, sockets – these are all good signs. The crucial question is, is SDIO one of these? Can SDIO devices be emulated or probed in Syzkaller? Does Syzkaller even *have* an SDIO emulation mechanism? This is where I need to switch gears. I'll need to search the kernel source or Syzkaller documentation – I'll use `grepper` or check other relevant files. I need to understand how SDIO devices are handled. How is rtw88_sdio probed? Is there anything within Syzkaller that allows for interacting with or emulating an SDIO device? If I can't confirm reachability, this patch series needs a hard pass. |
| 4/2 | 2026/11/20 07:16 | tool | grepper |
0mArgs:{
"Expression": "module_sdio_driver|sdio_register_driver",
"PathPrefixes": [
"drivers/net/wireless/realtek/rtw88/"
]
}Results: {
"Output": "drivers/net/wireless/realtek/rtw88/rtw8723bs.c=44=static struct sdio_driver rtw_8723bs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c-53-};\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c:54:module_sdio_driver(rtw_8723bs_driver);\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c-55-\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c=21=static struct sdio_driver rtw_8723cs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c-29-\t}};\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c:30:module_sdio_driver(rtw_8723cs_driver);\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c-31-\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c=27=static struct sdio_driver rtw_8723ds_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c-36-};\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c:37:module_sdio_driver(rtw_8723ds_driver);\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c-38-\n--\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c=22=static struct sdio_driver rtw_8821cs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c-31-};\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c:32:module_sdio_driver(rtw_8821cs_driver);\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c-33-\n--\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c=22=static struct sdio_driver rtw_8822bs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c-31-};\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c:32:module_sdio_driver(rtw_8822bs_driver);\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c-33-\n--\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c=22=static struct sdio_driver rtw_8822cs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c-31-};\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c:32:module_sdio_driver(rtw_8822cs_driver);\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c-33-\n"
} |
| 5/2 | 2026/11/20 07:16 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16749 output: 42 thoughts: 499 Thoughts: **Investigating SDIO Bus Support in rtw88** Okay, so `rtw88/sdio.c` is the key file here – it's all about SDIO bus support for Realtek's rtw88 Wi-Fi devices. Devices like the rtw8723bs, rtw8723cs, rtw8723ds, rtw8821cs, rtw8822bs, and rtw8822cs. The real question is how can I test this in a virtual environment. Can I emulate or probe SDIO devices within something like QEMU, Google Compute Engine, or using syzkaller? Does QEMU or the Linux kernel even have any software-emulated SDIO devices, or perhaps syzkaller offers an SDIO fuzzer or a pseudo-device? Let's see, within Linux itself, what buses does syzkaller play with to emulate or even create devices? I know USB pretty well; syzkaller can use USB raw gadget, dummy_hcd, or raw-gadget! with `syz_usb_connect...`. Now for PCI: I'm pretty sure it doesn't emulate arbitrary PCIe hardware in general unless it is virtio-pci or maybe some specific emulated device in QEMU. This makes things like mlxsw and amdgpu hardware PCIe drivers pretty much unreachable. Bluetooth gets vhci (virtual HCI driver), and for networking, we have tun, tap, loopback, and mac80211_hwsim! Ah, mac80211_hwsim! I wonder... It's a software simulator for mac80211 wireless devices. However, that driver, `drivers/net/wireless/virtual/mac80211_hwsim.c`, instantiates itself. It *doesn't* use real hardware drivers like rtw88, iwlwifi, or ath9k. Okay, back to rtw88. Does rtw88 have USB support? Yes, the driver directory is structured to accommodate `usb.c`, `pci.c`, and, of course, the `sdio.c` we are discussing. This looks like a perfect starting point. Aha! The commit diff is *only* in `drivers/net/wireless/realtek/rtw88/sdio.c` and `drivers/net/wireless/realtek/rtw88/sdio.h`! That really narrows the scope. Before jumping to conclusions, I need to check if `sdio.c` is *only* used for SDIO drivers. Let's make sure it's not a more widely used shared component. |
| 6/2 | 2026/11/20 07:16 | tool | grepper |
0mArgs:{
"Expression": "rtw88.*sdio",
"PathPrefixes": [
"drivers/net/wireless/realtek/rtw88/"
]
}Results: {
"Output": "drivers/net/wireless/realtek/rtw88/Makefile=113=rtw88_pci-objs\t\t\t:= pci.o\ndrivers/net/wireless/realtek/rtw88/Makefile-114-\ndrivers/net/wireless/realtek/rtw88/Makefile:115:obj-$(CONFIG_RTW88_SDIO)\t+= rtw88_sdio.o\ndrivers/net/wireless/realtek/rtw88/Makefile:116:rtw88_sdio-objs\t\t\t:= sdio.o\ndrivers/net/wireless/realtek/rtw88/Makefile-117-\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c=2163=static int rtw_sdio_init_tx(struct rtw_dev *rtwdev)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-2167-\ndrivers/net/wireless/realtek/rtw88/sdio.c:2168:\trtwsdio-\u003etxwq = create_singlethread_workqueue(\"rtw88_sdio: tx wq\");\ndrivers/net/wireless/realtek/rtw88/sdio.c-2169-\tif (!rtwsdio-\u003etxwq) {\n"
} |
| 7/2 | 2026/11/20 07:16 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 18214 output: 42 thoughts: 113 Thoughts: **Investigating the Realtek Wireless SDIO Driver Configuration** Okay, let's dive into this. I'm looking at the `Makefile` for the Realtek wireless driver, specifically `drivers/net/wireless/realtek/rtw88/Makefile`. Ah, there it is: `obj-$(CONFIG_RTW88_SDIO) += rtw88_sdio.o`. So, `rtw88_sdio.o` is being conditionally built based on the `CONFIG_RTW88_SDIO` configuration option. Makes perfect sense. Now, the next logical question: what’s *in* that object file? Ah, right, `rtw88_sdio-objs := sdio.o` shows that. This is the more interesting question. But, I need to know *when* that configuration option is set. So, next, I need to check `drivers/net/wireless/realtek/rtw88/Kconfig`. Let's see what that reveals about `CONFIG_RTW88_SDIO`. That should give me the crucial context about the driver's dependencies and how it's enabled. |
| 8/2 | 2026/11/20 07:16 | tool | grepper |
0mArgs:{
"Expression": "RTW88_SDIO",
"PathPrefixes": [
"drivers/net/wireless/realtek/rtw88/"
]
}Results: {
"Output": "drivers/net/wireless/realtek/rtw88/Kconfig=17=config RTW88_PCI\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-19-\ndrivers/net/wireless/realtek/rtw88/Kconfig:20:config RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-21-\ttristate\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig=75=config RTW88_8822BS\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-78-\tselect RTW88_CORE\ndrivers/net/wireless/realtek/rtw88/Kconfig:79:\tselect RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-80-\tselect RTW88_8822B\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig=108=config RTW88_8822CS\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-111-\tselect RTW88_CORE\ndrivers/net/wireless/realtek/rtw88/Kconfig:112:\tselect RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-113-\tselect RTW88_8822C\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig=141=config RTW88_8723DS\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-144-\tselect RTW88_CORE\ndrivers/net/wireless/realtek/rtw88/Kconfig:145:\tselect RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-146-\tselect RTW88_8723D\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig=152=config RTW88_8723CS\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-155-\tselect RTW88_CORE\ndrivers/net/wireless/realtek/rtw88/Kconfig:156:\tselect RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-157-\tselect RTW88_8703B\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig=166=config RTW88_8723BS\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-169-\tselect RTW88_CORE\ndrivers/net/wireless/realtek/rtw88/Kconfig:170:\tselect RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-171-\tselect RTW88_8723B\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig=202=config RTW88_8821CS\n--\ndrivers/net/wireless/realtek/rtw88/Kconfig-205-\tselect RTW88_CORE\ndrivers/net/wireless/realtek/rtw88/Kconfig:206:\tselect RTW88_SDIO\ndrivers/net/wireless/realtek/rtw88/Kconfig-207-\tselect RTW88_8821C\n--\ndrivers/net/wireless/realtek/rtw88/Makefile=113=rtw88_pci-objs\t\t\t:= pci.o\ndrivers/net/wireless/realtek/rtw88/Makefile-114-\ndrivers/net/wireless/realtek/rtw88/Makefile:115:obj-$(CONFIG_RTW88_SDIO)\t+= rtw88_sdio.o\ndrivers/net/wireless/realtek/rtw88/Makefile-116-rtw88_sdio-objs\t\t\t:= sdio.o\n"
} |
| 9/2 | 2026/11/20 07:16 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 19667 output: 29 thoughts: 92 Thoughts: **SDIO Fuzzing and Emulation: A Quick Assessment** Okay, so I need to figure out the current state of SDIO support in the fuzzing landscape, specifically within syzkaller and the Linux kernel. First, let's step back and consider the basics. Does syzkaller even *emulate* SDIO devices? That's the fundamental question here. Does it have any built-in SDIO functionality, or am I going to be starting from scratch? To get a handle on this, I'll need to dig into the syzkaller documentation and code, but before I go too far down that path, let's establish some ground truths. Can user space even *create* SDIO devices within the syzkaller environment? If that's not possible, then we're facing a significant hurdle. After that, I will also have to search the kernel source tree for any clues. I'm thinking of virtual SDIO buses, dummy device drivers, anything that would allow for an abstract representation that could potentially be leveraged for fuzzing. I'll need to search for 'sdio' in various contexts to see if any such infrastructure exists. |
| 10/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "sdio_register_driver",
"PathPrefixes": [
"drivers/"
]
}Results: {
"Output": "drivers/bluetooth/btmrvl_sdio.c=1744=static int __init btmrvl_sdio_init_module(void)\ndrivers/bluetooth/btmrvl_sdio.c-1745-{\ndrivers/bluetooth/btmrvl_sdio.c:1746:\tif (sdio_register_driver(\u0026bt_mrvl_sdio) != 0) {\ndrivers/bluetooth/btmrvl_sdio.c-1747-\t\tBT_ERR(\"SDIO Driver Registration Failed\");\n--\ndrivers/mmc/core/sdio_bus.c=274=static void sdio_legacy_shutdown(struct sdio_func *func)\n--\ndrivers/mmc/core/sdio_bus.c-282-/**\ndrivers/mmc/core/sdio_bus.c:283: *\t__sdio_register_driver - register a function driver\ndrivers/mmc/core/sdio_bus.c-284- *\t@drv: SDIO function driver\n--\ndrivers/mmc/core/sdio_bus.c-286- */\ndrivers/mmc/core/sdio_bus.c:287:int __sdio_register_driver(struct sdio_driver *drv, struct module *owner)\ndrivers/mmc/core/sdio_bus.c-288-{\n--\ndrivers/mmc/core/sdio_bus.c-301-}\ndrivers/mmc/core/sdio_bus.c:302:EXPORT_SYMBOL_GPL(__sdio_register_driver);\ndrivers/mmc/core/sdio_bus.c-303-\n--\ndrivers/net/wireless/broadcom/b43/sdio.c=195=int b43_sdio_init(void)\ndrivers/net/wireless/broadcom/b43/sdio.c-196-{\ndrivers/net/wireless/broadcom/b43/sdio.c:197:\treturn sdio_register_driver(\u0026b43_sdio_driver);\ndrivers/net/wireless/broadcom/b43/sdio.c-198-}\n--\ndrivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c=1271=int brcmf_sdio_register(void)\ndrivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c-1272-{\ndrivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c:1273:\treturn sdio_register_driver(\u0026brcmf_sdmmc_driver);\ndrivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c-1274-}\n--\ndrivers/net/wireless/marvell/libertas/if_sdio.c=1390=static int __init if_sdio_init_module(void)\n--\ndrivers/net/wireless/marvell/libertas/if_sdio.c-1396-\ndrivers/net/wireless/marvell/libertas/if_sdio.c:1397:\tret = sdio_register_driver(\u0026if_sdio_driver);\ndrivers/net/wireless/marvell/libertas/if_sdio.c-1398-\n--\ndrivers/net/wireless/silabs/wfx/main.c=505=static int __init wfx_core_init(void)\n--\ndrivers/net/wireless/silabs/wfx/main.c-514-\tif (IS_ENABLED(CONFIG_MMC)) {\ndrivers/net/wireless/silabs/wfx/main.c:515:\t\tret = sdio_register_driver(\u0026wfx_sdio_driver);\ndrivers/net/wireless/silabs/wfx/main.c-516-\t\tif (ret)\n--\ndrivers/net/wireless/st/cw1200/cw1200_sdio.c=388=static int __init cw1200_sdio_init(void)\n--\ndrivers/net/wireless/st/cw1200/cw1200_sdio.c-400-\ndrivers/net/wireless/st/cw1200/cw1200_sdio.c:401:\tret = sdio_register_driver(\u0026sdio_driver);\ndrivers/net/wireless/st/cw1200/cw1200_sdio.c-402-\tif (ret)\n--\ndrivers/tty/serial/sdio_uart.c=1118=static int __init sdio_uart_init(void)\n--\ndrivers/tty/serial/sdio_uart.c-1143-\ndrivers/tty/serial/sdio_uart.c:1144:\tret = sdio_register_driver(\u0026sdio_uart_driver);\ndrivers/tty/serial/sdio_uart.c-1145-\tif (ret)\n"
} |
| 11/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 21296 output: 32 thoughts: 48 Thoughts: Okay, here's my interpretation of those thoughts, tailored for an expert audience, presented in the first person: **Investigating Virtual MMC/SDIO Host Controller Support for SDIO Device Probing** Right, my first instinct is to determine if syzkaller is already capable of probing SDIO devices and if a virtual MMC/SDIO host controller exists that it can leverage. To clarify, I need to check for existing support. Specifically, I should look within the `drivers/mmc` directory. My aim is to identify any virtual, testing, or "dummy" host implementations. These would be ideal for isolating SDIO device interactions and fuzzing them without needing physical hardware. I want to see if we can start from an easier setup. |
| 12/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "mmc_alloc_host",
"PathPrefixes": [
"drivers/mmc/"
]
}Results: {
"Output": "\nFull output is too long, showing 200 out of 263 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (41 files in total):\ndrivers/mmc/core/host.c:4\ndrivers/mmc/host/alcor.c:1\ndrivers/mmc/host/atmel-mci.c:1\ndrivers/mmc/host/au1xmmc.c:1\ndrivers/mmc/host/bcm2835.c:1\ndrivers/mmc/host/cavium.c:1\ndrivers/mmc/host/cb710-mmc.c:1\ndrivers/mmc/host/davinci_mmc.c:1\ndrivers/mmc/host/dw_mmc.c:1\ndrivers/mmc/host/jz4740_mmc.c:1\ndrivers/mmc/host/litex_mmc.c:1\ndrivers/mmc/host/loongson2-mmc.c:1\ndrivers/mmc/host/meson-gx-mmc.c:1\ndrivers/mmc/host/meson-mx-sdhc-mmc.c:1\ndrivers/mmc/host/meson-mx-sdio.c:1\ndrivers/mmc/host/mmc_spi.c:1\ndrivers/mmc/host/mmci.c:1\ndrivers/mmc/host/moxart-mmc.c:2\ndrivers/mmc/host/mtk-sd.c:1\ndrivers/mmc/host/mvsdio.c:1\ndrivers/mmc/host/mxcmmc.c:1\ndrivers/mmc/host/mxs-mmc.c:1\ndrivers/mmc/host/omap.c:1\ndrivers/mmc/host/omap_hsmmc.c:1\ndrivers/mmc/host/owl-mmc.c:1\ndrivers/mmc/host/pxamci.c:1\ndrivers/mmc/host/rtsx_pci_sdmmc.c:1\ndrivers/mmc/host/rtsx_usb_sdmmc.c:1\ndrivers/mmc/host/sdhci.c:1\ndrivers/mmc/host/sdricoh_cs.c:2\ndrivers/mmc/host/sh_mmcif.c:1\ndrivers/mmc/host/sunplus-mmc.c:1\ndrivers/mmc/host/sunxi-mmc.c:1\ndrivers/mmc/host/tifm_sd.c:1\ndrivers/mmc/host/tmio_mmc_core.c:1\ndrivers/mmc/host/toshsd.c:1\ndrivers/mmc/host/usdhi6rol0.c:1\ndrivers/mmc/host/ushc.c:1\ndrivers/mmc/host/via-sdmmc.c:1\ndrivers/mmc/host/wbsd.c:1\ndrivers/mmc/host/wmt-sdmmc.c:1\n\ndrivers/mmc/core/host.c=497=static int mmc_first_nonreserved_index(void)\n--\ndrivers/mmc/core/host.c-507-\ndrivers/mmc/core/host.c:508:static struct mmc_host *mmc_alloc_host(struct device *dev, int extra)\ndrivers/mmc/core/host.c-509-{\n--\ndrivers/mmc/core/host.c=587=static void devm_mmc_host_release(struct device *dev, void *res)\n--\ndrivers/mmc/core/host.c-591-\ndrivers/mmc/core/host.c:592:struct mmc_host *devm_mmc_alloc_host(struct device *dev, int extra)\ndrivers/mmc/core/host.c-593-{\n--\ndrivers/mmc/core/host.c-599-\ndrivers/mmc/core/host.c:600:\thost = mmc_alloc_host(dev, extra);\ndrivers/mmc/core/host.c-601-\tif (!host) {\n--\ndrivers/mmc/core/host.c-610-}\ndrivers/mmc/core/host.c:611:EXPORT_SYMBOL(devm_mmc_alloc_host);\ndrivers/mmc/core/host.c-612-\n--\ndrivers/mmc/host/alcor.c=1080=static int alcor_pci_sdmmc_drv_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/alcor.c-1086-\ndrivers/mmc/host/alcor.c:1087:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/alcor.c-1088-\tif (!mmc) {\n--\ndrivers/mmc/host/atmel-mci.c=2233=static int atmci_init_slot(struct atmel_mci *host,\n--\ndrivers/mmc/host/atmel-mci.c-2241-\ndrivers/mmc/host/atmel-mci.c:2242:\tmmc = devm_mmc_alloc_host(dev, sizeof(*slot));\ndrivers/mmc/host/atmel-mci.c-2243-\tif (!mmc)\n--\ndrivers/mmc/host/au1xmmc.c=933=static int au1xmmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/au1xmmc.c-939-\ndrivers/mmc/host/au1xmmc.c:940:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/au1xmmc.c-941-\tif (!mmc) {\n--\ndrivers/mmc/host/bcm2835.c=1367=static int bcm2835_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/bcm2835.c-1375-\tdev_dbg(dev, \"%s\\n\", __func__);\ndrivers/mmc/host/bcm2835.c:1376:\tmmc = devm_mmc_alloc_host(dev, sizeof(*host));\ndrivers/mmc/host/bcm2835.c-1377-\tif (!mmc)\n--\ndrivers/mmc/host/cavium.c=1007=int cvm_mmc_of_slot_probe(struct device *dev, struct cvm_mmc_host *host)\n--\ndrivers/mmc/host/cavium.c-1012-\ndrivers/mmc/host/cavium.c:1013:\tmmc = devm_mmc_alloc_host(dev, sizeof(*slot));\ndrivers/mmc/host/cavium.c-1014-\tif (!mmc)\n--\ndrivers/mmc/host/cb710-mmc.c=687=static int cb710_mmc_init(struct platform_device *pdev)\n--\ndrivers/mmc/host/cb710-mmc.c-695-\ndrivers/mmc/host/cb710-mmc.c:696:\tmmc = devm_mmc_alloc_host(cb710_slot_dev(slot), sizeof(*reader));\ndrivers/mmc/host/cb710-mmc.c-697-\tif (!mmc)\n--\ndrivers/mmc/host/davinci_mmc.c=1184=static int davinci_mmcsd_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/davinci_mmc.c-1205-\ndrivers/mmc/host/davinci_mmc.c:1206:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/davinci_mmc.c-1207-\tif (!mmc)\n--\ndrivers/mmc/host/dw_mmc.c=3173=struct dw_mci *dw_mci_alloc_host(struct device *dev)\n--\ndrivers/mmc/host/dw_mmc.c-3177-\ndrivers/mmc/host/dw_mmc.c:3178:\tmmc = devm_mmc_alloc_host(dev, sizeof(struct dw_mci));\ndrivers/mmc/host/dw_mmc.c-3179-\tif (!mmc)\n--\ndrivers/mmc/host/jz4740_mmc.c=1040=static int jz4740_mmc_probe(struct platform_device* pdev)\n--\ndrivers/mmc/host/jz4740_mmc.c-1045-\ndrivers/mmc/host/jz4740_mmc.c:1046:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/jz4740_mmc.c-1047-\tif (!mmc) {\n--\ndrivers/mmc/host/litex_mmc.c=460=static int litex_mmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/litex_mmc.c-473-\t */\ndrivers/mmc/host/litex_mmc.c:474:\tmmc = devm_mmc_alloc_host(dev, sizeof(*host));\ndrivers/mmc/host/litex_mmc.c-475-\tif (!mmc)\n--\ndrivers/mmc/host/loongson2-mmc.c=940=static int loongson2_mmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/loongson2-mmc.c-946-\ndrivers/mmc/host/loongson2-mmc.c:947:\tmmc = devm_mmc_alloc_host(dev, sizeof(*host));\ndrivers/mmc/host/loongson2-mmc.c-948-\tif (!mmc)\n--\ndrivers/mmc/host/meson-gx-mmc.c=1154=static int meson_mmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/meson-gx-mmc.c-1162-\ndrivers/mmc/host/meson-gx-mmc.c:1163:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(struct meson_host));\ndrivers/mmc/host/meson-gx-mmc.c-1164-\tif (!mmc)\n--\ndrivers/mmc/host/meson-mx-sdhc-mmc.c=760=static int meson_mx_sdhc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/meson-mx-sdhc-mmc.c-767-\ndrivers/mmc/host/meson-mx-sdhc-mmc.c:768:\tmmc = devm_mmc_alloc_host(dev, sizeof(*host));\ndrivers/mmc/host/meson-mx-sdhc-mmc.c-769-\tif (!mmc)\n--\ndrivers/mmc/host/meson-mx-sdio.c=629=static int meson_mx_mmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/meson-mx-sdio.c-652-\ndrivers/mmc/host/meson-mx-sdio.c:653:\tmmc = devm_mmc_alloc_host(\u0026slot_pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/meson-mx-sdio.c-654-\tif (!mmc) {\n--\ndrivers/mmc/host/mmc_spi.c=1145=static int mmc_spi_probe(struct spi_device *spi)\n--\ndrivers/mmc/host/mmc_spi.c-1188-\ndrivers/mmc/host/mmc_spi.c:1189:\tmmc = devm_mmc_alloc_host(\u0026spi-\u003edev, sizeof(*host));\ndrivers/mmc/host/mmc_spi.c-1190-\tif (!mmc)\n--\ndrivers/mmc/host/mmci.c=2203=static int mmci_probe(struct amba_device *dev,\n--\ndrivers/mmc/host/mmci.c-2224-\ndrivers/mmc/host/mmci.c:2225:\tmmc = devm_mmc_alloc_host(\u0026dev-\u003edev, sizeof(*host));\ndrivers/mmc/host/mmci.c-2226-\tif (!mmc)\n--\ndrivers/mmc/host/moxart-mmc.c=553=static int moxart_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/moxart-mmc.c-572-\ndrivers/mmc/host/moxart-mmc.c:573:\tmmc = devm_mmc_alloc_host(dev, sizeof(*host));\ndrivers/mmc/host/moxart-mmc.c-574-\tif (!mmc) {\ndrivers/mmc/host/moxart-mmc.c:575:\t\tdev_err(dev, \"devm_mmc_alloc_host failed\\n\");\ndrivers/mmc/host/moxart-mmc.c-576-\t\treturn -ENOMEM;\n--\ndrivers/mmc/host/mtk-sd.c=2982=static int msdc_drv_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/mtk-sd.c-2993-\t/* Allocate MMC host for this device */\ndrivers/mmc/host/mtk-sd.c:2994:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(struct msdc_host));\ndrivers/mmc/host/mtk-sd.c-2995-\tif (!mmc)\n--\ndrivers/mmc/host/mvsdio.c=693=static int mvsd_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/mvsdio.c-708-\ndrivers/mmc/host/mvsdio.c:709:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/mvsdio.c-710-\tif (!mmc)\n--\ndrivers/mmc/host/mxcmmc.c=992=static int mxcmci_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/mxcmmc.c-1007-\ndrivers/mmc/host/mxcmmc.c:1008:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/mxcmmc.c-1009-\tif (!mmc)\n--\ndrivers/mmc/host/mxs-mmc.c=559=static int mxs_mmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/mxs-mmc.c-571-\ndrivers/mmc/host/mxs-mmc.c:572:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/mxs-mmc.c-573-\tif (!mmc)\n--\ndrivers/mmc/host/omap.c=1256=static int mmc_omap_new_slot(struct mmc_omap_host *host, int id)\n--\ndrivers/mmc/host/omap.c-1261-\ndrivers/mmc/host/omap.c:1262:\tmmc = devm_mmc_alloc_host(host-\u003edev, sizeof(*slot));\ndrivers/mmc/host/omap.c-1263-\tif (mmc == NULL)\n--\ndrivers/mmc/host/omap_hsmmc.c=1761=static int omap_hsmmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/omap_hsmmc.c-1803-\ndrivers/mmc/host/omap_hsmmc.c:1804:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/omap_hsmmc.c-1805-\tif (!mmc)\n--\ndrivers/mmc/host/owl-mmc.c=562=static int owl_mmc_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/owl-mmc.c-568-\ndrivers/mmc/host/owl-mmc.c:569:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*owl_host));\ndrivers/mmc/host/owl-mmc.c-570-\tif (!mmc) {\n--\ndrivers/mmc/host/pxamci.c=605=static int pxamci_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/pxamci.c-616-\ndrivers/mmc/host/pxamci.c:617:\tmmc = devm_mmc_alloc_host(dev, sizeof(*host));\ndrivers/mmc/host/pxamci.c-618-\tif (!mmc)\n--\ndrivers/mmc/host/rtsx_pci_sdmmc.c=1454=static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/rtsx_pci_sdmmc.c-1470-\ndrivers/mmc/host/rtsx_pci_sdmmc.c:1471:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/rtsx_pci_sdmmc.c-1472-\tif (!mmc)\n--\ndrivers/mmc/host/rtsx_usb_sdmmc.c=1380=static int rtsx_usb_sdmmc_drv_probe(struct platform_device *pdev)\n--\ndrivers/mmc/host/rtsx_usb_sdmmc.c-1395-\ndrivers/mmc/host/rtsx_usb_sdmmc.c:1396:\tmmc = devm_mmc_alloc_host(\u0026pdev-\u003edev, sizeof(*host));\ndrivers/mmc/host/rtsx_usb_sdmmc.c-1397-\tif (!mmc)\n--\ndrivers/mmc/host/sdhci.c=4063=struct sdhci_host *sdhci_alloc_host(struct device *dev,\n--\ndrivers/mmc/host/sdhci.c-4070-\ndrivers/mmc/host/sdhci.c:4071:\tmmc = devm_mmc_alloc_host(dev, sizeof(struct sdhci_host) + priv_size);\ndrivers/mmc/host/sdhci.c-4072-\tif (!mmc)\n--\ndrivers/mmc/host/sdricoh_cs.c=378=static int sdricoh_init_mmc(struct pci_dev *pci_dev,\n--\ndrivers/mmc/host/sdricoh_cs.c-405-\tmmc = pcmcia_dev-\u003epriv =\ndrivers/mmc/host/sdricoh_cs.c:406:\t devm_mmc_alloc_host(\u0026pcmcia_dev-\u003edev, sizeof(*host));\ndrivers/mmc/host/sdricoh_cs.c-407-\tif (!mmc) {\ndrivers/mmc/host/sdricoh_cs.c:408:\t\tdev_err(dev, \"devm_mmc_alloc_host failed\\n\");\ndrivers/mmc/host/sdricoh_cs.c-409-\t\tresult = -ENOMEM;\n--\ndrivers/mmc/host/sh_mmcif.c=1427=static int sh_mmcif_probe(struct platform_device *pdev)\n--\n\n"
} |
| 13/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 26751 output: 31 thoughts: 436 Thoughts: **SDIO Device Reachability for Fuzzing** Okay, so I'm thinking, can I actually use SDIO devices in QEMU or with syzkaller? Let me first check the documentation for syzkaller, or just recall my knowledge. But wait... the documentation makes a really important point: reachability is the primary gatekeeper. Fuzzing only works if the code can actually *execute* in standard virtualized environments. It mentions that code is unreachable if it requires hardware that isn't emulated. Alright, so the document lays out some negative criteria: vendor-specific hardware like PCIe switches, SmartNICs, GPU drivers – things that need physical cards not emulated in QEMU. On the flip side, we have reachable drivers and protocols, accessible via virtual buses like virtio, USB gadget, etc. Now the question is, is SDIO a virtual bus? No, hold on, SDIO is an MMC/Secure Digital I/O *hardware* bus! Darn. Alright, so the question becomes: does QEMU or syzkaller have any kind of SDIO card emulation? Wait, does QEMU emulate SDIO Realtek WiFi cards? No. QEMU only emulates SD cards (storage, mmc-block) on sdhci. It doesn't have SDIO card emulation for something like a Realtek WiFi device (rtw8723bs, rtw8822bs, etc.). And what about syzkaller, does it have a way to probe SDIO devices? No. Syzkaller uses syscalls to interact with the kernel. It *can* emulate USB devices via USB raw gadget (/dev/raw-gadget or dummy_hcd). But there's no "SDIO raw gadget" equivalent in the Linux kernel! Okay, time to make sure there really isn't any kind of virtual SDIO device within the Linux kernel to be sure. |
| 14/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "CONFIG_MMC_TEST",
"PathPrefixes": [
"drivers/mmc/"
]
}Results: {
"Output": "drivers/mmc/core/Makefile=18=mmc_block-objs\t\t\t:= block.o queue.o\ndrivers/mmc/core/Makefile:19:obj-$(CONFIG_MMC_TEST)\t\t+= mmc_test.o\ndrivers/mmc/core/Makefile-20-mmc_core-$(CONFIG_MMC_CRYPTO)\t+= crypto.o\n"
} |
| 15/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27728 output: 25 thoughts: 34 Thoughts: Okay, here's my take on those thoughts, tailored for an expert audience: **Investigating mmc_test in the Kernel** Alright, so `mmc_test` is clearly targeted at testing MMC block cards. That's straightforward enough. Now, my immediate thought is, beyond the obvious MMC devices, are we dealing with any potential virtual or emulated SDIO gadgets lurking around in the kernel's code? It's easy to get caught up in the physical hardware, but I need to quickly scan for any virtual interfaces that might be masquerading as MMC/SDIO devices. There are scenarios where you have a software-defined or emulated MMC interface. This needs to be considered to get a complete picture. Are there any interfaces that might be implementing the relevant APIs for testing or emulation? Time to dive a little deeper, I think. |
| 16/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "sdio.*gadget|gadget.*sdio"
}Results: {
"Output": "no matches"
} |
| 17/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 27979 output: 41 thoughts: 96 Thoughts: **Investigating the "No Matches" Situation** Okay, so I'm hitting a wall – no direct matches right off the bat. Time to dig deeper. My initial instinct is to check within the `drivers/net/wireless/realtek/rtw88/` directory for any driver that interacts with the `rtw_sdio_*` functions. Given the context, this seems the most likely avenue. If the problem is sdio related, it should be in this section of the drivers. Next, I'll shift gears slightly and examine the callers of functions defined within `sdio.c`. This will give me a better understanding of how the `sdio.c` module is utilized within the broader context of the system. I'm hoping to trace a call chain that eventually leads to the failure or to point me to how sdio is enabled for this hardware. Specifically, I'll be looking closely at `sdio.c` itself. Is there an `rtw_sdio_probe` function? If so, that would be a key entry point, likely handling device initialization and connection to the overall Realtek wireless driver framework. My goal is to map how `sdio.c` is integrated with the other modules in rtw88 to establish a clear connection. |
| 18/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "rtw_sdio_",
"PathPrefixes": [
"drivers/net/wireless/realtek/rtw88/"
]
}Results: {
"Output": "\nFull output is too long, showing 200 out of 1062 lines.\nUse more precise expression or PathPrefixes if possible.\n\nNumber of matching lines per file (9 files in total):\ndrivers/net/wireless/realtek/rtw88/mac.c:1\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c:4\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c:4\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c:4\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c:4\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c:4\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c:4\ndrivers/net/wireless/realtek/rtw88/sdio.c:294\ndrivers/net/wireless/realtek/rtw88/sdio.h:8\n\ndrivers/net/wireless/realtek/rtw88/mac.c=62=static int rtw_mac_pre_system_cfg(struct rtw_dev *rtwdev)\n--\ndrivers/net/wireless/realtek/rtw88/mac.c-96-\ndrivers/net/wireless/realtek/rtw88/mac.c:97:\t\tif (rtw_sdio_is_sdio30_supported(rtwdev))\ndrivers/net/wireless/realtek/rtw88/mac.c-98-\t\t\trtw_write8_set(rtwdev, REG_HCI_OPT_CTRL + 2,\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c=44=static struct sdio_driver rtw_8723bs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c-46-\t.id_table = rtw_8723bs_id_table,\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c:47:\t.probe = rtw_sdio_probe,\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c:48:\t.remove = rtw_sdio_remove,\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c:49:\t.shutdown = rtw_sdio_shutdown,\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c-50-\t.drv = {\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c:51:\t\t.pm = \u0026rtw_sdio_pm_ops,\ndrivers/net/wireless/realtek/rtw88/rtw8723bs.c-52-\t}\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c=21=static struct sdio_driver rtw_8723cs_driver = {\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c-23-\t.id_table = rtw_8723cs_id_table,\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c:24:\t.probe = rtw_sdio_probe,\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c:25:\t.remove = rtw_sdio_remove,\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c:26:\t.shutdown = rtw_sdio_shutdown,\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c-27-\t.drv = {\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c:28:\t\t.pm = \u0026rtw_sdio_pm_ops,\ndrivers/net/wireless/realtek/rtw88/rtw8723cs.c-29-\t}};\n--\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c=27=static struct sdio_driver rtw_8723ds_driver = {\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c-28-\t.name = KBUILD_MODNAME,\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c:29:\t.probe = rtw_sdio_probe,\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c:30:\t.remove = rtw_sdio_remove,\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c:31:\t.shutdown = rtw_sdio_shutdown,\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c-32-\t.id_table = rtw_8723ds_id_table,\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c-33-\t.drv = {\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c:34:\t\t.pm = \u0026rtw_sdio_pm_ops,\ndrivers/net/wireless/realtek/rtw88/rtw8723ds.c-35-\t}\n--\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c=22=static struct sdio_driver rtw_8821cs_driver = {\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c-23-\t.name = KBUILD_MODNAME,\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c:24:\t.probe = rtw_sdio_probe,\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c:25:\t.remove = rtw_sdio_remove,\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c:26:\t.shutdown = rtw_sdio_shutdown,\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c-27-\t.id_table = rtw_8821cs_id_table,\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c-28-\t.drv = {\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c:29:\t\t.pm = \u0026rtw_sdio_pm_ops,\ndrivers/net/wireless/realtek/rtw88/rtw8821cs.c-30-\t}\n--\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c=22=static struct sdio_driver rtw_8822bs_driver = {\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c-23-\t.name = KBUILD_MODNAME,\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c:24:\t.probe = rtw_sdio_probe,\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c:25:\t.remove = rtw_sdio_remove,\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c:26:\t.shutdown = rtw_sdio_shutdown,\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c-27-\t.id_table = rtw_8822bs_id_table,\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c-28-\t.drv = {\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c:29:\t\t.pm = \u0026rtw_sdio_pm_ops,\ndrivers/net/wireless/realtek/rtw88/rtw8822bs.c-30-\t}\n--\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c=22=static struct sdio_driver rtw_8822cs_driver = {\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c-23-\t.name = KBUILD_MODNAME,\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c:24:\t.probe = rtw_sdio_probe,\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c:25:\t.remove = rtw_sdio_remove,\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c:26:\t.shutdown = rtw_sdio_shutdown,\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c-27-\t.id_table = rtw_8822cs_id_table,\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c-28-\t.drv = {\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c:29:\t\t.pm = \u0026rtw_sdio_pm_ops,\ndrivers/net/wireless/realtek/rtw88/rtw8822cs.c-30-\t}\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-44-\ndrivers/net/wireless/realtek/rtw88/sdio.c:45:static bool rtw_sdio_is_bus_addr(u32 addr)\ndrivers/net/wireless/realtek/rtw88/sdio.c-46-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-49-\ndrivers/net/wireless/realtek/rtw88/sdio.c:50:static bool rtw_sdio_bus_claim_needed(struct rtw_sdio *rtwsdio)\ndrivers/net/wireless/realtek/rtw88/sdio.c-51-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-55-\ndrivers/net/wireless/realtek/rtw88/sdio.c:56:static u32 rtw_sdio_to_bus_offset(struct rtw_dev *rtwdev, u32 addr)\ndrivers/net/wireless/realtek/rtw88/sdio.c-57-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-76-\ndrivers/net/wireless/realtek/rtw88/sdio.c:77:static bool rtw_sdio_use_memcpy_io(struct rtw_dev *rtwdev, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-78-\t\t\t\t u8 alignment)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-83-\ndrivers/net/wireless/realtek/rtw88/sdio.c:84:static void rtw_sdio_writel(struct rtw_dev *rtwdev, u32 val, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-85-\t\t\t int *err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-90-\ndrivers/net/wireless/realtek/rtw88/sdio.c:91:\tif (rtw_sdio_use_memcpy_io(rtwdev, addr, 4)) {\ndrivers/net/wireless/realtek/rtw88/sdio.c-92-\t\tsdio_writel(rtwsdio-\u003esdio_func, val, addr, err_ret);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-104-\ndrivers/net/wireless/realtek/rtw88/sdio.c:105:static void rtw_sdio_writew(struct rtw_dev *rtwdev, u16 val, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-106-\t\t\t int *err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-120-\ndrivers/net/wireless/realtek/rtw88/sdio.c:121:static u32 rtw_sdio_readl(struct rtw_dev *rtwdev, u32 addr, int *err_ret)\ndrivers/net/wireless/realtek/rtw88/sdio.c-122-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-126-\ndrivers/net/wireless/realtek/rtw88/sdio.c:127:\tif (rtw_sdio_use_memcpy_io(rtwdev, addr, 4))\ndrivers/net/wireless/realtek/rtw88/sdio.c-128-\t\treturn sdio_readl(rtwsdio-\u003esdio_func, addr, err_ret);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-138-\ndrivers/net/wireless/realtek/rtw88/sdio.c:139:static u16 rtw_sdio_readw(struct rtw_dev *rtwdev, u32 addr, int *err_ret)\ndrivers/net/wireless/realtek/rtw88/sdio.c-140-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-153-\ndrivers/net/wireless/realtek/rtw88/sdio.c:154:static u32 rtw_sdio_to_io_address(struct rtw_dev *rtwdev, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-155-\t\t\t\t bool direct)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-159-\ndrivers/net/wireless/realtek/rtw88/sdio.c:160:\tif (!rtw_sdio_is_bus_addr(addr))\ndrivers/net/wireless/realtek/rtw88/sdio.c-161-\t\taddr |= WLAN_IOREG_OFFSET;\ndrivers/net/wireless/realtek/rtw88/sdio.c-162-\ndrivers/net/wireless/realtek/rtw88/sdio.c:163:\treturn rtw_sdio_to_bus_offset(rtwdev, addr);\ndrivers/net/wireless/realtek/rtw88/sdio.c-164-}\ndrivers/net/wireless/realtek/rtw88/sdio.c-165-\ndrivers/net/wireless/realtek/rtw88/sdio.c:166:static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)\ndrivers/net/wireless/realtek/rtw88/sdio.c-167-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-170-\tif (!test_bit(RTW_FLAG_POWERON, rtwdev-\u003eflags) \u0026\u0026\ndrivers/net/wireless/realtek/rtw88/sdio.c:171:\t !rtw_sdio_is_bus_addr(addr) \u0026\u0026 might_indirect_under_power_off)\ndrivers/net/wireless/realtek/rtw88/sdio.c-172-\t\treturn false;\ndrivers/net/wireless/realtek/rtw88/sdio.c-173-\ndrivers/net/wireless/realtek/rtw88/sdio.c:174:\treturn !rtw_sdio_is_sdio30_supported(rtwdev) ||\ndrivers/net/wireless/realtek/rtw88/sdio.c:175:\t\trtw_sdio_is_bus_addr(addr);\ndrivers/net/wireless/realtek/rtw88/sdio.c-176-}\ndrivers/net/wireless/realtek/rtw88/sdio.c-177-\ndrivers/net/wireless/realtek/rtw88/sdio.c:178:static int rtw_sdio_indirect_reg_cfg(struct rtw_dev *rtwdev, u32 addr, u32 cfg)\ndrivers/net/wireless/realtek/rtw88/sdio.c-179-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-185-\ndrivers/net/wireless/realtek/rtw88/sdio.c:186:\treg_cfg = rtw_sdio_to_bus_offset(rtwdev, REG_SDIO_INDIRECT_REG_CFG);\ndrivers/net/wireless/realtek/rtw88/sdio.c-187-\ndrivers/net/wireless/realtek/rtw88/sdio.c:188:\trtw_sdio_writel(rtwdev, addr | cfg | BIT_SDIO_INDIRECT_REG_CFG_UNK20,\ndrivers/net/wireless/realtek/rtw88/sdio.c-189-\t\t\treg_cfg, \u0026ret);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-201-\ndrivers/net/wireless/realtek/rtw88/sdio.c:202:static u8 rtw_sdio_indirect_read8(struct rtw_dev *rtwdev, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-203-\t\t\t\t int *err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-207-\ndrivers/net/wireless/realtek/rtw88/sdio.c:208:\t*err_ret = rtw_sdio_indirect_reg_cfg(rtwdev, addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-209-\t\t\t\t\t BIT_SDIO_INDIRECT_REG_CFG_READ);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-212-\ndrivers/net/wireless/realtek/rtw88/sdio.c:213:\treg_data = rtw_sdio_to_bus_offset(rtwdev, REG_SDIO_INDIRECT_REG_DATA);\ndrivers/net/wireless/realtek/rtw88/sdio.c-214-\treturn sdio_readb(rtwsdio-\u003esdio_func, reg_data, err_ret);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-216-\ndrivers/net/wireless/realtek/rtw88/sdio.c:217:static int rtw_sdio_indirect_read_bytes(struct rtw_dev *rtwdev, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-218-\t\t\t\t\tu8 *buf, int count)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-222-\tfor (i = 0; i \u003c count; i++) {\ndrivers/net/wireless/realtek/rtw88/sdio.c:223:\t\tbuf[i] = rtw_sdio_indirect_read8(rtwdev, addr + i, \u0026ret);\ndrivers/net/wireless/realtek/rtw88/sdio.c-224-\t\tif (ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-230-\ndrivers/net/wireless/realtek/rtw88/sdio.c:231:static u16 rtw_sdio_indirect_read16(struct rtw_dev *rtwdev, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-232-\t\t\t\t int *err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-237-\tif (!IS_ALIGNED(addr, 2)) {\ndrivers/net/wireless/realtek/rtw88/sdio.c:238:\t\t*err_ret = rtw_sdio_indirect_read_bytes(rtwdev, addr, buf, 2);\ndrivers/net/wireless/realtek/rtw88/sdio.c-239-\t\tif (*err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-244-\ndrivers/net/wireless/realtek/rtw88/sdio.c:245:\t*err_ret = rtw_sdio_indirect_reg_cfg(rtwdev, addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-246-\t\t\t\t\t BIT_SDIO_INDIRECT_REG_CFG_READ);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-249-\ndrivers/net/wireless/realtek/rtw88/sdio.c:250:\treg_data = rtw_sdio_to_bus_offset(rtwdev, REG_SDIO_INDIRECT_REG_DATA);\ndrivers/net/wireless/realtek/rtw88/sdio.c:251:\treturn rtw_sdio_readw(rtwdev, reg_data, err_ret);\ndrivers/net/wireless/realtek/rtw88/sdio.c-252-}\ndrivers/net/wireless/realtek/rtw88/sdio.c-253-\ndrivers/net/wireless/realtek/rtw88/sdio.c:254:static u32 rtw_sdio_indirect_read32(struct rtw_dev *rtwdev, u32 addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-255-\t\t\t\t int *err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-260-\tif (!IS_ALIGNED(addr, 4)) {\ndrivers/net/wireless/realtek/rtw88/sdio.c:261:\t\t*err_ret = rtw_sdio_indirect_read_bytes(rtwdev, addr, buf, 4);\ndrivers/net/wireless/realtek/rtw88/sdio.c-262-\t\tif (*err_ret)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-267-\ndrivers/net/wireless/realtek/rtw88/sdio.c:268:\t*err_ret = rtw_sdio_indirect_reg_cfg(rtwdev, addr,\ndrivers/net/wireless/realtek/rtw88/sdio.c-269-\t\t\t\t\t BIT_SDIO_INDIRECT_REG_CFG_READ);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-272-\ndrivers/net/wireless/realtek/rtw88/sdio.c:273:\treg_data = rtw_sdio_to_bus_offset(rtwdev, REG_SDIO_INDIRECT_REG_DATA);\ndrivers/net/wireless/realtek/rtw88/sdio.c:274:\treturn rtw_sdio_readl(rtwdev, reg_data, err_ret);\ndrivers/net/wireless/realtek/rtw88/sdio.c-275-}\ndrivers/net/wireless/realtek/rtw88/sdio.c-276-\ndrivers/net/wireless/realtek/rtw88/sdio.c:277:static u8 rtw_sdio_read8(struct rtw_dev *rtwdev, u32 addr)\ndrivers/net/wireless/realtek/rtw88/sdio.c-278-{\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-283-\ndrivers/net/wireless/realtek/rtw88/sdio.c:284:\tdirect = rtw_sdio_use_direct_io(rtwdev, addr);\ndrivers/net/wireless/realtek/rtw88/sdio.c:285:\taddr = rtw_sdio_to_io_address(rtwdev, addr, direct);\ndrivers/net/wireless/realtek/rtw88/sdio.c:286:\tbus_claim = rtw_sdio_bus_claim_needed(rtwsdio);\ndrivers/net/wireless/realtek/rtw88/sdio.c-287-\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-293-\telse\n\n"
} |
| 19/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 34870 output: 42 thoughts: 1914 Thoughts: **SDIO Driver Analysis: Unreachable Hardware** Okay, so I'm looking at `rtw_sdio_probe`, the probe function for Realtek SDIO drivers. These are drivers for SDIO function devices, and they bind to an SDIO bus on an MMC/SDIO bus. My first thought is to understand how an SDIO device gets instantiated in Linux. It's when an MMC host detects an SDIO card. Now, I have to consider whether there's a virtual SDIO bus in the kernel I can leverage. Let me dig into the kernel's MMC host controllers. Okay, I've got a list from `drivers/mmc/host`. I see a whole bunch of them, but none of them seem to be virtual host controllers that would let me create SDIO devices from user space. I had a quick look at `ushc.c` and `rtsx_usb_sdmmc.c` but those are USB-to-SD card adapters, and I don't see how I could attach an SDIO card through them. Even if syzkaller emulates a USB card reader via raw gadget, does such a reader support SDIO cards and would it connect the Realtek SDIO card to syzkaller? Unlikely. QEMU and syzkaller don't have a mechanism to attach SDIO Wi-Fi cards, it would seem. Now, let's go back and carefully consider the triage guidelines. I need to make sure this code is actually reachable. The negative criteria are clear: if the code falls into things like non-kernel changes, or structurally unreachable hardware, it's not worth fuzzing. The positive criteria mention reachable drivers and protocols, accessible via virtual buses, but my Realtek SDIO chips (RTL8723BS, etc.) are embedded physical SDIO WLAN chips that are commonly soldered on ARM/SoC boards or plug-in SDIO cards. Can I probe these in a standard QEMU or GCE environment? No. Not without an SDIO bus. In a standard virtualized environment (QEMU on x86_64), there are no physical SDIO Realtek cards attached. QEMU uses virtual devices like virtio, e1000, and rtl8139, as well as USB gadget. However, QEMU on x86_64 doesn't have an SDIO bus with Realtek wifi emulation. Even if QEMU emulated an SDHCI controller, it would only support standard SD memory cards, not these Realtek SDIO Wi-Fi cards. Therefore, the code in `drivers/net/wireless/realtek/rtw88/sdio.c` is structurally unreachable hardware. Wait, one last thing: is the `sdio.c` code somehow called from the generic `rtw88` code that might be shared with USB or PCI? Let's check the `Makefile`. Okay, I see that `rtw88_sdio.o` is a completely separate module and is not compiled into the core. That's that, then. |
| 20/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "EXPORT_SYMBOL",
"PathPrefixes": [
"drivers/net/wireless/realtek/rtw88/sdio.c"
]
}Results: {
"Output": "drivers/net/wireless/realtek/rtw88/sdio.c=1778=SIMPLE_DEV_PM_OPS(rtw_sdio_pm_ops, rtw_sdio_suspend, rtw_sdio_resume);\ndrivers/net/wireless/realtek/rtw88/sdio.c:1779:EXPORT_SYMBOL(rtw_sdio_pm_ops);\ndrivers/net/wireless/realtek/rtw88/sdio.c-1780-\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c=2230=int rtw_sdio_probe(struct sdio_func *sdio_func,\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-2304-}\ndrivers/net/wireless/realtek/rtw88/sdio.c:2305:EXPORT_SYMBOL(rtw_sdio_probe);\ndrivers/net/wireless/realtek/rtw88/sdio.c-2306-\ndrivers/net/wireless/realtek/rtw88/sdio.c=2307=void rtw_sdio_remove(struct sdio_func *sdio_func)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-2324-}\ndrivers/net/wireless/realtek/rtw88/sdio.c:2325:EXPORT_SYMBOL(rtw_sdio_remove);\ndrivers/net/wireless/realtek/rtw88/sdio.c-2326-\ndrivers/net/wireless/realtek/rtw88/sdio.c=2327=void rtw_sdio_shutdown(struct sdio_func *sdio_func)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-2342-}\ndrivers/net/wireless/realtek/rtw88/sdio.c:2343:EXPORT_SYMBOL(rtw_sdio_shutdown);\ndrivers/net/wireless/realtek/rtw88/sdio.c-2344-\n"
} |
| 21/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 38029 output: 49 thoughts: 193 Thoughts: **My Analysis of `sdio.c` and its Dependencies** Okay, let's break down this `sdio.c` situation. My initial scan tells me it's remarkably focused. From what I see, it *only* exports four primary functions: `rtw_sdio_pm_ops`, `rtw_sdio_probe`, `rtw_sdio_remove`, and `rtw_sdio_shutdown`. That's a very streamlined API. Now, the natural next question, and one that my expertise immediately kicks in to answer, is who's using these functions? The dependency analysis should be straightforward, given how limited its scope is. The dependency analysis seems to confirm my hypothesis; it appears that the SDIO driver modules, specifically `rtw8723bs.c`, `rtw8723cs.c`, `rtw8723ds.c`, `rtw8821cs.c`, `rtw8822bs.c`, and `rtw8822cs.c`, are the sole consumers. That makes the design clean and easy to manage. But wait, there's a memory jog, something that caught my attention earlier. I remember seeing a function call, `rtw_sdio_is_sdio30_supported(rtwdev)`, lurking in `mac.c`. I need to verify its source and purpose. So, let's pivot and examine `mac.c` next, as that's where the answer to this question must lie. |
| 22/2 | 2026/11/20 07:17 | tool | grepper |
0mArgs:{
"Expression": "rtw_sdio_is_sdio30_supported",
"PathPrefixes": [
"drivers/net/wireless/realtek/rtw88/"
]
}Results: {
"Output": "drivers/net/wireless/realtek/rtw88/mac.c=62=static int rtw_mac_pre_system_cfg(struct rtw_dev *rtwdev)\n--\ndrivers/net/wireless/realtek/rtw88/mac.c-96-\ndrivers/net/wireless/realtek/rtw88/mac.c:97:\t\tif (rtw_sdio_is_sdio30_supported(rtwdev))\ndrivers/net/wireless/realtek/rtw88/mac.c-98-\t\t\trtw_write8_set(rtwdev, REG_HCI_OPT_CTRL + 2,\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c=166=static bool rtw_sdio_use_direct_io(struct rtw_dev *rtwdev, u32 addr)\n--\ndrivers/net/wireless/realtek/rtw88/sdio.c-173-\ndrivers/net/wireless/realtek/rtw88/sdio.c:174:\treturn !rtw_sdio_is_sdio30_supported(rtwdev) ||\ndrivers/net/wireless/realtek/rtw88/sdio.c-175-\t\trtw_sdio_is_bus_addr(addr);\n--\ndrivers/net/wireless/realtek/rtw88/sdio.h=204=void rtw_sdio_shutdown(struct sdio_func *sdio_func);\ndrivers/net/wireless/realtek/rtw88/sdio.h-205-\ndrivers/net/wireless/realtek/rtw88/sdio.h:206:static inline bool rtw_sdio_is_sdio30_supported(struct rtw_dev *rtwdev)\ndrivers/net/wireless/realtek/rtw88/sdio.h-207-{\n"
} |
| 23/2 | 2026/11/20 07:17 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 39091 output: 129 thoughts: 869 Thoughts: **Analysis of Realtek SDIO Driver Patch for Syzkaller Fuzzing** Okay, so I've been looking at this Realtek SDIO driver patch. First, I see `rtw_sdio_is_sdio30_supported` - that's a static inline function defined in `sdio.h`. Importantly, I noticed that `mac.c` checks if the device is SDIO *and* calls `rtw_sdio_is_sdio30_supported`. The code changes are confined to `drivers/net/wireless/realtek/rtw88/sdio.c` and `sdio.h`, specifically touching the `struct rtw_sdio` and some `RTW_SDIO_TX_AGG_MAX_*` defines. This tells me the changes are solely within the SDIO transport layer for the rtw88 driver. Crucially, *none* of the modifications touch the USB, PCI, or core wireless driver components. Now, the critical question: can syzkaller actually *fuzz* this code? I need to assess reachability. Syzkaller is excellent at fuzzing a wide array of devices: USB gadgets, network devices, mac80211, Bluetooth, filesystems, and virtual buses like virtio. However, I can't find anything in Syzkaller that even hints at SDIO emulation. I'm reasonably certain it doesn't support it directly via a pseudo-syscall or device plugin. The problem, as I see it, is that SDIO requires physical hardware. Standard QEMU/GCE environments don't provide an SDIO software emulator. This puts Realtek SDIO wireless chips (like RTL8723BS, RTL8822BS, etc.) squarely in the "structurally unreachable hardware" category, just like the vendor-specific PCIe switches or SmartNIC drivers that require physical cards not emulated in QEMU. Syzkaller's documentation, as I recall, emphasizes that fuzzing should only target code reachable in standard virtualized environments. Therefore, because this patch relates to SDIO driver code that *necessitates* physical hardware which isn't emulated, `WorthFuzzing` must be `false`. There's no way for syzkaller to execute this code. Let me double-check: `WorthFuzzing`? False. `FocusSymbols`? Empty. `EnableConfigs`? Empty. The reasoning is clear: the changes are in the SDIO transport, dependent on physical SDIO hardware that syzkaller can't simulate. It's structurally unreachable. I'm satisfied. Time to call `set-results`. |
| 24/2 | 2026/11/20 07:18 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch modifies the SDIO bus transport layer (rtw88_sdio) for Realtek wireless devices. This code requires physical SDIO hardware (such as RTL8723BS or RTL8822BS/CS) and cannot be instantiated or probed in standard virtualized environments (QEMU/GCE) since there is no virtual SDIO emulation or gadget interface available to syzkaller. Consequently, the modified code is structurally unreachable for fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch modifies the SDIO bus transport layer (rtw88_sdio) for Realtek wireless devices. This code requires physical SDIO hardware (such as RTL8723BS or RTL8822BS/CS) and cannot be instantiated or probed in standard virtualized environments (QEMU/GCE) since there is no virtual SDIO emulation or gadget interface available to syzkaller. Consequently, the modified code is structurally unreachable for fuzzing.",
"WorthFuzzing": false
} |
| 25/1 | 2026/11/20 07:18 | 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) |
|---|