From patchwork Tue Jan 24 22:12:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: William Zhang X-Patchwork-Id: 47933 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2405556wrn; Tue, 24 Jan 2023 14:36:06 -0800 (PST) X-Google-Smtp-Source: AK7set+nVVDvMGEvgh377CYd+vtqqY6gPc09BFon9ArPP1/XY3ZiGwnnZxA/u8ET+DQpPk8GddSc X-Received: by 2002:aa7:ca56:0:b0:4a0:a94b:7655 with SMTP id j22-20020aa7ca56000000b004a0a94b7655mr303627edt.18.1674599765825; Tue, 24 Jan 2023 14:36:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674599765; cv=none; d=google.com; s=arc-20160816; b=dBLYi4zLrgJV4xpGHzZP/K2XHSsUb2zPP72+5vRehCLiI7fon5lNf92vEU2T2Q4Oaz 9zS6T1oS/qILQVKBMkG6us5SHqPLeWGk6c66Gvklx7TW4XvYziSfSFzK+FMYEnbXzHUT 995o3RogfAa2GsRjUndb3UAFmRMYoqpCpemZ/U+xqGNTB1VxCYkHGBvNRLOu2dx2HngW XjBG8Rp7j64iZGn0rN1NA2PvS05PawgpWOhT305JCcNS0hNjlvZgYXjvgyrFZcRG2kuj 3PFrsL3xPxFJJBiQim5NBJYF8KkYZnizYKrzwyFk0QvEBwOAYGxRij/jGB2ULOhpWXct 1VVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=0kKw/CUsKc/lf8iZgVsFCLOiJRZaMy2Ntj3eL84tpH8=; b=Ocz2YBESfji4tpUH4iwgTWCPOWamEtwrfAHPvGDAqbkcSUqeJqLPTxo3t1xeP+LMY2 Y2++cVVOBS+T3NS1FzZ9gIaJN3ZvMny3AL1t418/LTTt2irdPTHN14zQpFU9lZxiXJdy 4aXuxzpQUjpr8YlXk3dpnnWU9ccJBPHhT5+ouougEZfpJOg1NTGobUtFjatnhecKcJaY jbCDqkxmH116IxtHWvVLWBubiC4dEC2gju9f8lx4XW1DpJ06TPuT4YtSBqM6osbZXm5i 1zU8+pC83vwMB3aogpZ/fKQRchSPkz4oDXCvtijJ9uX9g3ukiFB4o70it8MI7lCe5i/L BWTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b="Q7jT862/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a12-20020aa7d90c000000b004a091cb1537si1146455edr.450.2023.01.24.14.35.41; Tue, 24 Jan 2023 14:36:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b="Q7jT862/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234164AbjAXWdj (ORCPT + 99 others); Tue, 24 Jan 2023 17:33:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234980AbjAXWdT (ORCPT ); Tue, 24 Jan 2023 17:33:19 -0500 Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.166.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BC824E529; Tue, 24 Jan 2023 14:33:05 -0800 (PST) Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.75.146.107]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 4A964C0000F2; Tue, 24 Jan 2023 14:33:05 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 4A964C0000F2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1674599585; bh=R9v3QNnFjnhJ+Q1VxNUecO321RU+3kqGA8Tpef+bMY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q7jT862/iy/XlOUCWfMpqFsN0P9o2VF5Ff4cmyzNipZ/pt2Weskp3ZU/JlbSED/vh ePYbM9SQRitWXFN15KncZXKvPhd5feXy9c0RJpcDJ1ez+AcHjumMQHhHVNLDcjVu3+ FSlR/wahcNVCe+FJTT2jWx5pEvdUu5HHSFyMRW8g= Received: from bcacpedev-irv-3.lvn.broadcom.net (bcacpedev-irv-3.lvn.broadcom.net [10.75.138.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPS id 48F6D18041CAC6; Tue, 24 Jan 2023 14:33:05 -0800 (PST) Received: by bcacpedev-irv-3.lvn.broadcom.net (Postfix, from userid 28376) id A1981101B54; Tue, 24 Jan 2023 14:32:57 -0800 (PST) From: William Zhang To: Linux SPI List , Broadcom Kernel List Cc: tomer.yacoby@broadcom.com, kursad.oney@broadcom.com, dregan@mail.com, f.fainelli@gmail.com, anand.gore@broadcom.com, jonas.gorski@gmail.com, dan.beygelman@broadcom.com, joel.peshkin@broadcom.com, William Zhang , kernel test robot , Mark Brown , linux-kernel@vger.kernel.org Subject: [PATCH v2 06/14] spi: bcm63xx-hsspi: Endianness fix for ARM based SoC Date: Tue, 24 Jan 2023 14:12:09 -0800 Message-Id: <20230124221218.341511-7-william.zhang@broadcom.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20230124221218.341511-1-william.zhang@broadcom.com> References: <20230124221218.341511-1-william.zhang@broadcom.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1755945124071465762?= X-GMAIL-MSGID: =?utf-8?q?1755945124071465762?= 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 --- Changes in v2: - Fix build error for Alpha platform Reported-by: kernel test robot 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 01d5acad4a1b..a65a0ec67641 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),