From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.53 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796252612; b=M/EJyVRh/vrHP2LPWUVzQgJeTszGRizPrLIoKoJf/Sb0nPA2PNJ2gapeAksLpqCRWtT/ KPB9WPqBxJJJKl5QCP+ecok2wfZqH2p5eyL2T4rE/Q1RDdHUOu71m4lPz/3VWuLV1GBQ7 0W9v1wO2MZakbdFz/M0/4UdJ5yNW6k8oKfsb7otqRUVEkkkL4gmgf72vZ+JcI56pJIHr8 hBE5EmOtXr6VEnkjZuNUa6J4QaqHMFMXepCOAqVXgsSvemOXilWb8oPPsaYxWGeyK0ENw ddql+Z3zTq712g3PyCLRbk7GO+g3O928Ny/aRLJ38NrW1cuaUwGAyD6oft/+5PJJung== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796252612; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: MIME-Version:Content-Transfer-Encoding; bh=mczNEhVPJl8/MIUVdMy9wfHSfUYpNvQK3dAx8NHOuOY=; b=CBAtUO0JjlRdEltbAeVqtklglyWRbA/jhvZOanXyKrrfZwkArCsLWrPdloDbHv+pdDcx JsFTB3GGC3oSf2iee1Z5n9KA6SwPbrCYA0iwYV3ud8tpuhpV7FQ43F67h8xXwLz71DR3B nX/vf+QsKYb7YKpSxYTpc6Y7cQQhDUB4U3GmAUmSir805kN1lSk5cO02UvbNuKHKLEz91 50IQnRuf4JCpziBwPMTfuybeHMBXhGu4V1NtZr0rtlBfoFbVFXs77WHURCHiRwPe3pM5k GTHWujpxfwqPhX/kdsG0v3pQmJk2oQJpqmnIajSuU9wbgGfTBQsDn3q55Y1s2UzDJtg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lczwm7Su; arc=none smtp.remote-ip=209.85.221.53 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB134606A690 for ; Wed, 2 Dec 2026 23:03:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DB134606A690 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=lczwm7Su Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-491846221ffso11934038f8f.3 for ; Wed, 02 Dec 2026 15:03:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796252610; x=1796857410; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=mczNEhVPJl8/MIUVdMy9wfHSfUYpNvQK3dAx8NHOuOY=; b=lczwm7SuXNadfUdelGgzz+VCkBdL0jHgTH5NKAm5/9NKdvvjxS2+T6E4epHt2IRLPh iRFFAcKMtyVB6hY4MGLIw5itTN/I8jIc1xFWr3onrMUfi3en/fYueEeHu6aREZtgRNeb 1c0xhBWnWykCscbl+cu47zinBynhjqJ1awcYAE0ICGaFlbGcAd+EaNerEPVIrRKX7Hr3 9YLjRtSx0CFLUNvcWSb0b5R+jMvc7K7pRqhrEXCishLuot4kkFPV6V6wgw08vtyI6EMY ntOHbQnlRnsExuItRyj6sCYqIWfMLJp8FG/TlsyJgvaYIOUA3w2xM+1ExNo3kvgA+78d PG3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796252610; x=1796857410; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=mczNEhVPJl8/MIUVdMy9wfHSfUYpNvQK3dAx8NHOuOY=; b=EU6drQnDaNgYbJZnBtdV5/KCTbV8LboIR4sQmX0duCy5kuoDUCXq77cIjNzxOU7x+a ithBBToi/d+W2YuhriUrqSKJ/k+JO+7voBDIGu3tzengtbFXzmFSc3yfWg2ffKtEP3kf LlXNSajergJkeO97MteR3OK7zUUjx/JJg2S2EFeBAiDcKsZFixMB5Wx5NfEh79bIlHcn KBfcoaYb5GwqPJnRa1EmM60gtmOLSq0h2VhgEGRBvEpBMWDDALq1+u7fixoyxQQhxAm/ qZI+M7xeFVg7TXift5+yskxxjkjvPttRUJeKA7oUo4aNn41pX4Q3Kv9YW3uL8FKFaBY4 zrxA== X-Forwarded-Encrypted: i=1; AL+hErHUMEQ0KzEqtxPMzjlmY8yXHGEx0dGEv09av38MgAGipPkeZC+d0vuYBwyhdwnlY+qZOeGophVt/Sq+0OY=@vger.kernel.org X-Gm-Message-State: APuU4Z+sZWd2DLqiHWIbZiq9BLlWz9WhdX+74CqxmtF8lvcDR5j9zOXT /mW8yFZMGpJxtUb60WxksPbZfBVEMKW06o++nW7OYdiEAwcy0HPS/wZw X-Gm-Gg: AZFdTZe4SIernQUa/AZrh41ddF0MsYl1oZq8hSMFghjhdUZo6xxsMFoE0yln0/kNd5i EgBrhhN58jtofN5JXLNm7iK9RgIaNYaGSeVtBeW/WSuIL9rWO7vPpSsKImrXBfRkdIMtNeL3SRh X3KYdMeWQZ7aZVDRbauRWd50k7xvSu9apeufI9GDaJWf1maOvWda7u+Z05BrIZuxX3aafeZyLF2 sJG0If6W0luGvsSOh6u0GSba/TIEZNw4nqL22ZGpWzegEpqw4dIBsmwEDlmNt+H+X/SElbRZ+29 7dDcGw2ZnZ/S21fexV0eUGVSf7nXKFSxEJrfx8v87tZNTs1/kWI3Mlbj32n2xlkLNUXHE969UUJ 7z4AkE9P6mygR5vEyBQ1qf7tVWBwJV0v92hQWyikiEnY3NmgRYum25u7O3PX/Si+st/ERsRAeAA UMKbK14Q+cIHOZhTE7LZ1m1Shlu6Pcoc+V8bsH+AEzJYg1IyWnFtJNeJ/qQvpkl4h6WYVh58Vt9 0yS7xxwZ3dSwGstsQzECLWOB28ptcD75RZTW71vSodu6shd7PIT0PW3n388kZ7I2md5g7bLA1Rr qmt+OGU2eR5Z+YFxSLYqCVUTHK91nSMKGLPrP4aEuzbXzOvTHsNkTu8GgTtnuA== X-Received: by 2002:a05:6000:2506:b0:48d:ba3b:af36 with SMTP id ffacd0b85a97d-4abb47b0f64mr95538215f8f.37.1796252610257; Wed, 02 Dec 2026 15:03:30 -0800 (PST) Received: from unknown.m0rf30.ray ([2a02:b021:8011:256b:d13a:b0f2:c168:28e9]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-4ab658e2c8csm81180838f8f.2.2026.12.02.15.03.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2026 15:03:29 -0800 (PST) From: Gianluca Boiano To: Bryan O'Donoghue , Vladimir Zapolskiy , Loic Poulain , Mauro Carvalho Chehab , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, phone-devel@vger.kernel.org, David Heidelberg , stable@vger.kernel.org, Gianluca Boiano Subject: [PATCH v2 2/5] media: qcom: camss: Look up link frequency from the sub-device on the CSI-2 link Date: Thu, 3 Dec 2026 00:02:59 +0100 Message-ID: <5d19d927b932406078059b4365a796e1c49f141c.1796251498.git.morf3089@gmail.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: References: X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit camss_find_sensor_pad() returns the pad of the first sub-device found upstream of the CSIPHY that has the MEDIA_ENT_F_CAM_SENSOR function. This is the pixel array for a sensor that consists of several sub-devices, such as a MIPI CCS one, and the link frequency and the pixel rate are then looked up from the controls of the pixel array. The pixel array does not have a link frequency control, and the pixel rate it has is the rate at which pixels are read out from the array, not the one on the CSI-2 bus. The link frequency used for the CSIPHY clock and the settle count and the pixel clock used for the VFE clock rate are then derived from the wrong rate. On Sony IMX376 that is 800 MHz instead of 400 MHz at a 500 MHz link frequency, and the kernel warns: v4l2_get_link_freq_ctrl: Link frequency estimated using pixel rate: result might be inaccurate The controls describing the CSI-2 bus (V4L2_CID_LINK_FREQ and the CSI-2 V4L2_CID_PIXEL_RATE) are those of the sub-device that transmits on the bus, i.e. the one that CAMSS has bound. Return the pad of that sub-device instead, as the other CSI-2 receiver drivers do. For a sensor consisting of a single sub-device the result is the same. Signed-off-by: Gianluca Boiano --- drivers/media/platform/qcom/camss/camss.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/qcom/camss/camss.c b/drivers/media/platform/qcom/camss/camss.c index c54185c93..cf86bf04d 100644 --- a/drivers/media/platform/qcom/camss/camss.c +++ b/drivers/media/platform/qcom/camss/camss.c @@ -4513,6 +4513,10 @@ void camss_disable_clocks(int nclocks, struct camss_clock *clock) * camss_find_sensor_pad - Find the media pad via which the sensor is linked * @entity: Media entity to start searching from * + * The sensor pad is the source pad of the sub-device bound to CAMSS, i.e. the + * one that transmits on the CSI-2 bus. For a sensor made of several sub-devices + * this is not necessarily the pad of the pixel array. + * * Return a pointer to sensor media pad or NULL if not found */ struct media_pad *camss_find_sensor_pad(struct media_entity *entity) @@ -4530,7 +4534,7 @@ struct media_pad *camss_find_sensor_pad(struct media_entity *entity) entity = pad->entity; - if (entity->function == MEDIA_ENT_F_CAM_SENSOR) + if (v4l2_get_subdev_hostdata(media_entity_to_v4l2_subdev(entity))) return pad; } } -- 2.56.1