From patchwork Wed Aug 21 10:59:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Dahl X-Patchwork-Id: 13771233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 03525C5320E for ; Wed, 21 Aug 2024 11:02:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=crou9icPFQt6qy3frq3zWNsDVrBMyW0y4VXPpAGZ1pA=; b=MGzyOCgQTKTD/3aI1d8n+Hl/Kz 8/rjWH3uHURKKwLZh0HykFWjlkFKwdQ2cBSEaomwV9BtwXd5BEo3Sawi9USPFbEIr7vax0xdCPmzq Smd9pDwxpfxEdqLZa/saJXHqe8UyNNm5wnu8nUEBQGy/CiwxALITjY/PyZrmp7OEA5+zIRRQ06DtB YKWAdwvfZgk2C0HTKENr+Z32oXdpXGv94Zc1Mfr7JrpwdKt5QUQw7SoIsjtyX64oi9TXGUL+oDEPM cfRmPTfslDpYdVhoB1d9AtSFAtgiSpG/dqm5fr6w5LhtdEdTnnc4ylfA2o2sS8kniCjjbxIgzlBGG VGaBx1qA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgj6Z-00000008YL5-3fWV; Wed, 21 Aug 2024 11:02:19 +0000 Received: from mail.thorsis.com ([217.92.40.78]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sgj4E-00000008XRU-0A1v for linux-arm-kernel@lists.infradead.org; Wed, 21 Aug 2024 10:59:56 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 106881483DEE; Wed, 21 Aug 2024 12:59:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thorsis.com; s=dkim; t=1724237991; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding:in-reply-to:references; bh=crou9icPFQt6qy3frq3zWNsDVrBMyW0y4VXPpAGZ1pA=; b=qRaGUGE1xf+8Ul3ZG4giMuFfKzm0Ur44w+zplS6CK3K0tR1Rg40kPZbPFkaXPNMG597iw3 FNo4ZWHVG+NgvzZiaYlYvstoscl+7CRgPtH+blxo6W87OCaNnVe4vZGvH2igzN2ZrzMB3E aobBwsu65a4qFAL9mlIhVXzvCCKGkMcn76HoEskvuR5yNCfVR77mu5fJmrMF6iV1QrwXrS aj+APQQOvlC/p2Jv7Rm5ZKmh+EJdEF0+tYOnwdBqbdRrl057mnRu7fhmPKXEES6ibcANLx a0nsNH1N4cMXy8vkOiLrY4xFdD2R2IXcnsR+dhkESfZVSZzPy71p0YzMBEaGtw== From: Alexander Dahl To: Claudiu Beznea Cc: Christian Melki , Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org (moderated list:MICROCHIP OTPC DRIVER), linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 01/12] nvmem: microchip-otpc: Avoid writing a write-only register Date: Wed, 21 Aug 2024 12:59:32 +0200 Message-Id: <20240821105943.230281-2-ada@thorsis.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240821105943.230281-1-ada@thorsis.com> References: <20240821105943.230281-1-ada@thorsis.com> MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240821_035954_323866_191BE02A X-CRM114-Status: GOOD ( 10.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The OTPC Control Register (OTPC_CR) has just write-only members. Reading from that register leads to a warning in OTPC Write Protection Status Register (OTPC_WPSR) in field Software Error Type (SWETYP) of type READ_WO (A write-only register has been read (warning).) Just create the register write content from scratch is sufficient here. Signed-off-by: Alexander Dahl --- drivers/nvmem/microchip-otpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvmem/microchip-otpc.c b/drivers/nvmem/microchip-otpc.c index 7cf81738a3e0..03e60b99f2c9 100644 --- a/drivers/nvmem/microchip-otpc.c +++ b/drivers/nvmem/microchip-otpc.c @@ -82,7 +82,7 @@ static int mchp_otpc_prepare_read(struct mchp_otpc *otpc, writel_relaxed(tmp, otpc->base + MCHP_OTPC_MR); /* Set read. */ - tmp = readl_relaxed(otpc->base + MCHP_OTPC_CR); + tmp = 0; tmp |= MCHP_OTPC_CR_READ; writel_relaxed(tmp, otpc->base + MCHP_OTPC_CR);