Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2481043rdb; Wed, 21 Feb 2024 08:54:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWfg/ouEHJGiCj6s1PeAT9LKB748xY2zi23L3I8plfh6U1x3N5koEZcIqR6+jTC37bOEn1s5HsJXZUPHsWPsLqPFaNzAIZqPk5/htOrMQ== X-Google-Smtp-Source: AGHT+IFSww71KkNZMOp7QUgSxEm4R0VzsTSfkbYLN22g99QD28wRS0ohX11+Qj+rs7T0d1kcBR3A X-Received: by 2002:a17:902:da8f:b0:1db:e7a4:9d4d with SMTP id j15-20020a170902da8f00b001dbe7a49d4dmr12618441plx.46.1708534446277; Wed, 21 Feb 2024 08:54:06 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708534446; cv=pass; d=google.com; s=arc-20160816; b=rR/X4wLeR3aJxNSd+NlrG2PBrgj3AIFsAmRzaHtgm+dsyd59FtygQRhYL3Iwrd8Qtm JUvhhToyPaw+rB74cDBUtEVEzySrxTRVlp3r7sYOmRWNa5GAD04TVPvIvkO93H++1SZ9 ekvM2KGcSM5rR40IUaW375LA7X0P1xWhtqeCkkmVmfE04f7L4AJ7brhGuYYBsNPwn+PY 2ptA5TBcksOBfxXsqQX53e20XynEH95JUksFy+5Yc9RIOCVrZv/ta0Qm24dU4NQLMixq Dty56Oxhzw6A8YVHrzs+mX55XFAP70dQ8bgEETo5+KJd22o1E8z2Ril6XZ2oAOj0NlOx dA/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=D7qBMOPfFf7Aowm2YeooppdZ7YwNspCTNNKvsddFR50=; fh=OzGdaeiMjZgYAHajX7vnKwSpSiVzFDxYaf+uz7SF2AY=; b=rUIiUu22tmHJQcQSJKJjS76IRC3xEHqw1CrvnVJFZehPSw6qSkdhhO7tkOe+JX9Ef8 SgPooRBJZSE5BZrr2Sue5UZ40OrO7Jjk5mHzuK6hZ2U2DKc5Xav8qFeeltBjuX4PNHGm +OGrQIlWWtnroJW89WlxWvqefvvoWYIAx3G9+8LybFEiVJk2/9dhBhELVs6h7viKB5XJ KS6N1h8wcBmb5occgUOq4j8I1CZGvqvjRV3t51ikWNwm9MlaI/Fy2o+K1VxZGajrbG+/ UZ5ARhpsK783kO/aGRq70h6YIC9ZM35ctekU/NnyuPGMlJZVyWxIjsfNoUydEJmo0GMl LSUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-bluetooth+bounces-2063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2063-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id c1-20020a170902c1c100b001db420e7535si8296320plc.23.2024.02.21.08.54.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 08:54:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-2063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=molgen.mpg.de); spf=pass (google.com: domain of linux-bluetooth+bounces-2063-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-2063-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 91C2FB23C23 for ; Wed, 21 Feb 2024 16:48:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D8C6C82D8D; Wed, 21 Feb 2024 16:48:17 +0000 (UTC) X-Original-To: linux-bluetooth@vger.kernel.org Received: from mx3.molgen.mpg.de (mx3.molgen.mpg.de [141.14.17.11]) (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 EDC0680C08 for ; Wed, 21 Feb 2024 16:48:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=141.14.17.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708534097; cv=none; b=a8gE5pVDu/8sD+iUz7ufJjPjXtJ6mrpR5DCgOaUIp++lwFKBE6QQh75vOTs+W97yFxh29xKAhGoneiVeb9kZPVQeOGPXmKUWgRM84FJq4K+NDkkXSJ4EJt4iRbcYI6PS+E4vZRDQ88F3X4zq1GaCrwA7vhjtquXgJnoQkZGds4Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708534097; c=relaxed/simple; bh=EaEg+1b+10YWmcbtQuD0L0OyIozr7NF0uGTsgis6N7Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WIuGIqoRY/3Y38N8yWdSrlAFTF6ovmp2ym4FUkXUdDmtL+Sa5Mb4laYOtI5sRoxp3uWGuMRF7LvJMXOYKtJoYmnRohpdiMDh82t/SkKxAdF8cVRX+ehb01skrM0CGwQ1AgjkTYzmM0IgE2OJXWbXHWHp7ZULBqz7Au+wQBMojWA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de; spf=pass smtp.mailfrom=molgen.mpg.de; arc=none smtp.client-ip=141.14.17.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=molgen.mpg.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=molgen.mpg.de Received: from [141.14.220.34] (g34.guest.molgen.mpg.de [141.14.220.34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 4531661E5FE01; Wed, 21 Feb 2024 17:47:50 +0100 (CET) Message-ID: <6df743f5-d2ae-4d07-ac32-7ed0b89fa77f@molgen.mpg.de> Date: Wed, 21 Feb 2024 17:47:49 +0100 Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] Bluetooth: btintel: Print Firmware Sequencer information Content-Language: en-US To: Kiran K Cc: linux-bluetooth@vger.kernel.org, ravishankar.srivatsa@intel.com, chethan.tumkur.narayan@intel.com References: <20240221133346.3295639-1-kiran.k@intel.com> From: Paul Menzel In-Reply-To: <20240221133346.3295639-1-kiran.k@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Dear Kiran, Thank you for incorperating the feedback. Am 21.02.24 um 14:33 schrieb Kiran K: > Firmware sequencer (FSEQ) is a common code shared across Bluetooth > and Wifi. Printing FSEQ will help to debug if there is any mismatch > between Bluetooth and Wifi FSEQ. > > Signed-off-by: Kiran K > --- > drivers/bluetooth/btintel.c | 114 ++++++++++++++++++++++++++++++++++++ > 1 file changed, 114 insertions(+) > > Kernel log snippet: > > [ 3.643765] Bluetooth: hci0: Fseq status: Success (0x00) > [ 3.643769] Bluetooth: hci0: Fseq executed: 00.00.02.41 > [ 3.643771] Bluetooth: hci0: Fseq BT Top: 00.00.02.41 Next time I think this could go into the proper commit message. > diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c > index e5b043d96207..a083c4b8621c 100644 > --- a/drivers/bluetooth/btintel.c > +++ b/drivers/bluetooth/btintel.c > @@ -2670,6 +2670,119 @@ static void btintel_set_msft_opcode(struct hci_dev *hdev, u8 hw_variant) > } > } > > +static void btintel_print_fseq_info(struct hci_dev *hdev) > +{ > + struct sk_buff *skb; > + u8 *p; > + u32 val; > + const char *str; > + > + skb = __hci_cmd_sync(hdev, 0xfcb3, 0, NULL, HCI_CMD_TIMEOUT); > + if (IS_ERR(skb)) { > + bt_dev_dbg(hdev, "Reading fseq status command failed (%ld)", > + PTR_ERR(skb)); > + return; > + } > + > + if (skb->len < (sizeof(u32) * 16 + 2)) { > + bt_dev_dbg(hdev, "Malformed packet of length %u received", > + skb->len); I would have also printed the value of `sizeof(u32) * 16 + 2`: bt_dev_dbg(hdev, "Malformed packet of length %u received: too short < %u", skb->len, sizeof(u32) * 16 + 2) Kind regards, Paul > + kfree_skb(skb); > + return; > + } > + > + p = skb_pull_data(skb, 1); > + if (*p) { > + bt_dev_dbg(hdev, "Failed to get fseq status (0x%2.2x)", *p); > + kfree_skb(skb); > + return; > + } > + > + p = skb_pull_data(skb, 1); > + switch (*p) { > + case 0: > + str = "Success"; > + break; > + case 1: > + str = "Fatal error"; > + break; > + case 2: > + str = "Semaphore acquire error"; > + break; > + default: > + str = "Unknown error"; > + break; > + } > + > + if (*p) { > + bt_dev_err(hdev, "Fseq status: %s (0x%2.2x)", str, *p); > + kfree_skb(skb); > + return; > + } > + > + bt_dev_info(hdev, "Fseq status: %s (0x%2.2x)", str, *p); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Reason: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Global version: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Installed version: 0x%8.8x", val); > + > + p = skb->data; > + skb_pull_data(skb, 4); > + bt_dev_info(hdev, "Fseq executed: %2.2u.%2.2u.%2.2u.%2.2u", p[0], p[1], > + p[2], p[3]); > + > + p = skb->data; > + skb_pull_data(skb, 4); > + bt_dev_info(hdev, "Fseq BT Top: %2.2u.%2.2u.%2.2u.%2.2u", p[0], p[1], > + p[2], p[3]); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq Top init version: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq Cnvio init version: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq MBX Wifi file version: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq BT version: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq Top reset address: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq MBX timeout: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq MBX ack: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq CNVi id: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq CNVr id: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq Error handle: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq Magic noalive indication: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq OTP version: 0x%8.8x", val); > + > + val = get_unaligned_le32(skb_pull_data(skb, 4)); > + bt_dev_dbg(hdev, "Fseq MBX otp version: 0x%8.8x", val); > + > + kfree_skb(skb); > +} > + > static int btintel_setup_combined(struct hci_dev *hdev) > { > const u8 param[1] = { 0xFF }; > @@ -2902,6 +3015,7 @@ static int btintel_setup_combined(struct hci_dev *hdev) > > err = btintel_bootloader_setup_tlv(hdev, &ver_tlv); > btintel_register_devcoredump_support(hdev); > + btintel_print_fseq_info(hdev); > break; > default: > bt_dev_err(hdev, "Unsupported Intel hw variant (%u)",