Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp426483imm; Thu, 5 Jul 2018 02:46:29 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfoTymkyGxvF9esBrrCIn75szJ153YSusr61YyHeyIsntd+A3WgPlA5nQwLBbA49JVro8vH X-Received: by 2002:a17:902:bb8a:: with SMTP id m10-v6mr5439104pls.236.1530783989081; Thu, 05 Jul 2018 02:46:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530783989; cv=none; d=google.com; s=arc-20160816; b=Omh9/MtpXS62LQtcOt/cxA+L85aFjhLBJI7yT3NsH3TsA6N1KHP5lldhfBy7wZV1oy /rZBBt82nQdxoQnAFp3q+gTIXByq/egCqrESYMJK2gfTwxG4Szv0mQ8iLx0+wYjACPOI 1CmhvWNUPOaX3EN/RKXAYaAjXSJOHh23qwziE9Y+51Bd/34Scb04K+PncQueHGUU14pG ZMI3zNdVU2O3byhqbG2v/qwTQL7p7HIoe6i453lrxFHnLYGO8zwVdxdqqSQ3XqO6N1/j F0qqzWeHkqeZmQEMnK5YbuorMBZIps3v2h+vf4P81G9frUSxENywMwwipEcHAdPMprpR GaLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=HrOnZ6dUQ44LCF0hC3YxX2LKAVDgIrj2wX9NSksDJvI=; b=t9I8moCE78PFNcMGFDHbZQjQj8DtvzLh6X58XasoMjAksv65dhhRNQlD3IznyjTCLR ysjydBEQXMRL747M6UmOuGl3pVNZjY0bRiN2o+zmEHKLW7F0B2/kgWYJ86qXe6QZTRuw 2HhgIOp4ckWrTECtq2XsgyX7pCsxUZ30C/GghusNQ6vSCIUEYXYXuPa1gdna9r/9pBVe gHm/bd/ZUsmFAQtVylmOgiK8nJsY/DDPSzHCMXnV3uXfxnQCzuTQ7zBQTg4b/VZK/28M ThmphJ2IyB9g3i2pv5BwfKDgU/jcWEL3omPeivMFh6oImD85V6vHMkZaDxET/PpYax44 x29g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMga1AwV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s73-v6si5756225pfs.157.2018.07.05.02.46.14; Thu, 05 Jul 2018 02:46:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMga1AwV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753432AbeGEJp0 (ORCPT + 99 others); Thu, 5 Jul 2018 05:45:26 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:55880 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753249AbeGEJpY (ORCPT ); Thu, 5 Jul 2018 05:45:24 -0400 Received: by mail-wm0-f65.google.com with SMTP id v16-v6so10024529wmv.5 for ; Thu, 05 Jul 2018 02:45:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=HrOnZ6dUQ44LCF0hC3YxX2LKAVDgIrj2wX9NSksDJvI=; b=iMga1AwVrcK9O0wPkqdUV6TgIWEXD2F+MVX1tmdCOOYf6oFr8XopyoW0I3ftg3vExR Lwn/ws0n4BabgmFfeD8SEDHtNVg9FEAtmgc5ozVRza/sIHeLPz3nPUjVzsiGYrUtMJb9 6RGFHTDUoWqB06tHO1v4cxHlC78myWZNdWsnk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=HrOnZ6dUQ44LCF0hC3YxX2LKAVDgIrj2wX9NSksDJvI=; b=fPxPFrZpT/vZfEP2tvgj2Z9uL22XJk26BYwmraOUn8lyNjqgOZgzxaNkBEGHB3LqWZ RDpMvTtbK2RT0K32gcM4r+oUMdHcK2c2sI9Yf5kpIElJMAQ2SkjmJ/mQpgOa8tZBWS6a 9RtepDw6+TBII67aUzMJrwqvcddr3HshWDtN7LbG0rOq83NwJbVxez4w93OBoIMB/mIO t/bXt/1i4+UuRe3kpCZDV8GJfhvSilr9t2AJLgNwOvHsSAuTj7LjS58F8ifcM+HE+5mX 1nyueEppnyzgjdaHPYdCU75tFePygLvYpGtOqmz3rw9LmUB5XhaKtwbGTy34dS6Qh8y5 elQQ== X-Gm-Message-State: APt69E3FtrT4GguoHClzNZ5cCw1dvzf1FKOuXGRvdUQkmEjfxk0cJngn vO4sciOfaMVbMxqJjUaaQxu1XA== X-Received: by 2002:adf:bc03:: with SMTP id s3-v6mr4273008wrg.211.1530783923489; Thu, 05 Jul 2018 02:45:23 -0700 (PDT) Received: from [192.168.27.209] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id e3-v6sm10649685wmd.2.2018.07.05.02.45.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 02:45:22 -0700 (PDT) Subject: Re: [PATCH v2 12/29] venus: add common capability parser To: Tomasz Figa Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org References: <20180515075859.17217-1-stanimir.varbanov@linaro.org> <20180515075859.17217-13-stanimir.varbanov@linaro.org> <13c7aec1-2bb9-f449-6b7d-7ec93be4ec71@linaro.org> <30d141b6-dffa-bf6a-dae8-79595c966a23@linaro.org> From: Stanimir Varbanov Message-ID: Date: Thu, 5 Jul 2018 12:45:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On 07/02/2018 01:05 PM, Tomasz Figa wrote: > On Mon, Jul 2, 2018 at 6:59 PM Stanimir Varbanov > wrote: >> >> Hi Tomasz, >> >> On 07/02/2018 12:23 PM, Tomasz Figa wrote: >>> On Thu, May 31, 2018 at 4:06 PM Tomasz Figa wrote: >>>> >>>> On Thu, May 31, 2018 at 1:21 AM Stanimir Varbanov >>>> wrote: >>>>> >>>>> Hi Tomasz, >>>>> >>>>> On 05/24/2018 05:16 PM, Tomasz Figa wrote: >>>>>> Hi Stanimir, >>>>>> >>>>>> On Tue, May 15, 2018 at 5:08 PM Stanimir Varbanov < >>> [snip] >>>>>> >>>>>>> + break; >>>>>>> + } >>>>>>> + >>>>>>> + word++; >>>>>>> + words_count--; >>>>>> >>>>>> If data is at |word + 1|, shouldn’t we increment |word| by |1 + |data >>>>>> size||? >>>>> >>>>> yes, that could be possible but the firmware packets are with variable >>>>> data length and don't want to make the code so complex. >>>>> >>>>> The idea is to search for HFI_PROPERTY_PARAM* key numbers. Yes it is not >>>>> optimal but this enumeration is happen only once during driver probe. >>>>> >>>> >>>> Hmm, do we have a guarantee that we will never find a value that >>>> matches HFI_PROPERTY_PARAM*, but would be actually just some data >>>> inside the payload? >>> >>> Ping? >> >> OK, you are right there is guarantee that we not mixing keywords and > > Did the auto-correction engine in my head got this correctly as "no > guarantee"? :) > >> data. I can make parse_* functions to return how words they consumed and >> increment 'word' pointer with consumed words. > > Yes, that or maybe just returning the pointer to the first word after > consumed data. Most of the looping functions already seem to have this > value, so it would have to be just returned. (vs having to subtract > from the start pointer) I made the relevant changes to satisfy you request but the results were fine for Venus v3 and wrong on v1. So I'd propose to postpone this change and fix it with follow up patches because I don't want miss the next merge window. So far the supported venus firmware versions are fine with the current parser implementation. What you think? -- regards, Stan