Message ID | 2187487.irdbgypaU6@kreacher |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp1109760vqb; Fri, 20 Oct 2023 07:51:03 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZrBauSPlhod2tdBzBLfmQvVMPZw3vgFUuxmxIVImbn92GMAN8v4NYVHi9aTIXNbtBwv4q X-Received: by 2002:a05:6870:82a8:b0:1e9:dd4b:d0aa with SMTP id q40-20020a05687082a800b001e9dd4bd0aamr2172288oae.48.1697813463433; Fri, 20 Oct 2023 07:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697813463; cv=none; d=google.com; s=arc-20160816; b=ng3n/WfGrCYlJ+dJcZ4JiYN037icLIBWYmj6oKJWcamuunQGu8Pjif3IKUj/qOd0Fx L6GZvUqbMAri3awM1ry27KpLyh6pwKpCoBdMxZUu4fXZ8VmNDsZkHSyLhBRyssfWTOpN SkZKqNoMtr5i3ggD1zzK9rWdymVzIVGkHIG8aofCzW1/nt63Q8Hx7RoooZ9V3f2gJNsA DSYZTx+OoJ7cZJLkado6j+QWnGPekxn7ZglvsYEtUfRNohFRHmhdtuiwssiwMo9mFQVV dTBnp+EVDMOicFUgvDwsUMXyAWd1x8CzTVgisn7paBGYPhHKzvxzuMymSamgHcRt9cNX MQpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=Q6l4f3OM08x/XGlqxRI/cSdCQ2J6UlNht2wFwXCVBUs=; fh=WaqwKbNI6ggyvaUQ85iAclRCevgklJhqArlb3px6pNU=; b=oPCsDXmklsV9j2IBz8cMyercqzTbbihgAQ/hTqhwbf108ZzOLFib69rcVrXuStm+dM HmPKpBjjQGb98pFLFZJBqCCEMVQPge79ETTA0EwHXjsPmq9Ko/FFlekurjS0Heu/A/ie oAzpZve4L9tULJB/+upWrnnopkaYeMjpQBwZRHwI1t9SZ2jN0BO/E0YeRO4q/IJUPVaP ZFQoUTfAxrLsa7JHcA1BLSR5ecQ7SSffaLt0BFiE61/DiIMLuctjDYwRFE4lR768JSFJ ourirIOPo4v1R4hEMA875XFOv9KuznVX0l627c19qhlKzIbshwGO69oHcFWT0BnHS9KR ibAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h4-20020a636c04000000b00578b79c785bsi2033212pgc.217.2023.10.20.07.51.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 07:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 28B6983C9F9F; Fri, 20 Oct 2023 07:50:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377636AbjJTOuJ (ORCPT <rfc822;a1648639935@gmail.com> + 26 others); Fri, 20 Oct 2023 10:50:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377603AbjJTOt4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 20 Oct 2023 10:49:56 -0400 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" <rjw@rjwysocki.net> To: Linux ACPI <linux-acpi@vger.kernel.org>, Sakari Ailus <sakari.ailus@linux.intel.com> Cc: LKML <linux-kernel@vger.kernel.org> 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> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="UTF-8" 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 20 Oct 2023 07:50:47 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780286450185106099 X-GMAIL-MSGID: 1780286450185106099 |
Series |
ACPI: scan: MIPI DiSco for Imaging support
|
|
Message
Rafael J. Wysocki
Oct. 20, 2023, 2:33 p.m. UTC
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!
Comments
Hi Rafael, On Fri, Oct 20, 2023 at 04:33:56PM +0200, Rafael J. Wysocki wrote: > 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 for the update. I've tested this and I can confirm it works, to the extent implemented in the set. The rest can be implemented on top (mainly replicating properties). I'll comment on a few patches in the set. Do you prefer to make the changes or shall I? I presume them to be fairly minor.
Hi Sakari, On Tue, Oct 31, 2023 at 11:33 AM Sakari Ailus <sakari.ailus@linux.intel.com> wrote: > > Hi Rafael, [cut] > > 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 for the update. I've tested this and I can confirm it works, to the > extent implemented in the set. The rest can be implemented on top > (mainly replicating properties). Thanks for testing! > I'll comment on a few patches in the set. > > Do you prefer to make the changes or shall I? I presume them to be fairly > minor. I can make the changes.