From patchwork Tue Apr 6 10:10:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Roese X-Patchwork-Id: 1462720 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=denx.de header.i=@denx.de header.a=rsa-sha256 header.s=phobos-20191101 header.b=afuFhFfK; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4FF3FH0Nckz9sRf for ; Tue, 6 Apr 2021 20:10:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1DFA1806CE; Tue, 6 Apr 2021 12:10:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1617703830; bh=eVlcNw5Viof9FAGiP6nCaXzhg6ES93TdVfu3Z5gZM2E=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=afuFhFfKNfSlCtXz0rYSwnkemPShI1i7cOhc2DnquOkbdS+Nouwcv4NVPb75eOMsV fjHmfU83xiM3rQGa+rsHGU0PzdsAybso4NJimgpYg2MUi73tId/rAxksjdaJeM+nJZ 8EeuHo79ERp5f/iwdUkHhJZtVawzLZ5Y2I9ATdxFjTM5H2fZh5l2u4vUpr8OU7Im/X dpJuUWMXxyOm/h9cRQkK0ejPAzIEa1LMUkLZtB+0/O6J9XByXEIZlFeiaQ5Jrvnn3k kTrEE2I4+Uwbm2SJTB7E7p+lDYhrksZfkfhCdEEHKygzuFFJGi+Jac2t1QJz88Fu5R VzVhiffd15qQg== Received: by phobos.denx.de (Postfix, from userid 109) id 387CC81578; Tue, 6 Apr 2021 12:10:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout-u-204.mailbox.org (mout-u-204.mailbox.org [91.198.250.253]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2F7ED8006D for ; Tue, 6 Apr 2021 12:10:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=sr@denx.de Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4FF3Dv0CPJzQjnx; Tue, 6 Apr 2021 12:10:23 +0200 (CEST) Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id 4pWurKsyI2DX; Tue, 6 Apr 2021 12:10:19 +0200 (CEST) From: Stefan Roese To: u-boot@lists.denx.de Cc: Aaron Williams , Chandrakala Chavva , Bin Meng , Marek Vasut Subject: [PATCH 1/3] usb: hub: Fix usb_get_port_status() for big-endian platforms Date: Tue, 6 Apr 2021 12:10:16 +0200 Message-Id: <20210406101018.30037-1-sr@denx.de> MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -1.02 / 15.00 / 15.00 X-Rspamd-Queue-Id: ACFFC1899 X-Rspamd-UID: 1b4d12 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean From: Aaron Williams Add missing endianness conversions to usb_get_port_status(). This (amongst others) is necessary to enable the use of USB 3 hubs on big-endian platforms like MIPS Octeon. Signed-off-by: Aaron Williams Signed-off-by: Stefan Roese Cc: Chandrakala Chavva Cc: Bin Meng Cc: Marek Vasut --- common/usb_hub.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/common/usb_hub.c b/common/usb_hub.c index 3d856e7de792..ba11a188ca64 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -144,7 +144,8 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data) if (!usb_hub_is_root_hub(dev->dev) && usb_hub_is_superspeed(dev)) { struct usb_port_status *status = (struct usb_port_status *)data; - u16 tmp = (status->wPortStatus) & USB_SS_PORT_STAT_MASK; + u16 tmp = le16_to_cpu(status->wPortStatus) & + USB_SS_PORT_STAT_MASK; if (status->wPortStatus & USB_SS_PORT_STAT_POWER) tmp |= USB_PORT_STAT_POWER; @@ -152,7 +153,7 @@ int usb_get_port_status(struct usb_device *dev, int port, void *data) USB_SS_PORT_STAT_SPEED_5GBPS) tmp |= USB_PORT_STAT_SUPER_SPEED; - status->wPortStatus = tmp; + status->wPortStatus = cpu_to_le16(tmp); } #endif