Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2426731rdf; Mon, 6 Nov 2023 14:01:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IGhQxRqGf3zBnhpayktJQEGhmWCsFvEr9YVU3SGZXc7sAMCiOd6PWgVtt5Lhc7FxSiGcRVu X-Received: by 2002:a9d:7dcc:0:b0:6cd:9b6:5954 with SMTP id k12-20020a9d7dcc000000b006cd09b65954mr28800585otn.38.1699308093522; Mon, 06 Nov 2023 14:01:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699308093; cv=none; d=google.com; s=arc-20160816; b=bNWV8xWsAB16l2sA1iGPv1LwOFRc/R8+/62h0+WDlLDZPHHpq6fDVoGWFBdhPRQ656 RvFdtBWVpqwMK3WHGuJ6Ypby1Wqzje1pDghjodZVPv20Ava0eZ52xYfDnNs1jN9hClOW sy1aZE7PJGp8wMlQpJbgdjBfBrlKNKMOPVji12sywMoLyMlyelig6Thr7xsoskTYFglI c+mJkDboKxEDdL6Z9EHUi+nwDS42nkRIIXiqtoIfEe5hhMiBxHBp7RAzV0LUwpmpQksi lBjWg8nmh1/1hzoL9O23FJvnU+fTR4Fb3y1tfN3chL2losJzE2ovGjteLMjlMQS703v5 Hj7A== 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:dkim-signature; bh=CczBZ2nyr1JbiE/v8ZApQEPud/YLOzLDPL+hb2qXheU=; fh=wxl7wP3hcSHx61OGwS6ASwqenQLYzU+oqwoBTAsym1Y=; b=xvB4Tvr0tLyvZcEyQGTJJ1zQYR7eGhy1LrdNOV1DYVJR45WrsqJqWQnZlmJG8zukun Lq5pvCflvNqhypg1/ZzqCw5weyPYgzDm7mPgxUOCdJ9h/uHL+DKns0bLoLbnXhZiAEgJ eE/32V1N8/5wJjgzyItmDQJ0bpusZC7gvyQkZYBnWQFp8c/5KwbNgXmKeolhciwrCOH9 UJ5JlsSD7k61ojyvaIY5k4vmB1VzTF9uJV9uEMJxsN4js1TIvf46TUSCSL2T1aXQbk1X OelupGo+zvsJRb4SHHyihHaO/BS5Y9a6IaVZUMCqAOAadOB2F+tDFSjGHjNXYigBll3t hpxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Kmj/zlsY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id c14-20020a9d67ce000000b006cd09df161bsi3687123otn.26.2023.11.06.14.01.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 14:01:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="Kmj/zlsY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 533FE80781F1; Mon, 6 Nov 2023 14:00:50 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233193AbjKFWAq (ORCPT + 99 others); Mon, 6 Nov 2023 17:00:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232790AbjKFWAp (ORCPT ); Mon, 6 Nov 2023 17:00:45 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FD8E11F; Mon, 6 Nov 2023 14:00:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1699308042; x=1730844042; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=vszWPPXsju9JscN66VI8Yo3KG0OPHwEoAvA9/gUL2jU=; b=Kmj/zlsYRdv8Wg1N+SX7OR//+Nx8rogG5zxkhDhUuq1K186mRt1F6e+y wDmt7s0pxU7D0KBJI6Ce9zFd7UfaoITRBvn2aaKLV2rdrULn/8rM79D6m 8iqZag3QIWOL3mz5oTPASuDD2zQEutnSIxOpgrMugvzuSjpzrwnrNfNho 1ASZhzmb/UfPrwQkUO8g7agemd0UxaZN3m17U+i92wnSjXYWbfEFWLaug F1OaxVW9p6TqZ0HqfcAp7feRTvFKaMcPzAFwZpclz5EW2QCSrDUUSIJbc az39zQKRc+BUkXMOr6n/Z9Io0QsssmZpYaLi+qJN9og5IZFaVf7dcr6RI A==; X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="475614938" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="475614938" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 14:00:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10886"; a="712335738" X-IronPort-AV: E=Sophos;i="6.03,282,1694761200"; d="scan'208";a="712335738" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Nov 2023 14:00:40 -0800 Received: from kekkonen.localdomain (localhost [127.0.0.1]) by kekkonen.fi.intel.com (Postfix) with SMTP id A5CD211F894; Mon, 6 Nov 2023 23:50:49 +0200 (EET) Date: Mon, 6 Nov 2023 21:50:49 +0000 From: Sakari Ailus To: "Rafael J. Wysocki" Cc: Linux ACPI , LKML Subject: Re: [PATCH v3 5/7] ACPI: scan: Extract MIPI DisCo for Imaging data into swnodes Message-ID: References: <4542595.LvFx2qVVIh@kreacher> <1987710.usQuhbGJ8B@kreacher> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1987710.usQuhbGJ8B@kreacher> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 06 Nov 2023 14:00:50 -0800 (PST) Hi Rafael, On Mon, Nov 06, 2023 at 05:27:26PM +0100, Rafael J. Wysocki wrote: > From: Rafael J. Wysocki > Subject: [PATCH] ACPI: scan: Extract MIPI DisCo for Imaging data into swnodes > > Add information extracted from the MIPI DisCo for Imaging device > properties to software nodes created during the CSI-2 connection graph > discovery. > > Link: https://www.mipi.org/specifications/mipi-disco-imaging > Co-developed-by: Sakari Ailus > Signed-off-by: Sakari Ailus > Signed-off-by: Rafael J. Wysocki > --- > > v2 -> v3: > * Change the name of the new file to mipi-disco-img.c > * "DiSco" -> "DisCo" in multiple places > * Fix the link in the Link: tag > * Change the number of data lanes limit and add a comment regarding it > * Use ACPI_DEVICE_CSI2_DATA_LANES directly in several places instead > of array sizes equal to it Thanks for the update. I've tested the set, so you can add: Tested-by: Sakari Ailus with the following diff fixing mipi-img-lane-polarities parsing: diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c index 3123180d9b54..92b45e792a07 100644 --- a/drivers/acpi/mipi-disco-img.c +++ b/drivers/acpi/mipi-disco-img.c @@ -530,7 +530,12 @@ static void init_csi2_port(struct acpi_device *adev, } ret = fwnode_property_count_u8(port_fwnode, "mipi-img-lane-polarities"); - if (ret * BITS_PER_TYPE(u8) >= num_lanes + 1) { + if (ret < 0) { + acpi_handle_debug(handle, "Lane polarity bytes missing\n"); + } else if (ret * BITS_PER_TYPE(u8) < num_lanes + 1) { + acpi_handle_info(handle, "Too few lane polarity bytes (%lu vs. %d)\n", + ret * BITS_PER_TYPE(u8), num_lanes + 1); + } else { unsigned long mask = 0; int byte_count = ret; unsigned int i; @@ -543,15 +548,15 @@ static void init_csi2_port(struct acpi_device *adev, */ BUILD_BUG_ON(BITS_PER_TYPE(unsigned long) <= ACPI_DEVICE_CSI2_DATA_LANES); - if (byte_count > ACPI_DEVICE_CSI2_DATA_LANES) { + if (byte_count > sizeof(mask)) { acpi_handle_info(handle, "Too many lane polarities: %d\n", byte_count); - byte_count = ACPI_DEVICE_CSI2_DATA_LANES; + byte_count = sizeof(mask); } fwnode_property_read_u8_array(port_fwnode, "mipi-img-lane-polarities", val, byte_count); - for (i = 0; BITS_PER_TYPE(u8) * i <= num_lanes; i++) + for (i = 0; i < byte_count; i++) mask |= (unsigned long)val[i] << BITS_PER_TYPE(u8) * i; for (i = 0; i <= num_lanes; i++) @@ -561,8 +566,6 @@ static void init_csi2_port(struct acpi_device *adev, PROPERTY_ENTRY_U32_ARRAY_LEN("lane-polarities", port->lane_polarities, num_lanes + 1); - } else { - acpi_handle_info(handle, "Lane polarity bytes missing\n"); } swnodes->nodes[ACPI_DEVICE_SWNODE_EP(port_index)] = -- Kind regards, Sakari Ailus