From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7EAF8C4363A for ; Wed, 28 Oct 2020 23:43:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 29B82207BC for ; Wed, 28 Oct 2020 23:43:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="qOecoB3J" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731512AbgJ1Xm7 (ORCPT ); Wed, 28 Oct 2020 19:42:59 -0400 Received: from m42-4.mailgun.net ([69.72.42.4]:51356 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730722AbgJ1Xm4 (ORCPT ); Wed, 28 Oct 2020 19:42:56 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1603928574; h=Content-Transfer-Encoding: Content-Type: MIME-Version: Message-ID: Date: Subject: In-Reply-To: References: Cc: To: From: Sender; bh=TLNILGHQAl2E5V/J/ptFn/qNwBV4itMmQCkPbQrryS4=; b=qOecoB3JvaXN+v9CcckIdal3jLkEwTmT+F1K2xwPredGGEfGhfenxFjwUAnLAbum/mjEHd8t /Lt/ypvQeKes1tyudqmi1KLnRjpOMU7RQXPxBtSVdOPPGOPBUxO2C6TE09UKdG1SleZaJydS o582FM8GKBUk/GYzB4wnEpZ6ro4= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n05.prod.us-east-1.postgun.com with SMTP id 5f99928e38c6e40045981845 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 28 Oct 2020 15:47:26 GMT Sender: pillair=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 296D3C433FE; Wed, 28 Oct 2020 15:47:26 +0000 (UTC) Received: from Pillair (unknown [49.205.247.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: pillair) by smtp.codeaurora.org (Postfix) with ESMTPSA id 5DAD4C433CB; Wed, 28 Oct 2020 15:47:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 5DAD4C433CB Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=pillair@codeaurora.org From: "Rakesh Pillai" To: "'Doug Anderson'" Cc: "'ath10k'" , "'linux-wireless'" , "'LKML'" , "'Abhishek Kumar'" , "'Brian Norris'" References: <1603811067-23058-1-git-send-email-pillair@codeaurora.org> In-Reply-To: Subject: RE: [PATCH] ath10k: Fix the parsing error in service available event Date: Wed, 28 Oct 2020 21:17:19 +0530 Message-ID: <003801d6ad41$a1bb8970$e5329c50$@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJiqwpvoy2iSO2kR0YP6ePedJFSmQFbRrV/qIpSBRA= Content-Language: en-us Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Doug Anderson > Sent: Wednesday, October 28, 2020 8:07 PM > To: Rakesh Pillai > Cc: ath10k ; linux-wireless wireless@vger.kernel.org>; LKML ; = Abhishek > Kumar ; Brian Norris > Subject: Re: [PATCH] ath10k: Fix the parsing error in service = available event >=20 > Hi, >=20 > On Tue, Oct 27, 2020 at 8:20 AM Rakesh Pillai > wrote: > > > > The wmi service available event has been > > extended to contain extra 128 bit for new services > > to be indicated by firmware. > > > > Currently the presence of any optional TLVs in > > the wmi service available event leads to a parsing > > error with the below error message: > > ath10k_snoc 18800000.wifi: failed to parse svc_avail tlv: -71 > > > > The wmi service available event parsing should > > not return error for the newly added optional TLV. > > Fix this parsing for service available event message. > > > > Tested-on: WCN3990 hw1.0 SNOC > > > > Signed-off-by: Rakesh Pillai > > --- > > drivers/net/wireless/ath/ath10k/wmi-tlv.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c > b/drivers/net/wireless/ath/ath10k/wmi-tlv.c > > index 932266d..3b49e29 100644 > > --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c > > +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c > > @@ -1404,9 +1404,12 @@ static int = ath10k_wmi_tlv_svc_avail_parse(struct > ath10k *ar, u16 tag, u16 len, > > arg->service_map_ext_len =3D *(__le32 *)ptr; > > arg->service_map_ext =3D ptr + sizeof(__le32); > > return 0; > > + case WMI_TLV_TAG_FIRST_ARRAY_ENUM: > > + return 0; >=20 > This is at least slightly worrying to me. If I were calling this > function, I'd expect that if I didn't get back an error that at least > "arg->service_map_ext_len" was filled in. Seems like you should do: >=20 > case WMI_TLV_TAG_FIRST_ARRAY_ENUM: > arg->service_map_ext_len =3D 0; > arg->service_map_ext =3D NULL; > return 0; >=20 > ...and maybe add a comment about why you're doing that? >=20 > At the moment things are working OK because > ath10k_wmi_event_service_available() happens to init the structure to > 0 before calling with: >=20 > struct wmi_svc_avail_ev_arg arg =3D {}; >=20 > ....but it doesn't seem like a great idea to rely on that. >=20 > That all being said, I'm just a drive-by reviewer and if everyone else > likes it the way it is, feel free to ignore my comments. Hi Doug, The TLV TAG " WMI_TLV_TAG_STRUCT_SERVICE_AVAILABLE_EVENT" is the first = and a mandatory TLV in the service available event. The subsequent TLVs are optional ones and may or may not be present = (based on FW versions). This patch just fixes the bug, where the presence of any other TLVs are = leading to a failure in parsing the service available msg. If, in future, we plan to use any other services from firmware, which is = exposed in the extended TLVs, we will need to add a new variable (and = not service_map_ext) to set the service. >=20 > -Doug