Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7579843rwr; Tue, 25 Apr 2023 15:42:53 -0700 (PDT) X-Google-Smtp-Source: AKy350ZwcUK+I/l9mHE3OP7Y1Jsnvp8jiSo/4BOyOUZY3KYzp5mbPOnCTqzcchZ1FO86TgLTZhwf X-Received: by 2002:a17:903:228b:b0:1a6:46e0:6a15 with SMTP id b11-20020a170903228b00b001a646e06a15mr22294022plh.44.1682462573250; Tue, 25 Apr 2023 15:42:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682462573; cv=none; d=google.com; s=arc-20160816; b=jNhTqRK637dc35NFUCv7FdnceR29/ZdwUeGjEcVIApg5mAMaRya+Iv9doJ9ISFu/a6 JvvTybewdUs26V2cEQA5/fbnPICACv/tFbpB5EnEEUDUJ0r5nyt5R5MaBpGB1qlv7mLO XgtEe9+J3HmgqqE4W3fhUBWICxmTmYPgxAzn04i07bzWEI4+JR2Y3IrxGYvjvLjCmFwK 1CA11OjcXqr6SHLmfa3Zfle7Q4Vnzv992DcKLemm6GGXNCqTTfQBC0ljUivQGOqECFbw mGxIgGI1tLTM/SV571Fmkb/gFoPZxYnpev4ik1n0A22wcv/kMQKmzrq0mMxsTEd0SmUr 1c5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mrw0Gr9cfNkEmYDbnddDAGq3vnBM9K9m0rixUzvdGX4=; b=F5X6QWA38L/6LFBuxIn0GOgFdoJSiGznm4G7WvbluZwMIoBvIQ2PL+KPBE6pa8Zv4C i6fdZct81mav8b8HC8Ur19S6sQumgP+n7XvWhdJKgzbStsD27xtnrBBzzHJXrnMvbI5C shJqZ1pK6E6isxnfl6qASaX1KkVluujUxTJuaWxJGrcXa3k0nfPep03H97oN7cju9mLK HiXwQF0qGvlD6/4oh6r90bSHryCV8VWN/fSO6B/IcyoEnlMMZxRafvUle8clkn0J21BJ Zzt3jh2ERuiqiLztL0F6AWKmiYgmoT9F0rl/V55B/ubntgu9kwU0JOxKite1WpXNZ2AV pkrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a17090ad98300b00247a4bad97esi17331669pjv.52.2023.04.25.15.42.42; Tue, 25 Apr 2023 15:42:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbjDYWfx (ORCPT + 99 others); Tue, 25 Apr 2023 18:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232154AbjDYWfw (ORCPT ); Tue, 25 Apr 2023 18:35:52 -0400 Received: from relay06.th.seeweb.it (relay06.th.seeweb.it [IPv6:2001:4b7a:2000:18::167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A93314468 for ; Tue, 25 Apr 2023 15:35:51 -0700 (PDT) Received: from SoMainline.org (94-211-6-86.cable.dynamic.v4.ziggo.nl [94.211.6.86]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 2EC3A3F094; Wed, 26 Apr 2023 00:35:49 +0200 (CEST) Date: Wed, 26 Apr 2023 00:35:47 +0200 From: Marijn Suijten To: Abhinav Kumar Cc: Dmitry Baryshkov , freedreno@lists.freedesktop.org, Jami Kettunen , David Airlie , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Jordan Crouse , Konrad Dybcio , Rob Clark , Martin Botka , ~postmarketos/upstreaming@lists.sr.ht, Daniel Vetter , AngeloGioacchino Del Regno , Sean Paul Subject: Re: [Freedreno] [PATCH v2 3/3] drm/msm/dpu: Pass catalog pointers directly from RM instead of IDs Message-ID: References: <31f116f6-a6b7-1241-83bc-96c31e718f3f@linaro.org> <2c3ef118-d7b1-83bd-f789-3e5c5212a6e5@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023-04-25 14:32:51, Abhinav Kumar wrote: > >>>>> We can return NULL from dpu_hw_foo_init(), which would mean that the > >>>>> block was skipped or is not present. > >>>> > >>>> An then replace the `if INTF_NONE continue` logic in dpu_rm_init with a > >>>> check for NULL that skips, and a check for IS_ERR` that goes to `fail`? > >>> > >>> You can just drop the INTF_NONE in dpu_rm. If dpu_hw_intf_init() > >>> returns NULL, the rest of the code in dpu_rm will work correctly. Sure, I'll keep the check exclusively in dpu_hw_intf_init(). Should I also move the pingpong==PINGPONG_MAX check into dpu_hw_lm_init()? > >> The only thing lost will be that the loop in the RM will break at the > >> first instance of NULL so if the loop has valid intf blocks later, those > >> will also not get initialized. > > > > No, it won't. There is the IS_ERR check, not the IS_ERR_OR_NULL() Only DSC currently uses IS_ERR_OR_NULL... We should fix that as rc=PTR_ERR(hw) on the next should be 0 (actually, the intent is for it to be undefined I think) for that... > Ack, but isnt that an issue since rm->hw_intf[intf->id - INTF_0] can be > assigned to a NULL hw. Yes, that is exactly the intent here. > >> That wont happen today because catalog doesnt have such entries but just > >> wanted to note what gets lost with this change. It does, we have a few SoCs with type=INTF_NONE. Quoting myself from above: As per the first patch of this series SM6115/QCM2290 only have a DSI interface which always sits at ID 1, and ID 0 has its TYPE set to INTF_NONE and is skipped. - Marijn