From: Andy Shevchenko <andy@kernel.org>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Rafael J . Wysocki" <rafael@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Daniel Scally <dan.scally@ideasonboard.com>,
linux-acpi@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Kate Hsuan <hpa@redhat.com>, Hao Yao <hao.yao@intel.com>,
Bingbu Cao <bingbu.cao@intel.com>,
linux-media@vger.kernel.org
Subject: Re: [PATCH v3 17/18] media: atomisp: csi2-bridge: Add dev_name() to acpi_handle_info() logging
Date: Thu, 6 Jul 2023 13:09:29 +0300 [thread overview]
Message-ID: <ZKaS2UbkbkbfYqAe@smile.fi.intel.com> (raw)
In-Reply-To: <20230705213010.390849-18-hdegoede@redhat.com>
On Wed, Jul 05, 2023 at 11:30:09PM +0200, Hans de Goede wrote:
> acpi_handle_info() uses the ACPI path to the handle as prefix for messages
> e.g. : "\_SB_.I2C2.CAM8".
>
> This makes it hard for users to figure out which csi2-bridge messages
> belong to which sensor since the actual sensor drivers uses the ACPI
> device name (typically "HID:00") for logging.
>
> Extend the acpi_handle_info() (and err and warn) logging to also log
> the device name to make it easier to match csi2-bridge messages with
> sensor driver log messages.
Fine by me, one suggestion below (up to you, guys)
Reviewed-by: Andy Shevchenko <andy@kernel.org>
> Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
> .../media/atomisp/pci/atomisp_csi2_bridge.c | 51 ++++++++++++-------
> 1 file changed, 34 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c
> index 551c6fd244fd..8124be486e2e 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp_csi2_bridge.c
> @@ -131,7 +131,8 @@ static char *gmin_cfg_get_dsm(struct acpi_device *adev, const char *key)
> if (!val)
> break;
>
> - acpi_handle_info(adev->handle, "Using DSM entry %s=%s\n", key, val);
> + acpi_handle_info(adev->handle, "%s: Using DSM entry %s=%s\n",
> + dev_name(&adev->dev), key, val);
Maybe (maybe!) it's a candidate to have something like
v4l2_acpi_log_info(adev, ...) which combines both and unloads the code from
thinking about it?
> break;
> }
> }
> @@ -156,7 +157,8 @@ static char *gmin_cfg_get_dmi_override(struct acpi_device *adev, const char *key
> if (strcmp(key, gv->key))
> continue;
>
> - acpi_handle_info(adev->handle, "Using DMI entry %s=%s\n", key, gv->val);
> + acpi_handle_info(adev->handle, "%s: Using DMI entry %s=%s\n",
> + dev_name(&adev->dev), key, gv->val);
> return kstrdup(gv->val, GFP_KERNEL);
> }
>
> @@ -192,7 +194,8 @@ static int gmin_cfg_get_int(struct acpi_device *adev, const char *key, int defau
> return int_val;
>
> out_use_default:
> - acpi_handle_info(adev->handle, "Using default %s=%d\n", key, default_val);
> + acpi_handle_info(adev->handle, "%s: Using default %s=%d\n",
> + dev_name(&adev->dev), key, default_val);
> return default_val;
> }
>
> @@ -235,7 +238,8 @@ static int atomisp_csi2_get_pmc_clk_nr_from_acpi_pr0(struct acpi_device *adev)
> ACPI_FREE(buffer.pointer);
>
> if (ret < 0)
> - acpi_handle_warn(adev->handle, "Could not find PMC clk in _PR0\n");
> + acpi_handle_warn(adev->handle, "%s: Could not find PMC clk in _PR0\n",
> + dev_name(&adev->dev));
>
> return ret;
> }
> @@ -254,7 +258,8 @@ static int atomisp_csi2_set_pmc_clk_freq(struct acpi_device *adev, int clock_num
> clk = clk_get(NULL, name);
> if (IS_ERR(clk)) {
> ret = PTR_ERR(clk);
> - acpi_handle_err(adev->handle, "Error getting clk %s:%d\n", name, ret);
> + acpi_handle_err(adev->handle, "%s: Error getting clk %s: %d\n",
> + dev_name(&adev->dev), name, ret);
> return ret;
> }
>
> @@ -268,7 +273,8 @@ static int atomisp_csi2_set_pmc_clk_freq(struct acpi_device *adev, int clock_num
> if (!ret)
> ret = clk_set_rate(clk, PMC_CLK_RATE_19_2MHZ);
> if (ret)
> - acpi_handle_err(adev->handle, "Error setting clk-rate for %s:%d\n", name, ret);
> + acpi_handle_err(adev->handle, "%s: Error setting clk-rate for %s: %d\n",
> + dev_name(&adev->dev), name, ret);
>
> clk_put(clk);
> return ret;
> @@ -317,7 +323,8 @@ static int atomisp_csi2_handle_acpi_gpio_res(struct acpi_resource *ares, void *_
>
> if (i == data->settings_count) {
> acpi_handle_warn(data->adev->handle,
> - "Could not find DSM GPIO settings for pin %u\n", pin);
> + "%s: Could not find DSM GPIO settings for pin %u\n",
> + dev_name(&data->adev->dev), pin);
> return 1;
> }
>
> @@ -329,7 +336,8 @@ static int atomisp_csi2_handle_acpi_gpio_res(struct acpi_resource *ares, void *_
> name = "powerdown-gpios";
> break;
> default:
> - acpi_handle_warn(data->adev->handle, "Unknown GPIO type 0x%02lx for pin %u\n",
> + acpi_handle_warn(data->adev->handle, "%s: Unknown GPIO type 0x%02lx for pin %u\n",
> + dev_name(&data->adev->dev),
> INTEL_GPIO_DSM_TYPE(settings), pin);
> return 1;
> }
> @@ -354,7 +362,8 @@ static int atomisp_csi2_handle_acpi_gpio_res(struct acpi_resource *ares, void *_
> data->map->mapping[i].size = 1;
> data->map_count++;
>
> - acpi_handle_info(data->adev->handle, "%s crs %d %s pin %u active-%s\n", name,
> + acpi_handle_info(data->adev->handle, "%s: %s crs %d %s pin %u active-%s\n",
> + dev_name(&data->adev->dev), name,
> data->res_count - 1, agpio->resource_source.string_ptr,
> pin, active_low ? "low" : "high");
>
> @@ -391,7 +400,8 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev)
> obj = acpi_evaluate_dsm_typed(adev->handle, &intel_sensor_module_guid,
> 0x00, 1, NULL, ACPI_TYPE_STRING);
> if (obj) {
> - acpi_handle_info(adev->handle, "Sensor module id: '%s'\n", obj->string.pointer);
> + acpi_handle_info(adev->handle, "%s: Sensor module id: '%s'\n",
> + dev_name(&adev->dev), obj->string.pointer);
> ACPI_FREE(obj);
> }
>
> @@ -405,7 +415,8 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev)
> &intel_sensor_gpio_info_guid, 0x00, 1,
> NULL, ACPI_TYPE_INTEGER);
> if (!obj) {
> - acpi_handle_err(adev->handle, "No _DSM entry for GPIO pin count\n");
> + acpi_handle_err(adev->handle, "%s: No _DSM entry for GPIO pin count\n",
> + dev_name(&adev->dev));
> return -EIO;
> }
>
> @@ -413,7 +424,9 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev)
> ACPI_FREE(obj);
>
> if (data.settings_count > CSI2_MAX_ACPI_GPIOS) {
> - acpi_handle_err(adev->handle, "Too many GPIOs %u > %u\n", data.settings_count, CSI2_MAX_ACPI_GPIOS);
> + acpi_handle_err(adev->handle, "%s: Too many GPIOs %u > %u\n",
> + dev_name(&adev->dev), data.settings_count,
> + CSI2_MAX_ACPI_GPIOS);
> return -EOVERFLOW;
> }
>
> @@ -427,7 +440,8 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev)
> 0x00, i + 2,
> NULL, ACPI_TYPE_INTEGER);
> if (!obj) {
> - acpi_handle_err(adev->handle, "No _DSM entry for pin %u\n", i);
> + acpi_handle_err(adev->handle, "%s: No _DSM entry for pin %u\n",
> + dev_name(&adev->dev), i);
> return -EIO;
> }
>
> @@ -442,7 +456,8 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev)
> INTEL_GPIO_DSM_PIN(data.settings[j]))
> continue;
>
> - acpi_handle_err(adev->handle, "Duplicate pin number %lu\n",
> + acpi_handle_err(adev->handle, "%s: Duplicate pin number %lu\n",
> + dev_name(&adev->dev),
> INTEL_GPIO_DSM_PIN(data.settings[i]));
> return -EIO;
> }
> @@ -463,12 +478,14 @@ static int atomisp_csi2_add_gpio_mappings(struct acpi_device *adev)
>
> if (data.map_count != data.settings_count ||
> data.res_count != data.settings_count)
> - acpi_handle_warn(adev->handle, "ACPI GPIO resources vs DSM GPIO-info count mismatch (dsm: %d res: %d map %d\n",
> - data.settings_count, data.res_count, data.map_count);
> + acpi_handle_warn(adev->handle, "%s: ACPI GPIO resources vs DSM GPIO-info count mismatch (dsm: %d res: %d map %d\n",
> + dev_name(&adev->dev), data.settings_count,
> + data.res_count, data.map_count);
>
> ret = acpi_dev_add_driver_gpios(adev, data.map->mapping);
> if (ret)
> - acpi_handle_err(adev->handle, "Error adding driver GPIOs: %d\n", ret);
> + acpi_handle_err(adev->handle, "%s: Error adding driver GPIOs: %d\n",
> + dev_name(&adev->dev), ret);
>
> return ret;
> }
> --
> 2.41.0
>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2023-07-06 10:09 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 21:29 [PATCH v3 00/18] media: ipu-bridge: Shared with atomisp, rework VCM instantiation Hans de Goede
2023-07-05 21:29 ` [PATCH v3 01/18] media: ipu-bridge: Fix null pointer deref on SSDB/PLD parsing warnings Hans de Goede
2023-07-06 13:07 ` Dan Scally
2023-07-05 21:29 ` [PATCH v3 02/18] media: ipu-bridge: Do not use on stack memory for software_node.name field Hans de Goede
2023-07-05 21:29 ` [PATCH v3 03/18] media: ipu-bridge: Move initialization of node_names.vcm to ipu_bridge_init_swnode_names() Hans de Goede
2023-07-05 21:29 ` [PATCH v3 04/18] media: ipu-bridge: Allow building as module Hans de Goede
2023-07-06 9:47 ` Andy Shevchenko
2023-07-05 21:29 ` [PATCH v3 05/18] media: ipu-bridge: Make ipu_bridge_init() take a regular struct device as argument Hans de Goede
2023-07-05 21:29 ` [PATCH v3 06/18] media: ipu-bridge: Store dev pointer in struct ipu_bridge Hans de Goede
2023-07-05 21:29 ` [PATCH v3 07/18] media: ipu-bridge: Only keep PLD around while parsing Hans de Goede
2023-07-05 21:30 ` [PATCH v3 08/18] media: ipu-bridge: Add a ipu_bridge_parse_ssdb() helper function Hans de Goede
2023-07-05 21:30 ` [PATCH v3 09/18] media: ipu-bridge: Drop early setting of sensor->adev Hans de Goede
2023-07-05 21:30 ` [PATCH v3 10/18] media: ipu-bridge: Add a parse_sensor_fwnode callback to ipu_bridge_init() Hans de Goede
2023-07-06 9:50 ` Andy Shevchenko
2023-07-05 21:30 ` [PATCH v3 11/18] media: ipu-bridge: Move ipu-bridge.h to include/media/ Hans de Goede
2023-07-05 21:30 ` [PATCH v3 12/18] media: ipu-bridge: Add GalaxyCore GC0310 to ipu_supported_sensors[] Hans de Goede
2023-07-05 21:30 ` [PATCH v3 13/18] media: ipu-bridge: Add a runtime-pm device-link between VCM and sensor Hans de Goede
2023-07-05 21:30 ` [PATCH v3 14/18] media: i2c: Add driver for DW9719 VCM Hans de Goede
2023-07-06 7:47 ` Sakari Ailus
2023-07-06 9:14 ` Andy Shevchenko
2023-07-06 9:30 ` Sakari Ailus
2023-07-06 10:06 ` Andy Shevchenko
2023-07-06 10:27 ` Sakari Ailus
2023-07-06 10:48 ` Andy Shevchenko
2023-07-06 11:02 ` Sakari Ailus
2023-07-06 14:34 ` Hans de Goede
2023-07-06 14:47 ` Andy Shevchenko
2023-07-06 11:18 ` Dave Stevenson
2023-07-06 12:34 ` Hans de Goede
2023-07-06 12:52 ` Hans de Goede
2023-07-05 21:30 ` [PATCH v3 15/18] ACPI: bus: Introduce acpi_match_acpi_device() function Hans de Goede
2023-07-06 9:19 ` Andy Shevchenko
2023-07-06 12:29 ` Hans de Goede
2023-07-06 12:40 ` Andy Shevchenko
2023-07-06 13:26 ` Rafael J. Wysocki
2023-07-06 13:28 ` Hans de Goede
2023-07-06 13:31 ` Andy Shevchenko
2023-07-05 21:30 ` [PATCH v3 16/18] media: atomisp: csi2-bridge: Switch to new common ipu_bridge_init() Hans de Goede
2023-07-05 21:30 ` [PATCH v3 17/18] media: atomisp: csi2-bridge: Add dev_name() to acpi_handle_info() logging Hans de Goede
2023-07-06 10:09 ` Andy Shevchenko [this message]
2023-07-06 11:12 ` Laurent Pinchart
2023-07-06 12:23 ` Andy Shevchenko
2023-07-06 13:07 ` Laurent Pinchart
2023-07-06 13:22 ` Andy Shevchenko
2023-07-06 13:43 ` Sakari Ailus
2023-07-05 21:30 ` [PATCH v3 18/18] media: atomisp: csi2-bridge: Add support for VCM I2C-client instantiation Hans de Goede
2023-07-06 10:15 ` Andy Shevchenko
2023-07-06 12:31 ` Hans de Goede
2023-07-06 12:42 ` Andy Shevchenko
2023-07-06 12:47 ` Hans de Goede
2023-07-06 12:56 ` Andy Shevchenko
2023-07-06 12:58 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZKaS2UbkbkbfYqAe@smile.fi.intel.com \
--to=andy@kernel.org \
--cc=bingbu.cao@intel.com \
--cc=dan.scally@ideasonboard.com \
--cc=hao.yao@intel.com \
--cc=hdegoede@redhat.com \
--cc=hpa@redhat.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=rafael@kernel.org \
--cc=sakari.ailus@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox