From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iGSl7-00071N-Le for ath10k@lists.infradead.org; Fri, 04 Oct 2019 18:57:06 +0000 MIME-Version: 1.0 Date: Fri, 04 Oct 2019 11:56:51 -0700 From: Jeff Johnson Subject: Re: [PATCH 5/5] ath10k: pull_svc_rdy code-style fix In-Reply-To: References: <1569268165-1639-1-git-send-email-pozega.tomislav@gmail.com> <1569268165-1639-5-git-send-email-pozega.tomislav@gmail.com> <87d0fq5kic.fsf@codeaurora.org> Message-ID: <998c7ce60b99865835f619dee86b301b@codeaurora.org> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: base64 Content-Type: text/plain; charset="utf-8"; Format="flowed" Sender: "ath10k" Errors-To: ath10k-bounces+kvalo=adurom.com@lists.infradead.org To: Tom Psyborg Cc: linux-wireless-owner@vger.kernel.org, linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, Kalle Valo T24gMjAxOS0wOS0yNCAwMDo0OSwgVG9tIFBzeWJvcmcgd3JvdGU6Cj4gT24gMjQvMDkvMjAxOSwg S2FsbGUgVmFsbyA8a3ZhbG9AY29kZWF1cm9yYS5vcmc+IHdyb3RlOgo+PiBUb21pc2xhdiBQb8W+ ZWdhIDxwb3plZ2EudG9taXNsYXZAZ21haWwuY29tPiB3cml0ZXM6Cj4+IEFjdHVhbGx5IEkgcHJl ZmVyIHRoZSBvcmlnaW5hbCBzdHlsZSwgc28gdGhhdCB3ZSBmaXJzdCBjaGVjayB0aGUgZGF0YSAK Pj4gaW4KPj4gc2tiIGlzIHZhbGlkIGFuZCBvbmx5IHRoZW4gYXNzaWduIHRoZSBkYXRhIHRvIGV2 Lgo+PiAKPj4gLS0KPj4gS2FsbGUgVmFsbwo+PiAKPiAKPiBJdCBjYW1lIHRvIG15IG1pbmQgdGhh dCB0a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Ig aXMgbmVjZXNzYXJ5IGluIHRoZSBjYXNlIG9mIGEgaG9zdCAKYnVpbHQgd2l0aCB0aGUgY3VycmVu dCBmb3JtYXQgaW50ZXJmYWNpbmcgdG8gYSBmaXJtd2FyZSBidWlsdCB3aXRoIGFuIAplYXJsaWVy IHZlcnNpb24gb2YgdGhlIGZvcm1hdC4gSSdtIG5vdCBzdXJlIHdoeSBhdGgxMGsgaXNuJ3Qgc3Vw cG9ydGluZyAKdGhpcyBzaW5jZSB0aGUgUVRJICJvdXQgb2YgdHJlZSIgZHJpdmVyIChteSBhcmVh IG9mIGZvY3VzKSBoYXMgdGhhdCAKc3VwcG9ydC4KCl9fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fCmF0aDEwayBtYWlsaW5nIGxpc3QKYXRoMTBrQGxpc3RzLmlu ZnJhZGVhZC5vcmcKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9saXN0aW5mby9h dGgxMGsK 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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 4F109C4360C for ; Fri, 4 Oct 2019 18:56:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 291332084D for ; Fri, 4 Oct 2019 18:56:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="lzefUBgE"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="dDQTCFGV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726119AbfJDS4z (ORCPT ); Fri, 4 Oct 2019 14:56:55 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33674 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725775AbfJDS4z (ORCPT ); Fri, 4 Oct 2019 14:56:55 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 01D6560A0A; Fri, 4 Oct 2019 18:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1570215414; bh=HddhwGwkCeWXSrQOE0ffx19+ae4C50NE2JNj4YM9ugg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lzefUBgE0PhGPUibXYpZiTua4u5DLXTFv2LEe5cEXOHvfpmujiljmw57uwXiSXSvj Qc6I/+2rKtzWAVdQhGwJeQNvbGuw/Egt9vxC5sLik5attnuC/WZA/qqUsXCAJOU+/A bjgQ8bpa7jEwZCdFOw2pSh6lPg9OcyNLghB2lOJM= Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 8744760C5F; Fri, 4 Oct 2019 18:56:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1570215411; bh=HddhwGwkCeWXSrQOE0ffx19+ae4C50NE2JNj4YM9ugg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=dDQTCFGVlr5ubij2d+p0i3/3dU/rtNif/w2BzQP88xLgj9tpoC7kn+Mxrz04HXAon BitBHnQAnrEm0zetbeigHu96HoEN3Vqq9HT2Qc+eKWv/4OHiDTiNY0/Ib7FePrVFr/ CVNIsnKtwdDf6fOxvCuthlB9i1VExI/EDpWYEHKo= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 04 Oct 2019 11:56:51 -0700 From: Jeff Johnson To: Tom Psyborg Cc: Kalle Valo , linux-wireless@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless-owner@vger.kernel.org Subject: Re: [PATCH 5/5] ath10k: pull_svc_rdy code-style fix In-Reply-To: References: <1569268165-1639-1-git-send-email-pozega.tomislav@gmail.com> <1569268165-1639-5-git-send-email-pozega.tomislav@gmail.com> <87d0fq5kic.fsf@codeaurora.org> Message-ID: <998c7ce60b99865835f619dee86b301b@codeaurora.org> X-Sender: jjohnson@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2019-09-24 00:49, Tom Psyborg wrote: > On 24/09/2019, Kalle Valo wrote: >> Tomislav Požega writes: >> Actually I prefer the original style, so that we first check the data >> in >> skb is valid and only then assign the data to ev. >> >> -- >> Kalle Valo >> > > It came to my mind that this might be the reason why the current > driver did not give me warning about too short service ready event, > but there was no warning about event length in either case. > I even tested this with compat wireless from 2013. and there the > situation was the opposite: in both cases there was warning about > service ready length. Hmmm, my understanding of the way the TLV WMI is supposed to work is that the individual data structures are extensible, and in the case where a data structure is received with a "short" length the recipient is supposed to zero-extend to the expected length, and then handle the "zeroed" field(s) appropriately. This is supposed to hold for both host=>firmware and firmware=>host. Since the wmi_service_ready_event has been extended over time this behavior is necessary in the case of a host built with the current format interfacing to a firmware built with an earlier version of the format. I'm not sure why ath10k isn't supporting this since the QTI "out of tree" driver (my area of focus) has that support.