Skip to content

Commit fe6f8e9

Browse files
committed
Merge tag 'powerpc-7.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from Madhavan Srinivasan: - Fix preempt count leak in sysfs show paths - Fix error handling in pika_dtm_thread - Remove pmac_low_i2c_{lock,unlock}() - Enable all windfarms by default - Fix dead default for GUEST_STATE_BUFFER_TEST - Remove redundant preempt_disable|enable() calls from arch_irq_work_raise() Thanks to Aboorva Devarajan, Ally Heev, Amit Machhiwal, Bart Van Assche, Christophe Leroy, Christophe Leroy (CS GROUP), Dan Carpenter, Gautam Menghani, Harsh Prateek Bora, Julian Braha, Krzysztof Kozlowski, Linus Walleij, Ma Ke, Ritesh Harjani (IBM), and Sayali Patil * tag 'powerpc-7.1-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/time: Remove redundant preempt_disable|enable() calls from arch_irq_work_raise() powerpc/hv-gpci: fix preempt count leak in sysfs show paths powerpc: fix dead default for GUEST_STATE_BUFFER_TEST powerpc/powermac: Remove pmac_low_i2c_{lock,unlock}() powerpc/warp: Fix error handling in pika_dtm_thread powerpc: 82xx: fix uninitialized pointers with free attribute powerpc/g5: Enable all windfarms by default
2 parents b6a08b0 + 31467b2 commit fe6f8e9

8 files changed

Lines changed: 27 additions & 52 deletions

File tree

arch/powerpc/Kconfig.debug

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,10 @@ config MSI_BITMAP_SELFTEST
8383
depends on DEBUG_KERNEL
8484

8585
config GUEST_STATE_BUFFER_TEST
86-
def_tristate n
86+
def_tristate KUNIT_ALL_TESTS
8787
prompt "Enable Guest State Buffer unit tests"
8888
depends on KUNIT
8989
depends on KVM_BOOK3S_HV_POSSIBLE
90-
default KUNIT_ALL_TESTS
9190
help
9291
The Guest State Buffer is a data format specified in the PAPR.
9392
It is by hcalls to communicate the state of L2 guests between

arch/powerpc/configs/g5_defconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ CONFIG_PMAC_SMU=y
8585
CONFIG_MAC_EMUMOUSEBTN=y
8686
CONFIG_WINDFARM=y
8787
CONFIG_WINDFARM_PM81=y
88+
CONFIG_WINDFARM_PM72=y
89+
CONFIG_WINDFARM_RM31=y
8890
CONFIG_WINDFARM_PM91=y
8991
CONFIG_WINDFARM_PM112=y
9092
CONFIG_WINDFARM_PM121=y

arch/powerpc/include/asm/pmac_low_i2c.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ extern int pmac_i2c_match_adapter(struct device_node *dev,
7979
struct i2c_adapter *adapter);
8080

8181

82-
/* (legacy) Locking functions exposed to i2c-keywest */
83-
extern int pmac_low_i2c_lock(struct device_node *np);
84-
extern int pmac_low_i2c_unlock(struct device_node *np);
85-
8682
/* Access functions for platform code */
8783
extern int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled);
8884
extern void pmac_i2c_close(struct pmac_i2c_bus *bus);

arch/powerpc/kernel/time.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,10 @@ DEFINE_PER_CPU(u8, irq_work_pending);
458458

459459
#endif /* 32 vs 64 bit */
460460

461+
/*
462+
* Must be called with preemption disabled since it updates
463+
* per-CPU irq_work state and programs the local CPU decrementer.
464+
*/
461465
void arch_irq_work_raise(void)
462466
{
463467
/*
@@ -471,10 +475,8 @@ void arch_irq_work_raise(void)
471475
* which could get tangled up if we're messing with the same state
472476
* here.
473477
*/
474-
preempt_disable();
475478
set_irq_work_pending_flag();
476479
set_dec(1);
477-
preempt_enable();
478480
}
479481

480482
static void set_dec_or_work(u64 val)

arch/powerpc/perf/hv-gpci.c

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ static ssize_t processor_bus_topology_show(struct device *dev, struct device_att
210210
0, 0, buf, &n, arg);
211211

212212
if (!ret)
213-
return n;
213+
goto out_success;
214214

215215
if (ret != H_PARAMETER)
216216
goto out;
@@ -244,12 +244,14 @@ static ssize_t processor_bus_topology_show(struct device *dev, struct device_att
244244
starting_index, 0, buf, &n, arg);
245245

246246
if (!ret)
247-
return n;
247+
goto out_success;
248248

249249
if (ret != H_PARAMETER)
250250
goto out;
251251
}
252252

