From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 67B59BA49 for ; Tue, 7 Mar 2023 18:56:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9D358C433D2; Tue, 7 Mar 2023 18:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1678215371; bh=fXzPbYK1dAhC782/uLVcdJd9IvDRrR+9sqOWzIGsKgE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HEQ3+CJbH8u3t+p/sOGPp1PzBvDXVxGisAlOMM/cLf6w6q4NIrUKseEhpdCHKdMqo SLGaojKeE0Ar0depja8zeMQo/roVmabAYnV3AQaHFIi3Pn9SY6U++Z1McJqIYihYDI IxINNUwFdDJL8QMVr0dCdF6v4pXdGyuUdLM8QpmA= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Kursad Oney , William Zhang , Florian Fainelli , Mark Brown , Sasha Levin Subject: [PATCH 5.15 240/567] spi: bcm63xx-hsspi: Endianness fix for ARM based SoC Date: Tue, 7 Mar 2023 17:59:36 +0100 Message-Id: <20230307165916.355041131@linuxfoundation.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230307165905.838066027@linuxfoundation.org> References: <20230307165905.838066027@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: William Zhang [ Upstream commit 85a84a61699990db6a025b5073f337f49933a875 ] HSSPI controller uses big endian for the opcode in the message to the controller ping pong buffer. Use cpu_to_be16 to properly handle the endianness for both big and little endian host. Fixes: 142168eba9dc ("spi: bcm63xx-hsspi: add bcm63xx HSSPI driver") Signed-off-by: Kursad Oney Signed-off-by: William Zhang Acked-by: Florian Fainelli Link: https://lore.kernel.org/r/20230207065826.285013-7-william.zhang@broadcom.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-bcm63xx-hsspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-bcm63xx-hsspi.c b/drivers/spi/spi-bcm63xx-hsspi.c index b871fd810d801..a74345ed0e2ff 100644 --- a/drivers/spi/spi-bcm63xx-hsspi.c +++ b/drivers/spi/spi-bcm63xx-hsspi.c @@ -194,7 +194,7 @@ static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t) tx += curr_step; } - __raw_writew(opcode | curr_step, bs->fifo); + __raw_writew((u16)cpu_to_be16(opcode | curr_step), bs->fifo); /* enable interrupt */ __raw_writel(HSSPI_PINGx_CMD_DONE(0), -- 2.39.2