Received: by 2002:a05:7412:b130:b0:e2:908c:2ebd with SMTP id az48csp891957rdb; Fri, 17 Nov 2023 16:33:08 -0800 (PST) X-Google-Smtp-Source: AGHT+IHl0z/QDPpygVxiL7cV6C6nQJ0LB1wZ8vdNHNO41yA26mmnjHsIY5eC/YCCpgzxnaeeAZAw X-Received: by 2002:a05:6a20:3ca4:b0:17e:70fa:3f3c with SMTP id b36-20020a056a203ca400b0017e70fa3f3cmr984322pzj.57.1700267588354; Fri, 17 Nov 2023 16:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700267588; cv=none; d=google.com; s=arc-20160816; b=WFrW8ICc0OrvPwM7qmQeIZTYZWCAdwkkK/DQrcFgmTuMdzWuQLv1LqAhr0NauXxi/+ 30wR+NP+YUmCi0zmCQxiy6iJyh4yqMNHid/Fx0P6XWR1xH3kixcxjW5rmk8oM+ypiuvX iPgQ26T2s3+7Qc84K9ytIuDr52QJ8gK++ghJr/bNztrG3Z5ilj/lzLf2vyph9jwbsqhz 4zZvI0ymysjsrCnru+PIZ47ZH9qQSzTDyt/jhxey6YGczxPPDWLqn7kDDhvAZRROAgbj NTkw0MjJ8N8YHC3TuL3Yx/ZRmNrGGZllTUdsrErorEyf6nOrJsZus510P7aTWRnzP4lL +ClQ== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=ACuE1Cjpg+/+S3TvL8RQf3mAriRh2LNm7WasFktjKbM=; fh=FOwmIRuy7LSfW1ynNtnPg7u/Pv+Nz7Y4K/4oivuV384=; b=cXWdDFsdAs1AYlE5d5SP+RsUpOk+kOtliANNcOQAAGSm6NY7zejDq0RndWFmzDIdHx Tw50T45GjrQtT/pawEF0lPV0MTCNJsxM6NNdaMkBoRaA4Z8bYRQ1np4sPeB0gEoSxK3z nFElRRzzIFn3kLBi7kVRSwcgbvB21V77DdQZYvzmbozgKiBgHtYSCTaN7FW9CxAFMZUE mZ5YgY4Nb8K9LoOHqfB39lwP4vEyWn6L+3bRdaiCFlHiOgTPzg0p4QiTfGXPfw+Ulmtc NXkkMHG6jnRQfjsDIjr+/lov/JJGuHwDtPFcRCtE/+ScmCax/q/qGmP4i4aroP7kJ3dc i8eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lYqCknMv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h10-20020a056a00230a00b006b91e0fc586si3265410pfh.66.2023.11.17.16.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 16:33:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lYqCknMv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 8A5DB8329A23; Fri, 17 Nov 2023 16:32:59 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346385AbjKRAco (ORCPT + 99 others); Fri, 17 Nov 2023 19:32:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346368AbjKRAcj (ORCPT ); Fri, 17 Nov 2023 19:32:39 -0500 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7AE1D7E for ; Fri, 17 Nov 2023 16:32:35 -0800 (PST) Received: by mail-ed1-x530.google.com with SMTP id 4fb4d7f45d1cf-54864b675b2so628038a12.2 for ; Fri, 17 Nov 2023 16:32:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700267554; x=1700872354; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ACuE1Cjpg+/+S3TvL8RQf3mAriRh2LNm7WasFktjKbM=; b=lYqCknMvnM8+KV58ELIXQtx4h3aqdNuogmXFOwmrayV9kKnVc1P2WB8/sIkyXIYHdF wAOj5luskMzTNGGbNRLw3AS8QR+uJJHsnjrPdlw6iHfgsCc6t48L2GOuiSZHTNlxHRJM 7iYgn7h87DllvW/7CXTg2JXT+jX/S2Ux6xreQSGeGLcuEbo0DZQ78u0VKapTy0rxN7uV ZmnTITe6dwFbeCS09EK5S6uhLPMG1/xtGfTR9Myt9WEvrVpg0NGmyQ4gqcmYHW0RfonQ Ao+S+ExoZ7Iz+zJklR0LtqGtK0d1ok+0OBC/GB5m9op8miaoj7KRMblBx2R86fFf+7Pr 6+Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700267554; x=1700872354; h=content-transfer-encoding:in-reply-to:autocrypt: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=ACuE1Cjpg+/+S3TvL8RQf3mAriRh2LNm7WasFktjKbM=; b=YojN+JmugCZD67sc97dgCf7nVIieq/2N2P3Zu8id5YIE7I36cXOc8WKaEG2Iuf72Np o7Lye1vaLmpX2cNsj7tpx5CEIGSqB0ylciyw0la0/5nphLMWvSsKc8OPCJLvel/vQUL1 cVy4nK0CnhHgVri71sx6zbsD2DpOEwXbNxNpSog3N0IFg0+Nnbw+ZIiJyriQJWpaWjMX MvymvQIq8LJRQLR7eWJQDRgETt2vAkxaMz4/pTfeO/4wxFeNbnBj4z6FIPbmtEkXL4jS aC+qug+iivQs4Il7vfT9yGvhrBKudIFn4HOftc4YtlGxbLmi5mBQ4h34XsDt9pmCPphP N4uQ== X-Gm-Message-State: AOJu0Yz1t3PrRioPMGSI+alBm0vb6v7MH0aBsRbwtGIVRah6ewYtzqLQ Pp/hi+bveWFCrSLy9bpvjUClBQ== X-Received: by 2002:a17:906:5352:b0:9bf:70ea:6926 with SMTP id j18-20020a170906535200b009bf70ea6926mr662922ejo.2.1700267554094; Fri, 17 Nov 2023 16:32:34 -0800 (PST) Received: from [192.168.201.100] (178235187040.dynamic-4-waw-k-2-3-0.vectranet.pl. [178.235.187.40]) by smtp.gmail.com with ESMTPSA id w22-20020a170906131600b009de11bcbbcasm1318413ejb.175.2023.11.17.16.32.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Nov 2023 16:32:33 -0800 (PST) Message-ID: <0fbef967-62db-4c5f-8108-2c545c53a39e@linaro.org> Date: Sat, 18 Nov 2023 01:32:31 +0100 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: Bryan O'Donoghue , 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> From: Konrad Dybcio Autocrypt: addr=konrad.dybcio@linaro.org; keydata= xsFNBF9ALYUBEADWAhxdTBWrwAgDQQzc1O/bJ5O7b6cXYxwbBd9xKP7MICh5YA0DcCjJSOum BB/OmIWU6X+LZW6P88ZmHe+KeyABLMP5s1tJNK1j4ntT7mECcWZDzafPWF4F6m4WJOG27kTJ HGWdmtO+RvadOVi6CoUDqALsmfS3MUG5Pj2Ne9+0jRg4hEnB92AyF9rW2G3qisFcwPgvatt7 TXD5E38mLyOPOUyXNj9XpDbt1hNwKQfiidmPh5e7VNAWRnW1iCMMoKqzM1Anzq7e5Afyeifz zRcQPLaqrPjnKqZGL2BKQSZDh6NkI5ZLRhhHQf61fkWcUpTp1oDC6jWVfT7hwRVIQLrrNj9G MpPzrlN4YuAqKeIer1FMt8cq64ifgTzxHzXsMcUdclzq2LTk2RXaPl6Jg/IXWqUClJHbamSk t1bfif3SnmhA6TiNvEpDKPiT3IDs42THU6ygslrBxyROQPWLI9IL1y8S6RtEh8H+NZQWZNzm UQ3imZirlPjxZtvz1BtnnBWS06e7x/UEAguj7VHCuymVgpl2Za17d1jj81YN5Rp5L9GXxkV1 aUEwONM3eCI3qcYm5JNc5X+JthZOWsbIPSC1Rhxz3JmWIwP1udr5E3oNRe9u2LIEq+wH/toH kpPDhTeMkvt4KfE5m5ercid9+ZXAqoaYLUL4HCEw+HW0DXcKDwARAQABzShLb25yYWQgRHli Y2lvIDxrb25yYWQuZHliY2lvQGxpbmFyby5vcmc+wsGOBBMBCAA4FiEEU24if9oCL2zdAAQV R4cBcg5dfFgFAmQ5bqwCGwMFCwkIBwIGFQoJCAsCBBYCAwECHgECF4AACgkQR4cBcg5dfFjO BQ//YQV6fkbqQCceYebGg6TiisWCy8LG77zV7DB0VMIWJv7Km7Sz0QQrHQVzhEr3trNenZrf yy+o2tQOF2biICzbLM8o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0sT1eRJDEhI4XIQM4ClIzpsCIN5HnVF76UQXh3a9zpwh3dk8i bhN/URmCOTH+LHNJYN/MxY8wuukq877DWB7k86pBs5IDLAXmW8v3gIDWyIcgYqb2v8QO2Mqx YMqL7UZxVLul4/JbllsQB8F/fNI8AfttmAQL9cwo6C8yDTXKdho920W4WUR9k8NT/OBqWSyk bGqMHex48FVZhexNPYOd58EY9/7mL5u0sJmo+jTeb4JBgIbFPJCFyng4HwbniWgQJZ1WqaUC nas9J77uICis2WH7N8Bs9jy0wQYezNzqS+FxoNXmDQg2jetX8en4bO2Di7Pmx0jXA4TOb9TM izWDgYvmBE8= In-Reply-To: <20231103-b4-camss-named-power-domains-v4-4-33a905359dbc@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 groat.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 (groat.vger.email [0.0.0.0]); Fri, 17 Nov 2023 16:32:59 -0800 (PST) On 3.11.2023 13:29, Bryan O'Donoghue wrote: > Moving the location of the hooks to VFE power domains has several > advantages. > > 1. Separation of concerns and functional decomposition. > vfe.c should be responsible for and know best how manage > power-domains for a VFE, excising from camss.c follows this > principle. > > 2. Embedding a pointer to genpd in struct camss_vfe{} meas that we can > dispense with a bunch of kmalloc array inside of camss.c. > > 3. Splitting up titan top gdsc from vfe/ife gdsc provides a base for > breaking up magic indexes in dtsi. > > Suggested-by: Matti Lehtimäki > Tested-by: Matti Lehtimäki > Signed-off-by: Bryan O'Donoghue > --- [...] > +/* > + * msm_vfe_genpd_cleanup - Cleanup VFE genpd linkages > + * @vfe: VFE device You can even give this an upgrade to kerneldoc! :) [...] > + /* count the # of VFEs which have flagged power-domain */ [...] Personal peeve, but this comment seems a bit excessive > + 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 Konrad