From patchwork Fri Oct 20 14:33:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rafael J. Wysocki" X-Patchwork-Id: 737334 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 664F91D52E for ; Fri, 20 Oct 2023 14:49:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none Received: from cloudserver094114.home.pl (cloudserver094114.home.pl [79.96.170.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 551A0D5F; Fri, 20 Oct 2023 07:49:54 -0700 (PDT) Received: from localhost (127.0.0.1) (HELO v370.home.net.pl) by /usr/run/smtp (/usr/run/postfix/private/idea_relay_lmtp) via UNIX with SMTP (IdeaSmtpServer 5.2.0) id 36c620263d67cc07; Fri, 20 Oct 2023 16:49:52 +0200 Received: from kreacher.localnet (unknown [195.136.19.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by cloudserver094114.home.pl (Postfix) with ESMTPSA id 58FFB667008; Fri, 20 Oct 2023 16:49:52 +0200 (CEST) From: "Rafael J. Wysocki" To: Linux ACPI , Sakari Ailus Cc: LKML Subject: [PATCH v2 0/6] ACPI: scan: MIPI DiSco for Imaging support Date: Fri, 20 Oct 2023 16:33:56 +0200 Message-ID: <2187487.irdbgypaU6@kreacher> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-CLIENT-IP: 195.136.19.94 X-CLIENT-HOSTNAME: 195.136.19.94 X-VADE-SPAMSTATE: clean X-VADE-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrjeekgdektdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfjqffogffrnfdpggftiffpkfenuceurghilhhouhhtmecuudehtdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefufffkggfgtgesthfuredttddtjeenucfhrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqeenucggtffrrghtthgvrhhnpeffieeutdeikeevkeelieeigeehhfevgeetgefhffdvudeufedugeekueekffffvdenucffohhmrghinhepkhgvrhhnvghlrdhorhhgpdhuvghfihdrohhrghdpmhhiphhirdhorhhgnecukfhppeduleehrddufeeirdduledrleegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelhedrudefiedrudelrdelgedphhgvlhhopehkrhgvrggthhgvrhdrlhhotggrlhhnvghtpdhmrghilhhfrhhomhepfdftrghfrggvlhculfdrucghhihsohgtkhhifdcuoehrjhifsehrjhifhihsohgtkhhirdhnvghtqedpnhgspghrtghpthhtohepfedprhgtphhtthhopehlihhnuhigqdgrtghpihesvhhgvghrrdhkvghrnhgvlhdrohhrghdprhgtphhtthhopehsrghkrghrihdrrghilhhusheslhhinhhugidrihhnthgvlhdrtghomhdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhr gh X-DCC--Metrics: v370.home.net.pl 1024; Body=3 Fuz1=3 Fuz2=3 Hi Folks, This is a new revision of https://lore.kernel.org/linux-acpi/13276375.uLZWGnKmhe@kreacher/ which was reported to have issues and it took time to revisit it. > The main points from the original cover letter are still valid: > > The general idea is the same - CSI-2 resource descriptors, introduced in > ACPI 6.4 and defined by > > https://uefi.org/specs/ACPI/6.5/06_Device_Configuration.html#camera-serial-i > nterface-csi-2-connection-resource-descriptor > > are found and used for creating a set of software nodes that represent the > CSI-2 connection graph. > > These software nodes need to be available before any scan handlers or ACPI > drivers are bound to any struct acpi_device objects, so all of that is done > at the early stage of ACPI device enumeration, but unnecessary ACPI > namespace walks are avoided. > > The CSI-2 software nodes are populated with data extracted from the CSI-2 > resource descriptors themselves and from device properties defined by the > MIPI DiSco for Imaging specification (see > https://www.mipi.org/specifications/mipi-disco-imaging). > > Patches [4,6/6] come from the original series directly, but the other > patches have been changes substantially, so I've decided to re-start patch > series versioning from scratch. The v2 addresses at least 3 issues found in the v1 by code inspection: * A port_count field incrementation was missing in acpi_mipi_scan_crs_csi2(), so its value for all of the devices having CSI2 resources in _CRS was always 1 (and it should be equal to the number of valid CSI2 connection resources). * Some acpi_mipi_crs_csi2_list members could be freed prematurely, so they were inaccessible when extract_crs_csi2_conn_info() attempted to access them. * A check of remote_swnodes() against NULL was missing, which could result in a crash in a case when the swnodes memory could not be allocated for some acpi_mipi_crs_csi2_list entries. Apart from that, it rearranges the code somewhat to make it easier to follow and to avoid premature freeing of memory in it in general and the new file added by it is now called mipi-di.c (instead of mipi-disco-imaging.c) for compactness. The series is based on current linux-next. Thanks!