Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp452172imm; Thu, 5 Jul 2018 03:16:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe6kX9dJRsXWpb6+gdNNCxFywyWecbVjgu2/D3sOsnWVH65qnEBD55/qCZBLtu0BGK9GoRT X-Received: by 2002:a65:47cc:: with SMTP id f12-v6mr5011575pgs.173.1530785770953; Thu, 05 Jul 2018 03:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530785770; cv=none; d=google.com; s=arc-20160816; b=k9T8ip/nDJQZjZw0XY6yW1CKMhDWKy1l/MYiyly/ouamlp7Gm5qWUkcQVy/VgOiglf PUIL+XU5UhsJoamwmnDT2Fr5QfiVrT8xEnu8g12ekvwhV8Ue8nna3S+JmASsOD0dIBZh zSgxyL+hzsUyi3b55m2KHYkRgTTV9icxRMP5GQzEWqPomkicWM4xqmrO4cIZ396n20zr dQifXrVGPFg5KW945bv5rVoLh9K4cu1Ei/+iZV2gPNRLZ5R7mJLyNil1LRlLiPF2msXs GXSQJDyocGJb6s+SmDXbvIvq0s1lZpb2y6nrVqpHNxOJJ1Y83pknuOC8jIsGoTGFng0r 5jDg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature:arc-authentication-results; bh=/kZdBB4/VOWEeFPHyuegybUK1a/HOVsXXuPy8kvgRrk=; b=bPNOw/JlcKJwlQfvA0GQBW+zwLijpIj2qnq5QnkW444T7OzKCqFPCVnjv1fefLGYYe U9460J862N4dGbWWANMCiMLB2kD1Usz9UCDXyEMUaATffOWGhDnSNNG4z4jJ1jb/T7Fs wrJfFnSLz6OfpDbaaR01oILSFW6zsmSwpuBxxqC8SBISleLRzPY0MkfhrPT8TvshPifJ 64Q7aDwBe4ZGrlJ1QXexxgi+uPGWQZxlEiSbZxHcwW8DVvt8mlYWf3jl2IWbOCECGiaH Pm2dgfl9fPbtmWrFI45rrpdg9E3pjSOgVfpjP/e3LEi6XlKSZL/dy7BZ7d3m9H3TvE9H poHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kGC821IZ; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 64-v6si2504759plk.359.2018.07.05.03.15.56; Thu, 05 Jul 2018 03:16:10 -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=@chromium.org header.s=google header.b=kGC821IZ; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753750AbeGEKOe (ORCPT + 99 others); Thu, 5 Jul 2018 06:14:34 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:39134 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbeGEKOc (ORCPT ); Thu, 5 Jul 2018 06:14:32 -0400 Received: by mail-yb0-f194.google.com with SMTP id k127-v6so3002848ybk.6 for ; Thu, 05 Jul 2018 03:14:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=/kZdBB4/VOWEeFPHyuegybUK1a/HOVsXXuPy8kvgRrk=; b=kGC821IZRWLBviHJaAKEMmYN/QmY2s1ZA2pKXcs3zKOyTa03cFI2pOX6gndb+GDu3T hbqiyzd4GH8chNY7fsnnv2fXvfUWf7rU3m92wqNv7ZY98QN5JM121rEX9zZW+/x2VhDz 8D0u7yHZ/VPn4mtOCZdskz//g+4AsI/bIaSNE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=/kZdBB4/VOWEeFPHyuegybUK1a/HOVsXXuPy8kvgRrk=; b=SEgTEU8HnfPsj1P9YTPIjPIVCU5eSaqfTaHpDlXe99O3yDrP4rTLbwooLqFBBzyjHz AjygmpGVZaDgE+ckkyzw5BuVTM5EmM26QxKudJjuHnDyj+Cu0MN+aR+yX2jR86XSP3g6 xipzLkBFhYiLkzCD14YaK8U6gO0nTtgPL31eNOM+ZdTbpT0b8kzxeo5U1YXT1k6X29lu 9o3H9WsfE0GN8tH3l/IpH4+8gCsqmhLOCVd/M8Wb6X/DaWhKCdanIYkqk5yOSPNj0lgS Iu6zDsCDmOfM/FX+d/6SYJSTCZlKFdQs0LvgzBpmw36JXiszVi/BpBQhxtlAL1j81N5V 7GuA== X-Gm-Message-State: APt69E0OqrKO0MoLPsdlJ0CIUA2/f7WIOpedasT1LRp7O8HiBoRw2U25 uzg05uZAHBMumFXiOlmMppEfmKJwoEI= X-Received: by 2002:a25:c381:: with SMTP id t123-v6mr540177ybf.517.1530785671383; Thu, 05 Jul 2018 03:14:31 -0700 (PDT) Received: from mail-yb0-f170.google.com (mail-yb0-f170.google.com. [209.85.213.170]) by smtp.gmail.com with ESMTPSA id q184-v6sm2163215ywd.78.2018.07.05.03.14.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jul 2018 03:14:30 -0700 (PDT) Received: by mail-yb0-f170.google.com with SMTP id h127-v6so3000077ybg.12 for ; Thu, 05 Jul 2018 03:14:30 -0700 (PDT) X-Received: by 2002:a25:2084:: with SMTP id g126-v6mr1129185ybg.405.1530785669571; Thu, 05 Jul 2018 03:14:29 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: From: Tomasz Figa Date: Thu, 5 Jul 2018 19:14:18 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 12/29] venus: add common capability parser To: Stanimir Varbanov Cc: Mauro Carvalho Chehab , Hans Verkuil , Linux Media Mailing List , Linux Kernel Mailing List , linux-arm-msm , vgarodia@codeaurora.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 5, 2018 at 6:45 PM Stanimir Varbanov wrote: > > 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 wrot= e: > >>>> > >>>> 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=E2=80=99t we increment |word| by= |1 + |data > >>>>>> size||? > >>>>> > >>>>> yes, that could be possible but the firmware packets are with varia= ble > >>>>> 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 i= s not > >>>>> optimal but this enumeration is happen only once during driver prob= e. > >>>>> > >>>> > >>>> 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 a= nd > >> 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? Fair enough. Generally with the design of those metadata, fixing this problem seems to be quite non-trivial. Let's keep it as is for now. Best regards, Tomasz