Skip to content

Commit 5469a8d

Browse files
committed
Merge tag 'thermal-v6.12-rc7' of ssh://gitolite.kernel.org/pub/scm/linux/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
2 parents 59b723c + 725f31f commit 5469a8d

File tree

4 files changed

+22
-12
lines changed

4 files changed

+22
-12
lines changed

drivers/thermal/qcom/lmh.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,14 @@ static struct irq_chip lmh_irq_chip = {
7373
static int lmh_irq_map(struct irq_domain *d, unsigned int irq, irq_hw_number_t hw)
7474
{
7575
struct lmh_hw_data *lmh_data = d->host_data;
76+
static struct lock_class_key lmh_lock_key;
77+
static struct lock_class_key lmh_request_key;
7678

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

drivers/thermal/thermal_of.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,15 @@ static struct thermal_trip *thermal_of_trips_init(struct device_node *np, int *n
9999
struct device_node *trips;
100100
int ret, count;
101101

102+
*ntrips = 0;
103+
102104
trips = of_get_child_by_name(np, "trips");
103-
if (!trips) {
104-
pr_err("Failed to find 'trips' node\n");
105-
return ERR_PTR(-EINVAL);
106-
}
105+
if (!trips)
106+
return NULL;
107107

108108
count = of_get_child_count(trips);
109-
if (!count) {
110-
pr_err("No trip point defined\n");
111-
ret = -EINVAL;
112-
goto out_of_node_put;
113-
}
109+
if (!count)
110+
return NULL;
114111

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

134131
out_kfree:
135132
kfree(tt);
136-
*ntrips = 0;
137133
out_of_node_put:
138134
of_node_put(trips);
139135

@@ -401,11 +397,14 @@ static struct thermal_zone_device *thermal_of_zone_register(struct device_node *
401397

402398
trips = thermal_of_trips_init(np, &ntrips);
403399
if (IS_ERR(trips)) {
404-
pr_err("Failed to find trip points for %pOFn id=%d\n", sensor, id);
400+
pr_err("Failed to parse trip points for %pOFn id=%d\n", sensor, id);
405401
ret = PTR_ERR(trips);
406402
goto out_of_node_put;
407403
}
408404

405+
if (!trips)
406+
pr_info("No trip points found for %pOFn id=%d\n", sensor, id);
407+
409408
ret = thermal_of_monitor_init(np, &delay, &pdelay);
410409
if (ret) {
411410
pr_err("Failed to initialize monitoring delays from %pOFn\n", np);

tools/lib/thermal/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ all: fixdep
121121

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

126128
$(LIBTHERMAL_PC):
127129
$(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \

tools/lib/thermal/sampling.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ static int handle_thermal_sample(struct nl_msg *n, void *arg)
1616
struct thermal_handler_param *thp = arg;
1717
struct thermal_handler *th = thp->th;
1818

19+
arg = thp->arg;
20+
1921
genlmsg_parse(nlh, 0, attrs, THERMAL_GENL_ATTR_MAX, NULL);
2022

2123
switch (genlhdr->cmd) {

0 commit comments

Comments
 (0)