Skip to content

Commit 01e7a84

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller: "Three bug fixes, and TLB flushing one is of particular brown paper bag quality..." * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc: sparc: perf: fix updated event period in response to PERF_EVENT_IOC_PERIOD mdesc: fix a missing-check bug in get_vdev_port_node_info() sparc64: Fix regression in non-hypervisor TLB flush xcall
2 parents f340208 + 56cd0ae commit 01e7a84

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

arch/sparc/kernel/mdesc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ static int get_vdev_port_node_info(struct mdesc_handle *md, u64 node,
356356

357357
node_info->vdev_port.id = *idp;
358358
node_info->vdev_port.name = kstrdup_const(name, GFP_KERNEL);
359+
if (!node_info->vdev_port.name)
360+
return -1;
359361
node_info->vdev_port.parent_cfg_hdl = *parent_cfg_hdlp;
360362

361363
return 0;

arch/sparc/kernel/perf_event.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,10 @@ static int sparc_perf_event_set_period(struct perf_event *event,
891891
s64 period = hwc->sample_period;
892892
int ret = 0;
893893

894+
/* The period may have been changed by PERF_EVENT_IOC_PERIOD */
895+
if (unlikely(period != hwc->last_period))
896+
left = period - (hwc->last_period - left);
897+
894898
if (unlikely(left <= -period)) {
895899
left = period;
896900
local64_set(&hwc->period_left, left);

arch/sparc/mm/ultra.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ xcall_flush_tlb_kernel_range: /* 44 insns */
587587
sub %g7, %g1, %g3
588588
srlx %g3, 18, %g2
589589
brnz,pn %g2, 2f
590-
add %g2, 1, %g2
590+
sethi %hi(PAGE_SIZE), %g2
591591
sub %g3, %g2, %g3
592592
or %g1, 0x20, %g1 ! Nucleus
593593
1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP
@@ -751,7 +751,7 @@ __cheetah_xcall_flush_tlb_kernel_range: /* 44 insns */
751751
sub %g7, %g1, %g3
752752
srlx %g3, 18, %g2
753753
brnz,pn %g2, 2f
754-
add %g2, 1, %g2
754+
sethi %hi(PAGE_SIZE), %g2
755755
sub %g3, %g2, %g3
756756
or %g1, 0x20, %g1 ! Nucleus
757757
1: stxa %g0, [%g1 + %g3] ASI_DMMU_DEMAP

0 commit comments

Comments
 (0)