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 7D11B44063C for ; Wed, 19 Aug 2026 19:02:24 +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=1787166145; cv=none; b=CFq1zWuV7WQhPyii+T29qm2uNZQyWXQtPXGToHIX023LODser2rY2O71THHyWb/8LxLsmzBzwfO5PLj33ybhpym7NYsaSoMn1ZhCcKq+zMmXGDNND1mR1NdqD1kNPfSEgA4FBAi6vlprGm4IN34H8dDMqXsiVBLRpZEzLsd2MAo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787166145; c=relaxed/simple; bh=qtPj2s43M0U6tfDOuAhtOK39sgy+FhacRGnD4GzKT1U=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=EEUdhExEwhXAmnx15hwGH7NsGf5G12wJd9QNLtHCeZCSzTRPax+MBUXxE/D7GWqrda0HJc9XNIfWuEZp/FrrUhwBy4TlUnUAmOxor84nxleuO1iAXAm7sXiH5tdLeUVlik+C3ezQYevewIE0e39nI7QIi4Pzt1/aEiHy//9zUoc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ouhHGNYT; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ouhHGNYT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5736B1F000E9; Wed, 19 Aug 2026 19:02:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1787166144; bh=qtPj2s43M0U6tfDOuAhtOK39sgy+FhacRGnD4GzKT1U=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=ouhHGNYTIeJcY1Fm8Vn2UJNqcG/bdfSOmX6vc2Pq16IXIX8KPRHAMH7OiNSxbPqYC GM01H+pOWYcsZBI+eK9ZCWYM8lVLtFSJYexCVNP+z1JQd57f4GV4EasZQHmtMcgTrH 4i4Lhs9WYXYW9tZHTnfY4mRt8+UaTlxkmEtFceIXM5UvUSTY+I3EqFcvs68DV3bUsx NuH23nA7qkU6a0yuJdCz4ROvdgTYaNsRKFte7iIsqPs4SwOtp79g6PC2pPbr/v90gl XRcVDhdG0TaX7wYhkX5qwpymFDPgZp9FExkJxEegFuJP8nX6r9Ie2IEqb+J/AJOaeh zbKPii9j6sOtQ== From: Thomas Gleixner To: Rustam Adilov , Birger Koblitz , Bert Vermeulen , John Crispin , linux-kernel@vger.kernel.org Cc: Rustam Adilov , Carlo Szelinsky Subject: Re: [PATCH v2] irqchip/irq-realtek-rtl: change to __raw reads and writes In-Reply-To: <20260725101456.31619-1-adilov@disroot.org> References: <20260725101456.31619-1-adilov@disroot.org> Date: Wed, 19 Aug 2026 21:02:20 +0200 Message-ID: <87o6eyj5mr.ffs@fw13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Sat, Jul 25 2026 at 15:14, Rustam Adilov wrote: > When CONFIG_SWAP_IO_SPACE is enabled, readl() and writel() are > changed to perform a byte swap to little endian type. This is > incorrect because the devices that use the irq-realtek-rtl driver > are all big endian MIPS chips. That still does not make sense. With CONFIG_SWAP_IO_SPACE() enabled readl() performs a address swizzle to convert from BE (CPU) to LE (device). readl() swaps the read data from LE (device) to BE (CPU) and writel() the other way round. You need that change not because your CPU is big endian. You need it because the device is BE, so you don't want to have the LE -> BE conversion, right? Btw, please use readl_be() and writel_be() as those are the proper generic interfaces for this. And please put a comment into the driver explaining that the device is BE.