From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 960DD41D11F; Tue, 13 Oct 2026 12:32:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894722; cv=none; b=LpP/IUsESn9GPtvFTAqqj++eQTUdOMg7jGsFElmPVX/ZhFwo9ruapYtwx5VnO533FiOKh7u+OReutCm3O/oHy8aRHxcijW/FrkmmYDgbl6WkDrp2YBKcIzTWqFmP+WzcH1EMlFngsUyK540n+j0IiR3Gwuw46yyVdvf1yA4MdYs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791894722; c=relaxed/simple; bh=55cgKiHFJsS2dmMhmhHOCj/z5iVEKFTWAlFprwCCn0U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DDrcMiKW+NFqxyfboiiE06h6MUfvddMGkGD6kHXSm18I9VZYWb7ZO/kKuYmjRAYYxwTkcFycMbNfwxcU31b/hbAyuLdnR2DSuOwyBEQkHWXbo6WrLKfcKqPPh5z/x946bM5XTCbJ2SibnsQYfaU1Z4sl4BPj+B7kVm2PjeX6fRo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qIXaTTBw; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="qIXaTTBw" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E95891F000FF; Tue, 13 Oct 2026 12:32:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1791894721; bh=vKAlrWWN2vlt31bn4MN4jUx+Frs+gWKoN5ixpm4GSZI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qIXaTTBwj1X/oF6D0X+xcH8mIsH4j1B0VOFJK3iR1YBe12BsJTLy6FWbYsV5vq5SY E8K6AitlTtqEgLoqkGYHTOePDMFyQz4Nw+s3h4FVaBZVpP5RzvW7LJP9vJ9oPAC8qt mjiAOLjF7HJhrmoxdv9+/M+qA/OkRTfaaRxwhObE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Runyu Xiao , Alexandre Belloni Subject: [PATCH 6.12 033/497] rtc: spear: initialize IRQ state before requesting alarm IRQ Date: Tue, 13 Oct 2026 13:33:20 +0200 Message-ID: <20261013112908.675398646@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261013112907.864180619@linuxfoundation.org> References: <20261013112907.864180619@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Runyu Xiao commit 055ef5ce9f67a6a3a1363fa663007f8196cc0fb8 upstream. devm_request_irq() enables the interrupt before it returns, so the handler may run while probe is still initializing the device. Initialize the MMIO address and spinlock before requesting the alarm IRQ. Fixes: 0942a71e435f ("rtc: add support for spear rtc") Cc: stable@vger.kernel.org Assisted-by: Codex:GPT-5 Signed-off-by: Runyu Xiao Link: https://patch.msgid.link/20260902080318.3498434-1-runyu.xiao@seu.edu.cn Signed-off-by: Alexandre Belloni Signed-off-by: Greg Kroah-Hartman --- drivers/rtc/rtc-spear.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c @@ -363,6 +363,12 @@ static int spear_rtc_probe(struct platfo if (irq < 0) return irq; + config->ioaddr = devm_platform_ioremap_resource(pdev, 0); + if (IS_ERR(config->ioaddr)) + return PTR_ERR(config->ioaddr); + + spin_lock_init(&config->lock); + status = devm_request_irq(&pdev->dev, irq, spear_rtc_irq, 0, pdev->name, config); if (status) { @@ -371,10 +377,6 @@ static int spear_rtc_probe(struct platfo return status; } - config->ioaddr = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(config->ioaddr)) - return PTR_ERR(config->ioaddr); - config->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(config->clk)) return PTR_ERR(config->clk); @@ -383,7 +385,6 @@ static int spear_rtc_probe(struct platfo if (status < 0) return status; - spin_lock_init(&config->lock); platform_set_drvdata(pdev, config); config->rtc->ops = &spear_rtc_ops;