From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B19F734A788 for ; Fri, 27 Mar 2026 22:37:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774651032; cv=none; b=lErudk3z6oNSTYq+Ut3slnOO2AOGk3V5fUTpvCcJUsVG5iPirBirrisn97D9wo2V/xhJl5NJayIl70QEWoOaywOqvMUiyiMAgYMnApHYp9TC+Ad3FuqNbZzpMq+LE5GCGoqDXPKJRcid3jav8Hxwmq2xkHsS5CCcdIQR50VYU08= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774651032; c=relaxed/simple; bh=Mz94M9j3CiZjbegbr4S9pqf4HEm+HXNGIzWBfuew2IA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=db5ojDx5thnv2k36xR+xL04DLsBq3rhhR3D/r2QL0a63Rzx57xRe1tizPMvGSkRoIn9GnW15+YhuZv3LJPmmJGrZWXKXNEXkJg8PENQaWn8p4Vdk8Tgg9bsKhm2A4hpeqzRwrXkyntChoMo/gRnBSVtRyIVP2HNIDw5lVasfAbk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=URoLuYmE; arc=none smtp.client-ip=209.85.221.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="URoLuYmE" Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-439fe4985efso1965057f8f.3 for ; Fri, 27 Mar 2026 15:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1774651029; x=1775255829; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=bmGmc6Vgd8VKGv3mHVXKZQWf2GOsa5gLJXBEugfIWyU=; b=URoLuYmEYJ20BrHmlwS2nQwpHOoYYMXHu7iPdwYNRxd7ypkWMukbTsIAPy8Ug0tdJN K8TmRboDyuZDd/9PIjPPx1d+HBKAhsa9foCwT+XJfra8HTV/uHb6bD9wJQXOvH3Nm9NV NOc6FC7ZOba5hp0/WqIpFHK0YGp++s86Hlnkus1H7NnDMnGPF6jPykv+f+hCsURLiy1v UB3rgtORpTXDk2ZKJh3hduy2iioLiwwFgoAcWQqFSBR0uwBfJBIbXjgBVnUsxzZnq8By xrA9o+eRZNOxoatng4dLXEiRSUa5h7t4lJuN+T1l151l+k996nb2hJvM8mb/5uM/KAZc /ZMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774651029; x=1775255829; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=bmGmc6Vgd8VKGv3mHVXKZQWf2GOsa5gLJXBEugfIWyU=; b=nIKGj2RLg9xQDwDXLnpEJvpQZNNxPo4IFwT63VBGJ/lCEv2w7+ROCzTlg4B6zB5SXt N6mwc4iJQQWXbuX6QSqsmdqCsihCJgMuyzoj1VRimIGq2qHG7uv7+hXPMGGy8oR2h6NI MaN4rQJ53PGpg/U4EeoYcfoHBUatvpBBKkSaSt0PsqfK8vm2FcsMZoRNQzI0ASiNpkii XusH95AjUb9saxrU5ZpNYG71HQhJUA2OaxdFc68rIhcbINzERB81ZkOv3TS/3043dHUi enzcxZpuh0MNM2h63VcbhK5DeO3QbUQOpDVnkgwGLQmPvO3DJqZekyyVv4jSVW8GYSss arlg== X-Forwarded-Encrypted: i=1; AJvYcCWFyiFMGXm1Ac23wJzDOKsYjA8t9yfsa1vR+ytFiWv9Jgfb9mgCBLbo6ImZClVxe4z7oQnXFj1NV2EXSbo=@vger.kernel.org X-Gm-Message-State: AOJu0Yxv+x+F52fvzKrvoQPDCv+vVEU3Zagkv7eYZkVd/HvQh2slUAed Im4NqPtvVfK387knfUz5ll9FKdehxFAtQn9jPfcxm/3lkaZlml3XPpy3yzbZIcujwiQ= X-Gm-Gg: ATEYQzwuQJYnmg5VOGZSTubEfUdU9oqu44Jy7CbDvy4XDltbDxgJ7f9hJbpmGeUC4E2 in83YgTTygYb78DJqOrjLP/LC+XDqSdXkwSvLl3G4YhJZpkjPOwPDn0h7riqV4hFQbw/4hRQbCe HPFaGWiqhP/8i+0pkzBab7tyoflZ7WHfHOwzfZgAe6biiqlCM5XW1pShNlcuZz9OdJ3o/cfsmDS cOuLsHPPUhMv81MukCSNEMvI8YaUmQxfRxkUnAdUG6v9ajJnDa5PJ/YbLAtwOWIlUx+VJk2Vw5o nw/yU2uvLkIqxq87YT+h/hiXytkZcwQGfKeuOITOR0ioHLFS2jJe+BnF+VFq3LPbZaxrP4zivUc McSMgyGJeH5D/J17+Iz0IqBNTEMd2jW3lpvOaBgWNqP0C5XaYRDZNmxYiUwC9NJ1oCLfXG90Jxd Aa39RxPj7KF//YuG5OhPEeWVPZd1JiOj7C9dGXpfGhFa9RDdE= X-Received: by 2002:a05:6000:2dc9:b0:43b:490a:db51 with SMTP id ffacd0b85a97d-43b9e9fb32cmr7544314f8f.24.1774651028947; Fri, 27 Mar 2026 15:37:08 -0700 (PDT) Received: from [192.168.0.167] ([78.152.214.161]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-43cf21f1749sm1094260f8f.14.2026.03.27.15.37.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Mar 2026 15:37:08 -0700 (PDT) Message-ID: <7757b121-da4f-4157-93c9-4ba162b2696f@linaro.org> Date: Fri, 27 Mar 2026 22:37:06 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v11 4/7] media: qcom: camss: Add support to populate sub-devices To: Dmitry Baryshkov , Loic Poulain Cc: Bjorn Andersson , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Robert Foss , Todor Tomov , Mauro Carvalho Chehab , Konrad Dybcio , Vladimir Zapolskiy , Bryan O'Donoghue , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, Krzysztof Kozlowski References: <20260326-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v11-0-5b93415be6dd@linaro.org> <20260326-b4-linux-next-25-03-13-dtsi-x1e80100-camss-v11-4-5b93415be6dd@linaro.org> From: Bryan O'Donoghue Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 27/03/2026 21:33, Dmitry Baryshkov wrote: >> Other drivers typically call the populate function at the end of the >> probe function. In this case, however, it is invoked before the main >> resources are enabled. I assume this is because the CSIPHY device >> needs to be available early. Aside from that, it looks good to me. > This becomes fragile. The CSI PHY might be built as a module, which > might be loaded later. Is it any more or less fragile than "simple-mfd" in a DT though ? Krzysztof isn't very much in favour of simple-mfd so this method of population is the alternative to hand. The CSIPHY driver uses devm_of_phy_get which handles deferred probe. If the PHY module isn't loaded yet when CAMSS tries to get it, CAMSS gets -EPROBE_DEFER and retries. > >> Reviewed-by: Loic Poulain >> >>> @@ -4964,6 +4965,8 @@ static int camss_probe(struct platform_device *pdev) >>> if (!camss) >>> return -ENOMEM; >>> >>> + devm_of_platform_populate(dev); >>> + >>> camss->res = of_device_get_match_data(dev); >>> >>> atomic_set(&camss->ref_count, 0); > And this looks suspicious. What if drivers for submodules are already > there and start probing once populated? Do they have a chance to access > this ref_count? Nope, we don't share the camss pointer or any of the data-structures in the existing upstream driver with sub-modules. --- bod