Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

powerpc/dscr: Add some in-code documentation

This patch adds some in-code documentation to the DSCR related code to
make it more readable without having any functional change to it.

Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Anshuman Khandual and committed by
Michael Ellerman
d3cb06e0 1db36525

+47
+9
arch/powerpc/include/asm/processor.h
··· 295 295 #endif 296 296 #ifdef CONFIG_PPC64 297 297 unsigned long dscr; 298 + /* 299 + * This member element dscr_inherit indicates that the process 300 + * has explicitly attempted and changed the DSCR register value 301 + * for itself. Hence kernel wont use the default CPU DSCR value 302 + * contained in the PACA structure anymore during process context 303 + * switch. Once this variable is set, this behaviour will also be 304 + * inherited to all the children of this process from that point 305 + * onwards. 306 + */ 298 307 int dscr_inherit; 299 308 unsigned long ppr; /* used to save/restore SMT priority */ 300 309 #endif
+38
arch/powerpc/kernel/sysfs.c
··· 496 496 static DEVICE_ATTR(purr, 0400, show_purr, store_purr); 497 497 static DEVICE_ATTR(pir, 0400, show_pir, NULL); 498 498 499 + /* 500 + * This is the system wide DSCR register default value. Any 501 + * change to this default value through the sysfs interface 502 + * will update all per cpu DSCR default values across the 503 + * system stored in their respective PACA structures. 504 + */ 499 505 static unsigned long dscr_default; 500 506 507 + /** 508 + * read_dscr() - Fetch the cpu specific DSCR default 509 + * @val: Returned cpu specific DSCR default value 510 + * 511 + * This function returns the per cpu DSCR default value 512 + * for any cpu which is contained in it's PACA structure. 513 + */ 501 514 static void read_dscr(void *val) 502 515 { 503 516 *(unsigned long *)val = get_paca()->dscr_default; 504 517 } 505 518 519 + 520 + /** 521 + * write_dscr() - Update the cpu specific DSCR default 522 + * @val: New cpu specific DSCR default value to update 523 + * 524 + * This function updates the per cpu DSCR default value 525 + * for any cpu which is contained in it's PACA structure. 526 + */ 506 527 static void write_dscr(void *val) 507 528 { 508 529 get_paca()->dscr_default = *(unsigned long *)val; ··· 541 520 attr->attr.mode |= 0200; 542 521 } 543 522 523 + /** 524 + * show_dscr_default() - Fetch the system wide DSCR default 525 + * @dev: Device structure 526 + * @attr: Device attribute structure 527 + * @buf: Interface buffer 528 + * 529 + * This function returns the system wide DSCR default value. 530 + */ 544 531 static ssize_t show_dscr_default(struct device *dev, 545 532 struct device_attribute *attr, char *buf) 546 533 { 547 534 return sprintf(buf, "%lx\n", dscr_default); 548 535 } 549 536 537 + /** 538 + * store_dscr_default() - Update the system wide DSCR default 539 + * @dev: Device structure 540 + * @attr: Device attribute structure 541 + * @buf: Interface buffer 542 + * @count: Size of the update 543 + * 544 + * This function updates the system wide DSCR default value. 545 + */ 550 546 static ssize_t __used store_dscr_default(struct device *dev, 551 547 struct device_attribute *attr, const char *buf, 552 548 size_t count)