From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F121737B00C for ; Fri, 21 Aug 2026 03:35:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787283346; cv=none; b=qFV8VJ9syOvIQHqf4dY38ua9tW18aAVwS0wt3rIKOFBWWZgd/+qTr6kMJY5So+P/Tx9gam552+cWY937rxOY9pTvK0IkSrveNu4o9FWr68Tlvgoc4l5iwyMI09J4YDfm5UqJ39u5GW3ipxDr7ZX0LeExmb25sNzwS/CJk4SV4wc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787283346; c=relaxed/simple; bh=p3VsYFoBXKb6WPzu/fYT+GrFxHpG26k5gXURQNYGlmQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Rt5d+a0Dmdd788AAX7nQZr8TgxCRrPPTzB++FkV2uJO4iOiw6XDnWg1ssfNPKZnQMe8w2nV8IdeY+1CJLT7gtLM+w3rOosBzCXgn+IDHnXs3Lhs5a1/FlHBNajdPc0Y/wkN6LVQLU9QchR1QT/5g7oFjMBtTtJdgi65mzjOHkOQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Hsd7NAaZ; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hsd7NAaZ" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-84862b0d5f8so345733b3a.3 for ; Thu, 20 Aug 2026 20:35:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787283342; x=1787888142; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=37lrRdVdH72rKqT8mTTOi84r0kl7oav2/onL05fr7B8=; b=Hsd7NAaZfU3+OQQMVy7GDi+7sN53ssIj09rjmiG5LF3EsA0t9ZVVmBVpNCaiHBpl+z sEqW9lFQMV7AUV8HP6QsK0/JIneQeQn4Z7CBSpZ+AEy01ElWsZ/aGnSHjd32/wVPF9sv Bh9pD2LPxjeijTFPJrcQTNo+rvC32VBrIpuBaj+pc0kHS4MRJyIqNxfCOlCTwKawJVRR H+4H3KVMmVuAqK/PCldFLy1dFOJGa8zMnlmH0eBEHPGs9iYQAaCEK0+Q2b2s3lnv6SXe Cf2nYmfz2cukq+/v5LcFeMLNVgrtlYunyHHfiWLP86vt3nzT9LSsLBzH0UoNPB+dylNy fcjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787283342; x=1787888142; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=37lrRdVdH72rKqT8mTTOi84r0kl7oav2/onL05fr7B8=; b=GB0bCtmQg8P3ygclPWF+zWLSGQQOdwLvdFkv+b8ViT9oV13h1YrmhlEheiowcJiaL+ kkoJ6pidpZsmBBpJKpjoDPnGD3plDmHqUrm52AyP+OHQVyFI88eUpVy2Z/089p9VOEsh dEmH8FJEHcEJ1rXCMsWHvR/tx3Z/hpI+K+5opeXmBSIFar6LYKy/Zc7HeccNKso2JiRo zECxizNJebODUF0GTiRnTrhW35RPoAozhagLCYQf88ZFXQlSYErmejLZ1cCnAk3ZGLsl V/fbjtDZudRC+yYv/qcvta8dKrIChGKp9DsqPTs2cwqdl5ZI86VMPp2lxigxnro7Pd09 lwrQ== X-Gm-Message-State: AFuF++n2E3a7fIzYMnhZ0/iHRWoDfvnG0wDHCX2oLRPudPnIke1hO0nv jfoKkQwWb/bD7L5jJz5FYDsD8zgFO/7Pkivrrg/hZ/oYKZHCwfMBKl3NjKykiw== X-Gm-Gg: AR+sD11qd4vMPB1cWKmtKn4Me3o1WiDLHmwbK2wnkVbYAxry6AZey7VqdBu7UfymZz7 ecx0Ml4V4aDl0doG32jA2Om/aKihx8UY1XLtADjFBunbuUsJlIUgBr7GrMQiDeysKq4TgnnCTOC nCpi1dJm4D9GdntFg8KNpgmSjj9s7V1G0YR700D+OzKQMNq9f67y/0IcGASdbP0DT8iA9BC4RSr dg2BR2MfMSgv8ivtZiHutvaF5O72bJMrba8IogLadt1CEj69LK2dwW1GgfIalmh1NV1DP0uK8wf GkjVvkJLuGQIqjiV/lM3kKLxan3aCi1zgQh9gvo72VnRPR9Y6DtPfEhPr5GBmOY/7vL7+uE8x93 K/Py6+G6VHu3o/LjY+90N7wKjmTVqetoHNEO3TfEqajSWREPA6JAMmdydAovfglgD6lFc8tu7R7 HKzG/HnERvNvguxQaEnLcKTSBRWftKx/qX5sTDSP9Sn/R9E4ozKAdp57QmadXvuFxV9Ky87hM8q Na9euNd5EppaUUlonPKCykLfD9KQew= X-Received: by 2002:a05:6a00:410f:b0:845:c694:5c3d with SMTP id d2e1a72fcca58-851f972a856mr5396641b3a.1.1787283342432; Thu, 20 Aug 2026 20:35:42 -0700 (PDT) Received: from hcdev-d520mt2.. (60-250-196-139.hinet-ip.hinet.net. [60.250.196.139]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cc15891a04csm2204271a12.15.2026.08.20.20.35.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Aug 2026 20:35:42 -0700 (PDT) From: a0282524688@gmail.com To: lee@kernel.org, Ming Yu Cc: linux-kernel@vger.kernel.org, Ming Yu , mfd@lists.linux.dev Subject: [PATCH v7 08/10] mfd: nct6694: Submit the interrupt URB after the core is registered Date: Fri, 21 Aug 2026 11:35:03 +0800 Message-Id: <20260821033505.4017901-9-a0282524688@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260821033505.4017901-1-a0282524688@gmail.com> References: <20260821033505.4017901-1-a0282524688@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Ming Yu The interrupt URB is submitted before nct6694_core_probe() creates the IRQ domain. A device completing the URB early makes the callback pass a NULL domain to irq_find_mapping(), which then falls back to the default domain and dispatches interrupts the device does not own. Submit the URB once the core is registered, and kill it before the core is removed so the callback never runs without a domain. Fixes: 51dad33ede63 ("mfd: Add core driver for Nuvoton NCT6694") Signed-off-by: Ming Yu --- Changes in v7: - New patch. Fixes the URB-before-IRQ-domain race reported on v6 patch 6/7. drivers/mfd/nct6694-usb.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mfd/nct6694-usb.c b/drivers/mfd/nct6694-usb.c index c8667984df5e..cc3e7b7b3a0d 100644 --- a/drivers/mfd/nct6694-usb.c +++ b/drivers/mfd/nct6694-usb.c @@ -312,20 +312,20 @@ static int nct6694_usb_probe(struct usb_interface *iface, udata->int_buffer, sizeof(*udata->int_buffer), nct6694_usb_int_callback, nct6694, int_endpoint->bInterval); - ret = usb_submit_urb(udata->int_in_urb, GFP_KERNEL); - if (ret) - goto err_urb; - usb_set_intfdata(iface, nct6694); ret = nct6694_core_probe(dev, nct6694, nct6694_usb_devs, ARRAY_SIZE(nct6694_usb_devs)); if (ret) - goto err_mfd; + goto err_urb; + + ret = usb_submit_urb(udata->int_in_urb, GFP_KERNEL); + if (ret) + goto err_core; return 0; -err_mfd: - usb_kill_urb(udata->int_in_urb); +err_core: + nct6694_core_remove(nct6694); err_urb: usb_free_urb(udata->int_in_urb); return ret; @@ -336,8 +336,8 @@ static void nct6694_usb_disconnect(struct usb_interface *iface) struct nct6694 *nct6694 = usb_get_intfdata(iface); struct nct6694_usb_data *udata = nct6694->priv; - nct6694_core_remove(nct6694); usb_kill_urb(udata->int_in_urb); + nct6694_core_remove(nct6694); usb_free_urb(udata->int_in_urb); } -- 2.34.1