Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp1108815rdb; Sat, 18 Nov 2023 03:36:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IHufhVlNHDzrAjb2pricSYd8tlOUuuTShyOU+23MR010ontW7X8O6lxjZlvxDZz1iMXHWTN X-Received: by 2002:a17:902:c394:b0:1cc:3932:4a87 with SMTP id g20-20020a170902c39400b001cc39324a87mr2001118plg.56.1700307393261; Sat, 18 Nov 2023 03:36:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700307393; cv=none; d=google.com; s=arc-20160816; b=pyDUOKH8m9P8DTdQrjyQFa8hYPdDrVkKabSfnVVPjok+dKIBTmYWL3EjtUdF6EJvyk SHnXy6N9pjpKJKjZERQrCfsCuNJXWUTapvow8WeZfKMer/G1QcFgTRDSAkPcCs1EK5xi wHaB5h+VYnTW/46yGpAvx5zKnlR78MfIH+j/pgXt67IJ3Uq9ZebdV9QtAUjq5w7usbhD 1iWevajoiCO6ZzEpBjxqbz+3uqZ8Z5XtSxT5M3TKE59Bvpf4CZbnqcrYR70ioCJP4lJ9 FQw4e1xbaKZ1Jd49ohGl5TdKN6fyeA0cRc3PKMUMyuzWP4+LvUzpMlfV2hC/na0Y+hCP q/3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=44TB2Q4xVBrawfbtki6oGL++4vEDUXWgPnAMX9eIRIg=; fh=uDD1y7bDoG68mimeqFC7o1eTaEtPwl40wpR+yEHG40s=; b=I/Mc9V72XKAPzcSJXCeu/fQLO6tmX9XDh6yED+QjM5TWYz7iYLyvmvsjX2o+wNjjus 12TZGouVftwKA/p77rJVvPXYlowh0d1ggKL2D5k7TFOKi5j4pSSxfOimej1Qft4su/9G 6UJMeFmtaE7sWF022I3FbnKT7Mfx2NclKo8iDNGL3PfT7Uew6cIYVKFrwald5beQhwva KoRDMufVyCfasnnaC+IumBEvPHZi9TKMZ1XBArYwWl5YxBCoLrhbpYOzdZDiKhcZFLTX tB93PEm3rqoxrONbJEqEtT4IysLeUIuzuQ0bpbMU+UR54XQG6Rk6+3UEkIu5h0ySZhHs 07rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jusyyr7h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id h1-20020a170902748100b001cc7c079304si4052199pll.97.2023.11.18.03.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Nov 2023 03:36:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Jusyyr7h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 63E4E809C1AA; Sat, 18 Nov 2023 03:35:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbjKRLfk (ORCPT + 99 others); Sat, 18 Nov 2023 06:35:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjKRLfi (ORCPT ); Sat, 18 Nov 2023 06:35:38 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 014FC10D0 for ; Sat, 18 Nov 2023 03:35:33 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-4079ed65582so2346015e9.1 for ; Sat, 18 Nov 2023 03:35:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700307332; x=1700912132; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=44TB2Q4xVBrawfbtki6oGL++4vEDUXWgPnAMX9eIRIg=; b=Jusyyr7hwHGPh9Eo1RMQt6rniM3X+ZgjMxeHleJ6HktP5HCmHw282YIBd09Kef7z65 eGqjPT0ILbew6vUEuZ6MVLeyIYqJ9ndnLWz7fik4TV+0X6wpGiYeOIeRJD2JuE/63FNT QDVpgODvagQP3xe+SNltqWIgiTfeMza9bJA/KkvK5ej4S//KonOhddrWj7sg+/vobVce i/pKRQZ26ZlJvg7hWwoP3XY2+5FdQtXl1dN8/p1oBMT/LecgH4wrOE0K+ZiEBjbzjefZ J7fJq46LLTyJMku0U9olkjgA7KrB4+6QdKm+xX37gDDEqcohLiOAvckndUTqe92V1hdN MMOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700307332; x=1700912132; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=44TB2Q4xVBrawfbtki6oGL++4vEDUXWgPnAMX9eIRIg=; b=sxrwwYb5+MwPB0fISonbKHQ+wW+y702TFCsLs96xcHynXvA7pFZMUwQVfdWDzuEZmA 6DdMhJb9SvwfvBl7QmRYD4Pzhc6feCTHRM/gFJqZc84s3swC2eU9D8WGs968rreZotYp Qhr3GiITt1su0YBxT2p2XsHrbiWsqSZ5DBmECm/IKbBFTPItw6h+F3RNh9O+UWc9lwV2 zWYtvScXTp7h1JDOn2O6gLkIi+qZuLTGkGXaEs+qwup8/VUkUbgJqNylnw/DeoIsRTRG 1JccI06RgQfAYxrd31z+dnunMFCuBHbOsW1CJXHoGF1xUP+syxSio8bTQQzVW3YNZkcR 26eA== X-Gm-Message-State: AOJu0Yw+H0O7LG9v0l8qkmvtVK5KzNgtFHcmz+kyyYAnIzcahopJBfzM BCEVKqXvSTVJejzwFSUTPqgFOA== X-Received: by 2002:a05:600c:5487:b0:40a:43eb:b752 with SMTP id iv7-20020a05600c548700b0040a43ebb752mr1805937wmb.34.1700307332257; Sat, 18 Nov 2023 03:35:32 -0800 (PST) Received: from [192.168.100.102] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id t4-20020a5d4604000000b0032fbd0c7d04sm5101992wrq.55.2023.11.18.03.35.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 18 Nov 2023 03:35:31 -0800 (PST) Message-ID: <57c9b7e8-bb0e-4d31-adeb-19a83137c082@linaro.org> Date: Sat, 18 Nov 2023 11:35:30 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 4/7] media: qcom: camss: Move VFE power-domain specifics into vfe.c Content-Language: en-US To: Konrad Dybcio , hverkuil-cisco@xs4all.nl, laurent.pinchart@ideasonboard.com, Robert Foss , Todor Tomov , Andy Gross , Bjorn Andersson , Mauro Carvalho Chehab , matti.lehtimaki@gmail.com, quic_grosikop@quicinc.com Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231103-b4-camss-named-power-domains-v4-0-33a905359dbc@linaro.org> <20231103-b4-camss-named-power-domains-v4-4-33a905359dbc@linaro.org> <0fbef967-62db-4c5f-8108-2c545c53a39e@linaro.org> From: Bryan O'Donoghue In-Reply-To: <0fbef967-62db-4c5f-8108-2c545c53a39e@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Sat, 18 Nov 2023 03:35:51 -0800 (PST) On 18/11/2023 00:32, Konrad Dybcio wrote: >> + /* count the # of VFEs which have flagged power-domain */ > [...] > > Personal peeve, but this comment seems a bit excessive Well, to me this code "does stuff" that isn't terribly obvious. It took a while to understand the Gordian knot so its worthwhile documenting it inline until we can use named pds to make it all go away forever. > >> + for (vfepd_num = i = 0; i < camss->vfe_total_num; i++) { >> + if (res->vfe_res[i].has_pd) >> + vfepd_num++; >> + } >> >> - camss->genpd_link = devm_kmalloc_array(dev, camss->genpd_num, >> - sizeof(*camss->genpd_link), >> - GFP_KERNEL); >> - if (!camss->genpd_link) >> - return -ENOMEM; >> + /* >> + * If the number of power-domains is greater than the number of VFEs >> + * then the additional power-domain is for the entire CAMSS block the >> + * 'top' power-domain. > the last 3 words seem out of place > >> + */ >> + if (camss->genpd_num <= vfepd_num) >> + return 0; > if (!(camss->genpd_num > vfepd_num)) > > would probably be easier to follow given your comment above Sure, if its easier to read/understand for you, then it is probably so for others. I will V5 this. --- bod