From patchwork Wed May 10 09:27:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Weiss X-Patchwork-Id: 91993 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3483087vqo; Wed, 10 May 2023 02:28:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6lktA6blrZkSe5Y4ArXbw7U3Vq8IefdJYi3xg/GRfsGAI3JvmKhHApw6N8ydFrwgBdAafQ X-Received: by 2002:a17:902:e5c4:b0:1ac:6235:62e1 with SMTP id u4-20020a170902e5c400b001ac623562e1mr14158279plf.59.1683710912554; Wed, 10 May 2023 02:28:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683710912; cv=none; d=google.com; s=arc-20160816; b=Le9vkVQxsMjenjwGhWa1lVGReapBRfUo4snBnR3YUAJ8dWAXgDYqqYZHu5LQAEL4+c cmfsFAujjC9YNJd7tQAS4COLD9z3VPvs61fdMOolyaMJY2UtiNyn6okA2LoxXSE4YJLC xyXjWKUqjSr/0sd7WwNEsNqqVnRPAyLJ8JiywgBIu2XvrM6qcXWHgoA7qwamNI6bLNUX lMYxpC4GCuIFqaga/JyOJ0V3JTJn5U5pLHyPJViAC9GR55wuejPPAmEBh8SbuIM8tdRC fIxJj0/htZKnvW18e1x5XIPTbca2SY0NmU2f3Q2ZCY+DghBzUQW0gyeB6eAi90E67z0s bGKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=JBKGh73QpqEYJqax38l5dJYavyHBNPUc6IQPM+Q4Z0I=; b=vj/cZhSwlc7x/u8571d1M12F6R3iCUESdKvNbzbRupaxdwDjrnN/kpL0gQQ+BZ9Nxo uyX6CHjqAIDL6vMbrncj8d8chTmMww6A38X0XKnUtAKID+ycPdqRgvDKUTTlpaVbXsAv VTgMU8r4V684ZvJmU68Ab9nkURTYwTY83EOEWHEhjwXOKJxkfvbA+9NOcMGLxdbKKUp1 pOldszRdvmMdMwdayJwapEboVmj5DZcBvcbHiPp8cXLaX3DvyiNd3OqDMsEzGeTQt8D3 H9eicLAAp0DG9xvqtDUAoZqk/jCV3bd2Ta6mOuJftjh3tuRorqkFCn5KDlJzoS+Kx/rC yFZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=iPH+ouFo; 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=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j4-20020a17090276c400b001a95babe3c0si3549942plt.371.2023.05.10.02.28.17; Wed, 10 May 2023 02:28:32 -0700 (PDT) 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=@fairphone.com header.s=fair header.b=iPH+ouFo; 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=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236657AbjEJJ1f (ORCPT + 99 others); Wed, 10 May 2023 05:27:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236107AbjEJJ1e (ORCPT ); Wed, 10 May 2023 05:27:34 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 74DD63A8D for ; Wed, 10 May 2023 02:27:32 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id 4fb4d7f45d1cf-50b37f3e664so12439695a12.1 for ; Wed, 10 May 2023 02:27:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1683710851; x=1686302851; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=JBKGh73QpqEYJqax38l5dJYavyHBNPUc6IQPM+Q4Z0I=; b=iPH+ouFoA5GOEgnT5bLA6aVtT6mZ8/JMWvWbyo7xN+jXlp6nS10XYkdja8PCRH+3HD j90pzE45kJTfAuCLCDQvuFmSszJC11Pigyyzs+BntJUG7/t1lUZfGegsNzHlxg4JJcLw B1x9uQrKunyqkx0KF7YCBrwlyAdaNBFW9yPsVVw7O3UxvB9WyqWuDpiYhqxKHKSmvWoe Rr0G+TAqbG2pGAPndeufdxCeF02J0zrWO8vCZN8AmxAVUdqcHt065YS+u1s7rB07fZ4f Oi63pSAk1bFSVleunPCl+RM9T+N676GJgE5aTCKjpWEolxVwuxtL6jdQWDlA+cvUmepM a/Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683710851; x=1686302851; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=JBKGh73QpqEYJqax38l5dJYavyHBNPUc6IQPM+Q4Z0I=; b=keqZjnjtTmnNdzH6Ld+MzJY0AZZGKVEZ/2O0ILb/JKf9gVI5kqD2hItWY371jrgtXn 9K8aKL8SfjHf1iPBLGcFRo2dpypEGSmAb8Hz4Ht5fvArKO6ws9YCezeuJv/drwJDYoHA kbZIO1EMXU+HLPHAlzD7YOm223Yy00j68r4LEn6Np5pI+I1ghH9Iq4WDs2Mt9WvrB+yB JyHTB9xJXa+LYAT2uIdaul2qLF1TPEwAnPW1H1bozWb5YqwfFRHB75/Suv7WgzDaEpL5 ReHuc4hjPxIBhjwViG6xTztl94WfKeDHnrrH8F4slilNKfAHdUeAYSjcepG5PN8Xwc9A pkew== X-Gm-Message-State: AC+VfDws2X/o+ZVuUB81ytUhPh72BzpYBR3ITglSSTjy+5qgoGTUfPJT /9z+YmtvIybPiA49/p1XG/AC1A== X-Received: by 2002:aa7:cd0b:0:b0:506:7386:88d7 with SMTP id b11-20020aa7cd0b000000b00506738688d7mr11915481edw.11.1683710850965; Wed, 10 May 2023 02:27:30 -0700 (PDT) Received: from [172.16.240.113] (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id d16-20020a056402001000b0050bd47f9073sm1691639edu.39.2023.05.10.02.27.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 02:27:30 -0700 (PDT) From: Luca Weiss Date: Wed, 10 May 2023 11:27:21 +0200 Subject: [PATCH] Bluetooth: btqca: make sure to handle byte order for soc_id MIME-Version: 1.0 Message-Id: <20230510-btqca-byte-order-v1-1-82e6a371c5aa@fairphone.com> X-B4-Tracking: v=1; b=H4sIAHhjW2QC/x2Nyw7CIBAAf6XZs9tAq43xV4wHoItsYgAXfDRN/ 13qcZKZzAqFhKnApVtB6M2FU2ygDx24YOKdkOfGMKhhVCet0NanM2iXSphkJkGayGil9NlrBy2 zphBaMdGFPfT5iFM/9gt+OKN9vKimVMNuZiHP3//8etu2H8inI1WMAAAA To: Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Venkata Lakshmi Narayana Gubba Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Simon Horman , Luca Weiss X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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?1765498854161137835?= X-GMAIL-MSGID: =?utf-8?q?1765498854161137835?= The field soc_id in struct qca_btsoc_version is __le32 so we need to convert it to host byteorder before using. Reported-by: Simon Horman Fixes: 059924fdf6c1 ("Bluetooth: btqca: Use NVM files based on SoC ID for WCN3991") Signed-off-by: Luca Weiss Reviewed-by: Simon Horman --- drivers/bluetooth/btqca.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- base-commit: ac9a78681b921877518763ba0e89202254349d1b change-id: 20230510-btqca-byte-order-e6ea10018f1c Best regards, diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c index fd0941fe8608..e7e58a956d15 100644 --- a/drivers/bluetooth/btqca.c +++ b/drivers/bluetooth/btqca.c @@ -637,7 +637,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, snprintf(config.fwname, sizeof(config.fwname), "qca/%s", firmware_name); else if (qca_is_wcn399x(soc_type)) { - if (ver.soc_id == QCA_WCN3991_SOC_ID) { + if (le32_to_cpu(ver.soc_id) == QCA_WCN3991_SOC_ID) { snprintf(config.fwname, sizeof(config.fwname), "qca/crnv%02xu.bin", rom_ver); } else {