Skip to content

Commit 0907495

Browse files
committed
ARC: add/fix some comments in code - no functional change
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
1 parent 6de6066 commit 0907495

6 files changed

Lines changed: 23 additions & 22 deletions

File tree

‎arch/arc/boot/dts/axc003.dtsi‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@
7272
};
7373

7474
/*
75-
* This INTC is actually connected to DW APB GPIO
76-
* which acts as a wire between MB INTC and CPU INTC.
77-
* GPIO INTC is configured in platform init code
78-
* and here we mimic direct connection from MB INTC to
79-
* CPU INTC, thus we set "interrupts = <7>" instead of
80-
* "interrupts = <12>"
75+
* The DW APB ICTL intc on MB is connected to CPU intc via a
76+
* DT "invisible" DW APB GPIO block, configured to simply pass thru
77+
* interrupts - setup accordinly in platform init (plat-axs10x/ax10x.c)
78+
*
79+
* So here we mimic a direct connection betwen them, ignoring the
80+
* ABPG GPIO. Thus set "interrupts = <24>" (DW APB GPIO to core)
81+
* instead of "interrupts = <12>" (DW APB ICTL to DW APB GPIO)
8182
*
8283
* This intc actually resides on MB, but we move it here to
8384
* avoid duplicating the MB dtsi file given that IRQ from

‎arch/arc/include/asm/cmpxchg.h‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,18 @@ static inline unsigned long __xchg(unsigned long val, volatile void *ptr,
110110
sizeof(*(ptr))))
111111

112112
/*
113-
* On ARC700, EX insn is inherently atomic, so by default "vanilla" xchg() need
114-
* not require any locking. However there's a quirk.
115-
* ARC lacks native CMPXCHG, thus emulated (see above), using external locking -
116-
* incidently it "reuses" the same atomic_ops_lock used by atomic APIs.
117-
* Now, llist code uses cmpxchg() and xchg() on same data, so xchg() needs to
118-
* abide by same serializing rules, thus ends up using atomic_ops_lock as well.
113+
* xchg() maps directly to ARC EX instruction which guarantees atomicity.
114+
* However in !LLSC config, it also needs to be use @atomic_ops_lock spinlock
115+
* due to a subtle reason:
116+
* - For !LLSC, cmpxchg() needs to use that lock (see above) and there is lot
117+
* of kernel code which calls xchg()/cmpxchg() on same data (see llist.h)
118+
* Hence xchg() needs to follow same locking rules.
119119
*
120-
* This however is only relevant if SMP and/or ARC lacks LLSC
121-
* if (UP or LLSC)
122-
* xchg doesn't need serialization
123-
* else <==> !(UP or LLSC) <==> (!UP and !LLSC) <==> (SMP and !LLSC)
124-
* xchg needs serialization
120+
* Technically the lock is also needed for UP (boils down to irq save/restore)
121+
* but we can cheat a bit since cmpxchg() atomic_ops_lock() would cause irqs to
122+
* be disabled thus can't possibly be interrpted/preempted/clobbered by xchg()
123+
* Other way around, xchg is one instruction anyways, so can't be interrupted
124+
* as such
125125
*/
126126

127127
#if !defined(CONFIG_ARC_HAS_LLSC) && defined(CONFIG_SMP)

‎arch/arc/include/asm/perf_event.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ static const char * const arc_pmu_ev_hw_map[] = {
9595

9696
/* counts condition */
9797
[PERF_COUNT_HW_INSTRUCTIONS] = "iall",
98-
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp",
98+
[PERF_COUNT_HW_BRANCH_INSTRUCTIONS] = "ijmp", /* Excludes ZOL jumps */
9999
[PERF_COUNT_ARC_BPOK] = "bpok", /* NP-NT, PT-T, PNT-NT */
100100
[PERF_COUNT_HW_BRANCH_MISSES] = "bpfail", /* NP-T, PT-NT, PNT-T */
101101

‎arch/arc/kernel/perf_event.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ static void arc_pmu_start(struct perf_event *event, int flags)
199199
event->hw.state = 0;
200200

201201
/* enable ARC pmu here */
202-
write_aux_reg(ARC_REG_PCT_INDEX, idx);
203-
write_aux_reg(ARC_REG_PCT_CONFIG, hwc->config);
202+
write_aux_reg(ARC_REG_PCT_INDEX, idx); /* counter # */
203+
write_aux_reg(ARC_REG_PCT_CONFIG, hwc->config); /* condition */
204204
}
205205

206206
static void arc_pmu_stop(struct perf_event *event, int flags)

‎arch/arc/kernel/process.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ asmlinkage void ret_from_fork(void);
6565
* ------------------
6666
* | r25 | <==== top of Stack (thread.ksp)
6767
* ~ ~
68-
* | --to-- | (CALLEE Regs of user mode)
68+
* | --to-- | (CALLEE Regs of kernel mode)
6969
* | r13 |
7070
* ------------------
7171
* | fp |

‎arch/arc/plat-axs10x/axs10x.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ static void __init axs10x_enable_gpio_intc_wire(void)
4646
* ------------------- -------------------
4747
* | snps,dw-apb-gpio | | snps,dw-apb-gpio |
4848
* ------------------- -------------------
49-
* | |
49+
* | #12 |
5050
* | [ Debug UART on cpu card ]
5151
* |
5252
* ------------------------

0 commit comments

Comments
 (0)