diff --git "a/\\" "b/\\" new file mode 100644 index 0000000000000000000000000000000000000000..eab7889a17224a57eb1117bfb04d38180abff938 --- /dev/null +++ "b/\\" @@ -0,0 +1,34 @@ +hwmon: Fix the missing of 'average' word in hwmon_power_attr_templates + +ANBZ: #26346 + +commit 232427772fc123942d110c18269cfbdf40edae18 upstream + +The string "power%d_interval_max" and "power%d_interval_min" in the +hwmon_power_attr_templates[] are corresponding to the sysfs interface name +of hwmon_power_average_interval_max and hwmon_power_average_interval_min. +But the 'average' word is missing in two strings. Fortunately, there is +no driver to use it yet. + +Signed-off-by: Huisong Li +Link: https://lore.kernel.org/r/20250304074640.2770353-1-lihuisong@huawei.com +Signed-off-by: Guenter Roeck + +# Please enter the commit message for your changes. Lines starting +# with '#' will be ignored, and an empty message aborts the commit. +# +# Author: Huisong Li +# Date: Tue Mar 4 15:46:40 2025 +0800 +# +# interactive rebase in progress; onto f8bce50aa552 +# Last commands done (6 commands done): +# reword 81ff9f4824e9 hwmon: (acpi_power_meter) Fix fail to load module on platform without _PMD method +# reword 2bd77b23ae17 hwmon: Fix the missing of 'average' word in hwmon_power_attr_templates +# Next commands to do (8 remaining commands): +# reword b2fde4dbeef9 hwmon: (acpi_power_meter) Ensure IPMI space handler is ready on Dell systems +# reword b2320c49d82a ACPI: PCC: Add PCC shared memory region command and status bitfields +# You are currently editing a commit while rebasing branch 'devel-5.10-power-meter2' on 'f8bce50aa552'. +# +# Changes to be committed: +# modified: drivers/hwmon/hwmon.c +# diff --git a/drivers/base/core.c b/drivers/base/core.c index 547d21faff3a8efec785eb1041e0d184cc5d665f..945cd04fc4282b3328e28a1373a4979857aed835 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -4388,6 +4388,12 @@ int device_match_acpi_dev(struct device *dev, const void *adev) } EXPORT_SYMBOL(device_match_acpi_dev); +int device_match_acpi_handle(struct device *dev, const void *handle) +{ + return ACPI_HANDLE(dev) == handle; +} +EXPORT_SYMBOL(device_match_acpi_handle); + int device_match_any(struct device *dev, const void *unused) { return 1; diff --git a/drivers/char/tpm/tpm_tis_core.c b/drivers/char/tpm/tpm_tis_core.c index b3452259d6e0b6e82c5bc723c36d622d1c059d75..ee253f421b231f6fa9fbf27c23a7e96bcea6ba88 100644 --- a/drivers/char/tpm/tpm_tis_core.c +++ b/drivers/char/tpm/tpm_tis_core.c @@ -779,7 +779,6 @@ static int tpm_tis_probe_irq_single(struct tpm_chip *chip, u32 intmask, int rc; u32 int_status; - rc = devm_request_threaded_irq(chip->dev.parent, irq, NULL, tis_int_handler, IRQF_ONESHOT | flags, dev_name(&chip->dev), chip); diff --git a/drivers/gpio/gpiolib-acpi.c b/drivers/gpio/gpiolib-acpi.c index 44ee319da1b357c9cd105419c5593683373d40d1..266d33d4151116d03f0cb964f5f391045731a8e8 100644 --- a/drivers/gpio/gpiolib-acpi.c +++ b/drivers/gpio/gpiolib-acpi.c @@ -95,10 +95,23 @@ static bool acpi_gpio_deferred_req_irqs_done; static int acpi_gpiochip_find(struct gpio_chip *gc, void *data) { - if (!gc->parent) - return false; + /* First check the actual GPIO device */ + if (device_match_acpi_handle(&gc->gpiodev->dev, data)) + return true; - return ACPI_HANDLE(gc->parent) == data; + /* + * When the ACPI device is artificially split to the banks of GPIOs, + * where each of them is represented by a separate GPIO device, + * the firmware node of the physical device may not be shared among + * the banks as they may require different values for the same property, + * e.g., number of GPIOs in a certain bank. In such case the ACPI handle + * of a GPIO device is NULL and can not be used. Hence we have to check + * the parent device to be sure that there is no match before bailing + * out. + */ + if (gc->parent) + return device_match_acpi_handle(gc->parent, data); + return false; } /** diff --git a/drivers/spi/spi-hisi-kunpeng.c b/drivers/spi/spi-hisi-kunpeng.c index 54730e93fba45a4286623389704cb9c0e9aba988..8d75e57fc1d5f0f0fed711783dfc62461d79ab00 100644 --- a/drivers/spi/spi-hisi-kunpeng.c +++ b/drivers/spi/spi-hisi-kunpeng.c @@ -164,8 +164,8 @@ static int hisi_spi_debugfs_init(struct hisi_spi *hs) struct spi_controller *master; - master = container_of(hs->dev, struct spi_controller, dev); - snprintf(name, 32, "hisi_spi%d", master->bus_num); + master = hs->dev->driver_data; + snprintf(name, 32, "hisi_spi%d", host->bus_num); hs->debugfs = debugfs_create_dir(name, NULL); if (!hs->debugfs) return -ENOMEM; @@ -481,6 +481,9 @@ static int hisi_spi_probe(struct platform_device *pdev) return -EINVAL; } + if (host->max_speed_hz == 0) + return dev_err_probe(dev, -EINVAL, "spi-max-frequency can't be 0\n"); + ret = device_property_read_u16(dev, "num-cs", &master->num_chipselect); if (ret) @@ -495,6 +498,7 @@ static int hisi_spi_probe(struct platform_device *pdev) master->transfer_one = hisi_spi_transfer_one; master->handle_err = hisi_spi_handle_err; master->dev.fwnode = dev->fwnode; + master->min_speed_hz = DIV_ROUND_UP(host->max_speed_hz, CLK_DIV_MAX); hisi_spi_hw_init(hs); diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index 3e1212b6fb58921bb2e1f280bd6b1b3e1a70841e..0fd1117d184820bb9226d3d030f5d9ebec1ecb29 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -147,6 +147,7 @@ int device_match_of_node(struct device *dev, const void *np); int device_match_fwnode(struct device *dev, const void *fwnode); int device_match_devt(struct device *dev, const void *pdevt); int device_match_acpi_dev(struct device *dev, const void *adev); +int device_match_acpi_handle(struct device *dev, const void *handle); int device_match_any(struct device *dev, const void *unused); /* iterator helpers for buses */