253+
out_success:
254+
put_cpu_var(hv_gpci_reqb);
253255
return n;
254256

255257
out:
@@ -278,7 +280,7 @@ static ssize_t processor_config_show(struct device *dev, struct device_attribute
278280
0, 0, buf, &n, arg);
279281

280282
if (!ret)
281-
return n;
283+
goto out_success;
282284

283285
if (ret != H_PARAMETER)
284286
goto out;
@@ -312,12 +314,14 @@ static ssize_t processor_config_show(struct device *dev, struct device_attribute
312314
starting_index, 0, buf, &n, arg);
313315

314316
if (!ret)
315-
return n;
317+
goto out_success;
316318

317319
if (ret != H_PARAMETER)
318320
goto out;
319321
}
320322

323+
out_success:
324+
put_cpu_var(hv_gpci_reqb);
321325
return n;
322326

323327
out:
@@ -346,7 +350,7 @@ static ssize_t affinity_domain_via_virtual_processor_show(struct device *dev,
346350
0, 0, buf, &n, arg);
347351

348352
if (!ret)
349-
return n;
353+
goto out_success;
350354

351355
if (ret != H_PARAMETER)
352356
goto out;
@@ -382,12 +386,14 @@ static ssize_t affinity_domain_via_virtual_processor_show(struct device *dev,
382386
starting_index, secondary_index, buf, &n, arg);
383387

384388
if (!ret)
385-
return n;
389+
goto out_success;
386390

387391
if (ret != H_PARAMETER)
388392
goto out;
389393
}
390394

395+
out_success:
396+
put_cpu_var(hv_gpci_reqb);
391397
return n;
392398

393399
out:
@@ -416,7 +422,7 @@ static ssize_t affinity_domain_via_domain_show(struct device *dev, struct device
416422
0, 0, buf, &n, arg);
417423

418424
if (!ret)
419-
return n;
425+
goto out_success;
420426

421427
if (ret != H_PARAMETER)
422428
goto out;
@@ -448,12 +454,14 @@ static ssize_t affinity_domain_via_domain_show(struct device *dev, struct device
448454
starting_index, 0, buf, &n, arg);
449455

450456
if (!ret)
451-
return n;
457+
goto out_success;
452458

453459
if (ret != H_PARAMETER)
454460
goto out;
455461
}
456462

463+
out_success:
464+
put_cpu_var(hv_gpci_reqb);
457465
return n;
458466

459467
out:

arch/powerpc/platforms/44x/warp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ static int pika_dtm_thread(void __iomem *fpga)
293293
schedule_timeout(HZ);
294294
}
295295

296+
put_device(&client->dev);
297+
296298
return 0;
297299
}
298300

arch/powerpc/platforms/82xx/km82xx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727

2828
static void __init km82xx_pic_init(void)
2929
{
30-
struct device_node *np __free(device_node);
31-
np = of_find_compatible_node(NULL, NULL, "fsl,pq2-pic");
30+
struct device_node *np __free(device_node) = of_find_compatible_node(NULL,
31+
NULL, "fsl,pq2-pic");
3232

3333
if (!np) {
3434
pr_err("PIC init: can not find cpm-pic node\n");

arch/powerpc/platforms/powermac/low_i2c.c

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,40 +1058,6 @@ int pmac_i2c_match_adapter(struct device_node *dev, struct i2c_adapter *adapter)
10581058
}
10591059
EXPORT_SYMBOL_GPL(pmac_i2c_match_adapter);
10601060

1061-
int pmac_low_i2c_lock(struct device_node *np)
1062-
{
1063-
struct pmac_i2c_bus *bus, *found = NULL;
1064-
1065-
list_for_each_entry(bus, &pmac_i2c_busses, link) {
1066-
if (np == bus->controller) {
1067-
found = bus;
1068-
break;
1069-
}
1070-
}
1071-
if (!found)
1072-
return -ENODEV;
1073-
return pmac_i2c_open(bus, 0);
1074-
}
1075-
EXPORT_SYMBOL_GPL(pmac_low_i2c_lock);
1076-
1077-
int pmac_low_i2c_unlock(struct device_node *np)
1078-
{
1079-
struct pmac_i2c_bus *bus, *found = NULL;
1080-
1081-
list_for_each_entry(bus, &pmac_i2c_busses, link) {
1082-
if (np == bus->controller) {
1083-
found = bus;
1084-
break;
1085-
}
1086-
}
1087-
if (!found)
1088-
return -ENODEV;
1089-
pmac_i2c_close(bus);
1090-
return 0;
1091-
}
1092-
EXPORT_SYMBOL_GPL(pmac_low_i2c_unlock);
1093-
1094-
10951061
int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled)
10961062
{
10971063
int rc;

0 commit comments

Comments
 (0)