Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1120379ybb; Wed, 8 Apr 2020 17:11:31 -0700 (PDT) X-Google-Smtp-Source: APiQypJAPYt48sdL1FFhjbh5SfMHD+pzhbZfjKymMtkbcl6UONG1QOijolzs3YkTcRF6HfTPTk2m X-Received: by 2002:aca:7213:: with SMTP id p19mr4659415oic.159.1586391091805; Wed, 08 Apr 2020 17:11:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586391091; cv=none; d=google.com; s=arc-20160816; b=v5bm+Dck8Wa46rTJXj3KfGzWF+Ika7QvzlGfwbd9xTOtWGLpxkAyPwGA9lTOZVG2n3 Jtt4bhVNbRyenFco/dKWqkKHoyNXHkgV8WLeNef3jyy5Qw9+To/i8Ic6+aJJMIF8QM91 /fGRcjSE0MhSEIf9tJPHmZw7II7Nr854bo3Vz/qvZERQ+YoUvuovkBbjgHGN6Sdn9rfo Cgoum2NaCH1W7iO+OoIrm+iD1bNMoy0CaO6z/+WKevW1t+IGxQkYIEpv0i4EvYY1+gk2 cJ3O+ocShLK4gWu0KZyMSCystxvNfT4VJki6XCGEQDweBp0E0G6Ld81vNDnq8y/Lb0B7 5zNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=B6pS9OgAcPsD6CSPKpIIvHEG5zqVSzQLTTYkVt8jyck=; b=GLqmzgUbZhAT7Y3l9kp8sV3Jk7RPJWPIspV24WgakdWseVbCkps9zKAtoaJrzc5IH7 SU0cS8DMZAZXlNPcCTo04FHfKnkrF9CMJWp7G7hp6EJ0mrWTtCGCNr2KZYUz/Hb6UMKm EGL/mgfCFWghwU6ls6oeseFsDD96+ajFcO8gAqOsaWo7kCF4kmU2IKlQveGmG/cSrBlU wqyzCakSqm1h/E2F4v9nBNgRRjq9NMKGJIbMLpZnx+CBSxeCyqkhK1BXbtcGA7BVSgpS Q6WwJeNNrGmiB1l+aiBFb3mGUSJARX0gYREIyiu7YNMoRpw1VTEMKvi+Q3pr7Vn0T+FS C73g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QzNPLo5R; 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 e193si2567332oib.276.2020.04.08.17.11.15; Wed, 08 Apr 2020 17:11:31 -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=QzNPLo5R; 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 S1726549AbgDIAKP (ORCPT + 99 others); Wed, 8 Apr 2020 20:10:15 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:36388 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726530AbgDIAKP (ORCPT ); Wed, 8 Apr 2020 20:10:15 -0400 Received: by mail-vs1-f65.google.com with SMTP id 184so5898342vsu.3 for ; Wed, 08 Apr 2020 17:10:15 -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; bh=B6pS9OgAcPsD6CSPKpIIvHEG5zqVSzQLTTYkVt8jyck=; b=QzNPLo5RL3lO4TmcYcF4V23HmCtH6zvc/crCSse2osUeXKghPrIz35H3jROp57Pjgn bNzydnCYuDad7TyqCSU8b4kqNffY3kKjr7V85Po1uBZTiSt9EqlzUwi3Ra7nIr2/HtKy U+Y0d1OkSTzwAv2urvP556j42eGzCmag+ojsI= 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; bh=B6pS9OgAcPsD6CSPKpIIvHEG5zqVSzQLTTYkVt8jyck=; b=N/A8s9VaJscnH0N41TkmoA7+wNfL0iPGaUeq0HfsPxqLq176d5L3whWx2bXtB8/aSP Og8chIUmJq8s/2HCx4wejHRyTHVBb+uGvVIjwDNQ0cM/RScq4avs8/CM/4KXq95AgsgF 3aCh/VaedSAMZBZ6aSzL5RKVZy6JDpzzN/brUW/urmrCGXvnkeniz2BEtYuL5LFiU3MA o65QZNqgLasIlIPv4GR1M/4Q+Nu8YjtFHRYtBymilCz+leJwqlIUMr5+bXPSwwvqSDuB ElDesCLHXsZ2hzYquugnk2tt0xyub965BVEzk/uq5wjTpBn5HUyEDRyD69C7fWFQ6W6i 6LnQ== X-Gm-Message-State: AGi0PuYbd52bUr7DK4yJOTANAcRX2v+guCyc3BDsm/o17ec09wzFaEFe T5wTg3rnnnZtZTTLGxfVKlNxxQYX0Vc= X-Received: by 2002:a67:320f:: with SMTP id y15mr8798396vsy.157.1586391014611; Wed, 08 Apr 2020 17:10:14 -0700 (PDT) Received: from mail-ua1-f49.google.com (mail-ua1-f49.google.com. [209.85.222.49]) by smtp.gmail.com with ESMTPSA id d83sm6829264vka.34.2020.04.08.17.10.12 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Apr 2020 17:10:13 -0700 (PDT) Received: by mail-ua1-f49.google.com with SMTP id g24so3327813uan.10 for ; Wed, 08 Apr 2020 17:10:12 -0700 (PDT) X-Received: by 2002:ab0:2389:: with SMTP id b9mr7355490uan.120.1586391012513; Wed, 08 Apr 2020 17:10:12 -0700 (PDT) MIME-Version: 1.0 References: <20200407235024.260460-1-dianders@chromium.org> <20200407164915.v3.8.I8e187cdfb7a31f5bb7724f1f937f2862ee464a35@changeid> In-Reply-To: From: Doug Anderson Date: Wed, 8 Apr 2020 17:10:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 08/10] drivers: qcom: rpmh-rsc: Don't double-check rpmh To: Maulik Shah Cc: Andy Gross , Bjorn Andersson , Matthias Kaehlcke , Lina Iyer , Rajendra Nayak , Stephen Boyd , Evan Green , linux-arm-msm , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Apr 8, 2020 at 5:24 AM Maulik Shah wrote: > > Hi, > > In rpmh.c, rpmh_write_async() and rpmh_write_batch() uses > __fill_rpmh_msg() which already checks for below payload conditions. > > so i am ok to remove duplicate checks from rpmh-rsc.c > > can you please add payload at the end of subject. > > drivers: qcom: rpmh-rsc: Don't double-check rpmh payload > > Other than this. > > Reviewed-by: Maulik Shah > Tested-by: Maulik Shah Thanks! Bjorn / Andy: if you want me to spin my series I'm happy to. I'm also happy to just let you fix this nit in the commit message and the other one Maulik had when applying. Just let me know. > Note: > > rpmh_write() is not using __fill_rpmh_msg() and have replica as below, > probably since it was declares message on stack instead of using malloc() > > if (!cmd || !n || n > MAX_RPMH_PAYLOAD) > return -EINVAL; > > memcpy(rpm_msg.cmd, cmd, n * sizeof(*cmd)); > rpm_msg.msg.num_cmds = n; > > Making a note to remove above if check and start using __fill_rpmh_msg() > here as well to do memcpy() and num_cmds initilization. > > Although it may end up writing msg.state and msg.cmd twice (once during > defining msg on stack and then during fill rpmh msg) but it should be ok. > > Below two lines from __rpmh_write() can be removed as well. > > rpm_msg->msg.state = state; > > DEFINE_RPMH_MSG_ONSTACK() and __fill_rpmh_msg() seems taking care of > initializing msg.state already, so we should be good. > > if you are spinning a new version and want to include above change as > well, i am ok. > > if not, i can push separate patch to update this as well once my series > to invoke rpmh_flush() gets picked up. I'd sorta be inclined to wait and do this later just because it seems like we've got enough changes stacked together right now... -Doug