diff options
414 files changed, 5642 insertions, 4539 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-rbd b/Documentation/ABI/testing/sysfs-bus-rbd new file mode 100644 index 000000000000..90a87e2a572b --- /dev/null +++ b/Documentation/ABI/testing/sysfs-bus-rbd | |||
| @@ -0,0 +1,83 @@ | |||
| 1 | What: /sys/bus/rbd/ | ||
| 2 | Date: November 2010 | ||
| 3 | Contact: Yehuda Sadeh <yehuda@hq.newdream.net>, | ||
| 4 | Sage Weil <sage@newdream.net> | ||
| 5 | Description: | ||
| 6 | |||
| 7 | Being used for adding and removing rbd block devices. | ||
| 8 | |||
| 9 | Usage: <mon ip addr> <options> <pool name> <rbd image name> [snap name] | ||
| 10 | |||
| 11 | $ echo "192.168.0.1 name=admin rbd foo" > /sys/bus/rbd/add | ||
| 12 | |||
| 13 | The snapshot name can be "-" or omitted to map the image read/write. A <dev-id> | ||
| 14 | will be assigned for any registered block device. If snapshot is used, it will | ||
| 15 | be mapped read-only. | ||
| 16 | |||
| 17 | Removal of a device: | ||
| 18 | |||
| 19 | $ echo <dev-id> > /sys/bus/rbd/remove | ||
| 20 | |||
| 21 | Entries under /sys/bus/rbd/devices/<dev-id>/ | ||
| 22 | -------------------------------------------- | ||
| 23 | |||
| 24 | client_id | ||
| 25 | |||
| 26 | The ceph unique client id that was assigned for this specific session. | ||
| 27 | |||
| 28 | major | ||
| 29 | |||
| 30 | The block device major number. | ||
| 31 | |||
| 32 | name | ||
| 33 | |||
| 34 | The name of the rbd image. | ||
| 35 | |||
| 36 | pool | ||
| 37 | |||
| 38 | The pool where this rbd image resides. The pool-name pair is unique | ||
| 39 | per rados system. | ||
| 40 | |||
| 41 | size | ||
| 42 | |||
| 43 | The size (in bytes) of the mapped block device. | ||
| 44 | |||
| 45 | refresh | ||
| 46 | |||
| 47 | Writing to this file will reread the image header data and set | ||
| 48 | all relevant datastructures accordingly. | ||
| 49 | |||
| 50 | current_snap | ||
| 51 | |||
| 52 | The current snapshot for which the device is mapped. | ||
| 53 | |||
| 54 | create_snap | ||
| 55 | |||
| 56 | Create a snapshot: | ||
| 57 | |||
| 58 | $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_create | ||
| 59 | |||
| 60 | rollback_snap | ||
| 61 | |||
| 62 | Rolls back data to the specified snapshot. This goes over the entire | ||
| 63 | list of rados blocks and sends a rollback command to each. | ||
| 64 | |||
| 65 | $ echo <snap-name> > /sys/bus/rbd/devices/<dev-id>/snap_rollback | ||
| 66 | |||
| 67 | snap_* | ||
| 68 | |||
| 69 | A directory per each snapshot | ||
| 70 | |||
| 71 | |||
| 72 | Entries under /sys/bus/rbd/devices/<dev-id>/snap_<snap-name> | ||
| 73 | ------------------------------------------------------------- | ||
| 74 | |||
| 75 | id | ||
| 76 | |||
| 77 | The rados internal snapshot id assigned for this snapshot | ||
| 78 | |||
| 79 | size | ||
| 80 | |||
| 81 | The size of the image when this snapshot was taken. | ||
| 82 | |||
| 83 | |||
diff --git a/Documentation/ABI/testing/sysfs-platform-asus-laptop b/Documentation/ABI/testing/sysfs-platform-asus-laptop index 1d775390e856..41ff8ae4dee0 100644 --- a/Documentation/ABI/testing/sysfs-platform-asus-laptop +++ b/Documentation/ABI/testing/sysfs-platform-asus-laptop | |||
| @@ -47,6 +47,20 @@ Date: January 2007 | |||
| 47 | KernelVersion: 2.6.20 | 47 | KernelVersion: 2.6.20 |
| 48 | Contact: "Corentin Chary" <corentincj@iksaif.net> | 48 | Contact: "Corentin Chary" <corentincj@iksaif.net> |
| 49 | Description: | 49 | Description: |
| 50 | Control the bluetooth device. 1 means on, 0 means off. | 50 | Control the wlan device. 1 means on, 0 means off. |
| 51 | This may control the led, the device or both. | 51 | This may control the led, the device or both. |
| 52 | Users: Lapsus | 52 | Users: Lapsus |
| 53 | |||
| 54 | What: /sys/devices/platform/asus_laptop/wimax | ||
| 55 | Date: October 2010 | ||
| 56 | KernelVersion: 2.6.37 | ||
| 57 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
| 58 | Description: | ||
| 59 | Control the wimax device. 1 means on, 0 means off. | ||
| 60 | |||
| 61 | What: /sys/devices/platform/asus_laptop/wwan | ||
| 62 | Date: October 2010 | ||
| 63 | KernelVersion: 2.6.37 | ||
| 64 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
| 65 | Description: | ||
| 66 | Control the wwan (3G) device. 1 means on, 0 means off. | ||
diff --git a/Documentation/ABI/testing/sysfs-platform-eeepc-wmi b/Documentation/ABI/testing/sysfs-platform-eeepc-wmi new file mode 100644 index 000000000000..e4b5fef5fadd --- /dev/null +++ b/Documentation/ABI/testing/sysfs-platform-eeepc-wmi | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | What: /sys/devices/platform/eeepc-wmi/cpufv | ||
| 2 | Date: Oct 2010 | ||
| 3 | KernelVersion: 2.6.37 | ||
| 4 | Contact: "Corentin Chary" <corentincj@iksaif.net> | ||
| 5 | Description: | ||
| 6 | Change CPU clock configuration (write-only). | ||
| 7 | There are three available clock configuration: | ||
| 8 | * 0 -> Super Performance Mode | ||
| 9 | * 1 -> High Performance Mode | ||
| 10 | * 2 -> Power Saving Mode | ||
diff --git a/Documentation/driver-model/interface.txt b/Documentation/driver-model/interface.txt deleted file mode 100644 index c66912bfe866..000000000000 --- a/Documentation/driver-model/interface.txt +++ /dev/null | |||
| @@ -1,129 +0,0 @@ | |||
| 1 | |||
| 2 | Device Interfaces | ||
| 3 | |||
| 4 | Introduction | ||
| 5 | ~~~~~~~~~~~~ | ||
| 6 | |||
| 7 | Device interfaces are the logical interfaces of device classes that correlate | ||
| 8 | directly to userspace interfaces, like device nodes. | ||
| 9 | |||
| 10 | Each device class may have multiple interfaces through which you can | ||
| 11 | access the same device. An input device may support the mouse interface, | ||
| 12 | the 'evdev' interface, and the touchscreen interface. A SCSI disk would | ||
| 13 | support the disk interface, the SCSI generic interface, and possibly a raw | ||
| 14 | device interface. | ||
| 15 | |||
| 16 | Device interfaces are registered with the class they belong to. As devices | ||
| 17 | are added to the class, they are added to each interface registered with | ||
| 18 | the class. The interface is responsible for determining whether the device | ||
| 19 | supports the interface or not. | ||
| 20 | |||
| 21 | |||
| 22 | Programming Interface | ||
| 23 | ~~~~~~~~~~~~~~~~~~~~~ | ||
| 24 | |||
| 25 | struct device_interface { | ||
| 26 | char * name; | ||
| 27 | rwlock_t lock; | ||
| 28 | u32 devnum; | ||
| 29 | struct device_class * devclass; | ||
| 30 | |||
| 31 | struct list_head node; | ||
| 32 | struct driver_dir_entry dir; | ||
| 33 | |||
| 34 | int (*add_device)(struct device *); | ||
| 35 | int (*add_device)(struct intf_data *); | ||
| 36 | }; | ||
| 37 | |||
| 38 | int interface_register(struct device_interface *); | ||
| 39 | void interface_unregister(struct device_interface *); | ||
| 40 | |||
| 41 | |||
| 42 | An interface must specify the device class it belongs to. It is added | ||
| 43 | to that class's list of interfaces on registration. | ||
| 44 | |||
| 45 | |||
| 46 | Interfaces can be added to a device class at any time. Whenever it is | ||
| 47 | added, each device in the class is passed to the interface's | ||
| 48 | add_device callback. When an interface is removed, each device is | ||
| 49 | removed from the interface. | ||
| 50 | |||
| 51 | |||
| 52 | Devices | ||
| 53 | ~~~~~~~ | ||
| 54 | Once a device is added to a device class, it is added to each | ||
| 55 | interface that is registered with the device class. The class | ||
| 56 | is expected to place a class-specific data structure in | ||
| 57 | struct device::class_data. The interface can use that (along with | ||
| 58 | other fields of struct device) to determine whether or not the driver | ||
| 59 | and/or device support that particular interface. | ||
| 60 | |||
| 61 | |||
| 62 | Data | ||
| 63 | ~~~~ | ||
| 64 | |||
| 65 | struct intf_data { | ||
| 66 | struct list_head node; | ||
| 67 | struct device_interface * intf; | ||
| 68 | struct device * dev; | ||
| 69 | u32 intf_num; | ||
| 70 | }; | ||
| 71 | |||
| 72 | int interface_add_data(struct interface_data *); | ||
| 73 | |||
| 74 | The interface is responsible for allocating and initializing a struct | ||
| 75 | intf_data and calling interface_add_data() to add it to the device's list | ||
| 76 | of interfaces it belongs to. This list will be iterated over when the device | ||
| 77 | is removed from the class (instead of all possible interfaces for a class). | ||
| 78 | This structure should probably be embedded in whatever per-device data | ||
| 79 | structure the interface is allocating anyway. | ||
| 80 | |||
| 81 | Devices are enumerated within the interface. This happens in interface_add_data() | ||
| 82 | and the enumerated value is stored in the struct intf_data for that device. | ||
| 83 | |||
| 84 | sysfs | ||
| 85 | ~~~~~ | ||
| 86 | Each interface is given a directory in the directory of the device | ||
| 87 | class it belongs to: | ||
| 88 | |||
| 89 | Interfaces get a directory in the class's directory as well: | ||
| 90 | |||
| 91 | class/ | ||
| 92 | `-- input | ||
| 93 | |-- devices | ||
| 94 | |-- drivers | ||
| 95 | |-- mouse | ||
| 96 | `-- evdev | ||
| 97 | |||
| 98 | When a device is added to the interface, a symlink is created that points | ||
| 99 | to the device's directory in the physical hierarchy: | ||
| 100 | |||
| 101 | class/ | ||
| 102 | `-- input | ||
| 103 | |-- devices | ||
| 104 | | `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/ | ||
| 105 | |-- drivers | ||
| 106 | | `-- usb:usb_mouse -> ../../../bus/drivers/usb_mouse/ | ||
| 107 | |-- mouse | ||
| 108 | | `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/ | ||
| 109 | `-- evdev | ||
| 110 | `-- 1 -> ../../../root/pci0/00:1f.0/usb_bus/00:1f.2-1:0/ | ||
| 111 | |||
| 112 | |||
| 113 | Future Plans | ||
| 114 | ~~~~~~~~~~~~ | ||
| 115 | A device interface is correlated directly with a userspace interface | ||
| 116 | for a device, specifically a device node. For instance, a SCSI disk | ||
| 117 | exposes at least two interfaces to userspace: the standard SCSI disk | ||
| 118 | interface and the SCSI generic interface. It might also export a raw | ||
| 119 | device interface. | ||
| 120 | |||
| 121 | Many interfaces have a major number associated with them and each | ||
| 122 | device gets a minor number. Or, multiple interfaces might share one | ||
| 123 | major number, and each will receive a range of minor numbers (like in | ||
| 124 | the case of input devices). | ||
| 125 | |||
| 126 | These major and minor numbers could be stored in the interface | ||
| 127 | structure. Major and minor allocations could happen when the interface | ||
| 128 | is registered with the class, or via a helper function. | ||
| 129 | |||
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking index a91f30890011..b6426f15b4ae 100644 --- a/Documentation/filesystems/Locking +++ b/Documentation/filesystems/Locking | |||
| @@ -173,12 +173,13 @@ prototypes: | |||
| 173 | sector_t (*bmap)(struct address_space *, sector_t); | 173 | sector_t (*bmap)(struct address_space *, sector_t); |
| 174 | int (*invalidatepage) (struct page *, unsigned long); | 174 | int (*invalidatepage) (struct page *, unsigned long); |
| 175 | int (*releasepage) (struct page *, int); | 175 | int (*releasepage) (struct page *, int); |
| 176 | void (*freepage)(struct page *); | ||
| 176 | int (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 177 | int (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
| 177 | loff_t offset, unsigned long nr_segs); | 178 | loff_t offset, unsigned long nr_segs); |
| 178 | int (*launder_page) (struct page *); | 179 | int (*launder_page) (struct page *); |
| 179 | 180 | ||
| 180 | locking rules: | 181 | locking rules: |
| 181 | All except set_page_dirty may block | 182 | All except set_page_dirty and freepage may block |
| 182 | 183 | ||
| 183 | BKL PageLocked(page) i_mutex | 184 | BKL PageLocked(page) i_mutex |
| 184 | writepage: no yes, unlocks (see below) | 185 | writepage: no yes, unlocks (see below) |
| @@ -193,6 +194,7 @@ perform_write: no n/a yes | |||
| 193 | bmap: no | 194 | bmap: no |
| 194 | invalidatepage: no yes | 195 | invalidatepage: no yes |
| 195 | releasepage: no yes | 196 | releasepage: no yes |
| 197 | freepage: no yes | ||
| 196 | direct_IO: no | 198 | direct_IO: no |
| 197 | launder_page: no yes | 199 | launder_page: no yes |
| 198 | 200 | ||
| @@ -288,6 +290,9 @@ buffers from the page in preparation for freeing it. It returns zero to | |||
| 288 | indicate that the buffers are (or may be) freeable. If ->releasepage is zero, | 290 | indicate that the buffers are (or may be) freeable. If ->releasepage is zero, |
| 289 | the kernel assumes that the fs has no private interest in the buffers. | 291 | the kernel assumes that the fs has no private interest in the buffers. |
| 290 | 292 | ||
| 293 | ->freepage() is called when the kernel is done dropping the page | ||
| 294 | from the page cache. | ||
| 295 | |||
| 291 | ->launder_page() may be called prior to releasing a page if | 296 | ->launder_page() may be called prior to releasing a page if |
| 292 | it is still found to be dirty. It returns zero if the page was successfully | 297 | it is still found to be dirty. It returns zero if the page was successfully |
| 293 | cleaned, or an error value if not. Note that in order to prevent the page | 298 | cleaned, or an error value if not. Note that in order to prevent the page |
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt index ed7e5efc06d8..20899e095e7e 100644 --- a/Documentation/filesystems/vfs.txt +++ b/Documentation/filesystems/vfs.txt | |||
| @@ -534,6 +534,7 @@ struct address_space_operations { | |||
| 534 | sector_t (*bmap)(struct address_space *, sector_t); | 534 | sector_t (*bmap)(struct address_space *, sector_t); |
| 535 | int (*invalidatepage) (struct page *, unsigned long); | 535 | int (*invalidatepage) (struct page *, unsigned long); |
| 536 | int (*releasepage) (struct page *, int); | 536 | int (*releasepage) (struct page *, int); |
| 537 | void (*freepage)(struct page *); | ||
| 537 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 538 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
| 538 | loff_t offset, unsigned long nr_segs); | 539 | loff_t offset, unsigned long nr_segs); |
| 539 | struct page* (*get_xip_page)(struct address_space *, sector_t, | 540 | struct page* (*get_xip_page)(struct address_space *, sector_t, |
| @@ -660,11 +661,10 @@ struct address_space_operations { | |||
| 660 | releasepage: releasepage is called on PagePrivate pages to indicate | 661 | releasepage: releasepage is called on PagePrivate pages to indicate |
| 661 | that the page should be freed if possible. ->releasepage | 662 | that the page should be freed if possible. ->releasepage |
| 662 | should remove any private data from the page and clear the | 663 | should remove any private data from the page and clear the |
| 663 | PagePrivate flag. It may also remove the page from the | 664 | PagePrivate flag. If releasepage() fails for some reason, it must |
| 664 | address_space. If this fails for some reason, it may indicate | 665 | indicate failure with a 0 return value. |
| 665 | failure with a 0 return value. | 666 | releasepage() is used in two distinct though related cases. The |
| 666 | This is used in two distinct though related cases. The first | 667 | first is when the VM finds a clean page with no active users and |
| 667 | is when the VM finds a clean page with no active users and | ||
| 668 | wants to make it a free page. If ->releasepage succeeds, the | 668 | wants to make it a free page. If ->releasepage succeeds, the |
| 669 | page will be removed from the address_space and become free. | 669 | page will be removed from the address_space and become free. |
| 670 | 670 | ||
| @@ -679,6 +679,12 @@ struct address_space_operations { | |||
| 679 | need to ensure this. Possibly it can clear the PageUptodate | 679 | need to ensure this. Possibly it can clear the PageUptodate |
| 680 | bit if it cannot free private data yet. | 680 | bit if it cannot free private data yet. |
| 681 | 681 | ||
| 682 | freepage: freepage is called once the page is no longer visible in | ||
| 683 | the page cache in order to allow the cleanup of any private | ||
| 684 | data. Since it may be called by the memory reclaimer, it | ||
| 685 | should not assume that the original address_space mapping still | ||
| 686 | exists, and it should not block. | ||
| 687 | |||
| 682 | direct_IO: called by the generic read/write routines to perform | 688 | direct_IO: called by the generic read/write routines to perform |
| 683 | direct_IO - that is IO requests which bypass the page cache | 689 | direct_IO - that is IO requests which bypass the page cache |
| 684 | and transfer data directly between the storage and the | 690 | and transfer data directly between the storage and the |
diff --git a/MAINTAINERS b/MAINTAINERS index b3be8b3d0437..1a1c27b9c557 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -2060,7 +2060,7 @@ F: Documentation/blockdev/drbd/ | |||
| 2060 | 2060 | ||
| 2061 | DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS | 2061 | DRIVER CORE, KOBJECTS, DEBUGFS AND SYSFS |
| 2062 | M: Greg Kroah-Hartman <gregkh@suse.de> | 2062 | M: Greg Kroah-Hartman <gregkh@suse.de> |
| 2063 | T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | 2063 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git |
| 2064 | S: Supported | 2064 | S: Supported |
| 2065 | F: Documentation/kobject.txt | 2065 | F: Documentation/kobject.txt |
| 2066 | F: drivers/base/ | 2066 | F: drivers/base/ |
| @@ -2080,7 +2080,7 @@ F: include/drm/ | |||
| 2080 | 2080 | ||
| 2081 | INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) | 2081 | INTEL DRM DRIVERS (excluding Poulsbo, Moorestown and derivative chipsets) |
| 2082 | M: Chris Wilson <chris@chris-wilson.co.uk> | 2082 | M: Chris Wilson <chris@chris-wilson.co.uk> |
| 2083 | L: intel-gfx@lists.freedesktop.org | 2083 | L: intel-gfx@lists.freedesktop.org (subscribers-only) |
| 2084 | L: dri-devel@lists.freedesktop.org | 2084 | L: dri-devel@lists.freedesktop.org |
| 2085 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel.git | 2085 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/ickle/drm-intel.git |
| 2086 | S: Supported | 2086 | S: Supported |
| @@ -4064,9 +4064,8 @@ F: drivers/scsi/NCR_D700.* | |||
| 4064 | 4064 | ||
| 4065 | NETEFFECT IWARP RNIC DRIVER (IW_NES) | 4065 | NETEFFECT IWARP RNIC DRIVER (IW_NES) |
| 4066 | M: Faisal Latif <faisal.latif@intel.com> | 4066 | M: Faisal Latif <faisal.latif@intel.com> |
| 4067 | M: Chien Tung <chien.tin.tung@intel.com> | ||
| 4068 | L: linux-rdma@vger.kernel.org | 4067 | L: linux-rdma@vger.kernel.org |
| 4069 | W: http://www.neteffect.com | 4068 | W: http://www.intel.com/Products/Server/Adapters/Server-Cluster/Server-Cluster-overview.htm |
| 4070 | S: Supported | 4069 | S: Supported |
| 4071 | F: drivers/infiniband/hw/nes/ | 4070 | F: drivers/infiniband/hw/nes/ |
| 4072 | 4071 | ||
| @@ -1,7 +1,7 @@ | |||
| 1 | VERSION = 2 | 1 | VERSION = 2 |
| 2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
| 3 | SUBLEVEL = 37 | 3 | SUBLEVEL = 37 |
| 4 | EXTRAVERSION = -rc4 | 4 | EXTRAVERSION = -rc5 |
| 5 | NAME = Flesh-Eating Bats with Fangs | 5 | NAME = Flesh-Eating Bats with Fangs |
| 6 | 6 | ||
| 7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index db524e75c4a2..f1d9297b1050 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig | |||
| @@ -9,7 +9,7 @@ config ARM | |||
| 9 | select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI) | 9 | select GENERIC_ATOMIC64 if (!CPU_32v6K || !AEABI) |
| 10 | select HAVE_OPROFILE if (HAVE_PERF_EVENTS) | 10 | select HAVE_OPROFILE if (HAVE_PERF_EVENTS) |
| 11 | select HAVE_ARCH_KGDB | 11 | select HAVE_ARCH_KGDB |
| 12 | select HAVE_KPROBES if (!XIP_KERNEL) | 12 | select HAVE_KPROBES if (!XIP_KERNEL && !THUMB2_KERNEL) |
| 13 | select HAVE_KRETPROBES if (HAVE_KPROBES) | 13 | select HAVE_KRETPROBES if (HAVE_KPROBES) |
| 14 | select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) | 14 | select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) |
| 15 | select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) | 15 | select HAVE_FTRACE_MCOUNT_RECORD if (!XIP_KERNEL) |
diff --git a/arch/arm/boot/Makefile b/arch/arm/boot/Makefile index 4a590f4113e2..4d26f2c52a75 100644 --- a/arch/arm/boot/Makefile +++ b/arch/arm/boot/Makefile | |||
| @@ -70,12 +70,7 @@ else | |||
| 70 | $(obj)/uImage: LOADADDR=$(ZRELADDR) | 70 | $(obj)/uImage: LOADADDR=$(ZRELADDR) |
| 71 | endif | 71 | endif |
| 72 | 72 | ||
| 73 | ifeq ($(CONFIG_THUMB2_KERNEL),y) | ||
| 74 | # Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode | ||
| 75 | $(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/") | ||
| 76 | else | ||
| 77 | $(obj)/uImage: STARTADDR=$(LOADADDR) | 73 | $(obj)/uImage: STARTADDR=$(LOADADDR) |
| 78 | endif | ||
| 79 | 74 | ||
| 80 | $(obj)/uImage: $(obj)/zImage FORCE | 75 | $(obj)/uImage: $(obj)/zImage FORCE |
| 81 | $(call if_changed,uimage) | 76 | $(call if_changed,uimage) |
diff --git a/arch/arm/boot/bootp/init.S b/arch/arm/boot/bootp/init.S index 8b0de41c3dcb..78b508075161 100644 --- a/arch/arm/boot/bootp/init.S +++ b/arch/arm/boot/bootp/init.S | |||
| @@ -73,6 +73,8 @@ move: ldmia r4!, {r7 - r10} @ move 32-bytes at a time | |||
| 73 | 73 | ||
| 74 | .size _start, . - _start | 74 | .size _start, . - _start |
| 75 | 75 | ||
| 76 | .align | ||
| 77 | |||
| 76 | .type data,#object | 78 | .type data,#object |
| 77 | data: .word initrd_start @ source initrd address | 79 | data: .word initrd_start @ source initrd address |
| 78 | .word initrd_phys @ destination initrd address | 80 | .word initrd_phys @ destination initrd address |
diff --git a/arch/arm/boot/compressed/head.S b/arch/arm/boot/compressed/head.S index 9be21ba648cd..7193884ed8b0 100644 --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S | |||
| @@ -125,9 +125,13 @@ wait: mrc p14, 0, pc, c0, c1, 0 | |||
| 125 | * sort out different calling conventions | 125 | * sort out different calling conventions |
| 126 | */ | 126 | */ |
| 127 | .align | 127 | .align |
| 128 | .arm @ Always enter in ARM state | ||
| 128 | start: | 129 | start: |
| 129 | .type start,#function | 130 | .type start,#function |
| 130 | .rept 8 | 131 | THUMB( adr r12, BSYM(1f) ) |
| 132 | THUMB( bx r12 ) | ||
| 133 | THUMB( .rept 6 ) | ||
| 134 | ARM( .rept 8 ) | ||
| 131 | mov r0, r0 | 135 | mov r0, r0 |
| 132 | .endr | 136 | .endr |
| 133 | 137 | ||
| @@ -135,6 +139,7 @@ start: | |||
| 135 | .word 0x016f2818 @ Magic numbers to help the loader | 139 | .word 0x016f2818 @ Magic numbers to help the loader |
| 136 | .word start @ absolute load/run zImage address | 140 | .word start @ absolute load/run zImage address |
| 137 | .word _edata @ zImage end address | 141 | .word _edata @ zImage end address |
| 142 | THUMB( .thumb ) | ||
| 138 | 1: mov r7, r1 @ save architecture ID | 143 | 1: mov r7, r1 @ save architecture ID |
| 139 | mov r8, r2 @ save atags pointer | 144 | mov r8, r2 @ save atags pointer |
| 140 | 145 | ||
| @@ -174,7 +179,8 @@ not_angel: | |||
| 174 | ldr sp, [r0, #28] | 179 | ldr sp, [r0, #28] |
| 175 | #ifdef CONFIG_AUTO_ZRELADDR | 180 | #ifdef CONFIG_AUTO_ZRELADDR |
| 176 | @ determine final kernel image address | 181 | @ determine final kernel image address |
| 177 | and r4, pc, #0xf8000000 | 182 | mov r4, pc |
| 183 | and r4, r4, #0xf8000000 | ||
| 178 | add r4, r4, #TEXT_OFFSET | 184 | add r4, r4, #TEXT_OFFSET |
| 179 | #else | 185 | #else |
| 180 | ldr r4, =zreladdr | 186 | ldr r4, =zreladdr |
| @@ -445,7 +451,8 @@ __setup_mmu: sub r3, r4, #16384 @ Page directory size | |||
| 445 | */ | 451 | */ |
| 446 | mov r1, #0x1e | 452 | mov r1, #0x1e |
| 447 | orr r1, r1, #3 << 10 | 453 | orr r1, r1, #3 << 10 |
| 448 | mov r2, pc, lsr #20 | 454 | mov r2, pc |
| 455 | mov r2, r2, lsr #20 | ||
| 449 | orr r1, r1, r2, lsl #20 | 456 | orr r1, r1, r2, lsl #20 |
| 450 | add r0, r3, r2, lsl #2 | 457 | add r0, r3, r2, lsl #2 |
| 451 | str r1, [r0], #4 | 458 | str r1, [r0], #4 |
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index 772f95f1aecd..e6388dcd8cfa 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
| @@ -146,9 +146,15 @@ static int gic_set_cpu(unsigned int irq, const struct cpumask *mask_val) | |||
| 146 | unsigned int shift = (irq % 4) * 8; | 146 | unsigned int shift = (irq % 4) * 8; |
| 147 | unsigned int cpu = cpumask_first(mask_val); | 147 | unsigned int cpu = cpumask_first(mask_val); |
| 148 | u32 val; | 148 | u32 val; |
| 149 | struct irq_desc *desc; | ||
| 149 | 150 | ||
| 150 | spin_lock(&irq_controller_lock); | 151 | spin_lock(&irq_controller_lock); |
| 151 | irq_desc[irq].node = cpu; | 152 | desc = irq_to_desc(irq); |
| 153 | if (desc == NULL) { | ||
| 154 | spin_unlock(&irq_controller_lock); | ||
| 155 | return -EINVAL; | ||
| 156 | } | ||
| 157 | desc->node = cpu; | ||
| 152 | val = readl(reg) & ~(0xff << shift); | 158 | val = readl(reg) & ~(0xff << shift); |
| 153 | val |= 1 << (cpu + shift); | 159 | val |= 1 << (cpu + shift); |
| 154 | writel(val, reg); | 160 | writel(val, reg); |
| @@ -210,7 +216,7 @@ void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq) | |||
| 210 | void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | 216 | void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, |
| 211 | unsigned int irq_start) | 217 | unsigned int irq_start) |
| 212 | { | 218 | { |
| 213 | unsigned int max_irq, i; | 219 | unsigned int gic_irqs, irq_limit, i; |
| 214 | u32 cpumask = 1 << smp_processor_id(); | 220 | u32 cpumask = 1 << smp_processor_id(); |
| 215 | 221 | ||
| 216 | if (gic_nr >= MAX_GIC_NR) | 222 | if (gic_nr >= MAX_GIC_NR) |
| @@ -226,47 +232,49 @@ void __init gic_dist_init(unsigned int gic_nr, void __iomem *base, | |||
| 226 | 232 | ||
| 227 | /* | 233 | /* |
| 228 | * Find out how many interrupts are supported. | 234 | * Find out how many interrupts are supported. |
| 229 | */ | ||
| 230 | max_irq = readl(base + GIC_DIST_CTR) & 0x1f; | ||
| 231 | max_irq = (max_irq + 1) * 32; | ||
| 232 | |||
| 233 | /* | ||
| 234 | * The GIC only supports up to 1020 interrupt sources. | 235 | * The GIC only supports up to 1020 interrupt sources. |
| 235 | * Limit this to either the architected maximum, or the | ||
| 236 | * platform maximum. | ||
| 237 | */ | 236 | */ |
| 238 | if (max_irq > max(1020, NR_IRQS)) | 237 | gic_irqs = readl(base + GIC_DIST_CTR) & 0x1f; |
| 239 | max_irq = max(1020, NR_IRQS); | 238 | gic_irqs = (gic_irqs + 1) * 32; |
| 239 | if (gic_irqs > 1020) | ||
| 240 | gic_irqs = 1020; | ||
| 240 | 241 | ||
| 241 | /* | 242 | /* |
| 242 | * Set all global interrupts to be level triggered, active low. | 243 | * Set all global interrupts to be level triggered, active low. |
| 243 | */ | 244 | */ |
| 244 | for (i = 32; i < max_irq; i += 16) | 245 | for (i = 32; i < gic_irqs; i += 16) |
| 245 | writel(0, base + GIC_DIST_CONFIG + i * 4 / 16); | 246 | writel(0, base + GIC_DIST_CONFIG + i * 4 / 16); |
| 246 | 247 | ||
| 247 | /* | 248 | /* |
| 248 | * Set all global interrupts to this CPU only. | 249 | * Set all global interrupts to this CPU only. |
| 249 | */ | 250 | */ |
| 250 | for (i = 32; i < max_irq; i += 4) | 251 | for (i = 32; i < gic_irqs; i += 4) |
| 251 | writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); | 252 | writel(cpumask, base + GIC_DIST_TARGET + i * 4 / 4); |
| 252 | 253 | ||
| 253 | /* | 254 | /* |
| 254 | * Set priority on all global interrupts. | 255 | * Set priority on all global interrupts. |
| 255 | */ | 256 | */ |
| 256 | for (i = 32; i < max_irq; i += 4) | 257 | for (i = 32; i < gic_irqs; i += 4) |
| 257 | writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); | 258 | writel(0xa0a0a0a0, base + GIC_DIST_PRI + i * 4 / 4); |
| 258 | 259 | ||
| 259 | /* | 260 | /* |
| 260 | * Disable all interrupts. Leave the PPI and SGIs alone | 261 | * Disable all interrupts. Leave the PPI and SGIs alone |
| 261 | * as these enables are banked registers. | 262 | * as these enables are banked registers. |
| 262 | */ | 263 | */ |
| 263 | for (i = 32; i < max_irq; i += 32) | 264 | for (i = 32; i < gic_irqs; i += 32) |
| 264 | writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); | 265 | writel(0xffffffff, base + GIC_DIST_ENABLE_CLEAR + i * 4 / 32); |
| 265 | 266 | ||
| 266 | /* | 267 | /* |
| 268 | * Limit number of interrupts registered to the platform maximum | ||
| 269 | */ | ||
| 270 | irq_limit = gic_data[gic_nr].irq_offset + gic_irqs; | ||
| 271 | if (WARN_ON(irq_limit > NR_IRQS)) | ||
| 272 | irq_limit = NR_IRQS; | ||
| 273 | |||
| 274 | /* | ||
| 267 | * Setup the Linux IRQ subsystem. | 275 | * Setup the Linux IRQ subsystem. |
| 268 | */ | 276 | */ |
| 269 | for (i = irq_start; i < gic_data[gic_nr].irq_offset + max_irq; i++) { | 277 | for (i = irq_start; i < irq_limit; i++) { |
| 270 | set_irq_chip(i, &gic_chip); | 278 | set_irq_chip(i, &gic_chip); |
| 271 | set_irq_chip_data(i, &gic_data[gic_nr]); | 279 | set_irq_chip_data(i, &gic_data[gic_nr]); |
| 272 | set_irq_handler(i, handle_level_irq); | 280 | set_irq_handler(i, handle_level_irq); |
diff --git a/arch/arm/configs/at91rm9200_defconfig b/arch/arm/configs/at91rm9200_defconfig new file mode 100644 index 000000000000..38cb7c985426 --- /dev/null +++ b/arch/arm/configs/at91rm9200_defconfig | |||
| @@ -0,0 +1,341 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_IKCONFIG=y | ||
| 6 | CONFIG_IKCONFIG_PROC=y | ||
| 7 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 8 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 9 | CONFIG_BLK_DEV_INITRD=y | ||
| 10 | CONFIG_MODULES=y | ||
| 11 | CONFIG_MODULE_FORCE_LOAD=y | ||
| 12 | CONFIG_MODULE_UNLOAD=y | ||
| 13 | CONFIG_MODVERSIONS=y | ||
| 14 | CONFIG_MODULE_SRCVERSION_ALL=y | ||
| 15 | # CONFIG_BLK_DEV_BSG is not set | ||
| 16 | # CONFIG_IOSCHED_CFQ is not set | ||
| 17 | CONFIG_ARCH_AT91=y | ||
| 18 | CONFIG_MACH_ONEARM=y | ||
| 19 | CONFIG_ARCH_AT91RM9200DK=y | ||
| 20 | CONFIG_MACH_AT91RM9200EK=y | ||
| 21 | CONFIG_MACH_CSB337=y | ||
| 22 | CONFIG_MACH_CSB637=y | ||
| 23 | CONFIG_MACH_CARMEVA=y | ||
| 24 | CONFIG_MACH_ATEB9200=y | ||
| 25 | CONFIG_MACH_KB9200=y | ||
| 26 | CONFIG_MACH_PICOTUX2XX=y | ||
| 27 | CONFIG_MACH_KAFA=y | ||
| 28 | CONFIG_MACH_ECBAT91=y | ||
| 29 | CONFIG_MACH_YL9200=y | ||
| 30 | CONFIG_MACH_CPUAT91=y | ||
| 31 | CONFIG_MACH_ECO920=y | ||
| 32 | CONFIG_MTD_AT91_DATAFLASH_CARD=y | ||
| 33 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 34 | CONFIG_AT91_TIMER_HZ=100 | ||
| 35 | # CONFIG_ARM_THUMB is not set | ||
| 36 | CONFIG_PCCARD=y | ||
| 37 | CONFIG_AT91_CF=y | ||
| 38 | CONFIG_NO_HZ=y | ||
| 39 | CONFIG_HIGH_RES_TIMERS=y | ||
| 40 | CONFIG_PREEMPT=y | ||
| 41 | CONFIG_AEABI=y | ||
| 42 | CONFIG_LEDS=y | ||
| 43 | CONFIG_LEDS_CPU=y | ||
| 44 | CONFIG_ZBOOT_ROM_TEXT=0x10000000 | ||
| 45 | CONFIG_ZBOOT_ROM_BSS=0x20040000 | ||
| 46 | CONFIG_KEXEC=y | ||
| 47 | CONFIG_FPE_NWFPE=y | ||
| 48 | CONFIG_BINFMT_MISC=y | ||
| 49 | CONFIG_NET=y | ||
| 50 | CONFIG_PACKET=y | ||
| 51 | CONFIG_UNIX=y | ||
| 52 | CONFIG_XFRM_USER=m | ||
| 53 | CONFIG_INET=y | ||
| 54 | CONFIG_IP_MULTICAST=y | ||
| 55 | CONFIG_IP_PNP=y | ||
| 56 | CONFIG_IP_PNP_DHCP=y | ||
| 57 | CONFIG_IP_PNP_BOOTP=y | ||
| 58 | CONFIG_NET_IPIP=m | ||
| 59 | CONFIG_NET_IPGRE=m | ||
| 60 | CONFIG_INET_AH=m | ||
| 61 | CONFIG_INET_ESP=m | ||
| 62 | CONFIG_INET_IPCOMP=m | ||
| 63 | CONFIG_INET_XFRM_MODE_TRANSPORT=m | ||
| 64 | CONFIG_INET_XFRM_MODE_TUNNEL=m | ||
| 65 | CONFIG_INET_XFRM_MODE_BEET=m | ||
| 66 | CONFIG_IPV6_PRIVACY=y | ||
| 67 | CONFIG_IPV6_ROUTER_PREF=y | ||
| 68 | CONFIG_IPV6_ROUTE_INFO=y | ||
| 69 | CONFIG_INET6_AH=m | ||
| 70 | CONFIG_INET6_ESP=m | ||
| 71 | CONFIG_INET6_IPCOMP=m | ||
| 72 | CONFIG_IPV6_MIP6=m | ||
| 73 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | ||
| 74 | CONFIG_IPV6_TUNNEL=m | ||
| 75 | CONFIG_BRIDGE=m | ||
| 76 | CONFIG_VLAN_8021Q=m | ||
| 77 | CONFIG_BT=m | ||
| 78 | CONFIG_BT_L2CAP=m | ||
| 79 | CONFIG_BT_SCO=m | ||
| 80 | CONFIG_BT_RFCOMM=m | ||
| 81 | CONFIG_BT_RFCOMM_TTY=y | ||
| 82 | CONFIG_BT_BNEP=m | ||
| 83 | CONFIG_BT_BNEP_MC_FILTER=y | ||
| 84 | CONFIG_BT_BNEP_PROTO_FILTER=y | ||
| 85 | CONFIG_BT_HIDP=m | ||
| 86 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 87 | CONFIG_MTD=y | ||
| 88 | CONFIG_MTD_CONCAT=y | ||
| 89 | CONFIG_MTD_PARTITIONS=y | ||
| 90 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 91 | CONFIG_MTD_AFS_PARTS=y | ||
| 92 | CONFIG_MTD_CHAR=y | ||
| 93 | CONFIG_MTD_BLOCK=y | ||
| 94 | CONFIG_MTD_CFI=y | ||
| 95 | CONFIG_MTD_JEDECPROBE=y | ||
| 96 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 97 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 98 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
| 99 | CONFIG_MTD_PHYSMAP=y | ||
| 100 | CONFIG_MTD_PLATRAM=y | ||
| 101 | CONFIG_MTD_DATAFLASH=y | ||
| 102 | CONFIG_MTD_NAND=y | ||
| 103 | CONFIG_MTD_NAND_ATMEL=y | ||
| 104 | CONFIG_MTD_NAND_PLATFORM=y | ||
| 105 | CONFIG_MTD_UBI=y | ||
| 106 | CONFIG_MTD_UBI_GLUEBI=y | ||
| 107 | CONFIG_BLK_DEV_LOOP=y | ||
| 108 | CONFIG_BLK_DEV_NBD=y | ||
| 109 | CONFIG_BLK_DEV_RAM=y | ||
| 110 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 111 | CONFIG_ATMEL_TCLIB=y | ||
| 112 | CONFIG_EEPROM_LEGACY=m | ||
| 113 | CONFIG_SCSI=y | ||
| 114 | CONFIG_BLK_DEV_SD=y | ||
| 115 | CONFIG_BLK_DEV_SR=m | ||
| 116 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
| 117 | CONFIG_CHR_DEV_SG=m | ||
| 118 | CONFIG_SCSI_MULTI_LUN=y | ||
| 119 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 120 | CONFIG_NETDEVICES=y | ||
| 121 | CONFIG_TUN=m | ||
| 122 | CONFIG_PHYLIB=y | ||
| 123 | CONFIG_DAVICOM_PHY=y | ||
| 124 | CONFIG_SMSC_PHY=y | ||
| 125 | CONFIG_MICREL_PHY=y | ||
| 126 | CONFIG_NET_ETHERNET=y | ||
| 127 | CONFIG_ARM_AT91_ETHER=y | ||
| 128 | # CONFIG_NETDEV_1000 is not set | ||
| 129 | # CONFIG_NETDEV_10000 is not set | ||
| 130 | CONFIG_USB_CATC=m | ||
| 131 | CONFIG_USB_KAWETH=m | ||
| 132 | CONFIG_USB_PEGASUS=m | ||
| 133 | CONFIG_USB_RTL8150=m | ||
| 134 | CONFIG_USB_USBNET=m | ||
| 135 | CONFIG_USB_NET_DM9601=m | ||
| 136 | CONFIG_USB_NET_GL620A=m | ||
| 137 | CONFIG_USB_NET_PLUSB=m | ||
| 138 | CONFIG_USB_NET_RNDIS_HOST=m | ||
| 139 | CONFIG_USB_ALI_M5632=y | ||
| 140 | CONFIG_USB_AN2720=y | ||
| 141 | CONFIG_USB_EPSON2888=y | ||
| 142 | CONFIG_PPP=y | ||
| 143 | CONFIG_PPP_MULTILINK=y | ||
| 144 | CONFIG_PPP_FILTER=y | ||
| 145 | CONFIG_PPP_ASYNC=y | ||
| 146 | CONFIG_PPP_DEFLATE=y | ||
| 147 | CONFIG_PPP_BSDCOMP=y | ||
| 148 | CONFIG_PPP_MPPE=m | ||
| 149 | CONFIG_PPPOE=m | ||
| 150 | CONFIG_SLIP=m | ||
| 151 | CONFIG_SLIP_COMPRESSED=y | ||
| 152 | CONFIG_SLIP_SMART=y | ||
| 153 | CONFIG_SLIP_MODE_SLIP6=y | ||
| 154 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 155 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 | ||
| 156 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 | ||
| 157 | CONFIG_INPUT_EVDEV=y | ||
| 158 | CONFIG_KEYBOARD_GPIO=y | ||
| 159 | # CONFIG_INPUT_MOUSE is not set | ||
| 160 | CONFIG_INPUT_TOUCHSCREEN=y | ||
| 161 | CONFIG_SERIAL_ATMEL=y | ||
| 162 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 163 | CONFIG_LEGACY_PTY_COUNT=32 | ||
| 164 | CONFIG_HW_RANDOM=y | ||
| 165 | CONFIG_I2C=y | ||
| 166 | CONFIG_I2C_CHARDEV=y | ||
| 167 | CONFIG_I2C_GPIO=y | ||
| 168 | CONFIG_SPI=y | ||
| 169 | CONFIG_SPI_ATMEL=y | ||
| 170 | CONFIG_SPI_BITBANG=y | ||
| 171 | CONFIG_GPIO_SYSFS=y | ||
| 172 | CONFIG_HWMON=m | ||
| 173 | CONFIG_SENSORS_ADM1021=m | ||
| 174 | CONFIG_SENSORS_ADM1025=m | ||
| 175 | CONFIG_SENSORS_ADM1026=m | ||
| 176 | CONFIG_SENSORS_ADM1029=m | ||
| 177 | CONFIG_SENSORS_ADM1031=m | ||
| 178 | CONFIG_SENSORS_ADM9240=m | ||
| 179 | CONFIG_SENSORS_DS1621=m | ||
| 180 | CONFIG_SENSORS_GL518SM=m | ||
| 181 | CONFIG_SENSORS_GL520SM=m | ||
| 182 | CONFIG_SENSORS_IT87=m | ||
| 183 | CONFIG_SENSORS_LM63=m | ||
| 184 | CONFIG_SENSORS_LM73=m | ||
| 185 | CONFIG_SENSORS_LM75=m | ||
| 186 | CONFIG_SENSORS_LM77=m | ||
| 187 | CONFIG_SENSORS_LM78=m | ||
| 188 | CONFIG_SENSORS_LM80=m | ||
| 189 | CONFIG_SENSORS_LM83=m | ||
| 190 | CONFIG_SENSORS_LM85=m | ||
| 191 | CONFIG_SENSORS_LM87=m | ||
| 192 | CONFIG_SENSORS_LM90=m | ||
| 193 | CONFIG_SENSORS_LM92=m | ||
| 194 | CONFIG_SENSORS_MAX1619=m | ||
| 195 | CONFIG_SENSORS_PCF8591=m | ||
| 196 | CONFIG_SENSORS_SMSC47B397=m | ||
| 197 | CONFIG_SENSORS_W83781D=m | ||
| 198 | CONFIG_SENSORS_W83791D=m | ||
| 199 | CONFIG_SENSORS_W83792D=m | ||
| 200 | CONFIG_SENSORS_W83793=m | ||
| 201 | CONFIG_SENSORS_W83L785TS=m | ||
| 202 | CONFIG_WATCHDOG=y | ||
| 203 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 204 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 205 | CONFIG_FB=y | ||
| 206 | CONFIG_FB_MODE_HELPERS=y | ||
| 207 | CONFIG_FB_TILEBLITTING=y | ||
| 208 | CONFIG_FB_S1D13XXX=y | ||
| 209 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 210 | CONFIG_LCD_CLASS_DEVICE=y | ||
| 211 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 212 | # CONFIG_BACKLIGHT_GENERIC is not set | ||
| 213 | CONFIG_DISPLAY_SUPPORT=y | ||
| 214 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
| 215 | CONFIG_FONTS=y | ||
| 216 | CONFIG_FONT_MINI_4x6=y | ||
| 217 | CONFIG_LOGO=y | ||
| 218 | # CONFIG_LOGO_LINUX_MONO is not set | ||
| 219 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
| 220 | CONFIG_USB=y | ||
| 221 | CONFIG_USB_DEVICEFS=y | ||
| 222 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 223 | CONFIG_USB_MON=y | ||
| 224 | CONFIG_USB_OHCI_HCD=y | ||
| 225 | CONFIG_USB_ACM=m | ||
| 226 | CONFIG_USB_PRINTER=m | ||
| 227 | CONFIG_USB_STORAGE=y | ||
| 228 | CONFIG_USB_SERIAL=y | ||
| 229 | CONFIG_USB_SERIAL_CONSOLE=y | ||
| 230 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 231 | CONFIG_USB_SERIAL_FTDI_SIO=y | ||
| 232 | CONFIG_USB_SERIAL_KEYSPAN=y | ||
| 233 | CONFIG_USB_SERIAL_KEYSPAN_MPR=y | ||
| 234 | CONFIG_USB_SERIAL_KEYSPAN_USA28=y | ||
| 235 | CONFIG_USB_SERIAL_KEYSPAN_USA28X=y | ||
| 236 | CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y | ||
| 237 | CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y | ||
| 238 | CONFIG_USB_SERIAL_KEYSPAN_USA19=y | ||
| 239 | CONFIG_USB_SERIAL_KEYSPAN_USA18X=y | ||
| 240 | CONFIG_USB_SERIAL_KEYSPAN_USA19W=y | ||
| 241 | CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y | ||
| 242 | CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y | ||
| 243 | CONFIG_USB_SERIAL_KEYSPAN_USA49W=y | ||
| 244 | CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | ||
| 245 | CONFIG_USB_SERIAL_MCT_U232=y | ||
| 246 | CONFIG_USB_SERIAL_PL2303=y | ||
| 247 | CONFIG_USB_GADGET=y | ||
| 248 | CONFIG_USB_ETH=m | ||
| 249 | CONFIG_USB_MASS_STORAGE=m | ||
| 250 | CONFIG_MMC=y | ||
| 251 | CONFIG_MMC_AT91=y | ||
| 252 | CONFIG_NEW_LEDS=y | ||
| 253 | CONFIG_LEDS_CLASS=y | ||
| 254 | CONFIG_LEDS_GPIO=y | ||
| 255 | CONFIG_LEDS_TRIGGERS=y | ||
| 256 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 257 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 258 | CONFIG_LEDS_TRIGGER_GPIO=y | ||
| 259 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
| 260 | CONFIG_RTC_CLASS=y | ||
| 261 | # CONFIG_RTC_HCTOSYS is not set | ||
| 262 | CONFIG_RTC_DRV_DS1307=y | ||
| 263 | CONFIG_RTC_DRV_PCF8563=y | ||
| 264 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 265 | CONFIG_EXT2_FS=y | ||
| 266 | CONFIG_EXT2_FS_XATTR=y | ||
| 267 | CONFIG_EXT3_FS=y | ||
| 268 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 269 | CONFIG_REISERFS_FS=y | ||
| 270 | CONFIG_AUTOFS4_FS=y | ||
| 271 | CONFIG_ISO9660_FS=y | ||
| 272 | CONFIG_JOLIET=y | ||
| 273 | CONFIG_ZISOFS=y | ||
| 274 | CONFIG_UDF_FS=y | ||
| 275 | CONFIG_MSDOS_FS=y | ||
| 276 | CONFIG_VFAT_FS=y | ||
| 277 | CONFIG_NTFS_FS=m | ||
| 278 | CONFIG_TMPFS=y | ||
| 279 | CONFIG_CONFIGFS_FS=y | ||
| 280 | CONFIG_JFFS2_FS=y | ||
| 281 | CONFIG_JFFS2_SUMMARY=y | ||
| 282 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 283 | CONFIG_JFFS2_LZO=y | ||
| 284 | CONFIG_JFFS2_RUBIN=y | ||
| 285 | CONFIG_CRAMFS=y | ||
| 286 | CONFIG_MINIX_FS=y | ||
| 287 | CONFIG_NFS_FS=y | ||
| 288 | CONFIG_NFS_V3=y | ||
| 289 | CONFIG_NFS_V3_ACL=y | ||
| 290 | CONFIG_NFS_V4=y | ||
| 291 | CONFIG_ROOT_NFS=y | ||
| 292 | CONFIG_NFSD=y | ||
| 293 | CONFIG_SMB_FS=m | ||
| 294 | CONFIG_CIFS=m | ||
| 295 | CONFIG_PARTITION_ADVANCED=y | ||
| 296 | CONFIG_MAC_PARTITION=y | ||
| 297 | CONFIG_NLS_CODEPAGE_437=y | ||
| 298 | CONFIG_NLS_CODEPAGE_737=m | ||
| 299 | CONFIG_NLS_CODEPAGE_775=m | ||
| 300 | CONFIG_NLS_CODEPAGE_850=m | ||
| 301 | CONFIG_NLS_CODEPAGE_852=m | ||
| 302 | CONFIG_NLS_CODEPAGE_855=m | ||
| 303 | CONFIG_NLS_CODEPAGE_857=m | ||
| 304 | CONFIG_NLS_CODEPAGE_860=m | ||
| 305 | CONFIG_NLS_CODEPAGE_861=m | ||
| 306 | CONFIG_NLS_CODEPAGE_862=m | ||
| 307 | CONFIG_NLS_CODEPAGE_863=m | ||
| 308 | CONFIG_NLS_CODEPAGE_864=m | ||
| 309 | CONFIG_NLS_CODEPAGE_865=m | ||
| 310 | CONFIG_NLS_CODEPAGE_866=m | ||
| 311 | CONFIG_NLS_CODEPAGE_869=m | ||
| 312 | CONFIG_NLS_CODEPAGE_936=m | ||
| 313 | CONFIG_NLS_CODEPAGE_950=m | ||
| 314 | CONFIG_NLS_CODEPAGE_932=m | ||
| 315 | CONFIG_NLS_CODEPAGE_949=m | ||
| 316 | CONFIG_NLS_CODEPAGE_874=m | ||
| 317 | CONFIG_NLS_ISO8859_8=m | ||
| 318 | CONFIG_NLS_CODEPAGE_1250=m | ||
| 319 | CONFIG_NLS_CODEPAGE_1251=m | ||
| 320 | CONFIG_NLS_ASCII=m | ||
| 321 | CONFIG_NLS_ISO8859_1=y | ||
| 322 | CONFIG_NLS_ISO8859_2=m | ||
| 323 | CONFIG_NLS_ISO8859_3=m | ||
| 324 | CONFIG_NLS_ISO8859_4=m | ||
| 325 | CONFIG_NLS_ISO8859_5=m | ||
| 326 | CONFIG_NLS_ISO8859_6=m | ||
| 327 | CONFIG_NLS_ISO8859_7=m | ||
| 328 | CONFIG_NLS_ISO8859_9=m | ||
| 329 | CONFIG_NLS_ISO8859_13=m | ||
| 330 | CONFIG_NLS_ISO8859_14=m | ||
| 331 | CONFIG_NLS_ISO8859_15=m | ||
| 332 | CONFIG_NLS_KOI8_R=m | ||
| 333 | CONFIG_NLS_KOI8_U=m | ||
| 334 | CONFIG_NLS_UTF8=y | ||
| 335 | CONFIG_MAGIC_SYSRQ=y | ||
| 336 | CONFIG_DEBUG_FS=y | ||
| 337 | CONFIG_DEBUG_KERNEL=y | ||
| 338 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
| 339 | # CONFIG_FTRACE is not set | ||
| 340 | CONFIG_CRYPTO_PCBC=y | ||
| 341 | CONFIG_CRYPTO_SHA1=y | ||
diff --git a/arch/arm/configs/at91rm9200dk_defconfig b/arch/arm/configs/at91rm9200dk_defconfig deleted file mode 100644 index 4438e64f3bfb..000000000000 --- a/arch/arm/configs/at91rm9200dk_defconfig +++ /dev/null | |||
| @@ -1,72 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_BLK_DEV_INITRD=y | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 9 | # CONFIG_IOSCHED_CFQ is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_ARCH_AT91RM9200DK=y | ||
| 12 | CONFIG_MACH_ECO920=y | ||
| 13 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 14 | # CONFIG_ARM_THUMB is not set | ||
| 15 | CONFIG_PCCARD=y | ||
| 16 | CONFIG_AT91_CF=y | ||
| 17 | CONFIG_LEDS=y | ||
| 18 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 19 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 20 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 21 | CONFIG_FPE_NWFPE=y | ||
| 22 | CONFIG_NET=y | ||
| 23 | CONFIG_PACKET=y | ||
| 24 | CONFIG_UNIX=y | ||
| 25 | CONFIG_INET=y | ||
| 26 | CONFIG_IP_PNP=y | ||
| 27 | CONFIG_IP_PNP_BOOTP=y | ||
| 28 | # CONFIG_IPV6 is not set | ||
| 29 | CONFIG_MTD=y | ||
| 30 | CONFIG_MTD_PARTITIONS=y | ||
| 31 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 32 | CONFIG_MTD_CHAR=y | ||
| 33 | CONFIG_MTD_BLOCK=y | ||
| 34 | CONFIG_MTD_CFI=y | ||
| 35 | CONFIG_MTD_JEDECPROBE=y | ||
| 36 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 37 | CONFIG_MTD_PHYSMAP=y | ||
| 38 | CONFIG_BLK_DEV_RAM=y | ||
| 39 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 40 | CONFIG_NETDEVICES=y | ||
| 41 | CONFIG_NET_ETHERNET=y | ||
| 42 | CONFIG_ARM_AT91_ETHER=y | ||
| 43 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 44 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 45 | # CONFIG_INPUT_MOUSE is not set | ||
| 46 | # CONFIG_SERIO is not set | ||
| 47 | CONFIG_SERIAL_ATMEL=y | ||
| 48 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 49 | CONFIG_I2C=y | ||
| 50 | CONFIG_I2C_CHARDEV=y | ||
| 51 | CONFIG_I2C_GPIO=y | ||
| 52 | CONFIG_WATCHDOG=y | ||
| 53 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 54 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 55 | # CONFIG_VGA_CONSOLE is not set | ||
| 56 | # CONFIG_USB_HID is not set | ||
| 57 | CONFIG_USB=y | ||
| 58 | CONFIG_USB_DEBUG=y | ||
| 59 | CONFIG_USB_DEVICEFS=y | ||
| 60 | CONFIG_USB_MON=y | ||
| 61 | CONFIG_USB_OHCI_HCD=y | ||
| 62 | CONFIG_USB_GADGET=y | ||
| 63 | CONFIG_MMC=y | ||
| 64 | CONFIG_RTC_CLASS=y | ||
| 65 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 66 | CONFIG_EXT2_FS=y | ||
| 67 | CONFIG_INOTIFY=y | ||
| 68 | CONFIG_TMPFS=y | ||
| 69 | CONFIG_CRAMFS=y | ||
| 70 | CONFIG_DEBUG_KERNEL=y | ||
| 71 | CONFIG_DEBUG_USER=y | ||
| 72 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/at91rm9200ek_defconfig b/arch/arm/configs/at91rm9200ek_defconfig deleted file mode 100644 index ccd517c64bc7..000000000000 --- a/arch/arm/configs/at91rm9200ek_defconfig +++ /dev/null | |||
| @@ -1,73 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_BLK_DEV_INITRD=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 10 | # CONFIG_IOSCHED_CFQ is not set | ||
| 11 | CONFIG_ARCH_AT91=y | ||
| 12 | CONFIG_MACH_AT91RM9200EK=y | ||
| 13 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 14 | # CONFIG_ARM_THUMB is not set | ||
| 15 | CONFIG_LEDS=y | ||
| 16 | CONFIG_LEDS_CPU=y | ||
| 17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 19 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 20 | CONFIG_FPE_NWFPE=y | ||
| 21 | CONFIG_NET=y | ||
| 22 | CONFIG_PACKET=y | ||
| 23 | CONFIG_UNIX=y | ||
| 24 | CONFIG_INET=y | ||
| 25 | CONFIG_IP_PNP=y | ||
| 26 | CONFIG_IP_PNP_BOOTP=y | ||
| 27 | # CONFIG_IPV6 is not set | ||
| 28 | CONFIG_MTD=y | ||
| 29 | CONFIG_MTD_PARTITIONS=y | ||
| 30 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 31 | CONFIG_MTD_CHAR=y | ||
| 32 | CONFIG_MTD_BLOCK=y | ||
| 33 | CONFIG_MTD_CFI=y | ||
| 34 | CONFIG_MTD_JEDECPROBE=y | ||
| 35 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 36 | CONFIG_MTD_PHYSMAP=y | ||
| 37 | CONFIG_BLK_DEV_RAM=y | ||
| 38 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 39 | CONFIG_NETDEVICES=y | ||
| 40 | CONFIG_NET_ETHERNET=y | ||
| 41 | CONFIG_ARM_AT91_ETHER=y | ||
| 42 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 43 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 44 | # CONFIG_INPUT_MOUSE is not set | ||
| 45 | # CONFIG_SERIO is not set | ||
| 46 | CONFIG_SERIAL_ATMEL=y | ||
| 47 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 48 | CONFIG_I2C=y | ||
| 49 | CONFIG_I2C_CHARDEV=y | ||
| 50 | CONFIG_I2C_GPIO=y | ||
| 51 | CONFIG_WATCHDOG=y | ||
| 52 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 53 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 54 | CONFIG_FB=y | ||
| 55 | CONFIG_FB_S1D13XXX=y | ||
| 56 | # CONFIG_VGA_CONSOLE is not set | ||
| 57 | # CONFIG_USB_HID is not set | ||
| 58 | CONFIG_USB=y | ||
| 59 | CONFIG_USB_DEBUG=y | ||
| 60 | CONFIG_USB_DEVICEFS=y | ||
| 61 | CONFIG_USB_MON=y | ||
| 62 | CONFIG_USB_OHCI_HCD=y | ||
| 63 | CONFIG_USB_GADGET=y | ||
| 64 | CONFIG_MMC=y | ||
| 65 | CONFIG_RTC_CLASS=y | ||
| 66 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 67 | CONFIG_EXT2_FS=y | ||
| 68 | CONFIG_INOTIFY=y | ||
| 69 | CONFIG_TMPFS=y | ||
| 70 | CONFIG_CRAMFS=y | ||
| 71 | CONFIG_DEBUG_KERNEL=y | ||
| 72 | CONFIG_DEBUG_USER=y | ||
| 73 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/ateb9200_defconfig b/arch/arm/configs/ateb9200_defconfig deleted file mode 100644 index 1b0e9a1689bb..000000000000 --- a/arch/arm/configs/ateb9200_defconfig +++ /dev/null | |||
| @@ -1,131 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 4 | CONFIG_EMBEDDED=y | ||
| 5 | CONFIG_SLAB=y | ||
| 6 | CONFIG_PROFILING=y | ||
| 7 | CONFIG_OPROFILE=m | ||
| 8 | CONFIG_MODULES=y | ||
| 9 | CONFIG_MODULE_UNLOAD=y | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_MACH_ATEB9200=y | ||
| 12 | CONFIG_PCCARD=m | ||
| 13 | CONFIG_AT91_CF=m | ||
| 14 | CONFIG_PREEMPT=y | ||
| 15 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 16 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 17 | CONFIG_FPE_NWFPE=y | ||
| 18 | CONFIG_PM=y | ||
| 19 | CONFIG_NET=y | ||
| 20 | CONFIG_PACKET=y | ||
| 21 | CONFIG_UNIX=y | ||
| 22 | CONFIG_NET_KEY=y | ||
| 23 | CONFIG_INET=y | ||
| 24 | # CONFIG_IPV6 is not set | ||
| 25 | CONFIG_BRIDGE=m | ||
| 26 | CONFIG_VLAN_8021Q=m | ||
| 27 | CONFIG_MTD=y | ||
| 28 | CONFIG_MTD_PARTITIONS=y | ||
| 29 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 30 | CONFIG_MTD_CHAR=y | ||
| 31 | CONFIG_MTD_BLOCK_RO=y | ||
| 32 | CONFIG_BLK_DEV_LOOP=m | ||
| 33 | CONFIG_BLK_DEV_NBD=m | ||
| 34 | CONFIG_SCSI=m | ||
| 35 | CONFIG_BLK_DEV_SD=m | ||
| 36 | CONFIG_BLK_DEV_SR=m | ||
| 37 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
| 38 | CONFIG_CHR_DEV_SG=m | ||
| 39 | CONFIG_SCSI_MULTI_LUN=y | ||
| 40 | CONFIG_NETDEVICES=y | ||
| 41 | CONFIG_DUMMY=m | ||
| 42 | CONFIG_TUN=m | ||
| 43 | CONFIG_PHYLIB=y | ||
| 44 | CONFIG_DAVICOM_PHY=y | ||
| 45 | CONFIG_NET_ETHERNET=y | ||
| 46 | CONFIG_ARM_AT91_ETHER=y | ||
| 47 | CONFIG_USB_USBNET=y | ||
| 48 | CONFIG_USB_NET_GL620A=y | ||
| 49 | CONFIG_USB_NET_PLUSB=y | ||
| 50 | CONFIG_USB_NET_RNDIS_HOST=y | ||
| 51 | CONFIG_USB_ALI_M5632=y | ||
| 52 | CONFIG_USB_AN2720=y | ||
| 53 | CONFIG_USB_EPSON2888=y | ||
| 54 | CONFIG_PPP=m | ||
| 55 | CONFIG_PPP_ASYNC=m | ||
| 56 | CONFIG_PPP_SYNC_TTY=m | ||
| 57 | CONFIG_PPP_DEFLATE=m | ||
| 58 | CONFIG_PPP_BSDCOMP=m | ||
| 59 | CONFIG_PPPOE=m | ||
| 60 | CONFIG_SERIAL_ATMEL=y | ||
| 61 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 62 | CONFIG_I2C=m | ||
| 63 | CONFIG_I2C_CHARDEV=m | ||
| 64 | CONFIG_I2C_GPIO=m | ||
| 65 | # CONFIG_VGA_CONSOLE is not set | ||
| 66 | CONFIG_SOUND=y | ||
| 67 | CONFIG_USB_HID=m | ||
| 68 | CONFIG_HID_PID=y | ||
| 69 | CONFIG_USB_HIDDEV=y | ||
| 70 | CONFIG_USB=y | ||
| 71 | CONFIG_USB_DEVICEFS=y | ||
| 72 | CONFIG_USB_MON=y | ||
| 73 | CONFIG_USB_OHCI_HCD=y | ||
| 74 | CONFIG_USB_ACM=m | ||
| 75 | CONFIG_USB_PRINTER=m | ||
| 76 | CONFIG_USB_STORAGE=m | ||
| 77 | CONFIG_USB_STORAGE_DATAFAB=m | ||
| 78 | CONFIG_USB_STORAGE_FREECOM=m | ||
| 79 | CONFIG_USB_STORAGE_USBAT=m | ||
| 80 | CONFIG_USB_STORAGE_SDDR09=m | ||
| 81 | CONFIG_USB_STORAGE_SDDR55=m | ||
| 82 | CONFIG_USB_STORAGE_JUMPSHOT=m | ||
| 83 | CONFIG_USB_SERIAL=m | ||
| 84 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 85 | CONFIG_USB_SERIAL_FTDI_SIO=m | ||
| 86 | CONFIG_USB_SERIAL_PL2303=m | ||
| 87 | CONFIG_USB_GADGET=m | ||
| 88 | CONFIG_USB_ETH=m | ||
| 89 | CONFIG_USB_GADGETFS=m | ||
| 90 | CONFIG_USB_FILE_STORAGE=m | ||
| 91 | CONFIG_USB_G_SERIAL=m | ||
| 92 | CONFIG_MMC=m | ||
| 93 | CONFIG_MMC_DEBUG=y | ||
| 94 | CONFIG_RTC_CLASS=y | ||
| 95 | # CONFIG_RTC_HCTOSYS is not set | ||
| 96 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 97 | CONFIG_EXT2_FS=m | ||
| 98 | CONFIG_EXT3_FS=m | ||
| 99 | CONFIG_REISERFS_FS=m | ||
| 100 | CONFIG_INOTIFY=y | ||
| 101 | CONFIG_ISO9660_FS=m | ||
| 102 | CONFIG_JOLIET=y | ||
| 103 | CONFIG_ZISOFS=y | ||
| 104 | CONFIG_UDF_FS=m | ||
| 105 | CONFIG_MSDOS_FS=m | ||
| 106 | CONFIG_VFAT_FS=m | ||
| 107 | CONFIG_NTFS_FS=m | ||
| 108 | CONFIG_NTFS_RW=y | ||
| 109 | CONFIG_TMPFS=y | ||
| 110 | CONFIG_CRAMFS=y | ||
| 111 | CONFIG_NFS_FS=m | ||
| 112 | CONFIG_NFS_V3=y | ||
| 113 | CONFIG_NFS_V3_ACL=y | ||
| 114 | CONFIG_NFS_V4=y | ||
| 115 | CONFIG_NFSD=m | ||
| 116 | CONFIG_NFSD_V4=y | ||
| 117 | CONFIG_PARTITION_ADVANCED=y | ||
| 118 | CONFIG_MAC_PARTITION=y | ||
| 119 | CONFIG_BSD_DISKLABEL=y | ||
| 120 | CONFIG_MINIX_SUBPARTITION=y | ||
| 121 | CONFIG_SOLARIS_X86_PARTITION=y | ||
| 122 | CONFIG_UNIXWARE_DISKLABEL=y | ||
| 123 | CONFIG_NLS_CODEPAGE_932=m | ||
| 124 | CONFIG_NLS_ASCII=m | ||
| 125 | CONFIG_NLS_ISO8859_15=m | ||
| 126 | CONFIG_NLS_UTF8=m | ||
| 127 | CONFIG_CRYPTO_MD5=y | ||
| 128 | CONFIG_CRYPTO_MICHAEL_MIC=m | ||
| 129 | CONFIG_CRYPTO_ARC4=m | ||
| 130 | CONFIG_CRC16=m | ||
| 131 | CONFIG_LIBCRC32C=m | ||
diff --git a/arch/arm/configs/carmeva_defconfig b/arch/arm/configs/carmeva_defconfig deleted file mode 100644 index ac64dbd8a49c..000000000000 --- a/arch/arm/configs/carmeva_defconfig +++ /dev/null | |||
| @@ -1,47 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 3 | CONFIG_BLK_DEV_INITRD=y | ||
| 4 | CONFIG_EMBEDDED=y | ||
| 5 | # CONFIG_HOTPLUG is not set | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | CONFIG_MODULE_FORCE_UNLOAD=y | ||
| 9 | CONFIG_ARCH_AT91=y | ||
| 10 | CONFIG_MACH_CARMEVA=y | ||
| 11 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 12 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 13 | CONFIG_FPE_NWFPE=y | ||
| 14 | CONFIG_NET=y | ||
| 15 | CONFIG_UNIX=y | ||
| 16 | CONFIG_INET=y | ||
| 17 | CONFIG_IP_MULTICAST=y | ||
| 18 | CONFIG_IP_PNP=y | ||
| 19 | # CONFIG_IPV6 is not set | ||
| 20 | CONFIG_MTD=y | ||
| 21 | CONFIG_MTD_PARTITIONS=y | ||
| 22 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 23 | CONFIG_MTD_CHAR=y | ||
| 24 | CONFIG_MTD_BLOCK=y | ||
| 25 | CONFIG_BLK_DEV_RAM=y | ||
| 26 | CONFIG_NETDEVICES=y | ||
| 27 | CONFIG_NET_ETHERNET=y | ||
| 28 | CONFIG_ARM_AT91_ETHER=y | ||
| 29 | # CONFIG_INPUT_MOUSEDEV is not set | ||
| 30 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 31 | # CONFIG_INPUT_MOUSE is not set | ||
| 32 | CONFIG_SERIO=m | ||
| 33 | CONFIG_SERIAL_ATMEL=y | ||
| 34 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 35 | # CONFIG_VGA_CONSOLE is not set | ||
| 36 | CONFIG_MMC=m | ||
| 37 | CONFIG_MMC_DEBUG=y | ||
| 38 | CONFIG_EXT2_FS=y | ||
| 39 | CONFIG_EXT2_FS_XATTR=y | ||
| 40 | # CONFIG_DNOTIFY is not set | ||
| 41 | CONFIG_JFFS2_FS=y | ||
| 42 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 43 | CONFIG_NFS_FS=y | ||
| 44 | CONFIG_NFS_V3=y | ||
| 45 | CONFIG_NFS_V4=y | ||
| 46 | CONFIG_ROOT_NFS=y | ||
| 47 | CONFIG_NFSD=y | ||
diff --git a/arch/arm/configs/cpuat91_defconfig b/arch/arm/configs/cpuat91_defconfig deleted file mode 100644 index 022aeb55b676..000000000000 --- a/arch/arm/configs/cpuat91_defconfig +++ /dev/null | |||
| @@ -1,112 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_BLK_DEV_BSG is not set | ||
| 10 | # CONFIG_IOSCHED_CFQ is not set | ||
| 11 | CONFIG_ARCH_AT91=y | ||
| 12 | CONFIG_MACH_CPUAT91=y | ||
| 13 | CONFIG_AT91_TIMER_HZ=100 | ||
| 14 | # CONFIG_ARM_THUMB is not set | ||
| 15 | CONFIG_PREEMPT=y | ||
| 16 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 17 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 18 | CONFIG_NET=y | ||
| 19 | CONFIG_PACKET=y | ||
| 20 | CONFIG_UNIX=y | ||
| 21 | CONFIG_INET=y | ||
| 22 | CONFIG_IP_PNP=y | ||
| 23 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 24 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 25 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 26 | # CONFIG_IPV6 is not set | ||
| 27 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 28 | CONFIG_MTD=y | ||
| 29 | CONFIG_MTD_PARTITIONS=y | ||
| 30 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 31 | CONFIG_MTD_CHAR=y | ||
| 32 | CONFIG_MTD_BLOCK=y | ||
| 33 | CONFIG_MTD_CFI=y | ||
| 34 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 35 | CONFIG_MTD_PHYSMAP=y | ||
| 36 | CONFIG_MTD_PLATRAM=y | ||
| 37 | CONFIG_BLK_DEV_LOOP=y | ||
| 38 | CONFIG_BLK_DEV_NBD=y | ||
| 39 | CONFIG_BLK_DEV_RAM=y | ||
| 40 | # CONFIG_MISC_DEVICES is not set | ||
| 41 | CONFIG_SCSI=y | ||
| 42 | CONFIG_BLK_DEV_SD=y | ||
| 43 | CONFIG_SCSI_MULTI_LUN=y | ||
| 44 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 45 | CONFIG_NETDEVICES=y | ||
| 46 | CONFIG_PHYLIB=y | ||
| 47 | CONFIG_NET_ETHERNET=y | ||
| 48 | CONFIG_ARM_AT91_ETHER=y | ||
| 49 | # CONFIG_NETDEV_1000 is not set | ||
| 50 | # CONFIG_NETDEV_10000 is not set | ||
| 51 | CONFIG_PPP=y | ||
| 52 | CONFIG_PPP_ASYNC=y | ||
| 53 | CONFIG_PPP_DEFLATE=y | ||
| 54 | CONFIG_PPP_BSDCOMP=y | ||
| 55 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 56 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 57 | # CONFIG_INPUT_MOUSE is not set | ||
| 58 | # CONFIG_SERIO is not set | ||
| 59 | CONFIG_SERIAL_ATMEL=y | ||
| 60 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 61 | CONFIG_LEGACY_PTY_COUNT=32 | ||
| 62 | # CONFIG_HW_RANDOM is not set | ||
| 63 | CONFIG_I2C=y | ||
| 64 | CONFIG_I2C_CHARDEV=y | ||
| 65 | CONFIG_I2C_GPIO=y | ||
| 66 | CONFIG_GPIO_SYSFS=y | ||
| 67 | # CONFIG_HWMON is not set | ||
| 68 | CONFIG_WATCHDOG=y | ||
| 69 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 70 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 71 | # CONFIG_VGA_CONSOLE is not set | ||
| 72 | # CONFIG_HID_SUPPORT is not set | ||
| 73 | CONFIG_USB=y | ||
| 74 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 75 | CONFIG_USB_OHCI_HCD=y | ||
| 76 | CONFIG_USB_STORAGE=y | ||
| 77 | CONFIG_USB_GADGET=y | ||
| 78 | CONFIG_USB_ETH=m | ||
| 79 | CONFIG_MMC=y | ||
| 80 | CONFIG_MMC_AT91=m | ||
| 81 | CONFIG_NEW_LEDS=y | ||
| 82 | CONFIG_LEDS_CLASS=y | ||
| 83 | CONFIG_LEDS_GPIO=y | ||
| 84 | CONFIG_LEDS_TRIGGERS=y | ||
| 85 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 86 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 87 | CONFIG_LEDS_TRIGGER_GPIO=y | ||
| 88 | CONFIG_LEDS_TRIGGER_DEFAULT_ON=y | ||
| 89 | CONFIG_RTC_CLASS=y | ||
| 90 | # CONFIG_RTC_HCTOSYS is not set | ||
| 91 | CONFIG_RTC_DRV_DS1307=y | ||
| 92 | CONFIG_RTC_DRV_PCF8563=y | ||
| 93 | CONFIG_EXT2_FS=y | ||
| 94 | CONFIG_EXT3_FS=y | ||
| 95 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 96 | CONFIG_INOTIFY=y | ||
| 97 | CONFIG_AUTOFS4_FS=y | ||
| 98 | CONFIG_MSDOS_FS=y | ||
| 99 | CONFIG_VFAT_FS=y | ||
| 100 | CONFIG_TMPFS=y | ||
| 101 | CONFIG_JFFS2_FS=y | ||
| 102 | CONFIG_JFFS2_SUMMARY=y | ||
| 103 | CONFIG_CRAMFS=y | ||
| 104 | CONFIG_MINIX_FS=y | ||
| 105 | CONFIG_NFS_FS=y | ||
| 106 | CONFIG_NFS_V3=y | ||
| 107 | CONFIG_ROOT_NFS=y | ||
| 108 | CONFIG_PARTITION_ADVANCED=y | ||
| 109 | CONFIG_NLS_CODEPAGE_437=y | ||
| 110 | CONFIG_NLS_ISO8859_1=y | ||
| 111 | CONFIG_NLS_UTF8=y | ||
| 112 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
diff --git a/arch/arm/configs/csb337_defconfig b/arch/arm/configs/csb337_defconfig deleted file mode 100644 index a24c448840c4..000000000000 --- a/arch/arm/configs/csb337_defconfig +++ /dev/null | |||
| @@ -1,104 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_BLK_DEV_INITRD=y | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | # CONFIG_BLK_DEV_BSG is not set | ||
| 9 | CONFIG_ARCH_AT91=y | ||
| 10 | CONFIG_MACH_CSB337=y | ||
| 11 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 12 | # CONFIG_ARM_THUMB is not set | ||
| 13 | CONFIG_PCCARD=y | ||
| 14 | CONFIG_AT91_CF=y | ||
| 15 | CONFIG_LEDS=y | ||
| 16 | CONFIG_LEDS_CPU=y | ||
| 17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 19 | CONFIG_CMDLINE="mem=32M console=ttyS0,38400 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 20 | CONFIG_FPE_NWFPE=y | ||
| 21 | CONFIG_NET=y | ||
| 22 | CONFIG_PACKET=y | ||
| 23 | CONFIG_UNIX=y | ||
| 24 | CONFIG_INET=y | ||
| 25 | CONFIG_IP_PNP=y | ||
| 26 | CONFIG_IP_PNP_DHCP=y | ||
| 27 | CONFIG_IP_PNP_BOOTP=y | ||
| 28 | # CONFIG_INET_LRO is not set | ||
| 29 | # CONFIG_IPV6 is not set | ||
| 30 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 31 | CONFIG_MTD=y | ||
| 32 | CONFIG_MTD_PARTITIONS=y | ||
| 33 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 34 | CONFIG_MTD_CHAR=y | ||
| 35 | CONFIG_MTD_BLOCK=y | ||
| 36 | CONFIG_MTD_CFI=y | ||
| 37 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 38 | CONFIG_MTD_PHYSMAP=y | ||
| 39 | CONFIG_BLK_DEV_LOOP=y | ||
| 40 | CONFIG_BLK_DEV_RAM=y | ||
| 41 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 42 | CONFIG_ATMEL_SSC=y | ||
| 43 | CONFIG_SCSI=y | ||
| 44 | CONFIG_NETDEVICES=y | ||
| 45 | CONFIG_NET_ETHERNET=y | ||
| 46 | CONFIG_ARM_AT91_ETHER=y | ||
| 47 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 48 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 49 | # CONFIG_INPUT_MOUSE is not set | ||
| 50 | # CONFIG_SERIO is not set | ||
| 51 | CONFIG_SERIAL_ATMEL=y | ||
| 52 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 53 | # CONFIG_HW_RANDOM is not set | ||
| 54 | CONFIG_I2C=y | ||
| 55 | CONFIG_I2C_CHARDEV=y | ||
| 56 | CONFIG_I2C_GPIO=y | ||
| 57 | # CONFIG_HWMON is not set | ||
| 58 | CONFIG_WATCHDOG=y | ||
| 59 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 60 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 61 | # CONFIG_VGA_CONSOLE is not set | ||
| 62 | # CONFIG_USB_HID is not set | ||
| 63 | CONFIG_USB=y | ||
| 64 | CONFIG_USB_DEBUG=y | ||
| 65 | CONFIG_USB_DEVICEFS=y | ||
| 66 | CONFIG_USB_MON=y | ||
| 67 | CONFIG_USB_OHCI_HCD=y | ||
| 68 | CONFIG_USB_STORAGE=y | ||
| 69 | CONFIG_USB_SERIAL=y | ||
| 70 | CONFIG_USB_SERIAL_CONSOLE=y | ||
| 71 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 72 | CONFIG_USB_SERIAL_FTDI_SIO=y | ||
| 73 | CONFIG_USB_SERIAL_KEYSPAN=y | ||
| 74 | CONFIG_USB_SERIAL_KEYSPAN_MPR=y | ||
| 75 | CONFIG_USB_SERIAL_KEYSPAN_USA28=y | ||
| 76 | CONFIG_USB_SERIAL_KEYSPAN_USA28X=y | ||
| 77 | CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y | ||
| 78 | CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y | ||
| 79 | CONFIG_USB_SERIAL_KEYSPAN_USA19=y | ||
| 80 | CONFIG_USB_SERIAL_KEYSPAN_USA18X=y | ||
| 81 | CONFIG_USB_SERIAL_KEYSPAN_USA19W=y | ||
| 82 | CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y | ||
| 83 | CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y | ||
| 84 | CONFIG_USB_SERIAL_KEYSPAN_USA49W=y | ||
| 85 | CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | ||
| 86 | CONFIG_USB_SERIAL_MCT_U232=y | ||
| 87 | CONFIG_USB_GADGET=y | ||
| 88 | CONFIG_MMC=y | ||
| 89 | CONFIG_RTC_CLASS=y | ||
| 90 | CONFIG_RTC_HCTOSYS_DEVICE="rtc1" | ||
| 91 | # CONFIG_RTC_INTF_SYSFS is not set | ||
| 92 | CONFIG_RTC_DRV_DS1307=y | ||
| 93 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 94 | CONFIG_EXT2_FS=y | ||
| 95 | CONFIG_INOTIFY=y | ||
| 96 | CONFIG_TMPFS=y | ||
| 97 | CONFIG_CRAMFS=y | ||
| 98 | CONFIG_NFS_FS=y | ||
| 99 | CONFIG_NFS_V3=y | ||
| 100 | CONFIG_NFS_V4=y | ||
| 101 | CONFIG_ROOT_NFS=y | ||
| 102 | CONFIG_DEBUG_KERNEL=y | ||
| 103 | CONFIG_DEBUG_USER=y | ||
| 104 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/csb637_defconfig b/arch/arm/configs/csb637_defconfig deleted file mode 100644 index 98552adac5fb..000000000000 --- a/arch/arm/configs/csb637_defconfig +++ /dev/null | |||
| @@ -1,98 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_SYSFS_DEPRECATED_V2=y | ||
| 6 | CONFIG_BLK_DEV_INITRD=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_BLK_DEV_BSG is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_MACH_CSB637=y | ||
| 12 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 13 | # CONFIG_ARM_THUMB is not set | ||
| 14 | CONFIG_PCCARD=y | ||
| 15 | CONFIG_AT91_CF=y | ||
| 16 | CONFIG_LEDS=y | ||
| 17 | CONFIG_LEDS_CPU=y | ||
| 18 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 19 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 20 | CONFIG_CMDLINE="mem=32M console=ttyS0,38400 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 21 | CONFIG_FPE_NWFPE=y | ||
| 22 | CONFIG_NET=y | ||
| 23 | CONFIG_PACKET=y | ||
| 24 | CONFIG_UNIX=y | ||
| 25 | CONFIG_INET=y | ||
| 26 | CONFIG_IP_PNP=y | ||
| 27 | CONFIG_IP_PNP_DHCP=y | ||
| 28 | CONFIG_IP_PNP_BOOTP=y | ||
| 29 | # CONFIG_INET_LRO is not set | ||
| 30 | # CONFIG_IPV6 is not set | ||
| 31 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 32 | CONFIG_MTD=y | ||
| 33 | CONFIG_MTD_PARTITIONS=y | ||
| 34 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 35 | CONFIG_MTD_CHAR=y | ||
| 36 | CONFIG_MTD_BLOCK=y | ||
| 37 | CONFIG_MTD_CFI=y | ||
| 38 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 39 | CONFIG_MTD_PHYSMAP=y | ||
| 40 | CONFIG_BLK_DEV_LOOP=y | ||
| 41 | CONFIG_BLK_DEV_RAM=y | ||
| 42 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 43 | CONFIG_SCSI=y | ||
| 44 | CONFIG_NETDEVICES=y | ||
| 45 | CONFIG_NET_ETHERNET=y | ||
| 46 | CONFIG_ARM_AT91_ETHER=y | ||
| 47 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 48 | # CONFIG_INPUT_MOUSE is not set | ||
| 49 | # CONFIG_SERIO is not set | ||
| 50 | CONFIG_SERIAL_ATMEL=y | ||
| 51 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 52 | CONFIG_I2C=y | ||
| 53 | CONFIG_I2C_CHARDEV=y | ||
| 54 | CONFIG_WATCHDOG=y | ||
| 55 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 56 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 57 | # CONFIG_VGA_CONSOLE is not set | ||
| 58 | # CONFIG_USB_HID is not set | ||
| 59 | CONFIG_USB=y | ||
| 60 | CONFIG_USB_DEBUG=y | ||
| 61 | CONFIG_USB_DEVICEFS=y | ||
| 62 | CONFIG_USB_MON=y | ||
| 63 | CONFIG_USB_OHCI_HCD=y | ||
| 64 | CONFIG_USB_STORAGE=y | ||
| 65 | CONFIG_USB_SERIAL=y | ||
| 66 | CONFIG_USB_SERIAL_CONSOLE=y | ||
| 67 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 68 | CONFIG_USB_SERIAL_FTDI_SIO=y | ||
| 69 | CONFIG_USB_SERIAL_KEYSPAN=y | ||
| 70 | CONFIG_USB_SERIAL_KEYSPAN_MPR=y | ||
| 71 | CONFIG_USB_SERIAL_KEYSPAN_USA28=y | ||
| 72 | CONFIG_USB_SERIAL_KEYSPAN_USA28X=y | ||
| 73 | CONFIG_USB_SERIAL_KEYSPAN_USA28XA=y | ||
| 74 | CONFIG_USB_SERIAL_KEYSPAN_USA28XB=y | ||
| 75 | CONFIG_USB_SERIAL_KEYSPAN_USA19=y | ||
| 76 | CONFIG_USB_SERIAL_KEYSPAN_USA18X=y | ||
| 77 | CONFIG_USB_SERIAL_KEYSPAN_USA19W=y | ||
| 78 | CONFIG_USB_SERIAL_KEYSPAN_USA19QW=y | ||
| 79 | CONFIG_USB_SERIAL_KEYSPAN_USA19QI=y | ||
| 80 | CONFIG_USB_SERIAL_KEYSPAN_USA49W=y | ||
| 81 | CONFIG_USB_SERIAL_KEYSPAN_USA49WLC=y | ||
| 82 | CONFIG_USB_SERIAL_MCT_U232=y | ||
| 83 | CONFIG_NEW_LEDS=y | ||
| 84 | CONFIG_LEDS_CLASS=y | ||
| 85 | CONFIG_LEDS_GPIO=y | ||
| 86 | CONFIG_LEDS_TRIGGERS=y | ||
| 87 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 88 | CONFIG_EXT2_FS=y | ||
| 89 | CONFIG_INOTIFY=y | ||
| 90 | CONFIG_TMPFS=y | ||
| 91 | CONFIG_CRAMFS=y | ||
| 92 | CONFIG_NFS_FS=y | ||
| 93 | CONFIG_NFS_V3=y | ||
| 94 | CONFIG_NFS_V4=y | ||
| 95 | CONFIG_ROOT_NFS=y | ||
| 96 | CONFIG_DEBUG_KERNEL=y | ||
| 97 | CONFIG_DEBUG_USER=y | ||
| 98 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/ecbat91_defconfig b/arch/arm/configs/ecbat91_defconfig deleted file mode 100644 index 6bb6abdcea8c..000000000000 --- a/arch/arm/configs/ecbat91_defconfig +++ /dev/null | |||
| @@ -1,99 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_IKCONFIG=y | ||
| 4 | CONFIG_IKCONFIG_PROC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_SLAB=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 10 | # CONFIG_IOSCHED_CFQ is not set | ||
| 11 | CONFIG_ARCH_AT91=y | ||
| 12 | CONFIG_MACH_ECBAT91=y | ||
| 13 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 14 | CONFIG_PCCARD=y | ||
| 15 | CONFIG_AT91_CF=y | ||
| 16 | CONFIG_PREEMPT=y | ||
| 17 | CONFIG_LEDS=y | ||
| 18 | CONFIG_LEDS_CPU=y | ||
| 19 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 20 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 21 | CONFIG_CMDLINE="rootfstype=reiserfs root=/dev/mmcblk0p1 console=ttyS0,115200n8 rootdelay=1" | ||
| 22 | CONFIG_FPE_NWFPE=y | ||
| 23 | CONFIG_NET=y | ||
| 24 | CONFIG_PACKET=y | ||
| 25 | CONFIG_UNIX=y | ||
| 26 | CONFIG_INET=y | ||
| 27 | CONFIG_IP_PNP=y | ||
| 28 | CONFIG_IP_PNP_DHCP=y | ||
| 29 | # CONFIG_IPV6 is not set | ||
| 30 | CONFIG_CFG80211=y | ||
| 31 | CONFIG_MAC80211=y | ||
| 32 | # CONFIG_STANDALONE is not set | ||
| 33 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | ||
| 34 | CONFIG_MTD=y | ||
| 35 | CONFIG_MTD_PARTITIONS=y | ||
| 36 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 37 | CONFIG_MTD_AFS_PARTS=y | ||
| 38 | CONFIG_MTD_CHAR=y | ||
| 39 | CONFIG_MTD_BLOCK=y | ||
| 40 | CONFIG_MTD_DATAFLASH=y | ||
| 41 | CONFIG_BLK_DEV_LOOP=y | ||
| 42 | CONFIG_SCSI=y | ||
| 43 | CONFIG_BLK_DEV_SD=y | ||
| 44 | CONFIG_CHR_DEV_SG=y | ||
| 45 | CONFIG_NETDEVICES=y | ||
| 46 | CONFIG_NET_ETHERNET=y | ||
| 47 | CONFIG_ARM_AT91_ETHER=y | ||
| 48 | # CONFIG_NETDEV_1000 is not set | ||
| 49 | # CONFIG_NETDEV_10000 is not set | ||
| 50 | CONFIG_PPP=y | ||
| 51 | CONFIG_PPP_MULTILINK=y | ||
| 52 | CONFIG_PPP_FILTER=y | ||
| 53 | CONFIG_PPP_ASYNC=y | ||
| 54 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 55 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 56 | # CONFIG_INPUT_MOUSE is not set | ||
| 57 | # CONFIG_SERIO is not set | ||
| 58 | CONFIG_SERIAL_ATMEL=y | ||
| 59 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 60 | CONFIG_HW_RANDOM=y | ||
| 61 | CONFIG_I2C=y | ||
| 62 | CONFIG_I2C_CHARDEV=y | ||
| 63 | CONFIG_SPI=y | ||
| 64 | CONFIG_SPI_BITBANG=y | ||
| 65 | CONFIG_WATCHDOG=y | ||
| 66 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 67 | # CONFIG_VGA_CONSOLE is not set | ||
| 68 | # CONFIG_USB_HID is not set | ||
| 69 | CONFIG_USB=y | ||
| 70 | CONFIG_USB_DEVICEFS=y | ||
| 71 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 72 | CONFIG_USB_OHCI_HCD=y | ||
| 73 | CONFIG_USB_PRINTER=y | ||
| 74 | CONFIG_USB_STORAGE=y | ||
| 75 | CONFIG_USB_GADGET=y | ||
| 76 | CONFIG_MMC=y | ||
| 77 | CONFIG_MMC_DEBUG=y | ||
| 78 | CONFIG_MMC_AT91=m | ||
| 79 | CONFIG_NEW_LEDS=y | ||
| 80 | CONFIG_LEDS_CLASS=y | ||
| 81 | CONFIG_RTC_CLASS=y | ||
| 82 | # CONFIG_RTC_HCTOSYS is not set | ||
| 83 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 84 | CONFIG_EXT2_FS=y | ||
| 85 | CONFIG_EXT3_FS=y | ||
| 86 | CONFIG_REISERFS_FS=y | ||
| 87 | CONFIG_INOTIFY=y | ||
| 88 | CONFIG_TMPFS=y | ||
| 89 | CONFIG_CONFIGFS_FS=y | ||
| 90 | CONFIG_CRAMFS=y | ||
| 91 | CONFIG_NFS_FS=y | ||
| 92 | CONFIG_NFS_V3=y | ||
| 93 | CONFIG_NFS_V3_ACL=y | ||
| 94 | CONFIG_NFS_V4=y | ||
| 95 | CONFIG_ROOT_NFS=y | ||
| 96 | CONFIG_PARTITION_ADVANCED=y | ||
| 97 | CONFIG_DEBUG_USER=y | ||
| 98 | CONFIG_CRYPTO_PCBC=y | ||
| 99 | CONFIG_CRYPTO_SHA1=y | ||
diff --git a/arch/arm/configs/kafa_defconfig b/arch/arm/configs/kafa_defconfig deleted file mode 100644 index 896dbe00dc6e..000000000000 --- a/arch/arm/configs/kafa_defconfig +++ /dev/null | |||
| @@ -1,61 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_LOCALVERSION_AUTO is not set | ||
| 3 | # CONFIG_SWAP is not set | ||
| 4 | CONFIG_SYSVIPC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_SLAB=y | ||
| 7 | CONFIG_MODULES=y | ||
| 8 | CONFIG_MODULE_UNLOAD=y | ||
| 9 | # CONFIG_IOSCHED_CFQ is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_MACH_KAFA=y | ||
| 12 | # CONFIG_ARM_THUMB is not set | ||
| 13 | CONFIG_PREEMPT=y | ||
| 14 | CONFIG_LEDS=y | ||
| 15 | CONFIG_LEDS_CPU=y | ||
| 16 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 17 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 18 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20800000,10M root=/dev/ram0 rw" | ||
| 19 | CONFIG_FPE_NWFPE=y | ||
| 20 | CONFIG_BINFMT_MISC=y | ||
| 21 | CONFIG_NET=y | ||
| 22 | CONFIG_PACKET=y | ||
| 23 | CONFIG_UNIX=y | ||
| 24 | CONFIG_INET=y | ||
| 25 | # CONFIG_INET_DIAG is not set | ||
| 26 | # CONFIG_IPV6 is not set | ||
| 27 | CONFIG_MTD=y | ||
| 28 | CONFIG_MTD_PARTITIONS=y | ||
| 29 | CONFIG_MTD_CHAR=y | ||
| 30 | CONFIG_MTD_BLOCK_RO=y | ||
| 31 | CONFIG_NETDEVICES=y | ||
| 32 | CONFIG_PHYLIB=y | ||
| 33 | CONFIG_DAVICOM_PHY=y | ||
| 34 | CONFIG_NET_ETHERNET=y | ||
| 35 | CONFIG_ARM_AT91_ETHER=y | ||
| 36 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 37 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 38 | # CONFIG_INPUT_MOUSE is not set | ||
| 39 | # CONFIG_SERIO is not set | ||
| 40 | CONFIG_SERIAL_ATMEL=y | ||
| 41 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 42 | CONFIG_LEGACY_PTY_COUNT=32 | ||
| 43 | CONFIG_I2C=y | ||
| 44 | CONFIG_I2C_CHARDEV=y | ||
| 45 | CONFIG_I2C_GPIO=y | ||
| 46 | # CONFIG_HWMON is not set | ||
| 47 | CONFIG_WATCHDOG=y | ||
| 48 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 49 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 50 | # CONFIG_VGA_CONSOLE is not set | ||
| 51 | CONFIG_RTC_CLASS=y | ||
| 52 | # CONFIG_RTC_HCTOSYS is not set | ||
| 53 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 54 | CONFIG_EXT3_FS=y | ||
| 55 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 56 | CONFIG_TMPFS=y | ||
| 57 | CONFIG_CRAMFS=y | ||
| 58 | CONFIG_NFS_FS=m | ||
| 59 | CONFIG_NFS_V3=y | ||
| 60 | CONFIG_CRYPTO_MD5=y | ||
| 61 | CONFIG_CRYPTO_DES=y | ||
diff --git a/arch/arm/configs/kb9202_defconfig b/arch/arm/configs/kb9202_defconfig deleted file mode 100644 index 9f906a85f5c2..000000000000 --- a/arch/arm/configs/kb9202_defconfig +++ /dev/null | |||
| @@ -1,127 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_POSIX_MQUEUE=y | ||
| 5 | CONFIG_BSD_PROCESS_ACCT=y | ||
| 6 | CONFIG_AUDIT=y | ||
| 7 | CONFIG_IKCONFIG=y | ||
| 8 | CONFIG_IKCONFIG_PROC=y | ||
| 9 | CONFIG_BLK_DEV_INITRD=y | ||
| 10 | CONFIG_KALLSYMS_EXTRA_PASS=y | ||
| 11 | CONFIG_MODULES=y | ||
| 12 | CONFIG_MODULE_UNLOAD=y | ||
| 13 | CONFIG_MODVERSIONS=y | ||
| 14 | CONFIG_MODULE_SRCVERSION_ALL=y | ||
| 15 | # CONFIG_BLK_DEV_BSG is not set | ||
| 16 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 17 | CONFIG_ARCH_AT91=y | ||
| 18 | CONFIG_MACH_KB9200=y | ||
| 19 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 20 | CONFIG_NO_HZ=y | ||
| 21 | CONFIG_HIGH_RES_TIMERS=y | ||
| 22 | CONFIG_PREEMPT=y | ||
| 23 | CONFIG_AEABI=y | ||
| 24 | CONFIG_ZBOOT_ROM_TEXT=0x10000000 | ||
| 25 | CONFIG_ZBOOT_ROM_BSS=0x20040000 | ||
| 26 | CONFIG_CMDLINE="noinitrd root=/dev/mtdblock0 rootfstype=jffs2 mem=64M" | ||
| 27 | CONFIG_KEXEC=y | ||
| 28 | CONFIG_FPE_NWFPE=y | ||
| 29 | CONFIG_BINFMT_MISC=y | ||
| 30 | CONFIG_NET=y | ||
| 31 | CONFIG_PACKET=y | ||
| 32 | CONFIG_UNIX=y | ||
| 33 | CONFIG_INET=y | ||
| 34 | CONFIG_IP_PNP=y | ||
| 35 | CONFIG_IP_PNP_DHCP=y | ||
| 36 | CONFIG_IP_PNP_BOOTP=y | ||
| 37 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 38 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 39 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 40 | # CONFIG_INET_LRO is not set | ||
| 41 | # CONFIG_INET_DIAG is not set | ||
| 42 | # CONFIG_IPV6 is not set | ||
| 43 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 44 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
| 45 | CONFIG_MTD=y | ||
| 46 | CONFIG_MTD_CONCAT=y | ||
| 47 | CONFIG_MTD_PARTITIONS=y | ||
| 48 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 49 | CONFIG_MTD_CHAR=y | ||
| 50 | CONFIG_MTD_BLOCK=y | ||
| 51 | CONFIG_MTD_CFI=y | ||
| 52 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 53 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
| 54 | CONFIG_MTD_PHYSMAP=y | ||
| 55 | CONFIG_MTD_NAND=y | ||
| 56 | CONFIG_MTD_NAND_ATMEL=y | ||
| 57 | CONFIG_MTD_UBI=y | ||
| 58 | CONFIG_MTD_UBI_GLUEBI=y | ||
| 59 | CONFIG_BLK_DEV_LOOP=y | ||
| 60 | CONFIG_BLK_DEV_RAM=y | ||
| 61 | CONFIG_BLK_DEV_RAM_SIZE=16384 | ||
| 62 | CONFIG_ATMEL_TCLIB=y | ||
| 63 | CONFIG_ATMEL_SSC=y | ||
| 64 | CONFIG_SCSI=y | ||
| 65 | CONFIG_BLK_DEV_SD=y | ||
| 66 | CONFIG_CHR_DEV_SG=y | ||
| 67 | CONFIG_SCSI_MULTI_LUN=y | ||
| 68 | CONFIG_SCSI_CONSTANTS=y | ||
| 69 | CONFIG_SCSI_LOGGING=y | ||
| 70 | CONFIG_SCSI_SPI_ATTRS=m | ||
| 71 | # CONFIG_SCSI_LOWLEVEL is not set | ||
| 72 | CONFIG_NETDEVICES=y | ||
| 73 | CONFIG_NET_ETHERNET=y | ||
| 74 | CONFIG_ARM_AT91_ETHER=y | ||
| 75 | # CONFIG_NETDEV_1000 is not set | ||
| 76 | # CONFIG_NETDEV_10000 is not set | ||
| 77 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 78 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 79 | # CONFIG_INPUT_MOUSE is not set | ||
| 80 | # CONFIG_SERIO is not set | ||
| 81 | CONFIG_SERIAL_ATMEL=y | ||
| 82 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 83 | # CONFIG_LEGACY_PTYS is not set | ||
| 84 | # CONFIG_HW_RANDOM is not set | ||
| 85 | # CONFIG_HWMON is not set | ||
| 86 | CONFIG_WATCHDOG=y | ||
| 87 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 88 | CONFIG_FB=y | ||
| 89 | CONFIG_FB_MODE_HELPERS=y | ||
| 90 | CONFIG_FB_TILEBLITTING=y | ||
| 91 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 92 | # CONFIG_LCD_CLASS_DEVICE is not set | ||
| 93 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 94 | # CONFIG_BACKLIGHT_GENERIC is not set | ||
| 95 | # CONFIG_VGA_CONSOLE is not set | ||
| 96 | CONFIG_FRAMEBUFFER_CONSOLE=y | ||
| 97 | CONFIG_FONTS=y | ||
| 98 | CONFIG_FONT_MINI_4x6=y | ||
| 99 | # CONFIG_HID_SUPPORT is not set | ||
| 100 | CONFIG_USB=y | ||
| 101 | CONFIG_USB_DEVICEFS=y | ||
| 102 | CONFIG_USB_OHCI_HCD=y | ||
| 103 | CONFIG_USB_STORAGE=y | ||
| 104 | CONFIG_USB_LIBUSUAL=y | ||
| 105 | CONFIG_MMC=y | ||
| 106 | CONFIG_MMC_AT91=m | ||
| 107 | CONFIG_RTC_CLASS=y | ||
| 108 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 109 | CONFIG_EXT2_FS=y | ||
| 110 | CONFIG_EXT3_FS=y | ||
| 111 | # CONFIG_DNOTIFY is not set | ||
| 112 | CONFIG_INOTIFY=y | ||
| 113 | CONFIG_VFAT_FS=y | ||
| 114 | CONFIG_TMPFS=y | ||
| 115 | CONFIG_CONFIGFS_FS=y | ||
| 116 | CONFIG_JFFS2_FS=y | ||
| 117 | CONFIG_NFS_FS=y | ||
| 118 | CONFIG_NFS_V3=y | ||
| 119 | CONFIG_ROOT_NFS=y | ||
| 120 | CONFIG_NLS_CODEPAGE_437=y | ||
| 121 | CONFIG_NLS_UTF8=y | ||
| 122 | CONFIG_MAGIC_SYSRQ=y | ||
| 123 | CONFIG_DEBUG_FS=y | ||
| 124 | CONFIG_DEBUG_KERNEL=y | ||
| 125 | # CONFIG_SCHED_DEBUG is not set | ||
| 126 | # CONFIG_DEBUG_PREEMPT is not set | ||
| 127 | # CONFIG_RCU_CPU_STALL_DETECTOR is not set | ||
diff --git a/arch/arm/configs/onearm_defconfig b/arch/arm/configs/onearm_defconfig deleted file mode 100644 index 1579857aeeaa..000000000000 --- a/arch/arm/configs/onearm_defconfig +++ /dev/null | |||
| @@ -1,80 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | # CONFIG_SWAP is not set | ||
| 3 | CONFIG_SYSVIPC=y | ||
| 4 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 5 | CONFIG_BLK_DEV_INITRD=y | ||
| 6 | CONFIG_EMBEDDED=y | ||
| 7 | CONFIG_SLAB=y | ||
| 8 | CONFIG_MODULES=y | ||
| 9 | CONFIG_MODULE_UNLOAD=y | ||
| 10 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 11 | # CONFIG_IOSCHED_CFQ is not set | ||
| 12 | CONFIG_ARCH_AT91=y | ||
| 13 | CONFIG_MACH_ONEARM=y | ||
| 14 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 15 | # CONFIG_ARM_THUMB is not set | ||
| 16 | CONFIG_PCCARD=y | ||
| 17 | CONFIG_AT91_CF=y | ||
| 18 | CONFIG_LEDS=y | ||
| 19 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 20 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 21 | CONFIG_CMDLINE="console=ttyS0,115200 root=/dev/nfs ip=bootp mem=64M" | ||
| 22 | CONFIG_FPE_NWFPE=y | ||
| 23 | CONFIG_NET=y | ||
| 24 | CONFIG_PACKET=y | ||
| 25 | CONFIG_UNIX=y | ||
| 26 | CONFIG_INET=y | ||
| 27 | CONFIG_IP_PNP=y | ||
| 28 | CONFIG_IP_PNP_BOOTP=y | ||
| 29 | CONFIG_IPV6=y | ||
| 30 | # CONFIG_INET6_XFRM_MODE_TRANSPORT is not set | ||
| 31 | # CONFIG_INET6_XFRM_MODE_TUNNEL is not set | ||
| 32 | # CONFIG_INET6_XFRM_MODE_BEET is not set | ||
| 33 | # CONFIG_IPV6_SIT is not set | ||
| 34 | CONFIG_MTD=y | ||
| 35 | CONFIG_MTD_PARTITIONS=y | ||
| 36 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 37 | CONFIG_MTD_CHAR=y | ||
| 38 | CONFIG_MTD_BLOCK=y | ||
| 39 | CONFIG_MTD_CFI=y | ||
| 40 | CONFIG_MTD_JEDECPROBE=y | ||
| 41 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 42 | CONFIG_MTD_PHYSMAP=y | ||
| 43 | CONFIG_BLK_DEV_NBD=y | ||
| 44 | CONFIG_BLK_DEV_RAM=y | ||
| 45 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 46 | CONFIG_NETDEVICES=y | ||
| 47 | CONFIG_NET_ETHERNET=y | ||
| 48 | CONFIG_ARM_AT91_ETHER=y | ||
| 49 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 50 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 51 | # CONFIG_INPUT_MOUSE is not set | ||
| 52 | # CONFIG_SERIO is not set | ||
| 53 | # CONFIG_VT is not set | ||
| 54 | CONFIG_SERIAL_ATMEL=y | ||
| 55 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 56 | # CONFIG_HW_RANDOM is not set | ||
| 57 | CONFIG_I2C=y | ||
| 58 | CONFIG_I2C_CHARDEV=y | ||
| 59 | CONFIG_WATCHDOG=y | ||
| 60 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 61 | CONFIG_AT91RM9200_WATCHDOG=y | ||
| 62 | # CONFIG_USB_HID is not set | ||
| 63 | CONFIG_USB=y | ||
| 64 | CONFIG_USB_DEBUG=y | ||
| 65 | CONFIG_USB_DEVICEFS=y | ||
| 66 | CONFIG_USB_MON=y | ||
| 67 | CONFIG_USB_OHCI_HCD=y | ||
| 68 | CONFIG_USB_GADGET=y | ||
| 69 | CONFIG_MMC=y | ||
| 70 | CONFIG_EXT2_FS=y | ||
| 71 | CONFIG_INOTIFY=y | ||
| 72 | CONFIG_TMPFS=y | ||
| 73 | CONFIG_CRAMFS=y | ||
| 74 | CONFIG_NFS_FS=y | ||
| 75 | CONFIG_NFS_V3=y | ||
| 76 | CONFIG_NFS_V3_ACL=y | ||
| 77 | CONFIG_ROOT_NFS=y | ||
| 78 | CONFIG_DEBUG_KERNEL=y | ||
| 79 | CONFIG_DEBUG_USER=y | ||
| 80 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/configs/picotux200_defconfig b/arch/arm/configs/picotux200_defconfig deleted file mode 100644 index 4c9afa478d57..000000000000 --- a/arch/arm/configs/picotux200_defconfig +++ /dev/null | |||
| @@ -1,242 +0,0 @@ | |||
| 1 | CONFIG_EXPERIMENTAL=y | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_IKCONFIG=m | ||
| 4 | CONFIG_IKCONFIG_PROC=y | ||
| 5 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 6 | CONFIG_EMBEDDED=y | ||
| 7 | # CONFIG_KALLSYMS is not set | ||
| 8 | CONFIG_SLAB=y | ||
| 9 | CONFIG_MODULES=y | ||
| 10 | CONFIG_MODULE_UNLOAD=y | ||
| 11 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 12 | # CONFIG_IOSCHED_CFQ is not set | ||
| 13 | CONFIG_ARCH_AT91=y | ||
| 14 | CONFIG_MACH_PICOTUX2XX=y | ||
| 15 | CONFIG_AT91_PROGRAMMABLE_CLOCKS=y | ||
| 16 | CONFIG_AEABI=y | ||
| 17 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 18 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 19 | CONFIG_KEXEC=y | ||
| 20 | CONFIG_FPE_NWFPE=y | ||
| 21 | CONFIG_BINFMT_MISC=m | ||
| 22 | CONFIG_NET=y | ||
| 23 | CONFIG_PACKET=m | ||
| 24 | CONFIG_UNIX=y | ||
| 25 | CONFIG_XFRM_USER=m | ||
| 26 | CONFIG_INET=y | ||
| 27 | CONFIG_IP_PNP=y | ||
| 28 | CONFIG_IP_PNP_BOOTP=y | ||
| 29 | CONFIG_NET_IPIP=m | ||
| 30 | CONFIG_NET_IPGRE=m | ||
| 31 | CONFIG_INET_AH=m | ||
| 32 | CONFIG_INET_ESP=m | ||
| 33 | CONFIG_INET_IPCOMP=m | ||
| 34 | CONFIG_INET_XFRM_MODE_TRANSPORT=m | ||
| 35 | CONFIG_INET_XFRM_MODE_TUNNEL=m | ||
| 36 | CONFIG_INET_XFRM_MODE_BEET=m | ||
| 37 | CONFIG_INET_DIAG=m | ||
| 38 | CONFIG_IPV6_PRIVACY=y | ||
| 39 | CONFIG_IPV6_ROUTER_PREF=y | ||
| 40 | CONFIG_IPV6_ROUTE_INFO=y | ||
| 41 | CONFIG_INET6_AH=m | ||
| 42 | CONFIG_INET6_ESP=m | ||
| 43 | CONFIG_INET6_IPCOMP=m | ||
| 44 | CONFIG_IPV6_MIP6=m | ||
| 45 | CONFIG_INET6_XFRM_MODE_ROUTEOPTIMIZATION=m | ||
| 46 | CONFIG_IPV6_TUNNEL=m | ||
| 47 | CONFIG_BRIDGE=m | ||
| 48 | CONFIG_VLAN_8021Q=m | ||
| 49 | CONFIG_BT=m | ||
| 50 | CONFIG_BT_L2CAP=m | ||
| 51 | CONFIG_BT_SCO=m | ||
| 52 | CONFIG_BT_RFCOMM=m | ||
| 53 | CONFIG_BT_RFCOMM_TTY=y | ||
| 54 | CONFIG_BT_BNEP=m | ||
| 55 | CONFIG_BT_BNEP_MC_FILTER=y | ||
| 56 | CONFIG_BT_BNEP_PROTO_FILTER=y | ||
| 57 | CONFIG_BT_HIDP=m | ||
| 58 | CONFIG_FW_LOADER=m | ||
| 59 | CONFIG_MTD=y | ||
| 60 | CONFIG_MTD_PARTITIONS=y | ||
| 61 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 62 | CONFIG_MTD_CHAR=y | ||
| 63 | CONFIG_MTD_BLOCK=y | ||
| 64 | CONFIG_MTD_CFI=y | ||
| 65 | CONFIG_MTD_CFI_AMDSTD=y | ||
| 66 | CONFIG_MTD_PHYSMAP=y | ||
| 67 | CONFIG_BLK_DEV_LOOP=m | ||
| 68 | CONFIG_EEPROM_LEGACY=m | ||
| 69 | CONFIG_SCSI=m | ||
| 70 | CONFIG_BLK_DEV_SD=m | ||
| 71 | CONFIG_BLK_DEV_SR=m | ||
| 72 | CONFIG_BLK_DEV_SR_VENDOR=y | ||
| 73 | CONFIG_CHR_DEV_SG=m | ||
| 74 | CONFIG_NETDEVICES=y | ||
| 75 | CONFIG_TUN=m | ||
| 76 | CONFIG_NET_ETHERNET=y | ||
| 77 | CONFIG_ARM_AT91_ETHER=y | ||
| 78 | CONFIG_USB_CATC=m | ||
| 79 | CONFIG_USB_KAWETH=m | ||
| 80 | CONFIG_USB_PEGASUS=m | ||
| 81 | CONFIG_USB_RTL8150=m | ||
| 82 | CONFIG_USB_USBNET=m | ||
| 83 | CONFIG_USB_NET_DM9601=m | ||
| 84 | CONFIG_USB_NET_GL620A=m | ||
| 85 | CONFIG_USB_NET_PLUSB=m | ||
| 86 | CONFIG_USB_NET_MCS7830=m | ||
| 87 | CONFIG_USB_NET_RNDIS_HOST=m | ||
| 88 | CONFIG_USB_ALI_M5632=y | ||
| 89 | CONFIG_USB_AN2720=y | ||
| 90 | CONFIG_USB_EPSON2888=y | ||
| 91 | CONFIG_USB_KC2190=y | ||
| 92 | CONFIG_PPP=m | ||
| 93 | CONFIG_PPP_FILTER=y | ||
| 94 | CONFIG_PPP_ASYNC=m | ||
| 95 | CONFIG_PPP_DEFLATE=m | ||
| 96 | CONFIG_PPP_BSDCOMP=m | ||
| 97 | CONFIG_PPP_MPPE=m | ||
| 98 | CONFIG_PPPOE=m | ||
| 99 | CONFIG_SLIP=m | ||
| 100 | CONFIG_SLIP_COMPRESSED=y | ||
| 101 | CONFIG_SLIP_SMART=y | ||
| 102 | CONFIG_SLIP_MODE_SLIP6=y | ||
| 103 | # CONFIG_INPUT_MOUSEDEV is not set | ||
| 104 | # CONFIG_INPUT_KEYBOARD is not set | ||
| 105 | # CONFIG_INPUT_MOUSE is not set | ||
| 106 | # CONFIG_SERIO is not set | ||
| 107 | # CONFIG_VT is not set | ||
| 108 | CONFIG_SERIAL_ATMEL=y | ||
| 109 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 110 | # CONFIG_LEGACY_PTYS is not set | ||
| 111 | CONFIG_I2C=m | ||
| 112 | CONFIG_I2C_CHARDEV=m | ||
| 113 | CONFIG_I2C_GPIO=m | ||
| 114 | CONFIG_HWMON=m | ||
| 115 | CONFIG_SENSORS_ADM1021=m | ||
| 116 | CONFIG_SENSORS_ADM1025=m | ||
| 117 | CONFIG_SENSORS_ADM1026=m | ||
| 118 | CONFIG_SENSORS_ADM1029=m | ||
| 119 | CONFIG_SENSORS_ADM1031=m | ||
| 120 | CONFIG_SENSORS_ADM9240=m | ||
| 121 | CONFIG_SENSORS_DS1621=m | ||
| 122 | CONFIG_SENSORS_GL518SM=m | ||
| 123 | CONFIG_SENSORS_GL520SM=m | ||
| 124 | CONFIG_SENSORS_IT87=m | ||
| 125 | CONFIG_SENSORS_LM63=m | ||
| 126 | CONFIG_SENSORS_LM75=m | ||
| 127 | CONFIG_SENSORS_LM77=m | ||
| 128 | CONFIG_SENSORS_LM78=m | ||
| 129 | CONFIG_SENSORS_LM80=m | ||
| 130 | CONFIG_SENSORS_LM83=m | ||
| 131 | CONFIG_SENSORS_LM85=m | ||
| 132 | CONFIG_SENSORS_LM87=m | ||
| 133 | CONFIG_SENSORS_LM90=m | ||
| 134 | CONFIG_SENSORS_LM92=m | ||
| 135 | CONFIG_SENSORS_MAX1619=m | ||
| 136 | CONFIG_SENSORS_PCF8591=m | ||
| 137 | CONFIG_SENSORS_SMSC47B397=m | ||
| 138 | CONFIG_SENSORS_W83781D=m | ||
| 139 | CONFIG_SENSORS_W83791D=m | ||
| 140 | CONFIG_SENSORS_W83792D=m | ||
| 141 | CONFIG_SENSORS_W83793=m | ||
| 142 | CONFIG_SENSORS_W83L785TS=m | ||
| 143 | CONFIG_WATCHDOG=y | ||
| 144 | CONFIG_WATCHDOG_NOWAYOUT=y | ||
| 145 | CONFIG_AT91RM9200_WATCHDOG=m | ||
| 146 | CONFIG_HID=m | ||
| 147 | CONFIG_USB=m | ||
| 148 | CONFIG_USB_DEVICEFS=y | ||
| 149 | CONFIG_USB_OHCI_HCD=m | ||
| 150 | CONFIG_USB_ACM=m | ||
| 151 | CONFIG_USB_PRINTER=m | ||
| 152 | CONFIG_USB_STORAGE=m | ||
| 153 | CONFIG_USB_SERIAL=m | ||
| 154 | CONFIG_USB_SERIAL_GENERIC=y | ||
| 155 | CONFIG_USB_SERIAL_PL2303=m | ||
| 156 | CONFIG_MMC=m | ||
| 157 | CONFIG_MMC_AT91=m | ||
| 158 | CONFIG_RTC_CLASS=m | ||
| 159 | CONFIG_RTC_DRV_AT91RM9200=m | ||
| 160 | CONFIG_EXT2_FS=m | ||
| 161 | CONFIG_EXT3_FS=m | ||
| 162 | # CONFIG_EXT3_FS_XATTR is not set | ||
| 163 | CONFIG_INOTIFY=y | ||
| 164 | CONFIG_ISO9660_FS=m | ||
| 165 | CONFIG_JOLIET=y | ||
| 166 | CONFIG_UDF_FS=m | ||
| 167 | CONFIG_MSDOS_FS=m | ||
| 168 | CONFIG_VFAT_FS=m | ||
| 169 | CONFIG_NTFS_FS=m | ||
| 170 | CONFIG_TMPFS=y | ||
| 171 | CONFIG_JFFS2_FS=y | ||
| 172 | CONFIG_JFFS2_SUMMARY=y | ||
| 173 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 174 | CONFIG_NFS_FS=m | ||
| 175 | CONFIG_SMB_FS=m | ||
| 176 | CONFIG_CIFS=m | ||
| 177 | CONFIG_PARTITION_ADVANCED=y | ||
| 178 | CONFIG_AMIGA_PARTITION=y | ||
| 179 | CONFIG_NLS_DEFAULT="utf-8" | ||
| 180 | CONFIG_NLS_CODEPAGE_437=m | ||
| 181 | CONFIG_NLS_CODEPAGE_737=m | ||
| 182 | CONFIG_NLS_CODEPAGE_775=m | ||
| 183 | CONFIG_NLS_CODEPAGE_850=m | ||
| 184 | CONFIG_NLS_CODEPAGE_852=m | ||
| 185 | CONFIG_NLS_CODEPAGE_855=m | ||
| 186 | CONFIG_NLS_CODEPAGE_857=m | ||
| 187 | CONFIG_NLS_CODEPAGE_860=m | ||
| 188 | CONFIG_NLS_CODEPAGE_861=m | ||
| 189 | CONFIG_NLS_CODEPAGE_862=m | ||
| 190 | CONFIG_NLS_CODEPAGE_863=m | ||
| 191 | CONFIG_NLS_CODEPAGE_864=m | ||
| 192 | CONFIG_NLS_CODEPAGE_865=m | ||
| 193 | CONFIG_NLS_CODEPAGE_866=m | ||
| 194 | CONFIG_NLS_CODEPAGE_869=m | ||
| 195 | CONFIG_NLS_CODEPAGE_936=m | ||
| 196 | CONFIG_NLS_CODEPAGE_950=m | ||
| 197 | CONFIG_NLS_CODEPAGE_932=m | ||
| 198 | CONFIG_NLS_CODEPAGE_949=m | ||
| 199 | CONFIG_NLS_CODEPAGE_874=m | ||
| 200 | CONFIG_NLS_ISO8859_8=m | ||
| 201 | CONFIG_NLS_CODEPAGE_1250=m | ||
| 202 | CONFIG_NLS_CODEPAGE_1251=m | ||
| 203 | CONFIG_NLS_ASCII=m | ||
| 204 | CONFIG_NLS_ISO8859_1=m | ||
| 205 | CONFIG_NLS_ISO8859_2=m | ||
| 206 | CONFIG_NLS_ISO8859_3=m | ||
| 207 | CONFIG_NLS_ISO8859_4=m | ||
| 208 | CONFIG_NLS_ISO8859_5=m | ||
| 209 | CONFIG_NLS_ISO8859_6=m | ||
| 210 | CONFIG_NLS_ISO8859_7=m | ||
| 211 | CONFIG_NLS_ISO8859_9=m | ||
| 212 | CONFIG_NLS_ISO8859_13=m | ||
| 213 | CONFIG_NLS_ISO8859_14=m | ||
| 214 | CONFIG_NLS_ISO8859_15=m | ||
| 215 | CONFIG_NLS_KOI8_R=m | ||
| 216 | CONFIG_NLS_KOI8_U=m | ||
| 217 | CONFIG_NLS_UTF8=m | ||
| 218 | CONFIG_DEBUG_KERNEL=y | ||
| 219 | # CONFIG_DEBUG_BUGVERBOSE is not set | ||
| 220 | CONFIG_DEBUG_LL=y | ||
| 221 | CONFIG_CRYPTO_NULL=m | ||
| 222 | CONFIG_CRYPTO_TEST=m | ||
| 223 | CONFIG_CRYPTO_LRW=m | ||
| 224 | CONFIG_CRYPTO_PCBC=m | ||
| 225 | CONFIG_CRYPTO_XCBC=m | ||
| 226 | CONFIG_CRYPTO_MD4=m | ||
| 227 | CONFIG_CRYPTO_MICHAEL_MIC=m | ||
| 228 | CONFIG_CRYPTO_SHA256=m | ||
| 229 | CONFIG_CRYPTO_SHA512=m | ||
| 230 | CONFIG_CRYPTO_TGR192=m | ||
| 231 | CONFIG_CRYPTO_WP512=m | ||
| 232 | CONFIG_CRYPTO_ANUBIS=m | ||
| 233 | CONFIG_CRYPTO_BLOWFISH=m | ||
| 234 | CONFIG_CRYPTO_CAMELLIA=m | ||
| 235 | CONFIG_CRYPTO_CAST5=m | ||
| 236 | CONFIG_CRYPTO_CAST6=m | ||
| 237 | CONFIG_CRYPTO_FCRYPT=m | ||
| 238 | CONFIG_CRYPTO_KHAZAD=m | ||
| 239 | CONFIG_CRYPTO_SERPENT=m | ||
| 240 | CONFIG_CRYPTO_TEA=m | ||
| 241 | CONFIG_CRYPTO_TWOFISH=m | ||
| 242 | CONFIG_LIBCRC32C=m | ||
diff --git a/arch/arm/configs/yl9200_defconfig b/arch/arm/configs/yl9200_defconfig deleted file mode 100644 index 30c537f61089..000000000000 --- a/arch/arm/configs/yl9200_defconfig +++ /dev/null | |||
| @@ -1,137 +0,0 @@ | |||
| 1 | # CONFIG_SWAP is not set | ||
| 2 | CONFIG_SYSVIPC=y | ||
| 3 | CONFIG_LOG_BUF_SHIFT=14 | ||
| 4 | CONFIG_BLK_DEV_INITRD=y | ||
| 5 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
| 6 | CONFIG_MODULES=y | ||
| 7 | CONFIG_MODULE_UNLOAD=y | ||
| 8 | # CONFIG_IOSCHED_DEADLINE is not set | ||
| 9 | # CONFIG_IOSCHED_CFQ is not set | ||
| 10 | CONFIG_ARCH_AT91=y | ||
| 11 | CONFIG_ARCH_AT91RM9200DK=y | ||
| 12 | CONFIG_MACH_YL9200=y | ||
| 13 | # CONFIG_ARM_THUMB is not set | ||
| 14 | CONFIG_ZBOOT_ROM_TEXT=0x0 | ||
| 15 | CONFIG_ZBOOT_ROM_BSS=0x0 | ||
| 16 | CONFIG_CMDLINE="mem=32M console=ttyS0,115200 initrd=0x20410000,3145728 root=/dev/ram0 rw" | ||
| 17 | CONFIG_FPE_NWFPE=y | ||
| 18 | CONFIG_NET=y | ||
| 19 | CONFIG_PACKET=y | ||
| 20 | CONFIG_UNIX=y | ||
| 21 | CONFIG_INET=y | ||
| 22 | CONFIG_IP_PNP=y | ||
| 23 | CONFIG_IP_PNP_DHCP=y | ||
| 24 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | ||
| 25 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | ||
| 26 | # CONFIG_INET_XFRM_MODE_BEET is not set | ||
| 27 | # CONFIG_INET_LRO is not set | ||
| 28 | # CONFIG_INET_DIAG is not set | ||
| 29 | # CONFIG_IPV6 is not set | ||
| 30 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | ||
| 31 | CONFIG_MTD=y | ||
| 32 | CONFIG_MTD_CONCAT=y | ||
| 33 | CONFIG_MTD_PARTITIONS=y | ||
| 34 | CONFIG_MTD_CMDLINE_PARTS=y | ||
| 35 | CONFIG_MTD_CHAR=y | ||
| 36 | CONFIG_MTD_BLOCK=y | ||
| 37 | CONFIG_MTD_CFI=y | ||
| 38 | CONFIG_MTD_JEDECPROBE=y | ||
| 39 | CONFIG_MTD_CFI_INTELEXT=y | ||
| 40 | CONFIG_MTD_COMPLEX_MAPPINGS=y | ||
| 41 | CONFIG_MTD_PHYSMAP=y | ||
| 42 | CONFIG_MTD_PLATRAM=y | ||
| 43 | CONFIG_MTD_NAND=y | ||
| 44 | CONFIG_MTD_NAND_ATMEL=y | ||
| 45 | CONFIG_MTD_NAND_PLATFORM=y | ||
| 46 | CONFIG_BLK_DEV_LOOP=y | ||
| 47 | CONFIG_BLK_DEV_RAM=y | ||
| 48 | CONFIG_BLK_DEV_RAM_COUNT=3 | ||
| 49 | CONFIG_BLK_DEV_RAM_SIZE=8192 | ||
| 50 | # CONFIG_MISC_DEVICES is not set | ||
| 51 | CONFIG_BLK_DEV_SD=y | ||
| 52 | CONFIG_ATA=y | ||
| 53 | CONFIG_NETDEVICES=y | ||
| 54 | CONFIG_PHYLIB=y | ||
| 55 | CONFIG_DAVICOM_PHY=y | ||
| 56 | CONFIG_NET_ETHERNET=y | ||
| 57 | CONFIG_ARM_AT91_ETHER=y | ||
| 58 | # CONFIG_NETDEV_1000 is not set | ||
| 59 | # CONFIG_NETDEV_10000 is not set | ||
| 60 | # CONFIG_INPUT_MOUSEDEV_PSAUX is not set | ||
| 61 | CONFIG_INPUT_MOUSEDEV_SCREEN_X=640 | ||
| 62 | CONFIG_INPUT_MOUSEDEV_SCREEN_Y=480 | ||
| 63 | CONFIG_INPUT_EVDEV=y | ||
| 64 | # CONFIG_KEYBOARD_ATKBD is not set | ||
| 65 | CONFIG_KEYBOARD_GPIO=y | ||
| 66 | CONFIG_INPUT_TOUCHSCREEN=y | ||
| 67 | CONFIG_TOUCHSCREEN_ADS7846=y | ||
| 68 | # CONFIG_SERIO_SERPORT is not set | ||
| 69 | CONFIG_SERIAL_ATMEL=y | ||
| 70 | CONFIG_SERIAL_ATMEL_CONSOLE=y | ||
| 71 | # CONFIG_HW_RANDOM is not set | ||
| 72 | CONFIG_I2C=y | ||
| 73 | CONFIG_SPI=y | ||
| 74 | CONFIG_SPI_DEBUG=y | ||
| 75 | CONFIG_SPI_ATMEL=y | ||
| 76 | CONFIG_FB=y | ||
| 77 | CONFIG_BACKLIGHT_LCD_SUPPORT=y | ||
| 78 | CONFIG_LCD_CLASS_DEVICE=y | ||
| 79 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
| 80 | CONFIG_DISPLAY_SUPPORT=y | ||
| 81 | # CONFIG_VGA_CONSOLE is not set | ||
| 82 | CONFIG_LOGO=y | ||
| 83 | # CONFIG_LOGO_LINUX_MONO is not set | ||
| 84 | # CONFIG_LOGO_LINUX_VGA16 is not set | ||
| 85 | CONFIG_USB=y | ||
| 86 | CONFIG_USB_DEBUG=y | ||
| 87 | CONFIG_USB_DEVICEFS=y | ||
| 88 | # CONFIG_USB_DEVICE_CLASS is not set | ||
| 89 | CONFIG_USB_MON=y | ||
| 90 | CONFIG_USB_OHCI_HCD=y | ||
| 91 | CONFIG_USB_STORAGE=y | ||
| 92 | CONFIG_USB_GADGET=y | ||
| 93 | CONFIG_USB_GADGET_M66592=y | ||
| 94 | CONFIG_USB_FILE_STORAGE=m | ||
| 95 | CONFIG_MMC=y | ||
| 96 | CONFIG_MMC_DEBUG=y | ||
| 97 | # CONFIG_MMC_BLOCK_BOUNCE is not set | ||
| 98 | CONFIG_MMC_AT91=m | ||
| 99 | CONFIG_NEW_LEDS=y | ||
| 100 | CONFIG_LEDS_CLASS=y | ||
| 101 | CONFIG_LEDS_GPIO=y | ||
| 102 | CONFIG_LEDS_TRIGGERS=y | ||
| 103 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
| 104 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
| 105 | CONFIG_RTC_CLASS=y | ||
| 106 | CONFIG_RTC_DRV_AT91RM9200=y | ||
| 107 | CONFIG_EXT2_FS=y | ||
| 108 | CONFIG_EXT2_FS_XATTR=y | ||
| 109 | CONFIG_EXT3_FS=y | ||
| 110 | CONFIG_REISERFS_FS=y | ||
| 111 | CONFIG_INOTIFY=y | ||
| 112 | CONFIG_ISO9660_FS=y | ||
| 113 | CONFIG_JOLIET=y | ||
| 114 | CONFIG_ZISOFS=y | ||
| 115 | CONFIG_UDF_FS=y | ||
| 116 | CONFIG_MSDOS_FS=y | ||
| 117 | CONFIG_VFAT_FS=y | ||
| 118 | CONFIG_TMPFS=y | ||
| 119 | CONFIG_JFFS2_FS=y | ||
| 120 | CONFIG_JFFS2_FS_DEBUG=1 | ||
| 121 | CONFIG_JFFS2_COMPRESSION_OPTIONS=y | ||
| 122 | CONFIG_JFFS2_RUBIN=y | ||
| 123 | CONFIG_CRAMFS=y | ||
| 124 | CONFIG_PARTITION_ADVANCED=y | ||
| 125 | CONFIG_MAC_PARTITION=y | ||
| 126 | CONFIG_NLS_CODEPAGE_437=y | ||
| 127 | CONFIG_NLS_ISO8859_1=y | ||
| 128 | # CONFIG_ENABLE_MUST_CHECK is not set | ||
| 129 | CONFIG_DEBUG_FS=y | ||
| 130 | CONFIG_DEBUG_KERNEL=y | ||
| 131 | CONFIG_SLUB_DEBUG_ON=y | ||
| 132 | CONFIG_DEBUG_KOBJECT=y | ||
| 133 | CONFIG_DEBUG_INFO=y | ||
| 134 | CONFIG_DEBUG_LIST=y | ||
| 135 | CONFIG_DEBUG_USER=y | ||
| 136 | CONFIG_DEBUG_ERRORS=y | ||
| 137 | CONFIG_DEBUG_LL=y | ||
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index c09e3573c5de..bb96a7d4bbf5 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
| @@ -911,7 +911,7 @@ __kuser_cmpxchg: @ 0xffff0fc0 | |||
| 911 | * A special ghost syscall is used for that (see traps.c). | 911 | * A special ghost syscall is used for that (see traps.c). |
| 912 | */ | 912 | */ |
| 913 | stmfd sp!, {r7, lr} | 913 | stmfd sp!, {r7, lr} |
| 914 | ldr r7, =1f @ it's 20 bits | 914 | ldr r7, 1f @ it's 20 bits |
| 915 | swi __ARM_NR_cmpxchg | 915 | swi __ARM_NR_cmpxchg |
| 916 | ldmfd sp!, {r7, pc} | 916 | ldmfd sp!, {r7, pc} |
| 917 | 1: .word __ARM_NR_cmpxchg | 917 | 1: .word __ARM_NR_cmpxchg |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index dd6b369ac69c..6bd82d25683c 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
| @@ -85,9 +85,11 @@ ENTRY(stext) | |||
| 85 | mrc p15, 0, r9, c0, c0 @ get processor id | 85 | mrc p15, 0, r9, c0, c0 @ get processor id |
| 86 | bl __lookup_processor_type @ r5=procinfo r9=cpuid | 86 | bl __lookup_processor_type @ r5=procinfo r9=cpuid |
| 87 | movs r10, r5 @ invalid processor (r5=0)? | 87 | movs r10, r5 @ invalid processor (r5=0)? |
| 88 | THUMB( it eq ) @ force fixup-able long branch encoding | ||
| 88 | beq __error_p @ yes, error 'p' | 89 | beq __error_p @ yes, error 'p' |
| 89 | bl __lookup_machine_type @ r5=machinfo | 90 | bl __lookup_machine_type @ r5=machinfo |
| 90 | movs r8, r5 @ invalid machine (r5=0)? | 91 | movs r8, r5 @ invalid machine (r5=0)? |
| 92 | THUMB( it eq ) @ force fixup-able long branch encoding | ||
| 91 | beq __error_a @ yes, error 'a' | 93 | beq __error_a @ yes, error 'a' |
| 92 | bl __vet_atags | 94 | bl __vet_atags |
| 93 | #ifdef CONFIG_SMP_ON_UP | 95 | #ifdef CONFIG_SMP_ON_UP |
| @@ -262,6 +264,7 @@ __create_page_tables: | |||
| 262 | mov pc, lr | 264 | mov pc, lr |
| 263 | ENDPROC(__create_page_tables) | 265 | ENDPROC(__create_page_tables) |
| 264 | .ltorg | 266 | .ltorg |
| 267 | .align | ||
| 265 | __enable_mmu_loc: | 268 | __enable_mmu_loc: |
| 266 | .long . | 269 | .long . |
| 267 | .long __enable_mmu | 270 | .long __enable_mmu |
| @@ -282,6 +285,7 @@ ENTRY(secondary_startup) | |||
| 282 | bl __lookup_processor_type | 285 | bl __lookup_processor_type |
| 283 | movs r10, r5 @ invalid processor? | 286 | movs r10, r5 @ invalid processor? |
| 284 | moveq r0, #'p' @ yes, error 'p' | 287 | moveq r0, #'p' @ yes, error 'p' |
| 288 | THUMB( it eq ) @ force fixup-able long branch encoding | ||
| 285 | beq __error_p | 289 | beq __error_p |
| 286 | 290 | ||
| 287 | /* | 291 | /* |
| @@ -308,6 +312,8 @@ ENTRY(__secondary_switched) | |||
| 308 | b secondary_start_kernel | 312 | b secondary_start_kernel |
| 309 | ENDPROC(__secondary_switched) | 313 | ENDPROC(__secondary_switched) |
| 310 | 314 | ||
| 315 | .align | ||
| 316 | |||
| 311 | .type __secondary_data, %object | 317 | .type __secondary_data, %object |
| 312 | __secondary_data: | 318 | __secondary_data: |
| 313 | .long . | 319 | .long . |
| @@ -413,6 +419,7 @@ __fixup_smp_on_up: | |||
| 413 | mov pc, lr | 419 | mov pc, lr |
| 414 | ENDPROC(__fixup_smp) | 420 | ENDPROC(__fixup_smp) |
| 415 | 421 | ||
| 422 | .align | ||
| 416 | 1: .word . | 423 | 1: .word . |
| 417 | .word __smpalt_begin | 424 | .word __smpalt_begin |
| 418 | .word __smpalt_end | 425 | .word __smpalt_end |
diff --git a/arch/arm/kernel/relocate_kernel.S b/arch/arm/kernel/relocate_kernel.S index fd26f8d65151..9cf4cbf8f95b 100644 --- a/arch/arm/kernel/relocate_kernel.S +++ b/arch/arm/kernel/relocate_kernel.S | |||
| @@ -59,6 +59,8 @@ relocate_new_kernel: | |||
| 59 | ldr r2,kexec_boot_atags | 59 | ldr r2,kexec_boot_atags |
| 60 | mov pc,lr | 60 | mov pc,lr |
| 61 | 61 | ||
| 62 | .align | ||
| 63 | |||
| 62 | .globl kexec_start_address | 64 | .globl kexec_start_address |
| 63 | kexec_start_address: | 65 | kexec_start_address: |
| 64 | .long 0x0 | 66 | .long 0x0 |
diff --git a/arch/arm/mach-at91/Makefile b/arch/arm/mach-at91/Makefile index 821eb842795f..62d686f0b426 100644 --- a/arch/arm/mach-at91/Makefile +++ b/arch/arm/mach-at91/Makefile | |||
| @@ -24,8 +24,8 @@ obj-$(CONFIG_ARCH_AT91X40) += at91x40.o at91x40_time.o | |||
| 24 | 24 | ||
| 25 | # AT91RM9200 board-specific support | 25 | # AT91RM9200 board-specific support |
| 26 | obj-$(CONFIG_MACH_ONEARM) += board-1arm.o | 26 | obj-$(CONFIG_MACH_ONEARM) += board-1arm.o |
| 27 | obj-$(CONFIG_ARCH_AT91RM9200DK) += board-dk.o | 27 | obj-$(CONFIG_ARCH_AT91RM9200DK) += board-rm9200dk.o |
| 28 | obj-$(CONFIG_MACH_AT91RM9200EK) += board-ek.o | 28 | obj-$(CONFIG_MACH_AT91RM9200EK) += board-rm9200ek.o |
| 29 | obj-$(CONFIG_MACH_CSB337) += board-csb337.o | 29 | obj-$(CONFIG_MACH_CSB337) += board-csb337.o |
| 30 | obj-$(CONFIG_MACH_CSB637) += board-csb637.o | 30 | obj-$(CONFIG_MACH_CSB637) += board-csb637.o |
| 31 | obj-$(CONFIG_MACH_CARMEVA) += board-carmeva.o | 31 | obj-$(CONFIG_MACH_CARMEVA) += board-carmeva.o |
diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c index 9338825cfcd7..7b539228e0ef 100644 --- a/arch/arm/mach-at91/at91rm9200_devices.c +++ b/arch/arm/mach-at91/at91rm9200_devices.c | |||
| @@ -1106,51 +1106,6 @@ static inline void configure_usart3_pins(unsigned pins) | |||
| 1106 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ | 1106 | static struct platform_device *__initdata at91_uarts[ATMEL_MAX_UART]; /* the UARTs to use */ |
| 1107 | struct platform_device *atmel_default_console_device; /* the serial console device */ | 1107 | struct platform_device *atmel_default_console_device; /* the serial console device */ |
| 1108 | 1108 | ||
| 1109 | void __init __deprecated at91_init_serial(struct at91_uart_config *config) | ||
| 1110 | { | ||
| 1111 | int i; | ||
| 1112 | |||
| 1113 | /* Fill in list of supported UARTs */ | ||
| 1114 | for (i = 0; i < config->nr_tty; i++) { | ||
| 1115 | switch (config->tty_map[i]) { | ||
| 1116 | case 0: | ||
| 1117 | configure_usart0_pins(ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 1118 | at91_uarts[i] = &at91rm9200_uart0_device; | ||
| 1119 | at91_clock_associate("usart0_clk", &at91rm9200_uart0_device.dev, "usart"); | ||
| 1120 | break; | ||
| 1121 | case 1: | ||
| 1122 | configure_usart1_pins(ATMEL_UART_CTS | ATMEL_UART_RTS | ATMEL_UART_DSR | ATMEL_UART_DTR | ATMEL_UART_DCD | ATMEL_UART_RI); | ||
| 1123 | at91_uarts[i] = &at91rm9200_uart1_device; | ||
| 1124 | at91_clock_associate("usart1_clk", &at91rm9200_uart1_device.dev, "usart"); | ||
| 1125 | break; | ||
| 1126 | case 2: | ||
| 1127 | configure_usart2_pins(0); | ||
| 1128 | at91_uarts[i] = &at91rm9200_uart2_device; | ||
| 1129 | at91_clock_associate("usart2_clk", &at91rm9200_uart2_device.dev, "usart"); | ||
| 1130 | break; | ||
| 1131 | case 3: | ||
| 1132 | configure_usart3_pins(0); | ||
| 1133 | at91_uarts[i] = &at91rm9200_uart3_device; | ||
| 1134 | at91_clock_associate("usart3_clk", &at91rm9200_uart3_device.dev, "usart"); | ||
| 1135 | break; | ||
| 1136 | case 4: | ||
| 1137 | configure_dbgu_pins(); | ||
| 1138 | at91_uarts[i] = &at91rm9200_dbgu_device; | ||
| 1139 | at91_clock_associate("mck", &at91rm9200_dbgu_device.dev, "usart"); | ||
| 1140 | break; | ||
| 1141 | default: | ||
| 1142 | continue; | ||
| 1143 | } | ||
| 1144 | at91_uarts[i]->id = i; /* update ID number to mapped ID */ | ||
| 1145 | } | ||
| 1146 | |||
| 1147 | /* Set serial console device */ | ||
| 1148 | if (config->console_tty < ATMEL_MAX_UART) | ||
| 1149 | atmel_default_console_device = at91_uarts[config->console_tty]; | ||
| 1150 | if (!atmel_default_console_device) | ||
| 1151 | printk(KERN_INFO "AT91: No default serial console defined.\n"); | ||
| 1152 | } | ||
| 1153 | |||
| 1154 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) | 1109 | void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins) |
| 1155 | { | 1110 | { |
| 1156 | struct platform_device *pdev; | 1111 | struct platform_device *pdev; |
diff --git a/arch/arm/mach-at91/board-1arm.c b/arch/arm/mach-at91/board-1arm.c index 46bdc82d3fbf..8a3fc84847c1 100644 --- a/arch/arm/mach-at91/board-1arm.c +++ b/arch/arm/mach-at91/board-1arm.c | |||
| @@ -39,24 +39,24 @@ | |||
| 39 | #include "generic.h" | 39 | #include "generic.h" |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | /* | ||
| 43 | * Serial port configuration. | ||
| 44 | * 0 .. 3 = USART0 .. USART3 | ||
| 45 | * 4 = DBGU | ||
| 46 | */ | ||
| 47 | static struct at91_uart_config __initdata onearm_uart_config = { | ||
| 48 | .console_tty = 0, /* ttyS0 */ | ||
| 49 | .nr_tty = 3, | ||
| 50 | .tty_map = { 4, 0, 1, -1, -1 }, /* ttyS0, ..., ttyS4 */ | ||
| 51 | }; | ||
| 52 | |||
| 53 | static void __init onearm_map_io(void) | 42 | static void __init onearm_map_io(void) |
| 54 | { | 43 | { |
| 55 | /* Initialize processor: 18.432 MHz crystal */ | 44 | /* Initialize processor: 18.432 MHz crystal */ |
| 56 | at91rm9200_initialize(18432000, AT91RM9200_PQFP); | 45 | at91rm9200_initialize(18432000, AT91RM9200_PQFP); |
| 57 | 46 | ||
| 58 | /* Setup the serial ports and console */ | 47 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 59 | at91_init_serial(&onearm_uart_config); | 48 | at91_register_uart(0, 0, 0); |
| 49 | |||
| 50 | /* USART0 on ttyS1 (Rx, Tx, CTS, RTS) */ | ||
| 51 | at91_register_uart(AT91RM9200_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 52 | |||
| 53 | /* USART1 on ttyS2 (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
| 54 | at91_register_uart(AT91RM9200_ID_US1, 2, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
| 55 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
| 56 | | ATMEL_UART_RI); | ||
| 57 | |||
| 58 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 59 | at91_set_serial_console(0); | ||
| 60 | } | 60 | } |
| 61 | 61 | ||
| 62 | static void __init onearm_init_irq(void) | 62 | static void __init onearm_init_irq(void) |
diff --git a/arch/arm/mach-at91/board-kafa.c b/arch/arm/mach-at91/board-kafa.c index c0ce79d431a0..d2e1f4ec1fcc 100644 --- a/arch/arm/mach-at91/board-kafa.c +++ b/arch/arm/mach-at91/board-kafa.c | |||
| @@ -39,17 +39,6 @@ | |||
| 39 | #include "generic.h" | 39 | #include "generic.h" |
| 40 | 40 | ||
| 41 | 41 | ||
| 42 | /* | ||
| 43 | * Serial port configuration. | ||
| 44 | * 0 .. 3 = USART0 .. USART3 | ||
| 45 | * 4 = DBGU | ||
| 46 | */ | ||
| 47 | static struct at91_uart_config __initdata kafa_uart_config = { | ||
| 48 | .console_tty = 0, /* ttyS0 */ | ||
| 49 | .nr_tty = 2, | ||
| 50 | .tty_map = { 4, 0, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ | ||
| 51 | }; | ||
| 52 | |||
| 53 | static void __init kafa_map_io(void) | 42 | static void __init kafa_map_io(void) |
| 54 | { | 43 | { |
| 55 | /* Initialize processor: 18.432 MHz crystal */ | 44 | /* Initialize processor: 18.432 MHz crystal */ |
| @@ -58,8 +47,14 @@ static void __init kafa_map_io(void) | |||
| 58 | /* Set up the LEDs */ | 47 | /* Set up the LEDs */ |
| 59 | at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); | 48 | at91_init_leds(AT91_PIN_PB4, AT91_PIN_PB4); |
| 60 | 49 | ||
| 61 | /* Setup the serial ports and console */ | 50 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 62 | at91_init_serial(&kafa_uart_config); | 51 | at91_register_uart(0, 0, 0); |
| 52 | |||
| 53 | /* USART0 on ttyS1 (Rx, Tx, CTS, RTS) */ | ||
| 54 | at91_register_uart(AT91RM9200_ID_US0, 1, ATMEL_UART_CTS | ATMEL_UART_RTS); | ||
| 55 | |||
| 56 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 57 | at91_set_serial_console(0); | ||
| 63 | } | 58 | } |
| 64 | 59 | ||
| 65 | static void __init kafa_init_irq(void) | 60 | static void __init kafa_init_irq(void) |
diff --git a/arch/arm/mach-at91/board-picotux200.c b/arch/arm/mach-at91/board-picotux200.c index 9d833bbc592d..55dad3a46547 100644 --- a/arch/arm/mach-at91/board-picotux200.c +++ b/arch/arm/mach-at91/board-picotux200.c | |||
| @@ -43,24 +43,21 @@ | |||
| 43 | #include "generic.h" | 43 | #include "generic.h" |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | /* | ||
| 47 | * Serial port configuration. | ||
| 48 | * 0 .. 3 = USART0 .. USART3 | ||
| 49 | * 4 = DBGU | ||
| 50 | */ | ||
| 51 | static struct at91_uart_config __initdata picotux200_uart_config = { | ||
| 52 | .console_tty = 0, /* ttyS0 */ | ||
| 53 | .nr_tty = 2, | ||
| 54 | .tty_map = { 4, 1, -1, -1, -1 } /* ttyS0, ..., ttyS4 */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | static void __init picotux200_map_io(void) | 46 | static void __init picotux200_map_io(void) |
| 58 | { | 47 | { |
| 59 | /* Initialize processor: 18.432 MHz crystal */ | 48 | /* Initialize processor: 18.432 MHz crystal */ |
| 60 | at91rm9200_initialize(18432000, AT91RM9200_BGA); | 49 | at91rm9200_initialize(18432000, AT91RM9200_BGA); |
| 61 | 50 | ||
| 62 | /* Setup the serial ports and console */ | 51 | /* DBGU on ttyS0. (Rx & Tx only) */ |
| 63 | at91_init_serial(&picotux200_uart_config); | 52 | at91_register_uart(0, 0, 0); |
| 53 | |||
| 54 | /* USART1 on ttyS1. (Rx, Tx, CTS, RTS, DTR, DSR, DCD, RI) */ | ||
| 55 | at91_register_uart(AT91RM9200_ID_US1, 1, ATMEL_UART_CTS | ATMEL_UART_RTS | ||
| 56 | | ATMEL_UART_DTR | ATMEL_UART_DSR | ATMEL_UART_DCD | ||
| 57 | | ATMEL_UART_RI); | ||
| 58 | |||
| 59 | /* set serial console to ttyS0 (ie, DBGU) */ | ||
| 60 | at91_set_serial_console(0); | ||
| 64 | } | 61 | } |
| 65 | 62 | ||
| 66 | static void __init picotux200_init_irq(void) | 63 | static void __init picotux200_init_irq(void) |
| @@ -77,11 +74,6 @@ static struct at91_usbh_data __initdata picotux200_usbh_data = { | |||
| 77 | .ports = 1, | 74 | .ports = 1, |
| 78 | }; | 75 | }; |
| 79 | 76 | ||
| 80 | // static struct at91_udc_data __initdata picotux200_udc_data = { | ||
| 81 | // .vbus_pin = AT91_PIN_PD4, | ||
| 82 | // .pullup_pin = AT91_PIN_PD5, | ||
| 83 | // }; | ||
| 84 | |||
| 85 | static struct at91_mmc_data __initdata picotux200_mmc_data = { | 77 | static struct at91_mmc_data __initdata picotux200_mmc_data = { |
| 86 | .det_pin = AT91_PIN_PB27, | 78 | .det_pin = AT91_PIN_PB27, |
| 87 | .slot_b = 0, | 79 | .slot_b = 0, |
| @@ -89,21 +81,6 @@ static struct at91_mmc_data __initdata picotux200_mmc_data = { | |||
| 89 | .wp_pin = AT91_PIN_PA17, | 81 | .wp_pin = AT91_PIN_PA17, |
| 90 | }; | 82 | }; |
| 91 | 83 | ||
| 92 | // static struct spi_board_info picotux200_spi_devices[] = { | ||
| 93 | // { /* DataFlash chip */ | ||
| 94 | // .modalias = "mtd_dataflash", | ||
| 95 | // .chip_select = 0, | ||
| 96 | // .max_speed_hz = 15 * 1000 * 1000, | ||
| 97 | // }, | ||
| 98 | // #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 99 | // { /* DataFlash card */ | ||
| 100 | // .modalias = "mtd_dataflash", | ||
| 101 | // .chip_select = 3, | ||
| 102 | // .max_speed_hz = 15 * 1000 * 1000, | ||
| 103 | // }, | ||
| 104 | // #endif | ||
| 105 | // }; | ||
| 106 | |||
| 107 | #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 | 84 | #define PICOTUX200_FLASH_BASE AT91_CHIPSELECT_0 |
| 108 | #define PICOTUX200_FLASH_SIZE SZ_4M | 85 | #define PICOTUX200_FLASH_SIZE SZ_4M |
| 109 | 86 | ||
| @@ -135,21 +112,11 @@ static void __init picotux200_board_init(void) | |||
| 135 | at91_add_device_eth(&picotux200_eth_data); | 112 | at91_add_device_eth(&picotux200_eth_data); |
| 136 | /* USB Host */ | 113 | /* USB Host */ |
| 137 | at91_add_device_usbh(&picotux200_usbh_data); | 114 | at91_add_device_usbh(&picotux200_usbh_data); |
| 138 | /* USB Device */ | ||
| 139 | // at91_add_device_udc(&picotux200_udc_data); | ||
| 140 | // at91_set_multi_drive(picotux200_udc_data.pullup_pin, 1); /* pullup_pin is connected to reset */ | ||
| 141 | /* I2C */ | 115 | /* I2C */ |
| 142 | at91_add_device_i2c(NULL, 0); | 116 | at91_add_device_i2c(NULL, 0); |
| 143 | /* SPI */ | ||
| 144 | // at91_add_device_spi(picotux200_spi_devices, ARRAY_SIZE(picotux200_spi_devices)); | ||
| 145 | #ifdef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 146 | /* DataFlash card */ | ||
| 147 | at91_set_gpio_output(AT91_PIN_PB22, 0); | ||
| 148 | #else | ||
| 149 | /* MMC */ | 117 | /* MMC */ |
| 150 | at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ | 118 | at91_set_gpio_output(AT91_PIN_PB22, 1); /* this MMC card slot can optionally use SPI signaling (CS3). */ |
| 151 | at91_add_device_mmc(0, &picotux200_mmc_data); | 119 | at91_add_device_mmc(0, &picotux200_mmc_data); |
| 152 | #endif | ||
| 153 | /* NOR Flash */ | 120 | /* NOR Flash */ |
| 154 | platform_device_register(&picotux200_flash); | 121 | platform_device_register(&picotux200_flash); |
| 155 | } | 122 | } |
diff --git a/arch/arm/mach-at91/board-dk.c b/arch/arm/mach-at91/board-rm9200dk.c index e14f0e165680..4c1047c8200d 100644 --- a/arch/arm/mach-at91/board-dk.c +++ b/arch/arm/mach-at91/board-rm9200dk.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-at91/board-dk.c | 2 | * linux/arch/arm/mach-at91/board-rm9200dk.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005 SAN People | 4 | * Copyright (C) 2005 SAN People |
| 5 | * | 5 | * |
| @@ -91,10 +91,12 @@ static struct at91_cf_data __initdata dk_cf_data = { | |||
| 91 | // .vcc_pin = ... always powered | 91 | // .vcc_pin = ... always powered |
| 92 | }; | 92 | }; |
| 93 | 93 | ||
| 94 | #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 94 | static struct at91_mmc_data __initdata dk_mmc_data = { | 95 | static struct at91_mmc_data __initdata dk_mmc_data = { |
| 95 | .slot_b = 0, | 96 | .slot_b = 0, |
| 96 | .wire4 = 1, | 97 | .wire4 = 1, |
| 97 | }; | 98 | }; |
| 99 | #endif | ||
| 98 | 100 | ||
| 99 | static struct spi_board_info dk_spi_devices[] = { | 101 | static struct spi_board_info dk_spi_devices[] = { |
| 100 | { /* DataFlash chip */ | 102 | { /* DataFlash chip */ |
diff --git a/arch/arm/mach-at91/board-ek.c b/arch/arm/mach-at91/board-rm9200ek.c index 56e92c4bbc2a..9df1be8818c0 100644 --- a/arch/arm/mach-at91/board-ek.c +++ b/arch/arm/mach-at91/board-rm9200ek.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/arch/arm/mach-at91/board-ek.c | 2 | * linux/arch/arm/mach-at91/board-rm9200ek.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2005 SAN People | 4 | * Copyright (C) 2005 SAN People |
| 5 | * | 5 | * |
| @@ -84,12 +84,14 @@ static struct at91_udc_data __initdata ek_udc_data = { | |||
| 84 | .pullup_pin = AT91_PIN_PD5, | 84 | .pullup_pin = AT91_PIN_PD5, |
| 85 | }; | 85 | }; |
| 86 | 86 | ||
| 87 | #ifndef CONFIG_MTD_AT91_DATAFLASH_CARD | ||
| 87 | static struct at91_mmc_data __initdata ek_mmc_data = { | 88 | static struct at91_mmc_data __initdata ek_mmc_data = { |
| 88 | .det_pin = AT91_PIN_PB27, | 89 | .det_pin = AT91_PIN_PB27, |
| 89 | .slot_b = 0, | 90 | .slot_b = 0, |
| 90 | .wire4 = 1, | 91 | .wire4 = 1, |
| 91 | .wp_pin = AT91_PIN_PA17, | 92 | .wp_pin = AT91_PIN_PA17, |
| 92 | }; | 93 | }; |
| 94 | #endif | ||
| 93 | 95 | ||
| 94 | static struct spi_board_info ek_spi_devices[] = { | 96 | static struct spi_board_info ek_spi_devices[] = { |
| 95 | { /* DataFlash chip */ | 97 | { /* DataFlash chip */ |
diff --git a/arch/arm/mach-at91/board-yl-9200.c b/arch/arm/mach-at91/board-yl-9200.c index 89df00a9d2f7..e0f0080eb639 100644 --- a/arch/arm/mach-at91/board-yl-9200.c +++ b/arch/arm/mach-at91/board-yl-9200.c | |||
| @@ -387,7 +387,7 @@ static struct spi_board_info yl9200_spi_devices[] = { | |||
| 387 | * EPSON S1D13806 FB (discontinued chip) | 387 | * EPSON S1D13806 FB (discontinued chip) |
| 388 | * EPSON S1D13506 FB | 388 | * EPSON S1D13506 FB |
| 389 | */ | 389 | */ |
| 390 | #if defined(CONFIG_FB_S1D135XX) || defined(CONFIG_FB_S1D13XXX_MODULE) | 390 | #if defined(CONFIG_FB_S1D13XXX) || defined(CONFIG_FB_S1D13XXX_MODULE) |
| 391 | #include <video/s1d13xxxfb.h> | 391 | #include <video/s1d13xxxfb.h> |
| 392 | 392 | ||
| 393 | 393 | ||
diff --git a/arch/arm/mach-at91/include/mach/board.h b/arch/arm/mach-at91/include/mach/board.h index 58528aa9c8a8..2b499eb343a1 100644 --- a/arch/arm/mach-at91/include/mach/board.h +++ b/arch/arm/mach-at91/include/mach/board.h | |||
| @@ -137,13 +137,7 @@ extern void __init at91_add_device_spi(struct spi_board_info *devices, int nr_de | |||
| 137 | extern void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins); | 137 | extern void __init at91_register_uart(unsigned id, unsigned portnr, unsigned pins); |
| 138 | extern void __init at91_set_serial_console(unsigned portnr); | 138 | extern void __init at91_set_serial_console(unsigned portnr); |
| 139 | 139 | ||
| 140 | struct at91_uart_config { | ||
| 141 | unsigned short console_tty; /* tty number of serial console */ | ||
| 142 | unsigned short nr_tty; /* number of serial tty's */ | ||
| 143 | short tty_map[]; /* map UART to tty number */ | ||
| 144 | }; | ||
| 145 | extern struct platform_device *atmel_default_console_device; | 140 | extern struct platform_device *atmel_default_console_device; |
| 146 | extern void __init __deprecated at91_init_serial(struct at91_uart_config *config); | ||
| 147 | 141 | ||
| 148 | struct atmel_uart_data { | 142 | struct atmel_uart_data { |
| 149 | short use_dma_tx; /* use transmit DMA? */ | 143 | short use_dma_tx; /* use transmit DMA? */ |
diff --git a/arch/arm/mach-cns3xxx/pcie.c b/arch/arm/mach-cns3xxx/pcie.c index 38088c36936c..78defd71a829 100644 --- a/arch/arm/mach-cns3xxx/pcie.c +++ b/arch/arm/mach-cns3xxx/pcie.c | |||
| @@ -369,7 +369,7 @@ static int __init cns3xxx_pcie_init(void) | |||
| 369 | { | 369 | { |
| 370 | int i; | 370 | int i; |
| 371 | 371 | ||
| 372 | hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, | 372 | hook_fault_code(16 + 6, cns3xxx_pcie_abort_handler, SIGBUS, 0, |
| 373 | "imprecise external abort"); | 373 | "imprecise external abort"); |
| 374 | 374 | ||
| 375 | for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) { | 375 | for (i = 0; i < ARRAY_SIZE(cns3xxx_pcie); i++) { |
diff --git a/arch/arm/mach-realview/headsmp.S b/arch/arm/mach-realview/headsmp.S index 4075473cf68a..b34be4554d40 100644 --- a/arch/arm/mach-realview/headsmp.S +++ b/arch/arm/mach-realview/headsmp.S | |||
| @@ -35,5 +35,6 @@ pen: ldr r7, [r6] | |||
| 35 | */ | 35 | */ |
| 36 | b secondary_startup | 36 | b secondary_startup |
| 37 | 37 | ||
| 38 | .align | ||
| 38 | 1: .long . | 39 | 1: .long . |
| 39 | .long pen_release | 40 | .long pen_release |
diff --git a/arch/arm/mach-s3c2412/Kconfig b/arch/arm/mach-s3c2412/Kconfig index cef6a65637bd..fa2e5bffbb8e 100644 --- a/arch/arm/mach-s3c2412/Kconfig +++ b/arch/arm/mach-s3c2412/Kconfig | |||
| @@ -16,7 +16,7 @@ config CPU_S3C2412 | |||
| 16 | config CPU_S3C2412_ONLY | 16 | config CPU_S3C2412_ONLY |
| 17 | bool | 17 | bool |
| 18 | depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \ | 18 | depends on ARCH_S3C2410 && !CPU_S3C2400 && !CPU_S3C2410 && \ |
| 19 | !CPU_2416 && !CPU_S3C2440 && !CPU_S3C2442 && \ | 19 | !CPU_S3C2416 && !CPU_S3C2440 && !CPU_S3C2442 && \ |
| 20 | !CPU_S3C2443 && CPU_S3C2412 | 20 | !CPU_S3C2443 && CPU_S3C2412 |
| 21 | default y if CPU_S3C2412 | 21 | default y if CPU_S3C2412 |
| 22 | 22 | ||
diff --git a/arch/arm/mach-s3c2416/Kconfig b/arch/arm/mach-s3c2416/Kconfig index 87b9c9f003bd..27b3e7c9d613 100644 --- a/arch/arm/mach-s3c2416/Kconfig +++ b/arch/arm/mach-s3c2416/Kconfig | |||
| @@ -35,9 +35,12 @@ menu "S3C2416 Machines" | |||
| 35 | config MACH_SMDK2416 | 35 | config MACH_SMDK2416 |
| 36 | bool "SMDK2416" | 36 | bool "SMDK2416" |
| 37 | select CPU_S3C2416 | 37 | select CPU_S3C2416 |
| 38 | select MACH_SMDK | ||
| 38 | select S3C_DEV_FB | 39 | select S3C_DEV_FB |
| 39 | select S3C_DEV_HSMMC | 40 | select S3C_DEV_HSMMC |
| 40 | select S3C_DEV_HSMMC1 | 41 | select S3C_DEV_HSMMC1 |
| 42 | select S3C_DEV_NAND | ||
| 43 | select S3C_DEV_USB_HOST | ||
| 41 | select S3C2416_PM if PM | 44 | select S3C2416_PM if PM |
| 42 | help | 45 | help |
| 43 | Say Y here if you are using an SMDK2416 | 46 | Say Y here if you are using an SMDK2416 |
diff --git a/arch/arm/mach-s3c2440/Kconfig b/arch/arm/mach-s3c2440/Kconfig index ff024a6c0f85..a0cb2581894f 100644 --- a/arch/arm/mach-s3c2440/Kconfig +++ b/arch/arm/mach-s3c2440/Kconfig | |||
| @@ -18,6 +18,7 @@ config CPU_S3C2440 | |||
| 18 | config CPU_S3C2442 | 18 | config CPU_S3C2442 |
| 19 | bool | 19 | bool |
| 20 | select CPU_ARM920T | 20 | select CPU_ARM920T |
| 21 | select S3C_GPIO_PULL_DOWN | ||
| 21 | select S3C2410_CLOCK | 22 | select S3C2410_CLOCK |
| 22 | select S3C2410_GPIO | 23 | select S3C2410_GPIO |
| 23 | select S3C2410_PM if PM | 24 | select S3C2410_PM if PM |
| @@ -178,6 +179,9 @@ config MACH_MINI2440 | |||
| 178 | bool "MINI2440 development board" | 179 | bool "MINI2440 development board" |
| 179 | select CPU_S3C2440 | 180 | select CPU_S3C2440 |
| 180 | select EEPROM_AT24 | 181 | select EEPROM_AT24 |
| 182 | select NEW_LEDS | ||
| 183 | select LEDS_CLASS | ||
| 184 | select LEDS_TRIGGER | ||
| 181 | select LEDS_TRIGGER_BACKLIGHT | 185 | select LEDS_TRIGGER_BACKLIGHT |
| 182 | select S3C_DEV_NAND | 186 | select S3C_DEV_NAND |
| 183 | select S3C_DEV_USB_HOST | 187 | select S3C_DEV_USB_HOST |
diff --git a/arch/arm/mach-s3c2440/s3c2440.c b/arch/arm/mach-s3c2440/s3c2440.c index d50f3ae6173d..f7663f731ea0 100644 --- a/arch/arm/mach-s3c2440/s3c2440.c +++ b/arch/arm/mach-s3c2440/s3c2440.c | |||
| @@ -46,9 +46,6 @@ int __init s3c2440_init(void) | |||
| 46 | { | 46 | { |
| 47 | printk("S3C2440: Initialising architecture\n"); | 47 | printk("S3C2440: Initialising architecture\n"); |
| 48 | 48 | ||
| 49 | s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; | ||
| 50 | s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; | ||
| 51 | |||
| 52 | /* change irq for watchdog */ | 49 | /* change irq for watchdog */ |
| 53 | 50 | ||
| 54 | s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; | 51 | s3c_device_wdt.resource[1].start = IRQ_S3C2440_WDT; |
| @@ -58,3 +55,11 @@ int __init s3c2440_init(void) | |||
| 58 | 55 | ||
| 59 | return sysdev_register(&s3c2440_sysdev); | 56 | return sysdev_register(&s3c2440_sysdev); |
| 60 | } | 57 | } |
| 58 | |||
| 59 | void __init s3c2440_map_io(void) | ||
| 60 | { | ||
| 61 | s3c244x_map_io(); | ||
| 62 | |||
| 63 | s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1up; | ||
| 64 | s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1up; | ||
| 65 | } | ||
diff --git a/arch/arm/mach-s3c2440/s3c2442.c b/arch/arm/mach-s3c2440/s3c2442.c index 188ad1e57dc0..ecf813546554 100644 --- a/arch/arm/mach-s3c2440/s3c2442.c +++ b/arch/arm/mach-s3c2440/s3c2442.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | #include <linux/interrupt.h> | 32 | #include <linux/interrupt.h> |
| 33 | #include <linux/ioport.h> | 33 | #include <linux/ioport.h> |
| 34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
| 35 | #include <linux/gpio.h> | ||
| 35 | #include <linux/clk.h> | 36 | #include <linux/clk.h> |
| 36 | #include <linux/io.h> | 37 | #include <linux/io.h> |
| 37 | 38 | ||
| @@ -43,6 +44,11 @@ | |||
| 43 | 44 | ||
| 44 | #include <plat/clock.h> | 45 | #include <plat/clock.h> |
| 45 | #include <plat/cpu.h> | 46 | #include <plat/cpu.h> |
| 47 | #include <plat/s3c244x.h> | ||
| 48 | |||
| 49 | #include <plat/gpio-core.h> | ||
| 50 | #include <plat/gpio-cfg.h> | ||
| 51 | #include <plat/gpio-cfg-helpers.h> | ||
| 46 | 52 | ||
| 47 | /* S3C2442 extended clock support */ | 53 | /* S3C2442 extended clock support */ |
| 48 | 54 | ||
| @@ -163,3 +169,11 @@ int __init s3c2442_init(void) | |||
| 163 | 169 | ||
| 164 | return sysdev_register(&s3c2442_sysdev); | 170 | return sysdev_register(&s3c2442_sysdev); |
| 165 | } | 171 | } |
| 172 | |||
| 173 | void __init s3c2442_map_io(void) | ||
| 174 | { | ||
| 175 | s3c244x_map_io(); | ||
| 176 | |||
| 177 | s3c24xx_gpiocfg_default.set_pull = s3c_gpio_setpull_1down; | ||
| 178 | s3c24xx_gpiocfg_default.get_pull = s3c_gpio_getpull_1down; | ||
| 179 | } | ||
diff --git a/arch/arm/mach-s3c2443/Kconfig b/arch/arm/mach-s3c2443/Kconfig index 4fef723126fa..31babec90cec 100644 --- a/arch/arm/mach-s3c2443/Kconfig +++ b/arch/arm/mach-s3c2443/Kconfig | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | config CPU_S3C2443 | 5 | config CPU_S3C2443 |
| 6 | bool | 6 | bool |
| 7 | depends on ARCH_S3C2410 | 7 | depends on ARCH_S3C2410 |
| 8 | select CPU_ARM920T | ||
| 8 | select S3C2443_DMA if S3C2410_DMA | 9 | select S3C2443_DMA if S3C2410_DMA |
| 9 | select CPU_LLSERIAL_S3C2440 | 10 | select CPU_LLSERIAL_S3C2440 |
| 10 | select SAMSUNG_CLKSRC | 11 | select SAMSUNG_CLKSRC |
diff --git a/arch/arm/mach-tegra/include/mach/debug-macro.S b/arch/arm/mach-tegra/include/mach/debug-macro.S index 8ea3bffb4e00..a0e7c12868bd 100644 --- a/arch/arm/mach-tegra/include/mach/debug-macro.S +++ b/arch/arm/mach-tegra/include/mach/debug-macro.S | |||
| @@ -21,8 +21,8 @@ | |||
| 21 | #include <mach/io.h> | 21 | #include <mach/io.h> |
| 22 | 22 | ||
| 23 | .macro addruart, rp, rv | 23 | .macro addruart, rp, rv |
| 24 | ldreq \rp, =IO_APB_PHYS @ physical | 24 | ldr \rp, =IO_APB_PHYS @ physical |
| 25 | ldrne \rv, =IO_APB_VIRT @ virtual | 25 | ldr \rv, =IO_APB_VIRT @ virtual |
| 26 | #if defined(CONFIG_TEGRA_DEBUG_UART_NONE) | 26 | #if defined(CONFIG_TEGRA_DEBUG_UART_NONE) |
| 27 | #error "A debug UART must be selected in the kernel config to use DEBUG_LL" | 27 | #error "A debug UART must be selected in the kernel config to use DEBUG_LL" |
| 28 | #elif defined(CONFIG_TEGRA_DEBUG_UARTA) | 28 | #elif defined(CONFIG_TEGRA_DEBUG_UARTA) |
diff --git a/arch/arm/mach-vexpress/headsmp.S b/arch/arm/mach-vexpress/headsmp.S index 8a78ff68e1ee..7a3f0632947c 100644 --- a/arch/arm/mach-vexpress/headsmp.S +++ b/arch/arm/mach-vexpress/headsmp.S | |||
| @@ -35,5 +35,6 @@ pen: ldr r7, [r6] | |||
| 35 | */ | 35 | */ |
| 36 | b secondary_startup | 36 | b secondary_startup |
| 37 | 37 | ||
| 38 | .align | ||
| 38 | 1: .long . | 39 | 1: .long . |
| 39 | .long pen_release | 40 | .long pen_release |
diff --git a/arch/arm/mm/proc-v7.S b/arch/arm/mm/proc-v7.S index 53cbe2225153..9b9ff5d949fd 100644 --- a/arch/arm/mm/proc-v7.S +++ b/arch/arm/mm/proc-v7.S | |||
| @@ -381,7 +381,7 @@ __v7_ca9mp_proc_info: | |||
| 381 | PMD_SECT_XN | \ | 381 | PMD_SECT_XN | \ |
| 382 | PMD_SECT_AP_WRITE | \ | 382 | PMD_SECT_AP_WRITE | \ |
| 383 | PMD_SECT_AP_READ | 383 | PMD_SECT_AP_READ |
| 384 | b __v7_ca9mp_setup | 384 | W(b) __v7_ca9mp_setup |
| 385 | .long cpu_arch_name | 385 | .long cpu_arch_name |
| 386 | .long cpu_elf_name | 386 | .long cpu_elf_name |
| 387 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS | 387 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS |
| @@ -413,7 +413,7 @@ __v7_proc_info: | |||
| 413 | PMD_SECT_XN | \ | 413 | PMD_SECT_XN | \ |
| 414 | PMD_SECT_AP_WRITE | \ | 414 | PMD_SECT_AP_WRITE | \ |
| 415 | PMD_SECT_AP_READ | 415 | PMD_SECT_AP_READ |
| 416 | b __v7_setup | 416 | W(b) __v7_setup |
| 417 | .long cpu_arch_name | 417 | .long cpu_arch_name |
| 418 | .long cpu_elf_name | 418 | .long cpu_elf_name |
| 419 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS | 419 | .long HWCAP_SWP|HWCAP_HALF|HWCAP_THUMB|HWCAP_FAST_MULT|HWCAP_EDSP|HWCAP_TLS |
diff --git a/arch/arm/plat-iop/time.c b/arch/arm/plat-iop/time.c index 85d3e55ca4a9..558cdfaf76b6 100644 --- a/arch/arm/plat-iop/time.c +++ b/arch/arm/plat-iop/time.c | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #include <linux/time.h> | 18 | #include <linux/time.h> |
| 19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
| 20 | #include <linux/timex.h> | 20 | #include <linux/timex.h> |
| 21 | #include <linux/sched.h> | ||
| 21 | #include <linux/io.h> | 22 | #include <linux/io.h> |
| 22 | #include <linux/clocksource.h> | 23 | #include <linux/clocksource.h> |
| 23 | #include <linux/clockchips.h> | 24 | #include <linux/clockchips.h> |
| @@ -36,7 +37,7 @@ | |||
| 36 | /* | 37 | /* |
| 37 | * IOP clocksource (free-running timer 1). | 38 | * IOP clocksource (free-running timer 1). |
| 38 | */ | 39 | */ |
| 39 | static cycle_t iop_clocksource_read(struct clocksource *unused) | 40 | static cycle_t notrace iop_clocksource_read(struct clocksource *unused) |
| 40 | { | 41 | { |
| 41 | return 0xffffffffu - read_tcr1(); | 42 | return 0xffffffffu - read_tcr1(); |
| 42 | } | 43 | } |
diff --git a/arch/arm/plat-s3c24xx/cpu.c b/arch/arm/plat-s3c24xx/cpu.c index 76d0858c3cbb..4a10c0f684b2 100644 --- a/arch/arm/plat-s3c24xx/cpu.c +++ b/arch/arm/plat-s3c24xx/cpu.c | |||
| @@ -88,7 +88,7 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
| 88 | { | 88 | { |
| 89 | .idcode = 0x32440000, | 89 | .idcode = 0x32440000, |
| 90 | .idmask = 0xffffffff, | 90 | .idmask = 0xffffffff, |
| 91 | .map_io = s3c244x_map_io, | 91 | .map_io = s3c2440_map_io, |
| 92 | .init_clocks = s3c244x_init_clocks, | 92 | .init_clocks = s3c244x_init_clocks, |
| 93 | .init_uarts = s3c244x_init_uarts, | 93 | .init_uarts = s3c244x_init_uarts, |
| 94 | .init = s3c2440_init, | 94 | .init = s3c2440_init, |
| @@ -97,7 +97,7 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
| 97 | { | 97 | { |
| 98 | .idcode = 0x32440001, | 98 | .idcode = 0x32440001, |
| 99 | .idmask = 0xffffffff, | 99 | .idmask = 0xffffffff, |
| 100 | .map_io = s3c244x_map_io, | 100 | .map_io = s3c2440_map_io, |
| 101 | .init_clocks = s3c244x_init_clocks, | 101 | .init_clocks = s3c244x_init_clocks, |
| 102 | .init_uarts = s3c244x_init_uarts, | 102 | .init_uarts = s3c244x_init_uarts, |
| 103 | .init = s3c2440_init, | 103 | .init = s3c2440_init, |
| @@ -106,7 +106,7 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
| 106 | { | 106 | { |
| 107 | .idcode = 0x32440aaa, | 107 | .idcode = 0x32440aaa, |
| 108 | .idmask = 0xffffffff, | 108 | .idmask = 0xffffffff, |
| 109 | .map_io = s3c244x_map_io, | 109 | .map_io = s3c2442_map_io, |
| 110 | .init_clocks = s3c244x_init_clocks, | 110 | .init_clocks = s3c244x_init_clocks, |
| 111 | .init_uarts = s3c244x_init_uarts, | 111 | .init_uarts = s3c244x_init_uarts, |
| 112 | .init = s3c2442_init, | 112 | .init = s3c2442_init, |
| @@ -115,7 +115,7 @@ static struct cpu_table cpu_ids[] __initdata = { | |||
| 115 | { | 115 | { |
| 116 | .idcode = 0x32440aab, | 116 | .idcode = 0x32440aab, |
| 117 | .idmask = 0xffffffff, | 117 | .idmask = 0xffffffff, |
| 118 | .map_io = s3c244x_map_io, | 118 | .map_io = s3c2442_map_io, |
| 119 | .init_clocks = s3c244x_init_clocks, | 119 | .init_clocks = s3c244x_init_clocks, |
| 120 | .init_uarts = s3c244x_init_uarts, | 120 | .init_uarts = s3c244x_init_uarts, |
| 121 | .init = s3c2442_init, | 121 | .init = s3c2442_init, |
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 24c6f5a30596..243b6411050d 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c | |||
| @@ -82,8 +82,6 @@ static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = { | |||
| 82 | struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { | 82 | struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { |
| 83 | .set_config = s3c_gpio_setcfg_s3c24xx, | 83 | .set_config = s3c_gpio_setcfg_s3c24xx, |
| 84 | .get_config = s3c_gpio_getcfg_s3c24xx, | 84 | .get_config = s3c_gpio_getcfg_s3c24xx, |
| 85 | .set_pull = s3c_gpio_setpull_1up, | ||
| 86 | .get_pull = s3c_gpio_getpull_1up, | ||
| 87 | }; | 85 | }; |
| 88 | 86 | ||
| 89 | struct s3c_gpio_chip s3c24xx_gpios[] = { | 87 | struct s3c_gpio_chip s3c24xx_gpios[] = { |
diff --git a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h index 307248d1ccbb..89e8d0a25f87 100644 --- a/arch/arm/plat-s3c24xx/include/plat/s3c244x.h +++ b/arch/arm/plat-s3c24xx/include/plat/s3c244x.h | |||
| @@ -21,17 +21,22 @@ extern void s3c244x_init_clocks(int xtal); | |||
| 21 | #else | 21 | #else |
| 22 | #define s3c244x_init_clocks NULL | 22 | #define s3c244x_init_clocks NULL |
| 23 | #define s3c244x_init_uarts NULL | 23 | #define s3c244x_init_uarts NULL |
| 24 | #define s3c244x_map_io NULL | ||
| 25 | #endif | 24 | #endif |
| 26 | 25 | ||
| 27 | #ifdef CONFIG_CPU_S3C2440 | 26 | #ifdef CONFIG_CPU_S3C2440 |
| 28 | extern int s3c2440_init(void); | 27 | extern int s3c2440_init(void); |
| 28 | |||
| 29 | extern void s3c2440_map_io(void); | ||
| 29 | #else | 30 | #else |
| 30 | #define s3c2440_init NULL | 31 | #define s3c2440_init NULL |
| 32 | #define s3c2440_map_io NULL | ||
| 31 | #endif | 33 | #endif |
| 32 | 34 | ||
| 33 | #ifdef CONFIG_CPU_S3C2442 | 35 | #ifdef CONFIG_CPU_S3C2442 |
| 34 | extern int s3c2442_init(void); | 36 | extern int s3c2442_init(void); |
| 37 | |||
| 38 | extern void s3c2442_map_io(void); | ||
| 35 | #else | 39 | #else |
| 36 | #define s3c2442_init NULL | 40 | #define s3c2442_init NULL |
| 41 | #define s3c2442_map_io NULL | ||
| 37 | #endif | 42 | #endif |
diff --git a/arch/arm/plat-samsung/gpio-config.c b/arch/arm/plat-samsung/gpio-config.c index b732b773b9af..0aa32f242ee4 100644 --- a/arch/arm/plat-samsung/gpio-config.c +++ b/arch/arm/plat-samsung/gpio-config.c | |||
| @@ -280,18 +280,17 @@ s3c_gpio_pull_t s3c_gpio_getpull_updown(struct s3c_gpio_chip *chip, | |||
| 280 | } | 280 | } |
| 281 | #endif | 281 | #endif |
| 282 | 282 | ||
| 283 | #ifdef CONFIG_S3C_GPIO_PULL_UP | 283 | #if defined(CONFIG_S3C_GPIO_PULL_UP) || defined(CONFIG_S3C_GPIO_PULL_DOWN) |
| 284 | int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, | 284 | static int s3c_gpio_setpull_1(struct s3c_gpio_chip *chip, |
| 285 | unsigned int off, s3c_gpio_pull_t pull) | 285 | unsigned int off, s3c_gpio_pull_t pull, |
| 286 | s3c_gpio_pull_t updown) | ||
| 286 | { | 287 | { |
| 287 | void __iomem *reg = chip->base + 0x08; | 288 | void __iomem *reg = chip->base + 0x08; |
| 288 | u32 pup = __raw_readl(reg); | 289 | u32 pup = __raw_readl(reg); |
| 289 | 290 | ||
| 290 | pup = __raw_readl(reg); | 291 | if (pull == updown) |
| 291 | |||
| 292 | if (pup == S3C_GPIO_PULL_UP) | ||
| 293 | pup &= ~(1 << off); | 292 | pup &= ~(1 << off); |
| 294 | else if (pup == S3C_GPIO_PULL_NONE) | 293 | else if (pull == S3C_GPIO_PULL_NONE) |
| 295 | pup |= (1 << off); | 294 | pup |= (1 << off); |
| 296 | else | 295 | else |
| 297 | return -EINVAL; | 296 | return -EINVAL; |
| @@ -300,17 +299,45 @@ int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, | |||
| 300 | return 0; | 299 | return 0; |
| 301 | } | 300 | } |
| 302 | 301 | ||
| 303 | s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, | 302 | static s3c_gpio_pull_t s3c_gpio_getpull_1(struct s3c_gpio_chip *chip, |
| 304 | unsigned int off) | 303 | unsigned int off, s3c_gpio_pull_t updown) |
| 305 | { | 304 | { |
| 306 | void __iomem *reg = chip->base + 0x08; | 305 | void __iomem *reg = chip->base + 0x08; |
| 307 | u32 pup = __raw_readl(reg); | 306 | u32 pup = __raw_readl(reg); |
| 308 | 307 | ||
| 309 | pup &= (1 << off); | 308 | pup &= (1 << off); |
| 310 | return pup ? S3C_GPIO_PULL_NONE : S3C_GPIO_PULL_UP; | 309 | return pup ? S3C_GPIO_PULL_NONE : updown; |
| 310 | } | ||
| 311 | #endif /* CONFIG_S3C_GPIO_PULL_UP || CONFIG_S3C_GPIO_PULL_DOWN */ | ||
| 312 | |||
| 313 | #ifdef CONFIG_S3C_GPIO_PULL_UP | ||
| 314 | s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, | ||
| 315 | unsigned int off) | ||
| 316 | { | ||
| 317 | return s3c_gpio_getpull_1(chip, off, S3C_GPIO_PULL_UP); | ||
| 318 | } | ||
| 319 | |||
| 320 | int s3c_gpio_setpull_1up(struct s3c_gpio_chip *chip, | ||
| 321 | unsigned int off, s3c_gpio_pull_t pull) | ||
| 322 | { | ||
| 323 | return s3c_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_UP); | ||
| 311 | } | 324 | } |
| 312 | #endif /* CONFIG_S3C_GPIO_PULL_UP */ | 325 | #endif /* CONFIG_S3C_GPIO_PULL_UP */ |
| 313 | 326 | ||
| 327 | #ifdef CONFIG_S3C_GPIO_PULL_DOWN | ||
| 328 | s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip, | ||
| 329 | unsigned int off) | ||
| 330 | { | ||
| 331 | return s3c_gpio_getpull_1(chip, off, S3C_GPIO_PULL_DOWN); | ||
| 332 | } | ||
| 333 | |||
| 334 | int s3c_gpio_setpull_1down(struct s3c_gpio_chip *chip, | ||
| 335 | unsigned int off, s3c_gpio_pull_t pull) | ||
| 336 | { | ||
| 337 | return s3c_gpio_setpull_1(chip, off, pull, S3C_GPIO_PULL_DOWN); | ||
| 338 | } | ||
| 339 | #endif /* CONFIG_S3C_GPIO_PULL_DOWN */ | ||
| 340 | |||
| 314 | #ifdef CONFIG_S5P_GPIO_DRVSTR | 341 | #ifdef CONFIG_S5P_GPIO_DRVSTR |
| 315 | s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin) | 342 | s5p_gpio_drvstr_t s5p_gpio_get_drvstr(unsigned int pin) |
| 316 | { | 343 | { |
diff --git a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h index 8fd65d8b5863..0d2c5703f1ee 100644 --- a/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h +++ b/arch/arm/plat-samsung/include/plat/gpio-cfg-helpers.h | |||
| @@ -210,6 +210,17 @@ extern s3c_gpio_pull_t s3c_gpio_getpull_1up(struct s3c_gpio_chip *chip, | |||
| 210 | unsigned int off); | 210 | unsigned int off); |
| 211 | 211 | ||
| 212 | /** | 212 | /** |
| 213 | * s3c_gpio_getpull_1down() - Get configuration for choice of down or none | ||
| 214 | * @chip: The gpio chip that the GPIO pin belongs to | ||
| 215 | * @off: The offset to the pin to get the configuration of. | ||
| 216 | * | ||
| 217 | * This helper function reads the state of the pull-down resistor for the | ||
| 218 | * given GPIO in the same case as s3c_gpio_setpull_1down. | ||
| 219 | */ | ||
| 220 | extern s3c_gpio_pull_t s3c_gpio_getpull_1down(struct s3c_gpio_chip *chip, | ||
| 221 | unsigned int off); | ||
| 222 | |||
| 223 | /** | ||
| 213 | * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. | 224 | * s3c_gpio_setpull_s3c2443() - Pull configuration for s3c2443. |
| 214 | * @chip: The gpio chip that is being configured. | 225 | * @chip: The gpio chip that is being configured. |
| 215 | * @off: The offset for the GPIO being configured. | 226 | * @off: The offset for the GPIO being configured. |
diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S index d66cead97d28..9897dcfc16d6 100644 --- a/arch/arm/vfp/vfphw.S +++ b/arch/arm/vfp/vfphw.S | |||
| @@ -206,6 +206,7 @@ ENTRY(vfp_save_state) | |||
| 206 | mov pc, lr | 206 | mov pc, lr |
| 207 | ENDPROC(vfp_save_state) | 207 | ENDPROC(vfp_save_state) |
| 208 | 208 | ||
| 209 | .align | ||
| 209 | last_VFP_context_address: | 210 | last_VFP_context_address: |
| 210 | .word last_VFP_context | 211 | .word last_VFP_context |
| 211 | 212 | ||
diff --git a/arch/mn10300/include/asm/syscall.h b/arch/mn10300/include/asm/syscall.h new file mode 100644 index 000000000000..b44b0bb75a01 --- /dev/null +++ b/arch/mn10300/include/asm/syscall.h | |||
| @@ -0,0 +1,117 @@ | |||
| 1 | /* Access to user system call parameters and results | ||
| 2 | * | ||
| 3 | * See asm-generic/syscall.h for function descriptions. | ||
| 4 | * | ||
| 5 | * Copyright (C) 2010 Red Hat, Inc. All Rights Reserved. | ||
| 6 | * Written by David Howells (dhowells@redhat.com) | ||
| 7 | * | ||
| 8 | * This program is free software; you can redistribute it and/or | ||
| 9 | * modify it under the terms of the GNU General Public Licence | ||
| 10 | * as published by the Free Software Foundation; either version | ||
| 11 | * 2 of the Licence, or (at your option) any later version. | ||
| 12 | */ | ||
| 13 | |||
| 14 | #ifndef _ASM_SYSCALL_H | ||
| 15 | #define _ASM_SYSCALL_H | ||
| 16 | |||
| 17 | #include <linux/sched.h> | ||
| 18 | #include <linux/err.h> | ||
| 19 | |||
| 20 | extern const unsigned long sys_call_table[]; | ||
| 21 | |||
| 22 | static inline int syscall_get_nr(struct task_struct *task, struct pt_regs *regs) | ||
| 23 | { | ||
| 24 | return regs->orig_d0; | ||
| 25 | } | ||
| 26 | |||
| 27 | static inline void syscall_rollback(struct task_struct *task, | ||
| 28 | struct pt_regs *regs) | ||
| 29 | { | ||
| 30 | regs->d0 = regs->orig_d0; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline long syscall_get_error(struct task_struct *task, | ||
| 34 | struct pt_regs *regs) | ||
| 35 | { | ||
| 36 | unsigned long error = regs->d0; | ||
| 37 | return IS_ERR_VALUE(error) ? error : 0; | ||
| 38 | } | ||
| 39 | |||
| 40 | static inline long syscall_get_return_value(struct task_struct *task, | ||
| 41 | struct pt_regs *regs) | ||
| 42 | { | ||
| 43 | return regs->d0; | ||
| 44 | } | ||
| 45 | |||
| 46 | static inline void syscall_set_return_value(struct task_struct *task, | ||
| 47 | struct pt_regs *regs, | ||
| 48 | int error, long val) | ||
| 49 | { | ||
| 50 | regs->d0 = (long) error ?: val; | ||
| 51 | } | ||
| 52 | |||
| 53 | static inline void syscall_get_arguments(struct task_struct *task, | ||
| 54 | struct pt_regs *regs, | ||
| 55 | unsigned int i, unsigned int n, | ||
| 56 | unsigned long *args) | ||
| 57 | { | ||
| 58 | switch (i) { | ||
| 59 | case 0: | ||
| 60 | if (!n--) break; | ||
| 61 | *args++ = regs->a0; | ||
| 62 | case 1: | ||
| 63 | if (!n--) break; | ||
| 64 | *args++ = regs->d1; | ||
| 65 | case 2: | ||
| 66 | if (!n--) break; | ||
| 67 | *args++ = regs->a3; | ||
| 68 | case 3: | ||
| 69 | if (!n--) break; | ||
| 70 | *args++ = regs->a2; | ||
| 71 | case 4: | ||
| 72 | if (!n--) break; | ||
| 73 | *args++ = regs->d3; | ||
| 74 | case 5: | ||
| 75 | if (!n--) break; | ||
| 76 | *args++ = regs->d2; | ||
| 77 | case 6: | ||
| 78 | if (!n--) break; | ||
| 79 | default: | ||
| 80 | BUG(); | ||
| 81 | break; | ||
| 82 | } | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline void syscall_set_arguments(struct task_struct *task, | ||
| 86 | struct pt_regs *regs, | ||
| 87 | unsigned int i, unsigned int n, | ||
| 88 | const unsigned long *args) | ||
| 89 | { | ||
| 90 | switch (i) { | ||
| 91 | case 0: | ||
| 92 | if (!n--) break; | ||
| 93 | regs->a0 = *args++; | ||
| 94 | case 1: | ||
| 95 | if (!n--) break; | ||
| 96 | regs->d1 = *args++; | ||
| 97 | case 2: | ||
| 98 | if (!n--) break; | ||
| 99 | regs->a3 = *args++; | ||
| 100 | case 3: | ||
| 101 | if (!n--) break; | ||
| 102 | regs->a2 = *args++; | ||
| 103 | case 4: | ||
| 104 | if (!n--) break; | ||
| 105 | regs->d3 = *args++; | ||
| 106 | case 5: | ||
| 107 | if (!n--) break; | ||
| 108 | regs->d2 = *args++; | ||
| 109 | case 6: | ||
| 110 | if (!n--) break; | ||
| 111 | default: | ||
| 112 | BUG(); | ||
| 113 | break; | ||
| 114 | } | ||
| 115 | } | ||
| 116 | |||
| 117 | #endif /* _ASM_SYSCALL_H */ | ||
diff --git a/arch/mn10300/kernel/gdb-io-serial.c b/arch/mn10300/kernel/gdb-io-serial.c index 0d5d63c91dc3..f28dc99c6f72 100644 --- a/arch/mn10300/kernel/gdb-io-serial.c +++ b/arch/mn10300/kernel/gdb-io-serial.c | |||
| @@ -73,7 +73,8 @@ void gdbstub_io_init(void) | |||
| 73 | GDBPORT_SERIAL_IER = UART_IER_RDI | UART_IER_RLSI; | 73 | GDBPORT_SERIAL_IER = UART_IER_RDI | UART_IER_RLSI; |
| 74 | 74 | ||
| 75 | /* permit level 0 IRQs to take place */ | 75 | /* permit level 0 IRQs to take place */ |
| 76 | local_change_intr_mask_level(NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); | 76 | arch_local_change_intr_mask_level( |
| 77 | NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); | ||
| 77 | } | 78 | } |
| 78 | 79 | ||
| 79 | /* | 80 | /* |
diff --git a/arch/mn10300/kernel/gdb-io-ttysm.c b/arch/mn10300/kernel/gdb-io-ttysm.c index 97dfda23342c..abdeea153c89 100644 --- a/arch/mn10300/kernel/gdb-io-ttysm.c +++ b/arch/mn10300/kernel/gdb-io-ttysm.c | |||
| @@ -87,7 +87,8 @@ void __init gdbstub_io_init(void) | |||
| 87 | tmp = *gdbstub_port->_control; | 87 | tmp = *gdbstub_port->_control; |
| 88 | 88 | ||
| 89 | /* permit level 0 IRQs only */ | 89 | /* permit level 0 IRQs only */ |
| 90 | local_change_intr_mask_level(NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); | 90 | arch_local_change_intr_mask_level( |
| 91 | NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); | ||
| 91 | } | 92 | } |
| 92 | 93 | ||
| 93 | /* | 94 | /* |
diff --git a/arch/mn10300/kernel/gdb-stub.c b/arch/mn10300/kernel/gdb-stub.c index a5fc3f05309b..b169d99d9f20 100644 --- a/arch/mn10300/kernel/gdb-stub.c +++ b/arch/mn10300/kernel/gdb-stub.c | |||
| @@ -1194,7 +1194,8 @@ static int gdbstub(struct pt_regs *regs, enum exception_code excep) | |||
| 1194 | 1194 | ||
| 1195 | asm volatile("mov mdr,%0" : "=d"(mdr)); | 1195 | asm volatile("mov mdr,%0" : "=d"(mdr)); |
| 1196 | local_save_flags(epsw); | 1196 | local_save_flags(epsw); |
| 1197 | local_change_intr_mask_level(NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); | 1197 | arch_local_change_intr_mask_level( |
| 1198 | NUM2EPSW_IM(CONFIG_GDBSTUB_IRQ_LEVEL + 1)); | ||
| 1198 | 1199 | ||
| 1199 | gdbstub_store_fpu(); | 1200 | gdbstub_store_fpu(); |
| 1200 | 1201 | ||
diff --git a/arch/parisc/kernel/irq.c b/arch/parisc/kernel/irq.c index 5024f643b3b1..d7d94b845dc2 100644 --- a/arch/parisc/kernel/irq.c +++ b/arch/parisc/kernel/irq.c | |||
| @@ -75,9 +75,6 @@ static void cpu_unmask_irq(unsigned int irq) | |||
| 75 | smp_send_all_nop(); | 75 | smp_send_all_nop(); |
| 76 | } | 76 | } |
| 77 | 77 | ||
| 78 | void no_ack_irq(unsigned int irq) { } | ||
| 79 | void no_end_irq(unsigned int irq) { } | ||
| 80 | |||
| 81 | void cpu_ack_irq(unsigned int irq) | 78 | void cpu_ack_irq(unsigned int irq) |
| 82 | { | 79 | { |
| 83 | unsigned long mask = EIEM_MASK(irq); | 80 | unsigned long mask = EIEM_MASK(irq); |
| @@ -241,7 +238,7 @@ int cpu_claim_irq(unsigned int irq, struct irq_chip *type, void *data) | |||
| 241 | 238 | ||
| 242 | /* for iosapic interrupts */ | 239 | /* for iosapic interrupts */ |
| 243 | if (type) { | 240 | if (type) { |
| 244 | set_irq_chip_and_handler(irq, type, handle_level_irq); | 241 | set_irq_chip_and_handler(irq, type, handle_percpu_irq); |
| 245 | set_irq_chip_data(irq, data); | 242 | set_irq_chip_data(irq, data); |
| 246 | cpu_unmask_irq(irq); | 243 | cpu_unmask_irq(irq); |
| 247 | } | 244 | } |
| @@ -392,7 +389,7 @@ static void claim_cpu_irqs(void) | |||
| 392 | int i; | 389 | int i; |
| 393 | for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) { | 390 | for (i = CPU_IRQ_BASE; i <= CPU_IRQ_MAX; i++) { |
| 394 | set_irq_chip_and_handler(i, &cpu_interrupt_type, | 391 | set_irq_chip_and_handler(i, &cpu_interrupt_type, |
| 395 | handle_level_irq); | 392 | handle_percpu_irq); |
| 396 | } | 393 | } |
| 397 | 394 | ||
| 398 | set_irq_handler(TIMER_IRQ, handle_percpu_irq); | 395 | set_irq_handler(TIMER_IRQ, handle_percpu_irq); |
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c index 35c827e94e31..609a331878e7 100644 --- a/arch/parisc/kernel/signal.c +++ b/arch/parisc/kernel/signal.c | |||
| @@ -98,7 +98,6 @@ void | |||
| 98 | sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) | 98 | sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) |
| 99 | { | 99 | { |
| 100 | struct rt_sigframe __user *frame; | 100 | struct rt_sigframe __user *frame; |
| 101 | struct siginfo si; | ||
| 102 | sigset_t set; | 101 | sigset_t set; |
| 103 | unsigned long usp = (regs->gr[30] & ~(0x01UL)); | 102 | unsigned long usp = (regs->gr[30] & ~(0x01UL)); |
| 104 | unsigned long sigframe_size = PARISC_RT_SIGFRAME_SIZE; | 103 | unsigned long sigframe_size = PARISC_RT_SIGFRAME_SIZE; |
| @@ -178,13 +177,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall) | |||
| 178 | 177 | ||
| 179 | give_sigsegv: | 178 | give_sigsegv: |
| 180 | DBG(1,"sys_rt_sigreturn: Sending SIGSEGV\n"); | 179 | DBG(1,"sys_rt_sigreturn: Sending SIGSEGV\n"); |
| 181 | si.si_signo = SIGSEGV; | 180 | force_sig(SIGSEGV, current); |
| 182 | si.si_errno = 0; | ||
| 183 | si.si_code = SI_KERNEL; | ||
| 184 | si.si_pid = task_pid_vnr(current); | ||
| 185 | si.si_uid = current_uid(); | ||
| 186 | si.si_addr = &frame->uc; | ||
| 187 | force_sig_info(SIGSEGV, &si, current); | ||
| 188 | return; | 181 | return; |
| 189 | } | 182 | } |
| 190 | 183 | ||
diff --git a/arch/s390/kernel/vtime.c b/arch/s390/kernel/vtime.c index 56c8687b29b3..7eff9b7347c0 100644 --- a/arch/s390/kernel/vtime.c +++ b/arch/s390/kernel/vtime.c | |||
| @@ -19,6 +19,7 @@ | |||
| 19 | #include <linux/kernel_stat.h> | 19 | #include <linux/kernel_stat.h> |
| 20 | #include <linux/rcupdate.h> | 20 | #include <linux/rcupdate.h> |
| 21 | #include <linux/posix-timers.h> | 21 | #include <linux/posix-timers.h> |
| 22 | #include <linux/cpu.h> | ||
| 22 | 23 | ||
| 23 | #include <asm/s390_ext.h> | 24 | #include <asm/s390_ext.h> |
| 24 | #include <asm/timer.h> | 25 | #include <asm/timer.h> |
| @@ -566,6 +567,23 @@ void init_cpu_vtimer(void) | |||
| 566 | __ctl_set_bit(0,10); | 567 | __ctl_set_bit(0,10); |
| 567 | } | 568 | } |
| 568 | 569 | ||
| 570 | static int __cpuinit s390_nohz_notify(struct notifier_block *self, | ||
| 571 | unsigned long action, void *hcpu) | ||
| 572 | { | ||
| 573 | struct s390_idle_data *idle; | ||
| 574 | long cpu = (long) hcpu; | ||
| 575 | |||
| 576 | idle = &per_cpu(s390_idle, cpu); | ||
| 577 | switch (action) { | ||
| 578 | case CPU_DYING: | ||
| 579 | case CPU_DYING_FROZEN: | ||
| 580 | idle->nohz_delay = 0; | ||
| 581 | default: | ||
| 582 | break; | ||
| 583 | } | ||
| 584 | return NOTIFY_OK; | ||
| 585 | } | ||
| 586 | |||
| 569 | void __init vtime_init(void) | 587 | void __init vtime_init(void) |
| 570 | { | 588 | { |
| 571 | /* request the cpu timer external interrupt */ | 589 | /* request the cpu timer external interrupt */ |
| @@ -574,5 +592,6 @@ void __init vtime_init(void) | |||
| 574 | 592 | ||
| 575 | /* Enable cpu timer interrupts on the boot cpu. */ | 593 | /* Enable cpu timer interrupts on the boot cpu. */ |
| 576 | init_cpu_vtimer(); | 594 | init_cpu_vtimer(); |
| 595 | cpu_notifier(s390_nohz_notify, 0); | ||
| 577 | } | 596 | } |
| 578 | 597 | ||
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 2eaeb9e59585..f48c492a68d3 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
| @@ -720,32 +720,6 @@ static struct platform_device camera_devices[] = { | |||
| 720 | }; | 720 | }; |
| 721 | 721 | ||
| 722 | /* FSI */ | 722 | /* FSI */ |
| 723 | /* | ||
| 724 | * FSI-B use external clock which came from da7210. | ||
| 725 | * So, we should change parent of fsi | ||
| 726 | */ | ||
| 727 | #define FCLKBCR 0xa415000c | ||
| 728 | static void fsimck_init(struct clk *clk) | ||
| 729 | { | ||
| 730 | u32 status = __raw_readl(clk->enable_reg); | ||
| 731 | |||
| 732 | /* use external clock */ | ||
| 733 | status &= ~0x000000ff; | ||
| 734 | status |= 0x00000080; | ||
| 735 | |||
| 736 | __raw_writel(status, clk->enable_reg); | ||
| 737 | } | ||
| 738 | |||
| 739 | static struct clk_ops fsimck_clk_ops = { | ||
| 740 | .init = fsimck_init, | ||
| 741 | }; | ||
| 742 | |||
| 743 | static struct clk fsimckb_clk = { | ||
| 744 | .ops = &fsimck_clk_ops, | ||
| 745 | .enable_reg = (void __iomem *)FCLKBCR, | ||
| 746 | .rate = 0, /* unknown */ | ||
| 747 | }; | ||
| 748 | |||
| 749 | static struct sh_fsi_platform_info fsi_info = { | 723 | static struct sh_fsi_platform_info fsi_info = { |
| 750 | .portb_flags = SH_FSI_BRS_INV | | 724 | .portb_flags = SH_FSI_BRS_INV | |
| 751 | SH_FSI_OUT_SLAVE_MODE | | 725 | SH_FSI_OUT_SLAVE_MODE | |
| @@ -1264,10 +1238,10 @@ static int __init arch_setup(void) | |||
| 1264 | /* change parent of FSI B */ | 1238 | /* change parent of FSI B */ |
| 1265 | clk = clk_get(NULL, "fsib_clk"); | 1239 | clk = clk_get(NULL, "fsib_clk"); |
| 1266 | if (!IS_ERR(clk)) { | 1240 | if (!IS_ERR(clk)) { |
| 1267 | clk_register(&fsimckb_clk); | 1241 | /* 48kHz dummy clock was used to make sure 1/1 divide */ |
| 1268 | clk_set_parent(clk, &fsimckb_clk); | 1242 | clk_set_rate(&sh7724_fsimckb_clk, 48000); |
| 1269 | clk_set_rate(clk, 11000); | 1243 | clk_set_parent(clk, &sh7724_fsimckb_clk); |
| 1270 | clk_set_rate(&fsimckb_clk, 11000); | 1244 | clk_set_rate(clk, 48000); |
| 1271 | clk_put(clk); | 1245 | clk_put(clk); |
| 1272 | } | 1246 | } |
| 1273 | 1247 | ||
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index c31d228fdfc6..527a0cd956b5 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
| @@ -283,31 +283,6 @@ static struct platform_device ceu1_device = { | |||
| 283 | }; | 283 | }; |
| 284 | 284 | ||
| 285 | /* FSI */ | 285 | /* FSI */ |
| 286 | /* | ||
| 287 | * FSI-A use external clock which came from ak464x. | ||
| 288 | * So, we should change parent of fsi | ||
| 289 | */ | ||
| 290 | #define FCLKACR 0xa4150008 | ||
| 291 | static void fsimck_init(struct clk *clk) | ||
| 292 | { | ||
| 293 | u32 status = __raw_readl(clk->enable_reg); | ||
| 294 | |||
| 295 | /* use external clock */ | ||
| 296 | status &= ~0x000000ff; | ||
| 297 | status |= 0x00000080; | ||
| 298 | __raw_writel(status, clk->enable_reg); | ||
| 299 | } | ||
| 300 | |||
| 301 | static struct clk_ops fsimck_clk_ops = { | ||
| 302 | .init = fsimck_init, | ||
| 303 | }; | ||
| 304 | |||
| 305 | static struct clk fsimcka_clk = { | ||
| 306 | .ops = &fsimck_clk_ops, | ||
| 307 | .enable_reg = (void __iomem *)FCLKACR, | ||
| 308 | .rate = 0, /* unknown */ | ||
| 309 | }; | ||
| 310 | |||
| 311 | /* change J20, J21, J22 pin to 1-2 connection to use slave mode */ | 286 | /* change J20, J21, J22 pin to 1-2 connection to use slave mode */ |
| 312 | static struct sh_fsi_platform_info fsi_info = { | 287 | static struct sh_fsi_platform_info fsi_info = { |
| 313 | .porta_flags = SH_FSI_BRS_INV | | 288 | .porta_flags = SH_FSI_BRS_INV | |
| @@ -852,37 +827,29 @@ static int __init devices_setup(void) | |||
| 852 | gpio_request(GPIO_FN_KEYOUT0, NULL); | 827 | gpio_request(GPIO_FN_KEYOUT0, NULL); |
| 853 | 828 | ||
| 854 | /* enable FSI */ | 829 | /* enable FSI */ |
| 855 | gpio_request(GPIO_FN_FSIMCKB, NULL); | ||
| 856 | gpio_request(GPIO_FN_FSIMCKA, NULL); | 830 | gpio_request(GPIO_FN_FSIMCKA, NULL); |
| 831 | gpio_request(GPIO_FN_FSIIASD, NULL); | ||
| 857 | gpio_request(GPIO_FN_FSIOASD, NULL); | 832 | gpio_request(GPIO_FN_FSIOASD, NULL); |
| 858 | gpio_request(GPIO_FN_FSIIABCK, NULL); | 833 | gpio_request(GPIO_FN_FSIIABCK, NULL); |
| 859 | gpio_request(GPIO_FN_FSIIALRCK, NULL); | 834 | gpio_request(GPIO_FN_FSIIALRCK, NULL); |
| 860 | gpio_request(GPIO_FN_FSIOABCK, NULL); | 835 | gpio_request(GPIO_FN_FSIOABCK, NULL); |
| 861 | gpio_request(GPIO_FN_FSIOALRCK, NULL); | 836 | gpio_request(GPIO_FN_FSIOALRCK, NULL); |
| 862 | gpio_request(GPIO_FN_CLKAUDIOAO, NULL); | 837 | gpio_request(GPIO_FN_CLKAUDIOAO, NULL); |
| 863 | gpio_request(GPIO_FN_FSIIBSD, NULL); | ||
| 864 | gpio_request(GPIO_FN_FSIOBSD, NULL); | ||
| 865 | gpio_request(GPIO_FN_FSIIBBCK, NULL); | ||
| 866 | gpio_request(GPIO_FN_FSIIBLRCK, NULL); | ||
| 867 | gpio_request(GPIO_FN_FSIOBBCK, NULL); | ||
| 868 | gpio_request(GPIO_FN_FSIOBLRCK, NULL); | ||
| 869 | gpio_request(GPIO_FN_CLKAUDIOBO, NULL); | ||
| 870 | gpio_request(GPIO_FN_FSIIASD, NULL); | ||
| 871 | 838 | ||
| 872 | /* set SPU2 clock to 83.4 MHz */ | 839 | /* set SPU2 clock to 83.4 MHz */ |
| 873 | clk = clk_get(NULL, "spu_clk"); | 840 | clk = clk_get(NULL, "spu_clk"); |
| 874 | if (clk) { | 841 | if (!IS_ERR(clk)) { |
| 875 | clk_set_rate(clk, clk_round_rate(clk, 83333333)); | 842 | clk_set_rate(clk, clk_round_rate(clk, 83333333)); |
| 876 | clk_put(clk); | 843 | clk_put(clk); |
| 877 | } | 844 | } |
| 878 | 845 | ||
| 879 | /* change parent of FSI A */ | 846 | /* change parent of FSI A */ |
| 880 | clk = clk_get(NULL, "fsia_clk"); | 847 | clk = clk_get(NULL, "fsia_clk"); |
| 881 | if (clk) { | 848 | if (!IS_ERR(clk)) { |
| 882 | clk_register(&fsimcka_clk); | 849 | /* 48kHz dummy clock was used to make sure 1/1 divide */ |
| 883 | clk_set_parent(clk, &fsimcka_clk); | 850 | clk_set_rate(&sh7724_fsimcka_clk, 48000); |
| 884 | clk_set_rate(clk, 11000); | 851 | clk_set_parent(clk, &sh7724_fsimcka_clk); |
| 885 | clk_set_rate(&fsimcka_clk, 11000); | 852 | clk_set_rate(clk, 48000); |
| 886 | clk_put(clk); | 853 | clk_put(clk); |
| 887 | } | 854 | } |
| 888 | 855 | ||
diff --git a/arch/sh/include/asm/cacheflush.h b/arch/sh/include/asm/cacheflush.h index 1f4e562c5e8c..82e1eabeac98 100644 --- a/arch/sh/include/asm/cacheflush.h +++ b/arch/sh/include/asm/cacheflush.h | |||
| @@ -96,7 +96,7 @@ void kmap_coherent_init(void); | |||
| 96 | void *kmap_coherent(struct page *page, unsigned long addr); | 96 | void *kmap_coherent(struct page *page, unsigned long addr); |
| 97 | void kunmap_coherent(void *kvaddr); | 97 | void kunmap_coherent(void *kvaddr); |
| 98 | 98 | ||
| 99 | #define PG_dcache_dirty PG_arch_1 | 99 | #define PG_dcache_clean PG_arch_1 |
| 100 | 100 | ||
| 101 | void cpu_cache_init(void); | 101 | void cpu_cache_init(void); |
| 102 | 102 | ||
diff --git a/arch/sh/include/cpu-sh4/cpu/sh7724.h b/arch/sh/include/cpu-sh4/cpu/sh7724.h index 4c27b68789b3..7eb435999426 100644 --- a/arch/sh/include/cpu-sh4/cpu/sh7724.h +++ b/arch/sh/include/cpu-sh4/cpu/sh7724.h | |||
| @@ -303,4 +303,7 @@ enum { | |||
| 303 | SHDMA_SLAVE_SDHI1_RX, | 303 | SHDMA_SLAVE_SDHI1_RX, |
| 304 | }; | 304 | }; |
| 305 | 305 | ||
| 306 | extern struct clk sh7724_fsimcka_clk; | ||
| 307 | extern struct clk sh7724_fsimckb_clk; | ||
| 308 | |||
| 306 | #endif /* __ASM_SH7724_H__ */ | 309 | #endif /* __ASM_SH7724_H__ */ |
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c index 0fe2e9329cb2..271c0b325a9a 100644 --- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c +++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c | |||
| @@ -111,12 +111,21 @@ static struct clk div3_clk = { | |||
| 111 | .parent = &pll_clk, | 111 | .parent = &pll_clk, |
| 112 | }; | 112 | }; |
| 113 | 113 | ||
| 114 | /* External input clock (pin name: FSIMCKA/FSIMCKB ) */ | ||
| 115 | struct clk sh7724_fsimcka_clk = { | ||
| 116 | }; | ||
| 117 | |||
| 118 | struct clk sh7724_fsimckb_clk = { | ||
| 119 | }; | ||
| 120 | |||
| 114 | static struct clk *main_clks[] = { | 121 | static struct clk *main_clks[] = { |
| 115 | &r_clk, | 122 | &r_clk, |
| 116 | &extal_clk, | 123 | &extal_clk, |
| 117 | &fll_clk, | 124 | &fll_clk, |
| 118 | &pll_clk, | 125 | &pll_clk, |
| 119 | &div3_clk, | 126 | &div3_clk, |
| 127 | &sh7724_fsimcka_clk, | ||
| 128 | &sh7724_fsimckb_clk, | ||
| 120 | }; | 129 | }; |
| 121 | 130 | ||
| 122 | static void div4_kick(struct clk *clk) | 131 | static void div4_kick(struct clk *clk) |
| @@ -154,16 +163,38 @@ struct clk div4_clks[DIV4_NR] = { | |||
| 154 | [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), | 163 | [DIV4_M1] = DIV4(FRQCRB, 4, 0x2f7c, CLK_ENABLE_ON_INIT), |
| 155 | }; | 164 | }; |
| 156 | 165 | ||
| 157 | enum { DIV6_V, DIV6_FA, DIV6_FB, DIV6_I, DIV6_S, DIV6_NR }; | 166 | enum { DIV6_V, DIV6_I, DIV6_S, DIV6_NR }; |
| 158 | 167 | ||
| 159 | static struct clk div6_clks[DIV6_NR] = { | 168 | static struct clk div6_clks[DIV6_NR] = { |
| 160 | [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), | 169 | [DIV6_V] = SH_CLK_DIV6(&div3_clk, VCLKCR, 0), |
| 161 | [DIV6_FA] = SH_CLK_DIV6(&div3_clk, FCLKACR, 0), | ||
| 162 | [DIV6_FB] = SH_CLK_DIV6(&div3_clk, FCLKBCR, 0), | ||
| 163 | [DIV6_I] = SH_CLK_DIV6(&div3_clk, IRDACLKCR, 0), | 170 | [DIV6_I] = SH_CLK_DIV6(&div3_clk, IRDACLKCR, 0), |
| 164 | [DIV6_S] = SH_CLK_DIV6(&div3_clk, SPUCLKCR, CLK_ENABLE_ON_INIT), | 171 | [DIV6_S] = SH_CLK_DIV6(&div3_clk, SPUCLKCR, CLK_ENABLE_ON_INIT), |
| 165 | }; | 172 | }; |
| 166 | 173 | ||
| 174 | enum { DIV6_FA, DIV6_FB, DIV6_REPARENT_NR }; | ||
| 175 | |||
| 176 | /* Indices are important - they are the actual src selecting values */ | ||
| 177 | static struct clk *fclkacr_parent[] = { | ||
| 178 | [0] = &div3_clk, | ||
| 179 | [1] = NULL, | ||
| 180 | [2] = &sh7724_fsimcka_clk, | ||
| 181 | [3] = NULL, | ||
| 182 | }; | ||
| 183 | |||
| 184 | static struct clk *fclkbcr_parent[] = { | ||
| 185 | [0] = &div3_clk, | ||
| 186 | [1] = NULL, | ||
| 187 | [2] = &sh7724_fsimckb_clk, | ||
| 188 | [3] = NULL, | ||
| 189 | }; | ||
| 190 | |||
| 191 | static struct clk div6_reparent_clks[DIV6_REPARENT_NR] = { | ||
| 192 | [DIV6_FA] = SH_CLK_DIV6_EXT(&div3_clk, FCLKACR, 0, | ||
| 193 | fclkacr_parent, ARRAY_SIZE(fclkacr_parent), 6, 2), | ||
| 194 | [DIV6_FB] = SH_CLK_DIV6_EXT(&div3_clk, FCLKBCR, 0, | ||
| 195 | fclkbcr_parent, ARRAY_SIZE(fclkbcr_parent), 6, 2), | ||
| 196 | }; | ||
| 197 | |||
| 167 | static struct clk mstp_clks[HWBLK_NR] = { | 198 | static struct clk mstp_clks[HWBLK_NR] = { |
| 168 | SH_HWBLK_CLK(HWBLK_TLB, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT), | 199 | SH_HWBLK_CLK(HWBLK_TLB, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT), |
| 169 | SH_HWBLK_CLK(HWBLK_IC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT), | 200 | SH_HWBLK_CLK(HWBLK_IC, &div4_clks[DIV4_I], CLK_ENABLE_ON_INIT), |
| @@ -240,8 +271,8 @@ static struct clk_lookup lookups[] = { | |||
| 240 | 271 | ||
| 241 | /* DIV6 clocks */ | 272 | /* DIV6 clocks */ |
| 242 | CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), | 273 | CLKDEV_CON_ID("video_clk", &div6_clks[DIV6_V]), |
| 243 | CLKDEV_CON_ID("fsia_clk", &div6_clks[DIV6_FA]), | 274 | CLKDEV_CON_ID("fsia_clk", &div6_reparent_clks[DIV6_FA]), |
| 244 | CLKDEV_CON_ID("fsib_clk", &div6_clks[DIV6_FB]), | 275 | CLKDEV_CON_ID("fsib_clk", &div6_reparent_clks[DIV6_FB]), |
| 245 | CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), | 276 | CLKDEV_CON_ID("irda_clk", &div6_clks[DIV6_I]), |
| 246 | CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), | 277 | CLKDEV_CON_ID("spu_clk", &div6_clks[DIV6_S]), |
| 247 | 278 | ||
| @@ -376,6 +407,9 @@ int __init arch_clk_init(void) | |||
| 376 | ret = sh_clk_div6_register(div6_clks, DIV6_NR); | 407 | ret = sh_clk_div6_register(div6_clks, DIV6_NR); |
| 377 | 408 | ||
| 378 | if (!ret) | 409 | if (!ret) |
| 410 | ret = sh_clk_div6_reparent_register(div6_reparent_clks, DIV6_REPARENT_NR); | ||
| 411 | |||
| 412 | if (!ret) | ||
| 379 | ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR); | 413 | ret = sh_hwblk_clk_register(mstp_clks, HWBLK_NR); |
| 380 | 414 | ||
| 381 | return ret; | 415 | return ret; |
diff --git a/arch/sh/mm/cache-sh4.c b/arch/sh/mm/cache-sh4.c index 2cfae81914aa..92eb98633ab0 100644 --- a/arch/sh/mm/cache-sh4.c +++ b/arch/sh/mm/cache-sh4.c | |||
| @@ -114,7 +114,7 @@ static void sh4_flush_dcache_page(void *arg) | |||
| 114 | struct address_space *mapping = page_mapping(page); | 114 | struct address_space *mapping = page_mapping(page); |
| 115 | 115 | ||
| 116 | if (mapping && !mapping_mapped(mapping)) | 116 | if (mapping && !mapping_mapped(mapping)) |
| 117 | set_bit(PG_dcache_dirty, &page->flags); | 117 | clear_bit(PG_dcache_clean, &page->flags); |
| 118 | else | 118 | else |
| 119 | #endif | 119 | #endif |
| 120 | flush_cache_one(CACHE_OC_ADDRESS_ARRAY | | 120 | flush_cache_one(CACHE_OC_ADDRESS_ARRAY | |
| @@ -239,7 +239,7 @@ static void sh4_flush_cache_page(void *args) | |||
| 239 | * another ASID than the current one. | 239 | * another ASID than the current one. |
| 240 | */ | 240 | */ |
| 241 | map_coherent = (current_cpu_data.dcache.n_aliases && | 241 | map_coherent = (current_cpu_data.dcache.n_aliases && |
| 242 | !test_bit(PG_dcache_dirty, &page->flags) && | 242 | test_bit(PG_dcache_clean, &page->flags) && |
| 243 | page_mapped(page)); | 243 | page_mapped(page)); |
| 244 | if (map_coherent) | 244 | if (map_coherent) |
| 245 | vaddr = kmap_coherent(page, address); | 245 | vaddr = kmap_coherent(page, address); |
diff --git a/arch/sh/mm/cache-sh7705.c b/arch/sh/mm/cache-sh7705.c index f498da1cce7a..7729cca727eb 100644 --- a/arch/sh/mm/cache-sh7705.c +++ b/arch/sh/mm/cache-sh7705.c | |||
| @@ -139,7 +139,7 @@ static void sh7705_flush_dcache_page(void *arg) | |||
| 139 | struct address_space *mapping = page_mapping(page); | 139 | struct address_space *mapping = page_mapping(page); |
| 140 | 140 | ||
| 141 | if (mapping && !mapping_mapped(mapping)) | 141 | if (mapping && !mapping_mapped(mapping)) |
| 142 | set_bit(PG_dcache_dirty, &page->flags); | 142 | clear_bit(PG_dcache_clean, &page->flags); |
| 143 | else | 143 | else |
| 144 | __flush_dcache_page(__pa(page_address(page))); | 144 | __flush_dcache_page(__pa(page_address(page))); |
| 145 | } | 145 | } |
diff --git a/arch/sh/mm/cache.c b/arch/sh/mm/cache.c index ba401d137bb9..88d3dc3d30d5 100644 --- a/arch/sh/mm/cache.c +++ b/arch/sh/mm/cache.c | |||
| @@ -60,14 +60,14 @@ void copy_to_user_page(struct vm_area_struct *vma, struct page *page, | |||
| 60 | unsigned long len) | 60 | unsigned long len) |
| 61 | { | 61 | { |
| 62 | if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && | 62 | if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && |
| 63 | !test_bit(PG_dcache_dirty, &page->flags)) { | 63 | test_bit(PG_dcache_clean, &page->flags)) { |
| 64 | void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | 64 | void *vto = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
| 65 | memcpy(vto, src, len); | 65 | memcpy(vto, src, len); |
| 66 | kunmap_coherent(vto); | 66 | kunmap_coherent(vto); |
| 67 | } else { | 67 | } else { |
| 68 | memcpy(dst, src, len); | 68 | memcpy(dst, src, len); |
| 69 | if (boot_cpu_data.dcache.n_aliases) | 69 | if (boot_cpu_data.dcache.n_aliases) |
| 70 | set_bit(PG_dcache_dirty, &page->flags); | 70 | clear_bit(PG_dcache_clean, &page->flags); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | if (vma->vm_flags & VM_EXEC) | 73 | if (vma->vm_flags & VM_EXEC) |
| @@ -79,14 +79,14 @@ void copy_from_user_page(struct vm_area_struct *vma, struct page *page, | |||
| 79 | unsigned long len) | 79 | unsigned long len) |
| 80 | { | 80 | { |
| 81 | if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && | 81 | if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && |
| 82 | !test_bit(PG_dcache_dirty, &page->flags)) { | 82 | test_bit(PG_dcache_clean, &page->flags)) { |
| 83 | void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); | 83 | void *vfrom = kmap_coherent(page, vaddr) + (vaddr & ~PAGE_MASK); |
| 84 | memcpy(dst, vfrom, len); | 84 | memcpy(dst, vfrom, len); |
| 85 | kunmap_coherent(vfrom); | 85 | kunmap_coherent(vfrom); |
| 86 | } else { | 86 | } else { |
| 87 | memcpy(dst, src, len); | 87 | memcpy(dst, src, len); |
| 88 | if (boot_cpu_data.dcache.n_aliases) | 88 | if (boot_cpu_data.dcache.n_aliases) |
| 89 | set_bit(PG_dcache_dirty, &page->flags); | 89 | clear_bit(PG_dcache_clean, &page->flags); |
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| 92 | 92 | ||
| @@ -98,7 +98,7 @@ void copy_user_highpage(struct page *to, struct page *from, | |||
| 98 | vto = kmap_atomic(to, KM_USER1); | 98 | vto = kmap_atomic(to, KM_USER1); |
| 99 | 99 | ||
| 100 | if (boot_cpu_data.dcache.n_aliases && page_mapped(from) && | 100 | if (boot_cpu_data.dcache.n_aliases && page_mapped(from) && |
| 101 | !test_bit(PG_dcache_dirty, &from->flags)) { | 101 | test_bit(PG_dcache_clean, &from->flags)) { |
| 102 | vfrom = kmap_coherent(from, vaddr); | 102 | vfrom = kmap_coherent(from, vaddr); |
| 103 | copy_page(vto, vfrom); | 103 | copy_page(vto, vfrom); |
| 104 | kunmap_coherent(vfrom); | 104 | kunmap_coherent(vfrom); |
| @@ -141,7 +141,7 @@ void __update_cache(struct vm_area_struct *vma, | |||
| 141 | 141 | ||
| 142 | page = pfn_to_page(pfn); | 142 | page = pfn_to_page(pfn); |
| 143 | if (pfn_valid(pfn)) { | 143 | if (pfn_valid(pfn)) { |
| 144 | int dirty = test_and_clear_bit(PG_dcache_dirty, &page->flags); | 144 | int dirty = !test_and_set_bit(PG_dcache_clean, &page->flags); |
| 145 | if (dirty) | 145 | if (dirty) |
| 146 | __flush_purge_region(page_address(page), PAGE_SIZE); | 146 | __flush_purge_region(page_address(page), PAGE_SIZE); |
| 147 | } | 147 | } |
| @@ -153,7 +153,7 @@ void __flush_anon_page(struct page *page, unsigned long vmaddr) | |||
| 153 | 153 | ||
| 154 | if (pages_do_alias(addr, vmaddr)) { | 154 | if (pages_do_alias(addr, vmaddr)) { |
| 155 | if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && | 155 | if (boot_cpu_data.dcache.n_aliases && page_mapped(page) && |
| 156 | !test_bit(PG_dcache_dirty, &page->flags)) { | 156 | test_bit(PG_dcache_clean, &page->flags)) { |
| 157 | void *kaddr; | 157 | void *kaddr; |
| 158 | 158 | ||
| 159 | kaddr = kmap_coherent(page, vmaddr); | 159 | kaddr = kmap_coherent(page, vmaddr); |
diff --git a/arch/sh/mm/kmap.c b/arch/sh/mm/kmap.c index 15d74ea42094..ec29e14ec5a8 100644 --- a/arch/sh/mm/kmap.c +++ b/arch/sh/mm/kmap.c | |||
| @@ -34,7 +34,7 @@ void *kmap_coherent(struct page *page, unsigned long addr) | |||
| 34 | enum fixed_addresses idx; | 34 | enum fixed_addresses idx; |
| 35 | unsigned long vaddr; | 35 | unsigned long vaddr; |
| 36 | 36 | ||
| 37 | BUG_ON(test_bit(PG_dcache_dirty, &page->flags)); | 37 | BUG_ON(!test_bit(PG_dcache_clean, &page->flags)); |
| 38 | 38 | ||
| 39 | pagefault_disable(); | 39 | pagefault_disable(); |
| 40 | 40 | ||
diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h index 7f7e577a0e39..31d84acc1512 100644 --- a/arch/x86/include/asm/pvclock.h +++ b/arch/x86/include/asm/pvclock.h | |||
| @@ -11,6 +11,7 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src); | |||
| 11 | void pvclock_read_wallclock(struct pvclock_wall_clock *wall, | 11 | void pvclock_read_wallclock(struct pvclock_wall_clock *wall, |
| 12 | struct pvclock_vcpu_time_info *vcpu, | 12 | struct pvclock_vcpu_time_info *vcpu, |
| 13 | struct timespec *ts); | 13 | struct timespec *ts); |
| 14 | void pvclock_resume(void); | ||
| 14 | 15 | ||
| 15 | /* | 16 | /* |
| 16 | * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction, | 17 | * Scale a 64-bit delta by scaling and multiplying by a 32-bit fraction, |
diff --git a/arch/x86/kernel/pvclock.c b/arch/x86/kernel/pvclock.c index 008b91eefa18..42eb3300dfc6 100644 --- a/arch/x86/kernel/pvclock.c +++ b/arch/x86/kernel/pvclock.c | |||
| @@ -83,6 +83,11 @@ unsigned long pvclock_tsc_khz(struct pvclock_vcpu_time_info *src) | |||
| 83 | 83 | ||
| 84 | static atomic64_t last_value = ATOMIC64_INIT(0); | 84 | static atomic64_t last_value = ATOMIC64_INIT(0); |
| 85 | 85 | ||
| 86 | void pvclock_resume(void) | ||
| 87 | { | ||
| 88 | atomic64_set(&last_value, 0); | ||
| 89 | } | ||
| 90 | |||
| 86 | cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) | 91 | cycle_t pvclock_clocksource_read(struct pvclock_vcpu_time_info *src) |
| 87 | { | 92 | { |
| 88 | struct pvclock_shadow_time shadow; | 93 | struct pvclock_shadow_time shadow; |
diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c index d7b5109f7a9c..25cd4a07d09f 100644 --- a/arch/x86/pci/xen.c +++ b/arch/x86/pci/xen.c | |||
| @@ -70,6 +70,9 @@ static int acpi_register_gsi_xen_hvm(struct device *dev, u32 gsi, | |||
| 70 | struct xen_pci_frontend_ops *xen_pci_frontend; | 70 | struct xen_pci_frontend_ops *xen_pci_frontend; |
| 71 | EXPORT_SYMBOL_GPL(xen_pci_frontend); | 71 | EXPORT_SYMBOL_GPL(xen_pci_frontend); |
| 72 | 72 | ||
| 73 | #define XEN_PIRQ_MSI_DATA (MSI_DATA_TRIGGER_EDGE | \ | ||
| 74 | MSI_DATA_LEVEL_ASSERT | (3 << 8) | MSI_DATA_VECTOR(0)) | ||
| 75 | |||
| 73 | static void xen_msi_compose_msg(struct pci_dev *pdev, unsigned int pirq, | 76 | static void xen_msi_compose_msg(struct pci_dev *pdev, unsigned int pirq, |
| 74 | struct msi_msg *msg) | 77 | struct msi_msg *msg) |
| 75 | { | 78 | { |
| @@ -83,12 +86,7 @@ static void xen_msi_compose_msg(struct pci_dev *pdev, unsigned int pirq, | |||
| 83 | MSI_ADDR_REDIRECTION_CPU | | 86 | MSI_ADDR_REDIRECTION_CPU | |
| 84 | MSI_ADDR_DEST_ID(pirq); | 87 | MSI_ADDR_DEST_ID(pirq); |
| 85 | 88 | ||
| 86 | msg->data = | 89 | msg->data = XEN_PIRQ_MSI_DATA; |
| 87 | MSI_DATA_TRIGGER_EDGE | | ||
| 88 | MSI_DATA_LEVEL_ASSERT | | ||
| 89 | /* delivery mode reserved */ | ||
| 90 | (3 << 8) | | ||
| 91 | MSI_DATA_VECTOR(0); | ||
| 92 | } | 90 | } |
| 93 | 91 | ||
| 94 | static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | 92 | static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) |
| @@ -98,8 +96,23 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) | |||
| 98 | struct msi_msg msg; | 96 | struct msi_msg msg; |
| 99 | 97 | ||
| 100 | list_for_each_entry(msidesc, &dev->msi_list, list) { | 98 | list_for_each_entry(msidesc, &dev->msi_list, list) { |
| 99 | __read_msi_msg(msidesc, &msg); | ||
| 100 | pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) | | ||
| 101 | ((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff); | ||
| 102 | if (xen_irq_from_pirq(pirq) >= 0 && msg.data == XEN_PIRQ_MSI_DATA) { | ||
| 103 | xen_allocate_pirq_msi((type == PCI_CAP_ID_MSIX) ? | ||
| 104 | "msi-x" : "msi", &irq, &pirq, XEN_ALLOC_IRQ); | ||
| 105 | if (irq < 0) | ||
| 106 | goto error; | ||
| 107 | ret = set_irq_msi(irq, msidesc); | ||
| 108 | if (ret < 0) | ||
| 109 | goto error_while; | ||
| 110 | printk(KERN_DEBUG "xen: msi already setup: msi --> irq=%d" | ||
| 111 | " pirq=%d\n", irq, pirq); | ||
| 112 | return 0; | ||
| 113 | } | ||
| 101 | xen_allocate_pirq_msi((type == PCI_CAP_ID_MSIX) ? | 114 | xen_allocate_pirq_msi((type == PCI_CAP_ID_MSIX) ? |
| 102 | "msi-x" : "msi", &irq, &pirq); | 115 | "msi-x" : "msi", &irq, &pirq, (XEN_ALLOC_IRQ | XEN_ALLOC_PIRQ)); |
| 103 | if (irq < 0 || pirq < 0) | 116 | if (irq < 0 || pirq < 0) |
| 104 | goto error; | 117 | goto error; |
| 105 | printk(KERN_DEBUG "xen: msi --> irq=%d, pirq=%d\n", irq, pirq); | 118 | printk(KERN_DEBUG "xen: msi --> irq=%d, pirq=%d\n", irq, pirq); |
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index 02c710bebf7a..44dcad43989d 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
| @@ -1021,10 +1021,6 @@ static void xen_reboot(int reason) | |||
| 1021 | { | 1021 | { |
| 1022 | struct sched_shutdown r = { .reason = reason }; | 1022 | struct sched_shutdown r = { .reason = reason }; |
| 1023 | 1023 | ||
| 1024 | #ifdef CONFIG_SMP | ||
| 1025 | stop_other_cpus(); | ||
| 1026 | #endif | ||
| 1027 | |||
| 1028 | if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) | 1024 | if (HYPERVISOR_sched_op(SCHEDOP_shutdown, &r)) |
| 1029 | BUG(); | 1025 | BUG(); |
| 1030 | } | 1026 | } |
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index a1feff9e59b6..44924e551fde 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c | |||
| @@ -2415,8 +2415,6 @@ void __init xen_init_mmu_ops(void) | |||
| 2415 | x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done; | 2415 | x86_init.paging.pagetable_setup_done = xen_pagetable_setup_done; |
| 2416 | pv_mmu_ops = xen_mmu_ops; | 2416 | pv_mmu_ops = xen_mmu_ops; |
| 2417 | 2417 | ||
| 2418 | vmap_lazy_unmap = false; | ||
| 2419 | |||
| 2420 | memset(dummy_mapping, 0xff, PAGE_SIZE); | 2418 | memset(dummy_mapping, 0xff, PAGE_SIZE); |
| 2421 | } | 2419 | } |
| 2422 | 2420 | ||
diff --git a/arch/x86/xen/platform-pci-unplug.c b/arch/x86/xen/platform-pci-unplug.c index 0f456386cce5..25c52f94a27c 100644 --- a/arch/x86/xen/platform-pci-unplug.c +++ b/arch/x86/xen/platform-pci-unplug.c | |||
| @@ -68,7 +68,7 @@ static int __init check_platform_magic(void) | |||
| 68 | return 0; | 68 | return 0; |
| 69 | } | 69 | } |
| 70 | 70 | ||
| 71 | void __init xen_unplug_emulated_devices(void) | 71 | void xen_unplug_emulated_devices(void) |
| 72 | { | 72 | { |
| 73 | int r; | 73 | int r; |
| 74 | 74 | ||
diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c index 01afd8a94607..b5a7f928234b 100644 --- a/arch/x86/xen/setup.c +++ b/arch/x86/xen/setup.c | |||
| @@ -181,24 +181,21 @@ char * __init xen_memory_setup(void) | |||
| 181 | for (i = 0; i < memmap.nr_entries; i++) { | 181 | for (i = 0; i < memmap.nr_entries; i++) { |
| 182 | unsigned long long end = map[i].addr + map[i].size; | 182 | unsigned long long end = map[i].addr + map[i].size; |
| 183 | 183 | ||
| 184 | if (map[i].type == E820_RAM) { | 184 | if (map[i].type == E820_RAM && end > mem_end) { |
| 185 | if (map[i].addr < mem_end && end > mem_end) { | 185 | /* RAM off the end - may be partially included */ |
| 186 | /* Truncate region to max_mem. */ | 186 | u64 delta = min(map[i].size, end - mem_end); |
| 187 | u64 delta = end - mem_end; | ||
| 188 | 187 | ||
| 189 | map[i].size -= delta; | 188 | map[i].size -= delta; |
| 190 | extra_pages += PFN_DOWN(delta); | 189 | end -= delta; |
| 191 | 190 | ||
| 192 | end = mem_end; | 191 | extra_pages += PFN_DOWN(delta); |
| 193 | } | ||
| 194 | } | 192 | } |
| 195 | 193 | ||
| 196 | if (end > xen_extra_mem_start) | 194 | if (map[i].size > 0 && end > xen_extra_mem_start) |
| 197 | xen_extra_mem_start = end; | 195 | xen_extra_mem_start = end; |
| 198 | 196 | ||
| 199 | /* If region is non-RAM or below mem_end, add what remains */ | 197 | /* Add region if any remains */ |
| 200 | if ((map[i].type != E820_RAM || map[i].addr < mem_end) && | 198 | if (map[i].size > 0) |
| 201 | map[i].size > 0) | ||
| 202 | e820_add_region(map[i].addr, map[i].size, map[i].type); | 199 | e820_add_region(map[i].addr, map[i].size, map[i].type); |
| 203 | } | 200 | } |
| 204 | 201 | ||
| @@ -252,20 +249,6 @@ char * __init xen_memory_setup(void) | |||
| 252 | return "Xen"; | 249 | return "Xen"; |
| 253 | } | 250 | } |
| 254 | 251 | ||
| 255 | static void xen_idle(void) | ||
| 256 | { | ||
| 257 | local_irq_disable(); | ||
| 258 | |||
| 259 | if (need_resched()) | ||
| 260 | local_irq_enable(); | ||
| 261 | else { | ||
| 262 | current_thread_info()->status &= ~TS_POLLING; | ||
| 263 | smp_mb__after_clear_bit(); | ||
| 264 | safe_halt(); | ||
| 265 | current_thread_info()->status |= TS_POLLING; | ||
| 266 | } | ||
| 267 | } | ||
| 268 | |||
| 269 | /* | 252 | /* |
| 270 | * Set the bit indicating "nosegneg" library variants should be used. | 253 | * Set the bit indicating "nosegneg" library variants should be used. |
| 271 | * We only need to bother in pure 32-bit mode; compat 32-bit processes | 254 | * We only need to bother in pure 32-bit mode; compat 32-bit processes |
| @@ -362,7 +345,11 @@ void __init xen_arch_setup(void) | |||
| 362 | MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ? | 345 | MAX_GUEST_CMDLINE > COMMAND_LINE_SIZE ? |
| 363 | COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE); | 346 | COMMAND_LINE_SIZE : MAX_GUEST_CMDLINE); |
| 364 | 347 | ||
| 365 | pm_idle = xen_idle; | 348 | /* Set up idle, making sure it calls safe_halt() pvop */ |
| 349 | #ifdef CONFIG_X86_32 | ||
| 350 | boot_cpu_data.hlt_works_ok = 1; | ||
| 351 | #endif | ||
| 352 | pm_idle = default_idle; | ||
| 366 | 353 | ||
| 367 | fiddle_vdso(); | 354 | fiddle_vdso(); |
| 368 | } | 355 | } |
diff --git a/arch/x86/xen/suspend.c b/arch/x86/xen/suspend.c index 1d789d56877c..9bbd63a129b5 100644 --- a/arch/x86/xen/suspend.c +++ b/arch/x86/xen/suspend.c | |||
| @@ -31,6 +31,7 @@ void xen_hvm_post_suspend(int suspend_cancelled) | |||
| 31 | int cpu; | 31 | int cpu; |
| 32 | xen_hvm_init_shared_info(); | 32 | xen_hvm_init_shared_info(); |
| 33 | xen_callback_vector(); | 33 | xen_callback_vector(); |
| 34 | xen_unplug_emulated_devices(); | ||
| 34 | if (xen_feature(XENFEAT_hvm_safe_pvclock)) { | 35 | if (xen_feature(XENFEAT_hvm_safe_pvclock)) { |
| 35 | for_each_online_cpu(cpu) { | 36 | for_each_online_cpu(cpu) { |
| 36 | xen_setup_runstate_info(cpu); | 37 | xen_setup_runstate_info(cpu); |
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index b2bb5aa3b054..5da5e53fb94c 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
| @@ -426,6 +426,8 @@ void xen_timer_resume(void) | |||
| 426 | { | 426 | { |
| 427 | int cpu; | 427 | int cpu; |
| 428 | 428 | ||
| 429 | pvclock_resume(); | ||
| 430 | |||
| 429 | if (xen_clockevent != &xen_vcpuop_clockevent) | 431 | if (xen_clockevent != &xen_vcpuop_clockevent) |
| 430 | return; | 432 | return; |
| 431 | 433 | ||
diff --git a/arch/x86/xen/xen-ops.h b/arch/x86/xen/xen-ops.h index 64044747348e..9d41bf985757 100644 --- a/arch/x86/xen/xen-ops.h +++ b/arch/x86/xen/xen-ops.h | |||
| @@ -43,7 +43,7 @@ void xen_vcpu_restore(void); | |||
| 43 | 43 | ||
| 44 | void xen_callback_vector(void); | 44 | void xen_callback_vector(void); |
| 45 | void xen_hvm_init_shared_info(void); | 45 | void xen_hvm_init_shared_info(void); |
| 46 | void __init xen_unplug_emulated_devices(void); | 46 | void xen_unplug_emulated_devices(void); |
| 47 | 47 | ||
| 48 | void __init xen_build_dynamic_phys_to_machine(void); | 48 | void __init xen_build_dynamic_phys_to_machine(void); |
| 49 | 49 | ||
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index ba9afeaa23ac..25d3aaebc10d 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
| @@ -100,24 +100,7 @@ static const struct file_operations acpi_ac_fops = { | |||
| 100 | .release = single_release, | 100 | .release = single_release, |
| 101 | }; | 101 | }; |
| 102 | #endif | 102 | #endif |
| 103 | static int get_ac_property(struct power_supply *psy, | ||
| 104 | enum power_supply_property psp, | ||
| 105 | union power_supply_propval *val) | ||
| 106 | { | ||
| 107 | struct acpi_ac *ac = to_acpi_ac(psy); | ||
| 108 | switch (psp) { | ||
| 109 | case POWER_SUPPLY_PROP_ONLINE: | ||
| 110 | val->intval = ac->state; | ||
| 111 | break; | ||
| 112 | default: | ||
| 113 | return -EINVAL; | ||
| 114 | } | ||
| 115 | return 0; | ||
| 116 | } | ||
| 117 | 103 | ||
| 118 | static enum power_supply_property ac_props[] = { | ||
| 119 | POWER_SUPPLY_PROP_ONLINE, | ||
| 120 | }; | ||
| 121 | /* -------------------------------------------------------------------------- | 104 | /* -------------------------------------------------------------------------- |
| 122 | AC Adapter Management | 105 | AC Adapter Management |
| 123 | -------------------------------------------------------------------------- */ | 106 | -------------------------------------------------------------------------- */ |
| @@ -140,6 +123,35 @@ static int acpi_ac_get_state(struct acpi_ac *ac) | |||
| 140 | return 0; | 123 | return 0; |
| 141 | } | 124 | } |
| 142 | 125 | ||
| 126 | /* -------------------------------------------------------------------------- | ||
| 127 | sysfs I/F | ||
| 128 | -------------------------------------------------------------------------- */ | ||
| 129 | static int get_ac_property(struct power_supply *psy, | ||
| 130 | enum power_supply_property psp, | ||
| 131 | union power_supply_propval *val) | ||
| 132 | { | ||
| 133 | struct acpi_ac *ac = to_acpi_ac(psy); | ||
| 134 | |||
| 135 | if (!ac) | ||
| 136 | return -ENODEV; | ||
| 137 | |||
| 138 | if (acpi_ac_get_state(ac)) | ||
| 139 | return -ENODEV; | ||
| 140 | |||
| 141 | switch (psp) { | ||
| 142 | case POWER_SUPPLY_PROP_ONLINE: | ||
| 143 | val->intval = ac->state; | ||
| 144 | break; | ||
| 145 | default: | ||
| 146 | return -EINVAL; | ||
| 147 | } | ||
| 148 | return 0; | ||
| 149 | } | ||
| 150 | |||
| 151 | static enum power_supply_property ac_props[] = { | ||
| 152 | POWER_SUPPLY_PROP_ONLINE, | ||
| 153 | }; | ||
| 154 | |||
| 143 | #ifdef CONFIG_ACPI_PROCFS_POWER | 155 | #ifdef CONFIG_ACPI_PROCFS_POWER |
| 144 | /* -------------------------------------------------------------------------- | 156 | /* -------------------------------------------------------------------------- |
| 145 | FS Interface (/proc) | 157 | FS Interface (/proc) |
diff --git a/drivers/acpi/apei/erst.c b/drivers/acpi/apei/erst.c index 1211c03149e8..5850d320404c 100644 --- a/drivers/acpi/apei/erst.c +++ b/drivers/acpi/apei/erst.c | |||
| @@ -86,7 +86,7 @@ static struct erst_erange { | |||
| 86 | * It is used to provide exclusive accessing for ERST Error Log | 86 | * It is used to provide exclusive accessing for ERST Error Log |
| 87 | * Address Range too. | 87 | * Address Range too. |
| 88 | */ | 88 | */ |
| 89 | static DEFINE_SPINLOCK(erst_lock); | 89 | static DEFINE_RAW_SPINLOCK(erst_lock); |
| 90 | 90 | ||
| 91 | static inline int erst_errno(int command_status) | 91 | static inline int erst_errno(int command_status) |
| 92 | { | 92 | { |
| @@ -421,9 +421,9 @@ ssize_t erst_get_record_count(void) | |||
| 421 | if (erst_disable) | 421 | if (erst_disable) |
| 422 | return -ENODEV; | 422 | return -ENODEV; |
| 423 | 423 | ||
| 424 | spin_lock_irqsave(&erst_lock, flags); | 424 | raw_spin_lock_irqsave(&erst_lock, flags); |
| 425 | count = __erst_get_record_count(); | 425 | count = __erst_get_record_count(); |
| 426 | spin_unlock_irqrestore(&erst_lock, flags); | 426 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 427 | 427 | ||
| 428 | return count; | 428 | return count; |
| 429 | } | 429 | } |
| @@ -456,9 +456,9 @@ int erst_get_next_record_id(u64 *record_id) | |||
| 456 | if (erst_disable) | 456 | if (erst_disable) |
| 457 | return -ENODEV; | 457 | return -ENODEV; |
| 458 | 458 | ||
| 459 | spin_lock_irqsave(&erst_lock, flags); | 459 | raw_spin_lock_irqsave(&erst_lock, flags); |
| 460 | rc = __erst_get_next_record_id(record_id); | 460 | rc = __erst_get_next_record_id(record_id); |
| 461 | spin_unlock_irqrestore(&erst_lock, flags); | 461 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 462 | 462 | ||
| 463 | return rc; | 463 | return rc; |
| 464 | } | 464 | } |
| @@ -624,17 +624,17 @@ int erst_write(const struct cper_record_header *record) | |||
| 624 | return -EINVAL; | 624 | return -EINVAL; |
| 625 | 625 | ||
| 626 | if (erst_erange.attr & ERST_RANGE_NVRAM) { | 626 | if (erst_erange.attr & ERST_RANGE_NVRAM) { |
| 627 | if (!spin_trylock_irqsave(&erst_lock, flags)) | 627 | if (!raw_spin_trylock_irqsave(&erst_lock, flags)) |
| 628 | return -EBUSY; | 628 | return -EBUSY; |
| 629 | rc = __erst_write_to_nvram(record); | 629 | rc = __erst_write_to_nvram(record); |
| 630 | spin_unlock_irqrestore(&erst_lock, flags); | 630 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 631 | return rc; | 631 | return rc; |
| 632 | } | 632 | } |
| 633 | 633 | ||
| 634 | if (record->record_length > erst_erange.size) | 634 | if (record->record_length > erst_erange.size) |
| 635 | return -EINVAL; | 635 | return -EINVAL; |
| 636 | 636 | ||
| 637 | if (!spin_trylock_irqsave(&erst_lock, flags)) | 637 | if (!raw_spin_trylock_irqsave(&erst_lock, flags)) |
| 638 | return -EBUSY; | 638 | return -EBUSY; |
| 639 | memcpy(erst_erange.vaddr, record, record->record_length); | 639 | memcpy(erst_erange.vaddr, record, record->record_length); |
| 640 | rcd_erange = erst_erange.vaddr; | 640 | rcd_erange = erst_erange.vaddr; |
| @@ -642,7 +642,7 @@ int erst_write(const struct cper_record_header *record) | |||
| 642 | memcpy(&rcd_erange->persistence_information, "ER", 2); | 642 | memcpy(&rcd_erange->persistence_information, "ER", 2); |
| 643 | 643 | ||
| 644 | rc = __erst_write_to_storage(0); | 644 | rc = __erst_write_to_storage(0); |
| 645 | spin_unlock_irqrestore(&erst_lock, flags); | 645 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 646 | 646 | ||
| 647 | return rc; | 647 | return rc; |
| 648 | } | 648 | } |
| @@ -696,9 +696,9 @@ ssize_t erst_read(u64 record_id, struct cper_record_header *record, | |||
| 696 | if (erst_disable) | 696 | if (erst_disable) |
| 697 | return -ENODEV; | 697 | return -ENODEV; |
| 698 | 698 | ||
| 699 | spin_lock_irqsave(&erst_lock, flags); | 699 | raw_spin_lock_irqsave(&erst_lock, flags); |
| 700 | len = __erst_read(record_id, record, buflen); | 700 | len = __erst_read(record_id, record, buflen); |
| 701 | spin_unlock_irqrestore(&erst_lock, flags); | 701 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 702 | return len; | 702 | return len; |
| 703 | } | 703 | } |
| 704 | EXPORT_SYMBOL_GPL(erst_read); | 704 | EXPORT_SYMBOL_GPL(erst_read); |
| @@ -719,20 +719,20 @@ ssize_t erst_read_next(struct cper_record_header *record, size_t buflen) | |||
| 719 | if (erst_disable) | 719 | if (erst_disable) |
| 720 | return -ENODEV; | 720 | return -ENODEV; |
| 721 | 721 | ||
| 722 | spin_lock_irqsave(&erst_lock, flags); | 722 | raw_spin_lock_irqsave(&erst_lock, flags); |
| 723 | rc = __erst_get_next_record_id(&record_id); | 723 | rc = __erst_get_next_record_id(&record_id); |
| 724 | if (rc) { | 724 | if (rc) { |
| 725 | spin_unlock_irqrestore(&erst_lock, flags); | 725 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 726 | return rc; | 726 | return rc; |
| 727 | } | 727 | } |
| 728 | /* no more record */ | 728 | /* no more record */ |
| 729 | if (record_id == APEI_ERST_INVALID_RECORD_ID) { | 729 | if (record_id == APEI_ERST_INVALID_RECORD_ID) { |
| 730 | spin_unlock_irqrestore(&erst_lock, flags); | 730 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 731 | return 0; | 731 | return 0; |
| 732 | } | 732 | } |
| 733 | 733 | ||
| 734 | len = __erst_read(record_id, record, buflen); | 734 | len = __erst_read(record_id, record, buflen); |
| 735 | spin_unlock_irqrestore(&erst_lock, flags); | 735 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 736 | 736 | ||
| 737 | return len; | 737 | return len; |
| 738 | } | 738 | } |
| @@ -746,12 +746,12 @@ int erst_clear(u64 record_id) | |||
| 746 | if (erst_disable) | 746 | if (erst_disable) |
| 747 | return -ENODEV; | 747 | return -ENODEV; |
| 748 | 748 | ||
| 749 | spin_lock_irqsave(&erst_lock, flags); | 749 | raw_spin_lock_irqsave(&erst_lock, flags); |
| 750 | if (erst_erange.attr & ERST_RANGE_NVRAM) | 750 | if (erst_erange.attr & ERST_RANGE_NVRAM) |
| 751 | rc = __erst_clear_from_nvram(record_id); | 751 | rc = __erst_clear_from_nvram(record_id); |
| 752 | else | 752 | else |
| 753 | rc = __erst_clear_from_storage(record_id); | 753 | rc = __erst_clear_from_storage(record_id); |
| 754 | spin_unlock_irqrestore(&erst_lock, flags); | 754 | raw_spin_unlock_irqrestore(&erst_lock, flags); |
| 755 | 755 | ||
| 756 | return rc; | 756 | return rc; |
| 757 | } | 757 | } |
diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c index 1a3508a7fe03..daa7bc63f1d4 100644 --- a/drivers/acpi/apei/hest.c +++ b/drivers/acpi/apei/hest.c | |||
| @@ -46,9 +46,9 @@ EXPORT_SYMBOL_GPL(hest_disable); | |||
| 46 | 46 | ||
| 47 | /* HEST table parsing */ | 47 | /* HEST table parsing */ |
| 48 | 48 | ||
| 49 | static struct acpi_table_hest *hest_tab; | 49 | static struct acpi_table_hest *__read_mostly hest_tab; |
| 50 | 50 | ||
| 51 | static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = { | 51 | static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = { |
| 52 | [ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */ | 52 | [ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */ |
| 53 | [ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1, | 53 | [ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1, |
| 54 | [ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi), | 54 | [ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi), |
| @@ -126,7 +126,7 @@ struct ghes_arr { | |||
| 126 | unsigned int count; | 126 | unsigned int count; |
| 127 | }; | 127 | }; |
| 128 | 128 | ||
| 129 | static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) | 129 | static int __init hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) |
| 130 | { | 130 | { |
| 131 | int *count = data; | 131 | int *count = data; |
| 132 | 132 | ||
| @@ -135,7 +135,7 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data) | |||
| 135 | return 0; | 135 | return 0; |
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) | 138 | static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data) |
| 139 | { | 139 | { |
| 140 | struct platform_device *ghes_dev; | 140 | struct platform_device *ghes_dev; |
| 141 | struct ghes_arr *ghes_arr = data; | 141 | struct ghes_arr *ghes_arr = data; |
| @@ -165,7 +165,7 @@ err: | |||
| 165 | return rc; | 165 | return rc; |
| 166 | } | 166 | } |
| 167 | 167 | ||
| 168 | static int hest_ghes_dev_register(unsigned int ghes_count) | 168 | static int __init hest_ghes_dev_register(unsigned int ghes_count) |
| 169 | { | 169 | { |
| 170 | int rc, i; | 170 | int rc, i; |
| 171 | struct ghes_arr ghes_arr; | 171 | struct ghes_arr ghes_arr; |
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 95649d373071..9fb9d5ac939d 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
| @@ -130,6 +130,8 @@ struct acpi_battery { | |||
| 130 | unsigned long flags; | 130 | unsigned long flags; |
| 131 | }; | 131 | }; |
| 132 | 132 | ||
| 133 | static int acpi_battery_update(struct acpi_battery *battery); | ||
| 134 | |||
| 133 | #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat); | 135 | #define to_acpi_battery(x) container_of(x, struct acpi_battery, bat); |
| 134 | 136 | ||
| 135 | inline int acpi_battery_present(struct acpi_battery *battery) | 137 | inline int acpi_battery_present(struct acpi_battery *battery) |
| @@ -184,6 +186,9 @@ static int acpi_battery_get_property(struct power_supply *psy, | |||
| 184 | int ret = 0; | 186 | int ret = 0; |
| 185 | struct acpi_battery *battery = to_acpi_battery(psy); | 187 | struct acpi_battery *battery = to_acpi_battery(psy); |
| 186 | 188 | ||
| 189 | if (acpi_battery_update(battery)) | ||
| 190 | return -ENODEV; | ||
| 191 | |||
| 187 | if (acpi_battery_present(battery)) { | 192 | if (acpi_battery_present(battery)) { |
| 188 | /* run battery update only if it is present */ | 193 | /* run battery update only if it is present */ |
| 189 | acpi_battery_get_state(battery); | 194 | acpi_battery_get_state(battery); |
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 372ff80b7b0c..302b31ed31f1 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c | |||
| @@ -934,6 +934,9 @@ static struct dmi_system_id __initdata ec_dmi_table[] = { | |||
| 934 | ec_flag_msi, "MSI hardware", { | 934 | ec_flag_msi, "MSI hardware", { |
| 935 | DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL}, | 935 | DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL}, |
| 936 | { | 936 | { |
| 937 | ec_flag_msi, "MSI hardware", { | ||
| 938 | DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL}, | ||
| 939 | { | ||
| 937 | ec_validate_ecdt, "ASUS hardware", { | 940 | ec_validate_ecdt, "ASUS hardware", { |
| 938 | DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, | 941 | DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL}, |
| 939 | {}, | 942 | {}, |
diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index 966feddf6b1b..055d7b701fff 100644 --- a/drivers/acpi/osl.c +++ b/drivers/acpi/osl.c | |||
| @@ -110,9 +110,6 @@ struct acpi_ioremap { | |||
| 110 | static LIST_HEAD(acpi_ioremaps); | 110 | static LIST_HEAD(acpi_ioremaps); |
| 111 | static DEFINE_SPINLOCK(acpi_ioremap_lock); | 111 | static DEFINE_SPINLOCK(acpi_ioremap_lock); |
| 112 | 112 | ||
| 113 | #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ | ||
| 114 | static char osi_setup_string[OSI_STRING_LENGTH_MAX]; | ||
| 115 | |||
| 116 | static void __init acpi_osi_setup_late(void); | 113 | static void __init acpi_osi_setup_late(void); |
| 117 | 114 | ||
| 118 | /* | 115 | /* |
| @@ -152,8 +149,7 @@ static struct osi_linux { | |||
| 152 | unsigned int enable:1; | 149 | unsigned int enable:1; |
| 153 | unsigned int dmi:1; | 150 | unsigned int dmi:1; |
| 154 | unsigned int cmdline:1; | 151 | unsigned int cmdline:1; |
| 155 | unsigned int known:1; | 152 | } osi_linux = {0, 0, 0}; |
| 156 | } osi_linux = { 0, 0, 0, 0}; | ||
| 157 | 153 | ||
| 158 | static u32 acpi_osi_handler(acpi_string interface, u32 supported) | 154 | static u32 acpi_osi_handler(acpi_string interface, u32 supported) |
| 159 | { | 155 | { |
| @@ -1055,13 +1051,53 @@ static int __init acpi_os_name_setup(char *str) | |||
| 1055 | 1051 | ||
| 1056 | __setup("acpi_os_name=", acpi_os_name_setup); | 1052 | __setup("acpi_os_name=", acpi_os_name_setup); |
| 1057 | 1053 | ||
| 1054 | #define OSI_STRING_LENGTH_MAX 64 /* arbitrary */ | ||
| 1055 | #define OSI_STRING_ENTRIES_MAX 16 /* arbitrary */ | ||
| 1056 | |||
| 1057 | struct osi_setup_entry { | ||
| 1058 | char string[OSI_STRING_LENGTH_MAX]; | ||
| 1059 | bool enable; | ||
| 1060 | }; | ||
| 1061 | |||
| 1062 | static struct osi_setup_entry __initdata osi_setup_entries[OSI_STRING_ENTRIES_MAX]; | ||
| 1063 | |||
| 1064 | void __init acpi_osi_setup(char *str) | ||
| 1065 | { | ||
| 1066 | struct osi_setup_entry *osi; | ||
| 1067 | bool enable = true; | ||
| 1068 | int i; | ||
| 1069 | |||
| 1070 | if (!acpi_gbl_create_osi_method) | ||
| 1071 | return; | ||
| 1072 | |||
| 1073 | if (str == NULL || *str == '\0') { | ||
| 1074 | printk(KERN_INFO PREFIX "_OSI method disabled\n"); | ||
| 1075 | acpi_gbl_create_osi_method = FALSE; | ||
| 1076 | return; | ||
| 1077 | } | ||
| 1078 | |||
| 1079 | if (*str == '!') { | ||
| 1080 | str++; | ||
| 1081 | enable = false; | ||
| 1082 | } | ||
| 1083 | |||
| 1084 | for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) { | ||
| 1085 | osi = &osi_setup_entries[i]; | ||
| 1086 | if (!strcmp(osi->string, str)) { | ||
| 1087 | osi->enable = enable; | ||
| 1088 | break; | ||
| 1089 | } else if (osi->string[0] == '\0') { | ||
| 1090 | osi->enable = enable; | ||
| 1091 | strncpy(osi->string, str, OSI_STRING_LENGTH_MAX); | ||
| 1092 | break; | ||
| 1093 | } | ||
| 1094 | } | ||
| 1095 | } | ||
| 1096 | |||
| 1058 | static void __init set_osi_linux(unsigned int enable) | 1097 | static void __init set_osi_linux(unsigned int enable) |
| 1059 | { | 1098 | { |
| 1060 | if (osi_linux.enable != enable) { | 1099 | if (osi_linux.enable != enable) |
| 1061 | osi_linux.enable = enable; | 1100 | osi_linux.enable = enable; |
| 1062 | printk(KERN_NOTICE PREFIX "%sed _OSI(Linux)\n", | ||
| 1063 | enable ? "Add": "Delet"); | ||
| 1064 | } | ||
| 1065 | 1101 | ||
| 1066 | if (osi_linux.enable) | 1102 | if (osi_linux.enable) |
| 1067 | acpi_osi_setup("Linux"); | 1103 | acpi_osi_setup("Linux"); |
| @@ -1073,7 +1109,8 @@ static void __init set_osi_linux(unsigned int enable) | |||
| 1073 | 1109 | ||
| 1074 | static void __init acpi_cmdline_osi_linux(unsigned int enable) | 1110 | static void __init acpi_cmdline_osi_linux(unsigned int enable) |
| 1075 | { | 1111 | { |
| 1076 | osi_linux.cmdline = 1; /* cmdline set the default */ | 1112 | osi_linux.cmdline = 1; /* cmdline set the default and override DMI */ |
| 1113 | osi_linux.dmi = 0; | ||
| 1077 | set_osi_linux(enable); | 1114 | set_osi_linux(enable); |
| 1078 | 1115 | ||
| 1079 | return; | 1116 | return; |
| @@ -1081,15 +1118,12 @@ static void __init acpi_cmdline_osi_linux(unsigned int enable) | |||
| 1081 | 1118 | ||
| 1082 | void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) | 1119 | void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) |
| 1083 | { | 1120 | { |
| 1084 | osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */ | ||
| 1085 | |||
| 1086 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); | 1121 | printk(KERN_NOTICE PREFIX "DMI detected: %s\n", d->ident); |
| 1087 | 1122 | ||
| 1088 | if (enable == -1) | 1123 | if (enable == -1) |
| 1089 | return; | 1124 | return; |
| 1090 | 1125 | ||
| 1091 | osi_linux.known = 1; /* DMI knows which OSI(Linux) default needed */ | 1126 | osi_linux.dmi = 1; /* DMI knows that this box asks OSI(Linux) */ |
| 1092 | |||
| 1093 | set_osi_linux(enable); | 1127 | set_osi_linux(enable); |
| 1094 | 1128 | ||
| 1095 | return; | 1129 | return; |
| @@ -1104,37 +1138,44 @@ void __init acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d) | |||
| 1104 | */ | 1138 | */ |
| 1105 | static void __init acpi_osi_setup_late(void) | 1139 | static void __init acpi_osi_setup_late(void) |
| 1106 | { | 1140 | { |
| 1107 | char *str = osi_setup_string; | 1141 | struct osi_setup_entry *osi; |
| 1142 | char *str; | ||
| 1143 | int i; | ||
| 1144 | acpi_status status; | ||
| 1108 | 1145 | ||
| 1109 | if (*str == '\0') | 1146 | for (i = 0; i < OSI_STRING_ENTRIES_MAX; i++) { |
| 1110 | return; | 1147 | osi = &osi_setup_entries[i]; |
| 1148 | str = osi->string; | ||
| 1111 | 1149 | ||
| 1112 | if (!strcmp("!Linux", str)) { | 1150 | if (*str == '\0') |
| 1113 | acpi_cmdline_osi_linux(0); /* !enable */ | 1151 | break; |
| 1114 | } else if (*str == '!') { | 1152 | if (osi->enable) { |
| 1115 | if (acpi_remove_interface(++str) == AE_OK) | 1153 | status = acpi_install_interface(str); |
| 1116 | printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); | 1154 | |
| 1117 | } else if (!strcmp("Linux", str)) { | 1155 | if (ACPI_SUCCESS(status)) |
| 1118 | acpi_cmdline_osi_linux(1); /* enable */ | 1156 | printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); |
| 1119 | } else { | 1157 | } else { |
| 1120 | if (acpi_install_interface(str) == AE_OK) | 1158 | status = acpi_remove_interface(str); |
| 1121 | printk(KERN_INFO PREFIX "Added _OSI(%s)\n", str); | 1159 | |
| 1160 | if (ACPI_SUCCESS(status)) | ||
| 1161 | printk(KERN_INFO PREFIX "Deleted _OSI(%s)\n", str); | ||
| 1162 | } | ||
| 1122 | } | 1163 | } |
| 1123 | } | 1164 | } |
| 1124 | 1165 | ||
| 1125 | int __init acpi_osi_setup(char *str) | 1166 | static int __init osi_setup(char *str) |
| 1126 | { | 1167 | { |
| 1127 | if (str == NULL || *str == '\0') { | 1168 | if (str && !strcmp("Linux", str)) |
| 1128 | printk(KERN_INFO PREFIX "_OSI method disabled\n"); | 1169 | acpi_cmdline_osi_linux(1); |
| 1129 | acpi_gbl_create_osi_method = FALSE; | 1170 | else if (str && !strcmp("!Linux", str)) |
| 1130 | } else { | 1171 | acpi_cmdline_osi_linux(0); |
| 1131 | strncpy(osi_setup_string, str, OSI_STRING_LENGTH_MAX); | 1172 | else |
| 1132 | } | 1173 | acpi_osi_setup(str); |
| 1133 | 1174 | ||
| 1134 | return 1; | 1175 | return 1; |
| 1135 | } | 1176 | } |
| 1136 | 1177 | ||
| 1137 | __setup("acpi_osi=", acpi_osi_setup); | 1178 | __setup("acpi_osi=", osi_setup); |
| 1138 | 1179 | ||
| 1139 | /* enable serialization to combat AE_ALREADY_EXISTS errors */ | 1180 | /* enable serialization to combat AE_ALREADY_EXISTS errors */ |
| 1140 | static int __init acpi_serialize_setup(char *str) | 1181 | static int __init acpi_serialize_setup(char *str) |
| @@ -1530,7 +1571,7 @@ acpi_status __init acpi_os_initialize(void) | |||
| 1530 | return AE_OK; | 1571 | return AE_OK; |
| 1531 | } | 1572 | } |
| 1532 | 1573 | ||
| 1533 | acpi_status acpi_os_initialize1(void) | 1574 | acpi_status __init acpi_os_initialize1(void) |
| 1534 | { | 1575 | { |
| 1535 | kacpid_wq = create_workqueue("kacpid"); | 1576 | kacpid_wq = create_workqueue("kacpid"); |
| 1536 | kacpi_notify_wq = create_workqueue("kacpi_notify"); | 1577 | kacpi_notify_wq = create_workqueue("kacpi_notify"); |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 67dedeed144c..4c9c2fb5d98f 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
| @@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle) | |||
| 213 | resource->name)); | 213 | resource->name)); |
| 214 | } else { | 214 | } else { |
| 215 | result = __acpi_power_on(resource); | 215 | result = __acpi_power_on(resource); |
| 216 | if (result) | ||
| 217 | resource->ref_count--; | ||
| 216 | } | 218 | } |
| 217 | 219 | ||
| 218 | mutex_unlock(&resource->resource_lock); | 220 | mutex_unlock(&resource->resource_lock); |
| 219 | 221 | ||
| 220 | return 0; | 222 | return result; |
| 221 | } | 223 | } |
| 222 | 224 | ||
| 223 | static int acpi_power_off_device(acpi_handle handle) | 225 | static int acpi_power_off_device(acpi_handle handle) |
| @@ -465,10 +467,12 @@ int acpi_power_transition(struct acpi_device *device, int state) | |||
| 465 | struct acpi_handle_list *tl = NULL; /* Target Resources */ | 467 | struct acpi_handle_list *tl = NULL; /* Target Resources */ |
| 466 | int i = 0; | 468 | int i = 0; |
| 467 | 469 | ||
| 468 | |||
| 469 | if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) | 470 | if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3)) |
| 470 | return -EINVAL; | 471 | return -EINVAL; |
| 471 | 472 | ||
| 473 | if (device->power.state == state) | ||
| 474 | return 0; | ||
| 475 | |||
| 472 | if ((device->power.state < ACPI_STATE_D0) | 476 | if ((device->power.state < ACPI_STATE_D0) |
| 473 | || (device->power.state > ACPI_STATE_D3)) | 477 | || (device->power.state > ACPI_STATE_D3)) |
| 474 | return -ENODEV; | 478 | return -ENODEV; |
| @@ -488,10 +492,6 @@ int acpi_power_transition(struct acpi_device *device, int state) | |||
| 488 | goto end; | 492 | goto end; |
| 489 | } | 493 | } |
| 490 | 494 | ||
| 491 | if (device->power.state == state) { | ||
| 492 | goto end; | ||
| 493 | } | ||
| 494 | |||
| 495 | /* | 495 | /* |
| 496 | * Then we dereference all power resources used in the current list. | 496 | * Then we dereference all power resources used in the current list. |
| 497 | */ | 497 | */ |
diff --git a/drivers/acpi/processor_thermal.c b/drivers/acpi/processor_thermal.c index fde49b9b1d99..79cb65332894 100644 --- a/drivers/acpi/processor_thermal.c +++ b/drivers/acpi/processor_thermal.c | |||
| @@ -156,15 +156,6 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state) | |||
| 156 | return 0; | 156 | return 0; |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | static int acpi_thermal_cpufreq_increase(unsigned int cpu) | ||
| 160 | { | ||
| 161 | return -ENODEV; | ||
| 162 | } | ||
| 163 | static int acpi_thermal_cpufreq_decrease(unsigned int cpu) | ||
| 164 | { | ||
| 165 | return -ENODEV; | ||
| 166 | } | ||
| 167 | |||
| 168 | #endif | 159 | #endif |
| 169 | 160 | ||
| 170 | int acpi_processor_get_limit_info(struct acpi_processor *pr) | 161 | int acpi_processor_get_limit_info(struct acpi_processor *pr) |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 721d93b3ceee..febb153b5a68 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -27,8 +27,6 @@ | |||
| 27 | 27 | ||
| 28 | static u8 sleep_states[ACPI_S_STATE_COUNT]; | 28 | static u8 sleep_states[ACPI_S_STATE_COUNT]; |
| 29 | 29 | ||
| 30 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | ||
| 31 | |||
| 32 | static void acpi_sleep_tts_switch(u32 acpi_state) | 30 | static void acpi_sleep_tts_switch(u32 acpi_state) |
| 33 | { | 31 | { |
| 34 | union acpi_object in_arg = { ACPI_TYPE_INTEGER }; | 32 | union acpi_object in_arg = { ACPI_TYPE_INTEGER }; |
| @@ -81,6 +79,8 @@ static int acpi_sleep_prepare(u32 acpi_state) | |||
| 81 | } | 79 | } |
| 82 | 80 | ||
| 83 | #ifdef CONFIG_ACPI_SLEEP | 81 | #ifdef CONFIG_ACPI_SLEEP |
| 82 | static u32 acpi_target_sleep_state = ACPI_STATE_S0; | ||
| 83 | |||
| 84 | /* | 84 | /* |
| 85 | * The ACPI specification wants us to save NVS memory regions during hibernation | 85 | * The ACPI specification wants us to save NVS memory regions during hibernation |
| 86 | * and to restore them during the subsequent resume. Windows does that also for | 86 | * and to restore them during the subsequent resume. Windows does that also for |
| @@ -427,6 +427,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = { | |||
| 427 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), | 427 | DMI_MATCH(DMI_PRODUCT_NAME, "VPCEB1Z1E"), |
| 428 | }, | 428 | }, |
| 429 | }, | 429 | }, |
| 430 | { | ||
| 431 | .callback = init_nvs_nosave, | ||
| 432 | .ident = "Sony Vaio VGN-NW130D", | ||
| 433 | .matches = { | ||
| 434 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), | ||
| 435 | DMI_MATCH(DMI_PRODUCT_NAME, "VGN-NW130D"), | ||
| 436 | }, | ||
| 437 | }, | ||
| 430 | {}, | 438 | {}, |
| 431 | }; | 439 | }; |
| 432 | #endif /* CONFIG_SUSPEND */ | 440 | #endif /* CONFIG_SUSPEND */ |
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 6ec9d53806c5..008d4a00b50d 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -21,80 +21,9 @@ | |||
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | Instructions for use | 24 | For usage instructions, please refer to: |
| 25 | -------------------- | ||
| 26 | 25 | ||
| 27 | 1) Map a Linux block device to an existing rbd image. | 26 | Documentation/ABI/testing/sysfs-bus-rbd |
| 28 | |||
| 29 | Usage: <mon ip addr> <options> <pool name> <rbd image name> [snap name] | ||
| 30 | |||
| 31 | $ echo "192.168.0.1 name=admin rbd foo" > /sys/class/rbd/add | ||
| 32 | |||
| 33 | The snapshot name can be "-" or omitted to map the image read/write. | ||
| 34 | |||
| 35 | 2) List all active blkdev<->object mappings. | ||
| 36 | |||
| 37 | In this example, we have performed step #1 twice, creating two blkdevs, | ||
| 38 | mapped to two separate rados objects in the rados rbd pool | ||
| 39 | |||
| 40 | $ cat /sys/class/rbd/list | ||
| 41 | #id major client_name pool name snap KB | ||
| 42 | 0 254 client4143 rbd foo - 1024000 | ||
| 43 | |||
| 44 | The columns, in order, are: | ||
| 45 | - blkdev unique id | ||
| 46 | - blkdev assigned major | ||
| 47 | - rados client id | ||
| 48 | - rados pool name | ||
| 49 | - rados block device name | ||
| 50 | - mapped snapshot ("-" if none) | ||
| 51 | - device size in KB | ||
| 52 | |||
| 53 | |||
| 54 | 3) Create a snapshot. | ||
| 55 | |||
| 56 | Usage: <blkdev id> <snapname> | ||
| 57 | |||
| 58 | $ echo "0 mysnap" > /sys/class/rbd/snap_create | ||
| 59 | |||
| 60 | |||
| 61 | 4) Listing a snapshot. | ||
| 62 | |||
| 63 | $ cat /sys/class/rbd/snaps_list | ||
| 64 | #id snap KB | ||
| 65 | 0 - 1024000 (*) | ||
| 66 | 0 foo 1024000 | ||
| 67 | |||
| 68 | The columns, in order, are: | ||
| 69 | - blkdev unique id | ||
| 70 | - snapshot name, '-' means none (active read/write version) | ||
| 71 | - size of device at time of snapshot | ||
| 72 | - the (*) indicates this is the active version | ||
| 73 | |||
| 74 | 5) Rollback to snapshot. | ||
| 75 | |||
| 76 | Usage: <blkdev id> <snapname> | ||
| 77 | |||
| 78 | $ echo "0 mysnap" > /sys/class/rbd/snap_rollback | ||
| 79 | |||
| 80 | |||
| 81 | 6) Mapping an image using snapshot. | ||
| 82 | |||
| 83 | A snapshot mapping is read-only. This is being done by passing | ||
| 84 | snap=<snapname> to the options when adding a device. | ||
| 85 | |||
| 86 | $ echo "192.168.0.1 name=admin,snap=mysnap rbd foo" > /sys/class/rbd/add | ||
| 87 | |||
| 88 | |||
| 89 | 7) Remove an active blkdev<->rbd image mapping. | ||
| 90 | |||
| 91 | In this example, we remove the mapping with blkdev unique id 1. | ||
| 92 | |||
| 93 | $ echo 1 > /sys/class/rbd/remove | ||
| 94 | |||
| 95 | |||
| 96 | NOTE: The actual creation and deletion of rados objects is outside the scope | ||
| 97 | of this driver. | ||
| 98 | 27 | ||
| 99 | */ | 28 | */ |
| 100 | 29 | ||
| @@ -163,6 +92,14 @@ struct rbd_request { | |||
| 163 | u64 len; | 92 | u64 len; |
| 164 | }; | 93 | }; |
| 165 | 94 | ||
| 95 | struct rbd_snap { | ||
| 96 | struct device dev; | ||
| 97 | const char *name; | ||
| 98 | size_t size; | ||
| 99 | struct list_head node; | ||
| 100 | u64 id; | ||
| 101 | }; | ||
| 102 | |||
| 166 | /* | 103 | /* |
| 167 | * a single device | 104 | * a single device |
| 168 | */ | 105 | */ |
| @@ -193,21 +130,60 @@ struct rbd_device { | |||
| 193 | int read_only; | 130 | int read_only; |
| 194 | 131 | ||
| 195 | struct list_head node; | 132 | struct list_head node; |
| 133 | |||
| 134 | /* list of snapshots */ | ||
| 135 | struct list_head snaps; | ||
| 136 | |||
| 137 | /* sysfs related */ | ||
| 138 | struct device dev; | ||
| 139 | }; | ||
| 140 | |||
| 141 | static struct bus_type rbd_bus_type = { | ||
| 142 | .name = "rbd", | ||
| 196 | }; | 143 | }; |
| 197 | 144 | ||
| 198 | static spinlock_t node_lock; /* protects client get/put */ | 145 | static spinlock_t node_lock; /* protects client get/put */ |
| 199 | 146 | ||
| 200 | static struct class *class_rbd; /* /sys/class/rbd */ | ||
| 201 | static DEFINE_MUTEX(ctl_mutex); /* Serialize open/close/setup/teardown */ | 147 | static DEFINE_MUTEX(ctl_mutex); /* Serialize open/close/setup/teardown */ |
| 202 | static LIST_HEAD(rbd_dev_list); /* devices */ | 148 | static LIST_HEAD(rbd_dev_list); /* devices */ |
| 203 | static LIST_HEAD(rbd_client_list); /* clients */ | 149 | static LIST_HEAD(rbd_client_list); /* clients */ |
| 204 | 150 | ||
| 151 | static int __rbd_init_snaps_header(struct rbd_device *rbd_dev); | ||
| 152 | static void rbd_dev_release(struct device *dev); | ||
| 153 | static ssize_t rbd_snap_rollback(struct device *dev, | ||
| 154 | struct device_attribute *attr, | ||
| 155 | const char *buf, | ||
| 156 | size_t size); | ||
| 157 | static ssize_t rbd_snap_add(struct device *dev, | ||
| 158 | struct device_attribute *attr, | ||
| 159 | const char *buf, | ||
| 160 | size_t count); | ||
| 161 | static void __rbd_remove_snap_dev(struct rbd_device *rbd_dev, | ||
| 162 | struct rbd_snap *snap);; | ||
| 163 | |||
| 164 | |||
| 165 | static struct rbd_device *dev_to_rbd(struct device *dev) | ||
| 166 | { | ||
| 167 | return container_of(dev, struct rbd_device, dev); | ||
| 168 | } | ||
| 169 | |||
| 170 | static struct device *rbd_get_dev(struct rbd_device *rbd_dev) | ||
| 171 | { | ||
| 172 | return get_device(&rbd_dev->dev); | ||
| 173 | } | ||
| 174 | |||
| 175 | static void rbd_put_dev(struct rbd_device *rbd_dev) | ||
| 176 | { | ||
| 177 | put_device(&rbd_dev->dev); | ||
| 178 | } | ||
| 205 | 179 | ||
| 206 | static int rbd_open(struct block_device *bdev, fmode_t mode) | 180 | static int rbd_open(struct block_device *bdev, fmode_t mode) |
| 207 | { | 181 | { |
| 208 | struct gendisk *disk = bdev->bd_disk; | 182 | struct gendisk *disk = bdev->bd_disk; |
| 209 | struct rbd_device *rbd_dev = disk->private_data; | 183 | struct rbd_device *rbd_dev = disk->private_data; |
| 210 | 184 | ||
| 185 | rbd_get_dev(rbd_dev); | ||
| 186 | |||
| 211 | set_device_ro(bdev, rbd_dev->read_only); | 187 | set_device_ro(bdev, rbd_dev->read_only); |
| 212 | 188 | ||
| 213 | if ((mode & FMODE_WRITE) && rbd_dev->read_only) | 189 | if ((mode & FMODE_WRITE) && rbd_dev->read_only) |
| @@ -216,9 +192,19 @@ static int rbd_open(struct block_device *bdev, fmode_t mode) | |||
| 216 | return 0; | 192 | return 0; |
| 217 | } | 193 | } |
| 218 | 194 | ||
| 195 | static int rbd_release(struct gendisk *disk, fmode_t mode) | ||
| 196 | { | ||
| 197 | struct rbd_device *rbd_dev = disk->private_data; | ||
| 198 | |||
| 199 | rbd_put_dev(rbd_dev); | ||
| 200 | |||
| 201 | return 0; | ||
| 202 | } | ||
| 203 | |||
| 219 | static const struct block_device_operations rbd_bd_ops = { | 204 | static const struct block_device_operations rbd_bd_ops = { |
| 220 | .owner = THIS_MODULE, | 205 | .owner = THIS_MODULE, |
| 221 | .open = rbd_open, | 206 | .open = rbd_open, |
| 207 | .release = rbd_release, | ||
| 222 | }; | 208 | }; |
| 223 | 209 | ||
| 224 | /* | 210 | /* |
| @@ -361,7 +347,6 @@ static int rbd_header_from_disk(struct rbd_image_header *header, | |||
| 361 | int ret = -ENOMEM; | 347 | int ret = -ENOMEM; |
| 362 | 348 | ||
| 363 | init_rwsem(&header->snap_rwsem); | 349 | init_rwsem(&header->snap_rwsem); |
| 364 | |||
| 365 | header->snap_names_len = le64_to_cpu(ondisk->snap_names_len); | 350 | header->snap_names_len = le64_to_cpu(ondisk->snap_names_len); |
| 366 | header->snapc = kmalloc(sizeof(struct ceph_snap_context) + | 351 | header->snapc = kmalloc(sizeof(struct ceph_snap_context) + |
| 367 | snap_count * | 352 | snap_count * |
| @@ -1256,10 +1241,20 @@ bad: | |||
| 1256 | return -ERANGE; | 1241 | return -ERANGE; |
| 1257 | } | 1242 | } |
| 1258 | 1243 | ||
| 1244 | static void __rbd_remove_all_snaps(struct rbd_device *rbd_dev) | ||
| 1245 | { | ||
| 1246 | struct rbd_snap *snap; | ||
| 1247 | |||
| 1248 | while (!list_empty(&rbd_dev->snaps)) { | ||
| 1249 | snap = list_first_entry(&rbd_dev->snaps, struct rbd_snap, node); | ||
| 1250 | __rbd_remove_snap_dev(rbd_dev, snap); | ||
| 1251 | } | ||
| 1252 | } | ||
| 1253 | |||
| 1259 | /* | 1254 | /* |
| 1260 | * only read the first part of the ondisk header, without the snaps info | 1255 | * only read the first part of the ondisk header, without the snaps info |
| 1261 | */ | 1256 | */ |
| 1262 | static int rbd_update_snaps(struct rbd_device *rbd_dev) | 1257 | static int __rbd_update_snaps(struct rbd_device *rbd_dev) |
| 1263 | { | 1258 | { |
| 1264 | int ret; | 1259 | int ret; |
| 1265 | struct rbd_image_header h; | 1260 | struct rbd_image_header h; |
| @@ -1280,12 +1275,15 @@ static int rbd_update_snaps(struct rbd_device *rbd_dev) | |||
| 1280 | rbd_dev->header.total_snaps = h.total_snaps; | 1275 | rbd_dev->header.total_snaps = h.total_snaps; |
| 1281 | rbd_dev->header.snapc = h.snapc; | 1276 | rbd_dev->header.snapc = h.snapc; |
| 1282 | rbd_dev->header.snap_names = h.snap_names; | 1277 | rbd_dev->header.snap_names = h.snap_names; |
| 1278 | rbd_dev->header.snap_names_len = h.snap_names_len; | ||
| 1283 | rbd_dev->header.snap_sizes = h.snap_sizes; | 1279 | rbd_dev->header.snap_sizes = h.snap_sizes; |
| 1284 | rbd_dev->header.snapc->seq = snap_seq; | 1280 | rbd_dev->header.snapc->seq = snap_seq; |
| 1285 | 1281 | ||
| 1282 | ret = __rbd_init_snaps_header(rbd_dev); | ||
| 1283 | |||
| 1286 | up_write(&rbd_dev->header.snap_rwsem); | 1284 | up_write(&rbd_dev->header.snap_rwsem); |
| 1287 | 1285 | ||
| 1288 | return 0; | 1286 | return ret; |
| 1289 | } | 1287 | } |
| 1290 | 1288 | ||
| 1291 | static int rbd_init_disk(struct rbd_device *rbd_dev) | 1289 | static int rbd_init_disk(struct rbd_device *rbd_dev) |
| @@ -1300,6 +1298,11 @@ static int rbd_init_disk(struct rbd_device *rbd_dev) | |||
| 1300 | if (rc) | 1298 | if (rc) |
| 1301 | return rc; | 1299 | return rc; |
| 1302 | 1300 | ||
| 1301 | /* no need to lock here, as rbd_dev is not registered yet */ | ||
| 1302 | rc = __rbd_init_snaps_header(rbd_dev); | ||
| 1303 | if (rc) | ||
| 1304 | return rc; | ||
| 1305 | |||
| 1303 | rc = rbd_header_set_snap(rbd_dev, rbd_dev->snap_name, &total_size); | 1306 | rc = rbd_header_set_snap(rbd_dev, rbd_dev->snap_name, &total_size); |
| 1304 | if (rc) | 1307 | if (rc) |
| 1305 | return rc; | 1308 | return rc; |
| @@ -1343,54 +1346,360 @@ out: | |||
| 1343 | return rc; | 1346 | return rc; |
| 1344 | } | 1347 | } |
| 1345 | 1348 | ||
| 1346 | /******************************************************************** | 1349 | /* |
| 1347 | * /sys/class/rbd/ | 1350 | sysfs |
| 1348 | * add map rados objects to blkdev | 1351 | */ |
| 1349 | * remove unmap rados objects | 1352 | |
| 1350 | * list show mappings | 1353 | static ssize_t rbd_size_show(struct device *dev, |
| 1351 | *******************************************************************/ | 1354 | struct device_attribute *attr, char *buf) |
| 1355 | { | ||
| 1356 | struct rbd_device *rbd_dev = dev_to_rbd(dev); | ||
| 1357 | |||
| 1358 | return sprintf(buf, "%llu\n", (unsigned long long)rbd_dev->header.image_size); | ||
| 1359 | } | ||
| 1360 | |||
| 1361 | static ssize_t rbd_major_show(struct device *dev, | ||
| 1362 | struct device_attribute *attr, char *buf) | ||
| 1363 | { | ||
| 1364 | struct rbd_device *rbd_dev = dev_to_rbd(dev); | ||
| 1352 | 1365 | ||
| 1353 | static void class_rbd_release(struct class *cls) | 1366 | return sprintf(buf, "%d\n", rbd_dev->major); |
| 1367 | } | ||
| 1368 | |||
| 1369 | static ssize_t rbd_client_id_show(struct device *dev, | ||
| 1370 | struct device_attribute *attr, char *buf) | ||
| 1354 | { | 1371 | { |
| 1355 | kfree(cls); | 1372 | struct rbd_device *rbd_dev = dev_to_rbd(dev); |
| 1373 | |||
| 1374 | return sprintf(buf, "client%lld\n", ceph_client_id(rbd_dev->client)); | ||
| 1356 | } | 1375 | } |
| 1357 | 1376 | ||
| 1358 | static ssize_t class_rbd_list(struct class *c, | 1377 | static ssize_t rbd_pool_show(struct device *dev, |
| 1359 | struct class_attribute *attr, | 1378 | struct device_attribute *attr, char *buf) |
| 1360 | char *data) | ||
| 1361 | { | 1379 | { |
| 1362 | int n = 0; | 1380 | struct rbd_device *rbd_dev = dev_to_rbd(dev); |
| 1363 | struct list_head *tmp; | 1381 | |
| 1364 | int max = PAGE_SIZE; | 1382 | return sprintf(buf, "%s\n", rbd_dev->pool_name); |
| 1383 | } | ||
| 1384 | |||
| 1385 | static ssize_t rbd_name_show(struct device *dev, | ||
| 1386 | struct device_attribute *attr, char *buf) | ||
| 1387 | { | ||
| 1388 | struct rbd_device *rbd_dev = dev_to_rbd(dev); | ||
| 1389 | |||
| 1390 | return sprintf(buf, "%s\n", rbd_dev->obj); | ||
| 1391 | } | ||
| 1392 | |||
| 1393 | static ssize_t rbd_snap_show(struct device *dev, | ||
| 1394 | struct device_attribute *attr, | ||
| 1395 | char *buf) | ||
| 1396 | { | ||
| 1397 | struct rbd_device *rbd_dev = dev_to_rbd(dev); | ||
| 1398 | |||
| 1399 | return sprintf(buf, "%s\n", rbd_dev->snap_name); | ||
| 1400 | } | ||
| 1401 | |||
| 1402 | static ssize_t rbd_image_refresh(struct device *dev, | ||
| 1403 | struct device_attribute *attr, | ||
| 1404 | const char *buf, | ||
| 1405 | size_t size) | ||
| 1406 | { | ||
| 1407 | struct rbd_device *rbd_dev = dev_to_rbd(dev); | ||
| 1408 | int rc; | ||
| 1409 | int ret = size; | ||
| 1365 | 1410 | ||
| 1366 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 1411 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
| 1367 | 1412 | ||
| 1368 | n += snprintf(data, max, | 1413 | rc = __rbd_update_snaps(rbd_dev); |
| 1369 | "#id\tmajor\tclient_name\tpool\tname\tsnap\tKB\n"); | 1414 | if (rc < 0) |
| 1415 | ret = rc; | ||
| 1370 | 1416 | ||
| 1371 | list_for_each(tmp, &rbd_dev_list) { | 1417 | mutex_unlock(&ctl_mutex); |
| 1372 | struct rbd_device *rbd_dev; | 1418 | return ret; |
| 1419 | } | ||
| 1373 | 1420 | ||
| 1374 | rbd_dev = list_entry(tmp, struct rbd_device, node); | 1421 | static DEVICE_ATTR(size, S_IRUGO, rbd_size_show, NULL); |
| 1375 | n += snprintf(data+n, max-n, | 1422 | static DEVICE_ATTR(major, S_IRUGO, rbd_major_show, NULL); |
| 1376 | "%d\t%d\tclient%lld\t%s\t%s\t%s\t%lld\n", | 1423 | static DEVICE_ATTR(client_id, S_IRUGO, rbd_client_id_show, NULL); |
| 1377 | rbd_dev->id, | 1424 | static DEVICE_ATTR(pool, S_IRUGO, rbd_pool_show, NULL); |
| 1378 | rbd_dev->major, | 1425 | static DEVICE_ATTR(name, S_IRUGO, rbd_name_show, NULL); |
| 1379 | ceph_client_id(rbd_dev->client), | 1426 | static DEVICE_ATTR(refresh, S_IWUSR, NULL, rbd_image_refresh); |
| 1380 | rbd_dev->pool_name, | 1427 | static DEVICE_ATTR(current_snap, S_IRUGO, rbd_snap_show, NULL); |
| 1381 | rbd_dev->obj, rbd_dev->snap_name, | 1428 | static DEVICE_ATTR(create_snap, S_IWUSR, NULL, rbd_snap_add); |
| 1382 | rbd_dev->header.image_size >> 10); | 1429 | static DEVICE_ATTR(rollback_snap, S_IWUSR, NULL, rbd_snap_rollback); |
| 1383 | if (n == max) | 1430 | |
| 1431 | static struct attribute *rbd_attrs[] = { | ||
| 1432 | &dev_attr_size.attr, | ||
| 1433 | &dev_attr_major.attr, | ||
| 1434 | &dev_attr_client_id.attr, | ||
| 1435 | &dev_attr_pool.attr, | ||
| 1436 | &dev_attr_name.attr, | ||
| 1437 | &dev_attr_current_snap.attr, | ||
| 1438 | &dev_attr_refresh.attr, | ||
| 1439 | &dev_attr_create_snap.attr, | ||
| 1440 | &dev_attr_rollback_snap.attr, | ||
| 1441 | NULL | ||
| 1442 | }; | ||
| 1443 | |||
| 1444 | static struct attribute_group rbd_attr_group = { | ||
| 1445 | .attrs = rbd_attrs, | ||
| 1446 | }; | ||
| 1447 | |||
| 1448 | static const struct attribute_group *rbd_attr_groups[] = { | ||
| 1449 | &rbd_attr_group, | ||
| 1450 | NULL | ||
| 1451 | }; | ||
| 1452 | |||
| 1453 | static void rbd_sysfs_dev_release(struct device *dev) | ||
| 1454 | { | ||
| 1455 | } | ||
| 1456 | |||
| 1457 | static struct device_type rbd_device_type = { | ||
| 1458 | .name = "rbd", | ||
| 1459 | .groups = rbd_attr_groups, | ||
| 1460 | .release = rbd_sysfs_dev_release, | ||
| 1461 | }; | ||
| 1462 | |||
| 1463 | |||
| 1464 | /* | ||
| 1465 | sysfs - snapshots | ||
| 1466 | */ | ||
| 1467 | |||
| 1468 | static ssize_t rbd_snap_size_show(struct device *dev, | ||
| 1469 | struct device_attribute *attr, | ||
| 1470 | char *buf) | ||
| 1471 | { | ||
| 1472 | struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev); | ||
| 1473 | |||
| 1474 | return sprintf(buf, "%lld\n", (long long)snap->size); | ||
| 1475 | } | ||
| 1476 | |||
| 1477 | static ssize_t rbd_snap_id_show(struct device *dev, | ||
| 1478 | struct device_attribute *attr, | ||
| 1479 | char *buf) | ||
| 1480 | { | ||
| 1481 | struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev); | ||
| 1482 | |||
| 1483 | return sprintf(buf, "%lld\n", (long long)snap->id); | ||
| 1484 | } | ||
| 1485 | |||
| 1486 | static DEVICE_ATTR(snap_size, S_IRUGO, rbd_snap_size_show, NULL); | ||
| 1487 | static DEVICE_ATTR(snap_id, S_IRUGO, rbd_snap_id_show, NULL); | ||
| 1488 | |||
| 1489 | static struct attribute *rbd_snap_attrs[] = { | ||
| 1490 | &dev_attr_snap_size.attr, | ||
| 1491 | &dev_attr_snap_id.attr, | ||
| 1492 | NULL, | ||
| 1493 | }; | ||
| 1494 | |||
| 1495 | static struct attribute_group rbd_snap_attr_group = { | ||
| 1496 | .attrs = rbd_snap_attrs, | ||
| 1497 | }; | ||
| 1498 | |||
| 1499 | static void rbd_snap_dev_release(struct device *dev) | ||
| 1500 | { | ||
| 1501 | struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev); | ||
| 1502 | kfree(snap->name); | ||
| 1503 | kfree(snap); | ||
| 1504 | } | ||
| 1505 | |||
| 1506 | static const struct attribute_group *rbd_snap_attr_groups[] = { | ||
| 1507 | &rbd_snap_attr_group, | ||
| 1508 | NULL | ||
| 1509 | }; | ||
| 1510 | |||
| 1511 | static struct device_type rbd_snap_device_type = { | ||
| 1512 | .groups = rbd_snap_attr_groups, | ||
| 1513 | .release = rbd_snap_dev_release, | ||
| 1514 | }; | ||
| 1515 | |||
| 1516 | static void __rbd_remove_snap_dev(struct rbd_device *rbd_dev, | ||
| 1517 | struct rbd_snap *snap) | ||
| 1518 | { | ||
| 1519 | list_del(&snap->node); | ||
| 1520 | device_unregister(&snap->dev); | ||
| 1521 | } | ||
| 1522 | |||
| 1523 | static int rbd_register_snap_dev(struct rbd_device *rbd_dev, | ||
| 1524 | struct rbd_snap *snap, | ||
| 1525 | struct device *parent) | ||
| 1526 | { | ||
| 1527 | struct device *dev = &snap->dev; | ||
| 1528 | int ret; | ||
| 1529 | |||
| 1530 | dev->type = &rbd_snap_device_type; | ||
| 1531 | dev->parent = parent; | ||
| 1532 | dev->release = rbd_snap_dev_release; | ||
| 1533 | dev_set_name(dev, "snap_%s", snap->name); | ||
| 1534 | ret = device_register(dev); | ||
| 1535 | |||
| 1536 | return ret; | ||
| 1537 | } | ||
| 1538 | |||
| 1539 | static int __rbd_add_snap_dev(struct rbd_device *rbd_dev, | ||
| 1540 | int i, const char *name, | ||
| 1541 | struct rbd_snap **snapp) | ||
| 1542 | { | ||
| 1543 | int ret; | ||
| 1544 | struct rbd_snap *snap = kzalloc(sizeof(*snap), GFP_KERNEL); | ||
| 1545 | if (!snap) | ||
| 1546 | return -ENOMEM; | ||
| 1547 | snap->name = kstrdup(name, GFP_KERNEL); | ||
| 1548 | snap->size = rbd_dev->header.snap_sizes[i]; | ||
| 1549 | snap->id = rbd_dev->header.snapc->snaps[i]; | ||
| 1550 | if (device_is_registered(&rbd_dev->dev)) { | ||
| 1551 | ret = rbd_register_snap_dev(rbd_dev, snap, | ||
| 1552 | &rbd_dev->dev); | ||
| 1553 | if (ret < 0) | ||
| 1554 | goto err; | ||
| 1555 | } | ||
| 1556 | *snapp = snap; | ||
| 1557 | return 0; | ||
| 1558 | err: | ||
| 1559 | kfree(snap->name); | ||
| 1560 | kfree(snap); | ||
| 1561 | return ret; | ||
| 1562 | } | ||
| 1563 | |||
| 1564 | /* | ||
| 1565 | * search for the previous snap in a null delimited string list | ||
| 1566 | */ | ||
| 1567 | const char *rbd_prev_snap_name(const char *name, const char *start) | ||
| 1568 | { | ||
| 1569 | if (name < start + 2) | ||
| 1570 | return NULL; | ||
| 1571 | |||
| 1572 | name -= 2; | ||
| 1573 | while (*name) { | ||
| 1574 | if (name == start) | ||
| 1575 | return start; | ||
| 1576 | name--; | ||
| 1577 | } | ||
| 1578 | return name + 1; | ||
| 1579 | } | ||
| 1580 | |||
| 1581 | /* | ||
| 1582 | * compare the old list of snapshots that we have to what's in the header | ||
| 1583 | * and update it accordingly. Note that the header holds the snapshots | ||
| 1584 | * in a reverse order (from newest to oldest) and we need to go from | ||
| 1585 | * older to new so that we don't get a duplicate snap name when | ||
| 1586 | * doing the process (e.g., removed snapshot and recreated a new | ||
| 1587 | * one with the same name. | ||
| 1588 | */ | ||
| 1589 | static int __rbd_init_snaps_header(struct rbd_device *rbd_dev) | ||
| 1590 | { | ||
| 1591 | const char *name, *first_name; | ||
| 1592 | int i = rbd_dev->header.total_snaps; | ||
| 1593 | struct rbd_snap *snap, *old_snap = NULL; | ||
| 1594 | int ret; | ||
| 1595 | struct list_head *p, *n; | ||
| 1596 | |||
| 1597 | first_name = rbd_dev->header.snap_names; | ||
| 1598 | name = first_name + rbd_dev->header.snap_names_len; | ||
| 1599 | |||
| 1600 | list_for_each_prev_safe(p, n, &rbd_dev->snaps) { | ||
| 1601 | u64 cur_id; | ||
| 1602 | |||
| 1603 | old_snap = list_entry(p, struct rbd_snap, node); | ||
| 1604 | |||
| 1605 | if (i) | ||
| 1606 | cur_id = rbd_dev->header.snapc->snaps[i - 1]; | ||
| 1607 | |||
| 1608 | if (!i || old_snap->id < cur_id) { | ||
| 1609 | /* old_snap->id was skipped, thus was removed */ | ||
| 1610 | __rbd_remove_snap_dev(rbd_dev, old_snap); | ||
| 1611 | continue; | ||
| 1612 | } | ||
| 1613 | if (old_snap->id == cur_id) { | ||
| 1614 | /* we have this snapshot already */ | ||
| 1615 | i--; | ||
| 1616 | name = rbd_prev_snap_name(name, first_name); | ||
| 1617 | continue; | ||
| 1618 | } | ||
| 1619 | for (; i > 0; | ||
| 1620 | i--, name = rbd_prev_snap_name(name, first_name)) { | ||
| 1621 | if (!name) { | ||
| 1622 | WARN_ON(1); | ||
| 1623 | return -EINVAL; | ||
| 1624 | } | ||
| 1625 | cur_id = rbd_dev->header.snapc->snaps[i]; | ||
| 1626 | /* snapshot removal? handle it above */ | ||
| 1627 | if (cur_id >= old_snap->id) | ||
| 1628 | break; | ||
| 1629 | /* a new snapshot */ | ||
| 1630 | ret = __rbd_add_snap_dev(rbd_dev, i - 1, name, &snap); | ||
| 1631 | if (ret < 0) | ||
| 1632 | return ret; | ||
| 1633 | |||
| 1634 | /* note that we add it backward so using n and not p */ | ||
| 1635 | list_add(&snap->node, n); | ||
| 1636 | p = &snap->node; | ||
| 1637 | } | ||
| 1638 | } | ||
| 1639 | /* we're done going over the old snap list, just add what's left */ | ||
| 1640 | for (; i > 0; i--) { | ||
| 1641 | name = rbd_prev_snap_name(name, first_name); | ||
| 1642 | if (!name) { | ||
| 1643 | WARN_ON(1); | ||
| 1644 | return -EINVAL; | ||
| 1645 | } | ||
| 1646 | ret = __rbd_add_snap_dev(rbd_dev, i - 1, name, &snap); | ||
| 1647 | if (ret < 0) | ||
| 1648 | return ret; | ||
| 1649 | list_add(&snap->node, &rbd_dev->snaps); | ||
| 1650 | } | ||
| 1651 | |||
| 1652 | return 0; | ||
| 1653 | } | ||
| 1654 | |||
| 1655 | |||
| 1656 | static void rbd_root_dev_release(struct device *dev) | ||
| 1657 | { | ||
| 1658 | } | ||
| 1659 | |||
| 1660 | static struct device rbd_root_dev = { | ||
| 1661 | .init_name = "rbd", | ||
| 1662 | .release = rbd_root_dev_release, | ||
| 1663 | }; | ||
| 1664 | |||
| 1665 | static int rbd_bus_add_dev(struct rbd_device *rbd_dev) | ||
| 1666 | { | ||
| 1667 | int ret = -ENOMEM; | ||
| 1668 | struct device *dev; | ||
| 1669 | struct rbd_snap *snap; | ||
| 1670 | |||
| 1671 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 1672 | dev = &rbd_dev->dev; | ||
| 1673 | |||
| 1674 | dev->bus = &rbd_bus_type; | ||
| 1675 | dev->type = &rbd_device_type; | ||
| 1676 | dev->parent = &rbd_root_dev; | ||
| 1677 | dev->release = rbd_dev_release; | ||
| 1678 | dev_set_name(dev, "%d", rbd_dev->id); | ||
| 1679 | ret = device_register(dev); | ||
| 1680 | if (ret < 0) | ||
| 1681 | goto done_free; | ||
| 1682 | |||
| 1683 | list_for_each_entry(snap, &rbd_dev->snaps, node) { | ||
| 1684 | ret = rbd_register_snap_dev(rbd_dev, snap, | ||
| 1685 | &rbd_dev->dev); | ||
| 1686 | if (ret < 0) | ||
| 1384 | break; | 1687 | break; |
| 1385 | } | 1688 | } |
| 1386 | 1689 | ||
| 1387 | mutex_unlock(&ctl_mutex); | 1690 | mutex_unlock(&ctl_mutex); |
| 1388 | return n; | 1691 | return 0; |
| 1692 | done_free: | ||
| 1693 | mutex_unlock(&ctl_mutex); | ||
| 1694 | return ret; | ||
| 1389 | } | 1695 | } |
| 1390 | 1696 | ||
| 1391 | static ssize_t class_rbd_add(struct class *c, | 1697 | static void rbd_bus_del_dev(struct rbd_device *rbd_dev) |
| 1392 | struct class_attribute *attr, | 1698 | { |
| 1393 | const char *buf, size_t count) | 1699 | device_unregister(&rbd_dev->dev); |
| 1700 | } | ||
| 1701 | |||
| 1702 | static ssize_t rbd_add(struct bus_type *bus, const char *buf, size_t count) | ||
| 1394 | { | 1703 | { |
| 1395 | struct ceph_osd_client *osdc; | 1704 | struct ceph_osd_client *osdc; |
| 1396 | struct rbd_device *rbd_dev; | 1705 | struct rbd_device *rbd_dev; |
| @@ -1419,6 +1728,7 @@ static ssize_t class_rbd_add(struct class *c, | |||
| 1419 | /* static rbd_device initialization */ | 1728 | /* static rbd_device initialization */ |
| 1420 | spin_lock_init(&rbd_dev->lock); | 1729 | spin_lock_init(&rbd_dev->lock); |
| 1421 | INIT_LIST_HEAD(&rbd_dev->node); | 1730 | INIT_LIST_HEAD(&rbd_dev->node); |
| 1731 | INIT_LIST_HEAD(&rbd_dev->snaps); | ||
| 1422 | 1732 | ||
| 1423 | /* generate unique id: find highest unique id, add one */ | 1733 | /* generate unique id: find highest unique id, add one */ |
| 1424 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 1734 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
| @@ -1478,6 +1788,9 @@ static ssize_t class_rbd_add(struct class *c, | |||
| 1478 | } | 1788 | } |
| 1479 | rbd_dev->major = irc; | 1789 | rbd_dev->major = irc; |
| 1480 | 1790 | ||
| 1791 | rc = rbd_bus_add_dev(rbd_dev); | ||
| 1792 | if (rc) | ||
| 1793 | goto err_out_disk; | ||
| 1481 | /* set up and announce blkdev mapping */ | 1794 | /* set up and announce blkdev mapping */ |
| 1482 | rc = rbd_init_disk(rbd_dev); | 1795 | rc = rbd_init_disk(rbd_dev); |
| 1483 | if (rc) | 1796 | if (rc) |
| @@ -1487,6 +1800,8 @@ static ssize_t class_rbd_add(struct class *c, | |||
| 1487 | 1800 | ||
| 1488 | err_out_blkdev: | 1801 | err_out_blkdev: |
| 1489 | unregister_blkdev(rbd_dev->major, rbd_dev->name); | 1802 | unregister_blkdev(rbd_dev->major, rbd_dev->name); |
| 1803 | err_out_disk: | ||
| 1804 | rbd_free_disk(rbd_dev); | ||
| 1490 | err_out_client: | 1805 | err_out_client: |
| 1491 | rbd_put_client(rbd_dev); | 1806 | rbd_put_client(rbd_dev); |
| 1492 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 1807 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
| @@ -1518,35 +1833,10 @@ static struct rbd_device *__rbd_get_dev(unsigned long id) | |||
| 1518 | return NULL; | 1833 | return NULL; |
| 1519 | } | 1834 | } |
| 1520 | 1835 | ||
| 1521 | static ssize_t class_rbd_remove(struct class *c, | 1836 | static void rbd_dev_release(struct device *dev) |
| 1522 | struct class_attribute *attr, | ||
| 1523 | const char *buf, | ||
| 1524 | size_t count) | ||
| 1525 | { | 1837 | { |
| 1526 | struct rbd_device *rbd_dev = NULL; | 1838 | struct rbd_device *rbd_dev = |
| 1527 | int target_id, rc; | 1839 | container_of(dev, struct rbd_device, dev); |
| 1528 | unsigned long ul; | ||
| 1529 | |||
| 1530 | rc = strict_strtoul(buf, 10, &ul); | ||
| 1531 | if (rc) | ||
| 1532 | return rc; | ||
| 1533 | |||
| 1534 | /* convert to int; abort if we lost anything in the conversion */ | ||
| 1535 | target_id = (int) ul; | ||
| 1536 | if (target_id != ul) | ||
| 1537 | return -EINVAL; | ||
| 1538 | |||
| 1539 | /* remove object from list immediately */ | ||
| 1540 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 1541 | |||
| 1542 | rbd_dev = __rbd_get_dev(target_id); | ||
| 1543 | if (rbd_dev) | ||
| 1544 | list_del_init(&rbd_dev->node); | ||
| 1545 | |||
| 1546 | mutex_unlock(&ctl_mutex); | ||
| 1547 | |||
| 1548 | if (!rbd_dev) | ||
| 1549 | return -ENOENT; | ||
| 1550 | 1840 | ||
| 1551 | rbd_put_client(rbd_dev); | 1841 | rbd_put_client(rbd_dev); |
| 1552 | 1842 | ||
| @@ -1557,67 +1847,11 @@ static ssize_t class_rbd_remove(struct class *c, | |||
| 1557 | 1847 | ||
| 1558 | /* release module ref */ | 1848 | /* release module ref */ |
| 1559 | module_put(THIS_MODULE); | 1849 | module_put(THIS_MODULE); |
| 1560 | |||
| 1561 | return count; | ||
| 1562 | } | 1850 | } |
| 1563 | 1851 | ||
| 1564 | static ssize_t class_rbd_snaps_list(struct class *c, | 1852 | static ssize_t rbd_remove(struct bus_type *bus, |
| 1565 | struct class_attribute *attr, | 1853 | const char *buf, |
| 1566 | char *data) | 1854 | size_t count) |
| 1567 | { | ||
| 1568 | struct rbd_device *rbd_dev = NULL; | ||
| 1569 | struct list_head *tmp; | ||
| 1570 | struct rbd_image_header *header; | ||
| 1571 | int i, n = 0, max = PAGE_SIZE; | ||
| 1572 | int ret; | ||
| 1573 | |||
| 1574 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
| 1575 | |||
| 1576 | n += snprintf(data, max, "#id\tsnap\tKB\n"); | ||
| 1577 | |||
| 1578 | list_for_each(tmp, &rbd_dev_list) { | ||
| 1579 | char *names, *p; | ||
| 1580 | struct ceph_snap_context *snapc; | ||
| 1581 | |||
| 1582 | rbd_dev = list_entry(tmp, struct rbd_device, node); | ||
| 1583 | header = &rbd_dev->header; | ||
| 1584 | |||
| 1585 | down_read(&header->snap_rwsem); | ||
| 1586 | |||
| 1587 | names = header->snap_names; | ||
| 1588 | snapc = header->snapc; | ||
| 1589 | |||
| 1590 | n += snprintf(data + n, max - n, "%d\t%s\t%lld%s\n", | ||
| 1591 | rbd_dev->id, RBD_SNAP_HEAD_NAME, | ||
| 1592 | header->image_size >> 10, | ||
| 1593 | (!rbd_dev->cur_snap ? " (*)" : "")); | ||
| 1594 | if (n == max) | ||
| 1595 | break; | ||
| 1596 | |||
| 1597 | p = names; | ||
| 1598 | for (i = 0; i < header->total_snaps; i++, p += strlen(p) + 1) { | ||
| 1599 | n += snprintf(data + n, max - n, "%d\t%s\t%lld%s\n", | ||
| 1600 | rbd_dev->id, p, header->snap_sizes[i] >> 10, | ||
| 1601 | (rbd_dev->cur_snap && | ||
| 1602 | (snap_index(header, i) == rbd_dev->cur_snap) ? | ||
| 1603 | " (*)" : "")); | ||
| 1604 | if (n == max) | ||
| 1605 | break; | ||
| 1606 | } | ||
| 1607 | |||
| 1608 | up_read(&header->snap_rwsem); | ||
| 1609 | } | ||
| 1610 | |||
| 1611 | |||
| 1612 | ret = n; | ||
| 1613 | mutex_unlock(&ctl_mutex); | ||
| 1614 | return ret; | ||
| 1615 | } | ||
| 1616 | |||
| 1617 | static ssize_t class_rbd_snaps_refresh(struct class *c, | ||
| 1618 | struct class_attribute *attr, | ||
| 1619 | const char *buf, | ||
| 1620 | size_t count) | ||
| 1621 | { | 1855 | { |
| 1622 | struct rbd_device *rbd_dev = NULL; | 1856 | struct rbd_device *rbd_dev = NULL; |
| 1623 | int target_id, rc; | 1857 | int target_id, rc; |
| @@ -1641,95 +1875,70 @@ static ssize_t class_rbd_snaps_refresh(struct class *c, | |||
| 1641 | goto done; | 1875 | goto done; |
| 1642 | } | 1876 | } |
| 1643 | 1877 | ||
| 1644 | rc = rbd_update_snaps(rbd_dev); | 1878 | list_del_init(&rbd_dev->node); |
| 1645 | if (rc < 0) | 1879 | |
| 1646 | ret = rc; | 1880 | __rbd_remove_all_snaps(rbd_dev); |
| 1881 | rbd_bus_del_dev(rbd_dev); | ||
| 1647 | 1882 | ||
| 1648 | done: | 1883 | done: |
| 1649 | mutex_unlock(&ctl_mutex); | 1884 | mutex_unlock(&ctl_mutex); |
| 1650 | return ret; | 1885 | return ret; |
| 1651 | } | 1886 | } |
| 1652 | 1887 | ||
| 1653 | static ssize_t class_rbd_snap_create(struct class *c, | 1888 | static ssize_t rbd_snap_add(struct device *dev, |
| 1654 | struct class_attribute *attr, | 1889 | struct device_attribute *attr, |
| 1655 | const char *buf, | 1890 | const char *buf, |
| 1656 | size_t count) | 1891 | size_t count) |
| 1657 | { | 1892 | { |
| 1658 | struct rbd_device *rbd_dev = NULL; | 1893 | struct rbd_device *rbd_dev = dev_to_rbd(dev); |
| 1659 | int target_id, ret; | 1894 | int ret; |
| 1660 | char *name; | 1895 | char *name = kmalloc(count + 1, GFP_KERNEL); |
| 1661 | |||
| 1662 | name = kmalloc(RBD_MAX_SNAP_NAME_LEN + 1, GFP_KERNEL); | ||
| 1663 | if (!name) | 1896 | if (!name) |
| 1664 | return -ENOMEM; | 1897 | return -ENOMEM; |
| 1665 | 1898 | ||
| 1666 | /* parse snaps add command */ | 1899 | snprintf(name, count, "%s", buf); |
| 1667 | if (sscanf(buf, "%d " | ||
| 1668 | "%" __stringify(RBD_MAX_SNAP_NAME_LEN) "s", | ||
| 1669 | &target_id, | ||
| 1670 | name) != 2) { | ||
| 1671 | ret = -EINVAL; | ||
| 1672 | goto done; | ||
| 1673 | } | ||
| 1674 | 1900 | ||
| 1675 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 1901 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
| 1676 | 1902 | ||
| 1677 | rbd_dev = __rbd_get_dev(target_id); | ||
| 1678 | if (!rbd_dev) { | ||
| 1679 | ret = -ENOENT; | ||
| 1680 | goto done_unlock; | ||
| 1681 | } | ||
| 1682 | |||
| 1683 | ret = rbd_header_add_snap(rbd_dev, | 1903 | ret = rbd_header_add_snap(rbd_dev, |
| 1684 | name, GFP_KERNEL); | 1904 | name, GFP_KERNEL); |
| 1685 | if (ret < 0) | 1905 | if (ret < 0) |
| 1686 | goto done_unlock; | 1906 | goto done_unlock; |
| 1687 | 1907 | ||
| 1688 | ret = rbd_update_snaps(rbd_dev); | 1908 | ret = __rbd_update_snaps(rbd_dev); |
| 1689 | if (ret < 0) | 1909 | if (ret < 0) |
| 1690 | goto done_unlock; | 1910 | goto done_unlock; |
| 1691 | 1911 | ||
| 1692 | ret = count; | 1912 | ret = count; |
| 1693 | done_unlock: | 1913 | done_unlock: |
| 1694 | mutex_unlock(&ctl_mutex); | 1914 | mutex_unlock(&ctl_mutex); |
| 1695 | done: | ||
| 1696 | kfree(name); | 1915 | kfree(name); |
| 1697 | return ret; | 1916 | return ret; |
| 1698 | } | 1917 | } |
| 1699 | 1918 | ||
| 1700 | static ssize_t class_rbd_rollback(struct class *c, | 1919 | static ssize_t rbd_snap_rollback(struct device *dev, |
| 1701 | struct class_attribute *attr, | 1920 | struct device_attribute *attr, |
| 1702 | const char *buf, | 1921 | const char *buf, |
| 1703 | size_t count) | 1922 | size_t count) |
| 1704 | { | 1923 | { |
| 1705 | struct rbd_device *rbd_dev = NULL; | 1924 | struct rbd_device *rbd_dev = dev_to_rbd(dev); |
| 1706 | int target_id, ret; | 1925 | int ret; |
| 1707 | u64 snapid; | 1926 | u64 snapid; |
| 1708 | char snap_name[RBD_MAX_SNAP_NAME_LEN]; | ||
| 1709 | u64 cur_ofs; | 1927 | u64 cur_ofs; |
| 1710 | char *seg_name; | 1928 | char *seg_name = NULL; |
| 1929 | char *snap_name = kmalloc(count + 1, GFP_KERNEL); | ||
| 1930 | ret = -ENOMEM; | ||
| 1931 | if (!snap_name) | ||
| 1932 | return ret; | ||
| 1711 | 1933 | ||
| 1712 | /* parse snaps add command */ | 1934 | /* parse snaps add command */ |
| 1713 | if (sscanf(buf, "%d " | 1935 | snprintf(snap_name, count, "%s", buf); |
| 1714 | "%" __stringify(RBD_MAX_SNAP_NAME_LEN) "s", | ||
| 1715 | &target_id, | ||
| 1716 | snap_name) != 2) { | ||
| 1717 | return -EINVAL; | ||
| 1718 | } | ||
| 1719 | |||
| 1720 | ret = -ENOMEM; | ||
| 1721 | seg_name = kmalloc(RBD_MAX_SEG_NAME_LEN + 1, GFP_NOIO); | 1936 | seg_name = kmalloc(RBD_MAX_SEG_NAME_LEN + 1, GFP_NOIO); |
| 1722 | if (!seg_name) | 1937 | if (!seg_name) |
| 1723 | return ret; | 1938 | goto done; |
| 1724 | 1939 | ||
| 1725 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 1940 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |
| 1726 | 1941 | ||
| 1727 | rbd_dev = __rbd_get_dev(target_id); | ||
| 1728 | if (!rbd_dev) { | ||
| 1729 | ret = -ENOENT; | ||
| 1730 | goto done_unlock; | ||
| 1731 | } | ||
| 1732 | |||
| 1733 | ret = snap_by_name(&rbd_dev->header, snap_name, &snapid, NULL); | 1942 | ret = snap_by_name(&rbd_dev->header, snap_name, &snapid, NULL); |
| 1734 | if (ret < 0) | 1943 | if (ret < 0) |
| 1735 | goto done_unlock; | 1944 | goto done_unlock; |
| @@ -1750,7 +1959,7 @@ static ssize_t class_rbd_rollback(struct class *c, | |||
| 1750 | seg_name, ret); | 1959 | seg_name, ret); |
| 1751 | } | 1960 | } |
| 1752 | 1961 | ||
| 1753 | ret = rbd_update_snaps(rbd_dev); | 1962 | ret = __rbd_update_snaps(rbd_dev); |
| 1754 | if (ret < 0) | 1963 | if (ret < 0) |
| 1755 | goto done_unlock; | 1964 | goto done_unlock; |
| 1756 | 1965 | ||
| @@ -1758,57 +1967,42 @@ static ssize_t class_rbd_rollback(struct class *c, | |||
| 1758 | 1967 | ||
| 1759 | done_unlock: | 1968 | done_unlock: |
| 1760 | mutex_unlock(&ctl_mutex); | 1969 | mutex_unlock(&ctl_mutex); |
| 1970 | done: | ||
| 1761 | kfree(seg_name); | 1971 | kfree(seg_name); |
| 1972 | kfree(snap_name); | ||
| 1762 | 1973 | ||
| 1763 | return ret; | 1974 | return ret; |
| 1764 | } | 1975 | } |
| 1765 | 1976 | ||
| 1766 | static struct class_attribute class_rbd_attrs[] = { | 1977 | static struct bus_attribute rbd_bus_attrs[] = { |
| 1767 | __ATTR(add, 0200, NULL, class_rbd_add), | 1978 | __ATTR(add, S_IWUSR, NULL, rbd_add), |
| 1768 | __ATTR(remove, 0200, NULL, class_rbd_remove), | 1979 | __ATTR(remove, S_IWUSR, NULL, rbd_remove), |
| 1769 | __ATTR(list, 0444, class_rbd_list, NULL), | ||
| 1770 | __ATTR(snaps_refresh, 0200, NULL, class_rbd_snaps_refresh), | ||
| 1771 | __ATTR(snap_create, 0200, NULL, class_rbd_snap_create), | ||
| 1772 | __ATTR(snaps_list, 0444, class_rbd_snaps_list, NULL), | ||
| 1773 | __ATTR(snap_rollback, 0200, NULL, class_rbd_rollback), | ||
| 1774 | __ATTR_NULL | 1980 | __ATTR_NULL |
| 1775 | }; | 1981 | }; |
| 1776 | 1982 | ||
| 1777 | /* | 1983 | /* |
| 1778 | * create control files in sysfs | 1984 | * create control files in sysfs |
| 1779 | * /sys/class/rbd/... | 1985 | * /sys/bus/rbd/... |
| 1780 | */ | 1986 | */ |
| 1781 | static int rbd_sysfs_init(void) | 1987 | static int rbd_sysfs_init(void) |
| 1782 | { | 1988 | { |
| 1783 | int ret = -ENOMEM; | 1989 | int ret; |
| 1784 | 1990 | ||
| 1785 | class_rbd = kzalloc(sizeof(*class_rbd), GFP_KERNEL); | 1991 | rbd_bus_type.bus_attrs = rbd_bus_attrs; |
| 1786 | if (!class_rbd) | ||
| 1787 | goto out; | ||
| 1788 | 1992 | ||
| 1789 | class_rbd->name = DRV_NAME; | 1993 | ret = bus_register(&rbd_bus_type); |
| 1790 | class_rbd->owner = THIS_MODULE; | 1994 | if (ret < 0) |
| 1791 | class_rbd->class_release = class_rbd_release; | 1995 | return ret; |
| 1792 | class_rbd->class_attrs = class_rbd_attrs; | ||
| 1793 | 1996 | ||
| 1794 | ret = class_register(class_rbd); | 1997 | ret = device_register(&rbd_root_dev); |
| 1795 | if (ret) | ||
| 1796 | goto out_class; | ||
| 1797 | return 0; | ||
| 1798 | 1998 | ||
| 1799 | out_class: | ||
| 1800 | kfree(class_rbd); | ||
| 1801 | class_rbd = NULL; | ||
| 1802 | pr_err(DRV_NAME ": failed to create class rbd\n"); | ||
| 1803 | out: | ||
| 1804 | return ret; | 1999 | return ret; |
| 1805 | } | 2000 | } |
| 1806 | 2001 | ||
| 1807 | static void rbd_sysfs_cleanup(void) | 2002 | static void rbd_sysfs_cleanup(void) |
| 1808 | { | 2003 | { |
| 1809 | if (class_rbd) | 2004 | device_unregister(&rbd_root_dev); |
| 1810 | class_destroy(class_rbd); | 2005 | bus_unregister(&rbd_bus_type); |
| 1811 | class_rbd = NULL; | ||
| 1812 | } | 2006 | } |
| 1813 | 2007 | ||
| 1814 | int __init rbd_init(void) | 2008 | int __init rbd_init(void) |
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 9272c38dd3c6..16a2847b7cdb 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
| @@ -812,8 +812,10 @@ static int intel_fake_agp_fetch_size(void) | |||
| 812 | 812 | ||
| 813 | static void i830_cleanup(void) | 813 | static void i830_cleanup(void) |
| 814 | { | 814 | { |
| 815 | kunmap(intel_private.i8xx_page); | 815 | if (intel_private.i8xx_flush_page) { |
| 816 | intel_private.i8xx_flush_page = NULL; | 816 | kunmap(intel_private.i8xx_flush_page); |
| 817 | intel_private.i8xx_flush_page = NULL; | ||
| 818 | } | ||
| 817 | 819 | ||
| 818 | __free_page(intel_private.i8xx_page); | 820 | __free_page(intel_private.i8xx_page); |
| 819 | intel_private.i8xx_page = NULL; | 821 | intel_private.i8xx_page = NULL; |
diff --git a/drivers/dma/Makefile b/drivers/dma/Makefile index a8a84f4587f2..64b21f5cd740 100644 --- a/drivers/dma/Makefile +++ b/drivers/dma/Makefile | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | ifeq ($(CONFIG_DMADEVICES_DEBUG),y) | 1 | ifeq ($(CONFIG_DMADEVICES_DEBUG),y) |
| 2 | EXTRA_CFLAGS += -DDEBUG | 2 | ccflags-y += -DDEBUG |
| 3 | endif | 3 | endif |
| 4 | ifeq ($(CONFIG_DMADEVICES_VDEBUG),y) | 4 | ifeq ($(CONFIG_DMADEVICES_VDEBUG),y) |
| 5 | EXTRA_CFLAGS += -DVERBOSE_DEBUG | 5 | ccflags-y += -DVERBOSE_DEBUG |
| 6 | endif | 6 | endif |
| 7 | 7 | ||
| 8 | obj-$(CONFIG_DMA_ENGINE) += dmaengine.o | 8 | obj-$(CONFIG_DMA_ENGINE) += dmaengine.o |
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index a0f3e6a06e06..ea0ee81cff53 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
| @@ -722,7 +722,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, | |||
| 722 | desc->lli.daddr = mem; | 722 | desc->lli.daddr = mem; |
| 723 | desc->lli.ctrla = ctrla | 723 | desc->lli.ctrla = ctrla |
| 724 | | ATC_DST_WIDTH(mem_width) | 724 | | ATC_DST_WIDTH(mem_width) |
| 725 | | len >> mem_width; | 725 | | len >> reg_width; |
| 726 | desc->lli.ctrlb = ctrlb; | 726 | desc->lli.ctrlb = ctrlb; |
| 727 | 727 | ||
| 728 | if (!first) { | 728 | if (!first) { |
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index 286c3ac6bdcc..e5e172d21692 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c | |||
| @@ -50,9 +50,11 @@ static void dma_init(struct fsldma_chan *chan) | |||
| 50 | * EIE - Error interrupt enable | 50 | * EIE - Error interrupt enable |
| 51 | * EOSIE - End of segments interrupt enable (basic mode) | 51 | * EOSIE - End of segments interrupt enable (basic mode) |
| 52 | * EOLNIE - End of links interrupt enable | 52 | * EOLNIE - End of links interrupt enable |
| 53 | * BWC - Bandwidth sharing among channels | ||
| 53 | */ | 54 | */ |
| 54 | DMA_OUT(chan, &chan->regs->mr, FSL_DMA_MR_EIE | 55 | DMA_OUT(chan, &chan->regs->mr, FSL_DMA_MR_BWC |
| 55 | | FSL_DMA_MR_EOLNIE | FSL_DMA_MR_EOSIE, 32); | 56 | | FSL_DMA_MR_EIE | FSL_DMA_MR_EOLNIE |
| 57 | | FSL_DMA_MR_EOSIE, 32); | ||
| 56 | break; | 58 | break; |
| 57 | case FSL_DMA_IP_83XX: | 59 | case FSL_DMA_IP_83XX: |
| 58 | /* Set the channel to below modes: | 60 | /* Set the channel to below modes: |
diff --git a/drivers/dma/fsldma.h b/drivers/dma/fsldma.h index cb4d6ff51597..ba9f403c0fbe 100644 --- a/drivers/dma/fsldma.h +++ b/drivers/dma/fsldma.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (C) 2007 Freescale Semiconductor, Inc. All rights reserved. | 2 | * Copyright (C) 2007-2010 Freescale Semiconductor, Inc. All rights reserved. |
| 3 | * | 3 | * |
| 4 | * Author: | 4 | * Author: |
| 5 | * Zhang Wei <wei.zhang@freescale.com>, Jul 2007 | 5 | * Zhang Wei <wei.zhang@freescale.com>, Jul 2007 |
| @@ -36,6 +36,13 @@ | |||
| 36 | #define FSL_DMA_MR_DAHE 0x00002000 | 36 | #define FSL_DMA_MR_DAHE 0x00002000 |
| 37 | #define FSL_DMA_MR_SAHE 0x00001000 | 37 | #define FSL_DMA_MR_SAHE 0x00001000 |
| 38 | 38 | ||
| 39 | /* | ||
| 40 | * Bandwidth/pause control determines how many bytes a given | ||
| 41 | * channel is allowed to transfer before the DMA engine pauses | ||
| 42 | * the current channel and switches to the next channel | ||
| 43 | */ | ||
| 44 | #define FSL_DMA_MR_BWC 0x08000000 | ||
| 45 | |||
| 39 | /* Special MR definition for MPC8349 */ | 46 | /* Special MR definition for MPC8349 */ |
| 40 | #define FSL_DMA_MR_EOTIE 0x00000080 | 47 | #define FSL_DMA_MR_EOTIE 0x00000080 |
| 41 | #define FSL_DMA_MR_PRC_RM 0x00000800 | 48 | #define FSL_DMA_MR_PRC_RM 0x00000800 |
diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index f629e4961af5..e53d438142bb 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c | |||
| @@ -379,7 +379,7 @@ static int __init imxdma_probe(struct platform_device *pdev) | |||
| 379 | return 0; | 379 | return 0; |
| 380 | 380 | ||
| 381 | err_init: | 381 | err_init: |
| 382 | while (i-- >= 0) { | 382 | while (--i >= 0) { |
| 383 | struct imxdma_channel *imxdmac = &imxdma->channel[i]; | 383 | struct imxdma_channel *imxdmac = &imxdma->channel[i]; |
| 384 | imx_dma_free(imxdmac->imxdma_channel); | 384 | imx_dma_free(imxdmac->imxdma_channel); |
| 385 | } | 385 | } |
diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index 0834323a0599..d0602dd5d1b2 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c | |||
| @@ -951,7 +951,7 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( | |||
| 951 | struct sdma_buffer_descriptor *bd = &sdmac->bd[i]; | 951 | struct sdma_buffer_descriptor *bd = &sdmac->bd[i]; |
| 952 | int param; | 952 | int param; |
| 953 | 953 | ||
| 954 | bd->buffer_addr = sgl->dma_address; | 954 | bd->buffer_addr = sg->dma_address; |
| 955 | 955 | ||
| 956 | count = sg->length; | 956 | count = sg->length; |
| 957 | 957 | ||
| @@ -1385,7 +1385,7 @@ static int __init sdma_module_init(void) | |||
| 1385 | { | 1385 | { |
| 1386 | return platform_driver_probe(&sdma_driver, sdma_probe); | 1386 | return platform_driver_probe(&sdma_driver, sdma_probe); |
| 1387 | } | 1387 | } |
| 1388 | subsys_initcall(sdma_module_init); | 1388 | module_init(sdma_module_init); |
| 1389 | 1389 | ||
| 1390 | MODULE_AUTHOR("Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>"); | 1390 | MODULE_AUTHOR("Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>"); |
| 1391 | MODULE_DESCRIPTION("i.MX SDMA driver"); | 1391 | MODULE_DESCRIPTION("i.MX SDMA driver"); |
diff --git a/drivers/dma/intel_mid_dma.c b/drivers/dma/intel_mid_dma.c index 338bc4eed1f3..3109bd94bc4f 100644 --- a/drivers/dma/intel_mid_dma.c +++ b/drivers/dma/intel_mid_dma.c | |||
| @@ -1075,7 +1075,6 @@ static int mid_setup_dma(struct pci_dev *pdev) | |||
| 1075 | if (NULL == dma->dma_pool) { | 1075 | if (NULL == dma->dma_pool) { |
| 1076 | pr_err("ERR_MDMA:pci_pool_create failed\n"); | 1076 | pr_err("ERR_MDMA:pci_pool_create failed\n"); |
| 1077 | err = -ENOMEM; | 1077 | err = -ENOMEM; |
| 1078 | kfree(dma); | ||
| 1079 | goto err_dma_pool; | 1078 | goto err_dma_pool; |
| 1080 | } | 1079 | } |
| 1081 | 1080 | ||
| @@ -1186,7 +1185,6 @@ err_engine: | |||
| 1186 | free_irq(pdev->irq, dma); | 1185 | free_irq(pdev->irq, dma); |
| 1187 | err_irq: | 1186 | err_irq: |
| 1188 | pci_pool_destroy(dma->dma_pool); | 1187 | pci_pool_destroy(dma->dma_pool); |
| 1189 | kfree(dma); | ||
| 1190 | err_dma_pool: | 1188 | err_dma_pool: |
| 1191 | pr_err("ERR_MDMA:setup_dma failed: %d\n", err); | 1189 | pr_err("ERR_MDMA:setup_dma failed: %d\n", err); |
| 1192 | return err; | 1190 | return err; |
| @@ -1413,7 +1411,7 @@ static const struct dev_pm_ops intel_mid_dma_pm = { | |||
| 1413 | .runtime_idle = dma_runtime_idle, | 1411 | .runtime_idle = dma_runtime_idle, |
| 1414 | }; | 1412 | }; |
| 1415 | 1413 | ||
| 1416 | static struct pci_driver intel_mid_dma_pci = { | 1414 | static struct pci_driver intel_mid_dma_pci_driver = { |
| 1417 | .name = "Intel MID DMA", | 1415 | .name = "Intel MID DMA", |
| 1418 | .id_table = intel_mid_dma_ids, | 1416 | .id_table = intel_mid_dma_ids, |
| 1419 | .probe = intel_mid_dma_probe, | 1417 | .probe = intel_mid_dma_probe, |
| @@ -1431,13 +1429,13 @@ static int __init intel_mid_dma_init(void) | |||
| 1431 | { | 1429 | { |
| 1432 | pr_debug("INFO_MDMA: LNW DMA Driver Version %s\n", | 1430 | pr_debug("INFO_MDMA: LNW DMA Driver Version %s\n", |
| 1433 | INTEL_MID_DMA_DRIVER_VERSION); | 1431 | INTEL_MID_DMA_DRIVER_VERSION); |
| 1434 | return pci_register_driver(&intel_mid_dma_pci); | 1432 | return pci_register_driver(&intel_mid_dma_pci_driver); |
| 1435 | } | 1433 | } |
| 1436 | fs_initcall(intel_mid_dma_init); | 1434 | fs_initcall(intel_mid_dma_init); |
| 1437 | 1435 | ||
| 1438 | static void __exit intel_mid_dma_exit(void) | 1436 | static void __exit intel_mid_dma_exit(void) |
| 1439 | { | 1437 | { |
| 1440 | pci_unregister_driver(&intel_mid_dma_pci); | 1438 | pci_unregister_driver(&intel_mid_dma_pci_driver); |
| 1441 | } | 1439 | } |
| 1442 | module_exit(intel_mid_dma_exit); | 1440 | module_exit(intel_mid_dma_exit); |
| 1443 | 1441 | ||
diff --git a/drivers/dma/ioat/Makefile b/drivers/dma/ioat/Makefile index 8997d3fb9051..0ff7270af25b 100644 --- a/drivers/dma/ioat/Makefile +++ b/drivers/dma/ioat/Makefile | |||
| @@ -1,2 +1,2 @@ | |||
| 1 | obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o | 1 | obj-$(CONFIG_INTEL_IOATDMA) += ioatdma.o |
| 2 | ioatdma-objs := pci.o dma.o dma_v2.o dma_v3.o dca.o | 2 | ioatdma-y := pci.o dma.o dma_v2.o dma_v3.o dca.o |
diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index 92b679024fed..c064c89420d0 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c | |||
| @@ -259,11 +259,6 @@ static void pdc_dostart(struct pch_dma_chan *pd_chan, struct pch_dma_desc* desc) | |||
| 259 | return; | 259 | return; |
| 260 | } | 260 | } |
| 261 | 261 | ||
| 262 | channel_writel(pd_chan, DEV_ADDR, desc->regs.dev_addr); | ||
| 263 | channel_writel(pd_chan, MEM_ADDR, desc->regs.mem_addr); | ||
| 264 | channel_writel(pd_chan, SIZE, desc->regs.size); | ||
| 265 | channel_writel(pd_chan, NEXT, desc->regs.next); | ||
| 266 | |||
| 267 | dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> dev_addr: %x\n", | 262 | dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> dev_addr: %x\n", |
| 268 | pd_chan->chan.chan_id, desc->regs.dev_addr); | 263 | pd_chan->chan.chan_id, desc->regs.dev_addr); |
| 269 | dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> mem_addr: %x\n", | 264 | dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> mem_addr: %x\n", |
| @@ -273,10 +268,16 @@ static void pdc_dostart(struct pch_dma_chan *pd_chan, struct pch_dma_desc* desc) | |||
| 273 | dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> next: %x\n", | 268 | dev_dbg(chan2dev(&pd_chan->chan), "chan %d -> next: %x\n", |
| 274 | pd_chan->chan.chan_id, desc->regs.next); | 269 | pd_chan->chan.chan_id, desc->regs.next); |
| 275 | 270 | ||
| 276 | if (list_empty(&desc->tx_list)) | 271 | if (list_empty(&desc->tx_list)) { |
| 272 | channel_writel(pd_chan, DEV_ADDR, desc->regs.dev_addr); | ||
| 273 | channel_writel(pd_chan, MEM_ADDR, desc->regs.mem_addr); | ||
| 274 | channel_writel(pd_chan, SIZE, desc->regs.size); | ||
| 275 | channel_writel(pd_chan, NEXT, desc->regs.next); | ||
| 277 | pdc_set_mode(&pd_chan->chan, DMA_CTL0_ONESHOT); | 276 | pdc_set_mode(&pd_chan->chan, DMA_CTL0_ONESHOT); |
| 278 | else | 277 | } else { |
| 278 | channel_writel(pd_chan, NEXT, desc->txd.phys); | ||
| 279 | pdc_set_mode(&pd_chan->chan, DMA_CTL0_SG); | 279 | pdc_set_mode(&pd_chan->chan, DMA_CTL0_SG); |
| 280 | } | ||
| 280 | 281 | ||
| 281 | val = dma_readl(pd, CTL2); | 282 | val = dma_readl(pd, CTL2); |
| 282 | val |= 1 << (DMA_CTL2_START_SHIFT_BITS + pd_chan->chan.chan_id); | 283 | val |= 1 << (DMA_CTL2_START_SHIFT_BITS + pd_chan->chan.chan_id); |
diff --git a/drivers/dma/ppc4xx/adma.c b/drivers/dma/ppc4xx/adma.c index 0d58a4a4487f..cef584533ee8 100644 --- a/drivers/dma/ppc4xx/adma.c +++ b/drivers/dma/ppc4xx/adma.c | |||
| @@ -4449,9 +4449,8 @@ static int __devinit ppc440spe_adma_probe(struct platform_device *ofdev, | |||
| 4449 | 4449 | ||
| 4450 | if (!request_mem_region(res.start, resource_size(&res), | 4450 | if (!request_mem_region(res.start, resource_size(&res), |
| 4451 | dev_driver_string(&ofdev->dev))) { | 4451 | dev_driver_string(&ofdev->dev))) { |
| 4452 | dev_err(&ofdev->dev, "failed to request memory region " | 4452 | dev_err(&ofdev->dev, "failed to request memory region %pR\n", |
| 4453 | "(0x%016llx-0x%016llx)\n", | 4453 | &res); |
| 4454 | (u64)res.start, (u64)res.end); | ||
| 4455 | initcode = PPC_ADMA_INIT_MEMREG; | 4454 | initcode = PPC_ADMA_INIT_MEMREG; |
| 4456 | ret = -EBUSY; | 4455 | ret = -EBUSY; |
| 4457 | goto out; | 4456 | goto out; |
diff --git a/drivers/dma/shdma.c b/drivers/dma/shdma.c index eb6b54dbb806..85ffd5e38c50 100644 --- a/drivers/dma/shdma.c +++ b/drivers/dma/shdma.c | |||
| @@ -1213,3 +1213,4 @@ module_exit(sh_dmae_exit); | |||
| 1213 | MODULE_AUTHOR("Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>"); | 1213 | MODULE_AUTHOR("Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>"); |
| 1214 | MODULE_DESCRIPTION("Renesas SH DMA Engine driver"); | 1214 | MODULE_DESCRIPTION("Renesas SH DMA Engine driver"); |
| 1215 | MODULE_LICENSE("GPL"); | 1215 | MODULE_LICENSE("GPL"); |
| 1216 | MODULE_ALIAS("platform:sh-dma-engine"); | ||
diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c index 8521401bbd75..eca9ba193e94 100644 --- a/drivers/edac/amd64_edac.c +++ b/drivers/edac/amd64_edac.c | |||
| @@ -1572,7 +1572,7 @@ static int f10_match_to_this_node(struct amd64_pvt *pvt, int dram_range, | |||
| 1572 | debugf1(" HoleOffset=0x%x HoleValid=0x%x IntlvSel=0x%x\n", | 1572 | debugf1(" HoleOffset=0x%x HoleValid=0x%x IntlvSel=0x%x\n", |
| 1573 | hole_off, hole_valid, intlv_sel); | 1573 | hole_off, hole_valid, intlv_sel); |
| 1574 | 1574 | ||
| 1575 | if (intlv_en || | 1575 | if (intlv_en && |
| 1576 | (intlv_sel != ((sys_addr >> 12) & intlv_en))) | 1576 | (intlv_sel != ((sys_addr >> 12) & intlv_en))) |
| 1577 | return -EINVAL; | 1577 | return -EINVAL; |
| 1578 | 1578 | ||
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index d7ca43a828bd..251440cd50a3 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
| @@ -41,10 +41,10 @@ | |||
| 41 | #define MC_PROC_NAME_MAX_LEN 7 | 41 | #define MC_PROC_NAME_MAX_LEN 7 |
| 42 | 42 | ||
| 43 | #if PAGE_SHIFT < 20 | 43 | #if PAGE_SHIFT < 20 |
| 44 | #define PAGES_TO_MiB( pages ) ( ( pages ) >> ( 20 - PAGE_SHIFT ) ) | 44 | #define PAGES_TO_MiB(pages) ((pages) >> (20 - PAGE_SHIFT)) |
| 45 | #define MiB_TO_PAGES(mb) ((mb) >> (20 - PAGE_SHIFT)) | 45 | #define MiB_TO_PAGES(mb) ((mb) << (20 - PAGE_SHIFT)) |
| 46 | #else /* PAGE_SHIFT > 20 */ | 46 | #else /* PAGE_SHIFT > 20 */ |
| 47 | #define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) ) | 47 | #define PAGES_TO_MiB(pages) ((pages) << (PAGE_SHIFT - 20)) |
| 48 | #define MiB_TO_PAGES(mb) ((mb) >> (PAGE_SHIFT - 20)) | 48 | #define MiB_TO_PAGES(mb) ((mb) >> (PAGE_SHIFT - 20)) |
| 49 | #endif | 49 | #endif |
| 50 | 50 | ||
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index ba6586a69ccc..795ea69c4d8f 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c | |||
| @@ -586,14 +586,16 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev) | |||
| 586 | return NULL; | 586 | return NULL; |
| 587 | } | 587 | } |
| 588 | 588 | ||
| 589 | /* marking MCI offline */ | ||
| 590 | mci->op_state = OP_OFFLINE; | ||
| 591 | |||
| 592 | del_mc_from_global_list(mci); | 589 | del_mc_from_global_list(mci); |
| 593 | mutex_unlock(&mem_ctls_mutex); | 590 | mutex_unlock(&mem_ctls_mutex); |
| 594 | 591 | ||
| 595 | /* flush workq processes and remove sysfs */ | 592 | /* flush workq processes */ |
| 596 | edac_mc_workq_teardown(mci); | 593 | edac_mc_workq_teardown(mci); |
| 594 | |||
| 595 | /* marking MCI offline */ | ||
| 596 | mci->op_state = OP_OFFLINE; | ||
| 597 | |||
| 598 | /* remove from sysfs */ | ||
| 597 | edac_remove_sysfs_mci_device(mci); | 599 | edac_remove_sysfs_mci_device(mci); |
| 598 | 600 | ||
| 599 | edac_printk(KERN_INFO, EDAC_MC, | 601 | edac_printk(KERN_INFO, EDAC_MC, |
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 84eb607d6c03..e3c8b60bd86b 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c | |||
| @@ -242,6 +242,7 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card) | |||
| 242 | 242 | ||
| 243 | static char ohci_driver_name[] = KBUILD_MODNAME; | 243 | static char ohci_driver_name[] = KBUILD_MODNAME; |
| 244 | 244 | ||
| 245 | #define PCI_DEVICE_ID_AGERE_FW643 0x5901 | ||
| 245 | #define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380 | 246 | #define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380 |
| 246 | #define PCI_DEVICE_ID_TI_TSB12LV22 0x8009 | 247 | #define PCI_DEVICE_ID_TI_TSB12LV22 0x8009 |
| 247 | 248 | ||
| @@ -253,18 +254,34 @@ static char ohci_driver_name[] = KBUILD_MODNAME; | |||
| 253 | 254 | ||
| 254 | /* In case of multiple matches in ohci_quirks[], only the first one is used. */ | 255 | /* In case of multiple matches in ohci_quirks[], only the first one is used. */ |
| 255 | static const struct { | 256 | static const struct { |
| 256 | unsigned short vendor, device, flags; | 257 | unsigned short vendor, device, revision, flags; |
| 257 | } ohci_quirks[] = { | 258 | } ohci_quirks[] = { |
| 258 | {PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TSB12LV22, QUIRK_CYCLE_TIMER | | 259 | {PCI_VENDOR_ID_AL, PCI_ANY_ID, PCI_ANY_ID, |
| 259 | QUIRK_RESET_PACKET | | 260 | QUIRK_CYCLE_TIMER}, |
| 260 | QUIRK_NO_1394A}, | 261 | |
| 261 | {PCI_VENDOR_ID_TI, PCI_ANY_ID, QUIRK_RESET_PACKET}, | 262 | {PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_FW, PCI_ANY_ID, |
| 262 | {PCI_VENDOR_ID_AL, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | 263 | QUIRK_BE_HEADERS}, |
| 263 | {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, QUIRK_NO_MSI}, | 264 | |
| 264 | {PCI_VENDOR_ID_NEC, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | 265 | {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6, |
| 265 | {PCI_VENDOR_ID_VIA, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | 266 | QUIRK_NO_MSI}, |
| 266 | {PCI_VENDOR_ID_RICOH, PCI_ANY_ID, QUIRK_CYCLE_TIMER}, | 267 | |
| 267 | {PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_FW, QUIRK_BE_HEADERS}, | 268 | {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, PCI_ANY_ID, |
| 269 | QUIRK_NO_MSI}, | ||
| 270 | |||
| 271 | {PCI_VENDOR_ID_NEC, PCI_ANY_ID, PCI_ANY_ID, | ||
| 272 | QUIRK_CYCLE_TIMER}, | ||
| 273 | |||
| 274 | {PCI_VENDOR_ID_RICOH, PCI_ANY_ID, PCI_ANY_ID, | ||
| 275 | QUIRK_CYCLE_TIMER}, | ||
| 276 | |||
| 277 | {PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TSB12LV22, PCI_ANY_ID, | ||
| 278 | QUIRK_CYCLE_TIMER | QUIRK_RESET_PACKET | QUIRK_NO_1394A}, | ||
| 279 | |||
| 280 | {PCI_VENDOR_ID_TI, PCI_ANY_ID, PCI_ANY_ID, | ||
| 281 | QUIRK_RESET_PACKET}, | ||
| 282 | |||
| 283 | {PCI_VENDOR_ID_VIA, PCI_ANY_ID, PCI_ANY_ID, | ||
| 284 | QUIRK_CYCLE_TIMER | QUIRK_NO_MSI}, | ||
| 268 | }; | 285 | }; |
| 269 | 286 | ||
| 270 | /* This overrides anything that was found in ohci_quirks[]. */ | 287 | /* This overrides anything that was found in ohci_quirks[]. */ |
| @@ -2927,9 +2944,11 @@ static int __devinit pci_probe(struct pci_dev *dev, | |||
| 2927 | } | 2944 | } |
| 2928 | 2945 | ||
| 2929 | for (i = 0; i < ARRAY_SIZE(ohci_quirks); i++) | 2946 | for (i = 0; i < ARRAY_SIZE(ohci_quirks); i++) |
| 2930 | if (ohci_quirks[i].vendor == dev->vendor && | 2947 | if ((ohci_quirks[i].vendor == dev->vendor) && |
| 2931 | (ohci_quirks[i].device == dev->device || | 2948 | (ohci_quirks[i].device == (unsigned short)PCI_ANY_ID || |
| 2932 | ohci_quirks[i].device == (unsigned short)PCI_ANY_ID)) { | 2949 | ohci_quirks[i].device == dev->device) && |
| 2950 | (ohci_quirks[i].revision == (unsigned short)PCI_ANY_ID || | ||
| 2951 | ohci_quirks[i].revision >= dev->revision)) { | ||
| 2933 | ohci->quirks = ohci_quirks[i].flags; | 2952 | ohci->quirks = ohci_quirks[i].flags; |
| 2934 | break; | 2953 | break; |
| 2935 | } | 2954 | } |
diff --git a/drivers/gpio/cs5535-gpio.c b/drivers/gpio/cs5535-gpio.c index e23c06893d19..599f6c9e0fbf 100644 --- a/drivers/gpio/cs5535-gpio.c +++ b/drivers/gpio/cs5535-gpio.c | |||
| @@ -56,6 +56,18 @@ static struct cs5535_gpio_chip { | |||
| 56 | * registers, see include/linux/cs5535.h. | 56 | * registers, see include/linux/cs5535.h. |
| 57 | */ | 57 | */ |
| 58 | 58 | ||
| 59 | static void errata_outl(u32 val, unsigned long addr) | ||
| 60 | { | ||
| 61 | /* | ||
| 62 | * According to the CS5536 errata (#36), after suspend | ||
| 63 | * a write to the high bank GPIO register will clear all | ||
| 64 | * non-selected bits; the recommended workaround is a | ||
| 65 | * read-modify-write operation. | ||
| 66 | */ | ||
| 67 | val |= inl(addr); | ||
| 68 | outl(val, addr); | ||
| 69 | } | ||
| 70 | |||
| 59 | static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset, | 71 | static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset, |
| 60 | unsigned int reg) | 72 | unsigned int reg) |
| 61 | { | 73 | { |
| @@ -64,7 +76,7 @@ static void __cs5535_gpio_set(struct cs5535_gpio_chip *chip, unsigned offset, | |||
| 64 | outl(1 << offset, chip->base + reg); | 76 | outl(1 << offset, chip->base + reg); |
| 65 | else | 77 | else |
| 66 | /* high bank register */ | 78 | /* high bank register */ |
| 67 | outl(1 << (offset - 16), chip->base + 0x80 + reg); | 79 | errata_outl(1 << (offset - 16), chip->base + 0x80 + reg); |
| 68 | } | 80 | } |
| 69 | 81 | ||
| 70 | void cs5535_gpio_set(unsigned offset, unsigned int reg) | 82 | void cs5535_gpio_set(unsigned offset, unsigned int reg) |
| @@ -86,7 +98,7 @@ static void __cs5535_gpio_clear(struct cs5535_gpio_chip *chip, unsigned offset, | |||
| 86 | outl(1 << (offset + 16), chip->base + reg); | 98 | outl(1 << (offset + 16), chip->base + reg); |
| 87 | else | 99 | else |
| 88 | /* high bank register */ | 100 | /* high bank register */ |
| 89 | outl(1 << offset, chip->base + 0x80 + reg); | 101 | errata_outl(1 << offset, chip->base + 0x80 + reg); |
| 90 | } | 102 | } |
| 91 | 103 | ||
| 92 | void cs5535_gpio_clear(unsigned offset, unsigned int reg) | 104 | void cs5535_gpio_clear(unsigned offset, unsigned int reg) |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index 6985cb1da72c..2baa6708e44c 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -156,12 +156,12 @@ static struct drm_conn_prop_enum_list drm_connector_enum_list[] = | |||
| 156 | { DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 }, | 156 | { DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO", 0 }, |
| 157 | { DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 }, | 157 | { DRM_MODE_CONNECTOR_LVDS, "LVDS", 0 }, |
| 158 | { DRM_MODE_CONNECTOR_Component, "Component", 0 }, | 158 | { DRM_MODE_CONNECTOR_Component, "Component", 0 }, |
| 159 | { DRM_MODE_CONNECTOR_9PinDIN, "9-pin DIN", 0 }, | 159 | { DRM_MODE_CONNECTOR_9PinDIN, "DIN", 0 }, |
| 160 | { DRM_MODE_CONNECTOR_DisplayPort, "DisplayPort", 0 }, | 160 | { DRM_MODE_CONNECTOR_DisplayPort, "DP", 0 }, |
| 161 | { DRM_MODE_CONNECTOR_HDMIA, "HDMI Type A", 0 }, | 161 | { DRM_MODE_CONNECTOR_HDMIA, "HDMI-A", 0 }, |
| 162 | { DRM_MODE_CONNECTOR_HDMIB, "HDMI Type B", 0 }, | 162 | { DRM_MODE_CONNECTOR_HDMIB, "HDMI-B", 0 }, |
| 163 | { DRM_MODE_CONNECTOR_TV, "TV", 0 }, | 163 | { DRM_MODE_CONNECTOR_TV, "TV", 0 }, |
| 164 | { DRM_MODE_CONNECTOR_eDP, "Embedded DisplayPort", 0 }, | 164 | { DRM_MODE_CONNECTOR_eDP, "eDP", 0 }, |
| 165 | }; | 165 | }; |
| 166 | 166 | ||
| 167 | static struct drm_prop_enum_list drm_encoder_enum_list[] = | 167 | static struct drm_prop_enum_list drm_encoder_enum_list[] = |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index f7af91cb273d..bede10a03407 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -241,7 +241,7 @@ void drm_helper_disable_unused_functions(struct drm_device *dev) | |||
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 243 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
| 244 | if (!drm_helper_encoder_in_use(encoder)) { | 244 | if (encoder->crtc && !drm_helper_encoder_in_use(encoder)) { |
| 245 | drm_encoder_disable(encoder); | 245 | drm_encoder_disable(encoder); |
| 246 | /* disconnector encoder from any connector */ | 246 | /* disconnector encoder from any connector */ |
| 247 | encoder->crtc = NULL; | 247 | encoder->crtc = NULL; |
| @@ -471,6 +471,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 471 | int count = 0, ro, fail = 0; | 471 | int count = 0, ro, fail = 0; |
| 472 | struct drm_crtc_helper_funcs *crtc_funcs; | 472 | struct drm_crtc_helper_funcs *crtc_funcs; |
| 473 | int ret = 0; | 473 | int ret = 0; |
| 474 | int i; | ||
| 474 | 475 | ||
| 475 | DRM_DEBUG_KMS("\n"); | 476 | DRM_DEBUG_KMS("\n"); |
| 476 | 477 | ||
| @@ -666,6 +667,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) | |||
| 666 | if (ret != 0) | 667 | if (ret != 0) |
| 667 | goto fail; | 668 | goto fail; |
| 668 | } | 669 | } |
| 670 | DRM_DEBUG_KMS("Setting connector DPMS state to on\n"); | ||
| 671 | for (i = 0; i < set->num_connectors; i++) { | ||
| 672 | DRM_DEBUG_KMS("\t[CONNECTOR:%d:%s] set DPMS on\n", set->connectors[i]->base.id, | ||
| 673 | drm_get_connector_name(set->connectors[i])); | ||
| 674 | set->connectors[i]->dpms = DRM_MODE_DPMS_ON; | ||
| 675 | } | ||
| 669 | 676 | ||
| 670 | kfree(save_connectors); | 677 | kfree(save_connectors); |
| 671 | kfree(save_encoders); | 678 | kfree(save_encoders); |
| @@ -841,7 +848,7 @@ static void output_poll_execute(struct work_struct *work) | |||
| 841 | struct delayed_work *delayed_work = to_delayed_work(work); | 848 | struct delayed_work *delayed_work = to_delayed_work(work); |
| 842 | struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work); | 849 | struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work); |
| 843 | struct drm_connector *connector; | 850 | struct drm_connector *connector; |
| 844 | enum drm_connector_status old_status, status; | 851 | enum drm_connector_status old_status; |
| 845 | bool repoll = false, changed = false; | 852 | bool repoll = false, changed = false; |
| 846 | 853 | ||
| 847 | if (!drm_kms_helper_poll) | 854 | if (!drm_kms_helper_poll) |
| @@ -866,8 +873,9 @@ static void output_poll_execute(struct work_struct *work) | |||
| 866 | !(connector->polled & DRM_CONNECTOR_POLL_HPD)) | 873 | !(connector->polled & DRM_CONNECTOR_POLL_HPD)) |
| 867 | continue; | 874 | continue; |
| 868 | 875 | ||
| 869 | status = connector->funcs->detect(connector, false); | 876 | connector->status = connector->funcs->detect(connector, false); |
| 870 | if (old_status != status) | 877 | DRM_DEBUG_KMS("connector status updated to %d\n", connector->status); |
| 878 | if (old_status != connector->status) | ||
| 871 | changed = true; | 879 | changed = true; |
| 872 | } | 880 | } |
| 873 | 881 | ||
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 9d3a5030b6e1..16d5155edad1 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -585,10 +585,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
| 585 | struct timeval now; | 585 | struct timeval now; |
| 586 | unsigned long flags; | 586 | unsigned long flags; |
| 587 | unsigned int seq; | 587 | unsigned int seq; |
| 588 | int ret; | ||
| 588 | 589 | ||
| 589 | e = kzalloc(sizeof *e, GFP_KERNEL); | 590 | e = kzalloc(sizeof *e, GFP_KERNEL); |
| 590 | if (e == NULL) | 591 | if (e == NULL) { |
| 591 | return -ENOMEM; | 592 | ret = -ENOMEM; |
| 593 | goto err_put; | ||
| 594 | } | ||
| 592 | 595 | ||
| 593 | e->pipe = pipe; | 596 | e->pipe = pipe; |
| 594 | e->base.pid = current->pid; | 597 | e->base.pid = current->pid; |
| @@ -603,9 +606,8 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
| 603 | spin_lock_irqsave(&dev->event_lock, flags); | 606 | spin_lock_irqsave(&dev->event_lock, flags); |
| 604 | 607 | ||
| 605 | if (file_priv->event_space < sizeof e->event) { | 608 | if (file_priv->event_space < sizeof e->event) { |
| 606 | spin_unlock_irqrestore(&dev->event_lock, flags); | 609 | ret = -EBUSY; |
| 607 | kfree(e); | 610 | goto err_unlock; |
| 608 | return -ENOMEM; | ||
| 609 | } | 611 | } |
| 610 | 612 | ||
| 611 | file_priv->event_space -= sizeof e->event; | 613 | file_priv->event_space -= sizeof e->event; |
| @@ -626,7 +628,7 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
| 626 | if ((seq - vblwait->request.sequence) <= (1 << 23)) { | 628 | if ((seq - vblwait->request.sequence) <= (1 << 23)) { |
| 627 | e->event.tv_sec = now.tv_sec; | 629 | e->event.tv_sec = now.tv_sec; |
| 628 | e->event.tv_usec = now.tv_usec; | 630 | e->event.tv_usec = now.tv_usec; |
| 629 | drm_vblank_put(dev, e->pipe); | 631 | drm_vblank_put(dev, pipe); |
| 630 | list_add_tail(&e->base.link, &e->base.file_priv->event_list); | 632 | list_add_tail(&e->base.link, &e->base.file_priv->event_list); |
| 631 | wake_up_interruptible(&e->base.file_priv->event_wait); | 633 | wake_up_interruptible(&e->base.file_priv->event_wait); |
| 632 | trace_drm_vblank_event_delivered(current->pid, pipe, | 634 | trace_drm_vblank_event_delivered(current->pid, pipe, |
| @@ -638,6 +640,13 @@ static int drm_queue_vblank_event(struct drm_device *dev, int pipe, | |||
| 638 | spin_unlock_irqrestore(&dev->event_lock, flags); | 640 | spin_unlock_irqrestore(&dev->event_lock, flags); |
| 639 | 641 | ||
| 640 | return 0; | 642 | return 0; |
| 643 | |||
| 644 | err_unlock: | ||
| 645 | spin_unlock_irqrestore(&dev->event_lock, flags); | ||
| 646 | kfree(e); | ||
| 647 | err_put: | ||
| 648 | drm_vblank_put(dev, pipe); | ||
| 649 | return ret; | ||
| 641 | } | 650 | } |
| 642 | 651 | ||
| 643 | /** | 652 | /** |
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 7a26f4dd21ae..e6800819bca8 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
| @@ -767,6 +767,9 @@ static int i915_getparam(struct drm_device *dev, void *data, | |||
| 767 | case I915_PARAM_HAS_BLT: | 767 | case I915_PARAM_HAS_BLT: |
| 768 | value = HAS_BLT(dev); | 768 | value = HAS_BLT(dev); |
| 769 | break; | 769 | break; |
| 770 | case I915_PARAM_HAS_COHERENT_RINGS: | ||
| 771 | value = 1; | ||
| 772 | break; | ||
| 770 | default: | 773 | default: |
| 771 | DRM_DEBUG_DRIVER("Unknown parameter %d\n", | 774 | DRM_DEBUG_DRIVER("Unknown parameter %d\n", |
| 772 | param->param); | 775 | param->param); |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 17b1cba3b5f1..275ec6ed43ae 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
| @@ -38,8 +38,7 @@ | |||
| 38 | 38 | ||
| 39 | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); | 39 | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); |
| 40 | 40 | ||
| 41 | static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, | 41 | static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); |
| 42 | bool pipelined); | ||
| 43 | static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); | 42 | static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); |
| 44 | static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); | 43 | static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); |
| 45 | static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, | 44 | static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, |
| @@ -2594,7 +2593,7 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj, | |||
| 2594 | if (reg->gpu) { | 2593 | if (reg->gpu) { |
| 2595 | int ret; | 2594 | int ret; |
| 2596 | 2595 | ||
| 2597 | ret = i915_gem_object_flush_gpu_write_domain(obj, true); | 2596 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
| 2598 | if (ret) | 2597 | if (ret) |
| 2599 | return ret; | 2598 | return ret; |
| 2600 | 2599 | ||
| @@ -2742,8 +2741,7 @@ i915_gem_clflush_object(struct drm_gem_object *obj) | |||
| 2742 | 2741 | ||
| 2743 | /** Flushes any GPU write domain for the object if it's dirty. */ | 2742 | /** Flushes any GPU write domain for the object if it's dirty. */ |
| 2744 | static int | 2743 | static int |
| 2745 | i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, | 2744 | i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj) |
| 2746 | bool pipelined) | ||
| 2747 | { | 2745 | { |
| 2748 | struct drm_device *dev = obj->dev; | 2746 | struct drm_device *dev = obj->dev; |
| 2749 | uint32_t old_write_domain; | 2747 | uint32_t old_write_domain; |
| @@ -2762,10 +2760,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, | |||
| 2762 | obj->read_domains, | 2760 | obj->read_domains, |
| 2763 | old_write_domain); | 2761 | old_write_domain); |
| 2764 | 2762 | ||
| 2765 | if (pipelined) | 2763 | return 0; |
| 2766 | return 0; | ||
| 2767 | |||
| 2768 | return i915_gem_object_wait_rendering(obj, true); | ||
| 2769 | } | 2764 | } |
| 2770 | 2765 | ||
| 2771 | /** Flushes the GTT write domain for the object if it's dirty. */ | 2766 | /** Flushes the GTT write domain for the object if it's dirty. */ |
| @@ -2826,18 +2821,15 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write) | |||
| 2826 | if (obj_priv->gtt_space == NULL) | 2821 | if (obj_priv->gtt_space == NULL) |
| 2827 | return -EINVAL; | 2822 | return -EINVAL; |
| 2828 | 2823 | ||
| 2829 | ret = i915_gem_object_flush_gpu_write_domain(obj, false); | 2824 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
| 2830 | if (ret != 0) | 2825 | if (ret != 0) |
| 2831 | return ret; | 2826 | return ret; |
| 2827 | ret = i915_gem_object_wait_rendering(obj, true); | ||
| 2828 | if (ret) | ||
| 2829 | return ret; | ||
| 2832 | 2830 | ||
| 2833 | i915_gem_object_flush_cpu_write_domain(obj); | 2831 | i915_gem_object_flush_cpu_write_domain(obj); |
| 2834 | 2832 | ||
| 2835 | if (write) { | ||
| 2836 | ret = i915_gem_object_wait_rendering(obj, true); | ||
| 2837 | if (ret) | ||
| 2838 | return ret; | ||
| 2839 | } | ||
| 2840 | |||
| 2841 | old_write_domain = obj->write_domain; | 2833 | old_write_domain = obj->write_domain; |
| 2842 | old_read_domains = obj->read_domains; | 2834 | old_read_domains = obj->read_domains; |
| 2843 | 2835 | ||
| @@ -2875,7 +2867,7 @@ i915_gem_object_set_to_display_plane(struct drm_gem_object *obj, | |||
| 2875 | if (obj_priv->gtt_space == NULL) | 2867 | if (obj_priv->gtt_space == NULL) |
| 2876 | return -EINVAL; | 2868 | return -EINVAL; |
| 2877 | 2869 | ||
| 2878 | ret = i915_gem_object_flush_gpu_write_domain(obj, true); | 2870 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
| 2879 | if (ret) | 2871 | if (ret) |
| 2880 | return ret; | 2872 | return ret; |
| 2881 | 2873 | ||
| @@ -2924,9 +2916,12 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) | |||
| 2924 | uint32_t old_write_domain, old_read_domains; | 2916 | uint32_t old_write_domain, old_read_domains; |
| 2925 | int ret; | 2917 | int ret; |
| 2926 | 2918 | ||
| 2927 | ret = i915_gem_object_flush_gpu_write_domain(obj, false); | 2919 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
| 2928 | if (ret != 0) | 2920 | if (ret != 0) |
| 2929 | return ret; | 2921 | return ret; |
| 2922 | ret = i915_gem_object_wait_rendering(obj, true); | ||
| 2923 | if (ret) | ||
| 2924 | return ret; | ||
| 2930 | 2925 | ||
| 2931 | i915_gem_object_flush_gtt_write_domain(obj); | 2926 | i915_gem_object_flush_gtt_write_domain(obj); |
| 2932 | 2927 | ||
| @@ -2935,12 +2930,6 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) | |||
| 2935 | */ | 2930 | */ |
| 2936 | i915_gem_object_set_to_full_cpu_read_domain(obj); | 2931 | i915_gem_object_set_to_full_cpu_read_domain(obj); |
| 2937 | 2932 | ||
| 2938 | if (write) { | ||
| 2939 | ret = i915_gem_object_wait_rendering(obj, true); | ||
| 2940 | if (ret) | ||
| 2941 | return ret; | ||
| 2942 | } | ||
| 2943 | |||
| 2944 | old_write_domain = obj->write_domain; | 2933 | old_write_domain = obj->write_domain; |
| 2945 | old_read_domains = obj->read_domains; | 2934 | old_read_domains = obj->read_domains; |
| 2946 | 2935 | ||
| @@ -3205,9 +3194,13 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, | |||
| 3205 | if (offset == 0 && size == obj->size) | 3194 | if (offset == 0 && size == obj->size) |
| 3206 | return i915_gem_object_set_to_cpu_domain(obj, 0); | 3195 | return i915_gem_object_set_to_cpu_domain(obj, 0); |
| 3207 | 3196 | ||
| 3208 | ret = i915_gem_object_flush_gpu_write_domain(obj, false); | 3197 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
| 3209 | if (ret != 0) | 3198 | if (ret != 0) |
| 3210 | return ret; | 3199 | return ret; |
| 3200 | ret = i915_gem_object_wait_rendering(obj, true); | ||
| 3201 | if (ret) | ||
| 3202 | return ret; | ||
| 3203 | |||
| 3211 | i915_gem_object_flush_gtt_write_domain(obj); | 3204 | i915_gem_object_flush_gtt_write_domain(obj); |
| 3212 | 3205 | ||
| 3213 | /* If we're already fully in the CPU read domain, we're done. */ | 3206 | /* If we're already fully in the CPU read domain, we're done. */ |
| @@ -3254,192 +3247,230 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, | |||
| 3254 | return 0; | 3247 | return 0; |
| 3255 | } | 3248 | } |
| 3256 | 3249 | ||
| 3257 | /** | ||
| 3258 | * Pin an object to the GTT and evaluate the relocations landing in it. | ||
| 3259 | */ | ||
| 3260 | static int | 3250 | static int |
| 3261 | i915_gem_execbuffer_relocate(struct drm_i915_gem_object *obj, | 3251 | i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj, |
| 3262 | struct drm_file *file_priv, | 3252 | struct drm_file *file_priv, |
| 3263 | struct drm_i915_gem_exec_object2 *entry) | 3253 | struct drm_i915_gem_exec_object2 *entry, |
| 3254 | struct drm_i915_gem_relocation_entry *reloc) | ||
| 3264 | { | 3255 | { |
| 3265 | struct drm_device *dev = obj->base.dev; | 3256 | struct drm_device *dev = obj->base.dev; |
| 3266 | drm_i915_private_t *dev_priv = dev->dev_private; | 3257 | struct drm_gem_object *target_obj; |
| 3267 | struct drm_i915_gem_relocation_entry __user *user_relocs; | 3258 | uint32_t target_offset; |
| 3268 | struct drm_gem_object *target_obj = NULL; | 3259 | int ret = -EINVAL; |
| 3269 | uint32_t target_handle = 0; | ||
| 3270 | int i, ret = 0; | ||
| 3271 | 3260 | ||
| 3272 | user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr; | 3261 | target_obj = drm_gem_object_lookup(dev, file_priv, |
| 3273 | for (i = 0; i < entry->relocation_count; i++) { | 3262 | reloc->target_handle); |
| 3274 | struct drm_i915_gem_relocation_entry reloc; | 3263 | if (target_obj == NULL) |
| 3275 | uint32_t target_offset; | 3264 | return -ENOENT; |
| 3276 | 3265 | ||
| 3277 | if (__copy_from_user_inatomic(&reloc, | 3266 | target_offset = to_intel_bo(target_obj)->gtt_offset; |
| 3278 | user_relocs+i, | ||
| 3279 | sizeof(reloc))) { | ||
| 3280 | ret = -EFAULT; | ||
| 3281 | break; | ||
| 3282 | } | ||
| 3283 | 3267 | ||
| 3284 | if (reloc.target_handle != target_handle) { | 3268 | #if WATCH_RELOC |
| 3285 | drm_gem_object_unreference(target_obj); | 3269 | DRM_INFO("%s: obj %p offset %08x target %d " |
| 3270 | "read %08x write %08x gtt %08x " | ||
| 3271 | "presumed %08x delta %08x\n", | ||
| 3272 | __func__, | ||
| 3273 | obj, | ||
| 3274 | (int) reloc->offset, | ||
| 3275 | (int) reloc->target_handle, | ||
| 3276 | (int) reloc->read_domains, | ||
| 3277 | (int) reloc->write_domain, | ||
| 3278 | (int) target_offset, | ||
| 3279 | (int) reloc->presumed_offset, | ||
| 3280 | reloc->delta); | ||
| 3281 | #endif | ||
| 3286 | 3282 | ||
| 3287 | target_obj = drm_gem_object_lookup(dev, file_priv, | 3283 | /* The target buffer should have appeared before us in the |
| 3288 | reloc.target_handle); | 3284 | * exec_object list, so it should have a GTT space bound by now. |
| 3289 | if (target_obj == NULL) { | 3285 | */ |
| 3290 | ret = -ENOENT; | 3286 | if (target_offset == 0) { |
| 3291 | break; | 3287 | DRM_ERROR("No GTT space found for object %d\n", |
| 3292 | } | 3288 | reloc->target_handle); |
| 3289 | goto err; | ||
| 3290 | } | ||
| 3293 | 3291 | ||
| 3294 | target_handle = reloc.target_handle; | 3292 | /* Validate that the target is in a valid r/w GPU domain */ |
| 3295 | } | 3293 | if (reloc->write_domain & (reloc->write_domain - 1)) { |
| 3296 | target_offset = to_intel_bo(target_obj)->gtt_offset; | 3294 | DRM_ERROR("reloc with multiple write domains: " |
| 3295 | "obj %p target %d offset %d " | ||
| 3296 | "read %08x write %08x", | ||
| 3297 | obj, reloc->target_handle, | ||
| 3298 | (int) reloc->offset, | ||
| 3299 | reloc->read_domains, | ||
| 3300 | reloc->write_domain); | ||
| 3301 | goto err; | ||
| 3302 | } | ||
| 3303 | if (reloc->write_domain & I915_GEM_DOMAIN_CPU || | ||
| 3304 | reloc->read_domains & I915_GEM_DOMAIN_CPU) { | ||
| 3305 | DRM_ERROR("reloc with read/write CPU domains: " | ||
| 3306 | "obj %p target %d offset %d " | ||
| 3307 | "read %08x write %08x", | ||
| 3308 | obj, reloc->target_handle, | ||
| 3309 | (int) reloc->offset, | ||
| 3310 | reloc->read_domains, | ||
| 3311 | reloc->write_domain); | ||
| 3312 | goto err; | ||
| 3313 | } | ||
| 3314 | if (reloc->write_domain && target_obj->pending_write_domain && | ||
| 3315 | reloc->write_domain != target_obj->pending_write_domain) { | ||
| 3316 | DRM_ERROR("Write domain conflict: " | ||
| 3317 | "obj %p target %d offset %d " | ||
| 3318 | "new %08x old %08x\n", | ||
| 3319 | obj, reloc->target_handle, | ||
| 3320 | (int) reloc->offset, | ||
| 3321 | reloc->write_domain, | ||
| 3322 | target_obj->pending_write_domain); | ||
| 3323 | goto err; | ||
| 3324 | } | ||
| 3297 | 3325 | ||
| 3298 | #if WATCH_RELOC | 3326 | target_obj->pending_read_domains |= reloc->read_domains; |
| 3299 | DRM_INFO("%s: obj %p offset %08x target %d " | 3327 | target_obj->pending_write_domain |= reloc->write_domain; |
| 3300 | "read %08x write %08x gtt %08x " | ||
| 3301 | "presumed %08x delta %08x\n", | ||
| 3302 | __func__, | ||
| 3303 | obj, | ||
| 3304 | (int) reloc.offset, | ||
| 3305 | (int) reloc.target_handle, | ||
| 3306 | (int) reloc.read_domains, | ||
| 3307 | (int) reloc.write_domain, | ||
| 3308 | (int) target_offset, | ||
| 3309 | (int) reloc.presumed_offset, | ||
| 3310 | reloc.delta); | ||
| 3311 | #endif | ||
| 3312 | 3328 | ||
| 3313 | /* The target buffer should have appeared before us in the | 3329 | /* If the relocation already has the right value in it, no |
| 3314 | * exec_object list, so it should have a GTT space bound by now. | 3330 | * more work needs to be done. |
| 3315 | */ | 3331 | */ |
| 3316 | if (target_offset == 0) { | 3332 | if (target_offset == reloc->presumed_offset) |
| 3317 | DRM_ERROR("No GTT space found for object %d\n", | 3333 | goto out; |
| 3318 | reloc.target_handle); | ||
| 3319 | ret = -EINVAL; | ||
| 3320 | break; | ||
| 3321 | } | ||
| 3322 | 3334 | ||
| 3323 | /* Validate that the target is in a valid r/w GPU domain */ | 3335 | /* Check that the relocation address is valid... */ |
| 3324 | if (reloc.write_domain & (reloc.write_domain - 1)) { | 3336 | if (reloc->offset > obj->base.size - 4) { |
| 3325 | DRM_ERROR("reloc with multiple write domains: " | 3337 | DRM_ERROR("Relocation beyond object bounds: " |
| 3326 | "obj %p target %d offset %d " | 3338 | "obj %p target %d offset %d size %d.\n", |
| 3327 | "read %08x write %08x", | 3339 | obj, reloc->target_handle, |
| 3328 | obj, reloc.target_handle, | 3340 | (int) reloc->offset, |
| 3329 | (int) reloc.offset, | 3341 | (int) obj->base.size); |
| 3330 | reloc.read_domains, | 3342 | goto err; |
| 3331 | reloc.write_domain); | 3343 | } |
| 3332 | ret = -EINVAL; | 3344 | if (reloc->offset & 3) { |
| 3333 | break; | 3345 | DRM_ERROR("Relocation not 4-byte aligned: " |
| 3334 | } | 3346 | "obj %p target %d offset %d.\n", |
| 3335 | if (reloc.write_domain & I915_GEM_DOMAIN_CPU || | 3347 | obj, reloc->target_handle, |
| 3336 | reloc.read_domains & I915_GEM_DOMAIN_CPU) { | 3348 | (int) reloc->offset); |
| 3337 | DRM_ERROR("reloc with read/write CPU domains: " | 3349 | goto err; |
| 3338 | "obj %p target %d offset %d " | 3350 | } |
| 3339 | "read %08x write %08x", | ||
| 3340 | obj, reloc.target_handle, | ||
| 3341 | (int) reloc.offset, | ||
| 3342 | reloc.read_domains, | ||
| 3343 | reloc.write_domain); | ||
| 3344 | ret = -EINVAL; | ||
| 3345 | break; | ||
| 3346 | } | ||
| 3347 | if (reloc.write_domain && target_obj->pending_write_domain && | ||
| 3348 | reloc.write_domain != target_obj->pending_write_domain) { | ||
| 3349 | DRM_ERROR("Write domain conflict: " | ||
| 3350 | "obj %p target %d offset %d " | ||
| 3351 | "new %08x old %08x\n", | ||
| 3352 | obj, reloc.target_handle, | ||
| 3353 | (int) reloc.offset, | ||
| 3354 | reloc.write_domain, | ||
| 3355 | target_obj->pending_write_domain); | ||
| 3356 | ret = -EINVAL; | ||
| 3357 | break; | ||
| 3358 | } | ||
| 3359 | 3351 | ||
| 3360 | target_obj->pending_read_domains |= reloc.read_domains; | 3352 | /* and points to somewhere within the target object. */ |
| 3361 | target_obj->pending_write_domain |= reloc.write_domain; | 3353 | if (reloc->delta >= target_obj->size) { |
| 3354 | DRM_ERROR("Relocation beyond target object bounds: " | ||
| 3355 | "obj %p target %d delta %d size %d.\n", | ||
| 3356 | obj, reloc->target_handle, | ||
| 3357 | (int) reloc->delta, | ||
| 3358 | (int) target_obj->size); | ||
| 3359 | goto err; | ||
| 3360 | } | ||
| 3362 | 3361 | ||
| 3363 | /* If the relocation already has the right value in it, no | 3362 | reloc->delta += target_offset; |
| 3364 | * more work needs to be done. | 3363 | if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { |
| 3365 | */ | 3364 | uint32_t page_offset = reloc->offset & ~PAGE_MASK; |
| 3366 | if (target_offset == reloc.presumed_offset) | 3365 | char *vaddr; |
| 3367 | continue; | ||
| 3368 | 3366 | ||
| 3369 | /* Check that the relocation address is valid... */ | 3367 | vaddr = kmap_atomic(obj->pages[reloc->offset >> PAGE_SHIFT]); |
| 3370 | if (reloc.offset > obj->base.size - 4) { | 3368 | *(uint32_t *)(vaddr + page_offset) = reloc->delta; |
| 3371 | DRM_ERROR("Relocation beyond object bounds: " | 3369 | kunmap_atomic(vaddr); |
| 3372 | "obj %p target %d offset %d size %d.\n", | 3370 | } else { |
| 3373 | obj, reloc.target_handle, | 3371 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 3374 | (int) reloc.offset, (int) obj->base.size); | 3372 | uint32_t __iomem *reloc_entry; |
| 3375 | ret = -EINVAL; | 3373 | void __iomem *reloc_page; |
| 3376 | break; | ||
| 3377 | } | ||
| 3378 | if (reloc.offset & 3) { | ||
| 3379 | DRM_ERROR("Relocation not 4-byte aligned: " | ||
| 3380 | "obj %p target %d offset %d.\n", | ||
| 3381 | obj, reloc.target_handle, | ||
| 3382 | (int) reloc.offset); | ||
| 3383 | ret = -EINVAL; | ||
| 3384 | break; | ||
| 3385 | } | ||
| 3386 | 3374 | ||
| 3387 | /* and points to somewhere within the target object. */ | 3375 | ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1); |
| 3388 | if (reloc.delta >= target_obj->size) { | 3376 | if (ret) |
| 3389 | DRM_ERROR("Relocation beyond target object bounds: " | 3377 | goto err; |
| 3390 | "obj %p target %d delta %d size %d.\n", | ||
| 3391 | obj, reloc.target_handle, | ||
| 3392 | (int) reloc.delta, (int) target_obj->size); | ||
| 3393 | ret = -EINVAL; | ||
| 3394 | break; | ||
| 3395 | } | ||
| 3396 | 3378 | ||
| 3397 | reloc.delta += target_offset; | 3379 | /* Map the page containing the relocation we're going to perform. */ |
| 3398 | if (obj->base.write_domain == I915_GEM_DOMAIN_CPU) { | 3380 | reloc->offset += obj->gtt_offset; |
| 3399 | uint32_t page_offset = reloc.offset & ~PAGE_MASK; | 3381 | reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, |
| 3400 | char *vaddr; | 3382 | reloc->offset & PAGE_MASK); |
| 3383 | reloc_entry = (uint32_t __iomem *) | ||
| 3384 | (reloc_page + (reloc->offset & ~PAGE_MASK)); | ||
| 3385 | iowrite32(reloc->delta, reloc_entry); | ||
| 3386 | io_mapping_unmap_atomic(reloc_page); | ||
| 3387 | } | ||
| 3401 | 3388 | ||
| 3402 | vaddr = kmap_atomic(obj->pages[reloc.offset >> PAGE_SHIFT]); | 3389 | /* and update the user's relocation entry */ |
| 3403 | *(uint32_t *)(vaddr + page_offset) = reloc.delta; | 3390 | reloc->presumed_offset = target_offset; |
| 3404 | kunmap_atomic(vaddr); | ||
| 3405 | } else { | ||
| 3406 | uint32_t __iomem *reloc_entry; | ||
| 3407 | void __iomem *reloc_page; | ||
| 3408 | 3391 | ||
| 3409 | ret = i915_gem_object_set_to_gtt_domain(&obj->base, 1); | 3392 | out: |
| 3410 | if (ret) | 3393 | ret = 0; |
| 3411 | break; | 3394 | err: |
| 3395 | drm_gem_object_unreference(target_obj); | ||
| 3396 | return ret; | ||
| 3397 | } | ||
| 3412 | 3398 | ||
| 3413 | /* Map the page containing the relocation we're going to perform. */ | 3399 | static int |
| 3414 | reloc.offset += obj->gtt_offset; | 3400 | i915_gem_execbuffer_relocate_object(struct drm_i915_gem_object *obj, |
| 3415 | reloc_page = io_mapping_map_atomic_wc(dev_priv->mm.gtt_mapping, | 3401 | struct drm_file *file_priv, |
| 3416 | reloc.offset & PAGE_MASK); | 3402 | struct drm_i915_gem_exec_object2 *entry) |
| 3417 | reloc_entry = (uint32_t __iomem *) | 3403 | { |
| 3418 | (reloc_page + (reloc.offset & ~PAGE_MASK)); | 3404 | struct drm_i915_gem_relocation_entry __user *user_relocs; |
| 3419 | iowrite32(reloc.delta, reloc_entry); | 3405 | int i, ret; |
| 3420 | io_mapping_unmap_atomic(reloc_page); | 3406 | |
| 3421 | } | 3407 | user_relocs = (void __user *)(uintptr_t)entry->relocs_ptr; |
| 3408 | for (i = 0; i < entry->relocation_count; i++) { | ||
| 3409 | struct drm_i915_gem_relocation_entry reloc; | ||
| 3410 | |||
| 3411 | if (__copy_from_user_inatomic(&reloc, | ||
| 3412 | user_relocs+i, | ||
| 3413 | sizeof(reloc))) | ||
| 3414 | return -EFAULT; | ||
| 3415 | |||
| 3416 | ret = i915_gem_execbuffer_relocate_entry(obj, file_priv, entry, &reloc); | ||
| 3417 | if (ret) | ||
| 3418 | return ret; | ||
| 3422 | 3419 | ||
| 3423 | /* and update the user's relocation entry */ | ||
| 3424 | reloc.presumed_offset = target_offset; | ||
| 3425 | if (__copy_to_user_inatomic(&user_relocs[i].presumed_offset, | 3420 | if (__copy_to_user_inatomic(&user_relocs[i].presumed_offset, |
| 3426 | &reloc.presumed_offset, | 3421 | &reloc.presumed_offset, |
| 3427 | sizeof(reloc.presumed_offset))) { | 3422 | sizeof(reloc.presumed_offset))) |
| 3428 | ret = -EFAULT; | 3423 | return -EFAULT; |
| 3429 | break; | ||
| 3430 | } | ||
| 3431 | } | 3424 | } |
| 3432 | 3425 | ||
| 3433 | drm_gem_object_unreference(target_obj); | 3426 | return 0; |
| 3434 | return ret; | 3427 | } |
| 3428 | |||
| 3429 | static int | ||
| 3430 | i915_gem_execbuffer_relocate_object_slow(struct drm_i915_gem_object *obj, | ||
| 3431 | struct drm_file *file_priv, | ||
| 3432 | struct drm_i915_gem_exec_object2 *entry, | ||
| 3433 | struct drm_i915_gem_relocation_entry *relocs) | ||
| 3434 | { | ||
| 3435 | int i, ret; | ||
| 3436 | |||
| 3437 | for (i = 0; i < entry->relocation_count; i++) { | ||
| 3438 | ret = i915_gem_execbuffer_relocate_entry(obj, file_priv, entry, &relocs[i]); | ||
| 3439 | if (ret) | ||
| 3440 | return ret; | ||
| 3441 | } | ||
| 3442 | |||
| 3443 | return 0; | ||
| 3435 | } | 3444 | } |
| 3436 | 3445 | ||
| 3437 | static int | 3446 | static int |
| 3438 | i915_gem_execbuffer_pin(struct drm_device *dev, | 3447 | i915_gem_execbuffer_relocate(struct drm_device *dev, |
| 3439 | struct drm_file *file, | 3448 | struct drm_file *file, |
| 3440 | struct drm_gem_object **object_list, | 3449 | struct drm_gem_object **object_list, |
| 3441 | struct drm_i915_gem_exec_object2 *exec_list, | 3450 | struct drm_i915_gem_exec_object2 *exec_list, |
| 3442 | int count) | 3451 | int count) |
| 3452 | { | ||
| 3453 | int i, ret; | ||
| 3454 | |||
| 3455 | for (i = 0; i < count; i++) { | ||
| 3456 | struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); | ||
| 3457 | obj->base.pending_read_domains = 0; | ||
| 3458 | obj->base.pending_write_domain = 0; | ||
| 3459 | ret = i915_gem_execbuffer_relocate_object(obj, file, | ||
| 3460 | &exec_list[i]); | ||
| 3461 | if (ret) | ||
| 3462 | return ret; | ||
| 3463 | } | ||
| 3464 | |||
| 3465 | return 0; | ||
| 3466 | } | ||
| 3467 | |||
| 3468 | static int | ||
| 3469 | i915_gem_execbuffer_reserve(struct drm_device *dev, | ||
| 3470 | struct drm_file *file, | ||
| 3471 | struct drm_gem_object **object_list, | ||
| 3472 | struct drm_i915_gem_exec_object2 *exec_list, | ||
| 3473 | int count) | ||
| 3443 | { | 3474 | { |
| 3444 | struct drm_i915_private *dev_priv = dev->dev_private; | 3475 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 3445 | int ret, i, retry; | 3476 | int ret, i, retry; |
| @@ -3502,6 +3533,87 @@ i915_gem_execbuffer_pin(struct drm_device *dev, | |||
| 3502 | } | 3533 | } |
| 3503 | 3534 | ||
| 3504 | static int | 3535 | static int |
| 3536 | i915_gem_execbuffer_relocate_slow(struct drm_device *dev, | ||
| 3537 | struct drm_file *file, | ||
| 3538 | struct drm_gem_object **object_list, | ||
| 3539 | struct drm_i915_gem_exec_object2 *exec_list, | ||
| 3540 | int count) | ||
| 3541 | { | ||
| 3542 | struct drm_i915_gem_relocation_entry *reloc; | ||
| 3543 | int i, total, ret; | ||
| 3544 | |||
| 3545 | for (i = 0; i < count; i++) { | ||
| 3546 | struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); | ||
| 3547 | obj->in_execbuffer = false; | ||
| 3548 | } | ||
| 3549 | |||
| 3550 | mutex_unlock(&dev->struct_mutex); | ||
| 3551 | |||
| 3552 | total = 0; | ||
| 3553 | for (i = 0; i < count; i++) | ||
| 3554 | total += exec_list[i].relocation_count; | ||
| 3555 | |||
| 3556 | reloc = drm_malloc_ab(total, sizeof(*reloc)); | ||
| 3557 | if (reloc == NULL) { | ||
| 3558 | mutex_lock(&dev->struct_mutex); | ||
| 3559 | return -ENOMEM; | ||
| 3560 | } | ||
| 3561 | |||
| 3562 | total = 0; | ||
| 3563 | for (i = 0; i < count; i++) { | ||
| 3564 | struct drm_i915_gem_relocation_entry __user *user_relocs; | ||
| 3565 | |||
| 3566 | user_relocs = (void __user *)(uintptr_t)exec_list[i].relocs_ptr; | ||
| 3567 | |||
| 3568 | if (copy_from_user(reloc+total, user_relocs, | ||
| 3569 | exec_list[i].relocation_count * | ||
| 3570 | sizeof(*reloc))) { | ||
| 3571 | ret = -EFAULT; | ||
| 3572 | mutex_lock(&dev->struct_mutex); | ||
| 3573 | goto err; | ||
| 3574 | } | ||
| 3575 | |||
| 3576 | total += exec_list[i].relocation_count; | ||
| 3577 | } | ||
| 3578 | |||
| 3579 | ret = i915_mutex_lock_interruptible(dev); | ||
| 3580 | if (ret) { | ||
| 3581 | mutex_lock(&dev->struct_mutex); | ||
| 3582 | goto err; | ||
| 3583 | } | ||
| 3584 | |||
| 3585 | ret = i915_gem_execbuffer_reserve(dev, file, | ||
| 3586 | object_list, exec_list, | ||
| 3587 | count); | ||
| 3588 | if (ret) | ||
| 3589 | goto err; | ||
| 3590 | |||
| 3591 | total = 0; | ||
| 3592 | for (i = 0; i < count; i++) { | ||
| 3593 | struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); | ||
| 3594 | obj->base.pending_read_domains = 0; | ||
| 3595 | obj->base.pending_write_domain = 0; | ||
| 3596 | ret = i915_gem_execbuffer_relocate_object_slow(obj, file, | ||
| 3597 | &exec_list[i], | ||
| 3598 | reloc + total); | ||
| 3599 | if (ret) | ||
| 3600 | goto err; | ||
| 3601 | |||
| 3602 | total += exec_list[i].relocation_count; | ||
| 3603 | } | ||
| 3604 | |||
| 3605 | /* Leave the user relocations as are, this is the painfully slow path, | ||
| 3606 | * and we want to avoid the complication of dropping the lock whilst | ||
| 3607 | * having buffers reserved in the aperture and so causing spurious | ||
| 3608 | * ENOSPC for random operations. | ||
| 3609 | */ | ||
| 3610 | |||
| 3611 | err: | ||
| 3612 | drm_free_large(reloc); | ||
| 3613 | return ret; | ||
| 3614 | } | ||
| 3615 | |||
| 3616 | static int | ||
| 3505 | i915_gem_execbuffer_move_to_gpu(struct drm_device *dev, | 3617 | i915_gem_execbuffer_move_to_gpu(struct drm_device *dev, |
| 3506 | struct drm_file *file, | 3618 | struct drm_file *file, |
| 3507 | struct intel_ring_buffer *ring, | 3619 | struct intel_ring_buffer *ring, |
| @@ -3630,8 +3742,15 @@ validate_exec_list(struct drm_i915_gem_exec_object2 *exec, | |||
| 3630 | 3742 | ||
| 3631 | for (i = 0; i < count; i++) { | 3743 | for (i = 0; i < count; i++) { |
| 3632 | char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr; | 3744 | char __user *ptr = (char __user *)(uintptr_t)exec[i].relocs_ptr; |
| 3633 | size_t length = exec[i].relocation_count * sizeof(struct drm_i915_gem_relocation_entry); | 3745 | int length; /* limited by fault_in_pages_readable() */ |
| 3746 | |||
| 3747 | /* First check for malicious input causing overflow */ | ||
| 3748 | if (exec[i].relocation_count > | ||
| 3749 | INT_MAX / sizeof(struct drm_i915_gem_relocation_entry)) | ||
| 3750 | return -EINVAL; | ||
| 3634 | 3751 | ||
| 3752 | length = exec[i].relocation_count * | ||
| 3753 | sizeof(struct drm_i915_gem_relocation_entry); | ||
| 3635 | if (!access_ok(VERIFY_READ, ptr, length)) | 3754 | if (!access_ok(VERIFY_READ, ptr, length)) |
| 3636 | return -EFAULT; | 3755 | return -EFAULT; |
| 3637 | 3756 | ||
| @@ -3774,18 +3893,24 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, | |||
| 3774 | } | 3893 | } |
| 3775 | 3894 | ||
| 3776 | /* Move the objects en-masse into the GTT, evicting if necessary. */ | 3895 | /* Move the objects en-masse into the GTT, evicting if necessary. */ |
| 3777 | ret = i915_gem_execbuffer_pin(dev, file, | 3896 | ret = i915_gem_execbuffer_reserve(dev, file, |
| 3778 | object_list, exec_list, | 3897 | object_list, exec_list, |
| 3779 | args->buffer_count); | 3898 | args->buffer_count); |
| 3780 | if (ret) | 3899 | if (ret) |
| 3781 | goto err; | 3900 | goto err; |
| 3782 | 3901 | ||
| 3783 | /* The objects are in their final locations, apply the relocations. */ | 3902 | /* The objects are in their final locations, apply the relocations. */ |
| 3784 | for (i = 0; i < args->buffer_count; i++) { | 3903 | ret = i915_gem_execbuffer_relocate(dev, file, |
| 3785 | struct drm_i915_gem_object *obj = to_intel_bo(object_list[i]); | 3904 | object_list, exec_list, |
| 3786 | obj->base.pending_read_domains = 0; | 3905 | args->buffer_count); |
| 3787 | obj->base.pending_write_domain = 0; | 3906 | if (ret) { |
| 3788 | ret = i915_gem_execbuffer_relocate(obj, file, &exec_list[i]); | 3907 | if (ret == -EFAULT) { |
| 3908 | ret = i915_gem_execbuffer_relocate_slow(dev, file, | ||
| 3909 | object_list, | ||
| 3910 | exec_list, | ||
| 3911 | args->buffer_count); | ||
| 3912 | BUG_ON(!mutex_is_locked(&dev->struct_mutex)); | ||
| 3913 | } | ||
| 3789 | if (ret) | 3914 | if (ret) |
| 3790 | goto err; | 3915 | goto err; |
| 3791 | } | 3916 | } |
| @@ -4249,10 +4374,20 @@ i915_gem_busy_ioctl(struct drm_device *dev, void *data, | |||
| 4249 | * use this buffer rather sooner than later, so issuing the required | 4374 | * use this buffer rather sooner than later, so issuing the required |
| 4250 | * flush earlier is beneficial. | 4375 | * flush earlier is beneficial. |
| 4251 | */ | 4376 | */ |
| 4252 | if (obj->write_domain & I915_GEM_GPU_DOMAINS) | 4377 | if (obj->write_domain & I915_GEM_GPU_DOMAINS) { |
| 4253 | i915_gem_flush_ring(dev, file_priv, | 4378 | i915_gem_flush_ring(dev, file_priv, |
| 4254 | obj_priv->ring, | 4379 | obj_priv->ring, |
| 4255 | 0, obj->write_domain); | 4380 | 0, obj->write_domain); |
| 4381 | } else if (obj_priv->ring->outstanding_lazy_request) { | ||
| 4382 | /* This ring is not being cleared by active usage, | ||
| 4383 | * so emit a request to do so. | ||
| 4384 | */ | ||
| 4385 | u32 seqno = i915_add_request(dev, | ||
| 4386 | NULL, NULL, | ||
| 4387 | obj_priv->ring); | ||
| 4388 | if (seqno == 0) | ||
| 4389 | ret = -ENOMEM; | ||
| 4390 | } | ||
| 4256 | 4391 | ||
| 4257 | /* Update the active list for the hardware's current position. | 4392 | /* Update the active list for the hardware's current position. |
| 4258 | * Otherwise this only updates on a delayed timer or when irqs | 4393 | * Otherwise this only updates on a delayed timer or when irqs |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 25ed911a3112..878fc766a12c 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
| @@ -3033,6 +3033,7 @@ | |||
| 3033 | #define TRANS_DP_10BPC (1<<9) | 3033 | #define TRANS_DP_10BPC (1<<9) |
| 3034 | #define TRANS_DP_6BPC (2<<9) | 3034 | #define TRANS_DP_6BPC (2<<9) |
| 3035 | #define TRANS_DP_12BPC (3<<9) | 3035 | #define TRANS_DP_12BPC (3<<9) |
| 3036 | #define TRANS_DP_BPC_MASK (3<<9) | ||
| 3036 | #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) | 3037 | #define TRANS_DP_VSYNC_ACTIVE_HIGH (1<<4) |
| 3037 | #define TRANS_DP_VSYNC_ACTIVE_LOW 0 | 3038 | #define TRANS_DP_VSYNC_ACTIVE_LOW 0 |
| 3038 | #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3) | 3039 | #define TRANS_DP_HSYNC_ACTIVE_HIGH (1<<3) |
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 454c064f8ef7..42729d25da58 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
| @@ -239,6 +239,16 @@ static void i915_save_modeset_reg(struct drm_device *dev) | |||
| 239 | if (drm_core_check_feature(dev, DRIVER_MODESET)) | 239 | if (drm_core_check_feature(dev, DRIVER_MODESET)) |
| 240 | return; | 240 | return; |
| 241 | 241 | ||
| 242 | /* Cursor state */ | ||
| 243 | dev_priv->saveCURACNTR = I915_READ(CURACNTR); | ||
| 244 | dev_priv->saveCURAPOS = I915_READ(CURAPOS); | ||
| 245 | dev_priv->saveCURABASE = I915_READ(CURABASE); | ||
| 246 | dev_priv->saveCURBCNTR = I915_READ(CURBCNTR); | ||
| 247 | dev_priv->saveCURBPOS = I915_READ(CURBPOS); | ||
| 248 | dev_priv->saveCURBBASE = I915_READ(CURBBASE); | ||
| 249 | if (IS_GEN2(dev)) | ||
| 250 | dev_priv->saveCURSIZE = I915_READ(CURSIZE); | ||
| 251 | |||
| 242 | if (HAS_PCH_SPLIT(dev)) { | 252 | if (HAS_PCH_SPLIT(dev)) { |
| 243 | dev_priv->savePCH_DREF_CONTROL = I915_READ(PCH_DREF_CONTROL); | 253 | dev_priv->savePCH_DREF_CONTROL = I915_READ(PCH_DREF_CONTROL); |
| 244 | dev_priv->saveDISP_ARB_CTL = I915_READ(DISP_ARB_CTL); | 254 | dev_priv->saveDISP_ARB_CTL = I915_READ(DISP_ARB_CTL); |
| @@ -529,6 +539,16 @@ static void i915_restore_modeset_reg(struct drm_device *dev) | |||
| 529 | I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); | 539 | I915_WRITE(DSPBCNTR, dev_priv->saveDSPBCNTR); |
| 530 | I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); | 540 | I915_WRITE(DSPBADDR, I915_READ(DSPBADDR)); |
| 531 | 541 | ||
| 542 | /* Cursor state */ | ||
| 543 | I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); | ||
| 544 | I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); | ||
| 545 | I915_WRITE(CURABASE, dev_priv->saveCURABASE); | ||
| 546 | I915_WRITE(CURBPOS, dev_priv->saveCURBPOS); | ||
| 547 | I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR); | ||
| 548 | I915_WRITE(CURBBASE, dev_priv->saveCURBBASE); | ||
| 549 | if (IS_GEN2(dev)) | ||
| 550 | I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); | ||
| 551 | |||
| 532 | return; | 552 | return; |
| 533 | } | 553 | } |
| 534 | 554 | ||
| @@ -543,16 +563,6 @@ void i915_save_display(struct drm_device *dev) | |||
| 543 | /* Don't save them in KMS mode */ | 563 | /* Don't save them in KMS mode */ |
| 544 | i915_save_modeset_reg(dev); | 564 | i915_save_modeset_reg(dev); |
| 545 | 565 | ||
| 546 | /* Cursor state */ | ||
| 547 | dev_priv->saveCURACNTR = I915_READ(CURACNTR); | ||
| 548 | dev_priv->saveCURAPOS = I915_READ(CURAPOS); | ||
| 549 | dev_priv->saveCURABASE = I915_READ(CURABASE); | ||
| 550 | dev_priv->saveCURBCNTR = I915_READ(CURBCNTR); | ||
| 551 | dev_priv->saveCURBPOS = I915_READ(CURBPOS); | ||
| 552 | dev_priv->saveCURBBASE = I915_READ(CURBBASE); | ||
| 553 | if (IS_GEN2(dev)) | ||
| 554 | dev_priv->saveCURSIZE = I915_READ(CURSIZE); | ||
| 555 | |||
| 556 | /* CRT state */ | 566 | /* CRT state */ |
| 557 | if (HAS_PCH_SPLIT(dev)) { | 567 | if (HAS_PCH_SPLIT(dev)) { |
| 558 | dev_priv->saveADPA = I915_READ(PCH_ADPA); | 568 | dev_priv->saveADPA = I915_READ(PCH_ADPA); |
| @@ -657,16 +667,6 @@ void i915_restore_display(struct drm_device *dev) | |||
| 657 | /* Don't restore them in KMS mode */ | 667 | /* Don't restore them in KMS mode */ |
| 658 | i915_restore_modeset_reg(dev); | 668 | i915_restore_modeset_reg(dev); |
| 659 | 669 | ||
| 660 | /* Cursor state */ | ||
| 661 | I915_WRITE(CURAPOS, dev_priv->saveCURAPOS); | ||
| 662 | I915_WRITE(CURACNTR, dev_priv->saveCURACNTR); | ||
| 663 | I915_WRITE(CURABASE, dev_priv->saveCURABASE); | ||
| 664 | I915_WRITE(CURBPOS, dev_priv->saveCURBPOS); | ||
| 665 | I915_WRITE(CURBCNTR, dev_priv->saveCURBCNTR); | ||
| 666 | I915_WRITE(CURBBASE, dev_priv->saveCURBBASE); | ||
| 667 | if (IS_GEN2(dev)) | ||
| 668 | I915_WRITE(CURSIZE, dev_priv->saveCURSIZE); | ||
| 669 | |||
| 670 | /* CRT state */ | 670 | /* CRT state */ |
| 671 | if (HAS_PCH_SPLIT(dev)) | 671 | if (HAS_PCH_SPLIT(dev)) |
| 672 | I915_WRITE(PCH_ADPA, dev_priv->saveADPA); | 672 | I915_WRITE(PCH_ADPA, dev_priv->saveADPA); |
diff --git a/drivers/gpu/drm/i915/intel_acpi.c b/drivers/gpu/drm/i915/intel_acpi.c index 65c88f9ba12c..2cb8e0b9f1ee 100644 --- a/drivers/gpu/drm/i915/intel_acpi.c +++ b/drivers/gpu/drm/i915/intel_acpi.c | |||
| @@ -190,37 +190,6 @@ out: | |||
| 190 | kfree(output.pointer); | 190 | kfree(output.pointer); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | static int intel_dsm_switchto(enum vga_switcheroo_client_id id) | ||
| 194 | { | ||
| 195 | return 0; | ||
| 196 | } | ||
| 197 | |||
| 198 | static int intel_dsm_power_state(enum vga_switcheroo_client_id id, | ||
| 199 | enum vga_switcheroo_state state) | ||
| 200 | { | ||
| 201 | return 0; | ||
| 202 | } | ||
| 203 | |||
| 204 | static int intel_dsm_init(void) | ||
| 205 | { | ||
| 206 | return 0; | ||
| 207 | } | ||
| 208 | |||
| 209 | static int intel_dsm_get_client_id(struct pci_dev *pdev) | ||
| 210 | { | ||
| 211 | if (intel_dsm_priv.dhandle == DEVICE_ACPI_HANDLE(&pdev->dev)) | ||
| 212 | return VGA_SWITCHEROO_IGD; | ||
| 213 | else | ||
| 214 | return VGA_SWITCHEROO_DIS; | ||
| 215 | } | ||
| 216 | |||
| 217 | static struct vga_switcheroo_handler intel_dsm_handler = { | ||
| 218 | .switchto = intel_dsm_switchto, | ||
| 219 | .power_state = intel_dsm_power_state, | ||
| 220 | .init = intel_dsm_init, | ||
| 221 | .get_client_id = intel_dsm_get_client_id, | ||
| 222 | }; | ||
| 223 | |||
| 224 | static bool intel_dsm_pci_probe(struct pci_dev *pdev) | 193 | static bool intel_dsm_pci_probe(struct pci_dev *pdev) |
| 225 | { | 194 | { |
| 226 | acpi_handle dhandle, intel_handle; | 195 | acpi_handle dhandle, intel_handle; |
| @@ -276,11 +245,8 @@ void intel_register_dsm_handler(void) | |||
| 276 | { | 245 | { |
| 277 | if (!intel_dsm_detect()) | 246 | if (!intel_dsm_detect()) |
| 278 | return; | 247 | return; |
| 279 | |||
| 280 | vga_switcheroo_register_handler(&intel_dsm_handler); | ||
| 281 | } | 248 | } |
| 282 | 249 | ||
| 283 | void intel_unregister_dsm_handler(void) | 250 | void intel_unregister_dsm_handler(void) |
| 284 | { | 251 | { |
| 285 | vga_switcheroo_unregister_handler(); | ||
| 286 | } | 252 | } |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bee24b1a58e8..d9b7092439ef 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -2120,9 +2120,11 @@ static void ironlake_crtc_enable(struct drm_crtc *crtc) | |||
| 2120 | reg = TRANS_DP_CTL(pipe); | 2120 | reg = TRANS_DP_CTL(pipe); |
| 2121 | temp = I915_READ(reg); | 2121 | temp = I915_READ(reg); |
| 2122 | temp &= ~(TRANS_DP_PORT_SEL_MASK | | 2122 | temp &= ~(TRANS_DP_PORT_SEL_MASK | |
| 2123 | TRANS_DP_SYNC_MASK); | 2123 | TRANS_DP_SYNC_MASK | |
| 2124 | TRANS_DP_BPC_MASK); | ||
| 2124 | temp |= (TRANS_DP_OUTPUT_ENABLE | | 2125 | temp |= (TRANS_DP_OUTPUT_ENABLE | |
| 2125 | TRANS_DP_ENH_FRAMING); | 2126 | TRANS_DP_ENH_FRAMING); |
| 2127 | temp |= TRANS_DP_8BPC; | ||
| 2126 | 2128 | ||
| 2127 | if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC) | 2129 | if (crtc->mode.flags & DRM_MODE_FLAG_PHSYNC) |
| 2128 | temp |= TRANS_DP_HSYNC_ACTIVE_HIGH; | 2130 | temp |= TRANS_DP_HSYNC_ACTIVE_HIGH; |
| @@ -2712,27 +2714,19 @@ fdi_reduce_ratio(u32 *num, u32 *den) | |||
| 2712 | } | 2714 | } |
| 2713 | } | 2715 | } |
| 2714 | 2716 | ||
| 2715 | #define DATA_N 0x800000 | ||
| 2716 | #define LINK_N 0x80000 | ||
| 2717 | |||
| 2718 | static void | 2717 | static void |
| 2719 | ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock, | 2718 | ironlake_compute_m_n(int bits_per_pixel, int nlanes, int pixel_clock, |
| 2720 | int link_clock, struct fdi_m_n *m_n) | 2719 | int link_clock, struct fdi_m_n *m_n) |
| 2721 | { | 2720 | { |
| 2722 | u64 temp; | ||
| 2723 | |||
| 2724 | m_n->tu = 64; /* default size */ | 2721 | m_n->tu = 64; /* default size */ |
| 2725 | 2722 | ||
| 2726 | temp = (u64) DATA_N * pixel_clock; | 2723 | /* BUG_ON(pixel_clock > INT_MAX / 36); */ |
| 2727 | temp = div_u64(temp, link_clock); | 2724 | m_n->gmch_m = bits_per_pixel * pixel_clock; |
| 2728 | m_n->gmch_m = div_u64(temp * bits_per_pixel, nlanes); | 2725 | m_n->gmch_n = link_clock * nlanes * 8; |
| 2729 | m_n->gmch_m >>= 3; /* convert to bytes_per_pixel */ | ||
| 2730 | m_n->gmch_n = DATA_N; | ||
| 2731 | fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); | 2726 | fdi_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); |
| 2732 | 2727 | ||
| 2733 | temp = (u64) LINK_N * pixel_clock; | 2728 | m_n->link_m = pixel_clock; |
| 2734 | m_n->link_m = div_u64(temp, link_clock); | 2729 | m_n->link_n = link_clock; |
| 2735 | m_n->link_n = LINK_N; | ||
| 2736 | fdi_reduce_ratio(&m_n->link_m, &m_n->link_n); | 2730 | fdi_reduce_ratio(&m_n->link_m, &m_n->link_n); |
| 2737 | } | 2731 | } |
| 2738 | 2732 | ||
| @@ -3716,6 +3710,7 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3716 | 3710 | ||
| 3717 | /* FDI link */ | 3711 | /* FDI link */ |
| 3718 | if (HAS_PCH_SPLIT(dev)) { | 3712 | if (HAS_PCH_SPLIT(dev)) { |
| 3713 | int pixel_multiplier = intel_mode_get_pixel_multiplier(adjusted_mode); | ||
| 3719 | int lane = 0, link_bw, bpp; | 3714 | int lane = 0, link_bw, bpp; |
| 3720 | /* CPU eDP doesn't require FDI link, so just set DP M/N | 3715 | /* CPU eDP doesn't require FDI link, so just set DP M/N |
| 3721 | according to current link config */ | 3716 | according to current link config */ |
| @@ -3799,6 +3794,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
| 3799 | 3794 | ||
| 3800 | intel_crtc->fdi_lanes = lane; | 3795 | intel_crtc->fdi_lanes = lane; |
| 3801 | 3796 | ||
| 3797 | if (pixel_multiplier > 1) | ||
| 3798 | link_bw *= pixel_multiplier; | ||
| 3802 | ironlake_compute_m_n(bpp, lane, target_clock, link_bw, &m_n); | 3799 | ironlake_compute_m_n(bpp, lane, target_clock, link_bw, &m_n); |
| 3803 | } | 3800 | } |
| 3804 | 3801 | ||
| @@ -5236,6 +5233,55 @@ static const struct drm_crtc_funcs intel_crtc_funcs = { | |||
| 5236 | .page_flip = intel_crtc_page_flip, | 5233 | .page_flip = intel_crtc_page_flip, |
| 5237 | }; | 5234 | }; |
| 5238 | 5235 | ||
| 5236 | static void intel_sanitize_modesetting(struct drm_device *dev, | ||
| 5237 | int pipe, int plane) | ||
| 5238 | { | ||
| 5239 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 5240 | u32 reg, val; | ||
| 5241 | |||
| 5242 | if (HAS_PCH_SPLIT(dev)) | ||
| 5243 | return; | ||
| 5244 | |||
| 5245 | /* Who knows what state these registers were left in by the BIOS or | ||
| 5246 | * grub? | ||
| 5247 | * | ||
| 5248 | * If we leave the registers in a conflicting state (e.g. with the | ||
| 5249 | * display plane reading from the other pipe than the one we intend | ||
| 5250 | * to use) then when we attempt to teardown the active mode, we will | ||
| 5251 | * not disable the pipes and planes in the correct order -- leaving | ||
| 5252 | * a plane reading from a disabled pipe and possibly leading to | ||
| 5253 | * undefined behaviour. | ||
| 5254 | */ | ||
| 5255 | |||
| 5256 | reg = DSPCNTR(plane); | ||
| 5257 | val = I915_READ(reg); | ||
| 5258 | |||
| 5259 | if ((val & DISPLAY_PLANE_ENABLE) == 0) | ||
| 5260 | return; | ||
| 5261 | if (!!(val & DISPPLANE_SEL_PIPE_MASK) == pipe) | ||
| 5262 | return; | ||
| 5263 | |||
| 5264 | /* This display plane is active and attached to the other CPU pipe. */ | ||
| 5265 | pipe = !pipe; | ||
| 5266 | |||
| 5267 | /* Disable the plane and wait for it to stop reading from the pipe. */ | ||
| 5268 | I915_WRITE(reg, val & ~DISPLAY_PLANE_ENABLE); | ||
| 5269 | intel_flush_display_plane(dev, plane); | ||
| 5270 | |||
| 5271 | if (IS_GEN2(dev)) | ||
| 5272 | intel_wait_for_vblank(dev, pipe); | ||
| 5273 | |||
| 5274 | if (pipe == 0 && (dev_priv->quirks & QUIRK_PIPEA_FORCE)) | ||
| 5275 | return; | ||
| 5276 | |||
| 5277 | /* Switch off the pipe. */ | ||
| 5278 | reg = PIPECONF(pipe); | ||
| 5279 | val = I915_READ(reg); | ||
| 5280 | if (val & PIPECONF_ENABLE) { | ||
| 5281 | I915_WRITE(reg, val & ~PIPECONF_ENABLE); | ||
| 5282 | intel_wait_for_pipe_off(dev, pipe); | ||
| 5283 | } | ||
| 5284 | } | ||
| 5239 | 5285 | ||
| 5240 | static void intel_crtc_init(struct drm_device *dev, int pipe) | 5286 | static void intel_crtc_init(struct drm_device *dev, int pipe) |
| 5241 | { | 5287 | { |
| @@ -5287,6 +5333,8 @@ static void intel_crtc_init(struct drm_device *dev, int pipe) | |||
| 5287 | 5333 | ||
| 5288 | setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer, | 5334 | setup_timer(&intel_crtc->idle_timer, intel_crtc_idle_timer, |
| 5289 | (unsigned long)intel_crtc); | 5335 | (unsigned long)intel_crtc); |
| 5336 | |||
| 5337 | intel_sanitize_modesetting(dev, intel_crtc->pipe, intel_crtc->plane); | ||
| 5290 | } | 5338 | } |
| 5291 | 5339 | ||
| 5292 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, | 5340 | int intel_get_pipe_from_crtc_id(struct drm_device *dev, void *data, |
| @@ -5336,9 +5384,14 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
| 5336 | struct drm_i915_private *dev_priv = dev->dev_private; | 5384 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 5337 | struct intel_encoder *encoder; | 5385 | struct intel_encoder *encoder; |
| 5338 | bool dpd_is_edp = false; | 5386 | bool dpd_is_edp = false; |
| 5387 | bool has_lvds = false; | ||
| 5339 | 5388 | ||
| 5340 | if (IS_MOBILE(dev) && !IS_I830(dev)) | 5389 | if (IS_MOBILE(dev) && !IS_I830(dev)) |
| 5341 | intel_lvds_init(dev); | 5390 | has_lvds = intel_lvds_init(dev); |
| 5391 | if (!has_lvds && !HAS_PCH_SPLIT(dev)) { | ||
| 5392 | /* disable the panel fitter on everything but LVDS */ | ||
| 5393 | I915_WRITE(PFIT_CONTROL, 0); | ||
| 5394 | } | ||
| 5342 | 5395 | ||
| 5343 | if (HAS_PCH_SPLIT(dev)) { | 5396 | if (HAS_PCH_SPLIT(dev)) { |
| 5344 | dpd_is_edp = intel_dpd_is_edp(dev); | 5397 | dpd_is_edp = intel_dpd_is_edp(dev); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index c8e005553310..df648cb4c296 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -584,17 +584,6 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 584 | mode->clock = dev_priv->panel_fixed_mode->clock; | 584 | mode->clock = dev_priv->panel_fixed_mode->clock; |
| 585 | } | 585 | } |
| 586 | 586 | ||
| 587 | /* Just use VBT values for eDP */ | ||
| 588 | if (is_edp(intel_dp)) { | ||
| 589 | intel_dp->lane_count = dev_priv->edp.lanes; | ||
| 590 | intel_dp->link_bw = dev_priv->edp.rate; | ||
| 591 | adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); | ||
| 592 | DRM_DEBUG_KMS("eDP link bw %02x lane count %d clock %d\n", | ||
| 593 | intel_dp->link_bw, intel_dp->lane_count, | ||
| 594 | adjusted_mode->clock); | ||
| 595 | return true; | ||
| 596 | } | ||
| 597 | |||
| 598 | for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { | 587 | for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { |
| 599 | for (clock = 0; clock <= max_clock; clock++) { | 588 | for (clock = 0; clock <= max_clock; clock++) { |
| 600 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); | 589 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); |
| @@ -613,6 +602,19 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
| 613 | } | 602 | } |
| 614 | } | 603 | } |
| 615 | 604 | ||
| 605 | if (is_edp(intel_dp)) { | ||
| 606 | /* okay we failed just pick the highest */ | ||
| 607 | intel_dp->lane_count = max_lane_count; | ||
| 608 | intel_dp->link_bw = bws[max_clock]; | ||
| 609 | adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); | ||
| 610 | DRM_DEBUG_KMS("Force picking display port link bw %02x lane " | ||
| 611 | "count %d clock %d\n", | ||
| 612 | intel_dp->link_bw, intel_dp->lane_count, | ||
| 613 | adjusted_mode->clock); | ||
| 614 | |||
| 615 | return true; | ||
| 616 | } | ||
| 617 | |||
| 616 | return false; | 618 | return false; |
| 617 | } | 619 | } |
| 618 | 620 | ||
| @@ -1087,21 +1089,11 @@ intel_get_adjust_train(struct intel_dp *intel_dp) | |||
| 1087 | } | 1089 | } |
| 1088 | 1090 | ||
| 1089 | static uint32_t | 1091 | static uint32_t |
| 1090 | intel_dp_signal_levels(struct intel_dp *intel_dp) | 1092 | intel_dp_signal_levels(uint8_t train_set, int lane_count) |
| 1091 | { | 1093 | { |
| 1092 | struct drm_device *dev = intel_dp->base.base.dev; | 1094 | uint32_t signal_levels = 0; |
| 1093 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1094 | uint32_t signal_levels = 0; | ||
| 1095 | u8 train_set = intel_dp->train_set[0]; | ||
| 1096 | u32 vswing = train_set & DP_TRAIN_VOLTAGE_SWING_MASK; | ||
| 1097 | u32 preemphasis = train_set & DP_TRAIN_PRE_EMPHASIS_MASK; | ||
| 1098 | 1095 | ||
| 1099 | if (is_edp(intel_dp)) { | 1096 | switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) { |
| 1100 | vswing = dev_priv->edp.vswing; | ||
| 1101 | preemphasis = dev_priv->edp.preemphasis; | ||
| 1102 | } | ||
| 1103 | |||
| 1104 | switch (vswing) { | ||
| 1105 | case DP_TRAIN_VOLTAGE_SWING_400: | 1097 | case DP_TRAIN_VOLTAGE_SWING_400: |
| 1106 | default: | 1098 | default: |
| 1107 | signal_levels |= DP_VOLTAGE_0_4; | 1099 | signal_levels |= DP_VOLTAGE_0_4; |
| @@ -1116,7 +1108,7 @@ intel_dp_signal_levels(struct intel_dp *intel_dp) | |||
| 1116 | signal_levels |= DP_VOLTAGE_1_2; | 1108 | signal_levels |= DP_VOLTAGE_1_2; |
| 1117 | break; | 1109 | break; |
| 1118 | } | 1110 | } |
| 1119 | switch (preemphasis) { | 1111 | switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { |
| 1120 | case DP_TRAIN_PRE_EMPHASIS_0: | 1112 | case DP_TRAIN_PRE_EMPHASIS_0: |
| 1121 | default: | 1113 | default: |
| 1122 | signal_levels |= DP_PRE_EMPHASIS_0; | 1114 | signal_levels |= DP_PRE_EMPHASIS_0; |
| @@ -1203,18 +1195,6 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) | |||
| 1203 | } | 1195 | } |
| 1204 | 1196 | ||
| 1205 | static bool | 1197 | static bool |
| 1206 | intel_dp_aux_handshake_required(struct intel_dp *intel_dp) | ||
| 1207 | { | ||
| 1208 | struct drm_device *dev = intel_dp->base.base.dev; | ||
| 1209 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 1210 | |||
| 1211 | if (is_edp(intel_dp) && dev_priv->no_aux_handshake) | ||
| 1212 | return false; | ||
| 1213 | |||
| 1214 | return true; | ||
| 1215 | } | ||
| 1216 | |||
| 1217 | static bool | ||
| 1218 | intel_dp_set_link_train(struct intel_dp *intel_dp, | 1198 | intel_dp_set_link_train(struct intel_dp *intel_dp, |
| 1219 | uint32_t dp_reg_value, | 1199 | uint32_t dp_reg_value, |
| 1220 | uint8_t dp_train_pat) | 1200 | uint8_t dp_train_pat) |
| @@ -1226,9 +1206,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, | |||
| 1226 | I915_WRITE(intel_dp->output_reg, dp_reg_value); | 1206 | I915_WRITE(intel_dp->output_reg, dp_reg_value); |
| 1227 | POSTING_READ(intel_dp->output_reg); | 1207 | POSTING_READ(intel_dp->output_reg); |
| 1228 | 1208 | ||
| 1229 | if (!intel_dp_aux_handshake_required(intel_dp)) | ||
| 1230 | return true; | ||
| 1231 | |||
| 1232 | intel_dp_aux_native_write_1(intel_dp, | 1209 | intel_dp_aux_native_write_1(intel_dp, |
| 1233 | DP_TRAINING_PATTERN_SET, | 1210 | DP_TRAINING_PATTERN_SET, |
| 1234 | dp_train_pat); | 1211 | dp_train_pat); |
| @@ -1261,11 +1238,10 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
| 1261 | POSTING_READ(intel_dp->output_reg); | 1238 | POSTING_READ(intel_dp->output_reg); |
| 1262 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 1239 | intel_wait_for_vblank(dev, intel_crtc->pipe); |
| 1263 | 1240 | ||
| 1264 | if (intel_dp_aux_handshake_required(intel_dp)) | 1241 | /* Write the link configuration data */ |
| 1265 | /* Write the link configuration data */ | 1242 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, |
| 1266 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, | 1243 | intel_dp->link_configuration, |
| 1267 | intel_dp->link_configuration, | 1244 | DP_LINK_CONFIGURATION_SIZE); |
| 1268 | DP_LINK_CONFIGURATION_SIZE); | ||
| 1269 | 1245 | ||
| 1270 | DP |= DP_PORT_EN; | 1246 | DP |= DP_PORT_EN; |
| 1271 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) | 1247 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) |
| @@ -1283,7 +1259,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
| 1283 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1259 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
| 1284 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1260 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
| 1285 | } else { | 1261 | } else { |
| 1286 | signal_levels = intel_dp_signal_levels(intel_dp); | 1262 | signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); |
| 1287 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1263 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
| 1288 | } | 1264 | } |
| 1289 | 1265 | ||
| @@ -1297,37 +1273,33 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
| 1297 | break; | 1273 | break; |
| 1298 | /* Set training pattern 1 */ | 1274 | /* Set training pattern 1 */ |
| 1299 | 1275 | ||
| 1300 | udelay(500); | 1276 | udelay(100); |
| 1301 | if (intel_dp_aux_handshake_required(intel_dp)) { | 1277 | if (!intel_dp_get_link_status(intel_dp)) |
| 1278 | break; | ||
| 1279 | |||
| 1280 | if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { | ||
| 1281 | clock_recovery = true; | ||
| 1302 | break; | 1282 | break; |
| 1303 | } else { | 1283 | } |
| 1304 | if (!intel_dp_get_link_status(intel_dp)) | ||
| 1305 | break; | ||
| 1306 | 1284 | ||
| 1307 | if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { | 1285 | /* Check to see if we've tried the max voltage */ |
| 1308 | clock_recovery = true; | 1286 | for (i = 0; i < intel_dp->lane_count; i++) |
| 1287 | if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) | ||
| 1309 | break; | 1288 | break; |
| 1310 | } | 1289 | if (i == intel_dp->lane_count) |
| 1290 | break; | ||
| 1311 | 1291 | ||
| 1312 | /* Check to see if we've tried the max voltage */ | 1292 | /* Check to see if we've tried the same voltage 5 times */ |
| 1313 | for (i = 0; i < intel_dp->lane_count; i++) | 1293 | if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { |
| 1314 | if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) | 1294 | ++tries; |
| 1315 | break; | 1295 | if (tries == 5) |
| 1316 | if (i == intel_dp->lane_count) | ||
| 1317 | break; | 1296 | break; |
| 1297 | } else | ||
| 1298 | tries = 0; | ||
| 1299 | voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; | ||
| 1318 | 1300 | ||
| 1319 | /* Check to see if we've tried the same voltage 5 times */ | 1301 | /* Compute new intel_dp->train_set as requested by target */ |
| 1320 | if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { | 1302 | intel_get_adjust_train(intel_dp); |
| 1321 | ++tries; | ||
| 1322 | if (tries == 5) | ||
| 1323 | break; | ||
| 1324 | } else | ||
| 1325 | tries = 0; | ||
| 1326 | voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; | ||
| 1327 | |||
| 1328 | /* Compute new intel_dp->train_set as requested by target */ | ||
| 1329 | intel_get_adjust_train(intel_dp); | ||
| 1330 | } | ||
| 1331 | } | 1303 | } |
| 1332 | 1304 | ||
| 1333 | intel_dp->DP = DP; | 1305 | intel_dp->DP = DP; |
| @@ -1354,7 +1326,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
| 1354 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1326 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
| 1355 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1327 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
| 1356 | } else { | 1328 | } else { |
| 1357 | signal_levels = intel_dp_signal_levels(intel_dp); | 1329 | signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); |
| 1358 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1330 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
| 1359 | } | 1331 | } |
| 1360 | 1332 | ||
| @@ -1368,28 +1340,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
| 1368 | DP_TRAINING_PATTERN_2)) | 1340 | DP_TRAINING_PATTERN_2)) |
| 1369 | break; | 1341 | break; |
| 1370 | 1342 | ||
| 1371 | udelay(500); | 1343 | udelay(400); |
| 1372 | 1344 | if (!intel_dp_get_link_status(intel_dp)) | |
| 1373 | if (!intel_dp_aux_handshake_required(intel_dp)) { | ||
| 1374 | break; | 1345 | break; |
| 1375 | } else { | ||
| 1376 | if (!intel_dp_get_link_status(intel_dp)) | ||
| 1377 | break; | ||
| 1378 | 1346 | ||
| 1379 | if (intel_channel_eq_ok(intel_dp)) { | 1347 | if (intel_channel_eq_ok(intel_dp)) { |
| 1380 | channel_eq = true; | 1348 | channel_eq = true; |
| 1381 | break; | 1349 | break; |
| 1382 | } | 1350 | } |
| 1383 | 1351 | ||
| 1384 | /* Try 5 times */ | 1352 | /* Try 5 times */ |
| 1385 | if (tries > 5) | 1353 | if (tries > 5) |
| 1386 | break; | 1354 | break; |
| 1387 | 1355 | ||
| 1388 | /* Compute new intel_dp->train_set as requested by target */ | 1356 | /* Compute new intel_dp->train_set as requested by target */ |
| 1389 | intel_get_adjust_train(intel_dp); | 1357 | intel_get_adjust_train(intel_dp); |
| 1390 | ++tries; | 1358 | ++tries; |
| 1391 | } | ||
| 1392 | } | 1359 | } |
| 1360 | |||
| 1393 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) | 1361 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) |
| 1394 | reg = DP | DP_LINK_TRAIN_OFF_CPT; | 1362 | reg = DP | DP_LINK_TRAIN_OFF_CPT; |
| 1395 | else | 1363 | else |
| @@ -1408,6 +1376,9 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
| 1408 | struct drm_i915_private *dev_priv = dev->dev_private; | 1376 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 1409 | uint32_t DP = intel_dp->DP; | 1377 | uint32_t DP = intel_dp->DP; |
| 1410 | 1378 | ||
| 1379 | if ((I915_READ(intel_dp->output_reg) & DP_PORT_EN) == 0) | ||
| 1380 | return; | ||
| 1381 | |||
| 1411 | DRM_DEBUG_KMS("\n"); | 1382 | DRM_DEBUG_KMS("\n"); |
| 1412 | 1383 | ||
| 1413 | if (is_edp(intel_dp)) { | 1384 | if (is_edp(intel_dp)) { |
| @@ -1430,6 +1401,28 @@ intel_dp_link_down(struct intel_dp *intel_dp) | |||
| 1430 | 1401 | ||
| 1431 | if (is_edp(intel_dp)) | 1402 | if (is_edp(intel_dp)) |
| 1432 | DP |= DP_LINK_TRAIN_OFF; | 1403 | DP |= DP_LINK_TRAIN_OFF; |
| 1404 | |||
| 1405 | if (!HAS_PCH_CPT(dev) && | ||
| 1406 | I915_READ(intel_dp->output_reg) & DP_PIPEB_SELECT) { | ||
| 1407 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc); | ||
| 1408 | /* Hardware workaround: leaving our transcoder select | ||
| 1409 | * set to transcoder B while it's off will prevent the | ||
| 1410 | * corresponding HDMI output on transcoder A. | ||
| 1411 | * | ||
| 1412 | * Combine this with another hardware workaround: | ||
| 1413 | * transcoder select bit can only be cleared while the | ||
| 1414 | * port is enabled. | ||
| 1415 | */ | ||
| 1416 | DP &= ~DP_PIPEB_SELECT; | ||
| 1417 | I915_WRITE(intel_dp->output_reg, DP); | ||
| 1418 | |||
| 1419 | /* Changes to enable or select take place the vblank | ||
| 1420 | * after being written. | ||
| 1421 | */ | ||
| 1422 | intel_wait_for_vblank(intel_dp->base.base.dev, | ||
| 1423 | intel_crtc->pipe); | ||
| 1424 | } | ||
| 1425 | |||
| 1433 | I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); | 1426 | I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); |
| 1434 | POSTING_READ(intel_dp->output_reg); | 1427 | POSTING_READ(intel_dp->output_reg); |
| 1435 | } | 1428 | } |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 21551fe74541..e52c6125bb1f 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
| @@ -237,7 +237,7 @@ extern bool intel_sdvo_init(struct drm_device *dev, int output_device); | |||
| 237 | extern void intel_dvo_init(struct drm_device *dev); | 237 | extern void intel_dvo_init(struct drm_device *dev); |
| 238 | extern void intel_tv_init(struct drm_device *dev); | 238 | extern void intel_tv_init(struct drm_device *dev); |
| 239 | extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); | 239 | extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); |
| 240 | extern void intel_lvds_init(struct drm_device *dev); | 240 | extern bool intel_lvds_init(struct drm_device *dev); |
| 241 | extern void intel_dp_init(struct drm_device *dev, int dp_reg); | 241 | extern void intel_dp_init(struct drm_device *dev, int dp_reg); |
| 242 | void | 242 | void |
| 243 | intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, | 243 | intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 4324a326f98e..25bcedf386fd 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
| @@ -68,7 +68,7 @@ static struct intel_lvds *intel_attached_lvds(struct drm_connector *connector) | |||
| 68 | /** | 68 | /** |
| 69 | * Sets the power state for the panel. | 69 | * Sets the power state for the panel. |
| 70 | */ | 70 | */ |
| 71 | static void intel_lvds_set_power(struct intel_lvds *intel_lvds, bool on) | 71 | static void intel_lvds_enable(struct intel_lvds *intel_lvds) |
| 72 | { | 72 | { |
| 73 | struct drm_device *dev = intel_lvds->base.base.dev; | 73 | struct drm_device *dev = intel_lvds->base.base.dev; |
| 74 | struct drm_i915_private *dev_priv = dev->dev_private; | 74 | struct drm_i915_private *dev_priv = dev->dev_private; |
| @@ -82,26 +82,61 @@ static void intel_lvds_set_power(struct intel_lvds *intel_lvds, bool on) | |||
| 82 | lvds_reg = LVDS; | 82 | lvds_reg = LVDS; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | if (on) { | 85 | I915_WRITE(lvds_reg, I915_READ(lvds_reg) | LVDS_PORT_EN); |
| 86 | I915_WRITE(lvds_reg, I915_READ(lvds_reg) | LVDS_PORT_EN); | ||
| 87 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) | POWER_TARGET_ON); | ||
| 88 | intel_panel_set_backlight(dev, dev_priv->backlight_level); | ||
| 89 | } else { | ||
| 90 | dev_priv->backlight_level = intel_panel_get_backlight(dev); | ||
| 91 | |||
| 92 | intel_panel_set_backlight(dev, 0); | ||
| 93 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); | ||
| 94 | 86 | ||
| 95 | if (intel_lvds->pfit_control) { | 87 | if (intel_lvds->pfit_dirty) { |
| 96 | if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) | 88 | /* |
| 97 | DRM_ERROR("timed out waiting for panel to power off\n"); | 89 | * Enable automatic panel scaling so that non-native modes |
| 98 | I915_WRITE(PFIT_CONTROL, 0); | 90 | * fill the screen. The panel fitter should only be |
| 99 | intel_lvds->pfit_control = 0; | 91 | * adjusted whilst the pipe is disabled, according to |
| 92 | * register description and PRM. | ||
| 93 | */ | ||
| 94 | DRM_DEBUG_KMS("applying panel-fitter: %x, %x\n", | ||
| 95 | intel_lvds->pfit_control, | ||
| 96 | intel_lvds->pfit_pgm_ratios); | ||
| 97 | if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) { | ||
| 98 | DRM_ERROR("timed out waiting for panel to power off\n"); | ||
| 99 | } else { | ||
| 100 | I915_WRITE(PFIT_PGM_RATIOS, intel_lvds->pfit_pgm_ratios); | ||
| 101 | I915_WRITE(PFIT_CONTROL, intel_lvds->pfit_control); | ||
| 100 | intel_lvds->pfit_dirty = false; | 102 | intel_lvds->pfit_dirty = false; |
| 101 | } | 103 | } |
| 104 | } | ||
| 105 | |||
| 106 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) | POWER_TARGET_ON); | ||
| 107 | POSTING_READ(lvds_reg); | ||
| 108 | |||
| 109 | intel_panel_set_backlight(dev, dev_priv->backlight_level); | ||
| 110 | } | ||
| 111 | |||
| 112 | static void intel_lvds_disable(struct intel_lvds *intel_lvds) | ||
| 113 | { | ||
| 114 | struct drm_device *dev = intel_lvds->base.base.dev; | ||
| 115 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 116 | u32 ctl_reg, lvds_reg; | ||
| 117 | |||
| 118 | if (HAS_PCH_SPLIT(dev)) { | ||
| 119 | ctl_reg = PCH_PP_CONTROL; | ||
| 120 | lvds_reg = PCH_LVDS; | ||
| 121 | } else { | ||
| 122 | ctl_reg = PP_CONTROL; | ||
| 123 | lvds_reg = LVDS; | ||
| 124 | } | ||
| 125 | |||
| 126 | dev_priv->backlight_level = intel_panel_get_backlight(dev); | ||
| 127 | intel_panel_set_backlight(dev, 0); | ||
| 128 | |||
| 129 | I915_WRITE(ctl_reg, I915_READ(ctl_reg) & ~POWER_TARGET_ON); | ||
| 130 | |||
| 131 | if (intel_lvds->pfit_control) { | ||
| 132 | if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) | ||
| 133 | DRM_ERROR("timed out waiting for panel to power off\n"); | ||
| 102 | 134 | ||
| 103 | I915_WRITE(lvds_reg, I915_READ(lvds_reg) & ~LVDS_PORT_EN); | 135 | I915_WRITE(PFIT_CONTROL, 0); |
| 136 | intel_lvds->pfit_dirty = true; | ||
| 104 | } | 137 | } |
| 138 | |||
| 139 | I915_WRITE(lvds_reg, I915_READ(lvds_reg) & ~LVDS_PORT_EN); | ||
| 105 | POSTING_READ(lvds_reg); | 140 | POSTING_READ(lvds_reg); |
| 106 | } | 141 | } |
| 107 | 142 | ||
| @@ -110,9 +145,9 @@ static void intel_lvds_dpms(struct drm_encoder *encoder, int mode) | |||
| 110 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); | 145 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); |
| 111 | 146 | ||
| 112 | if (mode == DRM_MODE_DPMS_ON) | 147 | if (mode == DRM_MODE_DPMS_ON) |
| 113 | intel_lvds_set_power(intel_lvds, true); | 148 | intel_lvds_enable(intel_lvds); |
| 114 | else | 149 | else |
| 115 | intel_lvds_set_power(intel_lvds, false); | 150 | intel_lvds_disable(intel_lvds); |
| 116 | 151 | ||
| 117 | /* XXX: We never power down the LVDS pairs. */ | 152 | /* XXX: We never power down the LVDS pairs. */ |
| 118 | } | 153 | } |
| @@ -411,43 +446,18 @@ static void intel_lvds_commit(struct drm_encoder *encoder) | |||
| 411 | /* Always do a full power on as we do not know what state | 446 | /* Always do a full power on as we do not know what state |
| 412 | * we were left in. | 447 | * we were left in. |
| 413 | */ | 448 | */ |
| 414 | intel_lvds_set_power(intel_lvds, true); | 449 | intel_lvds_enable(intel_lvds); |
| 415 | } | 450 | } |
| 416 | 451 | ||
| 417 | static void intel_lvds_mode_set(struct drm_encoder *encoder, | 452 | static void intel_lvds_mode_set(struct drm_encoder *encoder, |
| 418 | struct drm_display_mode *mode, | 453 | struct drm_display_mode *mode, |
| 419 | struct drm_display_mode *adjusted_mode) | 454 | struct drm_display_mode *adjusted_mode) |
| 420 | { | 455 | { |
| 421 | struct drm_device *dev = encoder->dev; | ||
| 422 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
| 423 | struct intel_lvds *intel_lvds = to_intel_lvds(encoder); | ||
| 424 | |||
| 425 | /* | 456 | /* |
| 426 | * The LVDS pin pair will already have been turned on in the | 457 | * The LVDS pin pair will already have been turned on in the |
| 427 | * intel_crtc_mode_set since it has a large impact on the DPLL | 458 | * intel_crtc_mode_set since it has a large impact on the DPLL |
| 428 | * settings. | 459 | * settings. |
| 429 | */ | 460 | */ |
| 430 | |||
| 431 | if (HAS_PCH_SPLIT(dev)) | ||
| 432 | return; | ||
| 433 | |||
| 434 | if (!intel_lvds->pfit_dirty) | ||
| 435 | return; | ||
| 436 | |||
| 437 | /* | ||
| 438 | * Enable automatic panel scaling so that non-native modes fill the | ||
| 439 | * screen. Should be enabled before the pipe is enabled, according to | ||
| 440 | * register description and PRM. | ||
| 441 | */ | ||
| 442 | DRM_DEBUG_KMS("applying panel-fitter: %x, %x\n", | ||
| 443 | intel_lvds->pfit_control, | ||
| 444 | intel_lvds->pfit_pgm_ratios); | ||
| 445 | if (wait_for((I915_READ(PP_STATUS) & PP_ON) == 0, 1000)) | ||
| 446 | DRM_ERROR("timed out waiting for panel to power off\n"); | ||
| 447 | |||
| 448 | I915_WRITE(PFIT_PGM_RATIOS, intel_lvds->pfit_pgm_ratios); | ||
| 449 | I915_WRITE(PFIT_CONTROL, intel_lvds->pfit_control); | ||
| 450 | intel_lvds->pfit_dirty = false; | ||
| 451 | } | 461 | } |
| 452 | 462 | ||
| 453 | /** | 463 | /** |
| @@ -837,7 +847,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) | |||
| 837 | * Create the connector, register the LVDS DDC bus, and try to figure out what | 847 | * Create the connector, register the LVDS DDC bus, and try to figure out what |
| 838 | * modes we can display on the LVDS panel (if present). | 848 | * modes we can display on the LVDS panel (if present). |
| 839 | */ | 849 | */ |
| 840 | void intel_lvds_init(struct drm_device *dev) | 850 | bool intel_lvds_init(struct drm_device *dev) |
| 841 | { | 851 | { |
| 842 | struct drm_i915_private *dev_priv = dev->dev_private; | 852 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 843 | struct intel_lvds *intel_lvds; | 853 | struct intel_lvds *intel_lvds; |
| @@ -853,37 +863,37 @@ void intel_lvds_init(struct drm_device *dev) | |||
| 853 | 863 | ||
| 854 | /* Skip init on machines we know falsely report LVDS */ | 864 | /* Skip init on machines we know falsely report LVDS */ |
| 855 | if (dmi_check_system(intel_no_lvds)) | 865 | if (dmi_check_system(intel_no_lvds)) |
| 856 | return; | 866 | return false; |
| 857 | 867 | ||
| 858 | pin = GMBUS_PORT_PANEL; | 868 | pin = GMBUS_PORT_PANEL; |
| 859 | if (!lvds_is_present_in_vbt(dev, &pin)) { | 869 | if (!lvds_is_present_in_vbt(dev, &pin)) { |
| 860 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); | 870 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); |
| 861 | return; | 871 | return false; |
| 862 | } | 872 | } |
| 863 | 873 | ||
| 864 | if (HAS_PCH_SPLIT(dev)) { | 874 | if (HAS_PCH_SPLIT(dev)) { |
| 865 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) | 875 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) |
| 866 | return; | 876 | return false; |
| 867 | if (dev_priv->edp.support) { | 877 | if (dev_priv->edp.support) { |
| 868 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); | 878 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); |
| 869 | return; | 879 | return false; |
| 870 | } | 880 | } |
| 871 | } | 881 | } |
| 872 | 882 | ||
| 873 | if (!intel_lvds_ddc_probe(dev, pin)) { | 883 | if (!intel_lvds_ddc_probe(dev, pin)) { |
| 874 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); | 884 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); |
| 875 | return; | 885 | return false; |
| 876 | } | 886 | } |
| 877 | 887 | ||
| 878 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); | 888 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); |
| 879 | if (!intel_lvds) { | 889 | if (!intel_lvds) { |
| 880 | return; | 890 | return false; |
| 881 | } | 891 | } |
| 882 | 892 | ||
| 883 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 893 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); |
| 884 | if (!intel_connector) { | 894 | if (!intel_connector) { |
| 885 | kfree(intel_lvds); | 895 | kfree(intel_lvds); |
| 886 | return; | 896 | return false; |
| 887 | } | 897 | } |
| 888 | 898 | ||
| 889 | if (!HAS_PCH_SPLIT(dev)) { | 899 | if (!HAS_PCH_SPLIT(dev)) { |
| @@ -1026,7 +1036,7 @@ out: | |||
| 1026 | /* keep the LVDS connector */ | 1036 | /* keep the LVDS connector */ |
| 1027 | dev_priv->int_lvds_connector = connector; | 1037 | dev_priv->int_lvds_connector = connector; |
| 1028 | drm_sysfs_connector_add(connector); | 1038 | drm_sysfs_connector_add(connector); |
| 1029 | return; | 1039 | return true; |
| 1030 | 1040 | ||
| 1031 | failed: | 1041 | failed: |
| 1032 | DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); | 1042 | DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); |
| @@ -1034,4 +1044,5 @@ failed: | |||
| 1034 | drm_encoder_cleanup(encoder); | 1044 | drm_encoder_cleanup(encoder); |
| 1035 | kfree(intel_lvds); | 1045 | kfree(intel_lvds); |
| 1036 | kfree(intel_connector); | 1046 | kfree(intel_connector); |
| 1047 | return false; | ||
| 1037 | } | 1048 | } |
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index b83306f9244b..89a65be8a3f3 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
| @@ -156,23 +156,25 @@ static int init_ring_common(struct drm_device *dev, | |||
| 156 | 156 | ||
| 157 | /* G45 ring initialization fails to reset head to zero */ | 157 | /* G45 ring initialization fails to reset head to zero */ |
| 158 | if (head != 0) { | 158 | if (head != 0) { |
| 159 | DRM_ERROR("%s head not reset to zero " | 159 | DRM_DEBUG_KMS("%s head not reset to zero " |
| 160 | "ctl %08x head %08x tail %08x start %08x\n", | 160 | "ctl %08x head %08x tail %08x start %08x\n", |
| 161 | ring->name, | 161 | ring->name, |
| 162 | I915_READ_CTL(ring), | 162 | I915_READ_CTL(ring), |
| 163 | I915_READ_HEAD(ring), | 163 | I915_READ_HEAD(ring), |
| 164 | I915_READ_TAIL(ring), | 164 | I915_READ_TAIL(ring), |
| 165 | I915_READ_START(ring)); | 165 | I915_READ_START(ring)); |
| 166 | 166 | ||
| 167 | I915_WRITE_HEAD(ring, 0); | 167 | I915_WRITE_HEAD(ring, 0); |
| 168 | 168 | ||
| 169 | DRM_ERROR("%s head forced to zero " | 169 | if (I915_READ_HEAD(ring) & HEAD_ADDR) { |
| 170 | "ctl %08x head %08x tail %08x start %08x\n", | 170 | DRM_ERROR("failed to set %s head to zero " |
| 171 | ring->name, | 171 | "ctl %08x head %08x tail %08x start %08x\n", |
| 172 | I915_READ_CTL(ring), | 172 | ring->name, |
| 173 | I915_READ_HEAD(ring), | 173 | I915_READ_CTL(ring), |
| 174 | I915_READ_TAIL(ring), | 174 | I915_READ_HEAD(ring), |
| 175 | I915_READ_START(ring)); | 175 | I915_READ_TAIL(ring), |
| 176 | I915_READ_START(ring)); | ||
| 177 | } | ||
| 176 | } | 178 | } |
| 177 | 179 | ||
| 178 | I915_WRITE_CTL(ring, | 180 | I915_WRITE_CTL(ring, |
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index de158b76bcd5..d97e6cb52d34 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
| @@ -107,7 +107,8 @@ struct intel_sdvo { | |||
| 107 | * This is set if we treat the device as HDMI, instead of DVI. | 107 | * This is set if we treat the device as HDMI, instead of DVI. |
| 108 | */ | 108 | */ |
| 109 | bool is_hdmi; | 109 | bool is_hdmi; |
| 110 | bool has_audio; | 110 | bool has_hdmi_monitor; |
| 111 | bool has_hdmi_audio; | ||
| 111 | 112 | ||
| 112 | /** | 113 | /** |
| 113 | * This is set if we detect output of sdvo device as LVDS and | 114 | * This is set if we detect output of sdvo device as LVDS and |
| @@ -1023,7 +1024,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1023 | if (!intel_sdvo_set_target_input(intel_sdvo)) | 1024 | if (!intel_sdvo_set_target_input(intel_sdvo)) |
| 1024 | return; | 1025 | return; |
| 1025 | 1026 | ||
| 1026 | if (intel_sdvo->is_hdmi && | 1027 | if (intel_sdvo->has_hdmi_monitor && |
| 1027 | !intel_sdvo_set_avi_infoframe(intel_sdvo)) | 1028 | !intel_sdvo_set_avi_infoframe(intel_sdvo)) |
| 1028 | return; | 1029 | return; |
| 1029 | 1030 | ||
| @@ -1063,7 +1064,7 @@ static void intel_sdvo_mode_set(struct drm_encoder *encoder, | |||
| 1063 | } | 1064 | } |
| 1064 | if (intel_crtc->pipe == 1) | 1065 | if (intel_crtc->pipe == 1) |
| 1065 | sdvox |= SDVO_PIPE_B_SELECT; | 1066 | sdvox |= SDVO_PIPE_B_SELECT; |
| 1066 | if (intel_sdvo->has_audio) | 1067 | if (intel_sdvo->has_hdmi_audio) |
| 1067 | sdvox |= SDVO_AUDIO_ENABLE; | 1068 | sdvox |= SDVO_AUDIO_ENABLE; |
| 1068 | 1069 | ||
| 1069 | if (INTEL_INFO(dev)->gen >= 4) { | 1070 | if (INTEL_INFO(dev)->gen >= 4) { |
| @@ -1295,55 +1296,14 @@ intel_sdvo_get_edid(struct drm_connector *connector) | |||
| 1295 | return drm_get_edid(connector, &sdvo->ddc); | 1296 | return drm_get_edid(connector, &sdvo->ddc); |
| 1296 | } | 1297 | } |
| 1297 | 1298 | ||
| 1298 | static struct drm_connector * | ||
| 1299 | intel_find_analog_connector(struct drm_device *dev) | ||
| 1300 | { | ||
| 1301 | struct drm_connector *connector; | ||
| 1302 | struct intel_sdvo *encoder; | ||
| 1303 | |||
| 1304 | list_for_each_entry(encoder, | ||
| 1305 | &dev->mode_config.encoder_list, | ||
| 1306 | base.base.head) { | ||
| 1307 | if (encoder->base.type == INTEL_OUTPUT_ANALOG) { | ||
| 1308 | list_for_each_entry(connector, | ||
| 1309 | &dev->mode_config.connector_list, | ||
| 1310 | head) { | ||
| 1311 | if (&encoder->base == | ||
| 1312 | intel_attached_encoder(connector)) | ||
| 1313 | return connector; | ||
| 1314 | } | ||
| 1315 | } | ||
| 1316 | } | ||
| 1317 | |||
| 1318 | return NULL; | ||
| 1319 | } | ||
| 1320 | |||
| 1321 | static int | ||
| 1322 | intel_analog_is_connected(struct drm_device *dev) | ||
| 1323 | { | ||
| 1324 | struct drm_connector *analog_connector; | ||
| 1325 | |||
| 1326 | analog_connector = intel_find_analog_connector(dev); | ||
| 1327 | if (!analog_connector) | ||
| 1328 | return false; | ||
| 1329 | |||
| 1330 | if (analog_connector->funcs->detect(analog_connector, false) == | ||
| 1331 | connector_status_disconnected) | ||
| 1332 | return false; | ||
| 1333 | |||
| 1334 | return true; | ||
| 1335 | } | ||
| 1336 | |||
| 1337 | /* Mac mini hack -- use the same DDC as the analog connector */ | 1299 | /* Mac mini hack -- use the same DDC as the analog connector */ |
| 1338 | static struct edid * | 1300 | static struct edid * |
| 1339 | intel_sdvo_get_analog_edid(struct drm_connector *connector) | 1301 | intel_sdvo_get_analog_edid(struct drm_connector *connector) |
| 1340 | { | 1302 | { |
| 1341 | struct drm_i915_private *dev_priv = connector->dev->dev_private; | 1303 | struct drm_i915_private *dev_priv = connector->dev->dev_private; |
| 1342 | 1304 | ||
| 1343 | if (!intel_analog_is_connected(connector->dev)) | 1305 | return drm_get_edid(connector, |
| 1344 | return NULL; | 1306 | &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); |
| 1345 | |||
| 1346 | return drm_get_edid(connector, &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); | ||
| 1347 | } | 1307 | } |
| 1348 | 1308 | ||
| 1349 | enum drm_connector_status | 1309 | enum drm_connector_status |
| @@ -1388,8 +1348,10 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) | |||
| 1388 | /* DDC bus is shared, match EDID to connector type */ | 1348 | /* DDC bus is shared, match EDID to connector type */ |
| 1389 | if (edid->input & DRM_EDID_INPUT_DIGITAL) { | 1349 | if (edid->input & DRM_EDID_INPUT_DIGITAL) { |
| 1390 | status = connector_status_connected; | 1350 | status = connector_status_connected; |
| 1391 | intel_sdvo->is_hdmi = drm_detect_hdmi_monitor(edid); | 1351 | if (intel_sdvo->is_hdmi) { |
| 1392 | intel_sdvo->has_audio = drm_detect_monitor_audio(edid); | 1352 | intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid); |
| 1353 | intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid); | ||
| 1354 | } | ||
| 1393 | } | 1355 | } |
| 1394 | connector->display_info.raw_edid = NULL; | 1356 | connector->display_info.raw_edid = NULL; |
| 1395 | kfree(edid); | 1357 | kfree(edid); |
| @@ -1398,7 +1360,7 @@ intel_sdvo_hdmi_sink_detect(struct drm_connector *connector) | |||
| 1398 | if (status == connector_status_connected) { | 1360 | if (status == connector_status_connected) { |
| 1399 | struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); | 1361 | struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); |
| 1400 | if (intel_sdvo_connector->force_audio) | 1362 | if (intel_sdvo_connector->force_audio) |
| 1401 | intel_sdvo->has_audio = intel_sdvo_connector->force_audio > 0; | 1363 | intel_sdvo->has_hdmi_audio = intel_sdvo_connector->force_audio > 0; |
| 1402 | } | 1364 | } |
| 1403 | 1365 | ||
| 1404 | return status; | 1366 | return status; |
| @@ -1415,10 +1377,12 @@ intel_sdvo_detect(struct drm_connector *connector, bool force) | |||
| 1415 | if (!intel_sdvo_write_cmd(intel_sdvo, | 1377 | if (!intel_sdvo_write_cmd(intel_sdvo, |
| 1416 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) | 1378 | SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0)) |
| 1417 | return connector_status_unknown; | 1379 | return connector_status_unknown; |
| 1418 | if (intel_sdvo->is_tv) { | 1380 | |
| 1419 | /* add 30ms delay when the output type is SDVO-TV */ | 1381 | /* add 30ms delay when the output type might be TV */ |
| 1382 | if (intel_sdvo->caps.output_flags & | ||
| 1383 | (SDVO_OUTPUT_SVID0 | SDVO_OUTPUT_CVBS0)) | ||
| 1420 | mdelay(30); | 1384 | mdelay(30); |
| 1421 | } | 1385 | |
| 1422 | if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) | 1386 | if (!intel_sdvo_read_response(intel_sdvo, &response, 2)) |
| 1423 | return connector_status_unknown; | 1387 | return connector_status_unknown; |
| 1424 | 1388 | ||
| @@ -1472,8 +1436,10 @@ static void intel_sdvo_get_ddc_modes(struct drm_connector *connector) | |||
| 1472 | edid = intel_sdvo_get_analog_edid(connector); | 1436 | edid = intel_sdvo_get_analog_edid(connector); |
| 1473 | 1437 | ||
| 1474 | if (edid != NULL) { | 1438 | if (edid != NULL) { |
| 1475 | drm_mode_connector_update_edid_property(connector, edid); | 1439 | if (edid->input & DRM_EDID_INPUT_DIGITAL) { |
| 1476 | drm_add_edid_modes(connector, edid); | 1440 | drm_mode_connector_update_edid_property(connector, edid); |
| 1441 | drm_add_edid_modes(connector, edid); | ||
| 1442 | } | ||
| 1477 | connector->display_info.raw_edid = NULL; | 1443 | connector->display_info.raw_edid = NULL; |
| 1478 | kfree(edid); | 1444 | kfree(edid); |
| 1479 | } | 1445 | } |
| @@ -1713,12 +1679,12 @@ intel_sdvo_set_property(struct drm_connector *connector, | |||
| 1713 | 1679 | ||
| 1714 | intel_sdvo_connector->force_audio = val; | 1680 | intel_sdvo_connector->force_audio = val; |
| 1715 | 1681 | ||
| 1716 | if (val > 0 && intel_sdvo->has_audio) | 1682 | if (val > 0 && intel_sdvo->has_hdmi_audio) |
| 1717 | return 0; | 1683 | return 0; |
| 1718 | if (val < 0 && !intel_sdvo->has_audio) | 1684 | if (val < 0 && !intel_sdvo->has_hdmi_audio) |
| 1719 | return 0; | 1685 | return 0; |
| 1720 | 1686 | ||
| 1721 | intel_sdvo->has_audio = val > 0; | 1687 | intel_sdvo->has_hdmi_audio = val > 0; |
| 1722 | goto done; | 1688 | goto done; |
| 1723 | } | 1689 | } |
| 1724 | 1690 | ||
| @@ -2070,6 +2036,8 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
| 2070 | intel_sdvo_set_colorimetry(intel_sdvo, | 2036 | intel_sdvo_set_colorimetry(intel_sdvo, |
| 2071 | SDVO_COLORIMETRY_RGB256); | 2037 | SDVO_COLORIMETRY_RGB256); |
| 2072 | connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; | 2038 | connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; |
| 2039 | |||
| 2040 | intel_sdvo_add_hdmi_properties(intel_sdvo_connector); | ||
| 2073 | intel_sdvo->is_hdmi = true; | 2041 | intel_sdvo->is_hdmi = true; |
| 2074 | } | 2042 | } |
| 2075 | intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | | 2043 | intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | |
| @@ -2077,8 +2045,6 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) | |||
| 2077 | 2045 | ||
| 2078 | intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); | 2046 | intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo); |
| 2079 | 2047 | ||
| 2080 | intel_sdvo_add_hdmi_properties(intel_sdvo_connector); | ||
| 2081 | |||
| 2082 | return true; | 2048 | return true; |
| 2083 | } | 2049 | } |
| 2084 | 2050 | ||
diff --git a/drivers/gpu/drm/radeon/atom.c b/drivers/gpu/drm/radeon/atom.c index 8e421f644a54..05efb5b9f13e 100644 --- a/drivers/gpu/drm/radeon/atom.c +++ b/drivers/gpu/drm/radeon/atom.c | |||
| @@ -112,6 +112,7 @@ static uint32_t atom_iio_execute(struct atom_context *ctx, int base, | |||
| 112 | base += 3; | 112 | base += 3; |
| 113 | break; | 113 | break; |
| 114 | case ATOM_IIO_WRITE: | 114 | case ATOM_IIO_WRITE: |
| 115 | (void)ctx->card->ioreg_read(ctx->card, CU16(base + 1)); | ||
| 115 | ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); | 116 | ctx->card->ioreg_write(ctx->card, CU16(base + 1), temp); |
| 116 | base += 3; | 117 | base += 3; |
| 117 | break; | 118 | break; |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index a3552594ccc4..4d7a2e1bdb90 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
| @@ -878,12 +878,15 @@ void r600_pcie_gart_tlb_flush(struct radeon_device *rdev) | |||
| 878 | u32 tmp; | 878 | u32 tmp; |
| 879 | 879 | ||
| 880 | /* flush hdp cache so updates hit vram */ | 880 | /* flush hdp cache so updates hit vram */ |
| 881 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740)) { | 881 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) && |
| 882 | !(rdev->flags & RADEON_IS_AGP)) { | ||
| 882 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; | 883 | void __iomem *ptr = (void *)rdev->gart.table.vram.ptr; |
| 883 | u32 tmp; | 884 | u32 tmp; |
| 884 | 885 | ||
| 885 | /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read | 886 | /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read |
| 886 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL | 887 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL |
| 888 | * This seems to cause problems on some AGP cards. Just use the old | ||
| 889 | * method for them. | ||
| 887 | */ | 890 | */ |
| 888 | WREG32(HDP_DEBUG1, 0); | 891 | WREG32(HDP_DEBUG1, 0); |
| 889 | tmp = readl((void __iomem *)ptr); | 892 | tmp = readl((void __iomem *)ptr); |
| @@ -1195,8 +1198,10 @@ void r600_vram_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
| 1195 | mc->vram_end, mc->real_vram_size >> 20); | 1198 | mc->vram_end, mc->real_vram_size >> 20); |
| 1196 | } else { | 1199 | } else { |
| 1197 | u64 base = 0; | 1200 | u64 base = 0; |
| 1198 | if (rdev->flags & RADEON_IS_IGP) | 1201 | if (rdev->flags & RADEON_IS_IGP) { |
| 1199 | base = (RREG32(MC_VM_FB_LOCATION) & 0xFFFF) << 24; | 1202 | base = RREG32(MC_VM_FB_LOCATION) & 0xFFFF; |
| 1203 | base <<= 24; | ||
| 1204 | } | ||
| 1200 | radeon_vram_location(rdev, &rdev->mc, base); | 1205 | radeon_vram_location(rdev, &rdev->mc, base); |
| 1201 | rdev->mc.gtt_base_align = 0; | 1206 | rdev->mc.gtt_base_align = 0; |
| 1202 | radeon_gtt_location(rdev, mc); | 1207 | radeon_gtt_location(rdev, mc); |
| @@ -3483,10 +3488,12 @@ int r600_debugfs_mc_info_init(struct radeon_device *rdev) | |||
| 3483 | void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) | 3488 | void r600_ioctl_wait_idle(struct radeon_device *rdev, struct radeon_bo *bo) |
| 3484 | { | 3489 | { |
| 3485 | /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read | 3490 | /* r7xx hw bug. write to HDP_DEBUG1 followed by fb read |
| 3486 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL | 3491 | * rather than write to HDP_REG_COHERENCY_FLUSH_CNTL. |
| 3492 | * This seems to cause problems on some AGP cards. Just use the old | ||
| 3493 | * method for them. | ||
| 3487 | */ | 3494 | */ |
| 3488 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) && | 3495 | if ((rdev->family >= CHIP_RV770) && (rdev->family <= CHIP_RV740) && |
| 3489 | rdev->vram_scratch.ptr) { | 3496 | rdev->vram_scratch.ptr && !(rdev->flags & RADEON_IS_AGP)) { |
| 3490 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; | 3497 | void __iomem *ptr = (void *)rdev->vram_scratch.ptr; |
| 3491 | u32 tmp; | 3498 | u32 tmp; |
| 3492 | 3499 | ||
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 9bebac1ec006..0f90fc3482ce 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
| @@ -315,7 +315,7 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i) | |||
| 315 | if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { | 315 | if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) { |
| 316 | /* the initial DDX does bad things with the CB size occasionally */ | 316 | /* the initial DDX does bad things with the CB size occasionally */ |
| 317 | /* it rounds up height too far for slice tile max but the BO is smaller */ | 317 | /* it rounds up height too far for slice tile max but the BO is smaller */ |
| 318 | tmp = (height - 7) * pitch * bpe; | 318 | tmp = (height - 7) * 8 * bpe; |
| 319 | if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { | 319 | if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) { |
| 320 | dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); | 320 | dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i])); |
| 321 | return -EINVAL; | 321 | return -EINVAL; |
diff --git a/drivers/gpu/drm/radeon/r600_reg.h b/drivers/gpu/drm/radeon/r600_reg.h index d84612ae47e0..33cda016b083 100644 --- a/drivers/gpu/drm/radeon/r600_reg.h +++ b/drivers/gpu/drm/radeon/r600_reg.h | |||
| @@ -86,6 +86,7 @@ | |||
| 86 | #define R600_HDP_NONSURFACE_BASE 0x2c04 | 86 | #define R600_HDP_NONSURFACE_BASE 0x2c04 |
| 87 | 87 | ||
| 88 | #define R600_BUS_CNTL 0x5420 | 88 | #define R600_BUS_CNTL 0x5420 |
| 89 | # define R600_BIOS_ROM_DIS (1 << 1) | ||
| 89 | #define R600_CONFIG_CNTL 0x5424 | 90 | #define R600_CONFIG_CNTL 0x5424 |
| 90 | #define R600_CONFIG_MEMSIZE 0x5428 | 91 | #define R600_CONFIG_MEMSIZE 0x5428 |
| 91 | #define R600_CONFIG_F0_BASE 0x542C | 92 | #define R600_CONFIG_F0_BASE 0x542C |
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index 87ead090c7d5..bc5a2c3382d9 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c | |||
| @@ -98,6 +98,14 @@ static inline struct radeon_i2c_bus_rec radeon_lookup_i2c_gpio(struct radeon_dev | |||
| 98 | } | 98 | } |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | /* some DCE3 boards have bad data for this entry */ | ||
| 102 | if (ASIC_IS_DCE3(rdev)) { | ||
| 103 | if ((i == 4) && | ||
| 104 | (gpio->usClkMaskRegisterIndex == 0x1fda) && | ||
| 105 | (gpio->sucI2cId.ucAccess == 0x94)) | ||
| 106 | gpio->sucI2cId.ucAccess = 0x14; | ||
| 107 | } | ||
| 108 | |||
| 101 | if (gpio->sucI2cId.ucAccess == id) { | 109 | if (gpio->sucI2cId.ucAccess == id) { |
| 102 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; | 110 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; |
| 103 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; | 111 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; |
| @@ -174,6 +182,14 @@ void radeon_atombios_i2c_init(struct radeon_device *rdev) | |||
| 174 | } | 182 | } |
| 175 | } | 183 | } |
| 176 | 184 | ||
| 185 | /* some DCE3 boards have bad data for this entry */ | ||
| 186 | if (ASIC_IS_DCE3(rdev)) { | ||
| 187 | if ((i == 4) && | ||
| 188 | (gpio->usClkMaskRegisterIndex == 0x1fda) && | ||
| 189 | (gpio->sucI2cId.ucAccess == 0x94)) | ||
| 190 | gpio->sucI2cId.ucAccess = 0x14; | ||
| 191 | } | ||
| 192 | |||
| 177 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; | 193 | i2c.mask_clk_reg = le16_to_cpu(gpio->usClkMaskRegisterIndex) * 4; |
| 178 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; | 194 | i2c.mask_data_reg = le16_to_cpu(gpio->usDataMaskRegisterIndex) * 4; |
| 179 | i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4; | 195 | i2c.en_clk_reg = le16_to_cpu(gpio->usClkEnRegisterIndex) * 4; |
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c index 654787ec43f4..8f2c7b50dcf5 100644 --- a/drivers/gpu/drm/radeon/radeon_bios.c +++ b/drivers/gpu/drm/radeon/radeon_bios.c | |||
| @@ -130,6 +130,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) | |||
| 130 | } | 130 | } |
| 131 | return true; | 131 | return true; |
| 132 | } | 132 | } |
| 133 | |||
| 133 | static bool r700_read_disabled_bios(struct radeon_device *rdev) | 134 | static bool r700_read_disabled_bios(struct radeon_device *rdev) |
| 134 | { | 135 | { |
| 135 | uint32_t viph_control; | 136 | uint32_t viph_control; |
| @@ -143,7 +144,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) | |||
| 143 | bool r; | 144 | bool r; |
| 144 | 145 | ||
| 145 | viph_control = RREG32(RADEON_VIPH_CONTROL); | 146 | viph_control = RREG32(RADEON_VIPH_CONTROL); |
| 146 | bus_cntl = RREG32(RADEON_BUS_CNTL); | 147 | bus_cntl = RREG32(R600_BUS_CNTL); |
| 147 | d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); | 148 | d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); |
| 148 | d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); | 149 | d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); |
| 149 | vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); | 150 | vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); |
| @@ -152,7 +153,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) | |||
| 152 | /* disable VIP */ | 153 | /* disable VIP */ |
| 153 | WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); | 154 | WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); |
| 154 | /* enable the rom */ | 155 | /* enable the rom */ |
| 155 | WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); | 156 | WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); |
| 156 | /* Disable VGA mode */ | 157 | /* Disable VGA mode */ |
| 157 | WREG32(AVIVO_D1VGA_CONTROL, | 158 | WREG32(AVIVO_D1VGA_CONTROL, |
| 158 | (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | | 159 | (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | |
| @@ -191,7 +192,7 @@ static bool r700_read_disabled_bios(struct radeon_device *rdev) | |||
| 191 | cg_spll_status = RREG32(R600_CG_SPLL_STATUS); | 192 | cg_spll_status = RREG32(R600_CG_SPLL_STATUS); |
| 192 | } | 193 | } |
| 193 | WREG32(RADEON_VIPH_CONTROL, viph_control); | 194 | WREG32(RADEON_VIPH_CONTROL, viph_control); |
| 194 | WREG32(RADEON_BUS_CNTL, bus_cntl); | 195 | WREG32(R600_BUS_CNTL, bus_cntl); |
| 195 | WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); | 196 | WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); |
| 196 | WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); | 197 | WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); |
| 197 | WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); | 198 | WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); |
| @@ -216,7 +217,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) | |||
| 216 | bool r; | 217 | bool r; |
| 217 | 218 | ||
| 218 | viph_control = RREG32(RADEON_VIPH_CONTROL); | 219 | viph_control = RREG32(RADEON_VIPH_CONTROL); |
| 219 | bus_cntl = RREG32(RADEON_BUS_CNTL); | 220 | bus_cntl = RREG32(R600_BUS_CNTL); |
| 220 | d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); | 221 | d1vga_control = RREG32(AVIVO_D1VGA_CONTROL); |
| 221 | d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); | 222 | d2vga_control = RREG32(AVIVO_D2VGA_CONTROL); |
| 222 | vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); | 223 | vga_render_control = RREG32(AVIVO_VGA_RENDER_CONTROL); |
| @@ -231,7 +232,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) | |||
| 231 | /* disable VIP */ | 232 | /* disable VIP */ |
| 232 | WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); | 233 | WREG32(RADEON_VIPH_CONTROL, (viph_control & ~RADEON_VIPH_EN)); |
| 233 | /* enable the rom */ | 234 | /* enable the rom */ |
| 234 | WREG32(RADEON_BUS_CNTL, (bus_cntl & ~RADEON_BUS_BIOS_DIS_ROM)); | 235 | WREG32(R600_BUS_CNTL, (bus_cntl & ~R600_BIOS_ROM_DIS)); |
| 235 | /* Disable VGA mode */ | 236 | /* Disable VGA mode */ |
| 236 | WREG32(AVIVO_D1VGA_CONTROL, | 237 | WREG32(AVIVO_D1VGA_CONTROL, |
| 237 | (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | | 238 | (d1vga_control & ~(AVIVO_DVGA_CONTROL_MODE_ENABLE | |
| @@ -262,7 +263,7 @@ static bool r600_read_disabled_bios(struct radeon_device *rdev) | |||
| 262 | 263 | ||
| 263 | /* restore regs */ | 264 | /* restore regs */ |
| 264 | WREG32(RADEON_VIPH_CONTROL, viph_control); | 265 | WREG32(RADEON_VIPH_CONTROL, viph_control); |
| 265 | WREG32(RADEON_BUS_CNTL, bus_cntl); | 266 | WREG32(R600_BUS_CNTL, bus_cntl); |
| 266 | WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); | 267 | WREG32(AVIVO_D1VGA_CONTROL, d1vga_control); |
| 267 | WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); | 268 | WREG32(AVIVO_D2VGA_CONTROL, d2vga_control); |
| 268 | WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); | 269 | WREG32(AVIVO_VGA_RENDER_CONTROL, vga_render_control); |
diff --git a/drivers/gpu/drm/radeon/radeon_combios.c b/drivers/gpu/drm/radeon/radeon_combios.c index 3bddea5b5295..137b8075f6e7 100644 --- a/drivers/gpu/drm/radeon/radeon_combios.c +++ b/drivers/gpu/drm/radeon/radeon_combios.c | |||
| @@ -729,7 +729,7 @@ void radeon_combios_i2c_init(struct radeon_device *rdev) | |||
| 729 | clk = RBIOS8(offset + 3 + (i * 5) + 3); | 729 | clk = RBIOS8(offset + 3 + (i * 5) + 3); |
| 730 | data = RBIOS8(offset + 3 + (i * 5) + 4); | 730 | data = RBIOS8(offset + 3 + (i * 5) + 4); |
| 731 | i2c = combios_setup_i2c_bus(rdev, DDC_MONID, | 731 | i2c = combios_setup_i2c_bus(rdev, DDC_MONID, |
| 732 | clk, data); | 732 | (1 << clk), (1 << data)); |
| 733 | rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "GPIOPAD_MASK"); | 733 | rdev->i2c_bus[4] = radeon_i2c_create(dev, &i2c, "GPIOPAD_MASK"); |
| 734 | break; | 734 | break; |
| 735 | } | 735 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 3bef9f6d66fd..8afaf7a7459e 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
| @@ -1175,6 +1175,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1175 | /* no HPD on analog connectors */ | 1175 | /* no HPD on analog connectors */ |
| 1176 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | 1176 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1177 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | 1177 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; |
| 1178 | connector->interlace_allowed = true; | ||
| 1179 | connector->doublescan_allowed = true; | ||
| 1178 | break; | 1180 | break; |
| 1179 | case DRM_MODE_CONNECTOR_DVIA: | 1181 | case DRM_MODE_CONNECTOR_DVIA: |
| 1180 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); | 1182 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
| @@ -1190,6 +1192,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1190 | 1); | 1192 | 1); |
| 1191 | /* no HPD on analog connectors */ | 1193 | /* no HPD on analog connectors */ |
| 1192 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | 1194 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1195 | connector->interlace_allowed = true; | ||
| 1196 | connector->doublescan_allowed = true; | ||
| 1193 | break; | 1197 | break; |
| 1194 | case DRM_MODE_CONNECTOR_DVII: | 1198 | case DRM_MODE_CONNECTOR_DVII: |
| 1195 | case DRM_MODE_CONNECTOR_DVID: | 1199 | case DRM_MODE_CONNECTOR_DVID: |
| @@ -1226,6 +1230,11 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1226 | rdev->mode_info.load_detect_property, | 1230 | rdev->mode_info.load_detect_property, |
| 1227 | 1); | 1231 | 1); |
| 1228 | } | 1232 | } |
| 1233 | connector->interlace_allowed = true; | ||
| 1234 | if (connector_type == DRM_MODE_CONNECTOR_DVII) | ||
| 1235 | connector->doublescan_allowed = true; | ||
| 1236 | else | ||
| 1237 | connector->doublescan_allowed = false; | ||
| 1229 | break; | 1238 | break; |
| 1230 | case DRM_MODE_CONNECTOR_HDMIA: | 1239 | case DRM_MODE_CONNECTOR_HDMIA: |
| 1231 | case DRM_MODE_CONNECTOR_HDMIB: | 1240 | case DRM_MODE_CONNECTOR_HDMIB: |
| @@ -1256,6 +1265,11 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1256 | 0); | 1265 | 0); |
| 1257 | } | 1266 | } |
| 1258 | subpixel_order = SubPixelHorizontalRGB; | 1267 | subpixel_order = SubPixelHorizontalRGB; |
| 1268 | connector->interlace_allowed = true; | ||
| 1269 | if (connector_type == DRM_MODE_CONNECTOR_HDMIB) | ||
| 1270 | connector->doublescan_allowed = true; | ||
| 1271 | else | ||
| 1272 | connector->doublescan_allowed = false; | ||
| 1259 | break; | 1273 | break; |
| 1260 | case DRM_MODE_CONNECTOR_DisplayPort: | 1274 | case DRM_MODE_CONNECTOR_DisplayPort: |
| 1261 | case DRM_MODE_CONNECTOR_eDP: | 1275 | case DRM_MODE_CONNECTOR_eDP: |
| @@ -1293,6 +1307,9 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1293 | rdev->mode_info.underscan_vborder_property, | 1307 | rdev->mode_info.underscan_vborder_property, |
| 1294 | 0); | 1308 | 0); |
| 1295 | } | 1309 | } |
| 1310 | connector->interlace_allowed = true; | ||
| 1311 | /* in theory with a DP to VGA converter... */ | ||
| 1312 | connector->doublescan_allowed = false; | ||
| 1296 | break; | 1313 | break; |
| 1297 | case DRM_MODE_CONNECTOR_SVIDEO: | 1314 | case DRM_MODE_CONNECTOR_SVIDEO: |
| 1298 | case DRM_MODE_CONNECTOR_Composite: | 1315 | case DRM_MODE_CONNECTOR_Composite: |
| @@ -1308,6 +1325,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1308 | radeon_atombios_get_tv_info(rdev)); | 1325 | radeon_atombios_get_tv_info(rdev)); |
| 1309 | /* no HPD on analog connectors */ | 1326 | /* no HPD on analog connectors */ |
| 1310 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | 1327 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1328 | connector->interlace_allowed = false; | ||
| 1329 | connector->doublescan_allowed = false; | ||
| 1311 | break; | 1330 | break; |
| 1312 | case DRM_MODE_CONNECTOR_LVDS: | 1331 | case DRM_MODE_CONNECTOR_LVDS: |
| 1313 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); | 1332 | radeon_dig_connector = kzalloc(sizeof(struct radeon_connector_atom_dig), GFP_KERNEL); |
| @@ -1326,6 +1345,8 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
| 1326 | dev->mode_config.scaling_mode_property, | 1345 | dev->mode_config.scaling_mode_property, |
| 1327 | DRM_MODE_SCALE_FULLSCREEN); | 1346 | DRM_MODE_SCALE_FULLSCREEN); |
| 1328 | subpixel_order = SubPixelHorizontalRGB; | 1347 | subpixel_order = SubPixelHorizontalRGB; |
| 1348 | connector->interlace_allowed = false; | ||
| 1349 | connector->doublescan_allowed = false; | ||
| 1329 | break; | 1350 | break; |
| 1330 | } | 1351 | } |
| 1331 | 1352 | ||
| @@ -1403,6 +1424,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1403 | /* no HPD on analog connectors */ | 1424 | /* no HPD on analog connectors */ |
| 1404 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | 1425 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1405 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; | 1426 | connector->polled = DRM_CONNECTOR_POLL_CONNECT; |
| 1427 | connector->interlace_allowed = true; | ||
| 1428 | connector->doublescan_allowed = true; | ||
| 1406 | break; | 1429 | break; |
| 1407 | case DRM_MODE_CONNECTOR_DVIA: | 1430 | case DRM_MODE_CONNECTOR_DVIA: |
| 1408 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); | 1431 | drm_connector_init(dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); |
| @@ -1418,6 +1441,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1418 | 1); | 1441 | 1); |
| 1419 | /* no HPD on analog connectors */ | 1442 | /* no HPD on analog connectors */ |
| 1420 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | 1443 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1444 | connector->interlace_allowed = true; | ||
| 1445 | connector->doublescan_allowed = true; | ||
| 1421 | break; | 1446 | break; |
| 1422 | case DRM_MODE_CONNECTOR_DVII: | 1447 | case DRM_MODE_CONNECTOR_DVII: |
| 1423 | case DRM_MODE_CONNECTOR_DVID: | 1448 | case DRM_MODE_CONNECTOR_DVID: |
| @@ -1435,6 +1460,11 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1435 | 1); | 1460 | 1); |
| 1436 | } | 1461 | } |
| 1437 | subpixel_order = SubPixelHorizontalRGB; | 1462 | subpixel_order = SubPixelHorizontalRGB; |
| 1463 | connector->interlace_allowed = true; | ||
| 1464 | if (connector_type == DRM_MODE_CONNECTOR_DVII) | ||
| 1465 | connector->doublescan_allowed = true; | ||
| 1466 | else | ||
| 1467 | connector->doublescan_allowed = false; | ||
| 1438 | break; | 1468 | break; |
| 1439 | case DRM_MODE_CONNECTOR_SVIDEO: | 1469 | case DRM_MODE_CONNECTOR_SVIDEO: |
| 1440 | case DRM_MODE_CONNECTOR_Composite: | 1470 | case DRM_MODE_CONNECTOR_Composite: |
| @@ -1457,6 +1487,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1457 | radeon_combios_get_tv_info(rdev)); | 1487 | radeon_combios_get_tv_info(rdev)); |
| 1458 | /* no HPD on analog connectors */ | 1488 | /* no HPD on analog connectors */ |
| 1459 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; | 1489 | radeon_connector->hpd.hpd = RADEON_HPD_NONE; |
| 1490 | connector->interlace_allowed = false; | ||
| 1491 | connector->doublescan_allowed = false; | ||
| 1460 | break; | 1492 | break; |
| 1461 | case DRM_MODE_CONNECTOR_LVDS: | 1493 | case DRM_MODE_CONNECTOR_LVDS: |
| 1462 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); | 1494 | drm_connector_init(dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); |
| @@ -1470,6 +1502,8 @@ radeon_add_legacy_connector(struct drm_device *dev, | |||
| 1470 | dev->mode_config.scaling_mode_property, | 1502 | dev->mode_config.scaling_mode_property, |
| 1471 | DRM_MODE_SCALE_FULLSCREEN); | 1503 | DRM_MODE_SCALE_FULLSCREEN); |
| 1472 | subpixel_order = SubPixelHorizontalRGB; | 1504 | subpixel_order = SubPixelHorizontalRGB; |
| 1505 | connector->interlace_allowed = false; | ||
| 1506 | connector->doublescan_allowed = false; | ||
| 1473 | break; | 1507 | break; |
| 1474 | } | 1508 | } |
| 1475 | 1509 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index d8ac1849180d..e12e79326cb1 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -286,7 +286,7 @@ void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64 | |||
| 286 | mc->mc_vram_size = mc->aper_size; | 286 | mc->mc_vram_size = mc->aper_size; |
| 287 | } | 287 | } |
| 288 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; | 288 | mc->vram_end = mc->vram_start + mc->mc_vram_size - 1; |
| 289 | dev_info(rdev->dev, "VRAM: %lluM 0x%08llX - 0x%08llX (%lluM used)\n", | 289 | dev_info(rdev->dev, "VRAM: %lluM 0x%016llX - 0x%016llX (%lluM used)\n", |
| 290 | mc->mc_vram_size >> 20, mc->vram_start, | 290 | mc->mc_vram_size >> 20, mc->vram_start, |
| 291 | mc->vram_end, mc->real_vram_size >> 20); | 291 | mc->vram_end, mc->real_vram_size >> 20); |
| 292 | } | 292 | } |
| @@ -323,7 +323,7 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc) | |||
| 323 | mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align; | 323 | mc->gtt_start = (mc->vram_end + 1 + mc->gtt_base_align) & ~mc->gtt_base_align; |
| 324 | } | 324 | } |
| 325 | mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; | 325 | mc->gtt_end = mc->gtt_start + mc->gtt_size - 1; |
| 326 | dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n", | 326 | dev_info(rdev->dev, "GTT: %lluM 0x%016llX - 0x%016llX\n", |
| 327 | mc->gtt_size >> 20, mc->gtt_start, mc->gtt_end); | 327 | mc->gtt_size >> 20, mc->gtt_start, mc->gtt_end); |
| 328 | } | 328 | } |
| 329 | 329 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 1d067743fee0..a598d0049aa5 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c | |||
| @@ -69,7 +69,7 @@ void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain) | |||
| 69 | u32 c = 0; | 69 | u32 c = 0; |
| 70 | 70 | ||
| 71 | rbo->placement.fpfn = 0; | 71 | rbo->placement.fpfn = 0; |
| 72 | rbo->placement.lpfn = rbo->rdev->mc.active_vram_size >> PAGE_SHIFT; | 72 | rbo->placement.lpfn = 0; |
| 73 | rbo->placement.placement = rbo->placements; | 73 | rbo->placement.placement = rbo->placements; |
| 74 | rbo->placement.busy_placement = rbo->placements; | 74 | rbo->placement.busy_placement = rbo->placements; |
| 75 | if (domain & RADEON_GEM_DOMAIN_VRAM) | 75 | if (domain & RADEON_GEM_DOMAIN_VRAM) |
| @@ -91,7 +91,8 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, | |||
| 91 | { | 91 | { |
| 92 | struct radeon_bo *bo; | 92 | struct radeon_bo *bo; |
| 93 | enum ttm_bo_type type; | 93 | enum ttm_bo_type type; |
| 94 | int page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT; | 94 | unsigned long page_align = roundup(byte_align, PAGE_SIZE) >> PAGE_SHIFT; |
| 95 | unsigned long max_size = 0; | ||
| 95 | int r; | 96 | int r; |
| 96 | 97 | ||
| 97 | if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { | 98 | if (unlikely(rdev->mman.bdev.dev_mapping == NULL)) { |
| @@ -104,6 +105,14 @@ int radeon_bo_create(struct radeon_device *rdev, struct drm_gem_object *gobj, | |||
| 104 | } | 105 | } |
| 105 | *bo_ptr = NULL; | 106 | *bo_ptr = NULL; |
| 106 | 107 | ||
| 108 | /* maximun bo size is the minimun btw visible vram and gtt size */ | ||
| 109 | max_size = min(rdev->mc.visible_vram_size, rdev->mc.gtt_size); | ||
| 110 | if ((page_align << PAGE_SHIFT) >= max_size) { | ||
| 111 | printk(KERN_WARNING "%s:%d alloc size %ldM bigger than %ldMb limit\n", | ||
| 112 | __func__, __LINE__, page_align >> (20 - PAGE_SHIFT), max_size >> 20); | ||
| 113 | return -ENOMEM; | ||
| 114 | } | ||
| 115 | |||
| 107 | retry: | 116 | retry: |
| 108 | bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); | 117 | bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); |
| 109 | if (bo == NULL) | 118 | if (bo == NULL) |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 515345b11ac9..88cb04e7962b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
| @@ -1386,6 +1386,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
| 1386 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) }, | 1386 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb651) }, |
| 1387 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, | 1387 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, |
| 1388 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, | 1388 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, |
| 1389 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) }, | ||
| 1389 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, | 1390 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, |
| 1390 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) }, | 1391 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) }, |
| 1391 | { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) }, | 1392 | { HID_USB_DEVICE(USB_VENDOR_ID_TWINHAN, USB_DEVICE_ID_TWINHAN_IR_REMOTE) }, |
diff --git a/drivers/hid/hid-egalax.c b/drivers/hid/hid-egalax.c index 54b017ad258d..5a1b52e0eb85 100644 --- a/drivers/hid/hid-egalax.c +++ b/drivers/hid/hid-egalax.c | |||
| @@ -221,7 +221,7 @@ static int egalax_probe(struct hid_device *hdev, const struct hid_device_id *id) | |||
| 221 | struct egalax_data *td; | 221 | struct egalax_data *td; |
| 222 | struct hid_report *report; | 222 | struct hid_report *report; |
| 223 | 223 | ||
| 224 | td = kmalloc(sizeof(struct egalax_data), GFP_KERNEL); | 224 | td = kzalloc(sizeof(struct egalax_data), GFP_KERNEL); |
| 225 | if (!td) { | 225 | if (!td) { |
| 226 | dev_err(&hdev->dev, "cannot allocate eGalax data\n"); | 226 | dev_err(&hdev->dev, "cannot allocate eGalax data\n"); |
| 227 | return -ENOMEM; | 227 | return -ENOMEM; |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index bb0b3659437b..d8d372bae3cc 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
| @@ -174,7 +174,7 @@ static int hidinput_setkeycode(struct input_dev *dev, | |||
| 174 | 174 | ||
| 175 | clear_bit(*old_keycode, dev->keybit); | 175 | clear_bit(*old_keycode, dev->keybit); |
| 176 | set_bit(usage->code, dev->keybit); | 176 | set_bit(usage->code, dev->keybit); |
| 177 | dbg_hid(KERN_DEBUG "Assigned keycode %d to HID usage code %x\n", | 177 | dbg_hid("Assigned keycode %d to HID usage code %x\n", |
| 178 | usage->code, usage->hid); | 178 | usage->code, usage->hid); |
| 179 | 179 | ||
| 180 | /* | 180 | /* |
| @@ -203,8 +203,8 @@ static int hidinput_setkeycode(struct input_dev *dev, | |||
| 203 | * | 203 | * |
| 204 | * as seen in the HID specification v1.11 6.2.2.7 Global Items. | 204 | * as seen in the HID specification v1.11 6.2.2.7 Global Items. |
| 205 | * | 205 | * |
| 206 | * Only exponent 1 length units are processed. Centimeters are converted to | 206 | * Only exponent 1 length units are processed. Centimeters and inches are |
| 207 | * inches. Degrees are converted to radians. | 207 | * converted to millimeters. Degrees are converted to radians. |
| 208 | */ | 208 | */ |
| 209 | static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) | 209 | static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) |
| 210 | { | 210 | { |
| @@ -225,13 +225,16 @@ static __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) | |||
| 225 | */ | 225 | */ |
| 226 | if (code == ABS_X || code == ABS_Y || code == ABS_Z) { | 226 | if (code == ABS_X || code == ABS_Y || code == ABS_Z) { |
| 227 | if (field->unit == 0x11) { /* If centimeters */ | 227 | if (field->unit == 0x11) { /* If centimeters */ |
| 228 | /* Convert to inches */ | 228 | /* Convert to millimeters */ |
| 229 | prev = logical_extents; | 229 | unit_exponent += 1; |
| 230 | logical_extents *= 254; | 230 | } else if (field->unit == 0x13) { /* If inches */ |
| 231 | if (logical_extents < prev) | 231 | /* Convert to millimeters */ |
| 232 | prev = physical_extents; | ||
| 233 | physical_extents *= 254; | ||
| 234 | if (physical_extents < prev) | ||
| 232 | return 0; | 235 | return 0; |
| 233 | unit_exponent += 2; | 236 | unit_exponent -= 1; |
| 234 | } else if (field->unit != 0x13) { /* If not inches */ | 237 | } else { |
| 235 | return 0; | 238 | return 0; |
| 236 | } | 239 | } |
| 237 | } else if (code == ABS_RX || code == ABS_RY || code == ABS_RZ) { | 240 | } else if (code == ABS_RX || code == ABS_RY || code == ABS_RZ) { |
diff --git a/drivers/hid/hid-tmff.c b/drivers/hid/hid-tmff.c index 15434c814793..25be4e1461bd 100644 --- a/drivers/hid/hid-tmff.c +++ b/drivers/hid/hid-tmff.c | |||
| @@ -256,6 +256,8 @@ static const struct hid_device_id tm_devices[] = { | |||
| 256 | .driver_data = (unsigned long)ff_joystick }, | 256 | .driver_data = (unsigned long)ff_joystick }, |
| 257 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */ | 257 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654), /* FGT Force Feedback Wheel */ |
| 258 | .driver_data = (unsigned long)ff_joystick }, | 258 | .driver_data = (unsigned long)ff_joystick }, |
| 259 | { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a), /* F430 Force Feedback Wheel */ | ||
| 260 | .driver_data = (unsigned long)ff_joystick }, | ||
| 259 | { } | 261 | { } |
| 260 | }; | 262 | }; |
| 261 | MODULE_DEVICE_TABLE(hid, tm_devices); | 263 | MODULE_DEVICE_TABLE(hid, tm_devices); |
diff --git a/drivers/hwmon/adm1026.c b/drivers/hwmon/adm1026.c index 4bf969c0a32b..be0fdd58aa29 100644 --- a/drivers/hwmon/adm1026.c +++ b/drivers/hwmon/adm1026.c | |||
| @@ -916,27 +916,27 @@ static ssize_t set_fan_div(struct device *dev, struct device_attribute *attr, | |||
| 916 | int nr = sensor_attr->index; | 916 | int nr = sensor_attr->index; |
| 917 | struct i2c_client *client = to_i2c_client(dev); | 917 | struct i2c_client *client = to_i2c_client(dev); |
| 918 | struct adm1026_data *data = i2c_get_clientdata(client); | 918 | struct adm1026_data *data = i2c_get_clientdata(client); |
| 919 | int val, orig_div, new_div, shift; | 919 | int val, orig_div, new_div; |
| 920 | 920 | ||
| 921 | val = simple_strtol(buf, NULL, 10); | 921 | val = simple_strtol(buf, NULL, 10); |
| 922 | new_div = DIV_TO_REG(val); | 922 | new_div = DIV_TO_REG(val); |
| 923 | if (new_div == 0) { | 923 | |
| 924 | return -EINVAL; | ||
| 925 | } | ||
| 926 | mutex_lock(&data->update_lock); | 924 | mutex_lock(&data->update_lock); |
| 927 | orig_div = data->fan_div[nr]; | 925 | orig_div = data->fan_div[nr]; |
| 928 | data->fan_div[nr] = DIV_FROM_REG(new_div); | 926 | data->fan_div[nr] = DIV_FROM_REG(new_div); |
| 929 | 927 | ||
| 930 | if (nr < 4) { /* 0 <= nr < 4 */ | 928 | if (nr < 4) { /* 0 <= nr < 4 */ |
| 931 | shift = 2 * nr; | ||
| 932 | adm1026_write_value(client, ADM1026_REG_FAN_DIV_0_3, | 929 | adm1026_write_value(client, ADM1026_REG_FAN_DIV_0_3, |
| 933 | ((DIV_TO_REG(orig_div) & (~(0x03 << shift))) | | 930 | (DIV_TO_REG(data->fan_div[0]) << 0) | |
| 934 | (new_div << shift))); | 931 | (DIV_TO_REG(data->fan_div[1]) << 2) | |
| 932 | (DIV_TO_REG(data->fan_div[2]) << 4) | | ||
| 933 | (DIV_TO_REG(data->fan_div[3]) << 6)); | ||
| 935 | } else { /* 3 < nr < 8 */ | 934 | } else { /* 3 < nr < 8 */ |
| 936 | shift = 2 * (nr - 4); | ||
| 937 | adm1026_write_value(client, ADM1026_REG_FAN_DIV_4_7, | 935 | adm1026_write_value(client, ADM1026_REG_FAN_DIV_4_7, |
| 938 | ((DIV_TO_REG(orig_div) & (~(0x03 << (2 * shift)))) | | 936 | (DIV_TO_REG(data->fan_div[4]) << 0) | |
| 939 | (new_div << shift))); | 937 | (DIV_TO_REG(data->fan_div[5]) << 2) | |
| 938 | (DIV_TO_REG(data->fan_div[6]) << 4) | | ||
| 939 | (DIV_TO_REG(data->fan_div[7]) << 6)); | ||
| 940 | } | 940 | } |
| 941 | 941 | ||
| 942 | if (data->fan_div[nr] != orig_div) { | 942 | if (data->fan_div[nr] != orig_div) { |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 14a5d981be7d..a428a9264195 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
| @@ -187,6 +187,7 @@ static const u8 IT87_REG_FANX_MIN[] = { 0x1b, 0x1c, 0x1d, 0x85, 0x87 }; | |||
| 187 | #define IT87_REG_FAN_MAIN_CTRL 0x13 | 187 | #define IT87_REG_FAN_MAIN_CTRL 0x13 |
| 188 | #define IT87_REG_FAN_CTL 0x14 | 188 | #define IT87_REG_FAN_CTL 0x14 |
| 189 | #define IT87_REG_PWM(nr) (0x15 + (nr)) | 189 | #define IT87_REG_PWM(nr) (0x15 + (nr)) |
| 190 | #define IT87_REG_PWM_DUTY(nr) (0x63 + (nr) * 8) | ||
| 190 | 191 | ||
| 191 | #define IT87_REG_VIN(nr) (0x20 + (nr)) | 192 | #define IT87_REG_VIN(nr) (0x20 + (nr)) |
| 192 | #define IT87_REG_TEMP(nr) (0x29 + (nr)) | 193 | #define IT87_REG_TEMP(nr) (0x29 + (nr)) |
| @@ -251,12 +252,16 @@ struct it87_data { | |||
| 251 | u8 fan_main_ctrl; /* Register value */ | 252 | u8 fan_main_ctrl; /* Register value */ |
| 252 | u8 fan_ctl; /* Register value */ | 253 | u8 fan_ctl; /* Register value */ |
| 253 | 254 | ||
| 254 | /* The following 3 arrays correspond to the same registers. The | 255 | /* The following 3 arrays correspond to the same registers up to |
| 255 | * meaning of bits 6-0 depends on the value of bit 7, and we want | 256 | * the IT8720F. The meaning of bits 6-0 depends on the value of bit |
| 256 | * to preserve settings on mode changes, so we have to track all | 257 | * 7, and we want to preserve settings on mode changes, so we have |
| 257 | * values separately. */ | 258 | * to track all values separately. |
| 259 | * Starting with the IT8721F, the manual PWM duty cycles are stored | ||
| 260 | * in separate registers (8-bit values), so the separate tracking | ||
| 261 | * is no longer needed, but it is still done to keep the driver | ||
| 262 | * simple. */ | ||
| 258 | u8 pwm_ctrl[3]; /* Register value */ | 263 | u8 pwm_ctrl[3]; /* Register value */ |
| 259 | u8 pwm_duty[3]; /* Manual PWM value set by user (bit 6-0) */ | 264 | u8 pwm_duty[3]; /* Manual PWM value set by user */ |
| 260 | u8 pwm_temp_map[3]; /* PWM to temp. chan. mapping (bits 1-0) */ | 265 | u8 pwm_temp_map[3]; /* PWM to temp. chan. mapping (bits 1-0) */ |
| 261 | 266 | ||
| 262 | /* Automatic fan speed control registers */ | 267 | /* Automatic fan speed control registers */ |
| @@ -832,7 +837,9 @@ static ssize_t set_pwm_enable(struct device *dev, | |||
| 832 | data->fan_main_ctrl); | 837 | data->fan_main_ctrl); |
| 833 | } else { | 838 | } else { |
| 834 | if (val == 1) /* Manual mode */ | 839 | if (val == 1) /* Manual mode */ |
| 835 | data->pwm_ctrl[nr] = data->pwm_duty[nr]; | 840 | data->pwm_ctrl[nr] = data->type == it8721 ? |
| 841 | data->pwm_temp_map[nr] : | ||
| 842 | data->pwm_duty[nr]; | ||
| 836 | else /* Automatic mode */ | 843 | else /* Automatic mode */ |
| 837 | data->pwm_ctrl[nr] = 0x80 | data->pwm_temp_map[nr]; | 844 | data->pwm_ctrl[nr] = 0x80 | data->pwm_temp_map[nr]; |
| 838 | it87_write_value(data, IT87_REG_PWM(nr), data->pwm_ctrl[nr]); | 845 | it87_write_value(data, IT87_REG_PWM(nr), data->pwm_ctrl[nr]); |
| @@ -858,12 +865,25 @@ static ssize_t set_pwm(struct device *dev, struct device_attribute *attr, | |||
| 858 | return -EINVAL; | 865 | return -EINVAL; |
| 859 | 866 | ||
| 860 | mutex_lock(&data->update_lock); | 867 | mutex_lock(&data->update_lock); |
| 861 | data->pwm_duty[nr] = pwm_to_reg(data, val); | 868 | if (data->type == it8721) { |
| 862 | /* If we are in manual mode, write the duty cycle immediately; | 869 | /* If we are in automatic mode, the PWM duty cycle register |
| 863 | * otherwise, just store it for later use. */ | 870 | * is read-only so we can't write the value */ |
| 864 | if (!(data->pwm_ctrl[nr] & 0x80)) { | 871 | if (data->pwm_ctrl[nr] & 0x80) { |
| 865 | data->pwm_ctrl[nr] = data->pwm_duty[nr]; | 872 | mutex_unlock(&data->update_lock); |
| 866 | it87_write_value(data, IT87_REG_PWM(nr), data->pwm_ctrl[nr]); | 873 | return -EBUSY; |
| 874 | } | ||
| 875 | data->pwm_duty[nr] = pwm_to_reg(data, val); | ||
| 876 | it87_write_value(data, IT87_REG_PWM_DUTY(nr), | ||
| 877 | data->pwm_duty[nr]); | ||
| 878 | } else { | ||
| 879 | data->pwm_duty[nr] = pwm_to_reg(data, val); | ||
| 880 | /* If we are in manual mode, write the duty cycle immediately; | ||
| 881 | * otherwise, just store it for later use. */ | ||
| 882 | if (!(data->pwm_ctrl[nr] & 0x80)) { | ||
| 883 | data->pwm_ctrl[nr] = data->pwm_duty[nr]; | ||
| 884 | it87_write_value(data, IT87_REG_PWM(nr), | ||
| 885 | data->pwm_ctrl[nr]); | ||
| 886 | } | ||
| 867 | } | 887 | } |
| 868 | mutex_unlock(&data->update_lock); | 888 | mutex_unlock(&data->update_lock); |
| 869 | return count; | 889 | return count; |
| @@ -1958,7 +1978,10 @@ static void __devinit it87_init_device(struct platform_device *pdev) | |||
| 1958 | * channels to use when later setting to automatic mode later. | 1978 | * channels to use when later setting to automatic mode later. |
| 1959 | * Use a 1:1 mapping by default (we are clueless.) | 1979 | * Use a 1:1 mapping by default (we are clueless.) |
| 1960 | * In both cases, the value can (and should) be changed by the user | 1980 | * In both cases, the value can (and should) be changed by the user |
| 1961 | * prior to switching to a different mode. */ | 1981 | * prior to switching to a different mode. |
| 1982 | * Note that this is no longer needed for the IT8721F and later, as | ||
| 1983 | * these have separate registers for the temperature mapping and the | ||
| 1984 | * manual duty cycle. */ | ||
| 1962 | for (i = 0; i < 3; i++) { | 1985 | for (i = 0; i < 3; i++) { |
| 1963 | data->pwm_temp_map[i] = i; | 1986 | data->pwm_temp_map[i] = i; |
| 1964 | data->pwm_duty[i] = 0x7f; /* Full speed */ | 1987 | data->pwm_duty[i] = 0x7f; /* Full speed */ |
| @@ -2034,10 +2057,16 @@ static void __devinit it87_init_device(struct platform_device *pdev) | |||
| 2034 | static void it87_update_pwm_ctrl(struct it87_data *data, int nr) | 2057 | static void it87_update_pwm_ctrl(struct it87_data *data, int nr) |
| 2035 | { | 2058 | { |
| 2036 | data->pwm_ctrl[nr] = it87_read_value(data, IT87_REG_PWM(nr)); | 2059 | data->pwm_ctrl[nr] = it87_read_value(data, IT87_REG_PWM(nr)); |
| 2037 | if (data->pwm_ctrl[nr] & 0x80) /* Automatic mode */ | 2060 | if (data->type == it8721) { |
| 2038 | data->pwm_temp_map[nr] = data->pwm_ctrl[nr] & 0x03; | 2061 | data->pwm_temp_map[nr] = data->pwm_ctrl[nr] & 0x03; |
| 2039 | else /* Manual mode */ | 2062 | data->pwm_duty[nr] = it87_read_value(data, |
| 2040 | data->pwm_duty[nr] = data->pwm_ctrl[nr] & 0x7f; | 2063 | IT87_REG_PWM_DUTY(nr)); |
| 2064 | } else { | ||
| 2065 | if (data->pwm_ctrl[nr] & 0x80) /* Automatic mode */ | ||
| 2066 | data->pwm_temp_map[nr] = data->pwm_ctrl[nr] & 0x03; | ||
| 2067 | else /* Manual mode */ | ||
| 2068 | data->pwm_duty[nr] = data->pwm_ctrl[nr] & 0x7f; | ||
| 2069 | } | ||
| 2041 | 2070 | ||
| 2042 | if (has_old_autopwm(data)) { | 2071 | if (has_old_autopwm(data)) { |
| 2043 | int i; | 2072 | int i; |
diff --git a/drivers/hwmon/ltc4215.c b/drivers/hwmon/ltc4215.c index 00d975eb5b83..c7e6d8e81656 100644 --- a/drivers/hwmon/ltc4215.c +++ b/drivers/hwmon/ltc4215.c | |||
| @@ -205,7 +205,6 @@ LTC4215_ALARM(curr1_max_alarm, (1 << 2), LTC4215_STATUS); | |||
| 205 | 205 | ||
| 206 | /* Power (virtual) */ | 206 | /* Power (virtual) */ |
| 207 | LTC4215_POWER(power1_input); | 207 | LTC4215_POWER(power1_input); |
| 208 | LTC4215_ALARM(power1_alarm, (1 << 3), LTC4215_STATUS); | ||
| 209 | 208 | ||
| 210 | /* Input Voltage */ | 209 | /* Input Voltage */ |
| 211 | LTC4215_VOLTAGE(in1_input, LTC4215_ADIN); | 210 | LTC4215_VOLTAGE(in1_input, LTC4215_ADIN); |
| @@ -214,6 +213,7 @@ LTC4215_ALARM(in1_min_alarm, (1 << 1), LTC4215_STATUS); | |||
| 214 | 213 | ||
| 215 | /* Output Voltage */ | 214 | /* Output Voltage */ |
| 216 | LTC4215_VOLTAGE(in2_input, LTC4215_SOURCE); | 215 | LTC4215_VOLTAGE(in2_input, LTC4215_SOURCE); |
| 216 | LTC4215_ALARM(in2_min_alarm, (1 << 3), LTC4215_STATUS); | ||
| 217 | 217 | ||
| 218 | /* Finally, construct an array of pointers to members of the above objects, | 218 | /* Finally, construct an array of pointers to members of the above objects, |
| 219 | * as required for sysfs_create_group() | 219 | * as required for sysfs_create_group() |
| @@ -223,13 +223,13 @@ static struct attribute *ltc4215_attributes[] = { | |||
| 223 | &sensor_dev_attr_curr1_max_alarm.dev_attr.attr, | 223 | &sensor_dev_attr_curr1_max_alarm.dev_attr.attr, |
| 224 | 224 | ||
| 225 | &sensor_dev_attr_power1_input.dev_attr.attr, | 225 | &sensor_dev_attr_power1_input.dev_attr.attr, |
| 226 | &sensor_dev_attr_power1_alarm.dev_attr.attr, | ||
| 227 | 226 | ||
| 228 | &sensor_dev_attr_in1_input.dev_attr.attr, | 227 | &sensor_dev_attr_in1_input.dev_attr.attr, |
| 229 | &sensor_dev_attr_in1_max_alarm.dev_attr.attr, | 228 | &sensor_dev_attr_in1_max_alarm.dev_attr.attr, |
| 230 | &sensor_dev_attr_in1_min_alarm.dev_attr.attr, | 229 | &sensor_dev_attr_in1_min_alarm.dev_attr.attr, |
| 231 | 230 | ||
| 232 | &sensor_dev_attr_in2_input.dev_attr.attr, | 231 | &sensor_dev_attr_in2_input.dev_attr.attr, |
| 232 | &sensor_dev_attr_in2_min_alarm.dev_attr.attr, | ||
| 233 | 233 | ||
| 234 | NULL, | 234 | NULL, |
| 235 | }; | 235 | }; |
diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig index b923074b2cbe..30f06e956bfb 100644 --- a/drivers/i2c/Kconfig +++ b/drivers/i2c/Kconfig | |||
| @@ -75,8 +75,7 @@ config I2C_HELPER_AUTO | |||
| 75 | In doubt, say Y. | 75 | In doubt, say Y. |
| 76 | 76 | ||
| 77 | config I2C_SMBUS | 77 | config I2C_SMBUS |
| 78 | tristate | 78 | tristate "SMBus-specific protocols" if !I2C_HELPER_AUTO |
| 79 | prompt "SMBus-specific protocols" if !I2C_HELPER_AUTO | ||
| 80 | help | 79 | help |
| 81 | Say Y here if you want support for SMBus extensions to the I2C | 80 | Say Y here if you want support for SMBus extensions to the I2C |
| 82 | specification. At the moment, the only supported extension is | 81 | specification. At the moment, the only supported extension is |
diff --git a/drivers/i2c/algos/Kconfig b/drivers/i2c/algos/Kconfig index 3998dd620a03..f1cfe7e5508b 100644 --- a/drivers/i2c/algos/Kconfig +++ b/drivers/i2c/algos/Kconfig | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | # | 3 | # |
| 4 | 4 | ||
| 5 | menu "I2C Algorithms" | 5 | menu "I2C Algorithms" |
| 6 | depends on !I2C_HELPER_AUTO | 6 | visible if !I2C_HELPER_AUTO |
| 7 | 7 | ||
| 8 | config I2C_ALGOBIT | 8 | config I2C_ALGOBIT |
| 9 | tristate "I2C bit-banging interfaces" | 9 | tristate "I2C bit-banging interfaces" |
| @@ -15,15 +15,3 @@ config I2C_ALGOPCA | |||
| 15 | tristate "I2C PCA 9564 interfaces" | 15 | tristate "I2C PCA 9564 interfaces" |
| 16 | 16 | ||
| 17 | endmenu | 17 | endmenu |
| 18 | |||
| 19 | # In automatic configuration mode, we still have to define the | ||
| 20 | # symbols to avoid unmet dependencies. | ||
| 21 | |||
| 22 | if I2C_HELPER_AUTO | ||
| 23 | config I2C_ALGOBIT | ||
| 24 | tristate | ||
| 25 | config I2C_ALGOPCF | ||
| 26 | tristate | ||
| 27 | config I2C_ALGOPCA | ||
| 28 | tristate | ||
| 29 | endif | ||
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c index 41665d2f9f93..c131d58bcb50 100644 --- a/drivers/idle/intel_idle.c +++ b/drivers/idle/intel_idle.c | |||
| @@ -273,8 +273,6 @@ static int intel_idle_probe(void) | |||
| 273 | 273 | ||
| 274 | pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates); | 274 | pr_debug(PREFIX "MWAIT substates: 0x%x\n", mwait_substates); |
| 275 | 275 | ||
| 276 | if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */ | ||
| 277 | lapic_timer_reliable_states = 0xFFFFFFFF; | ||
| 278 | 276 | ||
| 279 | if (boot_cpu_data.x86 != 6) /* family 6 */ | 277 | if (boot_cpu_data.x86 != 6) /* family 6 */ |
| 280 | return -ENODEV; | 278 | return -ENODEV; |
| @@ -286,8 +284,6 @@ static int intel_idle_probe(void) | |||
| 286 | case 0x1F: /* Core i7 and i5 Processor - Nehalem */ | 284 | case 0x1F: /* Core i7 and i5 Processor - Nehalem */ |
| 287 | case 0x2E: /* Nehalem-EX Xeon */ | 285 | case 0x2E: /* Nehalem-EX Xeon */ |
| 288 | case 0x2F: /* Westmere-EX Xeon */ | 286 | case 0x2F: /* Westmere-EX Xeon */ |
| 289 | lapic_timer_reliable_states = (1 << 1); /* C1 */ | ||
| 290 | |||
| 291 | case 0x25: /* Westmere */ | 287 | case 0x25: /* Westmere */ |
| 292 | case 0x2C: /* Westmere */ | 288 | case 0x2C: /* Westmere */ |
| 293 | cpuidle_state_table = nehalem_cstates; | 289 | cpuidle_state_table = nehalem_cstates; |
| @@ -295,7 +291,6 @@ static int intel_idle_probe(void) | |||
| 295 | 291 | ||
| 296 | case 0x1C: /* 28 - Atom Processor */ | 292 | case 0x1C: /* 28 - Atom Processor */ |
| 297 | case 0x26: /* 38 - Lincroft Atom Processor */ | 293 | case 0x26: /* 38 - Lincroft Atom Processor */ |
| 298 | lapic_timer_reliable_states = (1 << 1); /* C1 */ | ||
| 299 | cpuidle_state_table = atom_cstates; | 294 | cpuidle_state_table = atom_cstates; |
| 300 | break; | 295 | break; |
| 301 | 296 | ||
| @@ -303,10 +298,6 @@ static int intel_idle_probe(void) | |||
| 303 | case 0x2D: /* SNB Xeon */ | 298 | case 0x2D: /* SNB Xeon */ |
| 304 | cpuidle_state_table = snb_cstates; | 299 | cpuidle_state_table = snb_cstates; |
| 305 | break; | 300 | break; |
| 306 | #ifdef FUTURE_USE | ||
| 307 | case 0x17: /* 23 - Core 2 Duo */ | ||
| 308 | lapic_timer_reliable_states = (1 << 2) | (1 << 1); /* C2, C1 */ | ||
| 309 | #endif | ||
| 310 | 301 | ||
| 311 | default: | 302 | default: |
| 312 | pr_debug(PREFIX "does not run on family %d model %d\n", | 303 | pr_debug(PREFIX "does not run on family %d model %d\n", |
| @@ -314,6 +305,9 @@ static int intel_idle_probe(void) | |||
| 314 | return -ENODEV; | 305 | return -ENODEV; |
| 315 | } | 306 | } |
| 316 | 307 | ||
| 308 | if (boot_cpu_has(X86_FEATURE_ARAT)) /* Always Reliable APIC Timer */ | ||
| 309 | lapic_timer_reliable_states = 0xFFFFFFFF; | ||
| 310 | |||
| 317 | pr_debug(PREFIX "v" INTEL_IDLE_VERSION | 311 | pr_debug(PREFIX "v" INTEL_IDLE_VERSION |
| 318 | " model 0x%X\n", boot_cpu_data.x86_model); | 312 | " model 0x%X\n", boot_cpu_data.x86_model); |
| 319 | 313 | ||
diff --git a/drivers/infiniband/core/ud_header.c b/drivers/infiniband/core/ud_header.c index bb7e19280821..9b737ff133e2 100644 --- a/drivers/infiniband/core/ud_header.c +++ b/drivers/infiniband/core/ud_header.c | |||
| @@ -278,36 +278,6 @@ void ib_ud_header_init(int payload_bytes, | |||
| 278 | EXPORT_SYMBOL(ib_ud_header_init); | 278 | EXPORT_SYMBOL(ib_ud_header_init); |
| 279 | 279 | ||
| 280 | /** | 280 | /** |
| 281 | * ib_lrh_header_pack - Pack LRH header struct into wire format | ||
| 282 | * @lrh:unpacked LRH header struct | ||
| 283 | * @buf:Buffer to pack into | ||
| 284 | * | ||
| 285 | * ib_lrh_header_pack() packs the LRH header structure @lrh into | ||
| 286 | * wire format in the buffer @buf. | ||
| 287 | */ | ||
| 288 | int ib_lrh_header_pack(struct ib_unpacked_lrh *lrh, void *buf) | ||
| 289 | { | ||
| 290 | ib_pack(lrh_table, ARRAY_SIZE(lrh_table), lrh, buf); | ||
| 291 | return 0; | ||
| 292 | } | ||
| 293 | EXPORT_SYMBOL(ib_lrh_header_pack); | ||
| 294 | |||
| 295 | /** | ||
| 296 | * ib_lrh_header_unpack - Unpack LRH structure from wire format | ||
| 297 | * @lrh:unpacked LRH header struct | ||
| 298 | * @buf:Buffer to pack into | ||
| 299 | * | ||
| 300 | * ib_lrh_header_unpack() unpacks the LRH header structure from | ||
| 301 | * wire format (in buf) into @lrh. | ||
| 302 | */ | ||
| 303 | int ib_lrh_header_unpack(void *buf, struct ib_unpacked_lrh *lrh) | ||
| 304 | { | ||
| 305 | ib_unpack(lrh_table, ARRAY_SIZE(lrh_table), buf, lrh); | ||
| 306 | return 0; | ||
| 307 | } | ||
| 308 | EXPORT_SYMBOL(ib_lrh_header_unpack); | ||
| 309 | |||
| 310 | /** | ||
| 311 | * ib_ud_header_pack - Pack UD header struct into wire format | 281 | * ib_ud_header_pack - Pack UD header struct into wire format |
| 312 | * @header:UD header struct | 282 | * @header:UD header struct |
| 313 | * @buf:Buffer to pack into | 283 | * @buf:Buffer to pack into |
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index b342248aec05..c42699285f8e 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
| @@ -893,68 +893,81 @@ out: | |||
| 893 | return ret ? ret : in_len; | 893 | return ret ? ret : in_len; |
| 894 | } | 894 | } |
| 895 | 895 | ||
| 896 | static int copy_wc_to_user(void __user *dest, struct ib_wc *wc) | ||
| 897 | { | ||
| 898 | struct ib_uverbs_wc tmp; | ||
| 899 | |||
| 900 | tmp.wr_id = wc->wr_id; | ||
| 901 | tmp.status = wc->status; | ||
| 902 | tmp.opcode = wc->opcode; | ||
| 903 | tmp.vendor_err = wc->vendor_err; | ||
| 904 | tmp.byte_len = wc->byte_len; | ||
| 905 | tmp.ex.imm_data = (__u32 __force) wc->ex.imm_data; | ||
| 906 | tmp.qp_num = wc->qp->qp_num; | ||
| 907 | tmp.src_qp = wc->src_qp; | ||
| 908 | tmp.wc_flags = wc->wc_flags; | ||
| 909 | tmp.pkey_index = wc->pkey_index; | ||
| 910 | tmp.slid = wc->slid; | ||
| 911 | tmp.sl = wc->sl; | ||
| 912 | tmp.dlid_path_bits = wc->dlid_path_bits; | ||
| 913 | tmp.port_num = wc->port_num; | ||
| 914 | tmp.reserved = 0; | ||
| 915 | |||
| 916 | if (copy_to_user(dest, &tmp, sizeof tmp)) | ||
| 917 | return -EFAULT; | ||
| 918 | |||
| 919 | return 0; | ||
| 920 | } | ||
| 921 | |||
| 896 | ssize_t ib_uverbs_poll_cq(struct ib_uverbs_file *file, | 922 | ssize_t ib_uverbs_poll_cq(struct ib_uverbs_file *file, |
| 897 | const char __user *buf, int in_len, | 923 | const char __user *buf, int in_len, |
| 898 | int out_len) | 924 | int out_len) |
| 899 | { | 925 | { |
| 900 | struct ib_uverbs_poll_cq cmd; | 926 | struct ib_uverbs_poll_cq cmd; |
| 901 | struct ib_uverbs_poll_cq_resp *resp; | 927 | struct ib_uverbs_poll_cq_resp resp; |
| 928 | u8 __user *header_ptr; | ||
| 929 | u8 __user *data_ptr; | ||
| 902 | struct ib_cq *cq; | 930 | struct ib_cq *cq; |
| 903 | struct ib_wc *wc; | 931 | struct ib_wc wc; |
| 904 | int ret = 0; | 932 | int ret; |
| 905 | int i; | ||
| 906 | int rsize; | ||
| 907 | 933 | ||
| 908 | if (copy_from_user(&cmd, buf, sizeof cmd)) | 934 | if (copy_from_user(&cmd, buf, sizeof cmd)) |
| 909 | return -EFAULT; | 935 | return -EFAULT; |
| 910 | 936 | ||
| 911 | wc = kmalloc(cmd.ne * sizeof *wc, GFP_KERNEL); | ||
| 912 | if (!wc) | ||
| 913 | return -ENOMEM; | ||
| 914 | |||
| 915 | rsize = sizeof *resp + cmd.ne * sizeof(struct ib_uverbs_wc); | ||
| 916 | resp = kmalloc(rsize, GFP_KERNEL); | ||
| 917 | if (!resp) { | ||
| 918 | ret = -ENOMEM; | ||
| 919 | goto out_wc; | ||
| 920 | } | ||
| 921 | |||
| 922 | cq = idr_read_cq(cmd.cq_handle, file->ucontext, 0); | 937 | cq = idr_read_cq(cmd.cq_handle, file->ucontext, 0); |
| 923 | if (!cq) { | 938 | if (!cq) |
| 924 | ret = -EINVAL; | 939 | return -EINVAL; |
| 925 | goto out; | ||
| 926 | } | ||
| 927 | 940 | ||
| 928 | resp->count = ib_poll_cq(cq, cmd.ne, wc); | 941 | /* we copy a struct ib_uverbs_poll_cq_resp to user space */ |
| 942 | header_ptr = (void __user *)(unsigned long) cmd.response; | ||
| 943 | data_ptr = header_ptr + sizeof resp; | ||
| 929 | 944 | ||
| 930 | put_cq_read(cq); | 945 | memset(&resp, 0, sizeof resp); |
| 946 | while (resp.count < cmd.ne) { | ||
| 947 | ret = ib_poll_cq(cq, 1, &wc); | ||
| 948 | if (ret < 0) | ||
| 949 | goto out_put; | ||
| 950 | if (!ret) | ||
| 951 | break; | ||
| 952 | |||
| 953 | ret = copy_wc_to_user(data_ptr, &wc); | ||
| 954 | if (ret) | ||
| 955 | goto out_put; | ||
| 931 | 956 | ||
| 932 | for (i = 0; i < resp->count; i++) { | 957 | data_ptr += sizeof(struct ib_uverbs_wc); |
| 933 | resp->wc[i].wr_id = wc[i].wr_id; | 958 | ++resp.count; |
| 934 | resp->wc[i].status = wc[i].status; | ||
| 935 | resp->wc[i].opcode = wc[i].opcode; | ||
| 936 | resp->wc[i].vendor_err = wc[i].vendor_err; | ||
| 937 | resp->wc[i].byte_len = wc[i].byte_len; | ||
| 938 | resp->wc[i].ex.imm_data = (__u32 __force) wc[i].ex.imm_data; | ||
| 939 | resp->wc[i].qp_num = wc[i].qp->qp_num; | ||
| 940 | resp->wc[i].src_qp = wc[i].src_qp; | ||
| 941 | resp->wc[i].wc_flags = wc[i].wc_flags; | ||
| 942 | resp->wc[i].pkey_index = wc[i].pkey_index; | ||
| 943 | resp->wc[i].slid = wc[i].slid; | ||
| 944 | resp->wc[i].sl = wc[i].sl; | ||
| 945 | resp->wc[i].dlid_path_bits = wc[i].dlid_path_bits; | ||
| 946 | resp->wc[i].port_num = wc[i].port_num; | ||
| 947 | } | 959 | } |
| 948 | 960 | ||
| 949 | if (copy_to_user((void __user *) (unsigned long) cmd.response, resp, rsize)) | 961 | if (copy_to_user(header_ptr, &resp, sizeof resp)) { |
| 950 | ret = -EFAULT; | 962 | ret = -EFAULT; |
| 963 | goto out_put; | ||
| 964 | } | ||
| 951 | 965 | ||
| 952 | out: | 966 | ret = in_len; |
| 953 | kfree(resp); | ||
| 954 | 967 | ||
| 955 | out_wc: | 968 | out_put: |
| 956 | kfree(wc); | 969 | put_cq_read(cq); |
| 957 | return ret ? ret : in_len; | 970 | return ret; |
| 958 | } | 971 | } |
| 959 | 972 | ||
| 960 | ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file, | 973 | ssize_t ib_uverbs_req_notify_cq(struct ib_uverbs_file *file, |
diff --git a/drivers/infiniband/core/uverbs_marshall.c b/drivers/infiniband/core/uverbs_marshall.c index 5440da0e59b4..1b1146f87124 100644 --- a/drivers/infiniband/core/uverbs_marshall.c +++ b/drivers/infiniband/core/uverbs_marshall.c | |||
| @@ -40,18 +40,21 @@ void ib_copy_ah_attr_to_user(struct ib_uverbs_ah_attr *dst, | |||
| 40 | dst->grh.sgid_index = src->grh.sgid_index; | 40 | dst->grh.sgid_index = src->grh.sgid_index; |
| 41 | dst->grh.hop_limit = src->grh.hop_limit; | 41 | dst->grh.hop_limit = src->grh.hop_limit; |
| 42 | dst->grh.traffic_class = src->grh.traffic_class; | 42 | dst->grh.traffic_class = src->grh.traffic_class; |
| 43 | memset(&dst->grh.reserved, 0, sizeof(dst->grh.reserved)); | ||
| 43 | dst->dlid = src->dlid; | 44 | dst->dlid = src->dlid; |
| 44 | dst->sl = src->sl; | 45 | dst->sl = src->sl; |
| 45 | dst->src_path_bits = src->src_path_bits; | 46 | dst->src_path_bits = src->src_path_bits; |
| 46 | dst->static_rate = src->static_rate; | 47 | dst->static_rate = src->static_rate; |
| 47 | dst->is_global = src->ah_flags & IB_AH_GRH ? 1 : 0; | 48 | dst->is_global = src->ah_flags & IB_AH_GRH ? 1 : 0; |
| 48 | dst->port_num = src->port_num; | 49 | dst->port_num = src->port_num; |
| 50 | dst->reserved = 0; | ||
| 49 | } | 51 | } |
| 50 | EXPORT_SYMBOL(ib_copy_ah_attr_to_user); | 52 | EXPORT_SYMBOL(ib_copy_ah_attr_to_user); |
| 51 | 53 | ||
| 52 | void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, | 54 | void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, |
| 53 | struct ib_qp_attr *src) | 55 | struct ib_qp_attr *src) |
| 54 | { | 56 | { |
| 57 | dst->qp_state = src->qp_state; | ||
| 55 | dst->cur_qp_state = src->cur_qp_state; | 58 | dst->cur_qp_state = src->cur_qp_state; |
| 56 | dst->path_mtu = src->path_mtu; | 59 | dst->path_mtu = src->path_mtu; |
| 57 | dst->path_mig_state = src->path_mig_state; | 60 | dst->path_mig_state = src->path_mig_state; |
| @@ -83,6 +86,7 @@ void ib_copy_qp_attr_to_user(struct ib_uverbs_qp_attr *dst, | |||
| 83 | dst->rnr_retry = src->rnr_retry; | 86 | dst->rnr_retry = src->rnr_retry; |
| 84 | dst->alt_port_num = src->alt_port_num; | 87 | dst->alt_port_num = src->alt_port_num; |
| 85 | dst->alt_timeout = src->alt_timeout; | 88 | dst->alt_timeout = src->alt_timeout; |
| 89 | memset(dst->reserved, 0, sizeof(dst->reserved)); | ||
| 86 | } | 90 | } |
| 87 | EXPORT_SYMBOL(ib_copy_qp_attr_to_user); | 91 | EXPORT_SYMBOL(ib_copy_qp_attr_to_user); |
| 88 | 92 | ||
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index bf3e20cd0298..30e09caf0da9 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
| @@ -219,7 +219,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port, | |||
| 219 | struct net_device *ndev; | 219 | struct net_device *ndev; |
| 220 | enum ib_mtu tmp; | 220 | enum ib_mtu tmp; |
| 221 | 221 | ||
| 222 | props->active_width = IB_WIDTH_4X; | 222 | props->active_width = IB_WIDTH_1X; |
| 223 | props->active_speed = 4; | 223 | props->active_speed = 4; |
| 224 | props->port_cap_flags = IB_PORT_CM_SUP; | 224 | props->port_cap_flags = IB_PORT_CM_SUP; |
| 225 | props->gid_tbl_len = to_mdev(ibdev)->dev->caps.gid_table_len[port]; | 225 | props->gid_tbl_len = to_mdev(ibdev)->dev->caps.gid_table_len[port]; |
| @@ -242,7 +242,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port, | |||
| 242 | tmp = iboe_get_mtu(ndev->mtu); | 242 | tmp = iboe_get_mtu(ndev->mtu); |
| 243 | props->active_mtu = tmp ? min(props->max_mtu, tmp) : IB_MTU_256; | 243 | props->active_mtu = tmp ? min(props->max_mtu, tmp) : IB_MTU_256; |
| 244 | 244 | ||
| 245 | props->state = netif_running(ndev) && netif_oper_up(ndev) ? | 245 | props->state = (netif_running(ndev) && netif_carrier_ok(ndev)) ? |
| 246 | IB_PORT_ACTIVE : IB_PORT_DOWN; | 246 | IB_PORT_ACTIVE : IB_PORT_DOWN; |
| 247 | props->phys_state = state_to_phys_state(props->state); | 247 | props->phys_state = state_to_phys_state(props->state); |
| 248 | 248 | ||
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index 9a7794ac34c1..2001f20a4361 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
| @@ -1816,6 +1816,11 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 1816 | ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ? | 1816 | ctrl->fence_size = (wr->send_flags & IB_SEND_FENCE ? |
| 1817 | MLX4_WQE_CTRL_FENCE : 0) | size; | 1817 | MLX4_WQE_CTRL_FENCE : 0) | size; |
| 1818 | 1818 | ||
| 1819 | if (be16_to_cpu(vlan) < 0x1000) { | ||
| 1820 | ctrl->ins_vlan = 1 << 6; | ||
| 1821 | ctrl->vlan_tag = vlan; | ||
| 1822 | } | ||
| 1823 | |||
| 1819 | /* | 1824 | /* |
| 1820 | * Make sure descriptor is fully written before | 1825 | * Make sure descriptor is fully written before |
| 1821 | * setting ownership bit (because HW can start | 1826 | * setting ownership bit (because HW can start |
| @@ -1831,11 +1836,6 @@ int mlx4_ib_post_send(struct ib_qp *ibqp, struct ib_send_wr *wr, | |||
| 1831 | ctrl->owner_opcode = mlx4_ib_opcode[wr->opcode] | | 1836 | ctrl->owner_opcode = mlx4_ib_opcode[wr->opcode] | |
| 1832 | (ind & qp->sq.wqe_cnt ? cpu_to_be32(1 << 31) : 0) | blh; | 1837 | (ind & qp->sq.wqe_cnt ? cpu_to_be32(1 << 31) : 0) | blh; |
| 1833 | 1838 | ||
| 1834 | if (be16_to_cpu(vlan) < 0x1000) { | ||
| 1835 | ctrl->ins_vlan = 1 << 6; | ||
| 1836 | ctrl->vlan_tag = vlan; | ||
| 1837 | } | ||
| 1838 | |||
| 1839 | stamp = ind + qp->sq_spare_wqes; | 1839 | stamp = ind + qp->sq_spare_wqes; |
| 1840 | ind += DIV_ROUND_UP(size * 16, 1U << qp->sq.wqe_shift); | 1840 | ind += DIV_ROUND_UP(size * 16, 1U << qp->sq.wqe_shift); |
| 1841 | 1841 | ||
diff --git a/drivers/input/joystick/turbografx.c b/drivers/input/joystick/turbografx.c index d53b9e900234..27b6a3ce18ca 100644 --- a/drivers/input/joystick/turbografx.c +++ b/drivers/input/joystick/turbografx.c | |||
| @@ -245,6 +245,7 @@ static struct tgfx __init *tgfx_probe(int parport, int *n_buttons, int n_devs) | |||
| 245 | goto err_free_tgfx; | 245 | goto err_free_tgfx; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | parport_put_port(pp); | ||
| 248 | return tgfx; | 249 | return tgfx; |
| 249 | 250 | ||
| 250 | err_free_dev: | 251 | err_free_dev: |
diff --git a/drivers/input/keyboard/Kconfig b/drivers/input/keyboard/Kconfig index b8c51b9781db..3a87f3ba5f75 100644 --- a/drivers/input/keyboard/Kconfig +++ b/drivers/input/keyboard/Kconfig | |||
| @@ -179,6 +179,22 @@ config KEYBOARD_GPIO | |||
| 179 | To compile this driver as a module, choose M here: the | 179 | To compile this driver as a module, choose M here: the |
| 180 | module will be called gpio_keys. | 180 | module will be called gpio_keys. |
| 181 | 181 | ||
| 182 | config KEYBOARD_GPIO_POLLED | ||
| 183 | tristate "Polled GPIO buttons" | ||
| 184 | depends on GENERIC_GPIO | ||
| 185 | select INPUT_POLLDEV | ||
| 186 | help | ||
| 187 | This driver implements support for buttons connected | ||
| 188 | to GPIO pins that are not capable of generating interrupts. | ||
| 189 | |||
| 190 | Say Y here if your device has buttons connected | ||
| 191 | directly to such GPIO pins. Your board-specific | ||
| 192 | setup logic must also provide a platform device, | ||
| 193 | with configuration data saying which GPIOs are used. | ||
| 194 | |||
| 195 | To compile this driver as a module, choose M here: the | ||
| 196 | module will be called gpio_keys_polled. | ||
| 197 | |||
| 182 | config KEYBOARD_TCA6416 | 198 | config KEYBOARD_TCA6416 |
| 183 | tristate "TCA6416 Keypad Support" | 199 | tristate "TCA6416 Keypad Support" |
| 184 | depends on I2C | 200 | depends on I2C |
diff --git a/drivers/input/keyboard/Makefile b/drivers/input/keyboard/Makefile index a34452e8ebe2..622de73a445d 100644 --- a/drivers/input/keyboard/Makefile +++ b/drivers/input/keyboard/Makefile | |||
| @@ -14,6 +14,7 @@ obj-$(CONFIG_KEYBOARD_BFIN) += bf54x-keys.o | |||
| 14 | obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o | 14 | obj-$(CONFIG_KEYBOARD_DAVINCI) += davinci_keyscan.o |
| 15 | obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o | 15 | obj-$(CONFIG_KEYBOARD_EP93XX) += ep93xx_keypad.o |
| 16 | obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o | 16 | obj-$(CONFIG_KEYBOARD_GPIO) += gpio_keys.o |
| 17 | obj-$(CONFIG_KEYBOARD_GPIO_POLLED) += gpio_keys_polled.o | ||
| 17 | obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o | 18 | obj-$(CONFIG_KEYBOARD_TCA6416) += tca6416-keypad.o |
| 18 | obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o | 19 | obj-$(CONFIG_KEYBOARD_HIL) += hil_kbd.o |
| 19 | obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o | 20 | obj-$(CONFIG_KEYBOARD_HIL_OLD) += hilkbd.o |
diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyboard/gpio_keys_polled.c new file mode 100644 index 000000000000..4c17aff20657 --- /dev/null +++ b/drivers/input/keyboard/gpio_keys_polled.c | |||
| @@ -0,0 +1,261 @@ | |||
| 1 | /* | ||
| 2 | * Driver for buttons on GPIO lines not capable of generating interrupts | ||
| 3 | * | ||
| 4 | * Copyright (C) 2007-2010 Gabor Juhos <juhosg@openwrt.org> | ||
| 5 | * Copyright (C) 2010 Nuno Goncalves <nunojpg@gmail.com> | ||
| 6 | * | ||
| 7 | * This file was based on: /drivers/input/misc/cobalt_btns.c | ||
| 8 | * Copyright (C) 2007 Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> | ||
| 9 | * | ||
| 10 | * also was based on: /drivers/input/keyboard/gpio_keys.c | ||
| 11 | * Copyright 2005 Phil Blundell | ||
| 12 | * | ||
| 13 | * This program is free software; you can redistribute it and/or modify | ||
| 14 | * it under the terms of the GNU General Public License version 2 as | ||
| 15 | * published by the Free Software Foundation. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/module.h> | ||
| 20 | #include <linux/init.h> | ||
| 21 | #include <linux/slab.h> | ||
| 22 | #include <linux/input.h> | ||
| 23 | #include <linux/input-polldev.h> | ||
| 24 | #include <linux/ioport.h> | ||
| 25 | #include <linux/platform_device.h> | ||
| 26 | #include <linux/gpio.h> | ||
| 27 | #include <linux/gpio_keys.h> | ||
| 28 | |||
| 29 | #define DRV_NAME "gpio-keys-polled" | ||
| 30 | |||
| 31 | struct gpio_keys_button_data { | ||
| 32 | int last_state; | ||
| 33 | int count; | ||
| 34 | int threshold; | ||
| 35 | int can_sleep; | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct gpio_keys_polled_dev { | ||
| 39 | struct input_polled_dev *poll_dev; | ||
| 40 | struct device *dev; | ||
| 41 | struct gpio_keys_platform_data *pdata; | ||
| 42 | struct gpio_keys_button_data data[0]; | ||
| 43 | }; | ||
| 44 | |||
| 45 | static void gpio_keys_polled_check_state(struct input_dev *input, | ||
| 46 | struct gpio_keys_button *button, | ||
| 47 | struct gpio_keys_button_data *bdata) | ||
| 48 | { | ||
| 49 | int state; | ||
| 50 | |||
| 51 | if (bdata->can_sleep) | ||
| 52 | state = !!gpio_get_value_cansleep(button->gpio); | ||
| 53 | else | ||
| 54 | state = !!gpio_get_value(button->gpio); | ||
| 55 | |||
| 56 | if (state != bdata->last_state) { | ||
| 57 | unsigned int type = button->type ?: EV_KEY; | ||
| 58 | |||
| 59 | input_event(input, type, button->code, | ||
| 60 | !!(state ^ button->active_low)); | ||
| 61 | input_sync(input); | ||
| 62 | bdata->count = 0; | ||
| 63 | bdata->last_state = state; | ||
| 64 | } | ||
| 65 | } | ||
| 66 | |||
| 67 | static void gpio_keys_polled_poll(struct input_polled_dev *dev) | ||
| 68 | { | ||
| 69 | struct gpio_keys_polled_dev *bdev = dev->private; | ||
| 70 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
| 71 | struct input_dev *input = dev->input; | ||
| 72 | int i; | ||
| 73 | |||
| 74 | for (i = 0; i < bdev->pdata->nbuttons; i++) { | ||
| 75 | struct gpio_keys_button_data *bdata = &bdev->data[i]; | ||
| 76 | |||
| 77 | if (bdata->count < bdata->threshold) | ||
| 78 | bdata->count++; | ||
| 79 | else | ||
| 80 | gpio_keys_polled_check_state(input, &pdata->buttons[i], | ||
| 81 | bdata); | ||
| 82 | } | ||
| 83 | } | ||
| 84 | |||
| 85 | static void gpio_keys_polled_open(struct input_polled_dev *dev) | ||
| 86 | { | ||
| 87 | struct gpio_keys_polled_dev *bdev = dev->private; | ||
| 88 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
| 89 | |||
| 90 | if (pdata->enable) | ||
| 91 | pdata->enable(bdev->dev); | ||
| 92 | } | ||
| 93 | |||
| 94 | static void gpio_keys_polled_close(struct input_polled_dev *dev) | ||
| 95 | { | ||
| 96 | struct gpio_keys_polled_dev *bdev = dev->private; | ||
| 97 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
| 98 | |||
| 99 | if (pdata->disable) | ||
| 100 | pdata->disable(bdev->dev); | ||
| 101 | } | ||
| 102 | |||
| 103 | static int __devinit gpio_keys_polled_probe(struct platform_device *pdev) | ||
| 104 | { | ||
| 105 | struct gpio_keys_platform_data *pdata = pdev->dev.platform_data; | ||
| 106 | struct device *dev = &pdev->dev; | ||
| 107 | struct gpio_keys_polled_dev *bdev; | ||
| 108 | struct input_polled_dev *poll_dev; | ||
| 109 | struct input_dev *input; | ||
| 110 | int error; | ||
| 111 | int i; | ||
| 112 | |||
| 113 | if (!pdata || !pdata->poll_interval) | ||
| 114 | return -EINVAL; | ||
| 115 | |||
| 116 | bdev = kzalloc(sizeof(struct gpio_keys_polled_dev) + | ||
| 117 | pdata->nbuttons * sizeof(struct gpio_keys_button_data), | ||
| 118 | GFP_KERNEL); | ||
| 119 | if (!bdev) { | ||
| 120 | dev_err(dev, "no memory for private data\n"); | ||
| 121 | return -ENOMEM; | ||
| 122 | } | ||
| 123 | |||
| 124 | poll_dev = input_allocate_polled_device(); | ||
| 125 | if (!poll_dev) { | ||
| 126 | dev_err(dev, "no memory for polled device\n"); | ||
| 127 | error = -ENOMEM; | ||
| 128 | goto err_free_bdev; | ||
| 129 | } | ||
| 130 | |||
| 131 | poll_dev->private = bdev; | ||
| 132 | poll_dev->poll = gpio_keys_polled_poll; | ||
| 133 | poll_dev->poll_interval = pdata->poll_interval; | ||
| 134 | poll_dev->open = gpio_keys_polled_open; | ||
| 135 | poll_dev->close = gpio_keys_polled_close; | ||
| 136 | |||
| 137 | input = poll_dev->input; | ||
| 138 | |||
| 139 | input->evbit[0] = BIT(EV_KEY); | ||
| 140 | input->name = pdev->name; | ||
| 141 | input->phys = DRV_NAME"/input0"; | ||
| 142 | input->dev.parent = &pdev->dev; | ||
| 143 | |||
| 144 | input->id.bustype = BUS_HOST; | ||
| 145 | input->id.vendor = 0x0001; | ||
| 146 | input->id.product = 0x0001; | ||
| 147 | input->id.version = 0x0100; | ||
| 148 | |||
| 149 | for (i = 0; i < pdata->nbuttons; i++) { | ||
| 150 | struct gpio_keys_button *button = &pdata->buttons[i]; | ||
| 151 | struct gpio_keys_button_data *bdata = &bdev->data[i]; | ||
| 152 | unsigned int gpio = button->gpio; | ||
| 153 | unsigned int type = button->type ?: EV_KEY; | ||
| 154 | |||
| 155 | if (button->wakeup) { | ||
| 156 | dev_err(dev, DRV_NAME " does not support wakeup\n"); | ||
| 157 | error = -EINVAL; | ||
| 158 | goto err_free_gpio; | ||
| 159 | } | ||
| 160 | |||
| 161 | error = gpio_request(gpio, | ||
| 162 | button->desc ? button->desc : DRV_NAME); | ||
| 163 | if (error) { | ||
| 164 | dev_err(dev, "unable to claim gpio %u, err=%d\n", | ||
| 165 | gpio, error); | ||
| 166 | goto err_free_gpio; | ||
| 167 | } | ||
| 168 | |||
| 169 | error = gpio_direction_input(gpio); | ||
| 170 | if (error) { | ||
| 171 | dev_err(dev, | ||
| 172 | "unable to set direction on gpio %u, err=%d\n", | ||
| 173 | gpio, error); | ||
| 174 | goto err_free_gpio; | ||
| 175 | } | ||
| 176 | |||
| 177 | bdata->can_sleep = gpio_cansleep(gpio); | ||
| 178 | bdata->last_state = -1; | ||
| 179 | bdata->threshold = DIV_ROUND_UP(button->debounce_interval, | ||
| 180 | pdata->poll_interval); | ||
| 181 | |||
| 182 | input_set_capability(input, type, button->code); | ||
| 183 | } | ||
| 184 | |||
| 185 | bdev->poll_dev = poll_dev; | ||
| 186 | bdev->dev = dev; | ||
| 187 | bdev->pdata = pdata; | ||
| 188 | platform_set_drvdata(pdev, bdev); | ||
| 189 | |||
| 190 | error = input_register_polled_device(poll_dev); | ||
| 191 | if (error) { | ||
| 192 | dev_err(dev, "unable to register polled device, err=%d\n", | ||
| 193 | error); | ||
| 194 | goto err_free_gpio; | ||
| 195 | } | ||
| 196 | |||
| 197 | /* report initial state of the buttons */ | ||
| 198 | for (i = 0; i < pdata->nbuttons; i++) | ||
| 199 | gpio_keys_polled_check_state(input, &pdata->buttons[i], | ||
| 200 | &bdev->data[i]); | ||
| 201 | |||
| 202 | return 0; | ||
| 203 | |||
| 204 | err_free_gpio: | ||
| 205 | while (--i >= 0) | ||
| 206 | gpio_free(pdata->buttons[i].gpio); | ||
| 207 | |||
| 208 | input_free_polled_device(poll_dev); | ||
| 209 | |||
| 210 | err_free_bdev: | ||
| 211 | kfree(bdev); | ||
| 212 | |||
| 213 | platform_set_drvdata(pdev, NULL); | ||
| 214 | return error; | ||
| 215 | } | ||
| 216 | |||
| 217 | static int __devexit gpio_keys_polled_remove(struct platform_device *pdev) | ||
| 218 | { | ||
| 219 | struct gpio_keys_polled_dev *bdev = platform_get_drvdata(pdev); | ||
| 220 | struct gpio_keys_platform_data *pdata = bdev->pdata; | ||
| 221 | int i; | ||
| 222 | |||
| 223 | input_unregister_polled_device(bdev->poll_dev); | ||
| 224 | |||
| 225 | for (i = 0; i < pdata->nbuttons; i++) | ||
| 226 | gpio_free(pdata->buttons[i].gpio); | ||
| 227 | |||
| 228 | input_free_polled_device(bdev->poll_dev); | ||
| 229 | |||
| 230 | kfree(bdev); | ||
| 231 | platform_set_drvdata(pdev, NULL); | ||
| 232 | |||
| 233 | return 0; | ||
| 234 | } | ||
| 235 | |||
| 236 | static struct platform_driver gpio_keys_polled_driver = { | ||
| 237 | .probe = gpio_keys_polled_probe, | ||
| 238 | .remove = __devexit_p(gpio_keys_polled_remove), | ||
| 239 | .driver = { | ||
| 240 | .name = DRV_NAME, | ||
| 241 | .owner = THIS_MODULE, | ||
| 242 | }, | ||
| 243 | }; | ||
| 244 | |||
| 245 | static int __init gpio_keys_polled_init(void) | ||
| 246 | { | ||
| 247 | return platform_driver_register(&gpio_keys_polled_driver); | ||
| 248 | } | ||
| 249 | |||
| 250 | static void __exit gpio_keys_polled_exit(void) | ||
| 251 | { | ||
| 252 | platform_driver_unregister(&gpio_keys_polled_driver); | ||
| 253 | } | ||
| 254 | |||
| 255 | module_init(gpio_keys_polled_init); | ||
| 256 | module_exit(gpio_keys_polled_exit); | ||
| 257 | |||
| 258 | MODULE_LICENSE("GPL v2"); | ||
| 259 | MODULE_AUTHOR("Gabor Juhos <juhosg@openwrt.org>"); | ||
| 260 | MODULE_DESCRIPTION("Polled GPIO Buttons driver"); | ||
| 261 | MODULE_ALIAS("platform:" DRV_NAME); | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index 613a3652f98f..0aefaa885871 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
| @@ -51,7 +51,8 @@ | |||
| 51 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) | 51 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) |
| 52 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) | 52 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) |
| 53 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) | 53 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) |
| 54 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100) | 54 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100000) /* 1-button ClickPad */ |
| 55 | #define SYN_CAP_CLICKPAD2BTN(ex0c) ((ex0c) & 0x000100) /* 2-button ClickPad */ | ||
| 55 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) | 56 | #define SYN_CAP_MAX_DIMENSIONS(ex0c) ((ex0c) & 0x020000) |
| 56 | 57 | ||
| 57 | /* synaptics modes query bits */ | 58 | /* synaptics modes query bits */ |
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 3c287dd879d3..4225f5d6b15f 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c | |||
| @@ -358,7 +358,7 @@ static int __devinit gscps2_probe(struct parisc_device *dev) | |||
| 358 | gscps2_reset(ps2port); | 358 | gscps2_reset(ps2port); |
| 359 | ps2port->id = readb(ps2port->addr + GSC_ID) & 0x0f; | 359 | ps2port->id = readb(ps2port->addr + GSC_ID) & 0x0f; |
| 360 | 360 | ||
| 361 | snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s", | 361 | snprintf(serio->name, sizeof(serio->name), "gsc-ps2-%s", |
| 362 | (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse"); | 362 | (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse"); |
| 363 | strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); | 363 | strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); |
| 364 | serio->id.type = SERIO_8042; | 364 | serio->id.type = SERIO_8042; |
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index b3252ef1e279..4852b440960a 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c | |||
| @@ -1436,6 +1436,12 @@ static struct wacom_features wacom_features_0xD2 = | |||
| 1436 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; | 1436 | { "Wacom Bamboo Craft", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; |
| 1437 | static struct wacom_features wacom_features_0xD3 = | 1437 | static struct wacom_features wacom_features_0xD3 = |
| 1438 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | 1438 | { "Wacom Bamboo 2FG 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; |
| 1439 | static struct wacom_features wacom_features_0xD8 = | ||
| 1440 | { "Wacom Bamboo Comic 2FG", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | ||
| 1441 | static struct wacom_features wacom_features_0xDA = | ||
| 1442 | { "Wacom Bamboo 2FG 4x5 SE", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, 63, BAMBOO_PT }; | ||
| 1443 | static struct wacom_features wacom_features_0xDB = | ||
| 1444 | { "Wacom Bamboo 2FG 6x8 SE", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, 63, BAMBOO_PT }; | ||
| 1439 | 1445 | ||
| 1440 | #define USB_DEVICE_WACOM(prod) \ | 1446 | #define USB_DEVICE_WACOM(prod) \ |
| 1441 | USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ | 1447 | USB_DEVICE(USB_VENDOR_ID_WACOM, prod), \ |
| @@ -1504,6 +1510,9 @@ const struct usb_device_id wacom_ids[] = { | |||
| 1504 | { USB_DEVICE_WACOM(0xD1) }, | 1510 | { USB_DEVICE_WACOM(0xD1) }, |
| 1505 | { USB_DEVICE_WACOM(0xD2) }, | 1511 | { USB_DEVICE_WACOM(0xD2) }, |
| 1506 | { USB_DEVICE_WACOM(0xD3) }, | 1512 | { USB_DEVICE_WACOM(0xD3) }, |
| 1513 | { USB_DEVICE_WACOM(0xD8) }, | ||
| 1514 | { USB_DEVICE_WACOM(0xDA) }, | ||
| 1515 | { USB_DEVICE_WACOM(0xDB) }, | ||
| 1507 | { USB_DEVICE_WACOM(0xF0) }, | 1516 | { USB_DEVICE_WACOM(0xF0) }, |
| 1508 | { USB_DEVICE_WACOM(0xCC) }, | 1517 | { USB_DEVICE_WACOM(0xCC) }, |
| 1509 | { USB_DEVICE_WACOM(0x90) }, | 1518 | { USB_DEVICE_WACOM(0x90) }, |
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index f45f80f6d336..73fd6642b681 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
| @@ -178,6 +178,7 @@ static const struct usb_device_id usbtouch_devices[] = { | |||
| 178 | 178 | ||
| 179 | #ifdef CONFIG_TOUCHSCREEN_USB_ITM | 179 | #ifdef CONFIG_TOUCHSCREEN_USB_ITM |
| 180 | {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM}, | 180 | {USB_DEVICE(0x0403, 0xf9e9), .driver_info = DEVTYPE_ITM}, |
| 181 | {USB_DEVICE(0x16e3, 0xf9e9), .driver_info = DEVTYPE_ITM}, | ||
| 181 | #endif | 182 | #endif |
| 182 | 183 | ||
| 183 | #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO | 184 | #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 77b8fd20cd90..6f190f4cdbc0 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
| @@ -7,20 +7,20 @@ menuconfig NEW_LEDS | |||
| 7 | This is not related to standard keyboard LEDs which are controlled | 7 | This is not related to standard keyboard LEDs which are controlled |
| 8 | via the input system. | 8 | via the input system. |
| 9 | 9 | ||
| 10 | if NEW_LEDS | ||
| 11 | |||
| 12 | config LEDS_CLASS | 10 | config LEDS_CLASS |
| 13 | bool "LED Class Support" | 11 | bool "LED Class Support" |
| 12 | depends on NEW_LEDS | ||
| 14 | help | 13 | help |
| 15 | This option enables the led sysfs class in /sys/class/leds. You'll | 14 | This option enables the led sysfs class in /sys/class/leds. You'll |
| 16 | need this to do anything useful with LEDs. If unsure, say N. | 15 | need this to do anything useful with LEDs. If unsure, say N. |
| 17 | 16 | ||
| 18 | if LEDS_CLASS | 17 | if NEW_LEDS |
| 19 | 18 | ||
| 20 | comment "LED drivers" | 19 | comment "LED drivers" |
| 21 | 20 | ||
| 22 | config LEDS_88PM860X | 21 | config LEDS_88PM860X |
| 23 | tristate "LED Support for Marvell 88PM860x PMIC" | 22 | tristate "LED Support for Marvell 88PM860x PMIC" |
| 23 | depends on LEDS_CLASS | ||
| 24 | depends on MFD_88PM860X | 24 | depends on MFD_88PM860X |
| 25 | help | 25 | help |
| 26 | This option enables support for on-chip LED drivers found on Marvell | 26 | This option enables support for on-chip LED drivers found on Marvell |
| @@ -28,6 +28,7 @@ config LEDS_88PM860X | |||
| 28 | 28 | ||
| 29 | config LEDS_ATMEL_PWM | 29 | config LEDS_ATMEL_PWM |
| 30 | tristate "LED Support using Atmel PWM outputs" | 30 | tristate "LED Support using Atmel PWM outputs" |
| 31 | depends on LEDS_CLASS | ||
| 31 | depends on ATMEL_PWM | 32 | depends on ATMEL_PWM |
| 32 | help | 33 | help |
| 33 | This option enables support for LEDs driven using outputs | 34 | This option enables support for LEDs driven using outputs |
| @@ -35,6 +36,7 @@ config LEDS_ATMEL_PWM | |||
| 35 | 36 | ||
| 36 | config LEDS_LOCOMO | 37 | config LEDS_LOCOMO |
| 37 | tristate "LED Support for Locomo device" | 38 | tristate "LED Support for Locomo device" |
| 39 | depends on LEDS_CLASS | ||
| 38 | depends on SHARP_LOCOMO | 40 | depends on SHARP_LOCOMO |
| 39 | help | 41 | help |
| 40 | This option enables support for the LEDs on Sharp Locomo. | 42 | This option enables support for the LEDs on Sharp Locomo. |
| @@ -42,6 +44,7 @@ config LEDS_LOCOMO | |||
| 42 | 44 | ||
| 43 | config LEDS_MIKROTIK_RB532 | 45 | config LEDS_MIKROTIK_RB532 |
| 44 | tristate "LED Support for Mikrotik Routerboard 532" | 46 | tristate "LED Support for Mikrotik Routerboard 532" |
| 47 | depends on LEDS_CLASS | ||
| 45 | depends on MIKROTIK_RB532 | 48 | depends on MIKROTIK_RB532 |
| 46 | help | 49 | help |
| 47 | This option enables support for the so called "User LED" of | 50 | This option enables support for the so called "User LED" of |
| @@ -49,6 +52,7 @@ config LEDS_MIKROTIK_RB532 | |||
| 49 | 52 | ||
| 50 | config LEDS_S3C24XX | 53 | config LEDS_S3C24XX |
| 51 | tristate "LED Support for Samsung S3C24XX GPIO LEDs" | 54 | tristate "LED Support for Samsung S3C24XX GPIO LEDs" |
| 55 | depends on LEDS_CLASS | ||
| 52 | depends on ARCH_S3C2410 | 56 | depends on ARCH_S3C2410 |
| 53 | help | 57 | help |
| 54 | This option enables support for LEDs connected to GPIO lines | 58 | This option enables support for LEDs connected to GPIO lines |
| @@ -56,12 +60,14 @@ config LEDS_S3C24XX | |||
| 56 | 60 | ||
| 57 | config LEDS_AMS_DELTA | 61 | config LEDS_AMS_DELTA |
| 58 | tristate "LED Support for the Amstrad Delta (E3)" | 62 | tristate "LED Support for the Amstrad Delta (E3)" |
| 63 | depends on LEDS_CLASS | ||
| 59 | depends on MACH_AMS_DELTA | 64 | depends on MACH_AMS_DELTA |
| 60 | help | 65 | help |
| 61 | This option enables support for the LEDs on Amstrad Delta (E3). | 66 | This option enables support for the LEDs on Amstrad Delta (E3). |
| 62 | 67 | ||
| 63 | config LEDS_NET48XX | 68 | config LEDS_NET48XX |
| 64 | tristate "LED Support for Soekris net48xx series Error LED" | 69 | tristate "LED Support for Soekris net48xx series Error LED" |
| 70 | depends on LEDS_CLASS | ||
| 65 | depends on SCx200_GPIO | 71 | depends on SCx200_GPIO |
| 66 | help | 72 | help |
| 67 | This option enables support for the Soekris net4801 and net4826 error | 73 | This option enables support for the Soekris net4801 and net4826 error |
| @@ -79,18 +85,21 @@ config LEDS_NET5501 | |||
| 79 | 85 | ||
| 80 | config LEDS_FSG | 86 | config LEDS_FSG |
| 81 | tristate "LED Support for the Freecom FSG-3" | 87 | tristate "LED Support for the Freecom FSG-3" |
| 88 | depends on LEDS_CLASS | ||
| 82 | depends on MACH_FSG | 89 | depends on MACH_FSG |
| 83 | help | 90 | help |
| 84 | This option enables support for the LEDs on the Freecom FSG-3. | 91 | This option enables support for the LEDs on the Freecom FSG-3. |
| 85 | 92 | ||
| 86 | config LEDS_WRAP | 93 | config LEDS_WRAP |
| 87 | tristate "LED Support for the WRAP series LEDs" | 94 | tristate "LED Support for the WRAP series LEDs" |
| 95 | depends on LEDS_CLASS | ||
| 88 | depends on SCx200_GPIO | 96 | depends on SCx200_GPIO |
| 89 | help | 97 | help |
| 90 | This option enables support for the PCEngines WRAP programmable LEDs. | 98 | This option enables support for the PCEngines WRAP programmable LEDs. |
| 91 | 99 | ||
| 92 | config LEDS_ALIX2 | 100 | config LEDS_ALIX2 |
| 93 | tristate "LED Support for ALIX.2 and ALIX.3 series" | 101 | tristate "LED Support for ALIX.2 and ALIX.3 series" |
| 102 | depends on LEDS_CLASS | ||
| 94 | depends on X86 && !GPIO_CS5535 && !CS5535_GPIO | 103 | depends on X86 && !GPIO_CS5535 && !CS5535_GPIO |
| 95 | help | 104 | help |
| 96 | This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs. | 105 | This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs. |
| @@ -98,12 +107,14 @@ config LEDS_ALIX2 | |||
| 98 | 107 | ||
| 99 | config LEDS_H1940 | 108 | config LEDS_H1940 |
| 100 | tristate "LED Support for iPAQ H1940 device" | 109 | tristate "LED Support for iPAQ H1940 device" |
| 110 | depends on LEDS_CLASS | ||
| 101 | depends on ARCH_H1940 | 111 | depends on ARCH_H1940 |
| 102 | help | 112 | help |
| 103 | This option enables support for the LEDs on the h1940. | 113 | This option enables support for the LEDs on the h1940. |
| 104 | 114 | ||
| 105 | config LEDS_COBALT_QUBE | 115 | config LEDS_COBALT_QUBE |
| 106 | tristate "LED Support for the Cobalt Qube series front LED" | 116 | tristate "LED Support for the Cobalt Qube series front LED" |
| 117 | depends on LEDS_CLASS | ||
| 107 | depends on MIPS_COBALT | 118 | depends on MIPS_COBALT |
| 108 | help | 119 | help |
| 109 | This option enables support for the front LED on Cobalt Qube series | 120 | This option enables support for the front LED on Cobalt Qube series |
| @@ -117,6 +128,7 @@ config LEDS_COBALT_RAQ | |||
| 117 | 128 | ||
| 118 | config LEDS_SUNFIRE | 129 | config LEDS_SUNFIRE |
| 119 | tristate "LED support for SunFire servers." | 130 | tristate "LED support for SunFire servers." |
| 131 | depends on LEDS_CLASS | ||
| 120 | depends on SPARC64 | 132 | depends on SPARC64 |
| 121 | select LEDS_TRIGGERS | 133 | select LEDS_TRIGGERS |
| 122 | help | 134 | help |
| @@ -125,6 +137,7 @@ config LEDS_SUNFIRE | |||
| 125 | 137 | ||
| 126 | config LEDS_HP6XX | 138 | config LEDS_HP6XX |
| 127 | tristate "LED Support for the HP Jornada 6xx" | 139 | tristate "LED Support for the HP Jornada 6xx" |
| 140 | depends on LEDS_CLASS | ||
| 128 | depends on SH_HP6XX | 141 | depends on SH_HP6XX |
| 129 | help | 142 | help |
| 130 | This option enables LED support for the handheld | 143 | This option enables LED support for the handheld |
| @@ -132,6 +145,7 @@ config LEDS_HP6XX | |||
| 132 | 145 | ||
| 133 | config LEDS_PCA9532 | 146 | config LEDS_PCA9532 |
| 134 | tristate "LED driver for PCA9532 dimmer" | 147 | tristate "LED driver for PCA9532 dimmer" |
| 148 | depends on LEDS_CLASS | ||
| 135 | depends on I2C && INPUT && EXPERIMENTAL | 149 | depends on I2C && INPUT && EXPERIMENTAL |
| 136 | help | 150 | help |
| 137 | This option enables support for NXP pca9532 | 151 | This option enables support for NXP pca9532 |
| @@ -140,6 +154,7 @@ config LEDS_PCA9532 | |||
| 140 | 154 | ||
| 141 | config LEDS_GPIO | 155 | config LEDS_GPIO |
| 142 | tristate "LED Support for GPIO connected LEDs" | 156 | tristate "LED Support for GPIO connected LEDs" |
| 157 | depends on LEDS_CLASS | ||
| 143 | depends on GENERIC_GPIO | 158 | depends on GENERIC_GPIO |
| 144 | help | 159 | help |
| 145 | This option enables support for the LEDs connected to GPIO | 160 | This option enables support for the LEDs connected to GPIO |
| @@ -167,6 +182,7 @@ config LEDS_GPIO_OF | |||
| 167 | 182 | ||
| 168 | config LEDS_LP3944 | 183 | config LEDS_LP3944 |
| 169 | tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip" | 184 | tristate "LED Support for N.S. LP3944 (Fun Light) I2C chip" |
| 185 | depends on LEDS_CLASS | ||
| 170 | depends on I2C | 186 | depends on I2C |
| 171 | help | 187 | help |
| 172 | This option enables support for LEDs connected to the National | 188 | This option enables support for LEDs connected to the National |
| @@ -196,6 +212,7 @@ config LEDS_LP5523 | |||
| 196 | 212 | ||
| 197 | config LEDS_CLEVO_MAIL | 213 | config LEDS_CLEVO_MAIL |
| 198 | tristate "Mail LED on Clevo notebook" | 214 | tristate "Mail LED on Clevo notebook" |
| 215 | depends on LEDS_CLASS | ||
| 199 | depends on X86 && SERIO_I8042 && DMI | 216 | depends on X86 && SERIO_I8042 && DMI |
| 200 | help | 217 | help |
| 201 | This driver makes the mail LED accessible from userspace | 218 | This driver makes the mail LED accessible from userspace |
| @@ -226,6 +243,7 @@ config LEDS_CLEVO_MAIL | |||
| 226 | 243 | ||
| 227 | config LEDS_PCA955X | 244 | config LEDS_PCA955X |
| 228 | tristate "LED Support for PCA955x I2C chips" | 245 | tristate "LED Support for PCA955x I2C chips" |
| 246 | depends on LEDS_CLASS | ||
| 229 | depends on I2C | 247 | depends on I2C |
| 230 | help | 248 | help |
| 231 | This option enables support for LEDs connected to PCA955x | 249 | This option enables support for LEDs connected to PCA955x |
| @@ -234,6 +252,7 @@ config LEDS_PCA955X | |||
| 234 | 252 | ||
| 235 | config LEDS_WM831X_STATUS | 253 | config LEDS_WM831X_STATUS |
| 236 | tristate "LED support for status LEDs on WM831x PMICs" | 254 | tristate "LED support for status LEDs on WM831x PMICs" |
| 255 | depends on LEDS_CLASS | ||
| 237 | depends on MFD_WM831X | 256 | depends on MFD_WM831X |
| 238 | help | 257 | help |
| 239 | This option enables support for the status LEDs of the WM831x | 258 | This option enables support for the status LEDs of the WM831x |
| @@ -241,6 +260,7 @@ config LEDS_WM831X_STATUS | |||
| 241 | 260 | ||
| 242 | config LEDS_WM8350 | 261 | config LEDS_WM8350 |
| 243 | tristate "LED Support for WM8350 AudioPlus PMIC" | 262 | tristate "LED Support for WM8350 AudioPlus PMIC" |
| 263 | depends on LEDS_CLASS | ||
| 244 | depends on MFD_WM8350 | 264 | depends on MFD_WM8350 |
| 245 | help | 265 | help |
| 246 | This option enables support for LEDs driven by the Wolfson | 266 | This option enables support for LEDs driven by the Wolfson |
| @@ -248,6 +268,7 @@ config LEDS_WM8350 | |||
| 248 | 268 | ||
| 249 | config LEDS_DA903X | 269 | config LEDS_DA903X |
| 250 | tristate "LED Support for DA9030/DA9034 PMIC" | 270 | tristate "LED Support for DA9030/DA9034 PMIC" |
| 271 | depends on LEDS_CLASS | ||
| 251 | depends on PMIC_DA903X | 272 | depends on PMIC_DA903X |
| 252 | help | 273 | help |
| 253 | This option enables support for on-chip LED drivers found | 274 | This option enables support for on-chip LED drivers found |
| @@ -255,6 +276,7 @@ config LEDS_DA903X | |||
| 255 | 276 | ||
| 256 | config LEDS_DAC124S085 | 277 | config LEDS_DAC124S085 |
| 257 | tristate "LED Support for DAC124S085 SPI DAC" | 278 | tristate "LED Support for DAC124S085 SPI DAC" |
| 279 | depends on LEDS_CLASS | ||
| 258 | depends on SPI | 280 | depends on SPI |
| 259 | help | 281 | help |
| 260 | This option enables support for DAC124S085 SPI DAC from NatSemi, | 282 | This option enables support for DAC124S085 SPI DAC from NatSemi, |
| @@ -262,18 +284,21 @@ config LEDS_DAC124S085 | |||
| 262 | 284 | ||
| 263 | config LEDS_PWM | 285 | config LEDS_PWM |
| 264 | tristate "PWM driven LED Support" | 286 | tristate "PWM driven LED Support" |
| 287 | depends on LEDS_CLASS | ||
| 265 | depends on HAVE_PWM | 288 | depends on HAVE_PWM |
| 266 | help | 289 | help |
| 267 | This option enables support for pwm driven LEDs | 290 | This option enables support for pwm driven LEDs |
| 268 | 291 | ||
| 269 | config LEDS_REGULATOR | 292 | config LEDS_REGULATOR |
| 270 | tristate "REGULATOR driven LED support" | 293 | tristate "REGULATOR driven LED support" |
| 294 | depends on LEDS_CLASS | ||
| 271 | depends on REGULATOR | 295 | depends on REGULATOR |
| 272 | help | 296 | help |
| 273 | This option enables support for regulator driven LEDs. | 297 | This option enables support for regulator driven LEDs. |
| 274 | 298 | ||
| 275 | config LEDS_BD2802 | 299 | config LEDS_BD2802 |
| 276 | tristate "LED driver for BD2802 RGB LED" | 300 | tristate "LED driver for BD2802 RGB LED" |
| 301 | depends on LEDS_CLASS | ||
| 277 | depends on I2C | 302 | depends on I2C |
| 278 | help | 303 | help |
| 279 | This option enables support for BD2802GU RGB LED driver chips | 304 | This option enables support for BD2802GU RGB LED driver chips |
| @@ -281,6 +306,7 @@ config LEDS_BD2802 | |||
| 281 | 306 | ||
| 282 | config LEDS_INTEL_SS4200 | 307 | config LEDS_INTEL_SS4200 |
| 283 | tristate "LED driver for Intel NAS SS4200 series" | 308 | tristate "LED driver for Intel NAS SS4200 series" |
| 309 | depends on LEDS_CLASS | ||
| 284 | depends on PCI && DMI | 310 | depends on PCI && DMI |
| 285 | help | 311 | help |
| 286 | This option enables support for the Intel SS4200 series of | 312 | This option enables support for the Intel SS4200 series of |
| @@ -290,6 +316,7 @@ config LEDS_INTEL_SS4200 | |||
| 290 | 316 | ||
| 291 | config LEDS_LT3593 | 317 | config LEDS_LT3593 |
| 292 | tristate "LED driver for LT3593 controllers" | 318 | tristate "LED driver for LT3593 controllers" |
| 319 | depends on LEDS_CLASS | ||
| 293 | depends on GENERIC_GPIO | 320 | depends on GENERIC_GPIO |
| 294 | help | 321 | help |
| 295 | This option enables support for LEDs driven by a Linear Technology | 322 | This option enables support for LEDs driven by a Linear Technology |
| @@ -298,6 +325,7 @@ config LEDS_LT3593 | |||
| 298 | 325 | ||
| 299 | config LEDS_ADP5520 | 326 | config LEDS_ADP5520 |
| 300 | tristate "LED Support for ADP5520/ADP5501 PMIC" | 327 | tristate "LED Support for ADP5520/ADP5501 PMIC" |
| 328 | depends on LEDS_CLASS | ||
| 301 | depends on PMIC_ADP5520 | 329 | depends on PMIC_ADP5520 |
| 302 | help | 330 | help |
| 303 | This option enables support for on-chip LED drivers found | 331 | This option enables support for on-chip LED drivers found |
| @@ -308,6 +336,7 @@ config LEDS_ADP5520 | |||
| 308 | 336 | ||
| 309 | config LEDS_DELL_NETBOOKS | 337 | config LEDS_DELL_NETBOOKS |
| 310 | tristate "External LED on Dell Business Netbooks" | 338 | tristate "External LED on Dell Business Netbooks" |
| 339 | depends on LEDS_CLASS | ||
| 311 | depends on X86 && ACPI_WMI | 340 | depends on X86 && ACPI_WMI |
| 312 | help | 341 | help |
| 313 | This adds support for the Latitude 2100 and similar | 342 | This adds support for the Latitude 2100 and similar |
| @@ -315,6 +344,7 @@ config LEDS_DELL_NETBOOKS | |||
| 315 | 344 | ||
| 316 | config LEDS_MC13783 | 345 | config LEDS_MC13783 |
| 317 | tristate "LED Support for MC13783 PMIC" | 346 | tristate "LED Support for MC13783 PMIC" |
| 347 | depends on LEDS_CLASS | ||
| 318 | depends on MFD_MC13783 | 348 | depends on MFD_MC13783 |
| 319 | help | 349 | help |
| 320 | This option enable support for on-chip LED drivers found | 350 | This option enable support for on-chip LED drivers found |
| @@ -322,6 +352,7 @@ config LEDS_MC13783 | |||
| 322 | 352 | ||
| 323 | config LEDS_NS2 | 353 | config LEDS_NS2 |
| 324 | tristate "LED support for Network Space v2 GPIO LEDs" | 354 | tristate "LED support for Network Space v2 GPIO LEDs" |
| 355 | depends on LEDS_CLASS | ||
| 325 | depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || MACH_NETSPACE_MAX_V2 || D2NET_V2 | 356 | depends on MACH_NETSPACE_V2 || MACH_INETSPACE_V2 || MACH_NETSPACE_MAX_V2 || D2NET_V2 |
| 326 | default y | 357 | default y |
| 327 | help | 358 | help |
| @@ -340,17 +371,17 @@ config LEDS_NETXBIG | |||
| 340 | 371 | ||
| 341 | config LEDS_TRIGGERS | 372 | config LEDS_TRIGGERS |
| 342 | bool "LED Trigger support" | 373 | bool "LED Trigger support" |
| 374 | depends on LEDS_CLASS | ||
| 343 | help | 375 | help |
| 344 | This option enables trigger support for the leds class. | 376 | This option enables trigger support for the leds class. |
| 345 | These triggers allow kernel events to drive the LEDs and can | 377 | These triggers allow kernel events to drive the LEDs and can |
| 346 | be configured via sysfs. If unsure, say Y. | 378 | be configured via sysfs. If unsure, say Y. |
| 347 | 379 | ||
| 348 | if LEDS_TRIGGERS | ||
| 349 | |||
| 350 | comment "LED Triggers" | 380 | comment "LED Triggers" |
| 351 | 381 | ||
| 352 | config LEDS_TRIGGER_TIMER | 382 | config LEDS_TRIGGER_TIMER |
| 353 | tristate "LED Timer Trigger" | 383 | tristate "LED Timer Trigger" |
| 384 | depends on LEDS_TRIGGERS | ||
| 354 | help | 385 | help |
| 355 | This allows LEDs to be controlled by a programmable timer | 386 | This allows LEDs to be controlled by a programmable timer |
| 356 | via sysfs. Some LED hardware can be programmed to start | 387 | via sysfs. Some LED hardware can be programmed to start |
| @@ -362,12 +393,14 @@ config LEDS_TRIGGER_TIMER | |||
| 362 | config LEDS_TRIGGER_IDE_DISK | 393 | config LEDS_TRIGGER_IDE_DISK |
| 363 | bool "LED IDE Disk Trigger" | 394 | bool "LED IDE Disk Trigger" |
| 364 | depends on IDE_GD_ATA | 395 | depends on IDE_GD_ATA |
| 396 | depends on LEDS_TRIGGERS | ||
| 365 | help | 397 | help |
| 366 | This allows LEDs to be controlled by IDE disk activity. | 398 | This allows LEDs to be controlled by IDE disk activity. |
| 367 | If unsure, say Y. | 399 | If unsure, say Y. |
| 368 | 400 | ||
| 369 | config LEDS_TRIGGER_HEARTBEAT | 401 | config LEDS_TRIGGER_HEARTBEAT |
| 370 | tristate "LED Heartbeat Trigger" | 402 | tristate "LED Heartbeat Trigger" |
| 403 | depends on LEDS_TRIGGERS | ||
| 371 | help | 404 | help |
| 372 | This allows LEDs to be controlled by a CPU load average. | 405 | This allows LEDs to be controlled by a CPU load average. |
| 373 | The flash frequency is a hyperbolic function of the 1-minute | 406 | The flash frequency is a hyperbolic function of the 1-minute |
| @@ -376,6 +409,7 @@ config LEDS_TRIGGER_HEARTBEAT | |||
| 376 | 409 | ||
| 377 | config LEDS_TRIGGER_BACKLIGHT | 410 | config LEDS_TRIGGER_BACKLIGHT |
| 378 | tristate "LED backlight Trigger" | 411 | tristate "LED backlight Trigger" |
| 412 | depends on LEDS_TRIGGERS | ||
| 379 | help | 413 | help |
| 380 | This allows LEDs to be controlled as a backlight device: they | 414 | This allows LEDs to be controlled as a backlight device: they |
| 381 | turn off and on when the display is blanked and unblanked. | 415 | turn off and on when the display is blanked and unblanked. |
| @@ -384,6 +418,7 @@ config LEDS_TRIGGER_BACKLIGHT | |||
| 384 | 418 | ||
| 385 | config LEDS_TRIGGER_GPIO | 419 | config LEDS_TRIGGER_GPIO |
| 386 | tristate "LED GPIO Trigger" | 420 | tristate "LED GPIO Trigger" |
| 421 | depends on LEDS_TRIGGERS | ||
| 387 | depends on GPIOLIB | 422 | depends on GPIOLIB |
| 388 | help | 423 | help |
| 389 | This allows LEDs to be controlled by gpio events. It's good | 424 | This allows LEDs to be controlled by gpio events. It's good |
| @@ -396,6 +431,7 @@ config LEDS_TRIGGER_GPIO | |||
| 396 | 431 | ||
| 397 | config LEDS_TRIGGER_DEFAULT_ON | 432 | config LEDS_TRIGGER_DEFAULT_ON |
| 398 | tristate "LED Default ON Trigger" | 433 | tristate "LED Default ON Trigger" |
| 434 | depends on LEDS_TRIGGERS | ||
| 399 | help | 435 | help |
| 400 | This allows LEDs to be initialised in the ON state. | 436 | This allows LEDs to be initialised in the ON state. |
| 401 | If unsure, say Y. | 437 | If unsure, say Y. |
| @@ -403,8 +439,4 @@ config LEDS_TRIGGER_DEFAULT_ON | |||
| 403 | comment "iptables trigger is under Netfilter config (LED target)" | 439 | comment "iptables trigger is under Netfilter config (LED target)" |
| 404 | depends on LEDS_TRIGGERS | 440 | depends on LEDS_TRIGGERS |
| 405 | 441 | ||
| 406 | endif # LEDS_TRIGGERS | ||
| 407 | |||
| 408 | endif # LEDS_CLASS | ||
| 409 | |||
| 410 | endif # NEW_LEDS | 442 | endif # NEW_LEDS |
diff --git a/drivers/macintosh/Kconfig b/drivers/macintosh/Kconfig index 3d7355ff7308..fa51af11c6f1 100644 --- a/drivers/macintosh/Kconfig +++ b/drivers/macintosh/Kconfig | |||
| @@ -102,6 +102,7 @@ config ADB_PMU_LED | |||
| 102 | config ADB_PMU_LED_IDE | 102 | config ADB_PMU_LED_IDE |
| 103 | bool "Use front LED as IDE LED by default" | 103 | bool "Use front LED as IDE LED by default" |
| 104 | depends on ADB_PMU_LED | 104 | depends on ADB_PMU_LED |
| 105 | depends on LEDS_CLASS | ||
| 105 | select LEDS_TRIGGERS | 106 | select LEDS_TRIGGERS |
| 106 | select LEDS_TRIGGER_IDE_DISK | 107 | select LEDS_TRIGGER_IDE_DISK |
| 107 | help | 108 | help |
diff --git a/drivers/media/common/tuners/Kconfig b/drivers/media/common/tuners/Kconfig index 2385e6cca635..78b089526e02 100644 --- a/drivers/media/common/tuners/Kconfig +++ b/drivers/media/common/tuners/Kconfig | |||
| @@ -31,7 +31,7 @@ config MEDIA_TUNER | |||
| 31 | select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE | 31 | select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE |
| 32 | select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE | 32 | select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE |
| 33 | 33 | ||
| 34 | menuconfig MEDIA_TUNER_CUSTOMISE | 34 | config MEDIA_TUNER_CUSTOMISE |
| 35 | bool "Customize analog and hybrid tuner modules to build" | 35 | bool "Customize analog and hybrid tuner modules to build" |
| 36 | depends on MEDIA_TUNER | 36 | depends on MEDIA_TUNER |
| 37 | default y if EMBEDDED | 37 | default y if EMBEDDED |
| @@ -44,7 +44,8 @@ menuconfig MEDIA_TUNER_CUSTOMISE | |||
| 44 | 44 | ||
| 45 | If unsure say N. | 45 | If unsure say N. |
| 46 | 46 | ||
| 47 | if MEDIA_TUNER_CUSTOMISE | 47 | menu "Customize TV tuners" |
| 48 | visible if MEDIA_TUNER_CUSTOMISE | ||
| 48 | 49 | ||
| 49 | config MEDIA_TUNER_SIMPLE | 50 | config MEDIA_TUNER_SIMPLE |
| 50 | tristate "Simple tuner support" | 51 | tristate "Simple tuner support" |
| @@ -185,5 +186,4 @@ config MEDIA_TUNER_TDA18218 | |||
| 185 | default m if MEDIA_TUNER_CUSTOMISE | 186 | default m if MEDIA_TUNER_CUSTOMISE |
| 186 | help | 187 | help |
| 187 | NXP TDA18218 silicon tuner driver. | 188 | NXP TDA18218 silicon tuner driver. |
| 188 | 189 | endmenu | |
| 189 | endif # MEDIA_TUNER_CUSTOMISE | ||
diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index e9062b08a485..96b27016670e 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig | |||
| @@ -12,9 +12,8 @@ config DVB_FE_CUSTOMISE | |||
| 12 | 12 | ||
| 13 | If unsure say N. | 13 | If unsure say N. |
| 14 | 14 | ||
| 15 | if DVB_FE_CUSTOMISE | ||
| 16 | |||
| 17 | menu "Customise DVB Frontends" | 15 | menu "Customise DVB Frontends" |
| 16 | visible if DVB_FE_CUSTOMISE | ||
| 18 | 17 | ||
| 19 | comment "Multistandard (satellite) frontends" | 18 | comment "Multistandard (satellite) frontends" |
| 20 | depends on DVB_CORE | 19 | depends on DVB_CORE |
| @@ -619,5 +618,3 @@ config DVB_DUMMY_FE | |||
| 619 | tristate "Dummy frontend driver" | 618 | tristate "Dummy frontend driver" |
| 620 | default n | 619 | default n |
| 621 | endmenu | 620 | endmenu |
| 622 | |||
| 623 | endif | ||
diff --git a/drivers/media/radio/radio-si4713.c b/drivers/media/radio/radio-si4713.c index 6a435786b63d..03829e6818bd 100644 --- a/drivers/media/radio/radio-si4713.c +++ b/drivers/media/radio/radio-si4713.c | |||
| @@ -291,7 +291,7 @@ static int radio_si4713_pdriver_probe(struct platform_device *pdev) | |||
| 291 | goto unregister_v4l2_dev; | 291 | goto unregister_v4l2_dev; |
| 292 | } | 292 | } |
| 293 | 293 | ||
| 294 | sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter, NULL, | 294 | sd = v4l2_i2c_new_subdev_board(&rsdev->v4l2_dev, adapter, |
| 295 | pdata->subdev_board_info, NULL); | 295 | pdata->subdev_board_info, NULL); |
| 296 | if (!sd) { | 296 | if (!sd) { |
| 297 | dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n"); | 297 | dev_err(&pdev->dev, "Cannot get v4l2 subdevice\n"); |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index ac16e815e275..6830d2848bd7 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
| @@ -112,7 +112,7 @@ config VIDEO_IR_I2C | |||
| 112 | # | 112 | # |
| 113 | 113 | ||
| 114 | menu "Encoders/decoders and other helper chips" | 114 | menu "Encoders/decoders and other helper chips" |
| 115 | depends on !VIDEO_HELPER_CHIPS_AUTO | 115 | visible if !VIDEO_HELPER_CHIPS_AUTO |
| 116 | 116 | ||
| 117 | comment "Audio decoders" | 117 | comment "Audio decoders" |
| 118 | 118 | ||
diff --git a/drivers/media/video/au0828/au0828-cards.c b/drivers/media/video/au0828/au0828-cards.c index 0453816d4ec3..01be89fa5c78 100644 --- a/drivers/media/video/au0828/au0828-cards.c +++ b/drivers/media/video/au0828/au0828-cards.c | |||
| @@ -212,7 +212,7 @@ void au0828_card_setup(struct au0828_dev *dev) | |||
| 212 | be abstracted out if we ever need to support a different | 212 | be abstracted out if we ever need to support a different |
| 213 | demod) */ | 213 | demod) */ |
| 214 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 214 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 215 | NULL, "au8522", 0x8e >> 1, NULL); | 215 | "au8522", 0x8e >> 1, NULL); |
| 216 | if (sd == NULL) | 216 | if (sd == NULL) |
| 217 | printk(KERN_ERR "analog subdev registration failed\n"); | 217 | printk(KERN_ERR "analog subdev registration failed\n"); |
| 218 | } | 218 | } |
| @@ -221,7 +221,7 @@ void au0828_card_setup(struct au0828_dev *dev) | |||
| 221 | if (dev->board.tuner_type != TUNER_ABSENT) { | 221 | if (dev->board.tuner_type != TUNER_ABSENT) { |
| 222 | /* Load the tuner module, which does the attach */ | 222 | /* Load the tuner module, which does the attach */ |
| 223 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 223 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 224 | NULL, "tuner", dev->board.tuner_addr, NULL); | 224 | "tuner", dev->board.tuner_addr, NULL); |
| 225 | if (sd == NULL) | 225 | if (sd == NULL) |
| 226 | printk(KERN_ERR "tuner subdev registration fail\n"); | 226 | printk(KERN_ERR "tuner subdev registration fail\n"); |
| 227 | 227 | ||
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index 87d8b006ef77..49efcf660ba6 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
| @@ -3529,7 +3529,7 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
| 3529 | struct v4l2_subdev *sd; | 3529 | struct v4l2_subdev *sd; |
| 3530 | 3530 | ||
| 3531 | sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3531 | sd = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3532 | &btv->c.i2c_adap, NULL, "saa6588", 0, addrs); | 3532 | &btv->c.i2c_adap, "saa6588", 0, addrs); |
| 3533 | btv->has_saa6588 = (sd != NULL); | 3533 | btv->has_saa6588 = (sd != NULL); |
| 3534 | } | 3534 | } |
| 3535 | 3535 | ||
| @@ -3554,7 +3554,7 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
| 3554 | }; | 3554 | }; |
| 3555 | 3555 | ||
| 3556 | btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3556 | btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3557 | &btv->c.i2c_adap, NULL, "msp3400", 0, addrs); | 3557 | &btv->c.i2c_adap, "msp3400", 0, addrs); |
| 3558 | if (btv->sd_msp34xx) | 3558 | if (btv->sd_msp34xx) |
| 3559 | return; | 3559 | return; |
| 3560 | goto no_audio; | 3560 | goto no_audio; |
| @@ -3568,7 +3568,7 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
| 3568 | }; | 3568 | }; |
| 3569 | 3569 | ||
| 3570 | if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3570 | if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3571 | &btv->c.i2c_adap, NULL, "tda7432", 0, addrs)) | 3571 | &btv->c.i2c_adap, "tda7432", 0, addrs)) |
| 3572 | return; | 3572 | return; |
| 3573 | goto no_audio; | 3573 | goto no_audio; |
| 3574 | } | 3574 | } |
| @@ -3576,7 +3576,7 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
| 3576 | case 3: { | 3576 | case 3: { |
| 3577 | /* The user specified that we should probe for tvaudio */ | 3577 | /* The user specified that we should probe for tvaudio */ |
| 3578 | btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3578 | btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3579 | &btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs()); | 3579 | &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); |
| 3580 | if (btv->sd_tvaudio) | 3580 | if (btv->sd_tvaudio) |
| 3581 | return; | 3581 | return; |
| 3582 | goto no_audio; | 3582 | goto no_audio; |
| @@ -3596,11 +3596,11 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
| 3596 | found is really something else (e.g. a tea6300). */ | 3596 | found is really something else (e.g. a tea6300). */ |
| 3597 | if (!bttv_tvcards[btv->c.type].no_msp34xx) { | 3597 | if (!bttv_tvcards[btv->c.type].no_msp34xx) { |
| 3598 | btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3598 | btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3599 | &btv->c.i2c_adap, NULL, "msp3400", | 3599 | &btv->c.i2c_adap, "msp3400", |
| 3600 | 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1)); | 3600 | 0, I2C_ADDRS(I2C_ADDR_MSP3400 >> 1)); |
| 3601 | } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { | 3601 | } else if (bttv_tvcards[btv->c.type].msp34xx_alt) { |
| 3602 | btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3602 | btv->sd_msp34xx = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3603 | &btv->c.i2c_adap, NULL, "msp3400", | 3603 | &btv->c.i2c_adap, "msp3400", |
| 3604 | 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1)); | 3604 | 0, I2C_ADDRS(I2C_ADDR_MSP3400_ALT >> 1)); |
| 3605 | } | 3605 | } |
| 3606 | 3606 | ||
| @@ -3616,13 +3616,13 @@ void __devinit bttv_init_card2(struct bttv *btv) | |||
| 3616 | }; | 3616 | }; |
| 3617 | 3617 | ||
| 3618 | if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3618 | if (v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3619 | &btv->c.i2c_adap, NULL, "tda7432", 0, addrs)) | 3619 | &btv->c.i2c_adap, "tda7432", 0, addrs)) |
| 3620 | return; | 3620 | return; |
| 3621 | } | 3621 | } |
| 3622 | 3622 | ||
| 3623 | /* Now see if we can find one of the tvaudio devices. */ | 3623 | /* Now see if we can find one of the tvaudio devices. */ |
| 3624 | btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3624 | btv->sd_tvaudio = v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3625 | &btv->c.i2c_adap, NULL, "tvaudio", 0, tvaudio_addrs()); | 3625 | &btv->c.i2c_adap, "tvaudio", 0, tvaudio_addrs()); |
| 3626 | if (btv->sd_tvaudio) | 3626 | if (btv->sd_tvaudio) |
| 3627 | return; | 3627 | return; |
| 3628 | 3628 | ||
| @@ -3646,13 +3646,13 @@ void __devinit bttv_init_tuner(struct bttv *btv) | |||
| 3646 | /* Load tuner module before issuing tuner config call! */ | 3646 | /* Load tuner module before issuing tuner config call! */ |
| 3647 | if (bttv_tvcards[btv->c.type].has_radio) | 3647 | if (bttv_tvcards[btv->c.type].has_radio) |
| 3648 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3648 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3649 | &btv->c.i2c_adap, NULL, "tuner", | 3649 | &btv->c.i2c_adap, "tuner", |
| 3650 | 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); | 3650 | 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); |
| 3651 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3651 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3652 | &btv->c.i2c_adap, NULL, "tuner", | 3652 | &btv->c.i2c_adap, "tuner", |
| 3653 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 3653 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
| 3654 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, | 3654 | v4l2_i2c_new_subdev(&btv->c.v4l2_dev, |
| 3655 | &btv->c.i2c_adap, NULL, "tuner", | 3655 | &btv->c.i2c_adap, "tuner", |
| 3656 | 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD)); | 3656 | 0, v4l2_i2c_tuner_addrs(ADDRS_TV_WITH_DEMOD)); |
| 3657 | 3657 | ||
| 3658 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; | 3658 | tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV; |
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 7bc36670071a..260c666ce931 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c | |||
| @@ -2066,8 +2066,7 @@ static int cafe_pci_probe(struct pci_dev *pdev, | |||
| 2066 | 2066 | ||
| 2067 | cam->sensor_addr = 0x42; | 2067 | cam->sensor_addr = 0x42; |
| 2068 | cam->sensor = v4l2_i2c_new_subdev_cfg(&cam->v4l2_dev, &cam->i2c_adapter, | 2068 | cam->sensor = v4l2_i2c_new_subdev_cfg(&cam->v4l2_dev, &cam->i2c_adapter, |
| 2069 | "ov7670", "ov7670", 0, &sensor_cfg, cam->sensor_addr, | 2069 | "ov7670", 0, &sensor_cfg, cam->sensor_addr, NULL); |
| 2070 | NULL); | ||
| 2071 | if (cam->sensor == NULL) { | 2070 | if (cam->sensor == NULL) { |
| 2072 | ret = -ENODEV; | 2071 | ret = -ENODEV; |
| 2073 | goto out_smbus; | 2072 | goto out_smbus; |
diff --git a/drivers/media/video/cx18/cx18-i2c.c b/drivers/media/video/cx18/cx18-i2c.c index a09caf883170..e71a026f3419 100644 --- a/drivers/media/video/cx18/cx18-i2c.c +++ b/drivers/media/video/cx18/cx18-i2c.c | |||
| @@ -122,15 +122,15 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx) | |||
| 122 | if (hw == CX18_HW_TUNER) { | 122 | if (hw == CX18_HW_TUNER) { |
| 123 | /* special tuner group handling */ | 123 | /* special tuner group handling */ |
| 124 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, | 124 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, |
| 125 | adap, NULL, type, 0, cx->card_i2c->radio); | 125 | adap, type, 0, cx->card_i2c->radio); |
| 126 | if (sd != NULL) | 126 | if (sd != NULL) |
| 127 | sd->grp_id = hw; | 127 | sd->grp_id = hw; |
| 128 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, | 128 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, |
| 129 | adap, NULL, type, 0, cx->card_i2c->demod); | 129 | adap, type, 0, cx->card_i2c->demod); |
| 130 | if (sd != NULL) | 130 | if (sd != NULL) |
| 131 | sd->grp_id = hw; | 131 | sd->grp_id = hw; |
| 132 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, | 132 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, |
| 133 | adap, NULL, type, 0, cx->card_i2c->tv); | 133 | adap, type, 0, cx->card_i2c->tv); |
| 134 | if (sd != NULL) | 134 | if (sd != NULL) |
| 135 | sd->grp_id = hw; | 135 | sd->grp_id = hw; |
| 136 | return sd != NULL ? 0 : -1; | 136 | return sd != NULL ? 0 : -1; |
| @@ -144,7 +144,7 @@ int cx18_i2c_register(struct cx18 *cx, unsigned idx) | |||
| 144 | return -1; | 144 | return -1; |
| 145 | 145 | ||
| 146 | /* It's an I2C device other than an analog tuner or IR chip */ | 146 | /* It's an I2C device other than an analog tuner or IR chip */ |
| 147 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, NULL, type, hw_addrs[idx], | 147 | sd = v4l2_i2c_new_subdev(&cx->v4l2_dev, adap, type, hw_addrs[idx], |
| 148 | NULL); | 148 | NULL); |
| 149 | if (sd != NULL) | 149 | if (sd != NULL) |
| 150 | sd->grp_id = hw; | 150 | sd->grp_id = hw; |
diff --git a/drivers/media/video/cx231xx/cx231xx-cards.c b/drivers/media/video/cx231xx/cx231xx-cards.c index 56c2d8195ac6..2c78d188bb06 100644 --- a/drivers/media/video/cx231xx/cx231xx-cards.c +++ b/drivers/media/video/cx231xx/cx231xx-cards.c | |||
| @@ -560,7 +560,7 @@ void cx231xx_card_setup(struct cx231xx *dev) | |||
| 560 | if (dev->board.decoder == CX231XX_AVDECODER) { | 560 | if (dev->board.decoder == CX231XX_AVDECODER) { |
| 561 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 561 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 562 | &dev->i2c_bus[0].i2c_adap, | 562 | &dev->i2c_bus[0].i2c_adap, |
| 563 | NULL, "cx25840", 0x88 >> 1, NULL); | 563 | "cx25840", 0x88 >> 1, NULL); |
| 564 | if (dev->sd_cx25840 == NULL) | 564 | if (dev->sd_cx25840 == NULL) |
| 565 | cx231xx_info("cx25840 subdev registration failure\n"); | 565 | cx231xx_info("cx25840 subdev registration failure\n"); |
| 566 | cx25840_call(dev, core, load_fw); | 566 | cx25840_call(dev, core, load_fw); |
| @@ -571,7 +571,7 @@ void cx231xx_card_setup(struct cx231xx *dev) | |||
| 571 | if (dev->board.tuner_type != TUNER_ABSENT) { | 571 | if (dev->board.tuner_type != TUNER_ABSENT) { |
| 572 | dev->sd_tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 572 | dev->sd_tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 573 | &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, | 573 | &dev->i2c_bus[dev->board.tuner_i2c_master].i2c_adap, |
| 574 | NULL, "tuner", | 574 | "tuner", |
| 575 | dev->tuner_addr, NULL); | 575 | dev->tuner_addr, NULL); |
| 576 | if (dev->sd_tuner == NULL) | 576 | if (dev->sd_tuner == NULL) |
| 577 | cx231xx_info("tuner subdev registration failure\n"); | 577 | cx231xx_info("tuner subdev registration failure\n"); |
diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index db054004e462..8861309268b1 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c | |||
| @@ -1247,7 +1247,7 @@ void cx23885_card_setup(struct cx23885_dev *dev) | |||
| 1247 | case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200: | 1247 | case CX23885_BOARD_LEADTEK_WINFAST_PXTV1200: |
| 1248 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1248 | dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 1249 | &dev->i2c_bus[2].i2c_adap, | 1249 | &dev->i2c_bus[2].i2c_adap, |
| 1250 | NULL, "cx25840", 0x88 >> 1, NULL); | 1250 | "cx25840", 0x88 >> 1, NULL); |
| 1251 | if (dev->sd_cx25840) { | 1251 | if (dev->sd_cx25840) { |
| 1252 | dev->sd_cx25840->grp_id = CX23885_HW_AV_CORE; | 1252 | dev->sd_cx25840->grp_id = CX23885_HW_AV_CORE; |
| 1253 | v4l2_subdev_call(dev->sd_cx25840, core, load_fw); | 1253 | v4l2_subdev_call(dev->sd_cx25840, core, load_fw); |
diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 3cc9f462d08d..8b2fb8a4375c 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c | |||
| @@ -1507,10 +1507,10 @@ int cx23885_video_register(struct cx23885_dev *dev) | |||
| 1507 | if (dev->tuner_addr) | 1507 | if (dev->tuner_addr) |
| 1508 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1508 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 1509 | &dev->i2c_bus[1].i2c_adap, | 1509 | &dev->i2c_bus[1].i2c_adap, |
| 1510 | NULL, "tuner", dev->tuner_addr, NULL); | 1510 | "tuner", dev->tuner_addr, NULL); |
| 1511 | else | 1511 | else |
| 1512 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1512 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 1513 | &dev->i2c_bus[1].i2c_adap, NULL, | 1513 | &dev->i2c_bus[1].i2c_adap, |
| 1514 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV)); | 1514 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_TV)); |
| 1515 | if (sd) { | 1515 | if (sd) { |
| 1516 | struct tuner_setup tun_setup; | 1516 | struct tuner_setup tun_setup; |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index b26fcba8600c..9b9e169cce90 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
| @@ -3515,19 +3515,18 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) | |||
| 3515 | later code configures a tea5767. | 3515 | later code configures a tea5767. |
| 3516 | */ | 3516 | */ |
| 3517 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, | 3517 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, |
| 3518 | NULL, "tuner", | 3518 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); |
| 3519 | 0, v4l2_i2c_tuner_addrs(ADDRS_RADIO)); | ||
| 3520 | if (has_demod) | 3519 | if (has_demod) |
| 3521 | v4l2_i2c_new_subdev(&core->v4l2_dev, | 3520 | v4l2_i2c_new_subdev(&core->v4l2_dev, |
| 3522 | &core->i2c_adap, NULL, "tuner", | 3521 | &core->i2c_adap, "tuner", |
| 3523 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 3522 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
| 3524 | if (core->board.tuner_addr == ADDR_UNSET) { | 3523 | if (core->board.tuner_addr == ADDR_UNSET) { |
| 3525 | v4l2_i2c_new_subdev(&core->v4l2_dev, | 3524 | v4l2_i2c_new_subdev(&core->v4l2_dev, |
| 3526 | &core->i2c_adap, NULL, "tuner", | 3525 | &core->i2c_adap, "tuner", |
| 3527 | 0, has_demod ? tv_addrs + 4 : tv_addrs); | 3526 | 0, has_demod ? tv_addrs + 4 : tv_addrs); |
| 3528 | } else { | 3527 | } else { |
| 3529 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, | 3528 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, |
| 3530 | NULL, "tuner", core->board.tuner_addr, NULL); | 3529 | "tuner", core->board.tuner_addr, NULL); |
| 3531 | } | 3530 | } |
| 3532 | } | 3531 | } |
| 3533 | 3532 | ||
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 88b51194f917..62cea9549404 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
| @@ -1895,14 +1895,13 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev, | |||
| 1895 | 1895 | ||
| 1896 | if (core->board.audio_chip == V4L2_IDENT_WM8775) | 1896 | if (core->board.audio_chip == V4L2_IDENT_WM8775) |
| 1897 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, | 1897 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, |
| 1898 | NULL, "wm8775", 0x36 >> 1, NULL); | 1898 | "wm8775", 0x36 >> 1, NULL); |
| 1899 | 1899 | ||
| 1900 | if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) { | 1900 | if (core->board.audio_chip == V4L2_IDENT_TVAUDIO) { |
| 1901 | /* This probes for a tda9874 as is used on some | 1901 | /* This probes for a tda9874 as is used on some |
| 1902 | Pixelview Ultra boards. */ | 1902 | Pixelview Ultra boards. */ |
| 1903 | v4l2_i2c_new_subdev(&core->v4l2_dev, | 1903 | v4l2_i2c_new_subdev(&core->v4l2_dev, &core->i2c_adap, |
| 1904 | &core->i2c_adap, | 1904 | "tvaudio", 0, I2C_ADDRS(0xb0 >> 1)); |
| 1905 | NULL, "tvaudio", 0, I2C_ADDRS(0xb0 >> 1)); | ||
| 1906 | } | 1905 | } |
| 1907 | 1906 | ||
| 1908 | switch (core->boardnr) { | 1907 | switch (core->boardnr) { |
diff --git a/drivers/media/video/davinci/vpfe_capture.c b/drivers/media/video/davinci/vpfe_capture.c index d8e38cc4ec40..7333a9bb2549 100644 --- a/drivers/media/video/davinci/vpfe_capture.c +++ b/drivers/media/video/davinci/vpfe_capture.c | |||
| @@ -1986,7 +1986,6 @@ static __init int vpfe_probe(struct platform_device *pdev) | |||
| 1986 | vpfe_dev->sd[i] = | 1986 | vpfe_dev->sd[i] = |
| 1987 | v4l2_i2c_new_subdev_board(&vpfe_dev->v4l2_dev, | 1987 | v4l2_i2c_new_subdev_board(&vpfe_dev->v4l2_dev, |
| 1988 | i2c_adap, | 1988 | i2c_adap, |
| 1989 | NULL, | ||
| 1990 | &sdinfo->board_info, | 1989 | &sdinfo->board_info, |
| 1991 | NULL); | 1990 | NULL); |
| 1992 | if (vpfe_dev->sd[i]) { | 1991 | if (vpfe_dev->sd[i]) { |
diff --git a/drivers/media/video/davinci/vpif_capture.c b/drivers/media/video/davinci/vpif_capture.c index 6ac6acd16352..193abab6b355 100644 --- a/drivers/media/video/davinci/vpif_capture.c +++ b/drivers/media/video/davinci/vpif_capture.c | |||
| @@ -2013,7 +2013,6 @@ static __init int vpif_probe(struct platform_device *pdev) | |||
| 2013 | vpif_obj.sd[i] = | 2013 | vpif_obj.sd[i] = |
| 2014 | v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev, | 2014 | v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev, |
| 2015 | i2c_adap, | 2015 | i2c_adap, |
| 2016 | NULL, | ||
| 2017 | &subdevdata->board_info, | 2016 | &subdevdata->board_info, |
| 2018 | NULL); | 2017 | NULL); |
| 2019 | 2018 | ||
diff --git a/drivers/media/video/davinci/vpif_display.c b/drivers/media/video/davinci/vpif_display.c index 685f6a6ee603..412c65d54fe1 100644 --- a/drivers/media/video/davinci/vpif_display.c +++ b/drivers/media/video/davinci/vpif_display.c | |||
| @@ -1553,7 +1553,7 @@ static __init int vpif_probe(struct platform_device *pdev) | |||
| 1553 | 1553 | ||
| 1554 | for (i = 0; i < subdev_count; i++) { | 1554 | for (i = 0; i < subdev_count; i++) { |
| 1555 | vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev, | 1555 | vpif_obj.sd[i] = v4l2_i2c_new_subdev_board(&vpif_obj.v4l2_dev, |
| 1556 | i2c_adap, NULL, | 1556 | i2c_adap, |
| 1557 | &subdevdata[i].board_info, | 1557 | &subdevdata[i].board_info, |
| 1558 | NULL); | 1558 | NULL); |
| 1559 | if (!vpif_obj.sd[i]) { | 1559 | if (!vpif_obj.sd[i]) { |
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 54859233f311..f7e9168157a5 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
| @@ -2554,39 +2554,39 @@ void em28xx_card_setup(struct em28xx *dev) | |||
| 2554 | /* request some modules */ | 2554 | /* request some modules */ |
| 2555 | if (dev->board.has_msp34xx) | 2555 | if (dev->board.has_msp34xx) |
| 2556 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2556 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 2557 | NULL, "msp3400", 0, msp3400_addrs); | 2557 | "msp3400", 0, msp3400_addrs); |
| 2558 | 2558 | ||
| 2559 | if (dev->board.decoder == EM28XX_SAA711X) | 2559 | if (dev->board.decoder == EM28XX_SAA711X) |
| 2560 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2560 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 2561 | NULL, "saa7115_auto", 0, saa711x_addrs); | 2561 | "saa7115_auto", 0, saa711x_addrs); |
| 2562 | 2562 | ||
| 2563 | if (dev->board.decoder == EM28XX_TVP5150) | 2563 | if (dev->board.decoder == EM28XX_TVP5150) |
| 2564 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2564 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 2565 | NULL, "tvp5150", 0, tvp5150_addrs); | 2565 | "tvp5150", 0, tvp5150_addrs); |
| 2566 | 2566 | ||
| 2567 | if (dev->em28xx_sensor == EM28XX_MT9V011) { | 2567 | if (dev->em28xx_sensor == EM28XX_MT9V011) { |
| 2568 | struct v4l2_subdev *sd; | 2568 | struct v4l2_subdev *sd; |
| 2569 | 2569 | ||
| 2570 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 2570 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 2571 | &dev->i2c_adap, NULL, "mt9v011", 0, mt9v011_addrs); | 2571 | &dev->i2c_adap, "mt9v011", 0, mt9v011_addrs); |
| 2572 | v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal); | 2572 | v4l2_subdev_call(sd, core, s_config, 0, &dev->sensor_xtal); |
| 2573 | } | 2573 | } |
| 2574 | 2574 | ||
| 2575 | 2575 | ||
| 2576 | if (dev->board.adecoder == EM28XX_TVAUDIO) | 2576 | if (dev->board.adecoder == EM28XX_TVAUDIO) |
| 2577 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2577 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 2578 | NULL, "tvaudio", dev->board.tvaudio_addr, NULL); | 2578 | "tvaudio", dev->board.tvaudio_addr, NULL); |
| 2579 | 2579 | ||
| 2580 | if (dev->board.tuner_type != TUNER_ABSENT) { | 2580 | if (dev->board.tuner_type != TUNER_ABSENT) { |
| 2581 | int has_demod = (dev->tda9887_conf & TDA9887_PRESENT); | 2581 | int has_demod = (dev->tda9887_conf & TDA9887_PRESENT); |
| 2582 | 2582 | ||
| 2583 | if (dev->board.radio.type) | 2583 | if (dev->board.radio.type) |
| 2584 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2584 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 2585 | NULL, "tuner", dev->board.radio_addr, NULL); | 2585 | "tuner", dev->board.radio_addr, NULL); |
| 2586 | 2586 | ||
| 2587 | if (has_demod) | 2587 | if (has_demod) |
| 2588 | v4l2_i2c_new_subdev(&dev->v4l2_dev, | 2588 | v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 2589 | &dev->i2c_adap, NULL, "tuner", | 2589 | &dev->i2c_adap, "tuner", |
| 2590 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 2590 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
| 2591 | if (dev->tuner_addr == 0) { | 2591 | if (dev->tuner_addr == 0) { |
| 2592 | enum v4l2_i2c_tuner_type type = | 2592 | enum v4l2_i2c_tuner_type type = |
| @@ -2594,14 +2594,14 @@ void em28xx_card_setup(struct em28xx *dev) | |||
| 2594 | struct v4l2_subdev *sd; | 2594 | struct v4l2_subdev *sd; |
| 2595 | 2595 | ||
| 2596 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 2596 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 2597 | &dev->i2c_adap, NULL, "tuner", | 2597 | &dev->i2c_adap, "tuner", |
| 2598 | 0, v4l2_i2c_tuner_addrs(type)); | 2598 | 0, v4l2_i2c_tuner_addrs(type)); |
| 2599 | 2599 | ||
| 2600 | if (sd) | 2600 | if (sd) |
| 2601 | dev->tuner_addr = v4l2_i2c_subdev_addr(sd); | 2601 | dev->tuner_addr = v4l2_i2c_subdev_addr(sd); |
| 2602 | } else { | 2602 | } else { |
| 2603 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 2603 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 2604 | NULL, "tuner", dev->tuner_addr, NULL); | 2604 | "tuner", dev->tuner_addr, NULL); |
| 2605 | } | 2605 | } |
| 2606 | } | 2606 | } |
| 2607 | 2607 | ||
diff --git a/drivers/media/video/fsl-viu.c b/drivers/media/video/fsl-viu.c index 9a075d83dd1f..b8faff2dd711 100644 --- a/drivers/media/video/fsl-viu.c +++ b/drivers/media/video/fsl-viu.c | |||
| @@ -1486,7 +1486,7 @@ static int __devinit viu_of_probe(struct platform_device *op, | |||
| 1486 | 1486 | ||
| 1487 | ad = i2c_get_adapter(0); | 1487 | ad = i2c_get_adapter(0); |
| 1488 | viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad, | 1488 | viu_dev->decoder = v4l2_i2c_new_subdev(&viu_dev->v4l2_dev, ad, |
| 1489 | NULL, "saa7113", VIU_VIDEO_DECODER_ADDR, NULL); | 1489 | "saa7113", VIU_VIDEO_DECODER_ADDR, NULL); |
| 1490 | 1490 | ||
| 1491 | viu_dev->vidq.timeout.function = viu_vid_timeout; | 1491 | viu_dev->vidq.timeout.function = viu_vid_timeout; |
| 1492 | viu_dev->vidq.timeout.data = (unsigned long)viu_dev; | 1492 | viu_dev->vidq.timeout.data = (unsigned long)viu_dev; |
diff --git a/drivers/media/video/ivtv/ivtv-i2c.c b/drivers/media/video/ivtv/ivtv-i2c.c index 9e8039ac909e..665191c9b407 100644 --- a/drivers/media/video/ivtv/ivtv-i2c.c +++ b/drivers/media/video/ivtv/ivtv-i2c.c | |||
| @@ -239,19 +239,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) | |||
| 239 | return -1; | 239 | return -1; |
| 240 | if (hw == IVTV_HW_TUNER) { | 240 | if (hw == IVTV_HW_TUNER) { |
| 241 | /* special tuner handling */ | 241 | /* special tuner handling */ |
| 242 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 242 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0, |
| 243 | adap, NULL, type, | 243 | itv->card_i2c->radio); |
| 244 | 0, itv->card_i2c->radio); | ||
| 245 | if (sd) | 244 | if (sd) |
| 246 | sd->grp_id = 1 << idx; | 245 | sd->grp_id = 1 << idx; |
| 247 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 246 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0, |
| 248 | adap, NULL, type, | 247 | itv->card_i2c->demod); |
| 249 | 0, itv->card_i2c->demod); | ||
| 250 | if (sd) | 248 | if (sd) |
| 251 | sd->grp_id = 1 << idx; | 249 | sd->grp_id = 1 << idx; |
| 252 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 250 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, adap, type, 0, |
| 253 | adap, NULL, type, | 251 | itv->card_i2c->tv); |
| 254 | 0, itv->card_i2c->tv); | ||
| 255 | if (sd) | 252 | if (sd) |
| 256 | sd->grp_id = 1 << idx; | 253 | sd->grp_id = 1 << idx; |
| 257 | return sd ? 0 : -1; | 254 | return sd ? 0 : -1; |
| @@ -267,17 +264,16 @@ int ivtv_i2c_register(struct ivtv *itv, unsigned idx) | |||
| 267 | /* It's an I2C device other than an analog tuner or IR chip */ | 264 | /* It's an I2C device other than an analog tuner or IR chip */ |
| 268 | if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) { | 265 | if (hw == IVTV_HW_UPD64031A || hw == IVTV_HW_UPD6408X) { |
| 269 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 266 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
| 270 | adap, NULL, type, 0, I2C_ADDRS(hw_addrs[idx])); | 267 | adap, type, 0, I2C_ADDRS(hw_addrs[idx])); |
| 271 | } else if (hw == IVTV_HW_CX25840) { | 268 | } else if (hw == IVTV_HW_CX25840) { |
| 272 | struct cx25840_platform_data pdata; | 269 | struct cx25840_platform_data pdata; |
| 273 | 270 | ||
| 274 | pdata.pvr150_workaround = itv->pvr150_workaround; | 271 | pdata.pvr150_workaround = itv->pvr150_workaround; |
| 275 | sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev, | 272 | sd = v4l2_i2c_new_subdev_cfg(&itv->v4l2_dev, |
| 276 | adap, NULL, type, 0, &pdata, hw_addrs[idx], | 273 | adap, type, 0, &pdata, hw_addrs[idx], NULL); |
| 277 | NULL); | ||
| 278 | } else { | 274 | } else { |
| 279 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, | 275 | sd = v4l2_i2c_new_subdev(&itv->v4l2_dev, |
| 280 | adap, NULL, type, hw_addrs[idx], NULL); | 276 | adap, type, hw_addrs[idx], NULL); |
| 281 | } | 277 | } |
| 282 | if (sd) | 278 | if (sd) |
| 283 | sd->grp_id = 1 << idx; | 279 | sd->grp_id = 1 << idx; |
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 94ba698d0ad4..4e8fd965f151 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
| @@ -185,17 +185,17 @@ static int mxb_probe(struct saa7146_dev *dev) | |||
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | mxb->saa7111a = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, | 187 | mxb->saa7111a = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, |
| 188 | NULL, "saa7111", I2C_SAA7111A, NULL); | 188 | "saa7111", I2C_SAA7111A, NULL); |
| 189 | mxb->tea6420_1 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, | 189 | mxb->tea6420_1 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, |
| 190 | NULL, "tea6420", I2C_TEA6420_1, NULL); | 190 | "tea6420", I2C_TEA6420_1, NULL); |
| 191 | mxb->tea6420_2 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, | 191 | mxb->tea6420_2 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, |
| 192 | NULL, "tea6420", I2C_TEA6420_2, NULL); | 192 | "tea6420", I2C_TEA6420_2, NULL); |
| 193 | mxb->tea6415c = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, | 193 | mxb->tea6415c = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, |
| 194 | NULL, "tea6415c", I2C_TEA6415C, NULL); | 194 | "tea6415c", I2C_TEA6415C, NULL); |
| 195 | mxb->tda9840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, | 195 | mxb->tda9840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, |
| 196 | NULL, "tda9840", I2C_TDA9840, NULL); | 196 | "tda9840", I2C_TDA9840, NULL); |
| 197 | mxb->tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, | 197 | mxb->tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, |
| 198 | NULL, "tuner", I2C_TUNER, NULL); | 198 | "tuner", I2C_TUNER, NULL); |
| 199 | 199 | ||
| 200 | /* check if all devices are present */ | 200 | /* check if all devices are present */ |
| 201 | if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c || | 201 | if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c || |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index bef202752cc8..66ad516bdfd9 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
| @@ -2088,16 +2088,14 @@ static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, | |||
| 2088 | " Setting up with specified i2c address 0x%x", | 2088 | " Setting up with specified i2c address 0x%x", |
| 2089 | mid, i2caddr[0]); | 2089 | mid, i2caddr[0]); |
| 2090 | sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap, | 2090 | sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap, |
| 2091 | NULL, fname, | 2091 | fname, i2caddr[0], NULL); |
| 2092 | i2caddr[0], NULL); | ||
| 2093 | } else { | 2092 | } else { |
| 2094 | pvr2_trace(PVR2_TRACE_INIT, | 2093 | pvr2_trace(PVR2_TRACE_INIT, |
| 2095 | "Module ID %u:" | 2094 | "Module ID %u:" |
| 2096 | " Setting up with address probe list", | 2095 | " Setting up with address probe list", |
| 2097 | mid); | 2096 | mid); |
| 2098 | sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap, | 2097 | sd = v4l2_i2c_new_subdev(&hdw->v4l2_dev, &hdw->i2c_adap, |
| 2099 | NULL, fname, | 2098 | fname, 0, i2caddr); |
| 2100 | 0, i2caddr); | ||
| 2101 | } | 2099 | } |
| 2102 | 2100 | ||
| 2103 | if (!sd) { | 2101 | if (!sd) { |
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index e8f13d3e2df1..1b93207c89e8 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
| @@ -44,7 +44,7 @@ static struct v4l2_subdev *fimc_subdev_register(struct fimc_dev *fimc, | |||
| 44 | return ERR_PTR(-ENOMEM); | 44 | return ERR_PTR(-ENOMEM); |
| 45 | 45 | ||
| 46 | sd = v4l2_i2c_new_subdev_board(&vid_cap->v4l2_dev, i2c_adap, | 46 | sd = v4l2_i2c_new_subdev_board(&vid_cap->v4l2_dev, i2c_adap, |
| 47 | MODULE_NAME, isp_info->board_info, NULL); | 47 | isp_info->board_info, NULL); |
| 48 | if (!sd) { | 48 | if (!sd) { |
| 49 | v4l2_err(&vid_cap->v4l2_dev, "failed to acquire subdev\n"); | 49 | v4l2_err(&vid_cap->v4l2_dev, "failed to acquire subdev\n"); |
| 50 | return NULL; | 50 | return NULL; |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 0911cb580e18..1d4d0a49ea52 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
| @@ -7551,22 +7551,22 @@ int saa7134_board_init2(struct saa7134_dev *dev) | |||
| 7551 | so we do not need to probe for a radio tuner device. */ | 7551 | so we do not need to probe for a radio tuner device. */ |
| 7552 | if (dev->radio_type != UNSET) | 7552 | if (dev->radio_type != UNSET) |
| 7553 | v4l2_i2c_new_subdev(&dev->v4l2_dev, | 7553 | v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 7554 | &dev->i2c_adap, NULL, "tuner", | 7554 | &dev->i2c_adap, "tuner", |
| 7555 | dev->radio_addr, NULL); | 7555 | dev->radio_addr, NULL); |
| 7556 | if (has_demod) | 7556 | if (has_demod) |
| 7557 | v4l2_i2c_new_subdev(&dev->v4l2_dev, | 7557 | v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 7558 | &dev->i2c_adap, NULL, "tuner", | 7558 | &dev->i2c_adap, "tuner", |
| 7559 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 7559 | 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
| 7560 | if (dev->tuner_addr == ADDR_UNSET) { | 7560 | if (dev->tuner_addr == ADDR_UNSET) { |
| 7561 | enum v4l2_i2c_tuner_type type = | 7561 | enum v4l2_i2c_tuner_type type = |
| 7562 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; | 7562 | has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; |
| 7563 | 7563 | ||
| 7564 | v4l2_i2c_new_subdev(&dev->v4l2_dev, | 7564 | v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 7565 | &dev->i2c_adap, NULL, "tuner", | 7565 | &dev->i2c_adap, "tuner", |
| 7566 | 0, v4l2_i2c_tuner_addrs(type)); | 7566 | 0, v4l2_i2c_tuner_addrs(type)); |
| 7567 | } else { | 7567 | } else { |
| 7568 | v4l2_i2c_new_subdev(&dev->v4l2_dev, | 7568 | v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 7569 | &dev->i2c_adap, NULL, "tuner", | 7569 | &dev->i2c_adap, "tuner", |
| 7570 | dev->tuner_addr, NULL); | 7570 | dev->tuner_addr, NULL); |
| 7571 | } | 7571 | } |
| 7572 | } | 7572 | } |
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 764d7d219fed..756a27812260 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
| @@ -991,7 +991,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
| 991 | if (card_is_empress(dev)) { | 991 | if (card_is_empress(dev)) { |
| 992 | struct v4l2_subdev *sd = | 992 | struct v4l2_subdev *sd = |
| 993 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 993 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 994 | NULL, "saa6752hs", | 994 | "saa6752hs", |
| 995 | saa7134_boards[dev->board].empress_addr, NULL); | 995 | saa7134_boards[dev->board].empress_addr, NULL); |
| 996 | 996 | ||
| 997 | if (sd) | 997 | if (sd) |
| @@ -1002,7 +1002,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev, | |||
| 1002 | struct v4l2_subdev *sd; | 1002 | struct v4l2_subdev *sd; |
| 1003 | 1003 | ||
| 1004 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, | 1004 | sd = v4l2_i2c_new_subdev(&dev->v4l2_dev, |
| 1005 | &dev->i2c_adap, NULL, "saa6588", | 1005 | &dev->i2c_adap, "saa6588", |
| 1006 | 0, I2C_ADDRS(saa7134_boards[dev->board].rds_addr)); | 1006 | 0, I2C_ADDRS(saa7134_boards[dev->board].rds_addr)); |
| 1007 | if (sd) { | 1007 | if (sd) { |
| 1008 | printk(KERN_INFO "%s: found RDS decoder\n", dev->name); | 1008 | printk(KERN_INFO "%s: found RDS decoder\n", dev->name); |
diff --git a/drivers/media/video/sh_vou.c b/drivers/media/video/sh_vou.c index 0f4906136b8f..4e5a8cf76ded 100644 --- a/drivers/media/video/sh_vou.c +++ b/drivers/media/video/sh_vou.c | |||
| @@ -1406,7 +1406,7 @@ static int __devinit sh_vou_probe(struct platform_device *pdev) | |||
| 1406 | goto ereset; | 1406 | goto ereset; |
| 1407 | 1407 | ||
| 1408 | subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap, | 1408 | subdev = v4l2_i2c_new_subdev_board(&vou_dev->v4l2_dev, i2c_adap, |
| 1409 | NULL, vou_pdata->board_info, NULL); | 1409 | vou_pdata->board_info, NULL); |
| 1410 | if (!subdev) { | 1410 | if (!subdev) { |
| 1411 | ret = -ENOMEM; | 1411 | ret = -ENOMEM; |
| 1412 | goto ei2cnd; | 1412 | goto ei2cnd; |
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index 43848a751d11..335120c2021b 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
| @@ -896,7 +896,7 @@ static int soc_camera_init_i2c(struct soc_camera_device *icd, | |||
| 896 | icl->board_info->platform_data = icd; | 896 | icl->board_info->platform_data = icd; |
| 897 | 897 | ||
| 898 | subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, | 898 | subdev = v4l2_i2c_new_subdev_board(&ici->v4l2_dev, adap, |
| 899 | NULL, icl->board_info, NULL); | 899 | icl->board_info, NULL); |
| 900 | if (!subdev) | 900 | if (!subdev) |
| 901 | goto ei2cnd; | 901 | goto ei2cnd; |
| 902 | 902 | ||
diff --git a/drivers/media/video/usbvision/usbvision-i2c.c b/drivers/media/video/usbvision/usbvision-i2c.c index e3bbae26e3ce..81dd53bb5267 100644 --- a/drivers/media/video/usbvision/usbvision-i2c.c +++ b/drivers/media/video/usbvision/usbvision-i2c.c | |||
| @@ -251,7 +251,7 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision) | |||
| 251 | hit-and-miss. */ | 251 | hit-and-miss. */ |
| 252 | mdelay(10); | 252 | mdelay(10); |
| 253 | v4l2_i2c_new_subdev(&usbvision->v4l2_dev, | 253 | v4l2_i2c_new_subdev(&usbvision->v4l2_dev, |
| 254 | &usbvision->i2c_adap, NULL, | 254 | &usbvision->i2c_adap, |
| 255 | "saa7115_auto", 0, saa711x_addrs); | 255 | "saa7115_auto", 0, saa711x_addrs); |
| 256 | break; | 256 | break; |
| 257 | } | 257 | } |
| @@ -261,14 +261,14 @@ int usbvision_i2c_register(struct usb_usbvision *usbvision) | |||
| 261 | struct tuner_setup tun_setup; | 261 | struct tuner_setup tun_setup; |
| 262 | 262 | ||
| 263 | sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev, | 263 | sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev, |
| 264 | &usbvision->i2c_adap, NULL, | 264 | &usbvision->i2c_adap, |
| 265 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); | 265 | "tuner", 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD)); |
| 266 | /* depending on whether we found a demod or not, select | 266 | /* depending on whether we found a demod or not, select |
| 267 | the tuner type. */ | 267 | the tuner type. */ |
| 268 | type = sd ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; | 268 | type = sd ? ADDRS_TV_WITH_DEMOD : ADDRS_TV; |
| 269 | 269 | ||
| 270 | sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev, | 270 | sd = v4l2_i2c_new_subdev(&usbvision->v4l2_dev, |
| 271 | &usbvision->i2c_adap, NULL, | 271 | &usbvision->i2c_adap, |
| 272 | "tuner", 0, v4l2_i2c_tuner_addrs(type)); | 272 | "tuner", 0, v4l2_i2c_tuner_addrs(type)); |
| 273 | 273 | ||
| 274 | if (sd == NULL) | 274 | if (sd == NULL) |
diff --git a/drivers/media/video/v4l2-common.c b/drivers/media/video/v4l2-common.c index 9294282b5add..b5eb1f3950b1 100644 --- a/drivers/media/video/v4l2-common.c +++ b/drivers/media/video/v4l2-common.c | |||
| @@ -368,18 +368,15 @@ EXPORT_SYMBOL_GPL(v4l2_i2c_subdev_init); | |||
| 368 | 368 | ||
| 369 | /* Load an i2c sub-device. */ | 369 | /* Load an i2c sub-device. */ |
| 370 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | 370 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, |
| 371 | struct i2c_adapter *adapter, const char *module_name, | 371 | struct i2c_adapter *adapter, struct i2c_board_info *info, |
| 372 | struct i2c_board_info *info, const unsigned short *probe_addrs) | 372 | const unsigned short *probe_addrs) |
| 373 | { | 373 | { |
| 374 | struct v4l2_subdev *sd = NULL; | 374 | struct v4l2_subdev *sd = NULL; |
| 375 | struct i2c_client *client; | 375 | struct i2c_client *client; |
| 376 | 376 | ||
| 377 | BUG_ON(!v4l2_dev); | 377 | BUG_ON(!v4l2_dev); |
| 378 | 378 | ||
| 379 | if (module_name) | 379 | request_module(I2C_MODULE_PREFIX "%s", info->type); |
| 380 | request_module(module_name); | ||
| 381 | else | ||
| 382 | request_module(I2C_MODULE_PREFIX "%s", info->type); | ||
| 383 | 380 | ||
| 384 | /* Create the i2c client */ | 381 | /* Create the i2c client */ |
| 385 | if (info->addr == 0 && probe_addrs) | 382 | if (info->addr == 0 && probe_addrs) |
| @@ -432,8 +429,7 @@ error: | |||
| 432 | EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board); | 429 | EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_board); |
| 433 | 430 | ||
| 434 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | 431 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, |
| 435 | struct i2c_adapter *adapter, | 432 | struct i2c_adapter *adapter, const char *client_type, |
| 436 | const char *module_name, const char *client_type, | ||
| 437 | int irq, void *platform_data, | 433 | int irq, void *platform_data, |
| 438 | u8 addr, const unsigned short *probe_addrs) | 434 | u8 addr, const unsigned short *probe_addrs) |
| 439 | { | 435 | { |
| @@ -447,8 +443,7 @@ struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | |||
| 447 | info.irq = irq; | 443 | info.irq = irq; |
| 448 | info.platform_data = platform_data; | 444 | info.platform_data = platform_data; |
| 449 | 445 | ||
| 450 | return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, module_name, | 446 | return v4l2_i2c_new_subdev_board(v4l2_dev, adapter, &info, probe_addrs); |
| 451 | &info, probe_addrs); | ||
| 452 | } | 447 | } |
| 453 | EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg); | 448 | EXPORT_SYMBOL_GPL(v4l2_i2c_new_subdev_cfg); |
| 454 | 449 | ||
diff --git a/drivers/media/video/via-camera.c b/drivers/media/video/via-camera.c index 02a21bccae18..9eda7cc03121 100644 --- a/drivers/media/video/via-camera.c +++ b/drivers/media/video/via-camera.c | |||
| @@ -1360,7 +1360,7 @@ static __devinit int viacam_probe(struct platform_device *pdev) | |||
| 1360 | */ | 1360 | */ |
| 1361 | sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31); | 1361 | sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31); |
| 1362 | cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, sensor_adapter, | 1362 | cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, sensor_adapter, |
| 1363 | "ov7670", "ov7670", 0x42 >> 1, NULL); | 1363 | "ov7670", 0x42 >> 1, NULL); |
| 1364 | if (cam->sensor == NULL) { | 1364 | if (cam->sensor == NULL) { |
| 1365 | dev_err(&pdev->dev, "Unable to find the sensor!\n"); | 1365 | dev_err(&pdev->dev, "Unable to find the sensor!\n"); |
| 1366 | ret = -ENODEV; | 1366 | ret = -ENODEV; |
diff --git a/drivers/media/video/vino.c b/drivers/media/video/vino.c index e5e005dc1554..7e7eec48f8b1 100644 --- a/drivers/media/video/vino.c +++ b/drivers/media/video/vino.c | |||
| @@ -4334,10 +4334,10 @@ static int __init vino_module_init(void) | |||
| 4334 | 4334 | ||
| 4335 | vino_drvdata->decoder = | 4335 | vino_drvdata->decoder = |
| 4336 | v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter, | 4336 | v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter, |
| 4337 | NULL, "saa7191", 0, I2C_ADDRS(0x45)); | 4337 | "saa7191", 0, I2C_ADDRS(0x45)); |
| 4338 | vino_drvdata->camera = | 4338 | vino_drvdata->camera = |
| 4339 | v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter, | 4339 | v4l2_i2c_new_subdev(&vino_drvdata->v4l2_dev, &vino_i2c_adapter, |
| 4340 | NULL, "indycam", 0, I2C_ADDRS(0x2b)); | 4340 | "indycam", 0, I2C_ADDRS(0x2b)); |
| 4341 | 4341 | ||
| 4342 | dprintk("init complete!\n"); | 4342 | dprintk("init complete!\n"); |
| 4343 | 4343 | ||
diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c index 7e6d62467eaa..e520abf9f4c3 100644 --- a/drivers/media/video/zoran/zoran_card.c +++ b/drivers/media/video/zoran/zoran_card.c | |||
| @@ -1343,13 +1343,12 @@ static int __devinit zoran_probe(struct pci_dev *pdev, | |||
| 1343 | } | 1343 | } |
| 1344 | 1344 | ||
| 1345 | zr->decoder = v4l2_i2c_new_subdev(&zr->v4l2_dev, | 1345 | zr->decoder = v4l2_i2c_new_subdev(&zr->v4l2_dev, |
| 1346 | &zr->i2c_adapter, NULL, zr->card.i2c_decoder, | 1346 | &zr->i2c_adapter, zr->card.i2c_decoder, |
| 1347 | 0, zr->card.addrs_decoder); | 1347 | 0, zr->card.addrs_decoder); |
| 1348 | 1348 | ||
| 1349 | if (zr->card.i2c_encoder) | 1349 | if (zr->card.i2c_encoder) |
| 1350 | zr->encoder = v4l2_i2c_new_subdev(&zr->v4l2_dev, | 1350 | zr->encoder = v4l2_i2c_new_subdev(&zr->v4l2_dev, |
| 1351 | &zr->i2c_adapter, | 1351 | &zr->i2c_adapter, zr->card.i2c_encoder, |
| 1352 | NULL, zr->card.i2c_encoder, | ||
| 1353 | 0, zr->card.addrs_encoder); | 1352 | 0, zr->card.addrs_encoder); |
| 1354 | 1353 | ||
| 1355 | dprintk(2, | 1354 | dprintk(2, |
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index c2960ac9f39c..811775aa8ee8 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
| @@ -482,10 +482,17 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum) | |||
| 482 | uint32_t data = 0; | 482 | uint32_t data = 0; |
| 483 | struct ubi_vid_hdr vid_hdr; | 483 | struct ubi_vid_hdr vid_hdr; |
| 484 | 484 | ||
| 485 | addr = (loff_t)pnum * ubi->peb_size + ubi->vid_hdr_aloffset; | 485 | /* |
| 486 | * It is important to first invalidate the EC header, and then the VID | ||
| 487 | * header. Otherwise a power cut may lead to valid EC header and | ||
| 488 | * invalid VID header, in which case UBI will treat this PEB as | ||
| 489 | * corrupted and will try to preserve it, and print scary warnings (see | ||
| 490 | * the header comment in scan.c for more information). | ||
| 491 | */ | ||
| 492 | addr = (loff_t)pnum * ubi->peb_size; | ||
| 486 | err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data); | 493 | err = ubi->mtd->write(ubi->mtd, addr, 4, &written, (void *)&data); |
| 487 | if (!err) { | 494 | if (!err) { |
| 488 | addr -= ubi->vid_hdr_aloffset; | 495 | addr += ubi->vid_hdr_aloffset; |
| 489 | err = ubi->mtd->write(ubi->mtd, addr, 4, &written, | 496 | err = ubi->mtd->write(ubi->mtd, addr, 4, &written, |
| 490 | (void *)&data); | 497 | (void *)&data); |
| 491 | if (!err) | 498 | if (!err) |
| @@ -494,18 +501,24 @@ static int nor_erase_prepare(struct ubi_device *ubi, int pnum) | |||
| 494 | 501 | ||
| 495 | /* | 502 | /* |
| 496 | * We failed to write to the media. This was observed with Spansion | 503 | * We failed to write to the media. This was observed with Spansion |
| 497 | * S29GL512N NOR flash. Most probably the eraseblock erasure was | 504 | * S29GL512N NOR flash. Most probably the previously eraseblock erasure |
| 498 | * interrupted at a very inappropriate moment, so it became unwritable. | 505 | * was interrupted at a very inappropriate moment, so it became |
| 499 | * In this case we probably anyway have garbage in this PEB. | 506 | * unwritable. In this case we probably anyway have garbage in this |
| 507 | * PEB. | ||
| 500 | */ | 508 | */ |
| 501 | err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); | 509 | err1 = ubi_io_read_vid_hdr(ubi, pnum, &vid_hdr, 0); |
| 502 | if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR) | 510 | if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR) { |
| 503 | /* | 511 | struct ubi_ec_hdr ec_hdr; |
| 504 | * The VID header is corrupted, so we can safely erase this | 512 | |
| 505 | * PEB and not afraid that it will be treated as a valid PEB in | 513 | err1 = ubi_io_read_ec_hdr(ubi, pnum, &ec_hdr, 0); |
| 506 | * case of an unclean reboot. | 514 | if (err1 == UBI_IO_BAD_HDR_EBADMSG || err1 == UBI_IO_BAD_HDR) |
| 507 | */ | 515 | /* |
| 508 | return 0; | 516 | * Both VID and EC headers are corrupted, so we can |
| 517 | * safely erase this PEB and not afraid that it will be | ||
| 518 | * treated as a valid PEB in case of an unclean reboot. | ||
| 519 | */ | ||
| 520 | return 0; | ||
| 521 | } | ||
| 509 | 522 | ||
| 510 | /* | 523 | /* |
| 511 | * The PEB contains a valid VID header, but we cannot invalidate it. | 524 | * The PEB contains a valid VID header, but we cannot invalidate it. |
diff --git a/drivers/mtd/ubi/scan.c b/drivers/mtd/ubi/scan.c index 204345be8e62..79ca304fc4db 100644 --- a/drivers/mtd/ubi/scan.c +++ b/drivers/mtd/ubi/scan.c | |||
| @@ -953,6 +953,10 @@ static int process_eb(struct ubi_device *ubi, struct ubi_scan_info *si, | |||
| 953 | * impossible to distinguish it from a PEB which just | 953 | * impossible to distinguish it from a PEB which just |
| 954 | * contains garbage because of a power cut during erase | 954 | * contains garbage because of a power cut during erase |
| 955 | * operation. So we just schedule this PEB for erasure. | 955 | * operation. So we just schedule this PEB for erasure. |
| 956 | * | ||
| 957 | * Besides, in case of NOR flash, we deliberatly | ||
| 958 | * corrupt both headers because NOR flash erasure is | ||
| 959 | * slow and can start from the end. | ||
| 956 | */ | 960 | */ |
| 957 | err = 0; | 961 | err = 0; |
| 958 | else | 962 | else |
diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index b68eee2414c2..7a7e18ba278a 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c | |||
| @@ -289,6 +289,10 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) | |||
| 289 | MLX4_GET(field, outbox, QUERY_DEV_CAP_LOG_BF_REG_SZ_OFFSET); | 289 | MLX4_GET(field, outbox, QUERY_DEV_CAP_LOG_BF_REG_SZ_OFFSET); |
| 290 | dev_cap->bf_reg_size = 1 << (field & 0x1f); | 290 | dev_cap->bf_reg_size = 1 << (field & 0x1f); |
| 291 | MLX4_GET(field, outbox, QUERY_DEV_CAP_LOG_MAX_BF_REGS_PER_PAGE_OFFSET); | 291 | MLX4_GET(field, outbox, QUERY_DEV_CAP_LOG_MAX_BF_REGS_PER_PAGE_OFFSET); |
| 292 | if ((1 << (field & 0x3f)) > (PAGE_SIZE / dev_cap->bf_reg_size)) { | ||
| 293 | mlx4_warn(dev, "firmware bug: log2 # of blue flame regs is invalid (%d), forcing 3\n", field & 0x1f); | ||
| 294 | field = 3; | ||
| 295 | } | ||
| 292 | dev_cap->bf_regs_per_page = 1 << (field & 0x3f); | 296 | dev_cap->bf_regs_per_page = 1 << (field & 0x3f); |
| 293 | mlx4_dbg(dev, "BlueFlame available (reg size %d, regs/page %d)\n", | 297 | mlx4_dbg(dev, "BlueFlame available (reg size %d, regs/page %d)\n", |
| 294 | dev_cap->bf_reg_size, dev_cap->bf_regs_per_page); | 298 | dev_cap->bf_reg_size, dev_cap->bf_regs_per_page); |
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c index cf05504d9511..24297b274cd4 100644 --- a/drivers/net/wan/x25_asy.c +++ b/drivers/net/wan/x25_asy.c | |||
| @@ -577,7 +577,7 @@ static int x25_asy_open_tty(struct tty_struct *tty) | |||
| 577 | if (err) | 577 | if (err) |
| 578 | return err; | 578 | return err; |
| 579 | /* Done. We have linked the TTY line to a channel. */ | 579 | /* Done. We have linked the TTY line to a channel. */ |
| 580 | return sl->dev->base_addr; | 580 | return 0; |
| 581 | } | 581 | } |
| 582 | 582 | ||
| 583 | 583 | ||
diff --git a/drivers/parisc/dino.c b/drivers/parisc/dino.c index d9f51485beee..9383063d2b16 100644 --- a/drivers/parisc/dino.c +++ b/drivers/parisc/dino.c | |||
| @@ -349,7 +349,6 @@ static struct irq_chip dino_interrupt_type = { | |||
| 349 | .name = "GSC-PCI", | 349 | .name = "GSC-PCI", |
| 350 | .unmask = dino_unmask_irq, | 350 | .unmask = dino_unmask_irq, |
| 351 | .mask = dino_mask_irq, | 351 | .mask = dino_mask_irq, |
| 352 | .ack = no_ack_irq, | ||
| 353 | }; | 352 | }; |
| 354 | 353 | ||
| 355 | 354 | ||
diff --git a/drivers/parisc/eisa.c b/drivers/parisc/eisa.c index 1211974f55aa..e860038b0b84 100644 --- a/drivers/parisc/eisa.c +++ b/drivers/parisc/eisa.c | |||
| @@ -186,7 +186,6 @@ static struct irq_chip eisa_interrupt_type = { | |||
| 186 | .name = "EISA", | 186 | .name = "EISA", |
| 187 | .unmask = eisa_unmask_irq, | 187 | .unmask = eisa_unmask_irq, |
| 188 | .mask = eisa_mask_irq, | 188 | .mask = eisa_mask_irq, |
| 189 | .ack = no_ack_irq, | ||
| 190 | }; | 189 | }; |
| 191 | 190 | ||
| 192 | static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) | 191 | static irqreturn_t eisa_irq(int wax_irq, void *intr_dev) |
| @@ -340,7 +339,7 @@ static int __init eisa_probe(struct parisc_device *dev) | |||
| 340 | setup_irq(2, &irq2_action); | 339 | setup_irq(2, &irq2_action); |
| 341 | for (i = 0; i < 16; i++) { | 340 | for (i = 0; i < 16; i++) { |
| 342 | set_irq_chip_and_handler(i, &eisa_interrupt_type, | 341 | set_irq_chip_and_handler(i, &eisa_interrupt_type, |
| 343 | handle_level_irq); | 342 | handle_simple_irq); |
| 344 | } | 343 | } |
| 345 | 344 | ||
| 346 | EISA_bus = 1; | 345 | EISA_bus = 1; |
diff --git a/drivers/parisc/gsc.c b/drivers/parisc/gsc.c index e605298e3aee..772b1939ac21 100644 --- a/drivers/parisc/gsc.c +++ b/drivers/parisc/gsc.c | |||
| @@ -143,7 +143,6 @@ static struct irq_chip gsc_asic_interrupt_type = { | |||
| 143 | .name = "GSC-ASIC", | 143 | .name = "GSC-ASIC", |
| 144 | .unmask = gsc_asic_unmask_irq, | 144 | .unmask = gsc_asic_unmask_irq, |
| 145 | .mask = gsc_asic_mask_irq, | 145 | .mask = gsc_asic_mask_irq, |
| 146 | .ack = no_ack_irq, | ||
| 147 | }; | 146 | }; |
| 148 | 147 | ||
| 149 | int gsc_assign_irq(struct irq_chip *type, void *data) | 148 | int gsc_assign_irq(struct irq_chip *type, void *data) |
| @@ -153,7 +152,7 @@ int gsc_assign_irq(struct irq_chip *type, void *data) | |||
| 153 | if (irq > GSC_IRQ_MAX) | 152 | if (irq > GSC_IRQ_MAX) |
| 154 | return NO_IRQ; | 153 | return NO_IRQ; |
| 155 | 154 | ||
| 156 | set_irq_chip_and_handler(irq, type, handle_level_irq); | 155 | set_irq_chip_and_handler(irq, type, handle_simple_irq); |
| 157 | set_irq_chip_data(irq, data); | 156 | set_irq_chip_data(irq, data); |
| 158 | 157 | ||
| 159 | return irq++; | 158 | return irq++; |
diff --git a/drivers/parisc/iosapic.c b/drivers/parisc/iosapic.c index a3120a09c43d..0327894bf235 100644 --- a/drivers/parisc/iosapic.c +++ b/drivers/parisc/iosapic.c | |||
| @@ -669,6 +669,13 @@ printk("\n"); | |||
| 669 | DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", irq, | 669 | DBG(KERN_DEBUG "enable_irq(%d): eoi(%p, 0x%x)\n", irq, |
| 670 | vi->eoi_addr, vi->eoi_data); | 670 | vi->eoi_addr, vi->eoi_data); |
| 671 | iosapic_eoi(vi->eoi_addr, vi->eoi_data); | 671 | iosapic_eoi(vi->eoi_addr, vi->eoi_data); |
| 672 | } | ||
| 673 | |||
| 674 | static void iosapic_eoi_irq(unsigned int irq) | ||
| 675 | { | ||
| 676 | struct vector_info *vi = get_irq_chip_data(irq); | ||
| 677 | |||
| 678 | iosapic_eoi(vi->eoi_addr, vi->eoi_data); | ||
| 672 | cpu_eoi_irq(irq); | 679 | cpu_eoi_irq(irq); |
| 673 | } | 680 | } |
| 674 | 681 | ||
| @@ -705,6 +712,7 @@ static struct irq_chip iosapic_interrupt_type = { | |||
| 705 | .unmask = iosapic_unmask_irq, | 712 | .unmask = iosapic_unmask_irq, |
| 706 | .mask = iosapic_mask_irq, | 713 | .mask = iosapic_mask_irq, |
| 707 | .ack = cpu_ack_irq, | 714 | .ack = cpu_ack_irq, |
| 715 | .eoi = iosapic_eoi_irq, | ||
| 708 | #ifdef CONFIG_SMP | 716 | #ifdef CONFIG_SMP |
| 709 | .set_affinity = iosapic_set_affinity_irq, | 717 | .set_affinity = iosapic_set_affinity_irq, |
| 710 | #endif | 718 | #endif |
diff --git a/drivers/parisc/led.c b/drivers/parisc/led.c index 2350e8a86eef..f2f501e5b6a0 100644 --- a/drivers/parisc/led.c +++ b/drivers/parisc/led.c | |||
| @@ -64,6 +64,7 @@ static unsigned int led_diskio __read_mostly = 1; | |||
| 64 | static unsigned int led_lanrxtx __read_mostly = 1; | 64 | static unsigned int led_lanrxtx __read_mostly = 1; |
| 65 | static char lcd_text[32] __read_mostly; | 65 | static char lcd_text[32] __read_mostly; |
| 66 | static char lcd_text_default[32] __read_mostly; | 66 | static char lcd_text_default[32] __read_mostly; |
| 67 | static int lcd_no_led_support __read_mostly = 0; /* KittyHawk doesn't support LED on its LCD */ | ||
| 67 | 68 | ||
| 68 | 69 | ||
| 69 | static struct workqueue_struct *led_wq; | 70 | static struct workqueue_struct *led_wq; |
| @@ -115,7 +116,7 @@ lcd_info __attribute__((aligned(8))) __read_mostly = | |||
| 115 | .lcd_width = 16, | 116 | .lcd_width = 16, |
| 116 | .lcd_cmd_reg_addr = KITTYHAWK_LCD_CMD, | 117 | .lcd_cmd_reg_addr = KITTYHAWK_LCD_CMD, |
| 117 | .lcd_data_reg_addr = KITTYHAWK_LCD_DATA, | 118 | .lcd_data_reg_addr = KITTYHAWK_LCD_DATA, |
| 118 | .min_cmd_delay = 40, | 119 | .min_cmd_delay = 80, |
| 119 | .reset_cmd1 = 0x80, | 120 | .reset_cmd1 = 0x80, |
| 120 | .reset_cmd2 = 0xc0, | 121 | .reset_cmd2 = 0xc0, |
| 121 | }; | 122 | }; |
| @@ -135,6 +136,9 @@ static int start_task(void) | |||
| 135 | /* Display the default text now */ | 136 | /* Display the default text now */ |
| 136 | if (led_type == LED_HASLCD) lcd_print( lcd_text_default ); | 137 | if (led_type == LED_HASLCD) lcd_print( lcd_text_default ); |
| 137 | 138 | ||
| 139 | /* KittyHawk has no LED support on its LCD */ | ||
| 140 | if (lcd_no_led_support) return 0; | ||
| 141 | |||
| 138 | /* Create the work queue and queue the LED task */ | 142 | /* Create the work queue and queue the LED task */ |
| 139 | led_wq = create_singlethread_workqueue("led_wq"); | 143 | led_wq = create_singlethread_workqueue("led_wq"); |
| 140 | queue_delayed_work(led_wq, &led_task, 0); | 144 | queue_delayed_work(led_wq, &led_task, 0); |
| @@ -248,9 +252,13 @@ static int __init led_create_procfs(void) | |||
| 248 | 252 | ||
| 249 | proc_pdc_root = proc_mkdir("pdc", 0); | 253 | proc_pdc_root = proc_mkdir("pdc", 0); |
| 250 | if (!proc_pdc_root) return -1; | 254 | if (!proc_pdc_root) return -1; |
| 251 | ent = proc_create_data("led", S_IRUGO|S_IWUSR, proc_pdc_root, | 255 | |
| 252 | &led_proc_fops, (void *)LED_NOLCD); /* LED */ | 256 | if (!lcd_no_led_support) |
| 253 | if (!ent) return -1; | 257 | { |
| 258 | ent = proc_create_data("led", S_IRUGO|S_IWUSR, proc_pdc_root, | ||
| 259 | &led_proc_fops, (void *)LED_NOLCD); /* LED */ | ||
| 260 | if (!ent) return -1; | ||
| 261 | } | ||
| 254 | 262 | ||
| 255 | if (led_type == LED_HASLCD) | 263 | if (led_type == LED_HASLCD) |
| 256 | { | 264 | { |
| @@ -692,6 +700,7 @@ int __init led_init(void) | |||
| 692 | case 0x58B: /* KittyHawk DC2 100 (K200) */ | 700 | case 0x58B: /* KittyHawk DC2 100 (K200) */ |
| 693 | printk(KERN_INFO "%s: KittyHawk-Machine (hversion 0x%x) found, " | 701 | printk(KERN_INFO "%s: KittyHawk-Machine (hversion 0x%x) found, " |
| 694 | "LED detection skipped.\n", __FILE__, CPU_HVERSION); | 702 | "LED detection skipped.\n", __FILE__, CPU_HVERSION); |
| 703 | lcd_no_led_support = 1; | ||
| 695 | goto found; /* use the preinitialized values of lcd_info */ | 704 | goto found; /* use the preinitialized values of lcd_info */ |
| 696 | } | 705 | } |
| 697 | 706 | ||
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index 0846dafdfff1..28241532c0fd 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c | |||
| @@ -323,7 +323,6 @@ static struct irq_chip superio_interrupt_type = { | |||
| 323 | .name = SUPERIO, | 323 | .name = SUPERIO, |
| 324 | .unmask = superio_unmask_irq, | 324 | .unmask = superio_unmask_irq, |
| 325 | .mask = superio_mask_irq, | 325 | .mask = superio_mask_irq, |
| 326 | .ack = no_ack_irq, | ||
| 327 | }; | 326 | }; |
| 328 | 327 | ||
| 329 | #ifdef DEBUG_SUPERIO_INIT | 328 | #ifdef DEBUG_SUPERIO_INIT |
| @@ -354,7 +353,7 @@ int superio_fixup_irq(struct pci_dev *pcidev) | |||
| 354 | #endif | 353 | #endif |
| 355 | 354 | ||
| 356 | for (i = 0; i < 16; i++) { | 355 | for (i = 0; i < 16; i++) { |
| 357 | set_irq_chip_and_handler(i, &superio_interrupt_type, handle_level_irq); | 356 | set_irq_chip_and_handler(i, &superio_interrupt_type, handle_simple_irq); |
| 358 | } | 357 | } |
| 359 | 358 | ||
| 360 | /* | 359 | /* |
diff --git a/drivers/pcmcia/soc_common.c b/drivers/pcmcia/soc_common.c index 3753fd0722e7..2fe8cb8e95cd 100644 --- a/drivers/pcmcia/soc_common.c +++ b/drivers/pcmcia/soc_common.c | |||
| @@ -70,6 +70,7 @@ void soc_pcmcia_debug(struct soc_pcmcia_socket *skt, const char *func, | |||
| 70 | va_end(args); | 70 | va_end(args); |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | EXPORT_SYMBOL(soc_pcmcia_debug); | ||
| 73 | 74 | ||
| 74 | #endif | 75 | #endif |
| 75 | 76 | ||
diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c index 60a5a5c6b50a..d235f44fd7a3 100644 --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c | |||
| @@ -81,6 +81,8 @@ MODULE_PARM_DESC(wapf, "WAPF value"); | |||
| 81 | 81 | ||
| 82 | static int wlan_status = 1; | 82 | static int wlan_status = 1; |
| 83 | static int bluetooth_status = 1; | 83 | static int bluetooth_status = 1; |
| 84 | static int wimax_status = -1; | ||
| 85 | static int wwan_status = -1; | ||
| 84 | 86 | ||
| 85 | module_param(wlan_status, int, 0444); | 87 | module_param(wlan_status, int, 0444); |
| 86 | MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot " | 88 | MODULE_PARM_DESC(wlan_status, "Set the wireless status on boot " |
| @@ -92,6 +94,16 @@ MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | |||
| 92 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | 94 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " |
| 93 | "default is 1"); | 95 | "default is 1"); |
| 94 | 96 | ||
| 97 | module_param(wimax_status, int, 0444); | ||
| 98 | MODULE_PARM_DESC(wimax_status, "Set the wireless status on boot " | ||
| 99 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | ||
| 100 | "default is 1"); | ||
| 101 | |||
| 102 | module_param(wwan_status, int, 0444); | ||
| 103 | MODULE_PARM_DESC(wwan_status, "Set the wireless status on boot " | ||
| 104 | "(0 = disabled, 1 = enabled, -1 = don't do anything). " | ||
| 105 | "default is 1"); | ||
| 106 | |||
| 95 | /* | 107 | /* |
| 96 | * Some events we use, same for all Asus | 108 | * Some events we use, same for all Asus |
| 97 | */ | 109 | */ |
| @@ -114,6 +126,8 @@ MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | |||
| 114 | */ | 126 | */ |
| 115 | #define WL_RSTS 0x01 /* internal Wifi */ | 127 | #define WL_RSTS 0x01 /* internal Wifi */ |
| 116 | #define BT_RSTS 0x02 /* internal Bluetooth */ | 128 | #define BT_RSTS 0x02 /* internal Bluetooth */ |
| 129 | #define WM_RSTS 0x08 /* internal wimax */ | ||
| 130 | #define WW_RSTS 0x20 /* internal wwan */ | ||
| 117 | 131 | ||
| 118 | /* LED */ | 132 | /* LED */ |
| 119 | #define METHOD_MLED "MLED" | 133 | #define METHOD_MLED "MLED" |
| @@ -132,6 +146,11 @@ MODULE_PARM_DESC(bluetooth_status, "Set the wireless status on boot " | |||
| 132 | */ | 146 | */ |
| 133 | #define METHOD_WLAN "WLED" | 147 | #define METHOD_WLAN "WLED" |
| 134 | #define METHOD_BLUETOOTH "BLED" | 148 | #define METHOD_BLUETOOTH "BLED" |
| 149 | |||
| 150 | /* WWAN and WIMAX */ | ||
| 151 | #define METHOD_WWAN "GSMC" | ||
| 152 | #define METHOD_WIMAX "WMXC" | ||
| 153 | |||
| 135 | #define METHOD_WL_STATUS "RSTS" | 154 | #define METHOD_WL_STATUS "RSTS" |
| 136 | 155 | ||
| 137 | /* Brightness */ | 156 | /* Brightness */ |
| @@ -883,6 +902,64 @@ static ssize_t store_bluetooth(struct device *dev, | |||
| 883 | } | 902 | } |
| 884 | 903 | ||
| 885 | /* | 904 | /* |
| 905 | * Wimax | ||
| 906 | */ | ||
| 907 | static int asus_wimax_set(struct asus_laptop *asus, int status) | ||
| 908 | { | ||
| 909 | if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) { | ||
| 910 | pr_warning("Error setting wimax status to %d", status); | ||
| 911 | return -EIO; | ||
| 912 | } | ||
| 913 | return 0; | ||
| 914 | } | ||
| 915 | |||
| 916 | static ssize_t show_wimax(struct device *dev, | ||
| 917 | struct device_attribute *attr, char *buf) | ||
| 918 | { | ||
| 919 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
| 920 | |||
| 921 | return sprintf(buf, "%d\n", asus_wireless_status(asus, WM_RSTS)); | ||
| 922 | } | ||
| 923 | |||
| 924 | static ssize_t store_wimax(struct device *dev, | ||
| 925 | struct device_attribute *attr, const char *buf, | ||
| 926 | size_t count) | ||
| 927 | { | ||
| 928 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
| 929 | |||
| 930 | return sysfs_acpi_set(asus, buf, count, METHOD_WIMAX); | ||
| 931 | } | ||
| 932 | |||
| 933 | /* | ||
| 934 | * Wwan | ||
| 935 | */ | ||
| 936 | static int asus_wwan_set(struct asus_laptop *asus, int status) | ||
| 937 | { | ||
| 938 | if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) { | ||
| 939 | pr_warning("Error setting wwan status to %d", status); | ||
| 940 | return -EIO; | ||
| 941 | } | ||
| 942 | return 0; | ||
| 943 | } | ||
| 944 | |||
| 945 | static ssize_t show_wwan(struct device *dev, | ||
| 946 | struct device_attribute *attr, char *buf) | ||
| 947 | { | ||
| 948 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
| 949 | |||
| 950 | return sprintf(buf, "%d\n", asus_wireless_status(asus, WW_RSTS)); | ||
| 951 | } | ||
| 952 | |||
| 953 | static ssize_t store_wwan(struct device *dev, | ||
| 954 | struct device_attribute *attr, const char *buf, | ||
| 955 | size_t count) | ||
| 956 | { | ||
| 957 | struct asus_laptop *asus = dev_get_drvdata(dev); | ||
| 958 | |||
| 959 | return sysfs_acpi_set(asus, buf, count, METHOD_WWAN); | ||
| 960 | } | ||
| 961 | |||
| 962 | /* | ||
| 886 | * Display | 963 | * Display |
| 887 | */ | 964 | */ |
| 888 | static void asus_set_display(struct asus_laptop *asus, int value) | 965 | static void asus_set_display(struct asus_laptop *asus, int value) |
| @@ -1202,6 +1279,8 @@ static DEVICE_ATTR(infos, S_IRUGO, show_infos, NULL); | |||
| 1202 | static DEVICE_ATTR(wlan, S_IRUGO | S_IWUSR, show_wlan, store_wlan); | 1279 | static DEVICE_ATTR(wlan, S_IRUGO | S_IWUSR, show_wlan, store_wlan); |
| 1203 | static DEVICE_ATTR(bluetooth, S_IRUGO | S_IWUSR, | 1280 | static DEVICE_ATTR(bluetooth, S_IRUGO | S_IWUSR, |
| 1204 | show_bluetooth, store_bluetooth); | 1281 | show_bluetooth, store_bluetooth); |
| 1282 | static DEVICE_ATTR(wimax, S_IRUGO | S_IWUSR, show_wimax, store_wimax); | ||
| 1283 | static DEVICE_ATTR(wwan, S_IRUGO | S_IWUSR, show_wwan, store_wwan); | ||
| 1205 | static DEVICE_ATTR(display, S_IRUGO | S_IWUSR, show_disp, store_disp); | 1284 | static DEVICE_ATTR(display, S_IRUGO | S_IWUSR, show_disp, store_disp); |
| 1206 | static DEVICE_ATTR(ledd, S_IRUGO | S_IWUSR, show_ledd, store_ledd); | 1285 | static DEVICE_ATTR(ledd, S_IRUGO | S_IWUSR, show_ledd, store_ledd); |
| 1207 | static DEVICE_ATTR(ls_level, S_IRUGO | S_IWUSR, show_lslvl, store_lslvl); | 1286 | static DEVICE_ATTR(ls_level, S_IRUGO | S_IWUSR, show_lslvl, store_lslvl); |
| @@ -1212,6 +1291,8 @@ static struct attribute *asus_attributes[] = { | |||
| 1212 | &dev_attr_infos.attr, | 1291 | &dev_attr_infos.attr, |
| 1213 | &dev_attr_wlan.attr, | 1292 | &dev_attr_wlan.attr, |
| 1214 | &dev_attr_bluetooth.attr, | 1293 | &dev_attr_bluetooth.attr, |
| 1294 | &dev_attr_wimax.attr, | ||
| 1295 | &dev_attr_wwan.attr, | ||
| 1215 | &dev_attr_display.attr, | 1296 | &dev_attr_display.attr, |
| 1216 | &dev_attr_ledd.attr, | 1297 | &dev_attr_ledd.attr, |
| 1217 | &dev_attr_ls_level.attr, | 1298 | &dev_attr_ls_level.attr, |
| @@ -1239,6 +1320,13 @@ static mode_t asus_sysfs_is_visible(struct kobject *kobj, | |||
| 1239 | } else if (attr == &dev_attr_display.attr) { | 1320 | } else if (attr == &dev_attr_display.attr) { |
| 1240 | supported = !acpi_check_handle(handle, METHOD_SWITCH_DISPLAY, NULL); | 1321 | supported = !acpi_check_handle(handle, METHOD_SWITCH_DISPLAY, NULL); |
| 1241 | 1322 | ||
| 1323 | } else if (attr == &dev_attr_wimax.attr) { | ||
| 1324 | supported = | ||
| 1325 | !acpi_check_handle(asus->handle, METHOD_WIMAX, NULL); | ||
| 1326 | |||
| 1327 | } else if (attr == &dev_attr_wwan.attr) { | ||
| 1328 | supported = !acpi_check_handle(asus->handle, METHOD_WWAN, NULL); | ||
| 1329 | |||
| 1242 | } else if (attr == &dev_attr_ledd.attr) { | 1330 | } else if (attr == &dev_attr_ledd.attr) { |
| 1243 | supported = !acpi_check_handle(handle, METHOD_LEDD, NULL); | 1331 | supported = !acpi_check_handle(handle, METHOD_LEDD, NULL); |
| 1244 | 1332 | ||
| @@ -1397,7 +1485,8 @@ static int asus_laptop_get_info(struct asus_laptop *asus) | |||
| 1397 | 1485 | ||
| 1398 | /* | 1486 | /* |
| 1399 | * The HWRS method return informations about the hardware. | 1487 | * The HWRS method return informations about the hardware. |
| 1400 | * 0x80 bit is for WLAN, 0x100 for Bluetooth. | 1488 | * 0x80 bit is for WLAN, 0x100 for Bluetooth, |
| 1489 | * 0x40 for WWAN, 0x10 for WIMAX. | ||
| 1401 | * The significance of others is yet to be found. | 1490 | * The significance of others is yet to be found. |
| 1402 | */ | 1491 | */ |
| 1403 | status = | 1492 | status = |
| @@ -1440,6 +1529,12 @@ static int __devinit asus_acpi_init(struct asus_laptop *asus) | |||
| 1440 | if (wlan_status >= 0) | 1529 | if (wlan_status >= 0) |
| 1441 | asus_wlan_set(asus, !!wlan_status); | 1530 | asus_wlan_set(asus, !!wlan_status); |
| 1442 | 1531 | ||
| 1532 | if (wimax_status >= 0) | ||
| 1533 | asus_wimax_set(asus, !!wimax_status); | ||
| 1534 | |||
| 1535 | if (wwan_status >= 0) | ||
| 1536 | asus_wwan_set(asus, !!wwan_status); | ||
| 1537 | |||
| 1443 | /* Keyboard Backlight is on by default */ | 1538 | /* Keyboard Backlight is on by default */ |
| 1444 | if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL)) | 1539 | if (!acpi_check_handle(asus->handle, METHOD_KBD_LIGHT_SET, NULL)) |
| 1445 | asus_kled_set(asus, 1); | 1540 | asus_kled_set(asus, 1); |
diff --git a/drivers/platform/x86/eeepc-wmi.c b/drivers/platform/x86/eeepc-wmi.c index 462ceab93f87..0d50fbbe2478 100644 --- a/drivers/platform/x86/eeepc-wmi.c +++ b/drivers/platform/x86/eeepc-wmi.c | |||
| @@ -298,8 +298,8 @@ static void eeepc_wmi_notify(u32 value, void *context) | |||
| 298 | kfree(obj); | 298 | kfree(obj); |
| 299 | } | 299 | } |
| 300 | 300 | ||
| 301 | static int store_cpufv(struct device *dev, struct device_attribute *attr, | 301 | static ssize_t store_cpufv(struct device *dev, struct device_attribute *attr, |
| 302 | const char *buf, size_t count) | 302 | const char *buf, size_t count) |
| 303 | { | 303 | { |
| 304 | int value; | 304 | int value; |
| 305 | struct acpi_buffer input = { (acpi_size)sizeof(value), &value }; | 305 | struct acpi_buffer input = { (acpi_size)sizeof(value), &value }; |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 1dac659b5e0c..9e05af9c41cb 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
| @@ -172,6 +172,8 @@ static int hp_wmi_perform_query(int query, int write, u32 *buffer, | |||
| 172 | bios_return = *((struct bios_return *)obj->buffer.pointer); | 172 | bios_return = *((struct bios_return *)obj->buffer.pointer); |
| 173 | 173 | ||
| 174 | memcpy(buffer, &bios_return.value, sizeof(bios_return.value)); | 174 | memcpy(buffer, &bios_return.value, sizeof(bios_return.value)); |
| 175 | |||
| 176 | kfree(obj); | ||
| 175 | return 0; | 177 | return 0; |
| 176 | } | 178 | } |
| 177 | 179 | ||
diff --git a/drivers/platform/x86/ibm_rtl.c b/drivers/platform/x86/ibm_rtl.c index 3c2c6b91ecb3..94a114aa8e28 100644 --- a/drivers/platform/x86/ibm_rtl.c +++ b/drivers/platform/x86/ibm_rtl.c | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/io.h> | 28 | #include <linux/io.h> |
| 29 | #include <linux/sysdev.h> | 29 | #include <linux/sysdev.h> |
| 30 | #include <linux/dmi.h> | 30 | #include <linux/dmi.h> |
| 31 | #include <linux/efi.h> | ||
| 31 | #include <linux/mutex.h> | 32 | #include <linux/mutex.h> |
| 32 | #include <asm/bios_ebda.h> | 33 | #include <asm/bios_ebda.h> |
| 33 | 34 | ||
| @@ -220,32 +221,13 @@ static void rtl_teardown_sysfs(void) { | |||
| 220 | sysdev_class_unregister(&class_rtl); | 221 | sysdev_class_unregister(&class_rtl); |
| 221 | } | 222 | } |
| 222 | 223 | ||
| 223 | static int dmi_check_cb(const struct dmi_system_id *id) | ||
| 224 | { | ||
| 225 | RTL_DEBUG("found IBM server '%s'\n", id->ident); | ||
| 226 | return 0; | ||
| 227 | } | ||
| 228 | |||
| 229 | #define ibm_dmi_entry(NAME, TYPE) \ | ||
| 230 | { \ | ||
| 231 | .ident = NAME, \ | ||
| 232 | .matches = { \ | ||
| 233 | DMI_MATCH(DMI_SYS_VENDOR, "IBM"), \ | ||
| 234 | DMI_MATCH(DMI_PRODUCT_NAME, TYPE), \ | ||
| 235 | }, \ | ||
| 236 | .callback = dmi_check_cb \ | ||
| 237 | } | ||
| 238 | 224 | ||
| 239 | static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = { | 225 | static struct dmi_system_id __initdata ibm_rtl_dmi_table[] = { |
| 240 | ibm_dmi_entry("BladeCenter LS21", "7971"), | 226 | { \ |
| 241 | ibm_dmi_entry("BladeCenter LS22", "7901"), | 227 | .matches = { \ |
| 242 | ibm_dmi_entry("BladeCenter HS21 XM", "7995"), | 228 | DMI_MATCH(DMI_SYS_VENDOR, "IBM"), \ |
| 243 | ibm_dmi_entry("BladeCenter HS22", "7870"), | 229 | }, \ |
| 244 | ibm_dmi_entry("BladeCenter HS22V", "7871"), | 230 | }, |
| 245 | ibm_dmi_entry("System x3550 M2", "7946"), | ||
| 246 | ibm_dmi_entry("System x3650 M2", "7947"), | ||
| 247 | ibm_dmi_entry("System x3550 M3", "7944"), | ||
| 248 | ibm_dmi_entry("System x3650 M3", "7945"), | ||
| 249 | { } | 231 | { } |
| 250 | }; | 232 | }; |
| 251 | 233 | ||
| @@ -257,7 +239,7 @@ static int __init ibm_rtl_init(void) { | |||
| 257 | if (force) | 239 | if (force) |
| 258 | pr_warning("ibm-rtl: module loaded by force\n"); | 240 | pr_warning("ibm-rtl: module loaded by force\n"); |
| 259 | /* first ensure that we are running on IBM HW */ | 241 | /* first ensure that we are running on IBM HW */ |
| 260 | else if (!dmi_check_system(ibm_rtl_dmi_table)) | 242 | else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table)) |
| 261 | return -ENODEV; | 243 | return -ENODEV; |
| 262 | 244 | ||
| 263 | /* Get the address for the Extended BIOS Data Area */ | 245 | /* Get the address for the Extended BIOS Data Area */ |
| @@ -302,7 +284,7 @@ static int __init ibm_rtl_init(void) { | |||
| 302 | RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n", | 284 | RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n", |
| 303 | rtl_cmd_width, rtl_cmd_type); | 285 | rtl_cmd_width, rtl_cmd_type); |
| 304 | addr = ioread32(&rtl_table->cmd_port_address); | 286 | addr = ioread32(&rtl_table->cmd_port_address); |
| 305 | RTL_DEBUG("addr = %#llx\n", addr); | 287 | RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr); |
| 306 | plen = rtl_cmd_width/sizeof(char); | 288 | plen = rtl_cmd_width/sizeof(char); |
| 307 | rtl_cmd_addr = rtl_port_map(addr, plen); | 289 | rtl_cmd_addr = rtl_port_map(addr, plen); |
| 308 | RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr); | 290 | RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr); |
diff --git a/drivers/platform/x86/msi-wmi.c b/drivers/platform/x86/msi-wmi.c index 42a5469a2459..35278ad7e628 100644 --- a/drivers/platform/x86/msi-wmi.c +++ b/drivers/platform/x86/msi-wmi.c | |||
| @@ -43,16 +43,18 @@ MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"); | |||
| 43 | 43 | ||
| 44 | #define dprintk(msg...) pr_debug(DRV_PFX msg) | 44 | #define dprintk(msg...) pr_debug(DRV_PFX msg) |
| 45 | 45 | ||
| 46 | #define KEYCODE_BASE 0xD0 | 46 | #define SCANCODE_BASE 0xD0 |
| 47 | #define MSI_WMI_BRIGHTNESSUP KEYCODE_BASE | 47 | #define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE |
| 48 | #define MSI_WMI_BRIGHTNESSDOWN (KEYCODE_BASE + 1) | 48 | #define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1) |
| 49 | #define MSI_WMI_VOLUMEUP (KEYCODE_BASE + 2) | 49 | #define MSI_WMI_VOLUMEUP (SCANCODE_BASE + 2) |
| 50 | #define MSI_WMI_VOLUMEDOWN (KEYCODE_BASE + 3) | 50 | #define MSI_WMI_VOLUMEDOWN (SCANCODE_BASE + 3) |
| 51 | #define MSI_WMI_MUTE (SCANCODE_BASE + 4) | ||
| 51 | static struct key_entry msi_wmi_keymap[] = { | 52 | static struct key_entry msi_wmi_keymap[] = { |
| 52 | { KE_KEY, MSI_WMI_BRIGHTNESSUP, {KEY_BRIGHTNESSUP} }, | 53 | { KE_KEY, MSI_WMI_BRIGHTNESSUP, {KEY_BRIGHTNESSUP} }, |
| 53 | { KE_KEY, MSI_WMI_BRIGHTNESSDOWN, {KEY_BRIGHTNESSDOWN} }, | 54 | { KE_KEY, MSI_WMI_BRIGHTNESSDOWN, {KEY_BRIGHTNESSDOWN} }, |
| 54 | { KE_KEY, MSI_WMI_VOLUMEUP, {KEY_VOLUMEUP} }, | 55 | { KE_KEY, MSI_WMI_VOLUMEUP, {KEY_VOLUMEUP} }, |
| 55 | { KE_KEY, MSI_WMI_VOLUMEDOWN, {KEY_VOLUMEDOWN} }, | 56 | { KE_KEY, MSI_WMI_VOLUMEDOWN, {KEY_VOLUMEDOWN} }, |
| 57 | { KE_KEY, MSI_WMI_MUTE, {KEY_MUTE} }, | ||
| 56 | { KE_END, 0} | 58 | { KE_END, 0} |
| 57 | }; | 59 | }; |
| 58 | static ktime_t last_pressed[ARRAY_SIZE(msi_wmi_keymap) - 1]; | 60 | static ktime_t last_pressed[ARRAY_SIZE(msi_wmi_keymap) - 1]; |
| @@ -169,7 +171,7 @@ static void msi_wmi_notify(u32 value, void *context) | |||
| 169 | ktime_t diff; | 171 | ktime_t diff; |
| 170 | cur = ktime_get_real(); | 172 | cur = ktime_get_real(); |
| 171 | diff = ktime_sub(cur, last_pressed[key->code - | 173 | diff = ktime_sub(cur, last_pressed[key->code - |
| 172 | KEYCODE_BASE]); | 174 | SCANCODE_BASE]); |
| 173 | /* Ignore event if the same event happened in a 50 ms | 175 | /* Ignore event if the same event happened in a 50 ms |
| 174 | timeframe -> Key press may result in 10-20 GPEs */ | 176 | timeframe -> Key press may result in 10-20 GPEs */ |
| 175 | if (ktime_to_us(diff) < 1000 * 50) { | 177 | if (ktime_to_us(diff) < 1000 * 50) { |
| @@ -178,7 +180,7 @@ static void msi_wmi_notify(u32 value, void *context) | |||
| 178 | key->code, ktime_to_us(diff)); | 180 | key->code, ktime_to_us(diff)); |
| 179 | return; | 181 | return; |
| 180 | } | 182 | } |
| 181 | last_pressed[key->code - KEYCODE_BASE] = cur; | 183 | last_pressed[key->code - SCANCODE_BASE] = cur; |
| 182 | 184 | ||
| 183 | if (key->type == KE_KEY && | 185 | if (key->type == KE_KEY && |
| 184 | /* Brightness is served via acpi video driver */ | 186 | /* Brightness is served via acpi video driver */ |
diff --git a/drivers/platform/x86/thinkpad_acpi.c b/drivers/platform/x86/thinkpad_acpi.c index 2d61186ad5a2..e8c21994b36d 100644 --- a/drivers/platform/x86/thinkpad_acpi.c +++ b/drivers/platform/x86/thinkpad_acpi.c | |||
| @@ -8497,7 +8497,6 @@ static void ibm_exit(struct ibm_struct *ibm) | |||
| 8497 | ibm->acpi->type, | 8497 | ibm->acpi->type, |
| 8498 | dispatch_acpi_notify); | 8498 | dispatch_acpi_notify); |
| 8499 | ibm->flags.acpi_notify_installed = 0; | 8499 | ibm->flags.acpi_notify_installed = 0; |
| 8500 | ibm->flags.acpi_notify_installed = 0; | ||
| 8501 | } | 8500 | } |
| 8502 | 8501 | ||
| 8503 | if (ibm->flags.proc_created) { | 8502 | if (ibm->flags.proc_created) { |
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 06f304f46e02..4276da7291b8 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
| @@ -135,6 +135,7 @@ static const struct key_entry toshiba_acpi_keymap[] __initconst = { | |||
| 135 | { KE_KEY, 0x141, { KEY_BRIGHTNESSUP } }, | 135 | { KE_KEY, 0x141, { KEY_BRIGHTNESSUP } }, |
| 136 | { KE_KEY, 0x142, { KEY_WLAN } }, | 136 | { KE_KEY, 0x142, { KEY_WLAN } }, |
| 137 | { KE_KEY, 0x143, { KEY_PROG1 } }, | 137 | { KE_KEY, 0x143, { KEY_PROG1 } }, |
| 138 | { KE_KEY, 0x17f, { KEY_FN } }, | ||
| 138 | { KE_KEY, 0xb05, { KEY_PROG2 } }, | 139 | { KE_KEY, 0xb05, { KEY_PROG2 } }, |
| 139 | { KE_KEY, 0xb06, { KEY_WWW } }, | 140 | { KE_KEY, 0xb06, { KEY_WWW } }, |
| 140 | { KE_KEY, 0xb07, { KEY_MAIL } }, | 141 | { KE_KEY, 0xb07, { KEY_MAIL } }, |
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index 104b77c87ef5..aecd9a9b549f 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
| @@ -755,7 +755,7 @@ static bool guid_already_parsed(const char *guid_string) | |||
| 755 | struct wmi_block *wblock; | 755 | struct wmi_block *wblock; |
| 756 | 756 | ||
| 757 | list_for_each_entry(wblock, &wmi_block_list, list) | 757 | list_for_each_entry(wblock, &wmi_block_list, list) |
| 758 | if (strncmp(wblock->gblock.guid, guid_string, 16) == 0) | 758 | if (memcmp(wblock->gblock.guid, guid_string, 16) == 0) |
| 759 | return true; | 759 | return true; |
| 760 | 760 | ||
| 761 | return false; | 761 | return false; |
diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c index 2d73dfcecdbb..57313f4658bc 100644 --- a/drivers/pnp/pnpacpi/core.c +++ b/drivers/pnp/pnpacpi/core.c | |||
| @@ -180,7 +180,7 @@ struct pnp_protocol pnpacpi_protocol = { | |||
| 180 | }; | 180 | }; |
| 181 | EXPORT_SYMBOL(pnpacpi_protocol); | 181 | EXPORT_SYMBOL(pnpacpi_protocol); |
| 182 | 182 | ||
| 183 | static char *pnpacpi_get_id(struct acpi_device *device) | 183 | static char *__init pnpacpi_get_id(struct acpi_device *device) |
| 184 | { | 184 | { |
| 185 | struct acpi_hardware_id *id; | 185 | struct acpi_hardware_id *id; |
| 186 | 186 | ||
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index f1d10c974cd4..ba521f0f0fac 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
| @@ -911,7 +911,7 @@ out: | |||
| 911 | } | 911 | } |
| 912 | 912 | ||
| 913 | /** | 913 | /** |
| 914 | * set_consumer_device_supply: Bind a regulator to a symbolic supply | 914 | * set_consumer_device_supply - Bind a regulator to a symbolic supply |
| 915 | * @rdev: regulator source | 915 | * @rdev: regulator source |
| 916 | * @consumer_dev: device the supply applies to | 916 | * @consumer_dev: device the supply applies to |
| 917 | * @consumer_dev_name: dev_name() string for device supply applies to | 917 | * @consumer_dev_name: dev_name() string for device supply applies to |
| @@ -1052,7 +1052,6 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, | |||
| 1052 | printk(KERN_WARNING | 1052 | printk(KERN_WARNING |
| 1053 | "%s: could not add device link %s err %d\n", | 1053 | "%s: could not add device link %s err %d\n", |
| 1054 | __func__, dev->kobj.name, err); | 1054 | __func__, dev->kobj.name, err); |
| 1055 | device_remove_file(dev, ®ulator->dev_attr); | ||
| 1056 | goto link_name_err; | 1055 | goto link_name_err; |
| 1057 | } | 1056 | } |
| 1058 | } | 1057 | } |
| @@ -1268,13 +1267,17 @@ static int _regulator_enable(struct regulator_dev *rdev) | |||
| 1268 | { | 1267 | { |
| 1269 | int ret, delay; | 1268 | int ret, delay; |
| 1270 | 1269 | ||
| 1271 | /* do we need to enable the supply regulator first */ | 1270 | if (rdev->use_count == 0) { |
| 1272 | if (rdev->supply) { | 1271 | /* do we need to enable the supply regulator first */ |
| 1273 | ret = _regulator_enable(rdev->supply); | 1272 | if (rdev->supply) { |
| 1274 | if (ret < 0) { | 1273 | mutex_lock(&rdev->supply->mutex); |
| 1275 | printk(KERN_ERR "%s: failed to enable %s: %d\n", | 1274 | ret = _regulator_enable(rdev->supply); |
| 1276 | __func__, rdev_get_name(rdev), ret); | 1275 | mutex_unlock(&rdev->supply->mutex); |
| 1277 | return ret; | 1276 | if (ret < 0) { |
| 1277 | printk(KERN_ERR "%s: failed to enable %s: %d\n", | ||
| 1278 | __func__, rdev_get_name(rdev), ret); | ||
| 1279 | return ret; | ||
| 1280 | } | ||
| 1278 | } | 1281 | } |
| 1279 | } | 1282 | } |
| 1280 | 1283 | ||
| @@ -1313,10 +1316,12 @@ static int _regulator_enable(struct regulator_dev *rdev) | |||
| 1313 | if (ret < 0) | 1316 | if (ret < 0) |
| 1314 | return ret; | 1317 | return ret; |
| 1315 | 1318 | ||
| 1316 | if (delay >= 1000) | 1319 | if (delay >= 1000) { |
| 1317 | mdelay(delay / 1000); | 1320 | mdelay(delay / 1000); |
| 1318 | else if (delay) | 1321 | udelay(delay % 1000); |
| 1322 | } else if (delay) { | ||
| 1319 | udelay(delay); | 1323 | udelay(delay); |
| 1324 | } | ||
| 1320 | 1325 | ||
| 1321 | } else if (ret < 0) { | 1326 | } else if (ret < 0) { |
| 1322 | printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n", | 1327 | printk(KERN_ERR "%s: is_enabled() failed for %s: %d\n", |
| @@ -1359,6 +1364,7 @@ static int _regulator_disable(struct regulator_dev *rdev, | |||
| 1359 | struct regulator_dev **supply_rdev_ptr) | 1364 | struct regulator_dev **supply_rdev_ptr) |
| 1360 | { | 1365 | { |
| 1361 | int ret = 0; | 1366 | int ret = 0; |
| 1367 | *supply_rdev_ptr = NULL; | ||
| 1362 | 1368 | ||
| 1363 | if (WARN(rdev->use_count <= 0, | 1369 | if (WARN(rdev->use_count <= 0, |
| 1364 | "unbalanced disables for %s\n", | 1370 | "unbalanced disables for %s\n", |
| @@ -2346,6 +2352,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | |||
| 2346 | if (init_data->supply_regulator && init_data->supply_regulator_dev) { | 2352 | if (init_data->supply_regulator && init_data->supply_regulator_dev) { |
| 2347 | dev_err(dev, | 2353 | dev_err(dev, |
| 2348 | "Supply regulator specified by both name and dev\n"); | 2354 | "Supply regulator specified by both name and dev\n"); |
| 2355 | ret = -EINVAL; | ||
| 2349 | goto scrub; | 2356 | goto scrub; |
| 2350 | } | 2357 | } |
| 2351 | 2358 | ||
| @@ -2364,6 +2371,7 @@ struct regulator_dev *regulator_register(struct regulator_desc *regulator_desc, | |||
| 2364 | if (!found) { | 2371 | if (!found) { |
| 2365 | dev_err(dev, "Failed to find supply %s\n", | 2372 | dev_err(dev, "Failed to find supply %s\n", |
| 2366 | init_data->supply_regulator); | 2373 | init_data->supply_regulator); |
| 2374 | ret = -ENODEV; | ||
| 2367 | goto scrub; | 2375 | goto scrub; |
| 2368 | } | 2376 | } |
| 2369 | 2377 | ||
diff --git a/drivers/regulator/mc13783-regulator.c b/drivers/regulator/mc13783-regulator.c index 4597d508a229..ecd99f59dba8 100644 --- a/drivers/regulator/mc13783-regulator.c +++ b/drivers/regulator/mc13783-regulator.c | |||
| @@ -465,8 +465,8 @@ static struct regulator_ops mc13783_fixed_regulator_ops = { | |||
| 465 | .get_voltage = mc13783_fixed_regulator_get_voltage, | 465 | .get_voltage = mc13783_fixed_regulator_get_voltage, |
| 466 | }; | 466 | }; |
| 467 | 467 | ||
| 468 | int mc13783_powermisc_rmw(struct mc13783_regulator_priv *priv, u32 mask, | 468 | static int mc13783_powermisc_rmw(struct mc13783_regulator_priv *priv, u32 mask, |
| 469 | u32 val) | 469 | u32 val) |
| 470 | { | 470 | { |
| 471 | struct mc13783 *mc13783 = priv->mc13783; | 471 | struct mc13783 *mc13783 = priv->mc13783; |
| 472 | int ret; | 472 | int ret; |
diff --git a/drivers/regulator/tps6586x-regulator.c b/drivers/regulator/tps6586x-regulator.c index 51237fbb1bbb..6d20b0454a1d 100644 --- a/drivers/regulator/tps6586x-regulator.c +++ b/drivers/regulator/tps6586x-regulator.c | |||
| @@ -231,8 +231,7 @@ static int tps6586x_dvm_voltages[] = { | |||
| 231 | }; | 231 | }; |
| 232 | 232 | ||
| 233 | #define TPS6586X_REGULATOR(_id, vdata, _ops, vreg, shift, nbits, \ | 233 | #define TPS6586X_REGULATOR(_id, vdata, _ops, vreg, shift, nbits, \ |
| 234 | ereg0, ebit0, ereg1, ebit1, goreg, gobit) \ | 234 | ereg0, ebit0, ereg1, ebit1) \ |
| 235 | { \ | ||
| 236 | .desc = { \ | 235 | .desc = { \ |
| 237 | .name = "REG-" #_id, \ | 236 | .name = "REG-" #_id, \ |
| 238 | .ops = &tps6586x_regulator_##_ops, \ | 237 | .ops = &tps6586x_regulator_##_ops, \ |
| @@ -248,18 +247,26 @@ static int tps6586x_dvm_voltages[] = { | |||
| 248 | .enable_bit[0] = (ebit0), \ | 247 | .enable_bit[0] = (ebit0), \ |
| 249 | .enable_reg[1] = TPS6586X_SUPPLY##ereg1, \ | 248 | .enable_reg[1] = TPS6586X_SUPPLY##ereg1, \ |
| 250 | .enable_bit[1] = (ebit1), \ | 249 | .enable_bit[1] = (ebit1), \ |
| 251 | .voltages = tps6586x_##vdata##_voltages, \ | 250 | .voltages = tps6586x_##vdata##_voltages, |
| 252 | } | 251 | |
| 252 | #define TPS6586X_REGULATOR_DVM_GOREG(goreg, gobit) \ | ||
| 253 | .go_reg = TPS6586X_##goreg, \ | ||
| 254 | .go_bit = (gobit), | ||
| 253 | 255 | ||
| 254 | #define TPS6586X_LDO(_id, vdata, vreg, shift, nbits, \ | 256 | #define TPS6586X_LDO(_id, vdata, vreg, shift, nbits, \ |
| 255 | ereg0, ebit0, ereg1, ebit1) \ | 257 | ereg0, ebit0, ereg1, ebit1) \ |
| 258 | { \ | ||
| 256 | TPS6586X_REGULATOR(_id, vdata, ldo_ops, vreg, shift, nbits, \ | 259 | TPS6586X_REGULATOR(_id, vdata, ldo_ops, vreg, shift, nbits, \ |
| 257 | ereg0, ebit0, ereg1, ebit1, 0, 0) | 260 | ereg0, ebit0, ereg1, ebit1) \ |
| 261 | } | ||
| 258 | 262 | ||
| 259 | #define TPS6586X_DVM(_id, vdata, vreg, shift, nbits, \ | 263 | #define TPS6586X_DVM(_id, vdata, vreg, shift, nbits, \ |
| 260 | ereg0, ebit0, ereg1, ebit1, goreg, gobit) \ | 264 | ereg0, ebit0, ereg1, ebit1, goreg, gobit) \ |
| 265 | { \ | ||
| 261 | TPS6586X_REGULATOR(_id, vdata, dvm_ops, vreg, shift, nbits, \ | 266 | TPS6586X_REGULATOR(_id, vdata, dvm_ops, vreg, shift, nbits, \ |
| 262 | ereg0, ebit0, ereg1, ebit1, goreg, gobit) | 267 | ereg0, ebit0, ereg1, ebit1) \ |
| 268 | TPS6586X_REGULATOR_DVM_GOREG(goreg, gobit) \ | ||
| 269 | } | ||
| 263 | 270 | ||
| 264 | static struct tps6586x_regulator tps6586x_regulator[] = { | 271 | static struct tps6586x_regulator tps6586x_regulator[] = { |
| 265 | TPS6586X_LDO(LDO_0, ldo, SUPPLYV1, 5, 3, ENC, 0, END, 0), | 272 | TPS6586X_LDO(LDO_0, ldo, SUPPLYV1, 5, 3, ENC, 0, END, 0), |
| @@ -267,11 +274,11 @@ static struct tps6586x_regulator tps6586x_regulator[] = { | |||
| 267 | TPS6586X_LDO(LDO_5, ldo, SUPPLYV6, 0, 3, ENE, 6, ENE, 6), | 274 | TPS6586X_LDO(LDO_5, ldo, SUPPLYV6, 0, 3, ENE, 6, ENE, 6), |
| 268 | TPS6586X_LDO(LDO_6, ldo, SUPPLYV3, 0, 3, ENC, 4, END, 4), | 275 | TPS6586X_LDO(LDO_6, ldo, SUPPLYV3, 0, 3, ENC, 4, END, 4), |
| 269 | TPS6586X_LDO(LDO_7, ldo, SUPPLYV3, 3, 3, ENC, 5, END, 5), | 276 | TPS6586X_LDO(LDO_7, ldo, SUPPLYV3, 3, 3, ENC, 5, END, 5), |
| 270 | TPS6586X_LDO(LDO_8, ldo, SUPPLYV1, 5, 3, ENC, 6, END, 6), | 277 | TPS6586X_LDO(LDO_8, ldo, SUPPLYV2, 5, 3, ENC, 6, END, 6), |
| 271 | TPS6586X_LDO(LDO_9, ldo, SUPPLYV6, 3, 3, ENE, 7, ENE, 7), | 278 | TPS6586X_LDO(LDO_9, ldo, SUPPLYV6, 3, 3, ENE, 7, ENE, 7), |
| 272 | TPS6586X_LDO(LDO_RTC, ldo, SUPPLYV4, 3, 3, ENE, 7, ENE, 7), | 279 | TPS6586X_LDO(LDO_RTC, ldo, SUPPLYV4, 3, 3, V4, 7, V4, 7), |
| 273 | TPS6586X_LDO(LDO_1, dvm, SUPPLYV1, 0, 5, ENC, 1, END, 1), | 280 | TPS6586X_LDO(LDO_1, dvm, SUPPLYV1, 0, 5, ENC, 1, END, 1), |
| 274 | TPS6586X_LDO(SM_2, sm2, SUPPLYV2, 0, 5, ENC, 1, END, 1), | 281 | TPS6586X_LDO(SM_2, sm2, SUPPLYV2, 0, 5, ENC, 7, END, 7), |
| 275 | 282 | ||
| 276 | TPS6586X_DVM(LDO_2, dvm, LDO2BV1, 0, 5, ENA, 3, ENB, 3, VCC2, 6), | 283 | TPS6586X_DVM(LDO_2, dvm, LDO2BV1, 0, 5, ENA, 3, ENB, 3, VCC2, 6), |
| 277 | TPS6586X_DVM(LDO_4, ldo4, LDO4V1, 0, 5, ENC, 3, END, 3, VCC1, 6), | 284 | TPS6586X_DVM(LDO_4, ldo4, LDO4V1, 0, 5, ENC, 3, END, 3, VCC1, 6), |
| @@ -290,6 +297,10 @@ static inline int tps6586x_regulator_preinit(struct device *parent, | |||
| 290 | uint8_t val1, val2; | 297 | uint8_t val1, val2; |
| 291 | int ret; | 298 | int ret; |
| 292 | 299 | ||
| 300 | if (ri->enable_reg[0] == ri->enable_reg[1] && | ||
| 301 | ri->enable_bit[0] == ri->enable_bit[1]) | ||
| 302 | return 0; | ||
| 303 | |||
| 293 | ret = tps6586x_read(parent, ri->enable_reg[0], &val1); | 304 | ret = tps6586x_read(parent, ri->enable_reg[0], &val1); |
| 294 | if (ret) | 305 | if (ret) |
| 295 | return ret; | 306 | return ret; |
| @@ -298,14 +309,14 @@ static inline int tps6586x_regulator_preinit(struct device *parent, | |||
| 298 | if (ret) | 309 | if (ret) |
| 299 | return ret; | 310 | return ret; |
| 300 | 311 | ||
| 301 | if (!(val2 & ri->enable_bit[1])) | 312 | if (!(val2 & (1 << ri->enable_bit[1]))) |
| 302 | return 0; | 313 | return 0; |
| 303 | 314 | ||
| 304 | /* | 315 | /* |
| 305 | * The regulator is on, but it's enabled with the bit we don't | 316 | * The regulator is on, but it's enabled with the bit we don't |
| 306 | * want to use, so we switch the enable bits | 317 | * want to use, so we switch the enable bits |
| 307 | */ | 318 | */ |
| 308 | if (!(val1 & ri->enable_bit[0])) { | 319 | if (!(val1 & (1 << ri->enable_bit[0]))) { |
| 309 | ret = tps6586x_set_bits(parent, ri->enable_reg[0], | 320 | ret = tps6586x_set_bits(parent, ri->enable_reg[0], |
| 310 | 1 << ri->enable_bit[0]); | 321 | 1 << ri->enable_bit[0]); |
| 311 | if (ret) | 322 | if (ret) |
diff --git a/drivers/regulator/twl-regulator.c b/drivers/regulator/twl-regulator.c index 7e5892efc437..a57262a4fa6c 100644 --- a/drivers/regulator/twl-regulator.c +++ b/drivers/regulator/twl-regulator.c | |||
| @@ -219,12 +219,12 @@ static int twlreg_set_mode(struct regulator_dev *rdev, unsigned mode) | |||
| 219 | return -EACCES; | 219 | return -EACCES; |
| 220 | 220 | ||
| 221 | status = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, | 221 | status = twl_i2c_write_u8(TWL_MODULE_PM_MASTER, |
| 222 | message >> 8, 0x15 /* PB_WORD_MSB */ ); | 222 | message >> 8, TWL4030_PM_MASTER_PB_WORD_MSB); |
| 223 | if (status >= 0) | 223 | if (status < 0) |
| 224 | return status; | 224 | return status; |
| 225 | 225 | ||
| 226 | return twl_i2c_write_u8(TWL_MODULE_PM_MASTER, | 226 | return twl_i2c_write_u8(TWL_MODULE_PM_MASTER, |
| 227 | message, 0x16 /* PB_WORD_LSB */ ); | 227 | message & 0xff, TWL4030_PM_MASTER_PB_WORD_LSB); |
| 228 | } | 228 | } |
| 229 | 229 | ||
| 230 | /*----------------------------------------------------------------------*/ | 230 | /*----------------------------------------------------------------------*/ |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index a5050e217150..825951b6b83f 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
| @@ -635,7 +635,7 @@ static void css_process_crw(struct crw *crw0, struct crw *crw1, int overflow) | |||
| 635 | init_subchannel_id(&mchk_schid); | 635 | init_subchannel_id(&mchk_schid); |
| 636 | mchk_schid.sch_no = crw0->rsid; | 636 | mchk_schid.sch_no = crw0->rsid; |
| 637 | if (crw1) | 637 | if (crw1) |
| 638 | mchk_schid.ssid = (crw1->rsid >> 8) & 3; | 638 | mchk_schid.ssid = (crw1->rsid >> 4) & 3; |
| 639 | 639 | ||
| 640 | /* | 640 | /* |
| 641 | * Since we are always presented with IPI in the CRW, we have to | 641 | * Since we are always presented with IPI in the CRW, we have to |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 4d8e14b7aa93..09a550860dcf 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
| @@ -2872,7 +2872,7 @@ static struct console serial8250_console = { | |||
| 2872 | .device = uart_console_device, | 2872 | .device = uart_console_device, |
| 2873 | .setup = serial8250_console_setup, | 2873 | .setup = serial8250_console_setup, |
| 2874 | .early_setup = serial8250_console_early_setup, | 2874 | .early_setup = serial8250_console_early_setup, |
| 2875 | .flags = CON_PRINTBUFFER, | 2875 | .flags = CON_PRINTBUFFER | CON_ANYTIME, |
| 2876 | .index = -1, | 2876 | .index = -1, |
| 2877 | .data = &serial8250_reg, | 2877 | .data = &serial8250_reg, |
| 2878 | }; | 2878 | }; |
diff --git a/drivers/serial/mfd.c b/drivers/serial/mfd.c index 5fc699e929dc..d40010a22ecd 100644 --- a/drivers/serial/mfd.c +++ b/drivers/serial/mfd.c | |||
| @@ -900,8 +900,7 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios, | |||
| 900 | unsigned char cval, fcr = 0; | 900 | unsigned char cval, fcr = 0; |
| 901 | unsigned long flags; | 901 | unsigned long flags; |
| 902 | unsigned int baud, quot; | 902 | unsigned int baud, quot; |
| 903 | u32 mul = 0x3600; | 903 | u32 ps, mul; |
| 904 | u32 ps = 0x10; | ||
| 905 | 904 | ||
| 906 | switch (termios->c_cflag & CSIZE) { | 905 | switch (termios->c_cflag & CSIZE) { |
| 907 | case CS5: | 906 | case CS5: |
| @@ -943,31 +942,24 @@ serial_hsu_set_termios(struct uart_port *port, struct ktermios *termios, | |||
| 943 | baud = uart_get_baud_rate(port, termios, old, 0, 4000000); | 942 | baud = uart_get_baud_rate(port, termios, old, 0, 4000000); |
| 944 | 943 | ||
| 945 | quot = 1; | 944 | quot = 1; |
| 945 | ps = 0x10; | ||
| 946 | mul = 0x3600; | ||
| 946 | switch (baud) { | 947 | switch (baud) { |
| 947 | case 3500000: | 948 | case 3500000: |
| 948 | mul = 0x3345; | 949 | mul = 0x3345; |
| 949 | ps = 0xC; | 950 | ps = 0xC; |
| 950 | break; | 951 | break; |
| 951 | case 3000000: | ||
| 952 | mul = 0x2EE0; | ||
| 953 | break; | ||
| 954 | case 2500000: | ||
| 955 | mul = 0x2710; | ||
| 956 | break; | ||
| 957 | case 2000000: | ||
| 958 | mul = 0x1F40; | ||
| 959 | break; | ||
| 960 | case 1843200: | 952 | case 1843200: |
| 961 | mul = 0x2400; | 953 | mul = 0x2400; |
| 962 | break; | 954 | break; |
| 955 | case 3000000: | ||
| 956 | case 2500000: | ||
| 957 | case 2000000: | ||
| 963 | case 1500000: | 958 | case 1500000: |
| 964 | mul = 0x1770; | ||
| 965 | break; | ||
| 966 | case 1000000: | 959 | case 1000000: |
| 967 | mul = 0xFA0; | ||
| 968 | break; | ||
| 969 | case 500000: | 960 | case 500000: |
| 970 | mul = 0x7D0; | 961 | /* mul/ps/quot = 0x9C4/0x10/0x1 will make a 500000 bps */ |
| 962 | mul = baud / 500000 * 0x9C4; | ||
| 971 | break; | 963 | break; |
| 972 | default: | 964 | default: |
| 973 | /* Use uart_get_divisor to get quot for other baud rates */ | 965 | /* Use uart_get_divisor to get quot for other baud rates */ |
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 154529aacc03..a067046c9da2 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
| @@ -352,8 +352,12 @@ atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer) | |||
| 352 | 352 | ||
| 353 | xfer->tx_dma = xfer->rx_dma = INVALID_DMA_ADDRESS; | 353 | xfer->tx_dma = xfer->rx_dma = INVALID_DMA_ADDRESS; |
| 354 | if (xfer->tx_buf) { | 354 | if (xfer->tx_buf) { |
| 355 | /* tx_buf is a const void* where we need a void * for the dma | ||
| 356 | * mapping */ | ||
| 357 | void *nonconst_tx = (void *)xfer->tx_buf; | ||
| 358 | |||
| 355 | xfer->tx_dma = dma_map_single(dev, | 359 | xfer->tx_dma = dma_map_single(dev, |
| 356 | (void *) xfer->tx_buf, xfer->len, | 360 | nonconst_tx, xfer->len, |
| 357 | DMA_TO_DEVICE); | 361 | DMA_TO_DEVICE); |
| 358 | if (dma_mapping_error(dev, xfer->tx_dma)) | 362 | if (dma_mapping_error(dev, xfer->tx_dma)) |
| 359 | return -ENOMEM; | 363 | return -ENOMEM; |
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c index 8c95d8c2a4f4..016c6f7f8630 100644 --- a/drivers/staging/asus_oled/asus_oled.c +++ b/drivers/staging/asus_oled/asus_oled.c | |||
| @@ -620,13 +620,13 @@ static ssize_t class_set_picture(struct device *device, | |||
| 620 | 620 | ||
| 621 | #define ASUS_OLED_DEVICE_ATTR(_file) dev_attr_asus_oled_##_file | 621 | #define ASUS_OLED_DEVICE_ATTR(_file) dev_attr_asus_oled_##_file |
| 622 | 622 | ||
| 623 | static DEVICE_ATTR(asus_oled_enabled, S_IWUGO | S_IRUGO, | 623 | static DEVICE_ATTR(asus_oled_enabled, S_IWUSR | S_IRUGO, |
| 624 | get_enabled, set_enabled); | 624 | get_enabled, set_enabled); |
| 625 | static DEVICE_ATTR(asus_oled_picture, S_IWUGO , NULL, set_picture); | 625 | static DEVICE_ATTR(asus_oled_picture, S_IWUSR , NULL, set_picture); |
| 626 | 626 | ||
| 627 | static DEVICE_ATTR(enabled, S_IWUGO | S_IRUGO, | 627 | static DEVICE_ATTR(enabled, S_IWUSR | S_IRUGO, |
| 628 | class_get_enabled, class_set_enabled); | 628 | class_get_enabled, class_set_enabled); |
| 629 | static DEVICE_ATTR(picture, S_IWUGO, NULL, class_set_picture); | 629 | static DEVICE_ATTR(picture, S_IWUSR, NULL, class_set_picture); |
| 630 | 630 | ||
| 631 | static int asus_oled_probe(struct usb_interface *interface, | 631 | static int asus_oled_probe(struct usb_interface *interface, |
| 632 | const struct usb_device_id *id) | 632 | const struct usb_device_id *id) |
diff --git a/drivers/staging/batman-adv/hard-interface.c b/drivers/staging/batman-adv/hard-interface.c index b68a7e5173be..d85de82f941a 100644 --- a/drivers/staging/batman-adv/hard-interface.c +++ b/drivers/staging/batman-adv/hard-interface.c | |||
| @@ -463,9 +463,6 @@ static void hardif_remove_interface(struct batman_if *batman_if) | |||
| 463 | return; | 463 | return; |
| 464 | 464 | ||
| 465 | batman_if->if_status = IF_TO_BE_REMOVED; | 465 | batman_if->if_status = IF_TO_BE_REMOVED; |
| 466 | |||
| 467 | /* caller must take if_list_lock */ | ||
| 468 | list_del_rcu(&batman_if->list); | ||
| 469 | synchronize_rcu(); | 466 | synchronize_rcu(); |
| 470 | sysfs_del_hardif(&batman_if->hardif_obj); | 467 | sysfs_del_hardif(&batman_if->hardif_obj); |
| 471 | hardif_put(batman_if); | 468 | hardif_put(batman_if); |
| @@ -474,13 +471,21 @@ static void hardif_remove_interface(struct batman_if *batman_if) | |||
| 474 | void hardif_remove_interfaces(void) | 471 | void hardif_remove_interfaces(void) |
| 475 | { | 472 | { |
| 476 | struct batman_if *batman_if, *batman_if_tmp; | 473 | struct batman_if *batman_if, *batman_if_tmp; |
| 474 | struct list_head if_queue; | ||
| 475 | |||
| 476 | INIT_LIST_HEAD(&if_queue); | ||
| 477 | 477 | ||
| 478 | rtnl_lock(); | ||
| 479 | spin_lock(&if_list_lock); | 478 | spin_lock(&if_list_lock); |
| 480 | list_for_each_entry_safe(batman_if, batman_if_tmp, &if_list, list) { | 479 | list_for_each_entry_safe(batman_if, batman_if_tmp, &if_list, list) { |
| 481 | hardif_remove_interface(batman_if); | 480 | list_del_rcu(&batman_if->list); |
| 481 | list_add_tail(&batman_if->list, &if_queue); | ||
| 482 | } | 482 | } |
| 483 | spin_unlock(&if_list_lock); | 483 | spin_unlock(&if_list_lock); |
| 484 | |||
| 485 | rtnl_lock(); | ||
| 486 | list_for_each_entry_safe(batman_if, batman_if_tmp, &if_queue, list) { | ||
| 487 | hardif_remove_interface(batman_if); | ||
| 488 | } | ||
| 484 | rtnl_unlock(); | 489 | rtnl_unlock(); |
| 485 | } | 490 | } |
| 486 | 491 | ||
| @@ -507,8 +512,10 @@ static int hard_if_event(struct notifier_block *this, | |||
| 507 | break; | 512 | break; |
| 508 | case NETDEV_UNREGISTER: | 513 | case NETDEV_UNREGISTER: |
| 509 | spin_lock(&if_list_lock); | 514 | spin_lock(&if_list_lock); |
| 510 | hardif_remove_interface(batman_if); | 515 | list_del_rcu(&batman_if->list); |
| 511 | spin_unlock(&if_list_lock); | 516 | spin_unlock(&if_list_lock); |
| 517 | |||
| 518 | hardif_remove_interface(batman_if); | ||
| 512 | break; | 519 | break; |
| 513 | case NETDEV_CHANGEMTU: | 520 | case NETDEV_CHANGEMTU: |
| 514 | if (batman_if->soft_iface) | 521 | if (batman_if->soft_iface) |
diff --git a/drivers/staging/batman-adv/soft-interface.c b/drivers/staging/batman-adv/soft-interface.c index 3904db9ce7b1..0e996181daf7 100644 --- a/drivers/staging/batman-adv/soft-interface.c +++ b/drivers/staging/batman-adv/soft-interface.c | |||
| @@ -194,14 +194,15 @@ void interface_rx(struct net_device *soft_iface, | |||
| 194 | struct bat_priv *priv = netdev_priv(soft_iface); | 194 | struct bat_priv *priv = netdev_priv(soft_iface); |
| 195 | 195 | ||
| 196 | /* check if enough space is available for pulling, and pull */ | 196 | /* check if enough space is available for pulling, and pull */ |
| 197 | if (!pskb_may_pull(skb, hdr_size)) { | 197 | if (!pskb_may_pull(skb, hdr_size)) |
| 198 | kfree_skb(skb); | 198 | goto dropped; |
| 199 | return; | 199 | |
| 200 | } | ||
| 201 | skb_pull_rcsum(skb, hdr_size); | 200 | skb_pull_rcsum(skb, hdr_size); |
| 202 | /* skb_set_mac_header(skb, -sizeof(struct ethhdr));*/ | 201 | /* skb_set_mac_header(skb, -sizeof(struct ethhdr));*/ |
| 203 | 202 | ||
| 204 | /* skb->dev & skb->pkt_type are set here */ | 203 | /* skb->dev & skb->pkt_type are set here */ |
| 204 | if (unlikely(!pskb_may_pull(skb, ETH_HLEN))) | ||
| 205 | goto dropped; | ||
| 205 | skb->protocol = eth_type_trans(skb, soft_iface); | 206 | skb->protocol = eth_type_trans(skb, soft_iface); |
| 206 | 207 | ||
| 207 | /* should not be neccesary anymore as we use skb_pull_rcsum() | 208 | /* should not be neccesary anymore as we use skb_pull_rcsum() |
| @@ -216,6 +217,11 @@ void interface_rx(struct net_device *soft_iface, | |||
| 216 | soft_iface->last_rx = jiffies; | 217 | soft_iface->last_rx = jiffies; |
| 217 | 218 | ||
| 218 | netif_rx(skb); | 219 | netif_rx(skb); |
| 220 | return; | ||
| 221 | |||
| 222 | dropped: | ||
| 223 | kfree_skb(skb); | ||
| 224 | return; | ||
| 219 | } | 225 | } |
| 220 | 226 | ||
| 221 | #ifdef HAVE_NET_DEVICE_OPS | 227 | #ifdef HAVE_NET_DEVICE_OPS |
diff --git a/drivers/staging/brcm80211/README b/drivers/staging/brcm80211/README index c8f1cf1b4409..a27bb0b4f581 100644 --- a/drivers/staging/brcm80211/README +++ b/drivers/staging/brcm80211/README | |||
| @@ -88,7 +88,9 @@ with the driver. | |||
| 88 | 88 | ||
| 89 | Contact Info: | 89 | Contact Info: |
| 90 | ============= | 90 | ============= |
| 91 | Brett Rudley brudley@broadcom.com | 91 | Brett Rudley brudley@broadcom.com |
| 92 | Henry Ptasinski henryp@broadcom.com | 92 | Henry Ptasinski henryp@broadcom.com |
| 93 | Dowan Kim dowan@broadcom.com | 93 | Dowan Kim dowan@broadcom.com |
| 94 | Roland Vossen rvossen@broadcom.com | ||
| 95 | Arend van Spriel arend@broadcom.com | ||
| 94 | 96 | ||
diff --git a/drivers/staging/brcm80211/TODO b/drivers/staging/brcm80211/TODO index dbf904184899..24ebadbe4241 100644 --- a/drivers/staging/brcm80211/TODO +++ b/drivers/staging/brcm80211/TODO | |||
| @@ -46,4 +46,6 @@ Contact | |||
| 46 | Brett Rudley <brudley@broadcom.com> | 46 | Brett Rudley <brudley@broadcom.com> |
| 47 | Henry Ptasinski <henryp@broadcom.com> | 47 | Henry Ptasinski <henryp@broadcom.com> |
| 48 | Dowan Kim <dowan@broadcom.com> | 48 | Dowan Kim <dowan@broadcom.com> |
| 49 | Roland Vossen <rvossen@broadcom.com> | ||
| 50 | Arend van Spriel <arend@broadcom.com> | ||
| 49 | 51 | ||
diff --git a/drivers/staging/comedi/drivers/usbdux.c b/drivers/staging/comedi/drivers/usbdux.c index 1f177a67ff11..de784ff08caa 100644 --- a/drivers/staging/comedi/drivers/usbdux.c +++ b/drivers/staging/comedi/drivers/usbdux.c | |||
| @@ -2295,8 +2295,8 @@ static void tidy_up(struct usbduxsub *usbduxsub_tmp) | |||
| 2295 | usbduxsub_tmp->inBuffer = NULL; | 2295 | usbduxsub_tmp->inBuffer = NULL; |
| 2296 | kfree(usbduxsub_tmp->insnBuffer); | 2296 | kfree(usbduxsub_tmp->insnBuffer); |
| 2297 | usbduxsub_tmp->insnBuffer = NULL; | 2297 | usbduxsub_tmp->insnBuffer = NULL; |
| 2298 | kfree(usbduxsub_tmp->inBuffer); | 2298 | kfree(usbduxsub_tmp->outBuffer); |
| 2299 | usbduxsub_tmp->inBuffer = NULL; | 2299 | usbduxsub_tmp->outBuffer = NULL; |
| 2300 | kfree(usbduxsub_tmp->dac_commands); | 2300 | kfree(usbduxsub_tmp->dac_commands); |
| 2301 | usbduxsub_tmp->dac_commands = NULL; | 2301 | usbduxsub_tmp->dac_commands = NULL; |
| 2302 | kfree(usbduxsub_tmp->dux_commands); | 2302 | kfree(usbduxsub_tmp->dux_commands); |
diff --git a/drivers/staging/easycap/easycap.h b/drivers/staging/easycap/easycap.h index 25961c23dc0f..884263b2775d 100644 --- a/drivers/staging/easycap/easycap.h +++ b/drivers/staging/easycap/easycap.h | |||
| @@ -75,6 +75,7 @@ | |||
| 75 | #include <linux/errno.h> | 75 | #include <linux/errno.h> |
| 76 | #include <linux/init.h> | 76 | #include <linux/init.h> |
| 77 | #include <linux/slab.h> | 77 | #include <linux/slab.h> |
| 78 | #include <linux/smp_lock.h> | ||
| 78 | #include <linux/module.h> | 79 | #include <linux/module.h> |
| 79 | #include <linux/kref.h> | 80 | #include <linux/kref.h> |
| 80 | #include <linux/usb.h> | 81 | #include <linux/usb.h> |
diff --git a/drivers/staging/frontier/tranzport.c b/drivers/staging/frontier/tranzport.c index a145a15cfdb3..8894ab14f167 100644 --- a/drivers/staging/frontier/tranzport.c +++ b/drivers/staging/frontier/tranzport.c | |||
| @@ -204,7 +204,7 @@ static void usb_tranzport_abort_transfers(struct usb_tranzport *dev) | |||
| 204 | t->value = temp; \ | 204 | t->value = temp; \ |
| 205 | return count; \ | 205 | return count; \ |
| 206 | } \ | 206 | } \ |
| 207 | static DEVICE_ATTR(value, S_IWUGO | S_IRUGO, show_##value, set_##value); | 207 | static DEVICE_ATTR(value, S_IWUSR | S_IRUGO, show_##value, set_##value); |
| 208 | 208 | ||
| 209 | show_int(enable); | 209 | show_int(enable); |
| 210 | show_int(offline); | 210 | show_int(offline); |
diff --git a/drivers/staging/go7007/go7007-driver.c b/drivers/staging/go7007/go7007-driver.c index b3f42f37a313..48d4e483d8a4 100644 --- a/drivers/staging/go7007/go7007-driver.c +++ b/drivers/staging/go7007/go7007-driver.c | |||
| @@ -199,7 +199,7 @@ static int init_i2c_module(struct i2c_adapter *adapter, const char *type, | |||
| 199 | struct go7007 *go = i2c_get_adapdata(adapter); | 199 | struct go7007 *go = i2c_get_adapdata(adapter); |
| 200 | struct v4l2_device *v4l2_dev = &go->v4l2_dev; | 200 | struct v4l2_device *v4l2_dev = &go->v4l2_dev; |
| 201 | 201 | ||
| 202 | if (v4l2_i2c_new_subdev(v4l2_dev, adapter, NULL, type, addr, NULL)) | 202 | if (v4l2_i2c_new_subdev(v4l2_dev, adapter, type, addr, NULL)) |
| 203 | return 0; | 203 | return 0; |
| 204 | 204 | ||
| 205 | printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type); | 205 | printk(KERN_INFO "go7007: probing for module i2c:%s failed\n", type); |
diff --git a/drivers/staging/iio/accel/adis16220_core.c b/drivers/staging/iio/accel/adis16220_core.c index c86d1498737d..1c1e98aee2d9 100644 --- a/drivers/staging/iio/accel/adis16220_core.c +++ b/drivers/staging/iio/accel/adis16220_core.c | |||
| @@ -507,7 +507,7 @@ static IIO_DEVICE_ATTR(reset, S_IWUSR, NULL, | |||
| 507 | adis16220_write_reset, 0); | 507 | adis16220_write_reset, 0); |
| 508 | 508 | ||
| 509 | #define IIO_DEV_ATTR_CAPTURE(_store) \ | 509 | #define IIO_DEV_ATTR_CAPTURE(_store) \ |
| 510 | IIO_DEVICE_ATTR(capture, S_IWUGO, NULL, _store, 0) | 510 | IIO_DEVICE_ATTR(capture, S_IWUSR, NULL, _store, 0) |
| 511 | 511 | ||
| 512 | static IIO_DEV_ATTR_CAPTURE(adis16220_write_capture); | 512 | static IIO_DEV_ATTR_CAPTURE(adis16220_write_capture); |
| 513 | 513 | ||
diff --git a/drivers/staging/intel_sst/intel_sst_stream_encoded.c b/drivers/staging/intel_sst/intel_sst_stream_encoded.c index fbae39fda5c0..5c455608b024 100644 --- a/drivers/staging/intel_sst/intel_sst_stream_encoded.c +++ b/drivers/staging/intel_sst/intel_sst_stream_encoded.c | |||
| @@ -1269,7 +1269,7 @@ finish: | |||
| 1269 | dbufs->output_bytes_produced = total_output; | 1269 | dbufs->output_bytes_produced = total_output; |
| 1270 | str_info->status = str_info->prev; | 1270 | str_info->status = str_info->prev; |
| 1271 | str_info->prev = STREAM_DECODE; | 1271 | str_info->prev = STREAM_DECODE; |
| 1272 | str_info->decode_ibuf = NULL; | ||
| 1273 | kfree(str_info->decode_ibuf); | 1272 | kfree(str_info->decode_ibuf); |
| 1273 | str_info->decode_ibuf = NULL; | ||
| 1274 | return retval; | 1274 | return retval; |
| 1275 | } | 1275 | } |
diff --git a/drivers/staging/line6/control.c b/drivers/staging/line6/control.c index 040e25ca6d33..67e23b6e2d35 100644 --- a/drivers/staging/line6/control.c +++ b/drivers/staging/line6/control.c | |||
| @@ -266,210 +266,210 @@ VARIAX_PARAM_R(float, mix2); | |||
| 266 | VARIAX_PARAM_R(float, mix1); | 266 | VARIAX_PARAM_R(float, mix1); |
| 267 | VARIAX_PARAM_R(int, pickup_wiring); | 267 | VARIAX_PARAM_R(int, pickup_wiring); |
| 268 | 268 | ||
| 269 | static DEVICE_ATTR(tweak, S_IWUGO | S_IRUGO, pod_get_tweak, pod_set_tweak); | 269 | static DEVICE_ATTR(tweak, S_IWUSR | S_IRUGO, pod_get_tweak, pod_set_tweak); |
| 270 | static DEVICE_ATTR(wah_position, S_IWUGO | S_IRUGO, pod_get_wah_position, | 270 | static DEVICE_ATTR(wah_position, S_IWUSR | S_IRUGO, pod_get_wah_position, |
| 271 | pod_set_wah_position); | 271 | pod_set_wah_position); |
| 272 | static DEVICE_ATTR(compression_gain, S_IWUGO | S_IRUGO, | 272 | static DEVICE_ATTR(compression_gain, S_IWUSR | S_IRUGO, |
| 273 | pod_get_compression_gain, pod_set_compression_gain); | 273 | pod_get_compression_gain, pod_set_compression_gain); |
| 274 | static DEVICE_ATTR(vol_pedal_position, S_IWUGO | S_IRUGO, | 274 | static DEVICE_ATTR(vol_pedal_position, S_IWUSR | S_IRUGO, |
| 275 | pod_get_vol_pedal_position, pod_set_vol_pedal_position); | 275 | pod_get_vol_pedal_position, pod_set_vol_pedal_position); |
| 276 | static DEVICE_ATTR(compression_threshold, S_IWUGO | S_IRUGO, | 276 | static DEVICE_ATTR(compression_threshold, S_IWUSR | S_IRUGO, |
| 277 | pod_get_compression_threshold, | 277 | pod_get_compression_threshold, |
| 278 | pod_set_compression_threshold); | 278 | pod_set_compression_threshold); |
| 279 | static DEVICE_ATTR(pan, S_IWUGO | S_IRUGO, pod_get_pan, pod_set_pan); | 279 | static DEVICE_ATTR(pan, S_IWUSR | S_IRUGO, pod_get_pan, pod_set_pan); |
| 280 | static DEVICE_ATTR(amp_model_setup, S_IWUGO | S_IRUGO, pod_get_amp_model_setup, | 280 | static DEVICE_ATTR(amp_model_setup, S_IWUSR | S_IRUGO, pod_get_amp_model_setup, |
| 281 | pod_set_amp_model_setup); | 281 | pod_set_amp_model_setup); |
| 282 | static DEVICE_ATTR(amp_model, S_IWUGO | S_IRUGO, pod_get_amp_model, | 282 | static DEVICE_ATTR(amp_model, S_IWUSR | S_IRUGO, pod_get_amp_model, |
| 283 | pod_set_amp_model); | 283 | pod_set_amp_model); |
| 284 | static DEVICE_ATTR(drive, S_IWUGO | S_IRUGO, pod_get_drive, pod_set_drive); | 284 | static DEVICE_ATTR(drive, S_IWUSR | S_IRUGO, pod_get_drive, pod_set_drive); |
| 285 | static DEVICE_ATTR(bass, S_IWUGO | S_IRUGO, pod_get_bass, pod_set_bass); | 285 | static DEVICE_ATTR(bass, S_IWUSR | S_IRUGO, pod_get_bass, pod_set_bass); |
| 286 | static DEVICE_ATTR(mid, S_IWUGO | S_IRUGO, pod_get_mid, pod_set_mid); | 286 | static DEVICE_ATTR(mid, S_IWUSR | S_IRUGO, pod_get_mid, pod_set_mid); |
| 287 | static DEVICE_ATTR(lowmid, S_IWUGO | S_IRUGO, pod_get_lowmid, pod_set_lowmid); | 287 | static DEVICE_ATTR(lowmid, S_IWUSR | S_IRUGO, pod_get_lowmid, pod_set_lowmid); |
| 288 | static DEVICE_ATTR(treble, S_IWUGO | S_IRUGO, pod_get_treble, pod_set_treble); | 288 | static DEVICE_ATTR(treble, S_IWUSR | S_IRUGO, pod_get_treble, pod_set_treble); |
| 289 | static DEVICE_ATTR(highmid, S_IWUGO | S_IRUGO, pod_get_highmid, | 289 | static DEVICE_ATTR(highmid, S_IWUSR | S_IRUGO, pod_get_highmid, |
| 290 | pod_set_highmid); | 290 | pod_set_highmid); |
| 291 | static DEVICE_ATTR(chan_vol, S_IWUGO | S_IRUGO, pod_get_chan_vol, | 291 | static DEVICE_ATTR(chan_vol, S_IWUSR | S_IRUGO, pod_get_chan_vol, |
| 292 | pod_set_chan_vol); | 292 | pod_set_chan_vol); |
| 293 | static DEVICE_ATTR(reverb_mix, S_IWUGO | S_IRUGO, pod_get_reverb_mix, | 293 | static DEVICE_ATTR(reverb_mix, S_IWUSR | S_IRUGO, pod_get_reverb_mix, |
| 294 | pod_set_reverb_mix); | 294 | pod_set_reverb_mix); |
| 295 | static DEVICE_ATTR(effect_setup, S_IWUGO | S_IRUGO, pod_get_effect_setup, | 295 | static DEVICE_ATTR(effect_setup, S_IWUSR | S_IRUGO, pod_get_effect_setup, |
| 296 | pod_set_effect_setup); | 296 | pod_set_effect_setup); |
| 297 | static DEVICE_ATTR(band_1_frequency, S_IWUGO | S_IRUGO, | 297 | static DEVICE_ATTR(band_1_frequency, S_IWUSR | S_IRUGO, |
| 298 | pod_get_band_1_frequency, pod_set_band_1_frequency); | 298 | pod_get_band_1_frequency, pod_set_band_1_frequency); |
| 299 | static DEVICE_ATTR(presence, S_IWUGO | S_IRUGO, pod_get_presence, | 299 | static DEVICE_ATTR(presence, S_IWUSR | S_IRUGO, pod_get_presence, |
| 300 | pod_set_presence); | 300 | pod_set_presence); |
| 301 | static DEVICE_ATTR2(treble__bass, treble, S_IWUGO | S_IRUGO, | 301 | static DEVICE_ATTR2(treble__bass, treble, S_IWUSR | S_IRUGO, |
| 302 | pod_get_treble__bass, pod_set_treble__bass); | 302 | pod_get_treble__bass, pod_set_treble__bass); |
| 303 | static DEVICE_ATTR(noise_gate_enable, S_IWUGO | S_IRUGO, | 303 | static DEVICE_ATTR(noise_gate_enable, S_IWUSR | S_IRUGO, |
| 304 | pod_get_noise_gate_enable, pod_set_noise_gate_enable); | 304 | pod_get_noise_gate_enable, pod_set_noise_gate_enable); |
| 305 | static DEVICE_ATTR(gate_threshold, S_IWUGO | S_IRUGO, pod_get_gate_threshold, | 305 | static DEVICE_ATTR(gate_threshold, S_IWUSR | S_IRUGO, pod_get_gate_threshold, |
| 306 | pod_set_gate_threshold); | 306 | pod_set_gate_threshold); |
| 307 | static DEVICE_ATTR(gate_decay_time, S_IWUGO | S_IRUGO, pod_get_gate_decay_time, | 307 | static DEVICE_ATTR(gate_decay_time, S_IWUSR | S_IRUGO, pod_get_gate_decay_time, |
| 308 | pod_set_gate_decay_time); | 308 | pod_set_gate_decay_time); |
| 309 | static DEVICE_ATTR(stomp_enable, S_IWUGO | S_IRUGO, pod_get_stomp_enable, | 309 | static DEVICE_ATTR(stomp_enable, S_IWUSR | S_IRUGO, pod_get_stomp_enable, |
| 310 | pod_set_stomp_enable); | 310 | pod_set_stomp_enable); |
| 311 | static DEVICE_ATTR(comp_enable, S_IWUGO | S_IRUGO, pod_get_comp_enable, | 311 | static DEVICE_ATTR(comp_enable, S_IWUSR | S_IRUGO, pod_get_comp_enable, |
| 312 | pod_set_comp_enable); | 312 | pod_set_comp_enable); |
| 313 | static DEVICE_ATTR(stomp_time, S_IWUGO | S_IRUGO, pod_get_stomp_time, | 313 | static DEVICE_ATTR(stomp_time, S_IWUSR | S_IRUGO, pod_get_stomp_time, |
| 314 | pod_set_stomp_time); | 314 | pod_set_stomp_time); |
| 315 | static DEVICE_ATTR(delay_enable, S_IWUGO | S_IRUGO, pod_get_delay_enable, | 315 | static DEVICE_ATTR(delay_enable, S_IWUSR | S_IRUGO, pod_get_delay_enable, |
| 316 | pod_set_delay_enable); | 316 | pod_set_delay_enable); |
| 317 | static DEVICE_ATTR(mod_param_1, S_IWUGO | S_IRUGO, pod_get_mod_param_1, | 317 | static DEVICE_ATTR(mod_param_1, S_IWUSR | S_IRUGO, pod_get_mod_param_1, |
| 318 | pod_set_mod_param_1); | 318 | pod_set_mod_param_1); |
| 319 | static DEVICE_ATTR(delay_param_1, S_IWUGO | S_IRUGO, pod_get_delay_param_1, | 319 | static DEVICE_ATTR(delay_param_1, S_IWUSR | S_IRUGO, pod_get_delay_param_1, |
| 320 | pod_set_delay_param_1); | 320 | pod_set_delay_param_1); |
| 321 | static DEVICE_ATTR(delay_param_1_note_value, S_IWUGO | S_IRUGO, | 321 | static DEVICE_ATTR(delay_param_1_note_value, S_IWUSR | S_IRUGO, |
| 322 | pod_get_delay_param_1_note_value, | 322 | pod_get_delay_param_1_note_value, |
| 323 | pod_set_delay_param_1_note_value); | 323 | pod_set_delay_param_1_note_value); |
| 324 | static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUGO | S_IRUGO, | 324 | static DEVICE_ATTR2(band_2_frequency__bass, band_2_frequency, S_IWUSR | S_IRUGO, |
| 325 | pod_get_band_2_frequency__bass, | 325 | pod_get_band_2_frequency__bass, |
| 326 | pod_set_band_2_frequency__bass); | 326 | pod_set_band_2_frequency__bass); |
| 327 | static DEVICE_ATTR(delay_param_2, S_IWUGO | S_IRUGO, pod_get_delay_param_2, | 327 | static DEVICE_ATTR(delay_param_2, S_IWUSR | S_IRUGO, pod_get_delay_param_2, |
| 328 | pod_set_delay_param_2); | 328 | pod_set_delay_param_2); |
| 329 | static DEVICE_ATTR(delay_volume_mix, S_IWUGO | S_IRUGO, | 329 | static DEVICE_ATTR(delay_volume_mix, S_IWUSR | S_IRUGO, |
| 330 | pod_get_delay_volume_mix, pod_set_delay_volume_mix); | 330 | pod_get_delay_volume_mix, pod_set_delay_volume_mix); |
| 331 | static DEVICE_ATTR(delay_param_3, S_IWUGO | S_IRUGO, pod_get_delay_param_3, | 331 | static DEVICE_ATTR(delay_param_3, S_IWUSR | S_IRUGO, pod_get_delay_param_3, |
| 332 | pod_set_delay_param_3); | 332 | pod_set_delay_param_3); |
| 333 | static DEVICE_ATTR(reverb_enable, S_IWUGO | S_IRUGO, pod_get_reverb_enable, | 333 | static DEVICE_ATTR(reverb_enable, S_IWUSR | S_IRUGO, pod_get_reverb_enable, |
| 334 | pod_set_reverb_enable); | 334 | pod_set_reverb_enable); |
| 335 | static DEVICE_ATTR(reverb_type, S_IWUGO | S_IRUGO, pod_get_reverb_type, | 335 | static DEVICE_ATTR(reverb_type, S_IWUSR | S_IRUGO, pod_get_reverb_type, |
| 336 | pod_set_reverb_type); | 336 | pod_set_reverb_type); |
| 337 | static DEVICE_ATTR(reverb_decay, S_IWUGO | S_IRUGO, pod_get_reverb_decay, | 337 | static DEVICE_ATTR(reverb_decay, S_IWUSR | S_IRUGO, pod_get_reverb_decay, |
| 338 | pod_set_reverb_decay); | 338 | pod_set_reverb_decay); |
| 339 | static DEVICE_ATTR(reverb_tone, S_IWUGO | S_IRUGO, pod_get_reverb_tone, | 339 | static DEVICE_ATTR(reverb_tone, S_IWUSR | S_IRUGO, pod_get_reverb_tone, |
| 340 | pod_set_reverb_tone); | 340 | pod_set_reverb_tone); |
| 341 | static DEVICE_ATTR(reverb_pre_delay, S_IWUGO | S_IRUGO, | 341 | static DEVICE_ATTR(reverb_pre_delay, S_IWUSR | S_IRUGO, |
| 342 | pod_get_reverb_pre_delay, pod_set_reverb_pre_delay); | 342 | pod_get_reverb_pre_delay, pod_set_reverb_pre_delay); |
| 343 | static DEVICE_ATTR(reverb_pre_post, S_IWUGO | S_IRUGO, pod_get_reverb_pre_post, | 343 | static DEVICE_ATTR(reverb_pre_post, S_IWUSR | S_IRUGO, pod_get_reverb_pre_post, |
| 344 | pod_set_reverb_pre_post); | 344 | pod_set_reverb_pre_post); |
| 345 | static DEVICE_ATTR(band_2_frequency, S_IWUGO | S_IRUGO, | 345 | static DEVICE_ATTR(band_2_frequency, S_IWUSR | S_IRUGO, |
| 346 | pod_get_band_2_frequency, pod_set_band_2_frequency); | 346 | pod_get_band_2_frequency, pod_set_band_2_frequency); |
| 347 | static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUGO | S_IRUGO, | 347 | static DEVICE_ATTR2(band_3_frequency__bass, band_3_frequency, S_IWUSR | S_IRUGO, |
| 348 | pod_get_band_3_frequency__bass, | 348 | pod_get_band_3_frequency__bass, |
| 349 | pod_set_band_3_frequency__bass); | 349 | pod_set_band_3_frequency__bass); |
| 350 | static DEVICE_ATTR(wah_enable, S_IWUGO | S_IRUGO, pod_get_wah_enable, | 350 | static DEVICE_ATTR(wah_enable, S_IWUSR | S_IRUGO, pod_get_wah_enable, |
| 351 | pod_set_wah_enable); | 351 | pod_set_wah_enable); |
| 352 | static DEVICE_ATTR(modulation_lo_cut, S_IWUGO | S_IRUGO, | 352 | static DEVICE_ATTR(modulation_lo_cut, S_IWUSR | S_IRUGO, |
| 353 | pod_get_modulation_lo_cut, pod_set_modulation_lo_cut); | 353 | pod_get_modulation_lo_cut, pod_set_modulation_lo_cut); |
| 354 | static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUGO | S_IRUGO, | 354 | static DEVICE_ATTR(delay_reverb_lo_cut, S_IWUSR | S_IRUGO, |
| 355 | pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut); | 355 | pod_get_delay_reverb_lo_cut, pod_set_delay_reverb_lo_cut); |
| 356 | static DEVICE_ATTR(volume_pedal_minimum, S_IWUGO | S_IRUGO, | 356 | static DEVICE_ATTR(volume_pedal_minimum, S_IWUSR | S_IRUGO, |
| 357 | pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum); | 357 | pod_get_volume_pedal_minimum, pod_set_volume_pedal_minimum); |
| 358 | static DEVICE_ATTR(eq_pre_post, S_IWUGO | S_IRUGO, pod_get_eq_pre_post, | 358 | static DEVICE_ATTR(eq_pre_post, S_IWUSR | S_IRUGO, pod_get_eq_pre_post, |
| 359 | pod_set_eq_pre_post); | 359 | pod_set_eq_pre_post); |
| 360 | static DEVICE_ATTR(volume_pre_post, S_IWUGO | S_IRUGO, pod_get_volume_pre_post, | 360 | static DEVICE_ATTR(volume_pre_post, S_IWUSR | S_IRUGO, pod_get_volume_pre_post, |
| 361 | pod_set_volume_pre_post); | 361 | pod_set_volume_pre_post); |
| 362 | static DEVICE_ATTR(di_model, S_IWUGO | S_IRUGO, pod_get_di_model, | 362 | static DEVICE_ATTR(di_model, S_IWUSR | S_IRUGO, pod_get_di_model, |
| 363 | pod_set_di_model); | 363 | pod_set_di_model); |
| 364 | static DEVICE_ATTR(di_delay, S_IWUGO | S_IRUGO, pod_get_di_delay, | 364 | static DEVICE_ATTR(di_delay, S_IWUSR | S_IRUGO, pod_get_di_delay, |
| 365 | pod_set_di_delay); | 365 | pod_set_di_delay); |
| 366 | static DEVICE_ATTR(mod_enable, S_IWUGO | S_IRUGO, pod_get_mod_enable, | 366 | static DEVICE_ATTR(mod_enable, S_IWUSR | S_IRUGO, pod_get_mod_enable, |
| 367 | pod_set_mod_enable); | 367 | pod_set_mod_enable); |
| 368 | static DEVICE_ATTR(mod_param_1_note_value, S_IWUGO | S_IRUGO, | 368 | static DEVICE_ATTR(mod_param_1_note_value, S_IWUSR | S_IRUGO, |
| 369 | pod_get_mod_param_1_note_value, | 369 | pod_get_mod_param_1_note_value, |
| 370 | pod_set_mod_param_1_note_value); | 370 | pod_set_mod_param_1_note_value); |
| 371 | static DEVICE_ATTR(mod_param_2, S_IWUGO | S_IRUGO, pod_get_mod_param_2, | 371 | static DEVICE_ATTR(mod_param_2, S_IWUSR | S_IRUGO, pod_get_mod_param_2, |
| 372 | pod_set_mod_param_2); | 372 | pod_set_mod_param_2); |
| 373 | static DEVICE_ATTR(mod_param_3, S_IWUGO | S_IRUGO, pod_get_mod_param_3, | 373 | static DEVICE_ATTR(mod_param_3, S_IWUSR | S_IRUGO, pod_get_mod_param_3, |
| 374 | pod_set_mod_param_3); | 374 | pod_set_mod_param_3); |
| 375 | static DEVICE_ATTR(mod_param_4, S_IWUGO | S_IRUGO, pod_get_mod_param_4, | 375 | static DEVICE_ATTR(mod_param_4, S_IWUSR | S_IRUGO, pod_get_mod_param_4, |
| 376 | pod_set_mod_param_4); | 376 | pod_set_mod_param_4); |
| 377 | static DEVICE_ATTR(mod_param_5, S_IWUGO | S_IRUGO, pod_get_mod_param_5, | 377 | static DEVICE_ATTR(mod_param_5, S_IWUSR | S_IRUGO, pod_get_mod_param_5, |
| 378 | pod_set_mod_param_5); | 378 | pod_set_mod_param_5); |
| 379 | static DEVICE_ATTR(mod_volume_mix, S_IWUGO | S_IRUGO, pod_get_mod_volume_mix, | 379 | static DEVICE_ATTR(mod_volume_mix, S_IWUSR | S_IRUGO, pod_get_mod_volume_mix, |
| 380 | pod_set_mod_volume_mix); | 380 | pod_set_mod_volume_mix); |
| 381 | static DEVICE_ATTR(mod_pre_post, S_IWUGO | S_IRUGO, pod_get_mod_pre_post, | 381 | static DEVICE_ATTR(mod_pre_post, S_IWUSR | S_IRUGO, pod_get_mod_pre_post, |
| 382 | pod_set_mod_pre_post); | 382 | pod_set_mod_pre_post); |
| 383 | static DEVICE_ATTR(modulation_model, S_IWUGO | S_IRUGO, | 383 | static DEVICE_ATTR(modulation_model, S_IWUSR | S_IRUGO, |
| 384 | pod_get_modulation_model, pod_set_modulation_model); | 384 | pod_get_modulation_model, pod_set_modulation_model); |
| 385 | static DEVICE_ATTR(band_3_frequency, S_IWUGO | S_IRUGO, | 385 | static DEVICE_ATTR(band_3_frequency, S_IWUSR | S_IRUGO, |
| 386 | pod_get_band_3_frequency, pod_set_band_3_frequency); | 386 | pod_get_band_3_frequency, pod_set_band_3_frequency); |
| 387 | static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUGO | S_IRUGO, | 387 | static DEVICE_ATTR2(band_4_frequency__bass, band_4_frequency, S_IWUSR | S_IRUGO, |
| 388 | pod_get_band_4_frequency__bass, | 388 | pod_get_band_4_frequency__bass, |
| 389 | pod_set_band_4_frequency__bass); | 389 | pod_set_band_4_frequency__bass); |
| 390 | static DEVICE_ATTR(mod_param_1_double_precision, S_IWUGO | S_IRUGO, | 390 | static DEVICE_ATTR(mod_param_1_double_precision, S_IWUSR | S_IRUGO, |
| 391 | pod_get_mod_param_1_double_precision, | 391 | pod_get_mod_param_1_double_precision, |
| 392 | pod_set_mod_param_1_double_precision); | 392 | pod_set_mod_param_1_double_precision); |
| 393 | static DEVICE_ATTR(delay_param_1_double_precision, S_IWUGO | S_IRUGO, | 393 | static DEVICE_ATTR(delay_param_1_double_precision, S_IWUSR | S_IRUGO, |
| 394 | pod_get_delay_param_1_double_precision, | 394 | pod_get_delay_param_1_double_precision, |
| 395 | pod_set_delay_param_1_double_precision); | 395 | pod_set_delay_param_1_double_precision); |
| 396 | static DEVICE_ATTR(eq_enable, S_IWUGO | S_IRUGO, pod_get_eq_enable, | 396 | static DEVICE_ATTR(eq_enable, S_IWUSR | S_IRUGO, pod_get_eq_enable, |
| 397 | pod_set_eq_enable); | 397 | pod_set_eq_enable); |
| 398 | static DEVICE_ATTR(tap, S_IWUGO | S_IRUGO, pod_get_tap, pod_set_tap); | 398 | static DEVICE_ATTR(tap, S_IWUSR | S_IRUGO, pod_get_tap, pod_set_tap); |
| 399 | static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUGO | S_IRUGO, | 399 | static DEVICE_ATTR(volume_tweak_pedal_assign, S_IWUSR | S_IRUGO, |
| 400 | pod_get_volume_tweak_pedal_assign, | 400 | pod_get_volume_tweak_pedal_assign, |
| 401 | pod_set_volume_tweak_pedal_assign); | 401 | pod_set_volume_tweak_pedal_assign); |
| 402 | static DEVICE_ATTR(band_5_frequency, S_IWUGO | S_IRUGO, | 402 | static DEVICE_ATTR(band_5_frequency, S_IWUSR | S_IRUGO, |
| 403 | pod_get_band_5_frequency, pod_set_band_5_frequency); | 403 | pod_get_band_5_frequency, pod_set_band_5_frequency); |
| 404 | static DEVICE_ATTR(tuner, S_IWUGO | S_IRUGO, pod_get_tuner, pod_set_tuner); | 404 | static DEVICE_ATTR(tuner, S_IWUSR | S_IRUGO, pod_get_tuner, pod_set_tuner); |
| 405 | static DEVICE_ATTR(mic_selection, S_IWUGO | S_IRUGO, pod_get_mic_selection, | 405 | static DEVICE_ATTR(mic_selection, S_IWUSR | S_IRUGO, pod_get_mic_selection, |
| 406 | pod_set_mic_selection); | 406 | pod_set_mic_selection); |
| 407 | static DEVICE_ATTR(cabinet_model, S_IWUGO | S_IRUGO, pod_get_cabinet_model, | 407 | static DEVICE_ATTR(cabinet_model, S_IWUSR | S_IRUGO, pod_get_cabinet_model, |
| 408 | pod_set_cabinet_model); | 408 | pod_set_cabinet_model); |
| 409 | static DEVICE_ATTR(stomp_model, S_IWUGO | S_IRUGO, pod_get_stomp_model, | 409 | static DEVICE_ATTR(stomp_model, S_IWUSR | S_IRUGO, pod_get_stomp_model, |
| 410 | pod_set_stomp_model); | 410 | pod_set_stomp_model); |
| 411 | static DEVICE_ATTR(roomlevel, S_IWUGO | S_IRUGO, pod_get_roomlevel, | 411 | static DEVICE_ATTR(roomlevel, S_IWUSR | S_IRUGO, pod_get_roomlevel, |
| 412 | pod_set_roomlevel); | 412 | pod_set_roomlevel); |
| 413 | static DEVICE_ATTR(band_4_frequency, S_IWUGO | S_IRUGO, | 413 | static DEVICE_ATTR(band_4_frequency, S_IWUSR | S_IRUGO, |
| 414 | pod_get_band_4_frequency, pod_set_band_4_frequency); | 414 | pod_get_band_4_frequency, pod_set_band_4_frequency); |
| 415 | static DEVICE_ATTR(band_6_frequency, S_IWUGO | S_IRUGO, | 415 | static DEVICE_ATTR(band_6_frequency, S_IWUSR | S_IRUGO, |
| 416 | pod_get_band_6_frequency, pod_set_band_6_frequency); | 416 | pod_get_band_6_frequency, pod_set_band_6_frequency); |
| 417 | static DEVICE_ATTR(stomp_param_1_note_value, S_IWUGO | S_IRUGO, | 417 | static DEVICE_ATTR(stomp_param_1_note_value, S_IWUSR | S_IRUGO, |
| 418 | pod_get_stomp_param_1_note_value, | 418 | pod_get_stomp_param_1_note_value, |
| 419 | pod_set_stomp_param_1_note_value); | 419 | pod_set_stomp_param_1_note_value); |
| 420 | static DEVICE_ATTR(stomp_param_2, S_IWUGO | S_IRUGO, pod_get_stomp_param_2, | 420 | static DEVICE_ATTR(stomp_param_2, S_IWUSR | S_IRUGO, pod_get_stomp_param_2, |
| 421 | pod_set_stomp_param_2); | 421 | pod_set_stomp_param_2); |
| 422 | static DEVICE_ATTR(stomp_param_3, S_IWUGO | S_IRUGO, pod_get_stomp_param_3, | 422 | static DEVICE_ATTR(stomp_param_3, S_IWUSR | S_IRUGO, pod_get_stomp_param_3, |
| 423 | pod_set_stomp_param_3); | 423 | pod_set_stomp_param_3); |
| 424 | static DEVICE_ATTR(stomp_param_4, S_IWUGO | S_IRUGO, pod_get_stomp_param_4, | 424 | static DEVICE_ATTR(stomp_param_4, S_IWUSR | S_IRUGO, pod_get_stomp_param_4, |
| 425 | pod_set_stomp_param_4); | 425 | pod_set_stomp_param_4); |
| 426 | static DEVICE_ATTR(stomp_param_5, S_IWUGO | S_IRUGO, pod_get_stomp_param_5, | 426 | static DEVICE_ATTR(stomp_param_5, S_IWUSR | S_IRUGO, pod_get_stomp_param_5, |
| 427 | pod_set_stomp_param_5); | 427 | pod_set_stomp_param_5); |
| 428 | static DEVICE_ATTR(stomp_param_6, S_IWUGO | S_IRUGO, pod_get_stomp_param_6, | 428 | static DEVICE_ATTR(stomp_param_6, S_IWUSR | S_IRUGO, pod_get_stomp_param_6, |
| 429 | pod_set_stomp_param_6); | 429 | pod_set_stomp_param_6); |
| 430 | static DEVICE_ATTR(amp_switch_select, S_IWUGO | S_IRUGO, | 430 | static DEVICE_ATTR(amp_switch_select, S_IWUSR | S_IRUGO, |
| 431 | pod_get_amp_switch_select, pod_set_amp_switch_select); | 431 | pod_get_amp_switch_select, pod_set_amp_switch_select); |
| 432 | static DEVICE_ATTR(delay_param_4, S_IWUGO | S_IRUGO, pod_get_delay_param_4, | 432 | static DEVICE_ATTR(delay_param_4, S_IWUSR | S_IRUGO, pod_get_delay_param_4, |
| 433 | pod_set_delay_param_4); | 433 | pod_set_delay_param_4); |
| 434 | static DEVICE_ATTR(delay_param_5, S_IWUGO | S_IRUGO, pod_get_delay_param_5, | 434 | static DEVICE_ATTR(delay_param_5, S_IWUSR | S_IRUGO, pod_get_delay_param_5, |
| 435 | pod_set_delay_param_5); | 435 | pod_set_delay_param_5); |
| 436 | static DEVICE_ATTR(delay_pre_post, S_IWUGO | S_IRUGO, pod_get_delay_pre_post, | 436 | static DEVICE_ATTR(delay_pre_post, S_IWUSR | S_IRUGO, pod_get_delay_pre_post, |
| 437 | pod_set_delay_pre_post); | 437 | pod_set_delay_pre_post); |
| 438 | static DEVICE_ATTR(delay_model, S_IWUGO | S_IRUGO, pod_get_delay_model, | 438 | static DEVICE_ATTR(delay_model, S_IWUSR | S_IRUGO, pod_get_delay_model, |
| 439 | pod_set_delay_model); | 439 | pod_set_delay_model); |
| 440 | static DEVICE_ATTR(delay_verb_model, S_IWUGO | S_IRUGO, | 440 | static DEVICE_ATTR(delay_verb_model, S_IWUSR | S_IRUGO, |
| 441 | pod_get_delay_verb_model, pod_set_delay_verb_model); | 441 | pod_get_delay_verb_model, pod_set_delay_verb_model); |
| 442 | static DEVICE_ATTR(tempo_msb, S_IWUGO | S_IRUGO, pod_get_tempo_msb, | 442 | static DEVICE_ATTR(tempo_msb, S_IWUSR | S_IRUGO, pod_get_tempo_msb, |
| 443 | pod_set_tempo_msb); | 443 | pod_set_tempo_msb); |
| 444 | static DEVICE_ATTR(tempo_lsb, S_IWUGO | S_IRUGO, pod_get_tempo_lsb, | 444 | static DEVICE_ATTR(tempo_lsb, S_IWUSR | S_IRUGO, pod_get_tempo_lsb, |
| 445 | pod_set_tempo_lsb); | 445 | pod_set_tempo_lsb); |
| 446 | static DEVICE_ATTR(wah_model, S_IWUGO | S_IRUGO, pod_get_wah_model, | 446 | static DEVICE_ATTR(wah_model, S_IWUSR | S_IRUGO, pod_get_wah_model, |
| 447 | pod_set_wah_model); | 447 | pod_set_wah_model); |
| 448 | static DEVICE_ATTR(bypass_volume, S_IWUGO | S_IRUGO, pod_get_bypass_volume, | 448 | static DEVICE_ATTR(bypass_volume, S_IWUSR | S_IRUGO, pod_get_bypass_volume, |
| 449 | pod_set_bypass_volume); | 449 | pod_set_bypass_volume); |
| 450 | static DEVICE_ATTR(fx_loop_on_off, S_IWUGO | S_IRUGO, pod_get_fx_loop_on_off, | 450 | static DEVICE_ATTR(fx_loop_on_off, S_IWUSR | S_IRUGO, pod_get_fx_loop_on_off, |
| 451 | pod_set_fx_loop_on_off); | 451 | pod_set_fx_loop_on_off); |
| 452 | static DEVICE_ATTR(tweak_param_select, S_IWUGO | S_IRUGO, | 452 | static DEVICE_ATTR(tweak_param_select, S_IWUSR | S_IRUGO, |
| 453 | pod_get_tweak_param_select, pod_set_tweak_param_select); | 453 | pod_get_tweak_param_select, pod_set_tweak_param_select); |
| 454 | static DEVICE_ATTR(amp1_engage, S_IWUGO | S_IRUGO, pod_get_amp1_engage, | 454 | static DEVICE_ATTR(amp1_engage, S_IWUSR | S_IRUGO, pod_get_amp1_engage, |
| 455 | pod_set_amp1_engage); | 455 | pod_set_amp1_engage); |
| 456 | static DEVICE_ATTR(band_1_gain, S_IWUGO | S_IRUGO, pod_get_band_1_gain, | 456 | static DEVICE_ATTR(band_1_gain, S_IWUSR | S_IRUGO, pod_get_band_1_gain, |
| 457 | pod_set_band_1_gain); | 457 | pod_set_band_1_gain); |
| 458 | static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUGO | S_IRUGO, | 458 | static DEVICE_ATTR2(band_2_gain__bass, band_2_gain, S_IWUSR | S_IRUGO, |
| 459 | pod_get_band_2_gain__bass, pod_set_band_2_gain__bass); | 459 | pod_get_band_2_gain__bass, pod_set_band_2_gain__bass); |
| 460 | static DEVICE_ATTR(band_2_gain, S_IWUGO | S_IRUGO, pod_get_band_2_gain, | 460 | static DEVICE_ATTR(band_2_gain, S_IWUSR | S_IRUGO, pod_get_band_2_gain, |
| 461 | pod_set_band_2_gain); | 461 | pod_set_band_2_gain); |
| 462 | static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUGO | S_IRUGO, | 462 | static DEVICE_ATTR2(band_3_gain__bass, band_3_gain, S_IWUSR | S_IRUGO, |
| 463 | pod_get_band_3_gain__bass, pod_set_band_3_gain__bass); | 463 | pod_get_band_3_gain__bass, pod_set_band_3_gain__bass); |
| 464 | static DEVICE_ATTR(band_3_gain, S_IWUGO | S_IRUGO, pod_get_band_3_gain, | 464 | static DEVICE_ATTR(band_3_gain, S_IWUSR | S_IRUGO, pod_get_band_3_gain, |
| 465 | pod_set_band_3_gain); | 465 | pod_set_band_3_gain); |
| 466 | static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUGO | S_IRUGO, | 466 | static DEVICE_ATTR2(band_4_gain__bass, band_4_gain, S_IWUSR | S_IRUGO, |
| 467 | pod_get_band_4_gain__bass, pod_set_band_4_gain__bass); | 467 | pod_get_band_4_gain__bass, pod_set_band_4_gain__bass); |
| 468 | static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUGO | S_IRUGO, | 468 | static DEVICE_ATTR2(band_5_gain__bass, band_5_gain, S_IWUSR | S_IRUGO, |
| 469 | pod_get_band_5_gain__bass, pod_set_band_5_gain__bass); | 469 | pod_get_band_5_gain__bass, pod_set_band_5_gain__bass); |
| 470 | static DEVICE_ATTR(band_4_gain, S_IWUGO | S_IRUGO, pod_get_band_4_gain, | 470 | static DEVICE_ATTR(band_4_gain, S_IWUSR | S_IRUGO, pod_get_band_4_gain, |
| 471 | pod_set_band_4_gain); | 471 | pod_set_band_4_gain); |
| 472 | static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUGO | S_IRUGO, | 472 | static DEVICE_ATTR2(band_6_gain__bass, band_6_gain, S_IWUSR | S_IRUGO, |
| 473 | pod_get_band_6_gain__bass, pod_set_band_6_gain__bass); | 473 | pod_get_band_6_gain__bass, pod_set_band_6_gain__bass); |
| 474 | static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write); | 474 | static DEVICE_ATTR(body, S_IRUGO, variax_get_body, line6_nop_write); |
| 475 | static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable, | 475 | static DEVICE_ATTR(pickup1_enable, S_IRUGO, variax_get_pickup1_enable, |
diff --git a/drivers/staging/line6/midi.c b/drivers/staging/line6/midi.c index 4304dfe6c166..ab67e889d2c4 100644 --- a/drivers/staging/line6/midi.c +++ b/drivers/staging/line6/midi.c | |||
| @@ -350,9 +350,9 @@ static ssize_t midi_set_midi_mask_receive(struct device *dev, | |||
| 350 | return count; | 350 | return count; |
| 351 | } | 351 | } |
| 352 | 352 | ||
| 353 | static DEVICE_ATTR(midi_mask_transmit, S_IWUGO | S_IRUGO, | 353 | static DEVICE_ATTR(midi_mask_transmit, S_IWUSR | S_IRUGO, |
| 354 | midi_get_midi_mask_transmit, midi_set_midi_mask_transmit); | 354 | midi_get_midi_mask_transmit, midi_set_midi_mask_transmit); |
| 355 | static DEVICE_ATTR(midi_mask_receive, S_IWUGO | S_IRUGO, | 355 | static DEVICE_ATTR(midi_mask_receive, S_IWUSR | S_IRUGO, |
| 356 | midi_get_midi_mask_receive, midi_set_midi_mask_receive); | 356 | midi_get_midi_mask_receive, midi_set_midi_mask_receive); |
| 357 | 357 | ||
| 358 | /* MIDI device destructor */ | 358 | /* MIDI device destructor */ |
diff --git a/drivers/staging/line6/pcm.c b/drivers/staging/line6/pcm.c index e54770e34d2e..b9c55f9eb501 100644 --- a/drivers/staging/line6/pcm.c +++ b/drivers/staging/line6/pcm.c | |||
| @@ -79,9 +79,9 @@ static ssize_t pcm_set_impulse_period(struct device *dev, | |||
| 79 | return count; | 79 | return count; |
| 80 | } | 80 | } |
| 81 | 81 | ||
| 82 | static DEVICE_ATTR(impulse_volume, S_IWUGO | S_IRUGO, pcm_get_impulse_volume, | 82 | static DEVICE_ATTR(impulse_volume, S_IWUSR | S_IRUGO, pcm_get_impulse_volume, |
| 83 | pcm_set_impulse_volume); | 83 | pcm_set_impulse_volume); |
| 84 | static DEVICE_ATTR(impulse_period, S_IWUGO | S_IRUGO, pcm_get_impulse_period, | 84 | static DEVICE_ATTR(impulse_period, S_IWUSR | S_IRUGO, pcm_get_impulse_period, |
| 85 | pcm_set_impulse_period); | 85 | pcm_set_impulse_period); |
| 86 | 86 | ||
| 87 | #endif | 87 | #endif |
diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c index 22e2cedcacf7..d9b30212585c 100644 --- a/drivers/staging/line6/pod.c +++ b/drivers/staging/line6/pod.c | |||
| @@ -1051,48 +1051,48 @@ POD_GET_SYSTEM_PARAM(tuner_pitch, 1); | |||
| 1051 | #undef GET_SYSTEM_PARAM | 1051 | #undef GET_SYSTEM_PARAM |
| 1052 | 1052 | ||
| 1053 | /* POD special files: */ | 1053 | /* POD special files: */ |
| 1054 | static DEVICE_ATTR(channel, S_IWUGO | S_IRUGO, pod_get_channel, | 1054 | static DEVICE_ATTR(channel, S_IWUSR | S_IRUGO, pod_get_channel, |
| 1055 | pod_set_channel); | 1055 | pod_set_channel); |
| 1056 | static DEVICE_ATTR(clip, S_IRUGO, pod_wait_for_clip, line6_nop_write); | 1056 | static DEVICE_ATTR(clip, S_IRUGO, pod_wait_for_clip, line6_nop_write); |
| 1057 | static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); | 1057 | static DEVICE_ATTR(device_id, S_IRUGO, pod_get_device_id, line6_nop_write); |
| 1058 | static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write); | 1058 | static DEVICE_ATTR(dirty, S_IRUGO, pod_get_dirty, line6_nop_write); |
| 1059 | static DEVICE_ATTR(dump, S_IWUGO | S_IRUGO, pod_get_dump, pod_set_dump); | 1059 | static DEVICE_ATTR(dump, S_IWUSR | S_IRUGO, pod_get_dump, pod_set_dump); |
| 1060 | static DEVICE_ATTR(dump_buf, S_IWUGO | S_IRUGO, pod_get_dump_buf, | 1060 | static DEVICE_ATTR(dump_buf, S_IWUSR | S_IRUGO, pod_get_dump_buf, |
| 1061 | pod_set_dump_buf); | 1061 | pod_set_dump_buf); |
| 1062 | static DEVICE_ATTR(finish, S_IWUGO, line6_nop_read, pod_set_finish); | 1062 | static DEVICE_ATTR(finish, S_IWUSR, line6_nop_read, pod_set_finish); |
| 1063 | static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, | 1063 | static DEVICE_ATTR(firmware_version, S_IRUGO, pod_get_firmware_version, |
| 1064 | line6_nop_write); | 1064 | line6_nop_write); |
| 1065 | static DEVICE_ATTR(midi_postprocess, S_IWUGO | S_IRUGO, | 1065 | static DEVICE_ATTR(midi_postprocess, S_IWUSR | S_IRUGO, |
| 1066 | pod_get_midi_postprocess, pod_set_midi_postprocess); | 1066 | pod_get_midi_postprocess, pod_set_midi_postprocess); |
| 1067 | static DEVICE_ATTR(monitor_level, S_IWUGO | S_IRUGO, pod_get_monitor_level, | 1067 | static DEVICE_ATTR(monitor_level, S_IWUSR | S_IRUGO, pod_get_monitor_level, |
| 1068 | pod_set_monitor_level); | 1068 | pod_set_monitor_level); |
| 1069 | static DEVICE_ATTR(name, S_IRUGO, pod_get_name, line6_nop_write); | 1069 | static DEVICE_ATTR(name, S_IRUGO, pod_get_name, line6_nop_write); |
| 1070 | static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); | 1070 | static DEVICE_ATTR(name_buf, S_IRUGO, pod_get_name_buf, line6_nop_write); |
| 1071 | static DEVICE_ATTR(retrieve_amp_setup, S_IWUGO, line6_nop_read, | 1071 | static DEVICE_ATTR(retrieve_amp_setup, S_IWUSR, line6_nop_read, |
| 1072 | pod_set_retrieve_amp_setup); | 1072 | pod_set_retrieve_amp_setup); |
| 1073 | static DEVICE_ATTR(retrieve_channel, S_IWUGO, line6_nop_read, | 1073 | static DEVICE_ATTR(retrieve_channel, S_IWUSR, line6_nop_read, |
| 1074 | pod_set_retrieve_channel); | 1074 | pod_set_retrieve_channel); |
| 1075 | static DEVICE_ATTR(retrieve_effects_setup, S_IWUGO, line6_nop_read, | 1075 | static DEVICE_ATTR(retrieve_effects_setup, S_IWUSR, line6_nop_read, |
| 1076 | pod_set_retrieve_effects_setup); | 1076 | pod_set_retrieve_effects_setup); |
| 1077 | static DEVICE_ATTR(routing, S_IWUGO | S_IRUGO, pod_get_routing, | 1077 | static DEVICE_ATTR(routing, S_IWUSR | S_IRUGO, pod_get_routing, |
| 1078 | pod_set_routing); | 1078 | pod_set_routing); |
| 1079 | static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, | 1079 | static DEVICE_ATTR(serial_number, S_IRUGO, pod_get_serial_number, |
| 1080 | line6_nop_write); | 1080 | line6_nop_write); |
| 1081 | static DEVICE_ATTR(store_amp_setup, S_IWUGO, line6_nop_read, | 1081 | static DEVICE_ATTR(store_amp_setup, S_IWUSR, line6_nop_read, |
| 1082 | pod_set_store_amp_setup); | 1082 | pod_set_store_amp_setup); |
| 1083 | static DEVICE_ATTR(store_channel, S_IWUGO, line6_nop_read, | 1083 | static DEVICE_ATTR(store_channel, S_IWUSR, line6_nop_read, |
| 1084 | pod_set_store_channel); | 1084 | pod_set_store_channel); |
| 1085 | static DEVICE_ATTR(store_effects_setup, S_IWUGO, line6_nop_read, | 1085 | static DEVICE_ATTR(store_effects_setup, S_IWUSR, line6_nop_read, |
| 1086 | pod_set_store_effects_setup); | 1086 | pod_set_store_effects_setup); |
| 1087 | static DEVICE_ATTR(tuner_freq, S_IWUGO | S_IRUGO, pod_get_tuner_freq, | 1087 | static DEVICE_ATTR(tuner_freq, S_IWUSR | S_IRUGO, pod_get_tuner_freq, |
| 1088 | pod_set_tuner_freq); | 1088 | pod_set_tuner_freq); |
| 1089 | static DEVICE_ATTR(tuner_mute, S_IWUGO | S_IRUGO, pod_get_tuner_mute, | 1089 | static DEVICE_ATTR(tuner_mute, S_IWUSR | S_IRUGO, pod_get_tuner_mute, |
| 1090 | pod_set_tuner_mute); | 1090 | pod_set_tuner_mute); |
| 1091 | static DEVICE_ATTR(tuner_note, S_IRUGO, pod_get_tuner_note, line6_nop_write); | 1091 | static DEVICE_ATTR(tuner_note, S_IRUGO, pod_get_tuner_note, line6_nop_write); |
| 1092 | static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write); | 1092 | static DEVICE_ATTR(tuner_pitch, S_IRUGO, pod_get_tuner_pitch, line6_nop_write); |
| 1093 | 1093 | ||
| 1094 | #ifdef CONFIG_LINE6_USB_RAW | 1094 | #ifdef CONFIG_LINE6_USB_RAW |
| 1095 | static DEVICE_ATTR(raw, S_IWUGO, line6_nop_read, line6_set_raw); | 1095 | static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); |
| 1096 | #endif | 1096 | #endif |
| 1097 | 1097 | ||
| 1098 | /* control info callback */ | 1098 | /* control info callback */ |
diff --git a/drivers/staging/line6/toneport.c b/drivers/staging/line6/toneport.c index 6a10b0f9749a..879e6992bbc6 100644 --- a/drivers/staging/line6/toneport.c +++ b/drivers/staging/line6/toneport.c | |||
| @@ -154,9 +154,9 @@ static ssize_t toneport_set_led_green(struct device *dev, | |||
| 154 | return count; | 154 | return count; |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | static DEVICE_ATTR(led_red, S_IWUGO | S_IRUGO, line6_nop_read, | 157 | static DEVICE_ATTR(led_red, S_IWUSR | S_IRUGO, line6_nop_read, |
| 158 | toneport_set_led_red); | 158 | toneport_set_led_red); |
| 159 | static DEVICE_ATTR(led_green, S_IWUGO | S_IRUGO, line6_nop_read, | 159 | static DEVICE_ATTR(led_green, S_IWUSR | S_IRUGO, line6_nop_read, |
| 160 | toneport_set_led_green); | 160 | toneport_set_led_green); |
| 161 | 161 | ||
| 162 | static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2) | 162 | static int toneport_send_cmd(struct usb_device *usbdev, int cmd1, int cmd2) |
diff --git a/drivers/staging/line6/variax.c b/drivers/staging/line6/variax.c index 894eee7f2317..81241cdf1be9 100644 --- a/drivers/staging/line6/variax.c +++ b/drivers/staging/line6/variax.c | |||
| @@ -549,21 +549,21 @@ static ssize_t variax_set_raw2(struct device *dev, | |||
| 549 | #endif | 549 | #endif |
| 550 | 550 | ||
| 551 | /* Variax workbench special files: */ | 551 | /* Variax workbench special files: */ |
| 552 | static DEVICE_ATTR(model, S_IWUGO | S_IRUGO, variax_get_model, | 552 | static DEVICE_ATTR(model, S_IWUSR | S_IRUGO, variax_get_model, |
| 553 | variax_set_model); | 553 | variax_set_model); |
| 554 | static DEVICE_ATTR(volume, S_IWUGO | S_IRUGO, variax_get_volume, | 554 | static DEVICE_ATTR(volume, S_IWUSR | S_IRUGO, variax_get_volume, |
| 555 | variax_set_volume); | 555 | variax_set_volume); |
| 556 | static DEVICE_ATTR(tone, S_IWUGO | S_IRUGO, variax_get_tone, variax_set_tone); | 556 | static DEVICE_ATTR(tone, S_IWUSR | S_IRUGO, variax_get_tone, variax_set_tone); |
| 557 | static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); | 557 | static DEVICE_ATTR(name, S_IRUGO, variax_get_name, line6_nop_write); |
| 558 | static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); | 558 | static DEVICE_ATTR(bank, S_IRUGO, variax_get_bank, line6_nop_write); |
| 559 | static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); | 559 | static DEVICE_ATTR(dump, S_IRUGO, variax_get_dump, line6_nop_write); |
| 560 | static DEVICE_ATTR(active, S_IWUGO | S_IRUGO, variax_get_active, | 560 | static DEVICE_ATTR(active, S_IWUSR | S_IRUGO, variax_get_active, |
| 561 | variax_set_active); | 561 | variax_set_active); |
| 562 | static DEVICE_ATTR(guitar, S_IRUGO, variax_get_guitar, line6_nop_write); | 562 | static DEVICE_ATTR(guitar, S_IRUGO, variax_get_guitar, line6_nop_write); |
| 563 | 563 | ||
| 564 | #ifdef CONFIG_LINE6_USB_RAW | 564 | #ifdef CONFIG_LINE6_USB_RAW |
| 565 | static DEVICE_ATTR(raw, S_IWUGO, line6_nop_read, line6_set_raw); | 565 | static DEVICE_ATTR(raw, S_IWUSR, line6_nop_read, line6_set_raw); |
| 566 | static DEVICE_ATTR(raw2, S_IWUGO, line6_nop_read, variax_set_raw2); | 566 | static DEVICE_ATTR(raw2, S_IWUSR, line6_nop_read, variax_set_raw2); |
| 567 | #endif | 567 | #endif |
| 568 | 568 | ||
| 569 | /* | 569 | /* |
diff --git a/drivers/staging/quickstart/quickstart.c b/drivers/staging/quickstart/quickstart.c index d746715d3d89..d83bec876d2e 100644 --- a/drivers/staging/quickstart/quickstart.c +++ b/drivers/staging/quickstart/quickstart.c | |||
| @@ -355,7 +355,6 @@ static int quickstart_acpi_remove(struct acpi_device *device, int type) | |||
| 355 | static void quickstart_exit(void) | 355 | static void quickstart_exit(void) |
| 356 | { | 356 | { |
| 357 | input_unregister_device(quickstart_input); | 357 | input_unregister_device(quickstart_input); |
| 358 | input_free_device(quickstart_input); | ||
| 359 | 358 | ||
| 360 | device_remove_file(&pf_device->dev, &dev_attr_pressed_button); | 359 | device_remove_file(&pf_device->dev, &dev_attr_pressed_button); |
| 361 | device_remove_file(&pf_device->dev, &dev_attr_buttons); | 360 | device_remove_file(&pf_device->dev, &dev_attr_buttons); |
| @@ -375,6 +374,7 @@ static int __init quickstart_init_input(void) | |||
| 375 | { | 374 | { |
| 376 | struct quickstart_btn **ptr = &quickstart_data.btn_lst; | 375 | struct quickstart_btn **ptr = &quickstart_data.btn_lst; |
| 377 | int count; | 376 | int count; |
| 377 | int ret; | ||
| 378 | 378 | ||
| 379 | quickstart_input = input_allocate_device(); | 379 | quickstart_input = input_allocate_device(); |
| 380 | 380 | ||
| @@ -391,7 +391,13 @@ static int __init quickstart_init_input(void) | |||
| 391 | ptr = &((*ptr)->next); | 391 | ptr = &((*ptr)->next); |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | return input_register_device(quickstart_input); | 394 | ret = input_register_device(quickstart_input); |
| 395 | if (ret) { | ||
| 396 | input_free_device(quickstart_input); | ||
| 397 | return ret; | ||
| 398 | } | ||
| 399 | |||
| 400 | return 0; | ||
| 395 | } | 401 | } |
| 396 | 402 | ||
| 397 | static int __init quickstart_init(void) | 403 | static int __init quickstart_init(void) |
diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index ddacfc6c4861..cd15daae5412 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c | |||
| @@ -182,6 +182,7 @@ struct usb_device_id rtusb_usb_id[] = { | |||
| 182 | {USB_DEVICE(0x2001, 0x3C09)}, /* D-Link */ | 182 | {USB_DEVICE(0x2001, 0x3C09)}, /* D-Link */ |
| 183 | {USB_DEVICE(0x2001, 0x3C0A)}, /* D-Link 3072 */ | 183 | {USB_DEVICE(0x2001, 0x3C0A)}, /* D-Link 3072 */ |
| 184 | {USB_DEVICE(0x2019, 0xED14)}, /* Planex Communications, Inc. */ | 184 | {USB_DEVICE(0x2019, 0xED14)}, /* Planex Communications, Inc. */ |
| 185 | {USB_DEVICE(0x0411, 0x015D)}, /* Buffalo Airstation WLI-UC-GN */ | ||
| 185 | {} /* Terminating entry */ | 186 | {} /* Terminating entry */ |
| 186 | }; | 187 | }; |
| 187 | 188 | ||
diff --git a/drivers/staging/rtl8187se/r8185b_init.c b/drivers/staging/rtl8187se/r8185b_init.c index 46000d72f4c4..3bdf9b31cc4e 100644 --- a/drivers/staging/rtl8187se/r8185b_init.c +++ b/drivers/staging/rtl8187se/r8185b_init.c | |||
| @@ -264,8 +264,12 @@ HwHSSIThreeWire( | |||
| 264 | 264 | ||
| 265 | udelay(10); | 265 | udelay(10); |
| 266 | } | 266 | } |
| 267 | if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) | 267 | if (TryCnt == TC_3W_POLL_MAX_TRY_CNT) { |
| 268 | panic("HwThreeWire(): CmdReg: %#X RE|WE bits are not clear!!\n", u1bTmp); | 268 | printk(KERN_ERR "rtl8187se: HwThreeWire(): CmdReg:" |
| 269 | " %#X RE|WE bits are not clear!!\n", u1bTmp); | ||
| 270 | dump_stack(); | ||
| 271 | return 0; | ||
| 272 | } | ||
| 269 | 273 | ||
| 270 | /* RTL8187S HSSI Read/Write Function */ | 274 | /* RTL8187S HSSI Read/Write Function */ |
| 271 | u1bTmp = read_nic_byte(dev, RF_SW_CONFIG); | 275 | u1bTmp = read_nic_byte(dev, RF_SW_CONFIG); |
| @@ -298,13 +302,23 @@ HwHSSIThreeWire( | |||
| 298 | int idx; | 302 | int idx; |
| 299 | int ByteCnt = nDataBufBitCnt / 8; | 303 | int ByteCnt = nDataBufBitCnt / 8; |
| 300 | /* printk("%d\n",nDataBufBitCnt); */ | 304 | /* printk("%d\n",nDataBufBitCnt); */ |
| 301 | if ((nDataBufBitCnt % 8) != 0) | 305 | if ((nDataBufBitCnt % 8) != 0) { |
| 302 | panic("HwThreeWire(): nDataBufBitCnt(%d) should be multiple of 8!!!\n", | 306 | printk(KERN_ERR "rtl8187se: " |
| 303 | nDataBufBitCnt); | 307 | "HwThreeWire(): nDataBufBitCnt(%d)" |
| 308 | " should be multiple of 8!!!\n", | ||
| 309 | nDataBufBitCnt); | ||
| 310 | dump_stack(); | ||
| 311 | nDataBufBitCnt += 8; | ||
| 312 | nDataBufBitCnt &= ~7; | ||
| 313 | } | ||
| 304 | 314 | ||
| 305 | if (nDataBufBitCnt > 64) | 315 | if (nDataBufBitCnt > 64) { |
| 306 | panic("HwThreeWire(): nDataBufBitCnt(%d) should <= 64!!!\n", | 316 | printk(KERN_ERR "rtl8187se: HwThreeWire():" |
| 307 | nDataBufBitCnt); | 317 | " nDataBufBitCnt(%d) should <= 64!!!\n", |
| 318 | nDataBufBitCnt); | ||
| 319 | dump_stack(); | ||
| 320 | nDataBufBitCnt = 64; | ||
| 321 | } | ||
| 308 | 322 | ||
| 309 | for (idx = 0; idx < ByteCnt; idx++) | 323 | for (idx = 0; idx < ByteCnt; idx++) |
| 310 | write_nic_byte(dev, (SW_3W_DB0+idx), *(pDataBuf+idx)); | 324 | write_nic_byte(dev, (SW_3W_DB0+idx), *(pDataBuf+idx)); |
diff --git a/drivers/staging/rtl8712/usb_halinit.c b/drivers/staging/rtl8712/usb_halinit.c index f6569dce3012..0e9483bbabe1 100644 --- a/drivers/staging/rtl8712/usb_halinit.c +++ b/drivers/staging/rtl8712/usb_halinit.c | |||
| @@ -37,7 +37,7 @@ u8 r8712_usb_hal_bus_init(struct _adapter *padapter) | |||
| 37 | { | 37 | { |
| 38 | u8 val8 = 0; | 38 | u8 val8 = 0; |
| 39 | u8 ret = _SUCCESS; | 39 | u8 ret = _SUCCESS; |
| 40 | u8 PollingCnt = 20; | 40 | int PollingCnt = 20; |
| 41 | struct registry_priv *pregistrypriv = &padapter->registrypriv; | 41 | struct registry_priv *pregistrypriv = &padapter->registrypriv; |
| 42 | 42 | ||
| 43 | if (pregistrypriv->chip_version == RTL8712_FPGA) { | 43 | if (pregistrypriv->chip_version == RTL8712_FPGA) { |
diff --git a/drivers/staging/samsung-laptop/samsung-laptop.c b/drivers/staging/samsung-laptop/samsung-laptop.c index eb44b60e1eb5..ac2bf11e1119 100644 --- a/drivers/staging/samsung-laptop/samsung-laptop.c +++ b/drivers/staging/samsung-laptop/samsung-laptop.c | |||
| @@ -356,7 +356,7 @@ static ssize_t set_silent_state(struct device *dev, | |||
| 356 | } | 356 | } |
| 357 | return count; | 357 | return count; |
| 358 | } | 358 | } |
| 359 | static DEVICE_ATTR(silent, S_IWUGO | S_IRUGO, | 359 | static DEVICE_ATTR(silent, S_IWUSR | S_IRUGO, |
| 360 | get_silent_state, set_silent_state); | 360 | get_silent_state, set_silent_state); |
| 361 | 361 | ||
| 362 | 362 | ||
diff --git a/drivers/staging/speakup/fakekey.c b/drivers/staging/speakup/fakekey.c index adb93f21c0d6..65b231178f05 100644 --- a/drivers/staging/speakup/fakekey.c +++ b/drivers/staging/speakup/fakekey.c | |||
| @@ -62,7 +62,6 @@ void speakup_remove_virtual_keyboard(void) | |||
| 62 | { | 62 | { |
| 63 | if (virt_keyboard != NULL) { | 63 | if (virt_keyboard != NULL) { |
| 64 | input_unregister_device(virt_keyboard); | 64 | input_unregister_device(virt_keyboard); |
| 65 | input_free_device(virt_keyboard); | ||
| 66 | virt_keyboard = NULL; | 65 | virt_keyboard = NULL; |
| 67 | } | 66 | } |
| 68 | } | 67 | } |
diff --git a/drivers/staging/spectra/ffsport.c b/drivers/staging/spectra/ffsport.c index c7932da03c56..63a9d0adf32d 100644 --- a/drivers/staging/spectra/ffsport.c +++ b/drivers/staging/spectra/ffsport.c | |||
| @@ -656,7 +656,7 @@ static int SBD_setup_device(struct spectra_nand_dev *dev, int which) | |||
| 656 | /* Here we force report 512 byte hardware sector size to Kernel */ | 656 | /* Here we force report 512 byte hardware sector size to Kernel */ |
| 657 | blk_queue_logical_block_size(dev->queue, 512); | 657 | blk_queue_logical_block_size(dev->queue, 512); |
| 658 | 658 | ||
| 659 | blk_queue_ordered(dev->queue, QUEUE_ORDERED_DRAIN_FLUSH); | 659 | blk_queue_flush(dev->queue, REQ_FLUSH); |
| 660 | 660 | ||
| 661 | dev->thread = kthread_run(spectra_trans_thread, dev, "nand_thd"); | 661 | dev->thread = kthread_run(spectra_trans_thread, dev, "nand_thd"); |
| 662 | if (IS_ERR(dev->thread)) { | 662 | if (IS_ERR(dev->thread)) { |
diff --git a/drivers/staging/tm6000/tm6000-cards.c b/drivers/staging/tm6000/tm6000-cards.c index 664e6038090d..b143258f094a 100644 --- a/drivers/staging/tm6000/tm6000-cards.c +++ b/drivers/staging/tm6000/tm6000-cards.c | |||
| @@ -545,7 +545,7 @@ static void tm6000_config_tuner(struct tm6000_core *dev) | |||
| 545 | 545 | ||
| 546 | /* Load tuner module */ | 546 | /* Load tuner module */ |
| 547 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 547 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 548 | NULL, "tuner", dev->tuner_addr, NULL); | 548 | "tuner", dev->tuner_addr, NULL); |
| 549 | 549 | ||
| 550 | memset(&tun_setup, 0, sizeof(tun_setup)); | 550 | memset(&tun_setup, 0, sizeof(tun_setup)); |
| 551 | tun_setup.type = dev->tuner_type; | 551 | tun_setup.type = dev->tuner_type; |
| @@ -683,7 +683,7 @@ static int tm6000_init_dev(struct tm6000_core *dev) | |||
| 683 | 683 | ||
| 684 | if (dev->caps.has_tda9874) | 684 | if (dev->caps.has_tda9874) |
| 685 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, | 685 | v4l2_i2c_new_subdev(&dev->v4l2_dev, &dev->i2c_adap, |
| 686 | NULL, "tvaudio", I2C_ADDR_TDA9874, NULL); | 686 | "tvaudio", I2C_ADDR_TDA9874, NULL); |
| 687 | 687 | ||
| 688 | /* register and initialize V4L2 */ | 688 | /* register and initialize V4L2 */ |
| 689 | rc = tm6000_v4l2_register(dev); | 689 | rc = tm6000_v4l2_register(dev); |
diff --git a/drivers/staging/udlfb/udlfb.c b/drivers/staging/udlfb/udlfb.c index fed25105970a..b7ac16005265 100644 --- a/drivers/staging/udlfb/udlfb.c +++ b/drivers/staging/udlfb/udlfb.c | |||
| @@ -1441,7 +1441,7 @@ static struct device_attribute fb_device_attrs[] = { | |||
| 1441 | __ATTR_RO(metrics_bytes_identical), | 1441 | __ATTR_RO(metrics_bytes_identical), |
| 1442 | __ATTR_RO(metrics_bytes_sent), | 1442 | __ATTR_RO(metrics_bytes_sent), |
| 1443 | __ATTR_RO(metrics_cpu_kcycles_used), | 1443 | __ATTR_RO(metrics_cpu_kcycles_used), |
| 1444 | __ATTR(metrics_reset, S_IWUGO, NULL, metrics_reset_store), | 1444 | __ATTR(metrics_reset, S_IWUSR, NULL, metrics_reset_store), |
| 1445 | }; | 1445 | }; |
| 1446 | 1446 | ||
| 1447 | /* | 1447 | /* |
diff --git a/drivers/staging/winbond/sysdef.h b/drivers/staging/winbond/sysdef.h index 9195adf98e14..d0d71f69bc8c 100644 --- a/drivers/staging/winbond/sysdef.h +++ b/drivers/staging/winbond/sysdef.h | |||
| @@ -2,6 +2,9 @@ | |||
| 2 | 2 | ||
| 3 | #ifndef SYS_DEF_H | 3 | #ifndef SYS_DEF_H |
| 4 | #define SYS_DEF_H | 4 | #define SYS_DEF_H |
| 5 | |||
| 6 | #include <linux/delay.h> | ||
| 7 | |||
| 5 | #define WB_LINUX | 8 | #define WB_LINUX |
| 6 | #define WB_LINUX_WPA_PSK | 9 | #define WB_LINUX_WPA_PSK |
| 7 | 10 | ||
diff --git a/drivers/staging/zram/zram_sysfs.c b/drivers/staging/zram/zram_sysfs.c index 6c574a994d11..6b3cf00b0ff4 100644 --- a/drivers/staging/zram/zram_sysfs.c +++ b/drivers/staging/zram/zram_sysfs.c | |||
| @@ -189,10 +189,10 @@ static ssize_t mem_used_total_show(struct device *dev, | |||
| 189 | return sprintf(buf, "%llu\n", val); | 189 | return sprintf(buf, "%llu\n", val); |
| 190 | } | 190 | } |
| 191 | 191 | ||
| 192 | static DEVICE_ATTR(disksize, S_IRUGO | S_IWUGO, | 192 | static DEVICE_ATTR(disksize, S_IRUGO | S_IWUSR, |
| 193 | disksize_show, disksize_store); | 193 | disksize_show, disksize_store); |
| 194 | static DEVICE_ATTR(initstate, S_IRUGO, initstate_show, NULL); | 194 | static DEVICE_ATTR(initstate, S_IRUGO, initstate_show, NULL); |
| 195 | static DEVICE_ATTR(reset, S_IWUGO, NULL, reset_store); | 195 | static DEVICE_ATTR(reset, S_IWUSR, NULL, reset_store); |
| 196 | static DEVICE_ATTR(num_reads, S_IRUGO, num_reads_show, NULL); | 196 | static DEVICE_ATTR(num_reads, S_IRUGO, num_reads_show, NULL); |
| 197 | static DEVICE_ATTR(num_writes, S_IRUGO, num_writes_show, NULL); | 197 | static DEVICE_ATTR(num_writes, S_IRUGO, num_writes_show, NULL); |
| 198 | static DEVICE_ATTR(invalid_io, S_IRUGO, invalid_io_show, NULL); | 198 | static DEVICE_ATTR(invalid_io, S_IRUGO, invalid_io_show, NULL); |
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c index c05c5af5aa04..35480dd57a30 100644 --- a/drivers/tty/tty_io.c +++ b/drivers/tty/tty_io.c | |||
| @@ -559,6 +559,9 @@ void __tty_hangup(struct tty_struct *tty) | |||
| 559 | 559 | ||
| 560 | tty_lock(); | 560 | tty_lock(); |
| 561 | 561 | ||
| 562 | /* some functions below drop BTM, so we need this bit */ | ||
| 563 | set_bit(TTY_HUPPING, &tty->flags); | ||
| 564 | |||
| 562 | /* inuse_filps is protected by the single tty lock, | 565 | /* inuse_filps is protected by the single tty lock, |
| 563 | this really needs to change if we want to flush the | 566 | this really needs to change if we want to flush the |
| 564 | workqueue with the lock held */ | 567 | workqueue with the lock held */ |
| @@ -578,6 +581,10 @@ void __tty_hangup(struct tty_struct *tty) | |||
| 578 | } | 581 | } |
| 579 | spin_unlock(&tty_files_lock); | 582 | spin_unlock(&tty_files_lock); |
| 580 | 583 | ||
| 584 | /* | ||
| 585 | * it drops BTM and thus races with reopen | ||
| 586 | * we protect the race by TTY_HUPPING | ||
| 587 | */ | ||
| 581 | tty_ldisc_hangup(tty); | 588 | tty_ldisc_hangup(tty); |
| 582 | 589 | ||
| 583 | read_lock(&tasklist_lock); | 590 | read_lock(&tasklist_lock); |
| @@ -615,7 +622,6 @@ void __tty_hangup(struct tty_struct *tty) | |||
| 615 | tty->session = NULL; | 622 | tty->session = NULL; |
| 616 | tty->pgrp = NULL; | 623 | tty->pgrp = NULL; |
| 617 | tty->ctrl_status = 0; | 624 | tty->ctrl_status = 0; |
| 618 | set_bit(TTY_HUPPED, &tty->flags); | ||
| 619 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); | 625 | spin_unlock_irqrestore(&tty->ctrl_lock, flags); |
| 620 | 626 | ||
| 621 | /* Account for the p->signal references we killed */ | 627 | /* Account for the p->signal references we killed */ |
| @@ -641,6 +647,7 @@ void __tty_hangup(struct tty_struct *tty) | |||
| 641 | * can't yet guarantee all that. | 647 | * can't yet guarantee all that. |
| 642 | */ | 648 | */ |
| 643 | set_bit(TTY_HUPPED, &tty->flags); | 649 | set_bit(TTY_HUPPED, &tty->flags); |
| 650 | clear_bit(TTY_HUPPING, &tty->flags); | ||
| 644 | tty_ldisc_enable(tty); | 651 | tty_ldisc_enable(tty); |
| 645 | 652 | ||
| 646 | tty_unlock(); | 653 | tty_unlock(); |
| @@ -1310,7 +1317,9 @@ static int tty_reopen(struct tty_struct *tty) | |||
| 1310 | { | 1317 | { |
| 1311 | struct tty_driver *driver = tty->driver; | 1318 | struct tty_driver *driver = tty->driver; |
| 1312 | 1319 | ||
| 1313 | if (test_bit(TTY_CLOSING, &tty->flags)) | 1320 | if (test_bit(TTY_CLOSING, &tty->flags) || |
| 1321 | test_bit(TTY_HUPPING, &tty->flags) || | ||
| 1322 | test_bit(TTY_LDISC_CHANGING, &tty->flags)) | ||
| 1314 | return -EIO; | 1323 | return -EIO; |
| 1315 | 1324 | ||
| 1316 | if (driver->type == TTY_DRIVER_TYPE_PTY && | 1325 | if (driver->type == TTY_DRIVER_TYPE_PTY && |
diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c index d8e96b005023..4214d58276f7 100644 --- a/drivers/tty/tty_ldisc.c +++ b/drivers/tty/tty_ldisc.c | |||
| @@ -454,6 +454,8 @@ static int tty_ldisc_open(struct tty_struct *tty, struct tty_ldisc *ld) | |||
| 454 | /* BTM here locks versus a hangup event */ | 454 | /* BTM here locks versus a hangup event */ |
| 455 | WARN_ON(!tty_locked()); | 455 | WARN_ON(!tty_locked()); |
| 456 | ret = ld->ops->open(tty); | 456 | ret = ld->ops->open(tty); |
| 457 | if (ret) | ||
| 458 | clear_bit(TTY_LDISC_OPEN, &tty->flags); | ||
| 457 | return ret; | 459 | return ret; |
| 458 | } | 460 | } |
| 459 | return 0; | 461 | return 0; |
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c index a858d2b87b94..51fe1795d5a8 100644 --- a/drivers/uio/uio.c +++ b/drivers/uio/uio.c | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de> | 4 | * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de> |
| 5 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> | 5 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> |
| 6 | * Copyright(C) 2006, Hans J. Koch <hjk@linutronix.de> | 6 | * Copyright(C) 2006, Hans J. Koch <hjk@hansjkoch.de> |
| 7 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> | 7 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> |
| 8 | * | 8 | * |
| 9 | * Userspace IO | 9 | * Userspace IO |
diff --git a/drivers/uio/uio_cif.c b/drivers/uio/uio_cif.c index a8ea2f19a0cc..a84a451159ed 100644 --- a/drivers/uio/uio_cif.c +++ b/drivers/uio/uio_cif.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * UIO Hilscher CIF card driver | 2 | * UIO Hilscher CIF card driver |
| 3 | * | 3 | * |
| 4 | * (C) 2007 Hans J. Koch <hjk@linutronix.de> | 4 | * (C) 2007 Hans J. Koch <hjk@hansjkoch.de> |
| 5 | * Original code (C) 2005 Benedikt Spranger <b.spranger@linutronix.de> | 5 | * Original code (C) 2005 Benedikt Spranger <b.spranger@linutronix.de> |
| 6 | * | 6 | * |
| 7 | * Licensed under GPL version 2 only. | 7 | * Licensed under GPL version 2 only. |
diff --git a/drivers/uio/uio_netx.c b/drivers/uio/uio_netx.c index 5a18e9f7b836..5ffdb483b015 100644 --- a/drivers/uio/uio_netx.c +++ b/drivers/uio/uio_netx.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * UIO driver for Hilscher NetX based fieldbus cards (cifX, comX). | 2 | * UIO driver for Hilscher NetX based fieldbus cards (cifX, comX). |
| 3 | * See http://www.hilscher.com for details. | 3 | * See http://www.hilscher.com for details. |
| 4 | * | 4 | * |
| 5 | * (C) 2007 Hans J. Koch <hjk@linutronix.de> | 5 | * (C) 2007 Hans J. Koch <hjk@hansjkoch.de> |
| 6 | * (C) 2008 Manuel Traut <manut@linutronix.de> | 6 | * (C) 2008 Manuel Traut <manut@linutronix.de> |
| 7 | * | 7 | * |
| 8 | * Licensed under GPL version 2 only. | 8 | * Licensed under GPL version 2 only. |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 61800f77dac8..ced846ac4141 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
| @@ -1330,6 +1330,8 @@ static int map_urb_for_dma(struct usb_hcd *hcd, struct urb *urb, | |||
| 1330 | */ | 1330 | */ |
| 1331 | 1331 | ||
| 1332 | if (usb_endpoint_xfer_control(&urb->ep->desc)) { | 1332 | if (usb_endpoint_xfer_control(&urb->ep->desc)) { |
| 1333 | if (hcd->self.uses_pio_for_control) | ||
| 1334 | return ret; | ||
| 1333 | if (hcd->self.uses_dma) { | 1335 | if (hcd->self.uses_dma) { |
| 1334 | urb->setup_dma = dma_map_single( | 1336 | urb->setup_dma = dma_map_single( |
| 1335 | hcd->self.controller, | 1337 | hcd->self.controller, |
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 01bb72b71832..655f3c9f88bf 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
| @@ -161,6 +161,18 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
| 161 | if (pdev->revision < 0xa4) | 161 | if (pdev->revision < 0xa4) |
| 162 | ehci->no_selective_suspend = 1; | 162 | ehci->no_selective_suspend = 1; |
| 163 | break; | 163 | break; |
| 164 | |||
| 165 | /* MCP89 chips on the MacBookAir3,1 give EPROTO when | ||
| 166 | * fetching device descriptors unless LPM is disabled. | ||
| 167 | * There are also intermittent problems enumerating | ||
| 168 | * devices with PPCD enabled. | ||
| 169 | */ | ||
| 170 | case 0x0d9d: | ||
| 171 | ehci_info(ehci, "disable lpm/ppcd for nvidia mcp89"); | ||
| 172 | ehci->has_lpm = 0; | ||
| 173 | ehci->has_ppcd = 0; | ||
| 174 | ehci->command &= ~CMD_PPCEE; | ||
| 175 | break; | ||
| 164 | } | 176 | } |
| 165 | break; | 177 | break; |
| 166 | case PCI_VENDOR_ID_VIA: | 178 | case PCI_VENDOR_ID_VIA: |
diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index fef5a1f9d483..5d963e350494 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c | |||
| @@ -229,6 +229,13 @@ void xhci_ring_device(struct xhci_hcd *xhci, int slot_id) | |||
| 229 | static void xhci_disable_port(struct xhci_hcd *xhci, u16 wIndex, | 229 | static void xhci_disable_port(struct xhci_hcd *xhci, u16 wIndex, |
| 230 | u32 __iomem *addr, u32 port_status) | 230 | u32 __iomem *addr, u32 port_status) |
| 231 | { | 231 | { |
| 232 | /* Don't allow the USB core to disable SuperSpeed ports. */ | ||
| 233 | if (xhci->port_array[wIndex] == 0x03) { | ||
| 234 | xhci_dbg(xhci, "Ignoring request to disable " | ||
| 235 | "SuperSpeed port.\n"); | ||
| 236 | return; | ||
| 237 | } | ||
| 238 | |||
| 232 | /* Write 1 to disable the port */ | 239 | /* Write 1 to disable the port */ |
| 233 | xhci_writel(xhci, port_status | PORT_PE, addr); | 240 | xhci_writel(xhci, port_status | PORT_PE, addr); |
| 234 | port_status = xhci_readl(xhci, addr); | 241 | port_status = xhci_readl(xhci, addr); |
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index d178761c3981..0fae58ef8afe 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c | |||
| @@ -1443,6 +1443,13 @@ void xhci_mem_cleanup(struct xhci_hcd *xhci) | |||
| 1443 | xhci->dcbaa = NULL; | 1443 | xhci->dcbaa = NULL; |
| 1444 | 1444 | ||
| 1445 | scratchpad_free(xhci); | 1445 | scratchpad_free(xhci); |
| 1446 | |||
| 1447 | xhci->num_usb2_ports = 0; | ||
| 1448 | xhci->num_usb3_ports = 0; | ||
| 1449 | kfree(xhci->usb2_ports); | ||
| 1450 | kfree(xhci->usb3_ports); | ||
| 1451 | kfree(xhci->port_array); | ||
| 1452 | |||
| 1446 | xhci->page_size = 0; | 1453 | xhci->page_size = 0; |
| 1447 | xhci->page_shift = 0; | 1454 | xhci->page_shift = 0; |
| 1448 | xhci->bus_suspended = 0; | 1455 | xhci->bus_suspended = 0; |
| @@ -1627,6 +1634,161 @@ static void xhci_set_hc_event_deq(struct xhci_hcd *xhci) | |||
| 1627 | &xhci->ir_set->erst_dequeue); | 1634 | &xhci->ir_set->erst_dequeue); |
| 1628 | } | 1635 | } |
| 1629 | 1636 | ||
| 1637 | static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports, | ||
| 1638 | u32 __iomem *addr, u8 major_revision) | ||
| 1639 | { | ||
| 1640 | u32 temp, port_offset, port_count; | ||
| 1641 | int i; | ||
| 1642 | |||
| 1643 | if (major_revision > 0x03) { | ||
| 1644 | xhci_warn(xhci, "Ignoring unknown port speed, " | ||
| 1645 | "Ext Cap %p, revision = 0x%x\n", | ||
| 1646 | addr, major_revision); | ||
| 1647 | /* Ignoring port protocol we can't understand. FIXME */ | ||
| 1648 | return; | ||
| 1649 | } | ||
| 1650 | |||
| 1651 | /* Port offset and count in the third dword, see section 7.2 */ | ||
| 1652 | temp = xhci_readl(xhci, addr + 2); | ||
| 1653 | port_offset = XHCI_EXT_PORT_OFF(temp); | ||
| 1654 | port_count = XHCI_EXT_PORT_COUNT(temp); | ||
| 1655 | xhci_dbg(xhci, "Ext Cap %p, port offset = %u, " | ||
| 1656 | "count = %u, revision = 0x%x\n", | ||
| 1657 | addr, port_offset, port_count, major_revision); | ||
| 1658 | /* Port count includes the current port offset */ | ||
| 1659 | if (port_offset == 0 || (port_offset + port_count - 1) > num_ports) | ||
| 1660 | /* WTF? "Valid values are ‘1’ to MaxPorts" */ | ||
| 1661 | return; | ||
| 1662 | port_offset--; | ||
| 1663 | for (i = port_offset; i < (port_offset + port_count); i++) { | ||
| 1664 | /* Duplicate entry. Ignore the port if the revisions differ. */ | ||
| 1665 | if (xhci->port_array[i] != 0) { | ||
| 1666 | xhci_warn(xhci, "Duplicate port entry, Ext Cap %p," | ||
| 1667 | " port %u\n", addr, i); | ||
| 1668 | xhci_warn(xhci, "Port was marked as USB %u, " | ||
| 1669 | "duplicated as USB %u\n", | ||
| 1670 | xhci->port_array[i], major_revision); | ||
| 1671 | /* Only adjust the roothub port counts if we haven't | ||
| 1672 | * found a similar duplicate. | ||
| 1673 | */ | ||
| 1674 | if (xhci->port_array[i] != major_revision && | ||
| 1675 | xhci->port_array[i] != (u8) -1) { | ||
| 1676 | if (xhci->port_array[i] == 0x03) | ||
| 1677 | xhci->num_usb3_ports--; | ||
| 1678 | else | ||
| 1679 | xhci->num_usb2_ports--; | ||
| 1680 | xhci->port_array[i] = (u8) -1; | ||
| 1681 | } | ||
| 1682 | /* FIXME: Should we disable the port? */ | ||
| 1683 | } | ||
| 1684 | xhci->port_array[i] = major_revision; | ||
| 1685 | if (major_revision == 0x03) | ||
| 1686 | xhci->num_usb3_ports++; | ||
| 1687 | else | ||
| 1688 | xhci->num_usb2_ports++; | ||
| 1689 | } | ||
| 1690 | /* FIXME: Should we disable ports not in the Extended Capabilities? */ | ||
| 1691 | } | ||
| 1692 | |||
| 1693 | /* | ||
| 1694 | * Scan the Extended Capabilities for the "Supported Protocol Capabilities" that | ||
| 1695 | * specify what speeds each port is supposed to be. We can't count on the port | ||
| 1696 | * speed bits in the PORTSC register being correct until a device is connected, | ||
| 1697 | * but we need to set up the two fake roothubs with the correct number of USB | ||
| 1698 | * 3.0 and USB 2.0 ports at host controller initialization time. | ||
| 1699 | */ | ||
| 1700 | static int xhci_setup_port_arrays(struct xhci_hcd *xhci, gfp_t flags) | ||
| 1701 | { | ||
| 1702 | u32 __iomem *addr; | ||
| 1703 | u32 offset; | ||
| 1704 | unsigned int num_ports; | ||
| 1705 | int i, port_index; | ||
| 1706 | |||
| 1707 | addr = &xhci->cap_regs->hcc_params; | ||
| 1708 | offset = XHCI_HCC_EXT_CAPS(xhci_readl(xhci, addr)); | ||
| 1709 | if (offset == 0) { | ||
| 1710 | xhci_err(xhci, "No Extended Capability registers, " | ||
| 1711 | "unable to set up roothub.\n"); | ||
| 1712 | return -ENODEV; | ||
| 1713 | } | ||
| 1714 | |||
| 1715 | num_ports = HCS_MAX_PORTS(xhci->hcs_params1); | ||
| 1716 | xhci->port_array = kzalloc(sizeof(*xhci->port_array)*num_ports, flags); | ||
| 1717 | if (!xhci->port_array) | ||
| 1718 | return -ENOMEM; | ||
| 1719 | |||
| 1720 | /* | ||
| 1721 | * For whatever reason, the first capability offset is from the | ||
| 1722 | * capability register base, not from the HCCPARAMS register. | ||
| 1723 | * See section 5.3.6 for offset calculation. | ||
| 1724 | */ | ||
| 1725 | addr = &xhci->cap_regs->hc_capbase + offset; | ||
| 1726 | while (1) { | ||
| 1727 | u32 cap_id; | ||
| 1728 | |||
| 1729 | cap_id = xhci_readl(xhci, addr); | ||
| 1730 | if (XHCI_EXT_CAPS_ID(cap_id) == XHCI_EXT_CAPS_PROTOCOL) | ||
| 1731 | xhci_add_in_port(xhci, num_ports, addr, | ||
| 1732 | (u8) XHCI_EXT_PORT_MAJOR(cap_id)); | ||
| 1733 | offset = XHCI_EXT_CAPS_NEXT(cap_id); | ||
| 1734 | if (!offset || (xhci->num_usb2_ports + xhci->num_usb3_ports) | ||
| 1735 | == num_ports) | ||
| 1736 | break; | ||
| 1737 | /* | ||
| 1738 | * Once you're into the Extended Capabilities, the offset is | ||
| 1739 | * always relative to the register holding the offset. | ||
| 1740 | */ | ||
| 1741 | addr += offset; | ||
| 1742 | } | ||
| 1743 | |||
| 1744 | if (xhci->num_usb2_ports == 0 && xhci->num_usb3_ports == 0) { | ||
| 1745 | xhci_warn(xhci, "No ports on the roothubs?\n"); | ||
| 1746 | return -ENODEV; | ||
| 1747 | } | ||
| 1748 | xhci_dbg(xhci, "Found %u USB 2.0 ports and %u USB 3.0 ports.\n", | ||
| 1749 | xhci->num_usb2_ports, xhci->num_usb3_ports); | ||
| 1750 | /* | ||
| 1751 | * Note we could have all USB 3.0 ports, or all USB 2.0 ports. | ||
| 1752 | * Not sure how the USB core will handle a hub with no ports... | ||
| 1753 | */ | ||
| 1754 | if (xhci->num_usb2_ports) { | ||
| 1755 | xhci->usb2_ports = kmalloc(sizeof(*xhci->usb2_ports)* | ||
| 1756 | xhci->num_usb2_ports, flags); | ||
| 1757 | if (!xhci->usb2_ports) | ||
| 1758 | return -ENOMEM; | ||
| 1759 | |||
| 1760 | port_index = 0; | ||
| 1761 | for (i = 0; i < num_ports; i++) | ||
| 1762 | if (xhci->port_array[i] != 0x03) { | ||
| 1763 | xhci->usb2_ports[port_index] = | ||
| 1764 | &xhci->op_regs->port_status_base + | ||
| 1765 | NUM_PORT_REGS*i; | ||
| 1766 | xhci_dbg(xhci, "USB 2.0 port at index %u, " | ||
| 1767 | "addr = %p\n", i, | ||
| 1768 | xhci->usb2_ports[port_index]); | ||
| 1769 | port_index++; | ||
| 1770 | } | ||
| 1771 | } | ||
| 1772 | if (xhci->num_usb3_ports) { | ||
| 1773 | xhci->usb3_ports = kmalloc(sizeof(*xhci->usb3_ports)* | ||
| 1774 | xhci->num_usb3_ports, flags); | ||
| 1775 | if (!xhci->usb3_ports) | ||
| 1776 | return -ENOMEM; | ||
| 1777 | |||
| 1778 | port_index = 0; | ||
| 1779 | for (i = 0; i < num_ports; i++) | ||
| 1780 | if (xhci->port_array[i] == 0x03) { | ||
| 1781 | xhci->usb3_ports[port_index] = | ||
| 1782 | &xhci->op_regs->port_status_base + | ||
| 1783 | NUM_PORT_REGS*i; | ||
| 1784 | xhci_dbg(xhci, "USB 3.0 port at index %u, " | ||
| 1785 | "addr = %p\n", i, | ||
| 1786 | xhci->usb3_ports[port_index]); | ||
| 1787 | port_index++; | ||
| 1788 | } | ||
| 1789 | } | ||
| 1790 | return 0; | ||
| 1791 | } | ||
| 1630 | 1792 | ||
| 1631 | int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | 1793 | int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) |
| 1632 | { | 1794 | { |
| @@ -1809,6 +1971,8 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags) | |||
| 1809 | 1971 | ||
| 1810 | if (scratchpad_alloc(xhci, flags)) | 1972 | if (scratchpad_alloc(xhci, flags)) |
| 1811 | goto fail; | 1973 | goto fail; |
| 1974 | if (xhci_setup_port_arrays(xhci, flags)) | ||
| 1975 | goto fail; | ||
| 1812 | 1976 | ||
| 1813 | return 0; | 1977 | return 0; |
| 1814 | 1978 | ||
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 06fca0835b52..45e4a3108cc3 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c | |||
| @@ -1549,6 +1549,15 @@ static int xhci_configure_endpoint(struct xhci_hcd *xhci, | |||
| 1549 | cmd_completion = command->completion; | 1549 | cmd_completion = command->completion; |
| 1550 | cmd_status = &command->status; | 1550 | cmd_status = &command->status; |
| 1551 | command->command_trb = xhci->cmd_ring->enqueue; | 1551 | command->command_trb = xhci->cmd_ring->enqueue; |
| 1552 | |||
| 1553 | /* Enqueue pointer can be left pointing to the link TRB, | ||
| 1554 | * we must handle that | ||
| 1555 | */ | ||
| 1556 | if ((command->command_trb->link.control & TRB_TYPE_BITMASK) | ||
| 1557 | == TRB_TYPE(TRB_LINK)) | ||
| 1558 | command->command_trb = | ||
| 1559 | xhci->cmd_ring->enq_seg->next->trbs; | ||
| 1560 | |||
| 1552 | list_add_tail(&command->cmd_list, &virt_dev->cmd_list); | 1561 | list_add_tail(&command->cmd_list, &virt_dev->cmd_list); |
| 1553 | } else { | 1562 | } else { |
| 1554 | in_ctx = virt_dev->in_ctx; | 1563 | in_ctx = virt_dev->in_ctx; |
| @@ -2272,6 +2281,15 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, struct usb_device *udev) | |||
| 2272 | /* Attempt to submit the Reset Device command to the command ring */ | 2281 | /* Attempt to submit the Reset Device command to the command ring */ |
| 2273 | spin_lock_irqsave(&xhci->lock, flags); | 2282 | spin_lock_irqsave(&xhci->lock, flags); |
| 2274 | reset_device_cmd->command_trb = xhci->cmd_ring->enqueue; | 2283 | reset_device_cmd->command_trb = xhci->cmd_ring->enqueue; |
| 2284 | |||
| 2285 | /* Enqueue pointer can be left pointing to the link TRB, | ||
| 2286 | * we must handle that | ||
| 2287 | */ | ||
| 2288 | if ((reset_device_cmd->command_trb->link.control & TRB_TYPE_BITMASK) | ||
| 2289 | == TRB_TYPE(TRB_LINK)) | ||
| 2290 | reset_device_cmd->command_trb = | ||
| 2291 | xhci->cmd_ring->enq_seg->next->trbs; | ||
| 2292 | |||
| 2275 | list_add_tail(&reset_device_cmd->cmd_list, &virt_dev->cmd_list); | 2293 | list_add_tail(&reset_device_cmd->cmd_list, &virt_dev->cmd_list); |
| 2276 | ret = xhci_queue_reset_device(xhci, slot_id); | 2294 | ret = xhci_queue_reset_device(xhci, slot_id); |
| 2277 | if (ret) { | 2295 | if (ret) { |
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 85e65647d445..170c367112d2 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h | |||
| @@ -454,6 +454,24 @@ struct xhci_doorbell_array { | |||
| 454 | 454 | ||
| 455 | 455 | ||
| 456 | /** | 456 | /** |
| 457 | * struct xhci_protocol_caps | ||
| 458 | * @revision: major revision, minor revision, capability ID, | ||
| 459 | * and next capability pointer. | ||
| 460 | * @name_string: Four ASCII characters to say which spec this xHC | ||
| 461 | * follows, typically "USB ". | ||
| 462 | * @port_info: Port offset, count, and protocol-defined information. | ||
| 463 | */ | ||
| 464 | struct xhci_protocol_caps { | ||
| 465 | u32 revision; | ||
| 466 | u32 name_string; | ||
| 467 | u32 port_info; | ||
| 468 | }; | ||
| 469 | |||
| 470 | #define XHCI_EXT_PORT_MAJOR(x) (((x) >> 24) & 0xff) | ||
| 471 | #define XHCI_EXT_PORT_OFF(x) ((x) & 0xff) | ||
| 472 | #define XHCI_EXT_PORT_COUNT(x) (((x) >> 8) & 0xff) | ||
| 473 | |||
| 474 | /** | ||
| 457 | * struct xhci_container_ctx | 475 | * struct xhci_container_ctx |
| 458 | * @type: Type of context. Used to calculated offsets to contained contexts. | 476 | * @type: Type of context. Used to calculated offsets to contained contexts. |
| 459 | * @size: Size of the context data | 477 | * @size: Size of the context data |
| @@ -1240,6 +1258,14 @@ struct xhci_hcd { | |||
| 1240 | u32 suspended_ports[8]; /* which ports are | 1258 | u32 suspended_ports[8]; /* which ports are |
| 1241 | suspended */ | 1259 | suspended */ |
| 1242 | unsigned long resume_done[MAX_HC_PORTS]; | 1260 | unsigned long resume_done[MAX_HC_PORTS]; |
| 1261 | /* Is each xHCI roothub port a USB 3.0, USB 2.0, or USB 1.1 port? */ | ||
| 1262 | u8 *port_array; | ||
| 1263 | /* Array of pointers to USB 3.0 PORTSC registers */ | ||
| 1264 | u32 __iomem **usb3_ports; | ||
| 1265 | unsigned int num_usb3_ports; | ||
| 1266 | /* Array of pointers to USB 2.0 PORTSC registers */ | ||
| 1267 | u32 __iomem **usb2_ports; | ||
| 1268 | unsigned int num_usb2_ports; | ||
| 1243 | }; | 1269 | }; |
| 1244 | 1270 | ||
| 1245 | /* For testing purposes */ | 1271 | /* For testing purposes */ |
diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c index 719c6180b31f..ac5bfd619e62 100644 --- a/drivers/usb/misc/yurex.c +++ b/drivers/usb/misc/yurex.c | |||
| @@ -536,6 +536,7 @@ static const struct file_operations yurex_fops = { | |||
| 536 | .open = yurex_open, | 536 | .open = yurex_open, |
| 537 | .release = yurex_release, | 537 | .release = yurex_release, |
| 538 | .fasync = yurex_fasync, | 538 | .fasync = yurex_fasync, |
| 539 | .llseek = default_llseek, | ||
| 539 | }; | 540 | }; |
| 540 | 541 | ||
| 541 | 542 | ||
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index e6669fc3b804..99beebce8550 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
| @@ -2116,12 +2116,15 @@ bad_config: | |||
| 2116 | * Otherwise, wait till the gadget driver hooks up. | 2116 | * Otherwise, wait till the gadget driver hooks up. |
| 2117 | */ | 2117 | */ |
| 2118 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) { | 2118 | if (!is_otg_enabled(musb) && is_host_enabled(musb)) { |
| 2119 | struct usb_hcd *hcd = musb_to_hcd(musb); | ||
| 2120 | |||
| 2119 | MUSB_HST_MODE(musb); | 2121 | MUSB_HST_MODE(musb); |
| 2120 | musb->xceiv->default_a = 1; | 2122 | musb->xceiv->default_a = 1; |
| 2121 | musb->xceiv->state = OTG_STATE_A_IDLE; | 2123 | musb->xceiv->state = OTG_STATE_A_IDLE; |
| 2122 | 2124 | ||
| 2123 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); | 2125 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); |
| 2124 | 2126 | ||
| 2127 | hcd->self.uses_pio_for_control = 1; | ||
| 2125 | DBG(1, "%s mode, status %d, devctl %02x %c\n", | 2128 | DBG(1, "%s mode, status %d, devctl %02x %c\n", |
| 2126 | "HOST", status, | 2129 | "HOST", status, |
| 2127 | musb_readb(musb->mregs, MUSB_DEVCTL), | 2130 | musb_readb(musb->mregs, MUSB_DEVCTL), |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 36cfd060dbe5..9d6ade82b9f2 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
| @@ -92,6 +92,59 @@ | |||
| 92 | 92 | ||
| 93 | /* ----------------------------------------------------------------------- */ | 93 | /* ----------------------------------------------------------------------- */ |
| 94 | 94 | ||
| 95 | /* Maps the buffer to dma */ | ||
| 96 | |||
| 97 | static inline void map_dma_buffer(struct musb_request *request, | ||
| 98 | struct musb *musb) | ||
| 99 | { | ||
| 100 | if (request->request.dma == DMA_ADDR_INVALID) { | ||
| 101 | request->request.dma = dma_map_single( | ||
| 102 | musb->controller, | ||
| 103 | request->request.buf, | ||
| 104 | request->request.length, | ||
| 105 | request->tx | ||
| 106 | ? DMA_TO_DEVICE | ||
| 107 | : DMA_FROM_DEVICE); | ||
| 108 | request->mapped = 1; | ||
| 109 | } else { | ||
| 110 | dma_sync_single_for_device(musb->controller, | ||
| 111 | request->request.dma, | ||
| 112 | request->request.length, | ||
| 113 | request->tx | ||
| 114 | ? DMA_TO_DEVICE | ||
| 115 | : DMA_FROM_DEVICE); | ||
| 116 | request->mapped = 0; | ||
| 117 | } | ||
| 118 | } | ||
| 119 | |||
| 120 | /* Unmap the buffer from dma and maps it back to cpu */ | ||
| 121 | static inline void unmap_dma_buffer(struct musb_request *request, | ||
| 122 | struct musb *musb) | ||
| 123 | { | ||
| 124 | if (request->request.dma == DMA_ADDR_INVALID) { | ||
| 125 | DBG(20, "not unmapping a never mapped buffer\n"); | ||
| 126 | return; | ||
| 127 | } | ||
| 128 | if (request->mapped) { | ||
| 129 | dma_unmap_single(musb->controller, | ||
| 130 | request->request.dma, | ||
| 131 | request->request.length, | ||
| 132 | request->tx | ||
| 133 | ? DMA_TO_DEVICE | ||
| 134 | : DMA_FROM_DEVICE); | ||
| 135 | request->request.dma = DMA_ADDR_INVALID; | ||
| 136 | request->mapped = 0; | ||
| 137 | } else { | ||
| 138 | dma_sync_single_for_cpu(musb->controller, | ||
| 139 | request->request.dma, | ||
| 140 | request->request.length, | ||
| 141 | request->tx | ||
| 142 | ? DMA_TO_DEVICE | ||
| 143 | : DMA_FROM_DEVICE); | ||
| 144 | |||
| 145 | } | ||
| 146 | } | ||
| 147 | |||
| 95 | /* | 148 | /* |
| 96 | * Immediately complete a request. | 149 | * Immediately complete a request. |
| 97 | * | 150 | * |
| @@ -119,24 +172,8 @@ __acquires(ep->musb->lock) | |||
| 119 | 172 | ||
| 120 | ep->busy = 1; | 173 | ep->busy = 1; |
| 121 | spin_unlock(&musb->lock); | 174 | spin_unlock(&musb->lock); |
| 122 | if (is_dma_capable()) { | 175 | if (is_dma_capable() && ep->dma) |
| 123 | if (req->mapped) { | 176 | unmap_dma_buffer(req, musb); |
| 124 | dma_unmap_single(musb->controller, | ||
| 125 | req->request.dma, | ||
| 126 | req->request.length, | ||
| 127 | req->tx | ||
| 128 | ? DMA_TO_DEVICE | ||
| 129 | : DMA_FROM_DEVICE); | ||
| 130 | req->request.dma = DMA_ADDR_INVALID; | ||
| 131 | req->mapped = 0; | ||
| 132 | } else if (req->request.dma != DMA_ADDR_INVALID) | ||
| 133 | dma_sync_single_for_cpu(musb->controller, | ||
| 134 | req->request.dma, | ||
| 135 | req->request.length, | ||
| 136 | req->tx | ||
| 137 | ? DMA_TO_DEVICE | ||
| 138 | : DMA_FROM_DEVICE); | ||
| 139 | } | ||
| 140 | if (request->status == 0) | 177 | if (request->status == 0) |
| 141 | DBG(5, "%s done request %p, %d/%d\n", | 178 | DBG(5, "%s done request %p, %d/%d\n", |
| 142 | ep->end_point.name, request, | 179 | ep->end_point.name, request, |
| @@ -395,6 +432,13 @@ static void txstate(struct musb *musb, struct musb_request *req) | |||
| 395 | #endif | 432 | #endif |
| 396 | 433 | ||
| 397 | if (!use_dma) { | 434 | if (!use_dma) { |
| 435 | /* | ||
| 436 | * Unmap the dma buffer back to cpu if dma channel | ||
| 437 | * programming fails | ||
| 438 | */ | ||
| 439 | if (is_dma_capable() && musb_ep->dma) | ||
| 440 | unmap_dma_buffer(req, musb); | ||
| 441 | |||
| 398 | musb_write_fifo(musb_ep->hw_ep, fifo_count, | 442 | musb_write_fifo(musb_ep->hw_ep, fifo_count, |
| 399 | (u8 *) (request->buf + request->actual)); | 443 | (u8 *) (request->buf + request->actual)); |
| 400 | request->actual += fifo_count; | 444 | request->actual += fifo_count; |
| @@ -713,6 +757,21 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
| 713 | return; | 757 | return; |
| 714 | } | 758 | } |
| 715 | #endif | 759 | #endif |
| 760 | /* | ||
| 761 | * Unmap the dma buffer back to cpu if dma channel | ||
| 762 | * programming fails. This buffer is mapped if the | ||
| 763 | * channel allocation is successful | ||
| 764 | */ | ||
| 765 | if (is_dma_capable() && musb_ep->dma) { | ||
| 766 | unmap_dma_buffer(req, musb); | ||
| 767 | |||
| 768 | /* | ||
| 769 | * Clear DMAENAB and AUTOCLEAR for the | ||
| 770 | * PIO mode transfer | ||
| 771 | */ | ||
| 772 | csr &= ~(MUSB_RXCSR_DMAENAB | MUSB_RXCSR_AUTOCLEAR); | ||
| 773 | musb_writew(epio, MUSB_RXCSR, csr); | ||
| 774 | } | ||
| 716 | 775 | ||
| 717 | musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) | 776 | musb_read_fifo(musb_ep->hw_ep, fifo_count, (u8 *) |
| 718 | (request->buf + request->actual)); | 777 | (request->buf + request->actual)); |
| @@ -837,7 +896,9 @@ void musb_g_rx(struct musb *musb, u8 epnum) | |||
| 837 | if (!request) | 896 | if (!request) |
| 838 | return; | 897 | return; |
| 839 | } | 898 | } |
| 899 | #if defined(CONFIG_USB_INVENTRA_DMA) || defined(CONFIG_USB_TUSB_OMAP_DMA) | ||
| 840 | exit: | 900 | exit: |
| 901 | #endif | ||
| 841 | /* Analyze request */ | 902 | /* Analyze request */ |
| 842 | rxstate(musb, to_musb_request(request)); | 903 | rxstate(musb, to_musb_request(request)); |
| 843 | } | 904 | } |
| @@ -1150,26 +1211,9 @@ static int musb_gadget_queue(struct usb_ep *ep, struct usb_request *req, | |||
| 1150 | request->epnum = musb_ep->current_epnum; | 1211 | request->epnum = musb_ep->current_epnum; |
| 1151 | request->tx = musb_ep->is_in; | 1212 | request->tx = musb_ep->is_in; |
| 1152 | 1213 | ||
| 1153 | if (is_dma_capable() && musb_ep->dma) { | 1214 | if (is_dma_capable() && musb_ep->dma) |
| 1154 | if (request->request.dma == DMA_ADDR_INVALID) { | 1215 | map_dma_buffer(request, musb); |
| 1155 | request->request.dma = dma_map_single( | 1216 | else |
| 1156 | musb->controller, | ||
| 1157 | request->request.buf, | ||
| 1158 | request->request.length, | ||
| 1159 | request->tx | ||
| 1160 | ? DMA_TO_DEVICE | ||
| 1161 | : DMA_FROM_DEVICE); | ||
| 1162 | request->mapped = 1; | ||
| 1163 | } else { | ||
| 1164 | dma_sync_single_for_device(musb->controller, | ||
| 1165 | request->request.dma, | ||
| 1166 | request->request.length, | ||
| 1167 | request->tx | ||
| 1168 | ? DMA_TO_DEVICE | ||
| 1169 | : DMA_FROM_DEVICE); | ||
| 1170 | request->mapped = 0; | ||
| 1171 | } | ||
| 1172 | } else | ||
| 1173 | request->mapped = 0; | 1217 | request->mapped = 0; |
| 1174 | 1218 | ||
| 1175 | spin_lock_irqsave(&musb->lock, lockflags); | 1219 | spin_lock_irqsave(&musb->lock, lockflags); |
| @@ -1789,6 +1833,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 1789 | spin_unlock_irqrestore(&musb->lock, flags); | 1833 | spin_unlock_irqrestore(&musb->lock, flags); |
| 1790 | 1834 | ||
| 1791 | if (is_otg_enabled(musb)) { | 1835 | if (is_otg_enabled(musb)) { |
| 1836 | struct usb_hcd *hcd = musb_to_hcd(musb); | ||
| 1837 | |||
| 1792 | DBG(3, "OTG startup...\n"); | 1838 | DBG(3, "OTG startup...\n"); |
| 1793 | 1839 | ||
| 1794 | /* REVISIT: funcall to other code, which also | 1840 | /* REVISIT: funcall to other code, which also |
| @@ -1803,6 +1849,8 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver, | |||
| 1803 | musb->gadget_driver = NULL; | 1849 | musb->gadget_driver = NULL; |
| 1804 | musb->g.dev.driver = NULL; | 1850 | musb->g.dev.driver = NULL; |
| 1805 | spin_unlock_irqrestore(&musb->lock, flags); | 1851 | spin_unlock_irqrestore(&musb->lock, flags); |
| 1852 | } else { | ||
| 1853 | hcd->self.uses_pio_for_control = 1; | ||
| 1806 | } | 1854 | } |
| 1807 | } | 1855 | } |
| 1808 | } | 1856 | } |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 76f8b3556672..6a50965e23f2 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
| @@ -201,6 +201,7 @@ static struct usb_device_id id_table_combined [] = { | |||
| 201 | { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, | 201 | { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) }, |
| 202 | { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, | 202 | { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) }, |
| 203 | { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, | 203 | { USB_DEVICE(FTDI_VID, FTDI_R2000KU_TRUE_RNG) }, |
| 204 | { USB_DEVICE(FTDI_VID, FTDI_VARDAAN_PID) }, | ||
| 204 | { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, | 205 | { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0100_PID) }, |
| 205 | { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, | 206 | { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0101_PID) }, |
| 206 | { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, | 207 | { USB_DEVICE(MTXORB_VID, MTXORB_FTDI_RANGE_0102_PID) }, |
| @@ -696,6 +697,7 @@ static struct usb_device_id id_table_combined [] = { | |||
| 696 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, | 697 | .driver_info = (kernel_ulong_t)&ftdi_NDI_device_quirk }, |
| 697 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, | 698 | { USB_DEVICE(TELLDUS_VID, TELLDUS_TELLSTICK_PID) }, |
| 698 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, | 699 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_SERIAL_VX7_PID) }, |
| 700 | { USB_DEVICE(RTSYSTEMS_VID, RTSYSTEMS_CT29B_PID) }, | ||
| 699 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, | 701 | { USB_DEVICE(FTDI_VID, FTDI_MAXSTREAM_PID) }, |
| 700 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, | 702 | { USB_DEVICE(FTDI_VID, FTDI_PHI_FISCO_PID) }, |
| 701 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, | 703 | { USB_DEVICE(TML_VID, TML_USB_SERIAL_PID) }, |
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h index 263f62551197..1286f1e23d8c 100644 --- a/drivers/usb/serial/ftdi_sio_ids.h +++ b/drivers/usb/serial/ftdi_sio_ids.h | |||
| @@ -114,6 +114,9 @@ | |||
| 114 | /* Lenz LI-USB Computer Interface. */ | 114 | /* Lenz LI-USB Computer Interface. */ |
| 115 | #define FTDI_LENZ_LIUSB_PID 0xD780 | 115 | #define FTDI_LENZ_LIUSB_PID 0xD780 |
| 116 | 116 | ||
| 117 | /* Vardaan Enterprises Serial Interface VEUSB422R3 */ | ||
| 118 | #define FTDI_VARDAAN_PID 0xF070 | ||
| 119 | |||
| 117 | /* | 120 | /* |
| 118 | * Xsens Technologies BV products (http://www.xsens.com). | 121 | * Xsens Technologies BV products (http://www.xsens.com). |
| 119 | */ | 122 | */ |
| @@ -721,6 +724,7 @@ | |||
| 721 | */ | 724 | */ |
| 722 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ | 725 | #define RTSYSTEMS_VID 0x2100 /* Vendor ID */ |
| 723 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ | 726 | #define RTSYSTEMS_SERIAL_VX7_PID 0x9e52 /* Serial converter for VX-7 Radios using FT232RL */ |
| 727 | #define RTSYSTEMS_CT29B_PID 0x9e54 /* CT29B Radio Cable */ | ||
| 724 | 728 | ||
| 725 | /* | 729 | /* |
| 726 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. | 730 | * Bayer Ascensia Contour blood glucose meter USB-converter cable. |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 861223f2af6e..6954de50c0ff 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
| @@ -51,6 +51,7 @@ static struct usb_driver usb_serial_driver = { | |||
| 51 | .suspend = usb_serial_suspend, | 51 | .suspend = usb_serial_suspend, |
| 52 | .resume = usb_serial_resume, | 52 | .resume = usb_serial_resume, |
| 53 | .no_dynamic_id = 1, | 53 | .no_dynamic_id = 1, |
| 54 | .supports_autosuspend = 1, | ||
| 54 | }; | 55 | }; |
| 55 | 56 | ||
| 56 | /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead | 57 | /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead |
| @@ -1343,6 +1344,8 @@ int usb_serial_register(struct usb_serial_driver *driver) | |||
| 1343 | return -ENODEV; | 1344 | return -ENODEV; |
| 1344 | 1345 | ||
| 1345 | fixup_generic(driver); | 1346 | fixup_generic(driver); |
| 1347 | if (driver->usb_driver) | ||
| 1348 | driver->usb_driver->supports_autosuspend = 1; | ||
| 1346 | 1349 | ||
| 1347 | if (!driver->description) | 1350 | if (!driver->description) |
| 1348 | driver->description = driver->driver.name; | 1351 | driver->description = driver->driver.name; |
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c index cad7d45c8bac..c265aed09e04 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c | |||
| @@ -1029,10 +1029,6 @@ static int __init fb_probe(struct platform_device *device) | |||
| 1029 | goto err_release_pl_mem; | 1029 | goto err_release_pl_mem; |
| 1030 | } | 1030 | } |
| 1031 | 1031 | ||
| 1032 | ret = request_irq(par->irq, lcdc_irq_handler, 0, DRIVER_NAME, par); | ||
| 1033 | if (ret) | ||
| 1034 | goto err_release_pl_mem; | ||
| 1035 | |||
| 1036 | /* Initialize par */ | 1032 | /* Initialize par */ |
| 1037 | da8xx_fb_info->var.bits_per_pixel = lcd_cfg->bpp; | 1033 | da8xx_fb_info->var.bits_per_pixel = lcd_cfg->bpp; |
| 1038 | 1034 | ||
| @@ -1060,7 +1056,7 @@ static int __init fb_probe(struct platform_device *device) | |||
| 1060 | 1056 | ||
| 1061 | ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); | 1057 | ret = fb_alloc_cmap(&da8xx_fb_info->cmap, PALETTE_SIZE, 0); |
| 1062 | if (ret) | 1058 | if (ret) |
| 1063 | goto err_free_irq; | 1059 | goto err_release_pl_mem; |
| 1064 | da8xx_fb_info->cmap.len = par->palette_sz; | 1060 | da8xx_fb_info->cmap.len = par->palette_sz; |
| 1065 | 1061 | ||
| 1066 | /* initialize var_screeninfo */ | 1062 | /* initialize var_screeninfo */ |
| @@ -1088,8 +1084,13 @@ static int __init fb_probe(struct platform_device *device) | |||
| 1088 | goto err_cpu_freq; | 1084 | goto err_cpu_freq; |
| 1089 | } | 1085 | } |
| 1090 | #endif | 1086 | #endif |
| 1087 | |||
| 1088 | ret = request_irq(par->irq, lcdc_irq_handler, 0, DRIVER_NAME, par); | ||
| 1089 | if (ret) | ||
| 1090 | goto irq_freq; | ||
| 1091 | return 0; | 1091 | return 0; |
| 1092 | 1092 | ||
| 1093 | irq_freq: | ||
| 1093 | #ifdef CONFIG_CPU_FREQ | 1094 | #ifdef CONFIG_CPU_FREQ |
| 1094 | err_cpu_freq: | 1095 | err_cpu_freq: |
| 1095 | unregister_framebuffer(da8xx_fb_info); | 1096 | unregister_framebuffer(da8xx_fb_info); |
| @@ -1098,9 +1099,6 @@ err_cpu_freq: | |||
| 1098 | err_dealloc_cmap: | 1099 | err_dealloc_cmap: |
| 1099 | fb_dealloc_cmap(&da8xx_fb_info->cmap); | 1100 | fb_dealloc_cmap(&da8xx_fb_info->cmap); |
| 1100 | 1101 | ||
| 1101 | err_free_irq: | ||
| 1102 | free_irq(par->irq, par); | ||
| 1103 | |||
| 1104 | err_release_pl_mem: | 1102 | err_release_pl_mem: |
| 1105 | dma_free_coherent(NULL, PALETTE_SIZE, par->v_palette_base, | 1103 | dma_free_coherent(NULL, PALETTE_SIZE, par->v_palette_base, |
| 1106 | par->p_palette_base); | 1104 | par->p_palette_base); |
diff --git a/drivers/video/fbcmap.c b/drivers/video/fbcmap.c index affdf3e32cf3..5c3960da755a 100644 --- a/drivers/video/fbcmap.c +++ b/drivers/video/fbcmap.c | |||
| @@ -80,6 +80,7 @@ static const struct fb_cmap default_16_colors = { | |||
| 80 | * @cmap: frame buffer colormap structure | 80 | * @cmap: frame buffer colormap structure |
| 81 | * @len: length of @cmap | 81 | * @len: length of @cmap |
| 82 | * @transp: boolean, 1 if there is transparency, 0 otherwise | 82 | * @transp: boolean, 1 if there is transparency, 0 otherwise |
| 83 | * @flags: flags for kmalloc memory allocation | ||
| 83 | * | 84 | * |
| 84 | * Allocates memory for a colormap @cmap. @len is the | 85 | * Allocates memory for a colormap @cmap. @len is the |
| 85 | * number of entries in the palette. | 86 | * number of entries in the palette. |
diff --git a/drivers/video/geode/lxfb.h b/drivers/video/geode/lxfb.h index e4c4d89b7860..be8ccb47ebe0 100644 --- a/drivers/video/geode/lxfb.h +++ b/drivers/video/geode/lxfb.h | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #define DC_HFILT_COUNT 0x100 | 22 | #define DC_HFILT_COUNT 0x100 |
| 23 | #define DC_VFILT_COUNT 0x100 | 23 | #define DC_VFILT_COUNT 0x100 |
| 24 | #define VP_COEFF_SIZE 0x1000 | 24 | #define VP_COEFF_SIZE 0x1000 |
| 25 | #define VP_PAL_COUNT 0x100 | ||
| 25 | 26 | ||
| 26 | #define OUTPUT_CRT 0x01 | 27 | #define OUTPUT_CRT 0x01 |
| 27 | #define OUTPUT_PANEL 0x02 | 28 | #define OUTPUT_PANEL 0x02 |
| @@ -48,7 +49,8 @@ struct lxfb_par { | |||
| 48 | uint64_t vp[VP_REG_COUNT]; | 49 | uint64_t vp[VP_REG_COUNT]; |
| 49 | uint64_t fp[FP_REG_COUNT]; | 50 | uint64_t fp[FP_REG_COUNT]; |
| 50 | 51 | ||
| 51 | uint32_t pal[DC_PAL_COUNT]; | 52 | uint32_t dc_pal[DC_PAL_COUNT]; |
| 53 | uint32_t vp_pal[VP_PAL_COUNT]; | ||
| 52 | uint32_t hcoeff[DC_HFILT_COUNT * 2]; | 54 | uint32_t hcoeff[DC_HFILT_COUNT * 2]; |
| 53 | uint32_t vcoeff[DC_VFILT_COUNT]; | 55 | uint32_t vcoeff[DC_VFILT_COUNT]; |
| 54 | uint32_t vp_coeff[VP_COEFF_SIZE / 4]; | 56 | uint32_t vp_coeff[VP_COEFF_SIZE / 4]; |
diff --git a/drivers/video/geode/lxfb_ops.c b/drivers/video/geode/lxfb_ops.c index 85ec7f64c42a..79e9abc72b83 100644 --- a/drivers/video/geode/lxfb_ops.c +++ b/drivers/video/geode/lxfb_ops.c | |||
| @@ -610,10 +610,15 @@ static void lx_save_regs(struct lxfb_par *par) | |||
| 610 | memcpy(par->vp, par->vp_regs, sizeof(par->vp)); | 610 | memcpy(par->vp, par->vp_regs, sizeof(par->vp)); |
| 611 | memcpy(par->fp, par->vp_regs + VP_FP_START, sizeof(par->fp)); | 611 | memcpy(par->fp, par->vp_regs + VP_FP_START, sizeof(par->fp)); |
| 612 | 612 | ||
| 613 | /* save the palette */ | 613 | /* save the display controller palette */ |
| 614 | write_dc(par, DC_PAL_ADDRESS, 0); | 614 | write_dc(par, DC_PAL_ADDRESS, 0); |
| 615 | for (i = 0; i < ARRAY_SIZE(par->pal); i++) | 615 | for (i = 0; i < ARRAY_SIZE(par->dc_pal); i++) |
| 616 | par->pal[i] = read_dc(par, DC_PAL_DATA); | 616 | par->dc_pal[i] = read_dc(par, DC_PAL_DATA); |
| 617 | |||
| 618 | /* save the video processor palette */ | ||
| 619 | write_vp(par, VP_PAR, 0); | ||
| 620 | for (i = 0; i < ARRAY_SIZE(par->vp_pal); i++) | ||
| 621 | par->vp_pal[i] = read_vp(par, VP_PDR); | ||
| 617 | 622 | ||
| 618 | /* save the horizontal filter coefficients */ | 623 | /* save the horizontal filter coefficients */ |
| 619 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; | 624 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; |
| @@ -706,8 +711,8 @@ static void lx_restore_display_ctlr(struct lxfb_par *par) | |||
| 706 | 711 | ||
| 707 | /* restore the palette */ | 712 | /* restore the palette */ |
| 708 | write_dc(par, DC_PAL_ADDRESS, 0); | 713 | write_dc(par, DC_PAL_ADDRESS, 0); |
| 709 | for (i = 0; i < ARRAY_SIZE(par->pal); i++) | 714 | for (i = 0; i < ARRAY_SIZE(par->dc_pal); i++) |
| 710 | write_dc(par, DC_PAL_DATA, par->pal[i]); | 715 | write_dc(par, DC_PAL_DATA, par->dc_pal[i]); |
| 711 | 716 | ||
| 712 | /* restore the horizontal filter coefficients */ | 717 | /* restore the horizontal filter coefficients */ |
| 713 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; | 718 | filt = par->dc[DC_IRQ_FILT_CTL] | DC_IRQ_FILT_CTL_H_FILT_SEL; |
| @@ -751,6 +756,11 @@ static void lx_restore_video_proc(struct lxfb_par *par) | |||
| 751 | } | 756 | } |
| 752 | } | 757 | } |
| 753 | 758 | ||
| 759 | /* restore video processor palette */ | ||
| 760 | write_vp(par, VP_PAR, 0); | ||
| 761 | for (i = 0; i < ARRAY_SIZE(par->vp_pal); i++) | ||
| 762 | write_vp(par, VP_PDR, par->vp_pal[i]); | ||
| 763 | |||
| 754 | /* restore video coeff ram */ | 764 | /* restore video coeff ram */ |
| 755 | memcpy(par->vp_regs + VP_VCR, par->vp_coeff, sizeof(par->vp_coeff)); | 765 | memcpy(par->vp_regs + VP_VCR, par->vp_coeff, sizeof(par->vp_coeff)); |
| 756 | } | 766 | } |
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index 0a4dbdc1693a..de450c1fb869 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
| @@ -855,6 +855,7 @@ const struct fb_videomode *fb_find_nearest_mode(const struct fb_videomode *mode, | |||
| 855 | abs(cmode->yres - mode->yres); | 855 | abs(cmode->yres - mode->yres); |
| 856 | if (diff > d) { | 856 | if (diff > d) { |
| 857 | diff = d; | 857 | diff = d; |
| 858 | diff_refresh = abs(cmode->refresh - mode->refresh); | ||
| 858 | best = cmode; | 859 | best = cmode; |
| 859 | } else if (diff == d) { | 860 | } else if (diff == d) { |
| 860 | d = abs(cmode->refresh - mode->refresh); | 861 | d = abs(cmode->refresh - mode->refresh); |
diff --git a/drivers/watchdog/Kconfig b/drivers/watchdog/Kconfig index 4a291045ebac..a5ad77ef4266 100644 --- a/drivers/watchdog/Kconfig +++ b/drivers/watchdog/Kconfig | |||
| @@ -558,6 +558,9 @@ config IT8712F_WDT | |||
| 558 | This is the driver for the built-in watchdog timer on the IT8712F | 558 | This is the driver for the built-in watchdog timer on the IT8712F |
| 559 | Super I/0 chipset used on many motherboards. | 559 | Super I/0 chipset used on many motherboards. |
| 560 | 560 | ||
| 561 | If the driver does not work, then make sure that the game port in | ||
| 562 | the BIOS is enabled. | ||
| 563 | |||
| 561 | To compile this driver as a module, choose M here: the | 564 | To compile this driver as a module, choose M here: the |
| 562 | module will be called it8712f_wdt. | 565 | module will be called it8712f_wdt. |
| 563 | 566 | ||
diff --git a/drivers/watchdog/bcm63xx_wdt.c b/drivers/watchdog/bcm63xx_wdt.c index a1debc89356b..3c5045a206dd 100644 --- a/drivers/watchdog/bcm63xx_wdt.c +++ b/drivers/watchdog/bcm63xx_wdt.c | |||
| @@ -18,7 +18,6 @@ | |||
| 18 | #include <linux/miscdevice.h> | 18 | #include <linux/miscdevice.h> |
| 19 | #include <linux/module.h> | 19 | #include <linux/module.h> |
| 20 | #include <linux/moduleparam.h> | 20 | #include <linux/moduleparam.h> |
| 21 | #include <linux/reboot.h> | ||
| 22 | #include <linux/types.h> | 21 | #include <linux/types.h> |
| 23 | #include <linux/uaccess.h> | 22 | #include <linux/uaccess.h> |
| 24 | #include <linux/watchdog.h> | 23 | #include <linux/watchdog.h> |
| @@ -220,14 +219,6 @@ static long bcm63xx_wdt_ioctl(struct file *file, unsigned int cmd, | |||
| 220 | } | 219 | } |
| 221 | } | 220 | } |
| 222 | 221 | ||
| 223 | static int bcm63xx_wdt_notify_sys(struct notifier_block *this, | ||
| 224 | unsigned long code, void *unused) | ||
| 225 | { | ||
| 226 | if (code == SYS_DOWN || code == SYS_HALT) | ||
| 227 | bcm63xx_wdt_pause(); | ||
| 228 | return NOTIFY_DONE; | ||
| 229 | } | ||
| 230 | |||
| 231 | static const struct file_operations bcm63xx_wdt_fops = { | 222 | static const struct file_operations bcm63xx_wdt_fops = { |
| 232 | .owner = THIS_MODULE, | 223 | .owner = THIS_MODULE, |
| 233 | .llseek = no_llseek, | 224 | .llseek = no_llseek, |
| @@ -243,12 +234,8 @@ static struct miscdevice bcm63xx_wdt_miscdev = { | |||
| 243 | .fops = &bcm63xx_wdt_fops, | 234 | .fops = &bcm63xx_wdt_fops, |
| 244 | }; | 235 | }; |
| 245 | 236 | ||
| 246 | static struct notifier_block bcm63xx_wdt_notifier = { | ||
| 247 | .notifier_call = bcm63xx_wdt_notify_sys, | ||
| 248 | }; | ||
| 249 | 237 | ||
| 250 | 238 | static int __devinit bcm63xx_wdt_probe(struct platform_device *pdev) | |
| 251 | static int bcm63xx_wdt_probe(struct platform_device *pdev) | ||
| 252 | { | 239 | { |
| 253 | int ret; | 240 | int ret; |
| 254 | struct resource *r; | 241 | struct resource *r; |
| @@ -280,16 +267,10 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) | |||
| 280 | wdt_time); | 267 | wdt_time); |
| 281 | } | 268 | } |
| 282 | 269 | ||
| 283 | ret = register_reboot_notifier(&bcm63xx_wdt_notifier); | ||
| 284 | if (ret) { | ||
| 285 | dev_err(&pdev->dev, "failed to register reboot_notifier\n"); | ||
| 286 | goto unregister_timer; | ||
| 287 | } | ||
| 288 | |||
| 289 | ret = misc_register(&bcm63xx_wdt_miscdev); | 270 | ret = misc_register(&bcm63xx_wdt_miscdev); |
| 290 | if (ret < 0) { | 271 | if (ret < 0) { |
| 291 | dev_err(&pdev->dev, "failed to register watchdog device\n"); | 272 | dev_err(&pdev->dev, "failed to register watchdog device\n"); |
| 292 | goto unregister_reboot_notifier; | 273 | goto unregister_timer; |
| 293 | } | 274 | } |
| 294 | 275 | ||
| 295 | dev_info(&pdev->dev, " started, timer margin: %d sec\n", | 276 | dev_info(&pdev->dev, " started, timer margin: %d sec\n", |
| @@ -297,8 +278,6 @@ static int bcm63xx_wdt_probe(struct platform_device *pdev) | |||
| 297 | 278 | ||
| 298 | return 0; | 279 | return 0; |
| 299 | 280 | ||
| 300 | unregister_reboot_notifier: | ||
| 301 | unregister_reboot_notifier(&bcm63xx_wdt_notifier); | ||
| 302 | unregister_timer: | 281 | unregister_timer: |
| 303 | bcm63xx_timer_unregister(TIMER_WDT_ID); | 282 | bcm63xx_timer_unregister(TIMER_WDT_ID); |
| 304 | unmap: | 283 | unmap: |
| @@ -306,25 +285,28 @@ unmap: | |||
| 306 | return ret; | 285 | return ret; |
| 307 | } | 286 | } |
| 308 | 287 | ||
| 309 | static int bcm63xx_wdt_remove(struct platform_device *pdev) | 288 | static int __devexit bcm63xx_wdt_remove(struct platform_device *pdev) |
| 310 | { | 289 | { |
| 311 | if (!nowayout) | 290 | if (!nowayout) |
| 312 | bcm63xx_wdt_pause(); | 291 | bcm63xx_wdt_pause(); |
| 313 | 292 | ||
| 314 | misc_deregister(&bcm63xx_wdt_miscdev); | 293 | misc_deregister(&bcm63xx_wdt_miscdev); |
| 315 | |||
| 316 | iounmap(bcm63xx_wdt_device.regs); | ||
| 317 | |||
| 318 | unregister_reboot_notifier(&bcm63xx_wdt_notifier); | ||
| 319 | bcm63xx_timer_unregister(TIMER_WDT_ID); | 294 | bcm63xx_timer_unregister(TIMER_WDT_ID); |
| 320 | 295 | iounmap(bcm63xx_wdt_device.regs); | |
| 321 | return 0; | 296 | return 0; |
| 322 | } | 297 | } |
| 323 | 298 | ||
| 299 | static void bcm63xx_wdt_shutdown(struct platform_device *pdev) | ||
| 300 | { | ||
| 301 | bcm63xx_wdt_pause(); | ||
| 302 | } | ||
| 303 | |||
| 324 | static struct platform_driver bcm63xx_wdt = { | 304 | static struct platform_driver bcm63xx_wdt = { |
| 325 | .probe = bcm63xx_wdt_probe, | 305 | .probe = bcm63xx_wdt_probe, |
| 326 | .remove = bcm63xx_wdt_remove, | 306 | .remove = __devexit_p(bcm63xx_wdt_remove), |
| 307 | .shutdown = bcm63xx_wdt_shutdown, | ||
| 327 | .driver = { | 308 | .driver = { |
| 309 | .owner = THIS_MODULE, | ||
| 328 | .name = "bcm63xx-wdt", | 310 | .name = "bcm63xx-wdt", |
| 329 | } | 311 | } |
| 330 | }; | 312 | }; |
diff --git a/drivers/watchdog/gef_wdt.c b/drivers/watchdog/gef_wdt.c index 9c21d19043a6..f6bd6f10fcec 100644 --- a/drivers/watchdog/gef_wdt.c +++ b/drivers/watchdog/gef_wdt.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/miscdevice.h> | 31 | #include <linux/miscdevice.h> |
| 32 | #include <linux/watchdog.h> | 32 | #include <linux/watchdog.h> |
| 33 | #include <linux/fs.h> | ||
| 33 | #include <linux/of.h> | 34 | #include <linux/of.h> |
| 34 | #include <linux/of_platform.h> | 35 | #include <linux/of_platform.h> |
| 35 | #include <linux/io.h> | 36 | #include <linux/io.h> |
diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c index f7e90fe47b71..b8838d2c67a6 100644 --- a/drivers/watchdog/iTCO_wdt.c +++ b/drivers/watchdog/iTCO_wdt.c | |||
| @@ -32,6 +32,7 @@ | |||
| 32 | * document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH) | 32 | * document number 322169-001, 322170-003: 5 Series, 3400 Series (PCH) |
| 33 | * document number 320066-003, 320257-008: EP80597 (IICH) | 33 | * document number 320066-003, 320257-008: EP80597 (IICH) |
| 34 | * document number TBD : Cougar Point (CPT) | 34 | * document number TBD : Cougar Point (CPT) |
| 35 | * document number TBD : Patsburg (PBG) | ||
| 35 | */ | 36 | */ |
| 36 | 37 | ||
| 37 | /* | 38 | /* |
| @@ -146,7 +147,8 @@ enum iTCO_chipsets { | |||
| 146 | TCO_CPT29, /* Cougar Point */ | 147 | TCO_CPT29, /* Cougar Point */ |
| 147 | TCO_CPT30, /* Cougar Point */ | 148 | TCO_CPT30, /* Cougar Point */ |
| 148 | TCO_CPT31, /* Cougar Point */ | 149 | TCO_CPT31, /* Cougar Point */ |
| 149 | TCO_PBG, /* Patsburg */ | 150 | TCO_PBG1, /* Patsburg */ |
| 151 | TCO_PBG2, /* Patsburg */ | ||
| 150 | }; | 152 | }; |
| 151 | 153 | ||
| 152 | static struct { | 154 | static struct { |
| @@ -235,6 +237,7 @@ static struct { | |||
| 235 | {"Cougar Point", 2}, | 237 | {"Cougar Point", 2}, |
| 236 | {"Cougar Point", 2}, | 238 | {"Cougar Point", 2}, |
| 237 | {"Patsburg", 2}, | 239 | {"Patsburg", 2}, |
| 240 | {"Patsburg", 2}, | ||
| 238 | {NULL, 0} | 241 | {NULL, 0} |
| 239 | }; | 242 | }; |
| 240 | 243 | ||
| @@ -350,7 +353,8 @@ static struct pci_device_id iTCO_wdt_pci_tbl[] = { | |||
| 350 | { ITCO_PCI_DEVICE(0x1c5d, TCO_CPT29)}, | 353 | { ITCO_PCI_DEVICE(0x1c5d, TCO_CPT29)}, |
| 351 | { ITCO_PCI_DEVICE(0x1c5e, TCO_CPT30)}, | 354 | { ITCO_PCI_DEVICE(0x1c5e, TCO_CPT30)}, |
| 352 | { ITCO_PCI_DEVICE(0x1c5f, TCO_CPT31)}, | 355 | { ITCO_PCI_DEVICE(0x1c5f, TCO_CPT31)}, |
| 353 | { ITCO_PCI_DEVICE(0x1d40, TCO_PBG)}, | 356 | { ITCO_PCI_DEVICE(0x1d40, TCO_PBG1)}, |
| 357 | { ITCO_PCI_DEVICE(0x1d41, TCO_PBG2)}, | ||
| 354 | { 0, }, /* End of list */ | 358 | { 0, }, /* End of list */ |
| 355 | }; | 359 | }; |
| 356 | MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl); | 360 | MODULE_DEVICE_TABLE(pci, iTCO_wdt_pci_tbl); |
diff --git a/drivers/xen/balloon.c b/drivers/xen/balloon.c index 2b17ad5b4b32..43f9f02c7db0 100644 --- a/drivers/xen/balloon.c +++ b/drivers/xen/balloon.c | |||
| @@ -412,8 +412,16 @@ static int __init balloon_init(void) | |||
| 412 | 412 | ||
| 413 | register_balloon(&balloon_sysdev); | 413 | register_balloon(&balloon_sysdev); |
| 414 | 414 | ||
| 415 | /* Initialise the balloon with excess memory space. */ | 415 | /* |
| 416 | extra_pfn_end = min(e820_end_of_ram_pfn(), | 416 | * Initialise the balloon with excess memory space. We need |
| 417 | * to make sure we don't add memory which doesn't exist or | ||
| 418 | * logically exist. The E820 map can be trimmed to be smaller | ||
| 419 | * than the amount of physical memory due to the mem= command | ||
| 420 | * line parameter. And if this is a 32-bit non-HIGHMEM kernel | ||
| 421 | * on a system with memory which requires highmem to access, | ||
| 422 | * don't try to use it. | ||
| 423 | */ | ||
| 424 | extra_pfn_end = min(min(max_pfn, e820_end_of_ram_pfn()), | ||
| 417 | (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); | 425 | (unsigned long)PFN_DOWN(xen_extra_mem_start + xen_extra_mem_size)); |
| 418 | for (pfn = PFN_UP(xen_extra_mem_start); | 426 | for (pfn = PFN_UP(xen_extra_mem_start); |
| 419 | pfn < extra_pfn_end; | 427 | pfn < extra_pfn_end; |
diff --git a/drivers/xen/events.c b/drivers/xen/events.c index 2811bb988ea0..31af0ac31a98 100644 --- a/drivers/xen/events.c +++ b/drivers/xen/events.c | |||
| @@ -105,7 +105,6 @@ struct irq_info | |||
| 105 | 105 | ||
| 106 | static struct irq_info *irq_info; | 106 | static struct irq_info *irq_info; |
| 107 | static int *pirq_to_irq; | 107 | static int *pirq_to_irq; |
| 108 | static int nr_pirqs; | ||
| 109 | 108 | ||
| 110 | static int *evtchn_to_irq; | 109 | static int *evtchn_to_irq; |
| 111 | struct cpu_evtchn_s { | 110 | struct cpu_evtchn_s { |
| @@ -385,12 +384,17 @@ static int get_nr_hw_irqs(void) | |||
| 385 | return ret; | 384 | return ret; |
| 386 | } | 385 | } |
| 387 | 386 | ||
| 388 | /* callers of this function should make sure that PHYSDEVOP_get_nr_pirqs | 387 | static int find_unbound_pirq(int type) |
| 389 | * succeeded otherwise nr_pirqs won't hold the right value */ | ||
| 390 | static int find_unbound_pirq(void) | ||
| 391 | { | 388 | { |
| 392 | int i; | 389 | int rc, i; |
| 393 | for (i = nr_pirqs-1; i >= 0; i--) { | 390 | struct physdev_get_free_pirq op_get_free_pirq; |
| 391 | op_get_free_pirq.type = type; | ||
| 392 | |||
| 393 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_free_pirq, &op_get_free_pirq); | ||
| 394 | if (!rc) | ||
| 395 | return op_get_free_pirq.pirq; | ||
| 396 | |||
| 397 | for (i = 0; i < nr_irqs; i++) { | ||
| 394 | if (pirq_to_irq[i] < 0) | 398 | if (pirq_to_irq[i] < 0) |
| 395 | return i; | 399 | return i; |
| 396 | } | 400 | } |
| @@ -423,7 +427,7 @@ static int find_unbound_irq(void) | |||
| 423 | if (irq == start) | 427 | if (irq == start) |
| 424 | goto no_irqs; | 428 | goto no_irqs; |
| 425 | 429 | ||
| 426 | res = irq_alloc_desc_at(irq, 0); | 430 | res = irq_alloc_desc_at(irq, -1); |
| 427 | 431 | ||
| 428 | if (WARN_ON(res != irq)) | 432 | if (WARN_ON(res != irq)) |
| 429 | return -1; | 433 | return -1; |
| @@ -611,10 +615,10 @@ int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name) | |||
| 611 | 615 | ||
| 612 | spin_lock(&irq_mapping_update_lock); | 616 | spin_lock(&irq_mapping_update_lock); |
| 613 | 617 | ||
| 614 | if ((pirq > nr_pirqs) || (gsi > nr_irqs)) { | 618 | if ((pirq > nr_irqs) || (gsi > nr_irqs)) { |
| 615 | printk(KERN_WARNING "xen_map_pirq_gsi: %s %s is incorrect!\n", | 619 | printk(KERN_WARNING "xen_map_pirq_gsi: %s %s is incorrect!\n", |
| 616 | pirq > nr_pirqs ? "nr_pirqs" :"", | 620 | pirq > nr_irqs ? "pirq" :"", |
| 617 | gsi > nr_irqs ? "nr_irqs" : ""); | 621 | gsi > nr_irqs ? "gsi" : ""); |
| 618 | goto out; | 622 | goto out; |
| 619 | } | 623 | } |
| 620 | 624 | ||
| @@ -630,7 +634,7 @@ int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name) | |||
| 630 | if (identity_mapped_irq(gsi) || (!xen_initial_domain() && | 634 | if (identity_mapped_irq(gsi) || (!xen_initial_domain() && |
| 631 | xen_pv_domain())) { | 635 | xen_pv_domain())) { |
| 632 | irq = gsi; | 636 | irq = gsi; |
| 633 | irq_alloc_desc_at(irq, 0); | 637 | irq_alloc_desc_at(irq, -1); |
| 634 | } else | 638 | } else |
| 635 | irq = find_unbound_irq(); | 639 | irq = find_unbound_irq(); |
| 636 | 640 | ||
| @@ -664,17 +668,21 @@ out: | |||
| 664 | #include <linux/msi.h> | 668 | #include <linux/msi.h> |
| 665 | #include "../pci/msi.h" | 669 | #include "../pci/msi.h" |
| 666 | 670 | ||
| 667 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq) | 671 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc) |
| 668 | { | 672 | { |
| 669 | spin_lock(&irq_mapping_update_lock); | 673 | spin_lock(&irq_mapping_update_lock); |
| 670 | 674 | ||
| 671 | *irq = find_unbound_irq(); | 675 | if (alloc & XEN_ALLOC_IRQ) { |
| 672 | if (*irq == -1) | 676 | *irq = find_unbound_irq(); |
| 673 | goto out; | 677 | if (*irq == -1) |
| 678 | goto out; | ||
| 679 | } | ||
| 674 | 680 | ||
| 675 | *pirq = find_unbound_pirq(); | 681 | if (alloc & XEN_ALLOC_PIRQ) { |
| 676 | if (*pirq == -1) | 682 | *pirq = find_unbound_pirq(MAP_PIRQ_TYPE_MSI); |
| 677 | goto out; | 683 | if (*pirq == -1) |
| 684 | goto out; | ||
| 685 | } | ||
| 678 | 686 | ||
| 679 | set_irq_chip_and_handler_name(*irq, &xen_pirq_chip, | 687 | set_irq_chip_and_handler_name(*irq, &xen_pirq_chip, |
| 680 | handle_level_irq, name); | 688 | handle_level_irq, name); |
| @@ -762,6 +770,7 @@ int xen_destroy_irq(int irq) | |||
| 762 | printk(KERN_WARNING "unmap irq failed %d\n", rc); | 770 | printk(KERN_WARNING "unmap irq failed %d\n", rc); |
| 763 | goto out; | 771 | goto out; |
| 764 | } | 772 | } |
| 773 | pirq_to_irq[info->u.pirq.pirq] = -1; | ||
| 765 | } | 774 | } |
| 766 | irq_info[irq] = mk_unbound_info(); | 775 | irq_info[irq] = mk_unbound_info(); |
| 767 | 776 | ||
| @@ -782,6 +791,11 @@ int xen_gsi_from_irq(unsigned irq) | |||
| 782 | return gsi_from_irq(irq); | 791 | return gsi_from_irq(irq); |
| 783 | } | 792 | } |
| 784 | 793 | ||
| 794 | int xen_irq_from_pirq(unsigned pirq) | ||
| 795 | { | ||
| 796 | return pirq_to_irq[pirq]; | ||
| 797 | } | ||
| 798 | |||
| 785 | int bind_evtchn_to_irq(unsigned int evtchn) | 799 | int bind_evtchn_to_irq(unsigned int evtchn) |
| 786 | { | 800 | { |
| 787 | int irq; | 801 | int irq; |
| @@ -1279,6 +1293,42 @@ static int retrigger_dynirq(unsigned int irq) | |||
| 1279 | return ret; | 1293 | return ret; |
| 1280 | } | 1294 | } |
| 1281 | 1295 | ||
| 1296 | static void restore_cpu_pirqs(void) | ||
| 1297 | { | ||
| 1298 | int pirq, rc, irq, gsi; | ||
| 1299 | struct physdev_map_pirq map_irq; | ||
| 1300 | |||
| 1301 | for (pirq = 0; pirq < nr_irqs; pirq++) { | ||
| 1302 | irq = pirq_to_irq[pirq]; | ||
| 1303 | if (irq == -1) | ||
| 1304 | continue; | ||
| 1305 | |||
| 1306 | /* save/restore of PT devices doesn't work, so at this point the | ||
| 1307 | * only devices present are GSI based emulated devices */ | ||
| 1308 | gsi = gsi_from_irq(irq); | ||
| 1309 | if (!gsi) | ||
| 1310 | continue; | ||
| 1311 | |||
| 1312 | map_irq.domid = DOMID_SELF; | ||
| 1313 | map_irq.type = MAP_PIRQ_TYPE_GSI; | ||
| 1314 | map_irq.index = gsi; | ||
| 1315 | map_irq.pirq = pirq; | ||
| 1316 | |||
| 1317 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_map_pirq, &map_irq); | ||
| 1318 | if (rc) { | ||
| 1319 | printk(KERN_WARNING "xen map irq failed gsi=%d irq=%d pirq=%d rc=%d\n", | ||
| 1320 | gsi, irq, pirq, rc); | ||
| 1321 | irq_info[irq] = mk_unbound_info(); | ||
| 1322 | pirq_to_irq[pirq] = -1; | ||
| 1323 | continue; | ||
| 1324 | } | ||
| 1325 | |||
| 1326 | printk(KERN_DEBUG "xen: --> irq=%d, pirq=%d\n", irq, map_irq.pirq); | ||
| 1327 | |||
| 1328 | startup_pirq(irq); | ||
| 1329 | } | ||
| 1330 | } | ||
| 1331 | |||
| 1282 | static void restore_cpu_virqs(unsigned int cpu) | 1332 | static void restore_cpu_virqs(unsigned int cpu) |
| 1283 | { | 1333 | { |
| 1284 | struct evtchn_bind_virq bind_virq; | 1334 | struct evtchn_bind_virq bind_virq; |
| @@ -1422,6 +1472,8 @@ void xen_irq_resume(void) | |||
| 1422 | 1472 | ||
| 1423 | unmask_evtchn(evtchn); | 1473 | unmask_evtchn(evtchn); |
| 1424 | } | 1474 | } |
| 1475 | |||
| 1476 | restore_cpu_pirqs(); | ||
| 1425 | } | 1477 | } |
| 1426 | 1478 | ||
| 1427 | static struct irq_chip xen_dynamic_chip __read_mostly = { | 1479 | static struct irq_chip xen_dynamic_chip __read_mostly = { |
| @@ -1506,26 +1558,17 @@ void xen_callback_vector(void) {} | |||
| 1506 | 1558 | ||
| 1507 | void __init xen_init_IRQ(void) | 1559 | void __init xen_init_IRQ(void) |
| 1508 | { | 1560 | { |
| 1509 | int i, rc; | 1561 | int i; |
| 1510 | struct physdev_nr_pirqs op_nr_pirqs; | ||
| 1511 | 1562 | ||
| 1512 | cpu_evtchn_mask_p = kcalloc(nr_cpu_ids, sizeof(struct cpu_evtchn_s), | 1563 | cpu_evtchn_mask_p = kcalloc(nr_cpu_ids, sizeof(struct cpu_evtchn_s), |
| 1513 | GFP_KERNEL); | 1564 | GFP_KERNEL); |
| 1514 | irq_info = kcalloc(nr_irqs, sizeof(*irq_info), GFP_KERNEL); | 1565 | irq_info = kcalloc(nr_irqs, sizeof(*irq_info), GFP_KERNEL); |
| 1515 | 1566 | ||
| 1516 | rc = HYPERVISOR_physdev_op(PHYSDEVOP_get_nr_pirqs, &op_nr_pirqs); | 1567 | /* We are using nr_irqs as the maximum number of pirq available but |
| 1517 | if (rc < 0) { | 1568 | * that number is actually chosen by Xen and we don't know exactly |
| 1518 | nr_pirqs = nr_irqs; | 1569 | * what it is. Be careful choosing high pirq numbers. */ |
| 1519 | if (rc != -ENOSYS) | 1570 | pirq_to_irq = kcalloc(nr_irqs, sizeof(*pirq_to_irq), GFP_KERNEL); |
| 1520 | printk(KERN_WARNING "PHYSDEVOP_get_nr_pirqs returned rc=%d\n", rc); | 1571 | for (i = 0; i < nr_irqs; i++) |
| 1521 | } else { | ||
| 1522 | if (xen_pv_domain() && !xen_initial_domain()) | ||
| 1523 | nr_pirqs = max((int)op_nr_pirqs.nr_pirqs, nr_irqs); | ||
| 1524 | else | ||
| 1525 | nr_pirqs = op_nr_pirqs.nr_pirqs; | ||
| 1526 | } | ||
| 1527 | pirq_to_irq = kcalloc(nr_pirqs, sizeof(*pirq_to_irq), GFP_KERNEL); | ||
| 1528 | for (i = 0; i < nr_pirqs; i++) | ||
| 1529 | pirq_to_irq[i] = -1; | 1572 | pirq_to_irq[i] = -1; |
| 1530 | 1573 | ||
| 1531 | evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq), | 1574 | evtchn_to_irq = kcalloc(NR_EVENT_CHANNELS, sizeof(*evtchn_to_irq), |
diff --git a/drivers/xen/manage.c b/drivers/xen/manage.c index ef9c7db52077..db8c4c4ac880 100644 --- a/drivers/xen/manage.c +++ b/drivers/xen/manage.c | |||
| @@ -49,6 +49,7 @@ static int xen_hvm_suspend(void *data) | |||
| 49 | 49 | ||
| 50 | if (!*cancelled) { | 50 | if (!*cancelled) { |
| 51 | xen_irq_resume(); | 51 | xen_irq_resume(); |
| 52 | xen_console_resume(); | ||
| 52 | xen_timer_resume(); | 53 | xen_timer_resume(); |
| 53 | } | 54 | } |
| 54 | 55 | ||
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index d5c1401f0031..d34896cfb19f 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
| @@ -980,19 +980,11 @@ static int autofs4_root_ioctl_unlocked(struct inode *inode, struct file *filp, | |||
| 980 | } | 980 | } |
| 981 | } | 981 | } |
| 982 | 982 | ||
| 983 | static DEFINE_MUTEX(autofs4_ioctl_mutex); | ||
| 984 | |||
| 985 | static long autofs4_root_ioctl(struct file *filp, | 983 | static long autofs4_root_ioctl(struct file *filp, |
| 986 | unsigned int cmd, unsigned long arg) | 984 | unsigned int cmd, unsigned long arg) |
| 987 | { | 985 | { |
| 988 | long ret; | ||
| 989 | struct inode *inode = filp->f_dentry->d_inode; | 986 | struct inode *inode = filp->f_dentry->d_inode; |
| 990 | 987 | return autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | |
| 991 | mutex_lock(&autofs4_ioctl_mutex); | ||
| 992 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | ||
| 993 | mutex_unlock(&autofs4_ioctl_mutex); | ||
| 994 | |||
| 995 | return ret; | ||
| 996 | } | 988 | } |
| 997 | 989 | ||
| 998 | #ifdef CONFIG_COMPAT | 990 | #ifdef CONFIG_COMPAT |
| @@ -1002,13 +994,11 @@ static long autofs4_root_compat_ioctl(struct file *filp, | |||
| 1002 | struct inode *inode = filp->f_path.dentry->d_inode; | 994 | struct inode *inode = filp->f_path.dentry->d_inode; |
| 1003 | int ret; | 995 | int ret; |
| 1004 | 996 | ||
| 1005 | mutex_lock(&autofs4_ioctl_mutex); | ||
| 1006 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) | 997 | if (cmd == AUTOFS_IOC_READY || cmd == AUTOFS_IOC_FAIL) |
| 1007 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); | 998 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, arg); |
| 1008 | else | 999 | else |
| 1009 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, | 1000 | ret = autofs4_root_ioctl_unlocked(inode, filp, cmd, |
| 1010 | (unsigned long)compat_ptr(arg)); | 1001 | (unsigned long)compat_ptr(arg)); |
| 1011 | mutex_unlock(&autofs4_ioctl_mutex); | ||
| 1012 | 1002 | ||
| 1013 | return ret; | 1003 | return ret; |
| 1014 | } | 1004 | } |
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index c547cca26a26..51d2e4de34eb 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c | |||
| @@ -696,6 +696,7 @@ static int btree_submit_bio_hook(struct inode *inode, int rw, struct bio *bio, | |||
| 696 | __btree_submit_bio_done); | 696 | __btree_submit_bio_done); |
| 697 | } | 697 | } |
| 698 | 698 | ||
| 699 | #ifdef CONFIG_MIGRATION | ||
| 699 | static int btree_migratepage(struct address_space *mapping, | 700 | static int btree_migratepage(struct address_space *mapping, |
| 700 | struct page *newpage, struct page *page) | 701 | struct page *newpage, struct page *page) |
| 701 | { | 702 | { |
| @@ -712,12 +713,9 @@ static int btree_migratepage(struct address_space *mapping, | |||
| 712 | if (page_has_private(page) && | 713 | if (page_has_private(page) && |
| 713 | !try_to_release_page(page, GFP_KERNEL)) | 714 | !try_to_release_page(page, GFP_KERNEL)) |
| 714 | return -EAGAIN; | 715 | return -EAGAIN; |
| 715 | #ifdef CONFIG_MIGRATION | ||
| 716 | return migrate_page(mapping, newpage, page); | 716 | return migrate_page(mapping, newpage, page); |
| 717 | #else | ||
| 718 | return -ENOSYS; | ||
| 719 | #endif | ||
| 720 | } | 717 | } |
| 718 | #endif | ||
| 721 | 719 | ||
| 722 | static int btree_writepage(struct page *page, struct writeback_control *wbc) | 720 | static int btree_writepage(struct page *page, struct writeback_control *wbc) |
| 723 | { | 721 | { |
| @@ -1009,7 +1007,10 @@ static int find_and_setup_root(struct btrfs_root *tree_root, | |||
| 1009 | blocksize = btrfs_level_size(root, btrfs_root_level(&root->root_item)); | 1007 | blocksize = btrfs_level_size(root, btrfs_root_level(&root->root_item)); |
| 1010 | root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item), | 1008 | root->node = read_tree_block(root, btrfs_root_bytenr(&root->root_item), |
| 1011 | blocksize, generation); | 1009 | blocksize, generation); |
| 1012 | BUG_ON(!root->node); | 1010 | if (!root->node || !btrfs_buffer_uptodate(root->node, generation)) { |
| 1011 | free_extent_buffer(root->node); | ||
| 1012 | return -EIO; | ||
| 1013 | } | ||
| 1013 | root->commit_root = btrfs_root_node(root); | 1014 | root->commit_root = btrfs_root_node(root); |
| 1014 | return 0; | 1015 | return 0; |
| 1015 | } | 1016 | } |
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index bcd59c7dfb57..227e5815d838 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
| @@ -429,6 +429,7 @@ err: | |||
| 429 | 429 | ||
| 430 | static int cache_block_group(struct btrfs_block_group_cache *cache, | 430 | static int cache_block_group(struct btrfs_block_group_cache *cache, |
| 431 | struct btrfs_trans_handle *trans, | 431 | struct btrfs_trans_handle *trans, |
| 432 | struct btrfs_root *root, | ||
| 432 | int load_cache_only) | 433 | int load_cache_only) |
| 433 | { | 434 | { |
| 434 | struct btrfs_fs_info *fs_info = cache->fs_info; | 435 | struct btrfs_fs_info *fs_info = cache->fs_info; |
| @@ -442,9 +443,12 @@ static int cache_block_group(struct btrfs_block_group_cache *cache, | |||
| 442 | 443 | ||
| 443 | /* | 444 | /* |
| 444 | * We can't do the read from on-disk cache during a commit since we need | 445 | * We can't do the read from on-disk cache during a commit since we need |
| 445 | * to have the normal tree locking. | 446 | * to have the normal tree locking. Also if we are currently trying to |
| 447 | * allocate blocks for the tree root we can't do the fast caching since | ||
| 448 | * we likely hold important locks. | ||
| 446 | */ | 449 | */ |
| 447 | if (!trans->transaction->in_commit) { | 450 | if (!trans->transaction->in_commit && |
| 451 | (root && root != root->fs_info->tree_root)) { | ||
| 448 | spin_lock(&cache->lock); | 452 | spin_lock(&cache->lock); |
| 449 | if (cache->cached != BTRFS_CACHE_NO) { | 453 | if (cache->cached != BTRFS_CACHE_NO) { |
| 450 | spin_unlock(&cache->lock); | 454 | spin_unlock(&cache->lock); |
| @@ -2741,6 +2745,7 @@ static int cache_save_setup(struct btrfs_block_group_cache *block_group, | |||
| 2741 | struct btrfs_root *root = block_group->fs_info->tree_root; | 2745 | struct btrfs_root *root = block_group->fs_info->tree_root; |
| 2742 | struct inode *inode = NULL; | 2746 | struct inode *inode = NULL; |
| 2743 | u64 alloc_hint = 0; | 2747 | u64 alloc_hint = 0; |
| 2748 | int dcs = BTRFS_DC_ERROR; | ||
| 2744 | int num_pages = 0; | 2749 | int num_pages = 0; |
| 2745 | int retries = 0; | 2750 | int retries = 0; |
| 2746 | int ret = 0; | 2751 | int ret = 0; |
| @@ -2795,6 +2800,8 @@ again: | |||
| 2795 | 2800 | ||
| 2796 | spin_lock(&block_group->lock); | 2801 | spin_lock(&block_group->lock); |
| 2797 | if (block_group->cached != BTRFS_CACHE_FINISHED) { | 2802 | if (block_group->cached != BTRFS_CACHE_FINISHED) { |
| 2803 | /* We're not cached, don't bother trying to write stuff out */ | ||
| 2804 | dcs = BTRFS_DC_WRITTEN; | ||
| 2798 | spin_unlock(&block_group->lock); | 2805 | spin_unlock(&block_group->lock); |
| 2799 | goto out_put; | 2806 | goto out_put; |
| 2800 | } | 2807 | } |
| @@ -2821,6 +2828,8 @@ again: | |||
| 2821 | ret = btrfs_prealloc_file_range_trans(inode, trans, 0, 0, num_pages, | 2828 | ret = btrfs_prealloc_file_range_trans(inode, trans, 0, 0, num_pages, |
| 2822 | num_pages, num_pages, | 2829 | num_pages, num_pages, |
| 2823 | &alloc_hint); | 2830 | &alloc_hint); |
| 2831 | if (!ret) | ||
| 2832 | dcs = BTRFS_DC_SETUP; | ||
| 2824 | btrfs_free_reserved_data_space(inode, num_pages); | 2833 | btrfs_free_reserved_data_space(inode, num_pages); |
| 2825 | out_put: | 2834 | out_put: |
| 2826 | iput(inode); | 2835 | iput(inode); |
| @@ -2828,10 +2837,7 @@ out_free: | |||
| 2828 | btrfs_release_path(root, path); | 2837 | btrfs_release_path(root, path); |
| 2829 | out: | 2838 | out: |
| 2830 | spin_lock(&block_group->lock); | 2839 | spin_lock(&block_group->lock); |
| 2831 | if (ret) | 2840 | block_group->disk_cache_state = dcs; |
| 2832 | block_group->disk_cache_state = BTRFS_DC_ERROR; | ||
| 2833 | else | ||
| 2834 | block_group->disk_cache_state = BTRFS_DC_SETUP; | ||
| 2835 | spin_unlock(&block_group->lock); | 2841 | spin_unlock(&block_group->lock); |
| 2836 | 2842 | ||
| 2837 | return ret; | 2843 | return ret; |
| @@ -3037,7 +3043,13 @@ static void set_avail_alloc_bits(struct btrfs_fs_info *fs_info, u64 flags) | |||
| 3037 | 3043 | ||
| 3038 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags) | 3044 | u64 btrfs_reduce_alloc_profile(struct btrfs_root *root, u64 flags) |
| 3039 | { | 3045 | { |
| 3040 | u64 num_devices = root->fs_info->fs_devices->rw_devices; | 3046 | /* |
| 3047 | * we add in the count of missing devices because we want | ||
| 3048 | * to make sure that any RAID levels on a degraded FS | ||
| 3049 | * continue to be honored. | ||
| 3050 | */ | ||
| 3051 | u64 num_devices = root->fs_info->fs_devices->rw_devices + | ||
| 3052 | root->fs_info->fs_devices->missing_devices; | ||
| 3041 | 3053 | ||
| 3042 | if (num_devices == 1) | 3054 | if (num_devices == 1) |
| 3043 | flags &= ~(BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID0); | 3055 | flags &= ~(BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID0); |
| @@ -4080,7 +4092,7 @@ static int update_block_group(struct btrfs_trans_handle *trans, | |||
| 4080 | * space back to the block group, otherwise we will leak space. | 4092 | * space back to the block group, otherwise we will leak space. |
| 4081 | */ | 4093 | */ |
| 4082 | if (!alloc && cache->cached == BTRFS_CACHE_NO) | 4094 | if (!alloc && cache->cached == BTRFS_CACHE_NO) |
| 4083 | cache_block_group(cache, trans, 1); | 4095 | cache_block_group(cache, trans, NULL, 1); |
| 4084 | 4096 | ||
| 4085 | byte_in_group = bytenr - cache->key.objectid; | 4097 | byte_in_group = bytenr - cache->key.objectid; |
| 4086 | WARN_ON(byte_in_group > cache->key.offset); | 4098 | WARN_ON(byte_in_group > cache->key.offset); |
| @@ -4930,11 +4942,31 @@ search: | |||
| 4930 | btrfs_get_block_group(block_group); | 4942 | btrfs_get_block_group(block_group); |
| 4931 | search_start = block_group->key.objectid; | 4943 | search_start = block_group->key.objectid; |
| 4932 | 4944 | ||
| 4945 | /* | ||
| 4946 | * this can happen if we end up cycling through all the | ||
| 4947 | * raid types, but we want to make sure we only allocate | ||
| 4948 | * for the proper type. | ||
| 4949 | */ | ||
| 4950 | if (!block_group_bits(block_group, data)) { | ||
| 4951 | u64 extra = BTRFS_BLOCK_GROUP_DUP | | ||
| 4952 | BTRFS_BLOCK_GROUP_RAID1 | | ||
| 4953 | BTRFS_BLOCK_GROUP_RAID10; | ||
| 4954 | |||
| 4955 | /* | ||
| 4956 | * if they asked for extra copies and this block group | ||
| 4957 | * doesn't provide them, bail. This does allow us to | ||
| 4958 | * fill raid0 from raid1. | ||
| 4959 | */ | ||
| 4960 | if ((data & extra) && !(block_group->flags & extra)) | ||
| 4961 | goto loop; | ||
| 4962 | } | ||
| 4963 | |||
| 4933 | have_block_group: | 4964 | have_block_group: |
| 4934 | if (unlikely(block_group->cached == BTRFS_CACHE_NO)) { | 4965 | if (unlikely(block_group->cached == BTRFS_CACHE_NO)) { |
| 4935 | u64 free_percent; | 4966 | u64 free_percent; |
| 4936 | 4967 | ||
| 4937 | ret = cache_block_group(block_group, trans, 1); | 4968 | ret = cache_block_group(block_group, trans, |
| 4969 | orig_root, 1); | ||
| 4938 | if (block_group->cached == BTRFS_CACHE_FINISHED) | 4970 | if (block_group->cached == BTRFS_CACHE_FINISHED) |
| 4939 | goto have_block_group; | 4971 | goto have_block_group; |
| 4940 | 4972 | ||
| @@ -4958,7 +4990,8 @@ have_block_group: | |||
| 4958 | if (loop > LOOP_CACHING_NOWAIT || | 4990 | if (loop > LOOP_CACHING_NOWAIT || |
| 4959 | (loop > LOOP_FIND_IDEAL && | 4991 | (loop > LOOP_FIND_IDEAL && |
| 4960 | atomic_read(&space_info->caching_threads) < 2)) { | 4992 | atomic_read(&space_info->caching_threads) < 2)) { |
| 4961 | ret = cache_block_group(block_group, trans, 0); | 4993 | ret = cache_block_group(block_group, trans, |
| 4994 | orig_root, 0); | ||
| 4962 | BUG_ON(ret); | 4995 | BUG_ON(ret); |
| 4963 | } | 4996 | } |
| 4964 | found_uncached_bg = true; | 4997 | found_uncached_bg = true; |
| @@ -5515,7 +5548,7 @@ int btrfs_alloc_logged_file_extent(struct btrfs_trans_handle *trans, | |||
| 5515 | u64 num_bytes = ins->offset; | 5548 | u64 num_bytes = ins->offset; |
| 5516 | 5549 | ||
| 5517 | block_group = btrfs_lookup_block_group(root->fs_info, ins->objectid); | 5550 | block_group = btrfs_lookup_block_group(root->fs_info, ins->objectid); |
| 5518 | cache_block_group(block_group, trans, 0); | 5551 | cache_block_group(block_group, trans, NULL, 0); |
| 5519 | caching_ctl = get_caching_control(block_group); | 5552 | caching_ctl = get_caching_control(block_group); |
| 5520 | 5553 | ||
| 5521 | if (!caching_ctl) { | 5554 | if (!caching_ctl) { |
| @@ -6300,9 +6333,13 @@ int btrfs_drop_snapshot(struct btrfs_root *root, | |||
| 6300 | NULL, NULL); | 6333 | NULL, NULL); |
| 6301 | BUG_ON(ret < 0); | 6334 | BUG_ON(ret < 0); |
| 6302 | if (ret > 0) { | 6335 | if (ret > 0) { |
| 6303 | ret = btrfs_del_orphan_item(trans, tree_root, | 6336 | /* if we fail to delete the orphan item this time |
| 6304 | root->root_key.objectid); | 6337 | * around, it'll get picked up the next time. |
| 6305 | BUG_ON(ret); | 6338 | * |
| 6339 | * The most common failure here is just -ENOENT. | ||
| 6340 | */ | ||
| 6341 | btrfs_del_orphan_item(trans, tree_root, | ||
| 6342 | root->root_key.objectid); | ||
| 6306 | } | 6343 | } |
| 6307 | } | 6344 | } |
| 6308 | 6345 | ||
| @@ -7878,7 +7915,14 @@ static u64 update_block_group_flags(struct btrfs_root *root, u64 flags) | |||
| 7878 | u64 stripped = BTRFS_BLOCK_GROUP_RAID0 | | 7915 | u64 stripped = BTRFS_BLOCK_GROUP_RAID0 | |
| 7879 | BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID10; | 7916 | BTRFS_BLOCK_GROUP_RAID1 | BTRFS_BLOCK_GROUP_RAID10; |
| 7880 | 7917 | ||
| 7881 | num_devices = root->fs_info->fs_devices->rw_devices; | 7918 | /* |
| 7919 | * we add in the count of missing devices because we want | ||
| 7920 | * to make sure that any RAID levels on a degraded FS | ||
| 7921 | * continue to be honored. | ||
| 7922 | */ | ||
| 7923 | num_devices = root->fs_info->fs_devices->rw_devices + | ||
| 7924 | root->fs_info->fs_devices->missing_devices; | ||
| 7925 | |||
| 7882 | if (num_devices == 1) { | 7926 | if (num_devices == 1) { |
| 7883 | stripped |= BTRFS_BLOCK_GROUP_DUP; | 7927 | stripped |= BTRFS_BLOCK_GROUP_DUP; |
| 7884 | stripped = flags & ~stripped; | 7928 | stripped = flags & ~stripped; |
| @@ -8247,7 +8291,6 @@ int btrfs_read_block_groups(struct btrfs_root *root) | |||
| 8247 | break; | 8291 | break; |
| 8248 | if (ret != 0) | 8292 | if (ret != 0) |
| 8249 | goto error; | 8293 | goto error; |
| 8250 | |||
| 8251 | leaf = path->nodes[0]; | 8294 | leaf = path->nodes[0]; |
| 8252 | btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); | 8295 | btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); |
| 8253 | cache = kzalloc(sizeof(*cache), GFP_NOFS); | 8296 | cache = kzalloc(sizeof(*cache), GFP_NOFS); |
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index c1faded5fca0..66836d85763b 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
| @@ -48,30 +48,34 @@ static noinline int btrfs_copy_from_user(loff_t pos, int num_pages, | |||
| 48 | struct page **prepared_pages, | 48 | struct page **prepared_pages, |
| 49 | struct iov_iter *i) | 49 | struct iov_iter *i) |
| 50 | { | 50 | { |
| 51 | size_t copied; | 51 | size_t copied = 0; |
| 52 | int pg = 0; | 52 | int pg = 0; |
| 53 | int offset = pos & (PAGE_CACHE_SIZE - 1); | 53 | int offset = pos & (PAGE_CACHE_SIZE - 1); |
| 54 | int total_copied = 0; | ||
| 54 | 55 | ||
| 55 | while (write_bytes > 0) { | 56 | while (write_bytes > 0) { |
| 56 | size_t count = min_t(size_t, | 57 | size_t count = min_t(size_t, |
| 57 | PAGE_CACHE_SIZE - offset, write_bytes); | 58 | PAGE_CACHE_SIZE - offset, write_bytes); |
| 58 | struct page *page = prepared_pages[pg]; | 59 | struct page *page = prepared_pages[pg]; |
| 59 | again: | 60 | /* |
| 60 | if (unlikely(iov_iter_fault_in_readable(i, count))) | 61 | * Copy data from userspace to the current page |
| 61 | return -EFAULT; | 62 | * |
| 62 | 63 | * Disable pagefault to avoid recursive lock since | |
| 63 | /* Copy data from userspace to the current page */ | 64 | * the pages are already locked |
| 64 | copied = iov_iter_copy_from_user(page, i, offset, count); | 65 | */ |
| 66 | pagefault_disable(); | ||
| 67 | copied = iov_iter_copy_from_user_atomic(page, i, offset, count); | ||
| 68 | pagefault_enable(); | ||
| 65 | 69 | ||
| 66 | /* Flush processor's dcache for this page */ | 70 | /* Flush processor's dcache for this page */ |
| 67 | flush_dcache_page(page); | 71 | flush_dcache_page(page); |
| 68 | iov_iter_advance(i, copied); | 72 | iov_iter_advance(i, copied); |
| 69 | write_bytes -= copied; | 73 | write_bytes -= copied; |
| 74 | total_copied += copied; | ||
| 70 | 75 | ||
| 76 | /* Return to btrfs_file_aio_write to fault page */ | ||
| 71 | if (unlikely(copied == 0)) { | 77 | if (unlikely(copied == 0)) { |
| 72 | count = min_t(size_t, PAGE_CACHE_SIZE - offset, | 78 | break; |
| 73 | iov_iter_single_seg_count(i)); | ||
| 74 | goto again; | ||
| 75 | } | 79 | } |
| 76 | 80 | ||
| 77 | if (unlikely(copied < PAGE_CACHE_SIZE - offset)) { | 81 | if (unlikely(copied < PAGE_CACHE_SIZE - offset)) { |
| @@ -81,7 +85,7 @@ again: | |||
| 81 | offset = 0; | 85 | offset = 0; |
| 82 | } | 86 | } |
| 83 | } | 87 | } |
| 84 | return 0; | 88 | return total_copied; |
| 85 | } | 89 | } |
| 86 | 90 | ||
| 87 | /* | 91 | /* |
| @@ -854,6 +858,8 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
| 854 | unsigned long last_index; | 858 | unsigned long last_index; |
| 855 | int will_write; | 859 | int will_write; |
| 856 | int buffered = 0; | 860 | int buffered = 0; |
| 861 | int copied = 0; | ||
| 862 | int dirty_pages = 0; | ||
| 857 | 863 | ||
| 858 | will_write = ((file->f_flags & O_DSYNC) || IS_SYNC(inode) || | 864 | will_write = ((file->f_flags & O_DSYNC) || IS_SYNC(inode) || |
| 859 | (file->f_flags & O_DIRECT)); | 865 | (file->f_flags & O_DIRECT)); |
| @@ -970,7 +976,17 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
| 970 | WARN_ON(num_pages > nrptrs); | 976 | WARN_ON(num_pages > nrptrs); |
| 971 | memset(pages, 0, sizeof(struct page *) * nrptrs); | 977 | memset(pages, 0, sizeof(struct page *) * nrptrs); |
| 972 | 978 | ||
| 973 | ret = btrfs_delalloc_reserve_space(inode, write_bytes); | 979 | /* |
| 980 | * Fault pages before locking them in prepare_pages | ||
| 981 | * to avoid recursive lock | ||
| 982 | */ | ||
| 983 | if (unlikely(iov_iter_fault_in_readable(&i, write_bytes))) { | ||
| 984 | ret = -EFAULT; | ||
| 985 | goto out; | ||
| 986 | } | ||
| 987 | |||
| 988 | ret = btrfs_delalloc_reserve_space(inode, | ||
| 989 | num_pages << PAGE_CACHE_SHIFT); | ||
| 974 | if (ret) | 990 | if (ret) |
| 975 | goto out; | 991 | goto out; |
| 976 | 992 | ||
| @@ -978,37 +994,49 @@ static ssize_t btrfs_file_aio_write(struct kiocb *iocb, | |||
| 978 | pos, first_index, last_index, | 994 | pos, first_index, last_index, |
| 979 | write_bytes); | 995 | write_bytes); |
| 980 | if (ret) { | 996 | if (ret) { |
| 981 | btrfs_delalloc_release_space(inode, write_bytes); | 997 | btrfs_delalloc_release_space(inode, |
| 998 | num_pages << PAGE_CACHE_SHIFT); | ||
| 982 | goto out; | 999 | goto out; |
| 983 | } | 1000 | } |
| 984 | 1001 | ||
| 985 | ret = btrfs_copy_from_user(pos, num_pages, | 1002 | copied = btrfs_copy_from_user(pos, num_pages, |
| 986 | write_bytes, pages, &i); | 1003 | write_bytes, pages, &i); |
| 987 | if (ret == 0) { | 1004 | dirty_pages = (copied + PAGE_CACHE_SIZE - 1) >> |
| 1005 | PAGE_CACHE_SHIFT; | ||
| 1006 | |||
| 1007 | if (num_pages > dirty_pages) { | ||
| 1008 | if (copied > 0) | ||
| 1009 | atomic_inc( | ||
| 1010 | &BTRFS_I(inode)->outstanding_extents); | ||
| 1011 | btrfs_delalloc_release_space(inode, | ||
| 1012 | (num_pages - dirty_pages) << | ||
| 1013 | PAGE_CACHE_SHIFT); | ||
| 1014 | } | ||
| 1015 | |||
| 1016 | if (copied > 0) { | ||
| 988 | dirty_and_release_pages(NULL, root, file, pages, | 1017 | dirty_and_release_pages(NULL, root, file, pages, |
| 989 | num_pages, pos, write_bytes); | 1018 | dirty_pages, pos, copied); |
| 990 | } | 1019 | } |
| 991 | 1020 | ||
| 992 | btrfs_drop_pages(pages, num_pages); | 1021 | btrfs_drop_pages(pages, num_pages); |
| 993 | if (ret) { | ||
| 994 | btrfs_delalloc_release_space(inode, write_bytes); | ||
| 995 | goto out; | ||
| 996 | } | ||
| 997 | 1022 | ||
| 998 | if (will_write) { | 1023 | if (copied > 0) { |
| 999 | filemap_fdatawrite_range(inode->i_mapping, pos, | 1024 | if (will_write) { |
| 1000 | pos + write_bytes - 1); | 1025 | filemap_fdatawrite_range(inode->i_mapping, pos, |
| 1001 | } else { | 1026 | pos + copied - 1); |
| 1002 | balance_dirty_pages_ratelimited_nr(inode->i_mapping, | 1027 | } else { |
| 1003 | num_pages); | 1028 | balance_dirty_pages_ratelimited_nr( |
| 1004 | if (num_pages < | 1029 | inode->i_mapping, |
| 1005 | (root->leafsize >> PAGE_CACHE_SHIFT) + 1) | 1030 | dirty_pages); |
| 1006 | btrfs_btree_balance_dirty(root, 1); | 1031 | if (dirty_pages < |
| 1007 | btrfs_throttle(root); | 1032 | (root->leafsize >> PAGE_CACHE_SHIFT) + 1) |
| 1033 | btrfs_btree_balance_dirty(root, 1); | ||
| 1034 | btrfs_throttle(root); | ||
| 1035 | } | ||
| 1008 | } | 1036 | } |
| 1009 | 1037 | ||
| 1010 | pos += write_bytes; | 1038 | pos += copied; |
| 1011 | num_written += write_bytes; | 1039 | num_written += copied; |
| 1012 | 1040 | ||
| 1013 | cond_resched(); | 1041 | cond_resched(); |
| 1014 | } | 1042 | } |
diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c index 22ee0dc2e6b8..60d684266959 100644 --- a/fs/btrfs/free-space-cache.c +++ b/fs/btrfs/free-space-cache.c | |||
| @@ -290,7 +290,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info, | |||
| 290 | (unsigned long long)BTRFS_I(inode)->generation, | 290 | (unsigned long long)BTRFS_I(inode)->generation, |
| 291 | (unsigned long long)generation, | 291 | (unsigned long long)generation, |
| 292 | (unsigned long long)block_group->key.objectid); | 292 | (unsigned long long)block_group->key.objectid); |
| 293 | goto out; | 293 | goto free_cache; |
| 294 | } | 294 | } |
| 295 | 295 | ||
| 296 | if (!num_entries) | 296 | if (!num_entries) |
| @@ -524,6 +524,12 @@ int btrfs_write_out_cache(struct btrfs_root *root, | |||
| 524 | return 0; | 524 | return 0; |
| 525 | } | 525 | } |
| 526 | 526 | ||
| 527 | node = rb_first(&block_group->free_space_offset); | ||
| 528 | if (!node) { | ||
| 529 | iput(inode); | ||
| 530 | return 0; | ||
| 531 | } | ||
| 532 | |||
| 527 | last_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; | 533 | last_index = (i_size_read(inode) - 1) >> PAGE_CACHE_SHIFT; |
| 528 | filemap_write_and_wait(inode->i_mapping); | 534 | filemap_write_and_wait(inode->i_mapping); |
| 529 | btrfs_wait_ordered_range(inode, inode->i_size & | 535 | btrfs_wait_ordered_range(inode, inode->i_size & |
| @@ -543,10 +549,6 @@ int btrfs_write_out_cache(struct btrfs_root *root, | |||
| 543 | */ | 549 | */ |
| 544 | first_page_offset = (sizeof(u32) * num_checksums) + sizeof(u64); | 550 | first_page_offset = (sizeof(u32) * num_checksums) + sizeof(u64); |
| 545 | 551 | ||
| 546 | node = rb_first(&block_group->free_space_offset); | ||
| 547 | if (!node) | ||
| 548 | goto out_free; | ||
| 549 | |||
| 550 | /* | 552 | /* |
| 551 | * Lock all pages first so we can lock the extent safely. | 553 | * Lock all pages first so we can lock the extent safely. |
| 552 | * | 554 | * |
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8039390bd6a6..72f31ecb5c90 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
| @@ -495,7 +495,7 @@ again: | |||
| 495 | add_async_extent(async_cow, start, num_bytes, | 495 | add_async_extent(async_cow, start, num_bytes, |
| 496 | total_compressed, pages, nr_pages_ret); | 496 | total_compressed, pages, nr_pages_ret); |
| 497 | 497 | ||
| 498 | if (start + num_bytes < end && start + num_bytes < actual_end) { | 498 | if (start + num_bytes < end) { |
| 499 | start += num_bytes; | 499 | start += num_bytes; |
| 500 | pages = NULL; | 500 | pages = NULL; |
| 501 | cond_resched(); | 501 | cond_resched(); |
| @@ -5712,9 +5712,9 @@ static void btrfs_end_dio_bio(struct bio *bio, int err) | |||
| 5712 | 5712 | ||
| 5713 | if (err) { | 5713 | if (err) { |
| 5714 | printk(KERN_ERR "btrfs direct IO failed ino %lu rw %lu " | 5714 | printk(KERN_ERR "btrfs direct IO failed ino %lu rw %lu " |
| 5715 | "disk_bytenr %lu len %u err no %d\n", | 5715 | "sector %#Lx len %u err no %d\n", |
| 5716 | dip->inode->i_ino, bio->bi_rw, bio->bi_sector, | 5716 | dip->inode->i_ino, bio->bi_rw, |
| 5717 | bio->bi_size, err); | 5717 | (unsigned long long)bio->bi_sector, bio->bi_size, err); |
| 5718 | dip->errors = 1; | 5718 | dip->errors = 1; |
| 5719 | 5719 | ||
| 5720 | /* | 5720 | /* |
| @@ -5934,8 +5934,7 @@ free_ordered: | |||
| 5934 | */ | 5934 | */ |
| 5935 | if (write) { | 5935 | if (write) { |
| 5936 | struct btrfs_ordered_extent *ordered; | 5936 | struct btrfs_ordered_extent *ordered; |
| 5937 | ordered = btrfs_lookup_ordered_extent(inode, | 5937 | ordered = btrfs_lookup_ordered_extent(inode, file_offset); |
| 5938 | dip->logical_offset); | ||
| 5939 | if (!test_bit(BTRFS_ORDERED_PREALLOC, &ordered->flags) && | 5938 | if (!test_bit(BTRFS_ORDERED_PREALLOC, &ordered->flags) && |
| 5940 | !test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) | 5939 | !test_bit(BTRFS_ORDERED_NOCOW, &ordered->flags)) |
| 5941 | btrfs_free_reserved_extent(root, ordered->start, | 5940 | btrfs_free_reserved_extent(root, ordered->start, |
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index f1c9bb4079ed..f87552a1d7ea 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
| @@ -947,23 +947,42 @@ out: | |||
| 947 | 947 | ||
| 948 | static noinline int btrfs_ioctl_snap_create(struct file *file, | 948 | static noinline int btrfs_ioctl_snap_create(struct file *file, |
| 949 | void __user *arg, int subvol, | 949 | void __user *arg, int subvol, |
| 950 | int async) | 950 | int v2) |
| 951 | { | 951 | { |
| 952 | struct btrfs_ioctl_vol_args *vol_args = NULL; | 952 | struct btrfs_ioctl_vol_args *vol_args = NULL; |
| 953 | struct btrfs_ioctl_async_vol_args *async_vol_args = NULL; | 953 | struct btrfs_ioctl_vol_args_v2 *vol_args_v2 = NULL; |
| 954 | char *name; | 954 | char *name; |
| 955 | u64 fd; | 955 | u64 fd; |
| 956 | u64 transid = 0; | ||
| 957 | int ret; | 956 | int ret; |
| 958 | 957 | ||
| 959 | if (async) { | 958 | if (v2) { |
| 960 | async_vol_args = memdup_user(arg, sizeof(*async_vol_args)); | 959 | u64 transid = 0; |
| 961 | if (IS_ERR(async_vol_args)) | 960 | u64 *ptr = NULL; |
| 962 | return PTR_ERR(async_vol_args); | ||
| 963 | 961 | ||
| 964 | name = async_vol_args->name; | 962 | vol_args_v2 = memdup_user(arg, sizeof(*vol_args_v2)); |
| 965 | fd = async_vol_args->fd; | 963 | if (IS_ERR(vol_args_v2)) |
| 966 | async_vol_args->name[BTRFS_SNAPSHOT_NAME_MAX] = '\0'; | 964 | return PTR_ERR(vol_args_v2); |
| 965 | |||
| 966 | if (vol_args_v2->flags & ~BTRFS_SUBVOL_CREATE_ASYNC) { | ||
| 967 | ret = -EINVAL; | ||
| 968 | goto out; | ||
| 969 | } | ||
| 970 | |||
| 971 | name = vol_args_v2->name; | ||
| 972 | fd = vol_args_v2->fd; | ||
| 973 | vol_args_v2->name[BTRFS_SUBVOL_NAME_MAX] = '\0'; | ||
| 974 | |||
| 975 | if (vol_args_v2->flags & BTRFS_SUBVOL_CREATE_ASYNC) | ||
| 976 | ptr = &transid; | ||
| 977 | |||
| 978 | ret = btrfs_ioctl_snap_create_transid(file, name, fd, | ||
| 979 | subvol, ptr); | ||
| 980 | |||
| 981 | if (ret == 0 && ptr && | ||
| 982 | copy_to_user(arg + | ||
| 983 | offsetof(struct btrfs_ioctl_vol_args_v2, | ||
| 984 | transid), ptr, sizeof(*ptr))) | ||
| 985 | ret = -EFAULT; | ||
| 967 | } else { | 986 | } else { |
| 968 | vol_args = memdup_user(arg, sizeof(*vol_args)); | 987 | vol_args = memdup_user(arg, sizeof(*vol_args)); |
| 969 | if (IS_ERR(vol_args)) | 988 | if (IS_ERR(vol_args)) |
| @@ -971,20 +990,13 @@ static noinline int btrfs_ioctl_snap_create(struct file *file, | |||
| 971 | name = vol_args->name; | 990 | name = vol_args->name; |
| 972 | fd = vol_args->fd; | 991 | fd = vol_args->fd; |
| 973 | vol_args->name[BTRFS_PATH_NAME_MAX] = '\0'; | 992 | vol_args->name[BTRFS_PATH_NAME_MAX] = '\0'; |
| 974 | } | ||
| 975 | |||
| 976 | ret = btrfs_ioctl_snap_create_transid(file, name, fd, | ||
| 977 | subvol, &transid); | ||
| 978 | 993 | ||
| 979 | if (!ret && async) { | 994 | ret = btrfs_ioctl_snap_create_transid(file, name, fd, |
| 980 | if (copy_to_user(arg + | 995 | subvol, NULL); |
| 981 | offsetof(struct btrfs_ioctl_async_vol_args, | ||
| 982 | transid), &transid, sizeof(transid))) | ||
| 983 | return -EFAULT; | ||
| 984 | } | 996 | } |
| 985 | 997 | out: | |
| 986 | kfree(vol_args); | 998 | kfree(vol_args); |
| 987 | kfree(async_vol_args); | 999 | kfree(vol_args_v2); |
| 988 | 1000 | ||
| 989 | return ret; | 1001 | return ret; |
| 990 | } | 1002 | } |
| @@ -2246,7 +2258,7 @@ long btrfs_ioctl(struct file *file, unsigned int | |||
| 2246 | return btrfs_ioctl_getversion(file, argp); | 2258 | return btrfs_ioctl_getversion(file, argp); |
| 2247 | case BTRFS_IOC_SNAP_CREATE: | 2259 | case BTRFS_IOC_SNAP_CREATE: |
| 2248 | return btrfs_ioctl_snap_create(file, argp, 0, 0); | 2260 | return btrfs_ioctl_snap_create(file, argp, 0, 0); |
| 2249 | case BTRFS_IOC_SNAP_CREATE_ASYNC: | 2261 | case BTRFS_IOC_SNAP_CREATE_V2: |
| 2250 | return btrfs_ioctl_snap_create(file, argp, 0, 1); | 2262 | return btrfs_ioctl_snap_create(file, argp, 0, 1); |
| 2251 | case BTRFS_IOC_SUBVOL_CREATE: | 2263 | case BTRFS_IOC_SUBVOL_CREATE: |
| 2252 | return btrfs_ioctl_snap_create(file, argp, 1, 0); | 2264 | return btrfs_ioctl_snap_create(file, argp, 1, 0); |
diff --git a/fs/btrfs/ioctl.h b/fs/btrfs/ioctl.h index 17c99ebdf960..c344d12c646b 100644 --- a/fs/btrfs/ioctl.h +++ b/fs/btrfs/ioctl.h | |||
| @@ -30,11 +30,15 @@ struct btrfs_ioctl_vol_args { | |||
| 30 | char name[BTRFS_PATH_NAME_MAX + 1]; | 30 | char name[BTRFS_PATH_NAME_MAX + 1]; |
| 31 | }; | 31 | }; |
| 32 | 32 | ||
| 33 | #define BTRFS_SNAPSHOT_NAME_MAX 4079 | 33 | #define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0) |
| 34 | struct btrfs_ioctl_async_vol_args { | 34 | |
| 35 | #define BTRFS_SUBVOL_NAME_MAX 4039 | ||
| 36 | struct btrfs_ioctl_vol_args_v2 { | ||
| 35 | __s64 fd; | 37 | __s64 fd; |
| 36 | __u64 transid; | 38 | __u64 transid; |
| 37 | char name[BTRFS_SNAPSHOT_NAME_MAX + 1]; | 39 | __u64 flags; |
| 40 | __u64 unused[4]; | ||
| 41 | char name[BTRFS_SUBVOL_NAME_MAX + 1]; | ||
| 38 | }; | 42 | }; |
| 39 | 43 | ||
| 40 | #define BTRFS_INO_LOOKUP_PATH_MAX 4080 | 44 | #define BTRFS_INO_LOOKUP_PATH_MAX 4080 |
| @@ -187,6 +191,6 @@ struct btrfs_ioctl_space_args { | |||
| 187 | struct btrfs_ioctl_space_args) | 191 | struct btrfs_ioctl_space_args) |
| 188 | #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) | 192 | #define BTRFS_IOC_START_SYNC _IOR(BTRFS_IOCTL_MAGIC, 24, __u64) |
| 189 | #define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) | 193 | #define BTRFS_IOC_WAIT_SYNC _IOW(BTRFS_IOCTL_MAGIC, 22, __u64) |
| 190 | #define BTRFS_IOC_SNAP_CREATE_ASYNC _IOW(BTRFS_IOCTL_MAGIC, 23, \ | 194 | #define BTRFS_IOC_SNAP_CREATE_V2 _IOW(BTRFS_IOCTL_MAGIC, 23, \ |
| 191 | struct btrfs_ioctl_async_vol_args) | 195 | struct btrfs_ioctl_vol_args_v2) |
| 192 | #endif | 196 | #endif |
diff --git a/fs/btrfs/orphan.c b/fs/btrfs/orphan.c index 79cba5fbc28e..f8be250963a0 100644 --- a/fs/btrfs/orphan.c +++ b/fs/btrfs/orphan.c | |||
| @@ -56,8 +56,12 @@ int btrfs_del_orphan_item(struct btrfs_trans_handle *trans, | |||
| 56 | return -ENOMEM; | 56 | return -ENOMEM; |
| 57 | 57 | ||
| 58 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); | 58 | ret = btrfs_search_slot(trans, root, &key, path, -1, 1); |
| 59 | if (ret) | 59 | if (ret < 0) |
| 60 | goto out; | 60 | goto out; |
| 61 | if (ret) { | ||
| 62 | ret = -ENOENT; | ||
| 63 | goto out; | ||
| 64 | } | ||
| 61 | 65 | ||
| 62 | ret = btrfs_del_item(trans, root, path); | 66 | ret = btrfs_del_item(trans, root, path); |
| 63 | 67 | ||
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index dbb51ea7a13c..883c6fa1367e 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c | |||
| @@ -685,9 +685,9 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags, | |||
| 685 | mutex_unlock(&root->d_inode->i_mutex); | 685 | mutex_unlock(&root->d_inode->i_mutex); |
| 686 | 686 | ||
| 687 | if (IS_ERR(new_root)) { | 687 | if (IS_ERR(new_root)) { |
| 688 | dput(root); | ||
| 688 | deactivate_locked_super(s); | 689 | deactivate_locked_super(s); |
| 689 | error = PTR_ERR(new_root); | 690 | error = PTR_ERR(new_root); |
| 690 | dput(root); | ||
| 691 | goto error_free_subvol_name; | 691 | goto error_free_subvol_name; |
| 692 | } | 692 | } |
| 693 | if (!new_root->d_inode) { | 693 | if (!new_root->d_inode) { |
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index cc04dc1445d6..6b9884507837 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
| @@ -412,12 +412,16 @@ static noinline int device_list_add(const char *path, | |||
| 412 | 412 | ||
| 413 | device->fs_devices = fs_devices; | 413 | device->fs_devices = fs_devices; |
| 414 | fs_devices->num_devices++; | 414 | fs_devices->num_devices++; |
| 415 | } else if (strcmp(device->name, path)) { | 415 | } else if (!device->name || strcmp(device->name, path)) { |
| 416 | name = kstrdup(path, GFP_NOFS); | 416 | name = kstrdup(path, GFP_NOFS); |
| 417 | if (!name) | 417 | if (!name) |
| 418 | return -ENOMEM; | 418 | return -ENOMEM; |
| 419 | kfree(device->name); | 419 | kfree(device->name); |
| 420 | device->name = name; | 420 | device->name = name; |
| 421 | if (device->missing) { | ||
| 422 | fs_devices->missing_devices--; | ||
| 423 | device->missing = 0; | ||
| 424 | } | ||
| 421 | } | 425 | } |
| 422 | 426 | ||
| 423 | if (found_transid > fs_devices->latest_trans) { | 427 | if (found_transid > fs_devices->latest_trans) { |
| @@ -1236,6 +1240,9 @@ int btrfs_rm_device(struct btrfs_root *root, char *device_path) | |||
| 1236 | 1240 | ||
| 1237 | device->fs_devices->num_devices--; | 1241 | device->fs_devices->num_devices--; |
| 1238 | 1242 | ||
| 1243 | if (device->missing) | ||
| 1244 | root->fs_info->fs_devices->missing_devices--; | ||
| 1245 | |||
| 1239 | next_device = list_entry(root->fs_info->fs_devices->devices.next, | 1246 | next_device = list_entry(root->fs_info->fs_devices->devices.next, |
| 1240 | struct btrfs_device, dev_list); | 1247 | struct btrfs_device, dev_list); |
| 1241 | if (device->bdev == root->fs_info->sb->s_bdev) | 1248 | if (device->bdev == root->fs_info->sb->s_bdev) |
| @@ -3080,7 +3087,9 @@ static struct btrfs_device *add_missing_dev(struct btrfs_root *root, | |||
| 3080 | device->devid = devid; | 3087 | device->devid = devid; |
| 3081 | device->work.func = pending_bios_fn; | 3088 | device->work.func = pending_bios_fn; |
| 3082 | device->fs_devices = fs_devices; | 3089 | device->fs_devices = fs_devices; |
| 3090 | device->missing = 1; | ||
| 3083 | fs_devices->num_devices++; | 3091 | fs_devices->num_devices++; |
| 3092 | fs_devices->missing_devices++; | ||
| 3084 | spin_lock_init(&device->io_lock); | 3093 | spin_lock_init(&device->io_lock); |
| 3085 | INIT_LIST_HEAD(&device->dev_alloc_list); | 3094 | INIT_LIST_HEAD(&device->dev_alloc_list); |
| 3086 | memcpy(device->uuid, dev_uuid, BTRFS_UUID_SIZE); | 3095 | memcpy(device->uuid, dev_uuid, BTRFS_UUID_SIZE); |
| @@ -3278,6 +3287,15 @@ static int read_one_dev(struct btrfs_root *root, | |||
| 3278 | device = add_missing_dev(root, devid, dev_uuid); | 3287 | device = add_missing_dev(root, devid, dev_uuid); |
| 3279 | if (!device) | 3288 | if (!device) |
| 3280 | return -ENOMEM; | 3289 | return -ENOMEM; |
| 3290 | } else if (!device->missing) { | ||
| 3291 | /* | ||
| 3292 | * this happens when a device that was properly setup | ||
| 3293 | * in the device info lists suddenly goes bad. | ||
| 3294 | * device->bdev is NULL, and so we have to set | ||
| 3295 | * device->missing to one here | ||
| 3296 | */ | ||
| 3297 | root->fs_info->fs_devices->missing_devices++; | ||
| 3298 | device->missing = 1; | ||
| 3281 | } | 3299 | } |
| 3282 | } | 3300 | } |
| 3283 | 3301 | ||
diff --git a/fs/btrfs/volumes.h b/fs/btrfs/volumes.h index 2b638b6e4eea..2740db49eb04 100644 --- a/fs/btrfs/volumes.h +++ b/fs/btrfs/volumes.h | |||
| @@ -44,6 +44,7 @@ struct btrfs_device { | |||
| 44 | 44 | ||
| 45 | int writeable; | 45 | int writeable; |
| 46 | int in_fs_metadata; | 46 | int in_fs_metadata; |
| 47 | int missing; | ||
| 47 | 48 | ||
| 48 | spinlock_t io_lock; | 49 | spinlock_t io_lock; |
| 49 | 50 | ||
| @@ -93,6 +94,7 @@ struct btrfs_fs_devices { | |||
| 93 | u64 num_devices; | 94 | u64 num_devices; |
| 94 | u64 open_devices; | 95 | u64 open_devices; |
| 95 | u64 rw_devices; | 96 | u64 rw_devices; |
| 97 | u64 missing_devices; | ||
| 96 | u64 total_rw_bytes; | 98 | u64 total_rw_bytes; |
| 97 | struct block_device *latest_bdev; | 99 | struct block_device *latest_bdev; |
| 98 | 100 | ||
diff --git a/fs/ceph/dir.c b/fs/ceph/dir.c index 7d447af84ec4..158c700fdca5 100644 --- a/fs/ceph/dir.c +++ b/fs/ceph/dir.c | |||
| @@ -114,8 +114,8 @@ static int __dcache_readdir(struct file *filp, | |||
| 114 | spin_lock(&dcache_lock); | 114 | spin_lock(&dcache_lock); |
| 115 | 115 | ||
| 116 | /* start at beginning? */ | 116 | /* start at beginning? */ |
| 117 | if (filp->f_pos == 2 || (last && | 117 | if (filp->f_pos == 2 || last == NULL || |
| 118 | filp->f_pos < ceph_dentry(last)->offset)) { | 118 | filp->f_pos < ceph_dentry(last)->offset) { |
| 119 | if (list_empty(&parent->d_subdirs)) | 119 | if (list_empty(&parent->d_subdirs)) |
| 120 | goto out_unlock; | 120 | goto out_unlock; |
| 121 | p = parent->d_subdirs.prev; | 121 | p = parent->d_subdirs.prev; |
diff --git a/fs/ceph/ioctl.h b/fs/ceph/ioctl.h index a6ce54e94eb5..52e8fd74d450 100644 --- a/fs/ceph/ioctl.h +++ b/fs/ceph/ioctl.h | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | #include <linux/ioctl.h> | 4 | #include <linux/ioctl.h> |
| 5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
| 6 | 6 | ||
| 7 | #define CEPH_IOCTL_MAGIC 0x98 | 7 | #define CEPH_IOCTL_MAGIC 0x97 |
| 8 | 8 | ||
| 9 | /* just use u64 to align sanely on all archs */ | 9 | /* just use u64 to align sanely on all archs */ |
| 10 | struct ceph_ioctl_layout { | 10 | struct ceph_ioctl_layout { |
diff --git a/fs/ceph/locks.c b/fs/ceph/locks.c index 40abde93c345..476b329867d4 100644 --- a/fs/ceph/locks.c +++ b/fs/ceph/locks.c | |||
| @@ -11,40 +11,68 @@ | |||
| 11 | * Implement fcntl and flock locking functions. | 11 | * Implement fcntl and flock locking functions. |
| 12 | */ | 12 | */ |
| 13 | static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, | 13 | static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, |
| 14 | u64 pid, u64 pid_ns, | 14 | int cmd, u8 wait, struct file_lock *fl) |
| 15 | int cmd, u64 start, u64 length, u8 wait) | ||
| 16 | { | 15 | { |
| 17 | struct inode *inode = file->f_dentry->d_inode; | 16 | struct inode *inode = file->f_dentry->d_inode; |
| 18 | struct ceph_mds_client *mdsc = | 17 | struct ceph_mds_client *mdsc = |
| 19 | ceph_sb_to_client(inode->i_sb)->mdsc; | 18 | ceph_sb_to_client(inode->i_sb)->mdsc; |
| 20 | struct ceph_mds_request *req; | 19 | struct ceph_mds_request *req; |
| 21 | int err; | 20 | int err; |
| 21 | u64 length = 0; | ||
| 22 | 22 | ||
| 23 | req = ceph_mdsc_create_request(mdsc, operation, USE_AUTH_MDS); | 23 | req = ceph_mdsc_create_request(mdsc, operation, USE_AUTH_MDS); |
| 24 | if (IS_ERR(req)) | 24 | if (IS_ERR(req)) |
| 25 | return PTR_ERR(req); | 25 | return PTR_ERR(req); |
| 26 | req->r_inode = igrab(inode); | 26 | req->r_inode = igrab(inode); |
| 27 | 27 | ||
| 28 | /* mds requires start and length rather than start and end */ | ||
| 29 | if (LLONG_MAX == fl->fl_end) | ||
| 30 | length = 0; | ||
| 31 | else | ||
| 32 | length = fl->fl_end - fl->fl_start + 1; | ||
| 33 | |||
| 28 | dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, " | 34 | dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, " |
| 29 | "length: %llu, wait: %d, type`: %d", (int)lock_type, | 35 | "length: %llu, wait: %d, type`: %d", (int)lock_type, |
| 30 | (int)operation, pid, start, length, wait, cmd); | 36 | (int)operation, (u64)fl->fl_pid, fl->fl_start, |
| 37 | length, wait, fl->fl_type); | ||
| 38 | |||
| 31 | 39 | ||
| 32 | req->r_args.filelock_change.rule = lock_type; | 40 | req->r_args.filelock_change.rule = lock_type; |
| 33 | req->r_args.filelock_change.type = cmd; | 41 | req->r_args.filelock_change.type = cmd; |
| 34 | req->r_args.filelock_change.pid = cpu_to_le64(pid); | 42 | req->r_args.filelock_change.pid = cpu_to_le64((u64)fl->fl_pid); |
| 35 | /* This should be adjusted, but I'm not sure if | 43 | /* This should be adjusted, but I'm not sure if |
| 36 | namespaces actually get id numbers*/ | 44 | namespaces actually get id numbers*/ |
| 37 | req->r_args.filelock_change.pid_namespace = | 45 | req->r_args.filelock_change.pid_namespace = |
| 38 | cpu_to_le64((u64)pid_ns); | 46 | cpu_to_le64((u64)(unsigned long)fl->fl_nspid); |
| 39 | req->r_args.filelock_change.start = cpu_to_le64(start); | 47 | req->r_args.filelock_change.start = cpu_to_le64(fl->fl_start); |
| 40 | req->r_args.filelock_change.length = cpu_to_le64(length); | 48 | req->r_args.filelock_change.length = cpu_to_le64(length); |
| 41 | req->r_args.filelock_change.wait = wait; | 49 | req->r_args.filelock_change.wait = wait; |
| 42 | 50 | ||
| 43 | err = ceph_mdsc_do_request(mdsc, inode, req); | 51 | err = ceph_mdsc_do_request(mdsc, inode, req); |
| 52 | |||
| 53 | if ( operation == CEPH_MDS_OP_GETFILELOCK){ | ||
| 54 | fl->fl_pid = le64_to_cpu(req->r_reply_info.filelock_reply->pid); | ||
| 55 | if (CEPH_LOCK_SHARED == req->r_reply_info.filelock_reply->type) | ||
| 56 | fl->fl_type = F_RDLCK; | ||
| 57 | else if (CEPH_LOCK_EXCL == req->r_reply_info.filelock_reply->type) | ||
| 58 | fl->fl_type = F_WRLCK; | ||
| 59 | else | ||
| 60 | fl->fl_type = F_UNLCK; | ||
| 61 | |||
| 62 | fl->fl_start = le64_to_cpu(req->r_reply_info.filelock_reply->start); | ||
| 63 | length = le64_to_cpu(req->r_reply_info.filelock_reply->start) + | ||
| 64 | le64_to_cpu(req->r_reply_info.filelock_reply->length); | ||
| 65 | if (length >= 1) | ||
| 66 | fl->fl_end = length -1; | ||
| 67 | else | ||
| 68 | fl->fl_end = 0; | ||
| 69 | |||
| 70 | } | ||
| 44 | ceph_mdsc_put_request(req); | 71 | ceph_mdsc_put_request(req); |
| 45 | dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, " | 72 | dout("ceph_lock_message: rule: %d, op: %d, pid: %llu, start: %llu, " |
| 46 | "length: %llu, wait: %d, type`: %d err code %d", (int)lock_type, | 73 | "length: %llu, wait: %d, type`: %d, err code %d", (int)lock_type, |
| 47 | (int)operation, pid, start, length, wait, cmd, err); | 74 | (int)operation, (u64)fl->fl_pid, fl->fl_start, |
| 75 | length, wait, fl->fl_type, err); | ||
| 48 | return err; | 76 | return err; |
| 49 | } | 77 | } |
| 50 | 78 | ||
| @@ -54,7 +82,6 @@ static int ceph_lock_message(u8 lock_type, u16 operation, struct file *file, | |||
| 54 | */ | 82 | */ |
| 55 | int ceph_lock(struct file *file, int cmd, struct file_lock *fl) | 83 | int ceph_lock(struct file *file, int cmd, struct file_lock *fl) |
| 56 | { | 84 | { |
| 57 | u64 length; | ||
| 58 | u8 lock_cmd; | 85 | u8 lock_cmd; |
| 59 | int err; | 86 | int err; |
| 60 | u8 wait = 0; | 87 | u8 wait = 0; |
| @@ -76,29 +103,20 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl) | |||
| 76 | else | 103 | else |
| 77 | lock_cmd = CEPH_LOCK_UNLOCK; | 104 | lock_cmd = CEPH_LOCK_UNLOCK; |
| 78 | 105 | ||
| 79 | if (LLONG_MAX == fl->fl_end) | 106 | err = ceph_lock_message(CEPH_LOCK_FCNTL, op, file, lock_cmd, wait, fl); |
| 80 | length = 0; | ||
| 81 | else | ||
| 82 | length = fl->fl_end - fl->fl_start + 1; | ||
| 83 | |||
| 84 | err = ceph_lock_message(CEPH_LOCK_FCNTL, op, file, | ||
| 85 | (u64)fl->fl_pid, | ||
| 86 | (u64)(unsigned long)fl->fl_nspid, | ||
| 87 | lock_cmd, fl->fl_start, | ||
| 88 | length, wait); | ||
| 89 | if (!err) { | 107 | if (!err) { |
| 90 | dout("mds locked, locking locally"); | 108 | if ( op != CEPH_MDS_OP_GETFILELOCK ){ |
| 91 | err = posix_lock_file(file, fl, NULL); | 109 | dout("mds locked, locking locally"); |
| 92 | if (err && (CEPH_MDS_OP_SETFILELOCK == op)) { | 110 | err = posix_lock_file(file, fl, NULL); |
| 93 | /* undo! This should only happen if the kernel detects | 111 | if (err && (CEPH_MDS_OP_SETFILELOCK == op)) { |
| 94 | * local deadlock. */ | 112 | /* undo! This should only happen if the kernel detects |
| 95 | ceph_lock_message(CEPH_LOCK_FCNTL, op, file, | 113 | * local deadlock. */ |
| 96 | (u64)fl->fl_pid, | 114 | ceph_lock_message(CEPH_LOCK_FCNTL, op, file, |
| 97 | (u64)(unsigned long)fl->fl_nspid, | 115 | CEPH_LOCK_UNLOCK, 0, fl); |
| 98 | CEPH_LOCK_UNLOCK, fl->fl_start, | 116 | dout("got %d on posix_lock_file, undid lock", err); |
| 99 | length, 0); | 117 | } |
| 100 | dout("got %d on posix_lock_file, undid lock", err); | ||
| 101 | } | 118 | } |
| 119 | |||
| 102 | } else { | 120 | } else { |
| 103 | dout("mds returned error code %d", err); | 121 | dout("mds returned error code %d", err); |
| 104 | } | 122 | } |
| @@ -107,7 +125,6 @@ int ceph_lock(struct file *file, int cmd, struct file_lock *fl) | |||
| 107 | 125 | ||
| 108 | int ceph_flock(struct file *file, int cmd, struct file_lock *fl) | 126 | int ceph_flock(struct file *file, int cmd, struct file_lock *fl) |
| 109 | { | 127 | { |
| 110 | u64 length; | ||
| 111 | u8 lock_cmd; | 128 | u8 lock_cmd; |
| 112 | int err; | 129 | int err; |
| 113 | u8 wait = 1; | 130 | u8 wait = 1; |
| @@ -127,26 +144,15 @@ int ceph_flock(struct file *file, int cmd, struct file_lock *fl) | |||
| 127 | lock_cmd = CEPH_LOCK_EXCL; | 144 | lock_cmd = CEPH_LOCK_EXCL; |
| 128 | else | 145 | else |
| 129 | lock_cmd = CEPH_LOCK_UNLOCK; | 146 | lock_cmd = CEPH_LOCK_UNLOCK; |
| 130 | /* mds requires start and length rather than start and end */ | ||
| 131 | if (LLONG_MAX == fl->fl_end) | ||
| 132 | length = 0; | ||
| 133 | else | ||
| 134 | length = fl->fl_end - fl->fl_start + 1; | ||
| 135 | 147 | ||
| 136 | err = ceph_lock_message(CEPH_LOCK_FLOCK, CEPH_MDS_OP_SETFILELOCK, | 148 | err = ceph_lock_message(CEPH_LOCK_FLOCK, CEPH_MDS_OP_SETFILELOCK, |
| 137 | file, (u64)fl->fl_pid, | 149 | file, lock_cmd, wait, fl); |
| 138 | (u64)(unsigned long)fl->fl_nspid, | ||
| 139 | lock_cmd, fl->fl_start, | ||
| 140 | length, wait); | ||
| 141 | if (!err) { | 150 | if (!err) { |
| 142 | err = flock_lock_file_wait(file, fl); | 151 | err = flock_lock_file_wait(file, fl); |
| 143 | if (err) { | 152 | if (err) { |
| 144 | ceph_lock_message(CEPH_LOCK_FLOCK, | 153 | ceph_lock_message(CEPH_LOCK_FLOCK, |
| 145 | CEPH_MDS_OP_SETFILELOCK, | 154 | CEPH_MDS_OP_SETFILELOCK, |
| 146 | file, (u64)fl->fl_pid, | 155 | file, CEPH_LOCK_UNLOCK, 0, fl); |
| 147 | (u64)(unsigned long)fl->fl_nspid, | ||
| 148 | CEPH_LOCK_UNLOCK, fl->fl_start, | ||
| 149 | length, 0); | ||
| 150 | dout("got %d on flock_lock_file_wait, undid lock", err); | 156 | dout("got %d on flock_lock_file_wait, undid lock", err); |
| 151 | } | 157 | } |
| 152 | } else { | 158 | } else { |
diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 098b18508479..38800eaa81d0 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c | |||
| @@ -202,6 +202,38 @@ out_bad: | |||
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | /* | 204 | /* |
| 205 | * parse fcntl F_GETLK results | ||
| 206 | */ | ||
| 207 | static int parse_reply_info_filelock(void **p, void *end, | ||
| 208 | struct ceph_mds_reply_info_parsed *info) | ||
| 209 | { | ||
| 210 | if (*p + sizeof(*info->filelock_reply) > end) | ||
| 211 | goto bad; | ||
| 212 | |||
| 213 | info->filelock_reply = *p; | ||
| 214 | *p += sizeof(*info->filelock_reply); | ||
| 215 | |||
| 216 | if (unlikely(*p != end)) | ||
| 217 | goto bad; | ||
| 218 | return 0; | ||
| 219 | |||
| 220 | bad: | ||
| 221 | return -EIO; | ||
| 222 | } | ||
| 223 | |||
| 224 | /* | ||
| 225 | * parse extra results | ||
| 226 | */ | ||
| 227 | static int parse_reply_info_extra(void **p, void *end, | ||
| 228 | struct ceph_mds_reply_info_parsed *info) | ||
| 229 | { | ||
| 230 | if (info->head->op == CEPH_MDS_OP_GETFILELOCK) | ||
| 231 | return parse_reply_info_filelock(p, end, info); | ||
| 232 | else | ||
| 233 | return parse_reply_info_dir(p, end, info); | ||
| 234 | } | ||
| 235 | |||
| 236 | /* | ||
| 205 | * parse entire mds reply | 237 | * parse entire mds reply |
| 206 | */ | 238 | */ |
| 207 | static int parse_reply_info(struct ceph_msg *msg, | 239 | static int parse_reply_info(struct ceph_msg *msg, |
| @@ -223,10 +255,10 @@ static int parse_reply_info(struct ceph_msg *msg, | |||
| 223 | goto out_bad; | 255 | goto out_bad; |
| 224 | } | 256 | } |
| 225 | 257 | ||
| 226 | /* dir content */ | 258 | /* extra */ |
| 227 | ceph_decode_32_safe(&p, end, len, bad); | 259 | ceph_decode_32_safe(&p, end, len, bad); |
| 228 | if (len > 0) { | 260 | if (len > 0) { |
| 229 | err = parse_reply_info_dir(&p, p+len, info); | 261 | err = parse_reply_info_extra(&p, p+len, info); |
| 230 | if (err < 0) | 262 | if (err < 0) |
| 231 | goto out_bad; | 263 | goto out_bad; |
| 232 | } | 264 | } |
| @@ -2074,7 +2106,7 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
| 2074 | 2106 | ||
| 2075 | mutex_lock(&session->s_mutex); | 2107 | mutex_lock(&session->s_mutex); |
| 2076 | if (err < 0) { | 2108 | if (err < 0) { |
| 2077 | pr_err("mdsc_handle_reply got corrupt reply mds%d\n", mds); | 2109 | pr_err("mdsc_handle_reply got corrupt reply mds%d(tid:%lld)\n", mds, tid); |
| 2078 | ceph_msg_dump(msg); | 2110 | ceph_msg_dump(msg); |
| 2079 | goto out_err; | 2111 | goto out_err; |
| 2080 | } | 2112 | } |
| @@ -2094,7 +2126,8 @@ static void handle_reply(struct ceph_mds_session *session, struct ceph_msg *msg) | |||
| 2094 | mutex_lock(&req->r_fill_mutex); | 2126 | mutex_lock(&req->r_fill_mutex); |
| 2095 | err = ceph_fill_trace(mdsc->fsc->sb, req, req->r_session); | 2127 | err = ceph_fill_trace(mdsc->fsc->sb, req, req->r_session); |
| 2096 | if (err == 0) { | 2128 | if (err == 0) { |
| 2097 | if (result == 0 && rinfo->dir_nr) | 2129 | if (result == 0 && req->r_op != CEPH_MDS_OP_GETFILELOCK && |
| 2130 | rinfo->dir_nr) | ||
| 2098 | ceph_readdir_prepopulate(req, req->r_session); | 2131 | ceph_readdir_prepopulate(req, req->r_session); |
| 2099 | ceph_unreserve_caps(mdsc, &req->r_caps_reservation); | 2132 | ceph_unreserve_caps(mdsc, &req->r_caps_reservation); |
| 2100 | } | 2133 | } |
diff --git a/fs/ceph/mds_client.h b/fs/ceph/mds_client.h index 9341fd4f1432..aabe563b54db 100644 --- a/fs/ceph/mds_client.h +++ b/fs/ceph/mds_client.h | |||
| @@ -42,26 +42,37 @@ struct ceph_mds_reply_info_in { | |||
| 42 | }; | 42 | }; |
| 43 | 43 | ||
| 44 | /* | 44 | /* |
| 45 | * parsed info about an mds reply, including information about the | 45 | * parsed info about an mds reply, including information about |
| 46 | * target inode and/or its parent directory and dentry, and directory | 46 | * either: 1) the target inode and/or its parent directory and dentry, |
| 47 | * contents (for readdir results). | 47 | * and directory contents (for readdir results), or |
| 48 | * 2) the file range lock info (for fcntl F_GETLK results). | ||
| 48 | */ | 49 | */ |
| 49 | struct ceph_mds_reply_info_parsed { | 50 | struct ceph_mds_reply_info_parsed { |
| 50 | struct ceph_mds_reply_head *head; | 51 | struct ceph_mds_reply_head *head; |
| 51 | 52 | ||
| 53 | /* trace */ | ||
| 52 | struct ceph_mds_reply_info_in diri, targeti; | 54 | struct ceph_mds_reply_info_in diri, targeti; |
| 53 | struct ceph_mds_reply_dirfrag *dirfrag; | 55 | struct ceph_mds_reply_dirfrag *dirfrag; |
| 54 | char *dname; | 56 | char *dname; |
| 55 | u32 dname_len; | 57 | u32 dname_len; |
| 56 | struct ceph_mds_reply_lease *dlease; | 58 | struct ceph_mds_reply_lease *dlease; |
| 57 | 59 | ||
| 58 | struct ceph_mds_reply_dirfrag *dir_dir; | 60 | /* extra */ |
| 59 | int dir_nr; | 61 | union { |
| 60 | char **dir_dname; | 62 | /* for fcntl F_GETLK results */ |
| 61 | u32 *dir_dname_len; | 63 | struct ceph_filelock *filelock_reply; |
| 62 | struct ceph_mds_reply_lease **dir_dlease; | 64 | |
| 63 | struct ceph_mds_reply_info_in *dir_in; | 65 | /* for readdir results */ |
| 64 | u8 dir_complete, dir_end; | 66 | struct { |
| 67 | struct ceph_mds_reply_dirfrag *dir_dir; | ||
| 68 | int dir_nr; | ||
| 69 | char **dir_dname; | ||
| 70 | u32 *dir_dname_len; | ||
| 71 | struct ceph_mds_reply_lease **dir_dlease; | ||
| 72 | struct ceph_mds_reply_info_in *dir_in; | ||
| 73 | u8 dir_complete, dir_end; | ||
| 74 | }; | ||
| 75 | }; | ||
| 65 | 76 | ||
| 66 | /* encoded blob describing snapshot contexts for certain | 77 | /* encoded blob describing snapshot contexts for certain |
| 67 | operations (e.g., open) */ | 78 | operations (e.g., open) */ |
diff --git a/fs/cifs/Kconfig b/fs/cifs/Kconfig index 0ed213970ced..ee45648b0d1a 100644 --- a/fs/cifs/Kconfig +++ b/fs/cifs/Kconfig | |||
| @@ -4,6 +4,7 @@ config CIFS | |||
| 4 | select NLS | 4 | select NLS |
| 5 | select CRYPTO | 5 | select CRYPTO |
| 6 | select CRYPTO_MD5 | 6 | select CRYPTO_MD5 |
| 7 | select CRYPTO_HMAC | ||
| 7 | select CRYPTO_ARC4 | 8 | select CRYPTO_ARC4 |
| 8 | help | 9 | help |
| 9 | This is the client VFS module for the Common Internet File System | 10 | This is the client VFS module for the Common Internet File System |
| @@ -143,6 +144,13 @@ config CIFS_FSCACHE | |||
| 143 | to be cached locally on disk through the general filesystem cache | 144 | to be cached locally on disk through the general filesystem cache |
| 144 | manager. If unsure, say N. | 145 | manager. If unsure, say N. |
| 145 | 146 | ||
| 147 | config CIFS_ACL | ||
| 148 | bool "Provide CIFS ACL support (EXPERIMENTAL)" | ||
| 149 | depends on EXPERIMENTAL && CIFS_XATTR | ||
| 150 | help | ||
| 151 | Allows to fetch CIFS/NTFS ACL from the server. The DACL blob | ||
| 152 | is handed over to the application/caller. | ||
| 153 | |||
| 146 | config CIFS_EXPERIMENTAL | 154 | config CIFS_EXPERIMENTAL |
| 147 | bool "CIFS Experimental Features (EXPERIMENTAL)" | 155 | bool "CIFS Experimental Features (EXPERIMENTAL)" |
| 148 | depends on CIFS && EXPERIMENTAL | 156 | depends on CIFS && EXPERIMENTAL |
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile index adefa60a9bdc..43b19dd39191 100644 --- a/fs/cifs/Makefile +++ b/fs/cifs/Makefile | |||
| @@ -6,7 +6,9 @@ obj-$(CONFIG_CIFS) += cifs.o | |||
| 6 | cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ | 6 | cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o inode.o \ |
| 7 | link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \ | 7 | link.o misc.o netmisc.o smbdes.o smbencrypt.o transport.o asn1.o \ |
| 8 | md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \ | 8 | md4.o md5.o cifs_unicode.o nterr.o xattr.o cifsencrypt.o \ |
| 9 | readdir.o ioctl.o sess.o export.o cifsacl.o | 9 | readdir.o ioctl.o sess.o export.o |
| 10 | |||
| 11 | cifs-$(CONFIG_CIFS_ACL) += cifsacl.o | ||
| 10 | 12 | ||
| 11 | cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o | 13 | cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o |
| 12 | 14 | ||
diff --git a/fs/cifs/README b/fs/cifs/README index ee68d1036544..46af99ab3614 100644 --- a/fs/cifs/README +++ b/fs/cifs/README | |||
| @@ -337,6 +337,15 @@ A partial list of the supported mount options follows: | |||
| 337 | wsize default write size (default 57344) | 337 | wsize default write size (default 57344) |
| 338 | maximum wsize currently allowed by CIFS is 57344 (fourteen | 338 | maximum wsize currently allowed by CIFS is 57344 (fourteen |
| 339 | 4096 byte pages) | 339 | 4096 byte pages) |
| 340 | actimeo=n attribute cache timeout in seconds (default 1 second). | ||
| 341 | After this timeout, the cifs client requests fresh attribute | ||
| 342 | information from the server. This option allows to tune the | ||
| 343 | attribute cache timeout to suit the workload needs. Shorter | ||
| 344 | timeouts mean better the cache coherency, but increased number | ||
| 345 | of calls to the server. Longer timeouts mean reduced number | ||
| 346 | of calls to the server at the expense of less stricter cache | ||
| 347 | coherency checks (i.e. incorrect attribute cache for a short | ||
| 348 | period of time). | ||
| 340 | rw mount the network share read-write (note that the | 349 | rw mount the network share read-write (note that the |
| 341 | server may still consider the share read-only) | 350 | server may still consider the share read-only) |
| 342 | ro mount network share read-only | 351 | ro mount network share read-only |
diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h index e9a393c9c2ca..7852cd677051 100644 --- a/fs/cifs/cifs_fs_sb.h +++ b/fs/cifs/cifs_fs_sb.h | |||
| @@ -48,6 +48,7 @@ struct cifs_sb_info { | |||
| 48 | struct nls_table *local_nls; | 48 | struct nls_table *local_nls; |
| 49 | unsigned int rsize; | 49 | unsigned int rsize; |
| 50 | unsigned int wsize; | 50 | unsigned int wsize; |
| 51 | unsigned long actimeo; /* attribute cache timeout (jiffies) */ | ||
| 51 | atomic_t active; | 52 | atomic_t active; |
| 52 | uid_t mnt_uid; | 53 | uid_t mnt_uid; |
| 53 | gid_t mnt_gid; | 54 | gid_t mnt_gid; |
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index c9b4792ae825..a437ec391a01 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c | |||
| @@ -30,8 +30,6 @@ | |||
| 30 | #include "cifs_debug.h" | 30 | #include "cifs_debug.h" |
| 31 | 31 | ||
| 32 | 32 | ||
| 33 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 34 | |||
| 35 | static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { | 33 | static struct cifs_wksid wksidarr[NUM_WK_SIDS] = { |
| 36 | {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"}, | 34 | {{1, 0, {0, 0, 0, 0, 0, 0}, {0, 0, 0, 0, 0} }, "null user"}, |
| 37 | {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"}, | 35 | {{1, 1, {0, 0, 0, 0, 0, 1}, {0, 0, 0, 0, 0} }, "nobody"}, |
| @@ -560,7 +558,7 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb, | |||
| 560 | struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); | 558 | struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); |
| 561 | 559 | ||
| 562 | if (IS_ERR(tlink)) | 560 | if (IS_ERR(tlink)) |
| 563 | return NULL; | 561 | return ERR_CAST(tlink); |
| 564 | 562 | ||
| 565 | xid = GetXid(); | 563 | xid = GetXid(); |
| 566 | rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen); | 564 | rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen); |
| @@ -568,7 +566,9 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb, | |||
| 568 | 566 | ||
| 569 | cifs_put_tlink(tlink); | 567 | cifs_put_tlink(tlink); |
| 570 | 568 | ||
| 571 | cFYI(1, "GetCIFSACL rc = %d ACL len %d", rc, *pacllen); | 569 | cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); |
| 570 | if (rc) | ||
| 571 | return ERR_PTR(rc); | ||
| 572 | return pntsd; | 572 | return pntsd; |
| 573 | } | 573 | } |
| 574 | 574 | ||
| @@ -583,7 +583,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb, | |||
| 583 | struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); | 583 | struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); |
| 584 | 584 | ||
| 585 | if (IS_ERR(tlink)) | 585 | if (IS_ERR(tlink)) |
| 586 | return NULL; | 586 | return ERR_CAST(tlink); |
| 587 | 587 | ||
| 588 | tcon = tlink_tcon(tlink); | 588 | tcon = tlink_tcon(tlink); |
| 589 | xid = GetXid(); | 589 | xid = GetXid(); |
| @@ -591,23 +591,22 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb, | |||
| 591 | rc = CIFSSMBOpen(xid, tcon, path, FILE_OPEN, READ_CONTROL, 0, | 591 | rc = CIFSSMBOpen(xid, tcon, path, FILE_OPEN, READ_CONTROL, 0, |
| 592 | &fid, &oplock, NULL, cifs_sb->local_nls, | 592 | &fid, &oplock, NULL, cifs_sb->local_nls, |
| 593 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); | 593 | cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); |
| 594 | if (rc) { | 594 | if (!rc) { |
| 595 | cERROR(1, "Unable to open file to get ACL"); | 595 | rc = CIFSSMBGetCIFSACL(xid, tcon, fid, &pntsd, pacllen); |
| 596 | goto out; | 596 | CIFSSMBClose(xid, tcon, fid); |
| 597 | } | 597 | } |
| 598 | 598 | ||
| 599 | rc = CIFSSMBGetCIFSACL(xid, tcon, fid, &pntsd, pacllen); | ||
| 600 | cFYI(1, "GetCIFSACL rc = %d ACL len %d", rc, *pacllen); | ||
| 601 | |||
| 602 | CIFSSMBClose(xid, tcon, fid); | ||
| 603 | out: | ||
| 604 | cifs_put_tlink(tlink); | 599 | cifs_put_tlink(tlink); |
| 605 | FreeXid(xid); | 600 | FreeXid(xid); |
| 601 | |||
| 602 | cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); | ||
| 603 | if (rc) | ||
| 604 | return ERR_PTR(rc); | ||
| 606 | return pntsd; | 605 | return pntsd; |
| 607 | } | 606 | } |
| 608 | 607 | ||
| 609 | /* Retrieve an ACL from the server */ | 608 | /* Retrieve an ACL from the server */ |
| 610 | static struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb, | 609 | struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *cifs_sb, |
| 611 | struct inode *inode, const char *path, | 610 | struct inode *inode, const char *path, |
| 612 | u32 *pacllen) | 611 | u32 *pacllen) |
| 613 | { | 612 | { |
| @@ -695,7 +694,7 @@ static int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen, | |||
| 695 | } | 694 | } |
| 696 | 695 | ||
| 697 | /* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */ | 696 | /* Translate the CIFS ACL (simlar to NTFS ACL) for a file into mode bits */ |
| 698 | void | 697 | int |
| 699 | cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr, | 698 | cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr, |
| 700 | struct inode *inode, const char *path, const __u16 *pfid) | 699 | struct inode *inode, const char *path, const __u16 *pfid) |
| 701 | { | 700 | { |
| @@ -711,17 +710,21 @@ cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, struct cifs_fattr *fattr, | |||
| 711 | pntsd = get_cifs_acl(cifs_sb, inode, path, &acllen); | 710 | pntsd = get_cifs_acl(cifs_sb, inode, path, &acllen); |
| 712 | 711 | ||
| 713 | /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ | 712 | /* if we can retrieve the ACL, now parse Access Control Entries, ACEs */ |
| 714 | if (pntsd) | 713 | if (IS_ERR(pntsd)) { |
| 714 | rc = PTR_ERR(pntsd); | ||
| 715 | cERROR(1, "%s: error %d getting sec desc", __func__, rc); | ||
| 716 | } else { | ||
| 715 | rc = parse_sec_desc(pntsd, acllen, fattr); | 717 | rc = parse_sec_desc(pntsd, acllen, fattr); |
| 716 | if (rc) | 718 | kfree(pntsd); |
| 717 | cFYI(1, "parse sec desc failed rc = %d", rc); | 719 | if (rc) |
| 720 | cERROR(1, "parse sec desc failed rc = %d", rc); | ||
| 721 | } | ||
| 718 | 722 | ||
| 719 | kfree(pntsd); | 723 | return rc; |
| 720 | return; | ||
| 721 | } | 724 | } |
| 722 | 725 | ||
| 723 | /* Convert mode bits to an ACL so we can update the ACL on the server */ | 726 | /* Convert mode bits to an ACL so we can update the ACL on the server */ |
| 724 | int mode_to_acl(struct inode *inode, const char *path, __u64 nmode) | 727 | int mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode) |
| 725 | { | 728 | { |
| 726 | int rc = 0; | 729 | int rc = 0; |
| 727 | __u32 secdesclen = 0; | 730 | __u32 secdesclen = 0; |
| @@ -736,7 +739,10 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode) | |||
| 736 | /* Add three ACEs for owner, group, everyone getting rid of | 739 | /* Add three ACEs for owner, group, everyone getting rid of |
| 737 | other ACEs as chmod disables ACEs and set the security descriptor */ | 740 | other ACEs as chmod disables ACEs and set the security descriptor */ |
| 738 | 741 | ||
| 739 | if (pntsd) { | 742 | if (IS_ERR(pntsd)) { |
| 743 | rc = PTR_ERR(pntsd); | ||
| 744 | cERROR(1, "%s: error %d getting sec desc", __func__, rc); | ||
| 745 | } else { | ||
| 740 | /* allocate memory for the smb header, | 746 | /* allocate memory for the smb header, |
| 741 | set security descriptor request security descriptor | 747 | set security descriptor request security descriptor |
| 742 | parameters, and secuirty descriptor itself */ | 748 | parameters, and secuirty descriptor itself */ |
| @@ -766,4 +772,3 @@ int mode_to_acl(struct inode *inode, const char *path, __u64 nmode) | |||
| 766 | 772 | ||
| 767 | return rc; | 773 | return rc; |
| 768 | } | 774 | } |
| 769 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | ||
diff --git a/fs/cifs/cifsacl.h b/fs/cifs/cifsacl.h index 6c8096cf5155..c4ae7d036563 100644 --- a/fs/cifs/cifsacl.h +++ b/fs/cifs/cifsacl.h | |||
| @@ -74,11 +74,7 @@ struct cifs_wksid { | |||
| 74 | char sidname[SIDNAMELENGTH]; | 74 | char sidname[SIDNAMELENGTH]; |
| 75 | } __attribute__((packed)); | 75 | } __attribute__((packed)); |
| 76 | 76 | ||
| 77 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 78 | |||
| 79 | extern int match_sid(struct cifs_sid *); | 77 | extern int match_sid(struct cifs_sid *); |
| 80 | extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *); | 78 | extern int compare_sids(const struct cifs_sid *, const struct cifs_sid *); |
| 81 | 79 | ||
| 82 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | ||
| 83 | |||
| 84 | #endif /* _CIFSACL_H */ | 80 | #endif /* _CIFSACL_H */ |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 9c3789762ab7..3936aa7f2c22 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
| @@ -458,9 +458,13 @@ cifs_show_options(struct seq_file *s, struct vfsmount *m) | |||
| 458 | seq_printf(s, ",acl"); | 458 | seq_printf(s, ",acl"); |
| 459 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) | 459 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) |
| 460 | seq_printf(s, ",mfsymlinks"); | 460 | seq_printf(s, ",mfsymlinks"); |
| 461 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) | ||
| 462 | seq_printf(s, ",fsc"); | ||
| 461 | 463 | ||
| 462 | seq_printf(s, ",rsize=%d", cifs_sb->rsize); | 464 | seq_printf(s, ",rsize=%d", cifs_sb->rsize); |
| 463 | seq_printf(s, ",wsize=%d", cifs_sb->wsize); | 465 | seq_printf(s, ",wsize=%d", cifs_sb->wsize); |
| 466 | /* convert actimeo and display it in seconds */ | ||
| 467 | seq_printf(s, ",actimeo=%lu", cifs_sb->actimeo / HZ); | ||
| 464 | 468 | ||
| 465 | return 0; | 469 | return 0; |
| 466 | } | 470 | } |
| @@ -933,7 +937,6 @@ init_cifs(void) | |||
| 933 | GlobalCurrentXid = 0; | 937 | GlobalCurrentXid = 0; |
| 934 | GlobalTotalActiveXid = 0; | 938 | GlobalTotalActiveXid = 0; |
| 935 | GlobalMaxActiveXid = 0; | 939 | GlobalMaxActiveXid = 0; |
| 936 | memset(Local_System_Name, 0, 15); | ||
| 937 | spin_lock_init(&cifs_tcp_ses_lock); | 940 | spin_lock_init(&cifs_tcp_ses_lock); |
| 938 | spin_lock_init(&cifs_file_list_lock); | 941 | spin_lock_init(&cifs_file_list_lock); |
| 939 | spin_lock_init(&GlobalMid_Lock); | 942 | spin_lock_init(&GlobalMid_Lock); |
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index b577bf0a1bb3..7136c0c3e2f9 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
| @@ -45,6 +45,16 @@ | |||
| 45 | #define CIFS_MIN_RCV_POOL 4 | 45 | #define CIFS_MIN_RCV_POOL 4 |
| 46 | 46 | ||
| 47 | /* | 47 | /* |
| 48 | * default attribute cache timeout (jiffies) | ||
| 49 | */ | ||
| 50 | #define CIFS_DEF_ACTIMEO (1 * HZ) | ||
| 51 | |||
| 52 | /* | ||
| 53 | * max attribute cache timeout (jiffies) - 2^30 | ||
| 54 | */ | ||
| 55 | #define CIFS_MAX_ACTIMEO (1 << 30) | ||
| 56 | |||
| 57 | /* | ||
| 48 | * MAX_REQ is the maximum number of requests that WE will send | 58 | * MAX_REQ is the maximum number of requests that WE will send |
| 49 | * on one socket concurrently. It also matches the most common | 59 | * on one socket concurrently. It also matches the most common |
| 50 | * value of max multiplex returned by servers. We may | 60 | * value of max multiplex returned by servers. We may |
| @@ -746,8 +756,6 @@ GLOBAL_EXTERN unsigned int GlobalTotalActiveXid; /* prot by GlobalMid_Sem */ | |||
| 746 | GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */ | 756 | GLOBAL_EXTERN unsigned int GlobalMaxActiveXid; /* prot by GlobalMid_Sem */ |
| 747 | GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above & list operations */ | 757 | GLOBAL_EXTERN spinlock_t GlobalMid_Lock; /* protects above & list operations */ |
| 748 | /* on midQ entries */ | 758 | /* on midQ entries */ |
| 749 | GLOBAL_EXTERN char Local_System_Name[15]; | ||
| 750 | |||
| 751 | /* | 759 | /* |
| 752 | * Global counters, updated atomically | 760 | * Global counters, updated atomically |
| 753 | */ | 761 | */ |
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h index 7ed69b6b5fe6..e6d1481b16c1 100644 --- a/fs/cifs/cifsproto.h +++ b/fs/cifs/cifsproto.h | |||
| @@ -54,7 +54,8 @@ do { \ | |||
| 54 | __func__, curr_xid, (int)rc); \ | 54 | __func__, curr_xid, (int)rc); \ |
| 55 | } while (0) | 55 | } while (0) |
| 56 | extern char *build_path_from_dentry(struct dentry *); | 56 | extern char *build_path_from_dentry(struct dentry *); |
| 57 | extern char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb); | 57 | extern char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb, |
| 58 | struct cifsTconInfo *tcon); | ||
| 58 | extern char *build_wildcard_path_from_dentry(struct dentry *direntry); | 59 | extern char *build_wildcard_path_from_dentry(struct dentry *direntry); |
| 59 | extern char *cifs_compose_mount_options(const char *sb_mountdata, | 60 | extern char *cifs_compose_mount_options(const char *sb_mountdata, |
| 60 | const char *fullpath, const struct dfs_info3_param *ref, | 61 | const char *fullpath, const struct dfs_info3_param *ref, |
| @@ -79,9 +80,7 @@ extern bool is_valid_oplock_break(struct smb_hdr *smb, | |||
| 79 | struct TCP_Server_Info *); | 80 | struct TCP_Server_Info *); |
| 80 | extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); | 81 | extern bool is_size_safe_to_change(struct cifsInodeInfo *, __u64 eof); |
| 81 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool); | 82 | extern struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *, bool); |
| 82 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 83 | extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool); | 83 | extern struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *, bool); |
| 84 | #endif | ||
| 85 | extern unsigned int smbCalcSize(struct smb_hdr *ptr); | 84 | extern unsigned int smbCalcSize(struct smb_hdr *ptr); |
| 86 | extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr); | 85 | extern unsigned int smbCalcSize_LE(struct smb_hdr *ptr); |
| 87 | extern int decode_negTokenInit(unsigned char *security_blob, int length, | 86 | extern int decode_negTokenInit(unsigned char *security_blob, int length, |
| @@ -130,10 +129,12 @@ extern int cifs_get_file_info_unix(struct file *filp); | |||
| 130 | extern int cifs_get_inode_info_unix(struct inode **pinode, | 129 | extern int cifs_get_inode_info_unix(struct inode **pinode, |
| 131 | const unsigned char *search_path, | 130 | const unsigned char *search_path, |
| 132 | struct super_block *sb, int xid); | 131 | struct super_block *sb, int xid); |
| 133 | extern void cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, | 132 | extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, |
| 134 | struct cifs_fattr *fattr, struct inode *inode, | 133 | struct cifs_fattr *fattr, struct inode *inode, |
| 135 | const char *path, const __u16 *pfid); | 134 | const char *path, const __u16 *pfid); |
| 136 | extern int mode_to_acl(struct inode *inode, const char *path, __u64); | 135 | extern int mode_to_cifs_acl(struct inode *inode, const char *path, __u64); |
| 136 | extern struct cifs_ntsd *get_cifs_acl(struct cifs_sb_info *, struct inode *, | ||
| 137 | const char *, u32 *); | ||
| 137 | 138 | ||
| 138 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, | 139 | extern int cifs_mount(struct super_block *, struct cifs_sb_info *, char *, |
| 139 | const char *); | 140 | const char *); |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 2f2632b6df5a..67acfb3acad2 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
| @@ -2478,95 +2478,6 @@ querySymLinkRetry: | |||
| 2478 | } | 2478 | } |
| 2479 | 2479 | ||
| 2480 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 2480 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
| 2481 | /* Initialize NT TRANSACT SMB into small smb request buffer. | ||
| 2482 | This assumes that all NT TRANSACTS that we init here have | ||
| 2483 | total parm and data under about 400 bytes (to fit in small cifs | ||
| 2484 | buffer size), which is the case so far, it easily fits. NB: | ||
| 2485 | Setup words themselves and ByteCount | ||
| 2486 | MaxSetupCount (size of returned setup area) and | ||
| 2487 | MaxParameterCount (returned parms size) must be set by caller */ | ||
| 2488 | static int | ||
| 2489 | smb_init_nttransact(const __u16 sub_command, const int setup_count, | ||
| 2490 | const int parm_len, struct cifsTconInfo *tcon, | ||
| 2491 | void **ret_buf) | ||
| 2492 | { | ||
| 2493 | int rc; | ||
| 2494 | __u32 temp_offset; | ||
| 2495 | struct smb_com_ntransact_req *pSMB; | ||
| 2496 | |||
| 2497 | rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon, | ||
| 2498 | (void **)&pSMB); | ||
| 2499 | if (rc) | ||
| 2500 | return rc; | ||
| 2501 | *ret_buf = (void *)pSMB; | ||
| 2502 | pSMB->Reserved = 0; | ||
| 2503 | pSMB->TotalParameterCount = cpu_to_le32(parm_len); | ||
| 2504 | pSMB->TotalDataCount = 0; | ||
| 2505 | pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf - | ||
| 2506 | MAX_CIFS_HDR_SIZE) & 0xFFFFFF00); | ||
| 2507 | pSMB->ParameterCount = pSMB->TotalParameterCount; | ||
| 2508 | pSMB->DataCount = pSMB->TotalDataCount; | ||
| 2509 | temp_offset = offsetof(struct smb_com_ntransact_req, Parms) + | ||
| 2510 | (setup_count * 2) - 4 /* for rfc1001 length itself */; | ||
| 2511 | pSMB->ParameterOffset = cpu_to_le32(temp_offset); | ||
| 2512 | pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len); | ||
| 2513 | pSMB->SetupCount = setup_count; /* no need to le convert byte fields */ | ||
| 2514 | pSMB->SubCommand = cpu_to_le16(sub_command); | ||
| 2515 | return 0; | ||
| 2516 | } | ||
| 2517 | |||
| 2518 | static int | ||
| 2519 | validate_ntransact(char *buf, char **ppparm, char **ppdata, | ||
| 2520 | __u32 *pparmlen, __u32 *pdatalen) | ||
| 2521 | { | ||
| 2522 | char *end_of_smb; | ||
| 2523 | __u32 data_count, data_offset, parm_count, parm_offset; | ||
| 2524 | struct smb_com_ntransact_rsp *pSMBr; | ||
| 2525 | |||
| 2526 | *pdatalen = 0; | ||
| 2527 | *pparmlen = 0; | ||
| 2528 | |||
| 2529 | if (buf == NULL) | ||
| 2530 | return -EINVAL; | ||
| 2531 | |||
| 2532 | pSMBr = (struct smb_com_ntransact_rsp *)buf; | ||
| 2533 | |||
| 2534 | /* ByteCount was converted from little endian in SendReceive */ | ||
| 2535 | end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount + | ||
| 2536 | (char *)&pSMBr->ByteCount; | ||
| 2537 | |||
| 2538 | data_offset = le32_to_cpu(pSMBr->DataOffset); | ||
| 2539 | data_count = le32_to_cpu(pSMBr->DataCount); | ||
| 2540 | parm_offset = le32_to_cpu(pSMBr->ParameterOffset); | ||
| 2541 | parm_count = le32_to_cpu(pSMBr->ParameterCount); | ||
| 2542 | |||
| 2543 | *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset; | ||
| 2544 | *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset; | ||
| 2545 | |||
| 2546 | /* should we also check that parm and data areas do not overlap? */ | ||
| 2547 | if (*ppparm > end_of_smb) { | ||
| 2548 | cFYI(1, "parms start after end of smb"); | ||
| 2549 | return -EINVAL; | ||
| 2550 | } else if (parm_count + *ppparm > end_of_smb) { | ||
| 2551 | cFYI(1, "parm end after end of smb"); | ||
| 2552 | return -EINVAL; | ||
| 2553 | } else if (*ppdata > end_of_smb) { | ||
| 2554 | cFYI(1, "data starts after end of smb"); | ||
| 2555 | return -EINVAL; | ||
| 2556 | } else if (data_count + *ppdata > end_of_smb) { | ||
| 2557 | cFYI(1, "data %p + count %d (%p) past smb end %p start %p", | ||
| 2558 | *ppdata, data_count, (data_count + *ppdata), | ||
| 2559 | end_of_smb, pSMBr); | ||
| 2560 | return -EINVAL; | ||
| 2561 | } else if (parm_count + data_count > pSMBr->ByteCount) { | ||
| 2562 | cFYI(1, "parm count and data count larger than SMB"); | ||
| 2563 | return -EINVAL; | ||
| 2564 | } | ||
| 2565 | *pdatalen = data_count; | ||
| 2566 | *pparmlen = parm_count; | ||
| 2567 | return 0; | ||
| 2568 | } | ||
| 2569 | |||
| 2570 | int | 2481 | int |
| 2571 | CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, | 2482 | CIFSSMBQueryReparseLinkInfo(const int xid, struct cifsTconInfo *tcon, |
| 2572 | const unsigned char *searchName, | 2483 | const unsigned char *searchName, |
| @@ -3056,7 +2967,97 @@ GetExtAttrOut: | |||
| 3056 | 2967 | ||
| 3057 | #endif /* CONFIG_POSIX */ | 2968 | #endif /* CONFIG_POSIX */ |
| 3058 | 2969 | ||
| 3059 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 2970 | #ifdef CONFIG_CIFS_ACL |
| 2971 | /* | ||
| 2972 | * Initialize NT TRANSACT SMB into small smb request buffer. This assumes that | ||
| 2973 | * all NT TRANSACTS that we init here have total parm and data under about 400 | ||
| 2974 | * bytes (to fit in small cifs buffer size), which is the case so far, it | ||
| 2975 | * easily fits. NB: Setup words themselves and ByteCount MaxSetupCount (size of | ||
| 2976 | * returned setup area) and MaxParameterCount (returned parms size) must be set | ||
| 2977 | * by caller | ||
| 2978 | */ | ||
| 2979 | static int | ||
| 2980 | smb_init_nttransact(const __u16 sub_command, const int setup_count, | ||
| 2981 | const int parm_len, struct cifsTconInfo *tcon, | ||
| 2982 | void **ret_buf) | ||
| 2983 | { | ||
| 2984 | int rc; | ||
| 2985 | __u32 temp_offset; | ||
| 2986 | struct smb_com_ntransact_req *pSMB; | ||
| 2987 | |||
| 2988 | rc = small_smb_init(SMB_COM_NT_TRANSACT, 19 + setup_count, tcon, | ||
| 2989 | (void **)&pSMB); | ||
| 2990 | if (rc) | ||
| 2991 | return rc; | ||
| 2992 | *ret_buf = (void *)pSMB; | ||
| 2993 | pSMB->Reserved = 0; | ||
| 2994 | pSMB->TotalParameterCount = cpu_to_le32(parm_len); | ||
| 2995 | pSMB->TotalDataCount = 0; | ||
| 2996 | pSMB->MaxDataCount = cpu_to_le32((tcon->ses->server->maxBuf - | ||
| 2997 | MAX_CIFS_HDR_SIZE) & 0xFFFFFF00); | ||
| 2998 | pSMB->ParameterCount = pSMB->TotalParameterCount; | ||
| 2999 | pSMB->DataCount = pSMB->TotalDataCount; | ||
| 3000 | temp_offset = offsetof(struct smb_com_ntransact_req, Parms) + | ||
| 3001 | (setup_count * 2) - 4 /* for rfc1001 length itself */; | ||
| 3002 | pSMB->ParameterOffset = cpu_to_le32(temp_offset); | ||
| 3003 | pSMB->DataOffset = cpu_to_le32(temp_offset + parm_len); | ||
| 3004 | pSMB->SetupCount = setup_count; /* no need to le convert byte fields */ | ||
| 3005 | pSMB->SubCommand = cpu_to_le16(sub_command); | ||
| 3006 | return 0; | ||
| 3007 | } | ||
| 3008 | |||
| 3009 | static int | ||
| 3010 | validate_ntransact(char *buf, char **ppparm, char **ppdata, | ||
| 3011 | __u32 *pparmlen, __u32 *pdatalen) | ||
| 3012 | { | ||
| 3013 | char *end_of_smb; | ||
| 3014 | __u32 data_count, data_offset, parm_count, parm_offset; | ||
| 3015 | struct smb_com_ntransact_rsp *pSMBr; | ||
| 3016 | |||
| 3017 | *pdatalen = 0; | ||
| 3018 | *pparmlen = 0; | ||
| 3019 | |||
| 3020 | if (buf == NULL) | ||
| 3021 | return -EINVAL; | ||
| 3022 | |||
| 3023 | pSMBr = (struct smb_com_ntransact_rsp *)buf; | ||
| 3024 | |||
| 3025 | /* ByteCount was converted from little endian in SendReceive */ | ||
| 3026 | end_of_smb = 2 /* sizeof byte count */ + pSMBr->ByteCount + | ||
| 3027 | (char *)&pSMBr->ByteCount; | ||
| 3028 | |||
| 3029 | data_offset = le32_to_cpu(pSMBr->DataOffset); | ||
| 3030 | data_count = le32_to_cpu(pSMBr->DataCount); | ||
| 3031 | parm_offset = le32_to_cpu(pSMBr->ParameterOffset); | ||
| 3032 | parm_count = le32_to_cpu(pSMBr->ParameterCount); | ||
| 3033 | |||
| 3034 | *ppparm = (char *)&pSMBr->hdr.Protocol + parm_offset; | ||
| 3035 | *ppdata = (char *)&pSMBr->hdr.Protocol + data_offset; | ||
| 3036 | |||
| 3037 | /* should we also check that parm and data areas do not overlap? */ | ||
| 3038 | if (*ppparm > end_of_smb) { | ||
| 3039 | cFYI(1, "parms start after end of smb"); | ||
| 3040 | return -EINVAL; | ||
| 3041 | } else if (parm_count + *ppparm > end_of_smb) { | ||
| 3042 | cFYI(1, "parm end after end of smb"); | ||
| 3043 | return -EINVAL; | ||
| 3044 | } else if (*ppdata > end_of_smb) { | ||
| 3045 | cFYI(1, "data starts after end of smb"); | ||
| 3046 | return -EINVAL; | ||
| 3047 | } else if (data_count + *ppdata > end_of_smb) { | ||
| 3048 | cFYI(1, "data %p + count %d (%p) past smb end %p start %p", | ||
| 3049 | *ppdata, data_count, (data_count + *ppdata), | ||
| 3050 | end_of_smb, pSMBr); | ||
| 3051 | return -EINVAL; | ||
| 3052 | } else if (parm_count + data_count > pSMBr->ByteCount) { | ||
| 3053 | cFYI(1, "parm count and data count larger than SMB"); | ||
| 3054 | return -EINVAL; | ||
| 3055 | } | ||
| 3056 | *pdatalen = data_count; | ||
| 3057 | *pparmlen = parm_count; | ||
| 3058 | return 0; | ||
| 3059 | } | ||
| 3060 | |||
| 3060 | /* Get Security Descriptor (by handle) from remote server for a file or dir */ | 3061 | /* Get Security Descriptor (by handle) from remote server for a file or dir */ |
| 3061 | int | 3062 | int |
| 3062 | CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, | 3063 | CIFSSMBGetCIFSACL(const int xid, struct cifsTconInfo *tcon, __u16 fid, |
| @@ -3214,7 +3215,7 @@ setCifsAclRetry: | |||
| 3214 | return (rc); | 3215 | return (rc); |
| 3215 | } | 3216 | } |
| 3216 | 3217 | ||
| 3217 | #endif /* CONFIG_CIFS_EXPERIMENTAL */ | 3218 | #endif /* CONFIG_CIFS_ACL */ |
| 3218 | 3219 | ||
| 3219 | /* Legacy Query Path Information call for lookup to old servers such | 3220 | /* Legacy Query Path Information call for lookup to old servers such |
| 3220 | as Win9x/WinME */ | 3221 | as Win9x/WinME */ |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 251a17c03545..cc1a8604a790 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -105,6 +105,7 @@ struct smb_vol { | |||
| 105 | unsigned int wsize; | 105 | unsigned int wsize; |
| 106 | bool sockopt_tcp_nodelay:1; | 106 | bool sockopt_tcp_nodelay:1; |
| 107 | unsigned short int port; | 107 | unsigned short int port; |
| 108 | unsigned long actimeo; /* attribute cache timeout (jiffies) */ | ||
| 108 | char *prepath; | 109 | char *prepath; |
| 109 | struct sockaddr_storage srcaddr; /* allow binding to a local IP */ | 110 | struct sockaddr_storage srcaddr; /* allow binding to a local IP */ |
| 110 | struct nls_table *local_nls; | 111 | struct nls_table *local_nls; |
| @@ -806,23 +807,20 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
| 806 | short int override_gid = -1; | 807 | short int override_gid = -1; |
| 807 | bool uid_specified = false; | 808 | bool uid_specified = false; |
| 808 | bool gid_specified = false; | 809 | bool gid_specified = false; |
| 810 | char *nodename = utsname()->nodename; | ||
| 809 | 811 | ||
| 810 | separator[0] = ','; | 812 | separator[0] = ','; |
| 811 | separator[1] = 0; | 813 | separator[1] = 0; |
| 812 | 814 | ||
| 813 | if (Local_System_Name[0] != 0) | 815 | /* |
| 814 | memcpy(vol->source_rfc1001_name, Local_System_Name, 15); | 816 | * does not have to be perfect mapping since field is |
| 815 | else { | 817 | * informational, only used for servers that do not support |
| 816 | char *nodename = utsname()->nodename; | 818 | * port 445 and it can be overridden at mount time |
| 817 | int n = strnlen(nodename, 15); | 819 | */ |
| 818 | memset(vol->source_rfc1001_name, 0x20, 15); | 820 | memset(vol->source_rfc1001_name, 0x20, 15); |
| 819 | for (i = 0; i < n; i++) { | 821 | for (i = 0; i < strnlen(nodename, 15); i++) |
| 820 | /* does not have to be perfect mapping since field is | 822 | vol->source_rfc1001_name[i] = toupper(nodename[i]); |
| 821 | informational, only used for servers that do not support | 823 | |
| 822 | port 445 and it can be overridden at mount time */ | ||
| 823 | vol->source_rfc1001_name[i] = toupper(nodename[i]); | ||
| 824 | } | ||
| 825 | } | ||
| 826 | vol->source_rfc1001_name[15] = 0; | 824 | vol->source_rfc1001_name[15] = 0; |
| 827 | /* null target name indicates to use *SMBSERVR default called name | 825 | /* null target name indicates to use *SMBSERVR default called name |
| 828 | if we end up sending RFC1001 session initialize */ | 826 | if we end up sending RFC1001 session initialize */ |
| @@ -840,6 +838,8 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
| 840 | /* default to using server inode numbers where available */ | 838 | /* default to using server inode numbers where available */ |
| 841 | vol->server_ino = 1; | 839 | vol->server_ino = 1; |
| 842 | 840 | ||
| 841 | vol->actimeo = CIFS_DEF_ACTIMEO; | ||
| 842 | |||
| 843 | if (!options) | 843 | if (!options) |
| 844 | return 1; | 844 | return 1; |
| 845 | 845 | ||
| @@ -1214,6 +1214,16 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
| 1214 | printk(KERN_WARNING "CIFS: server net" | 1214 | printk(KERN_WARNING "CIFS: server net" |
| 1215 | "biosname longer than 15 truncated.\n"); | 1215 | "biosname longer than 15 truncated.\n"); |
| 1216 | } | 1216 | } |
| 1217 | } else if (strnicmp(data, "actimeo", 7) == 0) { | ||
| 1218 | if (value && *value) { | ||
| 1219 | vol->actimeo = HZ * simple_strtoul(value, | ||
| 1220 | &value, 0); | ||
| 1221 | if (vol->actimeo > CIFS_MAX_ACTIMEO) { | ||
| 1222 | cERROR(1, "CIFS: attribute cache" | ||
| 1223 | "timeout too large"); | ||
| 1224 | return 1; | ||
| 1225 | } | ||
| 1226 | } | ||
| 1217 | } else if (strnicmp(data, "credentials", 4) == 0) { | 1227 | } else if (strnicmp(data, "credentials", 4) == 0) { |
| 1218 | /* ignore */ | 1228 | /* ignore */ |
| 1219 | } else if (strnicmp(data, "version", 3) == 0) { | 1229 | } else if (strnicmp(data, "version", 3) == 0) { |
| @@ -1352,6 +1362,11 @@ cifs_parse_mount_options(char *options, const char *devname, | |||
| 1352 | "supported. Instead set " | 1362 | "supported. Instead set " |
| 1353 | "/proc/fs/cifs/LookupCacheEnabled to 0\n"); | 1363 | "/proc/fs/cifs/LookupCacheEnabled to 0\n"); |
| 1354 | } else if (strnicmp(data, "fsc", 3) == 0) { | 1364 | } else if (strnicmp(data, "fsc", 3) == 0) { |
| 1365 | #ifndef CONFIG_CIFS_FSCACHE | ||
| 1366 | cERROR(1, "FS-Cache support needs CONFIG_CIFS_FSCACHE" | ||
| 1367 | "kernel config option set"); | ||
| 1368 | return 1; | ||
| 1369 | #endif | ||
| 1355 | vol->fsc = true; | 1370 | vol->fsc = true; |
| 1356 | } else if (strnicmp(data, "mfsymlinks", 10) == 0) { | 1371 | } else if (strnicmp(data, "mfsymlinks", 10) == 0) { |
| 1357 | vol->mfsymlinks = true; | 1372 | vol->mfsymlinks = true; |
| @@ -2566,6 +2581,8 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, | |||
| 2566 | cFYI(1, "file mode: 0x%x dir mode: 0x%x", | 2581 | cFYI(1, "file mode: 0x%x dir mode: 0x%x", |
| 2567 | cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); | 2582 | cifs_sb->mnt_file_mode, cifs_sb->mnt_dir_mode); |
| 2568 | 2583 | ||
| 2584 | cifs_sb->actimeo = pvolume_info->actimeo; | ||
| 2585 | |||
| 2569 | if (pvolume_info->noperm) | 2586 | if (pvolume_info->noperm) |
| 2570 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM; | 2587 | cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_NO_PERM; |
| 2571 | if (pvolume_info->setuids) | 2588 | if (pvolume_info->setuids) |
| @@ -2816,13 +2833,13 @@ remote_path_check: | |||
| 2816 | /* check if a whole path (including prepath) is not remote */ | 2833 | /* check if a whole path (including prepath) is not remote */ |
| 2817 | if (!rc && cifs_sb->prepathlen && tcon) { | 2834 | if (!rc && cifs_sb->prepathlen && tcon) { |
| 2818 | /* build_path_to_root works only when we have a valid tcon */ | 2835 | /* build_path_to_root works only when we have a valid tcon */ |
| 2819 | full_path = cifs_build_path_to_root(cifs_sb); | 2836 | full_path = cifs_build_path_to_root(cifs_sb, tcon); |
| 2820 | if (full_path == NULL) { | 2837 | if (full_path == NULL) { |
| 2821 | rc = -ENOMEM; | 2838 | rc = -ENOMEM; |
| 2822 | goto mount_fail_check; | 2839 | goto mount_fail_check; |
| 2823 | } | 2840 | } |
| 2824 | rc = is_path_accessible(xid, tcon, cifs_sb, full_path); | 2841 | rc = is_path_accessible(xid, tcon, cifs_sb, full_path); |
| 2825 | if (rc != -EREMOTE) { | 2842 | if (rc != 0 && rc != -EREMOTE) { |
| 2826 | kfree(full_path); | 2843 | kfree(full_path); |
| 2827 | goto mount_fail_check; | 2844 | goto mount_fail_check; |
| 2828 | } | 2845 | } |
diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c index 0eb87026cad3..548f06230a6d 100644 --- a/fs/cifs/dns_resolve.c +++ b/fs/cifs/dns_resolve.c | |||
| @@ -66,7 +66,7 @@ dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) | |||
| 66 | /* Search for server name delimiter */ | 66 | /* Search for server name delimiter */ |
| 67 | sep = memchr(hostname, '\\', len); | 67 | sep = memchr(hostname, '\\', len); |
| 68 | if (sep) | 68 | if (sep) |
| 69 | len = sep - unc; | 69 | len = sep - hostname; |
| 70 | else | 70 | else |
| 71 | cFYI(1, "%s: probably server name is whole unc: %s", | 71 | cFYI(1, "%s: probably server name is whole unc: %s", |
| 72 | __func__, unc); | 72 | __func__, unc); |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 06c3e83fa387..5a28660ca2b5 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
| @@ -1108,7 +1108,6 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, | |||
| 1108 | return total_written; | 1108 | return total_written; |
| 1109 | } | 1109 | } |
| 1110 | 1110 | ||
| 1111 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 1112 | struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, | 1111 | struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, |
| 1113 | bool fsuid_only) | 1112 | bool fsuid_only) |
| 1114 | { | 1113 | { |
| @@ -1142,7 +1141,6 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode, | |||
| 1142 | spin_unlock(&cifs_file_list_lock); | 1141 | spin_unlock(&cifs_file_list_lock); |
| 1143 | return NULL; | 1142 | return NULL; |
| 1144 | } | 1143 | } |
| 1145 | #endif | ||
| 1146 | 1144 | ||
| 1147 | struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, | 1145 | struct cifsFileInfo *find_writable_file(struct cifsInodeInfo *cifs_inode, |
| 1148 | bool fsuid_only) | 1146 | bool fsuid_only) |
| @@ -2271,8 +2269,10 @@ void cifs_oplock_break_get(struct cifsFileInfo *cfile) | |||
| 2271 | 2269 | ||
| 2272 | void cifs_oplock_break_put(struct cifsFileInfo *cfile) | 2270 | void cifs_oplock_break_put(struct cifsFileInfo *cfile) |
| 2273 | { | 2271 | { |
| 2272 | struct super_block *sb = cfile->dentry->d_sb; | ||
| 2273 | |||
| 2274 | cifsFileInfo_put(cfile); | 2274 | cifsFileInfo_put(cfile); |
| 2275 | cifs_sb_deactive(cfile->dentry->d_sb); | 2275 | cifs_sb_deactive(sb); |
| 2276 | } | 2276 | } |
| 2277 | 2277 | ||
| 2278 | const struct address_space_operations cifs_addr_ops = { | 2278 | const struct address_space_operations cifs_addr_ops = { |
diff --git a/fs/cifs/fscache.c b/fs/cifs/fscache.c index a2ad94efcfe6..297a43d0ff7f 100644 --- a/fs/cifs/fscache.c +++ b/fs/cifs/fscache.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * fs/cifs/fscache.c - CIFS filesystem cache interface | 2 | * fs/cifs/fscache.c - CIFS filesystem cache interface |
| 3 | * | 3 | * |
| 4 | * Copyright (c) 2010 Novell, Inc. | 4 | * Copyright (c) 2010 Novell, Inc. |
| 5 | * Author(s): Suresh Jayaraman (sjayaraman@suse.de> | 5 | * Author(s): Suresh Jayaraman <sjayaraman@suse.de> |
| 6 | * | 6 | * |
| 7 | * This library is free software; you can redistribute it and/or modify | 7 | * This library is free software; you can redistribute it and/or modify |
| 8 | * it under the terms of the GNU Lesser General Public License as published | 8 | * it under the terms of the GNU Lesser General Public License as published |
| @@ -67,10 +67,12 @@ static void cifs_fscache_enable_inode_cookie(struct inode *inode) | |||
| 67 | if (cifsi->fscache) | 67 | if (cifsi->fscache) |
| 68 | return; | 68 | return; |
| 69 | 69 | ||
| 70 | cifsi->fscache = fscache_acquire_cookie(tcon->fscache, | 70 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_FSCACHE) { |
| 71 | cifsi->fscache = fscache_acquire_cookie(tcon->fscache, | ||
| 71 | &cifs_fscache_inode_object_def, cifsi); | 72 | &cifs_fscache_inode_object_def, cifsi); |
| 72 | cFYI(1, "CIFS: got FH cookie (0x%p/0x%p)", tcon->fscache, | 73 | cFYI(1, "CIFS: got FH cookie (0x%p/0x%p)", tcon->fscache, |
| 73 | cifsi->fscache); | 74 | cifsi->fscache); |
| 75 | } | ||
| 74 | } | 76 | } |
| 75 | 77 | ||
| 76 | void cifs_fscache_release_inode_cookie(struct inode *inode) | 78 | void cifs_fscache_release_inode_cookie(struct inode *inode) |
| @@ -101,10 +103,8 @@ void cifs_fscache_set_inode_cookie(struct inode *inode, struct file *filp) | |||
| 101 | { | 103 | { |
| 102 | if ((filp->f_flags & O_ACCMODE) != O_RDONLY) | 104 | if ((filp->f_flags & O_ACCMODE) != O_RDONLY) |
| 103 | cifs_fscache_disable_inode_cookie(inode); | 105 | cifs_fscache_disable_inode_cookie(inode); |
| 104 | else { | 106 | else |
| 105 | cifs_fscache_enable_inode_cookie(inode); | 107 | cifs_fscache_enable_inode_cookie(inode); |
| 106 | cFYI(1, "CIFS: fscache inode cookie set"); | ||
| 107 | } | ||
| 108 | } | 108 | } |
| 109 | 109 | ||
| 110 | void cifs_fscache_reset_inode_cookie(struct inode *inode) | 110 | void cifs_fscache_reset_inode_cookie(struct inode *inode) |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index ef3a55bf86b6..589f3e3f6e00 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
| @@ -686,13 +686,18 @@ int cifs_get_inode_info(struct inode **pinode, | |||
| 686 | cFYI(1, "cifs_sfu_type failed: %d", tmprc); | 686 | cFYI(1, "cifs_sfu_type failed: %d", tmprc); |
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 689 | #ifdef CONFIG_CIFS_ACL |
| 690 | /* fill in 0777 bits from ACL */ | 690 | /* fill in 0777 bits from ACL */ |
| 691 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | 691 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
| 692 | cFYI(1, "Getting mode bits from ACL"); | 692 | rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, |
| 693 | cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, pfid); | 693 | pfid); |
| 694 | if (rc) { | ||
| 695 | cFYI(1, "%s: Getting ACL failed with error: %d", | ||
| 696 | __func__, rc); | ||
| 697 | goto cgii_exit; | ||
| 698 | } | ||
| 694 | } | 699 | } |
| 695 | #endif | 700 | #endif /* CONFIG_CIFS_ACL */ |
| 696 | 701 | ||
| 697 | /* fill in remaining high mode bits e.g. SUID, VTX */ | 702 | /* fill in remaining high mode bits e.g. SUID, VTX */ |
| 698 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) | 703 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_UNX_EMUL) |
| @@ -723,12 +728,12 @@ static const struct inode_operations cifs_ipc_inode_ops = { | |||
| 723 | .lookup = cifs_lookup, | 728 | .lookup = cifs_lookup, |
| 724 | }; | 729 | }; |
| 725 | 730 | ||
| 726 | char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb) | 731 | char *cifs_build_path_to_root(struct cifs_sb_info *cifs_sb, |
| 732 | struct cifsTconInfo *tcon) | ||
| 727 | { | 733 | { |
| 728 | int pplen = cifs_sb->prepathlen; | 734 | int pplen = cifs_sb->prepathlen; |
| 729 | int dfsplen; | 735 | int dfsplen; |
| 730 | char *full_path = NULL; | 736 | char *full_path = NULL; |
| 731 | struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); | ||
| 732 | 737 | ||
| 733 | /* if no prefix path, simply set path to the root of share to "" */ | 738 | /* if no prefix path, simply set path to the root of share to "" */ |
| 734 | if (pplen == 0) { | 739 | if (pplen == 0) { |
| @@ -870,7 +875,7 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
| 870 | char *full_path; | 875 | char *full_path; |
| 871 | struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); | 876 | struct cifsTconInfo *tcon = cifs_sb_master_tcon(cifs_sb); |
| 872 | 877 | ||
| 873 | full_path = cifs_build_path_to_root(cifs_sb); | 878 | full_path = cifs_build_path_to_root(cifs_sb, tcon); |
| 874 | if (full_path == NULL) | 879 | if (full_path == NULL) |
| 875 | return ERR_PTR(-ENOMEM); | 880 | return ERR_PTR(-ENOMEM); |
| 876 | 881 | ||
| @@ -881,8 +886,10 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
| 881 | rc = cifs_get_inode_info(&inode, full_path, NULL, sb, | 886 | rc = cifs_get_inode_info(&inode, full_path, NULL, sb, |
| 882 | xid, NULL); | 887 | xid, NULL); |
| 883 | 888 | ||
| 884 | if (!inode) | 889 | if (!inode) { |
| 885 | return ERR_PTR(rc); | 890 | inode = ERR_PTR(rc); |
| 891 | goto out; | ||
| 892 | } | ||
| 886 | 893 | ||
| 887 | #ifdef CONFIG_CIFS_FSCACHE | 894 | #ifdef CONFIG_CIFS_FSCACHE |
| 888 | /* populate tcon->resource_id */ | 895 | /* populate tcon->resource_id */ |
| @@ -898,13 +905,11 @@ struct inode *cifs_root_iget(struct super_block *sb, unsigned long ino) | |||
| 898 | inode->i_uid = cifs_sb->mnt_uid; | 905 | inode->i_uid = cifs_sb->mnt_uid; |
| 899 | inode->i_gid = cifs_sb->mnt_gid; | 906 | inode->i_gid = cifs_sb->mnt_gid; |
| 900 | } else if (rc) { | 907 | } else if (rc) { |
| 901 | kfree(full_path); | ||
| 902 | _FreeXid(xid); | ||
| 903 | iget_failed(inode); | 908 | iget_failed(inode); |
| 904 | return ERR_PTR(rc); | 909 | inode = ERR_PTR(rc); |
| 905 | } | 910 | } |
| 906 | 911 | ||
| 907 | 912 | out: | |
| 908 | kfree(full_path); | 913 | kfree(full_path); |
| 909 | /* can not call macro FreeXid here since in a void func | 914 | /* can not call macro FreeXid here since in a void func |
| 910 | * TODO: This is no longer true | 915 | * TODO: This is no longer true |
| @@ -1648,6 +1653,7 @@ static bool | |||
| 1648 | cifs_inode_needs_reval(struct inode *inode) | 1653 | cifs_inode_needs_reval(struct inode *inode) |
| 1649 | { | 1654 | { |
| 1650 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); | 1655 | struct cifsInodeInfo *cifs_i = CIFS_I(inode); |
| 1656 | struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); | ||
| 1651 | 1657 | ||
| 1652 | if (cifs_i->clientCanCacheRead) | 1658 | if (cifs_i->clientCanCacheRead) |
| 1653 | return false; | 1659 | return false; |
| @@ -1658,19 +1664,21 @@ cifs_inode_needs_reval(struct inode *inode) | |||
| 1658 | if (cifs_i->time == 0) | 1664 | if (cifs_i->time == 0) |
| 1659 | return true; | 1665 | return true; |
| 1660 | 1666 | ||
| 1661 | /* FIXME: the actimeo should be tunable */ | 1667 | if (!time_in_range(jiffies, cifs_i->time, |
| 1662 | if (time_after_eq(jiffies, cifs_i->time + HZ)) | 1668 | cifs_i->time + cifs_sb->actimeo)) |
| 1663 | return true; | 1669 | return true; |
| 1664 | 1670 | ||
| 1665 | /* hardlinked files w/ noserverino get "special" treatment */ | 1671 | /* hardlinked files w/ noserverino get "special" treatment */ |
| 1666 | if (!(CIFS_SB(inode->i_sb)->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) && | 1672 | if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) && |
| 1667 | S_ISREG(inode->i_mode) && inode->i_nlink != 1) | 1673 | S_ISREG(inode->i_mode) && inode->i_nlink != 1) |
| 1668 | return true; | 1674 | return true; |
| 1669 | 1675 | ||
| 1670 | return false; | 1676 | return false; |
| 1671 | } | 1677 | } |
| 1672 | 1678 | ||
| 1673 | /* check invalid_mapping flag and zap the cache if it's set */ | 1679 | /* |
| 1680 | * Zap the cache. Called when invalid_mapping flag is set. | ||
| 1681 | */ | ||
| 1674 | static void | 1682 | static void |
| 1675 | cifs_invalidate_mapping(struct inode *inode) | 1683 | cifs_invalidate_mapping(struct inode *inode) |
| 1676 | { | 1684 | { |
| @@ -2114,11 +2122,16 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) | |||
| 2114 | 2122 | ||
| 2115 | if (attrs->ia_valid & ATTR_MODE) { | 2123 | if (attrs->ia_valid & ATTR_MODE) { |
| 2116 | rc = 0; | 2124 | rc = 0; |
| 2117 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 2125 | #ifdef CONFIG_CIFS_ACL |
| 2118 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) | 2126 | if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { |
| 2119 | rc = mode_to_acl(inode, full_path, mode); | 2127 | rc = mode_to_cifs_acl(inode, full_path, mode); |
| 2120 | else | 2128 | if (rc) { |
| 2121 | #endif | 2129 | cFYI(1, "%s: Setting ACL failed with error: %d", |
| 2130 | __func__, rc); | ||
| 2131 | goto cifs_setattr_exit; | ||
| 2132 | } | ||
| 2133 | } else | ||
| 2134 | #endif /* CONFIG_CIFS_ACL */ | ||
| 2122 | if (((mode & S_IWUGO) == 0) && | 2135 | if (((mode & S_IWUGO) == 0) && |
| 2123 | (cifsInode->cifsAttrs & ATTR_READONLY) == 0) { | 2136 | (cifsInode->cifsAttrs & ATTR_READONLY) == 0) { |
| 2124 | 2137 | ||
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index ef7bb7b50f58..a73eb9f4bdaf 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
| @@ -226,26 +226,29 @@ static int initiate_cifs_search(const int xid, struct file *file) | |||
| 226 | char *full_path = NULL; | 226 | char *full_path = NULL; |
| 227 | struct cifsFileInfo *cifsFile; | 227 | struct cifsFileInfo *cifsFile; |
| 228 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); | 228 | struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); |
| 229 | struct tcon_link *tlink; | 229 | struct tcon_link *tlink = NULL; |
| 230 | struct cifsTconInfo *pTcon; | 230 | struct cifsTconInfo *pTcon; |
| 231 | 231 | ||
| 232 | tlink = cifs_sb_tlink(cifs_sb); | ||
| 233 | if (IS_ERR(tlink)) | ||
| 234 | return PTR_ERR(tlink); | ||
| 235 | pTcon = tlink_tcon(tlink); | ||
| 236 | |||
| 237 | if (file->private_data == NULL) | ||
| 238 | file->private_data = | ||
| 239 | kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); | ||
| 240 | if (file->private_data == NULL) { | 232 | if (file->private_data == NULL) { |
| 241 | rc = -ENOMEM; | 233 | tlink = cifs_sb_tlink(cifs_sb); |
| 242 | goto error_exit; | 234 | if (IS_ERR(tlink)) |
| 235 | return PTR_ERR(tlink); | ||
| 236 | |||
| 237 | cifsFile = kzalloc(sizeof(struct cifsFileInfo), GFP_KERNEL); | ||
| 238 | if (cifsFile == NULL) { | ||
| 239 | rc = -ENOMEM; | ||
| 240 | goto error_exit; | ||
| 241 | } | ||
| 242 | file->private_data = cifsFile; | ||
| 243 | cifsFile->tlink = cifs_get_tlink(tlink); | ||
| 244 | pTcon = tlink_tcon(tlink); | ||
| 245 | } else { | ||
| 246 | cifsFile = file->private_data; | ||
| 247 | pTcon = tlink_tcon(cifsFile->tlink); | ||
| 243 | } | 248 | } |
| 244 | 249 | ||
| 245 | cifsFile = file->private_data; | ||
| 246 | cifsFile->invalidHandle = true; | 250 | cifsFile->invalidHandle = true; |
| 247 | cifsFile->srch_inf.endOfSearch = false; | 251 | cifsFile->srch_inf.endOfSearch = false; |
| 248 | cifsFile->tlink = cifs_get_tlink(tlink); | ||
| 249 | 252 | ||
| 250 | full_path = build_path_from_dentry(file->f_path.dentry); | 253 | full_path = build_path_from_dentry(file->f_path.dentry); |
| 251 | if (full_path == NULL) { | 254 | if (full_path == NULL) { |
| @@ -756,18 +759,6 @@ static int cifs_filldir(char *pfindEntry, struct file *file, filldir_t filldir, | |||
| 756 | rc = filldir(direntry, qstring.name, qstring.len, file->f_pos, | 759 | rc = filldir(direntry, qstring.name, qstring.len, file->f_pos, |
| 757 | ino, fattr.cf_dtype); | 760 | ino, fattr.cf_dtype); |
| 758 | 761 | ||
| 759 | /* | ||
| 760 | * we can not return filldir errors to the caller since they are | ||
| 761 | * "normal" when the stat blocksize is too small - we return remapped | ||
| 762 | * error instead | ||
| 763 | * | ||
| 764 | * FIXME: This looks bogus. filldir returns -EOVERFLOW in the above | ||
| 765 | * case already. Why should we be clobbering other errors from it? | ||
| 766 | */ | ||
| 767 | if (rc) { | ||
| 768 | cFYI(1, "filldir rc = %d", rc); | ||
| 769 | rc = -EOVERFLOW; | ||
| 770 | } | ||
| 771 | dput(tmp_dentry); | 762 | dput(tmp_dentry); |
| 772 | return rc; | 763 | return rc; |
| 773 | } | 764 | } |
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index a264b744bb41..eae2a1491608 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c | |||
| @@ -30,10 +30,11 @@ | |||
| 30 | 30 | ||
| 31 | #define MAX_EA_VALUE_SIZE 65535 | 31 | #define MAX_EA_VALUE_SIZE 65535 |
| 32 | #define CIFS_XATTR_DOS_ATTRIB "user.DosAttrib" | 32 | #define CIFS_XATTR_DOS_ATTRIB "user.DosAttrib" |
| 33 | #define CIFS_XATTR_CIFS_ACL "system.cifs_acl" | ||
| 33 | #define CIFS_XATTR_USER_PREFIX "user." | 34 | #define CIFS_XATTR_USER_PREFIX "user." |
| 34 | #define CIFS_XATTR_SYSTEM_PREFIX "system." | 35 | #define CIFS_XATTR_SYSTEM_PREFIX "system." |
| 35 | #define CIFS_XATTR_OS2_PREFIX "os2." | 36 | #define CIFS_XATTR_OS2_PREFIX "os2." |
| 36 | #define CIFS_XATTR_SECURITY_PREFIX ".security" | 37 | #define CIFS_XATTR_SECURITY_PREFIX "security." |
| 37 | #define CIFS_XATTR_TRUSTED_PREFIX "trusted." | 38 | #define CIFS_XATTR_TRUSTED_PREFIX "trusted." |
| 38 | #define XATTR_TRUSTED_PREFIX_LEN 8 | 39 | #define XATTR_TRUSTED_PREFIX_LEN 8 |
| 39 | #define XATTR_SECURITY_PREFIX_LEN 9 | 40 | #define XATTR_SECURITY_PREFIX_LEN 9 |
| @@ -277,29 +278,8 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
| 277 | cifs_sb->local_nls, | 278 | cifs_sb->local_nls, |
| 278 | cifs_sb->mnt_cifs_flags & | 279 | cifs_sb->mnt_cifs_flags & |
| 279 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 280 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
| 280 | #ifdef CONFIG_CIFS_EXPERIMENTAL | ||
| 281 | else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { | ||
| 282 | __u16 fid; | ||
| 283 | int oplock = 0; | ||
| 284 | struct cifs_ntsd *pacl = NULL; | ||
| 285 | __u32 buflen = 0; | ||
| 286 | if (experimEnabled) | ||
| 287 | rc = CIFSSMBOpen(xid, pTcon, full_path, | ||
| 288 | FILE_OPEN, GENERIC_READ, 0, &fid, | ||
| 289 | &oplock, NULL, cifs_sb->local_nls, | ||
| 290 | cifs_sb->mnt_cifs_flags & | ||
| 291 | CIFS_MOUNT_MAP_SPECIAL_CHR); | ||
| 292 | /* else rc is EOPNOTSUPP from above */ | ||
| 293 | |||
| 294 | if (rc == 0) { | ||
| 295 | rc = CIFSSMBGetCIFSACL(xid, pTcon, fid, &pacl, | ||
| 296 | &buflen); | ||
| 297 | CIFSSMBClose(xid, pTcon, fid); | ||
| 298 | } | ||
| 299 | } | ||
| 300 | #endif /* EXPERIMENTAL */ | ||
| 301 | #else | 281 | #else |
| 302 | cFYI(1, "query POSIX ACL not supported yet"); | 282 | cFYI(1, "Query POSIX ACL not supported yet"); |
| 303 | #endif /* CONFIG_CIFS_POSIX */ | 283 | #endif /* CONFIG_CIFS_POSIX */ |
| 304 | } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, | 284 | } else if (strncmp(ea_name, POSIX_ACL_XATTR_DEFAULT, |
| 305 | strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { | 285 | strlen(POSIX_ACL_XATTR_DEFAULT)) == 0) { |
| @@ -311,8 +291,33 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name, | |||
| 311 | cifs_sb->mnt_cifs_flags & | 291 | cifs_sb->mnt_cifs_flags & |
| 312 | CIFS_MOUNT_MAP_SPECIAL_CHR); | 292 | CIFS_MOUNT_MAP_SPECIAL_CHR); |
| 313 | #else | 293 | #else |
| 314 | cFYI(1, "query POSIX default ACL not supported yet"); | 294 | cFYI(1, "Query POSIX default ACL not supported yet"); |
| 315 | #endif | 295 | #endif /* CONFIG_CIFS_POSIX */ |
| 296 | } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL, | ||
| 297 | strlen(CIFS_XATTR_CIFS_ACL)) == 0) { | ||
| 298 | #ifdef CONFIG_CIFS_ACL | ||
| 299 | u32 acllen; | ||
| 300 | struct cifs_ntsd *pacl; | ||
| 301 | |||
| 302 | pacl = get_cifs_acl(cifs_sb, direntry->d_inode, | ||
| 303 | full_path, &acllen); | ||
| 304 | if (IS_ERR(pacl)) { | ||
| 305 | rc = PTR_ERR(pacl); | ||
| 306 | cERROR(1, "%s: error %zd getting sec desc", | ||
| 307 | __func__, rc); | ||
| 308 | } else { | ||
| 309 | if (ea_value) { | ||
| 310 | if (acllen > buf_size) | ||
| 311 | acllen = -ERANGE; | ||
| 312 | else | ||
| 313 | memcpy(ea_value, pacl, acllen); | ||
| 314 | } | ||
| 315 | rc = acllen; | ||
| 316 | kfree(pacl); | ||
| 317 | } | ||
| 318 | #else | ||
| 319 | cFYI(1, "Query CIFS ACL not supported yet"); | ||
| 320 | #endif /* CONFIG_CIFS_ACL */ | ||
| 316 | } else if (strncmp(ea_name, | 321 | } else if (strncmp(ea_name, |
| 317 | CIFS_XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { | 322 | CIFS_XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) == 0) { |
| 318 | cFYI(1, "Trusted xattr namespace not supported yet"); | 323 | cFYI(1, "Trusted xattr namespace not supported yet"); |
diff --git a/fs/compat.c b/fs/compat.c index c580c322fa6b..eb1740ac8c0a 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
| @@ -1350,6 +1350,10 @@ static int compat_count(compat_uptr_t __user *argv, int max) | |||
| 1350 | argv++; | 1350 | argv++; |
| 1351 | if (i++ >= max) | 1351 | if (i++ >= max) |
| 1352 | return -E2BIG; | 1352 | return -E2BIG; |
| 1353 | |||
| 1354 | if (fatal_signal_pending(current)) | ||
| 1355 | return -ERESTARTNOHAND; | ||
| 1356 | cond_resched(); | ||
| 1353 | } | 1357 | } |
| 1354 | } | 1358 | } |
| 1355 | return i; | 1359 | return i; |
| @@ -1391,6 +1395,12 @@ static int compat_copy_strings(int argc, compat_uptr_t __user *argv, | |||
| 1391 | while (len > 0) { | 1395 | while (len > 0) { |
| 1392 | int offset, bytes_to_copy; | 1396 | int offset, bytes_to_copy; |
| 1393 | 1397 | ||
| 1398 | if (fatal_signal_pending(current)) { | ||
| 1399 | ret = -ERESTARTNOHAND; | ||
| 1400 | goto out; | ||
| 1401 | } | ||
| 1402 | cond_resched(); | ||
| 1403 | |||
| 1394 | offset = pos % PAGE_SIZE; | 1404 | offset = pos % PAGE_SIZE; |
| 1395 | if (offset == 0) | 1405 | if (offset == 0) |
| 1396 | offset = PAGE_SIZE; | 1406 | offset = PAGE_SIZE; |
| @@ -1407,18 +1417,8 @@ static int compat_copy_strings(int argc, compat_uptr_t __user *argv, | |||
| 1407 | if (!kmapped_page || kpos != (pos & PAGE_MASK)) { | 1417 | if (!kmapped_page || kpos != (pos & PAGE_MASK)) { |
| 1408 | struct page *page; | 1418 | struct page *page; |
| 1409 | 1419 | ||
| 1410 | #ifdef CONFIG_STACK_GROWSUP | 1420 | page = get_arg_page(bprm, pos, 1); |
| 1411 | ret = expand_stack_downwards(bprm->vma, pos); | 1421 | if (!page) { |
| 1412 | if (ret < 0) { | ||
| 1413 | /* We've exceed the stack rlimit. */ | ||
| 1414 | ret = -E2BIG; | ||
| 1415 | goto out; | ||
| 1416 | } | ||
| 1417 | #endif | ||
| 1418 | ret = get_user_pages(current, bprm->mm, pos, | ||
| 1419 | 1, 1, 1, &page, NULL); | ||
| 1420 | if (ret <= 0) { | ||
| 1421 | /* We've exceed the stack rlimit. */ | ||
| 1422 | ret = -E2BIG; | 1422 | ret = -E2BIG; |
| 1423 | goto out; | 1423 | goto out; |
| 1424 | } | 1424 | } |
| @@ -1539,8 +1539,10 @@ int compat_do_execve(char * filename, | |||
| 1539 | return retval; | 1539 | return retval; |
| 1540 | 1540 | ||
| 1541 | out: | 1541 | out: |
| 1542 | if (bprm->mm) | 1542 | if (bprm->mm) { |
| 1543 | acct_arg_size(bprm, 0); | ||
| 1543 | mmput(bprm->mm); | 1544 | mmput(bprm->mm); |
| 1545 | } | ||
| 1544 | 1546 | ||
| 1545 | out_file: | 1547 | out_file: |
| 1546 | if (bprm->file) { | 1548 | if (bprm->file) { |
| @@ -164,7 +164,26 @@ out: | |||
| 164 | 164 | ||
| 165 | #ifdef CONFIG_MMU | 165 | #ifdef CONFIG_MMU |
| 166 | 166 | ||
| 167 | static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | 167 | void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) |
| 168 | { | ||
| 169 | struct mm_struct *mm = current->mm; | ||
| 170 | long diff = (long)(pages - bprm->vma_pages); | ||
| 171 | |||
| 172 | if (!mm || !diff) | ||
| 173 | return; | ||
| 174 | |||
| 175 | bprm->vma_pages = pages; | ||
| 176 | |||
| 177 | #ifdef SPLIT_RSS_COUNTING | ||
| 178 | add_mm_counter(mm, MM_ANONPAGES, diff); | ||
| 179 | #else | ||
| 180 | spin_lock(&mm->page_table_lock); | ||
| 181 | add_mm_counter(mm, MM_ANONPAGES, diff); | ||
| 182 | spin_unlock(&mm->page_table_lock); | ||
| 183 | #endif | ||
| 184 | } | ||
| 185 | |||
| 186 | struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | ||
| 168 | int write) | 187 | int write) |
| 169 | { | 188 | { |
| 170 | struct page *page; | 189 | struct page *page; |
| @@ -186,6 +205,8 @@ static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | |||
| 186 | unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; | 205 | unsigned long size = bprm->vma->vm_end - bprm->vma->vm_start; |
| 187 | struct rlimit *rlim; | 206 | struct rlimit *rlim; |
| 188 | 207 | ||
| 208 | acct_arg_size(bprm, size / PAGE_SIZE); | ||
| 209 | |||
| 189 | /* | 210 | /* |
| 190 | * We've historically supported up to 32 pages (ARG_MAX) | 211 | * We've historically supported up to 32 pages (ARG_MAX) |
| 191 | * of argument strings even with small stacks | 212 | * of argument strings even with small stacks |
| @@ -276,7 +297,11 @@ static bool valid_arg_len(struct linux_binprm *bprm, long len) | |||
| 276 | 297 | ||
| 277 | #else | 298 | #else |
| 278 | 299 | ||
| 279 | static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | 300 | void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) |
| 301 | { | ||
| 302 | } | ||
| 303 | |||
| 304 | struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | ||
| 280 | int write) | 305 | int write) |
| 281 | { | 306 | { |
| 282 | struct page *page; | 307 | struct page *page; |
| @@ -1003,6 +1028,7 @@ int flush_old_exec(struct linux_binprm * bprm) | |||
| 1003 | /* | 1028 | /* |
| 1004 | * Release all of the old mmap stuff | 1029 | * Release all of the old mmap stuff |
| 1005 | */ | 1030 | */ |
| 1031 | acct_arg_size(bprm, 0); | ||
| 1006 | retval = exec_mmap(bprm->mm); | 1032 | retval = exec_mmap(bprm->mm); |
| 1007 | if (retval) | 1033 | if (retval) |
| 1008 | goto out; | 1034 | goto out; |
| @@ -1426,8 +1452,10 @@ int do_execve(const char * filename, | |||
| 1426 | return retval; | 1452 | return retval; |
| 1427 | 1453 | ||
| 1428 | out: | 1454 | out: |
| 1429 | if (bprm->mm) | 1455 | if (bprm->mm) { |
| 1430 | mmput (bprm->mm); | 1456 | acct_arg_size(bprm, 0); |
| 1457 | mmput(bprm->mm); | ||
| 1458 | } | ||
| 1431 | 1459 | ||
| 1432 | out_file: | 1460 | out_file: |
| 1433 | if (bprm->file) { | 1461 | if (bprm->file) { |
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 9242d294fe90..8b984a2cebbd 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
| 14 | #include <linux/sched.h> | 14 | #include <linux/sched.h> |
| 15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
| 16 | #include <linux/compat.h> | ||
| 16 | 17 | ||
| 17 | static const struct file_operations fuse_direct_io_file_operations; | 18 | static const struct file_operations fuse_direct_io_file_operations; |
| 18 | 19 | ||
| @@ -1628,6 +1629,58 @@ static int fuse_ioctl_copy_user(struct page **pages, struct iovec *iov, | |||
| 1628 | } | 1629 | } |
| 1629 | 1630 | ||
| 1630 | /* | 1631 | /* |
| 1632 | * CUSE servers compiled on 32bit broke on 64bit kernels because the | ||
| 1633 | * ABI was defined to be 'struct iovec' which is different on 32bit | ||
| 1634 | * and 64bit. Fortunately we can determine which structure the server | ||
| 1635 | * used from the size of the reply. | ||
| 1636 | */ | ||
| 1637 | static int fuse_copy_ioctl_iovec(struct iovec *dst, void *src, | ||
| 1638 | size_t transferred, unsigned count, | ||
| 1639 | bool is_compat) | ||
| 1640 | { | ||
| 1641 | #ifdef CONFIG_COMPAT | ||
| 1642 | if (count * sizeof(struct compat_iovec) == transferred) { | ||
| 1643 | struct compat_iovec *ciov = src; | ||
| 1644 | unsigned i; | ||
| 1645 | |||
| 1646 | /* | ||
| 1647 | * With this interface a 32bit server cannot support | ||
| 1648 | * non-compat (i.e. ones coming from 64bit apps) ioctl | ||
| 1649 | * requests | ||
| 1650 | */ | ||
| 1651 | if (!is_compat) | ||
| 1652 | return -EINVAL; | ||
| 1653 | |||
| 1654 | for (i = 0; i < count; i++) { | ||
| 1655 | dst[i].iov_base = compat_ptr(ciov[i].iov_base); | ||
| 1656 | dst[i].iov_len = ciov[i].iov_len; | ||
| 1657 | } | ||
| 1658 | return 0; | ||
| 1659 | } | ||
| 1660 | #endif | ||
| 1661 | |||
| 1662 | if (count * sizeof(struct iovec) != transferred) | ||
| 1663 | return -EIO; | ||
| 1664 | |||
| 1665 | memcpy(dst, src, transferred); | ||
| 1666 | return 0; | ||
| 1667 | } | ||
| 1668 | |||
| 1669 | /* Make sure iov_length() won't overflow */ | ||
| 1670 | static int fuse_verify_ioctl_iov(struct iovec *iov, size_t count) | ||
| 1671 | { | ||
| 1672 | size_t n; | ||
| 1673 | u32 max = FUSE_MAX_PAGES_PER_REQ << PAGE_SHIFT; | ||
| 1674 | |||
| 1675 | for (n = 0; n < count; n++) { | ||
| 1676 | if (iov->iov_len > (size_t) max) | ||
| 1677 | return -ENOMEM; | ||
| 1678 | max -= iov->iov_len; | ||
| 1679 | } | ||
| 1680 | return 0; | ||
| 1681 | } | ||
| 1682 | |||
| 1683 | /* | ||
| 1631 | * For ioctls, there is no generic way to determine how much memory | 1684 | * For ioctls, there is no generic way to determine how much memory |
| 1632 | * needs to be read and/or written. Furthermore, ioctls are allowed | 1685 | * needs to be read and/or written. Furthermore, ioctls are allowed |
| 1633 | * to dereference the passed pointer, so the parameter requires deep | 1686 | * to dereference the passed pointer, so the parameter requires deep |
| @@ -1808,18 +1861,25 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg, | |||
| 1808 | in_iovs + out_iovs > FUSE_IOCTL_MAX_IOV) | 1861 | in_iovs + out_iovs > FUSE_IOCTL_MAX_IOV) |
| 1809 | goto out; | 1862 | goto out; |
| 1810 | 1863 | ||
| 1811 | err = -EIO; | ||
| 1812 | if ((in_iovs + out_iovs) * sizeof(struct iovec) != transferred) | ||
| 1813 | goto out; | ||
| 1814 | |||
| 1815 | /* okay, copy in iovs and retry */ | ||
| 1816 | vaddr = kmap_atomic(pages[0], KM_USER0); | 1864 | vaddr = kmap_atomic(pages[0], KM_USER0); |
| 1817 | memcpy(page_address(iov_page), vaddr, transferred); | 1865 | err = fuse_copy_ioctl_iovec(page_address(iov_page), vaddr, |
| 1866 | transferred, in_iovs + out_iovs, | ||
| 1867 | (flags & FUSE_IOCTL_COMPAT) != 0); | ||
| 1818 | kunmap_atomic(vaddr, KM_USER0); | 1868 | kunmap_atomic(vaddr, KM_USER0); |
| 1869 | if (err) | ||
| 1870 | goto out; | ||
| 1819 | 1871 | ||
| 1820 | in_iov = page_address(iov_page); | 1872 | in_iov = page_address(iov_page); |
| 1821 | out_iov = in_iov + in_iovs; | 1873 | out_iov = in_iov + in_iovs; |
| 1822 | 1874 | ||
| 1875 | err = fuse_verify_ioctl_iov(in_iov, in_iovs); | ||
| 1876 | if (err) | ||
| 1877 | goto out; | ||
| 1878 | |||
| 1879 | err = fuse_verify_ioctl_iov(out_iov, out_iovs); | ||
| 1880 | if (err) | ||
| 1881 | goto out; | ||
| 1882 | |||
| 1823 | goto retry; | 1883 | goto retry; |
| 1824 | } | 1884 | } |
| 1825 | 1885 | ||
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 8ea4a4180a87..996dd8989a91 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c | |||
| @@ -57,7 +57,7 @@ static int nfs_rename(struct inode *, struct dentry *, | |||
| 57 | struct inode *, struct dentry *); | 57 | struct inode *, struct dentry *); |
| 58 | static int nfs_fsync_dir(struct file *, int); | 58 | static int nfs_fsync_dir(struct file *, int); |
| 59 | static loff_t nfs_llseek_dir(struct file *, loff_t, int); | 59 | static loff_t nfs_llseek_dir(struct file *, loff_t, int); |
| 60 | static int nfs_readdir_clear_array(struct page*, gfp_t); | 60 | static void nfs_readdir_clear_array(struct page*); |
| 61 | 61 | ||
| 62 | const struct file_operations nfs_dir_operations = { | 62 | const struct file_operations nfs_dir_operations = { |
| 63 | .llseek = nfs_llseek_dir, | 63 | .llseek = nfs_llseek_dir, |
| @@ -83,8 +83,8 @@ const struct inode_operations nfs_dir_inode_operations = { | |||
| 83 | .setattr = nfs_setattr, | 83 | .setattr = nfs_setattr, |
| 84 | }; | 84 | }; |
| 85 | 85 | ||
| 86 | const struct address_space_operations nfs_dir_addr_space_ops = { | 86 | const struct address_space_operations nfs_dir_aops = { |
| 87 | .releasepage = nfs_readdir_clear_array, | 87 | .freepage = nfs_readdir_clear_array, |
| 88 | }; | 88 | }; |
| 89 | 89 | ||
| 90 | #ifdef CONFIG_NFS_V3 | 90 | #ifdef CONFIG_NFS_V3 |
| @@ -178,6 +178,7 @@ typedef struct { | |||
| 178 | struct page *page; | 178 | struct page *page; |
| 179 | unsigned long page_index; | 179 | unsigned long page_index; |
| 180 | u64 *dir_cookie; | 180 | u64 *dir_cookie; |
| 181 | u64 last_cookie; | ||
| 181 | loff_t current_index; | 182 | loff_t current_index; |
| 182 | decode_dirent_t decode; | 183 | decode_dirent_t decode; |
| 183 | 184 | ||
| @@ -213,17 +214,15 @@ void nfs_readdir_release_array(struct page *page) | |||
| 213 | * we are freeing strings created by nfs_add_to_readdir_array() | 214 | * we are freeing strings created by nfs_add_to_readdir_array() |
| 214 | */ | 215 | */ |
| 215 | static | 216 | static |
| 216 | int nfs_readdir_clear_array(struct page *page, gfp_t mask) | 217 | void nfs_readdir_clear_array(struct page *page) |
| 217 | { | 218 | { |
| 218 | struct nfs_cache_array *array = nfs_readdir_get_array(page); | 219 | struct nfs_cache_array *array; |
| 219 | int i; | 220 | int i; |
| 220 | 221 | ||
| 221 | if (IS_ERR(array)) | 222 | array = kmap_atomic(page, KM_USER0); |
| 222 | return PTR_ERR(array); | ||
| 223 | for (i = 0; i < array->size; i++) | 223 | for (i = 0; i < array->size; i++) |
| 224 | kfree(array->array[i].string.name); | 224 | kfree(array->array[i].string.name); |
| 225 | nfs_readdir_release_array(page); | 225 | kunmap_atomic(array, KM_USER0); |
| 226 | return 0; | ||
| 227 | } | 226 | } |
| 228 | 227 | ||
| 229 | /* | 228 | /* |
| @@ -272,7 +271,7 @@ int nfs_readdir_add_to_array(struct nfs_entry *entry, struct page *page) | |||
| 272 | goto out; | 271 | goto out; |
| 273 | array->last_cookie = entry->cookie; | 272 | array->last_cookie = entry->cookie; |
| 274 | array->size++; | 273 | array->size++; |
| 275 | if (entry->eof == 1) | 274 | if (entry->eof != 0) |
| 276 | array->eof_index = array->size; | 275 | array->eof_index = array->size; |
| 277 | out: | 276 | out: |
| 278 | nfs_readdir_release_array(page); | 277 | nfs_readdir_release_array(page); |
| @@ -312,15 +311,14 @@ int nfs_readdir_search_for_cookie(struct nfs_cache_array *array, nfs_readdir_des | |||
| 312 | for (i = 0; i < array->size; i++) { | 311 | for (i = 0; i < array->size; i++) { |
| 313 | if (array->array[i].cookie == *desc->dir_cookie) { | 312 | if (array->array[i].cookie == *desc->dir_cookie) { |
| 314 | desc->cache_entry_index = i; | 313 | desc->cache_entry_index = i; |
| 315 | status = 0; | 314 | return 0; |
| 316 | goto out; | ||
| 317 | } | 315 | } |
| 318 | } | 316 | } |
| 319 | if (i == array->eof_index) { | 317 | if (array->eof_index >= 0) { |
| 320 | desc->eof = 1; | ||
| 321 | status = -EBADCOOKIE; | 318 | status = -EBADCOOKIE; |
| 319 | if (*desc->dir_cookie == array->last_cookie) | ||
| 320 | desc->eof = 1; | ||
| 322 | } | 321 | } |
| 323 | out: | ||
| 324 | return status; | 322 | return status; |
| 325 | } | 323 | } |
| 326 | 324 | ||
| @@ -328,10 +326,7 @@ static | |||
| 328 | int nfs_readdir_search_array(nfs_readdir_descriptor_t *desc) | 326 | int nfs_readdir_search_array(nfs_readdir_descriptor_t *desc) |
| 329 | { | 327 | { |
| 330 | struct nfs_cache_array *array; | 328 | struct nfs_cache_array *array; |
| 331 | int status = -EBADCOOKIE; | 329 | int status; |
| 332 | |||
| 333 | if (desc->dir_cookie == NULL) | ||
| 334 | goto out; | ||
| 335 | 330 | ||
| 336 | array = nfs_readdir_get_array(desc->page); | 331 | array = nfs_readdir_get_array(desc->page); |
| 337 | if (IS_ERR(array)) { | 332 | if (IS_ERR(array)) { |
| @@ -344,6 +339,10 @@ int nfs_readdir_search_array(nfs_readdir_descriptor_t *desc) | |||
| 344 | else | 339 | else |
| 345 | status = nfs_readdir_search_for_cookie(array, desc); | 340 | status = nfs_readdir_search_for_cookie(array, desc); |
| 346 | 341 | ||
| 342 | if (status == -EAGAIN) { | ||
| 343 | desc->last_cookie = array->last_cookie; | ||
| 344 | desc->page_index++; | ||
| 345 | } | ||
| 347 | nfs_readdir_release_array(desc->page); | 346 | nfs_readdir_release_array(desc->page); |
| 348 | out: | 347 | out: |
| 349 | return status; | 348 | return status; |
| @@ -395,13 +394,9 @@ int xdr_decode(nfs_readdir_descriptor_t *desc, struct nfs_entry *entry, struct x | |||
| 395 | static | 394 | static |
| 396 | int nfs_same_file(struct dentry *dentry, struct nfs_entry *entry) | 395 | int nfs_same_file(struct dentry *dentry, struct nfs_entry *entry) |
| 397 | { | 396 | { |
| 398 | struct nfs_inode *node; | ||
| 399 | if (dentry->d_inode == NULL) | 397 | if (dentry->d_inode == NULL) |
| 400 | goto different; | 398 | goto different; |
| 401 | node = NFS_I(dentry->d_inode); | 399 | if (nfs_compare_fh(entry->fh, NFS_FH(dentry->d_inode)) != 0) |
| 402 | if (node->fh.size != entry->fh->size) | ||
| 403 | goto different; | ||
| 404 | if (strncmp(node->fh.data, entry->fh->data, node->fh.size) != 0) | ||
| 405 | goto different; | 400 | goto different; |
| 406 | return 1; | 401 | return 1; |
| 407 | different: | 402 | different: |
| @@ -494,7 +489,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en | |||
| 494 | 489 | ||
| 495 | count++; | 490 | count++; |
| 496 | 491 | ||
| 497 | if (desc->plus == 1) | 492 | if (desc->plus != 0) |
| 498 | nfs_prime_dcache(desc->file->f_path.dentry, entry); | 493 | nfs_prime_dcache(desc->file->f_path.dentry, entry); |
| 499 | 494 | ||
| 500 | status = nfs_readdir_add_to_array(entry, page); | 495 | status = nfs_readdir_add_to_array(entry, page); |
| @@ -502,7 +497,7 @@ int nfs_readdir_page_filler(nfs_readdir_descriptor_t *desc, struct nfs_entry *en | |||
| 502 | break; | 497 | break; |
| 503 | } while (!entry->eof); | 498 | } while (!entry->eof); |
| 504 | 499 | ||
| 505 | if (count == 0 || (status == -EBADCOOKIE && entry->eof == 1)) { | 500 | if (count == 0 || (status == -EBADCOOKIE && entry->eof != 0)) { |
| 506 | array = nfs_readdir_get_array(page); | 501 | array = nfs_readdir_get_array(page); |
| 507 | if (!IS_ERR(array)) { | 502 | if (!IS_ERR(array)) { |
| 508 | array->eof_index = array->size; | 503 | array->eof_index = array->size; |
| @@ -567,7 +562,7 @@ int nfs_readdir_xdr_to_array(nfs_readdir_descriptor_t *desc, struct page *page, | |||
| 567 | unsigned int array_size = ARRAY_SIZE(pages); | 562 | unsigned int array_size = ARRAY_SIZE(pages); |
| 568 | 563 | ||
| 569 | entry.prev_cookie = 0; | 564 | entry.prev_cookie = 0; |
| 570 | entry.cookie = *desc->dir_cookie; | 565 | entry.cookie = desc->last_cookie; |
| 571 | entry.eof = 0; | 566 | entry.eof = 0; |
| 572 | entry.fh = nfs_alloc_fhandle(); | 567 | entry.fh = nfs_alloc_fhandle(); |
| 573 | entry.fattr = nfs_alloc_fattr(); | 568 | entry.fattr = nfs_alloc_fattr(); |
| @@ -640,6 +635,8 @@ int nfs_readdir_filler(nfs_readdir_descriptor_t *desc, struct page* page) | |||
| 640 | static | 635 | static |
| 641 | void cache_page_release(nfs_readdir_descriptor_t *desc) | 636 | void cache_page_release(nfs_readdir_descriptor_t *desc) |
| 642 | { | 637 | { |
| 638 | if (!desc->page->mapping) | ||
| 639 | nfs_readdir_clear_array(desc->page); | ||
| 643 | page_cache_release(desc->page); | 640 | page_cache_release(desc->page); |
| 644 | desc->page = NULL; | 641 | desc->page = NULL; |
| 645 | } | 642 | } |
| @@ -664,9 +661,8 @@ int find_cache_page(nfs_readdir_descriptor_t *desc) | |||
| 664 | return PTR_ERR(desc->page); | 661 | return PTR_ERR(desc->page); |
| 665 | 662 | ||
| 666 | res = nfs_readdir_search_array(desc); | 663 | res = nfs_readdir_search_array(desc); |
| 667 | if (res == 0) | 664 | if (res != 0) |
| 668 | return 0; | 665 | cache_page_release(desc); |
| 669 | cache_page_release(desc); | ||
| 670 | return res; | 666 | return res; |
| 671 | } | 667 | } |
| 672 | 668 | ||
| @@ -676,22 +672,16 @@ int readdir_search_pagecache(nfs_readdir_descriptor_t *desc) | |||
| 676 | { | 672 | { |
| 677 | int res; | 673 | int res; |
| 678 | 674 | ||
| 679 | if (desc->page_index == 0) | 675 | if (desc->page_index == 0) { |
| 680 | desc->current_index = 0; | 676 | desc->current_index = 0; |
| 681 | while (1) { | 677 | desc->last_cookie = 0; |
| 682 | res = find_cache_page(desc); | ||
| 683 | if (res != -EAGAIN) | ||
| 684 | break; | ||
| 685 | desc->page_index++; | ||
| 686 | } | 678 | } |
| 679 | do { | ||
| 680 | res = find_cache_page(desc); | ||
| 681 | } while (res == -EAGAIN); | ||
| 687 | return res; | 682 | return res; |
| 688 | } | 683 | } |
| 689 | 684 | ||
| 690 | static inline unsigned int dt_type(struct inode *inode) | ||
| 691 | { | ||
| 692 | return (inode->i_mode >> 12) & 15; | ||
| 693 | } | ||
| 694 | |||
| 695 | /* | 685 | /* |
| 696 | * Once we've found the start of the dirent within a page: fill 'er up... | 686 | * Once we've found the start of the dirent within a page: fill 'er up... |
| 697 | */ | 687 | */ |
| @@ -721,13 +711,12 @@ int nfs_do_filldir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
| 721 | break; | 711 | break; |
| 722 | } | 712 | } |
| 723 | file->f_pos++; | 713 | file->f_pos++; |
| 724 | desc->cache_entry_index = i; | ||
| 725 | if (i < (array->size-1)) | 714 | if (i < (array->size-1)) |
| 726 | *desc->dir_cookie = array->array[i+1].cookie; | 715 | *desc->dir_cookie = array->array[i+1].cookie; |
| 727 | else | 716 | else |
| 728 | *desc->dir_cookie = array->last_cookie; | 717 | *desc->dir_cookie = array->last_cookie; |
| 729 | } | 718 | } |
| 730 | if (i == array->eof_index) | 719 | if (array->eof_index >= 0) |
| 731 | desc->eof = 1; | 720 | desc->eof = 1; |
| 732 | 721 | ||
| 733 | nfs_readdir_release_array(desc->page); | 722 | nfs_readdir_release_array(desc->page); |
| @@ -768,6 +757,7 @@ int uncached_readdir(nfs_readdir_descriptor_t *desc, void *dirent, | |||
| 768 | } | 757 | } |
| 769 | 758 | ||
| 770 | desc->page_index = 0; | 759 | desc->page_index = 0; |
| 760 | desc->last_cookie = *desc->dir_cookie; | ||
| 771 | desc->page = page; | 761 | desc->page = page; |
| 772 | 762 | ||
| 773 | status = nfs_readdir_xdr_to_array(desc, page, inode); | 763 | status = nfs_readdir_xdr_to_array(desc, page, inode); |
| @@ -795,7 +785,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 795 | struct inode *inode = dentry->d_inode; | 785 | struct inode *inode = dentry->d_inode; |
| 796 | nfs_readdir_descriptor_t my_desc, | 786 | nfs_readdir_descriptor_t my_desc, |
| 797 | *desc = &my_desc; | 787 | *desc = &my_desc; |
| 798 | int res = -ENOMEM; | 788 | int res; |
| 799 | 789 | ||
| 800 | dfprintk(FILE, "NFS: readdir(%s/%s) starting at cookie %llu\n", | 790 | dfprintk(FILE, "NFS: readdir(%s/%s) starting at cookie %llu\n", |
| 801 | dentry->d_parent->d_name.name, dentry->d_name.name, | 791 | dentry->d_parent->d_name.name, dentry->d_name.name, |
| @@ -820,7 +810,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 820 | if (res < 0) | 810 | if (res < 0) |
| 821 | goto out; | 811 | goto out; |
| 822 | 812 | ||
| 823 | while (desc->eof != 1) { | 813 | do { |
| 824 | res = readdir_search_pagecache(desc); | 814 | res = readdir_search_pagecache(desc); |
| 825 | 815 | ||
| 826 | if (res == -EBADCOOKIE) { | 816 | if (res == -EBADCOOKIE) { |
| @@ -848,7 +838,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 848 | res = nfs_do_filldir(desc, dirent, filldir); | 838 | res = nfs_do_filldir(desc, dirent, filldir); |
| 849 | if (res < 0) | 839 | if (res < 0) |
| 850 | break; | 840 | break; |
| 851 | } | 841 | } while (!desc->eof); |
| 852 | out: | 842 | out: |
| 853 | nfs_unblock_sillyrename(dentry); | 843 | nfs_unblock_sillyrename(dentry); |
| 854 | if (res > 0) | 844 | if (res > 0) |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index 60677f9f1311..7bf029ef4084 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
| @@ -693,6 +693,7 @@ do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) | |||
| 693 | { | 693 | { |
| 694 | struct inode *inode = filp->f_mapping->host; | 694 | struct inode *inode = filp->f_mapping->host; |
| 695 | int status = 0; | 695 | int status = 0; |
| 696 | unsigned int saved_type = fl->fl_type; | ||
| 696 | 697 | ||
| 697 | /* Try local locking first */ | 698 | /* Try local locking first */ |
| 698 | posix_test_lock(filp, fl); | 699 | posix_test_lock(filp, fl); |
| @@ -700,6 +701,7 @@ do_getlk(struct file *filp, int cmd, struct file_lock *fl, int is_local) | |||
| 700 | /* found a conflict */ | 701 | /* found a conflict */ |
| 701 | goto out; | 702 | goto out; |
| 702 | } | 703 | } |
| 704 | fl->fl_type = saved_type; | ||
| 703 | 705 | ||
| 704 | if (nfs_have_delegation(inode, FMODE_READ)) | 706 | if (nfs_have_delegation(inode, FMODE_READ)) |
| 705 | goto out_noconflict; | 707 | goto out_noconflict; |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 314f57164602..e67e31c73416 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
| @@ -289,6 +289,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr) | |||
| 289 | } else if (S_ISDIR(inode->i_mode)) { | 289 | } else if (S_ISDIR(inode->i_mode)) { |
| 290 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; | 290 | inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->dir_inode_ops; |
| 291 | inode->i_fop = &nfs_dir_operations; | 291 | inode->i_fop = &nfs_dir_operations; |
| 292 | inode->i_data.a_ops = &nfs_dir_aops; | ||
| 292 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS)) | 293 | if (nfs_server_capable(inode, NFS_CAP_READDIRPLUS)) |
| 293 | set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags); | 294 | set_bit(NFS_INO_ADVISE_RDPLUS, &NFS_I(inode)->flags); |
| 294 | /* Deal with crossing mountpoints */ | 295 | /* Deal with crossing mountpoints */ |
diff --git a/fs/nfs/mount_clnt.c b/fs/nfs/mount_clnt.c index eceafe74f473..4f981f1f6689 100644 --- a/fs/nfs/mount_clnt.c +++ b/fs/nfs/mount_clnt.c | |||
| @@ -505,13 +505,13 @@ static struct rpc_procinfo mnt3_procedures[] = { | |||
| 505 | 505 | ||
| 506 | static struct rpc_version mnt_version1 = { | 506 | static struct rpc_version mnt_version1 = { |
| 507 | .number = 1, | 507 | .number = 1, |
| 508 | .nrprocs = 2, | 508 | .nrprocs = ARRAY_SIZE(mnt_procedures), |
| 509 | .procs = mnt_procedures, | 509 | .procs = mnt_procedures, |
| 510 | }; | 510 | }; |
| 511 | 511 | ||
| 512 | static struct rpc_version mnt_version3 = { | 512 | static struct rpc_version mnt_version3 = { |
| 513 | .number = 3, | 513 | .number = 3, |
| 514 | .nrprocs = 2, | 514 | .nrprocs = ARRAY_SIZE(mnt3_procedures), |
| 515 | .procs = mnt3_procedures, | 515 | .procs = mnt3_procedures, |
| 516 | }; | 516 | }; |
| 517 | 517 | ||
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 6a653ffd8e4e..4435e5e1f904 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c | |||
| @@ -3361,6 +3361,8 @@ static ssize_t nfs4_proc_get_acl(struct inode *inode, void *buf, size_t buflen) | |||
| 3361 | ret = nfs_revalidate_inode(server, inode); | 3361 | ret = nfs_revalidate_inode(server, inode); |
| 3362 | if (ret < 0) | 3362 | if (ret < 0) |
| 3363 | return ret; | 3363 | return ret; |
| 3364 | if (NFS_I(inode)->cache_validity & NFS_INO_INVALID_ACL) | ||
| 3365 | nfs_zap_acl_cache(inode); | ||
| 3364 | ret = nfs4_read_cached_acl(inode, buf, buflen); | 3366 | ret = nfs4_read_cached_acl(inode, buf, buflen); |
| 3365 | if (ret != -ENOENT) | 3367 | if (ret != -ENOENT) |
| 3366 | return ret; | 3368 | return ret; |
| @@ -3389,6 +3391,13 @@ static int __nfs4_proc_set_acl(struct inode *inode, const void *buf, size_t bufl | |||
| 3389 | nfs_inode_return_delegation(inode); | 3391 | nfs_inode_return_delegation(inode); |
| 3390 | buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase); | 3392 | buf_to_pages(buf, buflen, arg.acl_pages, &arg.acl_pgbase); |
| 3391 | ret = nfs4_call_sync(server, &msg, &arg, &res, 1); | 3393 | ret = nfs4_call_sync(server, &msg, &arg, &res, 1); |
| 3394 | /* | ||
| 3395 | * Acl update can result in inode attribute update. | ||
| 3396 | * so mark the attribute cache invalid. | ||
| 3397 | */ | ||
| 3398 | spin_lock(&inode->i_lock); | ||
| 3399 | NFS_I(inode)->cache_validity |= NFS_INO_INVALID_ATTR; | ||
| 3400 | spin_unlock(&inode->i_lock); | ||
| 3392 | nfs_access_zap_cache(inode); | 3401 | nfs_access_zap_cache(inode); |
| 3393 | nfs_zap_acl_cache(inode); | 3402 | nfs_zap_acl_cache(inode); |
| 3394 | return ret; | 3403 | return ret; |
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 137b549e63db..b68536cc9046 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c | |||
| @@ -115,7 +115,7 @@ int nfs_set_page_tag_locked(struct nfs_page *req) | |||
| 115 | { | 115 | { |
| 116 | if (!nfs_lock_request_dontget(req)) | 116 | if (!nfs_lock_request_dontget(req)) |
| 117 | return 0; | 117 | return 0; |
| 118 | if (req->wb_page != NULL) | 118 | if (test_bit(PG_MAPPED, &req->wb_flags)) |
| 119 | radix_tree_tag_set(&NFS_I(req->wb_context->path.dentry->d_inode)->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_LOCKED); | 119 | radix_tree_tag_set(&NFS_I(req->wb_context->path.dentry->d_inode)->nfs_page_tree, req->wb_index, NFS_PAGE_TAG_LOCKED); |
| 120 | return 1; | 120 | return 1; |
| 121 | } | 121 | } |
| @@ -125,7 +125,7 @@ int nfs_set_page_tag_locked(struct nfs_page *req) | |||
| 125 | */ | 125 | */ |
| 126 | void nfs_clear_page_tag_locked(struct nfs_page *req) | 126 | void nfs_clear_page_tag_locked(struct nfs_page *req) |
| 127 | { | 127 | { |
| 128 | if (req->wb_page != NULL) { | 128 | if (test_bit(PG_MAPPED, &req->wb_flags)) { |
| 129 | struct inode *inode = req->wb_context->path.dentry->d_inode; | 129 | struct inode *inode = req->wb_context->path.dentry->d_inode; |
| 130 | struct nfs_inode *nfsi = NFS_I(inode); | 130 | struct nfs_inode *nfsi = NFS_I(inode); |
| 131 | 131 | ||
diff --git a/fs/nfs/read.c b/fs/nfs/read.c index e4b62c6f5a6e..aedcaa7f291f 100644 --- a/fs/nfs/read.c +++ b/fs/nfs/read.c | |||
| @@ -152,7 +152,6 @@ static void nfs_readpage_release(struct nfs_page *req) | |||
| 152 | (long long)NFS_FILEID(req->wb_context->path.dentry->d_inode), | 152 | (long long)NFS_FILEID(req->wb_context->path.dentry->d_inode), |
| 153 | req->wb_bytes, | 153 | req->wb_bytes, |
| 154 | (long long)req_offset(req)); | 154 | (long long)req_offset(req)); |
| 155 | nfs_clear_request(req); | ||
| 156 | nfs_release_request(req); | 155 | nfs_release_request(req); |
| 157 | } | 156 | } |
| 158 | 157 | ||
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 3c045044fca2..4100630c9a5b 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -1069,12 +1069,10 @@ static int nfs_parse_mount_options(char *raw, | |||
| 1069 | mnt->flags |= NFS_MOUNT_VER3; | 1069 | mnt->flags |= NFS_MOUNT_VER3; |
| 1070 | mnt->version = 3; | 1070 | mnt->version = 3; |
| 1071 | break; | 1071 | break; |
| 1072 | #ifdef CONFIG_NFS_V4 | ||
| 1073 | case Opt_v4: | 1072 | case Opt_v4: |
| 1074 | mnt->flags &= ~NFS_MOUNT_VER3; | 1073 | mnt->flags &= ~NFS_MOUNT_VER3; |
| 1075 | mnt->version = 4; | 1074 | mnt->version = 4; |
| 1076 | break; | 1075 | break; |
| 1077 | #endif | ||
| 1078 | case Opt_udp: | 1076 | case Opt_udp: |
| 1079 | mnt->flags &= ~NFS_MOUNT_TCP; | 1077 | mnt->flags &= ~NFS_MOUNT_TCP; |
| 1080 | mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP; | 1078 | mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP; |
| @@ -1286,12 +1284,10 @@ static int nfs_parse_mount_options(char *raw, | |||
| 1286 | mnt->flags |= NFS_MOUNT_VER3; | 1284 | mnt->flags |= NFS_MOUNT_VER3; |
| 1287 | mnt->version = 3; | 1285 | mnt->version = 3; |
| 1288 | break; | 1286 | break; |
| 1289 | #ifdef CONFIG_NFS_V4 | ||
| 1290 | case NFS4_VERSION: | 1287 | case NFS4_VERSION: |
| 1291 | mnt->flags &= ~NFS_MOUNT_VER3; | 1288 | mnt->flags &= ~NFS_MOUNT_VER3; |
| 1292 | mnt->version = 4; | 1289 | mnt->version = 4; |
| 1293 | break; | 1290 | break; |
| 1294 | #endif | ||
| 1295 | default: | 1291 | default: |
| 1296 | goto out_invalid_value; | 1292 | goto out_invalid_value; |
| 1297 | } | 1293 | } |
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 4c14c17a5276..10d648ea128b 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
| @@ -390,6 +390,7 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req) | |||
| 390 | if (nfs_have_delegation(inode, FMODE_WRITE)) | 390 | if (nfs_have_delegation(inode, FMODE_WRITE)) |
| 391 | nfsi->change_attr++; | 391 | nfsi->change_attr++; |
| 392 | } | 392 | } |
| 393 | set_bit(PG_MAPPED, &req->wb_flags); | ||
| 393 | SetPagePrivate(req->wb_page); | 394 | SetPagePrivate(req->wb_page); |
| 394 | set_page_private(req->wb_page, (unsigned long)req); | 395 | set_page_private(req->wb_page, (unsigned long)req); |
| 395 | nfsi->npages++; | 396 | nfsi->npages++; |
| @@ -415,6 +416,7 @@ static void nfs_inode_remove_request(struct nfs_page *req) | |||
| 415 | spin_lock(&inode->i_lock); | 416 | spin_lock(&inode->i_lock); |
| 416 | set_page_private(req->wb_page, 0); | 417 | set_page_private(req->wb_page, 0); |
| 417 | ClearPagePrivate(req->wb_page); | 418 | ClearPagePrivate(req->wb_page); |
| 419 | clear_bit(PG_MAPPED, &req->wb_flags); | ||
| 418 | radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); | 420 | radix_tree_delete(&nfsi->nfs_page_tree, req->wb_index); |
| 419 | nfsi->npages--; | 421 | nfsi->npages--; |
| 420 | if (!nfsi->npages) { | 422 | if (!nfsi->npages) { |
| @@ -422,7 +424,6 @@ static void nfs_inode_remove_request(struct nfs_page *req) | |||
| 422 | iput(inode); | 424 | iput(inode); |
| 423 | } else | 425 | } else |
| 424 | spin_unlock(&inode->i_lock); | 426 | spin_unlock(&inode->i_lock); |
| 425 | nfs_clear_request(req); | ||
| 426 | nfs_release_request(req); | 427 | nfs_release_request(req); |
| 427 | } | 428 | } |
| 428 | 429 | ||
diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c index 2a533a0af2a9..7e84a852cdae 100644 --- a/fs/nfsd/nfs3xdr.c +++ b/fs/nfsd/nfs3xdr.c | |||
| @@ -260,9 +260,11 @@ void fill_post_wcc(struct svc_fh *fhp) | |||
| 260 | err = vfs_getattr(fhp->fh_export->ex_path.mnt, fhp->fh_dentry, | 260 | err = vfs_getattr(fhp->fh_export->ex_path.mnt, fhp->fh_dentry, |
| 261 | &fhp->fh_post_attr); | 261 | &fhp->fh_post_attr); |
| 262 | fhp->fh_post_change = fhp->fh_dentry->d_inode->i_version; | 262 | fhp->fh_post_change = fhp->fh_dentry->d_inode->i_version; |
| 263 | if (err) | 263 | if (err) { |
| 264 | fhp->fh_post_saved = 0; | 264 | fhp->fh_post_saved = 0; |
| 265 | else | 265 | /* Grab the ctime anyway - set_change_info might use it */ |
| 266 | fhp->fh_post_attr.ctime = fhp->fh_dentry->d_inode->i_ctime; | ||
| 267 | } else | ||
| 266 | fhp->fh_post_saved = 1; | 268 | fhp->fh_post_saved = 1; |
| 267 | } | 269 | } |
| 268 | 270 | ||
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 4d476ff08ae6..60fce3dc5cb5 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
| @@ -484,18 +484,17 @@ static inline bool nfsd4_not_cached(struct nfsd4_compoundres *resp) | |||
| 484 | static inline void | 484 | static inline void |
| 485 | set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | 485 | set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) |
| 486 | { | 486 | { |
| 487 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); | 487 | BUG_ON(!fhp->fh_pre_saved); |
| 488 | cinfo->atomic = 1; | 488 | cinfo->atomic = fhp->fh_post_saved; |
| 489 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); | 489 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); |
| 490 | if (cinfo->change_supported) { | 490 | |
| 491 | cinfo->before_change = fhp->fh_pre_change; | 491 | cinfo->before_change = fhp->fh_pre_change; |
| 492 | cinfo->after_change = fhp->fh_post_change; | 492 | cinfo->after_change = fhp->fh_post_change; |
| 493 | } else { | 493 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; |
| 494 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | 494 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; |
| 495 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | 495 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; |
| 496 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | 496 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; |
| 497 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | 497 | |
| 498 | } | ||
| 499 | } | 498 | } |
| 500 | 499 | ||
| 501 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | 500 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); |
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 52c7557f3e25..9f26ac9be2a4 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
| @@ -1964,8 +1964,10 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g | |||
| 1964 | if (reg == NULL) | 1964 | if (reg == NULL) |
| 1965 | return ERR_PTR(-ENOMEM); | 1965 | return ERR_PTR(-ENOMEM); |
| 1966 | 1966 | ||
| 1967 | if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) | 1967 | if (strlen(name) > O2HB_MAX_REGION_NAME_LEN) { |
| 1968 | return ERR_PTR(-ENAMETOOLONG); | 1968 | ret = -ENAMETOOLONG; |
| 1969 | goto free; | ||
| 1970 | } | ||
| 1969 | 1971 | ||
| 1970 | spin_lock(&o2hb_live_lock); | 1972 | spin_lock(&o2hb_live_lock); |
| 1971 | reg->hr_region_num = 0; | 1973 | reg->hr_region_num = 0; |
| @@ -1974,7 +1976,8 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g | |||
| 1974 | O2NM_MAX_REGIONS); | 1976 | O2NM_MAX_REGIONS); |
| 1975 | if (reg->hr_region_num >= O2NM_MAX_REGIONS) { | 1977 | if (reg->hr_region_num >= O2NM_MAX_REGIONS) { |
| 1976 | spin_unlock(&o2hb_live_lock); | 1978 | spin_unlock(&o2hb_live_lock); |
| 1977 | return ERR_PTR(-EFBIG); | 1979 | ret = -EFBIG; |
| 1980 | goto free; | ||
| 1978 | } | 1981 | } |
| 1979 | set_bit(reg->hr_region_num, o2hb_region_bitmap); | 1982 | set_bit(reg->hr_region_num, o2hb_region_bitmap); |
| 1980 | } | 1983 | } |
| @@ -1986,10 +1989,13 @@ static struct config_item *o2hb_heartbeat_group_make_item(struct config_group *g | |||
| 1986 | ret = o2hb_debug_region_init(reg, o2hb_debug_dir); | 1989 | ret = o2hb_debug_region_init(reg, o2hb_debug_dir); |
| 1987 | if (ret) { | 1990 | if (ret) { |
| 1988 | config_item_put(®->hr_item); | 1991 | config_item_put(®->hr_item); |
| 1989 | return ERR_PTR(ret); | 1992 | goto free; |
| 1990 | } | 1993 | } |
| 1991 | 1994 | ||
| 1992 | return ®->hr_item; | 1995 | return ®->hr_item; |
| 1996 | free: | ||
| 1997 | kfree(reg); | ||
| 1998 | return ERR_PTR(ret); | ||
| 1993 | } | 1999 | } |
| 1994 | 2000 | ||
| 1995 | static void o2hb_heartbeat_group_drop_item(struct config_group *group, | 2001 | static void o2hb_heartbeat_group_drop_item(struct config_group *group, |
diff --git a/fs/ocfs2/dcache.c b/fs/ocfs2/dcache.c index edaded48e7e9..895532ac4d98 100644 --- a/fs/ocfs2/dcache.c +++ b/fs/ocfs2/dcache.c | |||
| @@ -476,7 +476,6 @@ static void ocfs2_dentry_iput(struct dentry *dentry, struct inode *inode) | |||
| 476 | 476 | ||
| 477 | out: | 477 | out: |
| 478 | iput(inode); | 478 | iput(inode); |
| 479 | ocfs2_dentry_attach_gen(dentry); | ||
| 480 | } | 479 | } |
| 481 | 480 | ||
| 482 | /* | 481 | /* |
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 58a93b953735..cc2aaa96cfe5 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c | |||
| @@ -959,7 +959,7 @@ static int dlm_match_regions(struct dlm_ctxt *dlm, | |||
| 959 | r += O2HB_MAX_REGION_NAME_LEN; | 959 | r += O2HB_MAX_REGION_NAME_LEN; |
| 960 | } | 960 | } |
| 961 | 961 | ||
| 962 | local = kmalloc(sizeof(qr->qr_regions), GFP_KERNEL); | 962 | local = kmalloc(sizeof(qr->qr_regions), GFP_ATOMIC); |
| 963 | if (!local) { | 963 | if (!local) { |
| 964 | status = -ENOMEM; | 964 | status = -ENOMEM; |
| 965 | goto bail; | 965 | goto bail; |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 1efea3615589..70dd3b1798f1 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
| @@ -159,9 +159,9 @@ struct ocfs2_lock_res { | |||
| 159 | char l_name[OCFS2_LOCK_ID_MAX_LEN]; | 159 | char l_name[OCFS2_LOCK_ID_MAX_LEN]; |
| 160 | unsigned int l_ro_holders; | 160 | unsigned int l_ro_holders; |
| 161 | unsigned int l_ex_holders; | 161 | unsigned int l_ex_holders; |
| 162 | char l_level; | 162 | signed char l_level; |
| 163 | char l_requested; | 163 | signed char l_requested; |
| 164 | char l_blocking; | 164 | signed char l_blocking; |
| 165 | 165 | ||
| 166 | /* Data packed - type enum ocfs2_lock_type */ | 166 | /* Data packed - type enum ocfs2_lock_type */ |
| 167 | unsigned char l_type; | 167 | unsigned char l_type; |
diff --git a/fs/ocfs2/stack_user.c b/fs/ocfs2/stack_user.c index 252e7c82f929..a5ebe421195f 100644 --- a/fs/ocfs2/stack_user.c +++ b/fs/ocfs2/stack_user.c | |||
| @@ -190,7 +190,7 @@ static struct ocfs2_live_connection *ocfs2_connection_find(const char *name) | |||
| 190 | return c; | 190 | return c; |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | return c; | 193 | return NULL; |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | /* | 196 | /* |
diff --git a/fs/proc/base.c b/fs/proc/base.c index f3d02ca461ec..182845147fe4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -1574,7 +1574,7 @@ static int do_proc_readlink(struct path *path, char __user *buffer, int buflen) | |||
| 1574 | if (!tmp) | 1574 | if (!tmp) |
| 1575 | return -ENOMEM; | 1575 | return -ENOMEM; |
| 1576 | 1576 | ||
| 1577 | pathname = d_path_with_unreachable(path, tmp, PAGE_SIZE); | 1577 | pathname = d_path(path, tmp, PAGE_SIZE); |
| 1578 | len = PTR_ERR(pathname); | 1578 | len = PTR_ERR(pathname); |
| 1579 | if (IS_ERR(pathname)) | 1579 | if (IS_ERR(pathname)) |
| 1580 | goto out; | 1580 | goto out; |
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index 536d697a8a28..90d2fcb67a31 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
| @@ -472,7 +472,9 @@ int reiserfs_acl_chmod(struct inode *inode) | |||
| 472 | struct reiserfs_transaction_handle th; | 472 | struct reiserfs_transaction_handle th; |
| 473 | size_t size = reiserfs_xattr_nblocks(inode, | 473 | size_t size = reiserfs_xattr_nblocks(inode, |
| 474 | reiserfs_acl_size(clone->a_count)); | 474 | reiserfs_acl_size(clone->a_count)); |
| 475 | reiserfs_write_lock(inode->i_sb); | 475 | int depth; |
| 476 | |||
| 477 | depth = reiserfs_write_lock_once(inode->i_sb); | ||
| 476 | error = journal_begin(&th, inode->i_sb, size * 2); | 478 | error = journal_begin(&th, inode->i_sb, size * 2); |
| 477 | if (!error) { | 479 | if (!error) { |
| 478 | int error2; | 480 | int error2; |
| @@ -482,7 +484,7 @@ int reiserfs_acl_chmod(struct inode *inode) | |||
| 482 | if (error2) | 484 | if (error2) |
| 483 | error = error2; | 485 | error = error2; |
| 484 | } | 486 | } |
| 485 | reiserfs_write_unlock(inode->i_sb); | 487 | reiserfs_write_unlock_once(inode->i_sb, depth); |
| 486 | } | 488 | } |
| 487 | posix_acl_release(clone); | 489 | posix_acl_release(clone); |
| 488 | return error; | 490 | return error; |
diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 7d287afccde5..691f61223ed6 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c | |||
| @@ -934,7 +934,6 @@ xfs_aops_discard_page( | |||
| 934 | struct xfs_inode *ip = XFS_I(inode); | 934 | struct xfs_inode *ip = XFS_I(inode); |
| 935 | struct buffer_head *bh, *head; | 935 | struct buffer_head *bh, *head; |
| 936 | loff_t offset = page_offset(page); | 936 | loff_t offset = page_offset(page); |
| 937 | ssize_t len = 1 << inode->i_blkbits; | ||
| 938 | 937 | ||
| 939 | if (!xfs_is_delayed_page(page, IO_DELAY)) | 938 | if (!xfs_is_delayed_page(page, IO_DELAY)) |
| 940 | goto out_invalidate; | 939 | goto out_invalidate; |
| @@ -949,58 +948,14 @@ xfs_aops_discard_page( | |||
| 949 | xfs_ilock(ip, XFS_ILOCK_EXCL); | 948 | xfs_ilock(ip, XFS_ILOCK_EXCL); |
| 950 | bh = head = page_buffers(page); | 949 | bh = head = page_buffers(page); |
| 951 | do { | 950 | do { |
| 952 | int done; | ||
| 953 | xfs_fileoff_t offset_fsb; | ||
| 954 | xfs_bmbt_irec_t imap; | ||
| 955 | int nimaps = 1; | ||
| 956 | int error; | 951 | int error; |
| 957 | xfs_fsblock_t firstblock; | 952 | xfs_fileoff_t start_fsb; |
| 958 | xfs_bmap_free_t flist; | ||
| 959 | 953 | ||
| 960 | if (!buffer_delay(bh)) | 954 | if (!buffer_delay(bh)) |
| 961 | goto next_buffer; | 955 | goto next_buffer; |
| 962 | 956 | ||
| 963 | offset_fsb = XFS_B_TO_FSBT(ip->i_mount, offset); | 957 | start_fsb = XFS_B_TO_FSBT(ip->i_mount, offset); |
| 964 | 958 | error = xfs_bmap_punch_delalloc_range(ip, start_fsb, 1); | |
| 965 | /* | ||
| 966 | * Map the range first and check that it is a delalloc extent | ||
| 967 | * before trying to unmap the range. Otherwise we will be | ||
| 968 | * trying to remove a real extent (which requires a | ||
| 969 | * transaction) or a hole, which is probably a bad idea... | ||
| 970 | */ | ||
| 971 | error = xfs_bmapi(NULL, ip, offset_fsb, 1, | ||
| 972 | XFS_BMAPI_ENTIRE, NULL, 0, &imap, | ||
| 973 | &nimaps, NULL); | ||
| 974 | |||
| 975 | if (error) { | ||
| 976 | /* something screwed, just bail */ | ||
| 977 | if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | ||
| 978 | xfs_fs_cmn_err(CE_ALERT, ip->i_mount, | ||
| 979 | "page discard failed delalloc mapping lookup."); | ||
| 980 | } | ||
| 981 | break; | ||
| 982 | } | ||
| 983 | if (!nimaps) { | ||
| 984 | /* nothing there */ | ||
| 985 | goto next_buffer; | ||
| 986 | } | ||
| 987 | if (imap.br_startblock != DELAYSTARTBLOCK) { | ||
| 988 | /* been converted, ignore */ | ||
| 989 | goto next_buffer; | ||
| 990 | } | ||
| 991 | WARN_ON(imap.br_blockcount == 0); | ||
| 992 | |||
| 993 | /* | ||
| 994 | * Note: while we initialise the firstblock/flist pair, they | ||
| 995 | * should never be used because blocks should never be | ||
| 996 | * allocated or freed for a delalloc extent and hence we need | ||
| 997 | * don't cancel or finish them after the xfs_bunmapi() call. | ||
| 998 | */ | ||
| 999 | xfs_bmap_init(&flist, &firstblock); | ||
| 1000 | error = xfs_bunmapi(NULL, ip, offset_fsb, 1, 0, 1, &firstblock, | ||
| 1001 | &flist, &done); | ||
| 1002 | |||
| 1003 | ASSERT(!flist.xbf_count && !flist.xbf_first); | ||
| 1004 | if (error) { | 959 | if (error) { |
| 1005 | /* something screwed, just bail */ | 960 | /* something screwed, just bail */ |
| 1006 | if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | 961 | if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { |
| @@ -1010,7 +965,7 @@ xfs_aops_discard_page( | |||
| 1010 | break; | 965 | break; |
| 1011 | } | 966 | } |
| 1012 | next_buffer: | 967 | next_buffer: |
| 1013 | offset += len; | 968 | offset += 1 << inode->i_blkbits; |
| 1014 | 969 | ||
| 1015 | } while ((bh = bh->b_this_page) != head); | 970 | } while ((bh = bh->b_this_page) != head); |
| 1016 | 971 | ||
| @@ -1505,11 +1460,42 @@ xfs_vm_write_failed( | |||
| 1505 | struct inode *inode = mapping->host; | 1460 | struct inode *inode = mapping->host; |
| 1506 | 1461 | ||
| 1507 | if (to > inode->i_size) { | 1462 | if (to > inode->i_size) { |
| 1508 | struct iattr ia = { | 1463 | /* |
| 1509 | .ia_valid = ATTR_SIZE | ATTR_FORCE, | 1464 | * punch out the delalloc blocks we have already allocated. We |
| 1510 | .ia_size = inode->i_size, | 1465 | * don't call xfs_setattr() to do this as we may be in the |
| 1511 | }; | 1466 | * middle of a multi-iovec write and so the vfs inode->i_size |
| 1512 | xfs_setattr(XFS_I(inode), &ia, XFS_ATTR_NOLOCK); | 1467 | * will not match the xfs ip->i_size and so it will zero too |
| 1468 | * much. Hence we jus truncate the page cache to zero what is | ||
| 1469 | * necessary and punch the delalloc blocks directly. | ||
| 1470 | */ | ||
| 1471 | struct xfs_inode *ip = XFS_I(inode); | ||
| 1472 | xfs_fileoff_t start_fsb; | ||
| 1473 | xfs_fileoff_t end_fsb; | ||
| 1474 | int error; | ||
| 1475 | |||
| 1476 | truncate_pagecache(inode, to, inode->i_size); | ||
| 1477 | |||
| 1478 | /* | ||
| 1479 | * Check if there are any blocks that are outside of i_size | ||
| 1480 | * that need to be trimmed back. | ||
| 1481 | */ | ||
| 1482 | start_fsb = XFS_B_TO_FSB(ip->i_mount, inode->i_size) + 1; | ||
| 1483 | end_fsb = XFS_B_TO_FSB(ip->i_mount, to); | ||
| 1484 | if (end_fsb <= start_fsb) | ||
| 1485 | return; | ||
| 1486 | |||
| 1487 | xfs_ilock(ip, XFS_ILOCK_EXCL); | ||
| 1488 | error = xfs_bmap_punch_delalloc_range(ip, start_fsb, | ||
| 1489 | end_fsb - start_fsb); | ||
| 1490 | if (error) { | ||
| 1491 | /* something screwed, just bail */ | ||
| 1492 | if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | ||
| 1493 | xfs_fs_cmn_err(CE_ALERT, ip->i_mount, | ||
| 1494 | "xfs_vm_write_failed: unable to clean up ino %lld", | ||
| 1495 | ip->i_ino); | ||
| 1496 | } | ||
| 1497 | } | ||
| 1498 | xfs_iunlock(ip, XFS_ILOCK_EXCL); | ||
| 1513 | } | 1499 | } |
| 1514 | } | 1500 | } |
| 1515 | 1501 | ||
diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index aa1d353def29..4c5deb6e9e31 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c | |||
| @@ -488,29 +488,16 @@ found: | |||
| 488 | spin_unlock(&pag->pag_buf_lock); | 488 | spin_unlock(&pag->pag_buf_lock); |
| 489 | xfs_perag_put(pag); | 489 | xfs_perag_put(pag); |
| 490 | 490 | ||
| 491 | /* Attempt to get the semaphore without sleeping, | 491 | if (xfs_buf_cond_lock(bp)) { |
| 492 | * if this does not work then we need to drop the | 492 | /* failed, so wait for the lock if requested. */ |
| 493 | * spinlock and do a hard attempt on the semaphore. | ||
| 494 | */ | ||
| 495 | if (down_trylock(&bp->b_sema)) { | ||
| 496 | if (!(flags & XBF_TRYLOCK)) { | 493 | if (!(flags & XBF_TRYLOCK)) { |
| 497 | /* wait for buffer ownership */ | ||
| 498 | xfs_buf_lock(bp); | 494 | xfs_buf_lock(bp); |
| 499 | XFS_STATS_INC(xb_get_locked_waited); | 495 | XFS_STATS_INC(xb_get_locked_waited); |
| 500 | } else { | 496 | } else { |
| 501 | /* We asked for a trylock and failed, no need | ||
| 502 | * to look at file offset and length here, we | ||
| 503 | * know that this buffer at least overlaps our | ||
| 504 | * buffer and is locked, therefore our buffer | ||
| 505 | * either does not exist, or is this buffer. | ||
| 506 | */ | ||
| 507 | xfs_buf_rele(bp); | 497 | xfs_buf_rele(bp); |
| 508 | XFS_STATS_INC(xb_busy_locked); | 498 | XFS_STATS_INC(xb_busy_locked); |
| 509 | return NULL; | 499 | return NULL; |
| 510 | } | 500 | } |
| 511 | } else { | ||
| 512 | /* trylock worked */ | ||
| 513 | XB_SET_OWNER(bp); | ||
| 514 | } | 501 | } |
| 515 | 502 | ||
| 516 | if (bp->b_flags & XBF_STALE) { | 503 | if (bp->b_flags & XBF_STALE) { |
| @@ -876,10 +863,18 @@ xfs_buf_rele( | |||
| 876 | */ | 863 | */ |
| 877 | 864 | ||
| 878 | /* | 865 | /* |
| 879 | * Locks a buffer object, if it is not already locked. | 866 | * Locks a buffer object, if it is not already locked. Note that this in |
| 880 | * Note that this in no way locks the underlying pages, so it is only | 867 | * no way locks the underlying pages, so it is only useful for |
| 881 | * useful for synchronizing concurrent use of buffer objects, not for | 868 | * synchronizing concurrent use of buffer objects, not for synchronizing |
| 882 | * synchronizing independent access to the underlying pages. | 869 | * independent access to the underlying pages. |
| 870 | * | ||
| 871 | * If we come across a stale, pinned, locked buffer, we know that we are | ||
| 872 | * being asked to lock a buffer that has been reallocated. Because it is | ||
| 873 | * pinned, we know that the log has not been pushed to disk and hence it | ||
| 874 | * will still be locked. Rather than continuing to have trylock attempts | ||
| 875 | * fail until someone else pushes the log, push it ourselves before | ||
| 876 | * returning. This means that the xfsaild will not get stuck trying | ||
| 877 | * to push on stale inode buffers. | ||
| 883 | */ | 878 | */ |
| 884 | int | 879 | int |
| 885 | xfs_buf_cond_lock( | 880 | xfs_buf_cond_lock( |
| @@ -890,6 +885,8 @@ xfs_buf_cond_lock( | |||
| 890 | locked = down_trylock(&bp->b_sema) == 0; | 885 | locked = down_trylock(&bp->b_sema) == 0; |
| 891 | if (locked) | 886 | if (locked) |
| 892 | XB_SET_OWNER(bp); | 887 | XB_SET_OWNER(bp); |
| 888 | else if (atomic_read(&bp->b_pin_count) && (bp->b_flags & XBF_STALE)) | ||
| 889 | xfs_log_force(bp->b_target->bt_mount, 0); | ||
| 893 | 890 | ||
| 894 | trace_xfs_buf_cond_lock(bp, _RET_IP_); | 891 | trace_xfs_buf_cond_lock(bp, _RET_IP_); |
| 895 | return locked ? 0 : -EBUSY; | 892 | return locked ? 0 : -EBUSY; |
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 8abd12e32e13..4111cd3966c7 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c | |||
| @@ -5471,8 +5471,13 @@ xfs_getbmap( | |||
| 5471 | if (error) | 5471 | if (error) |
| 5472 | goto out_unlock_iolock; | 5472 | goto out_unlock_iolock; |
| 5473 | } | 5473 | } |
| 5474 | 5474 | /* | |
| 5475 | ASSERT(ip->i_delayed_blks == 0); | 5475 | * even after flushing the inode, there can still be delalloc |
| 5476 | * blocks on the inode beyond EOF due to speculative | ||
| 5477 | * preallocation. These are not removed until the release | ||
| 5478 | * function is called or the inode is inactivated. Hence we | ||
| 5479 | * cannot assert here that ip->i_delayed_blks == 0. | ||
| 5480 | */ | ||
| 5476 | } | 5481 | } |
| 5477 | 5482 | ||
| 5478 | lock = xfs_ilock_map_shared(ip); | 5483 | lock = xfs_ilock_map_shared(ip); |
| @@ -6070,3 +6075,79 @@ xfs_bmap_disk_count_leaves( | |||
| 6070 | *count += xfs_bmbt_disk_get_blockcount(frp); | 6075 | *count += xfs_bmbt_disk_get_blockcount(frp); |
| 6071 | } | 6076 | } |
| 6072 | } | 6077 | } |
| 6078 | |||
| 6079 | /* | ||
| 6080 | * dead simple method of punching delalyed allocation blocks from a range in | ||
| 6081 | * the inode. Walks a block at a time so will be slow, but is only executed in | ||
| 6082 | * rare error cases so the overhead is not critical. This will alays punch out | ||
| 6083 | * both the start and end blocks, even if the ranges only partially overlap | ||
| 6084 | * them, so it is up to the caller to ensure that partial blocks are not | ||
| 6085 | * passed in. | ||
| 6086 | */ | ||
| 6087 | int | ||
| 6088 | xfs_bmap_punch_delalloc_range( | ||
| 6089 | struct xfs_inode *ip, | ||
| 6090 | xfs_fileoff_t start_fsb, | ||
| 6091 | xfs_fileoff_t length) | ||
| 6092 | { | ||
| 6093 | xfs_fileoff_t remaining = length; | ||
| 6094 | int error = 0; | ||
| 6095 | |||
| 6096 | ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); | ||
| 6097 | |||
| 6098 | do { | ||
| 6099 | int done; | ||
| 6100 | xfs_bmbt_irec_t imap; | ||
| 6101 | int nimaps = 1; | ||
| 6102 | xfs_fsblock_t firstblock; | ||
| 6103 | xfs_bmap_free_t flist; | ||
| 6104 | |||
| 6105 | /* | ||
| 6106 | * Map the range first and check that it is a delalloc extent | ||
| 6107 | * before trying to unmap the range. Otherwise we will be | ||
| 6108 | * trying to remove a real extent (which requires a | ||
| 6109 | * transaction) or a hole, which is probably a bad idea... | ||
| 6110 | */ | ||
| 6111 | error = xfs_bmapi(NULL, ip, start_fsb, 1, | ||
| 6112 | XFS_BMAPI_ENTIRE, NULL, 0, &imap, | ||
| 6113 | &nimaps, NULL); | ||
| 6114 | |||
| 6115 | if (error) { | ||
| 6116 | /* something screwed, just bail */ | ||
| 6117 | if (!XFS_FORCED_SHUTDOWN(ip->i_mount)) { | ||
| 6118 | xfs_fs_cmn_err(CE_ALERT, ip->i_mount, | ||
| 6119 | "Failed delalloc mapping lookup ino %lld fsb %lld.", | ||
| 6120 | ip->i_ino, start_fsb); | ||
| 6121 | } | ||
| 6122 | break; | ||
| 6123 | } | ||
| 6124 | if (!nimaps) { | ||
| 6125 | /* nothing there */ | ||
| 6126 | goto next_block; | ||
| 6127 | } | ||
| 6128 | if (imap.br_startblock != DELAYSTARTBLOCK) { | ||
| 6129 | /* been converted, ignore */ | ||
| 6130 | goto next_block; | ||
| 6131 | } | ||
| 6132 | WARN_ON(imap.br_blockcount == 0); | ||
| 6133 | |||
| 6134 | /* | ||
| 6135 | * Note: while we initialise the firstblock/flist pair, they | ||
| 6136 | * should never be used because blocks should never be | ||
| 6137 | * allocated or freed for a delalloc extent and hence we need | ||
| 6138 | * don't cancel or finish them after the xfs_bunmapi() call. | ||
| 6139 | */ | ||
| 6140 | xfs_bmap_init(&flist, &firstblock); | ||
| 6141 | error = xfs_bunmapi(NULL, ip, start_fsb, 1, 0, 1, &firstblock, | ||
| 6142 | &flist, &done); | ||
| 6143 | if (error) | ||
| 6144 | break; | ||
| 6145 | |||
| 6146 | ASSERT(!flist.xbf_count && !flist.xbf_first); | ||
| 6147 | next_block: | ||
| 6148 | start_fsb++; | ||
| 6149 | remaining--; | ||
| 6150 | } while(remaining > 0); | ||
| 6151 | |||
| 6152 | return error; | ||
| 6153 | } | ||
diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h index 71ec9b6ecdfc..3651191daea1 100644 --- a/fs/xfs/xfs_bmap.h +++ b/fs/xfs/xfs_bmap.h | |||
| @@ -394,6 +394,11 @@ xfs_bmap_count_blocks( | |||
| 394 | int whichfork, | 394 | int whichfork, |
| 395 | int *count); | 395 | int *count); |
| 396 | 396 | ||
| 397 | int | ||
| 398 | xfs_bmap_punch_delalloc_range( | ||
| 399 | struct xfs_inode *ip, | ||
| 400 | xfs_fileoff_t start_fsb, | ||
| 401 | xfs_fileoff_t length); | ||
| 397 | #endif /* __KERNEL__ */ | 402 | #endif /* __KERNEL__ */ |
| 398 | 403 | ||
| 399 | #endif /* __XFS_BMAP_H__ */ | 404 | #endif /* __XFS_BMAP_H__ */ |
diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 3b9582c60a22..e60490bc00a6 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c | |||
| @@ -377,6 +377,19 @@ xfs_swap_extents( | |||
| 377 | ip->i_d.di_format = tip->i_d.di_format; | 377 | ip->i_d.di_format = tip->i_d.di_format; |
| 378 | tip->i_d.di_format = tmp; | 378 | tip->i_d.di_format = tmp; |
| 379 | 379 | ||
| 380 | /* | ||
| 381 | * The extents in the source inode could still contain speculative | ||
| 382 | * preallocation beyond EOF (e.g. the file is open but not modified | ||
| 383 | * while defrag is in progress). In that case, we need to copy over the | ||
| 384 | * number of delalloc blocks the data fork in the source inode is | ||
| 385 | * tracking beyond EOF so that when the fork is truncated away when the | ||
| 386 | * temporary inode is unlinked we don't underrun the i_delayed_blks | ||
| 387 | * counter on that inode. | ||
| 388 | */ | ||
| 389 | ASSERT(tip->i_delayed_blks == 0); | ||
| 390 | tip->i_delayed_blks = ip->i_delayed_blks; | ||
| 391 | ip->i_delayed_blks = 0; | ||
| 392 | |||
| 380 | ilf_fields = XFS_ILOG_CORE; | 393 | ilf_fields = XFS_ILOG_CORE; |
| 381 | 394 | ||
| 382 | switch(ip->i_d.di_format) { | 395 | switch(ip->i_d.di_format) { |
diff --git a/fs/xfs/xfs_error.c b/fs/xfs/xfs_error.c index ed9990267661..c78cc6a3d87c 100644 --- a/fs/xfs/xfs_error.c +++ b/fs/xfs/xfs_error.c | |||
| @@ -58,6 +58,7 @@ xfs_error_trap(int e) | |||
| 58 | int xfs_etest[XFS_NUM_INJECT_ERROR]; | 58 | int xfs_etest[XFS_NUM_INJECT_ERROR]; |
| 59 | int64_t xfs_etest_fsid[XFS_NUM_INJECT_ERROR]; | 59 | int64_t xfs_etest_fsid[XFS_NUM_INJECT_ERROR]; |
| 60 | char * xfs_etest_fsname[XFS_NUM_INJECT_ERROR]; | 60 | char * xfs_etest_fsname[XFS_NUM_INJECT_ERROR]; |
| 61 | int xfs_error_test_active; | ||
| 61 | 62 | ||
| 62 | int | 63 | int |
| 63 | xfs_error_test(int error_tag, int *fsidp, char *expression, | 64 | xfs_error_test(int error_tag, int *fsidp, char *expression, |
| @@ -108,6 +109,7 @@ xfs_errortag_add(int error_tag, xfs_mount_t *mp) | |||
| 108 | len = strlen(mp->m_fsname); | 109 | len = strlen(mp->m_fsname); |
| 109 | xfs_etest_fsname[i] = kmem_alloc(len + 1, KM_SLEEP); | 110 | xfs_etest_fsname[i] = kmem_alloc(len + 1, KM_SLEEP); |
| 110 | strcpy(xfs_etest_fsname[i], mp->m_fsname); | 111 | strcpy(xfs_etest_fsname[i], mp->m_fsname); |
| 112 | xfs_error_test_active++; | ||
| 111 | return 0; | 113 | return 0; |
| 112 | } | 114 | } |
| 113 | } | 115 | } |
| @@ -137,6 +139,7 @@ xfs_errortag_clearall(xfs_mount_t *mp, int loud) | |||
| 137 | xfs_etest_fsid[i] = 0LL; | 139 | xfs_etest_fsid[i] = 0LL; |
| 138 | kmem_free(xfs_etest_fsname[i]); | 140 | kmem_free(xfs_etest_fsname[i]); |
| 139 | xfs_etest_fsname[i] = NULL; | 141 | xfs_etest_fsname[i] = NULL; |
| 142 | xfs_error_test_active--; | ||
| 140 | } | 143 | } |
| 141 | } | 144 | } |
| 142 | 145 | ||
diff --git a/fs/xfs/xfs_error.h b/fs/xfs/xfs_error.h index c2c1a072bb82..f338847f80b8 100644 --- a/fs/xfs/xfs_error.h +++ b/fs/xfs/xfs_error.h | |||
| @@ -127,13 +127,14 @@ extern void xfs_corruption_error(const char *tag, int level, | |||
| 127 | #define XFS_RANDOM_BMAPIFORMAT XFS_RANDOM_DEFAULT | 127 | #define XFS_RANDOM_BMAPIFORMAT XFS_RANDOM_DEFAULT |
| 128 | 128 | ||
| 129 | #ifdef DEBUG | 129 | #ifdef DEBUG |
| 130 | extern int xfs_error_test_active; | ||
| 130 | extern int xfs_error_test(int, int *, char *, int, char *, unsigned long); | 131 | extern int xfs_error_test(int, int *, char *, int, char *, unsigned long); |
| 131 | 132 | ||
| 132 | #define XFS_NUM_INJECT_ERROR 10 | 133 | #define XFS_NUM_INJECT_ERROR 10 |
| 133 | #define XFS_TEST_ERROR(expr, mp, tag, rf) \ | 134 | #define XFS_TEST_ERROR(expr, mp, tag, rf) \ |
| 134 | ((expr) || \ | 135 | ((expr) || (xfs_error_test_active && \ |
| 135 | xfs_error_test((tag), (mp)->m_fixedfsid, "expr", __LINE__, __FILE__, \ | 136 | xfs_error_test((tag), (mp)->m_fixedfsid, "expr", __LINE__, __FILE__, \ |
| 136 | (rf))) | 137 | (rf)))) |
| 137 | 138 | ||
| 138 | extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp); | 139 | extern int xfs_errortag_add(int error_tag, xfs_mount_t *mp); |
| 139 | extern int xfs_errortag_clearall(xfs_mount_t *mp, int loud); | 140 | extern int xfs_errortag_clearall(xfs_mount_t *mp, int loud); |
diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index c7ac020705df..7c8d30c453c3 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c | |||
| @@ -657,18 +657,37 @@ xfs_inode_item_unlock( | |||
| 657 | } | 657 | } |
| 658 | 658 | ||
| 659 | /* | 659 | /* |
| 660 | * This is called to find out where the oldest active copy of the | 660 | * This is called to find out where the oldest active copy of the inode log |
| 661 | * inode log item in the on disk log resides now that the last log | 661 | * item in the on disk log resides now that the last log write of it completed |
| 662 | * write of it completed at the given lsn. Since we always re-log | 662 | * at the given lsn. Since we always re-log all dirty data in an inode, the |
| 663 | * all dirty data in an inode, the latest copy in the on disk log | 663 | * latest copy in the on disk log is the only one that matters. Therefore, |
| 664 | * is the only one that matters. Therefore, simply return the | 664 | * simply return the given lsn. |
| 665 | * given lsn. | 665 | * |
| 666 | * If the inode has been marked stale because the cluster is being freed, we | ||
| 667 | * don't want to (re-)insert this inode into the AIL. There is a race condition | ||
| 668 | * where the cluster buffer may be unpinned before the inode is inserted into | ||
| 669 | * the AIL during transaction committed processing. If the buffer is unpinned | ||
| 670 | * before the inode item has been committed and inserted, then it is possible | ||
| 671 | * for the buffer to be written and IO completions before the inode is inserted | ||
| 672 | * into the AIL. In that case, we'd be inserting a clean, stale inode into the | ||
| 673 | * AIL which will never get removed. It will, however, get reclaimed which | ||
| 674 | * triggers an assert in xfs_inode_free() complaining about freein an inode | ||
| 675 | * still in the AIL. | ||
| 676 | * | ||
| 677 | * To avoid this, return a lower LSN than the one passed in so that the | ||
| 678 | * transaction committed code will not move the inode forward in the AIL but | ||
| 679 | * will still unpin it properly. | ||
| 666 | */ | 680 | */ |
| 667 | STATIC xfs_lsn_t | 681 | STATIC xfs_lsn_t |
| 668 | xfs_inode_item_committed( | 682 | xfs_inode_item_committed( |
| 669 | struct xfs_log_item *lip, | 683 | struct xfs_log_item *lip, |
| 670 | xfs_lsn_t lsn) | 684 | xfs_lsn_t lsn) |
| 671 | { | 685 | { |
| 686 | struct xfs_inode_log_item *iip = INODE_ITEM(lip); | ||
| 687 | struct xfs_inode *ip = iip->ili_inode; | ||
| 688 | |||
| 689 | if (xfs_iflags_test(ip, XFS_ISTALE)) | ||
| 690 | return lsn - 1; | ||
| 672 | return lsn; | 691 | return lsn; |
| 673 | } | 692 | } |
| 674 | 693 | ||
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index d2af0a8381a6..77a59891734e 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c | |||
| @@ -297,6 +297,7 @@ xfs_rename( | |||
| 297 | * it and some incremental backup programs won't work without it. | 297 | * it and some incremental backup programs won't work without it. |
| 298 | */ | 298 | */ |
| 299 | xfs_trans_ichgtime(tp, src_ip, XFS_ICHGTIME_CHG); | 299 | xfs_trans_ichgtime(tp, src_ip, XFS_ICHGTIME_CHG); |
| 300 | xfs_trans_log_inode(tp, src_ip, XFS_ILOG_CORE); | ||
| 300 | 301 | ||
| 301 | /* | 302 | /* |
| 302 | * Adjust the link count on src_dp. This is necessary when | 303 | * Adjust the link count on src_dp. This is necessary when |
diff --git a/include/acpi/video.h b/include/acpi/video.h index 551793c9b6e8..0e98e679d3a7 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
| @@ -1,6 +1,10 @@ | |||
| 1 | #ifndef __ACPI_VIDEO_H | 1 | #ifndef __ACPI_VIDEO_H |
| 2 | #define __ACPI_VIDEO_H | 2 | #define __ACPI_VIDEO_H |
| 3 | 3 | ||
| 4 | #include <linux/errno.h> /* for ENODEV */ | ||
| 5 | |||
| 6 | struct acpi_device; | ||
| 7 | |||
| 4 | #define ACPI_VIDEO_DISPLAY_CRT 1 | 8 | #define ACPI_VIDEO_DISPLAY_CRT 1 |
| 5 | #define ACPI_VIDEO_DISPLAY_TV 2 | 9 | #define ACPI_VIDEO_DISPLAY_TV 2 |
| 6 | #define ACPI_VIDEO_DISPLAY_DVI 3 | 10 | #define ACPI_VIDEO_DISPLAY_DVI 3 |
| @@ -26,4 +30,3 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type, | |||
| 26 | #endif | 30 | #endif |
| 27 | 31 | ||
| 28 | #endif | 32 | #endif |
| 29 | |||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 8c641bed9bbd..a2776e2807a4 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
| @@ -287,6 +287,8 @@ typedef struct drm_i915_irq_wait { | |||
| 287 | #define I915_PARAM_HAS_EXECBUF2 9 | 287 | #define I915_PARAM_HAS_EXECBUF2 9 |
| 288 | #define I915_PARAM_HAS_BSD 10 | 288 | #define I915_PARAM_HAS_BSD 10 |
| 289 | #define I915_PARAM_HAS_BLT 11 | 289 | #define I915_PARAM_HAS_BLT 11 |
| 290 | #define I915_PARAM_HAS_RELAXED_FENCING 12 | ||
| 291 | #define I915_PARAM_HAS_COHERENT_RINGS 13 | ||
| 290 | 292 | ||
| 291 | typedef struct drm_i915_getparam { | 293 | typedef struct drm_i915_getparam { |
| 292 | int param; | 294 | int param; |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 050a7bccb836..67c91b4418b0 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -219,7 +219,7 @@ static inline int acpi_video_display_switch_support(void) | |||
| 219 | 219 | ||
| 220 | extern int acpi_blacklisted(void); | 220 | extern int acpi_blacklisted(void); |
| 221 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); | 221 | extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d); |
| 222 | extern int acpi_osi_setup(char *str); | 222 | extern void acpi_osi_setup(char *str); |
| 223 | 223 | ||
| 224 | #ifdef CONFIG_ACPI_NUMA | 224 | #ifdef CONFIG_ACPI_NUMA |
| 225 | int acpi_get_pxm(acpi_handle handle); | 225 | int acpi_get_pxm(acpi_handle handle); |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index a065612fc928..64a7114a9394 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -29,6 +29,7 @@ struct linux_binprm{ | |||
| 29 | char buf[BINPRM_BUF_SIZE]; | 29 | char buf[BINPRM_BUF_SIZE]; |
| 30 | #ifdef CONFIG_MMU | 30 | #ifdef CONFIG_MMU |
| 31 | struct vm_area_struct *vma; | 31 | struct vm_area_struct *vma; |
| 32 | unsigned long vma_pages; | ||
| 32 | #else | 33 | #else |
| 33 | # define MAX_ARG_PAGES 32 | 34 | # define MAX_ARG_PAGES 32 |
| 34 | struct page *page[MAX_ARG_PAGES]; | 35 | struct page *page[MAX_ARG_PAGES]; |
| @@ -59,6 +60,10 @@ struct linux_binprm{ | |||
| 59 | unsigned long loader, exec; | 60 | unsigned long loader, exec; |
| 60 | }; | 61 | }; |
| 61 | 62 | ||
| 63 | extern void acct_arg_size(struct linux_binprm *bprm, unsigned long pages); | ||
| 64 | extern struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | ||
| 65 | int write); | ||
| 66 | |||
| 62 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 | 67 | #define BINPRM_FLAGS_ENFORCE_NONDUMP_BIT 0 |
| 63 | #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT) | 68 | #define BINPRM_FLAGS_ENFORCE_NONDUMP (1 << BINPRM_FLAGS_ENFORCE_NONDUMP_BIT) |
| 64 | 69 | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 4823af64e9db..5f09323ee880 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
| @@ -10,11 +10,6 @@ | |||
| 10 | * | 10 | * |
| 11 | * CPUs are exported via sysfs in the class/cpu/devices/ | 11 | * CPUs are exported via sysfs in the class/cpu/devices/ |
| 12 | * directory. | 12 | * directory. |
| 13 | * | ||
| 14 | * Per-cpu interfaces can be implemented using a struct device_interface. | ||
| 15 | * See the following for how to do this: | ||
| 16 | * - drivers/base/intf.c | ||
| 17 | * - Documentation/driver-model/interface.txt | ||
| 18 | */ | 13 | */ |
| 19 | #ifndef _LINUX_CPU_H_ | 14 | #ifndef _LINUX_CPU_H_ |
| 20 | #define _LINUX_CPU_H_ | 15 | #define _LINUX_CPU_H_ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index c9e06cc70dad..090f0eacde29 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -602,6 +602,7 @@ struct address_space_operations { | |||
| 602 | sector_t (*bmap)(struct address_space *, sector_t); | 602 | sector_t (*bmap)(struct address_space *, sector_t); |
| 603 | void (*invalidatepage) (struct page *, unsigned long); | 603 | void (*invalidatepage) (struct page *, unsigned long); |
| 604 | int (*releasepage) (struct page *, gfp_t); | 604 | int (*releasepage) (struct page *, gfp_t); |
| 605 | void (*freepage)(struct page *); | ||
| 605 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 606 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, |
| 606 | loff_t offset, unsigned long nr_segs); | 607 | loff_t offset, unsigned long nr_segs); |
| 607 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | 608 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index e8713d55360a..f54adfcbec9c 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
| @@ -360,7 +360,7 @@ void drain_local_pages(void *dummy); | |||
| 360 | 360 | ||
| 361 | extern gfp_t gfp_allowed_mask; | 361 | extern gfp_t gfp_allowed_mask; |
| 362 | 362 | ||
| 363 | extern void set_gfp_allowed_mask(gfp_t mask); | 363 | extern void pm_restrict_gfp_mask(void); |
| 364 | extern gfp_t clear_gfp_allowed_mask(gfp_t mask); | 364 | extern void pm_restore_gfp_mask(void); |
| 365 | 365 | ||
| 366 | #endif /* __LINUX_GFP_H */ | 366 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index ce73a30113b4..dd1a56fbe924 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
| @@ -16,6 +16,8 @@ struct gpio_keys_button { | |||
| 16 | struct gpio_keys_platform_data { | 16 | struct gpio_keys_platform_data { |
| 17 | struct gpio_keys_button *buttons; | 17 | struct gpio_keys_button *buttons; |
| 18 | int nbuttons; | 18 | int nbuttons; |
| 19 | unsigned int poll_interval; /* polling interval in msecs - | ||
| 20 | for polling driver only */ | ||
| 19 | unsigned int rep:1; /* enable input subsystem auto repeat */ | 21 | unsigned int rep:1; /* enable input subsystem auto repeat */ |
| 20 | int (*enable)(struct device *dev); | 22 | int (*enable)(struct device *dev); |
| 21 | void (*disable)(struct device *dev); | 23 | void (*disable)(struct device *dev); |
diff --git a/include/linux/input.h b/include/linux/input.h index 6ef44465db8d..a8af21d42bc1 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -47,6 +47,25 @@ struct input_id { | |||
| 47 | __u16 version; | 47 | __u16 version; |
| 48 | }; | 48 | }; |
| 49 | 49 | ||
| 50 | /** | ||
| 51 | * struct input_absinfo - used by EVIOCGABS/EVIOCSABS ioctls | ||
| 52 | * @value: latest reported value for the axis. | ||
| 53 | * @minimum: specifies minimum value for the axis. | ||
| 54 | * @maximum: specifies maximum value for the axis. | ||
| 55 | * @fuzz: specifies fuzz value that is used to filter noise from | ||
| 56 | * the event stream. | ||
| 57 | * @flat: values that are within this value will be discarded by | ||
| 58 | * joydev interface and reported as 0 instead. | ||
| 59 | * @resolution: specifies resolution for the values reported for | ||
| 60 | * the axis. | ||
| 61 | * | ||
| 62 | * Note that input core does not clamp reported values to the | ||
| 63 | * [minimum, maximum] limits, such task is left to userspace. | ||
| 64 | * | ||
| 65 | * Resolution for main axes (ABS_X, ABS_Y, ABS_Z) is reported in | ||
| 66 | * units per millimeter (units/mm), resolution for rotational axes | ||
| 67 | * (ABS_RX, ABS_RY, ABS_RZ) is reported in units per radian. | ||
| 68 | */ | ||
| 50 | struct input_absinfo { | 69 | struct input_absinfo { |
| 51 | __s32 value; | 70 | __s32 value; |
| 52 | __s32 minimum; | 71 | __s32 minimum; |
| @@ -624,6 +643,10 @@ struct input_keymap_entry { | |||
| 624 | #define KEY_CAMERA_FOCUS 0x210 | 643 | #define KEY_CAMERA_FOCUS 0x210 |
| 625 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ | 644 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ |
| 626 | 645 | ||
| 646 | #define KEY_TOUCHPAD_TOGGLE 0x212 /* Request switch touchpad on or off */ | ||
| 647 | #define KEY_TOUCHPAD_ON 0x213 | ||
| 648 | #define KEY_TOUCHPAD_OFF 0x214 | ||
| 649 | |||
| 627 | #define BTN_TRIGGER_HAPPY 0x2c0 | 650 | #define BTN_TRIGGER_HAPPY 0x2c0 |
| 628 | #define BTN_TRIGGER_HAPPY1 0x2c0 | 651 | #define BTN_TRIGGER_HAPPY1 0x2c0 |
| 629 | #define BTN_TRIGGER_HAPPY2 0x2c1 | 652 | #define BTN_TRIGGER_HAPPY2 0x2c1 |
| @@ -1130,7 +1153,7 @@ struct input_mt_slot { | |||
| 1130 | * of tracked contacts | 1153 | * of tracked contacts |
| 1131 | * @mtsize: number of MT slots the device uses | 1154 | * @mtsize: number of MT slots the device uses |
| 1132 | * @slot: MT slot currently being transmitted | 1155 | * @slot: MT slot currently being transmitted |
| 1133 | * @absinfo: array of &struct absinfo elements holding information | 1156 | * @absinfo: array of &struct input_absinfo elements holding information |
| 1134 | * about absolute axes (current value, min, max, flat, fuzz, | 1157 | * about absolute axes (current value, min, max, flat, fuzz, |
| 1135 | * resolution) | 1158 | * resolution) |
| 1136 | * @key: reflects current state of device's keys/buttons | 1159 | * @key: reflects current state of device's keys/buttons |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 4307231bd22f..31c237a00c48 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
| @@ -161,6 +161,9 @@ extern void register_page_bootmem_info_node(struct pglist_data *pgdat); | |||
| 161 | extern void put_page_bootmem(struct page *page); | 161 | extern void put_page_bootmem(struct page *page); |
| 162 | #endif | 162 | #endif |
| 163 | 163 | ||
| 164 | void lock_memory_hotplug(void); | ||
| 165 | void unlock_memory_hotplug(void); | ||
| 166 | |||
| 164 | #else /* ! CONFIG_MEMORY_HOTPLUG */ | 167 | #else /* ! CONFIG_MEMORY_HOTPLUG */ |
| 165 | /* | 168 | /* |
| 166 | * Stub functions for when hotplug is off | 169 | * Stub functions for when hotplug is off |
| @@ -192,6 +195,9 @@ static inline void register_page_bootmem_info_node(struct pglist_data *pgdat) | |||
| 192 | { | 195 | { |
| 193 | } | 196 | } |
| 194 | 197 | ||
| 198 | static inline void lock_memory_hotplug(void) {} | ||
| 199 | static inline void unlock_memory_hotplug(void) {} | ||
| 200 | |||
| 195 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ | 201 | #endif /* ! CONFIG_MEMORY_HOTPLUG */ |
| 196 | 202 | ||
| 197 | #ifdef CONFIG_MEMORY_HOTREMOVE | 203 | #ifdef CONFIG_MEMORY_HOTREMOVE |
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h index 5c51f367c061..add8a1b8bcf0 100644 --- a/include/linux/mfd/wm8994/pdata.h +++ b/include/linux/mfd/wm8994/pdata.h | |||
| @@ -29,7 +29,7 @@ struct wm8994_ldo_pdata { | |||
| 29 | #define WM8994_CONFIGURE_GPIO 0x8000 | 29 | #define WM8994_CONFIGURE_GPIO 0x8000 |
| 30 | 30 | ||
| 31 | #define WM8994_DRC_REGS 5 | 31 | #define WM8994_DRC_REGS 5 |
| 32 | #define WM8994_EQ_REGS 19 | 32 | #define WM8994_EQ_REGS 20 |
| 33 | 33 | ||
| 34 | /** | 34 | /** |
| 35 | * DRC configurations are specified with a label and a set of register | 35 | * DRC configurations are specified with a label and a set of register |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index c66fdb7d6998..29d504d5d1c3 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -401,6 +401,7 @@ extern const struct inode_operations nfs3_file_inode_operations; | |||
| 401 | #endif /* CONFIG_NFS_V3 */ | 401 | #endif /* CONFIG_NFS_V3 */ |
| 402 | extern const struct file_operations nfs_file_operations; | 402 | extern const struct file_operations nfs_file_operations; |
| 403 | extern const struct address_space_operations nfs_file_aops; | 403 | extern const struct address_space_operations nfs_file_aops; |
| 404 | extern const struct address_space_operations nfs_dir_aops; | ||
| 404 | 405 | ||
| 405 | static inline struct nfs_open_context *nfs_file_open_context(struct file *filp) | 406 | static inline struct nfs_open_context *nfs_file_open_context(struct file *filp) |
| 406 | { | 407 | { |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index f8b60e7f4c44..d55cee73f634 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
| @@ -29,6 +29,7 @@ | |||
| 29 | */ | 29 | */ |
| 30 | enum { | 30 | enum { |
| 31 | PG_BUSY = 0, | 31 | PG_BUSY = 0, |
| 32 | PG_MAPPED, | ||
| 32 | PG_CLEAN, | 33 | PG_CLEAN, |
| 33 | PG_NEED_COMMIT, | 34 | PG_NEED_COMMIT, |
| 34 | PG_NEED_RESCHED, | 35 | PG_NEED_RESCHED, |
diff --git a/include/linux/node.h b/include/linux/node.h index 06292dac3eab..1466945cc9ef 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
| @@ -10,11 +10,6 @@ | |||
| 10 | * | 10 | * |
| 11 | * Nodes are exported via driverfs in the class/node/devices/ | 11 | * Nodes are exported via driverfs in the class/node/devices/ |
| 12 | * directory. | 12 | * directory. |
| 13 | * | ||
| 14 | * Per-node interfaces can be implemented using a struct device_interface. | ||
| 15 | * See the following for how to do this: | ||
| 16 | * - drivers/base/intf.c | ||
| 17 | * - Documentation/driver-model/interface.txt | ||
| 18 | */ | 13 | */ |
| 19 | #ifndef _LINUX_NODE_H_ | 14 | #ifndef _LINUX_NODE_H_ |
| 20 | #define _LINUX_NODE_H_ | 15 | #define _LINUX_NODE_H_ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index 032d79ff1d9d..54e4eaaa0561 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -366,6 +366,7 @@ struct tty_file_private { | |||
| 366 | #define TTY_HUPPED 18 /* Post driver->hangup() */ | 366 | #define TTY_HUPPED 18 /* Post driver->hangup() */ |
| 367 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ | 367 | #define TTY_FLUSHING 19 /* Flushing to ldisc in progress */ |
| 368 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ | 368 | #define TTY_FLUSHPENDING 20 /* Queued buffer flush pending */ |
| 369 | #define TTY_HUPPING 21 /* ->hangup() in progress */ | ||
| 369 | 370 | ||
| 370 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) | 371 | #define TTY_WRITE_FLUSH(tty) tty_write_flush((tty)) |
| 371 | 372 | ||
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h index d6188e5a52df..665517c05eaf 100644 --- a/include/linux/uio_driver.h +++ b/include/linux/uio_driver.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | * | 3 | * |
| 4 | * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de> | 4 | * Copyright(C) 2005, Benedikt Spranger <b.spranger@linutronix.de> |
| 5 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> | 5 | * Copyright(C) 2005, Thomas Gleixner <tglx@linutronix.de> |
| 6 | * Copyright(C) 2006, Hans J. Koch <hjk@linutronix.de> | 6 | * Copyright(C) 2006, Hans J. Koch <hjk@hansjkoch.de> |
| 7 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> | 7 | * Copyright(C) 2006, Greg Kroah-Hartman <greg@kroah.com> |
| 8 | * | 8 | * |
| 9 | * Userspace IO driver. | 9 | * Userspace IO driver. |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 24300d8a1bc1..a28eb2592577 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -313,6 +313,10 @@ struct usb_bus { | |||
| 313 | int busnum; /* Bus number (in order of reg) */ | 313 | int busnum; /* Bus number (in order of reg) */ |
| 314 | const char *bus_name; /* stable id (PCI slot_name etc) */ | 314 | const char *bus_name; /* stable id (PCI slot_name etc) */ |
| 315 | u8 uses_dma; /* Does the host controller use DMA? */ | 315 | u8 uses_dma; /* Does the host controller use DMA? */ |
| 316 | u8 uses_pio_for_control; /* | ||
| 317 | * Does the host controller use PIO | ||
| 318 | * for control transfers? | ||
| 319 | */ | ||
| 316 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 320 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
| 317 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 321 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
| 318 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 322 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
diff --git a/include/linux/video_output.h b/include/linux/video_output.h index 2fb46bc9340d..ed5cdeb3604d 100644 --- a/include/linux/video_output.h +++ b/include/linux/video_output.h | |||
| @@ -23,6 +23,7 @@ | |||
| 23 | #ifndef _LINUX_VIDEO_OUTPUT_H | 23 | #ifndef _LINUX_VIDEO_OUTPUT_H |
| 24 | #define _LINUX_VIDEO_OUTPUT_H | 24 | #define _LINUX_VIDEO_OUTPUT_H |
| 25 | #include <linux/device.h> | 25 | #include <linux/device.h> |
| 26 | #include <linux/err.h> | ||
| 26 | struct output_device; | 27 | struct output_device; |
| 27 | struct output_properties { | 28 | struct output_properties { |
| 28 | int (*set_state)(struct output_device *); | 29 | int (*set_state)(struct output_device *); |
| @@ -34,9 +35,23 @@ struct output_device { | |||
| 34 | struct device dev; | 35 | struct device dev; |
| 35 | }; | 36 | }; |
| 36 | #define to_output_device(obj) container_of(obj, struct output_device, dev) | 37 | #define to_output_device(obj) container_of(obj, struct output_device, dev) |
| 38 | #if defined(CONFIG_VIDEO_OUTPUT_CONTROL) || defined(CONFIG_VIDEO_OUTPUT_CONTROL_MODULE) | ||
| 37 | struct output_device *video_output_register(const char *name, | 39 | struct output_device *video_output_register(const char *name, |
| 38 | struct device *dev, | 40 | struct device *dev, |
| 39 | void *devdata, | 41 | void *devdata, |
| 40 | struct output_properties *op); | 42 | struct output_properties *op); |
| 41 | void video_output_unregister(struct output_device *dev); | 43 | void video_output_unregister(struct output_device *dev); |
| 44 | #else | ||
| 45 | static struct output_device *video_output_register(const char *name, | ||
| 46 | struct device *dev, | ||
| 47 | void *devdata, | ||
| 48 | struct output_properties *op) | ||
| 49 | { | ||
| 50 | return ERR_PTR(-ENODEV); | ||
| 51 | } | ||
| 52 | static void video_output_unregister(struct output_device *dev) | ||
| 53 | { | ||
| 54 | return; | ||
| 55 | } | ||
| 56 | #endif | ||
| 42 | #endif | 57 | #endif |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index a03dcf62ca9d..44b54f619ac6 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -7,8 +7,6 @@ | |||
| 7 | 7 | ||
| 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ | 8 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
| 9 | 9 | ||
| 10 | extern bool vmap_lazy_unmap; | ||
| 11 | |||
| 12 | /* bits in flags of vmalloc's vm_struct below */ | 10 | /* bits in flags of vmalloc's vm_struct below */ |
| 13 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 11 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
| 14 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 12 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h index 41dd480e45f1..239125af3ea3 100644 --- a/include/media/v4l2-common.h +++ b/include/media/v4l2-common.h | |||
| @@ -137,31 +137,27 @@ struct v4l2_subdev_ops; | |||
| 137 | 137 | ||
| 138 | 138 | ||
| 139 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 139 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
| 140 | Only call request_module if module_name != NULL. | ||
| 141 | The client_type argument is the name of the chip that's on the adapter. */ | 140 | The client_type argument is the name of the chip that's on the adapter. */ |
| 142 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, | 141 | struct v4l2_subdev *v4l2_i2c_new_subdev_cfg(struct v4l2_device *v4l2_dev, |
| 143 | struct i2c_adapter *adapter, | 142 | struct i2c_adapter *adapter, const char *client_type, |
| 144 | const char *module_name, const char *client_type, | ||
| 145 | int irq, void *platform_data, | 143 | int irq, void *platform_data, |
| 146 | u8 addr, const unsigned short *probe_addrs); | 144 | u8 addr, const unsigned short *probe_addrs); |
| 147 | 145 | ||
| 148 | /* Load an i2c module and return an initialized v4l2_subdev struct. | 146 | /* Load an i2c module and return an initialized v4l2_subdev struct. |
| 149 | Only call request_module if module_name != NULL. | ||
| 150 | The client_type argument is the name of the chip that's on the adapter. */ | 147 | The client_type argument is the name of the chip that's on the adapter. */ |
| 151 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, | 148 | static inline struct v4l2_subdev *v4l2_i2c_new_subdev(struct v4l2_device *v4l2_dev, |
| 152 | struct i2c_adapter *adapter, | 149 | struct i2c_adapter *adapter, const char *client_type, |
| 153 | const char *module_name, const char *client_type, | ||
| 154 | u8 addr, const unsigned short *probe_addrs) | 150 | u8 addr, const unsigned short *probe_addrs) |
| 155 | { | 151 | { |
| 156 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, module_name, | 152 | return v4l2_i2c_new_subdev_cfg(v4l2_dev, adapter, client_type, 0, NULL, |
| 157 | client_type, 0, NULL, addr, probe_addrs); | 153 | addr, probe_addrs); |
| 158 | } | 154 | } |
| 159 | 155 | ||
| 160 | struct i2c_board_info; | 156 | struct i2c_board_info; |
| 161 | 157 | ||
| 162 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, | 158 | struct v4l2_subdev *v4l2_i2c_new_subdev_board(struct v4l2_device *v4l2_dev, |
| 163 | struct i2c_adapter *adapter, const char *module_name, | 159 | struct i2c_adapter *adapter, struct i2c_board_info *info, |
| 164 | struct i2c_board_info *info, const unsigned short *probe_addrs); | 160 | const unsigned short *probe_addrs); |
| 165 | 161 | ||
| 166 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ | 162 | /* Initialize an v4l2_subdev with data from an i2c_client struct */ |
| 167 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, | 163 | void v4l2_i2c_subdev_init(struct v4l2_subdev *sd, struct i2c_client *client, |
diff --git a/include/xen/events.h b/include/xen/events.h index 646dd17d3aa4..00f53ddcc062 100644 --- a/include/xen/events.h +++ b/include/xen/events.h | |||
| @@ -76,7 +76,9 @@ int xen_map_pirq_gsi(unsigned pirq, unsigned gsi, int shareable, char *name); | |||
| 76 | 76 | ||
| 77 | #ifdef CONFIG_PCI_MSI | 77 | #ifdef CONFIG_PCI_MSI |
| 78 | /* Allocate an irq and a pirq to be used with MSIs. */ | 78 | /* Allocate an irq and a pirq to be used with MSIs. */ |
| 79 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq); | 79 | #define XEN_ALLOC_PIRQ (1 << 0) |
| 80 | #define XEN_ALLOC_IRQ (1 << 1) | ||
| 81 | void xen_allocate_pirq_msi(char *name, int *irq, int *pirq, int alloc_mask); | ||
| 80 | int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type); | 82 | int xen_create_msi_irq(struct pci_dev *dev, struct msi_desc *msidesc, int type); |
| 81 | #endif | 83 | #endif |
| 82 | 84 | ||
| @@ -89,4 +91,7 @@ int xen_vector_from_irq(unsigned pirq); | |||
| 89 | /* Return gsi allocated to pirq */ | 91 | /* Return gsi allocated to pirq */ |
| 90 | int xen_gsi_from_irq(unsigned pirq); | 92 | int xen_gsi_from_irq(unsigned pirq); |
| 91 | 93 | ||
| 94 | /* Return irq from pirq */ | ||
| 95 | int xen_irq_from_pirq(unsigned pirq); | ||
| 96 | |||
| 92 | #endif /* _XEN_EVENTS_H */ | 97 | #endif /* _XEN_EVENTS_H */ |
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h index 2b2c66c3df00..534cac89a77d 100644 --- a/include/xen/interface/physdev.h +++ b/include/xen/interface/physdev.h | |||
| @@ -188,6 +188,16 @@ struct physdev_nr_pirqs { | |||
| 188 | uint32_t nr_pirqs; | 188 | uint32_t nr_pirqs; |
| 189 | }; | 189 | }; |
| 190 | 190 | ||
| 191 | /* type is MAP_PIRQ_TYPE_GSI or MAP_PIRQ_TYPE_MSI | ||
| 192 | * the hypercall returns a free pirq */ | ||
| 193 | #define PHYSDEVOP_get_free_pirq 23 | ||
| 194 | struct physdev_get_free_pirq { | ||
| 195 | /* IN */ | ||
| 196 | int type; | ||
| 197 | /* OUT */ | ||
| 198 | uint32_t pirq; | ||
| 199 | }; | ||
| 200 | |||
| 191 | /* | 201 | /* |
| 192 | * Notify that some PIRQ-bound event channels have been unmasked. | 202 | * Notify that some PIRQ-bound event channels have been unmasked. |
| 193 | * ** This command is obsolete since interface version 0x00030202 and is ** | 203 | * ** This command is obsolete since interface version 0x00030202 and is ** |
diff --git a/kernel/exit.c b/kernel/exit.c index 21aa7b3001fb..676149a4ac5f 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
| @@ -914,6 +914,15 @@ NORET_TYPE void do_exit(long code) | |||
| 914 | if (unlikely(!tsk->pid)) | 914 | if (unlikely(!tsk->pid)) |
| 915 | panic("Attempted to kill the idle task!"); | 915 | panic("Attempted to kill the idle task!"); |
| 916 | 916 | ||
| 917 | /* | ||
| 918 | * If do_exit is called because this processes oopsed, it's possible | ||
| 919 | * that get_fs() was left as KERNEL_DS, so reset it to USER_DS before | ||
| 920 | * continuing. Amongst other possible reasons, this is to prevent | ||
| 921 | * mm_release()->clear_child_tid() from writing to a user-controlled | ||
| 922 | * kernel address. | ||
| 923 | */ | ||
| 924 | set_fs(USER_DS); | ||
| 925 | |||
| 917 | tracehook_report_exit(&code); | 926 | tracehook_report_exit(&code); |
| 918 | 927 | ||
| 919 | validate_creds_for_do_exit(tsk); | 928 | validate_creds_for_do_exit(tsk); |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 01b1d3a88983..6c8a2a9f8a7b 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
| @@ -214,7 +214,7 @@ static int irq_spurious_proc_show(struct seq_file *m, void *v) | |||
| 214 | 214 | ||
| 215 | static int irq_spurious_proc_open(struct inode *inode, struct file *file) | 215 | static int irq_spurious_proc_open(struct inode *inode, struct file *file) |
| 216 | { | 216 | { |
| 217 | return single_open(file, irq_spurious_proc_show, NULL); | 217 | return single_open(file, irq_spurious_proc_show, PDE(inode)->data); |
| 218 | } | 218 | } |
| 219 | 219 | ||
| 220 | static const struct file_operations irq_spurious_proc_fops = { | 220 | static const struct file_operations irq_spurious_proc_fops = { |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index 657272e91d0a..048d0b514831 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
| @@ -327,7 +327,6 @@ static int create_image(int platform_mode) | |||
| 327 | int hibernation_snapshot(int platform_mode) | 327 | int hibernation_snapshot(int platform_mode) |
| 328 | { | 328 | { |
| 329 | int error; | 329 | int error; |
| 330 | gfp_t saved_mask; | ||
| 331 | 330 | ||
| 332 | error = platform_begin(platform_mode); | 331 | error = platform_begin(platform_mode); |
| 333 | if (error) | 332 | if (error) |
| @@ -339,7 +338,7 @@ int hibernation_snapshot(int platform_mode) | |||
| 339 | goto Close; | 338 | goto Close; |
| 340 | 339 | ||
| 341 | suspend_console(); | 340 | suspend_console(); |
| 342 | saved_mask = clear_gfp_allowed_mask(GFP_IOFS); | 341 | pm_restrict_gfp_mask(); |
| 343 | error = dpm_suspend_start(PMSG_FREEZE); | 342 | error = dpm_suspend_start(PMSG_FREEZE); |
| 344 | if (error) | 343 | if (error) |
| 345 | goto Recover_platform; | 344 | goto Recover_platform; |
| @@ -348,7 +347,10 @@ int hibernation_snapshot(int platform_mode) | |||
| 348 | goto Recover_platform; | 347 | goto Recover_platform; |
| 349 | 348 | ||
| 350 | error = create_image(platform_mode); | 349 | error = create_image(platform_mode); |
| 351 | /* Control returns here after successful restore */ | 350 | /* |
| 351 | * Control returns here (1) after the image has been created or the | ||
| 352 | * image creation has failed and (2) after a successful restore. | ||
| 353 | */ | ||
| 352 | 354 | ||
| 353 | Resume_devices: | 355 | Resume_devices: |
| 354 | /* We may need to release the preallocated image pages here. */ | 356 | /* We may need to release the preallocated image pages here. */ |
| @@ -357,7 +359,10 @@ int hibernation_snapshot(int platform_mode) | |||
| 357 | 359 | ||
| 358 | dpm_resume_end(in_suspend ? | 360 | dpm_resume_end(in_suspend ? |
| 359 | (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE); | 361 | (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE); |
| 360 | set_gfp_allowed_mask(saved_mask); | 362 | |
| 363 | if (error || !in_suspend) | ||
| 364 | pm_restore_gfp_mask(); | ||
| 365 | |||
| 361 | resume_console(); | 366 | resume_console(); |
| 362 | Close: | 367 | Close: |
| 363 | platform_end(platform_mode); | 368 | platform_end(platform_mode); |
| @@ -452,17 +457,16 @@ static int resume_target_kernel(bool platform_mode) | |||
| 452 | int hibernation_restore(int platform_mode) | 457 | int hibernation_restore(int platform_mode) |
| 453 | { | 458 | { |
| 454 | int error; | 459 | int error; |
| 455 | gfp_t saved_mask; | ||
| 456 | 460 | ||
| 457 | pm_prepare_console(); | 461 | pm_prepare_console(); |
| 458 | suspend_console(); | 462 | suspend_console(); |
| 459 | saved_mask = clear_gfp_allowed_mask(GFP_IOFS); | 463 | pm_restrict_gfp_mask(); |
| 460 | error = dpm_suspend_start(PMSG_QUIESCE); | 464 | error = dpm_suspend_start(PMSG_QUIESCE); |
| 461 | if (!error) { | 465 | if (!error) { |
| 462 | error = resume_target_kernel(platform_mode); | 466 | error = resume_target_kernel(platform_mode); |
| 463 | dpm_resume_end(PMSG_RECOVER); | 467 | dpm_resume_end(PMSG_RECOVER); |
| 464 | } | 468 | } |
| 465 | set_gfp_allowed_mask(saved_mask); | 469 | pm_restore_gfp_mask(); |
| 466 | resume_console(); | 470 | resume_console(); |
| 467 | pm_restore_console(); | 471 | pm_restore_console(); |
| 468 | return error; | 472 | return error; |
| @@ -476,7 +480,6 @@ int hibernation_restore(int platform_mode) | |||
| 476 | int hibernation_platform_enter(void) | 480 | int hibernation_platform_enter(void) |
| 477 | { | 481 | { |
| 478 | int error; | 482 | int error; |
| 479 | gfp_t saved_mask; | ||
| 480 | 483 | ||
| 481 | if (!hibernation_ops) | 484 | if (!hibernation_ops) |
| 482 | return -ENOSYS; | 485 | return -ENOSYS; |
| @@ -492,7 +495,6 @@ int hibernation_platform_enter(void) | |||
| 492 | 495 | ||
| 493 | entering_platform_hibernation = true; | 496 | entering_platform_hibernation = true; |
| 494 | suspend_console(); | 497 | suspend_console(); |
| 495 | saved_mask = clear_gfp_allowed_mask(GFP_IOFS); | ||
| 496 | error = dpm_suspend_start(PMSG_HIBERNATE); | 498 | error = dpm_suspend_start(PMSG_HIBERNATE); |
| 497 | if (error) { | 499 | if (error) { |
| 498 | if (hibernation_ops->recover) | 500 | if (hibernation_ops->recover) |
| @@ -536,7 +538,6 @@ int hibernation_platform_enter(void) | |||
| 536 | Resume_devices: | 538 | Resume_devices: |
| 537 | entering_platform_hibernation = false; | 539 | entering_platform_hibernation = false; |
| 538 | dpm_resume_end(PMSG_RESTORE); | 540 | dpm_resume_end(PMSG_RESTORE); |
| 539 | set_gfp_allowed_mask(saved_mask); | ||
| 540 | resume_console(); | 541 | resume_console(); |
| 541 | 542 | ||
| 542 | Close: | 543 | Close: |
| @@ -646,6 +647,7 @@ int hibernate(void) | |||
| 646 | swsusp_free(); | 647 | swsusp_free(); |
| 647 | if (!error) | 648 | if (!error) |
| 648 | power_down(); | 649 | power_down(); |
| 650 | pm_restore_gfp_mask(); | ||
| 649 | } else { | 651 | } else { |
| 650 | pr_debug("PM: Image restored successfully.\n"); | 652 | pr_debug("PM: Image restored successfully.\n"); |
| 651 | } | 653 | } |
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c index 7335952ee473..ecf770509d0d 100644 --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c | |||
| @@ -197,7 +197,6 @@ static int suspend_enter(suspend_state_t state) | |||
| 197 | int suspend_devices_and_enter(suspend_state_t state) | 197 | int suspend_devices_and_enter(suspend_state_t state) |
| 198 | { | 198 | { |
| 199 | int error; | 199 | int error; |
| 200 | gfp_t saved_mask; | ||
| 201 | 200 | ||
| 202 | if (!suspend_ops) | 201 | if (!suspend_ops) |
| 203 | return -ENOSYS; | 202 | return -ENOSYS; |
| @@ -208,7 +207,7 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
| 208 | goto Close; | 207 | goto Close; |
| 209 | } | 208 | } |
| 210 | suspend_console(); | 209 | suspend_console(); |
| 211 | saved_mask = clear_gfp_allowed_mask(GFP_IOFS); | 210 | pm_restrict_gfp_mask(); |
| 212 | suspend_test_start(); | 211 | suspend_test_start(); |
| 213 | error = dpm_suspend_start(PMSG_SUSPEND); | 212 | error = dpm_suspend_start(PMSG_SUSPEND); |
| 214 | if (error) { | 213 | if (error) { |
| @@ -225,7 +224,7 @@ int suspend_devices_and_enter(suspend_state_t state) | |||
| 225 | suspend_test_start(); | 224 | suspend_test_start(); |
| 226 | dpm_resume_end(PMSG_RESUME); | 225 | dpm_resume_end(PMSG_RESUME); |
| 227 | suspend_test_finish("resume devices"); | 226 | suspend_test_finish("resume devices"); |
| 228 | set_gfp_allowed_mask(saved_mask); | 227 | pm_restore_gfp_mask(); |
| 229 | resume_console(); | 228 | resume_console(); |
| 230 | Close: | 229 | Close: |
| 231 | if (suspend_ops->end) | 230 | if (suspend_ops->end) |
diff --git a/kernel/power/swap.c b/kernel/power/swap.c index a0e4a86ccf94..baf667bb2794 100644 --- a/kernel/power/swap.c +++ b/kernel/power/swap.c | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | * | 6 | * |
| 7 | * Copyright (C) 1998,2001-2005 Pavel Machek <pavel@ucw.cz> | 7 | * Copyright (C) 1998,2001-2005 Pavel Machek <pavel@ucw.cz> |
| 8 | * Copyright (C) 2006 Rafael J. Wysocki <rjw@sisk.pl> | 8 | * Copyright (C) 2006 Rafael J. Wysocki <rjw@sisk.pl> |
| 9 | * Copyright (C) 2010 Bojan Smojver <bojan@rexursive.com> | ||
| 9 | * | 10 | * |
| 10 | * This file is released under the GPLv2. | 11 | * This file is released under the GPLv2. |
| 11 | * | 12 | * |
| @@ -753,30 +754,43 @@ static int load_image_lzo(struct swap_map_handle *handle, | |||
| 753 | { | 754 | { |
| 754 | unsigned int m; | 755 | unsigned int m; |
| 755 | int error = 0; | 756 | int error = 0; |
| 757 | struct bio *bio; | ||
| 756 | struct timeval start; | 758 | struct timeval start; |
| 757 | struct timeval stop; | 759 | struct timeval stop; |
| 758 | unsigned nr_pages; | 760 | unsigned nr_pages; |
| 759 | size_t off, unc_len, cmp_len; | 761 | size_t i, off, unc_len, cmp_len; |
| 760 | unsigned char *unc, *cmp, *page; | 762 | unsigned char *unc, *cmp, *page[LZO_CMP_PAGES]; |
| 761 | 763 | ||
| 762 | page = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH); | 764 | for (i = 0; i < LZO_CMP_PAGES; i++) { |
| 763 | if (!page) { | 765 | page[i] = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH); |
| 764 | printk(KERN_ERR "PM: Failed to allocate LZO page\n"); | 766 | if (!page[i]) { |
| 765 | return -ENOMEM; | 767 | printk(KERN_ERR "PM: Failed to allocate LZO page\n"); |
| 768 | |||
| 769 | while (i) | ||
| 770 | free_page((unsigned long)page[--i]); | ||
| 771 | |||
| 772 | return -ENOMEM; | ||
| 773 | } | ||
| 766 | } | 774 | } |
| 767 | 775 | ||
| 768 | unc = vmalloc(LZO_UNC_SIZE); | 776 | unc = vmalloc(LZO_UNC_SIZE); |
| 769 | if (!unc) { | 777 | if (!unc) { |
| 770 | printk(KERN_ERR "PM: Failed to allocate LZO uncompressed\n"); | 778 | printk(KERN_ERR "PM: Failed to allocate LZO uncompressed\n"); |
| 771 | free_page((unsigned long)page); | 779 | |
| 780 | for (i = 0; i < LZO_CMP_PAGES; i++) | ||
| 781 | free_page((unsigned long)page[i]); | ||
| 782 | |||
| 772 | return -ENOMEM; | 783 | return -ENOMEM; |
| 773 | } | 784 | } |
| 774 | 785 | ||
| 775 | cmp = vmalloc(LZO_CMP_SIZE); | 786 | cmp = vmalloc(LZO_CMP_SIZE); |
| 776 | if (!cmp) { | 787 | if (!cmp) { |
| 777 | printk(KERN_ERR "PM: Failed to allocate LZO compressed\n"); | 788 | printk(KERN_ERR "PM: Failed to allocate LZO compressed\n"); |
| 789 | |||
| 778 | vfree(unc); | 790 | vfree(unc); |
| 779 | free_page((unsigned long)page); | 791 | for (i = 0; i < LZO_CMP_PAGES; i++) |
| 792 | free_page((unsigned long)page[i]); | ||
| 793 | |||
| 780 | return -ENOMEM; | 794 | return -ENOMEM; |
| 781 | } | 795 | } |
| 782 | 796 | ||
| @@ -787,6 +801,7 @@ static int load_image_lzo(struct swap_map_handle *handle, | |||
| 787 | if (!m) | 801 | if (!m) |
| 788 | m = 1; | 802 | m = 1; |
| 789 | nr_pages = 0; | 803 | nr_pages = 0; |
| 804 | bio = NULL; | ||
| 790 | do_gettimeofday(&start); | 805 | do_gettimeofday(&start); |
| 791 | 806 | ||
| 792 | error = snapshot_write_next(snapshot); | 807 | error = snapshot_write_next(snapshot); |
| @@ -794,11 +809,11 @@ static int load_image_lzo(struct swap_map_handle *handle, | |||
| 794 | goto out_finish; | 809 | goto out_finish; |
| 795 | 810 | ||
| 796 | for (;;) { | 811 | for (;;) { |
| 797 | error = swap_read_page(handle, page, NULL); /* sync */ | 812 | error = swap_read_page(handle, page[0], NULL); /* sync */ |
| 798 | if (error) | 813 | if (error) |
| 799 | break; | 814 | break; |
| 800 | 815 | ||
| 801 | cmp_len = *(size_t *)page; | 816 | cmp_len = *(size_t *)page[0]; |
| 802 | if (unlikely(!cmp_len || | 817 | if (unlikely(!cmp_len || |
| 803 | cmp_len > lzo1x_worst_compress(LZO_UNC_SIZE))) { | 818 | cmp_len > lzo1x_worst_compress(LZO_UNC_SIZE))) { |
| 804 | printk(KERN_ERR "PM: Invalid LZO compressed length\n"); | 819 | printk(KERN_ERR "PM: Invalid LZO compressed length\n"); |
| @@ -806,13 +821,20 @@ static int load_image_lzo(struct swap_map_handle *handle, | |||
| 806 | break; | 821 | break; |
| 807 | } | 822 | } |
| 808 | 823 | ||
| 809 | memcpy(cmp, page, PAGE_SIZE); | 824 | for (off = PAGE_SIZE, i = 1; |
| 810 | for (off = PAGE_SIZE; off < LZO_HEADER + cmp_len; off += PAGE_SIZE) { | 825 | off < LZO_HEADER + cmp_len; off += PAGE_SIZE, i++) { |
| 811 | error = swap_read_page(handle, page, NULL); /* sync */ | 826 | error = swap_read_page(handle, page[i], &bio); |
| 812 | if (error) | 827 | if (error) |
| 813 | goto out_finish; | 828 | goto out_finish; |
| 829 | } | ||
| 814 | 830 | ||
| 815 | memcpy(cmp + off, page, PAGE_SIZE); | 831 | error = hib_wait_on_bio_chain(&bio); /* need all data now */ |
| 832 | if (error) | ||
| 833 | goto out_finish; | ||
| 834 | |||
| 835 | for (off = 0, i = 0; | ||
| 836 | off < LZO_HEADER + cmp_len; off += PAGE_SIZE, i++) { | ||
| 837 | memcpy(cmp + off, page[i], PAGE_SIZE); | ||
| 816 | } | 838 | } |
| 817 | 839 | ||
| 818 | unc_len = LZO_UNC_SIZE; | 840 | unc_len = LZO_UNC_SIZE; |
| @@ -857,7 +879,8 @@ out_finish: | |||
| 857 | 879 | ||
| 858 | vfree(cmp); | 880 | vfree(cmp); |
| 859 | vfree(unc); | 881 | vfree(unc); |
| 860 | free_page((unsigned long)page); | 882 | for (i = 0; i < LZO_CMP_PAGES; i++) |
| 883 | free_page((unsigned long)page[i]); | ||
| 861 | 884 | ||
| 862 | return error; | 885 | return error; |
| 863 | } | 886 | } |
diff --git a/kernel/power/user.c b/kernel/power/user.c index e819e17877ca..1b2ea31e6bd8 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
| @@ -263,6 +263,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 263 | case SNAPSHOT_UNFREEZE: | 263 | case SNAPSHOT_UNFREEZE: |
| 264 | if (!data->frozen || data->ready) | 264 | if (!data->frozen || data->ready) |
| 265 | break; | 265 | break; |
| 266 | pm_restore_gfp_mask(); | ||
| 266 | thaw_processes(); | 267 | thaw_processes(); |
| 267 | usermodehelper_enable(); | 268 | usermodehelper_enable(); |
| 268 | data->frozen = 0; | 269 | data->frozen = 0; |
| @@ -275,6 +276,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd, | |||
| 275 | error = -EPERM; | 276 | error = -EPERM; |
| 276 | break; | 277 | break; |
| 277 | } | 278 | } |
| 279 | pm_restore_gfp_mask(); | ||
| 278 | error = hibernation_snapshot(data->platform_support); | 280 | error = hibernation_snapshot(data->platform_support); |
| 279 | if (!error) | 281 | if (!error) |
| 280 | error = put_user(in_suspend, (int __user *)arg); | 282 | error = put_user(in_suspend, (int __user *)arg); |
diff --git a/kernel/printk.c b/kernel/printk.c index 9a2264fc42ca..a23315dc4498 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
| @@ -1082,13 +1082,15 @@ void printk_tick(void) | |||
| 1082 | 1082 | ||
| 1083 | int printk_needs_cpu(int cpu) | 1083 | int printk_needs_cpu(int cpu) |
| 1084 | { | 1084 | { |
| 1085 | if (unlikely(cpu_is_offline(cpu))) | ||
| 1086 | printk_tick(); | ||
| 1085 | return per_cpu(printk_pending, cpu); | 1087 | return per_cpu(printk_pending, cpu); |
| 1086 | } | 1088 | } |
| 1087 | 1089 | ||
| 1088 | void wake_up_klogd(void) | 1090 | void wake_up_klogd(void) |
| 1089 | { | 1091 | { |
| 1090 | if (waitqueue_active(&log_wait)) | 1092 | if (waitqueue_active(&log_wait)) |
| 1091 | __raw_get_cpu_var(printk_pending) = 1; | 1093 | this_cpu_write(printk_pending, 1); |
| 1092 | } | 1094 | } |
| 1093 | 1095 | ||
| 1094 | /** | 1096 | /** |
diff --git a/mm/filemap.c b/mm/filemap.c index ea89840fc65f..6b9aee20f242 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
| @@ -143,13 +143,18 @@ void __remove_from_page_cache(struct page *page) | |||
| 143 | void remove_from_page_cache(struct page *page) | 143 | void remove_from_page_cache(struct page *page) |
| 144 | { | 144 | { |
| 145 | struct address_space *mapping = page->mapping; | 145 | struct address_space *mapping = page->mapping; |
| 146 | void (*freepage)(struct page *); | ||
| 146 | 147 | ||
| 147 | BUG_ON(!PageLocked(page)); | 148 | BUG_ON(!PageLocked(page)); |
| 148 | 149 | ||
| 150 | freepage = mapping->a_ops->freepage; | ||
| 149 | spin_lock_irq(&mapping->tree_lock); | 151 | spin_lock_irq(&mapping->tree_lock); |
| 150 | __remove_from_page_cache(page); | 152 | __remove_from_page_cache(page); |
| 151 | spin_unlock_irq(&mapping->tree_lock); | 153 | spin_unlock_irq(&mapping->tree_lock); |
| 152 | mem_cgroup_uncharge_cache_page(page); | 154 | mem_cgroup_uncharge_cache_page(page); |
| 155 | |||
| 156 | if (freepage) | ||
| 157 | freepage(page); | ||
| 153 | } | 158 | } |
| 154 | EXPORT_SYMBOL(remove_from_page_cache); | 159 | EXPORT_SYMBOL(remove_from_page_cache); |
| 155 | 160 | ||
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c4a3558589ab..85855240933d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c | |||
| @@ -2738,7 +2738,8 @@ out_page_table_lock: | |||
| 2738 | unlock_page(pagecache_page); | 2738 | unlock_page(pagecache_page); |
| 2739 | put_page(pagecache_page); | 2739 | put_page(pagecache_page); |
| 2740 | } | 2740 | } |
| 2741 | unlock_page(page); | 2741 | if (page != pagecache_page) |
| 2742 | unlock_page(page); | ||
| 2742 | 2743 | ||
| 2743 | out_mutex: | 2744 | out_mutex: |
| 2744 | mutex_unlock(&hugetlb_instantiation_mutex); | 2745 | mutex_unlock(&hugetlb_instantiation_mutex); |
| @@ -1724,8 +1724,13 @@ static int ksm_memory_callback(struct notifier_block *self, | |||
| 1724 | /* | 1724 | /* |
| 1725 | * Keep it very simple for now: just lock out ksmd and | 1725 | * Keep it very simple for now: just lock out ksmd and |
| 1726 | * MADV_UNMERGEABLE while any memory is going offline. | 1726 | * MADV_UNMERGEABLE while any memory is going offline. |
| 1727 | * mutex_lock_nested() is necessary because lockdep was alarmed | ||
| 1728 | * that here we take ksm_thread_mutex inside notifier chain | ||
| 1729 | * mutex, and later take notifier chain mutex inside | ||
| 1730 | * ksm_thread_mutex to unlock it. But that's safe because both | ||
| 1731 | * are inside mem_hotplug_mutex. | ||
| 1727 | */ | 1732 | */ |
| 1728 | mutex_lock(&ksm_thread_mutex); | 1733 | mutex_lock_nested(&ksm_thread_mutex, SINGLE_DEPTH_NESTING); |
| 1729 | break; | 1734 | break; |
| 1730 | 1735 | ||
| 1731 | case MEM_OFFLINE: | 1736 | case MEM_OFFLINE: |
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index 124324134ff6..46ab2c044b0e 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c | |||
| @@ -51,6 +51,7 @@ | |||
| 51 | #include <linux/slab.h> | 51 | #include <linux/slab.h> |
| 52 | #include <linux/swapops.h> | 52 | #include <linux/swapops.h> |
| 53 | #include <linux/hugetlb.h> | 53 | #include <linux/hugetlb.h> |
| 54 | #include <linux/memory_hotplug.h> | ||
| 54 | #include "internal.h" | 55 | #include "internal.h" |
| 55 | 56 | ||
| 56 | int sysctl_memory_failure_early_kill __read_mostly = 0; | 57 | int sysctl_memory_failure_early_kill __read_mostly = 0; |
| @@ -1230,11 +1231,10 @@ static int get_any_page(struct page *p, unsigned long pfn, int flags) | |||
| 1230 | return 1; | 1231 | return 1; |
| 1231 | 1232 | ||
| 1232 | /* | 1233 | /* |
| 1233 | * The lock_system_sleep prevents a race with memory hotplug, | 1234 | * The lock_memory_hotplug prevents a race with memory hotplug. |
| 1234 | * because the isolation assumes there's only a single user. | ||
| 1235 | * This is a big hammer, a better would be nicer. | 1235 | * This is a big hammer, a better would be nicer. |
| 1236 | */ | 1236 | */ |
| 1237 | lock_system_sleep(); | 1237 | lock_memory_hotplug(); |
| 1238 | 1238 | ||
| 1239 | /* | 1239 | /* |
| 1240 | * Isolate the page, so that it doesn't get reallocated if it | 1240 | * Isolate the page, so that it doesn't get reallocated if it |
| @@ -1264,7 +1264,7 @@ static int get_any_page(struct page *p, unsigned long pfn, int flags) | |||
| 1264 | ret = 1; | 1264 | ret = 1; |
| 1265 | } | 1265 | } |
| 1266 | unset_migratetype_isolate(p); | 1266 | unset_migratetype_isolate(p); |
| 1267 | unlock_system_sleep(); | 1267 | unlock_memory_hotplug(); |
| 1268 | return ret; | 1268 | return ret; |
| 1269 | } | 1269 | } |
| 1270 | 1270 | ||
diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 9260314a221e..2c6523af5473 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c | |||
| @@ -34,6 +34,23 @@ | |||
| 34 | 34 | ||
| 35 | #include "internal.h" | 35 | #include "internal.h" |
| 36 | 36 | ||
| 37 | DEFINE_MUTEX(mem_hotplug_mutex); | ||
| 38 | |||
| 39 | void lock_memory_hotplug(void) | ||
| 40 | { | ||
| 41 | mutex_lock(&mem_hotplug_mutex); | ||
| 42 | |||
| 43 | /* for exclusive hibernation if CONFIG_HIBERNATION=y */ | ||
| 44 | lock_system_sleep(); | ||
| 45 | } | ||
| 46 | |||
| 47 | void unlock_memory_hotplug(void) | ||
| 48 | { | ||
| 49 | unlock_system_sleep(); | ||
| 50 | mutex_unlock(&mem_hotplug_mutex); | ||
| 51 | } | ||
| 52 | |||
| 53 | |||
| 37 | /* add this memory to iomem resource */ | 54 | /* add this memory to iomem resource */ |
| 38 | static struct resource *register_memory_resource(u64 start, u64 size) | 55 | static struct resource *register_memory_resource(u64 start, u64 size) |
| 39 | { | 56 | { |
| @@ -493,7 +510,7 @@ int mem_online_node(int nid) | |||
| 493 | pg_data_t *pgdat; | 510 | pg_data_t *pgdat; |
| 494 | int ret; | 511 | int ret; |
| 495 | 512 | ||
| 496 | lock_system_sleep(); | 513 | lock_memory_hotplug(); |
| 497 | pgdat = hotadd_new_pgdat(nid, 0); | 514 | pgdat = hotadd_new_pgdat(nid, 0); |
| 498 | if (pgdat) { | 515 | if (pgdat) { |
| 499 | ret = -ENOMEM; | 516 | ret = -ENOMEM; |
| @@ -504,7 +521,7 @@ int mem_online_node(int nid) | |||
| 504 | BUG_ON(ret); | 521 | BUG_ON(ret); |
| 505 | 522 | ||
| 506 | out: | 523 | out: |
| 507 | unlock_system_sleep(); | 524 | unlock_memory_hotplug(); |
| 508 | return ret; | 525 | return ret; |
| 509 | } | 526 | } |
| 510 | 527 | ||
| @@ -516,7 +533,7 @@ int __ref add_memory(int nid, u64 start, u64 size) | |||
| 516 | struct resource *res; | 533 | struct resource *res; |
| 517 | int ret; | 534 | int ret; |
| 518 | 535 | ||
| 519 | lock_system_sleep(); | 536 | lock_memory_hotplug(); |
| 520 | 537 | ||
| 521 | res = register_memory_resource(start, size); | 538 | res = register_memory_resource(start, size); |
| 522 | ret = -EEXIST; | 539 | ret = -EEXIST; |
| @@ -563,7 +580,7 @@ error: | |||
| 563 | release_memory_resource(res); | 580 | release_memory_resource(res); |
| 564 | 581 | ||
| 565 | out: | 582 | out: |
| 566 | unlock_system_sleep(); | 583 | unlock_memory_hotplug(); |
| 567 | return ret; | 584 | return ret; |
| 568 | } | 585 | } |
| 569 | EXPORT_SYMBOL_GPL(add_memory); | 586 | EXPORT_SYMBOL_GPL(add_memory); |
| @@ -791,7 +808,7 @@ static int offline_pages(unsigned long start_pfn, | |||
| 791 | if (!test_pages_in_a_zone(start_pfn, end_pfn)) | 808 | if (!test_pages_in_a_zone(start_pfn, end_pfn)) |
| 792 | return -EINVAL; | 809 | return -EINVAL; |
| 793 | 810 | ||
| 794 | lock_system_sleep(); | 811 | lock_memory_hotplug(); |
| 795 | 812 | ||
| 796 | zone = page_zone(pfn_to_page(start_pfn)); | 813 | zone = page_zone(pfn_to_page(start_pfn)); |
| 797 | node = zone_to_nid(zone); | 814 | node = zone_to_nid(zone); |
| @@ -880,7 +897,7 @@ repeat: | |||
| 880 | writeback_set_ratelimit(); | 897 | writeback_set_ratelimit(); |
| 881 | 898 | ||
| 882 | memory_notify(MEM_OFFLINE, &arg); | 899 | memory_notify(MEM_OFFLINE, &arg); |
| 883 | unlock_system_sleep(); | 900 | unlock_memory_hotplug(); |
| 884 | return 0; | 901 | return 0; |
| 885 | 902 | ||
| 886 | failed_removal: | 903 | failed_removal: |
| @@ -891,7 +908,7 @@ failed_removal: | |||
| 891 | undo_isolate_page_range(start_pfn, end_pfn); | 908 | undo_isolate_page_range(start_pfn, end_pfn); |
| 892 | 909 | ||
| 893 | out: | 910 | out: |
| 894 | unlock_system_sleep(); | 911 | unlock_memory_hotplug(); |
| 895 | return ret; | 912 | return ret; |
| 896 | } | 913 | } |
| 897 | 914 | ||
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 4a57f135b76e..11ff260fb282 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
| @@ -1307,15 +1307,18 @@ SYSCALL_DEFINE4(migrate_pages, pid_t, pid, unsigned long, maxnode, | |||
| 1307 | goto out; | 1307 | goto out; |
| 1308 | 1308 | ||
| 1309 | /* Find the mm_struct */ | 1309 | /* Find the mm_struct */ |
| 1310 | rcu_read_lock(); | ||
| 1310 | read_lock(&tasklist_lock); | 1311 | read_lock(&tasklist_lock); |
| 1311 | task = pid ? find_task_by_vpid(pid) : current; | 1312 | task = pid ? find_task_by_vpid(pid) : current; |
| 1312 | if (!task) { | 1313 | if (!task) { |
| 1313 | read_unlock(&tasklist_lock); | 1314 | read_unlock(&tasklist_lock); |
| 1315 | rcu_read_unlock(); | ||
| 1314 | err = -ESRCH; | 1316 | err = -ESRCH; |
| 1315 | goto out; | 1317 | goto out; |
| 1316 | } | 1318 | } |
| 1317 | mm = get_task_mm(task); | 1319 | mm = get_task_mm(task); |
| 1318 | read_unlock(&tasklist_lock); | 1320 | read_unlock(&tasklist_lock); |
| 1321 | rcu_read_unlock(); | ||
| 1319 | 1322 | ||
| 1320 | err = -EINVAL; | 1323 | err = -EINVAL; |
| 1321 | if (!mm) | 1324 | if (!mm) |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e4092704c1a9..ff7e15872398 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
| @@ -104,19 +104,24 @@ gfp_t gfp_allowed_mask __read_mostly = GFP_BOOT_MASK; | |||
| 104 | * only be modified with pm_mutex held, unless the suspend/hibernate code is | 104 | * only be modified with pm_mutex held, unless the suspend/hibernate code is |
| 105 | * guaranteed not to run in parallel with that modification). | 105 | * guaranteed not to run in parallel with that modification). |
| 106 | */ | 106 | */ |
| 107 | void set_gfp_allowed_mask(gfp_t mask) | 107 | |
| 108 | static gfp_t saved_gfp_mask; | ||
| 109 | |||
| 110 | void pm_restore_gfp_mask(void) | ||
| 108 | { | 111 | { |
| 109 | WARN_ON(!mutex_is_locked(&pm_mutex)); | 112 | WARN_ON(!mutex_is_locked(&pm_mutex)); |
| 110 | gfp_allowed_mask = mask; | 113 | if (saved_gfp_mask) { |
| 114 | gfp_allowed_mask = saved_gfp_mask; | ||
| 115 | saved_gfp_mask = 0; | ||
| 116 | } | ||
| 111 | } | 117 | } |
| 112 | 118 | ||
| 113 | gfp_t clear_gfp_allowed_mask(gfp_t mask) | 119 | void pm_restrict_gfp_mask(void) |
| 114 | { | 120 | { |
| 115 | gfp_t ret = gfp_allowed_mask; | ||
| 116 | |||
| 117 | WARN_ON(!mutex_is_locked(&pm_mutex)); | 121 | WARN_ON(!mutex_is_locked(&pm_mutex)); |
| 118 | gfp_allowed_mask &= ~mask; | 122 | WARN_ON(saved_gfp_mask); |
| 119 | return ret; | 123 | saved_gfp_mask = gfp_allowed_mask; |
| 124 | gfp_allowed_mask &= ~GFP_IOFS; | ||
| 120 | } | 125 | } |
| 121 | #endif /* CONFIG_PM_SLEEP */ | 126 | #endif /* CONFIG_PM_SLEEP */ |
| 122 | 127 | ||
| @@ -3401,13 +3401,13 @@ static int validate_slab(struct kmem_cache *s, struct page *page, | |||
| 3401 | 3401 | ||
| 3402 | for_each_free_object(p, s, page->freelist) { | 3402 | for_each_free_object(p, s, page->freelist) { |
| 3403 | set_bit(slab_index(p, s, addr), map); | 3403 | set_bit(slab_index(p, s, addr), map); |
| 3404 | if (!check_object(s, page, p, 0)) | 3404 | if (!check_object(s, page, p, SLUB_RED_INACTIVE)) |
| 3405 | return 0; | 3405 | return 0; |
| 3406 | } | 3406 | } |
| 3407 | 3407 | ||
| 3408 | for_each_object(p, s, addr, page->objects) | 3408 | for_each_object(p, s, addr, page->objects) |
| 3409 | if (!test_bit(slab_index(p, s, addr), map)) | 3409 | if (!test_bit(slab_index(p, s, addr), map)) |
| 3410 | if (!check_object(s, page, p, 1)) | 3410 | if (!check_object(s, page, p, SLUB_RED_ACTIVE)) |
| 3411 | return 0; | 3411 | return 0; |
| 3412 | return 1; | 3412 | return 1; |
| 3413 | } | 3413 | } |
diff --git a/mm/truncate.c b/mm/truncate.c index ba887bff48c5..3c2d5ddfa0d4 100644 --- a/mm/truncate.c +++ b/mm/truncate.c | |||
| @@ -390,6 +390,10 @@ invalidate_complete_page2(struct address_space *mapping, struct page *page) | |||
| 390 | __remove_from_page_cache(page); | 390 | __remove_from_page_cache(page); |
| 391 | spin_unlock_irq(&mapping->tree_lock); | 391 | spin_unlock_irq(&mapping->tree_lock); |
| 392 | mem_cgroup_uncharge_cache_page(page); | 392 | mem_cgroup_uncharge_cache_page(page); |
| 393 | |||
| 394 | if (mapping->a_ops->freepage) | ||
| 395 | mapping->a_ops->freepage(page); | ||
| 396 | |||
| 393 | page_cache_release(page); /* pagecache ref */ | 397 | page_cache_release(page); /* pagecache ref */ |
| 394 | return 1; | 398 | return 1; |
| 395 | failed: | 399 | failed: |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index a3d66b3dc5cb..eb5cc7d00c5a 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
| @@ -31,8 +31,6 @@ | |||
| 31 | #include <asm/tlbflush.h> | 31 | #include <asm/tlbflush.h> |
| 32 | #include <asm/shmparam.h> | 32 | #include <asm/shmparam.h> |
| 33 | 33 | ||
| 34 | bool vmap_lazy_unmap __read_mostly = true; | ||
| 35 | |||
| 36 | /*** Page table manipulation functions ***/ | 34 | /*** Page table manipulation functions ***/ |
| 37 | 35 | ||
| 38 | static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end) | 36 | static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end) |
| @@ -503,9 +501,6 @@ static unsigned long lazy_max_pages(void) | |||
| 503 | { | 501 | { |
| 504 | unsigned int log; | 502 | unsigned int log; |
| 505 | 503 | ||
| 506 | if (!vmap_lazy_unmap) | ||
| 507 | return 0; | ||
| 508 | |||
| 509 | log = fls(num_online_cpus()); | 504 | log = fls(num_online_cpus()); |
| 510 | 505 | ||
| 511 | return log * (32UL * 1024 * 1024 / PAGE_SIZE); | 506 | return log * (32UL * 1024 * 1024 / PAGE_SIZE); |
| @@ -566,7 +561,6 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, | |||
| 566 | if (va->va_end > *end) | 561 | if (va->va_end > *end) |
| 567 | *end = va->va_end; | 562 | *end = va->va_end; |
| 568 | nr += (va->va_end - va->va_start) >> PAGE_SHIFT; | 563 | nr += (va->va_end - va->va_start) >> PAGE_SHIFT; |
| 569 | unmap_vmap_area(va); | ||
| 570 | list_add_tail(&va->purge_list, &valist); | 564 | list_add_tail(&va->purge_list, &valist); |
| 571 | va->flags |= VM_LAZY_FREEING; | 565 | va->flags |= VM_LAZY_FREEING; |
| 572 | va->flags &= ~VM_LAZY_FREE; | 566 | va->flags &= ~VM_LAZY_FREE; |
| @@ -611,10 +605,11 @@ static void purge_vmap_area_lazy(void) | |||
| 611 | } | 605 | } |
| 612 | 606 | ||
| 613 | /* | 607 | /* |
| 614 | * Free and unmap a vmap area, caller ensuring flush_cache_vunmap had been | 608 | * Free a vmap area, caller ensuring that the area has been unmapped |
| 615 | * called for the correct range previously. | 609 | * and flush_cache_vunmap had been called for the correct range |
| 610 | * previously. | ||
| 616 | */ | 611 | */ |
| 617 | static void free_unmap_vmap_area_noflush(struct vmap_area *va) | 612 | static void free_vmap_area_noflush(struct vmap_area *va) |
| 618 | { | 613 | { |
| 619 | va->flags |= VM_LAZY_FREE; | 614 | va->flags |= VM_LAZY_FREE; |
| 620 | atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr); | 615 | atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr); |
| @@ -623,6 +618,16 @@ static void free_unmap_vmap_area_noflush(struct vmap_area *va) | |||
| 623 | } | 618 | } |
| 624 | 619 | ||
| 625 | /* | 620 | /* |
| 621 | * Free and unmap a vmap area, caller ensuring flush_cache_vunmap had been | ||
| 622 | * called for the correct range previously. | ||
| 623 | */ | ||
| 624 | static void free_unmap_vmap_area_noflush(struct vmap_area *va) | ||
| 625 | { | ||
| 626 | unmap_vmap_area(va); | ||
| 627 | free_vmap_area_noflush(va); | ||
| 628 | } | ||
| 629 | |||
| 630 | /* | ||
| 626 | * Free and unmap a vmap area | 631 | * Free and unmap a vmap area |
| 627 | */ | 632 | */ |
| 628 | static void free_unmap_vmap_area(struct vmap_area *va) | 633 | static void free_unmap_vmap_area(struct vmap_area *va) |
| @@ -798,7 +803,7 @@ static void free_vmap_block(struct vmap_block *vb) | |||
| 798 | spin_unlock(&vmap_block_tree_lock); | 803 | spin_unlock(&vmap_block_tree_lock); |
| 799 | BUG_ON(tmp != vb); | 804 | BUG_ON(tmp != vb); |
| 800 | 805 | ||
| 801 | free_unmap_vmap_area_noflush(vb->va); | 806 | free_vmap_area_noflush(vb->va); |
| 802 | call_rcu(&vb->rcu_head, rcu_free_vb); | 807 | call_rcu(&vb->rcu_head, rcu_free_vb); |
| 803 | } | 808 | } |
| 804 | 809 | ||
| @@ -936,6 +941,8 @@ static void vb_free(const void *addr, unsigned long size) | |||
| 936 | rcu_read_unlock(); | 941 | rcu_read_unlock(); |
| 937 | BUG_ON(!vb); | 942 | BUG_ON(!vb); |
| 938 | 943 | ||
| 944 | vunmap_page_range((unsigned long)addr, (unsigned long)addr + size); | ||
| 945 | |||
| 939 | spin_lock(&vb->lock); | 946 | spin_lock(&vb->lock); |
| 940 | BUG_ON(bitmap_allocate_region(vb->dirty_map, offset >> PAGE_SHIFT, order)); | 947 | BUG_ON(bitmap_allocate_region(vb->dirty_map, offset >> PAGE_SHIFT, order)); |
| 941 | 948 | ||
| @@ -988,7 +995,6 @@ void vm_unmap_aliases(void) | |||
| 988 | 995 | ||
| 989 | s = vb->va->va_start + (i << PAGE_SHIFT); | 996 | s = vb->va->va_start + (i << PAGE_SHIFT); |
| 990 | e = vb->va->va_start + (j << PAGE_SHIFT); | 997 | e = vb->va->va_start + (j << PAGE_SHIFT); |
| 991 | vunmap_page_range(s, e); | ||
| 992 | flush = 1; | 998 | flush = 1; |
| 993 | 999 | ||
| 994 | if (s < start) | 1000 | if (s < start) |
diff --git a/mm/vmscan.c b/mm/vmscan.c index d31d7ce52c0e..9ca587c69274 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
| @@ -494,9 +494,16 @@ static int __remove_mapping(struct address_space *mapping, struct page *page) | |||
| 494 | spin_unlock_irq(&mapping->tree_lock); | 494 | spin_unlock_irq(&mapping->tree_lock); |
| 495 | swapcache_free(swap, page); | 495 | swapcache_free(swap, page); |
| 496 | } else { | 496 | } else { |
| 497 | void (*freepage)(struct page *); | ||
| 498 | |||
| 499 | freepage = mapping->a_ops->freepage; | ||
| 500 | |||
| 497 | __remove_from_page_cache(page); | 501 | __remove_from_page_cache(page); |
| 498 | spin_unlock_irq(&mapping->tree_lock); | 502 | spin_unlock_irq(&mapping->tree_lock); |
| 499 | mem_cgroup_uncharge_cache_page(page); | 503 | mem_cgroup_uncharge_cache_page(page); |
| 504 | |||
| 505 | if (freepage != NULL) | ||
| 506 | freepage(page); | ||
| 500 | } | 507 | } |
| 501 | 508 | ||
| 502 | return 1; | 509 | return 1; |
diff --git a/mm/vmstat.c b/mm/vmstat.c index 42eac4d33216..8f62f17ee1c7 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c | |||
| @@ -750,8 +750,6 @@ static const char * const vmstat_text[] = { | |||
| 750 | "nr_shmem", | 750 | "nr_shmem", |
| 751 | "nr_dirtied", | 751 | "nr_dirtied", |
| 752 | "nr_written", | 752 | "nr_written", |
| 753 | "nr_dirty_threshold", | ||
| 754 | "nr_dirty_background_threshold", | ||
| 755 | 753 | ||
| 756 | #ifdef CONFIG_NUMA | 754 | #ifdef CONFIG_NUMA |
| 757 | "numa_hit", | 755 | "numa_hit", |
| @@ -761,6 +759,8 @@ static const char * const vmstat_text[] = { | |||
| 761 | "numa_local", | 759 | "numa_local", |
| 762 | "numa_other", | 760 | "numa_other", |
| 763 | #endif | 761 | #endif |
| 762 | "nr_dirty_threshold", | ||
| 763 | "nr_dirty_background_threshold", | ||
| 764 | 764 | ||
| 765 | #ifdef CONFIG_VM_EVENT_COUNTERS | 765 | #ifdef CONFIG_VM_EVENT_COUNTERS |
| 766 | "pgpgin", | 766 | "pgpgin", |
diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig index 4d6f8653ec88..8e8ea9cb7093 100644 --- a/net/mac80211/Kconfig +++ b/net/mac80211/Kconfig | |||
| @@ -92,7 +92,7 @@ config MAC80211_MESH | |||
| 92 | config MAC80211_LEDS | 92 | config MAC80211_LEDS |
| 93 | bool "Enable LED triggers" | 93 | bool "Enable LED triggers" |
| 94 | depends on MAC80211 | 94 | depends on MAC80211 |
| 95 | select NEW_LEDS | 95 | depends on LEDS_CLASS |
| 96 | select LEDS_TRIGGERS | 96 | select LEDS_TRIGGERS |
| 97 | ---help--- | 97 | ---help--- |
| 98 | This option enables a few LED triggers for different | 98 | This option enables a few LED triggers for different |
diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index ea2ff78dcf7b..3f2c5559ca1a 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c | |||
| @@ -212,6 +212,7 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
| 212 | spin_lock(&svc_xprt_class_lock); | 212 | spin_lock(&svc_xprt_class_lock); |
| 213 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { | 213 | list_for_each_entry(xcl, &svc_xprt_class_list, xcl_list) { |
| 214 | struct svc_xprt *newxprt; | 214 | struct svc_xprt *newxprt; |
| 215 | unsigned short newport; | ||
| 215 | 216 | ||
| 216 | if (strcmp(xprt_name, xcl->xcl_name)) | 217 | if (strcmp(xprt_name, xcl->xcl_name)) |
| 217 | continue; | 218 | continue; |
| @@ -230,8 +231,9 @@ int svc_create_xprt(struct svc_serv *serv, const char *xprt_name, | |||
| 230 | spin_lock_bh(&serv->sv_lock); | 231 | spin_lock_bh(&serv->sv_lock); |
| 231 | list_add(&newxprt->xpt_list, &serv->sv_permsocks); | 232 | list_add(&newxprt->xpt_list, &serv->sv_permsocks); |
| 232 | spin_unlock_bh(&serv->sv_lock); | 233 | spin_unlock_bh(&serv->sv_lock); |
| 234 | newport = svc_xprt_local_port(newxprt); | ||
| 233 | clear_bit(XPT_BUSY, &newxprt->xpt_flags); | 235 | clear_bit(XPT_BUSY, &newxprt->xpt_flags); |
| 234 | return svc_xprt_local_port(newxprt); | 236 | return newport; |
| 235 | } | 237 | } |
| 236 | err: | 238 | err: |
| 237 | spin_unlock(&svc_xprt_class_lock); | 239 | spin_unlock(&svc_xprt_class_lock); |
| @@ -425,8 +427,13 @@ void svc_xprt_received(struct svc_xprt *xprt) | |||
| 425 | { | 427 | { |
| 426 | BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); | 428 | BUG_ON(!test_bit(XPT_BUSY, &xprt->xpt_flags)); |
| 427 | xprt->xpt_pool = NULL; | 429 | xprt->xpt_pool = NULL; |
| 430 | /* As soon as we clear busy, the xprt could be closed and | ||
| 431 | * 'put', so we need a reference to call svc_xprt_enqueue with: | ||
| 432 | */ | ||
| 433 | svc_xprt_get(xprt); | ||
| 428 | clear_bit(XPT_BUSY, &xprt->xpt_flags); | 434 | clear_bit(XPT_BUSY, &xprt->xpt_flags); |
| 429 | svc_xprt_enqueue(xprt); | 435 | svc_xprt_enqueue(xprt); |
| 436 | svc_xprt_put(xprt); | ||
| 430 | } | 437 | } |
| 431 | EXPORT_SYMBOL_GPL(svc_xprt_received); | 438 | EXPORT_SYMBOL_GPL(svc_xprt_received); |
| 432 | 439 | ||
diff --git a/scripts/kconfig/expr.h b/scripts/kconfig/expr.h index 184eb6a0b505..e57826ced380 100644 --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h | |||
| @@ -164,6 +164,7 @@ struct menu { | |||
| 164 | struct menu *list; | 164 | struct menu *list; |
| 165 | struct symbol *sym; | 165 | struct symbol *sym; |
| 166 | struct property *prompt; | 166 | struct property *prompt; |
| 167 | struct expr *visibility; | ||
| 167 | struct expr *dep; | 168 | struct expr *dep; |
| 168 | unsigned int flags; | 169 | unsigned int flags; |
| 169 | char *help; | 170 | char *help; |
diff --git a/scripts/kconfig/lkc.h b/scripts/kconfig/lkc.h index 753cdbd7b805..3f7240df0f3b 100644 --- a/scripts/kconfig/lkc.h +++ b/scripts/kconfig/lkc.h | |||
| @@ -107,6 +107,7 @@ void menu_end_menu(void); | |||
| 107 | void menu_add_entry(struct symbol *sym); | 107 | void menu_add_entry(struct symbol *sym); |
| 108 | void menu_end_entry(void); | 108 | void menu_end_entry(void); |
| 109 | void menu_add_dep(struct expr *dep); | 109 | void menu_add_dep(struct expr *dep); |
| 110 | void menu_add_visibility(struct expr *dep); | ||
| 110 | struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); | 111 | struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *expr, struct expr *dep); |
| 111 | struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); | 112 | struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr *dep); |
| 112 | void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); | 113 | void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep); |
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c index 7e83aef42c6d..b9d9aa18e6d6 100644 --- a/scripts/kconfig/menu.c +++ b/scripts/kconfig/menu.c | |||
| @@ -152,6 +152,12 @@ struct property *menu_add_prompt(enum prop_type type, char *prompt, struct expr | |||
| 152 | return menu_add_prop(type, prompt, NULL, dep); | 152 | return menu_add_prop(type, prompt, NULL, dep); |
| 153 | } | 153 | } |
| 154 | 154 | ||
| 155 | void menu_add_visibility(struct expr *expr) | ||
| 156 | { | ||
| 157 | current_entry->visibility = expr_alloc_and(current_entry->visibility, | ||
| 158 | expr); | ||
| 159 | } | ||
| 160 | |||
| 155 | void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep) | 161 | void menu_add_expr(enum prop_type type, struct expr *expr, struct expr *dep) |
| 156 | { | 162 | { |
| 157 | menu_add_prop(type, NULL, expr, dep); | 163 | menu_add_prop(type, NULL, expr, dep); |
| @@ -410,6 +416,11 @@ bool menu_is_visible(struct menu *menu) | |||
| 410 | if (!menu->prompt) | 416 | if (!menu->prompt) |
| 411 | return false; | 417 | return false; |
| 412 | 418 | ||
| 419 | if (menu->visibility) { | ||
| 420 | if (expr_calc_value(menu->visibility) == no) | ||
| 421 | return no; | ||
| 422 | } | ||
| 423 | |||
| 413 | sym = menu->sym; | 424 | sym = menu->sym; |
| 414 | if (sym) { | 425 | if (sym) { |
| 415 | sym_calc_value(sym); | 426 | sym_calc_value(sym); |
diff --git a/scripts/kconfig/zconf.gperf b/scripts/kconfig/zconf.gperf index d8bc74249622..c9e690eb7545 100644 --- a/scripts/kconfig/zconf.gperf +++ b/scripts/kconfig/zconf.gperf | |||
| @@ -38,6 +38,7 @@ hex, T_TYPE, TF_COMMAND, S_HEX | |||
| 38 | string, T_TYPE, TF_COMMAND, S_STRING | 38 | string, T_TYPE, TF_COMMAND, S_STRING |
| 39 | select, T_SELECT, TF_COMMAND | 39 | select, T_SELECT, TF_COMMAND |
| 40 | range, T_RANGE, TF_COMMAND | 40 | range, T_RANGE, TF_COMMAND |
| 41 | visible, T_VISIBLE, TF_COMMAND | ||
| 41 | option, T_OPTION, TF_COMMAND | 42 | option, T_OPTION, TF_COMMAND |
| 42 | on, T_ON, TF_PARAM | 43 | on, T_ON, TF_PARAM |
| 43 | modules, T_OPT_MODULES, TF_OPTION | 44 | modules, T_OPT_MODULES, TF_OPTION |
diff --git a/scripts/kconfig/zconf.hash.c_shipped b/scripts/kconfig/zconf.hash.c_shipped index c1748faf4634..4055d5de1750 100644 --- a/scripts/kconfig/zconf.hash.c_shipped +++ b/scripts/kconfig/zconf.hash.c_shipped | |||
| @@ -32,7 +32,7 @@ | |||
| 32 | struct kconf_id; | 32 | struct kconf_id; |
| 33 | 33 | ||
| 34 | static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); | 34 | static struct kconf_id *kconf_id_lookup(register const char *str, register unsigned int len); |
| 35 | /* maximum key range = 47, duplicates = 0 */ | 35 | /* maximum key range = 50, duplicates = 0 */ |
| 36 | 36 | ||
| 37 | #ifdef __GNUC__ | 37 | #ifdef __GNUC__ |
| 38 | __inline | 38 | __inline |
| @@ -46,32 +46,32 @@ kconf_id_hash (register const char *str, register unsigned int len) | |||
| 46 | { | 46 | { |
| 47 | static unsigned char asso_values[] = | 47 | static unsigned char asso_values[] = |
| 48 | { | 48 | { |
| 49 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 49 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 50 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 50 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 51 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 51 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 52 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 52 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 53 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 53 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 54 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 54 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 55 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 55 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 56 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 56 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 57 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 57 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 58 | 49, 49, 49, 49, 49, 49, 49, 49, 11, 5, | 58 | 52, 52, 52, 52, 52, 52, 52, 52, 40, 5, |
| 59 | 0, 0, 5, 49, 5, 20, 49, 49, 5, 20, | 59 | 0, 0, 5, 52, 0, 20, 52, 52, 10, 20, |
| 60 | 5, 0, 30, 49, 0, 15, 0, 10, 0, 49, | 60 | 5, 0, 35, 52, 0, 30, 0, 15, 0, 52, |
| 61 | 25, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 61 | 15, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 62 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 62 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 63 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 63 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 64 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 64 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 65 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 65 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 66 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 66 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 67 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 67 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 68 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 68 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 69 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 69 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 70 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 70 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 71 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 71 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 72 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 72 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 73 | 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, | 73 | 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, |
| 74 | 49, 49, 49, 49, 49, 49 | 74 | 52, 52, 52, 52, 52, 52 |
| 75 | }; | 75 | }; |
| 76 | register int hval = len; | 76 | register int hval = len; |
| 77 | 77 | ||
| @@ -102,25 +102,26 @@ struct kconf_id_strings_t | |||
| 102 | char kconf_id_strings_str12[sizeof("default")]; | 102 | char kconf_id_strings_str12[sizeof("default")]; |
| 103 | char kconf_id_strings_str13[sizeof("def_bool")]; | 103 | char kconf_id_strings_str13[sizeof("def_bool")]; |
| 104 | char kconf_id_strings_str14[sizeof("help")]; | 104 | char kconf_id_strings_str14[sizeof("help")]; |
| 105 | char kconf_id_strings_str15[sizeof("bool")]; | ||
| 106 | char kconf_id_strings_str16[sizeof("config")]; | 105 | char kconf_id_strings_str16[sizeof("config")]; |
| 107 | char kconf_id_strings_str17[sizeof("def_tristate")]; | 106 | char kconf_id_strings_str17[sizeof("def_tristate")]; |
| 108 | char kconf_id_strings_str18[sizeof("boolean")]; | 107 | char kconf_id_strings_str18[sizeof("hex")]; |
| 109 | char kconf_id_strings_str19[sizeof("defconfig_list")]; | 108 | char kconf_id_strings_str19[sizeof("defconfig_list")]; |
| 110 | char kconf_id_strings_str21[sizeof("string")]; | ||
| 111 | char kconf_id_strings_str22[sizeof("if")]; | 109 | char kconf_id_strings_str22[sizeof("if")]; |
| 112 | char kconf_id_strings_str23[sizeof("int")]; | 110 | char kconf_id_strings_str23[sizeof("int")]; |
| 113 | char kconf_id_strings_str26[sizeof("select")]; | ||
| 114 | char kconf_id_strings_str27[sizeof("modules")]; | 111 | char kconf_id_strings_str27[sizeof("modules")]; |
| 115 | char kconf_id_strings_str28[sizeof("tristate")]; | 112 | char kconf_id_strings_str28[sizeof("tristate")]; |
| 116 | char kconf_id_strings_str29[sizeof("menu")]; | 113 | char kconf_id_strings_str29[sizeof("menu")]; |
| 117 | char kconf_id_strings_str31[sizeof("source")]; | ||
| 118 | char kconf_id_strings_str32[sizeof("comment")]; | 114 | char kconf_id_strings_str32[sizeof("comment")]; |
| 119 | char kconf_id_strings_str33[sizeof("hex")]; | ||
| 120 | char kconf_id_strings_str35[sizeof("menuconfig")]; | 115 | char kconf_id_strings_str35[sizeof("menuconfig")]; |
| 121 | char kconf_id_strings_str36[sizeof("prompt")]; | 116 | char kconf_id_strings_str36[sizeof("string")]; |
| 122 | char kconf_id_strings_str37[sizeof("depends")]; | 117 | char kconf_id_strings_str37[sizeof("visible")]; |
| 118 | char kconf_id_strings_str41[sizeof("prompt")]; | ||
| 119 | char kconf_id_strings_str42[sizeof("depends")]; | ||
| 120 | char kconf_id_strings_str44[sizeof("bool")]; | ||
| 121 | char kconf_id_strings_str46[sizeof("select")]; | ||
| 122 | char kconf_id_strings_str47[sizeof("boolean")]; | ||
| 123 | char kconf_id_strings_str48[sizeof("mainmenu")]; | 123 | char kconf_id_strings_str48[sizeof("mainmenu")]; |
| 124 | char kconf_id_strings_str51[sizeof("source")]; | ||
| 124 | }; | 125 | }; |
| 125 | static struct kconf_id_strings_t kconf_id_strings_contents = | 126 | static struct kconf_id_strings_t kconf_id_strings_contents = |
| 126 | { | 127 | { |
| @@ -136,25 +137,26 @@ static struct kconf_id_strings_t kconf_id_strings_contents = | |||
| 136 | "default", | 137 | "default", |
| 137 | "def_bool", | 138 | "def_bool", |
| 138 | "help", | 139 | "help", |
| 139 | "bool", | ||
| 140 | "config", | 140 | "config", |
| 141 | "def_tristate", | 141 | "def_tristate", |
| 142 | "boolean", | 142 | "hex", |
| 143 | "defconfig_list", | 143 | "defconfig_list", |
| 144 | "string", | ||
| 145 | "if", | 144 | "if", |
| 146 | "int", | 145 | "int", |
| 147 | "select", | ||
| 148 | "modules", | 146 | "modules", |
| 149 | "tristate", | 147 | "tristate", |
| 150 | "menu", | 148 | "menu", |
| 151 | "source", | ||
| 152 | "comment", | 149 | "comment", |
| 153 | "hex", | ||
| 154 | "menuconfig", | 150 | "menuconfig", |
| 151 | "string", | ||
| 152 | "visible", | ||
| 155 | "prompt", | 153 | "prompt", |
| 156 | "depends", | 154 | "depends", |
| 157 | "mainmenu" | 155 | "bool", |
| 156 | "select", | ||
| 157 | "boolean", | ||
| 158 | "mainmenu", | ||
| 159 | "source" | ||
| 158 | }; | 160 | }; |
| 159 | #define kconf_id_strings ((const char *) &kconf_id_strings_contents) | 161 | #define kconf_id_strings ((const char *) &kconf_id_strings_contents) |
| 160 | #ifdef __GNUC__ | 162 | #ifdef __GNUC__ |
| @@ -168,11 +170,11 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
| 168 | { | 170 | { |
| 169 | enum | 171 | enum |
| 170 | { | 172 | { |
| 171 | TOTAL_KEYWORDS = 31, | 173 | TOTAL_KEYWORDS = 32, |
| 172 | MIN_WORD_LENGTH = 2, | 174 | MIN_WORD_LENGTH = 2, |
| 173 | MAX_WORD_LENGTH = 14, | 175 | MAX_WORD_LENGTH = 14, |
| 174 | MIN_HASH_VALUE = 2, | 176 | MIN_HASH_VALUE = 2, |
| 175 | MAX_HASH_VALUE = 48 | 177 | MAX_HASH_VALUE = 51 |
| 176 | }; | 178 | }; |
| 177 | 179 | ||
| 178 | static struct kconf_id wordlist[] = | 180 | static struct kconf_id wordlist[] = |
| @@ -191,31 +193,35 @@ kconf_id_lookup (register const char *str, register unsigned int len) | |||
| 191 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, | 193 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str12, T_DEFAULT, TF_COMMAND, S_UNKNOWN}, |
| 192 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, | 194 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str13, T_DEFAULT, TF_COMMAND, S_BOOLEAN}, |
| 193 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND}, | 195 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str14, T_HELP, TF_COMMAND}, |
| 194 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str15, T_TYPE, TF_COMMAND, S_BOOLEAN}, | 196 | {-1}, |
| 195 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND}, | 197 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str16, T_CONFIG, TF_COMMAND}, |
| 196 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, | 198 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str17, T_DEFAULT, TF_COMMAND, S_TRISTATE}, |
| 197 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_BOOLEAN}, | 199 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str18, T_TYPE, TF_COMMAND, S_HEX}, |
| 198 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION}, | 200 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str19, T_OPT_DEFCONFIG_LIST,TF_OPTION}, |
| 199 | {-1}, | 201 | {-1}, {-1}, |
| 200 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str21, T_TYPE, TF_COMMAND, S_STRING}, | ||
| 201 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM}, | 202 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str22, T_IF, TF_COMMAND|TF_PARAM}, |
| 202 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT}, | 203 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str23, T_TYPE, TF_COMMAND, S_INT}, |
| 203 | {-1}, {-1}, | 204 | {-1}, {-1}, {-1}, |
| 204 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str26, T_SELECT, TF_COMMAND}, | ||
| 205 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, | 205 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str27, T_OPT_MODULES, TF_OPTION}, |
| 206 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE}, | 206 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str28, T_TYPE, TF_COMMAND, S_TRISTATE}, |
| 207 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, | 207 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str29, T_MENU, TF_COMMAND}, |
| 208 | {-1}, | 208 | {-1}, {-1}, |
| 209 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str31, T_SOURCE, TF_COMMAND}, | ||
| 210 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, | 209 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str32, T_COMMENT, TF_COMMAND}, |
| 211 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str33, T_TYPE, TF_COMMAND, S_HEX}, | 210 | {-1}, {-1}, |
| 212 | {-1}, | ||
| 213 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND}, | 211 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str35, T_MENUCONFIG, TF_COMMAND}, |
| 214 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_PROMPT, TF_COMMAND}, | 212 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str36, T_TYPE, TF_COMMAND, S_STRING}, |
| 215 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_DEPENDS, TF_COMMAND}, | 213 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str37, T_VISIBLE, TF_COMMAND}, |
| 216 | {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, {-1}, | 214 | {-1}, {-1}, {-1}, |
| 215 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str41, T_PROMPT, TF_COMMAND}, | ||
| 216 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str42, T_DEPENDS, TF_COMMAND}, | ||
| 217 | {-1}, | 217 | {-1}, |
| 218 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND} | 218 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str44, T_TYPE, TF_COMMAND, S_BOOLEAN}, |
| 219 | {-1}, | ||
| 220 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str46, T_SELECT, TF_COMMAND}, | ||
| 221 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str47, T_TYPE, TF_COMMAND, S_BOOLEAN}, | ||
| 222 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str48, T_MAINMENU, TF_COMMAND}, | ||
| 223 | {-1}, {-1}, | ||
| 224 | {(int)(long)&((struct kconf_id_strings_t *)0)->kconf_id_strings_str51, T_SOURCE, TF_COMMAND} | ||
| 219 | }; | 225 | }; |
| 220 | 226 | ||
| 221 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) | 227 | if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH) |
diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped index 699d4b265186..4c5495ea205e 100644 --- a/scripts/kconfig/zconf.tab.c_shipped +++ b/scripts/kconfig/zconf.tab.c_shipped | |||
| @@ -160,18 +160,19 @@ static struct menu *current_menu, *current_entry; | |||
| 160 | T_DEFAULT = 275, | 160 | T_DEFAULT = 275, |
| 161 | T_SELECT = 276, | 161 | T_SELECT = 276, |
| 162 | T_RANGE = 277, | 162 | T_RANGE = 277, |
| 163 | T_OPTION = 278, | 163 | T_VISIBLE = 278, |
| 164 | T_ON = 279, | 164 | T_OPTION = 279, |
| 165 | T_WORD = 280, | 165 | T_ON = 280, |
| 166 | T_WORD_QUOTE = 281, | 166 | T_WORD = 281, |
| 167 | T_UNEQUAL = 282, | 167 | T_WORD_QUOTE = 282, |
| 168 | T_CLOSE_PAREN = 283, | 168 | T_UNEQUAL = 283, |
| 169 | T_OPEN_PAREN = 284, | 169 | T_CLOSE_PAREN = 284, |
| 170 | T_EOL = 285, | 170 | T_OPEN_PAREN = 285, |
| 171 | T_OR = 286, | 171 | T_EOL = 286, |
| 172 | T_AND = 287, | 172 | T_OR = 287, |
| 173 | T_EQUAL = 288, | 173 | T_AND = 288, |
| 174 | T_NOT = 289 | 174 | T_EQUAL = 289, |
| 175 | T_NOT = 290 | ||
| 175 | }; | 176 | }; |
| 176 | #endif | 177 | #endif |
| 177 | 178 | ||
| @@ -419,20 +420,20 @@ union yyalloc | |||
| 419 | /* YYFINAL -- State number of the termination state. */ | 420 | /* YYFINAL -- State number of the termination state. */ |
| 420 | #define YYFINAL 11 | 421 | #define YYFINAL 11 |
| 421 | /* YYLAST -- Last index in YYTABLE. */ | 422 | /* YYLAST -- Last index in YYTABLE. */ |
| 422 | #define YYLAST 277 | 423 | #define YYLAST 290 |
| 423 | 424 | ||
| 424 | /* YYNTOKENS -- Number of terminals. */ | 425 | /* YYNTOKENS -- Number of terminals. */ |
| 425 | #define YYNTOKENS 35 | 426 | #define YYNTOKENS 36 |
| 426 | /* YYNNTS -- Number of nonterminals. */ | 427 | /* YYNNTS -- Number of nonterminals. */ |
| 427 | #define YYNNTS 48 | 428 | #define YYNNTS 50 |
| 428 | /* YYNRULES -- Number of rules. */ | 429 | /* YYNRULES -- Number of rules. */ |
| 429 | #define YYNRULES 113 | 430 | #define YYNRULES 118 |
| 430 | /* YYNRULES -- Number of states. */ | 431 | /* YYNRULES -- Number of states. */ |
| 431 | #define YYNSTATES 185 | 432 | #define YYNSTATES 191 |
| 432 | 433 | ||
| 433 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ | 434 | /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ |
| 434 | #define YYUNDEFTOK 2 | 435 | #define YYUNDEFTOK 2 |
| 435 | #define YYMAXUTOK 289 | 436 | #define YYMAXUTOK 290 |
| 436 | 437 | ||
| 437 | #define YYTRANSLATE(YYX) \ | 438 | #define YYTRANSLATE(YYX) \ |
| 438 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) | 439 | ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) |
| @@ -468,7 +469,8 @@ static const yytype_uint8 yytranslate[] = | |||
| 468 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, | 469 | 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, |
| 469 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, | 470 | 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, |
| 470 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, | 471 | 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, |
| 471 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34 | 472 | 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, |
| 473 | 35 | ||
| 472 | }; | 474 | }; |
| 473 | 475 | ||
| 474 | #if YYDEBUG | 476 | #if YYDEBUG |
| @@ -478,72 +480,73 @@ static const yytype_uint16 yyprhs[] = | |||
| 478 | { | 480 | { |
| 479 | 0, 0, 3, 6, 8, 11, 13, 14, 17, 20, | 481 | 0, 0, 3, 6, 8, 11, 13, 14, 17, 20, |
| 480 | 23, 26, 31, 36, 40, 42, 44, 46, 48, 50, | 482 | 23, 26, 31, 36, 40, 42, 44, 46, 48, 50, |
| 481 | 52, 54, 56, 58, 60, 62, 64, 66, 70, 73, | 483 | 52, 54, 56, 58, 60, 62, 64, 66, 68, 72, |
| 482 | 77, 80, 84, 87, 88, 91, 94, 97, 100, 103, | 484 | 75, 79, 82, 86, 89, 90, 93, 96, 99, 102, |
| 483 | 106, 110, 115, 120, 125, 131, 135, 136, 140, 141, | 485 | 105, 108, 112, 117, 122, 127, 133, 137, 138, 142, |
| 484 | 144, 148, 151, 153, 157, 158, 161, 164, 167, 170, | 486 | 143, 146, 150, 153, 155, 159, 160, 163, 166, 169, |
| 485 | 173, 178, 182, 185, 190, 191, 194, 198, 200, 204, | 487 | 172, 175, 180, 184, 187, 192, 193, 196, 200, 202, |
| 486 | 205, 208, 211, 214, 218, 222, 225, 227, 231, 232, | 488 | 206, 207, 210, 213, 216, 220, 224, 228, 230, 234, |
| 487 | 235, 238, 241, 245, 249, 252, 255, 258, 259, 262, | 489 | 235, 238, 241, 244, 248, 252, 255, 258, 261, 262, |
| 488 | 265, 268, 273, 274, 277, 279, 281, 284, 287, 290, | 490 | 265, 268, 271, 276, 277, 280, 283, 286, 287, 290, |
| 489 | 292, 295, 296, 299, 301, 305, 309, 313, 316, 320, | 491 | 292, 294, 297, 300, 303, 305, 308, 309, 312, 314, |
| 490 | 324, 326, 328, 329 | 492 | 318, 322, 326, 329, 333, 337, 339, 341, 342 |
| 491 | }; | 493 | }; |
| 492 | 494 | ||
| 493 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ | 495 | /* YYRHS -- A `-1'-separated list of the rules' RHS. */ |
| 494 | static const yytype_int8 yyrhs[] = | 496 | static const yytype_int8 yyrhs[] = |
| 495 | { | 497 | { |
| 496 | 36, 0, -1, 78, 37, -1, 37, -1, 62, 38, | 498 | 37, 0, -1, 81, 38, -1, 38, -1, 63, 39, |
| 497 | -1, 38, -1, -1, 38, 40, -1, 38, 54, -1, | 499 | -1, 39, -1, -1, 39, 41, -1, 39, 55, -1, |
| 498 | 38, 66, -1, 38, 77, -1, 38, 25, 1, 30, | 500 | 39, 67, -1, 39, 80, -1, 39, 26, 1, 31, |
| 499 | -1, 38, 39, 1, 30, -1, 38, 1, 30, -1, | 501 | -1, 39, 40, 1, 31, -1, 39, 1, 31, -1, |
| 500 | 16, -1, 18, -1, 19, -1, 21, -1, 17, -1, | 502 | 16, -1, 18, -1, 19, -1, 21, -1, 17, -1, |
| 501 | 22, -1, 20, -1, 30, -1, 60, -1, 70, -1, | 503 | 22, -1, 20, -1, 23, -1, 31, -1, 61, -1, |
| 502 | 43, -1, 45, -1, 68, -1, 25, 1, 30, -1, | 504 | 71, -1, 44, -1, 46, -1, 69, -1, 26, 1, |
| 503 | 1, 30, -1, 10, 25, 30, -1, 42, 46, -1, | 505 | 31, -1, 1, 31, -1, 10, 26, 31, -1, 43, |
| 504 | 11, 25, 30, -1, 44, 46, -1, -1, 46, 47, | 506 | 47, -1, 11, 26, 31, -1, 45, 47, -1, -1, |
| 505 | -1, 46, 48, -1, 46, 74, -1, 46, 72, -1, | 507 | 47, 48, -1, 47, 49, -1, 47, 75, -1, 47, |
| 506 | 46, 41, -1, 46, 30, -1, 19, 75, 30, -1, | 508 | 73, -1, 47, 42, -1, 47, 31, -1, 19, 78, |
| 507 | 18, 76, 79, 30, -1, 20, 80, 79, 30, -1, | 509 | 31, -1, 18, 79, 82, 31, -1, 20, 83, 82, |
| 508 | 21, 25, 79, 30, -1, 22, 81, 81, 79, 30, | 510 | 31, -1, 21, 26, 82, 31, -1, 22, 84, 84, |
| 509 | -1, 23, 49, 30, -1, -1, 49, 25, 50, -1, | 511 | 82, 31, -1, 24, 50, 31, -1, -1, 50, 26, |
| 510 | -1, 33, 76, -1, 7, 82, 30, -1, 51, 55, | 512 | 51, -1, -1, 34, 79, -1, 7, 85, 31, -1, |
| 511 | -1, 77, -1, 52, 57, 53, -1, -1, 55, 56, | 513 | 52, 56, -1, 80, -1, 53, 58, 54, -1, -1, |
| 512 | -1, 55, 74, -1, 55, 72, -1, 55, 30, -1, | 514 | 56, 57, -1, 56, 75, -1, 56, 73, -1, 56, |
| 513 | 55, 41, -1, 18, 76, 79, 30, -1, 19, 75, | 515 | 31, -1, 56, 42, -1, 18, 79, 82, 31, -1, |
| 514 | 30, -1, 17, 30, -1, 20, 25, 79, 30, -1, | 516 | 19, 78, 31, -1, 17, 31, -1, 20, 26, 82, |
| 515 | -1, 57, 40, -1, 14, 80, 78, -1, 77, -1, | 517 | 31, -1, -1, 58, 41, -1, 14, 83, 81, -1, |
| 516 | 58, 61, 59, -1, -1, 61, 40, -1, 61, 66, | 518 | 80, -1, 59, 62, 60, -1, -1, 62, 41, -1, |
| 517 | -1, 61, 54, -1, 3, 76, 78, -1, 4, 76, | 519 | 62, 67, -1, 62, 55, -1, 3, 79, 81, -1, |
| 518 | 30, -1, 63, 73, -1, 77, -1, 64, 67, 65, | 520 | 4, 79, 31, -1, 64, 76, 74, -1, 80, -1, |
| 519 | -1, -1, 67, 40, -1, 67, 66, -1, 67, 54, | 521 | 65, 68, 66, -1, -1, 68, 41, -1, 68, 67, |
| 520 | -1, 6, 76, 30, -1, 9, 76, 30, -1, 69, | 522 | -1, 68, 55, -1, 6, 79, 31, -1, 9, 79, |
| 521 | 73, -1, 12, 30, -1, 71, 13, -1, -1, 73, | 523 | 31, -1, 70, 74, -1, 12, 31, -1, 72, 13, |
| 522 | 74, -1, 73, 30, -1, 73, 41, -1, 16, 24, | 524 | -1, -1, 74, 75, -1, 74, 31, -1, 74, 42, |
| 523 | 80, 30, -1, -1, 76, 79, -1, 25, -1, 26, | 525 | -1, 16, 25, 83, 31, -1, -1, 76, 77, -1, |
| 524 | -1, 5, 30, -1, 8, 30, -1, 15, 30, -1, | 526 | 76, 31, -1, 23, 82, -1, -1, 79, 82, -1, |
| 525 | 30, -1, 78, 30, -1, -1, 14, 80, -1, 81, | 527 | 26, -1, 27, -1, 5, 31, -1, 8, 31, -1, |
| 526 | -1, 81, 33, 81, -1, 81, 27, 81, -1, 29, | 528 | 15, 31, -1, 31, -1, 81, 31, -1, -1, 14, |
| 527 | 80, 28, -1, 34, 80, -1, 80, 31, 80, -1, | 529 | 83, -1, 84, -1, 84, 34, 84, -1, 84, 28, |
| 528 | 80, 32, 80, -1, 25, -1, 26, -1, -1, 25, | 530 | 84, -1, 30, 83, 29, -1, 35, 83, -1, 83, |
| 529 | -1 | 531 | 32, 83, -1, 83, 33, 83, -1, 26, -1, 27, |
| 532 | -1, -1, 26, -1 | ||
| 530 | }; | 533 | }; |
| 531 | 534 | ||
| 532 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ | 535 | /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ |
| 533 | static const yytype_uint16 yyrline[] = | 536 | static const yytype_uint16 yyrline[] = |
| 534 | { | 537 | { |
| 535 | 0, 107, 107, 107, 109, 109, 111, 113, 114, 115, | 538 | 0, 108, 108, 108, 110, 110, 112, 114, 115, 116, |
| 536 | 116, 117, 118, 122, 126, 126, 126, 126, 126, 126, | 539 | 117, 118, 119, 123, 127, 127, 127, 127, 127, 127, |
| 537 | 126, 130, 131, 132, 133, 134, 135, 139, 140, 146, | 540 | 127, 127, 131, 132, 133, 134, 135, 136, 140, 141, |
| 538 | 154, 160, 168, 178, 180, 181, 182, 183, 184, 185, | 541 | 147, 155, 161, 169, 179, 181, 182, 183, 184, 185, |
| 539 | 188, 196, 202, 212, 218, 224, 227, 229, 240, 241, | 542 | 186, 189, 197, 203, 213, 219, 225, 228, 230, 241, |
| 540 | 246, 255, 260, 268, 271, 273, 274, 275, 276, 277, | 543 | 242, 247, 256, 261, 269, 272, 274, 275, 276, 277, |
| 541 | 280, 286, 297, 303, 313, 315, 320, 328, 336, 339, | 544 | 278, 281, 287, 298, 304, 314, 316, 321, 329, 337, |
| 542 | 341, 342, 343, 348, 355, 362, 367, 375, 378, 380, | 545 | 340, 342, 343, 344, 349, 356, 363, 368, 376, 379, |
| 543 | 381, 382, 385, 393, 400, 407, 413, 420, 422, 423, | 546 | 381, 382, 383, 386, 394, 401, 408, 414, 421, 423, |
| 544 | 424, 427, 435, 437, 442, 443, 446, 447, 448, 452, | 547 | 424, 425, 428, 436, 438, 439, 442, 449, 451, 456, |
| 545 | 453, 456, 457, 460, 461, 462, 463, 464, 465, 466, | 548 | 457, 460, 461, 462, 466, 467, 470, 471, 474, 475, |
| 546 | 469, 470, 473, 474 | 549 | 476, 477, 478, 479, 480, 483, 484, 487, 488 |
| 547 | }; | 550 | }; |
| 548 | #endif | 551 | #endif |
| 549 | 552 | ||
| @@ -556,7 +559,7 @@ static const char *const yytname[] = | |||
| 556 | "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", | 559 | "T_SOURCE", "T_CHOICE", "T_ENDCHOICE", "T_COMMENT", "T_CONFIG", |
| 557 | "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", | 560 | "T_MENUCONFIG", "T_HELP", "T_HELPTEXT", "T_IF", "T_ENDIF", "T_DEPENDS", |
| 558 | "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", | 561 | "T_OPTIONAL", "T_PROMPT", "T_TYPE", "T_DEFAULT", "T_SELECT", "T_RANGE", |
| 559 | "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", | 562 | "T_VISIBLE", "T_OPTION", "T_ON", "T_WORD", "T_WORD_QUOTE", "T_UNEQUAL", |
| 560 | "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", | 563 | "T_CLOSE_PAREN", "T_OPEN_PAREN", "T_EOL", "T_OR", "T_AND", "T_EQUAL", |
| 561 | "T_NOT", "$accept", "input", "start", "stmt_list", "option_name", | 564 | "T_NOT", "$accept", "input", "start", "stmt_list", "option_name", |
| 562 | "common_stmt", "option_error", "config_entry_start", "config_stmt", | 565 | "common_stmt", "option_error", "config_entry_start", "config_stmt", |
| @@ -567,8 +570,8 @@ static const char *const yytname[] = | |||
| 567 | "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu", | 570 | "if_entry", "if_end", "if_stmt", "if_block", "mainmenu_stmt", "menu", |
| 568 | "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt", | 571 | "menu_entry", "menu_end", "menu_stmt", "menu_block", "source_stmt", |
| 569 | "comment", "comment_stmt", "help_start", "help", "depends_list", | 572 | "comment", "comment_stmt", "help_start", "help", "depends_list", |
| 570 | "depends", "prompt_stmt_opt", "prompt", "end", "nl", "if_expr", "expr", | 573 | "depends", "visibility_list", "visible", "prompt_stmt_opt", "prompt", |
| 571 | "symbol", "word_opt", 0 | 574 | "end", "nl", "if_expr", "expr", "symbol", "word_opt", 0 |
| 572 | }; | 575 | }; |
| 573 | #endif | 576 | #endif |
| 574 | 577 | ||
| @@ -580,25 +583,25 @@ static const yytype_uint16 yytoknum[] = | |||
| 580 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, | 583 | 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, |
| 581 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, | 584 | 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, |
| 582 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, | 585 | 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, |
| 583 | 285, 286, 287, 288, 289 | 586 | 285, 286, 287, 288, 289, 290 |
| 584 | }; | 587 | }; |
| 585 | # endif | 588 | # endif |
| 586 | 589 | ||
| 587 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ | 590 | /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ |
| 588 | static const yytype_uint8 yyr1[] = | 591 | static const yytype_uint8 yyr1[] = |
| 589 | { | 592 | { |
| 590 | 0, 35, 36, 36, 37, 37, 38, 38, 38, 38, | 593 | 0, 36, 37, 37, 38, 38, 39, 39, 39, 39, |
| 591 | 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, | 594 | 39, 39, 39, 39, 40, 40, 40, 40, 40, 40, |
| 592 | 39, 40, 40, 40, 40, 40, 40, 41, 41, 42, | 595 | 40, 40, 41, 41, 41, 41, 41, 41, 42, 42, |
| 593 | 43, 44, 45, 46, 46, 46, 46, 46, 46, 46, | 596 | 43, 44, 45, 46, 47, 47, 47, 47, 47, 47, |
| 594 | 47, 47, 47, 47, 47, 48, 49, 49, 50, 50, | 597 | 47, 48, 48, 48, 48, 48, 49, 50, 50, 51, |
| 595 | 51, 52, 53, 54, 55, 55, 55, 55, 55, 55, | 598 | 51, 52, 53, 54, 55, 56, 56, 56, 56, 56, |
| 596 | 56, 56, 56, 56, 57, 57, 58, 59, 60, 61, | 599 | 56, 57, 57, 57, 57, 58, 58, 59, 60, 61, |
| 597 | 61, 61, 61, 62, 63, 64, 65, 66, 67, 67, | 600 | 62, 62, 62, 62, 63, 64, 65, 66, 67, 68, |
| 598 | 67, 67, 68, 69, 70, 71, 72, 73, 73, 73, | 601 | 68, 68, 68, 69, 70, 71, 72, 73, 74, 74, |
| 599 | 73, 74, 75, 75, 76, 76, 77, 77, 77, 78, | 602 | 74, 74, 75, 76, 76, 76, 77, 78, 78, 79, |
| 600 | 78, 79, 79, 80, 80, 80, 80, 80, 80, 80, | 603 | 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, |
| 601 | 81, 81, 82, 82 | 604 | 83, 83, 83, 83, 83, 84, 84, 85, 85 |
| 602 | }; | 605 | }; |
| 603 | 606 | ||
| 604 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ | 607 | /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ |
| @@ -606,16 +609,16 @@ static const yytype_uint8 yyr2[] = | |||
| 606 | { | 609 | { |
| 607 | 0, 2, 2, 1, 2, 1, 0, 2, 2, 2, | 610 | 0, 2, 2, 1, 2, 1, 0, 2, 2, 2, |
| 608 | 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, | 611 | 2, 4, 4, 3, 1, 1, 1, 1, 1, 1, |
| 609 | 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, | 612 | 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, |
| 610 | 2, 3, 2, 0, 2, 2, 2, 2, 2, 2, | 613 | 3, 2, 3, 2, 0, 2, 2, 2, 2, 2, |
| 611 | 3, 4, 4, 4, 5, 3, 0, 3, 0, 2, | 614 | 2, 3, 4, 4, 4, 5, 3, 0, 3, 0, |
| 612 | 3, 2, 1, 3, 0, 2, 2, 2, 2, 2, | 615 | 2, 3, 2, 1, 3, 0, 2, 2, 2, 2, |
| 613 | 4, 3, 2, 4, 0, 2, 3, 1, 3, 0, | 616 | 2, 4, 3, 2, 4, 0, 2, 3, 1, 3, |
| 614 | 2, 2, 2, 3, 3, 2, 1, 3, 0, 2, | 617 | 0, 2, 2, 2, 3, 3, 3, 1, 3, 0, |
| 615 | 2, 2, 3, 3, 2, 2, 2, 0, 2, 2, | 618 | 2, 2, 2, 3, 3, 2, 2, 2, 0, 2, |
| 616 | 2, 4, 0, 2, 1, 1, 2, 2, 2, 1, | 619 | 2, 2, 4, 0, 2, 2, 2, 0, 2, 1, |
| 617 | 2, 0, 2, 1, 3, 3, 3, 2, 3, 3, | 620 | 1, 2, 2, 2, 1, 2, 0, 2, 1, 3, |
| 618 | 1, 1, 0, 1 | 621 | 3, 3, 2, 3, 3, 1, 1, 0, 1 |
| 619 | }; | 622 | }; |
| 620 | 623 | ||
| 621 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state | 624 | /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state |
| @@ -623,165 +626,172 @@ static const yytype_uint8 yyr2[] = | |||
| 623 | means the default is an error. */ | 626 | means the default is an error. */ |
| 624 | static const yytype_uint8 yydefact[] = | 627 | static const yytype_uint8 yydefact[] = |
| 625 | { | 628 | { |
| 626 | 6, 0, 99, 0, 3, 0, 6, 6, 94, 95, | 629 | 6, 0, 104, 0, 3, 0, 6, 6, 99, 100, |
| 627 | 0, 1, 0, 0, 0, 0, 112, 0, 0, 0, | 630 | 0, 1, 0, 0, 0, 0, 117, 0, 0, 0, |
| 628 | 0, 0, 0, 14, 18, 15, 16, 20, 17, 19, | 631 | 0, 0, 0, 14, 18, 15, 16, 20, 17, 19, |
| 629 | 0, 21, 0, 7, 33, 24, 33, 25, 54, 64, | 632 | 21, 0, 22, 0, 7, 34, 25, 34, 26, 55, |
| 630 | 8, 69, 22, 87, 78, 9, 26, 87, 23, 10, | 633 | 65, 8, 70, 23, 93, 79, 9, 27, 88, 24, |
| 631 | 0, 100, 2, 73, 13, 0, 96, 0, 113, 0, | 634 | 10, 0, 105, 2, 74, 13, 0, 101, 0, 118, |
| 632 | 97, 0, 0, 0, 110, 111, 0, 0, 0, 103, | 635 | 0, 102, 0, 0, 0, 115, 116, 0, 0, 0, |
| 633 | 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 636 | 108, 103, 0, 0, 0, 0, 0, 0, 0, 88, |
| 634 | 0, 74, 82, 50, 83, 29, 31, 0, 107, 0, | 637 | 0, 0, 75, 83, 51, 84, 30, 32, 0, 112, |
| 635 | 0, 66, 0, 0, 11, 12, 0, 0, 0, 0, | 638 | 0, 0, 67, 0, 0, 11, 12, 0, 0, 0, |
| 636 | 92, 0, 0, 0, 46, 0, 39, 38, 34, 35, | 639 | 0, 97, 0, 0, 0, 47, 0, 40, 39, 35, |
| 637 | 0, 37, 36, 0, 0, 92, 0, 58, 59, 55, | 640 | 36, 0, 38, 37, 0, 0, 97, 0, 59, 60, |
| 638 | 57, 56, 65, 53, 52, 70, 72, 68, 71, 67, | 641 | 56, 58, 57, 66, 54, 53, 71, 73, 69, 72, |
| 639 | 89, 90, 88, 79, 81, 77, 80, 76, 106, 108, | 642 | 68, 106, 95, 0, 94, 80, 82, 78, 81, 77, |
| 640 | 109, 105, 104, 28, 85, 0, 101, 0, 101, 101, | 643 | 90, 91, 89, 111, 113, 114, 110, 109, 29, 86, |
| 641 | 101, 0, 0, 0, 86, 62, 101, 0, 101, 0, | 644 | 0, 106, 0, 106, 106, 106, 0, 0, 0, 87, |
| 642 | 0, 0, 40, 93, 0, 0, 101, 48, 45, 27, | 645 | 63, 106, 0, 106, 0, 96, 0, 0, 41, 98, |
| 643 | 0, 61, 0, 91, 102, 41, 42, 43, 0, 0, | 646 | 0, 0, 106, 49, 46, 28, 0, 62, 0, 107, |
| 644 | 47, 60, 63, 44, 49 | 647 | 92, 42, 43, 44, 0, 0, 48, 61, 64, 45, |
| 648 | 50 | ||
| 645 | }; | 649 | }; |
| 646 | 650 | ||
| 647 | /* YYDEFGOTO[NTERM-NUM]. */ | 651 | /* YYDEFGOTO[NTERM-NUM]. */ |
| 648 | static const yytype_int16 yydefgoto[] = | 652 | static const yytype_int16 yydefgoto[] = |
| 649 | { | 653 | { |
| 650 | -1, 3, 4, 5, 32, 33, 107, 34, 35, 36, | 654 | -1, 3, 4, 5, 33, 34, 108, 35, 36, 37, |
| 651 | 37, 73, 108, 109, 152, 180, 38, 39, 123, 40, | 655 | 38, 74, 109, 110, 157, 186, 39, 40, 124, 41, |
| 652 | 75, 119, 76, 41, 127, 42, 77, 6, 43, 44, | 656 | 76, 120, 77, 42, 128, 43, 78, 6, 44, 45, |
| 653 | 135, 45, 79, 46, 47, 48, 110, 111, 78, 112, | 657 | 137, 46, 80, 47, 48, 49, 111, 112, 81, 113, |
| 654 | 147, 148, 49, 7, 161, 68, 69, 59 | 658 | 79, 134, 152, 153, 50, 7, 165, 69, 70, 60 |
| 655 | }; | 659 | }; |
| 656 | 660 | ||
| 657 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing | 661 | /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing |
| 658 | STATE-NUM. */ | 662 | STATE-NUM. */ |
| 659 | #define YYPACT_NINF -89 | 663 | #define YYPACT_NINF -90 |
| 660 | static const yytype_int16 yypact[] = | 664 | static const yytype_int16 yypact[] = |
| 661 | { | 665 | { |
| 662 | 3, 4, -89, 20, -89, 100, -89, 7, -89, -89, | 666 | 4, 42, -90, 96, -90, 111, -90, 15, -90, -90, |
| 663 | -8, -89, 17, 4, 28, 4, 37, 36, 4, 68, | 667 | 75, -90, 82, 42, 104, 42, 110, 107, 42, 115, |
| 664 | 87, -18, 69, -89, -89, -89, -89, -89, -89, -89, | 668 | 125, -4, 121, -90, -90, -90, -90, -90, -90, -90, |
| 665 | 128, -89, 138, -89, -89, -89, -89, -89, -89, -89, | 669 | -90, 162, -90, 163, -90, -90, -90, -90, -90, -90, |
| 666 | -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, | 670 | -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, |
| 667 | 127, -89, -89, 110, -89, 126, -89, 136, -89, 137, | 671 | -90, 139, -90, -90, 138, -90, 142, -90, 143, -90, |
| 668 | -89, 147, 150, 152, -89, -89, -18, -18, 171, -14, | 672 | 152, -90, 164, 167, 168, -90, -90, -4, -4, 77, |
| 669 | -89, 153, 157, 34, 67, 180, 233, 220, 207, 220, | 673 | -18, -90, 177, 185, 33, 71, 195, 247, 236, -2, |
| 670 | 154, -89, -89, -89, -89, -89, -89, 0, -89, -18, | 674 | 236, 171, -90, -90, -90, -90, -90, -90, 41, -90, |
| 671 | -18, 110, 44, 44, -89, -89, 163, 174, 182, 4, | 675 | -4, -4, 138, 97, 97, -90, -90, 186, 187, 194, |
| 672 | 4, -18, 194, 44, -89, 219, -89, -89, -89, -89, | 676 | 42, 42, -4, 196, 97, -90, 219, -90, -90, -90, |
| 673 | 223, -89, -89, 203, 4, 4, 215, -89, -89, -89, | 677 | -90, 210, -90, -90, 204, 42, 42, 199, -90, -90, |
| 674 | -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, | 678 | -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, |
| 675 | -89, -89, -89, -89, -89, -89, -89, -89, -89, 213, | 679 | -90, 222, -90, 223, -90, -90, -90, -90, -90, -90, |
| 676 | -89, -89, -89, -89, -89, -18, 232, 227, 232, -5, | 680 | -90, -90, -90, -90, 215, -90, -90, -90, -90, -90, |
| 677 | 232, 44, 35, 234, -89, -89, 232, 235, 232, 224, | 681 | -4, 222, 228, 222, -5, 222, 97, 35, 229, -90, |
| 678 | -18, 236, -89, -89, 237, 238, 232, 216, -89, -89, | 682 | -90, 222, 232, 222, -4, -90, 135, 233, -90, -90, |
| 679 | 240, -89, 241, -89, 71, -89, -89, -89, 242, 4, | 683 | 234, 235, 222, 240, -90, -90, 237, -90, 239, -13, |
| 680 | -89, -89, -89, -89, -89 | 684 | -90, -90, -90, -90, 244, 42, -90, -90, -90, -90, |
| 685 | -90 | ||
| 681 | }; | 686 | }; |
| 682 | 687 | ||
| 683 | /* YYPGOTO[NTERM-NUM]. */ | 688 | /* YYPGOTO[NTERM-NUM]. */ |
| 684 | static const yytype_int16 yypgoto[] = | 689 | static const yytype_int16 yypgoto[] = |
| 685 | { | 690 | { |
| 686 | -89, -89, 255, 267, -89, 47, -57, -89, -89, -89, | 691 | -90, -90, 269, 271, -90, 23, -70, -90, -90, -90, |
| 687 | -89, 239, -89, -89, -89, -89, -89, -89, -89, 130, | 692 | -90, 243, -90, -90, -90, -90, -90, -90, -90, -48, |
| 688 | -89, -89, -89, -89, -89, -89, -89, -89, -89, -89, | 693 | -90, -90, -90, -90, -90, -90, -90, -90, -90, -90, |
| 689 | -89, 181, -89, -89, -89, -89, -89, 199, 229, 16, | 694 | -90, -20, -90, -90, -90, -90, -90, 206, 205, -68, |
| 690 | 162, -1, 74, -7, 103, -65, -88, -89 | 695 | -90, -90, 169, -1, 27, -7, 118, -66, -89, -90 |
| 691 | }; | 696 | }; |
| 692 | 697 | ||
| 693 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If | 698 | /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If |
| 694 | positive, shift that token. If negative, reduce the rule which | 699 | positive, shift that token. If negative, reduce the rule which |
| 695 | number is the opposite. If zero, do what YYDEFACT says. | 700 | number is the opposite. If zero, do what YYDEFACT says. |
| 696 | If YYTABLE_NINF, syntax error. */ | 701 | If YYTABLE_NINF, syntax error. */ |
| 697 | #define YYTABLE_NINF -85 | 702 | #define YYTABLE_NINF -86 |
| 698 | static const yytype_int16 yytable[] = | 703 | static const yytype_int16 yytable[] = |
| 699 | { | 704 | { |
| 700 | 10, 87, 88, 53, 141, 142, 1, 64, 65, 160, | 705 | 10, 88, 89, 54, 146, 147, 119, 1, 122, 164, |
| 701 | 1, 66, 55, 92, 57, 151, 67, 61, 118, 93, | 706 | 93, 141, 56, 142, 58, 156, 94, 62, 1, 90, |
| 702 | 11, 131, 2, 131, 139, 140, 89, 90, 138, 8, | 707 | 91, 131, 65, 66, 144, 145, 67, 90, 91, 132, |
| 703 | 9, 89, 90, 2, -30, 96, 149, 51, -30, -30, | 708 | 127, 68, 136, -31, 97, 2, 154, -31, -31, -31, |
| 704 | -30, -30, -30, -30, -30, -30, 97, 54, -30, -30, | 709 | -31, -31, -31, -31, -31, 98, 52, -31, -31, 99, |
| 705 | 98, -30, 99, 100, 101, 102, 103, 104, 56, 105, | 710 | -31, 100, 101, 102, 103, 104, -31, 105, 129, 106, |
| 706 | 167, 91, 58, 166, 106, 168, 60, -32, 96, 64, | 711 | 138, 173, 92, 141, 107, 142, 174, 172, 8, 9, |
| 707 | 65, -32, -32, -32, -32, -32, -32, -32, -32, 97, | 712 | 143, -33, 97, 90, 91, -33, -33, -33, -33, -33, |
| 708 | 159, -32, -32, 98, -32, 99, 100, 101, 102, 103, | 713 | -33, -33, -33, 98, 166, -33, -33, 99, -33, 100, |
| 709 | 104, 121, 105, 62, 132, 174, 132, 106, 146, 70, | 714 | 101, 102, 103, 104, -33, 105, 11, 106, 179, 151, |
| 710 | -5, 12, 89, 90, 13, 14, 15, 16, 17, 18, | 715 | 123, 126, 107, 135, 125, 130, 2, 139, 2, 90, |
| 711 | 19, 20, 63, 156, 21, 22, 23, 24, 25, 26, | 716 | 91, -5, 12, 55, 161, 13, 14, 15, 16, 17, |
| 712 | 27, 28, 29, 122, 125, 30, 133, -4, 12, 71, | 717 | 18, 19, 20, 65, 66, 21, 22, 23, 24, 25, |
| 713 | 31, 13, 14, 15, 16, 17, 18, 19, 20, 72, | 718 | 26, 27, 28, 29, 30, 57, 59, 31, 61, -4, |
| 714 | 51, 21, 22, 23, 24, 25, 26, 27, 28, 29, | 719 | 12, 63, 32, 13, 14, 15, 16, 17, 18, 19, |
| 715 | 124, 129, 30, 137, -84, 96, 81, 31, -84, -84, | 720 | 20, 64, 71, 21, 22, 23, 24, 25, 26, 27, |
| 716 | -84, -84, -84, -84, -84, -84, 82, 83, -84, -84, | 721 | 28, 29, 30, 72, 73, 31, 180, 90, 91, 52, |
| 717 | 98, -84, -84, -84, -84, -84, -84, 84, 184, 105, | 722 | 32, -85, 97, 82, 83, -85, -85, -85, -85, -85, |
| 718 | 85, 96, 86, 94, 130, -51, -51, 95, -51, -51, | 723 | -85, -85, -85, 84, 190, -85, -85, 99, -85, -85, |
| 719 | -51, -51, 97, 143, -51, -51, 98, 113, 114, 115, | 724 | -85, -85, -85, -85, -85, 85, 97, 106, 86, 87, |
| 720 | 116, 2, 89, 90, 144, 105, 145, 126, 96, 134, | 725 | -52, -52, 140, -52, -52, -52, -52, 98, 95, -52, |
| 721 | 117, -75, -75, -75, -75, -75, -75, -75, -75, 150, | 726 | -52, 99, 114, 115, 116, 117, 96, 148, 149, 150, |
| 722 | 153, -75, -75, 98, 13, 14, 15, 16, 17, 18, | 727 | 158, 106, 155, 159, 97, 163, 118, -76, -76, -76, |
| 723 | 19, 20, 105, 155, 21, 22, 154, 130, 14, 15, | 728 | -76, -76, -76, -76, -76, 160, 164, -76, -76, 99, |
| 724 | 158, 17, 18, 19, 20, 90, 160, 21, 22, 179, | 729 | 13, 14, 15, 16, 17, 18, 19, 20, 91, 106, |
| 725 | 31, 163, 164, 165, 173, 89, 90, 162, 128, 170, | 730 | 21, 22, 14, 15, 140, 17, 18, 19, 20, 168, |
| 726 | 136, 172, 52, 31, 169, 171, 175, 176, 177, 178, | 731 | 175, 21, 22, 177, 181, 182, 183, 32, 187, 167, |
| 727 | 181, 182, 183, 50, 120, 74, 80, 157 | 732 | 188, 169, 170, 171, 185, 189, 53, 51, 32, 176, |
| 733 | 75, 178, 121, 0, 133, 162, 0, 0, 0, 0, | ||
| 734 | 184 | ||
| 728 | }; | 735 | }; |
| 729 | 736 | ||
| 730 | static const yytype_uint8 yycheck[] = | 737 | static const yytype_int16 yycheck[] = |
| 731 | { | 738 | { |
| 732 | 1, 66, 67, 10, 92, 93, 3, 25, 26, 14, | 739 | 1, 67, 68, 10, 93, 94, 76, 3, 76, 14, |
| 733 | 3, 29, 13, 27, 15, 103, 34, 18, 75, 33, | 740 | 28, 81, 13, 81, 15, 104, 34, 18, 3, 32, |
| 734 | 0, 78, 30, 80, 89, 90, 31, 32, 28, 25, | 741 | 33, 23, 26, 27, 90, 91, 30, 32, 33, 31, |
| 735 | 26, 31, 32, 30, 0, 1, 101, 30, 4, 5, | 742 | 78, 35, 80, 0, 1, 31, 102, 4, 5, 6, |
| 736 | 6, 7, 8, 9, 10, 11, 12, 30, 14, 15, | 743 | 7, 8, 9, 10, 11, 12, 31, 14, 15, 16, |
| 737 | 16, 17, 18, 19, 20, 21, 22, 23, 30, 25, | 744 | 17, 18, 19, 20, 21, 22, 23, 24, 78, 26, |
| 738 | 25, 68, 25, 151, 30, 30, 30, 0, 1, 25, | 745 | 80, 26, 69, 133, 31, 133, 31, 156, 26, 27, |
| 739 | 26, 4, 5, 6, 7, 8, 9, 10, 11, 12, | 746 | 29, 0, 1, 32, 33, 4, 5, 6, 7, 8, |
| 740 | 145, 14, 15, 16, 17, 18, 19, 20, 21, 22, | 747 | 9, 10, 11, 12, 150, 14, 15, 16, 17, 18, |
| 741 | 23, 75, 25, 25, 78, 160, 80, 30, 99, 30, | 748 | 19, 20, 21, 22, 23, 24, 0, 26, 164, 100, |
| 742 | 0, 1, 31, 32, 4, 5, 6, 7, 8, 9, | 749 | 77, 78, 31, 80, 77, 78, 31, 80, 31, 32, |
| 743 | 10, 11, 25, 114, 14, 15, 16, 17, 18, 19, | 750 | 33, 0, 1, 31, 115, 4, 5, 6, 7, 8, |
| 744 | 20, 21, 22, 76, 77, 25, 79, 0, 1, 1, | 751 | 9, 10, 11, 26, 27, 14, 15, 16, 17, 18, |
| 745 | 30, 4, 5, 6, 7, 8, 9, 10, 11, 1, | 752 | 19, 20, 21, 22, 23, 31, 26, 26, 31, 0, |
| 746 | 30, 14, 15, 16, 17, 18, 19, 20, 21, 22, | 753 | 1, 26, 31, 4, 5, 6, 7, 8, 9, 10, |
| 747 | 76, 77, 25, 79, 0, 1, 30, 30, 4, 5, | 754 | 11, 26, 31, 14, 15, 16, 17, 18, 19, 20, |
| 748 | 6, 7, 8, 9, 10, 11, 30, 30, 14, 15, | 755 | 21, 22, 23, 1, 1, 26, 31, 32, 33, 31, |
| 749 | 16, 17, 18, 19, 20, 21, 22, 30, 179, 25, | 756 | 31, 0, 1, 31, 31, 4, 5, 6, 7, 8, |
| 750 | 30, 1, 30, 30, 30, 5, 6, 30, 8, 9, | 757 | 9, 10, 11, 31, 185, 14, 15, 16, 17, 18, |
| 751 | 10, 11, 12, 30, 14, 15, 16, 17, 18, 19, | 758 | 19, 20, 21, 22, 23, 31, 1, 26, 31, 31, |
| 752 | 20, 30, 31, 32, 30, 25, 24, 77, 1, 79, | 759 | 5, 6, 31, 8, 9, 10, 11, 12, 31, 14, |
| 753 | 30, 4, 5, 6, 7, 8, 9, 10, 11, 25, | 760 | 15, 16, 17, 18, 19, 20, 31, 31, 31, 25, |
| 754 | 1, 14, 15, 16, 4, 5, 6, 7, 8, 9, | 761 | 1, 26, 26, 13, 1, 26, 31, 4, 5, 6, |
| 755 | 10, 11, 25, 30, 14, 15, 13, 30, 5, 6, | 762 | 7, 8, 9, 10, 11, 31, 14, 14, 15, 16, |
| 756 | 25, 8, 9, 10, 11, 32, 14, 14, 15, 33, | 763 | 4, 5, 6, 7, 8, 9, 10, 11, 33, 26, |
| 757 | 30, 148, 149, 150, 30, 31, 32, 30, 77, 156, | 764 | 14, 15, 5, 6, 31, 8, 9, 10, 11, 31, |
| 758 | 79, 158, 7, 30, 30, 30, 30, 30, 30, 166, | 765 | 31, 14, 15, 31, 31, 31, 31, 31, 31, 151, |
| 759 | 30, 30, 30, 6, 75, 36, 47, 115 | 766 | 31, 153, 154, 155, 34, 31, 7, 6, 31, 161, |
| 767 | 37, 163, 76, -1, 79, 116, -1, -1, -1, -1, | ||
| 768 | 172 | ||
| 760 | }; | 769 | }; |
| 761 | 770 | ||
| 762 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing | 771 | /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing |
| 763 | symbol of state STATE-NUM. */ | 772 | symbol of state STATE-NUM. */ |
| 764 | static const yytype_uint8 yystos[] = | 773 | static const yytype_uint8 yystos[] = |
| 765 | { | 774 | { |
| 766 | 0, 3, 30, 36, 37, 38, 62, 78, 25, 26, | 775 | 0, 3, 31, 37, 38, 39, 63, 81, 26, 27, |
| 767 | 76, 0, 1, 4, 5, 6, 7, 8, 9, 10, | 776 | 79, 0, 1, 4, 5, 6, 7, 8, 9, 10, |
| 768 | 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, | 777 | 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, |
| 769 | 25, 30, 39, 40, 42, 43, 44, 45, 51, 52, | 778 | 23, 26, 31, 40, 41, 43, 44, 45, 46, 52, |
| 770 | 54, 58, 60, 63, 64, 66, 68, 69, 70, 77, | 779 | 53, 55, 59, 61, 64, 65, 67, 69, 70, 71, |
| 771 | 38, 30, 37, 78, 30, 76, 30, 76, 25, 82, | 780 | 80, 39, 31, 38, 81, 31, 79, 31, 79, 26, |
| 772 | 30, 76, 25, 25, 25, 26, 29, 34, 80, 81, | 781 | 85, 31, 79, 26, 26, 26, 27, 30, 35, 83, |
| 773 | 30, 1, 1, 46, 46, 55, 57, 61, 73, 67, | 782 | 84, 31, 1, 1, 47, 47, 56, 58, 62, 76, |
| 774 | 73, 30, 30, 30, 30, 30, 30, 80, 80, 31, | 783 | 68, 74, 31, 31, 31, 31, 31, 31, 83, 83, |
| 775 | 32, 78, 27, 33, 30, 30, 1, 12, 16, 18, | 784 | 32, 33, 81, 28, 34, 31, 31, 1, 12, 16, |
| 776 | 19, 20, 21, 22, 23, 25, 30, 41, 47, 48, | 785 | 18, 19, 20, 21, 22, 24, 26, 31, 42, 48, |
| 777 | 71, 72, 74, 17, 18, 19, 20, 30, 41, 56, | 786 | 49, 72, 73, 75, 17, 18, 19, 20, 31, 42, |
| 778 | 72, 74, 40, 53, 77, 40, 54, 59, 66, 77, | 787 | 57, 73, 75, 41, 54, 80, 41, 55, 60, 67, |
| 779 | 30, 41, 74, 40, 54, 65, 66, 77, 28, 80, | 788 | 80, 23, 31, 74, 77, 41, 55, 66, 67, 80, |
| 780 | 80, 81, 81, 30, 30, 24, 76, 75, 76, 80, | 789 | 31, 42, 75, 29, 83, 83, 84, 84, 31, 31, |
| 781 | 25, 81, 49, 1, 13, 30, 76, 75, 25, 80, | 790 | 25, 79, 78, 79, 83, 26, 84, 50, 1, 13, |
| 782 | 14, 79, 30, 79, 79, 79, 81, 25, 30, 30, | 791 | 31, 79, 78, 26, 14, 82, 83, 82, 31, 82, |
| 783 | 79, 30, 79, 30, 80, 30, 30, 30, 79, 33, | 792 | 82, 82, 84, 26, 31, 31, 82, 31, 82, 83, |
| 784 | 50, 30, 30, 30, 76 | 793 | 31, 31, 31, 31, 82, 34, 51, 31, 31, 31, |
| 794 | 79 | ||
| 785 | }; | 795 | }; |
| 786 | 796 | ||
| 787 | #define yyerrok (yyerrstatus = 0) | 797 | #define yyerrok (yyerrstatus = 0) |
| @@ -1292,7 +1302,7 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
| 1292 | 1302 | ||
| 1293 | switch (yytype) | 1303 | switch (yytype) |
| 1294 | { | 1304 | { |
| 1295 | case 52: /* "choice_entry" */ | 1305 | case 53: /* "choice_entry" */ |
| 1296 | 1306 | ||
| 1297 | { | 1307 | { |
| 1298 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", | 1308 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", |
| @@ -1302,7 +1312,7 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
| 1302 | }; | 1312 | }; |
| 1303 | 1313 | ||
| 1304 | break; | 1314 | break; |
| 1305 | case 58: /* "if_entry" */ | 1315 | case 59: /* "if_entry" */ |
| 1306 | 1316 | ||
| 1307 | { | 1317 | { |
| 1308 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", | 1318 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", |
| @@ -1312,7 +1322,7 @@ yydestruct (yymsg, yytype, yyvaluep) | |||
| 1312 | }; | 1322 | }; |
| 1313 | 1323 | ||
| 1314 | break; | 1324 | break; |
| 1315 | case 64: /* "menu_entry" */ | 1325 | case 65: /* "menu_entry" */ |
| 1316 | 1326 | ||
| 1317 | { | 1327 | { |
| 1318 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", | 1328 | fprintf(stderr, "%s:%d: missing end statement for this entry\n", |
| @@ -1644,17 +1654,17 @@ yyreduce: | |||
| 1644 | { zconf_error("invalid statement"); ;} | 1654 | { zconf_error("invalid statement"); ;} |
| 1645 | break; | 1655 | break; |
| 1646 | 1656 | ||
| 1647 | case 27: | 1657 | case 28: |
| 1648 | 1658 | ||
| 1649 | { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} | 1659 | { zconf_error("unknown option \"%s\"", (yyvsp[(1) - (3)].string)); ;} |
| 1650 | break; | 1660 | break; |
| 1651 | 1661 | ||
| 1652 | case 28: | 1662 | case 29: |
| 1653 | 1663 | ||
| 1654 | { zconf_error("invalid option"); ;} | 1664 | { zconf_error("invalid option"); ;} |
| 1655 | break; | 1665 | break; |
| 1656 | 1666 | ||
| 1657 | case 29: | 1667 | case 30: |
| 1658 | 1668 | ||
| 1659 | { | 1669 | { |
| 1660 | struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); | 1670 | struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); |
| @@ -1664,7 +1674,7 @@ yyreduce: | |||
| 1664 | ;} | 1674 | ;} |
| 1665 | break; | 1675 | break; |
| 1666 | 1676 | ||
| 1667 | case 30: | 1677 | case 31: |
| 1668 | 1678 | ||
| 1669 | { | 1679 | { |
| 1670 | menu_end_entry(); | 1680 | menu_end_entry(); |
| @@ -1672,7 +1682,7 @@ yyreduce: | |||
| 1672 | ;} | 1682 | ;} |
| 1673 | break; | 1683 | break; |
| 1674 | 1684 | ||
| 1675 | case 31: | 1685 | case 32: |
| 1676 | 1686 | ||
| 1677 | { | 1687 | { |
| 1678 | struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); | 1688 | struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), 0); |
| @@ -1682,7 +1692,7 @@ yyreduce: | |||
| 1682 | ;} | 1692 | ;} |
| 1683 | break; | 1693 | break; |
| 1684 | 1694 | ||
| 1685 | case 32: | 1695 | case 33: |
| 1686 | 1696 | ||
| 1687 | { | 1697 | { |
| 1688 | if (current_entry->prompt) | 1698 | if (current_entry->prompt) |
| @@ -1694,7 +1704,7 @@ yyreduce: | |||
| 1694 | ;} | 1704 | ;} |
| 1695 | break; | 1705 | break; |
| 1696 | 1706 | ||
| 1697 | case 40: | 1707 | case 41: |
| 1698 | 1708 | ||
| 1699 | { | 1709 | { |
| 1700 | menu_set_type((yyvsp[(1) - (3)].id)->stype); | 1710 | menu_set_type((yyvsp[(1) - (3)].id)->stype); |
| @@ -1704,7 +1714,7 @@ yyreduce: | |||
| 1704 | ;} | 1714 | ;} |
| 1705 | break; | 1715 | break; |
| 1706 | 1716 | ||
| 1707 | case 41: | 1717 | case 42: |
| 1708 | 1718 | ||
| 1709 | { | 1719 | { |
| 1710 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); | 1720 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); |
| @@ -1712,7 +1722,7 @@ yyreduce: | |||
| 1712 | ;} | 1722 | ;} |
| 1713 | break; | 1723 | break; |
| 1714 | 1724 | ||
| 1715 | case 42: | 1725 | case 43: |
| 1716 | 1726 | ||
| 1717 | { | 1727 | { |
| 1718 | menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); | 1728 | menu_add_expr(P_DEFAULT, (yyvsp[(2) - (4)].expr), (yyvsp[(3) - (4)].expr)); |
| @@ -1724,7 +1734,7 @@ yyreduce: | |||
| 1724 | ;} | 1734 | ;} |
| 1725 | break; | 1735 | break; |
| 1726 | 1736 | ||
| 1727 | case 43: | 1737 | case 44: |
| 1728 | 1738 | ||
| 1729 | { | 1739 | { |
| 1730 | menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); | 1740 | menu_add_symbol(P_SELECT, sym_lookup((yyvsp[(2) - (4)].string), 0), (yyvsp[(3) - (4)].expr)); |
| @@ -1732,7 +1742,7 @@ yyreduce: | |||
| 1732 | ;} | 1742 | ;} |
| 1733 | break; | 1743 | break; |
| 1734 | 1744 | ||
| 1735 | case 44: | 1745 | case 45: |
| 1736 | 1746 | ||
| 1737 | { | 1747 | { |
| 1738 | menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); | 1748 | menu_add_expr(P_RANGE, expr_alloc_comp(E_RANGE,(yyvsp[(2) - (5)].symbol), (yyvsp[(3) - (5)].symbol)), (yyvsp[(4) - (5)].expr)); |
| @@ -1740,7 +1750,7 @@ yyreduce: | |||
| 1740 | ;} | 1750 | ;} |
| 1741 | break; | 1751 | break; |
| 1742 | 1752 | ||
| 1743 | case 47: | 1753 | case 48: |
| 1744 | 1754 | ||
| 1745 | { | 1755 | { |
| 1746 | struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); | 1756 | struct kconf_id *id = kconf_id_lookup((yyvsp[(2) - (3)].string), strlen((yyvsp[(2) - (3)].string))); |
| @@ -1752,17 +1762,17 @@ yyreduce: | |||
| 1752 | ;} | 1762 | ;} |
| 1753 | break; | 1763 | break; |
| 1754 | 1764 | ||
| 1755 | case 48: | 1765 | case 49: |
| 1756 | 1766 | ||
| 1757 | { (yyval.string) = NULL; ;} | 1767 | { (yyval.string) = NULL; ;} |
| 1758 | break; | 1768 | break; |
| 1759 | 1769 | ||
| 1760 | case 49: | 1770 | case 50: |
| 1761 | 1771 | ||
| 1762 | { (yyval.string) = (yyvsp[(2) - (2)].string); ;} | 1772 | { (yyval.string) = (yyvsp[(2) - (2)].string); ;} |
| 1763 | break; | 1773 | break; |
| 1764 | 1774 | ||
| 1765 | case 50: | 1775 | case 51: |
| 1766 | 1776 | ||
| 1767 | { | 1777 | { |
| 1768 | struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); | 1778 | struct symbol *sym = sym_lookup((yyvsp[(2) - (3)].string), SYMBOL_CHOICE); |
| @@ -1773,14 +1783,14 @@ yyreduce: | |||
| 1773 | ;} | 1783 | ;} |
| 1774 | break; | 1784 | break; |
| 1775 | 1785 | ||
| 1776 | case 51: | 1786 | case 52: |
| 1777 | 1787 | ||
| 1778 | { | 1788 | { |
| 1779 | (yyval.menu) = menu_add_menu(); | 1789 | (yyval.menu) = menu_add_menu(); |
| 1780 | ;} | 1790 | ;} |
| 1781 | break; | 1791 | break; |
| 1782 | 1792 | ||
| 1783 | case 52: | 1793 | case 53: |
| 1784 | 1794 | ||
| 1785 | { | 1795 | { |
| 1786 | if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { | 1796 | if (zconf_endtoken((yyvsp[(1) - (1)].id), T_CHOICE, T_ENDCHOICE)) { |
| @@ -1790,7 +1800,7 @@ yyreduce: | |||
| 1790 | ;} | 1800 | ;} |
| 1791 | break; | 1801 | break; |
| 1792 | 1802 | ||
| 1793 | case 60: | 1803 | case 61: |
| 1794 | 1804 | ||
| 1795 | { | 1805 | { |
| 1796 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); | 1806 | menu_add_prompt(P_PROMPT, (yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].expr)); |
| @@ -1798,7 +1808,7 @@ yyreduce: | |||
| 1798 | ;} | 1808 | ;} |
| 1799 | break; | 1809 | break; |
| 1800 | 1810 | ||
| 1801 | case 61: | 1811 | case 62: |
| 1802 | 1812 | ||
| 1803 | { | 1813 | { |
| 1804 | if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { | 1814 | if ((yyvsp[(1) - (3)].id)->stype == S_BOOLEAN || (yyvsp[(1) - (3)].id)->stype == S_TRISTATE) { |
| @@ -1811,7 +1821,7 @@ yyreduce: | |||
| 1811 | ;} | 1821 | ;} |
| 1812 | break; | 1822 | break; |
| 1813 | 1823 | ||
| 1814 | case 62: | 1824 | case 63: |
| 1815 | 1825 | ||
| 1816 | { | 1826 | { |
| 1817 | current_entry->sym->flags |= SYMBOL_OPTIONAL; | 1827 | current_entry->sym->flags |= SYMBOL_OPTIONAL; |
| @@ -1819,7 +1829,7 @@ yyreduce: | |||
| 1819 | ;} | 1829 | ;} |
| 1820 | break; | 1830 | break; |
| 1821 | 1831 | ||
| 1822 | case 63: | 1832 | case 64: |
| 1823 | 1833 | ||
| 1824 | { | 1834 | { |
| 1825 | if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { | 1835 | if ((yyvsp[(1) - (4)].id)->stype == S_UNKNOWN) { |
| @@ -1831,7 +1841,7 @@ yyreduce: | |||
| 1831 | ;} | 1841 | ;} |
| 1832 | break; | 1842 | break; |
| 1833 | 1843 | ||
| 1834 | case 66: | 1844 | case 67: |
| 1835 | 1845 | ||
| 1836 | { | 1846 | { |
| 1837 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); | 1847 | printd(DEBUG_PARSE, "%s:%d:if\n", zconf_curname(), zconf_lineno()); |
| @@ -1841,7 +1851,7 @@ yyreduce: | |||
| 1841 | ;} | 1851 | ;} |
| 1842 | break; | 1852 | break; |
| 1843 | 1853 | ||
| 1844 | case 67: | 1854 | case 68: |
| 1845 | 1855 | ||
| 1846 | { | 1856 | { |
| 1847 | if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { | 1857 | if (zconf_endtoken((yyvsp[(1) - (1)].id), T_IF, T_ENDIF)) { |
| @@ -1851,14 +1861,14 @@ yyreduce: | |||
| 1851 | ;} | 1861 | ;} |
| 1852 | break; | 1862 | break; |
| 1853 | 1863 | ||
| 1854 | case 73: | 1864 | case 74: |
| 1855 | 1865 | ||
| 1856 | { | 1866 | { |
| 1857 | menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); | 1867 | menu_add_prompt(P_MENU, (yyvsp[(2) - (3)].string), NULL); |
| 1858 | ;} | 1868 | ;} |
| 1859 | break; | 1869 | break; |
| 1860 | 1870 | ||
| 1861 | case 74: | 1871 | case 75: |
| 1862 | 1872 | ||
| 1863 | { | 1873 | { |
| 1864 | menu_add_entry(NULL); | 1874 | menu_add_entry(NULL); |
| @@ -1867,14 +1877,14 @@ yyreduce: | |||
| 1867 | ;} | 1877 | ;} |
| 1868 | break; | 1878 | break; |
| 1869 | 1879 | ||
| 1870 | case 75: | 1880 | case 76: |
| 1871 | 1881 | ||
| 1872 | { | 1882 | { |
| 1873 | (yyval.menu) = menu_add_menu(); | 1883 | (yyval.menu) = menu_add_menu(); |
| 1874 | ;} | 1884 | ;} |
| 1875 | break; | 1885 | break; |
| 1876 | 1886 | ||
| 1877 | case 76: | 1887 | case 77: |
| 1878 | 1888 | ||
| 1879 | { | 1889 | { |
| 1880 | if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { | 1890 | if (zconf_endtoken((yyvsp[(1) - (1)].id), T_MENU, T_ENDMENU)) { |
| @@ -1884,7 +1894,7 @@ yyreduce: | |||
| 1884 | ;} | 1894 | ;} |
| 1885 | break; | 1895 | break; |
| 1886 | 1896 | ||
| 1887 | case 82: | 1897 | case 83: |
| 1888 | 1898 | ||
| 1889 | { | 1899 | { |
| 1890 | printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); | 1900 | printd(DEBUG_PARSE, "%s:%d:source %s\n", zconf_curname(), zconf_lineno(), (yyvsp[(2) - (3)].string)); |
| @@ -1892,7 +1902,7 @@ yyreduce: | |||
| 1892 | ;} | 1902 | ;} |
| 1893 | break; | 1903 | break; |
| 1894 | 1904 | ||
| 1895 | case 83: | 1905 | case 84: |
| 1896 | 1906 | ||
| 1897 | { | 1907 | { |
| 1898 | menu_add_entry(NULL); | 1908 | menu_add_entry(NULL); |
| @@ -1901,14 +1911,14 @@ yyreduce: | |||
| 1901 | ;} | 1911 | ;} |
| 1902 | break; | 1912 | break; |
| 1903 | 1913 | ||
| 1904 | case 84: | 1914 | case 85: |
| 1905 | 1915 | ||
| 1906 | { | 1916 | { |
| 1907 | menu_end_entry(); | 1917 | menu_end_entry(); |
| 1908 | ;} | 1918 | ;} |
| 1909 | break; | 1919 | break; |
| 1910 | 1920 | ||
| 1911 | case 85: | 1921 | case 86: |
| 1912 | 1922 | ||
| 1913 | { | 1923 | { |
| 1914 | printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); | 1924 | printd(DEBUG_PARSE, "%s:%d:help\n", zconf_curname(), zconf_lineno()); |
| @@ -1916,14 +1926,14 @@ yyreduce: | |||
| 1916 | ;} | 1926 | ;} |
| 1917 | break; | 1927 | break; |
| 1918 | 1928 | ||
| 1919 | case 86: | 1929 | case 87: |
| 1920 | 1930 | ||
| 1921 | { | 1931 | { |
| 1922 | current_entry->help = (yyvsp[(2) - (2)].string); | 1932 | current_entry->help = (yyvsp[(2) - (2)].string); |
| 1923 | ;} | 1933 | ;} |
| 1924 | break; | 1934 | break; |
| 1925 | 1935 | ||
| 1926 | case 91: | 1936 | case 92: |
| 1927 | 1937 | ||
| 1928 | { | 1938 | { |
| 1929 | menu_add_dep((yyvsp[(3) - (4)].expr)); | 1939 | menu_add_dep((yyvsp[(3) - (4)].expr)); |
| @@ -1931,84 +1941,91 @@ yyreduce: | |||
| 1931 | ;} | 1941 | ;} |
| 1932 | break; | 1942 | break; |
| 1933 | 1943 | ||
| 1934 | case 93: | 1944 | case 96: |
| 1945 | |||
| 1946 | { | ||
| 1947 | menu_add_visibility((yyvsp[(2) - (2)].expr)); | ||
| 1948 | ;} | ||
| 1949 | break; | ||
| 1950 | |||
| 1951 | case 98: | ||
| 1935 | 1952 | ||
| 1936 | { | 1953 | { |
| 1937 | menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); | 1954 | menu_add_prompt(P_PROMPT, (yyvsp[(1) - (2)].string), (yyvsp[(2) - (2)].expr)); |
| 1938 | ;} | 1955 | ;} |
| 1939 | break; | 1956 | break; |
| 1940 | 1957 | ||
| 1941 | case 96: | 1958 | case 101: |
| 1942 | 1959 | ||
| 1943 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} | 1960 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} |
| 1944 | break; | 1961 | break; |
| 1945 | 1962 | ||
| 1946 | case 97: | 1963 | case 102: |
| 1947 | 1964 | ||
| 1948 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} | 1965 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} |
| 1949 | break; | 1966 | break; |
| 1950 | 1967 | ||
| 1951 | case 98: | 1968 | case 103: |
| 1952 | 1969 | ||
| 1953 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} | 1970 | { (yyval.id) = (yyvsp[(1) - (2)].id); ;} |
| 1954 | break; | 1971 | break; |
| 1955 | 1972 | ||
| 1956 | case 101: | 1973 | case 106: |
| 1957 | 1974 | ||
| 1958 | { (yyval.expr) = NULL; ;} | 1975 | { (yyval.expr) = NULL; ;} |
| 1959 | break; | 1976 | break; |
| 1960 | 1977 | ||
| 1961 | case 102: | 1978 | case 107: |
| 1962 | 1979 | ||
| 1963 | { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} | 1980 | { (yyval.expr) = (yyvsp[(2) - (2)].expr); ;} |
| 1964 | break; | 1981 | break; |
| 1965 | 1982 | ||
| 1966 | case 103: | 1983 | case 108: |
| 1967 | 1984 | ||
| 1968 | { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} | 1985 | { (yyval.expr) = expr_alloc_symbol((yyvsp[(1) - (1)].symbol)); ;} |
| 1969 | break; | 1986 | break; |
| 1970 | 1987 | ||
| 1971 | case 104: | 1988 | case 109: |
| 1972 | 1989 | ||
| 1973 | { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} | 1990 | { (yyval.expr) = expr_alloc_comp(E_EQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} |
| 1974 | break; | 1991 | break; |
| 1975 | 1992 | ||
| 1976 | case 105: | 1993 | case 110: |
| 1977 | 1994 | ||
| 1978 | { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} | 1995 | { (yyval.expr) = expr_alloc_comp(E_UNEQUAL, (yyvsp[(1) - (3)].symbol), (yyvsp[(3) - (3)].symbol)); ;} |
| 1979 | break; | 1996 | break; |
| 1980 | 1997 | ||
| 1981 | case 106: | 1998 | case 111: |
| 1982 | 1999 | ||
| 1983 | { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} | 2000 | { (yyval.expr) = (yyvsp[(2) - (3)].expr); ;} |
| 1984 | break; | 2001 | break; |
| 1985 | 2002 | ||
| 1986 | case 107: | 2003 | case 112: |
| 1987 | 2004 | ||
| 1988 | { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} | 2005 | { (yyval.expr) = expr_alloc_one(E_NOT, (yyvsp[(2) - (2)].expr)); ;} |
| 1989 | break; | 2006 | break; |
| 1990 | 2007 | ||
| 1991 | case 108: | 2008 | case 113: |
| 1992 | 2009 | ||
| 1993 | { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} | 2010 | { (yyval.expr) = expr_alloc_two(E_OR, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} |
| 1994 | break; | 2011 | break; |
| 1995 | 2012 | ||
| 1996 | case 109: | 2013 | case 114: |
| 1997 | 2014 | ||
| 1998 | { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} | 2015 | { (yyval.expr) = expr_alloc_two(E_AND, (yyvsp[(1) - (3)].expr), (yyvsp[(3) - (3)].expr)); ;} |
| 1999 | break; | 2016 | break; |
| 2000 | 2017 | ||
| 2001 | case 110: | 2018 | case 115: |
| 2002 | 2019 | ||
| 2003 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} | 2020 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), 0); free((yyvsp[(1) - (1)].string)); ;} |
| 2004 | break; | 2021 | break; |
| 2005 | 2022 | ||
| 2006 | case 111: | 2023 | case 116: |
| 2007 | 2024 | ||
| 2008 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} | 2025 | { (yyval.symbol) = sym_lookup((yyvsp[(1) - (1)].string), SYMBOL_CONST); free((yyvsp[(1) - (1)].string)); ;} |
| 2009 | break; | 2026 | break; |
| 2010 | 2027 | ||
| 2011 | case 112: | 2028 | case 117: |
| 2012 | 2029 | ||
| 2013 | { (yyval.string) = NULL; ;} | 2030 | { (yyval.string) = NULL; ;} |
| 2014 | break; | 2031 | break; |
| @@ -2278,6 +2295,7 @@ static const char *zconf_tokenname(int token) | |||
| 2278 | case T_IF: return "if"; | 2295 | case T_IF: return "if"; |
| 2279 | case T_ENDIF: return "endif"; | 2296 | case T_ENDIF: return "endif"; |
| 2280 | case T_DEPENDS: return "depends"; | 2297 | case T_DEPENDS: return "depends"; |
| 2298 | case T_VISIBLE: return "visible"; | ||
| 2281 | } | 2299 | } |
| 2282 | return "<token>"; | 2300 | return "<token>"; |
| 2283 | } | 2301 | } |
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y index 2abd3c7ff15d..49fb4ab664c3 100644 --- a/scripts/kconfig/zconf.y +++ b/scripts/kconfig/zconf.y | |||
| @@ -36,7 +36,7 @@ static struct menu *current_menu, *current_entry; | |||
| 36 | #define YYERROR_VERBOSE | 36 | #define YYERROR_VERBOSE |
| 37 | #endif | 37 | #endif |
| 38 | %} | 38 | %} |
| 39 | %expect 28 | 39 | %expect 30 |
| 40 | 40 | ||
| 41 | %union | 41 | %union |
| 42 | { | 42 | { |
| @@ -68,6 +68,7 @@ static struct menu *current_menu, *current_entry; | |||
| 68 | %token <id>T_DEFAULT | 68 | %token <id>T_DEFAULT |
| 69 | %token <id>T_SELECT | 69 | %token <id>T_SELECT |
| 70 | %token <id>T_RANGE | 70 | %token <id>T_RANGE |
| 71 | %token <id>T_VISIBLE | ||
| 71 | %token <id>T_OPTION | 72 | %token <id>T_OPTION |
| 72 | %token <id>T_ON | 73 | %token <id>T_ON |
| 73 | %token <string> T_WORD | 74 | %token <string> T_WORD |
| @@ -123,7 +124,7 @@ stmt_list: | |||
| 123 | ; | 124 | ; |
| 124 | 125 | ||
| 125 | option_name: | 126 | option_name: |
| 126 | T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | 127 | T_DEPENDS | T_PROMPT | T_TYPE | T_SELECT | T_OPTIONAL | T_RANGE | T_DEFAULT | T_VISIBLE |
| 127 | ; | 128 | ; |
| 128 | 129 | ||
| 129 | common_stmt: | 130 | common_stmt: |
| @@ -359,7 +360,7 @@ menu: T_MENU prompt T_EOL | |||
| 359 | printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); | 360 | printd(DEBUG_PARSE, "%s:%d:menu\n", zconf_curname(), zconf_lineno()); |
| 360 | }; | 361 | }; |
| 361 | 362 | ||
| 362 | menu_entry: menu depends_list | 363 | menu_entry: menu visibility_list depends_list |
| 363 | { | 364 | { |
| 364 | $$ = menu_add_menu(); | 365 | $$ = menu_add_menu(); |
| 365 | }; | 366 | }; |
| @@ -430,6 +431,19 @@ depends: T_DEPENDS T_ON expr T_EOL | |||
| 430 | printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); | 431 | printd(DEBUG_PARSE, "%s:%d:depends on\n", zconf_curname(), zconf_lineno()); |
| 431 | }; | 432 | }; |
| 432 | 433 | ||
| 434 | /* visibility option */ | ||
| 435 | |||
| 436 | visibility_list: | ||
| 437 | /* empty */ | ||
| 438 | | visibility_list visible | ||
| 439 | | visibility_list T_EOL | ||
| 440 | ; | ||
| 441 | |||
| 442 | visible: T_VISIBLE if_expr | ||
| 443 | { | ||
| 444 | menu_add_visibility($2); | ||
| 445 | }; | ||
| 446 | |||
| 433 | /* prompt statement */ | 447 | /* prompt statement */ |
| 434 | 448 | ||
| 435 | prompt_stmt_opt: | 449 | prompt_stmt_opt: |
| @@ -526,6 +540,7 @@ static const char *zconf_tokenname(int token) | |||
| 526 | case T_IF: return "if"; | 540 | case T_IF: return "if"; |
| 527 | case T_ENDIF: return "endif"; | 541 | case T_ENDIF: return "endif"; |
| 528 | case T_DEPENDS: return "depends"; | 542 | case T_DEPENDS: return "depends"; |
| 543 | case T_VISIBLE: return "visible"; | ||
| 529 | } | 544 | } |
| 530 | return "<token>"; | 545 | return "<token>"; |
| 531 | } | 546 | } |
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c index 5c8c7dff8ede..b753ec661fcf 100644 --- a/sound/core/oss/pcm_oss.c +++ b/sound/core/oss/pcm_oss.c | |||
| @@ -1510,16 +1510,19 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use | |||
| 1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) | 1510 | static int snd_pcm_oss_reset(struct snd_pcm_oss_file *pcm_oss_file) |
| 1511 | { | 1511 | { |
| 1512 | struct snd_pcm_substream *substream; | 1512 | struct snd_pcm_substream *substream; |
| 1513 | struct snd_pcm_runtime *runtime; | ||
| 1514 | int i; | ||
| 1513 | 1515 | ||
| 1514 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK]; | 1516 | for (i = 0; i < 2; i++) { |
| 1515 | if (substream != NULL) { | 1517 | substream = pcm_oss_file->streams[i]; |
| 1516 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1518 | if (!substream) |
| 1517 | substream->runtime->oss.prepare = 1; | 1519 | continue; |
| 1518 | } | 1520 | runtime = substream->runtime; |
| 1519 | substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_CAPTURE]; | ||
| 1520 | if (substream != NULL) { | ||
| 1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); | 1521 | snd_pcm_kernel_ioctl(substream, SNDRV_PCM_IOCTL_DROP, NULL); |
| 1522 | substream->runtime->oss.prepare = 1; | 1522 | runtime->oss.prepare = 1; |
| 1523 | runtime->oss.buffer_used = 0; | ||
| 1524 | runtime->oss.prev_hw_ptr_period = 0; | ||
| 1525 | runtime->oss.period_ptr = 0; | ||
| 1523 | } | 1526 | } |
| 1524 | return 0; | 1527 | return 0; |
| 1525 | } | 1528 | } |
diff --git a/sound/pci/hda/hda_eld.c b/sound/pci/hda/hda_eld.c index cb0c23a6b473..4a663471dadc 100644 --- a/sound/pci/hda/hda_eld.c +++ b/sound/pci/hda/hda_eld.c | |||
| @@ -189,6 +189,9 @@ static void hdmi_update_short_audio_desc(struct cea_sad *a, | |||
| 189 | a->channels = GRAB_BITS(buf, 0, 0, 3); | 189 | a->channels = GRAB_BITS(buf, 0, 0, 3); |
| 190 | a->channels++; | 190 | a->channels++; |
| 191 | 191 | ||
| 192 | a->sample_bits = 0; | ||
| 193 | a->max_bitrate = 0; | ||
| 194 | |||
| 192 | a->format = GRAB_BITS(buf, 0, 3, 4); | 195 | a->format = GRAB_BITS(buf, 0, 3, 4); |
| 193 | switch (a->format) { | 196 | switch (a->format) { |
| 194 | case AUDIO_CODING_TYPE_REF_STREAM_HEADER: | 197 | case AUDIO_CODING_TYPE_REF_STREAM_HEADER: |
| @@ -198,7 +201,6 @@ static void hdmi_update_short_audio_desc(struct cea_sad *a, | |||
| 198 | 201 | ||
| 199 | case AUDIO_CODING_TYPE_LPCM: | 202 | case AUDIO_CODING_TYPE_LPCM: |
| 200 | val = GRAB_BITS(buf, 2, 0, 3); | 203 | val = GRAB_BITS(buf, 2, 0, 3); |
| 201 | a->sample_bits = 0; | ||
| 202 | for (i = 0; i < 3; i++) | 204 | for (i = 0; i < 3; i++) |
| 203 | if (val & (1 << i)) | 205 | if (val & (1 << i)) |
| 204 | a->sample_bits |= cea_sample_sizes[i + 1]; | 206 | a->sample_bits |= cea_sample_sizes[i + 1]; |
| @@ -598,24 +600,19 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, | |||
| 598 | { | 600 | { |
| 599 | int i; | 601 | int i; |
| 600 | 602 | ||
| 601 | pcm->rates = 0; | 603 | /* assume basic audio support (the basic audio flag is not in ELD; |
| 602 | pcm->formats = 0; | 604 | * however, all audio capable sinks are required to support basic |
| 603 | pcm->maxbps = 0; | 605 | * audio) */ |
| 604 | pcm->channels_min = -1; | 606 | pcm->rates = SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; |
| 605 | pcm->channels_max = 0; | 607 | pcm->formats = SNDRV_PCM_FMTBIT_S16_LE; |
| 608 | pcm->maxbps = 16; | ||
| 609 | pcm->channels_max = 2; | ||
| 606 | for (i = 0; i < eld->sad_count; i++) { | 610 | for (i = 0; i < eld->sad_count; i++) { |
| 607 | struct cea_sad *a = &eld->sad[i]; | 611 | struct cea_sad *a = &eld->sad[i]; |
| 608 | pcm->rates |= a->rates; | 612 | pcm->rates |= a->rates; |
| 609 | if (a->channels < pcm->channels_min) | ||
| 610 | pcm->channels_min = a->channels; | ||
| 611 | if (a->channels > pcm->channels_max) | 613 | if (a->channels > pcm->channels_max) |
| 612 | pcm->channels_max = a->channels; | 614 | pcm->channels_max = a->channels; |
| 613 | if (a->format == AUDIO_CODING_TYPE_LPCM) { | 615 | if (a->format == AUDIO_CODING_TYPE_LPCM) { |
| 614 | if (a->sample_bits & AC_SUPPCM_BITS_16) { | ||
| 615 | pcm->formats |= SNDRV_PCM_FMTBIT_S16_LE; | ||
| 616 | if (pcm->maxbps < 16) | ||
| 617 | pcm->maxbps = 16; | ||
| 618 | } | ||
| 619 | if (a->sample_bits & AC_SUPPCM_BITS_20) { | 616 | if (a->sample_bits & AC_SUPPCM_BITS_20) { |
| 620 | pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; | 617 | pcm->formats |= SNDRV_PCM_FMTBIT_S32_LE; |
| 621 | if (pcm->maxbps < 20) | 618 | if (pcm->maxbps < 20) |
| @@ -635,7 +632,6 @@ void hdmi_eld_update_pcm_info(struct hdmi_eld *eld, struct hda_pcm_stream *pcm, | |||
| 635 | /* restrict the parameters by the values the codec provides */ | 632 | /* restrict the parameters by the values the codec provides */ |
| 636 | pcm->rates &= codec_pars->rates; | 633 | pcm->rates &= codec_pars->rates; |
| 637 | pcm->formats &= codec_pars->formats; | 634 | pcm->formats &= codec_pars->formats; |
| 638 | pcm->channels_min = max(pcm->channels_min, codec_pars->channels_min); | ||
| 639 | pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); | 635 | pcm->channels_max = min(pcm->channels_max, codec_pars->channels_max); |
| 640 | pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); | 636 | pcm->maxbps = min(pcm->maxbps, codec_pars->maxbps); |
| 641 | } | 637 | } |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index 21aa9b0e28f6..b030c8eba21f 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
| @@ -2296,6 +2296,7 @@ static int azx_dev_free(struct snd_device *device) | |||
| 2296 | */ | 2296 | */ |
| 2297 | static struct snd_pci_quirk position_fix_list[] __devinitdata = { | 2297 | static struct snd_pci_quirk position_fix_list[] __devinitdata = { |
| 2298 | SND_PCI_QUIRK(0x1025, 0x009f, "Acer Aspire 5110", POS_FIX_LPIB), | 2298 | SND_PCI_QUIRK(0x1025, 0x009f, "Acer Aspire 5110", POS_FIX_LPIB), |
| 2299 | SND_PCI_QUIRK(0x1025, 0x026f, "Acer Aspire 5538", POS_FIX_LPIB), | ||
| 2299 | SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), | 2300 | SND_PCI_QUIRK(0x1028, 0x01cc, "Dell D820", POS_FIX_LPIB), |
| 2300 | SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), | 2301 | SND_PCI_QUIRK(0x1028, 0x01de, "Dell Precision 390", POS_FIX_LPIB), |
| 2301 | SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB), | 2302 | SND_PCI_QUIRK(0x1028, 0x01f6, "Dell Latitude 131L", POS_FIX_LPIB), |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 846d1ead47fd..76bd58a0e2b6 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
| @@ -2116,8 +2116,8 @@ static void cxt5066_update_speaker(struct hda_codec *codec) | |||
| 2116 | struct conexant_spec *spec = codec->spec; | 2116 | struct conexant_spec *spec = codec->spec; |
| 2117 | unsigned int pinctl; | 2117 | unsigned int pinctl; |
| 2118 | 2118 | ||
| 2119 | snd_printdd("CXT5066: update speaker, hp_present=%d\n", | 2119 | snd_printdd("CXT5066: update speaker, hp_present=%d, cur_eapd=%d\n", |
| 2120 | spec->hp_present); | 2120 | spec->hp_present, spec->cur_eapd); |
| 2121 | 2121 | ||
| 2122 | /* Port A (HP) */ | 2122 | /* Port A (HP) */ |
| 2123 | pinctl = ((spec->hp_present & 1) && spec->cur_eapd) ? PIN_HP : 0; | 2123 | pinctl = ((spec->hp_present & 1) && spec->cur_eapd) ? PIN_HP : 0; |
| @@ -2125,11 +2125,20 @@ static void cxt5066_update_speaker(struct hda_codec *codec) | |||
| 2125 | pinctl); | 2125 | pinctl); |
| 2126 | 2126 | ||
| 2127 | /* Port D (HP/LO) */ | 2127 | /* Port D (HP/LO) */ |
| 2128 | pinctl = ((spec->hp_present & 2) && spec->cur_eapd) | 2128 | if (spec->dell_automute) { |
| 2129 | ? spec->port_d_mode : 0; | 2129 | /* DELL AIO Port Rule: PortA> PortD> IntSpk */ |
| 2130 | /* Mute if Port A is connected on Thinkpad */ | 2130 | pinctl = (!(spec->hp_present & 1) && spec->cur_eapd) |
| 2131 | if (spec->thinkpad && (spec->hp_present & 1)) | 2131 | ? PIN_OUT : 0; |
| 2132 | pinctl = 0; | 2132 | } else if (spec->thinkpad) { |
| 2133 | if (spec->cur_eapd) | ||
| 2134 | pinctl = spec->port_d_mode; | ||
| 2135 | /* Mute dock line-out if Port A (laptop HP) is present */ | ||
| 2136 | if (spec->hp_present& 1) | ||
| 2137 | pinctl = 0; | ||
| 2138 | } else { | ||
| 2139 | pinctl = ((spec->hp_present & 2) && spec->cur_eapd) | ||
| 2140 | ? spec->port_d_mode : 0; | ||
| 2141 | } | ||
| 2133 | snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 2142 | snd_hda_codec_write(codec, 0x1c, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 2134 | pinctl); | 2143 | pinctl); |
| 2135 | 2144 | ||
| @@ -2137,14 +2146,6 @@ static void cxt5066_update_speaker(struct hda_codec *codec) | |||
| 2137 | pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; | 2146 | pinctl = (!spec->hp_present && spec->cur_eapd) ? PIN_OUT : 0; |
| 2138 | snd_hda_codec_write(codec, 0x1f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, | 2147 | snd_hda_codec_write(codec, 0x1f, 0, AC_VERB_SET_PIN_WIDGET_CONTROL, |
| 2139 | pinctl); | 2148 | pinctl); |
| 2140 | |||
| 2141 | if (spec->dell_automute) { | ||
| 2142 | /* DELL AIO Port Rule: PortA > PortD > IntSpk */ | ||
| 2143 | pinctl = (!(spec->hp_present & 1) && spec->cur_eapd) | ||
| 2144 | ? PIN_OUT : 0; | ||
| 2145 | snd_hda_codec_write(codec, 0x1c, 0, | ||
| 2146 | AC_VERB_SET_PIN_WIDGET_CONTROL, pinctl); | ||
| 2147 | } | ||
| 2148 | } | 2149 | } |
| 2149 | 2150 | ||
| 2150 | /* turn on/off EAPD (+ mute HP) as a master switch */ | 2151 | /* turn on/off EAPD (+ mute HP) as a master switch */ |
| @@ -3095,8 +3096,7 @@ static const char *cxt5066_models[CXT5066_MODELS] = { | |||
| 3095 | static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | 3096 | static struct snd_pci_quirk cxt5066_cfg_tbl[] = { |
| 3096 | SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), | 3097 | SND_PCI_QUIRK_MASK(0x1025, 0xff00, 0x0400, "Acer", CXT5066_IDEAPAD), |
| 3097 | SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3098 | SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO), |
| 3098 | SND_PCI_QUIRK(0x1028, 0x02f5, "Dell", | 3099 | SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD), |
| 3099 | CXT5066_DELL_LAPTOP), | ||
| 3100 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), | 3100 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO), |
| 3101 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | 3101 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), |
| 3102 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), | 3102 | SND_PCI_QUIRK(0x103c, 0x360b, "HP G60", CXT5066_HP_LAPTOP), |
| @@ -3109,6 +3109,7 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
| 3109 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), | 3109 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), |
| 3110 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), | 3110 | SND_PCI_QUIRK(0x17aa, 0x20f2, "Lenovo T400s", CXT5066_THINKPAD), |
| 3111 | SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD), | 3111 | SND_PCI_QUIRK(0x17aa, 0x21b2, "Thinkpad X100e", CXT5066_IDEAPAD), |
| 3112 | SND_PCI_QUIRK(0x17aa, 0x21c5, "Thinkpad Edge 13", CXT5066_THINKPAD), | ||
| 3112 | SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD), | 3113 | SND_PCI_QUIRK(0x17aa, 0x21b3, "Thinkpad Edge 13 (197)", CXT5066_IDEAPAD), |
| 3113 | SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), | 3114 | SND_PCI_QUIRK(0x17aa, 0x21b4, "Thinkpad Edge", CXT5066_IDEAPAD), |
| 3114 | SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD), | 3115 | SND_PCI_QUIRK(0x17aa, 0x21c8, "Thinkpad Edge 11", CXT5066_IDEAPAD), |
diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index d3e49aa5b9ec..31df7747990d 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c | |||
| @@ -834,7 +834,6 @@ static int hdmi_pcm_open(struct hda_pcm_stream *hinfo, | |||
| 834 | return -ENODEV; | 834 | return -ENODEV; |
| 835 | } else { | 835 | } else { |
| 836 | /* fallback to the codec default */ | 836 | /* fallback to the codec default */ |
| 837 | hinfo->channels_min = codec_pars->channels_min; | ||
| 838 | hinfo->channels_max = codec_pars->channels_max; | 837 | hinfo->channels_max = codec_pars->channels_max; |
| 839 | hinfo->rates = codec_pars->rates; | 838 | hinfo->rates = codec_pars->rates; |
| 840 | hinfo->formats = codec_pars->formats; | 839 | hinfo->formats = codec_pars->formats; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 886d7c72936e..2d7d7de8498a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -4595,6 +4595,7 @@ static struct snd_pci_quirk alc880_cfg_tbl[] = { | |||
| 4595 | SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU), | 4595 | SND_PCI_QUIRK(0x1734, 0x10b0, "Fujitsu", ALC880_FUJITSU), |
| 4596 | SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW), | 4596 | SND_PCI_QUIRK(0x1854, 0x0018, "LG LW20", ALC880_LG_LW), |
| 4597 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG), | 4597 | SND_PCI_QUIRK(0x1854, 0x003b, "LG", ALC880_LG), |
| 4598 | SND_PCI_QUIRK(0x1854, 0x005f, "LG P1 Express", ALC880_LG), | ||
| 4598 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG), | 4599 | SND_PCI_QUIRK(0x1854, 0x0068, "LG w1", ALC880_LG), |
| 4599 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW), | 4600 | SND_PCI_QUIRK(0x1854, 0x0077, "LG LW25", ALC880_LG_LW), |
| 4600 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700), | 4601 | SND_PCI_QUIRK(0x19db, 0x4188, "TCL S700", ALC880_TCL_S700), |
| @@ -9865,7 +9866,6 @@ static struct snd_pci_quirk alc882_cfg_tbl[] = { | |||
| 9865 | SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763), | 9866 | SND_PCI_QUIRK(0x17aa, 0x3bfc, "Lenovo NB0763", ALC883_LENOVO_NB0763), |
| 9866 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), | 9867 | SND_PCI_QUIRK(0x17aa, 0x3bfd, "Lenovo NB0763", ALC883_LENOVO_NB0763), |
| 9867 | SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), | 9868 | SND_PCI_QUIRK(0x17aa, 0x101d, "Lenovo Sky", ALC888_LENOVO_SKY), |
| 9868 | SND_PCI_QUIRK(0x17c0, 0x4071, "MEDION MD2", ALC883_MEDION_MD2), | ||
| 9869 | SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), | 9869 | SND_PCI_QUIRK(0x17c0, 0x4085, "MEDION MD96630", ALC888_LENOVO_MS7195_DIG), |
| 9870 | SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), | 9870 | SND_PCI_QUIRK(0x17f2, 0x5000, "Albatron KI690-AM2", ALC883_6ST_DIG), |
| 9871 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), | 9871 | SND_PCI_QUIRK(0x1991, 0x5625, "Haier W66", ALC883_HAIER_W66), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 5c710807dfe5..efa4225f5fd6 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -1627,6 +1627,8 @@ static struct snd_pci_quirk stac92hd73xx_cfg_tbl[] = { | |||
| 1627 | static struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = { | 1627 | static struct snd_pci_quirk stac92hd73xx_codec_id_cfg_tbl[] = { |
| 1628 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1, | 1628 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x02a1, |
| 1629 | "Alienware M17x", STAC_ALIENWARE_M17X), | 1629 | "Alienware M17x", STAC_ALIENWARE_M17X), |
| 1630 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x043a, | ||
| 1631 | "Alienware M17x", STAC_ALIENWARE_M17X), | ||
| 1630 | {} /* terminator */ | 1632 | {} /* terminator */ |
| 1631 | }; | 1633 | }; |
| 1632 | 1634 | ||
diff --git a/sound/soc/codecs/wm8580.c b/sound/soc/codecs/wm8580.c index a2e0ed59b376..879dff2714dd 100644 --- a/sound/soc/codecs/wm8580.c +++ b/sound/soc/codecs/wm8580.c | |||
| @@ -491,16 +491,16 @@ static int wm8580_paif_hw_params(struct snd_pcm_substream *substream, | |||
| 491 | paifa |= 0x8; | 491 | paifa |= 0x8; |
| 492 | break; | 492 | break; |
| 493 | case SNDRV_PCM_FORMAT_S20_3LE: | 493 | case SNDRV_PCM_FORMAT_S20_3LE: |
| 494 | paifa |= 0x10; | 494 | paifa |= 0x0; |
| 495 | paifb |= WM8580_AIF_LENGTH_20; | 495 | paifb |= WM8580_AIF_LENGTH_20; |
| 496 | break; | 496 | break; |
| 497 | case SNDRV_PCM_FORMAT_S24_LE: | 497 | case SNDRV_PCM_FORMAT_S24_LE: |
| 498 | paifa |= 0x10; | 498 | paifa |= 0x0; |
| 499 | paifb |= WM8580_AIF_LENGTH_24; | 499 | paifb |= WM8580_AIF_LENGTH_24; |
| 500 | break; | 500 | break; |
| 501 | case SNDRV_PCM_FORMAT_S32_LE: | 501 | case SNDRV_PCM_FORMAT_S32_LE: |
| 502 | paifa |= 0x10; | 502 | paifa |= 0x0; |
| 503 | paifb |= WM8580_AIF_LENGTH_24; | 503 | paifb |= WM8580_AIF_LENGTH_32; |
| 504 | break; | 504 | break; |
| 505 | default: | 505 | default: |
| 506 | return -EINVAL; | 506 | return -EINVAL; |
diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c index 631385802eb4..e725c09a3e79 100644 --- a/sound/soc/codecs/wm8731.c +++ b/sound/soc/codecs/wm8731.c | |||
| @@ -526,7 +526,7 @@ static int wm8731_probe(struct snd_soc_codec *codec) | |||
| 526 | snd_soc_update_bits(codec, WM8731_RINVOL, 0x100, 0); | 526 | snd_soc_update_bits(codec, WM8731_RINVOL, 0x100, 0); |
| 527 | 527 | ||
| 528 | /* Disable bypass path by default */ | 528 | /* Disable bypass path by default */ |
| 529 | snd_soc_update_bits(codec, WM8731_APANA, 0x4, 0); | 529 | snd_soc_update_bits(codec, WM8731_APANA, 0x8, 0); |
| 530 | 530 | ||
| 531 | snd_soc_add_controls(codec, wm8731_snd_controls, | 531 | snd_soc_add_controls(codec, wm8731_snd_controls, |
| 532 | ARRAY_SIZE(wm8731_snd_controls)); | 532 | ARRAY_SIZE(wm8731_snd_controls)); |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index e8092745a207..1304ca91a11c 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
| @@ -3339,7 +3339,7 @@ static irqreturn_t wm8962_irq(int irq, void *data) | |||
| 3339 | int mask; | 3339 | int mask; |
| 3340 | int active; | 3340 | int active; |
| 3341 | 3341 | ||
| 3342 | mask = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); | 3342 | mask = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2_MASK); |
| 3343 | 3343 | ||
| 3344 | active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); | 3344 | active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); |
| 3345 | active &= ~mask; | 3345 | active &= ~mask; |
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 19ca782ac970..0e24092722c3 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
| @@ -293,7 +293,7 @@ SOC_DOUBLE_R("Speaker Switch", | |||
| 293 | SOC_DOUBLE_R("Speaker ZC Switch", | 293 | SOC_DOUBLE_R("Speaker ZC Switch", |
| 294 | WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT, | 294 | WM8993_SPEAKER_VOLUME_LEFT, WM8993_SPEAKER_VOLUME_RIGHT, |
| 295 | 7, 1, 0), | 295 | 7, 1, 0), |
| 296 | SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 0, 3, 7, 0, | 296 | SOC_DOUBLE_TLV("Speaker Boost Volume", WM8993_SPKOUT_BOOST, 3, 0, 7, 0, |
| 297 | spkboost_tlv), | 297 | spkboost_tlv), |
| 298 | SOC_ENUM("Speaker Reference", speaker_ref), | 298 | SOC_ENUM("Speaker Reference", speaker_ref), |
| 299 | SOC_ENUM("Speaker Mode", speaker_mode), | 299 | SOC_ENUM("Speaker Mode", speaker_mode), |
diff --git a/sound/soc/fsl/mpc8610_hpcd.c b/sound/soc/fsl/mpc8610_hpcd.c index 0d7dcf1e4863..7d7847a1e66b 100644 --- a/sound/soc/fsl/mpc8610_hpcd.c +++ b/sound/soc/fsl/mpc8610_hpcd.c | |||
| @@ -498,6 +498,7 @@ static int mpc8610_hpcd_probe(struct platform_device *pdev) | |||
| 498 | dev_err(&pdev->dev, "platform device add failed\n"); | 498 | dev_err(&pdev->dev, "platform device add failed\n"); |
| 499 | goto error; | 499 | goto error; |
| 500 | } | 500 | } |
| 501 | dev_set_drvdata(&pdev->dev, sound_device); | ||
| 501 | 502 | ||
| 502 | of_node_put(codec_np); | 503 | of_node_put(codec_np); |
| 503 | 504 | ||
diff --git a/sound/soc/fsl/p1022_ds.c b/sound/soc/fsl/p1022_ds.c index 63b9eaa1ebc2..026b756961e0 100644 --- a/sound/soc/fsl/p1022_ds.c +++ b/sound/soc/fsl/p1022_ds.c | |||
| @@ -498,6 +498,7 @@ static int p1022_ds_probe(struct platform_device *pdev) | |||
| 498 | dev_err(&pdev->dev, "platform device add failed\n"); | 498 | dev_err(&pdev->dev, "platform device add failed\n"); |
| 499 | goto error; | 499 | goto error; |
| 500 | } | 500 | } |
| 501 | dev_set_drvdata(&pdev->dev, sound_device); | ||
| 501 | 502 | ||
| 502 | of_node_put(codec_np); | 503 | of_node_put(codec_np); |
| 503 | 504 | ||
diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index e00e39dd6576..dac6732da969 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c | |||
| @@ -49,7 +49,7 @@ static unsigned short nuc900_ac97_read(struct snd_ac97 *ac97, | |||
| 49 | mutex_lock(&ac97_mutex); | 49 | mutex_lock(&ac97_mutex); |
| 50 | 50 | ||
| 51 | val = nuc900_checkready(); | 51 | val = nuc900_checkready(); |
| 52 | if (!!val) { | 52 | if (val) { |
| 53 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 53 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
| 54 | goto out; | 54 | goto out; |
| 55 | } | 55 | } |
| @@ -102,7 +102,7 @@ static void nuc900_ac97_write(struct snd_ac97 *ac97, unsigned short reg, | |||
| 102 | mutex_lock(&ac97_mutex); | 102 | mutex_lock(&ac97_mutex); |
| 103 | 103 | ||
| 104 | tmp = nuc900_checkready(); | 104 | tmp = nuc900_checkready(); |
| 105 | if (!!tmp) | 105 | if (tmp) |
| 106 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 106 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
| 107 | 107 | ||
| 108 | /* clear the R_WB bit and write register index */ | 108 | /* clear the R_WB bit and write register index */ |
| @@ -149,7 +149,7 @@ static void nuc900_ac97_warm_reset(struct snd_ac97 *ac97) | |||
| 149 | udelay(100); | 149 | udelay(100); |
| 150 | 150 | ||
| 151 | val = nuc900_checkready(); | 151 | val = nuc900_checkready(); |
| 152 | if (!!val) | 152 | if (val) |
| 153 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); | 153 | dev_err(nuc900_audio->dev, "AC97 codec is not ready\n"); |
| 154 | 154 | ||
| 155 | mutex_unlock(&ac97_mutex); | 155 | mutex_unlock(&ac97_mutex); |
| @@ -263,8 +263,7 @@ static int nuc900_ac97_trigger(struct snd_pcm_substream *substream, | |||
| 263 | return ret; | 263 | return ret; |
| 264 | } | 264 | } |
| 265 | 265 | ||
| 266 | static int nuc900_ac97_probe(struct platform_device *pdev, | 266 | static int nuc900_ac97_probe(struct snd_soc_dai *dai) |
| 267 | struct snd_soc_dai *dai) | ||
| 268 | { | 267 | { |
| 269 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; | 268 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; |
| 270 | unsigned long val; | 269 | unsigned long val; |
| @@ -284,12 +283,12 @@ static int nuc900_ac97_probe(struct platform_device *pdev, | |||
| 284 | return 0; | 283 | return 0; |
| 285 | } | 284 | } |
| 286 | 285 | ||
| 287 | static void nuc900_ac97_remove(struct platform_device *pdev, | 286 | static int nuc900_ac97_remove(struct snd_soc_dai *dai) |
| 288 | struct snd_soc_dai *dai) | ||
| 289 | { | 287 | { |
| 290 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; | 288 | struct nuc900_audio *nuc900_audio = nuc900_ac97_data; |
| 291 | 289 | ||
| 292 | clk_disable(nuc900_audio->clk); | 290 | clk_disable(nuc900_audio->clk); |
| 291 | return 0; | ||
| 293 | } | 292 | } |
| 294 | 293 | ||
| 295 | static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { | 294 | static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { |
| @@ -313,7 +312,7 @@ static struct snd_soc_dai_driver nuc900_ac97_dai = { | |||
| 313 | .channels_max = 2, | 312 | .channels_max = 2, |
| 314 | }, | 313 | }, |
| 315 | .ops = &nuc900_ac97_dai_ops, | 314 | .ops = &nuc900_ac97_dai_ops, |
| 316 | } | 315 | }; |
| 317 | 316 | ||
| 318 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) | 317 | static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) |
| 319 | { | 318 | { |
diff --git a/sound/soc/nuc900/nuc900-audio.h b/sound/soc/nuc900/nuc900-audio.h index aeed8ead2b2b..59f7e8ed1a68 100644 --- a/sound/soc/nuc900/nuc900-audio.h +++ b/sound/soc/nuc900/nuc900-audio.h | |||
| @@ -110,4 +110,6 @@ struct nuc900_audio { | |||
| 110 | 110 | ||
| 111 | }; | 111 | }; |
| 112 | 112 | ||
| 113 | extern struct nuc900_audio *nuc900_ac97_data; | ||
| 114 | |||
| 113 | #endif /*end _NUC900_AUDIO_H */ | 115 | #endif /*end _NUC900_AUDIO_H */ |
diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index 195d1ac94771..8263f56dc665 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c | |||
| @@ -50,12 +50,12 @@ static int nuc900_dma_hw_params(struct snd_pcm_substream *substream, | |||
| 50 | unsigned long flags; | 50 | unsigned long flags; |
| 51 | int ret = 0; | 51 | int ret = 0; |
| 52 | 52 | ||
| 53 | spin_lock_irqsave(&nuc900_audio->lock, flags); | ||
| 54 | |||
| 55 | ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); | 53 | ret = snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params)); |
| 56 | if (ret < 0) | 54 | if (ret < 0) |
| 57 | return ret; | 55 | return ret; |
| 58 | 56 | ||
| 57 | spin_lock_irqsave(&nuc900_audio->lock, flags); | ||
| 58 | |||
| 59 | nuc900_audio->substream = substream; | 59 | nuc900_audio->substream = substream; |
| 60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; | 60 | nuc900_audio->dma_addr[substream->stream] = runtime->dma_addr; |
| 61 | nuc900_audio->buffersize[substream->stream] = | 61 | nuc900_audio->buffersize[substream->stream] = |
| @@ -169,6 +169,7 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
| 169 | struct snd_pcm_runtime *runtime = substream->runtime; | 169 | struct snd_pcm_runtime *runtime = substream->runtime; |
| 170 | struct nuc900_audio *nuc900_audio = runtime->private_data; | 170 | struct nuc900_audio *nuc900_audio = runtime->private_data; |
| 171 | unsigned long flags, val; | 171 | unsigned long flags, val; |
| 172 | int ret = 0; | ||
| 172 | 173 | ||
| 173 | spin_lock_irqsave(&nuc900_audio->lock, flags); | 174 | spin_lock_irqsave(&nuc900_audio->lock, flags); |
| 174 | 175 | ||
| @@ -197,10 +198,10 @@ static int nuc900_dma_prepare(struct snd_pcm_substream *substream) | |||
| 197 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); | 198 | AUDIO_WRITE(nuc900_audio->mmio + ACTL_RESET, val); |
| 198 | break; | 199 | break; |
| 199 | default: | 200 | default: |
| 200 | return -EINVAL; | 201 | ret = -EINVAL; |
| 201 | } | 202 | } |
| 202 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); | 203 | spin_unlock_irqrestore(&nuc900_audio->lock, flags); |
| 203 | return 0; | 204 | return ret; |
| 204 | } | 205 | } |
| 205 | 206 | ||
| 206 | static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) | 207 | static int nuc900_dma_trigger(struct snd_pcm_substream *substream, int cmd) |
| @@ -332,7 +333,7 @@ static struct snd_soc_platform_driver nuc900_soc_platform = { | |||
| 332 | .ops = &nuc900_dma_ops, | 333 | .ops = &nuc900_dma_ops, |
| 333 | .pcm_new = nuc900_dma_new, | 334 | .pcm_new = nuc900_dma_new, |
| 334 | .pcm_free = nuc900_dma_free_dma_buffers, | 335 | .pcm_free = nuc900_dma_free_dma_buffers, |
| 335 | } | 336 | }; |
| 336 | 337 | ||
| 337 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) | 338 | static int __devinit nuc900_soc_platform_probe(struct platform_device *pdev) |
| 338 | { | 339 | { |
diff --git a/sound/soc/omap/Kconfig b/sound/soc/omap/Kconfig index d542ea2ff6be..a088db6d5091 100644 --- a/sound/soc/omap/Kconfig +++ b/sound/soc/omap/Kconfig | |||
| @@ -12,8 +12,8 @@ config SND_OMAP_SOC_MCPDM | |||
| 12 | config SND_OMAP_SOC_N810 | 12 | config SND_OMAP_SOC_N810 |
| 13 | tristate "SoC Audio support for Nokia N810" | 13 | tristate "SoC Audio support for Nokia N810" |
| 14 | depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C | 14 | depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C |
| 15 | depends on OMAP_MUX | ||
| 15 | select SND_OMAP_SOC_MCBSP | 16 | select SND_OMAP_SOC_MCBSP |
| 16 | select OMAP_MUX | ||
| 17 | select SND_SOC_TLV320AIC3X | 17 | select SND_SOC_TLV320AIC3X |
| 18 | help | 18 | help |
| 19 | Say Y if you want to add support for SoC audio on Nokia N810. | 19 | Say Y if you want to add support for SoC audio on Nokia N810. |
diff --git a/sound/soc/s6000/s6000-i2s.c b/sound/soc/s6000/s6000-i2s.c index 8778faa174a6..3052f64b2403 100644 --- a/sound/soc/s6000/s6000-i2s.c +++ b/sound/soc/s6000/s6000-i2s.c | |||
| @@ -434,7 +434,7 @@ static struct snd_soc_dai_driver s6000_i2s_dai = { | |||
| 434 | .rate_max = 1562500, | 434 | .rate_max = 1562500, |
| 435 | }, | 435 | }, |
| 436 | .ops = &s6000_i2s_dai_ops, | 436 | .ops = &s6000_i2s_dai_ops, |
| 437 | } | 437 | }; |
| 438 | 438 | ||
| 439 | static int __devinit s6000_i2s_probe(struct platform_device *pdev) | 439 | static int __devinit s6000_i2s_probe(struct platform_device *pdev) |
| 440 | { | 440 | { |
diff --git a/sound/soc/s6000/s6000-pcm.c b/sound/soc/s6000/s6000-pcm.c index 271fd222bf19..ab3ccaec72d2 100644 --- a/sound/soc/s6000/s6000-pcm.c +++ b/sound/soc/s6000/s6000-pcm.c | |||
| @@ -473,7 +473,7 @@ static int s6000_pcm_new(struct snd_card *card, | |||
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | res = request_irq(params->irq, s6000_pcm_irq, IRQF_SHARED, | 475 | res = request_irq(params->irq, s6000_pcm_irq, IRQF_SHARED, |
| 476 | s6000_soc_platform.name, pcm); | 476 | "s6000-audio", pcm); |
| 477 | if (res) { | 477 | if (res) { |
| 478 | printk(KERN_ERR "s6000-pcm couldn't get IRQ\n"); | 478 | printk(KERN_ERR "s6000-pcm couldn't get IRQ\n"); |
| 479 | return res; | 479 | return res; |
diff --git a/sound/soc/s6000/s6105-ipcam.c b/sound/soc/s6000/s6105-ipcam.c index 96c05e137538..c1244c5bc730 100644 --- a/sound/soc/s6000/s6105-ipcam.c +++ b/sound/soc/s6000/s6105-ipcam.c | |||
| @@ -167,7 +167,7 @@ static int s6105_aic3x_init(struct snd_soc_pcm_runtime *rtd) | |||
| 167 | 167 | ||
| 168 | snd_soc_dapm_sync(codec); | 168 | snd_soc_dapm_sync(codec); |
| 169 | 169 | ||
| 170 | snd_ctl_add(codec->snd_card, snd_ctl_new1(&audio_out_mux, codec)); | 170 | snd_ctl_add(codec->card->snd_card, snd_ctl_new1(&audio_out_mux, codec)); |
| 171 | 171 | ||
| 172 | return 0; | 172 | return 0; |
| 173 | } | 173 | } |
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 441285ade024..85b7d548f167 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
| @@ -1619,12 +1619,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card) | |||
| 1619 | #ifdef CONFIG_SND_SOC_AC97_BUS | 1619 | #ifdef CONFIG_SND_SOC_AC97_BUS |
| 1620 | /* register any AC97 codecs */ | 1620 | /* register any AC97 codecs */ |
| 1621 | for (i = 0; i < card->num_rtd; i++) { | 1621 | for (i = 0; i < card->num_rtd; i++) { |
| 1622 | ret = soc_register_ac97_dai_link(&card->rtd[i]); | 1622 | ret = soc_register_ac97_dai_link(&card->rtd[i]); |
| 1623 | if (ret < 0) { | 1623 | if (ret < 0) { |
| 1624 | printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); | 1624 | printk(KERN_ERR "asoc: failed to register AC97 %s\n", card->name); |
| 1625 | goto probe_dai_err; | 1625 | while (--i >= 0) |
| 1626 | } | 1626 | soc_unregister_ac97_dai_link(&card->rtd[i]); |
| 1627 | goto probe_dai_err; | ||
| 1627 | } | 1628 | } |
| 1629 | } | ||
| 1628 | #endif | 1630 | #endif |
| 1629 | 1631 | ||
| 1630 | card->instantiated = 1; | 1632 | card->instantiated = 1; |
| @@ -3072,7 +3074,9 @@ int snd_soc_register_dais(struct device *dev, | |||
| 3072 | pr_debug("Registered DAI '%s'\n", dai->name); | 3074 | pr_debug("Registered DAI '%s'\n", dai->name); |
| 3073 | } | 3075 | } |
| 3074 | 3076 | ||
| 3077 | mutex_lock(&client_mutex); | ||
| 3075 | snd_soc_instantiate_cards(); | 3078 | snd_soc_instantiate_cards(); |
| 3079 | mutex_unlock(&client_mutex); | ||
| 3076 | return 0; | 3080 | return 0; |
| 3077 | 3081 | ||
| 3078 | err: | 3082 | err: |
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index e2c2de201eec..564491fa18b2 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
| @@ -197,7 +197,7 @@ static void sig_atexit(void) | |||
| 197 | if (child_pid > 0) | 197 | if (child_pid > 0) |
| 198 | kill(child_pid, SIGTERM); | 198 | kill(child_pid, SIGTERM); |
| 199 | 199 | ||
| 200 | if (signr == -1) | 200 | if (signr == -1 || signr == SIGUSR1) |
| 201 | return; | 201 | return; |
| 202 | 202 | ||
| 203 | signal(signr, SIG_DFL); | 203 | signal(signr, SIG_DFL); |
| @@ -515,6 +515,7 @@ static int __cmd_record(int argc, const char **argv) | |||
| 515 | atexit(sig_atexit); | 515 | atexit(sig_atexit); |
| 516 | signal(SIGCHLD, sig_handler); | 516 | signal(SIGCHLD, sig_handler); |
| 517 | signal(SIGINT, sig_handler); | 517 | signal(SIGINT, sig_handler); |
| 518 | signal(SIGUSR1, sig_handler); | ||
| 518 | 519 | ||
| 519 | if (forks && (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0)) { | 520 | if (forks && (pipe(child_ready_pipe) < 0 || pipe(go_pipe) < 0)) { |
| 520 | perror("failed to create pipes"); | 521 | perror("failed to create pipes"); |
| @@ -606,6 +607,7 @@ static int __cmd_record(int argc, const char **argv) | |||
| 606 | execvp(argv[0], (char **)argv); | 607 | execvp(argv[0], (char **)argv); |
| 607 | 608 | ||
| 608 | perror(argv[0]); | 609 | perror(argv[0]); |
| 610 | kill(getppid(), SIGUSR1); | ||
| 609 | exit(-1); | 611 | exit(-1); |
| 610 | } | 612 | } |
| 611 | 613 | ||
| @@ -762,7 +764,7 @@ static int __cmd_record(int argc, const char **argv) | |||
| 762 | } | 764 | } |
| 763 | } | 765 | } |
| 764 | 766 | ||
| 765 | if (quiet) | 767 | if (quiet || signr == SIGUSR1) |
| 766 | return 0; | 768 | return 0; |
| 767 | 769 | ||
| 768 | fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking); | 770 | fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking); |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index d7e67b167ea3..64a85bafde63 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
| @@ -946,11 +946,16 @@ perf_header__find_attr(u64 id, struct perf_header *header) | |||
| 946 | 946 | ||
| 947 | /* | 947 | /* |
| 948 | * We set id to -1 if the data file doesn't contain sample | 948 | * We set id to -1 if the data file doesn't contain sample |
| 949 | * ids. Check for this and avoid walking through the entire | 949 | * ids. This can happen when the data file contains one type |
| 950 | * list of ids which may be large. | 950 | * of event and in that case, the header can still store the |
| 951 | * event attribute information. Check for this and avoid | ||
| 952 | * walking through the entire list of ids which may be large. | ||
| 951 | */ | 953 | */ |
| 952 | if (id == -1ULL) | 954 | if (id == -1ULL) { |
| 955 | if (header->attrs > 0) | ||
| 956 | return &header->attr[0]->attr; | ||
| 953 | return NULL; | 957 | return NULL; |
| 958 | } | ||
| 954 | 959 | ||
| 955 | for (i = 0; i < header->attrs; i++) { | 960 | for (i = 0; i < header->attrs; i++) { |
| 956 | struct perf_header_attr *attr = header->attr[i]; | 961 | struct perf_header_attr *attr = header->attr[i]; |
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c index 0500895a45af..d628c8d1cf5e 100644 --- a/tools/perf/util/symbol.c +++ b/tools/perf/util/symbol.c | |||
| @@ -532,7 +532,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, | |||
| 532 | struct machine *machine = kmaps->machine; | 532 | struct machine *machine = kmaps->machine; |
| 533 | struct map *curr_map = map; | 533 | struct map *curr_map = map; |
| 534 | struct symbol *pos; | 534 | struct symbol *pos; |
| 535 | int count = 0; | 535 | int count = 0, moved = 0; |
| 536 | struct rb_root *root = &self->symbols[map->type]; | 536 | struct rb_root *root = &self->symbols[map->type]; |
| 537 | struct rb_node *next = rb_first(root); | 537 | struct rb_node *next = rb_first(root); |
| 538 | int kernel_range = 0; | 538 | int kernel_range = 0; |
| @@ -590,6 +590,11 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, | |||
| 590 | char dso_name[PATH_MAX]; | 590 | char dso_name[PATH_MAX]; |
| 591 | struct dso *dso; | 591 | struct dso *dso; |
| 592 | 592 | ||
| 593 | if (count == 0) { | ||
| 594 | curr_map = map; | ||
| 595 | goto filter_symbol; | ||
| 596 | } | ||
| 597 | |||
| 593 | if (self->kernel == DSO_TYPE_GUEST_KERNEL) | 598 | if (self->kernel == DSO_TYPE_GUEST_KERNEL) |
| 594 | snprintf(dso_name, sizeof(dso_name), | 599 | snprintf(dso_name, sizeof(dso_name), |
| 595 | "[guest.kernel].%d", | 600 | "[guest.kernel].%d", |
| @@ -615,7 +620,7 @@ static int dso__split_kallsyms(struct dso *self, struct map *map, | |||
| 615 | map_groups__insert(kmaps, curr_map); | 620 | map_groups__insert(kmaps, curr_map); |
| 616 | ++kernel_range; | 621 | ++kernel_range; |
| 617 | } | 622 | } |
| 618 | 623 | filter_symbol: | |
| 619 | if (filter && filter(curr_map, pos)) { | 624 | if (filter && filter(curr_map, pos)) { |
| 620 | discard_symbol: rb_erase(&pos->rb_node, root); | 625 | discard_symbol: rb_erase(&pos->rb_node, root); |
| 621 | symbol__delete(pos); | 626 | symbol__delete(pos); |
| @@ -623,8 +628,9 @@ discard_symbol: rb_erase(&pos->rb_node, root); | |||
| 623 | if (curr_map != map) { | 628 | if (curr_map != map) { |
| 624 | rb_erase(&pos->rb_node, root); | 629 | rb_erase(&pos->rb_node, root); |
| 625 | symbols__insert(&curr_map->dso->symbols[curr_map->type], pos); | 630 | symbols__insert(&curr_map->dso->symbols[curr_map->type], pos); |
| 626 | } | 631 | ++moved; |
| 627 | count++; | 632 | } else |
| 633 | ++count; | ||
| 628 | } | 634 | } |
| 629 | } | 635 | } |
| 630 | 636 | ||
| @@ -634,7 +640,7 @@ discard_symbol: rb_erase(&pos->rb_node, root); | |||
| 634 | dso__set_loaded(curr_map->dso, curr_map->type); | 640 | dso__set_loaded(curr_map->dso, curr_map->type); |
| 635 | } | 641 | } |
| 636 | 642 | ||
| 637 | return count; | 643 | return count + moved; |
| 638 | } | 644 | } |
| 639 | 645 | ||
| 640 | int dso__load_kallsyms(struct dso *self, const char *filename, | 646 | int dso__load_kallsyms(struct dso *self, const char *filename, |
| @@ -2125,14 +2131,55 @@ static struct dso *machine__create_kernel(struct machine *self) | |||
| 2125 | return kernel; | 2131 | return kernel; |
| 2126 | } | 2132 | } |
| 2127 | 2133 | ||
| 2134 | struct process_args { | ||
| 2135 | u64 start; | ||
| 2136 | }; | ||
| 2137 | |||
| 2138 | static int symbol__in_kernel(void *arg, const char *name, | ||
| 2139 | char type __used, u64 start) | ||
| 2140 | { | ||
| 2141 | struct process_args *args = arg; | ||
| 2142 | |||
| 2143 | if (strchr(name, '[')) | ||
| 2144 | return 0; | ||
| 2145 | |||
| 2146 | args->start = start; | ||
| 2147 | return 1; | ||
| 2148 | } | ||
| 2149 | |||
| 2150 | /* Figure out the start address of kernel map from /proc/kallsyms */ | ||
| 2151 | static u64 machine__get_kernel_start_addr(struct machine *machine) | ||
| 2152 | { | ||
| 2153 | const char *filename; | ||
| 2154 | char path[PATH_MAX]; | ||
| 2155 | struct process_args args; | ||
| 2156 | |||
| 2157 | if (machine__is_host(machine)) { | ||
| 2158 | filename = "/proc/kallsyms"; | ||
| 2159 | } else { | ||
| 2160 | if (machine__is_default_guest(machine)) | ||
| 2161 | filename = (char *)symbol_conf.default_guest_kallsyms; | ||
| 2162 | else { | ||
| 2163 | sprintf(path, "%s/proc/kallsyms", machine->root_dir); | ||
| 2164 | filename = path; | ||
| 2165 | } | ||
| 2166 | } | ||
| 2167 | |||
| 2168 | if (kallsyms__parse(filename, &args, symbol__in_kernel) <= 0) | ||
| 2169 | return 0; | ||
| 2170 | |||
| 2171 | return args.start; | ||
| 2172 | } | ||
| 2173 | |||
| 2128 | int __machine__create_kernel_maps(struct machine *self, struct dso *kernel) | 2174 | int __machine__create_kernel_maps(struct machine *self, struct dso *kernel) |
| 2129 | { | 2175 | { |
| 2130 | enum map_type type; | 2176 | enum map_type type; |
| 2177 | u64 start = machine__get_kernel_start_addr(self); | ||
| 2131 | 2178 | ||
| 2132 | for (type = 0; type < MAP__NR_TYPES; ++type) { | 2179 | for (type = 0; type < MAP__NR_TYPES; ++type) { |
| 2133 | struct kmap *kmap; | 2180 | struct kmap *kmap; |
| 2134 | 2181 | ||
| 2135 | self->vmlinux_maps[type] = map__new2(0, kernel, type); | 2182 | self->vmlinux_maps[type] = map__new2(start, kernel, type); |
| 2136 | if (self->vmlinux_maps[type] == NULL) | 2183 | if (self->vmlinux_maps[type] == NULL) |
| 2137 | return -1; | 2184 | return -1; |
| 2138 | 2185 | ||
diff --git a/usr/initramfs_data.S b/usr/initramfs_data.S index 792a750d9441..c14322d1c0cf 100644 --- a/usr/initramfs_data.S +++ b/usr/initramfs_data.S | |||
| @@ -22,14 +22,15 @@ | |||
| 22 | */ | 22 | */ |
| 23 | 23 | ||
| 24 | #include <linux/stringify.h> | 24 | #include <linux/stringify.h> |
| 25 | #include <asm-generic/vmlinux.lds.h> | ||
| 25 | 26 | ||
| 26 | .section .init.ramfs,"a" | 27 | .section .init.ramfs,"a" |
| 27 | __irf_start: | 28 | __irf_start: |
| 28 | .incbin __stringify(INITRAMFS_IMAGE) | 29 | .incbin __stringify(INITRAMFS_IMAGE) |
| 29 | __irf_end: | 30 | __irf_end: |
| 30 | .section .init.ramfs.info,"a" | 31 | .section .init.ramfs.info,"a" |
| 31 | .globl __initramfs_size | 32 | .globl VMLINUX_SYMBOL(__initramfs_size) |
| 32 | __initramfs_size: | 33 | VMLINUX_SYMBOL(__initramfs_size): |
| 33 | #ifdef CONFIG_64BIT | 34 | #ifdef CONFIG_64BIT |
| 34 | .quad __irf_end - __irf_start | 35 | .quad __irf_end - __irf_start |
| 35 | #else | 36 | #else |
