summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/misc
AgeCommit message (Expand)Author
2020-06-18dt: fix reference to olpc,xo1.75-ec.txtMauro Carvalho Chehab
2020-03-31dt-bindings: Add missing 'additionalProperties: false'Rob Herring
2020-02-24docs: dt: fix several broken references due to renamesMauro Carvalho Chehab
2019-12-17dt-bindings: misc: Document reg for aspeed, p2a-ctrl nodesAndrew Jeffery
2019-11-14dt-bindings: Add syscon YAML descriptionMaxime Ripard
2019-08-21Merge tag 'v5.3-rc5' into develLinus Walleij
2019-08-05dt-bindings: aspeed: Remove mention of deprecated compatiblesAndrew Jeffery
2019-07-26dt-bindings: Fix more $id value mismatches filenamesRob Herring
2019-07-19Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/s...Linus Torvalds
2019-07-14Merge tag 'platform-drivers-x86-v5.3-1' of git://git.infradead.org/linux-plat...Linus Torvalds
2019-06-21dt-bindings: xilinx-sdfec: Add SDFEC bindingDragan Cvetic
2019-05-20Documentation: DT: Add entry for DPAA2 consoleIoana Ciornei
2019-05-20dt-bindings: olpc,xo1.75-ec: Add OLPC XO-1.75 EC bindingsLubomir Rintel
2019-05-16Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/socLinus Torvalds
2019-04-25dt-bindings: misc: aspeed-p2a-ctrl: add supportPatrick Venture
2019-04-23soc: ixp4xx: qmgr: Add DT bindings for IXP4xx qmgrLinus Walleij
2019-02-12misc: dt-bindings: Add Qualcomm Fastrpc bindingsSrinivas Kandagatla
2018-12-28Merge tag 'char-misc-4.21-rc1' of git://git.kernel.org/pub/scm/linux/kernel/g...Linus Torvalds
2018-12-05net: documentation: build a directory structure for driversJakub Kicinski
2018-11-07dt-bindings: misc/pvpanic: add document for pvpanic-mmioPeng Hao
2018-10-26Merge tag 'devicetree-for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/...Linus Torvalds
2018-10-15dt-bindings: misc: bk4: Add device tree binding for Liebherr's BK4 SPI busLukasz Majewski
2018-09-25Documentation: fsl-mc: add iommu-map device-tree binding for fsl-mc busNipun Gupta
2018-07-10dt-bindings: misc: ASPEED coprocessor interrupt controllerBenjamin Herrenschmidt
2018-02-12auxdisplay: Move arm-charlcd binding to correct folderAndy Shevchenko
2017-12-21Merge tag 'tegra-for-4.16-dt-bindings' of ssh://gitolite.kernel.org/pub/scm/l...Arnd Bergmann
2017-12-13dt-bindings: misc: Add Tegra186 MISC registers bindingsThierry Reding
2017-12-06dt-bindings: Remove leading 0x from bindings notationMathieu Malaterre
2017-09-20dt-bindings: misc: achc: Add device tree binding for GE ACHCMartyn Welch
2017-09-05dt-bindings: Remove "status" from examplesRob Herring
2017-06-20dt-bindings: syscon: Add DT bindings documentation for Allwinner V3s sysconIcenowy Zheng
2017-06-01dt-bindings: syscon: Add DT bindings documentation for Allwinner sysconLABBE Corentin
2017-02-23Merge tag 'sound-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/t...Linus Torvalds
2017-01-19eeprom: Add IDT 89HPESx driver bindings fileSerge Semin
2016-12-15misc: atmel-ssc: register as sound DAI if #sound-dai-cells is presentPeter Rosin
2016-08-05ramoops: use DT reserved-memory bindingsKees Cook
2016-06-14pstore/ram: add Device Tree bindingsGreg Hackmann
2016-04-26Documentation: fsl-mc: binding updates for MSIs, ranges, PHYsStuart Yoder
2016-02-09Documentation: devicetree: Add DT bindings to eeprom_93xx46 driver.Cory Tusar
2015-12-09dt-bindings: Consolidate SRAM bindings from all vendorsKrzysztof Kozlowski
2015-11-06Merge tag 'devicetree-for-4.4' of git://git.kernel.org/pub/scm/linux/kernel/g...Linus Torvalds
2015-10-22dt-bindings: consolidate various misc bindingsRob Herring
2015-10-22dt-bindings: consolidate eeprom bindingsRob Herring
2015-10-17misc: sram: extend usage of reserved partitionsVladimir Zapolskiy
2015-08-05nvmem: sunxi: Move the SID driver to the nvmem frameworkMaxime Ripard
2015-05-04of: Document long-ram-code property in nvidia,tegra20-apbmiscTomeu Vizoso
2015-04-21Merge tag 'char-misc-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/gi...Linus Torvalds
2015-04-03Documentation: DT: lis302: update wakeup bindingSebastian Reichel
2015-03-26dt-bindings: brcm: rationalize Broadcom documentation namingScott Branden
2015-02-17Merge tag 'dt-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...Linus Torvalds
41 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037
/*
 * linux/fs/jbd2/commit.c
 *
 * Written by Stephen C. Tweedie <sct@redhat.com>, 1998
 *
 * Copyright 1998 Red Hat corp --- All Rights Reserved
 *
 * This file is part of the Linux kernel and is made available under
 * the terms of the GNU General Public License, version 2, or at your
 * option, any later version, incorporated herein by reference.
 *
 * Journal commit routines for the generic filesystem journaling code;
 * part of the ext2fs journaling system.
 */

