From patchwork Thu Nov 5 18:55:23 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Hilliard X-Patchwork-Id: 3881 Return-Path: X-Original-To: noreply@patchwork.local Delivered-To: noreply@patchwork.local Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mxe881.netcup.net (Postfix) with ESMTPS id CC9101C53A6 for ; Thu, 5 Nov 2026 19:56:16 +0100 (CET) Authentication-Results: mxe881; dkim=pass header.d=gmail.com; spf=pass (sender IP is 172.105.105.114) smtp.mailfrom=linux-sunxi+bounces-27266-noreply=patchwork.local@lists.linux.dev smtp.helo=tor.lore.kernel.org Received-SPF: pass (mxe881: domain of lists.linux.dev designates 172.105.105.114 as permitted sender) client-ip=172.105.105.114; envelope-from=linux-sunxi+bounces-27266-noreply=patchwork.local@lists.linux.dev; helo=tor.lore.kernel.org; Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 86A5D292D3 for ; Thu, 5 Nov 2026 18:55:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793904945; b=b8Qz0cWvdWB4Fz2MkEAlTrnp3hRUTfn8YOOTUMO74aMlPQOS5DO4No1Pit/b5TyW2bbg IUoyaWXouKeWB9Swi17fOtt9rNLbTp6pdceHS9kCb6gyHGssvuv9t4izwfZWJs1oVU15g H6h9HNJlfnx/VK9blQvvFqueiLOXdzLWTDfXkAn9tHtE5vhbjGZeBhv64RMjOAojFY9PC NOd6vLi5cmT0QIiPlD/xnKWmH1vxrf4UkSzaLVkAmPh7lXBfAHHSf8vNOOZEDr4NQdsMm UwwDBqTo6fP75tFvXtsQLzr1R2gACCu0rmfUN3m601r/jZ3TWXjdNSvWSkwYxo7iY9w== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793904945; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature: X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State: X-Gm-Gg:X-Received:Received:From:Date:Subject:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=nG4n6RbhRtbsAmKm5luV95OTsd5m2vOsTQEC1Oq46ng=; b=PrfHWzUh+g4rgze8uZt+h5eXytOiLN6o4uPz60IMvfMnAEMZESdX72lPInlvqzTsXNss GSLNsAvtR59bNoev8Rzg5rai0aKZElLJQfOEPtgKxxS1pT2IyDYqQoAfZ3Bxd7MZTasJw dVh6T0hlqRX1FsMwrThC2XQ2fUndGHDlK+Dwv2QGdC1IYKY551KDczqw8cp7WM8PPRBSg d5BxM9WrDpa0Uch0jomu4StHn0bmbjtv5YwBPy++jFy7FfmVZS9uypWzLE2P8TMPpexHv 9El+BUFMRiw0+VLpLGqmVBL7h4BFb0W3nmaABioh+BgwrdiyT+r2xAdYmMOrOjDAZvw== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aECHn9uP; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7D674606D803; Thu, 5 Nov 2026 18:55:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aECHn9uP X-Original-To: linux-sunxi@lists.linux.dev Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.161.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793904945; b=JH+DX1ZG2X2hkO3fjm1BOtE8atbrvm1zd0GZnDn3iTOKJ4wRl/5LJrBH7b6dLqE9l7j6 OZNvgabnL/PRgupQxIGZnoJvrSzCtVcQfa/N3BvXUkl/CxYZHrz/1KmHPAylBJtl4YCxR diHZCaZwjgORmjxvx8Ou48fLJvrRsHdEK57VecWbhZ/jkwjIpnwR45KvLi9ePFvJvTObb 3UjCC/pzK84kXUjyML0fwKtPknFla8NdKZnfj1+tfPasJ/bmouArhDGxgk7n+fplBOBcG Dr4eIUGTG1zoZle3Av/h6Z4ThpgTMvEegrymWk/cCtrSCsIs0BGrwH3YQcoc+rpcfqw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793904945; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:Date:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer; bh=nG4n6RbhRtbsAmKm5luV95OTsd5m2vOsTQEC1Oq46ng=; b=uqcnj/yetFcwdKHKHMSDTG5GMLjaLCJarKvdVZN6e563Gbf6HhddRACdoikRECR4I2qc AP556cYZk1cR9JGAOrraO9VFGaWFk8aTddpByuKpAJ2zPv06941U9j/SRk1SQlpHINYY1 RM+BTUewbaxS0xb46Nu0NKALq7fpbJIl8nDNzaHEalxACwJRYtjKFValoN26lTK9cgacE J8HYWOP8Ump6dMGzBN4oUUtOAQ8qBl1nzzk+OeAstpTl3XF9hPF1sj5CIDxzB82klyPXf ife4vSQPrrids8lamBOa0LHMtA4IKL7sBAECQgtTqr3DCxfAOLw5TteqVtR4GBl31/g== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=aECHn9uP; arc=none smtp.remote-ip=209.85.161.44 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 05629606A336 for ; Thu, 5 Nov 2026 18:55:44 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 05629606A336 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 Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-6b1afdf5196so932753eaf.2 for ; Thu, 05 Nov 2026 10:55:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1793904944; x=1794509744; darn=lists.linux.dev; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nG4n6RbhRtbsAmKm5luV95OTsd5m2vOsTQEC1Oq46ng=; b=aECHn9uPqcMl6BPYhSbBc37J2aOe+PLlf7Bv85jLqU+ylqYVWmFSitgM6XxExH3yD2 GdbstRhWCgojIS0cuishvFTiv4a1P6iKN92SPDvDPdNmlSzm9c7s4kEDL6lGwMNF1N8L ZZ+4sDwrBJrKW0BaiYm1vnKXqnEkNufXcEwqbmpJTDATgydmgfbgTiZ5Ja6GxzuKVW7L keudZG+ne+mawNaGDD+H3qROnKhpxJB+H81LF5CMZEcPQApVKNf7q+EZUb8Llho3L3Ce JUu7RnW7mRHPd7JRqrsbXhX0hlzSEtqGyajESNSY1kstfxQhgqe+InRoCazaGCljhJoO +8fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793904944; x=1794509744; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=nG4n6RbhRtbsAmKm5luV95OTsd5m2vOsTQEC1Oq46ng=; b=dBrAujgsiv9Y255C4IM45RawW4pzLGEqgli23guBl3bzk08d1f93HNA1fxp495ZSh4 /0QJoyFx43RJRHzBXXd+AmEeHqxVoAyWOyj+bjMdpXh2OkHanrEGROOmjDZxtqFWRpvA VQY3OSntS4B1sRIdLsDfvqO/TwV2vVAHEpnz8EvdGgwAh0GeDd4yKr71uhNhN/7b/G1X xtx4efcHYJvkhMRgEOTMxAC1sIsp1wDb/ZOCf8UmZHA4cwGZzmxtkc9RFZUBE3zG6okP 27Pbi69HVJ8YTu7NSCB4qVHMonvye5D/Sywyla3T47dyFAHHNxzHSTP0jKBc7SHw/eGk 2lVw== X-Forwarded-Encrypted: i=1; AKwUvBy4Ps12s/dppFqMljPEY41UcO8g0t8T735Tr6anGjjH8A/PqfdPe80Bf/Ph9pZz3WBo9s5lC1T4Obquqg==@lists.linux.dev X-Gm-Message-State: APuU4Z+KhGcGL6/VRZHnEgwxQGiq9NL3BS4U9Gj09ycyrMG5mEwEguIf dqcurxmSYYHdVp96fN0e2KioF4fsuTUMDHo6h6Ef1HXLZySy0h512dL8 X-Gm-Gg: AYBFou07T4Y1S9FLxEIZM1AUFHNHySKADs6rHFyKJy4BvCBVtJmW6jNjlISFIvEIzSI kUdgyVUykNG+zFNXigbugmGNqg+LFdzYemY6xCak6/ps+dEms6IkEIoOk65QJlo4oH36EP1eLtv 4EcsLVmpqFyGF8U6kB9fgHpu0iVFxZfW78u4peA+BABi/+/W7zvccxnlvQuxYerLqVZjBVs0Ka4 5sKSCmM4ieRBqgW4pZWPIYrzPGMqoyOczlAAD53SSSegYVhdVrEchPZLomCBN4SG/PmNJVFBYAr 4sXbYN6vUZmeuKSaVq3HkcU3q2QdBnTXwcFeAOKlqTclkX4pcEjTDZUxCuvjOApzVsStLkd5fWd 95djxFZFVnmfsjb1O5kuP+ymdA39wolTdkbiKMiUBIt3saGkHbR3awr5ZFkvRvvPiwX6yWLoohB iKCwEhQXZJVRPL0rL7k4X/vFBMFNUe7HWEyVGbWkxAcF89DVEaUl57VMKy2TjIXPZA/fvJgaYiF OKp4FJ65sYi2k8PUMIaBgXeS4Az9UCIhHfRlrWYOAzBnNw26UEbjVmh12BdRDAM/YvT5xbHAWgf PWOpmFhcdltyIjA2W+hyize6JFvtxokbMj0SZgtU7pm5pdj6drocUqXjHUgpnH1d2JLOkKHbL/R 11ZrQeMDR1fHk18xxL3TnpxfZeleE6Hp9QnCPGR3ZgCnswbLlCouTUd7at7xO3iqBZbAEQZCxe9 8YjNNrh6Pdc1n2nC55aBQlJalm0CNGvRBACc2k8gLdeL1/qSqFCRa/ X-Received: by 2002:a05:6820:1c8b:b0:712:c751:22eb with SMTP id 006d021491bc7-716e73dea8fmr352195eaf.11.1793904943944; Thu, 05 Nov 2026 10:55:43 -0800 (PST) Received: from [127.0.1.1] (174-29-1-49.hlrn.qwest.net. [174.29.1.49]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-716e99465dbsm115897eaf.0.2026.11.05.10.55.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2026 10:55:42 -0800 (PST) From: James Hilliard Date: Thu, 05 Nov 2026 11:55:23 -0700 Subject: [PATCH v10 07/26] mtd: rawnand: sunxi: drain interrupts before reusing the completion X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Message-Id: <20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-7-dca1f6ed29a8@gmail.com> References: <20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-0-dca1f6ed29a8@gmail.com> In-Reply-To: <20261105-submit-sunxi-nand-vendor-oob-layout-v1-v10-0-dca1f6ed29a8@gmail.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Sebastian Andrzej Siewior , Clark Williams , Steven Rostedt , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , James Hilliard Cc: Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , Maxime Ripard , Richard Genoud , Boris Brezillon , Masahiro Yamada , Brian Norris , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev, devicetree@vger.kernel.org, Sashiko X-Mailer: b4 0.15.2 X-Rspamd-Server: rspamd-worker-8404 X-Spamd-Result: default: False [4.31 / 15.00]; RBL_SENDERSCORE(2.00)[172.105.105.114:from]; SUSPICIOUS_RECIPS(1.50)[]; DMARC_POLICY_SOFTFAIL(1.00)[gmail.com : SPF not aligned (relaxed), No valid DKIM,none]; MAILLIST(-0.18)[generic]; BAD_REP_POLICIES(0.10)[]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; TAGGED_RCPT(0.00)[dt]; ARC_ALLOW(0.00)[subspace.kernel.org:s=arc20261015:i=2]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_TWELVE(0.00)[26]; FREEMAIL_CC(0.00)[kernel.org,gmail.com,sholland.org,bootlin.com,socionext.com,lists.infradead.org,lists.linux.dev,vger.kernel.org]; DBL_BLOCKED_OPENRESOLVER(0.00)[tor.lore.kernel.org:helo,tor.lore.kernel.org:rdns,linutronix.de:email]; FORGED_SENDER_MAILLIST(0.00)[]; FROM_HAS_DN(0.00)[]; TAGGED_FROM(0.00)[bounces-27266-noreply=patchwork.local]; ASN(0.00)[asn:63949, ipnet:172.105.96.0/20, country:SG]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(0.00)[+ip4:172.105.105.114]; TO_DN_SOME(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[100.77.114.92:received,209.85.161.44:received]; RCVD_COUNT_FIVE(0.00)[6]; FREEMAIL_TO(0.00)[bootlin.com,nod.at,ti.com,linutronix.de,kernel.org,goodmis.org,pengutronix.de,gmail.com]; MIME_TRACE(0.00)[0:+]; FROM_NEQ_ENVFROM(0.00)[jameshilliard1@gmail.com,linux-sunxi@lists.linux.dev]; RECEIVED_SPAMHAUS_PBL(0.00)[174.29.1.49:received]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[172.105.105.114:from] X-Rspamd-Queue-Id: CC9101C53A6 X-MORS-Enabled: yes X-MORS-DOMAIN: patchwork.local X-MORS-HOSTING: hosting172546 X-MORS-USER: hosting172546 X-getmail-retrieved-from-mailbox: INBOX The controller uses one completion for successive interrupt-driven waits. Some transfers wait for both command completion and DMA completion. The handler acknowledges each event and masks it, leaving any outstanding event enabled; it calls complete() when all requested events have arrived. sunxi_nfc_interrupt() currently calls complete() before updating those registers. A successful waiter can wake on another CPU and start the next operation before the old handler acknowledges status or rewrites the mask. Move complete() after those updates so waking the waiter cannot precede the handler's last controller access. A timeout also needs to exclude an unfinished handler. With PREEMPT_RT, the flags-zero IRQ request is forced threaded. Near the timeout boundary, that thread can be preempted after reading status and enable bits while the waiter times out, clears the device mask and rearms the next wait. The saved snapshot can then restore an obsolete remaining-event mask or, if it satisfies the old wait, complete the new wait. Masking the device does not invalidate the running handler's local values. Repeating init_completion() can also reset its waitqueue lock during complete(). This lifetime problem was identified by code inspection during review. Initialize the completion once in probe and use reinit_completion() for each wait. On timeout, call disable_irq() before clearing controller state so existing handling finishes and no new handler can enter during cleanup. The hardware may have finished before the delayed handler runs, or the handler may complete the wait while disable_irq() drains it. Recheck status against the remaining enabled events before clearing either register. Events already acknowledged by the handler no longer appear in that mask; if none remain, the wait has completed. This also handles command and DMA events arriving separately without requiring an already acknowledged status bit to be set again. Then mask and acknowledge the events, read back the mask to flush those writes, and re-enable the IRQ line even if the recheck changed the timeout to success. Keep partial-event handling in the IRQ handler and leave polling and controller/DMA abort handling unchanged. This keeps additional synchronization on the timeout path, without a driver lock in every interrupt and wait. The caller can sleep, this IRQ is not registered as shared, and the handler does not acquire the controller mutex held by the caller. The tradeoff is unbounded cleanup latency and no priority inheritance: a starved IRQ thread can prevent timeout cleanup from returning and block other operations on the controller. This is a handler-lifetime boundary, not an RT recovery-latency guarantee. Fixes: 1fef62c1423b ("mtd: nand: add sunxi NAND flash controller support") Reported-by: Sashiko Closes: https://lore.kernel.org/r/20260909085434.C8F201F00A3A@smtp.kernel.org Reviewed-by: Sebastian Andrzej Siewior Signed-off-by: James Hilliard --- drivers/mtd/nand/raw/sunxi_nand.c | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c index 9a7b365e998e..111094b1c64c 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -401,6 +401,7 @@ struct sunxi_nfc_caps { * @chips: a list containing all the NAND chips attached to this NAND * controller * @complete: a completion object used to wait for NAND controller events + * @irq: NAND controller interrupt * @dmac: the DMA channel attached to the NAND controller * @use_mdma: use an internal MBUS DMA backend * @mdma_desc: H6-style MBUS DMA descriptor @@ -420,6 +421,7 @@ struct sunxi_nfc { unsigned long clk_rate; struct list_head chips; struct completion complete; + int irq; struct dma_chan *dmac; bool use_mdma; struct sunxi_nfc_mdma_desc *mdma_desc; @@ -441,18 +443,20 @@ static irqreturn_t sunxi_nfc_interrupt(int irq, void *dev_id) if (!(ien & st)) return IRQ_NONE; - if ((ien & st) == ien) - complete(&nfc->complete); - + /* Finish updating the interrupt state before waking the next operation. */ writel(st & NFC_INT_MASK, nfc->regs + NFC_REG_ST); writel(~st & ien & NFC_INT_MASK, nfc->regs + NFC_REG_INT); + if ((ien & st) == ien) + complete(&nfc->complete); + return IRQ_HANDLED; } static int sunxi_nfc_wait_events(struct sunxi_nfc *nfc, u32 events, bool use_polling, unsigned int timeout_ms) { + bool irq_disabled = false; int ret; if (events & ~NFC_INT_MASK) @@ -462,16 +466,28 @@ static int sunxi_nfc_wait_events(struct sunxi_nfc *nfc, u32 events, timeout_ms = NFC_DEFAULT_TIMEOUT_MS; if (!use_polling) { - init_completion(&nfc->complete); + reinit_completion(&nfc->complete); writel(events, nfc->regs + NFC_REG_INT); ret = wait_for_completion_timeout(&nfc->complete, msecs_to_jiffies(timeout_ms)); - if (!ret) - ret = -ETIMEDOUT; - else + if (!ret) { + u32 pending, status; + + /* Drain the handler before it can restore an old IRQ mask. */ + disable_irq(nfc->irq); + irq_disabled = true; + /* + * The handler removes acknowledged events from the mask. + * An empty mask means all requested events were acknowledged. + */ + pending = readl(nfc->regs + NFC_REG_INT) & events; + status = readl(nfc->regs + NFC_REG_ST); + ret = (status & pending) == pending ? 0 : -ETIMEDOUT; + } else { ret = 0; + } writel(0, nfc->regs + NFC_REG_INT); } else { @@ -484,6 +500,12 @@ static int sunxi_nfc_wait_events(struct sunxi_nfc *nfc, u32 events, writel(events & NFC_INT_MASK, nfc->regs + NFC_REG_ST); + if (irq_disabled) { + /* Flush the mask and acknowledgment before re-enabling the IRQ. */ + readl(nfc->regs + NFC_REG_INT); + enable_irq(nfc->irq); + } + if (ret) dev_err(nfc->dev, "wait interrupt timedout\n"); @@ -2657,6 +2679,7 @@ static int sunxi_nfc_probe(struct platform_device *pdev) nfc->dev = dev; nand_controller_init(&nfc->controller); INIT_LIST_HEAD(&nfc->chips); + init_completion(&nfc->complete); nfc->regs = devm_platform_get_and_ioremap_resource(pdev, 0, &r); if (IS_ERR(nfc->regs)) @@ -2665,6 +2688,7 @@ static int sunxi_nfc_probe(struct platform_device *pdev) irq = platform_get_irq(pdev, 0); if (irq < 0) return irq; + nfc->irq = irq; nfc->caps = of_device_get_match_data(dev); if (!nfc->caps)