Skip to content

Commit

Permalink
Merge tag 'thermal-v6.12-rc7' of ssh://gitolite.kernel.org/pub/scm/li…
Browse files Browse the repository at this point in the history
…nux/kernel/git/thermal/linux

Merge thermal driver fixes for 6.12-rc7 from Daniel Lezcano:

"- Remove a false lockdep backtrace in the LMh driver (Dmitry
   Baryshkov)

 - Fix sampling handler context ptr in the libthermal (Emil Dahl Juhl)

 - Remove the thermal soft link when doing a make clean. The link is
   created at compilation time (Zhang Jiao)

 - Accept thermal zone without trip points as stated in the bindings,
   otherwise the thermal zone fails to initialize (Icenowy Zheng)"

* tag 'thermal-v6.12-rc7' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/thermal/linux:
  thermal/of: support thermal zones w/o trips subnode
  tools/lib/thermal: Remove the thermal.h soft link when doing make clean
  tools/lib/thermal: Fix sampling handler context ptr
  thermal/drivers/qcom/lmh: Remove false lockdep backtrace
  • Loading branch information
rafaeljw committed Nov 4, 2024
2 parents 59b723c + 725f31f commit 5469a8d
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
7 changes: 7 additions & 0 deletions drivers/thermal/qcom/lmh.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@ static struct irq_chip lmh_irq_chip = {
static int lmh_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
{
struct lmh_hw_data *lmh_data = d->host_data;
static struct lock_class_key lmh_lock_key;
static struct lock_class_key lmh_request_key;

/*
* This lock class tells lockdep that GPIO irqs are in a different
* category than their parents, so it won't report false recursion.
*/
irq_set_lockdep_class(irq, &lmh_lock_key, &lmh_request_key);
irq_set_chip_and_handler(irq, &lmh_irq_chip, handle_simple_irq);
irq_set_chip_data(irq, lmh_data);

Expand Down
21 changes: 10 additions & 11 deletions drivers/thermal/thermal_of.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,18 +99,15 @@ static struct thermal_trip *thermal_of_trips_init(struct device_node *np, int *n
struct device_node *trips;
int ret, count;

*ntrips = 0;

trips = of_get_child_by_name(np, "trips");
if (!trips) {
pr_err("Failed to find 'trips' node\n");
return ERR_PTR(-EINVAL);
}
if (!trips)
return NULL;

count = of_get_child_count(trips);
if (!count) {
pr_err("No trip point defined\n");
ret = -EINVAL;
goto out_of_node_put;
}
if (!count)
return NULL;

tt = kzalloc(sizeof(*tt) * count, GFP_KERNEL);
if (!tt) {
Expand All @@ -133,7 +130,6 @@ static struct thermal_trip *thermal_of_trips_init(struct device_node *np, int *n

out_kfree:
kfree(tt);
*ntrips = 0;
out_of_node_put:
of_node_put(trips);

Expand Down Expand Up @@ -401,11 +397,14 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *

trips = thermal_of_trips_init(np, &ntrips);
if (IS_ERR(trips)) {
pr_err("Failed to find trip points for %pOFn id=%d\n", sensor, id);
pr_err("Failed to parse trip points for %pOFn id=%d\n", sensor, id);
ret = PTR_ERR(trips);
goto out_of_node_put;
}

if (!trips)
pr_info("No trip points found for %pOFn id=%d\n", sensor, id);

ret = thermal_of_monitor_init(np, &delay, &pdelay);
if (ret) {
pr_err("Failed to initialize monitoring delays from %pOFn\n", np);
Expand Down
4 changes: 3 additions & 1 deletion tools/lib/thermal/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,9 @@ all: fixdep

clean:
$(call QUIET_CLEAN, libthermal) $(RM) $(LIBTHERMAL_A) \
*.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBTHERMAL_VERSION) .*.d .*.cmd LIBTHERMAL-CFLAGS $(LIBTHERMAL_PC)
*.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBTHERMAL_VERSION) \
.*.d .*.cmd LIBTHERMAL-CFLAGS $(LIBTHERMAL_PC) \
$(srctree)/tools/$(THERMAL_UAPI)

$(LIBTHERMAL_PC):
$(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \
Expand Down
2 changes: 2 additions & 0 deletions tools/lib/thermal/sampling.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ static int handle_thermal_sample(struct nl_msg *n, void *arg)
struct thermal_handler_param *thp = arg;
struct thermal_handler *th = thp->th;

arg = thp->arg;

genlmsg_parse(nlh, 0, attrs, THERMAL_GENL_ATTR_MAX, NULL);

switch (genlhdr->cmd) {
Expand Down

0 comments on commit 5469a8d

Please sign in to comment.