#include <linux/time.h>
#include <linux/fs.h>
#include <linux/jbd2.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/pagemap.h>
#include <linux/jiffies.h>
#include <linux/crc32.h>
#include <linux/writeback.h>
#include <linux/backing-dev.h>
#include <linux/bio.h>
#include <linux/blkdev.h>
#include <linux/bitops.h>
#include <trace/events/jbd2.h>
#include <asm/system.h>

/*
 * Default IO end handler for temporary BJ_IO buffer_heads.
 */
static void journal_end_buffer_io_sync(struct buffer_head *bh, int uptodate)
{
	BUFFER_TRACE(bh, "");
	if (uptodate)
		set_buffer_uptodate(bh);
	else
		clear_buffer_uptodate(bh);
	unlock_buffer(bh);
}

/*
 * When an ext4 file is truncated, it is possible that some pages are not
 * successfully freed, because they are attached to a committing transaction.
 * After the transaction commits, these pages are left on the LRU, with no
 * ->mapping, and with attached buffers.  These pages are trivially reclaimable
 * by the VM, but their apparent absence upsets the VM accounting, and it makes
 * the numbers in /proc/meminfo look odd.
 *
 * So here, we have a buffer which has just come off the forget list.  Look to
 * see if we can strip all buffers from the backing page.
 *
 * Called under lock_journal(), and possibly under journal_datalist_lock.  The
 * caller provided us with a ref against the buffer, and we drop that here.
 */
static void release_buffer_page(struct buffer_head *bh)
{
	struct page *page;

	if (buffer_dirty(bh))
		goto nope;
	if (atomic_read(&bh->b_count) != 1)
		goto nope;
	page = bh->b_page;
	if (!page)
		goto nope;
	if (page->mapping)
		goto nope;

	/* OK, it's a truncated page */
	if (!trylock_page(page))
		goto nope;

	page_cache_get(page);
	__brelse(bh);
	try_to_free_buffers(page);
	unlock_page(page);
	page_cache_release(page);
	return;

nope:
	__brelse(bh);
}

/*
 * Done it all: now submit the commit record.  We should have
 * cleaned up our previous buffers by now, so if we are in abort
 * mode we can now just skip the rest of the journal write
 * entirely.
 *
 * Returns 1 if the journal needs to be aborted or 0 on success
 */
static int journal_submit_commit_record(journal_t *journal,
					transaction_t *commit_transaction,
					struct buffer_head **cbh,
					__u32 crc32_sum)
{
	struct journal_head *descriptor;
	struct commit_header *tmp;
	struct buffer_head *bh;
	int ret;
	struct timespec now = current_kernel_time();

	if (is_journal_aborted(journal))
		return 0;

	descriptor = jbd2_journal_get_descriptor_buffer(journal);
	if (!descriptor)
		return 1;

	bh = jh2bh(descriptor);

	tmp = (struct commit_header *)bh->b_data;
	tmp->h_magic = cpu_to_be32(JBD2_MAGIC_NUMBER);
	tmp->h_blocktype = cpu_to_be32(JBD2_COMMIT_BLOCK);
	tmp->h_sequence = cpu_to_be32(commit_transaction->t_tid);
	tmp->h_commit_sec = cpu_to_be64(now.tv_sec);
	tmp->h_commit_nsec = cpu_to_be32(now.tv_nsec);

	if (JBD2_HAS_COMPAT_FEATURE(journal,
				    JBD2_FEATURE_COMPAT_CHECKSUM)) {
		tmp->h_chksum_type 	= JBD2_CRC32_CHKSUM;
		tmp->h_chksum_size 	= JBD2_CRC32_CHKSUM_SIZE;
		tmp->h_chksum[0] 	= cpu_to_be32(crc32_sum);
	}

	JBUFFER_TRACE(descriptor, "submit commit block");
	lock_buffer(bh);
	clear_buffer_dirty(bh);
	set_buffer_uptodate(bh);
	bh->b_end_io = journal_end_buffer_io_sync;

	if (journal->j_flags & JBD2_BARRIER &&
	    !JBD2_HAS_INCOMPAT_FEATURE(journal,
				       JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT))
		ret = submit_bh(WRITE_SYNC_PLUG | WRITE_FLUSH_FUA, bh);
	else
		ret = submit_bh(WRITE_SYNC_PLUG, bh);

	*cbh = bh;
	return ret;
}

/*
 * This function along with journal_submit_commit_record
 * allows to write the commit record asynchronously.
 */
static int journal_wait_on_commit_record(journal_t *journal,
					 struct buffer_head *bh)
{
	int ret = 0;

	clear_buffer_dirty(bh);
	wait_on_buffer(bh);

	if (unlikely(!buffer_uptodate(bh)))
		ret = -EIO;
	put_bh(bh);            /* One for getblk() */
	jbd2_journal_put_journal_head(bh2jh(bh));

	return ret;
}

/*
 * write the filemap data using writepage() address_space_operations.
 * We don't do block allocation here even for delalloc. We don't
 * use writepages() because with dealyed allocation we may be doing
 * block allocation in writepages().
 */
static int journal_submit_inode_data_buffers(struct address_space *mapping)
{
	int ret;
	stru