diff options
683 files changed, 10403 insertions, 6789 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..6a588873cf8d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -559,14 +559,14 @@ W: http://maxim.org.za/at91_26.html | |||
559 | S: Maintained | 559 | S: Maintained |
560 | 560 | ||
561 | ARM/BCMRING ARM ARCHITECTURE | 561 | ARM/BCMRING ARM ARCHITECTURE |
562 | M: Leo Chen <leochen@broadcom.com> | 562 | M: Jiandong Zheng <jdzheng@broadcom.com> |
563 | M: Scott Branden <sbranden@broadcom.com> | 563 | M: Scott Branden <sbranden@broadcom.com> |
564 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 564 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
565 | S: Maintained | 565 | S: Maintained |
566 | F: arch/arm/mach-bcmring | 566 | F: arch/arm/mach-bcmring |
567 | 567 | ||
568 | ARM/BCMRING MTD NAND DRIVER | 568 | ARM/BCMRING MTD NAND DRIVER |
569 | M: Leo Chen <leochen@broadcom.com> | 569 | M: Jiandong Zheng <jdzheng@broadcom.com> |
570 | M: Scott Branden <sbranden@broadcom.com> | 570 | M: Scott Branden <sbranden@broadcom.com> |
571 | L: linux-mtd@lists.infradead.org | 571 | L: linux-mtd@lists.infradead.org |
572 | S: Maintained | 572 | S: Maintained |
@@ -815,7 +815,7 @@ F: drivers/mmc/host/msm_sdcc.c | |||
815 | F: drivers/mmc/host/msm_sdcc.h | 815 | F: drivers/mmc/host/msm_sdcc.h |
816 | F: drivers/serial/msm_serial.h | 816 | F: drivers/serial/msm_serial.h |
817 | F: drivers/serial/msm_serial.c | 817 | F: drivers/serial/msm_serial.c |
818 | T: git git://codeaurora.org/quic/kernel/dwalker/linux-msm.git | 818 | T: git git://codeaurora.org/quic/kernel/davidb/linux-msm.git |
819 | S: Maintained | 819 | S: Maintained |
820 | 820 | ||
821 | ARM/TOSA MACHINE SUPPORT | 821 | ARM/TOSA MACHINE SUPPORT |
@@ -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 | ||
@@ -5933,7 +5932,6 @@ F: include/linux/tty.h | |||
5933 | 5932 | ||
5934 | TULIP NETWORK DRIVERS | 5933 | TULIP NETWORK DRIVERS |
5935 | M: Grant Grundler <grundler@parisc-linux.org> | 5934 | M: Grant Grundler <grundler@parisc-linux.org> |
5936 | M: Kyle McMartin <kyle@mcmartin.ca> | ||
5937 | L: netdev@vger.kernel.org | 5935 | L: netdev@vger.kernel.org |
5938 | S: Maintained | 5936 | S: Maintained |
5939 | F: drivers/net/tulip/ | 5937 | F: drivers/net/tulip/ |
@@ -6585,6 +6583,15 @@ F: include/linux/mfd/wm8400* | |||
6585 | F: include/sound/wm????.h | 6583 | F: include/sound/wm????.h |
6586 | F: sound/soc/codecs/wm* | 6584 | F: sound/soc/codecs/wm* |
6587 | 6585 | ||
6586 | WORKQUEUE | ||
6587 | M: Tejun Heo <tj@kernel.org> | ||
6588 | L: linux-kernel@vger.kernel.org | ||
6589 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq.git | ||
6590 | S: Maintained | ||
6591 | F: include/linux/workqueue.h | ||
6592 | F: kernel/workqueue.c | ||
6593 | F: Documentation/workqueue.txt | ||
6594 | |||
6588 | X.25 NETWORK LAYER | 6595 | X.25 NETWORK LAYER |
6589 | M: Andrew Hendry <andrew.hendry@gmail.com> | 6596 | M: Andrew Hendry <andrew.hendry@gmail.com> |
6590 | L: linux-x25@vger.kernel.org | 6597 | L: linux-x25@vger.kernel.org |
@@ -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 = -rc6 |
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 49778bb43782..d571cdb79d81 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) |
@@ -1000,8 +1000,8 @@ source arch/arm/mm/Kconfig | |||
1000 | 1000 | ||
1001 | config IWMMXT | 1001 | config IWMMXT |
1002 | bool "Enable iWMMXt support" | 1002 | bool "Enable iWMMXt support" |
1003 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK | 1003 | depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 |
1004 | default y if PXA27x || PXA3xx || ARCH_MMP | 1004 | default y if PXA27x || PXA3xx || PXA95x || ARCH_MMP |
1005 | help | 1005 | help |
1006 | Enable support for iWMMXt context switching at run time if | 1006 | Enable support for iWMMXt context switching at run time if |
1007 | running on a CPU that supports it. | 1007 | running on a CPU that supports it. |
@@ -1314,7 +1314,7 @@ config HZ | |||
1314 | 1314 | ||
1315 | config THUMB2_KERNEL | 1315 | config THUMB2_KERNEL |
1316 | bool "Compile the kernel in Thumb-2 mode" | 1316 | bool "Compile the kernel in Thumb-2 mode" |
1317 | depends on CPU_V7 && EXPERIMENTAL | 1317 | depends on CPU_V7 && !CPU_V6 && EXPERIMENTAL |
1318 | select AEABI | 1318 | select AEABI |
1319 | select ARM_ASM_UNIFIED | 1319 | select ARM_ASM_UNIFIED |
1320 | help | 1320 | help |
@@ -1762,7 +1762,7 @@ comment "At least one emulation must be selected" | |||
1762 | 1762 | ||
1763 | config FPE_NWFPE | 1763 | config FPE_NWFPE |
1764 | bool "NWFPE math emulation" | 1764 | bool "NWFPE math emulation" |
1765 | depends on !AEABI || OABI_COMPAT | 1765 | depends on (!AEABI || OABI_COMPAT) && !THUMB2_KERNEL |
1766 | ---help--- | 1766 | ---help--- |
1767 | Say Y to include the NWFPE floating point emulator in the kernel. | 1767 | Say Y to include the NWFPE floating point emulator in the kernel. |
1768 | This is necessary to run most binaries. Linux does not currently | 1768 | This is necessary to run most binaries. Linux does not currently |
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/Makefile b/arch/arm/kernel/Makefile index 679851a9f589..c73abe4b7e72 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -51,6 +51,7 @@ AFLAGS_crunch-bits.o := -Wa,-mcpu=ep9312 | |||
51 | obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o | 51 | obj-$(CONFIG_CPU_XSCALE) += xscale-cp0.o |
52 | obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o | 52 | obj-$(CONFIG_CPU_XSC3) += xscale-cp0.o |
53 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o | 53 | obj-$(CONFIG_CPU_MOHAWK) += xscale-cp0.o |
54 | obj-$(CONFIG_CPU_PJ4) += pj4-cp0.o | ||
54 | obj-$(CONFIG_IWMMXT) += iwmmxt.o | 55 | obj-$(CONFIG_IWMMXT) += iwmmxt.o |
55 | obj-$(CONFIG_CPU_HAS_PMU) += pmu.o | 56 | obj-$(CONFIG_CPU_HAS_PMU) += pmu.o |
56 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o | 57 | obj-$(CONFIG_HW_PERF_EVENTS) += perf_event.o |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index 34bbef0d2e7e..36199ffc4cc2 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -915,7 +915,7 @@ __kuser_cmpxchg: @ 0xffff0fc0 | |||
915 | * A special ghost syscall is used for that (see traps.c). | 915 | * A special ghost syscall is used for that (see traps.c). |
916 | */ | 916 | */ |
917 | stmfd sp!, {r7, lr} | 917 | stmfd sp!, {r7, lr} |
918 | ldr r7, =1f @ it's 20 bits | 918 | ldr r7, 1f @ it's 20 bits |
919 | swi __ARM_NR_cmpxchg | 919 | swi __ARM_NR_cmpxchg |
920 | ldmfd sp!, {r7, pc} | 920 | ldmfd sp!, {r7, pc} |
921 | 1: .word __ARM_NR_cmpxchg | 921 | 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/iwmmxt.S b/arch/arm/kernel/iwmmxt.S index b63b528f22a6..7fa3bb0d2397 100644 --- a/arch/arm/kernel/iwmmxt.S +++ b/arch/arm/kernel/iwmmxt.S | |||
@@ -19,6 +19,14 @@ | |||
19 | #include <asm/thread_info.h> | 19 | #include <asm/thread_info.h> |
20 | #include <asm/asm-offsets.h> | 20 | #include <asm/asm-offsets.h> |
21 | 21 | ||
22 | #if defined(CONFIG_CPU_PJ4) | ||
23 | #define PJ4(code...) code | ||
24 | #define XSC(code...) | ||
25 | #else | ||
26 | #define PJ4(code...) | ||
27 | #define XSC(code...) code | ||
28 | #endif | ||
29 | |||
22 | #define MMX_WR0 (0x00) | 30 | #define MMX_WR0 (0x00) |
23 | #define MMX_WR1 (0x08) | 31 | #define MMX_WR1 (0x08) |
24 | #define MMX_WR2 (0x10) | 32 | #define MMX_WR2 (0x10) |
@@ -58,11 +66,17 @@ | |||
58 | 66 | ||
59 | ENTRY(iwmmxt_task_enable) | 67 | ENTRY(iwmmxt_task_enable) |
60 | 68 | ||
61 | mrc p15, 0, r2, c15, c1, 0 | 69 | XSC(mrc p15, 0, r2, c15, c1, 0) |
62 | tst r2, #0x3 @ CP0 and CP1 accessible? | 70 | PJ4(mrc p15, 0, r2, c1, c0, 2) |
71 | @ CP0 and CP1 accessible? | ||
72 | XSC(tst r2, #0x3) | ||
73 | PJ4(tst r2, #0xf) | ||
63 | movne pc, lr @ if so no business here | 74 | movne pc, lr @ if so no business here |
64 | orr r2, r2, #0x3 @ enable access to CP0 and CP1 | 75 | @ enable access to CP0 and CP1 |
65 | mcr p15, 0, r2, c15, c1, 0 | 76 | XSC(orr r2, r2, #0x3) |
77 | XSC(mcr p15, 0, r2, c15, c1, 0) | ||
78 | PJ4(orr r2, r2, #0xf) | ||
79 | PJ4(mcr p15, 0, r2, c1, c0, 2) | ||
66 | 80 | ||
67 | ldr r3, =concan_owner | 81 | ldr r3, =concan_owner |
68 | add r0, r10, #TI_IWMMXT_STATE @ get task Concan save area | 82 | add r0, r10, #TI_IWMMXT_STATE @ get task Concan save area |
@@ -179,17 +193,26 @@ ENTRY(iwmmxt_task_disable) | |||
179 | teqne r1, r2 @ or specified one? | 193 | teqne r1, r2 @ or specified one? |
180 | bne 1f @ no: quit | 194 | bne 1f @ no: quit |
181 | 195 | ||
182 | mrc p15, 0, r4, c15, c1, 0 | 196 | @ enable access to CP0 and CP1 |
183 | orr r4, r4, #0x3 @ enable access to CP0 and CP1 | 197 | XSC(mrc p15, 0, r4, c15, c1, 0) |
184 | mcr p15, 0, r4, c15, c1, 0 | 198 | XSC(orr r4, r4, #0xf) |
199 | XSC(mcr p15, 0, r4, c15, c1, 0) | ||
200 | PJ4(mrc p15, 0, r4, c1, c0, 2) | ||
201 | PJ4(orr r4, r4, #0x3) | ||
202 | PJ4(mcr p15, 0, r4, c1, c0, 2) | ||
203 | |||
185 | mov r0, #0 @ nothing to load | 204 | mov r0, #0 @ nothing to load |
186 | str r0, [r3] @ no more current owner | 205 | str r0, [r3] @ no more current owner |
187 | mrc p15, 0, r2, c2, c0, 0 | 206 | mrc p15, 0, r2, c2, c0, 0 |
188 | mov r2, r2 @ cpwait | 207 | mov r2, r2 @ cpwait |
189 | bl concan_save | 208 | bl concan_save |
190 | 209 | ||
191 | bic r4, r4, #0x3 @ disable access to CP0 and CP1 | 210 | @ disable access to CP0 and CP1 |
192 | mcr p15, 0, r4, c15, c1, 0 | 211 | XSC(bic r4, r4, #0x3) |
212 | XSC(mcr p15, 0, r4, c15, c1, 0) | ||
213 | PJ4(bic r4, r4, #0xf) | ||
214 | PJ4(mcr p15, 0, r4, c1, c0, 2) | ||
215 | |||
193 | mrc p15, 0, r2, c2, c0, 0 | 216 | mrc p15, 0, r2, c2, c0, 0 |
194 | mov r2, r2 @ cpwait | 217 | mov r2, r2 @ cpwait |
195 | 218 | ||
@@ -277,8 +300,11 @@ ENTRY(iwmmxt_task_restore) | |||
277 | */ | 300 | */ |
278 | ENTRY(iwmmxt_task_switch) | 301 | ENTRY(iwmmxt_task_switch) |
279 | 302 | ||
280 | mrc p15, 0, r1, c15, c1, 0 | 303 | XSC(mrc p15, 0, r1, c15, c1, 0) |
281 | tst r1, #0x3 @ CP0 and CP1 accessible? | 304 | PJ4(mrc p15, 0, r1, c1, c0, 2) |
305 | @ CP0 and CP1 accessible? | ||
306 | XSC(tst r1, #0x3) | ||
307 | PJ4(tst r1, #0xf) | ||
282 | bne 1f @ yes: block them for next task | 308 | bne 1f @ yes: block them for next task |
283 | 309 | ||
284 | ldr r2, =concan_owner | 310 | ldr r2, =concan_owner |
@@ -287,8 +313,11 @@ ENTRY(iwmmxt_task_switch) | |||
287 | teq r2, r3 @ next task owns it? | 313 | teq r2, r3 @ next task owns it? |
288 | movne pc, lr @ no: leave Concan disabled | 314 | movne pc, lr @ no: leave Concan disabled |
289 | 315 | ||
290 | 1: eor r1, r1, #3 @ flip Concan access | 316 | 1: @ flip Conan access |
291 | mcr p15, 0, r1, c15, c1, 0 | 317 | XSC(eor r1, r1, #0x3) |
318 | XSC(mcr p15, 0, r1, c15, c1, 0) | ||
319 | PJ4(eor r1, r1, #0xf) | ||
320 | PJ4(mcr p15, 0, r1, c1, c0, 2) | ||
292 | 321 | ||
293 | mrc p15, 0, r1, c2, c0, 0 | 322 | mrc p15, 0, r1, c2, c0, 0 |
294 | sub pc, lr, r1, lsr #32 @ cpwait and return | 323 | sub pc, lr, r1, lsr #32 @ cpwait and return |
diff --git a/arch/arm/kernel/pj4-cp0.c b/arch/arm/kernel/pj4-cp0.c new file mode 100644 index 000000000000..a4b1b0748fd3 --- /dev/null +++ b/arch/arm/kernel/pj4-cp0.c | |||
@@ -0,0 +1,94 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/kernel/pj4-cp0.c | ||
3 | * | ||
4 | * PJ4 iWMMXt coprocessor context switching and handling | ||
5 | * | ||
6 | * Copyright (c) 2010 Marvell International Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/signal.h> | ||
17 | #include <linux/sched.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <asm/thread_notify.h> | ||
21 | |||
22 | static int iwmmxt_do(struct notifier_block *self, unsigned long cmd, void *t) | ||
23 | { | ||
24 | struct thread_info *thread = t; | ||
25 | |||
26 | switch (cmd) { | ||
27 | case THREAD_NOTIFY_FLUSH: | ||
28 | /* | ||
29 | * flush_thread() zeroes thread->fpstate, so no need | ||
30 | * to do anything here. | ||
31 | * | ||
32 | * FALLTHROUGH: Ensure we don't try to overwrite our newly | ||
33 | * initialised state information on the first fault. | ||
34 | */ | ||
35 | |||
36 | case THREAD_NOTIFY_EXIT: | ||
37 | iwmmxt_task_release(thread); | ||
38 | break; | ||
39 | |||
40 | case THREAD_NOTIFY_SWITCH: | ||
41 | iwmmxt_task_switch(thread); | ||
42 | break; | ||
43 | } | ||
44 | |||
45 | return NOTIFY_DONE; | ||
46 | } | ||
47 | |||
48 | static struct notifier_block iwmmxt_notifier_block = { | ||
49 | .notifier_call = iwmmxt_do, | ||
50 | }; | ||
51 | |||
52 | |||
53 | static u32 __init pj4_cp_access_read(void) | ||
54 | { | ||
55 | u32 value; | ||
56 | |||
57 | __asm__ __volatile__ ( | ||
58 | "mrc p15, 0, %0, c1, c0, 2\n\t" | ||
59 | : "=r" (value)); | ||
60 | return value; | ||
61 | } | ||
62 | |||
63 | static void __init pj4_cp_access_write(u32 value) | ||
64 | { | ||
65 | u32 temp; | ||
66 | |||
67 | __asm__ __volatile__ ( | ||
68 | "mcr p15, 0, %1, c1, c0, 2\n\t" | ||
69 | "mrc p15, 0, %0, c1, c0, 2\n\t" | ||
70 | "mov %0, %0\n\t" | ||
71 | "sub pc, pc, #4\n\t" | ||
72 | : "=r" (temp) : "r" (value)); | ||
73 | } | ||
74 | |||
75 | |||
76 | /* | ||
77 | * Disable CP0/CP1 on boot, and let call_fpe() and the iWMMXt lazy | ||
78 | * switch code handle iWMMXt context switching. | ||
79 | */ | ||
80 | static int __init pj4_cp0_init(void) | ||
81 | { | ||
82 | u32 cp_access; | ||
83 | |||
84 | cp_access = pj4_cp_access_read() & ~0xf; | ||
85 | pj4_cp_access_write(cp_access); | ||
86 | |||
87 | printk(KERN_INFO "PJ4 iWMMXt coprocessor enabled.\n"); | ||
88 | elf_hwcap |= HWCAP_IWMMXT; | ||
89 | thread_register_notifier(&iwmmxt_notifier_block); | ||
90 | |||
91 | return 0; | ||
92 | } | ||
93 | |||
94 | late_initcall(pj4_cp0_init); | ||
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-mmp/Kconfig b/arch/arm/mach-mmp/Kconfig index 0711d3b620ad..67793a690272 100644 --- a/arch/arm/mach-mmp/Kconfig +++ b/arch/arm/mach-mmp/Kconfig | |||
@@ -37,25 +37,38 @@ config MACH_TTC_DKB | |||
37 | Say 'Y' here if you want to support the Marvell PXA910-based | 37 | Say 'Y' here if you want to support the Marvell PXA910-based |
38 | TTC_DKB Development Board. | 38 | TTC_DKB Development Board. |
39 | 39 | ||
40 | config MACH_BROWNSTONE | ||
41 | bool "Marvell's Brownstone Development Platform" | ||
42 | depends on !CPU_MOHAWK | ||
43 | select CPU_MMP2 | ||
44 | help | ||
45 | Say 'Y' here if you want to support the Marvell MMP2-based | ||
46 | Brown Development Platform. | ||
47 | MMP2-based board can't be co-existed with PXA168-based & | ||
48 | PXA910-based development board. Since MMP2 is compatible to | ||
49 | ARMv7 architecture. | ||
50 | |||
40 | config MACH_FLINT | 51 | config MACH_FLINT |
41 | bool "Marvell's Flint Development Platform" | 52 | bool "Marvell's Flint Development Platform" |
53 | depends on !CPU_MOHAWK | ||
42 | select CPU_MMP2 | 54 | select CPU_MMP2 |
43 | help | 55 | help |
44 | Say 'Y' here if you want to support the Marvell MMP2-based | 56 | Say 'Y' here if you want to support the Marvell MMP2-based |
45 | Flint Development Platform. | 57 | Flint Development Platform. |
46 | MMP2-based board can't be co-existed with PXA168-based & | 58 | MMP2-based board can't be co-existed with PXA168-based & |
47 | PXA910-based development board. Since MMP2 is compatible to | 59 | PXA910-based development board. Since MMP2 is compatible to |
48 | ARMv6 architecture. | 60 | ARMv7 architecture. |
49 | 61 | ||
50 | config MACH_MARVELL_JASPER | 62 | config MACH_MARVELL_JASPER |
51 | bool "Marvell's Jasper Development Platform" | 63 | bool "Marvell's Jasper Development Platform" |
64 | depends on !CPU_MOHAWK | ||
52 | select CPU_MMP2 | 65 | select CPU_MMP2 |
53 | help | 66 | help |
54 | Say 'Y' here if you want to support the Marvell MMP2-base | 67 | Say 'Y' here if you want to support the Marvell MMP2-base |
55 | Jasper Development Platform. | 68 | Jasper Development Platform. |
56 | MMP2-based board can't be co-existed with PXA168-based & | 69 | MMP2-based board can't be co-existed with PXA168-based & |
57 | PXA910-based development board. Since MMP2 is compatible to | 70 | PXA910-based development board. Since MMP2 is compatible to |
58 | ARMv6 architecture. | 71 | ARMv7 architecture. |
59 | 72 | ||
60 | config MACH_TETON_BGA | 73 | config MACH_TETON_BGA |
61 | bool "Marvell's PXA168 Teton BGA Development Board" | 74 | bool "Marvell's PXA168 Teton BGA Development Board" |
@@ -80,8 +93,7 @@ config CPU_PXA910 | |||
80 | 93 | ||
81 | config CPU_MMP2 | 94 | config CPU_MMP2 |
82 | bool | 95 | bool |
83 | select CPU_V6 | 96 | select CPU_PJ4 |
84 | select CPU_32v6K | ||
85 | help | 97 | help |
86 | Select code specific to MMP2. MMP2 is ARMv6 compatible. | 98 | Select code specific to MMP2. MMP2 is ARMv7 compatible. |
87 | endif | 99 | endif |
diff --git a/arch/arm/mach-mmp/Makefile b/arch/arm/mach-mmp/Makefile index 751cdbf733c8..5c68382141af 100644 --- a/arch/arm/mach-mmp/Makefile +++ b/arch/arm/mach-mmp/Makefile | |||
@@ -15,6 +15,7 @@ obj-$(CONFIG_MACH_ZYLONITE2) += aspenite.o | |||
15 | obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o | 15 | obj-$(CONFIG_MACH_AVENGERS_LITE)+= avengers_lite.o |
16 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o | 16 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o |
17 | obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o | 17 | obj-$(CONFIG_MACH_TTC_DKB) += ttc_dkb.o |
18 | obj-$(CONFIG_MACH_BROWNSTONE) += brownstone.o | ||
18 | obj-$(CONFIG_MACH_FLINT) += flint.o | 19 | obj-$(CONFIG_MACH_FLINT) += flint.o |
19 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o | 20 | obj-$(CONFIG_MACH_MARVELL_JASPER) += jasper.o |
20 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o | 21 | obj-$(CONFIG_MACH_TETON_BGA) += teton_bga.o |
diff --git a/arch/arm/mach-mmp/brownstone.c b/arch/arm/mach-mmp/brownstone.c new file mode 100644 index 000000000000..7bb78fd5a2a6 --- /dev/null +++ b/arch/arm/mach-mmp/brownstone.c | |||
@@ -0,0 +1,204 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-mmp/brownstone.c | ||
3 | * | ||
4 | * Support for the Marvell Brownstone Development Platform. | ||
5 | * | ||
6 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * publishhed by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/io.h> | ||
17 | #include <linux/gpio.h> | ||
18 | #include <linux/regulator/machine.h> | ||
19 | #include <linux/regulator/max8649.h> | ||
20 | #include <linux/regulator/fixed.h> | ||
21 | #include <linux/mfd/max8925.h> | ||
22 | |||
23 | #include <asm/mach-types.h> | ||
24 | #include <asm/mach/arch.h> | ||
25 | #include <mach/addr-map.h> | ||
26 | #include <mach/mfp-mmp2.h> | ||
27 | #include <mach/mmp2.h> | ||
28 | #include <mach/irqs.h> | ||
29 | |||
30 | #include "common.h" | ||
31 | |||
32 | #define BROWNSTONE_NR_IRQS (IRQ_BOARD_START + 40) | ||
33 | |||
34 | #define GPIO_5V_ENABLE (89) | ||
35 | |||
36 | static unsigned long brownstone_pin_config[] __initdata = { | ||
37 | /* UART1 */ | ||
38 | GPIO29_UART1_RXD, | ||
39 | GPIO30_UART1_TXD, | ||
40 | |||
41 | /* UART3 */ | ||
42 | GPIO51_UART3_RXD, | ||
43 | GPIO52_UART3_TXD, | ||
44 | |||
45 | /* DFI */ | ||
46 | GPIO168_DFI_D0, | ||
47 | GPIO167_DFI_D1, | ||
48 | GPIO166_DFI_D2, | ||
49 | GPIO165_DFI_D3, | ||
50 | GPIO107_DFI_D4, | ||
51 | GPIO106_DFI_D5, | ||
52 | GPIO105_DFI_D6, | ||
53 | GPIO104_DFI_D7, | ||
54 | GPIO111_DFI_D8, | ||
55 | GPIO164_DFI_D9, | ||
56 | GPIO163_DFI_D10, | ||
57 | GPIO162_DFI_D11, | ||
58 | GPIO161_DFI_D12, | ||
59 | GPIO110_DFI_D13, | ||
60 | GPIO109_DFI_D14, | ||
61 | GPIO108_DFI_D15, | ||
62 | GPIO143_ND_nCS0, | ||
63 | GPIO144_ND_nCS1, | ||
64 | GPIO147_ND_nWE, | ||
65 | GPIO148_ND_nRE, | ||
66 | GPIO150_ND_ALE, | ||
67 | GPIO149_ND_CLE, | ||
68 | GPIO112_ND_RDY0, | ||
69 | GPIO160_ND_RDY1, | ||
70 | |||
71 | /* PMIC */ | ||
72 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, | ||
73 | |||
74 | /* MMC0 */ | ||
75 | GPIO131_MMC1_DAT3 | MFP_PULL_HIGH, | ||
76 | GPIO132_MMC1_DAT2 | MFP_PULL_HIGH, | ||
77 | GPIO133_MMC1_DAT1 | MFP_PULL_HIGH, | ||
78 | GPIO134_MMC1_DAT0 | MFP_PULL_HIGH, | ||
79 | GPIO136_MMC1_CMD | MFP_PULL_HIGH, | ||
80 | GPIO139_MMC1_CLK, | ||
81 | GPIO140_MMC1_CD | MFP_PULL_LOW, | ||
82 | GPIO141_MMC1_WP | MFP_PULL_LOW, | ||
83 | |||
84 | /* MMC1 */ | ||
85 | GPIO37_MMC2_DAT3 | MFP_PULL_HIGH, | ||
86 | GPIO38_MMC2_DAT2 | MFP_PULL_HIGH, | ||
87 | GPIO39_MMC2_DAT1 | MFP_PULL_HIGH, | ||
88 | GPIO40_MMC2_DAT0 | MFP_PULL_HIGH, | ||
89 | GPIO41_MMC2_CMD | MFP_PULL_HIGH, | ||
90 | GPIO42_MMC2_CLK, | ||
91 | |||
92 | /* MMC2 */ | ||
93 | GPIO165_MMC3_DAT7 | MFP_PULL_HIGH, | ||
94 | GPIO162_MMC3_DAT6 | MFP_PULL_HIGH, | ||
95 | GPIO166_MMC3_DAT5 | MFP_PULL_HIGH, | ||
96 | GPIO163_MMC3_DAT4 | MFP_PULL_HIGH, | ||
97 | GPIO167_MMC3_DAT3 | MFP_PULL_HIGH, | ||
98 | GPIO164_MMC3_DAT2 | MFP_PULL_HIGH, | ||
99 | GPIO168_MMC3_DAT1 | MFP_PULL_HIGH, | ||
100 | GPIO111_MMC3_DAT0 | MFP_PULL_HIGH, | ||
101 | GPIO112_MMC3_CMD | MFP_PULL_HIGH, | ||
102 | GPIO151_MMC3_CLK, | ||
103 | |||
104 | /* 5V regulator */ | ||
105 | GPIO89_GPIO, | ||
106 | }; | ||
107 | |||
108 | static struct regulator_consumer_supply max8649_supply[] = { | ||
109 | REGULATOR_SUPPLY("vcc_core", NULL), | ||
110 | }; | ||
111 | |||
112 | static struct regulator_init_data max8649_init_data = { | ||
113 | .constraints = { | ||
114 | .name = "vcc_core range", | ||
115 | .min_uV = 1150000, | ||
116 | .max_uV = 1280000, | ||
117 | .always_on = 1, | ||
118 | .boot_on = 1, | ||
119 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
120 | }, | ||
121 | .num_consumer_supplies = 1, | ||
122 | .consumer_supplies = &max8649_supply[0], | ||
123 | }; | ||
124 | |||
125 | static struct max8649_platform_data brownstone_max8649_info = { | ||
126 | .mode = 2, /* VID1 = 1, VID0 = 0 */ | ||
127 | .extclk = 0, | ||
128 | .ramp_timing = MAX8649_RAMP_32MV, | ||
129 | .regulator = &max8649_init_data, | ||
130 | }; | ||
131 | |||
132 | static struct regulator_consumer_supply brownstone_v_5vp_supplies[] = { | ||
133 | REGULATOR_SUPPLY("v_5vp", NULL), | ||
134 | }; | ||
135 | |||
136 | static struct regulator_init_data brownstone_v_5vp_data = { | ||
137 | .constraints = { | ||
138 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
139 | }, | ||
140 | .num_consumer_supplies = ARRAY_SIZE(brownstone_v_5vp_supplies), | ||
141 | .consumer_supplies = brownstone_v_5vp_supplies, | ||
142 | }; | ||
143 | |||
144 | static struct fixed_voltage_config brownstone_v_5vp = { | ||
145 | .supply_name = "v_5vp", | ||
146 | .microvolts = 5000000, | ||
147 | .gpio = GPIO_5V_ENABLE, | ||
148 | .enable_high = 1, | ||
149 | .enabled_at_boot = 1, | ||
150 | .init_data = &brownstone_v_5vp_data, | ||
151 | }; | ||
152 | |||
153 | static struct platform_device brownstone_v_5vp_device = { | ||
154 | .name = "reg-fixed-voltage", | ||
155 | .id = 1, | ||
156 | .dev = { | ||
157 | .platform_data = &brownstone_v_5vp, | ||
158 | }, | ||
159 | }; | ||
160 | |||
161 | static struct max8925_platform_data brownstone_max8925_info = { | ||
162 | .irq_base = IRQ_BOARD_START, | ||
163 | }; | ||
164 | |||
165 | static struct i2c_board_info brownstone_twsi1_info[] = { | ||
166 | [0] = { | ||
167 | .type = "max8649", | ||
168 | .addr = 0x60, | ||
169 | .platform_data = &brownstone_max8649_info, | ||
170 | }, | ||
171 | [1] = { | ||
172 | .type = "max8925", | ||
173 | .addr = 0x3c, | ||
174 | .irq = IRQ_MMP2_PMIC, | ||
175 | .platform_data = &brownstone_max8925_info, | ||
176 | }, | ||
177 | }; | ||
178 | |||
179 | static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { | ||
180 | .max_speed = 25000000, | ||
181 | }; | ||
182 | |||
183 | static void __init brownstone_init(void) | ||
184 | { | ||
185 | mfp_config(ARRAY_AND_SIZE(brownstone_pin_config)); | ||
186 | |||
187 | /* on-chip devices */ | ||
188 | mmp2_add_uart(1); | ||
189 | mmp2_add_uart(3); | ||
190 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(brownstone_twsi1_info)); | ||
191 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | ||
192 | |||
193 | /* enable 5v regulator */ | ||
194 | platform_device_register(&brownstone_v_5vp_device); | ||
195 | } | ||
196 | |||
197 | MACHINE_START(BROWNSTONE, "Brownstone Development Platform") | ||
198 | /* Maintainer: Haojian Zhuang <haojian.zhuang@marvell.com> */ | ||
199 | .map_io = mmp_map_io, | ||
200 | .nr_irqs = BROWNSTONE_NR_IRQS, | ||
201 | .init_irq = mmp2_init_irq, | ||
202 | .timer = &mmp2_timer, | ||
203 | .init_machine = brownstone_init, | ||
204 | MACHINE_END | ||
diff --git a/arch/arm/mach-mmp/flint.c b/arch/arm/mach-mmp/flint.c index bdeb6db4d49a..c4fd806b15b4 100644 --- a/arch/arm/mach-mmp/flint.c +++ b/arch/arm/mach-mmp/flint.c | |||
@@ -47,7 +47,7 @@ static unsigned long flint_pin_config[] __initdata = { | |||
47 | GPIO113_SMC_RDY, | 47 | GPIO113_SMC_RDY, |
48 | 48 | ||
49 | /*Ethernet*/ | 49 | /*Ethernet*/ |
50 | GPIO155_GPIO155, | 50 | GPIO155_GPIO, |
51 | 51 | ||
52 | /* DFI */ | 52 | /* DFI */ |
53 | GPIO168_DFI_D0, | 53 | GPIO168_DFI_D0, |
diff --git a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h index 761c2dacc079..117e30366087 100644 --- a/arch/arm/mach-mmp/include/mach/mfp-mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mfp-mmp2.h | |||
@@ -9,175 +9,175 @@ | |||
9 | #define MFP_DRIVE_FAST (0x8 << 13) | 9 | #define MFP_DRIVE_FAST (0x8 << 13) |
10 | 10 | ||
11 | /* GPIO */ | 11 | /* GPIO */ |
12 | #define GPIO0_GPIO0 MFP_CFG(GPIO0, AF0) | 12 | #define GPIO0_GPIO MFP_CFG(GPIO0, AF0) |
13 | #define GPIO1_GPIO1 MFP_CFG(GPIO1, AF0) | 13 | #define GPIO1_GPIO MFP_CFG(GPIO1, AF0) |
14 | #define GPIO2_GPIO2 MFP_CFG(GPIO2, AF0) | 14 | #define GPIO2_GPIO MFP_CFG(GPIO2, AF0) |
15 | #define GPIO3_GPIO3 MFP_CFG(GPIO3, AF0) | 15 | #define GPIO3_GPIO MFP_CFG(GPIO3, AF0) |
16 | #define GPIO4_GPIO4 MFP_CFG(GPIO4, AF0) | 16 | #define GPIO4_GPIO MFP_CFG(GPIO4, AF0) |
17 | #define GPIO5_GPIO5 MFP_CFG(GPIO5, AF0) | 17 | #define GPIO5_GPIO MFP_CFG(GPIO5, AF0) |
18 | #define GPIO6_GPIO6 MFP_CFG(GPIO6, AF0) | 18 | #define GPIO6_GPIO MFP_CFG(GPIO6, AF0) |
19 | #define GPIO7_GPIO7 MFP_CFG(GPIO7, AF0) | 19 | #define GPIO7_GPIO MFP_CFG(GPIO7, AF0) |
20 | #define GPIO8_GPIO8 MFP_CFG(GPIO8, AF0) | 20 | #define GPIO8_GPIO MFP_CFG(GPIO8, AF0) |
21 | #define GPIO9_GPIO9 MFP_CFG(GPIO9, AF0) | 21 | #define GPIO9_GPIO MFP_CFG(GPIO9, AF0) |
22 | #define GPIO10_GPIO10 MFP_CFG(GPIO10, AF0) | 22 | #define GPIO10_GPIO MFP_CFG(GPIO10, AF0) |
23 | #define GPIO11_GPIO11 MFP_CFG(GPIO11, AF0) | 23 | #define GPIO11_GPIO MFP_CFG(GPIO11, AF0) |
24 | #define GPIO12_GPIO12 MFP_CFG(GPIO12, AF0) | 24 | #define GPIO12_GPIO MFP_CFG(GPIO12, AF0) |
25 | #define GPIO13_GPIO13 MFP_CFG(GPIO13, AF0) | 25 | #define GPIO13_GPIO MFP_CFG(GPIO13, AF0) |
26 | #define GPIO14_GPIO14 MFP_CFG(GPIO14, AF0) | 26 | #define GPIO14_GPIO MFP_CFG(GPIO14, AF0) |
27 | #define GPIO15_GPIO15 MFP_CFG(GPIO15, AF0) | 27 | #define GPIO15_GPIO MFP_CFG(GPIO15, AF0) |
28 | #define GPIO16_GPIO16 MFP_CFG(GPIO16, AF0) | 28 | #define GPIO16_GPIO MFP_CFG(GPIO16, AF0) |
29 | #define GPIO17_GPIO17 MFP_CFG(GPIO17, AF0) | 29 | #define GPIO17_GPIO MFP_CFG(GPIO17, AF0) |
30 | #define GPIO18_GPIO18 MFP_CFG(GPIO18, AF0) | 30 | #define GPIO18_GPIO MFP_CFG(GPIO18, AF0) |
31 | #define GPIO19_GPIO19 MFP_CFG(GPIO19, AF0) | 31 | #define GPIO19_GPIO MFP_CFG(GPIO19, AF0) |
32 | #define GPIO20_GPIO20 MFP_CFG(GPIO20, AF0) | 32 | #define GPIO20_GPIO MFP_CFG(GPIO20, AF0) |
33 | #define GPIO21_GPIO21 MFP_CFG(GPIO21, AF0) | 33 | #define GPIO21_GPIO MFP_CFG(GPIO21, AF0) |
34 | #define GPIO22_GPIO22 MFP_CFG(GPIO22, AF0) | 34 | #define GPIO22_GPIO MFP_CFG(GPIO22, AF0) |
35 | #define GPIO23_GPIO23 MFP_CFG(GPIO23, AF0) | 35 | #define GPIO23_GPIO MFP_CFG(GPIO23, AF0) |
36 | #define GPIO24_GPIO24 MFP_CFG(GPIO24, AF0) | 36 | #define GPIO24_GPIO MFP_CFG(GPIO24, AF0) |
37 | #define GPIO25_GPIO25 MFP_CFG(GPIO25, AF0) | 37 | #define GPIO25_GPIO MFP_CFG(GPIO25, AF0) |
38 | #define GPIO26_GPIO26 MFP_CFG(GPIO26, AF0) | 38 | #define GPIO26_GPIO MFP_CFG(GPIO26, AF0) |
39 | #define GPIO27_GPIO27 MFP_CFG(GPIO27, AF0) | 39 | #define GPIO27_GPIO MFP_CFG(GPIO27, AF0) |
40 | #define GPIO28_GPIO28 MFP_CFG(GPIO28, AF0) | 40 | #define GPIO28_GPIO MFP_CFG(GPIO28, AF0) |
41 | #define GPIO29_GPIO29 MFP_CFG(GPIO29, AF0) | 41 | #define GPIO29_GPIO MFP_CFG(GPIO29, AF0) |
42 | #define GPIO30_GPIO30 MFP_CFG(GPIO30, AF0) | 42 | #define GPIO30_GPIO MFP_CFG(GPIO30, AF0) |
43 | #define GPIO31_GPIO31 MFP_CFG(GPIO31, AF0) | 43 | #define GPIO31_GPIO MFP_CFG(GPIO31, AF0) |
44 | #define GPIO32_GPIO32 MFP_CFG(GPIO32, AF0) | 44 | #define GPIO32_GPIO MFP_CFG(GPIO32, AF0) |
45 | #define GPIO33_GPIO33 MFP_CFG(GPIO33, AF0) | 45 | #define GPIO33_GPIO MFP_CFG(GPIO33, AF0) |
46 | #define GPIO34_GPIO34 MFP_CFG(GPIO34, AF0) | 46 | #define GPIO34_GPIO MFP_CFG(GPIO34, AF0) |
47 | #define GPIO35_GPIO35 MFP_CFG(GPIO35, AF0) | 47 | #define GPIO35_GPIO MFP_CFG(GPIO35, AF0) |
48 | #define GPIO36_GPIO36 MFP_CFG(GPIO36, AF0) | 48 | #define GPIO36_GPIO MFP_CFG(GPIO36, AF0) |
49 | #define GPIO37_GPIO37 MFP_CFG(GPIO37, AF0) | 49 | #define GPIO37_GPIO MFP_CFG(GPIO37, AF0) |
50 | #define GPIO38_GPIO38 MFP_CFG(GPIO38, AF0) | 50 | #define GPIO38_GPIO MFP_CFG(GPIO38, AF0) |
51 | #define GPIO39_GPIO39 MFP_CFG(GPIO39, AF0) | 51 | #define GPIO39_GPIO MFP_CFG(GPIO39, AF0) |
52 | #define GPIO40_GPIO40 MFP_CFG(GPIO40, AF0) | 52 | #define GPIO40_GPIO MFP_CFG(GPIO40, AF0) |
53 | #define GPIO41_GPIO41 MFP_CFG(GPIO41, AF0) | 53 | #define GPIO41_GPIO MFP_CFG(GPIO41, AF0) |
54 | #define GPIO42_GPIO42 MFP_CFG(GPIO42, AF0) | 54 | #define GPIO42_GPIO MFP_CFG(GPIO42, AF0) |
55 | #define GPIO43_GPIO43 MFP_CFG(GPIO43, AF0) | 55 | #define GPIO43_GPIO MFP_CFG(GPIO43, AF0) |
56 | #define GPIO44_GPIO44 MFP_CFG(GPIO44, AF0) | 56 | #define GPIO44_GPIO MFP_CFG(GPIO44, AF0) |
57 | #define GPIO45_GPIO45 MFP_CFG(GPIO45, AF0) | 57 | #define GPIO45_GPIO MFP_CFG(GPIO45, AF0) |
58 | #define GPIO46_GPIO46 MFP_CFG(GPIO46, AF0) | 58 | #define GPIO46_GPIO MFP_CFG(GPIO46, AF0) |
59 | #define GPIO47_GPIO47 MFP_CFG(GPIO47, AF0) | 59 | #define GPIO47_GPIO MFP_CFG(GPIO47, AF0) |
60 | #define GPIO48_GPIO48 MFP_CFG(GPIO48, AF0) | 60 | #define GPIO48_GPIO MFP_CFG(GPIO48, AF0) |
61 | #define GPIO49_GPIO49 MFP_CFG(GPIO49, AF0) | 61 | #define GPIO49_GPIO MFP_CFG(GPIO49, AF0) |
62 | #define GPIO50_GPIO50 MFP_CFG(GPIO50, AF0) | 62 | #define GPIO50_GPIO MFP_CFG(GPIO50, AF0) |
63 | #define GPIO51_GPIO51 MFP_CFG(GPIO51, AF0) | 63 | #define GPIO51_GPIO MFP_CFG(GPIO51, AF0) |
64 | #define GPIO52_GPIO52 MFP_CFG(GPIO52, AF0) | 64 | #define GPIO52_GPIO MFP_CFG(GPIO52, AF0) |
65 | #define GPIO53_GPIO53 MFP_CFG(GPIO53, AF0) | 65 | #define GPIO53_GPIO MFP_CFG(GPIO53, AF0) |
66 | #define GPIO54_GPIO54 MFP_CFG(GPIO54, AF0) | 66 | #define GPIO54_GPIO MFP_CFG(GPIO54, AF0) |
67 | #define GPIO55_GPIO55 MFP_CFG(GPIO55, AF0) | 67 | #define GPIO55_GPIO MFP_CFG(GPIO55, AF0) |
68 | #define GPIO56_GPIO56 MFP_CFG(GPIO56, AF0) | 68 | #define GPIO56_GPIO MFP_CFG(GPIO56, AF0) |
69 | #define GPIO57_GPIO57 MFP_CFG(GPIO57, AF0) | 69 | #define GPIO57_GPIO MFP_CFG(GPIO57, AF0) |
70 | #define GPIO58_GPIO58 MFP_CFG(GPIO58, AF0) | 70 | #define GPIO58_GPIO MFP_CFG(GPIO58, AF0) |
71 | #define GPIO59_GPIO59 MFP_CFG(GPIO59, AF0) | 71 | #define GPIO59_GPIO MFP_CFG(GPIO59, AF0) |
72 | #define GPIO60_GPIO60 MFP_CFG(GPIO60, AF0) | 72 | #define GPIO60_GPIO MFP_CFG(GPIO60, AF0) |
73 | #define GPIO61_GPIO61 MFP_CFG(GPIO61, AF0) | 73 | #define GPIO61_GPIO MFP_CFG(GPIO61, AF0) |
74 | #define GPIO62_GPIO62 MFP_CFG(GPIO62, AF0) | 74 | #define GPIO62_GPIO MFP_CFG(GPIO62, AF0) |
75 | #define GPIO63_GPIO63 MFP_CFG(GPIO63, AF0) | 75 | #define GPIO63_GPIO MFP_CFG(GPIO63, AF0) |
76 | #define GPIO64_GPIO64 MFP_CFG(GPIO64, AF0) | 76 | #define GPIO64_GPIO MFP_CFG(GPIO64, AF0) |
77 | #define GPIO65_GPIO65 MFP_CFG(GPIO65, AF0) | 77 | #define GPIO65_GPIO MFP_CFG(GPIO65, AF0) |
78 | #define GPIO66_GPIO66 MFP_CFG(GPIO66, AF0) | 78 | #define GPIO66_GPIO MFP_CFG(GPIO66, AF0) |
79 | #define GPIO67_GPIO67 MFP_CFG(GPIO67, AF0) | 79 | #define GPIO67_GPIO MFP_CFG(GPIO67, AF0) |
80 | #define GPIO68_GPIO68 MFP_CFG(GPIO68, AF0) | 80 | #define GPIO68_GPIO MFP_CFG(GPIO68, AF0) |
81 | #define GPIO69_GPIO69 MFP_CFG(GPIO69, AF0) | 81 | #define GPIO69_GPIO MFP_CFG(GPIO69, AF0) |
82 | #define GPIO70_GPIO70 MFP_CFG(GPIO70, AF0) | 82 | #define GPIO70_GPIO MFP_CFG(GPIO70, AF0) |
83 | #define GPIO71_GPIO71 MFP_CFG(GPIO71, AF0) | 83 | #define GPIO71_GPIO MFP_CFG(GPIO71, AF0) |
84 | #define GPIO72_GPIO72 MFP_CFG(GPIO72, AF0) | 84 | #define GPIO72_GPIO MFP_CFG(GPIO72, AF0) |
85 | #define GPIO73_GPIO73 MFP_CFG(GPIO73, AF0) | 85 | #define GPIO73_GPIO MFP_CFG(GPIO73, AF0) |
86 | #define GPIO74_GPIO74 MFP_CFG(GPIO74, AF0) | 86 | #define GPIO74_GPIO MFP_CFG(GPIO74, AF0) |
87 | #define GPIO75_GPIO75 MFP_CFG(GPIO75, AF0) | 87 | #define GPIO75_GPIO MFP_CFG(GPIO75, AF0) |
88 | #define GPIO76_GPIO76 MFP_CFG(GPIO76, AF0) | 88 | #define GPIO76_GPIO MFP_CFG(GPIO76, AF0) |
89 | #define GPIO77_GPIO77 MFP_CFG(GPIO77, AF0) | 89 | #define GPIO77_GPIO MFP_CFG(GPIO77, AF0) |
90 | #define GPIO78_GPIO78 MFP_CFG(GPIO78, AF0) | 90 | #define GPIO78_GPIO MFP_CFG(GPIO78, AF0) |
91 | #define GPIO79_GPIO79 MFP_CFG(GPIO79, AF0) | 91 | #define GPIO79_GPIO MFP_CFG(GPIO79, AF0) |
92 | #define GPIO80_GPIO80 MFP_CFG(GPIO80, AF0) | 92 | #define GPIO80_GPIO MFP_CFG(GPIO80, AF0) |
93 | #define GPIO81_GPIO81 MFP_CFG(GPIO81, AF0) | 93 | #define GPIO81_GPIO MFP_CFG(GPIO81, AF0) |
94 | #define GPIO82_GPIO82 MFP_CFG(GPIO82, AF0) | 94 | #define GPIO82_GPIO MFP_CFG(GPIO82, AF0) |
95 | #define GPIO83_GPIO83 MFP_CFG(GPIO83, AF0) | 95 | #define GPIO83_GPIO MFP_CFG(GPIO83, AF0) |
96 | #define GPIO84_GPIO84 MFP_CFG(GPIO84, AF0) | 96 | #define GPIO84_GPIO MFP_CFG(GPIO84, AF0) |
97 | #define GPIO85_GPIO85 MFP_CFG(GPIO85, AF0) | 97 | #define GPIO85_GPIO MFP_CFG(GPIO85, AF0) |
98 | #define GPIO86_GPIO86 MFP_CFG(GPIO86, AF0) | 98 | #define GPIO86_GPIO MFP_CFG(GPIO86, AF0) |
99 | #define GPIO87_GPIO87 MFP_CFG(GPIO87, AF0) | 99 | #define GPIO87_GPIO MFP_CFG(GPIO87, AF0) |
100 | #define GPIO88_GPIO88 MFP_CFG(GPIO88, AF0) | 100 | #define GPIO88_GPIO MFP_CFG(GPIO88, AF0) |
101 | #define GPIO89_GPIO89 MFP_CFG(GPIO89, AF0) | 101 | #define GPIO89_GPIO MFP_CFG(GPIO89, AF0) |
102 | #define GPIO90_GPIO90 MFP_CFG(GPIO90, AF0) | 102 | #define GPIO90_GPIO MFP_CFG(GPIO90, AF0) |
103 | #define GPIO91_GPIO91 MFP_CFG(GPIO91, AF0) | 103 | #define GPIO91_GPIO MFP_CFG(GPIO91, AF0) |
104 | #define GPIO92_GPIO92 MFP_CFG(GPIO92, AF0) | 104 | #define GPIO92_GPIO MFP_CFG(GPIO92, AF0) |
105 | #define GPIO93_GPIO93 MFP_CFG(GPIO93, AF0) | 105 | #define GPIO93_GPIO MFP_CFG(GPIO93, AF0) |
106 | #define GPIO94_GPIO94 MFP_CFG(GPIO94, AF0) | 106 | #define GPIO94_GPIO MFP_CFG(GPIO94, AF0) |
107 | #define GPIO95_GPIO95 MFP_CFG(GPIO95, AF0) | 107 | #define GPIO95_GPIO MFP_CFG(GPIO95, AF0) |
108 | #define GPIO96_GPIO96 MFP_CFG(GPIO96, AF0) | 108 | #define GPIO96_GPIO MFP_CFG(GPIO96, AF0) |
109 | #define GPIO97_GPIO97 MFP_CFG(GPIO97, AF0) | 109 | #define GPIO97_GPIO MFP_CFG(GPIO97, AF0) |
110 | #define GPIO98_GPIO98 MFP_CFG(GPIO98, AF0) | 110 | #define GPIO98_GPIO MFP_CFG(GPIO98, AF0) |
111 | #define GPIO99_GPIO99 MFP_CFG(GPIO99, AF0) | 111 | #define GPIO99_GPIO MFP_CFG(GPIO99, AF0) |
112 | #define GPIO100_GPIO100 MFP_CFG(GPIO100, AF0) | 112 | #define GPIO100_GPIO MFP_CFG(GPIO100, AF0) |
113 | #define GPIO101_GPIO101 MFP_CFG(GPIO101, AF0) | 113 | #define GPIO101_GPIO MFP_CFG(GPIO101, AF0) |
114 | #define GPIO102_GPIO102 MFP_CFG(GPIO102, AF1) | 114 | #define GPIO102_GPIO MFP_CFG(GPIO102, AF1) |
115 | #define GPIO103_GPIO103 MFP_CFG(GPIO103, AF1) | 115 | #define GPIO103_GPIO MFP_CFG(GPIO103, AF1) |
116 | #define GPIO104_GPIO104 MFP_CFG(GPIO104, AF1) | 116 | #define GPIO104_GPIO MFP_CFG(GPIO104, AF1) |
117 | #define GPIO105_GPIO105 MFP_CFG(GPIO105, AF1) | 117 | #define GPIO105_GPIO MFP_CFG(GPIO105, AF1) |
118 | #define GPIO106_GPIO106 MFP_CFG(GPIO106, AF1) | 118 | #define GPIO106_GPIO MFP_CFG(GPIO106, AF1) |
119 | #define GPIO107_GPIO107 MFP_CFG(GPIO107, AF1) | 119 | #define GPIO107_GPIO MFP_CFG(GPIO107, AF1) |
120 | #define GPIO108_GPIO108 MFP_CFG(GPIO108, AF1) | 120 | #define GPIO108_GPIO MFP_CFG(GPIO108, AF1) |
121 | #define GPIO109_GPIO109 MFP_CFG(GPIO109, AF1) | 121 | #define GPIO109_GPIO MFP_CFG(GPIO109, AF1) |
122 | #define GPIO110_GPIO110 MFP_CFG(GPIO110, AF1) | 122 | #define GPIO110_GPIO MFP_CFG(GPIO110, AF1) |
123 | #define GPIO111_GPIO111 MFP_CFG(GPIO111, AF1) | 123 | #define GPIO111_GPIO MFP_CFG(GPIO111, AF1) |
124 | #define GPIO112_GPIO112 MFP_CFG(GPIO112, AF1) | 124 | #define GPIO112_GPIO MFP_CFG(GPIO112, AF1) |
125 | #define GPIO113_GPIO113 MFP_CFG(GPIO113, AF1) | 125 | #define GPIO113_GPIO MFP_CFG(GPIO113, AF1) |
126 | #define GPIO114_GPIO114 MFP_CFG(GPIO114, AF0) | 126 | #define GPIO114_GPIO MFP_CFG(GPIO114, AF0) |
127 | #define GPIO115_GPIO115 MFP_CFG(GPIO115, AF0) | 127 | #define GPIO115_GPIO MFP_CFG(GPIO115, AF0) |
128 | #define GPIO116_GPIO116 MFP_CFG(GPIO116, AF0) | 128 | #define GPIO116_GPIO MFP_CFG(GPIO116, AF0) |
129 | #define GPIO117_GPIO117 MFP_CFG(GPIO117, AF0) | 129 | #define GPIO117_GPIO MFP_CFG(GPIO117, AF0) |
130 | #define GPIO118_GPIO118 MFP_CFG(GPIO118, AF0) | 130 | #define GPIO118_GPIO MFP_CFG(GPIO118, AF0) |
131 | #define GPIO119_GPIO119 MFP_CFG(GPIO119, AF0) | 131 | #define GPIO119_GPIO MFP_CFG(GPIO119, AF0) |
132 | #define GPIO120_GPIO120 MFP_CFG(GPIO120, AF0) | 132 | #define GPIO120_GPIO MFP_CFG(GPIO120, AF0) |
133 | #define GPIO121_GPIO121 MFP_CFG(GPIO121, AF0) | 133 | #define GPIO121_GPIO MFP_CFG(GPIO121, AF0) |
134 | #define GPIO122_GPIO122 MFP_CFG(GPIO122, AF0) | 134 | #define GPIO122_GPIO MFP_CFG(GPIO122, AF0) |
135 | #define GPIO123_GPIO123 MFP_CFG(GPIO123, AF0) | 135 | #define GPIO123_GPIO MFP_CFG(GPIO123, AF0) |
136 | #define GPIO124_GPIO124 MFP_CFG(GPIO124, AF0) | 136 | #define GPIO124_GPIO MFP_CFG(GPIO124, AF0) |
137 | #define GPIO125_GPIO125 MFP_CFG(GPIO125, AF0) | 137 | #define GPIO125_GPIO MFP_CFG(GPIO125, AF0) |
138 | #define GPIO126_GPIO126 MFP_CFG(GPIO126, AF0) | 138 | #define GPIO126_GPIO MFP_CFG(GPIO126, AF0) |
139 | #define GPIO127_GPIO127 MFP_CFG(GPIO127, AF0) | 139 | #define GPIO127_GPIO MFP_CFG(GPIO127, AF0) |
140 | #define GPIO128_GPIO128 MFP_CFG(GPIO128, AF0) | 140 | #define GPIO128_GPIO MFP_CFG(GPIO128, AF0) |
141 | #define GPIO129_GPIO129 MFP_CFG(GPIO129, AF0) | 141 | #define GPIO129_GPIO MFP_CFG(GPIO129, AF0) |
142 | #define GPIO130_GPIO130 MFP_CFG(GPIO130, AF0) | 142 | #define GPIO130_GPIO MFP_CFG(GPIO130, AF0) |
143 | #define GPIO131_GPIO131 MFP_CFG(GPIO131, AF0) | 143 | #define GPIO131_GPIO MFP_CFG(GPIO131, AF0) |
144 | #define GPIO132_GPIO132 MFP_CFG(GPIO132, AF0) | 144 | #define GPIO132_GPIO MFP_CFG(GPIO132, AF0) |
145 | #define GPIO133_GPIO133 MFP_CFG(GPIO133, AF0) | 145 | #define GPIO133_GPIO MFP_CFG(GPIO133, AF0) |
146 | #define GPIO134_GPIO134 MFP_CFG(GPIO134, AF0) | 146 | #define GPIO134_GPIO MFP_CFG(GPIO134, AF0) |
147 | #define GPIO135_GPIO135 MFP_CFG(GPIO135, AF0) | 147 | #define GPIO135_GPIO MFP_CFG(GPIO135, AF0) |
148 | #define GPIO136_GPIO136 MFP_CFG(GPIO136, AF0) | 148 | #define GPIO136_GPIO MFP_CFG(GPIO136, AF0) |
149 | #define GPIO137_GPIO137 MFP_CFG(GPIO137, AF0) | 149 | #define GPIO137_GPIO MFP_CFG(GPIO137, AF0) |
150 | #define GPIO138_GPIO138 MFP_CFG(GPIO138, AF0) | 150 | #define GPIO138_GPIO MFP_CFG(GPIO138, AF0) |
151 | #define GPIO139_GPIO139 MFP_CFG(GPIO139, AF0) | 151 | #define GPIO139_GPIO MFP_CFG(GPIO139, AF0) |
152 | #define GPIO140_GPIO140 MFP_CFG(GPIO140, AF0) | 152 | #define GPIO140_GPIO MFP_CFG(GPIO140, AF0) |
153 | #define GPIO141_GPIO141 MFP_CFG(GPIO141, AF0) | 153 | #define GPIO141_GPIO MFP_CFG(GPIO141, AF0) |
154 | #define GPIO142_GPIO142 MFP_CFG(GPIO142, AF1) | 154 | #define GPIO142_GPIO MFP_CFG(GPIO142, AF1) |
155 | #define GPIO143_GPIO143 MFP_CFG(GPIO143, AF1) | 155 | #define GPIO143_GPIO MFP_CFG(GPIO143, AF1) |
156 | #define GPIO144_GPIO144 MFP_CFG(GPIO144, AF1) | 156 | #define GPIO144_GPIO MFP_CFG(GPIO144, AF1) |
157 | #define GPIO145_GPIO145 MFP_CFG(GPIO145, AF1) | 157 | #define GPIO145_GPIO MFP_CFG(GPIO145, AF1) |
158 | #define GPIO146_GPIO146 MFP_CFG(GPIO146, AF1) | 158 | #define GPIO146_GPIO MFP_CFG(GPIO146, AF1) |
159 | #define GPIO147_GPIO147 MFP_CFG(GPIO147, AF1) | 159 | #define GPIO147_GPIO MFP_CFG(GPIO147, AF1) |
160 | #define GPIO148_GPIO148 MFP_CFG(GPIO148, AF1) | 160 | #define GPIO148_GPIO MFP_CFG(GPIO148, AF1) |
161 | #define GPIO149_GPIO149 MFP_CFG(GPIO149, AF1) | 161 | #define GPIO149_GPIO MFP_CFG(GPIO149, AF1) |
162 | #define GPIO150_GPIO150 MFP_CFG(GPIO150, AF1) | 162 | #define GPIO150_GPIO MFP_CFG(GPIO150, AF1) |
163 | #define GPIO151_GPIO151 MFP_CFG(GPIO151, AF1) | 163 | #define GPIO151_GPIO MFP_CFG(GPIO151, AF1) |
164 | #define GPIO152_GPIO152 MFP_CFG(GPIO152, AF1) | 164 | #define GPIO152_GPIO MFP_CFG(GPIO152, AF1) |
165 | #define GPIO153_GPIO153 MFP_CFG(GPIO153, AF1) | 165 | #define GPIO153_GPIO MFP_CFG(GPIO153, AF1) |
166 | #define GPIO154_GPIO154 MFP_CFG(GPIO154, AF1) | 166 | #define GPIO154_GPIO MFP_CFG(GPIO154, AF1) |
167 | #define GPIO155_GPIO155 MFP_CFG(GPIO155, AF1) | 167 | #define GPIO155_GPIO MFP_CFG(GPIO155, AF1) |
168 | #define GPIO156_GPIO156 MFP_CFG(GPIO156, AF1) | 168 | #define GPIO156_GPIO MFP_CFG(GPIO156, AF1) |
169 | #define GPIO157_GPIO157 MFP_CFG(GPIO157, AF1) | 169 | #define GPIO157_GPIO MFP_CFG(GPIO157, AF1) |
170 | #define GPIO158_GPIO158 MFP_CFG(GPIO158, AF1) | 170 | #define GPIO158_GPIO MFP_CFG(GPIO158, AF1) |
171 | #define GPIO159_GPIO159 MFP_CFG(GPIO159, AF1) | 171 | #define GPIO159_GPIO MFP_CFG(GPIO159, AF1) |
172 | #define GPIO160_GPIO160 MFP_CFG(GPIO160, AF1) | 172 | #define GPIO160_GPIO MFP_CFG(GPIO160, AF1) |
173 | #define GPIO161_GPIO161 MFP_CFG(GPIO161, AF1) | 173 | #define GPIO161_GPIO MFP_CFG(GPIO161, AF1) |
174 | #define GPIO162_GPIO162 MFP_CFG(GPIO162, AF1) | 174 | #define GPIO162_GPIO MFP_CFG(GPIO162, AF1) |
175 | #define GPIO163_GPIO163 MFP_CFG(GPIO163, AF1) | 175 | #define GPIO163_GPIO MFP_CFG(GPIO163, AF1) |
176 | #define GPIO164_GPIO164 MFP_CFG(GPIO164, AF1) | 176 | #define GPIO164_GPIO MFP_CFG(GPIO164, AF1) |
177 | #define GPIO165_GPIO165 MFP_CFG(GPIO165, AF1) | 177 | #define GPIO165_GPIO MFP_CFG(GPIO165, AF1) |
178 | #define GPIO166_GPIO166 MFP_CFG(GPIO166, AF1) | 178 | #define GPIO166_GPIO MFP_CFG(GPIO166, AF1) |
179 | #define GPIO167_GPIO167 MFP_CFG(GPIO167, AF1) | 179 | #define GPIO167_GPIO MFP_CFG(GPIO167, AF1) |
180 | #define GPIO168_GPIO168 MFP_CFG(GPIO168, AF1) | 180 | #define GPIO168_GPIO MFP_CFG(GPIO168, AF1) |
181 | 181 | ||
182 | /* DFI */ | 182 | /* DFI */ |
183 | #define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0) | 183 | #define GPIO108_DFI_D15 MFP_CFG(GPIO108, AF0) |
diff --git a/arch/arm/mach-mmp/include/mach/mmp2.h b/arch/arm/mach-mmp/include/mach/mmp2.h index dbba6e8a60c4..4aec493640b4 100644 --- a/arch/arm/mach-mmp/include/mach/mmp2.h +++ b/arch/arm/mach-mmp/include/mach/mmp2.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __ASM_MACH_MMP2_H | 1 | #ifndef __ASM_MACH_MMP2_H |
2 | #define __ASM_MACH_MMP2_H | 2 | #define __ASM_MACH_MMP2_H |
3 | 3 | ||
4 | #include <plat/sdhci.h> | ||
5 | |||
4 | struct sys_timer; | 6 | struct sys_timer; |
5 | 7 | ||
6 | extern struct sys_timer mmp2_timer; | 8 | extern struct sys_timer mmp2_timer; |
@@ -22,6 +24,10 @@ extern struct pxa_device_desc mmp2_device_twsi3; | |||
22 | extern struct pxa_device_desc mmp2_device_twsi4; | 24 | extern struct pxa_device_desc mmp2_device_twsi4; |
23 | extern struct pxa_device_desc mmp2_device_twsi5; | 25 | extern struct pxa_device_desc mmp2_device_twsi5; |
24 | extern struct pxa_device_desc mmp2_device_twsi6; | 26 | extern struct pxa_device_desc mmp2_device_twsi6; |
27 | extern struct pxa_device_desc mmp2_device_sdh0; | ||
28 | extern struct pxa_device_desc mmp2_device_sdh1; | ||
29 | extern struct pxa_device_desc mmp2_device_sdh2; | ||
30 | extern struct pxa_device_desc mmp2_device_sdh3; | ||
25 | 31 | ||
26 | static inline int mmp2_add_uart(int id) | 32 | static inline int mmp2_add_uart(int id) |
27 | { | 33 | { |
@@ -63,5 +69,21 @@ static inline int mmp2_add_twsi(int id, struct i2c_pxa_platform_data *data, | |||
63 | return pxa_register_device(d, data, sizeof(*data)); | 69 | return pxa_register_device(d, data, sizeof(*data)); |
64 | } | 70 | } |
65 | 71 | ||
72 | static inline int mmp2_add_sdhost(int id, struct sdhci_pxa_platdata *data) | ||
73 | { | ||
74 | struct pxa_device_desc *d = NULL; | ||
75 | |||
76 | switch (id) { | ||
77 | case 0: d = &mmp2_device_sdh0; break; | ||
78 | case 1: d = &mmp2_device_sdh1; break; | ||
79 | case 2: d = &mmp2_device_sdh2; break; | ||
80 | case 3: d = &mmp2_device_sdh3; break; | ||
81 | default: | ||
82 | return -EINVAL; | ||
83 | } | ||
84 | |||
85 | return pxa_register_device(d, data, sizeof(*data)); | ||
86 | } | ||
87 | |||
66 | #endif /* __ASM_MACH_MMP2_H */ | 88 | #endif /* __ASM_MACH_MMP2_H */ |
67 | 89 | ||
diff --git a/arch/arm/mach-mmp/include/mach/regs-apmu.h b/arch/arm/mach-mmp/include/mach/regs-apmu.h index ac4702357a6e..f7011ef70bf5 100644 --- a/arch/arm/mach-mmp/include/mach/regs-apmu.h +++ b/arch/arm/mach-mmp/include/mach/regs-apmu.h | |||
@@ -27,6 +27,8 @@ | |||
27 | #define APMU_DMA APMU_REG(0x064) | 27 | #define APMU_DMA APMU_REG(0x064) |
28 | #define APMU_GEU APMU_REG(0x068) | 28 | #define APMU_GEU APMU_REG(0x068) |
29 | #define APMU_BUS APMU_REG(0x06c) | 29 | #define APMU_BUS APMU_REG(0x06c) |
30 | #define APMU_SDH2 APMU_REG(0x0e8) | ||
31 | #define APMU_SDH3 APMU_REG(0x0ec) | ||
30 | 32 | ||
31 | #define APMU_FNCLK_EN (1 << 4) | 33 | #define APMU_FNCLK_EN (1 << 4) |
32 | #define APMU_AXICLK_EN (1 << 3) | 34 | #define APMU_AXICLK_EN (1 << 3) |
diff --git a/arch/arm/mach-mmp/jasper.c b/arch/arm/mach-mmp/jasper.c index 2a684fa50773..24172a0aad59 100644 --- a/arch/arm/mach-mmp/jasper.c +++ b/arch/arm/mach-mmp/jasper.c | |||
@@ -67,6 +67,36 @@ static unsigned long jasper_pin_config[] __initdata = { | |||
67 | 67 | ||
68 | /* PMIC */ | 68 | /* PMIC */ |
69 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, | 69 | PMIC_PMIC_INT | MFP_LPM_EDGE_FALL, |
70 | |||
71 | /* MMC1 */ | ||
72 | GPIO131_MMC1_DAT3, | ||
73 | GPIO132_MMC1_DAT2, | ||
74 | GPIO133_MMC1_DAT1, | ||
75 | GPIO134_MMC1_DAT0, | ||
76 | GPIO136_MMC1_CMD, | ||
77 | GPIO139_MMC1_CLK, | ||
78 | GPIO140_MMC1_CD, | ||
79 | GPIO141_MMC1_WP, | ||
80 | |||
81 | /* MMC2 */ | ||
82 | GPIO37_MMC2_DAT3, | ||
83 | GPIO38_MMC2_DAT2, | ||
84 | GPIO39_MMC2_DAT1, | ||
85 | GPIO40_MMC2_DAT0, | ||
86 | GPIO41_MMC2_CMD, | ||
87 | GPIO42_MMC2_CLK, | ||
88 | |||
89 | /* MMC3 */ | ||
90 | GPIO165_MMC3_DAT7, | ||
91 | GPIO162_MMC3_DAT6, | ||
92 | GPIO166_MMC3_DAT5, | ||
93 | GPIO163_MMC3_DAT4, | ||
94 | GPIO167_MMC3_DAT3, | ||
95 | GPIO164_MMC3_DAT2, | ||
96 | GPIO168_MMC3_DAT1, | ||
97 | GPIO111_MMC3_DAT0, | ||
98 | GPIO112_MMC3_CMD, | ||
99 | GPIO151_MMC3_CLK, | ||
70 | }; | 100 | }; |
71 | 101 | ||
72 | static struct regulator_consumer_supply max8649_supply[] = { | 102 | static struct regulator_consumer_supply max8649_supply[] = { |
@@ -123,6 +153,10 @@ static struct i2c_board_info jasper_twsi1_info[] = { | |||
123 | }, | 153 | }, |
124 | }; | 154 | }; |
125 | 155 | ||
156 | static struct sdhci_pxa_platdata mmp2_sdh_platdata_mmc0 = { | ||
157 | .max_speed = 25000000, | ||
158 | }; | ||
159 | |||
126 | static void __init jasper_init(void) | 160 | static void __init jasper_init(void) |
127 | { | 161 | { |
128 | mfp_config(ARRAY_AND_SIZE(jasper_pin_config)); | 162 | mfp_config(ARRAY_AND_SIZE(jasper_pin_config)); |
@@ -131,6 +165,7 @@ static void __init jasper_init(void) | |||
131 | mmp2_add_uart(1); | 165 | mmp2_add_uart(1); |
132 | mmp2_add_uart(3); | 166 | mmp2_add_uart(3); |
133 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); | 167 | mmp2_add_twsi(1, NULL, ARRAY_AND_SIZE(jasper_twsi1_info)); |
168 | mmp2_add_sdhost(0, &mmp2_sdh_platdata_mmc0); /* SD/MMC */ | ||
134 | 169 | ||
135 | regulator_has_full_constraints(); | 170 | regulator_has_full_constraints(); |
136 | } | 171 | } |
diff --git a/arch/arm/mach-mmp/mmp2.c b/arch/arm/mach-mmp/mmp2.c index daf3993349f8..8e6c3ac7f7c1 100644 --- a/arch/arm/mach-mmp/mmp2.c +++ b/arch/arm/mach-mmp/mmp2.c | |||
@@ -115,6 +115,29 @@ void __init mmp2_init_irq(void) | |||
115 | mmp2_init_gpio(); | 115 | mmp2_init_gpio(); |
116 | } | 116 | } |
117 | 117 | ||
118 | static void sdhc_clk_enable(struct clk *clk) | ||
119 | { | ||
120 | uint32_t clk_rst; | ||
121 | |||
122 | clk_rst = __raw_readl(clk->clk_rst); | ||
123 | clk_rst |= clk->enable_val; | ||
124 | __raw_writel(clk_rst, clk->clk_rst); | ||
125 | } | ||
126 | |||
127 | static void sdhc_clk_disable(struct clk *clk) | ||
128 | { | ||
129 | uint32_t clk_rst; | ||
130 | |||
131 | clk_rst = __raw_readl(clk->clk_rst); | ||
132 | clk_rst &= ~clk->enable_val; | ||
133 | __raw_writel(clk_rst, clk->clk_rst); | ||
134 | } | ||
135 | |||
136 | struct clkops sdhc_clk_ops = { | ||
137 | .enable = sdhc_clk_enable, | ||
138 | .disable = sdhc_clk_disable, | ||
139 | }; | ||
140 | |||
118 | /* APB peripheral clocks */ | 141 | /* APB peripheral clocks */ |
119 | static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); | 142 | static APBC_CLK(uart1, MMP2_UART1, 1, 26000000); |
120 | static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); | 143 | static APBC_CLK(uart2, MMP2_UART2, 1, 26000000); |
@@ -126,9 +149,12 @@ static APBC_CLK(twsi3, MMP2_TWSI3, 0, 26000000); | |||
126 | static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000); | 149 | static APBC_CLK(twsi4, MMP2_TWSI4, 0, 26000000); |
127 | static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); | 150 | static APBC_CLK(twsi5, MMP2_TWSI5, 0, 26000000); |
128 | static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); | 151 | static APBC_CLK(twsi6, MMP2_TWSI6, 0, 26000000); |
129 | static APBC_CLK(rtc, MMP2_RTC, 0, 32768); | ||
130 | 152 | ||
131 | static APMU_CLK(nand, NAND, 0xbf, 100000000); | 153 | static APMU_CLK(nand, NAND, 0xbf, 100000000); |
154 | static APMU_CLK_OPS(sdh0, SDH0, 0x1b, 200000000, &sdhc_clk_ops); | ||
155 | static APMU_CLK_OPS(sdh1, SDH1, 0x1b, 200000000, &sdhc_clk_ops); | ||
156 | static APMU_CLK_OPS(sdh2, SDH2, 0x1b, 200000000, &sdhc_clk_ops); | ||
157 | static APMU_CLK_OPS(sdh3, SDH3, 0x1b, 200000000, &sdhc_clk_ops); | ||
132 | 158 | ||
133 | static struct clk_lookup mmp2_clkregs[] = { | 159 | static struct clk_lookup mmp2_clkregs[] = { |
134 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), | 160 | INIT_CLKREG(&clk_uart1, "pxa2xx-uart.0", NULL), |
@@ -142,6 +168,10 @@ static struct clk_lookup mmp2_clkregs[] = { | |||
142 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), | 168 | INIT_CLKREG(&clk_twsi5, "pxa2xx-i2c.4", NULL), |
143 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), | 169 | INIT_CLKREG(&clk_twsi6, "pxa2xx-i2c.5", NULL), |
144 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 170 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
171 | INIT_CLKREG(&clk_sdh0, "sdhci-pxa.0", "PXA-SDHCLK"), | ||
172 | INIT_CLKREG(&clk_sdh1, "sdhci-pxa.1", "PXA-SDHCLK"), | ||
173 | INIT_CLKREG(&clk_sdh2, "sdhci-pxa.2", "PXA-SDHCLK"), | ||
174 | INIT_CLKREG(&clk_sdh3, "sdhci-pxa.3", "PXA-SDHCLK"), | ||
145 | }; | 175 | }; |
146 | 176 | ||
147 | static int __init mmp2_init(void) | 177 | static int __init mmp2_init(void) |
@@ -192,4 +222,8 @@ MMP2_DEVICE(twsi4, "pxa2xx-i2c", 3, TWSI4, 0xd4033000, 0x70); | |||
192 | MMP2_DEVICE(twsi5, "pxa2xx-i2c", 4, TWSI5, 0xd4033800, 0x70); | 222 | MMP2_DEVICE(twsi5, "pxa2xx-i2c", 4, TWSI5, 0xd4033800, 0x70); |
193 | MMP2_DEVICE(twsi6, "pxa2xx-i2c", 5, TWSI6, 0xd4034000, 0x70); | 223 | MMP2_DEVICE(twsi6, "pxa2xx-i2c", 5, TWSI6, 0xd4034000, 0x70); |
194 | MMP2_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x100, 28, 29); | 224 | MMP2_DEVICE(nand, "pxa3xx-nand", -1, NAND, 0xd4283000, 0x100, 28, 29); |
225 | MMP2_DEVICE(sdh0, "sdhci-pxa", 0, MMC, 0xd4280000, 0x120); | ||
226 | MMP2_DEVICE(sdh1, "sdhci-pxa", 1, MMC2, 0xd4280800, 0x120); | ||
227 | MMP2_DEVICE(sdh2, "sdhci-pxa", 2, MMC3, 0xd4281000, 0x120); | ||
228 | MMP2_DEVICE(sdh3, "sdhci-pxa", 3, MMC4, 0xd4281800, 0x120); | ||
195 | 229 | ||
diff --git a/arch/arm/mach-mmp/pxa910.c b/arch/arm/mach-mmp/pxa910.c index 46f2d69bef3c..8f92ccd26edf 100644 --- a/arch/arm/mach-mmp/pxa910.c +++ b/arch/arm/mach-mmp/pxa910.c | |||
@@ -111,6 +111,7 @@ static APBC_CLK(pwm3, PXA910_PWM3, 1, 13000000); | |||
111 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); | 111 | static APBC_CLK(pwm4, PXA910_PWM4, 1, 13000000); |
112 | 112 | ||
113 | static APMU_CLK(nand, NAND, 0x01db, 208000000); | 113 | static APMU_CLK(nand, NAND, 0x01db, 208000000); |
114 | static APMU_CLK(u2o, USB, 0x1b, 480000000); | ||
114 | 115 | ||
115 | /* device and clock bindings */ | 116 | /* device and clock bindings */ |
116 | static struct clk_lookup pxa910_clkregs[] = { | 117 | static struct clk_lookup pxa910_clkregs[] = { |
@@ -123,6 +124,7 @@ static struct clk_lookup pxa910_clkregs[] = { | |||
123 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), | 124 | INIT_CLKREG(&clk_pwm3, "pxa910-pwm.2", NULL), |
124 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), | 125 | INIT_CLKREG(&clk_pwm4, "pxa910-pwm.3", NULL), |
125 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), | 126 | INIT_CLKREG(&clk_nand, "pxa3xx-nand", NULL), |
127 | INIT_CLKREG(&clk_u2o, "pxa-u2o", "U2OCLK"), | ||
126 | }; | 128 | }; |
127 | 129 | ||
128 | static int __init pxa910_init(void) | 130 | static int __init pxa910_init(void) |
diff --git a/arch/arm/mach-omap2/board-zoom-peripherals.c b/arch/arm/mach-omap2/board-zoom-peripherals.c index 86c9b2102952..9db9203667df 100644 --- a/arch/arm/mach-omap2/board-zoom-peripherals.c +++ b/arch/arm/mach-omap2/board-zoom-peripherals.c | |||
@@ -216,7 +216,7 @@ static struct omap2_hsmmc_info mmc[] __initdata = { | |||
216 | { | 216 | { |
217 | .name = "wl1271", | 217 | .name = "wl1271", |
218 | .mmc = 3, | 218 | .mmc = 3, |
219 | .caps = MMC_CAP_4_BIT_DATA, | 219 | .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD, |
220 | .gpio_wp = -EINVAL, | 220 | .gpio_wp = -EINVAL, |
221 | .gpio_cd = -EINVAL, | 221 | .gpio_cd = -EINVAL, |
222 | .nonremovable = true, | 222 | .nonremovable = true, |
diff --git a/arch/arm/mach-omap2/io.c b/arch/arm/mach-omap2/io.c index 40562ddd3ee4..a1939b1e6f82 100644 --- a/arch/arm/mach-omap2/io.c +++ b/arch/arm/mach-omap2/io.c | |||
@@ -297,7 +297,7 @@ static int __init _omap2_init_reprogram_sdrc(void) | |||
297 | return 0; | 297 | return 0; |
298 | 298 | ||
299 | dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); | 299 | dpll3_m2_ck = clk_get(NULL, "dpll3_m2_ck"); |
300 | if (!dpll3_m2_ck) | 300 | if (IS_ERR(dpll3_m2_ck)) |
301 | return -EINVAL; | 301 | return -EINVAL; |
302 | 302 | ||
303 | rate = clk_get_rate(dpll3_m2_ck); | 303 | rate = clk_get_rate(dpll3_m2_ck); |
diff --git a/arch/arm/mach-omap2/pm-debug.c b/arch/arm/mach-omap2/pm-debug.c index 5e81517a7af2..a8afb610c7d8 100644 --- a/arch/arm/mach-omap2/pm-debug.c +++ b/arch/arm/mach-omap2/pm-debug.c | |||
@@ -161,6 +161,23 @@ void omap2_pm_dump(int mode, int resume, unsigned int us) | |||
161 | printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val); | 161 | printk(KERN_INFO "%-20s: 0x%08x\n", regs[i].name, regs[i].val); |
162 | } | 162 | } |
163 | 163 | ||
164 | void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds) | ||
165 | { | ||
166 | u32 tick_rate, cycles; | ||
167 | |||
168 | if (!seconds && !milliseconds) | ||
169 | return; | ||
170 | |||
171 | tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup)); | ||
172 | cycles = tick_rate * seconds + tick_rate * milliseconds / 1000; | ||
173 | omap_dm_timer_stop(gptimer_wakeup); | ||
174 | omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles); | ||
175 | |||
176 | pr_info("PM: Resume timer in %u.%03u secs" | ||
177 | " (%d ticks at %d ticks/sec.)\n", | ||
178 | seconds, milliseconds, cycles, tick_rate); | ||
179 | } | ||
180 | |||
164 | #ifdef CONFIG_DEBUG_FS | 181 | #ifdef CONFIG_DEBUG_FS |
165 | #include <linux/debugfs.h> | 182 | #include <linux/debugfs.h> |
166 | #include <linux/seq_file.h> | 183 | #include <linux/seq_file.h> |
@@ -354,23 +371,6 @@ void pm_dbg_update_time(struct powerdomain *pwrdm, int prev) | |||
354 | pwrdm->timer = t; | 371 | pwrdm->timer = t; |
355 | } | 372 | } |
356 | 373 | ||
357 | void omap2_pm_wakeup_on_timer(u32 seconds, u32 milliseconds) | ||
358 | { | ||
359 | u32 tick_rate, cycles; | ||
360 | |||
361 | if (!seconds && !milliseconds) | ||
362 | return; | ||
363 | |||
364 | tick_rate = clk_get_rate(omap_dm_timer_get_fclk(gptimer_wakeup)); | ||
365 | cycles = tick_rate * seconds + tick_rate * milliseconds / 1000; | ||
366 | omap_dm_timer_stop(gptimer_wakeup); | ||
367 | omap_dm_timer_set_load_start(gptimer_wakeup, 0, 0xffffffff - cycles); | ||
368 | |||
369 | pr_info("PM: Resume timer in %u.%03u secs" | ||
370 | " (%d ticks at %d ticks/sec.)\n", | ||
371 | seconds, milliseconds, cycles, tick_rate); | ||
372 | } | ||
373 | |||
374 | static int clkdm_dbg_show_counter(struct clockdomain *clkdm, void *user) | 374 | static int clkdm_dbg_show_counter(struct clockdomain *clkdm, void *user) |
375 | { | 375 | { |
376 | struct seq_file *s = (struct seq_file *)user; | 376 | struct seq_file *s = (struct seq_file *)user; |
diff --git a/arch/arm/mach-omap2/pm24xx.c b/arch/arm/mach-omap2/pm24xx.c index c85923e56b85..aaeea49b9bdd 100644 --- a/arch/arm/mach-omap2/pm24xx.c +++ b/arch/arm/mach-omap2/pm24xx.c | |||
@@ -53,6 +53,19 @@ | |||
53 | #include <plat/powerdomain.h> | 53 | #include <plat/powerdomain.h> |
54 | #include <plat/clockdomain.h> | 54 | #include <plat/clockdomain.h> |
55 | 55 | ||
56 | #ifdef CONFIG_SUSPEND | ||
57 | static suspend_state_t suspend_state = PM_SUSPEND_ON; | ||
58 | static inline bool is_suspending(void) | ||
59 | { | ||
60 | return (suspend_state != PM_SUSPEND_ON); | ||
61 | } | ||
62 | #else | ||
63 | static inline bool is_suspending(void) | ||
64 | { | ||
65 | return false; | ||
66 | } | ||
67 | #endif | ||
68 | |||
56 | static void (*omap2_sram_idle)(void); | 69 | static void (*omap2_sram_idle)(void); |
57 | static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, | 70 | static void (*omap2_sram_suspend)(u32 dllctrl, void __iomem *sdrc_dlla_ctrl, |
58 | void __iomem *sdrc_power); | 71 | void __iomem *sdrc_power); |
@@ -120,8 +133,9 @@ static void omap2_enter_full_retention(void) | |||
120 | goto no_sleep; | 133 | goto no_sleep; |
121 | 134 | ||
122 | /* Block console output in case it is on one of the OMAP UARTs */ | 135 | /* Block console output in case it is on one of the OMAP UARTs */ |
123 | if (try_acquire_console_sem()) | 136 | if (!is_suspending()) |
124 | goto no_sleep; | 137 | if (try_acquire_console_sem()) |
138 | goto no_sleep; | ||
125 | 139 | ||
126 | omap_uart_prepare_idle(0); | 140 | omap_uart_prepare_idle(0); |
127 | omap_uart_prepare_idle(1); | 141 | omap_uart_prepare_idle(1); |
@@ -136,7 +150,8 @@ static void omap2_enter_full_retention(void) | |||
136 | omap_uart_resume_idle(1); | 150 | omap_uart_resume_idle(1); |
137 | omap_uart_resume_idle(0); | 151 | omap_uart_resume_idle(0); |
138 | 152 | ||
139 | release_console_sem(); | 153 | if (!is_suspending()) |
154 | release_console_sem(); | ||
140 | 155 | ||
141 | no_sleep: | 156 | no_sleep: |
142 | if (omap2_pm_debug) { | 157 | if (omap2_pm_debug) { |
@@ -284,6 +299,12 @@ out: | |||
284 | local_irq_enable(); | 299 | local_irq_enable(); |
285 | } | 300 | } |
286 | 301 | ||
302 | static int omap2_pm_begin(suspend_state_t state) | ||
303 | { | ||
304 | suspend_state = state; | ||
305 | return 0; | ||
306 | } | ||
307 | |||
287 | static int omap2_pm_prepare(void) | 308 | static int omap2_pm_prepare(void) |
288 | { | 309 | { |
289 | /* We cannot sleep in idle until we have resumed */ | 310 | /* We cannot sleep in idle until we have resumed */ |
@@ -333,10 +354,17 @@ static void omap2_pm_finish(void) | |||
333 | enable_hlt(); | 354 | enable_hlt(); |
334 | } | 355 | } |
335 | 356 | ||
357 | static void omap2_pm_end(void) | ||
358 | { | ||
359 | suspend_state = PM_SUSPEND_ON; | ||
360 | } | ||
361 | |||
336 | static struct platform_suspend_ops omap_pm_ops = { | 362 | static struct platform_suspend_ops omap_pm_ops = { |
363 | .begin = omap2_pm_begin, | ||
337 | .prepare = omap2_pm_prepare, | 364 | .prepare = omap2_pm_prepare, |
338 | .enter = omap2_pm_enter, | 365 | .enter = omap2_pm_enter, |
339 | .finish = omap2_pm_finish, | 366 | .finish = omap2_pm_finish, |
367 | .end = omap2_pm_end, | ||
340 | .valid = suspend_valid_only_mem, | 368 | .valid = suspend_valid_only_mem, |
341 | }; | 369 | }; |
342 | 370 | ||
diff --git a/arch/arm/mach-omap2/pm34xx.c b/arch/arm/mach-omap2/pm34xx.c index 0ec8a04b7473..648b8c50d024 100644 --- a/arch/arm/mach-omap2/pm34xx.c +++ b/arch/arm/mach-omap2/pm34xx.c | |||
@@ -50,6 +50,19 @@ | |||
50 | #include "sdrc.h" | 50 | #include "sdrc.h" |
51 | #include "control.h" | 51 | #include "control.h" |
52 | 52 | ||
53 | #ifdef CONFIG_SUSPEND | ||
54 | static suspend_state_t suspend_state = PM_SUSPEND_ON; | ||
55 | static inline bool is_suspending(void) | ||
56 | { | ||
57 | return (suspend_state != PM_SUSPEND_ON); | ||
58 | } | ||
59 | #else | ||
60 | static inline bool is_suspending(void) | ||
61 | { | ||
62 | return false; | ||
63 | } | ||
64 | #endif | ||
65 | |||
53 | /* Scratchpad offsets */ | 66 | /* Scratchpad offsets */ |
54 | #define OMAP343X_TABLE_ADDRESS_OFFSET 0xc4 | 67 | #define OMAP343X_TABLE_ADDRESS_OFFSET 0xc4 |
55 | #define OMAP343X_TABLE_VALUE_OFFSET 0xc0 | 68 | #define OMAP343X_TABLE_VALUE_OFFSET 0xc0 |
@@ -387,10 +400,11 @@ void omap_sram_idle(void) | |||
387 | } | 400 | } |
388 | 401 | ||
389 | /* Block console output in case it is on one of the OMAP UARTs */ | 402 | /* Block console output in case it is on one of the OMAP UARTs */ |
390 | if (per_next_state < PWRDM_POWER_ON || | 403 | if (!is_suspending()) |
391 | core_next_state < PWRDM_POWER_ON) | 404 | if (per_next_state < PWRDM_POWER_ON || |
392 | if (try_acquire_console_sem()) | 405 | core_next_state < PWRDM_POWER_ON) |
393 | goto console_still_active; | 406 | if (try_acquire_console_sem()) |
407 | goto console_still_active; | ||
394 | 408 | ||
395 | /* PER */ | 409 | /* PER */ |
396 | if (per_next_state < PWRDM_POWER_ON) { | 410 | if (per_next_state < PWRDM_POWER_ON) { |
@@ -470,7 +484,8 @@ void omap_sram_idle(void) | |||
470 | omap_uart_resume_idle(3); | 484 | omap_uart_resume_idle(3); |
471 | } | 485 | } |
472 | 486 | ||
473 | release_console_sem(); | 487 | if (!is_suspending()) |
488 | release_console_sem(); | ||
474 | 489 | ||
475 | console_still_active: | 490 | console_still_active: |
476 | /* Disable IO-PAD and IO-CHAIN wakeup */ | 491 | /* Disable IO-PAD and IO-CHAIN wakeup */ |
@@ -514,8 +529,6 @@ out: | |||
514 | } | 529 | } |
515 | 530 | ||
516 | #ifdef CONFIG_SUSPEND | 531 | #ifdef CONFIG_SUSPEND |
517 | static suspend_state_t suspend_state; | ||
518 | |||
519 | static int omap3_pm_prepare(void) | 532 | static int omap3_pm_prepare(void) |
520 | { | 533 | { |
521 | disable_hlt(); | 534 | disable_hlt(); |
diff --git a/arch/arm/mach-omap2/prcm-common.h b/arch/arm/mach-omap2/prcm-common.h index 298a22a754e2..f81acee4738d 100644 --- a/arch/arm/mach-omap2/prcm-common.h +++ b/arch/arm/mach-omap2/prcm-common.h | |||
@@ -243,13 +243,14 @@ | |||
243 | #define OMAP24XX_EN_GPT1_MASK (1 << 0) | 243 | #define OMAP24XX_EN_GPT1_MASK (1 << 0) |
244 | 244 | ||
245 | /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ | 245 | /* PM_WKST_WKUP, CM_IDLEST_WKUP shared bits */ |
246 | #define OMAP24XX_ST_GPIOS_SHIFT (1 << 2) | 246 | #define OMAP24XX_ST_GPIOS_SHIFT 2 |
247 | #define OMAP24XX_ST_GPIOS_MASK 2 | 247 | #define OMAP24XX_ST_GPIOS_MASK (1 << 2) |
248 | #define OMAP24XX_ST_GPT1_SHIFT (1 << 0) | 248 | #define OMAP24XX_ST_GPT1_SHIFT 0 |
249 | #define OMAP24XX_ST_GPT1_MASK 0 | 249 | #define OMAP24XX_ST_GPT1_MASK (1 << 0) |
250 | 250 | ||
251 | /* CM_IDLEST_MDM and PM_WKST_MDM shared bits */ | 251 | /* CM_IDLEST_MDM and PM_WKST_MDM shared bits */ |
252 | #define OMAP2430_ST_MDM_SHIFT (1 << 0) | 252 | #define OMAP2430_ST_MDM_SHIFT 0 |
253 | #define OMAP2430_ST_MDM_MASK (1 << 0) | ||
253 | 254 | ||
254 | 255 | ||
255 | /* 3430 register bits shared between CM & PRM registers */ | 256 | /* 3430 register bits shared between CM & PRM registers */ |
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index dd235ecc9d6c..1df6db6a136e 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -50,6 +50,10 @@ config MACH_SAAR | |||
50 | select PXA3xx | 50 | select PXA3xx |
51 | select CPU_PXA930 | 51 | select CPU_PXA930 |
52 | 52 | ||
53 | config MACH_SAARB | ||
54 | bool "PXA955 Handheld Platform (aka SAARB)" | ||
55 | select CPU_PXA955 | ||
56 | |||
53 | comment "Third Party Dev Platforms (sorted by vendor name)" | 57 | comment "Third Party Dev Platforms (sorted by vendor name)" |
54 | 58 | ||
55 | config ARCH_PXA_IDP | 59 | config ARCH_PXA_IDP |
@@ -232,10 +236,6 @@ config MACH_COLIBRI | |||
232 | bool "Toradex Colibri PXA270" | 236 | bool "Toradex Colibri PXA270" |
233 | select PXA27x | 237 | select PXA27x |
234 | 238 | ||
235 | config MACH_COLIBRI_PXA270_EVALBOARD | ||
236 | bool "Toradex Colibri Evaluation Carrier Board support (PXA270)" | ||
237 | depends on MACH_COLIBRI | ||
238 | |||
239 | config MACH_COLIBRI_PXA270_INCOME | 239 | config MACH_COLIBRI_PXA270_INCOME |
240 | bool "Income s.r.o. PXA270 SBC" | 240 | bool "Income s.r.o. PXA270 SBC" |
241 | depends on MACH_COLIBRI | 241 | depends on MACH_COLIBRI |
@@ -253,6 +253,10 @@ config MACH_COLIBRI320 | |||
253 | select PXA3xx | 253 | select PXA3xx |
254 | select CPU_PXA320 | 254 | select CPU_PXA320 |
255 | 255 | ||
256 | config MACH_COLIBRI_EVALBOARD | ||
257 | bool "Toradex Colibri Evaluation Carrier Board support" | ||
258 | depends on MACH_COLIBRI || MACH_COLIBRI300 || MACH_COLIBRI320 | ||
259 | |||
256 | config MACH_VPAC270 | 260 | config MACH_VPAC270 |
257 | bool "Voipac PXA270" | 261 | bool "Voipac PXA270" |
258 | select PXA27x | 262 | select PXA27x |
@@ -651,11 +655,17 @@ config CPU_PXA935 | |||
651 | help | 655 | help |
652 | PXA935 (codename Tavor-P65) | 656 | PXA935 (codename Tavor-P65) |
653 | 657 | ||
654 | config CPU_PXA950 | 658 | config PXA95x |
655 | bool | 659 | bool |
656 | select CPU_PXA930 | 660 | select CPU_PJ4 |
661 | help | ||
662 | Select code specific to PXA95x variants | ||
663 | |||
664 | config CPU_PXA955 | ||
665 | bool | ||
666 | select PXA95x | ||
657 | help | 667 | help |
658 | PXA950 (codename Tavor-PV2) | 668 | PXA950 (codename MG1) |
659 | 669 | ||
660 | config PXA_SHARP_C7xx | 670 | config PXA_SHARP_C7xx |
661 | bool | 671 | bool |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index e2f89c2c6f49..cc39d17b2e07 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -16,9 +16,10 @@ endif | |||
16 | # Generic drivers that other drivers may depend upon | 16 | # Generic drivers that other drivers may depend upon |
17 | 17 | ||
18 | # SoC-specific code | 18 | # SoC-specific code |
19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o pxa2xx.o pxa25x.o | 19 | obj-$(CONFIG_PXA25x) += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa25x.o |
20 | obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o pxa2xx.o pxa27x.o | 20 | obj-$(CONFIG_PXA27x) += mfp-pxa2xx.o clock-pxa2xx.o pxa2xx.o pxa27x.o |
21 | obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o | 21 | obj-$(CONFIG_PXA3xx) += mfp-pxa3xx.o clock-pxa3xx.o pxa3xx.o smemc.o pxa3xx-ulpi.o |
22 | obj-$(CONFIG_PXA95x) += mfp-pxa3xx.o clock-pxa3xx.o pxa95x.o smemc.o | ||
22 | obj-$(CONFIG_CPU_PXA300) += pxa300.o | 23 | obj-$(CONFIG_CPU_PXA300) += pxa300.o |
23 | obj-$(CONFIG_CPU_PXA320) += pxa320.o | 24 | obj-$(CONFIG_CPU_PXA320) += pxa320.o |
24 | obj-$(CONFIG_CPU_PXA930) += pxa930.o | 25 | obj-$(CONFIG_CPU_PXA930) += pxa930.o |
@@ -34,6 +35,7 @@ obj-$(CONFIG_MACH_LITTLETON) += littleton.o | |||
34 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o | 35 | obj-$(CONFIG_MACH_TAVOREVB) += tavorevb.o |
35 | obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o | 36 | obj-$(CONFIG_MACH_TAVOREVB3) += tavorevb3.o |
36 | obj-$(CONFIG_MACH_SAAR) += saar.o | 37 | obj-$(CONFIG_MACH_SAAR) += saar.o |
38 | obj-$(CONFIG_MACH_SAARB) += saarb.o | ||
37 | 39 | ||
38 | # 3rd Party Dev Platforms | 40 | # 3rd Party Dev Platforms |
39 | obj-$(CONFIG_ARCH_PXA_IDP) += idp.o | 41 | obj-$(CONFIG_ARCH_PXA_IDP) += idp.o |
@@ -60,7 +62,7 @@ obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o | |||
60 | obj-$(CONFIG_MACH_PCM027) += pcm027.o | 62 | obj-$(CONFIG_MACH_PCM027) += pcm027.o |
61 | obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o | 63 | obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o |
62 | obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o | 64 | obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o |
63 | obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o | 65 | obj-$(CONFIG_MACH_COLIBRI_EVALBOARD) += colibri-evalboard.o |
64 | obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o | 66 | obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o |
65 | obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o | 67 | obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o |
66 | obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o | 68 | obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o |
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index 21e188901935..ccb2d0cebcc3 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -567,27 +567,29 @@ static inline void balloon3_i2c_init(void) {} | |||
567 | * NAND | 567 | * NAND |
568 | ******************************************************************************/ | 568 | ******************************************************************************/ |
569 | #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE) | 569 | #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE) |
570 | static uint16_t balloon3_ctl = | ||
571 | BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 | | ||
572 | BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 | | ||
573 | BALLOON3_NAND_CONTROL_FLWP; | ||
574 | |||
575 | static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | 570 | static void balloon3_nand_cmd_ctl(struct mtd_info *mtd, int cmd, unsigned int ctrl) |
576 | { | 571 | { |
577 | struct nand_chip *this = mtd->priv; | 572 | struct nand_chip *this = mtd->priv; |
573 | uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0; | ||
578 | 574 | ||
579 | if (ctrl & NAND_CTRL_CHANGE) { | 575 | if (ctrl & NAND_CTRL_CHANGE) { |
580 | if (ctrl & NAND_CLE) | 576 | if (ctrl & NAND_CLE) |
581 | balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCLE; | 577 | balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLCLE; |
582 | else | 578 | else |
583 | balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLCLE; | 579 | balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLCLE; |
584 | 580 | ||
585 | if (ctrl & NAND_ALE) | 581 | if (ctrl & NAND_ALE) |
586 | balloon3_ctl |= BALLOON3_NAND_CONTROL_FLALE; | 582 | balloon3_ctl_set |= BALLOON3_NAND_CONTROL_FLALE; |
587 | else | 583 | else |
588 | balloon3_ctl &= ~BALLOON3_NAND_CONTROL_FLALE; | 584 | balloon3_ctl_clr |= BALLOON3_NAND_CONTROL_FLALE; |
589 | 585 | ||
590 | __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); | 586 | if (balloon3_ctl_clr) |
587 | __raw_writel(balloon3_ctl_clr, | ||
588 | BALLOON3_NAND_CONTROL_REG); | ||
589 | if (balloon3_ctl_set) | ||
590 | __raw_writel(balloon3_ctl_set, | ||
591 | BALLOON3_NAND_CONTROL_REG | | ||
592 | BALLOON3_FPGA_SETnCLR); | ||
591 | } | 593 | } |
592 | 594 | ||
593 | if (cmd != NAND_CMD_NONE) | 595 | if (cmd != NAND_CMD_NONE) |
@@ -599,28 +601,33 @@ static void balloon3_nand_select_chip(struct mtd_info *mtd, int chip) | |||
599 | if (chip < 0 || chip > 3) | 601 | if (chip < 0 || chip > 3) |
600 | return; | 602 | return; |
601 | 603 | ||
602 | balloon3_ctl |= BALLOON3_NAND_CONTROL_FLCE0 | | 604 | /* Assert all nCE lines */ |
603 | BALLOON3_NAND_CONTROL_FLCE1 | | 605 | __raw_writew( |
604 | BALLOON3_NAND_CONTROL_FLCE2 | | 606 | BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 | |
605 | BALLOON3_NAND_CONTROL_FLCE3; | 607 | BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3, |
608 | BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR); | ||
606 | 609 | ||
607 | /* Deassert correct nCE line */ | 610 | /* Deassert correct nCE line */ |
608 | balloon3_ctl &= ~(BALLOON3_NAND_CONTROL_FLCE0 << chip); | 611 | __raw_writew(BALLOON3_NAND_CONTROL_FLCE0 << chip, |
612 | BALLOON3_NAND_CONTROL_REG); | ||
613 | } | ||
609 | 614 | ||
610 | __raw_writew(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); | 615 | static int balloon3_nand_dev_ready(struct mtd_info *mtd) |
616 | { | ||
617 | return __raw_readl(BALLOON3_NAND_STAT_REG) & BALLOON3_NAND_STAT_RNB; | ||
611 | } | 618 | } |
612 | 619 | ||
613 | static int balloon3_nand_probe(struct platform_device *pdev) | 620 | static int balloon3_nand_probe(struct platform_device *pdev) |
614 | { | 621 | { |
615 | void __iomem *temp_map; | ||
616 | uint16_t ver; | 622 | uint16_t ver; |
617 | int ret; | 623 | int ret; |
618 | 624 | ||
619 | __raw_writew(BALLOON3_NAND_CONTROL2_16BIT, BALLOON3_NAND_CONTROL2_REG); | 625 | __raw_writew(BALLOON3_NAND_CONTROL2_16BIT, |
626 | BALLOON3_NAND_CONTROL2_REG | BALLOON3_FPGA_SETnCLR); | ||
620 | 627 | ||
621 | ver = __raw_readw(BALLOON3_FPGA_VER); | 628 | ver = __raw_readw(BALLOON3_FPGA_VER); |
622 | if (ver > 0x0201) | 629 | if (ver < 0x4f08) |
623 | pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. " | 630 | pr_warn("The FPGA code, version 0x%04x, is too old. " |
624 | "NAND support might be broken in this version!", ver); | 631 | "NAND support might be broken in this version!", ver); |
625 | 632 | ||
626 | /* Power up the NAND chips */ | 633 | /* Power up the NAND chips */ |
@@ -635,7 +642,11 @@ static int balloon3_nand_probe(struct platform_device *pdev) | |||
635 | gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1); | 642 | gpio_set_value(BALLOON3_GPIO_RUN_NAND, 1); |
636 | 643 | ||
637 | /* Deassert all nCE lines and write protect line */ | 644 | /* Deassert all nCE lines and write protect line */ |
638 | __raw_writel(balloon3_ctl, BALLOON3_NAND_CONTROL_REG); | 645 | __raw_writel( |
646 | BALLOON3_NAND_CONTROL_FLCE0 | BALLOON3_NAND_CONTROL_FLCE1 | | ||
647 | BALLOON3_NAND_CONTROL_FLCE2 | BALLOON3_NAND_CONTROL_FLCE3 | | ||
648 | BALLOON3_NAND_CONTROL_FLWP, | ||
649 | BALLOON3_NAND_CONTROL_REG | BALLOON3_FPGA_SETnCLR); | ||
639 | return 0; | 650 | return 0; |
640 | 651 | ||
641 | err2: | 652 | err2: |
@@ -677,7 +688,7 @@ struct platform_nand_data balloon3_nand_pdata = { | |||
677 | }, | 688 | }, |
678 | .ctrl = { | 689 | .ctrl = { |
679 | .hwcontrol = 0, | 690 | .hwcontrol = 0, |
680 | .dev_ready = 0, | 691 | .dev_ready = balloon3_nand_dev_ready, |
681 | .select_chip = balloon3_nand_select_chip, | 692 | .select_chip = balloon3_nand_select_chip, |
682 | .cmd_ctrl = balloon3_nand_cmd_ctl, | 693 | .cmd_ctrl = balloon3_nand_cmd_ctl, |
683 | .probe = balloon3_nand_probe, | 694 | .probe = balloon3_nand_probe, |
@@ -802,7 +813,7 @@ static struct map_desc balloon3_io_desc[] __initdata = { | |||
802 | 813 | ||
803 | static void __init balloon3_map_io(void) | 814 | static void __init balloon3_map_io(void) |
804 | { | 815 | { |
805 | pxa_map_io(); | 816 | pxa27x_map_io(); |
806 | iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc)); | 817 | iotable_init(balloon3_io_desc, ARRAY_SIZE(balloon3_io_desc)); |
807 | } | 818 | } |
808 | 819 | ||
diff --git a/arch/arm/mach-pxa/capc7117.c b/arch/arm/mach-pxa/capc7117.c index 4bd7a3cda48c..4284513f396a 100644 --- a/arch/arm/mach-pxa/capc7117.c +++ b/arch/arm/mach-pxa/capc7117.c | |||
@@ -149,7 +149,7 @@ static void __init capc7117_init(void) | |||
149 | MACHINE_START(CAPC7117, | 149 | MACHINE_START(CAPC7117, |
150 | "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") | 150 | "Embedian CAPC-7117 evaluation kit based on the MXM-8x10 CoM") |
151 | .boot_params = 0xa0000100, | 151 | .boot_params = 0xa0000100, |
152 | .map_io = pxa_map_io, | 152 | .map_io = pxa3xx_map_io, |
153 | .init_irq = pxa3xx_init_irq, | 153 | .init_irq = pxa3xx_init_irq, |
154 | .timer = &pxa_timer, | 154 | .timer = &pxa_timer, |
155 | .init_machine = capc7117_init | 155 | .init_machine = capc7117_init |
diff --git a/arch/arm/mach-pxa/clock-pxa2xx.c b/arch/arm/mach-pxa/clock-pxa2xx.c new file mode 100644 index 000000000000..1ce090448493 --- /dev/null +++ b/arch/arm/mach-pxa/clock-pxa2xx.c | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/clock-pxa2xx.c | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/sysdev.h> | ||
13 | |||
14 | #include <mach/pxa2xx-regs.h> | ||
15 | |||
16 | #include "clock.h" | ||
17 | |||
18 | void clk_pxa2xx_cken_enable(struct clk *clk) | ||
19 | { | ||
20 | CKEN |= 1 << clk->cken; | ||
21 | } | ||
22 | |||
23 | void clk_pxa2xx_cken_disable(struct clk *clk) | ||
24 | { | ||
25 | CKEN &= ~(1 << clk->cken); | ||
26 | } | ||
27 | |||
28 | const struct clkops clk_pxa2xx_cken_ops = { | ||
29 | .enable = clk_pxa2xx_cken_enable, | ||
30 | .disable = clk_pxa2xx_cken_disable, | ||
31 | }; | ||
32 | |||
33 | #ifdef CONFIG_PM | ||
34 | static uint32_t saved_cken; | ||
35 | |||
36 | static int pxa2xx_clock_suspend(struct sys_device *d, pm_message_t state) | ||
37 | { | ||
38 | saved_cken = CKEN; | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | static int pxa2xx_clock_resume(struct sys_device *d) | ||
43 | { | ||
44 | CKEN = saved_cken; | ||
45 | return 0; | ||
46 | } | ||
47 | #else | ||
48 | #define pxa2xx_clock_suspend NULL | ||
49 | #define pxa2xx_clock_resume NULL | ||
50 | #endif | ||
51 | |||
52 | struct sysdev_class pxa2xx_clock_sysclass = { | ||
53 | .name = "pxa2xx-clock", | ||
54 | .suspend = pxa2xx_clock_suspend, | ||
55 | .resume = pxa2xx_clock_resume, | ||
56 | }; | ||
57 | |||
58 | static int __init pxa2xx_clock_init(void) | ||
59 | { | ||
60 | if (cpu_is_pxa2xx()) | ||
61 | return sysdev_class_register(&pxa2xx_clock_sysclass); | ||
62 | return 0; | ||
63 | } | ||
64 | postcore_initcall(pxa2xx_clock_init); | ||
diff --git a/arch/arm/mach-pxa/clock-pxa3xx.c b/arch/arm/mach-pxa/clock-pxa3xx.c new file mode 100644 index 000000000000..1b08a34ab234 --- /dev/null +++ b/arch/arm/mach-pxa/clock-pxa3xx.c | |||
@@ -0,0 +1,218 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/clock-pxa3xx.c | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | */ | ||
8 | |||
9 | #include <linux/module.h> | ||
10 | #include <linux/kernel.h> | ||
11 | #include <linux/init.h> | ||
12 | #include <linux/io.h> | ||
13 | |||
14 | #include <mach/smemc.h> | ||
15 | #include <mach/pxa3xx-regs.h> | ||
16 | |||
17 | #include "clock.h" | ||
18 | |||
19 | /* Crystal clock: 13MHz */ | ||
20 | #define BASE_CLK 13000000 | ||
21 | |||
22 | /* Ring Oscillator Clock: 60MHz */ | ||
23 | #define RO_CLK 60000000 | ||
24 | |||
25 | #define ACCR_D0CS (1 << 26) | ||
26 | #define ACCR_PCCE (1 << 11) | ||
27 | |||
28 | /* crystal frequency to HSIO bus frequency multiplier (HSS) */ | ||
29 | static unsigned char hss_mult[4] = { 8, 12, 16, 24 }; | ||
30 | |||
31 | /* | ||
32 | * Get the clock frequency as reflected by CCSR and the turbo flag. | ||
33 | * We assume these values have been applied via a fcs. | ||
34 | * If info is not 0 we also display the current settings. | ||
35 | */ | ||
36 | unsigned int pxa3xx_get_clk_frequency_khz(int info) | ||
37 | { | ||
38 | unsigned long acsr, xclkcfg; | ||
39 | unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS; | ||
40 | |||
41 | /* Read XCLKCFG register turbo bit */ | ||
42 | __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg)); | ||
43 | t = xclkcfg & 0x1; | ||
44 | |||
45 | acsr = ACSR; | ||
46 | |||
47 | xl = acsr & 0x1f; | ||
48 | xn = (acsr >> 8) & 0x7; | ||
49 | hss = (acsr >> 14) & 0x3; | ||
50 | |||
51 | XL = xl * BASE_CLK; | ||
52 | XN = xn * XL; | ||
53 | |||
54 | ro = acsr & ACCR_D0CS; | ||
55 | |||
56 | CLK = (ro) ? RO_CLK : ((t) ? XN : XL); | ||
57 | HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
58 | |||
59 | if (info) { | ||
60 | pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n", | ||
61 | RO_CLK / 1000000, (RO_CLK % 1000000) / 10000, | ||
62 | (ro) ? "" : "in"); | ||
63 | pr_info("Run Mode clock: %d.%02dMHz (*%d)\n", | ||
64 | XL / 1000000, (XL % 1000000) / 10000, xl); | ||
65 | pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n", | ||
66 | XN / 1000000, (XN % 1000000) / 10000, xn, | ||
67 | (t) ? "" : "in"); | ||
68 | pr_info("HSIO bus clock: %d.%02dMHz\n", | ||
69 | HSS / 1000000, (HSS % 1000000) / 10000); | ||
70 | } | ||
71 | |||
72 | return CLK / 1000; | ||
73 | } | ||
74 | |||
75 | /* | ||
76 | * Return the current AC97 clock frequency. | ||
77 | */ | ||
78 | static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk) | ||
79 | { | ||
80 | unsigned long rate = 312000000; | ||
81 | unsigned long ac97_div; | ||
82 | |||
83 | ac97_div = AC97_DIV; | ||
84 | |||
85 | /* This may loose precision for some rates but won't for the | ||
86 | * standard 24.576MHz. | ||
87 | */ | ||
88 | rate /= (ac97_div >> 12) & 0x7fff; | ||
89 | rate *= (ac97_div & 0xfff); | ||
90 | |||
91 | return rate; | ||
92 | } | ||
93 | |||
94 | /* | ||
95 | * Return the current HSIO bus clock frequency | ||
96 | */ | ||
97 | static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk) | ||
98 | { | ||
99 | unsigned long acsr; | ||
100 | unsigned int hss, hsio_clk; | ||
101 | |||
102 | acsr = ACSR; | ||
103 | |||
104 | hss = (acsr >> 14) & 0x3; | ||
105 | hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
106 | |||
107 | return hsio_clk; | ||
108 | } | ||
109 | |||
110 | /* crystal frequency to static memory controller multiplier (SMCFS) */ | ||
111 | static unsigned int smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; | ||
112 | static unsigned int df_clkdiv[4] = { 1, 2, 4, 1 }; | ||
113 | |||
114 | static unsigned long clk_pxa3xx_smemc_getrate(struct clk *clk) | ||
115 | { | ||
116 | unsigned long acsr = ACSR; | ||
117 | unsigned long memclkcfg = __raw_readl(MEMCLKCFG); | ||
118 | unsigned int smcfs = (acsr >> 23) & 0x7; | ||
119 | |||
120 | return BASE_CLK * smcfs_mult[(acsr >> 23) & 0x7] / | ||
121 | df_clkdiv[(memclkcfg >> 16) & 0x3]; | ||
122 | } | ||
123 | |||
124 | void clk_pxa3xx_cken_enable(struct clk *clk) | ||
125 | { | ||
126 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
127 | |||
128 | if (clk->cken < 32) | ||
129 | CKENA |= mask; | ||
130 | else | ||
131 | CKENB |= mask; | ||
132 | } | ||
133 | |||
134 | void clk_pxa3xx_cken_disable(struct clk *clk) | ||
135 | { | ||
136 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
137 | |||
138 | if (clk->cken < 32) | ||
139 | CKENA &= ~mask; | ||
140 | else | ||
141 | CKENB &= ~mask; | ||
142 | } | ||
143 | |||
144 | const struct clkops clk_pxa3xx_cken_ops = { | ||
145 | .enable = clk_pxa3xx_cken_enable, | ||
146 | .disable = clk_pxa3xx_cken_disable, | ||
147 | }; | ||
148 | |||
149 | const struct clkops clk_pxa3xx_hsio_ops = { | ||
150 | .enable = clk_pxa3xx_cken_enable, | ||
151 | .disable = clk_pxa3xx_cken_disable, | ||
152 | .getrate = clk_pxa3xx_hsio_getrate, | ||
153 | }; | ||
154 | |||
155 | const struct clkops clk_pxa3xx_ac97_ops = { | ||
156 | .enable = clk_pxa3xx_cken_enable, | ||
157 | .disable = clk_pxa3xx_cken_disable, | ||
158 | .getrate = clk_pxa3xx_ac97_getrate, | ||
159 | }; | ||
160 | |||
161 | const struct clkops clk_pxa3xx_smemc_ops = { | ||
162 | .enable = clk_pxa3xx_cken_enable, | ||
163 | .disable = clk_pxa3xx_cken_disable, | ||
164 | .getrate = clk_pxa3xx_smemc_getrate, | ||
165 | }; | ||
166 | |||
167 | static void clk_pout_enable(struct clk *clk) | ||
168 | { | ||
169 | OSCC |= OSCC_PEN; | ||
170 | } | ||
171 | |||
172 | static void clk_pout_disable(struct clk *clk) | ||
173 | { | ||
174 | OSCC &= ~OSCC_PEN; | ||
175 | } | ||
176 | |||
177 | const struct clkops clk_pxa3xx_pout_ops = { | ||
178 | .enable = clk_pout_enable, | ||
179 | .disable = clk_pout_disable, | ||
180 | }; | ||
181 | |||
182 | #ifdef CONFIG_PM | ||
183 | static uint32_t cken[2]; | ||
184 | static uint32_t accr; | ||
185 | |||
186 | static int pxa3xx_clock_suspend(struct sys_device *d, pm_message_t state) | ||
187 | { | ||
188 | cken[0] = CKENA; | ||
189 | cken[1] = CKENB; | ||
190 | accr = ACCR; | ||
191 | return 0; | ||
192 | } | ||
193 | |||
194 | static int pxa3xx_clock_resume(struct sys_device *d) | ||
195 | { | ||
196 | ACCR = accr; | ||
197 | CKENA = cken[0]; | ||
198 | CKENB = cken[1]; | ||
199 | return 0; | ||
200 | } | ||
201 | #else | ||
202 | #define pxa3xx_clock_suspend NULL | ||
203 | #define pxa3xx_clock_resume NULL | ||
204 | #endif | ||
205 | |||
206 | struct sysdev_class pxa3xx_clock_sysclass = { | ||
207 | .name = "pxa3xx-clock", | ||
208 | .suspend = pxa3xx_clock_suspend, | ||
209 | .resume = pxa3xx_clock_resume, | ||
210 | }; | ||
211 | |||
212 | static int __init pxa3xx_clock_init(void) | ||
213 | { | ||
214 | if (cpu_is_pxa3xx() || cpu_is_pxa95x()) | ||
215 | return sysdev_class_register(&pxa3xx_clock_sysclass); | ||
216 | return 0; | ||
217 | } | ||
218 | postcore_initcall(pxa3xx_clock_init); | ||
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c index abba0089a2ae..8184fe2d71c3 100644 --- a/arch/arm/mach-pxa/clock.c +++ b/arch/arm/mach-pxa/clock.c | |||
@@ -3,21 +3,12 @@ | |||
3 | */ | 3 | */ |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/kernel.h> | 5 | #include <linux/kernel.h> |
6 | #include <linux/list.h> | ||
7 | #include <linux/errno.h> | ||
8 | #include <linux/err.h> | ||
9 | #include <linux/string.h> | ||
10 | #include <linux/clk.h> | 6 | #include <linux/clk.h> |
11 | #include <linux/spinlock.h> | 7 | #include <linux/spinlock.h> |
12 | #include <linux/platform_device.h> | ||
13 | #include <linux/delay.h> | 8 | #include <linux/delay.h> |
14 | 9 | ||
15 | #include <asm/clkdev.h> | 10 | #include <asm/clkdev.h> |
16 | #include <mach/pxa2xx-regs.h> | ||
17 | #include <mach/hardware.h> | ||
18 | 11 | ||
19 | #include "devices.h" | ||
20 | #include "generic.h" | ||
21 | #include "clock.h" | 12 | #include "clock.h" |
22 | 13 | ||
23 | static DEFINE_SPINLOCK(clocks_lock); | 14 | static DEFINE_SPINLOCK(clocks_lock); |
@@ -63,18 +54,19 @@ unsigned long clk_get_rate(struct clk *clk) | |||
63 | } | 54 | } |
64 | EXPORT_SYMBOL(clk_get_rate); | 55 | EXPORT_SYMBOL(clk_get_rate); |
65 | 56 | ||
66 | 57 | void clk_dummy_enable(struct clk *clk) | |
67 | void clk_cken_enable(struct clk *clk) | ||
68 | { | 58 | { |
69 | CKEN |= 1 << clk->cken; | ||
70 | } | 59 | } |
71 | 60 | ||
72 | void clk_cken_disable(struct clk *clk) | 61 | void clk_dummy_disable(struct clk *clk) |
73 | { | 62 | { |
74 | CKEN &= ~(1 << clk->cken); | ||
75 | } | 63 | } |
76 | 64 | ||
77 | const struct clkops clk_cken_ops = { | 65 | const struct clkops clk_dummy_ops = { |
78 | .enable = clk_cken_enable, | 66 | .enable = clk_dummy_enable, |
79 | .disable = clk_cken_disable, | 67 | .disable = clk_dummy_disable, |
68 | }; | ||
69 | |||
70 | struct clk clk_dummy = { | ||
71 | .ops = &clk_dummy_ops, | ||
80 | }; | 72 | }; |
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index d8488742b807..6e949944f2ec 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
@@ -1,3 +1,4 @@ | |||
1 | #include <linux/sysdev.h> | ||
1 | #include <asm/clkdev.h> | 2 | #include <asm/clkdev.h> |
2 | 3 | ||
3 | struct clkops { | 4 | struct clkops { |
@@ -14,6 +15,12 @@ struct clk { | |||
14 | unsigned int enabled; | 15 | unsigned int enabled; |
15 | }; | 16 | }; |
16 | 17 | ||
18 | void clk_dummy_enable(struct clk *); | ||
19 | void clk_dummy_disable(struct clk *); | ||
20 | |||
21 | extern const struct clkops clk_dummy_ops; | ||
22 | extern struct clk clk_dummy; | ||
23 | |||
17 | #define INIT_CLKREG(_clk,_devname,_conname) \ | 24 | #define INIT_CLKREG(_clk,_devname,_conname) \ |
18 | { \ | 25 | { \ |
19 | .clk = _clk, \ | 26 | .clk = _clk, \ |
@@ -21,14 +28,6 @@ struct clk { | |||
21 | .con_id = _conname, \ | 28 | .con_id = _conname, \ |
22 | } | 29 | } |
23 | 30 | ||
24 | #define DEFINE_CKEN(_name, _cken, _rate, _delay) \ | ||
25 | struct clk clk_##_name = { \ | ||
26 | .ops = &clk_cken_ops, \ | ||
27 | .rate = _rate, \ | ||
28 | .cken = CKEN_##_cken, \ | ||
29 | .delay = _delay, \ | ||
30 | } | ||
31 | |||
32 | #define DEFINE_CK(_name, _cken, _ops) \ | 31 | #define DEFINE_CK(_name, _cken, _ops) \ |
33 | struct clk clk_##_name = { \ | 32 | struct clk clk_##_name = { \ |
34 | .ops = _ops, \ | 33 | .ops = _ops, \ |
@@ -42,28 +41,38 @@ struct clk clk_##_name = { \ | |||
42 | .delay = _delay, \ | 41 | .delay = _delay, \ |
43 | } | 42 | } |
44 | 43 | ||
45 | extern const struct clkops clk_cken_ops; | 44 | #define DEFINE_PXA2_CKEN(_name, _cken, _rate, _delay) \ |
46 | |||
47 | void clk_cken_enable(struct clk *clk); | ||
48 | void clk_cken_disable(struct clk *clk); | ||
49 | |||
50 | #ifdef CONFIG_PXA3xx | ||
51 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ | ||
52 | struct clk clk_##_name = { \ | 45 | struct clk clk_##_name = { \ |
53 | .ops = &clk_pxa3xx_cken_ops, \ | 46 | .ops = &clk_pxa2xx_cken_ops, \ |
54 | .rate = _rate, \ | 47 | .rate = _rate, \ |
55 | .cken = CKEN_##_cken, \ | 48 | .cken = CKEN_##_cken, \ |
56 | .delay = _delay, \ | 49 | .delay = _delay, \ |
57 | } | 50 | } |
58 | 51 | ||
59 | #define DEFINE_PXA3_CK(_name, _cken, _ops) \ | 52 | extern const struct clkops clk_pxa2xx_cken_ops; |
53 | |||
54 | void clk_pxa2xx_cken_enable(struct clk *clk); | ||
55 | void clk_pxa2xx_cken_disable(struct clk *clk); | ||
56 | |||
57 | extern struct sysdev_class pxa2xx_clock_sysclass; | ||
58 | |||
59 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | ||
60 | #define DEFINE_PXA3_CKEN(_name, _cken, _rate, _delay) \ | ||
60 | struct clk clk_##_name = { \ | 61 | struct clk clk_##_name = { \ |
61 | .ops = _ops, \ | 62 | .ops = &clk_pxa3xx_cken_ops, \ |
63 | .rate = _rate, \ | ||
62 | .cken = CKEN_##_cken, \ | 64 | .cken = CKEN_##_cken, \ |
65 | .delay = _delay, \ | ||
63 | } | 66 | } |
64 | 67 | ||
65 | extern const struct clkops clk_pxa3xx_cken_ops; | 68 | extern const struct clkops clk_pxa3xx_cken_ops; |
69 | extern const struct clkops clk_pxa3xx_hsio_ops; | ||
70 | extern const struct clkops clk_pxa3xx_ac97_ops; | ||
71 | extern const struct clkops clk_pxa3xx_pout_ops; | ||
72 | extern const struct clkops clk_pxa3xx_smemc_ops; | ||
73 | |||
66 | extern void clk_pxa3xx_cken_enable(struct clk *); | 74 | extern void clk_pxa3xx_cken_enable(struct clk *); |
67 | extern void clk_pxa3xx_cken_disable(struct clk *); | 75 | extern void clk_pxa3xx_cken_disable(struct clk *); |
68 | #endif | ||
69 | 76 | ||
77 | extern struct sysdev_class pxa3xx_clock_sysclass; | ||
78 | #endif | ||
diff --git a/arch/arm/mach-pxa/cm-x2xx.c b/arch/arm/mach-pxa/cm-x2xx.c index d34b99febeb9..b734d8468168 100644 --- a/arch/arm/mach-pxa/cm-x2xx.c +++ b/arch/arm/mach-pxa/cm-x2xx.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <mach/pxa2xx-regs.h> | 24 | #include <mach/pxa2xx-regs.h> |
25 | #include <mach/audio.h> | 25 | #include <mach/audio.h> |
26 | #include <mach/pxafb.h> | 26 | #include <mach/pxafb.h> |
27 | #include <mach/smemc.h> | ||
27 | 28 | ||
28 | #include <asm/hardware/it8152.h> | 29 | #include <asm/hardware/it8152.h> |
29 | 30 | ||
@@ -392,9 +393,9 @@ static int cmx2xx_suspend(struct sys_device *dev, pm_message_t state) | |||
392 | cmx2xx_pci_suspend(); | 393 | cmx2xx_pci_suspend(); |
393 | 394 | ||
394 | /* save MSC registers */ | 395 | /* save MSC registers */ |
395 | sleep_save_msc[0] = MSC0; | 396 | sleep_save_msc[0] = __raw_readl(MSC0); |
396 | sleep_save_msc[1] = MSC1; | 397 | sleep_save_msc[1] = __raw_readl(MSC1); |
397 | sleep_save_msc[2] = MSC2; | 398 | sleep_save_msc[2] = __raw_readl(MSC2); |
398 | 399 | ||
399 | /* setup power saving mode registers */ | 400 | /* setup power saving mode registers */ |
400 | PCFR = 0x0; | 401 | PCFR = 0x0; |
@@ -416,9 +417,9 @@ static int cmx2xx_resume(struct sys_device *dev) | |||
416 | cmx2xx_pci_resume(); | 417 | cmx2xx_pci_resume(); |
417 | 418 | ||
418 | /* restore MSC registers */ | 419 | /* restore MSC registers */ |
419 | MSC0 = sleep_save_msc[0]; | 420 | __raw_writel(sleep_save_msc[0], MSC0); |
420 | MSC1 = sleep_save_msc[1]; | 421 | __raw_writel(sleep_save_msc[1], MSC1); |
421 | MSC2 = sleep_save_msc[2]; | 422 | __raw_writel(sleep_save_msc[2], MSC2); |
422 | 423 | ||
423 | return 0; | 424 | return 0; |
424 | } | 425 | } |
@@ -498,7 +499,12 @@ static struct map_desc cmx2xx_io_desc[] __initdata = { | |||
498 | 499 | ||
499 | static void __init cmx2xx_map_io(void) | 500 | static void __init cmx2xx_map_io(void) |
500 | { | 501 | { |
501 | pxa_map_io(); | 502 | if (cpu_is_pxa25x()) |
503 | pxa25x_map_io(); | ||
504 | |||
505 | if (cpu_is_pxa27x()) | ||
506 | pxa27x_map_io(); | ||
507 | |||
502 | iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc)); | 508 | iotable_init(cmx2xx_io_desc, ARRAY_SIZE(cmx2xx_io_desc)); |
503 | 509 | ||
504 | it8152_base_address = CMX2XX_IT8152_VIRT; | 510 | it8152_base_address = CMX2XX_IT8152_VIRT; |
@@ -506,7 +512,11 @@ static void __init cmx2xx_map_io(void) | |||
506 | #else | 512 | #else |
507 | static void __init cmx2xx_map_io(void) | 513 | static void __init cmx2xx_map_io(void) |
508 | { | 514 | { |
509 | pxa_map_io(); | 515 | if (cpu_is_pxa25x()) |
516 | pxa25x_map_io(); | ||
517 | |||
518 | if (cpu_is_pxa27x()) | ||
519 | pxa27x_map_io(); | ||
510 | } | 520 | } |
511 | #endif | 521 | #endif |
512 | 522 | ||
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index 922b1075b9de..7984268508b6 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -857,7 +857,7 @@ static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | |||
857 | 857 | ||
858 | MACHINE_START(CM_X300, "CM-X300 module") | 858 | MACHINE_START(CM_X300, "CM-X300 module") |
859 | .boot_params = 0xa0000100, | 859 | .boot_params = 0xa0000100, |
860 | .map_io = pxa_map_io, | 860 | .map_io = pxa3xx_map_io, |
861 | .init_irq = pxa3xx_init_irq, | 861 | .init_irq = pxa3xx_init_irq, |
862 | .timer = &pxa_timer, | 862 | .timer = &pxa_timer, |
863 | .init_machine = cm_x300_init, | 863 | .init_machine = cm_x300_init, |
diff --git a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c b/arch/arm/mach-pxa/colibri-evalboard.c index 0f3b632c3b14..6b2c800a1133 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-evalboard.c +++ b/arch/arm/mach-pxa/colibri-evalboard.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c | 2 | * linux/arch/arm/mach-pxa/colibri-evalboard.c |
3 | * | 3 | * |
4 | * Support for Toradex PXA270 based Colibri Evaluation Carrier Board | 4 | * Support for Toradex Colibri Evaluation Carrier Board |
5 | * Daniel Mack <daniel@caiaq.de> | 5 | * Daniel Mack <daniel@caiaq.de> |
6 | * Marek Vasut <marek.vasut@gmail.com> | 6 | * Marek Vasut <marek.vasut@gmail.com> |
7 | * | 7 | * |
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/mach-types.h> | 19 | #include <asm/mach-types.h> |
20 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
21 | #include <asm/mach/arch.h> | 21 | #include <asm/mach/arch.h> |
22 | #include <linux/i2c.h> | ||
22 | 23 | ||
23 | #include <mach/pxa27x.h> | 24 | #include <mach/pxa27x.h> |
24 | #include <mach/colibri.h> | 25 | #include <mach/colibri.h> |
@@ -26,86 +27,95 @@ | |||
26 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
27 | #include <mach/pxa27x-udc.h> | 28 | #include <mach/pxa27x-udc.h> |
28 | 29 | ||
30 | #include <plat/i2c.h> | ||
31 | |||
29 | #include "generic.h" | 32 | #include "generic.h" |
30 | #include "devices.h" | 33 | #include "devices.h" |
31 | 34 | ||
32 | /****************************************************************************** | 35 | /****************************************************************************** |
33 | * Pin configuration | ||
34 | ******************************************************************************/ | ||
35 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { | ||
36 | /* MMC */ | ||
37 | GPIO32_MMC_CLK, | ||
38 | GPIO92_MMC_DAT_0, | ||
39 | GPIO109_MMC_DAT_1, | ||
40 | GPIO110_MMC_DAT_2, | ||
41 | GPIO111_MMC_DAT_3, | ||
42 | GPIO112_MMC_CMD, | ||
43 | GPIO0_GPIO, /* SD detect */ | ||
44 | |||
45 | /* FFUART */ | ||
46 | GPIO39_FFUART_TXD, | ||
47 | GPIO34_FFUART_RXD, | ||
48 | |||
49 | /* UHC */ | ||
50 | GPIO88_USBH1_PWR, | ||
51 | GPIO89_USBH1_PEN, | ||
52 | GPIO119_USBH2_PWR, | ||
53 | GPIO120_USBH2_PEN, | ||
54 | }; | ||
55 | |||
56 | /****************************************************************************** | ||
57 | * SD/MMC card controller | 36 | * SD/MMC card controller |
58 | ******************************************************************************/ | 37 | ******************************************************************************/ |
59 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 38 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
60 | static struct pxamci_platform_data colibri_pxa270_mci_platform_data = { | 39 | static struct pxamci_platform_data colibri_mci_platform_data = { |
61 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 40 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
62 | .gpio_power = -1, | 41 | .gpio_power = -1, |
63 | .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT, | ||
64 | .gpio_card_ro = -1, | 42 | .gpio_card_ro = -1, |
65 | .detect_delay_ms = 200, | 43 | .detect_delay_ms = 200, |
66 | }; | 44 | }; |
67 | 45 | ||
68 | static void __init colibri_pxa270_mmc_init(void) | 46 | static void __init colibri_mmc_init(void) |
69 | { | 47 | { |
70 | pxa_set_mci_info(&colibri_pxa270_mci_platform_data); | 48 | if (machine_is_colibri()) /* PXA270 Colibri */ |
49 | colibri_mci_platform_data.gpio_card_detect = | ||
50 | GPIO0_COLIBRI_PXA270_SD_DETECT; | ||
51 | if (machine_is_colibri300()) /* PXA300 Colibri */ | ||
52 | colibri_mci_platform_data.gpio_card_detect = | ||
53 | GPIO39_COLIBRI_PXA300_SD_DETECT; | ||
54 | else /* PXA320 Colibri */ | ||
55 | colibri_mci_platform_data.gpio_card_detect = | ||
56 | GPIO28_COLIBRI_PXA320_SD_DETECT; | ||
57 | |||
58 | pxa_set_mci_info(&colibri_mci_platform_data); | ||
71 | } | 59 | } |
72 | #else | 60 | #else |
73 | static inline void colibri_pxa270_mmc_init(void) {} | 61 | static inline void colibri_mmc_init(void) {} |
74 | #endif | 62 | #endif |
75 | 63 | ||
76 | /****************************************************************************** | 64 | /****************************************************************************** |
77 | * USB Host | 65 | * USB Host |
78 | ******************************************************************************/ | 66 | ******************************************************************************/ |
79 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 67 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
80 | static int colibri_pxa270_ohci_init(struct device *dev) | 68 | static int colibri_ohci_init(struct device *dev) |
81 | { | 69 | { |
82 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; | 70 | UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE; |
83 | return 0; | 71 | return 0; |
84 | } | 72 | } |
85 | 73 | ||
86 | static struct pxaohci_platform_data colibri_pxa270_ohci_info = { | 74 | static struct pxaohci_platform_data colibri_ohci_info = { |
87 | .port_mode = PMM_PERPORT_MODE, | 75 | .port_mode = PMM_PERPORT_MODE, |
88 | .flags = ENABLE_PORT1 | ENABLE_PORT2 | | 76 | .flags = ENABLE_PORT1 | |
89 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | 77 | POWER_CONTROL_LOW | POWER_SENSE_LOW, |
90 | .init = colibri_pxa270_ohci_init, | 78 | .init = colibri_ohci_init, |
91 | }; | 79 | }; |
92 | 80 | ||
93 | static void __init colibri_pxa270_uhc_init(void) | 81 | static void __init colibri_uhc_init(void) |
94 | { | 82 | { |
95 | pxa_set_ohci_info(&colibri_pxa270_ohci_info); | 83 | /* Colibri PXA270 has two usb ports, TBA for 320 */ |
84 | if (machine_is_colibri()) | ||
85 | colibri_ohci_info.flags |= ENABLE_PORT2; | ||
86 | |||
87 | pxa_set_ohci_info(&colibri_ohci_info); | ||
96 | } | 88 | } |
97 | #else | 89 | #else |
98 | static inline void colibri_pxa270_uhc_init(void) {} | 90 | static inline void colibri_uhc_init(void) {} |
99 | #endif | 91 | #endif |
100 | 92 | ||
101 | void __init colibri_pxa270_evalboard_init(void) | 93 | /****************************************************************************** |
94 | * I2C RTC | ||
95 | ******************************************************************************/ | ||
96 | #if defined(CONFIG_RTC_DRV_DS1307) || defined(CONFIG_RTC_DRV_DS1307_MODULE) | ||
97 | static struct i2c_board_info __initdata colibri_i2c_devs[] = { | ||
98 | { | ||
99 | I2C_BOARD_INFO("m41t00", 0x68), | ||
100 | }, | ||
101 | }; | ||
102 | |||
103 | static void __init colibri_rtc_init(void) | ||
104 | { | ||
105 | pxa_set_i2c_info(NULL); | ||
106 | i2c_register_board_info(0, ARRAY_AND_SIZE(colibri_i2c_devs)); | ||
107 | } | ||
108 | #else | ||
109 | static inline void colibri_rtc_init(void) {} | ||
110 | #endif | ||
111 | |||
112 | void __init colibri_evalboard_init(void) | ||
102 | { | 113 | { |
103 | pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config)); | ||
104 | pxa_set_ffuart_info(NULL); | 114 | pxa_set_ffuart_info(NULL); |
105 | pxa_set_btuart_info(NULL); | 115 | pxa_set_btuart_info(NULL); |
106 | pxa_set_stuart_info(NULL); | 116 | pxa_set_stuart_info(NULL); |
107 | 117 | ||
108 | colibri_pxa270_mmc_init(); | 118 | colibri_mmc_init(); |
109 | colibri_pxa270_uhc_init(); | 119 | colibri_uhc_init(); |
120 | colibri_rtc_init(); | ||
110 | } | 121 | } |
111 | |||
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c index 37f0f3ed7c61..07b62a096f17 100644 --- a/arch/arm/mach-pxa/colibri-pxa270-income.c +++ b/arch/arm/mach-pxa/colibri-pxa270-income.c | |||
@@ -46,52 +46,6 @@ | |||
46 | #define GPIO113_INCOME_TS_IRQ (113) | 46 | #define GPIO113_INCOME_TS_IRQ (113) |
47 | 47 | ||
48 | /****************************************************************************** | 48 | /****************************************************************************** |
49 | * Pin configuration | ||
50 | ******************************************************************************/ | ||
51 | static mfp_cfg_t income_pin_config[] __initdata = { | ||
52 | /* MMC */ | ||
53 | GPIO32_MMC_CLK, | ||
54 | GPIO92_MMC_DAT_0, | ||
55 | GPIO109_MMC_DAT_1, | ||
56 | GPIO110_MMC_DAT_2, | ||
57 | GPIO111_MMC_DAT_3, | ||
58 | GPIO112_MMC_CMD, | ||
59 | GPIO0_GPIO, /* SD detect */ | ||
60 | GPIO1_GPIO, /* SD read-only */ | ||
61 | |||
62 | /* FFUART */ | ||
63 | GPIO39_FFUART_TXD, | ||
64 | GPIO34_FFUART_RXD, | ||
65 | |||
66 | /* BFUART */ | ||
67 | GPIO42_BTUART_RXD, | ||
68 | GPIO43_BTUART_TXD, | ||
69 | GPIO45_BTUART_RTS, | ||
70 | |||
71 | /* STUART */ | ||
72 | GPIO46_STUART_RXD, | ||
73 | GPIO47_STUART_TXD, | ||
74 | |||
75 | /* UHC */ | ||
76 | GPIO88_USBH1_PWR, | ||
77 | GPIO89_USBH1_PEN, | ||
78 | |||
79 | /* LCD */ | ||
80 | GPIOxx_LCD_TFT_16BPP, | ||
81 | |||
82 | /* PWM */ | ||
83 | GPIO16_PWM0_OUT, | ||
84 | |||
85 | /* I2C */ | ||
86 | GPIO117_I2C_SCL, | ||
87 | GPIO118_I2C_SDA, | ||
88 | |||
89 | /* LED */ | ||
90 | GPIO54_GPIO, /* LED A */ | ||
91 | GPIO55_GPIO, /* LED B */ | ||
92 | }; | ||
93 | |||
94 | /****************************************************************************** | ||
95 | * SD/MMC card controller | 49 | * SD/MMC card controller |
96 | ******************************************************************************/ | 50 | ******************************************************************************/ |
97 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | 51 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) |
@@ -257,7 +211,6 @@ static inline void income_pwm_init(void) {} | |||
257 | 211 | ||
258 | void __init colibri_pxa270_income_boardinit(void) | 212 | void __init colibri_pxa270_income_boardinit(void) |
259 | { | 213 | { |
260 | pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); | ||
261 | pxa_set_ffuart_info(NULL); | 214 | pxa_set_ffuart_info(NULL); |
262 | pxa_set_btuart_info(NULL); | 215 | pxa_set_btuart_info(NULL); |
263 | pxa_set_stuart_info(NULL); | 216 | pxa_set_stuart_info(NULL); |
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c index bc045100ec15..6fc5d328ba7f 100644 --- a/arch/arm/mach-pxa/colibri-pxa270.c +++ b/arch/arm/mach-pxa/colibri-pxa270.c | |||
@@ -33,6 +33,103 @@ | |||
33 | #include "generic.h" | 33 | #include "generic.h" |
34 | 34 | ||
35 | /****************************************************************************** | 35 | /****************************************************************************** |
36 | * Evaluation board MFP | ||
37 | ******************************************************************************/ | ||
38 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
39 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = { | ||
40 | /* MMC */ | ||
41 | GPIO32_MMC_CLK, | ||
42 | GPIO92_MMC_DAT_0, | ||
43 | GPIO109_MMC_DAT_1, | ||
44 | GPIO110_MMC_DAT_2, | ||
45 | GPIO111_MMC_DAT_3, | ||
46 | GPIO112_MMC_CMD, | ||
47 | GPIO0_GPIO, /* SD detect */ | ||
48 | |||
49 | /* FFUART */ | ||
50 | GPIO39_FFUART_TXD, | ||
51 | GPIO34_FFUART_RXD, | ||
52 | |||
53 | /* UHC */ | ||
54 | GPIO88_USBH1_PWR, | ||
55 | GPIO89_USBH1_PEN, | ||
56 | GPIO119_USBH2_PWR, | ||
57 | GPIO120_USBH2_PEN, | ||
58 | |||
59 | /* PCMCIA */ | ||
60 | GPIO85_nPCE_1, | ||
61 | GPIO54_nPCE_2, | ||
62 | GPIO55_nPREG, | ||
63 | GPIO50_nPIOR, | ||
64 | GPIO51_nPIOW, | ||
65 | GPIO49_nPWE, | ||
66 | GPIO48_nPOE, | ||
67 | GPIO57_nIOIS16, | ||
68 | GPIO56_nPWAIT, | ||
69 | GPIO104_PSKTSEL, | ||
70 | GPIO53_GPIO, /* RESET */ | ||
71 | GPIO83_GPIO, /* BVD1 */ | ||
72 | GPIO82_GPIO, /* BVD2 */ | ||
73 | GPIO1_GPIO, /* READY */ | ||
74 | GPIO84_GPIO, /* DETECT */ | ||
75 | GPIO107_GPIO, /* PPEN */ | ||
76 | |||
77 | /* I2C */ | ||
78 | GPIO117_I2C_SCL, | ||
79 | GPIO118_I2C_SDA, | ||
80 | }; | ||
81 | #else | ||
82 | static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {}; | ||
83 | #endif | ||
84 | |||
85 | #ifdef CONFIG_MACH_COLIBRI_PXA270_INCOME | ||
86 | static mfp_cfg_t income_pin_config[] __initdata = { | ||
87 | /* MMC */ | ||
88 | GPIO32_MMC_CLK, | ||
89 | GPIO92_MMC_DAT_0, | ||
90 | GPIO109_MMC_DAT_1, | ||
91 | GPIO110_MMC_DAT_2, | ||
92 | GPIO111_MMC_DAT_3, | ||
93 | GPIO112_MMC_CMD, | ||
94 | GPIO0_GPIO, /* SD detect */ | ||
95 | GPIO1_GPIO, /* SD read-only */ | ||
96 | |||
97 | /* FFUART */ | ||
98 | GPIO39_FFUART_TXD, | ||
99 | GPIO34_FFUART_RXD, | ||
100 | |||
101 | /* BFUART */ | ||
102 | GPIO42_BTUART_RXD, | ||
103 | GPIO43_BTUART_TXD, | ||
104 | GPIO45_BTUART_RTS, | ||
105 | |||
106 | /* STUART */ | ||
107 | GPIO46_STUART_RXD, | ||
108 | GPIO47_STUART_TXD, | ||
109 | |||
110 | /* UHC */ | ||
111 | GPIO88_USBH1_PWR, | ||
112 | GPIO89_USBH1_PEN, | ||
113 | |||
114 | /* LCD */ | ||
115 | GPIOxx_LCD_TFT_16BPP, | ||
116 | |||
117 | /* PWM */ | ||
118 | GPIO16_PWM0_OUT, | ||
119 | |||
120 | /* I2C */ | ||
121 | GPIO117_I2C_SCL, | ||
122 | GPIO118_I2C_SDA, | ||
123 | |||
124 | /* LED */ | ||
125 | GPIO54_GPIO, /* LED A */ | ||
126 | GPIO55_GPIO, /* LED B */ | ||
127 | }; | ||
128 | #else | ||
129 | static mfp_cfg_t income_pin_config[] __initdata = {}; | ||
130 | #endif | ||
131 | |||
132 | /****************************************************************************** | ||
36 | * Pin configuration | 133 | * Pin configuration |
37 | ******************************************************************************/ | 134 | ******************************************************************************/ |
38 | static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { | 135 | static mfp_cfg_t colibri_pxa270_pin_config[] __initdata = { |
@@ -184,10 +281,13 @@ static void __init colibri_pxa270_init(void) | |||
184 | colibri_pxa270_tsc_init(); | 281 | colibri_pxa270_tsc_init(); |
185 | 282 | ||
186 | switch (colibri_pxa270_baseboard) { | 283 | switch (colibri_pxa270_baseboard) { |
187 | case COLIBRI_PXA270_EVALBOARD: | 284 | case COLIBRI_EVALBOARD: |
188 | colibri_pxa270_evalboard_init(); | 285 | pxa2xx_mfp_config(ARRAY_AND_SIZE( |
286 | colibri_pxa270_evalboard_pin_config)); | ||
287 | colibri_evalboard_init(); | ||
189 | break; | 288 | break; |
190 | case COLIBRI_PXA270_INCOME: | 289 | case COLIBRI_PXA270_INCOME: |
290 | pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config)); | ||
191 | colibri_pxa270_income_boardinit(); | 291 | colibri_pxa270_income_boardinit(); |
192 | break; | 292 | break; |
193 | default: | 293 | default: |
@@ -209,7 +309,7 @@ static void __init colibri_pxa270_income_init(void) | |||
209 | MACHINE_START(COLIBRI, "Toradex Colibri PXA270") | 309 | MACHINE_START(COLIBRI, "Toradex Colibri PXA270") |
210 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 310 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
211 | .init_machine = colibri_pxa270_init, | 311 | .init_machine = colibri_pxa270_init, |
212 | .map_io = pxa_map_io, | 312 | .map_io = pxa27x_map_io, |
213 | .init_irq = pxa27x_init_irq, | 313 | .init_irq = pxa27x_init_irq, |
214 | .timer = &pxa_timer, | 314 | .timer = &pxa_timer, |
215 | MACHINE_END | 315 | MACHINE_END |
@@ -217,7 +317,7 @@ MACHINE_END | |||
217 | MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") | 317 | MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC") |
218 | .boot_params = 0xa0000100, | 318 | .boot_params = 0xa0000100, |
219 | .init_machine = colibri_pxa270_income_init, | 319 | .init_machine = colibri_pxa270_income_init, |
220 | .map_io = pxa_map_io, | 320 | .map_io = pxa27x_map_io, |
221 | .init_irq = pxa27x_init_irq, | 321 | .init_irq = pxa27x_init_irq, |
222 | .timer = &pxa_timer, | 322 | .timer = &pxa_timer, |
223 | MACHINE_END | 323 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/colibri-pxa300.c b/arch/arm/mach-pxa/colibri-pxa300.c index a70b256591e6..fddb16d07eb0 100644 --- a/arch/arm/mach-pxa/colibri-pxa300.c +++ b/arch/arm/mach-pxa/colibri-pxa300.c | |||
@@ -31,9 +31,38 @@ | |||
31 | #include "generic.h" | 31 | #include "generic.h" |
32 | #include "devices.h" | 32 | #include "devices.h" |
33 | 33 | ||
34 | |||
35 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
36 | static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = { | ||
37 | /* MMC */ | ||
38 | GPIO7_MMC1_CLK, | ||
39 | GPIO14_MMC1_CMD, | ||
40 | GPIO3_MMC1_DAT0, | ||
41 | GPIO4_MMC1_DAT1, | ||
42 | GPIO5_MMC1_DAT2, | ||
43 | GPIO6_MMC1_DAT3, | ||
44 | GPIO39_GPIO, /* SD detect */ | ||
45 | |||
46 | /* UHC */ | ||
47 | GPIO0_2_USBH_PEN, | ||
48 | GPIO1_2_USBH_PWR, | ||
49 | GPIO77_USB_P3_1, | ||
50 | GPIO78_USB_P3_2, | ||
51 | GPIO79_USB_P3_3, | ||
52 | GPIO80_USB_P3_4, | ||
53 | GPIO81_USB_P3_5, | ||
54 | GPIO82_USB_P3_6, | ||
55 | |||
56 | /* I2C */ | ||
57 | GPIO21_I2C_SCL, | ||
58 | GPIO22_I2C_SDA, | ||
59 | }; | ||
60 | #else | ||
61 | static mfp_cfg_t colibri_pxa300_evalboard_pin_config[] __initdata = {}; | ||
62 | #endif | ||
63 | |||
34 | #if defined(CONFIG_AX88796) | 64 | #if defined(CONFIG_AX88796) |
35 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) | 65 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO26_GPIO) |
36 | |||
37 | /* | 66 | /* |
38 | * Asix AX88796 Ethernet | 67 | * Asix AX88796 Ethernet |
39 | */ | 68 | */ |
@@ -80,35 +109,6 @@ static void __init colibri_pxa300_init_eth(void) | |||
80 | static inline void __init colibri_pxa300_init_eth(void) {} | 109 | static inline void __init colibri_pxa300_init_eth(void) {} |
81 | #endif /* CONFIG_AX88796 */ | 110 | #endif /* CONFIG_AX88796 */ |
82 | 111 | ||
83 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
84 | static mfp_cfg_t colibri_pxa300_usb_pin_config[] __initdata = { | ||
85 | GPIO0_2_USBH_PEN, | ||
86 | GPIO1_2_USBH_PWR, | ||
87 | }; | ||
88 | |||
89 | static struct pxaohci_platform_data colibri_pxa300_ohci_info = { | ||
90 | .port_mode = PMM_GLOBAL_MODE, | ||
91 | .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | ||
92 | }; | ||
93 | |||
94 | void __init colibri_pxa300_init_ohci(void) | ||
95 | { | ||
96 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_usb_pin_config)); | ||
97 | pxa_set_ohci_info(&colibri_pxa300_ohci_info); | ||
98 | } | ||
99 | #else | ||
100 | static inline void colibri_pxa300_init_ohci(void) {} | ||
101 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | ||
102 | |||
103 | static mfp_cfg_t colibri_pxa300_mmc_pin_config[] __initdata = { | ||
104 | GPIO7_MMC1_CLK, | ||
105 | GPIO14_MMC1_CMD, | ||
106 | GPIO3_MMC1_DAT0, | ||
107 | GPIO4_MMC1_DAT1, | ||
108 | GPIO5_MMC1_DAT2, | ||
109 | GPIO6_MMC1_DAT3, | ||
110 | }; | ||
111 | |||
112 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 112 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
113 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { | 113 | static mfp_cfg_t colibri_pxa300_lcd_pin_config[] __initdata = { |
114 | GPIO54_LCD_LDD_0, | 114 | GPIO54_LCD_LDD_0, |
@@ -171,24 +171,21 @@ static inline void colibri_pxa310_init_ac97(void) {} | |||
171 | 171 | ||
172 | void __init colibri_pxa300_init(void) | 172 | void __init colibri_pxa300_init(void) |
173 | { | 173 | { |
174 | pxa_set_ffuart_info(NULL); | ||
175 | pxa_set_btuart_info(NULL); | ||
176 | pxa_set_stuart_info(NULL); | ||
177 | |||
178 | colibri_pxa300_init_eth(); | 174 | colibri_pxa300_init_eth(); |
179 | colibri_pxa300_init_ohci(); | ||
180 | colibri_pxa3xx_init_nand(); | 175 | colibri_pxa3xx_init_nand(); |
181 | colibri_pxa300_init_lcd(); | 176 | colibri_pxa300_init_lcd(); |
182 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); | 177 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO39_GPIO)); |
183 | colibri_pxa310_init_ac97(); | 178 | colibri_pxa310_init_ac97(); |
184 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa300_mmc_pin_config), | 179 | |
185 | mfp_to_gpio(MFP_PIN_GPIO13)); | 180 | /* Evalboard init */ |
181 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa300_evalboard_pin_config)); | ||
182 | colibri_evalboard_init(); | ||
186 | } | 183 | } |
187 | 184 | ||
188 | MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") | 185 | MACHINE_START(COLIBRI300, "Toradex Colibri PXA300") |
189 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 186 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
190 | .init_machine = colibri_pxa300_init, | 187 | .init_machine = colibri_pxa300_init, |
191 | .map_io = pxa_map_io, | 188 | .map_io = pxa3xx_map_io, |
192 | .init_irq = pxa3xx_init_irq, | 189 | .init_irq = pxa3xx_init_irq, |
193 | .timer = &pxa_timer, | 190 | .timer = &pxa_timer, |
194 | MACHINE_END | 191 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/colibri-pxa320.c b/arch/arm/mach-pxa/colibri-pxa320.c index ca5f29e2e9cd..ff9ff5f4fc47 100644 --- a/arch/arm/mach-pxa/colibri-pxa320.c +++ b/arch/arm/mach-pxa/colibri-pxa320.c | |||
@@ -35,9 +35,72 @@ | |||
35 | #include "generic.h" | 35 | #include "generic.h" |
36 | #include "devices.h" | 36 | #include "devices.h" |
37 | 37 | ||
38 | #ifdef CONFIG_MACH_COLIBRI_EVALBOARD | ||
39 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = { | ||
40 | /* MMC */ | ||
41 | GPIO22_MMC1_CLK, | ||
42 | GPIO23_MMC1_CMD, | ||
43 | GPIO18_MMC1_DAT0, | ||
44 | GPIO19_MMC1_DAT1, | ||
45 | GPIO20_MMC1_DAT2, | ||
46 | GPIO21_MMC1_DAT3, | ||
47 | GPIO28_GPIO, /* SD detect */ | ||
48 | |||
49 | /* UART 1 configuration (may be set by bootloader) */ | ||
50 | GPIO99_UART1_CTS, | ||
51 | GPIO104_UART1_RTS, | ||
52 | GPIO97_UART1_RXD, | ||
53 | GPIO98_UART1_TXD, | ||
54 | GPIO101_UART1_DTR, | ||
55 | GPIO103_UART1_DSR, | ||
56 | GPIO100_UART1_DCD, | ||
57 | GPIO102_UART1_RI, | ||
58 | |||
59 | /* UART 2 configuration */ | ||
60 | GPIO109_UART2_CTS, | ||
61 | GPIO112_UART2_RTS, | ||
62 | GPIO110_UART2_RXD, | ||
63 | GPIO111_UART2_TXD, | ||
64 | |||
65 | /* UART 3 configuration */ | ||
66 | GPIO30_UART3_RXD, | ||
67 | GPIO31_UART3_TXD, | ||
68 | |||
69 | /* UHC */ | ||
70 | GPIO2_2_USBH_PEN, | ||
71 | GPIO3_2_USBH_PWR, | ||
72 | |||
73 | /* I2C */ | ||
74 | GPIO32_I2C_SCL, | ||
75 | GPIO33_I2C_SDA, | ||
76 | |||
77 | /* PCMCIA */ | ||
78 | MFP_CFG(GPIO59, AF7), /* PRST ; AF7 to tristate */ | ||
79 | MFP_CFG(GPIO61, AF7), /* PCE1 ; AF7 to tristate */ | ||
80 | MFP_CFG(GPIO60, AF7), /* PCE2 ; AF7 to tristate */ | ||
81 | MFP_CFG(GPIO62, AF7), /* PCD ; AF7 to tristate */ | ||
82 | MFP_CFG(GPIO56, AF7), /* PSKTSEL ; AF7 to tristate */ | ||
83 | GPIO27_GPIO, /* RDnWR ; input/tristate */ | ||
84 | GPIO50_GPIO, /* PREG ; input/tristate */ | ||
85 | GPIO2_RDY, | ||
86 | GPIO5_NPIOR, | ||
87 | GPIO6_NPIOW, | ||
88 | GPIO7_NPIOS16, | ||
89 | GPIO8_NPWAIT, | ||
90 | GPIO29_GPIO, /* PRDY (READY GPIO) */ | ||
91 | GPIO57_GPIO, /* PPEN (POWER GPIO) */ | ||
92 | GPIO81_GPIO, /* PCD (DETECT GPIO) */ | ||
93 | GPIO77_GPIO, /* PRST (RESET GPIO) */ | ||
94 | GPIO53_GPIO, /* PBVD1 */ | ||
95 | GPIO79_GPIO, /* PBVD2 */ | ||
96 | GPIO54_GPIO, /* POE */ | ||
97 | }; | ||
98 | #else | ||
99 | static mfp_cfg_t colibri_pxa320_evalboard_pin_config[] __initdata = {}; | ||
100 | #endif | ||
101 | |||
38 | #if defined(CONFIG_AX88796) | 102 | #if defined(CONFIG_AX88796) |
39 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) | 103 | #define COLIBRI_ETH_IRQ_GPIO mfp_to_gpio(GPIO36_GPIO) |
40 | |||
41 | /* | 104 | /* |
42 | * Asix AX88796 Ethernet | 105 | * Asix AX88796 Ethernet |
43 | */ | 106 | */ |
@@ -84,26 +147,6 @@ static void __init colibri_pxa320_init_eth(void) | |||
84 | static inline void __init colibri_pxa320_init_eth(void) {} | 147 | static inline void __init colibri_pxa320_init_eth(void) {} |
85 | #endif /* CONFIG_AX88796 */ | 148 | #endif /* CONFIG_AX88796 */ |
86 | 149 | ||
87 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | ||
88 | static mfp_cfg_t colibri_pxa320_usb_pin_config[] __initdata = { | ||
89 | GPIO2_2_USBH_PEN, | ||
90 | GPIO3_2_USBH_PWR, | ||
91 | }; | ||
92 | |||
93 | static struct pxaohci_platform_data colibri_pxa320_ohci_info = { | ||
94 | .port_mode = PMM_GLOBAL_MODE, | ||
95 | .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW, | ||
96 | }; | ||
97 | |||
98 | void __init colibri_pxa320_init_ohci(void) | ||
99 | { | ||
100 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_usb_pin_config)); | ||
101 | pxa_set_ohci_info(&colibri_pxa320_ohci_info); | ||
102 | } | ||
103 | #else | ||
104 | static inline void colibri_pxa320_init_ohci(void) {} | ||
105 | #endif /* CONFIG_USB_OHCI_HCD || CONFIG_USB_OHCI_HCD_MODULE */ | ||
106 | |||
107 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) | 150 | #if defined(CONFIG_USB_GADGET_PXA27X)||defined(CONFIG_USB_GADGET_PXA27X_MODULE) |
108 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { | 151 | static struct gpio_vbus_mach_info colibri_pxa320_gpio_vbus_info = { |
109 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), | 152 | .gpio_vbus = mfp_to_gpio(MFP_PIN_GPIO96), |
@@ -140,15 +183,6 @@ static void __init colibri_pxa320_init_udc(void) | |||
140 | static inline void colibri_pxa320_init_udc(void) {} | 183 | static inline void colibri_pxa320_init_udc(void) {} |
141 | #endif | 184 | #endif |
142 | 185 | ||
143 | static mfp_cfg_t colibri_pxa320_mmc_pin_config[] __initdata = { | ||
144 | GPIO22_MMC1_CLK, | ||
145 | GPIO23_MMC1_CMD, | ||
146 | GPIO18_MMC1_DAT0, | ||
147 | GPIO19_MMC1_DAT1, | ||
148 | GPIO20_MMC1_DAT2, | ||
149 | GPIO21_MMC1_DAT3 | ||
150 | }; | ||
151 | |||
152 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 186 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
153 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { | 187 | static mfp_cfg_t colibri_pxa320_lcd_pin_config[] __initdata = { |
154 | GPIO6_2_LCD_LDD_0, | 188 | GPIO6_2_LCD_LDD_0, |
@@ -205,59 +239,24 @@ static inline void __init colibri_pxa320_init_ac97(void) | |||
205 | static inline void colibri_pxa320_init_ac97(void) {} | 239 | static inline void colibri_pxa320_init_ac97(void) {} |
206 | #endif | 240 | #endif |
207 | 241 | ||
208 | /* | ||
209 | * The following configuration is verified to work with the Toradex Orchid | ||
210 | * carrier board | ||
211 | */ | ||
212 | static mfp_cfg_t colibri_pxa320_uart_pin_config[] __initdata = { | ||
213 | /* UART 1 configuration (may be set by bootloader) */ | ||
214 | GPIO99_UART1_CTS, | ||
215 | GPIO104_UART1_RTS, | ||
216 | GPIO97_UART1_RXD, | ||
217 | GPIO98_UART1_TXD, | ||
218 | GPIO101_UART1_DTR, | ||
219 | GPIO103_UART1_DSR, | ||
220 | GPIO100_UART1_DCD, | ||
221 | GPIO102_UART1_RI, | ||
222 | |||
223 | /* UART 2 configuration */ | ||
224 | GPIO109_UART2_CTS, | ||
225 | GPIO112_UART2_RTS, | ||
226 | GPIO110_UART2_RXD, | ||
227 | GPIO111_UART2_TXD, | ||
228 | |||
229 | /* UART 3 configuration */ | ||
230 | GPIO30_UART3_RXD, | ||
231 | GPIO31_UART3_TXD, | ||
232 | }; | ||
233 | |||
234 | static void __init colibri_pxa320_init_uart(void) | ||
235 | { | ||
236 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_uart_pin_config)); | ||
237 | } | ||
238 | |||
239 | void __init colibri_pxa320_init(void) | 242 | void __init colibri_pxa320_init(void) |
240 | { | 243 | { |
241 | pxa_set_ffuart_info(NULL); | ||
242 | pxa_set_btuart_info(NULL); | ||
243 | pxa_set_stuart_info(NULL); | ||
244 | |||
245 | colibri_pxa320_init_eth(); | 244 | colibri_pxa320_init_eth(); |
246 | colibri_pxa320_init_ohci(); | ||
247 | colibri_pxa3xx_init_nand(); | 245 | colibri_pxa3xx_init_nand(); |
248 | colibri_pxa320_init_lcd(); | 246 | colibri_pxa320_init_lcd(); |
249 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); | 247 | colibri_pxa3xx_init_lcd(mfp_to_gpio(GPIO49_GPIO)); |
250 | colibri_pxa320_init_ac97(); | 248 | colibri_pxa320_init_ac97(); |
251 | colibri_pxa3xx_init_mmc(ARRAY_AND_SIZE(colibri_pxa320_mmc_pin_config), | ||
252 | mfp_to_gpio(MFP_PIN_GPIO28)); | ||
253 | colibri_pxa320_init_uart(); | ||
254 | colibri_pxa320_init_udc(); | 249 | colibri_pxa320_init_udc(); |
250 | |||
251 | /* Evalboard init */ | ||
252 | pxa3xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa320_evalboard_pin_config)); | ||
253 | colibri_evalboard_init(); | ||
255 | } | 254 | } |
256 | 255 | ||
257 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") | 256 | MACHINE_START(COLIBRI320, "Toradex Colibri PXA320") |
258 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, | 257 | .boot_params = COLIBRI_SDRAM_BASE + 0x100, |
259 | .init_machine = colibri_pxa320_init, | 258 | .init_machine = colibri_pxa320_init, |
260 | .map_io = pxa_map_io, | 259 | .map_io = pxa3xx_map_io, |
261 | .init_irq = pxa3xx_init_irq, | 260 | .init_irq = pxa3xx_init_irq, |
262 | .timer = &pxa_timer, | 261 | .timer = &pxa_timer, |
263 | MACHINE_END | 262 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/colibri-pxa3xx.c b/arch/arm/mach-pxa/colibri-pxa3xx.c index 199afa2ae303..96b2d9fbfef0 100644 --- a/arch/arm/mach-pxa/colibri-pxa3xx.c +++ b/arch/arm/mach-pxa/colibri-pxa3xx.c | |||
@@ -64,55 +64,6 @@ void __init colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data) | |||
64 | } | 64 | } |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
68 | static int mmc_detect_pin; | ||
69 | |||
70 | static int colibri_pxa3xx_mci_init(struct device *dev, | ||
71 | irq_handler_t colibri_mmc_detect_int, | ||
72 | void *data) | ||
73 | { | ||
74 | int ret; | ||
75 | |||
76 | ret = gpio_request(mmc_detect_pin, "mmc card detect"); | ||
77 | if (ret) | ||
78 | return ret; | ||
79 | |||
80 | gpio_direction_input(mmc_detect_pin); | ||
81 | ret = request_irq(gpio_to_irq(mmc_detect_pin), colibri_mmc_detect_int, | ||
82 | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, | ||
83 | "MMC card detect", data); | ||
84 | if (ret) { | ||
85 | gpio_free(mmc_detect_pin); | ||
86 | return ret; | ||
87 | } | ||
88 | |||
89 | return 0; | ||
90 | } | ||
91 | |||
92 | static void colibri_pxa3xx_mci_exit(struct device *dev, void *data) | ||
93 | { | ||
94 | free_irq(mmc_detect_pin, data); | ||
95 | gpio_free(gpio_to_irq(mmc_detect_pin)); | ||
96 | } | ||
97 | |||
98 | static struct pxamci_platform_data colibri_pxa3xx_mci_platform_data = { | ||
99 | .detect_delay_ms = 200, | ||
100 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | ||
101 | .init = colibri_pxa3xx_mci_init, | ||
102 | .exit = colibri_pxa3xx_mci_exit, | ||
103 | .gpio_card_detect = -1, | ||
104 | .gpio_card_ro = -1, | ||
105 | .gpio_power = -1, | ||
106 | }; | ||
107 | |||
108 | void __init colibri_pxa3xx_init_mmc(mfp_cfg_t *pins, int len, int detect_pin) | ||
109 | { | ||
110 | pxa3xx_mfp_config(pins, len); | ||
111 | mmc_detect_pin = detect_pin; | ||
112 | pxa_set_mci_info(&colibri_pxa3xx_mci_platform_data); | ||
113 | } | ||
114 | #endif /* CONFIG_MMC_PXA || CONFIG_MMC_PXA_MODULE */ | ||
115 | |||
116 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 67 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) |
117 | static int lcd_bl_pin; | 68 | static int lcd_bl_pin; |
118 | 69 | ||
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index 821229acabe6..9f3e5af0a0db 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -721,7 +721,7 @@ static void __init fixup_corgi(struct machine_desc *desc, | |||
721 | #ifdef CONFIG_MACH_CORGI | 721 | #ifdef CONFIG_MACH_CORGI |
722 | MACHINE_START(CORGI, "SHARP Corgi") | 722 | MACHINE_START(CORGI, "SHARP Corgi") |
723 | .fixup = fixup_corgi, | 723 | .fixup = fixup_corgi, |
724 | .map_io = pxa_map_io, | 724 | .map_io = pxa25x_map_io, |
725 | .init_irq = pxa25x_init_irq, | 725 | .init_irq = pxa25x_init_irq, |
726 | .init_machine = corgi_init, | 726 | .init_machine = corgi_init, |
727 | .timer = &pxa_timer, | 727 | .timer = &pxa_timer, |
@@ -731,7 +731,7 @@ MACHINE_END | |||
731 | #ifdef CONFIG_MACH_SHEPHERD | 731 | #ifdef CONFIG_MACH_SHEPHERD |
732 | MACHINE_START(SHEPHERD, "SHARP Shepherd") | 732 | MACHINE_START(SHEPHERD, "SHARP Shepherd") |
733 | .fixup = fixup_corgi, | 733 | .fixup = fixup_corgi, |
734 | .map_io = pxa_map_io, | 734 | .map_io = pxa25x_map_io, |
735 | .init_irq = pxa25x_init_irq, | 735 | .init_irq = pxa25x_init_irq, |
736 | .init_machine = corgi_init, | 736 | .init_machine = corgi_init, |
737 | .timer = &pxa_timer, | 737 | .timer = &pxa_timer, |
@@ -741,7 +741,7 @@ MACHINE_END | |||
741 | #ifdef CONFIG_MACH_HUSKY | 741 | #ifdef CONFIG_MACH_HUSKY |
742 | MACHINE_START(HUSKY, "SHARP Husky") | 742 | MACHINE_START(HUSKY, "SHARP Husky") |
743 | .fixup = fixup_corgi, | 743 | .fixup = fixup_corgi, |
744 | .map_io = pxa_map_io, | 744 | .map_io = pxa25x_map_io, |
745 | .init_irq = pxa25x_init_irq, | 745 | .init_irq = pxa25x_init_irq, |
746 | .init_machine = corgi_init, | 746 | .init_machine = corgi_init, |
747 | .timer = &pxa_timer, | 747 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/cpufreq-pxa2xx.c b/arch/arm/mach-pxa/cpufreq-pxa2xx.c index 58093d9e07be..6a7aeab42f6c 100644 --- a/arch/arm/mach-pxa/cpufreq-pxa2xx.c +++ b/arch/arm/mach-pxa/cpufreq-pxa2xx.c | |||
@@ -38,8 +38,10 @@ | |||
38 | #include <linux/cpufreq.h> | 38 | #include <linux/cpufreq.h> |
39 | #include <linux/err.h> | 39 | #include <linux/err.h> |
40 | #include <linux/regulator/consumer.h> | 40 | #include <linux/regulator/consumer.h> |
41 | #include <linux/io.h> | ||
41 | 42 | ||
42 | #include <mach/pxa2xx-regs.h> | 43 | #include <mach/pxa2xx-regs.h> |
44 | #include <mach/smemc.h> | ||
43 | 45 | ||
44 | #ifdef DEBUG | 46 | #ifdef DEBUG |
45 | static unsigned int freq_debug; | 47 | static unsigned int freq_debug; |
@@ -242,7 +244,7 @@ static void pxa27x_guess_max_freq(void) | |||
242 | 244 | ||
243 | static void init_sdram_rows(void) | 245 | static void init_sdram_rows(void) |
244 | { | 246 | { |
245 | uint32_t mdcnfg = MDCNFG; | 247 | uint32_t mdcnfg = __raw_readl(MDCNFG); |
246 | unsigned int drac2 = 0, drac0 = 0; | 248 | unsigned int drac2 = 0, drac0 = 0; |
247 | 249 | ||
248 | if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3)) | 250 | if (mdcnfg & (MDCNFG_DE2 | MDCNFG_DE3)) |
@@ -331,8 +333,8 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
331 | * we need to preset the smaller DRI before the change. If we're | 333 | * we need to preset the smaller DRI before the change. If we're |
332 | * speeding up we need to set the larger DRI value after the change. | 334 | * speeding up we need to set the larger DRI value after the change. |
333 | */ | 335 | */ |
334 | preset_mdrefr = postset_mdrefr = MDREFR; | 336 | preset_mdrefr = postset_mdrefr = __raw_readl(MDREFR); |
335 | if ((MDREFR & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) { | 337 | if ((preset_mdrefr & MDREFR_DRI_MASK) > mdrefr_dri(new_freq_mem)) { |
336 | preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK); | 338 | preset_mdrefr = (preset_mdrefr & ~MDREFR_DRI_MASK); |
337 | preset_mdrefr |= mdrefr_dri(new_freq_mem); | 339 | preset_mdrefr |= mdrefr_dri(new_freq_mem); |
338 | } | 340 | } |
@@ -370,7 +372,7 @@ static int pxa_set_target(struct cpufreq_policy *policy, | |||
370 | 3: nop \n\ | 372 | 3: nop \n\ |
371 | " | 373 | " |
372 | : "=&r" (unused) | 374 | : "=&r" (unused) |
373 | : "r" (&MDREFR), "r" (cclkcfg), | 375 | : "r" (MDREFR), "r" (cclkcfg), |
374 | "r" (preset_mdrefr), "r" (postset_mdrefr) | 376 | "r" (preset_mdrefr), "r" (postset_mdrefr) |
375 | : "r4", "r5"); | 377 | : "r4", "r5"); |
376 | local_irq_restore(flags); | 378 | local_irq_restore(flags); |
diff --git a/arch/arm/mach-pxa/csb726.c b/arch/arm/mach-pxa/csb726.c index 57cacaff194d..a305424a967d 100644 --- a/arch/arm/mach-pxa/csb726.c +++ b/arch/arm/mach-pxa/csb726.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <mach/ohci.h> | 27 | #include <mach/ohci.h> |
28 | #include <mach/pxa2xx-regs.h> | 28 | #include <mach/pxa2xx-regs.h> |
29 | #include <mach/audio.h> | 29 | #include <mach/audio.h> |
30 | #include <mach/smemc.h> | ||
30 | 31 | ||
31 | #include "generic.h" | 32 | #include "generic.h" |
32 | #include "devices.h" | 33 | #include "devices.h" |
@@ -255,9 +256,9 @@ static struct platform_device *devices[] __initdata = { | |||
255 | static void __init csb726_init(void) | 256 | static void __init csb726_init(void) |
256 | { | 257 | { |
257 | pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); | 258 | pxa2xx_mfp_config(ARRAY_AND_SIZE(csb726_pin_config)); |
258 | /* MSC1 = 0x7ffc3ffc; *//* LAN9215/EXP_CS */ | 259 | /* __raw_writel(0x7ffc3ffc, MSC1); *//* LAN9215/EXP_CS */ |
259 | /* MSC2 = 0x06697ff4; *//* none/SM501 */ | 260 | /* __raw_writel(0x06697ff4, MSC2); *//* none/SM501 */ |
260 | MSC2 = (MSC2 & ~0xffff) | 0x7ff4; /* SM501 */ | 261 | __raw_writel((__raw_readl(MSC2) & ~0xffff) | 0x7ff4, MSC2); /* SM501 */ |
261 | 262 | ||
262 | pxa_set_ffuart_info(NULL); | 263 | pxa_set_ffuart_info(NULL); |
263 | pxa_set_btuart_info(NULL); | 264 | pxa_set_btuart_info(NULL); |
@@ -273,7 +274,7 @@ static void __init csb726_init(void) | |||
273 | 274 | ||
274 | MACHINE_START(CSB726, "Cogent CSB726") | 275 | MACHINE_START(CSB726, "Cogent CSB726") |
275 | .boot_params = 0xa0000100, | 276 | .boot_params = 0xa0000100, |
276 | .map_io = pxa_map_io, | 277 | .map_io = pxa27x_map_io, |
277 | .init_irq = pxa27x_init_irq, | 278 | .init_irq = pxa27x_init_irq, |
278 | .init_machine = csb726_init, | 279 | .init_machine = csb726_init, |
279 | .timer = &pxa_timer, | 280 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/devices.c b/arch/arm/mach-pxa/devices.c index aaa1166df964..022c2fa4af04 100644 --- a/arch/arm/mach-pxa/devices.c +++ b/arch/arm/mach-pxa/devices.c | |||
@@ -342,27 +342,6 @@ struct platform_device pxa27x_device_i2c_power = { | |||
342 | }; | 342 | }; |
343 | #endif | 343 | #endif |
344 | 344 | ||
345 | #ifdef CONFIG_PXA3xx | ||
346 | static struct resource pxa3xx_resources_i2c_power[] = { | ||
347 | { | ||
348 | .start = 0x40f500c0, | ||
349 | .end = 0x40f500d3, | ||
350 | .flags = IORESOURCE_MEM, | ||
351 | }, { | ||
352 | .start = IRQ_PWRI2C, | ||
353 | .end = IRQ_PWRI2C, | ||
354 | .flags = IORESOURCE_IRQ, | ||
355 | }, | ||
356 | }; | ||
357 | |||
358 | struct platform_device pxa3xx_device_i2c_power = { | ||
359 | .name = "pxa3xx-pwri2c", | ||
360 | .id = 1, | ||
361 | .resource = pxa3xx_resources_i2c_power, | ||
362 | .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), | ||
363 | }; | ||
364 | #endif | ||
365 | |||
366 | static struct resource pxai2s_resources[] = { | 345 | static struct resource pxai2s_resources[] = { |
367 | { | 346 | { |
368 | .start = 0x40400000, | 347 | .start = 0x40400000, |
@@ -633,30 +612,35 @@ struct platform_device pxa25x_device_assp = { | |||
633 | #endif /* CONFIG_PXA25x */ | 612 | #endif /* CONFIG_PXA25x */ |
634 | 613 | ||
635 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | 614 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) |
636 | 615 | static struct resource pxa27x_resource_camera[] = { | |
637 | static struct resource pxa27x_resource_keypad[] = { | ||
638 | [0] = { | 616 | [0] = { |
639 | .start = 0x41500000, | 617 | .start = 0x50000000, |
640 | .end = 0x4150004c, | 618 | .end = 0x50000fff, |
641 | .flags = IORESOURCE_MEM, | 619 | .flags = IORESOURCE_MEM, |
642 | }, | 620 | }, |
643 | [1] = { | 621 | [1] = { |
644 | .start = IRQ_KEYPAD, | 622 | .start = IRQ_CAMERA, |
645 | .end = IRQ_KEYPAD, | 623 | .end = IRQ_CAMERA, |
646 | .flags = IORESOURCE_IRQ, | 624 | .flags = IORESOURCE_IRQ, |
647 | }, | 625 | }, |
648 | }; | 626 | }; |
649 | 627 | ||
650 | struct platform_device pxa27x_device_keypad = { | 628 | static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); |
651 | .name = "pxa27x-keypad", | 629 | |
652 | .id = -1, | 630 | static struct platform_device pxa27x_device_camera = { |
653 | .resource = pxa27x_resource_keypad, | 631 | .name = "pxa27x-camera", |
654 | .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), | 632 | .id = 0, /* This is used to put cameras on this interface */ |
633 | .dev = { | ||
634 | .dma_mask = &pxa27x_dma_mask_camera, | ||
635 | .coherent_dma_mask = 0xffffffff, | ||
636 | }, | ||
637 | .num_resources = ARRAY_SIZE(pxa27x_resource_camera), | ||
638 | .resource = pxa27x_resource_camera, | ||
655 | }; | 639 | }; |
656 | 640 | ||
657 | void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) | 641 | void __init pxa_set_camera_info(struct pxacamera_platform_data *info) |
658 | { | 642 | { |
659 | pxa_register_device(&pxa27x_device_keypad, info); | 643 | pxa_register_device(&pxa27x_device_camera, info); |
660 | } | 644 | } |
661 | 645 | ||
662 | static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); | 646 | static u64 pxa27x_ohci_dma_mask = DMA_BIT_MASK(32); |
@@ -689,6 +673,33 @@ void __init pxa_set_ohci_info(struct pxaohci_platform_data *info) | |||
689 | { | 673 | { |
690 | pxa_register_device(&pxa27x_device_ohci, info); | 674 | pxa_register_device(&pxa27x_device_ohci, info); |
691 | } | 675 | } |
676 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ | ||
677 | |||
678 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | ||
679 | static struct resource pxa27x_resource_keypad[] = { | ||
680 | [0] = { | ||
681 | .start = 0x41500000, | ||
682 | .end = 0x4150004c, | ||
683 | .flags = IORESOURCE_MEM, | ||
684 | }, | ||
685 | [1] = { | ||
686 | .start = IRQ_KEYPAD, | ||
687 | .end = IRQ_KEYPAD, | ||
688 | .flags = IORESOURCE_IRQ, | ||
689 | }, | ||
690 | }; | ||
691 | |||
692 | struct platform_device pxa27x_device_keypad = { | ||
693 | .name = "pxa27x-keypad", | ||
694 | .id = -1, | ||
695 | .resource = pxa27x_resource_keypad, | ||
696 | .num_resources = ARRAY_SIZE(pxa27x_resource_keypad), | ||
697 | }; | ||
698 | |||
699 | void __init pxa_set_keypad_info(struct pxa27x_keypad_platform_data *info) | ||
700 | { | ||
701 | pxa_register_device(&pxa27x_device_keypad, info); | ||
702 | } | ||
692 | 703 | ||
693 | static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); | 704 | static u64 pxa27x_ssp1_dma_mask = DMA_BIT_MASK(32); |
694 | 705 | ||
@@ -833,79 +844,9 @@ struct platform_device pxa27x_device_pwm1 = { | |||
833 | .resource = pxa27x_resource_pwm1, | 844 | .resource = pxa27x_resource_pwm1, |
834 | .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), | 845 | .num_resources = ARRAY_SIZE(pxa27x_resource_pwm1), |
835 | }; | 846 | }; |
836 | 847 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx || CONFIG_PXA95x*/ | |
837 | static struct resource pxa27x_resource_camera[] = { | ||
838 | [0] = { | ||
839 | .start = 0x50000000, | ||
840 | .end = 0x50000fff, | ||
841 | .flags = IORESOURCE_MEM, | ||
842 | }, | ||
843 | [1] = { | ||
844 | .start = IRQ_CAMERA, | ||
845 | .end = IRQ_CAMERA, | ||
846 | .flags = IORESOURCE_IRQ, | ||
847 | }, | ||
848 | }; | ||
849 | |||
850 | static u64 pxa27x_dma_mask_camera = DMA_BIT_MASK(32); | ||
851 | |||
852 | static struct platform_device pxa27x_device_camera = { | ||
853 | .name = "pxa27x-camera", | ||
854 | .id = 0, /* This is used to put cameras on this interface */ | ||
855 | .dev = { | ||
856 | .dma_mask = &pxa27x_dma_mask_camera, | ||
857 | .coherent_dma_mask = 0xffffffff, | ||
858 | }, | ||
859 | .num_resources = ARRAY_SIZE(pxa27x_resource_camera), | ||
860 | .resource = pxa27x_resource_camera, | ||
861 | }; | ||
862 | |||
863 | void __init pxa_set_camera_info(struct pxacamera_platform_data *info) | ||
864 | { | ||
865 | pxa_register_device(&pxa27x_device_camera, info); | ||
866 | } | ||
867 | #endif /* CONFIG_PXA27x || CONFIG_PXA3xx */ | ||
868 | 848 | ||
869 | #ifdef CONFIG_PXA3xx | 849 | #ifdef CONFIG_PXA3xx |
870 | static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); | ||
871 | |||
872 | static struct resource pxa3xx_resource_ssp4[] = { | ||
873 | [0] = { | ||
874 | .start = 0x41a00000, | ||
875 | .end = 0x41a0003f, | ||
876 | .flags = IORESOURCE_MEM, | ||
877 | }, | ||
878 | [1] = { | ||
879 | .start = IRQ_SSP4, | ||
880 | .end = IRQ_SSP4, | ||
881 | .flags = IORESOURCE_IRQ, | ||
882 | }, | ||
883 | [2] = { | ||
884 | /* DRCMR for RX */ | ||
885 | .start = 2, | ||
886 | .end = 2, | ||
887 | .flags = IORESOURCE_DMA, | ||
888 | }, | ||
889 | [3] = { | ||
890 | /* DRCMR for TX */ | ||
891 | .start = 3, | ||
892 | .end = 3, | ||
893 | .flags = IORESOURCE_DMA, | ||
894 | }, | ||
895 | }; | ||
896 | |||
897 | struct platform_device pxa3xx_device_ssp4 = { | ||
898 | /* PXA3xx SSP is basically equivalent to PXA27x */ | ||
899 | .name = "pxa27x-ssp", | ||
900 | .id = 3, | ||
901 | .dev = { | ||
902 | .dma_mask = &pxa3xx_ssp4_dma_mask, | ||
903 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
904 | }, | ||
905 | .resource = pxa3xx_resource_ssp4, | ||
906 | .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), | ||
907 | }; | ||
908 | |||
909 | static struct resource pxa3xx_resources_mci2[] = { | 850 | static struct resource pxa3xx_resources_mci2[] = { |
910 | [0] = { | 851 | [0] = { |
911 | .start = 0x42000000, | 852 | .start = 0x42000000, |
@@ -984,6 +925,54 @@ void __init pxa3xx_set_mci3_info(struct pxamci_platform_data *info) | |||
984 | pxa_register_device(&pxa3xx_device_mci3, info); | 925 | pxa_register_device(&pxa3xx_device_mci3, info); |
985 | } | 926 | } |
986 | 927 | ||
928 | static struct resource pxa3xx_resources_gcu[] = { | ||
929 | { | ||
930 | .start = 0x54000000, | ||
931 | .end = 0x54000fff, | ||
932 | .flags = IORESOURCE_MEM, | ||
933 | }, | ||
934 | { | ||
935 | .start = IRQ_GCU, | ||
936 | .end = IRQ_GCU, | ||
937 | .flags = IORESOURCE_IRQ, | ||
938 | }, | ||
939 | }; | ||
940 | |||
941 | static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); | ||
942 | |||
943 | struct platform_device pxa3xx_device_gcu = { | ||
944 | .name = "pxa3xx-gcu", | ||
945 | .id = -1, | ||
946 | .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), | ||
947 | .resource = pxa3xx_resources_gcu, | ||
948 | .dev = { | ||
949 | .dma_mask = &pxa3xx_gcu_dmamask, | ||
950 | .coherent_dma_mask = 0xffffffff, | ||
951 | }, | ||
952 | }; | ||
953 | |||
954 | #endif /* CONFIG_PXA3xx */ | ||
955 | |||
956 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) | ||
957 | static struct resource pxa3xx_resources_i2c_power[] = { | ||
958 | { | ||
959 | .start = 0x40f500c0, | ||
960 | .end = 0x40f500d3, | ||
961 | .flags = IORESOURCE_MEM, | ||
962 | }, { | ||
963 | .start = IRQ_PWRI2C, | ||
964 | .end = IRQ_PWRI2C, | ||
965 | .flags = IORESOURCE_IRQ, | ||
966 | }, | ||
967 | }; | ||
968 | |||
969 | struct platform_device pxa3xx_device_i2c_power = { | ||
970 | .name = "pxa3xx-pwri2c", | ||
971 | .id = 1, | ||
972 | .resource = pxa3xx_resources_i2c_power, | ||
973 | .num_resources = ARRAY_SIZE(pxa3xx_resources_i2c_power), | ||
974 | }; | ||
975 | |||
987 | static struct resource pxa3xx_resources_nand[] = { | 976 | static struct resource pxa3xx_resources_nand[] = { |
988 | [0] = { | 977 | [0] = { |
989 | .start = 0x43100000, | 978 | .start = 0x43100000, |
@@ -1027,33 +1016,45 @@ void __init pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info) | |||
1027 | pxa_register_device(&pxa3xx_device_nand, info); | 1016 | pxa_register_device(&pxa3xx_device_nand, info); |
1028 | } | 1017 | } |
1029 | 1018 | ||
1030 | static struct resource pxa3xx_resources_gcu[] = { | 1019 | static u64 pxa3xx_ssp4_dma_mask = DMA_BIT_MASK(32); |
1031 | { | 1020 | |
1032 | .start = 0x54000000, | 1021 | static struct resource pxa3xx_resource_ssp4[] = { |
1033 | .end = 0x54000fff, | 1022 | [0] = { |
1023 | .start = 0x41a00000, | ||
1024 | .end = 0x41a0003f, | ||
1034 | .flags = IORESOURCE_MEM, | 1025 | .flags = IORESOURCE_MEM, |
1035 | }, | 1026 | }, |
1036 | { | 1027 | [1] = { |
1037 | .start = IRQ_GCU, | 1028 | .start = IRQ_SSP4, |
1038 | .end = IRQ_GCU, | 1029 | .end = IRQ_SSP4, |
1039 | .flags = IORESOURCE_IRQ, | 1030 | .flags = IORESOURCE_IRQ, |
1040 | }, | 1031 | }, |
1032 | [2] = { | ||
1033 | /* DRCMR for RX */ | ||
1034 | .start = 2, | ||
1035 | .end = 2, | ||
1036 | .flags = IORESOURCE_DMA, | ||
1037 | }, | ||
1038 | [3] = { | ||
1039 | /* DRCMR for TX */ | ||
1040 | .start = 3, | ||
1041 | .end = 3, | ||
1042 | .flags = IORESOURCE_DMA, | ||
1043 | }, | ||
1041 | }; | 1044 | }; |
1042 | 1045 | ||
1043 | static u64 pxa3xx_gcu_dmamask = DMA_BIT_MASK(32); | 1046 | struct platform_device pxa3xx_device_ssp4 = { |
1044 | 1047 | /* PXA3xx SSP is basically equivalent to PXA27x */ | |
1045 | struct platform_device pxa3xx_device_gcu = { | 1048 | .name = "pxa27x-ssp", |
1046 | .name = "pxa3xx-gcu", | 1049 | .id = 3, |
1047 | .id = -1, | ||
1048 | .num_resources = ARRAY_SIZE(pxa3xx_resources_gcu), | ||
1049 | .resource = pxa3xx_resources_gcu, | ||
1050 | .dev = { | 1050 | .dev = { |
1051 | .dma_mask = &pxa3xx_gcu_dmamask, | 1051 | .dma_mask = &pxa3xx_ssp4_dma_mask, |
1052 | .coherent_dma_mask = 0xffffffff, | 1052 | .coherent_dma_mask = DMA_BIT_MASK(32), |
1053 | }, | 1053 | }, |
1054 | .resource = pxa3xx_resource_ssp4, | ||
1055 | .num_resources = ARRAY_SIZE(pxa3xx_resource_ssp4), | ||
1054 | }; | 1056 | }; |
1055 | 1057 | #endif /* CONFIG_PXA3xx || CONFIG_PXA95x */ | |
1056 | #endif /* CONFIG_PXA3xx */ | ||
1057 | 1058 | ||
1058 | /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. | 1059 | /* pxa2xx-spi platform-device ID equals respective SSP platform-device ID + 1. |
1059 | * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ | 1060 | * See comment in arch/arm/mach-pxa/ssp.c::ssp_probe() */ |
diff --git a/arch/arm/mach-pxa/em-x270.c b/arch/arm/mach-pxa/em-x270.c index ed0dbfdb22ed..4cefd1d18afd 100644 --- a/arch/arm/mach-pxa/em-x270.c +++ b/arch/arm/mach-pxa/em-x270.c | |||
@@ -1300,7 +1300,7 @@ static void __init em_x270_init(void) | |||
1300 | 1300 | ||
1301 | MACHINE_START(EM_X270, "Compulab EM-X270") | 1301 | MACHINE_START(EM_X270, "Compulab EM-X270") |
1302 | .boot_params = 0xa0000100, | 1302 | .boot_params = 0xa0000100, |
1303 | .map_io = pxa_map_io, | 1303 | .map_io = pxa27x_map_io, |
1304 | .init_irq = pxa27x_init_irq, | 1304 | .init_irq = pxa27x_init_irq, |
1305 | .timer = &pxa_timer, | 1305 | .timer = &pxa_timer, |
1306 | .init_machine = em_x270_init, | 1306 | .init_machine = em_x270_init, |
@@ -1308,7 +1308,7 @@ MACHINE_END | |||
1308 | 1308 | ||
1309 | MACHINE_START(EXEDA, "Compulab eXeda") | 1309 | MACHINE_START(EXEDA, "Compulab eXeda") |
1310 | .boot_params = 0xa0000100, | 1310 | .boot_params = 0xa0000100, |
1311 | .map_io = pxa_map_io, | 1311 | .map_io = pxa27x_map_io, |
1312 | .init_irq = pxa27x_init_irq, | 1312 | .init_irq = pxa27x_init_irq, |
1313 | .timer = &pxa_timer, | 1313 | .timer = &pxa_timer, |
1314 | .init_machine = em_x270_init, | 1314 | .init_machine = em_x270_init, |
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index b25690ccadc4..edca0a043293 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -181,7 +181,7 @@ static void __init e330_init(void) | |||
181 | MACHINE_START(E330, "Toshiba e330") | 181 | MACHINE_START(E330, "Toshiba e330") |
182 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 182 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
183 | .boot_params = 0xa0000100, | 183 | .boot_params = 0xa0000100, |
184 | .map_io = pxa_map_io, | 184 | .map_io = pxa25x_map_io, |
185 | .nr_irqs = ESERIES_NR_IRQS, | 185 | .nr_irqs = ESERIES_NR_IRQS, |
186 | .init_irq = pxa25x_init_irq, | 186 | .init_irq = pxa25x_init_irq, |
187 | .fixup = eseries_fixup, | 187 | .fixup = eseries_fixup, |
@@ -230,7 +230,7 @@ static void __init e350_init(void) | |||
230 | MACHINE_START(E350, "Toshiba e350") | 230 | MACHINE_START(E350, "Toshiba e350") |
231 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 231 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
232 | .boot_params = 0xa0000100, | 232 | .boot_params = 0xa0000100, |
233 | .map_io = pxa_map_io, | 233 | .map_io = pxa25x_map_io, |
234 | .nr_irqs = ESERIES_NR_IRQS, | 234 | .nr_irqs = ESERIES_NR_IRQS, |
235 | .init_irq = pxa25x_init_irq, | 235 | .init_irq = pxa25x_init_irq, |
236 | .fixup = eseries_fixup, | 236 | .fixup = eseries_fixup, |
@@ -352,7 +352,7 @@ static void __init e400_init(void) | |||
352 | MACHINE_START(E400, "Toshiba e400") | 352 | MACHINE_START(E400, "Toshiba e400") |
353 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 353 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
354 | .boot_params = 0xa0000100, | 354 | .boot_params = 0xa0000100, |
355 | .map_io = pxa_map_io, | 355 | .map_io = pxa25x_map_io, |
356 | .nr_irqs = ESERIES_NR_IRQS, | 356 | .nr_irqs = ESERIES_NR_IRQS, |
357 | .init_irq = pxa25x_init_irq, | 357 | .init_irq = pxa25x_init_irq, |
358 | .fixup = eseries_fixup, | 358 | .fixup = eseries_fixup, |
@@ -540,7 +540,7 @@ static void __init e740_init(void) | |||
540 | MACHINE_START(E740, "Toshiba e740") | 540 | MACHINE_START(E740, "Toshiba e740") |
541 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 541 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
542 | .boot_params = 0xa0000100, | 542 | .boot_params = 0xa0000100, |
543 | .map_io = pxa_map_io, | 543 | .map_io = pxa25x_map_io, |
544 | .nr_irqs = ESERIES_NR_IRQS, | 544 | .nr_irqs = ESERIES_NR_IRQS, |
545 | .init_irq = pxa25x_init_irq, | 545 | .init_irq = pxa25x_init_irq, |
546 | .fixup = eseries_fixup, | 546 | .fixup = eseries_fixup, |
@@ -731,7 +731,7 @@ static void __init e750_init(void) | |||
731 | MACHINE_START(E750, "Toshiba e750") | 731 | MACHINE_START(E750, "Toshiba e750") |
732 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 732 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
733 | .boot_params = 0xa0000100, | 733 | .boot_params = 0xa0000100, |
734 | .map_io = pxa_map_io, | 734 | .map_io = pxa25x_map_io, |
735 | .nr_irqs = ESERIES_NR_IRQS, | 735 | .nr_irqs = ESERIES_NR_IRQS, |
736 | .init_irq = pxa25x_init_irq, | 736 | .init_irq = pxa25x_init_irq, |
737 | .fixup = eseries_fixup, | 737 | .fixup = eseries_fixup, |
@@ -926,7 +926,7 @@ static void __init e800_init(void) | |||
926 | MACHINE_START(E800, "Toshiba e800") | 926 | MACHINE_START(E800, "Toshiba e800") |
927 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 927 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
928 | .boot_params = 0xa0000100, | 928 | .boot_params = 0xa0000100, |
929 | .map_io = pxa_map_io, | 929 | .map_io = pxa25x_map_io, |
930 | .nr_irqs = ESERIES_NR_IRQS, | 930 | .nr_irqs = ESERIES_NR_IRQS, |
931 | .init_irq = pxa25x_init_irq, | 931 | .init_irq = pxa25x_init_irq, |
932 | .fixup = eseries_fixup, | 932 | .fixup = eseries_fixup, |
diff --git a/arch/arm/mach-pxa/ezx.c b/arch/arm/mach-pxa/ezx.c index 142c711f4cda..87cec0abe5b0 100644 --- a/arch/arm/mach-pxa/ezx.c +++ b/arch/arm/mach-pxa/ezx.c | |||
@@ -798,7 +798,7 @@ static void __init a780_init(void) | |||
798 | 798 | ||
799 | MACHINE_START(EZX_A780, "Motorola EZX A780") | 799 | MACHINE_START(EZX_A780, "Motorola EZX A780") |
800 | .boot_params = 0xa0000100, | 800 | .boot_params = 0xa0000100, |
801 | .map_io = pxa_map_io, | 801 | .map_io = pxa27x_map_io, |
802 | .nr_irqs = EZX_NR_IRQS, | 802 | .nr_irqs = EZX_NR_IRQS, |
803 | .init_irq = pxa27x_init_irq, | 803 | .init_irq = pxa27x_init_irq, |
804 | .timer = &pxa_timer, | 804 | .timer = &pxa_timer, |
@@ -863,7 +863,7 @@ static void __init e680_init(void) | |||
863 | 863 | ||
864 | MACHINE_START(EZX_E680, "Motorola EZX E680") | 864 | MACHINE_START(EZX_E680, "Motorola EZX E680") |
865 | .boot_params = 0xa0000100, | 865 | .boot_params = 0xa0000100, |
866 | .map_io = pxa_map_io, | 866 | .map_io = pxa27x_map_io, |
867 | .nr_irqs = EZX_NR_IRQS, | 867 | .nr_irqs = EZX_NR_IRQS, |
868 | .init_irq = pxa27x_init_irq, | 868 | .init_irq = pxa27x_init_irq, |
869 | .timer = &pxa_timer, | 869 | .timer = &pxa_timer, |
@@ -928,7 +928,7 @@ static void __init a1200_init(void) | |||
928 | 928 | ||
929 | MACHINE_START(EZX_A1200, "Motorola EZX A1200") | 929 | MACHINE_START(EZX_A1200, "Motorola EZX A1200") |
930 | .boot_params = 0xa0000100, | 930 | .boot_params = 0xa0000100, |
931 | .map_io = pxa_map_io, | 931 | .map_io = pxa27x_map_io, |
932 | .nr_irqs = EZX_NR_IRQS, | 932 | .nr_irqs = EZX_NR_IRQS, |
933 | .init_irq = pxa27x_init_irq, | 933 | .init_irq = pxa27x_init_irq, |
934 | .timer = &pxa_timer, | 934 | .timer = &pxa_timer, |
@@ -1118,7 +1118,7 @@ static void __init a910_init(void) | |||
1118 | 1118 | ||
1119 | MACHINE_START(EZX_A910, "Motorola EZX A910") | 1119 | MACHINE_START(EZX_A910, "Motorola EZX A910") |
1120 | .boot_params = 0xa0000100, | 1120 | .boot_params = 0xa0000100, |
1121 | .map_io = pxa_map_io, | 1121 | .map_io = pxa27x_map_io, |
1122 | .nr_irqs = EZX_NR_IRQS, | 1122 | .nr_irqs = EZX_NR_IRQS, |
1123 | .init_irq = pxa27x_init_irq, | 1123 | .init_irq = pxa27x_init_irq, |
1124 | .timer = &pxa_timer, | 1124 | .timer = &pxa_timer, |
@@ -1183,7 +1183,7 @@ static void __init e6_init(void) | |||
1183 | 1183 | ||
1184 | MACHINE_START(EZX_E6, "Motorola EZX E6") | 1184 | MACHINE_START(EZX_E6, "Motorola EZX E6") |
1185 | .boot_params = 0xa0000100, | 1185 | .boot_params = 0xa0000100, |
1186 | .map_io = pxa_map_io, | 1186 | .map_io = pxa27x_map_io, |
1187 | .nr_irqs = EZX_NR_IRQS, | 1187 | .nr_irqs = EZX_NR_IRQS, |
1188 | .init_irq = pxa27x_init_irq, | 1188 | .init_irq = pxa27x_init_irq, |
1189 | .timer = &pxa_timer, | 1189 | .timer = &pxa_timer, |
@@ -1222,7 +1222,7 @@ static void __init e2_init(void) | |||
1222 | 1222 | ||
1223 | MACHINE_START(EZX_E2, "Motorola EZX E2") | 1223 | MACHINE_START(EZX_E2, "Motorola EZX E2") |
1224 | .boot_params = 0xa0000100, | 1224 | .boot_params = 0xa0000100, |
1225 | .map_io = pxa_map_io, | 1225 | .map_io = pxa27x_map_io, |
1226 | .nr_irqs = EZX_NR_IRQS, | 1226 | .nr_irqs = EZX_NR_IRQS, |
1227 | .init_irq = pxa27x_init_irq, | 1227 | .init_irq = pxa27x_init_irq, |
1228 | .timer = &pxa_timer, | 1228 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/generic.c b/arch/arm/mach-pxa/generic.c index 6451e9c3a93f..d6e15f71fc09 100644 --- a/arch/arm/mach-pxa/generic.c +++ b/arch/arm/mach-pxa/generic.c | |||
@@ -28,6 +28,8 @@ | |||
28 | 28 | ||
29 | #include <mach/reset.h> | 29 | #include <mach/reset.h> |
30 | #include <mach/gpio.h> | 30 | #include <mach/gpio.h> |
31 | #include <mach/smemc.h> | ||
32 | #include <mach/pxa3xx-regs.h> | ||
31 | 33 | ||
32 | #include "generic.h" | 34 | #include "generic.h" |
33 | 35 | ||
@@ -35,9 +37,10 @@ void clear_reset_status(unsigned int mask) | |||
35 | { | 37 | { |
36 | if (cpu_is_pxa2xx()) | 38 | if (cpu_is_pxa2xx()) |
37 | pxa2xx_clear_reset_status(mask); | 39 | pxa2xx_clear_reset_status(mask); |
38 | 40 | else { | |
39 | if (cpu_is_pxa3xx()) | 41 | /* RESET_STATUS_* has a 1:1 mapping with ARSR */ |
40 | pxa3xx_clear_reset_status(mask); | 42 | ARSR = mask; |
43 | } | ||
41 | } | 44 | } |
42 | 45 | ||
43 | unsigned long get_clock_tick_rate(void) | 46 | unsigned long get_clock_tick_rate(void) |
@@ -71,47 +74,17 @@ unsigned int get_clk_frequency_khz(int info) | |||
71 | EXPORT_SYMBOL(get_clk_frequency_khz); | 74 | EXPORT_SYMBOL(get_clk_frequency_khz); |
72 | 75 | ||
73 | /* | 76 | /* |
74 | * Return the current memory clock frequency in units of 10kHz | ||
75 | */ | ||
76 | unsigned int get_memclk_frequency_10khz(void) | ||
77 | { | ||
78 | if (cpu_is_pxa25x()) | ||
79 | return pxa25x_get_memclk_frequency_10khz(); | ||
80 | else if (cpu_is_pxa27x()) | ||
81 | return pxa27x_get_memclk_frequency_10khz(); | ||
82 | return 0; | ||
83 | } | ||
84 | EXPORT_SYMBOL(get_memclk_frequency_10khz); | ||
85 | |||
86 | /* | ||
87 | * Intel PXA2xx internal register mapping. | 77 | * Intel PXA2xx internal register mapping. |
88 | * | 78 | * |
89 | * Note 1: not all PXA2xx variants implement all those addresses. | 79 | * Note: virtual 0xfffe0000-0xffffffff is reserved for the vector table |
90 | * | 80 | * and cache flush area. |
91 | * Note 2: virtual 0xfffe0000-0xffffffff is reserved for the vector table | ||
92 | * and cache flush area. | ||
93 | */ | 81 | */ |
94 | static struct map_desc standard_io_desc[] __initdata = { | 82 | static struct map_desc common_io_desc[] __initdata = { |
95 | { /* Devs */ | 83 | { /* Devs */ |
96 | .virtual = 0xf2000000, | 84 | .virtual = 0xf2000000, |
97 | .pfn = __phys_to_pfn(0x40000000), | 85 | .pfn = __phys_to_pfn(0x40000000), |
98 | .length = 0x02000000, | 86 | .length = 0x02000000, |
99 | .type = MT_DEVICE | 87 | .type = MT_DEVICE |
100 | }, { /* Mem Ctl */ | ||
101 | .virtual = 0xf6000000, | ||
102 | .pfn = __phys_to_pfn(0x48000000), | ||
103 | .length = 0x00200000, | ||
104 | .type = MT_DEVICE | ||
105 | }, { /* Camera */ | ||
106 | .virtual = 0xfa000000, | ||
107 | .pfn = __phys_to_pfn(0x50000000), | ||
108 | .length = 0x00100000, | ||
109 | .type = MT_DEVICE | ||
110 | }, { /* IMem ctl */ | ||
111 | .virtual = 0xfe000000, | ||
112 | .pfn = __phys_to_pfn(0x58000000), | ||
113 | .length = 0x00100000, | ||
114 | .type = MT_DEVICE | ||
115 | }, { /* UNCACHED_PHYS_0 */ | 88 | }, { /* UNCACHED_PHYS_0 */ |
116 | .virtual = 0xff000000, | 89 | .virtual = 0xff000000, |
117 | .pfn = __phys_to_pfn(0x00000000), | 90 | .pfn = __phys_to_pfn(0x00000000), |
@@ -122,6 +95,5 @@ static struct map_desc standard_io_desc[] __initdata = { | |||
122 | 95 | ||
123 | void __init pxa_map_io(void) | 96 | void __init pxa_map_io(void) |
124 | { | 97 | { |
125 | iotable_init(standard_io_desc, ARRAY_SIZE(standard_io_desc)); | 98 | iotable_init(ARRAY_AND_SIZE(common_io_desc)); |
126 | get_clk_frequency_khz(1); | ||
127 | } | 99 | } |
diff --git a/arch/arm/mach-pxa/generic.h b/arch/arm/mach-pxa/generic.h index 4b1ad2769ed7..6205dc9a2b9d 100644 --- a/arch/arm/mach-pxa/generic.h +++ b/arch/arm/mach-pxa/generic.h | |||
@@ -20,7 +20,12 @@ extern void __init pxa26x_init_irq(void); | |||
20 | #endif | 20 | #endif |
21 | extern void __init pxa27x_init_irq(void); | 21 | extern void __init pxa27x_init_irq(void); |
22 | extern void __init pxa3xx_init_irq(void); | 22 | extern void __init pxa3xx_init_irq(void); |
23 | extern void __init pxa95x_init_irq(void); | ||
24 | |||
23 | extern void __init pxa_map_io(void); | 25 | extern void __init pxa_map_io(void); |
26 | extern void __init pxa25x_map_io(void); | ||
27 | extern void __init pxa27x_map_io(void); | ||
28 | extern void __init pxa3xx_map_io(void); | ||
24 | 29 | ||
25 | extern unsigned int get_clk_frequency_khz(int info); | 30 | extern unsigned int get_clk_frequency_khz(int info); |
26 | 31 | ||
@@ -32,18 +37,14 @@ extern unsigned int get_clk_frequency_khz(int info); | |||
32 | 37 | ||
33 | #ifdef CONFIG_PXA25x | 38 | #ifdef CONFIG_PXA25x |
34 | extern unsigned pxa25x_get_clk_frequency_khz(int); | 39 | extern unsigned pxa25x_get_clk_frequency_khz(int); |
35 | extern unsigned pxa25x_get_memclk_frequency_10khz(void); | ||
36 | #else | 40 | #else |
37 | #define pxa25x_get_clk_frequency_khz(x) (0) | 41 | #define pxa25x_get_clk_frequency_khz(x) (0) |
38 | #define pxa25x_get_memclk_frequency_10khz() (0) | ||
39 | #endif | 42 | #endif |
40 | 43 | ||
41 | #ifdef CONFIG_PXA27x | 44 | #ifdef CONFIG_PXA27x |
42 | extern unsigned pxa27x_get_clk_frequency_khz(int); | 45 | extern unsigned pxa27x_get_clk_frequency_khz(int); |
43 | extern unsigned pxa27x_get_memclk_frequency_10khz(void); | ||
44 | #else | 46 | #else |
45 | #define pxa27x_get_clk_frequency_khz(x) (0) | 47 | #define pxa27x_get_clk_frequency_khz(x) (0) |
46 | #define pxa27x_get_memclk_frequency_10khz() (0) | ||
47 | #endif | 48 | #endif |
48 | 49 | ||
49 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | 50 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) |
@@ -54,10 +55,8 @@ static inline void pxa2xx_clear_reset_status(unsigned int mask) {} | |||
54 | 55 | ||
55 | #ifdef CONFIG_PXA3xx | 56 | #ifdef CONFIG_PXA3xx |
56 | extern unsigned pxa3xx_get_clk_frequency_khz(int); | 57 | extern unsigned pxa3xx_get_clk_frequency_khz(int); |
57 | extern void pxa3xx_clear_reset_status(unsigned int); | ||
58 | #else | 58 | #else |
59 | #define pxa3xx_get_clk_frequency_khz(x) (0) | 59 | #define pxa3xx_get_clk_frequency_khz(x) (0) |
60 | static inline void pxa3xx_clear_reset_status(unsigned int mask) {} | ||
61 | #endif | 60 | #endif |
62 | 61 | ||
63 | extern struct sysdev_class pxa_irq_sysclass; | 62 | extern struct sysdev_class pxa_irq_sysclass; |
diff --git a/arch/arm/mach-pxa/gumstix.c b/arch/arm/mach-pxa/gumstix.c index 1e2a9a13aec1..6fd319ea5284 100644 --- a/arch/arm/mach-pxa/gumstix.c +++ b/arch/arm/mach-pxa/gumstix.c | |||
@@ -225,7 +225,7 @@ static void __init gumstix_init(void) | |||
225 | 225 | ||
226 | MACHINE_START(GUMSTIX, "Gumstix") | 226 | MACHINE_START(GUMSTIX, "Gumstix") |
227 | .boot_params = 0xa0000100, /* match u-boot bi_boot_params */ | 227 | .boot_params = 0xa0000100, /* match u-boot bi_boot_params */ |
228 | .map_io = pxa_map_io, | 228 | .map_io = pxa25x_map_io, |
229 | .init_irq = pxa25x_init_irq, | 229 | .init_irq = pxa25x_init_irq, |
230 | .timer = &pxa_timer, | 230 | .timer = &pxa_timer, |
231 | .init_machine = gumstix_init, | 231 | .init_machine = gumstix_init, |
diff --git a/arch/arm/mach-pxa/h5000.c b/arch/arm/mach-pxa/h5000.c index 7057a1f46db4..657db469de1f 100644 --- a/arch/arm/mach-pxa/h5000.c +++ b/arch/arm/mach-pxa/h5000.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <mach/pxa25x.h> | 32 | #include <mach/pxa25x.h> |
33 | #include <mach/h5000.h> | 33 | #include <mach/h5000.h> |
34 | #include <mach/udc.h> | 34 | #include <mach/udc.h> |
35 | #include <mach/smemc.h> | ||
35 | 36 | ||
36 | #include "generic.h" | 37 | #include "generic.h" |
37 | 38 | ||
@@ -172,11 +173,11 @@ static unsigned long h5000_pin_config[] __initdata = { | |||
172 | 173 | ||
173 | static void fix_msc(void) | 174 | static void fix_msc(void) |
174 | { | 175 | { |
175 | MSC0 = 0x129c24f2; | 176 | __raw_writel(0x129c24f2, MSC0); |
176 | MSC1 = 0x7ff424fa; | 177 | __raw_writel(0x7ff424fa, MSC1); |
177 | MSC2 = 0x7ff47ff4; | 178 | __raw_writel(0x7ff47ff4, MSC2); |
178 | 179 | ||
179 | MDREFR |= 0x02080000; | 180 | __raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR); |
180 | } | 181 | } |
181 | 182 | ||
182 | /* | 183 | /* |
@@ -202,7 +203,7 @@ static void __init h5000_init(void) | |||
202 | 203 | ||
203 | MACHINE_START(H5400, "HP iPAQ H5000") | 204 | MACHINE_START(H5400, "HP iPAQ H5000") |
204 | .boot_params = 0xa0000100, | 205 | .boot_params = 0xa0000100, |
205 | .map_io = pxa_map_io, | 206 | .map_io = pxa25x_map_io, |
206 | .init_irq = pxa25x_init_irq, | 207 | .init_irq = pxa25x_init_irq, |
207 | .timer = &pxa_timer, | 208 | .timer = &pxa_timer, |
208 | .init_machine = h5000_init, | 209 | .init_machine = h5000_init, |
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c index 01b7f07ebad2..e8603eba54bd 100644 --- a/arch/arm/mach-pxa/himalaya.c +++ b/arch/arm/mach-pxa/himalaya.c | |||
@@ -160,7 +160,7 @@ static void __init himalaya_init(void) | |||
160 | 160 | ||
161 | MACHINE_START(HIMALAYA, "HTC Himalaya") | 161 | MACHINE_START(HIMALAYA, "HTC Himalaya") |
162 | .boot_params = 0xa0000100, | 162 | .boot_params = 0xa0000100, |
163 | .map_io = pxa_map_io, | 163 | .map_io = pxa25x_map_io, |
164 | .init_irq = pxa25x_init_irq, | 164 | .init_irq = pxa25x_init_irq, |
165 | .init_machine = himalaya_init, | 165 | .init_machine = himalaya_init, |
166 | .timer = &pxa_timer, | 166 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c index 76d93a25bab6..cacb21b7014d 100644 --- a/arch/arm/mach-pxa/hx4700.c +++ b/arch/arm/mach-pxa/hx4700.c | |||
@@ -871,7 +871,7 @@ static void __init hx4700_init(void) | |||
871 | 871 | ||
872 | MACHINE_START(H4700, "HP iPAQ HX4700") | 872 | MACHINE_START(H4700, "HP iPAQ HX4700") |
873 | .boot_params = 0xa0000100, | 873 | .boot_params = 0xa0000100, |
874 | .map_io = pxa_map_io, | 874 | .map_io = pxa27x_map_io, |
875 | .nr_irqs = HX4700_NR_IRQS, | 875 | .nr_irqs = HX4700_NR_IRQS, |
876 | .init_irq = pxa27x_init_irq, | 876 | .init_irq = pxa27x_init_irq, |
877 | .init_machine = hx4700_init, | 877 | .init_machine = hx4700_init, |
diff --git a/arch/arm/mach-pxa/icontrol.c b/arch/arm/mach-pxa/icontrol.c index d51ee3d25e70..ac6ee12e400e 100644 --- a/arch/arm/mach-pxa/icontrol.c +++ b/arch/arm/mach-pxa/icontrol.c | |||
@@ -192,7 +192,7 @@ static void __init icontrol_init(void) | |||
192 | 192 | ||
193 | MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") | 193 | MACHINE_START(ICONTROL, "iControl/SafeTcam boards using Embedian MXM-8x10 CoM") |
194 | .boot_params = 0xa0000100, | 194 | .boot_params = 0xa0000100, |
195 | .map_io = pxa_map_io, | 195 | .map_io = pxa3xx_map_io, |
196 | .init_irq = pxa3xx_init_irq, | 196 | .init_irq = pxa3xx_init_irq, |
197 | .timer = &pxa_timer, | 197 | .timer = &pxa_timer, |
198 | .init_machine = icontrol_init | 198 | .init_machine = icontrol_init |
diff --git a/arch/arm/mach-pxa/idp.c b/arch/arm/mach-pxa/idp.c index e773dceeabc6..dd40e4a9291c 100644 --- a/arch/arm/mach-pxa/idp.c +++ b/arch/arm/mach-pxa/idp.c | |||
@@ -187,7 +187,7 @@ static struct map_desc idp_io_desc[] __initdata = { | |||
187 | 187 | ||
188 | static void __init idp_map_io(void) | 188 | static void __init idp_map_io(void) |
189 | { | 189 | { |
190 | pxa_map_io(); | 190 | pxa25x_map_io(); |
191 | iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); | 191 | iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc)); |
192 | } | 192 | } |
193 | 193 | ||
diff --git a/arch/arm/mach-pxa/include/mach/addr-map.h b/arch/arm/mach-pxa/include/mach/addr-map.h new file mode 100644 index 000000000000..f4c03659168c --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/addr-map.h | |||
@@ -0,0 +1,48 @@ | |||
1 | #ifndef __ASM_MACH_ADDR_MAP_H | ||
2 | #define __ASM_MACH_ADDR_MAP_H | ||
3 | |||
4 | /* | ||
5 | * Chip Selects | ||
6 | */ | ||
7 | #define PXA_CS0_PHYS 0x00000000 | ||
8 | #define PXA_CS1_PHYS 0x04000000 | ||
9 | #define PXA_CS2_PHYS 0x08000000 | ||
10 | #define PXA_CS3_PHYS 0x0C000000 | ||
11 | #define PXA_CS4_PHYS 0x10000000 | ||
12 | #define PXA_CS5_PHYS 0x14000000 | ||
13 | |||
14 | #define PXA300_CS0_PHYS 0x00000000 /* PXA300/PXA310 _only_ */ | ||
15 | #define PXA300_CS1_PHYS 0x30000000 /* PXA300/PXA310 _only_ */ | ||
16 | #define PXA3xx_CS2_PHYS 0x10000000 | ||
17 | #define PXA3xx_CS3_PHYS 0x14000000 | ||
18 | |||
19 | /* | ||
20 | * Peripheral Bus | ||
21 | */ | ||
22 | #define PERIPH_PHYS 0x40000000 | ||
23 | #define PERIPH_VIRT 0xf2000000 | ||
24 | #define PERIPH_SIZE 0x02000000 | ||
25 | |||
26 | /* | ||
27 | * Static Memory Controller (w/ SDRAM controls on PXA25x/PXA27x) | ||
28 | */ | ||
29 | #define PXA2XX_SMEMC_PHYS 0x48000000 | ||
30 | #define PXA3XX_SMEMC_PHYS 0x4a000000 | ||
31 | #define SMEMC_VIRT 0xf6000000 | ||
32 | #define SMEMC_SIZE 0x00100000 | ||
33 | |||
34 | /* | ||
35 | * Dynamic Memory Controller (only on PXA3xx) | ||
36 | */ | ||
37 | #define DMEMC_PHYS 0x48100000 | ||
38 | #define DMEMC_VIRT 0xf6100000 | ||
39 | #define DMEMC_SIZE 0x00100000 | ||
40 | |||
41 | /* | ||
42 | * Internal Memory Controller (PXA27x and later) | ||
43 | */ | ||
44 | #define IMEMC_PHYS 0x58000000 | ||
45 | #define IMEMC_VIRT 0xfe000000 | ||
46 | #define IMEMC_SIZE 0x00100000 | ||
47 | |||
48 | #endif /* __ASM_MACH_ADDR_MAP_H */ | ||
diff --git a/arch/arm/mach-pxa/include/mach/balloon3.h b/arch/arm/mach-pxa/include/mach/balloon3.h index 561562b4360b..7074e76146c9 100644 --- a/arch/arm/mach-pxa/include/mach/balloon3.h +++ b/arch/arm/mach-pxa/include/mach/balloon3.h | |||
@@ -26,6 +26,8 @@ enum balloon3_features { | |||
26 | #define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */ | 26 | #define BALLOON3_FPGA_VIRT (0xf1000000) /* as per balloon2 */ |
27 | #define BALLOON3_FPGA_LENGTH 0x01000000 | 27 | #define BALLOON3_FPGA_LENGTH 0x01000000 |
28 | 28 | ||
29 | #define BALLOON3_FPGA_SETnCLR (0x1000) | ||
30 | |||
29 | /* FPGA / CPLD registers for CF socket */ | 31 | /* FPGA / CPLD registers for CF socket */ |
30 | #define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008) | 32 | #define BALLOON3_CF_STATUS_REG (BALLOON3_FPGA_VIRT + 0x00e00008) |
31 | #define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008) | 33 | #define BALLOON3_CF_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00008) |
@@ -35,7 +37,7 @@ enum balloon3_features { | |||
35 | #define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000) | 37 | #define BALLOON3_NAND_BASE (PXA_CS4_PHYS + 0x00e00000) |
36 | #define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000) | 38 | #define BALLOON3_NAND_IO_REG (BALLOON3_FPGA_VIRT + 0x00e00000) |
37 | #define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010) | 39 | #define BALLOON3_NAND_CONTROL2_REG (BALLOON3_FPGA_VIRT + 0x00e00010) |
38 | #define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00010) | 40 | #define BALLOON3_NAND_STAT_REG (BALLOON3_FPGA_VIRT + 0x00e00014) |
39 | #define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014) | 41 | #define BALLOON3_NAND_CONTROL_REG (BALLOON3_FPGA_VIRT + 0x00e00014) |
40 | 42 | ||
41 | /* fpga/cpld interrupt control register */ | 43 | /* fpga/cpld interrupt control register */ |
@@ -174,7 +176,7 @@ enum balloon3_features { | |||
174 | #define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) | 176 | #define BALLOON3_CODEC_IRQ IRQ_GPIO(BALLOON3_GPIO_CODEC_IRQ) |
175 | #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) | 177 | #define BALLOON3_S0_CD_IRQ IRQ_GPIO(BALLOON3_GPIO_S0_CD) |
176 | 178 | ||
177 | #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 4) | 179 | #define BALLOON3_NR_IRQS (IRQ_BOARD_START + 16) |
178 | 180 | ||
179 | extern int balloon3_has(enum balloon3_features feature); | 181 | extern int balloon3_has(enum balloon3_features feature); |
180 | 182 | ||
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h index 58dada11054f..388a96f1ef93 100644 --- a/arch/arm/mach-pxa/include/mach/colibri.h +++ b/arch/arm/mach-pxa/include/mach/colibri.h | |||
@@ -9,14 +9,14 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | enum { | 11 | enum { |
12 | COLIBRI_PXA270_EVALBOARD = 0, | 12 | COLIBRI_EVALBOARD = 0, |
13 | COLIBRI_PXA270_INCOME, | 13 | COLIBRI_PXA270_INCOME, |
14 | }; | 14 | }; |
15 | 15 | ||
16 | #if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) | 16 | #if defined(CONFIG_MACH_COLIBRI_EVALBOARD) |
17 | extern void colibri_pxa270_evalboard_init(void); | 17 | extern void colibri_evalboard_init(void); |
18 | #else | 18 | #else |
19 | static inline void colibri_pxa270_evalboard_init(void) {} | 19 | static inline void colibri_evalboard_init(void) {} |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME) | 22 | #if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME) |
@@ -59,5 +59,11 @@ static inline void colibri_pxa3xx_init_nand(void) {} | |||
59 | #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 | 59 | #define GPIO0_COLIBRI_PXA270_SD_DETECT 0 |
60 | #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 | 60 | #define GPIO113_COLIBRI_PXA270_TS_IRQ 113 |
61 | 61 | ||
62 | /* GPIO definitions for Colibri PXA300/310 */ | ||
63 | #define GPIO39_COLIBRI_PXA300_SD_DETECT 39 | ||
64 | |||
65 | /* GPIO definitions for Colibri PXA320 */ | ||
66 | #define GPIO28_COLIBRI_PXA320_SD_DETECT 28 | ||
67 | |||
62 | #endif /* _COLIBRI_H_ */ | 68 | #endif /* _COLIBRI_H_ */ |
63 | 69 | ||
diff --git a/arch/arm/mach-pxa/include/mach/hardware.h b/arch/arm/mach-pxa/include/mach/hardware.h index 814f1458a06a..6957ba56025b 100644 --- a/arch/arm/mach-pxa/include/mach/hardware.h +++ b/arch/arm/mach-pxa/include/mach/hardware.h | |||
@@ -13,6 +13,8 @@ | |||
13 | #ifndef __ASM_ARCH_HARDWARE_H | 13 | #ifndef __ASM_ARCH_HARDWARE_H |
14 | #define __ASM_ARCH_HARDWARE_H | 14 | #define __ASM_ARCH_HARDWARE_H |
15 | 15 | ||
16 | #include <mach/addr-map.h> | ||
17 | |||
16 | /* | 18 | /* |
17 | * Workarounds for at least 2 errata so far require this. | 19 | * Workarounds for at least 2 errata so far require this. |
18 | * The mapping is set in mach-pxa/generic.c. | 20 | * The mapping is set in mach-pxa/generic.c. |
@@ -193,14 +195,15 @@ | |||
193 | #define __cpu_is_pxa935(id) (0) | 195 | #define __cpu_is_pxa935(id) (0) |
194 | #endif | 196 | #endif |
195 | 197 | ||
196 | #ifdef CONFIG_CPU_PXA950 | 198 | #ifdef CONFIG_CPU_PXA955 |
197 | #define __cpu_is_pxa950(id) \ | 199 | #define __cpu_is_pxa955(id) \ |
198 | ({ \ | 200 | ({ \ |
199 | unsigned int _id = (id) >> 4 & 0xfff; \ | 201 | unsigned int _id = (id) >> 4 & 0xfff; \ |
200 | _id == 0x697; \ | 202 | _id == 0x581 || _id == 0xc08 \ |
201 | }) | 203 | || _id == 0xb76; \ |
204 | }) | ||
202 | #else | 205 | #else |
203 | #define __cpu_is_pxa950(id) (0) | 206 | #define __cpu_is_pxa955(id) (0) |
204 | #endif | 207 | #endif |
205 | 208 | ||
206 | #define cpu_is_pxa210() \ | 209 | #define cpu_is_pxa210() \ |
@@ -253,16 +256,15 @@ | |||
253 | __cpu_is_pxa935(read_cpuid_id()); \ | 256 | __cpu_is_pxa935(read_cpuid_id()); \ |
254 | }) | 257 | }) |
255 | 258 | ||
256 | #define cpu_is_pxa950() \ | 259 | #define cpu_is_pxa955() \ |
257 | ({ \ | 260 | ({ \ |
258 | __cpu_is_pxa950(read_cpuid_id()); \ | 261 | __cpu_is_pxa955(read_cpuid_id()); \ |
259 | }) | 262 | }) |
260 | 263 | ||
261 | 264 | ||
262 | /* | 265 | /* |
263 | * CPUID Core Generation Bit | 266 | * CPUID Core Generation Bit |
264 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x | 267 | * <= 0x2 for pxa21x/pxa25x/pxa26x/pxa27x |
265 | * == 0x3 for pxa300/pxa310/pxa320 | ||
266 | */ | 268 | */ |
267 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | 269 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) |
268 | #define __cpu_is_pxa2xx(id) \ | 270 | #define __cpu_is_pxa2xx(id) \ |
@@ -277,8 +279,10 @@ | |||
277 | #ifdef CONFIG_PXA3xx | 279 | #ifdef CONFIG_PXA3xx |
278 | #define __cpu_is_pxa3xx(id) \ | 280 | #define __cpu_is_pxa3xx(id) \ |
279 | ({ \ | 281 | ({ \ |
280 | unsigned int _id = (id) >> 13 & 0x7; \ | 282 | __cpu_is_pxa300(id) \ |
281 | _id == 0x3; \ | 283 | || __cpu_is_pxa310(id) \ |
284 | || __cpu_is_pxa320(id) \ | ||
285 | || __cpu_is_pxa93x(id); \ | ||
282 | }) | 286 | }) |
283 | #else | 287 | #else |
284 | #define __cpu_is_pxa3xx(id) (0) | 288 | #define __cpu_is_pxa3xx(id) (0) |
@@ -287,13 +291,22 @@ | |||
287 | #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) | 291 | #if defined(CONFIG_CPU_PXA930) || defined(CONFIG_CPU_PXA935) |
288 | #define __cpu_is_pxa93x(id) \ | 292 | #define __cpu_is_pxa93x(id) \ |
289 | ({ \ | 293 | ({ \ |
290 | unsigned int _id = (id) >> 4 & 0xfff; \ | 294 | __cpu_is_pxa930(id) \ |
291 | _id == 0x683 || _id == 0x693; \ | 295 | || __cpu_is_pxa935(id); \ |
292 | }) | 296 | }) |
293 | #else | 297 | #else |
294 | #define __cpu_is_pxa93x(id) (0) | 298 | #define __cpu_is_pxa93x(id) (0) |
295 | #endif | 299 | #endif |
296 | 300 | ||
301 | #ifdef CONFIG_PXA95x | ||
302 | #define __cpu_is_pxa95x(id) \ | ||
303 | ({ \ | ||
304 | __cpu_is_pxa955(id); \ | ||
305 | }) | ||
306 | #else | ||
307 | #define __cpu_is_pxa95x(id) (0) | ||
308 | #endif | ||
309 | |||
297 | #define cpu_is_pxa2xx() \ | 310 | #define cpu_is_pxa2xx() \ |
298 | ({ \ | 311 | ({ \ |
299 | __cpu_is_pxa2xx(read_cpuid_id()); \ | 312 | __cpu_is_pxa2xx(read_cpuid_id()); \ |
@@ -308,6 +321,12 @@ | |||
308 | ({ \ | 321 | ({ \ |
309 | __cpu_is_pxa93x(read_cpuid_id()); \ | 322 | __cpu_is_pxa93x(read_cpuid_id()); \ |
310 | }) | 323 | }) |
324 | |||
325 | #define cpu_is_pxa95x() \ | ||
326 | ({ \ | ||
327 | __cpu_is_pxa95x(read_cpuid_id()); \ | ||
328 | }) | ||
329 | |||
311 | /* | 330 | /* |
312 | * return current memory and LCD clock frequency in units of 10kHz | 331 | * return current memory and LCD clock frequency in units of 10kHz |
313 | */ | 332 | */ |
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h index d372caa75dc7..a4285fc00878 100644 --- a/arch/arm/mach-pxa/include/mach/irqs.h +++ b/arch/arm/mach-pxa/include/mach/irqs.h | |||
@@ -21,16 +21,14 @@ | |||
21 | 21 | ||
22 | #define PXA_IRQ(x) (PXA_ISA_IRQ_NUM + (x)) | 22 | #define PXA_IRQ(x) (PXA_ISA_IRQ_NUM + (x)) |
23 | 23 | ||
24 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
25 | #define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ | 24 | #define IRQ_SSP3 PXA_IRQ(0) /* SSP3 service request */ |
26 | #define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ | 25 | #define IRQ_MSL PXA_IRQ(1) /* MSL Interface interrupt */ |
27 | #define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI) */ | 26 | #define IRQ_USBH2 PXA_IRQ(2) /* USB Host interrupt 1 (OHCI,PXA27x) */ |
28 | #define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI) */ | 27 | #define IRQ_USBH1 PXA_IRQ(3) /* USB Host interrupt 2 (non-OHCI,PXA27x) */ |
29 | #define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ | 28 | #define IRQ_KEYPAD PXA_IRQ(4) /* Key pad controller */ |
30 | #define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt */ | 29 | #define IRQ_MEMSTK PXA_IRQ(5) /* Memory Stick interrupt (PXA27x) */ |
30 | #define IRQ_ACIPC0 PXA_IRQ(5) /* AP-CP Communication (PXA930) */ | ||
31 | #define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ | 31 | #define IRQ_PWRI2C PXA_IRQ(6) /* Power I2C interrupt */ |
32 | #endif | ||
33 | |||
34 | #define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ | 32 | #define IRQ_HWUART PXA_IRQ(7) /* HWUART Transmit/Receive/Error (PXA26x) */ |
35 | #define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ | 33 | #define IRQ_OST_4_11 PXA_IRQ(7) /* OS timer 4-11 matches (PXA27x) */ |
36 | #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ | 34 | #define IRQ_GPIO0 PXA_IRQ(8) /* GPIO0 Edge Detect */ |
@@ -38,7 +36,8 @@ | |||
38 | #define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */ | 36 | #define IRQ_GPIO_2_x PXA_IRQ(10) /* GPIO[2-x] Edge Detect */ |
39 | #define IRQ_USB PXA_IRQ(11) /* USB Service */ | 37 | #define IRQ_USB PXA_IRQ(11) /* USB Service */ |
40 | #define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */ | 38 | #define IRQ_PMU PXA_IRQ(12) /* Performance Monitoring Unit */ |
41 | #define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt */ | 39 | #define IRQ_I2S PXA_IRQ(13) /* I2S Interrupt (PXA27x) */ |
40 | #define IRQ_SSP4 PXA_IRQ(13) /* SSP4 service request (PXA3xx) */ | ||
42 | #define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */ | 41 | #define IRQ_AC97 PXA_IRQ(14) /* AC97 Interrupt */ |
43 | #define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */ | 42 | #define IRQ_ASSP PXA_IRQ(15) /* Audio SSP Service Request (PXA25x) */ |
44 | #define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */ | 43 | #define IRQ_USIM PXA_IRQ(15) /* Smart Card interface interrupt (PXA27x) */ |
@@ -47,6 +46,7 @@ | |||
47 | #define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */ | 46 | #define IRQ_LCD PXA_IRQ(17) /* LCD Controller Service Request */ |
48 | #define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */ | 47 | #define IRQ_I2C PXA_IRQ(18) /* I2C Service Request */ |
49 | #define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */ | 48 | #define IRQ_ICP PXA_IRQ(19) /* ICP Transmit/Receive/Error */ |
49 | #define IRQ_ACIPC2 PXA_IRQ(19) /* AP-CP Communication (PXA930) */ | ||
50 | #define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */ | 50 | #define IRQ_STUART PXA_IRQ(20) /* STUART Transmit/Receive/Error */ |
51 | #define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */ | 51 | #define IRQ_BTUART PXA_IRQ(21) /* BTUART Transmit/Receive/Error */ |
52 | #define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/ | 52 | #define IRQ_FFUART PXA_IRQ(22) /* FFUART Transmit/Receive/Error*/ |
@@ -60,19 +60,17 @@ | |||
60 | #define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */ | 60 | #define IRQ_RTC1Hz PXA_IRQ(30) /* RTC HZ Clock Tick */ |
61 | #define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */ | 61 | #define IRQ_RTCAlrm PXA_IRQ(31) /* RTC Alarm */ |
62 | 62 | ||
63 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
64 | #define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ | 63 | #define IRQ_TPM PXA_IRQ(32) /* TPM interrupt */ |
65 | #define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ | 64 | #define IRQ_CAMERA PXA_IRQ(33) /* Camera Interface */ |
66 | #endif | ||
67 | |||
68 | #ifdef CONFIG_PXA3xx | ||
69 | #define IRQ_SSP4 PXA_IRQ(13) /* SSP4 service request */ | ||
70 | #define IRQ_CIR PXA_IRQ(34) /* Consumer IR */ | 65 | #define IRQ_CIR PXA_IRQ(34) /* Consumer IR */ |
71 | #define IRQ_COMM_WDT PXA_IRQ(35) /* Comm WDT interrupt */ | 66 | #define IRQ_COMM_WDT PXA_IRQ(35) /* Comm WDT interrupt */ |
72 | #define IRQ_TSI PXA_IRQ(36) /* Touch Screen Interface (PXA320) */ | 67 | #define IRQ_TSI PXA_IRQ(36) /* Touch Screen Interface (PXA320) */ |
68 | #define IRQ_ENHROT PXA_IRQ(37) /* Enhanced Rotary (PXA930) */ | ||
73 | #define IRQ_USIM2 PXA_IRQ(38) /* USIM2 Controller */ | 69 | #define IRQ_USIM2 PXA_IRQ(38) /* USIM2 Controller */ |
74 | #define IRQ_GCU PXA_IRQ(39) /* Graphics Controller */ | 70 | #define IRQ_GCU PXA_IRQ(39) /* Graphics Controller (PXA3xx) */ |
71 | #define IRQ_ACIPC1 PXA_IRQ(40) /* AP-CP Communication (PXA930) */ | ||
75 | #define IRQ_MMC2 PXA_IRQ(41) /* MMC2 Controller */ | 72 | #define IRQ_MMC2 PXA_IRQ(41) /* MMC2 Controller */ |
73 | #define IRQ_TRKBALL PXA_IRQ(43) /* Track Ball (PXA930) */ | ||
76 | #define IRQ_1WIRE PXA_IRQ(44) /* 1-Wire Controller */ | 74 | #define IRQ_1WIRE PXA_IRQ(44) /* 1-Wire Controller */ |
77 | #define IRQ_NAND PXA_IRQ(45) /* NAND Controller */ | 75 | #define IRQ_NAND PXA_IRQ(45) /* NAND Controller */ |
78 | #define IRQ_USB2 PXA_IRQ(46) /* USB 2.0 Device Controller */ | 76 | #define IRQ_USB2 PXA_IRQ(46) /* USB 2.0 Device Controller */ |
@@ -80,30 +78,14 @@ | |||
80 | #define IRQ_WAKEUP1 PXA_IRQ(50) /* EXT_WAKEUP1 */ | 78 | #define IRQ_WAKEUP1 PXA_IRQ(50) /* EXT_WAKEUP1 */ |
81 | #define IRQ_DMEMC PXA_IRQ(51) /* Dynamic Memory Controller */ | 79 | #define IRQ_DMEMC PXA_IRQ(51) /* Dynamic Memory Controller */ |
82 | #define IRQ_MMC3 PXA_IRQ(55) /* MMC3 Controller (PXA310) */ | 80 | #define IRQ_MMC3 PXA_IRQ(55) /* MMC3 Controller (PXA310) */ |
83 | #endif | ||
84 | 81 | ||
85 | #ifdef CONFIG_CPU_PXA935 | ||
86 | #define IRQ_U2O PXA_IRQ(64) /* USB OTG 2.0 Controller (PXA935) */ | 82 | #define IRQ_U2O PXA_IRQ(64) /* USB OTG 2.0 Controller (PXA935) */ |
87 | #define IRQ_U2H PXA_IRQ(65) /* USB Host 2.0 Controller (PXA935) */ | 83 | #define IRQ_U2H PXA_IRQ(65) /* USB Host 2.0 Controller (PXA935) */ |
88 | 84 | #define IRQ_PXA935_MMC0 PXA_IRQ(72) /* MMC0 Controller (PXA935) */ | |
89 | #define IRQ_MMC3_PXA935 PXA_IRQ(72) /* MMC3 Controller (PXA935) */ | 85 | #define IRQ_PXA935_MMC1 PXA_IRQ(73) /* MMC1 Controller (PXA935) */ |
90 | #define IRQ_MMC4_PXA935 PXA_IRQ(73) /* MMC4 Controller (PXA935) */ | 86 | #define IRQ_PXA935_MMC2 PXA_IRQ(74) /* MMC2 Controller (PXA935) */ |
91 | #define IRQ_MMC5_PXA935 PXA_IRQ(74) /* MMC5 Controller (PXA935) */ | 87 | #define IRQ_PXA955_MMC3 PXA_IRQ(75) /* MMC3 Controller (PXA955) */ |
92 | |||
93 | #define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */ | 88 | #define IRQ_U2P PXA_IRQ(93) /* USB PHY D+/D- Lines (PXA935) */ |
94 | #endif | ||
95 | |||
96 | #ifdef CONFIG_CPU_PXA930 | ||
97 | #define IRQ_ENHROT PXA_IRQ(37) /* Enhanced Rotary (PXA930) */ | ||
98 | #define IRQ_ACIPC0 PXA_IRQ(5) | ||
99 | #define IRQ_ACIPC1 PXA_IRQ(40) | ||
100 | #define IRQ_ACIPC2 PXA_IRQ(19) | ||
101 | #define IRQ_TRKBALL PXA_IRQ(43) /* Track Ball */ | ||
102 | #endif | ||
103 | |||
104 | #ifdef CONFIG_CPU_PXA950 | ||
105 | #define IRQ_GC500 PXA_IRQ(70) /* Graphics Controller (PXA950) */ | ||
106 | #endif | ||
107 | 89 | ||
108 | #define PXA_GPIO_IRQ_BASE PXA_IRQ(96) | 90 | #define PXA_GPIO_IRQ_BASE PXA_IRQ(96) |
109 | #define PXA_GPIO_IRQ_NUM (192) | 91 | #define PXA_GPIO_IRQ_NUM (192) |
diff --git a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h index 4fcddd9cab76..ee6ced1cea7f 100644 --- a/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa2xx-regs.h | |||
@@ -17,72 +17,6 @@ | |||
17 | #include <mach/hardware.h> | 17 | #include <mach/hardware.h> |
18 | 18 | ||
19 | /* | 19 | /* |
20 | * PXA Chip selects | ||
21 | */ | ||
22 | |||
23 | #define PXA_CS0_PHYS 0x00000000 | ||
24 | #define PXA_CS1_PHYS 0x04000000 | ||
25 | #define PXA_CS2_PHYS 0x08000000 | ||
26 | #define PXA_CS3_PHYS 0x0C000000 | ||
27 | #define PXA_CS4_PHYS 0x10000000 | ||
28 | #define PXA_CS5_PHYS 0x14000000 | ||
29 | |||
30 | /* | ||
31 | * Memory controller | ||
32 | */ | ||
33 | |||
34 | #define MDCNFG __REG(0x48000000) /* SDRAM Configuration Register 0 */ | ||
35 | #define MDREFR __REG(0x48000004) /* SDRAM Refresh Control Register */ | ||
36 | #define MSC0 __REG(0x48000008) /* Static Memory Control Register 0 */ | ||
37 | #define MSC1 __REG(0x4800000C) /* Static Memory Control Register 1 */ | ||
38 | #define MSC2 __REG(0x48000010) /* Static Memory Control Register 2 */ | ||
39 | #define MECR __REG(0x48000014) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */ | ||
40 | #define SXLCR __REG(0x48000018) /* LCR value to be written to SDRAM-Timing Synchronous Flash */ | ||
41 | #define SXCNFG __REG(0x4800001C) /* Synchronous Static Memory Control Register */ | ||
42 | #define SXMRS __REG(0x48000024) /* MRS value to be written to Synchronous Flash or SMROM */ | ||
43 | #define MCMEM0 __REG(0x48000028) /* Card interface Common Memory Space Socket 0 Timing */ | ||
44 | #define MCMEM1 __REG(0x4800002C) /* Card interface Common Memory Space Socket 1 Timing */ | ||
45 | #define MCATT0 __REG(0x48000030) /* Card interface Attribute Space Socket 0 Timing Configuration */ | ||
46 | #define MCATT1 __REG(0x48000034) /* Card interface Attribute Space Socket 1 Timing Configuration */ | ||
47 | #define MCIO0 __REG(0x48000038) /* Card interface I/O Space Socket 0 Timing Configuration */ | ||
48 | #define MCIO1 __REG(0x4800003C) /* Card interface I/O Space Socket 1 Timing Configuration */ | ||
49 | #define MDMRS __REG(0x48000040) /* MRS value to be written to SDRAM */ | ||
50 | #define BOOT_DEF __REG(0x48000044) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ | ||
51 | |||
52 | /* | ||
53 | * More handy macros for PCMCIA | ||
54 | * | ||
55 | * Arg is socket number | ||
56 | */ | ||
57 | #define MCMEM(s) __REG2(0x48000028, (s)<<2 ) /* Card interface Common Memory Space Socket s Timing */ | ||
58 | #define MCATT(s) __REG2(0x48000030, (s)<<2 ) /* Card interface Attribute Space Socket s Timing Configuration */ | ||
59 | #define MCIO(s) __REG2(0x48000038, (s)<<2 ) /* Card interface I/O Space Socket s Timing Configuration */ | ||
60 | |||
61 | /* MECR register defines */ | ||
62 | #define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ | ||
63 | #define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ | ||
64 | |||
65 | #define MDCNFG_DE0 (1 << 0) /* SDRAM Bank 0 Enable */ | ||
66 | #define MDCNFG_DE1 (1 << 1) /* SDRAM Bank 1 Enable */ | ||
67 | #define MDCNFG_DE2 (1 << 16) /* SDRAM Bank 2 Enable */ | ||
68 | #define MDCNFG_DE3 (1 << 17) /* SDRAM Bank 3 Enable */ | ||
69 | |||
70 | #define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ | ||
71 | #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ | ||
72 | #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ | ||
73 | #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ | ||
74 | #define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */ | ||
75 | #define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */ | ||
76 | #define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */ | ||
77 | #define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */ | ||
78 | #define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */ | ||
79 | #define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */ | ||
80 | #define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */ | ||
81 | #define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */ | ||
82 | #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ | ||
83 | #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ | ||
84 | |||
85 | /* | ||
86 | * Power Manager | 20 | * Power Manager |
87 | */ | 21 | */ |
88 | 22 | ||
diff --git a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h index e91d63cfe811..e4fb4668c26e 100644 --- a/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa3xx-regs.h | |||
@@ -16,15 +16,6 @@ | |||
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | ||
18 | /* | 18 | /* |
19 | * Static Chip Selects | ||
20 | */ | ||
21 | |||
22 | #define PXA300_CS0_PHYS (0x00000000) /* PXA300/PXA310 _only_ */ | ||
23 | #define PXA300_CS1_PHYS (0x30000000) /* PXA300/PXA310 _only_ */ | ||
24 | #define PXA3xx_CS2_PHYS (0x10000000) | ||
25 | #define PXA3xx_CS3_PHYS (0x14000000) | ||
26 | |||
27 | /* | ||
28 | * Oscillator Configuration Register (OSCC) | 19 | * Oscillator Configuration Register (OSCC) |
29 | */ | 20 | */ |
30 | #define OSCC __REG(0x41350000) /* Oscillator Configuration Register */ | 21 | #define OSCC __REG(0x41350000) /* Oscillator Configuration Register */ |
diff --git a/arch/arm/mach-pxa/include/mach/regs-intc.h b/arch/arm/mach-pxa/include/mach/regs-intc.h index 68464ce1c1ea..662288eb6f95 100644 --- a/arch/arm/mach-pxa/include/mach/regs-intc.h +++ b/arch/arm/mach-pxa/include/mach/regs-intc.h | |||
@@ -27,8 +27,4 @@ | |||
27 | #define ICFP3 __REG(0x40D0013C) /* Interrupt Controller FIQ Pending Register 3 */ | 27 | #define ICFP3 __REG(0x40D0013C) /* Interrupt Controller FIQ Pending Register 3 */ |
28 | #define ICPR3 __REG(0x40D00140) /* Interrupt Controller Pending Register 3 */ | 28 | #define ICPR3 __REG(0x40D00140) /* Interrupt Controller Pending Register 3 */ |
29 | 29 | ||
30 | #define IPR(x) __REG(0x40D0001C + (x < 32 ? (x << 2) \ | ||
31 | : (x < 64 ? (0x94 + ((x - 32) << 2)) \ | ||
32 | : (0x128 + ((x - 64) << 2))))) | ||
33 | |||
34 | #endif /* __ASM_MACH_REGS_INTC_H */ | 30 | #endif /* __ASM_MACH_REGS_INTC_H */ |
diff --git a/arch/arm/mach-pxa/include/mach/smemc.h b/arch/arm/mach-pxa/include/mach/smemc.h new file mode 100644 index 000000000000..654adc90c9a0 --- /dev/null +++ b/arch/arm/mach-pxa/include/mach/smemc.h | |||
@@ -0,0 +1,74 @@ | |||
1 | /* | ||
2 | * Static memory controller register definitions for PXA CPUs | ||
3 | * | ||
4 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __SMEMC_REGS_H | ||
12 | #define __SMEMC_REGS_H | ||
13 | |||
14 | #define PXA2XX_SMEMC_BASE 0x48000000 | ||
15 | #define PXA3XX_SMEMC_BASE 0x4a000000 | ||
16 | #define SMEMC_VIRT 0xf6000000 | ||
17 | |||
18 | #define MDCNFG (SMEMC_VIRT + 0x00) /* SDRAM Configuration Register 0 */ | ||
19 | #define MDREFR (SMEMC_VIRT + 0x04) /* SDRAM Refresh Control Register */ | ||
20 | #define MSC0 (SMEMC_VIRT + 0x08) /* Static Memory Control Register 0 */ | ||
21 | #define MSC1 (SMEMC_VIRT + 0x0C) /* Static Memory Control Register 1 */ | ||
22 | #define MSC2 (SMEMC_VIRT + 0x10) /* Static Memory Control Register 2 */ | ||
23 | #define MECR (SMEMC_VIRT + 0x14) /* Expansion Memory (PCMCIA/Compact Flash) Bus Configuration */ | ||
24 | #define SXLCR (SMEMC_VIRT + 0x18) /* LCR value to be written to SDRAM-Timing Synchronous Flash */ | ||
25 | #define SXCNFG (SMEMC_VIRT + 0x1C) /* Synchronous Static Memory Control Register */ | ||
26 | #define SXMRS (SMEMC_VIRT + 0x24) /* MRS value to be written to Synchronous Flash or SMROM */ | ||
27 | #define MCMEM0 (SMEMC_VIRT + 0x28) /* Card interface Common Memory Space Socket 0 Timing */ | ||
28 | #define MCMEM1 (SMEMC_VIRT + 0x2C) /* Card interface Common Memory Space Socket 1 Timing */ | ||
29 | #define MCATT0 (SMEMC_VIRT + 0x30) /* Card interface Attribute Space Socket 0 Timing Configuration */ | ||
30 | #define MCATT1 (SMEMC_VIRT + 0x34) /* Card interface Attribute Space Socket 1 Timing Configuration */ | ||
31 | #define MCIO0 (SMEMC_VIRT + 0x38) /* Card interface I/O Space Socket 0 Timing Configuration */ | ||
32 | #define MCIO1 (SMEMC_VIRT + 0x3C) /* Card interface I/O Space Socket 1 Timing Configuration */ | ||
33 | #define MDMRS (SMEMC_VIRT + 0x40) /* MRS value to be written to SDRAM */ | ||
34 | #define BOOT_DEF (SMEMC_VIRT + 0x44) /* Read-Only Boot-Time Register. Contains BOOT_SEL and PKG_SEL */ | ||
35 | #define MEMCLKCFG (SMEMC_VIRT + 0x68) /* Clock Configuration */ | ||
36 | #define CSADRCFG0 (SMEMC_VIRT + 0x80) /* Address Configuration Register for CS0 */ | ||
37 | #define CSADRCFG1 (SMEMC_VIRT + 0x84) /* Address Configuration Register for CS1 */ | ||
38 | #define CSADRCFG2 (SMEMC_VIRT + 0x88) /* Address Configuration Register for CS2 */ | ||
39 | #define CSADRCFG3 (SMEMC_VIRT + 0x8C) /* Address Configuration Register for CS3 */ | ||
40 | |||
41 | /* | ||
42 | * More handy macros for PCMCIA | ||
43 | * | ||
44 | * Arg is socket number | ||
45 | */ | ||
46 | #define MCMEM(s) (SMEMC_VIRT + 0x28 + ((s)<<2)) /* Card interface Common Memory Space Socket s Timing */ | ||
47 | #define MCATT(s) (SMEMC_VIRT + 0x30 + ((s)<<2)) /* Card interface Attribute Space Socket s Timing Configuration */ | ||
48 | #define MCIO(s) (SMEMC_VIRT + 0x38 + ((s)<<2)) /* Card interface I/O Space Socket s Timing Configuration */ | ||
49 | |||
50 | /* MECR register defines */ | ||
51 | #define MECR_NOS (1 << 0) /* Number Of Sockets: 0 -> 1 sock, 1 -> 2 sock */ | ||
52 | #define MECR_CIT (1 << 1) /* Card Is There: 0 -> no card, 1 -> card inserted */ | ||
53 | |||
54 | #define MDCNFG_DE0 (1 << 0) /* SDRAM Bank 0 Enable */ | ||
55 | #define MDCNFG_DE1 (1 << 1) /* SDRAM Bank 1 Enable */ | ||
56 | #define MDCNFG_DE2 (1 << 16) /* SDRAM Bank 2 Enable */ | ||
57 | #define MDCNFG_DE3 (1 << 17) /* SDRAM Bank 3 Enable */ | ||
58 | |||
59 | #define MDREFR_K0DB4 (1 << 29) /* SDCLK0 Divide by 4 Control/Status */ | ||
60 | #define MDREFR_K2FREE (1 << 25) /* SDRAM Free-Running Control */ | ||
61 | #define MDREFR_K1FREE (1 << 24) /* SDRAM Free-Running Control */ | ||
62 | #define MDREFR_K0FREE (1 << 23) /* SDRAM Free-Running Control */ | ||
63 | #define MDREFR_SLFRSH (1 << 22) /* SDRAM Self-Refresh Control/Status */ | ||
64 | #define MDREFR_APD (1 << 20) /* SDRAM/SSRAM Auto-Power-Down Enable */ | ||
65 | #define MDREFR_K2DB2 (1 << 19) /* SDCLK2 Divide by 2 Control/Status */ | ||
66 | #define MDREFR_K2RUN (1 << 18) /* SDCLK2 Run Control/Status */ | ||
67 | #define MDREFR_K1DB2 (1 << 17) /* SDCLK1 Divide by 2 Control/Status */ | ||
68 | #define MDREFR_K1RUN (1 << 16) /* SDCLK1 Run Control/Status */ | ||
69 | #define MDREFR_E1PIN (1 << 15) /* SDCKE1 Level Control/Status */ | ||
70 | #define MDREFR_K0DB2 (1 << 14) /* SDCLK0 Divide by 2 Control/Status */ | ||
71 | #define MDREFR_K0RUN (1 << 13) /* SDCLK0 Run Control/Status */ | ||
72 | #define MDREFR_E0PIN (1 << 12) /* SDCKE0 Level Control/Status */ | ||
73 | |||
74 | #endif | ||
diff --git a/arch/arm/mach-pxa/irq.c b/arch/arm/mach-pxa/irq.c index 1beb40f692fc..54e91c9e71c8 100644 --- a/arch/arm/mach-pxa/irq.c +++ b/arch/arm/mach-pxa/irq.c | |||
@@ -16,20 +16,31 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/sysdev.h> | 18 | #include <linux/sysdev.h> |
19 | #include <linux/io.h> | ||
20 | #include <linux/irq.h> | ||
19 | 21 | ||
20 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
21 | #include <asm/irq.h> | 23 | #include <mach/irqs.h> |
22 | #include <asm/mach/irq.h> | ||
23 | #include <mach/gpio.h> | 24 | #include <mach/gpio.h> |
24 | #include <mach/regs-intc.h> | ||
25 | 25 | ||
26 | #include "generic.h" | 26 | #include "generic.h" |
27 | 27 | ||
28 | #define MAX_INTERNAL_IRQS 128 | 28 | #define IRQ_BASE (void __iomem *)io_p2v(0x40d00000) |
29 | |||
30 | #define ICIP (0x000) | ||
31 | #define ICMR (0x004) | ||
32 | #define ICLR (0x008) | ||
33 | #define ICFR (0x00c) | ||
34 | #define ICPR (0x010) | ||
35 | #define ICCR (0x014) | ||
36 | #define ICHP (0x018) | ||
37 | #define IPR(i) (((i) < 32) ? (0x01c + ((i) << 2)) : \ | ||
38 | ((i) < 64) ? (0x0b0 + (((i) - 32) << 2)) : \ | ||
39 | (0x144 + (((i) - 64) << 2))) | ||
40 | #define IPR_VALID (1 << 31) | ||
41 | #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) | ||
29 | 42 | ||
30 | #define IRQ_BIT(n) (((n) - PXA_IRQ(0)) & 0x1f) | 43 | #define MAX_INTERNAL_IRQS 128 |
31 | #define _ICMR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICMR2 : &ICMR)) | ||
32 | #define _ICLR(n) (*((((n) - PXA_IRQ(0)) & ~0x1f) ? &ICLR2 : &ICLR)) | ||
33 | 44 | ||
34 | /* | 45 | /* |
35 | * This is for peripheral IRQs internal to the PXA chip. | 46 | * This is for peripheral IRQs internal to the PXA chip. |
@@ -37,14 +48,27 @@ | |||
37 | 48 | ||
38 | static int pxa_internal_irq_nr; | 49 | static int pxa_internal_irq_nr; |
39 | 50 | ||
51 | static inline int cpu_has_ipr(void) | ||
52 | { | ||
53 | return !cpu_is_pxa25x(); | ||
54 | } | ||
55 | |||
40 | static void pxa_mask_irq(unsigned int irq) | 56 | static void pxa_mask_irq(unsigned int irq) |
41 | { | 57 | { |
42 | _ICMR(irq) &= ~(1 << IRQ_BIT(irq)); | 58 | void __iomem *base = get_irq_chip_data(irq); |
59 | uint32_t icmr = __raw_readl(base + ICMR); | ||
60 | |||
61 | icmr &= ~(1 << IRQ_BIT(irq)); | ||
62 | __raw_writel(icmr, base + ICMR); | ||
43 | } | 63 | } |
44 | 64 | ||
45 | static void pxa_unmask_irq(unsigned int irq) | 65 | static void pxa_unmask_irq(unsigned int irq) |
46 | { | 66 | { |
47 | _ICMR(irq) |= 1 << IRQ_BIT(irq); | 67 | void __iomem *base = get_irq_chip_data(irq); |
68 | uint32_t icmr = __raw_readl(base + ICMR); | ||
69 | |||
70 | icmr |= 1 << IRQ_BIT(irq); | ||
71 | __raw_writel(icmr, base + ICMR); | ||
48 | } | 72 | } |
49 | 73 | ||
50 | static struct irq_chip pxa_internal_irq_chip = { | 74 | static struct irq_chip pxa_internal_irq_chip = { |
@@ -86,12 +110,16 @@ static void pxa_ack_low_gpio(unsigned int irq) | |||
86 | 110 | ||
87 | static void pxa_mask_low_gpio(unsigned int irq) | 111 | static void pxa_mask_low_gpio(unsigned int irq) |
88 | { | 112 | { |
89 | ICMR &= ~(1 << (irq - PXA_IRQ(0))); | 113 | struct irq_desc *desc = irq_to_desc(irq); |
114 | |||
115 | desc->chip->mask(irq); | ||
90 | } | 116 | } |
91 | 117 | ||
92 | static void pxa_unmask_low_gpio(unsigned int irq) | 118 | static void pxa_unmask_low_gpio(unsigned int irq) |
93 | { | 119 | { |
94 | ICMR |= 1 << (irq - PXA_IRQ(0)); | 120 | struct irq_desc *desc = irq_to_desc(irq); |
121 | |||
122 | desc->chip->unmask(irq); | ||
95 | } | 123 | } |
96 | 124 | ||
97 | static struct irq_chip pxa_low_gpio_chip = { | 125 | static struct irq_chip pxa_low_gpio_chip = { |
@@ -120,33 +148,45 @@ static void __init pxa_init_low_gpio_irq(set_wake_t fn) | |||
120 | pxa_low_gpio_chip.set_wake = fn; | 148 | pxa_low_gpio_chip.set_wake = fn; |
121 | } | 149 | } |
122 | 150 | ||
151 | static inline void __iomem *irq_base(int i) | ||
152 | { | ||
153 | static unsigned long phys_base[] = { | ||
154 | 0x40d00000, | ||
155 | 0x40d0009c, | ||
156 | 0x40d00130, | ||
157 | }; | ||
158 | |||
159 | return (void __iomem *)io_p2v(phys_base[i >> 5]); | ||
160 | } | ||
161 | |||
123 | void __init pxa_init_irq(int irq_nr, set_wake_t fn) | 162 | void __init pxa_init_irq(int irq_nr, set_wake_t fn) |
124 | { | 163 | { |
125 | int irq, i; | 164 | int irq, i, n; |
126 | 165 | ||
127 | BUG_ON(irq_nr > MAX_INTERNAL_IRQS); | 166 | BUG_ON(irq_nr > MAX_INTERNAL_IRQS); |
128 | 167 | ||
129 | pxa_internal_irq_nr = irq_nr; | 168 | pxa_internal_irq_nr = irq_nr; |
130 | 169 | ||
131 | for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq += 32) { | 170 | for (n = 0; n < irq_nr; n += 32) { |
132 | _ICMR(irq) = 0; /* disable all IRQs */ | 171 | void __iomem *base = irq_base(n); |
133 | _ICLR(irq) = 0; /* all IRQs are IRQ, not FIQ */ | 172 | |
134 | } | 173 | __raw_writel(0, base + ICMR); /* disable all IRQs */ |
135 | 174 | __raw_writel(0, base + ICLR); /* all IRQs are IRQ, not FIQ */ | |
136 | /* initialize interrupt priority */ | 175 | for (i = n; (i < (n + 32)) && (i < irq_nr); i++) { |
137 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { | 176 | /* initialize interrupt priority */ |
138 | for (i = 0; i < irq_nr; i++) | 177 | if (cpu_has_ipr()) |
139 | IPR(i) = i | (1 << 31); | 178 | __raw_writel(i | IPR_VALID, IRQ_BASE + IPR(i)); |
179 | |||
180 | irq = PXA_IRQ(i); | ||
181 | set_irq_chip(irq, &pxa_internal_irq_chip); | ||
182 | set_irq_chip_data(irq, base); | ||
183 | set_irq_handler(irq, handle_level_irq); | ||
184 | set_irq_flags(irq, IRQF_VALID); | ||
185 | } | ||
140 | } | 186 | } |
141 | 187 | ||
142 | /* only unmasked interrupts kick us out of idle */ | 188 | /* only unmasked interrupts kick us out of idle */ |
143 | ICCR = 1; | 189 | __raw_writel(1, irq_base(0) + ICCR); |
144 | |||
145 | for (irq = PXA_IRQ(0); irq < PXA_IRQ(irq_nr); irq++) { | ||
146 | set_irq_chip(irq, &pxa_internal_irq_chip); | ||
147 | set_irq_handler(irq, handle_level_irq); | ||
148 | set_irq_flags(irq, IRQF_VALID); | ||
149 | } | ||
150 | 190 | ||
151 | pxa_internal_irq_chip.set_wake = fn; | 191 | pxa_internal_irq_chip.set_wake = fn; |
152 | pxa_init_low_gpio_irq(fn); | 192 | pxa_init_low_gpio_irq(fn); |
@@ -158,16 +198,18 @@ static unsigned long saved_ipr[MAX_INTERNAL_IRQS]; | |||
158 | 198 | ||
159 | static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) | 199 | static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) |
160 | { | 200 | { |
161 | int i, irq = PXA_IRQ(0); | 201 | int i; |
162 | 202 | ||
163 | for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { | 203 | for (i = 0; i < pxa_internal_irq_nr; i += 32) { |
164 | saved_icmr[i] = _ICMR(irq); | 204 | void __iomem *base = irq_base(i); |
165 | _ICMR(irq) = 0; | 205 | |
206 | saved_icmr[i] = __raw_readl(base + ICMR); | ||
207 | __raw_writel(0, base + ICMR); | ||
166 | } | 208 | } |
167 | 209 | ||
168 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { | 210 | if (cpu_has_ipr()) { |
169 | for (i = 0; i < pxa_internal_irq_nr; i++) | 211 | for (i = 0; i < pxa_internal_irq_nr; i++) |
170 | saved_ipr[i] = IPR(i); | 212 | saved_ipr[i] = __raw_readl(IRQ_BASE + IPR(i)); |
171 | } | 213 | } |
172 | 214 | ||
173 | return 0; | 215 | return 0; |
@@ -175,19 +217,20 @@ static int pxa_irq_suspend(struct sys_device *dev, pm_message_t state) | |||
175 | 217 | ||
176 | static int pxa_irq_resume(struct sys_device *dev) | 218 | static int pxa_irq_resume(struct sys_device *dev) |
177 | { | 219 | { |
178 | int i, irq = PXA_IRQ(0); | 220 | int i; |
179 | 221 | ||
180 | if (cpu_is_pxa27x() || cpu_is_pxa3xx()) { | 222 | for (i = 0; i < pxa_internal_irq_nr; i += 32) { |
181 | for (i = 0; i < pxa_internal_irq_nr; i++) | 223 | void __iomem *base = irq_base(i); |
182 | IPR(i) = saved_ipr[i]; | ||
183 | } | ||
184 | 224 | ||
185 | for (i = 0; irq < PXA_IRQ(pxa_internal_irq_nr); i++, irq += 32) { | 225 | __raw_writel(saved_icmr[i], base + ICMR); |
186 | _ICMR(irq) = saved_icmr[i]; | 226 | __raw_writel(0, base + ICLR); |
187 | _ICLR(irq) = 0; | ||
188 | } | 227 | } |
189 | 228 | ||
190 | ICCR = 1; | 229 | if (!cpu_is_pxa25x()) |
230 | for (i = 0; i < pxa_internal_irq_nr; i++) | ||
231 | __raw_writel(saved_ipr[i], IRQ_BASE + IPR(i)); | ||
232 | |||
233 | __raw_writel(1, IRQ_BASE + ICCR); | ||
191 | return 0; | 234 | return 0; |
192 | } | 235 | } |
193 | #else | 236 | #else |
diff --git a/arch/arm/mach-pxa/littleton.c b/arch/arm/mach-pxa/littleton.c index 41aa89e35772..719c260597e7 100644 --- a/arch/arm/mach-pxa/littleton.c +++ b/arch/arm/mach-pxa/littleton.c | |||
@@ -438,7 +438,7 @@ static void __init littleton_init(void) | |||
438 | 438 | ||
439 | MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") | 439 | MACHINE_START(LITTLETON, "Marvell Form Factor Development Platform (aka Littleton)") |
440 | .boot_params = 0xa0000100, | 440 | .boot_params = 0xa0000100, |
441 | .map_io = pxa_map_io, | 441 | .map_io = pxa3xx_map_io, |
442 | .nr_irqs = LITTLETON_NR_IRQS, | 442 | .nr_irqs = LITTLETON_NR_IRQS, |
443 | .init_irq = pxa3xx_init_irq, | 443 | .init_irq = pxa3xx_init_irq, |
444 | .timer = &pxa_timer, | 444 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index 623af0232a54..8ab62a677807 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <mach/mmc.h> | 46 | #include <mach/mmc.h> |
47 | #include <mach/irda.h> | 47 | #include <mach/irda.h> |
48 | #include <mach/ohci.h> | 48 | #include <mach/ohci.h> |
49 | #include <mach/smemc.h> | ||
49 | 50 | ||
50 | #include "generic.h" | 51 | #include "generic.h" |
51 | #include "devices.h" | 52 | #include "devices.h" |
@@ -463,7 +464,7 @@ static void __init lpd270_init(void) | |||
463 | pxa_set_btuart_info(NULL); | 464 | pxa_set_btuart_info(NULL); |
464 | pxa_set_stuart_info(NULL); | 465 | pxa_set_stuart_info(NULL); |
465 | 466 | ||
466 | lpd270_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; | 467 | lpd270_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4; |
467 | lpd270_flash_data[1].width = 4; | 468 | lpd270_flash_data[1].width = 4; |
468 | 469 | ||
469 | /* | 470 | /* |
@@ -495,7 +496,7 @@ static struct map_desc lpd270_io_desc[] __initdata = { | |||
495 | 496 | ||
496 | static void __init lpd270_map_io(void) | 497 | static void __init lpd270_map_io(void) |
497 | { | 498 | { |
498 | pxa_map_io(); | 499 | pxa27x_map_io(); |
499 | iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc)); | 500 | iotable_init(lpd270_io_desc, ARRAY_SIZE(lpd270_io_desc)); |
500 | 501 | ||
501 | /* for use I SRAM as framebuffer. */ | 502 | /* for use I SRAM as framebuffer. */ |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 1499493cd070..d3375486c8cd 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #include <mach/pxafb.h> | 50 | #include <mach/pxafb.h> |
51 | #include <mach/mmc.h> | 51 | #include <mach/mmc.h> |
52 | #include <mach/pm.h> | 52 | #include <mach/pm.h> |
53 | #include <mach/smemc.h> | ||
53 | 54 | ||
54 | #include "generic.h" | 55 | #include "generic.h" |
55 | #include "clock.h" | 56 | #include "clock.h" |
@@ -525,7 +526,7 @@ static void __init lubbock_init(void) | |||
525 | pxa_set_ac97_info(NULL); | 526 | pxa_set_ac97_info(NULL); |
526 | 527 | ||
527 | lubbock_flash_data[0].width = lubbock_flash_data[1].width = | 528 | lubbock_flash_data[0].width = lubbock_flash_data[1].width = |
528 | (BOOT_DEF & 1) ? 2 : 4; | 529 | (__raw_readl(BOOT_DEF) & 1) ? 2 : 4; |
529 | /* Compensate for the nROMBT switch which swaps the flash banks */ | 530 | /* Compensate for the nROMBT switch which swaps the flash banks */ |
530 | printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n", | 531 | printk(KERN_NOTICE "Lubbock configured to boot from %s (bank %d)\n", |
531 | flashboot?"Flash":"ROM", flashboot); | 532 | flashboot?"Flash":"ROM", flashboot); |
@@ -549,7 +550,7 @@ static struct map_desc lubbock_io_desc[] __initdata = { | |||
549 | 550 | ||
550 | static void __init lubbock_map_io(void) | 551 | static void __init lubbock_map_io(void) |
551 | { | 552 | { |
552 | pxa_map_io(); | 553 | pxa25x_map_io(); |
553 | iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc)); | 554 | iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc)); |
554 | 555 | ||
555 | PCFR |= PCFR_OPDE; | 556 | PCFR |= PCFR_OPDE; |
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c index 90663760307a..41198f0dc3ac 100644 --- a/arch/arm/mach-pxa/magician.c +++ b/arch/arm/mach-pxa/magician.c | |||
@@ -765,7 +765,7 @@ static void __init magician_init(void) | |||
765 | 765 | ||
766 | MACHINE_START(MAGICIAN, "HTC Magician") | 766 | MACHINE_START(MAGICIAN, "HTC Magician") |
767 | .boot_params = 0xa0000100, | 767 | .boot_params = 0xa0000100, |
768 | .map_io = pxa_map_io, | 768 | .map_io = pxa27x_map_io, |
769 | .nr_irqs = MAGICIAN_NR_IRQS, | 769 | .nr_irqs = MAGICIAN_NR_IRQS, |
770 | .init_irq = pxa27x_init_irq, | 770 | .init_irq = pxa27x_init_irq, |
771 | .init_machine = magician_init, | 771 | .init_machine = magician_init, |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index a980a5c93e49..740c03590e3b 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -51,6 +51,7 @@ | |||
51 | #include <mach/irda.h> | 51 | #include <mach/irda.h> |
52 | #include <mach/ohci.h> | 52 | #include <mach/ohci.h> |
53 | #include <plat/pxa27x_keypad.h> | 53 | #include <plat/pxa27x_keypad.h> |
54 | #include <mach/smemc.h> | ||
54 | 55 | ||
55 | #include "generic.h" | 56 | #include "generic.h" |
56 | #include "devices.h" | 57 | #include "devices.h" |
@@ -565,7 +566,7 @@ static void __init mainstone_init(void) | |||
565 | pxa_set_btuart_info(NULL); | 566 | pxa_set_btuart_info(NULL); |
566 | pxa_set_stuart_info(NULL); | 567 | pxa_set_stuart_info(NULL); |
567 | 568 | ||
568 | mst_flash_data[0].width = (BOOT_DEF & 1) ? 2 : 4; | 569 | mst_flash_data[0].width = (__raw_readl(BOOT_DEF) & 1) ? 2 : 4; |
569 | mst_flash_data[1].width = 4; | 570 | mst_flash_data[1].width = 4; |
570 | 571 | ||
571 | /* Compensate for SW7 which swaps the flash banks */ | 572 | /* Compensate for SW7 which swaps the flash banks */ |
@@ -614,7 +615,7 @@ static struct map_desc mainstone_io_desc[] __initdata = { | |||
614 | 615 | ||
615 | static void __init mainstone_map_io(void) | 616 | static void __init mainstone_map_io(void) |
616 | { | 617 | { |
617 | pxa_map_io(); | 618 | pxa27x_map_io(); |
618 | iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc)); | 619 | iotable_init(mainstone_io_desc, ARRAY_SIZE(mainstone_io_desc)); |
619 | 620 | ||
620 | /* for use I SRAM as framebuffer. */ | 621 | /* for use I SRAM as framebuffer. */ |
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index f5fb915e1315..faafea3542fb 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c | |||
@@ -819,7 +819,7 @@ static void mioa701_machine_exit(void) | |||
819 | 819 | ||
820 | MACHINE_START(MIOA701, "MIO A701") | 820 | MACHINE_START(MIOA701, "MIO A701") |
821 | .boot_params = 0xa0000100, | 821 | .boot_params = 0xa0000100, |
822 | .map_io = &pxa_map_io, | 822 | .map_io = &pxa27x_map_io, |
823 | .init_irq = &pxa27x_init_irq, | 823 | .init_irq = &pxa27x_init_irq, |
824 | .init_machine = mioa701_machine_init, | 824 | .init_machine = mioa701_machine_init, |
825 | .timer = &pxa_timer, | 825 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/mp900.c b/arch/arm/mach-pxa/mp900.c index 116167aaba68..59cce78aebd1 100644 --- a/arch/arm/mach-pxa/mp900.c +++ b/arch/arm/mach-pxa/mp900.c | |||
@@ -94,7 +94,7 @@ static void __init mp900c_init(void) | |||
94 | MACHINE_START(NEC_MP900, "MobilePro900/C") | 94 | MACHINE_START(NEC_MP900, "MobilePro900/C") |
95 | .boot_params = 0xa0220100, | 95 | .boot_params = 0xa0220100, |
96 | .timer = &pxa_timer, | 96 | .timer = &pxa_timer, |
97 | .map_io = pxa_map_io, | 97 | .map_io = pxa25x_map_io, |
98 | .init_irq = pxa25x_init_irq, | 98 | .init_irq = pxa25x_init_irq, |
99 | .init_machine = mp900c_init, | 99 | .init_machine = mp900c_init, |
100 | MACHINE_END | 100 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/palmld.c b/arch/arm/mach-pxa/palmld.c index ce092c521e6d..a6f898cbfac9 100644 --- a/arch/arm/mach-pxa/palmld.c +++ b/arch/arm/mach-pxa/palmld.c | |||
@@ -313,7 +313,7 @@ static struct map_desc palmld_io_desc[] __initdata = { | |||
313 | 313 | ||
314 | static void __init palmld_map_io(void) | 314 | static void __init palmld_map_io(void) |
315 | { | 315 | { |
316 | pxa_map_io(); | 316 | pxa27x_map_io(); |
317 | iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc)); | 317 | iotable_init(palmld_io_desc, ARRAY_SIZE(palmld_io_desc)); |
318 | } | 318 | } |
319 | 319 | ||
diff --git a/arch/arm/mach-pxa/palmt5.c b/arch/arm/mach-pxa/palmt5.c index 862da812cd10..df4d7d009fbb 100644 --- a/arch/arm/mach-pxa/palmt5.c +++ b/arch/arm/mach-pxa/palmt5.c | |||
@@ -203,7 +203,7 @@ static void __init palmt5_init(void) | |||
203 | 203 | ||
204 | MACHINE_START(PALMT5, "Palm Tungsten|T5") | 204 | MACHINE_START(PALMT5, "Palm Tungsten|T5") |
205 | .boot_params = 0xa0000100, | 205 | .boot_params = 0xa0000100, |
206 | .map_io = pxa_map_io, | 206 | .map_io = pxa27x_map_io, |
207 | .reserve = palmt5_reserve, | 207 | .reserve = palmt5_reserve, |
208 | .init_irq = pxa27x_init_irq, | 208 | .init_irq = pxa27x_init_irq, |
209 | .timer = &pxa_timer, | 209 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/palmtc.c b/arch/arm/mach-pxa/palmtc.c index 2131d5860919..a09a2374697b 100644 --- a/arch/arm/mach-pxa/palmtc.c +++ b/arch/arm/mach-pxa/palmtc.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/power_supply.h> | 25 | #include <linux/power_supply.h> |
26 | #include <linux/gpio_keys.h> | 26 | #include <linux/gpio_keys.h> |
27 | #include <linux/mtd/physmap.h> | 27 | #include <linux/mtd/physmap.h> |
28 | #include <linux/usb/gpio_vbus.h> | ||
28 | 29 | ||
29 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
30 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
@@ -116,6 +117,7 @@ static unsigned long palmtc_pin_config[] __initdata = { | |||
116 | /****************************************************************************** | 117 | /****************************************************************************** |
117 | * SD/MMC card controller | 118 | * SD/MMC card controller |
118 | ******************************************************************************/ | 119 | ******************************************************************************/ |
120 | #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE) | ||
119 | static struct pxamci_platform_data palmtc_mci_platform_data = { | 121 | static struct pxamci_platform_data palmtc_mci_platform_data = { |
120 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, | 122 | .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, |
121 | .gpio_power = GPIO_NR_PALMTC_SD_POWER, | 123 | .gpio_power = GPIO_NR_PALMTC_SD_POWER, |
@@ -124,9 +126,18 @@ static struct pxamci_platform_data palmtc_mci_platform_data = { | |||
124 | .detect_delay_ms = 200, | 126 | .detect_delay_ms = 200, |
125 | }; | 127 | }; |
126 | 128 | ||
129 | static void __init palmtc_mmc_init(void) | ||
130 | { | ||
131 | pxa_set_mci_info(&palmtc_mci_platform_data); | ||
132 | } | ||
133 | #else | ||
134 | static inline void palmtc_mmc_init(void) {} | ||
135 | #endif | ||
136 | |||
127 | /****************************************************************************** | 137 | /****************************************************************************** |
128 | * GPIO keys | 138 | * GPIO keys |
129 | ******************************************************************************/ | 139 | ******************************************************************************/ |
140 | #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) | ||
130 | static struct gpio_keys_button palmtc_pxa_buttons[] = { | 141 | static struct gpio_keys_button palmtc_pxa_buttons[] = { |
131 | {KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1}, | 142 | {KEY_F8, GPIO_NR_PALMTC_HOTSYNC_BUTTON, 1, "HotSync Button", EV_KEY, 1}, |
132 | }; | 143 | }; |
@@ -144,9 +155,18 @@ static struct platform_device palmtc_pxa_keys = { | |||
144 | }, | 155 | }, |
145 | }; | 156 | }; |
146 | 157 | ||
158 | static void __init palmtc_keys_init(void) | ||
159 | { | ||
160 | platform_device_register(&palmtc_pxa_keys); | ||
161 | } | ||
162 | #else | ||
163 | static inline void palmtc_keys_init(void) {} | ||
164 | #endif | ||
165 | |||
147 | /****************************************************************************** | 166 | /****************************************************************************** |
148 | * Backlight | 167 | * Backlight |
149 | ******************************************************************************/ | 168 | ******************************************************************************/ |
169 | #if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM_MODULE) | ||
150 | static int palmtc_backlight_init(struct device *dev) | 170 | static int palmtc_backlight_init(struct device *dev) |
151 | { | 171 | { |
152 | int ret; | 172 | int ret; |
@@ -196,17 +216,35 @@ static struct platform_device palmtc_backlight = { | |||
196 | }, | 216 | }, |
197 | }; | 217 | }; |
198 | 218 | ||
219 | static void __init palmtc_pwm_init(void) | ||
220 | { | ||
221 | platform_device_register(&palmtc_backlight); | ||
222 | } | ||
223 | #else | ||
224 | static inline void palmtc_pwm_init(void) {} | ||
225 | #endif | ||
226 | |||
199 | /****************************************************************************** | 227 | /****************************************************************************** |
200 | * IrDA | 228 | * IrDA |
201 | ******************************************************************************/ | 229 | ******************************************************************************/ |
230 | #if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE) | ||
202 | static struct pxaficp_platform_data palmtc_ficp_platform_data = { | 231 | static struct pxaficp_platform_data palmtc_ficp_platform_data = { |
203 | .gpio_pwdown = GPIO_NR_PALMTC_IR_DISABLE, | 232 | .gpio_pwdown = GPIO_NR_PALMTC_IR_DISABLE, |
204 | .transceiver_cap = IR_SIRMODE | IR_OFF, | 233 | .transceiver_cap = IR_SIRMODE | IR_OFF, |
205 | }; | 234 | }; |
206 | 235 | ||
236 | static void __init palmtc_irda_init(void) | ||
237 | { | ||
238 | pxa_set_ficp_info(&palmtc_ficp_platform_data); | ||
239 | } | ||
240 | #else | ||
241 | static inline void palmtc_irda_init(void) {} | ||
242 | #endif | ||
243 | |||
207 | /****************************************************************************** | 244 | /****************************************************************************** |
208 | * Keyboard | 245 | * Keyboard |
209 | ******************************************************************************/ | 246 | ******************************************************************************/ |
247 | #if defined(CONFIG_KEYBOARD_MATRIX) || defined(CONFIG_KEYBOARD_MATRIX_MODULE) | ||
210 | static const uint32_t palmtc_matrix_keys[] = { | 248 | static const uint32_t palmtc_matrix_keys[] = { |
211 | KEY(0, 0, KEY_F1), | 249 | KEY(0, 0, KEY_F1), |
212 | KEY(0, 1, KEY_X), | 250 | KEY(0, 1, KEY_X), |
@@ -290,27 +328,103 @@ static struct platform_device palmtc_keyboard = { | |||
290 | .platform_data = &palmtc_keypad_platform_data, | 328 | .platform_data = &palmtc_keypad_platform_data, |
291 | }, | 329 | }, |
292 | }; | 330 | }; |
331 | static void __init palmtc_mkp_init(void) | ||
332 | { | ||
333 | platform_device_register(&palmtc_keyboard); | ||
334 | } | ||
335 | #else | ||
336 | static inline void palmtc_mkp_init(void) {} | ||
337 | #endif | ||
293 | 338 | ||
294 | /****************************************************************************** | 339 | /****************************************************************************** |
295 | * UDC | 340 | * UDC |
296 | ******************************************************************************/ | 341 | ******************************************************************************/ |
297 | static struct pxa2xx_udc_mach_info palmtc_udc_info __initdata = { | 342 | #if defined(CONFIG_USB_GADGET_PXA25X)||defined(CONFIG_USB_GADGET_PXA25X_MODULE) |
343 | static struct gpio_vbus_mach_info palmtc_udc_info = { | ||
298 | .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, | 344 | .gpio_vbus = GPIO_NR_PALMTC_USB_DETECT_N, |
299 | .gpio_vbus_inverted = 1, | 345 | .gpio_vbus_inverted = 1, |
300 | .gpio_pullup = GPIO_NR_PALMTC_USB_POWER, | 346 | .gpio_pullup = GPIO_NR_PALMTC_USB_POWER, |
301 | }; | 347 | }; |
302 | 348 | ||
349 | static struct platform_device palmtc_gpio_vbus = { | ||
350 | .name = "gpio-vbus", | ||
351 | .id = -1, | ||
352 | .dev = { | ||
353 | .platform_data = &palmtc_udc_info, | ||
354 | }, | ||
355 | }; | ||
356 | |||
357 | static void __init palmtc_udc_init(void) | ||
358 | { | ||
359 | platform_device_register(&palmtc_gpio_vbus); | ||
360 | }; | ||
361 | #else | ||
362 | static inline void palmtc_udc_init(void) {} | ||
363 | #endif | ||
364 | |||
303 | /****************************************************************************** | 365 | /****************************************************************************** |
304 | * Touchscreen / Battery / GPIO-extender | 366 | * Touchscreen / Battery / GPIO-extender |
305 | ******************************************************************************/ | 367 | ******************************************************************************/ |
306 | static struct platform_device palmtc_ucb1400_core = { | 368 | #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \ |
369 | defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE) | ||
370 | static struct platform_device palmtc_ucb1400_device = { | ||
307 | .name = "ucb1400_core", | 371 | .name = "ucb1400_core", |
308 | .id = -1, | 372 | .id = -1, |
309 | }; | 373 | }; |
310 | 374 | ||
375 | static void __init palmtc_ts_init(void) | ||
376 | { | ||
377 | pxa_set_ac97_info(NULL); | ||
378 | platform_device_register(&palmtc_ucb1400_device); | ||
379 | } | ||
380 | #else | ||
381 | static inline void palmtc_ts_init(void) {} | ||
382 | #endif | ||
383 | |||
384 | /****************************************************************************** | ||
385 | * LEDs | ||
386 | ******************************************************************************/ | ||
387 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) | ||
388 | struct gpio_led palmtc_gpio_leds[] = { | ||
389 | { | ||
390 | .name = "palmtc:green:user", | ||
391 | .default_trigger = "none", | ||
392 | .gpio = GPIO_NR_PALMTC_LED_POWER, | ||
393 | .active_low = 1, | ||
394 | }, { | ||
395 | .name = "palmtc:vibra:vibra", | ||
396 | .default_trigger = "none", | ||
397 | .gpio = GPIO_NR_PALMTC_VIBRA_POWER, | ||
398 | .active_low = 1, | ||
399 | } | ||
400 | |||
401 | }; | ||
402 | |||
403 | static struct gpio_led_platform_data palmtc_gpio_led_info = { | ||
404 | .leds = palmtc_gpio_leds, | ||
405 | .num_leds = ARRAY_SIZE(palmtc_gpio_leds), | ||
406 | }; | ||
407 | |||
408 | static struct platform_device palmtc_leds = { | ||
409 | .name = "leds-gpio", | ||
410 | .id = -1, | ||
411 | .dev = { | ||
412 | .platform_data = &palmtc_gpio_led_info, | ||
413 | } | ||
414 | }; | ||
415 | |||
416 | static void __init palmtc_leds_init(void) | ||
417 | { | ||
418 | platform_device_register(&palmtc_leds); | ||
419 | } | ||
420 | #else | ||
421 | static inline void palmtc_leds_init(void) {} | ||
422 | #endif | ||
423 | |||
311 | /****************************************************************************** | 424 | /****************************************************************************** |
312 | * NOR Flash | 425 | * NOR Flash |
313 | ******************************************************************************/ | 426 | ******************************************************************************/ |
427 | #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE) | ||
314 | static struct resource palmtc_flash_resource = { | 428 | static struct resource palmtc_flash_resource = { |
315 | .start = PXA_CS0_PHYS, | 429 | .start = PXA_CS0_PHYS, |
316 | .end = PXA_CS0_PHYS + SZ_16M - 1, | 430 | .end = PXA_CS0_PHYS + SZ_16M - 1, |
@@ -356,24 +470,33 @@ static struct platform_device palmtc_flash = { | |||
356 | }, | 470 | }, |
357 | }; | 471 | }; |
358 | 472 | ||
473 | static void __init palmtc_nor_init(void) | ||
474 | { | ||
475 | platform_device_register(&palmtc_flash); | ||
476 | } | ||
477 | #else | ||
478 | static inline void palmtc_nor_init(void) {} | ||
479 | #endif | ||
480 | |||
359 | /****************************************************************************** | 481 | /****************************************************************************** |
360 | * Framebuffer | 482 | * Framebuffer |
361 | ******************************************************************************/ | 483 | ******************************************************************************/ |
484 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
362 | static struct pxafb_mode_info palmtc_lcd_modes[] = { | 485 | static struct pxafb_mode_info palmtc_lcd_modes[] = { |
363 | { | 486 | { |
364 | .pixclock = 115384, | 487 | .pixclock = 115384, |
365 | .xres = 320, | 488 | .xres = 320, |
366 | .yres = 320, | 489 | .yres = 320, |
367 | .bpp = 16, | 490 | .bpp = 16, |
368 | 491 | ||
369 | .left_margin = 27, | 492 | .left_margin = 27, |
370 | .right_margin = 7, | 493 | .right_margin = 7, |
371 | .upper_margin = 7, | 494 | .upper_margin = 7, |
372 | .lower_margin = 8, | 495 | .lower_margin = 8, |
373 | 496 | ||
374 | .hsync_len = 6, | 497 | .hsync_len = 6, |
375 | .vsync_len = 1, | 498 | .vsync_len = 1, |
376 | }, | 499 | }, |
377 | }; | 500 | }; |
378 | 501 | ||
379 | static struct pxafb_mach_info palmtc_lcd_screen = { | 502 | static struct pxafb_mach_info palmtc_lcd_screen = { |
@@ -382,17 +505,17 @@ static struct pxafb_mach_info palmtc_lcd_screen = { | |||
382 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 505 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
383 | }; | 506 | }; |
384 | 507 | ||
508 | static void __init palmtc_lcd_init(void) | ||
509 | { | ||
510 | set_pxa_fb_info(&palmtc_lcd_screen); | ||
511 | } | ||
512 | #else | ||
513 | static inline void palmtc_lcd_init(void) {} | ||
514 | #endif | ||
515 | |||
385 | /****************************************************************************** | 516 | /****************************************************************************** |
386 | * Machine init | 517 | * Machine init |
387 | ******************************************************************************/ | 518 | ******************************************************************************/ |
388 | static struct platform_device *devices[] __initdata = { | ||
389 | &palmtc_backlight, | ||
390 | &palmtc_ucb1400_core, | ||
391 | &palmtc_keyboard, | ||
392 | &palmtc_pxa_keys, | ||
393 | &palmtc_flash, | ||
394 | }; | ||
395 | |||
396 | static void __init palmtc_init(void) | 519 | static void __init palmtc_init(void) |
397 | { | 520 | { |
398 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); | 521 | pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtc_pin_config)); |
@@ -402,18 +525,21 @@ static void __init palmtc_init(void) | |||
402 | pxa_set_stuart_info(NULL); | 525 | pxa_set_stuart_info(NULL); |
403 | pxa_set_hwuart_info(NULL); | 526 | pxa_set_hwuart_info(NULL); |
404 | 527 | ||
405 | set_pxa_fb_info(&palmtc_lcd_screen); | 528 | palmtc_mmc_init(); |
406 | pxa_set_mci_info(&palmtc_mci_platform_data); | 529 | palmtc_keys_init(); |
407 | pxa_set_udc_info(&palmtc_udc_info); | 530 | palmtc_pwm_init(); |
408 | pxa_set_ac97_info(NULL); | 531 | palmtc_irda_init(); |
409 | pxa_set_ficp_info(&palmtc_ficp_platform_data); | 532 | palmtc_mkp_init(); |
410 | 533 | palmtc_udc_init(); | |
411 | platform_add_devices(devices, ARRAY_SIZE(devices)); | 534 | palmtc_ts_init(); |
535 | palmtc_nor_init(); | ||
536 | palmtc_lcd_init(); | ||
537 | palmtc_leds_init(); | ||
412 | }; | 538 | }; |
413 | 539 | ||
414 | MACHINE_START(PALMTC, "Palm Tungsten|C") | 540 | MACHINE_START(PALMTC, "Palm Tungsten|C") |
415 | .boot_params = 0xa0000100, | 541 | .boot_params = 0xa0000100, |
416 | .map_io = pxa_map_io, | 542 | .map_io = pxa25x_map_io, |
417 | .init_irq = pxa25x_init_irq, | 543 | .init_irq = pxa25x_init_irq, |
418 | .timer = &pxa_timer, | 544 | .timer = &pxa_timer, |
419 | .init_machine = palmtc_init | 545 | .init_machine = palmtc_init |
diff --git a/arch/arm/mach-pxa/palmte2.c b/arch/arm/mach-pxa/palmte2.c index a9dae7bc35d9..3f25014a136c 100644 --- a/arch/arm/mach-pxa/palmte2.c +++ b/arch/arm/mach-pxa/palmte2.c | |||
@@ -374,7 +374,7 @@ static void __init palmte2_init(void) | |||
374 | 374 | ||
375 | MACHINE_START(PALMTE2, "Palm Tungsten|E2") | 375 | MACHINE_START(PALMTE2, "Palm Tungsten|E2") |
376 | .boot_params = 0xa0000100, | 376 | .boot_params = 0xa0000100, |
377 | .map_io = pxa_map_io, | 377 | .map_io = pxa25x_map_io, |
378 | .init_irq = pxa25x_init_irq, | 378 | .init_irq = pxa25x_init_irq, |
379 | .timer = &pxa_timer, | 379 | .timer = &pxa_timer, |
380 | .init_machine = palmte2_init | 380 | .init_machine = palmte2_init |
diff --git a/arch/arm/mach-pxa/palmtreo.c b/arch/arm/mach-pxa/palmtreo.c index 00e2d7ba84ed..8aadad55fbe4 100644 --- a/arch/arm/mach-pxa/palmtreo.c +++ b/arch/arm/mach-pxa/palmtreo.c | |||
@@ -442,7 +442,7 @@ static void __init centro_init(void) | |||
442 | 442 | ||
443 | MACHINE_START(TREO680, "Palm Treo 680") | 443 | MACHINE_START(TREO680, "Palm Treo 680") |
444 | .boot_params = 0xa0000100, | 444 | .boot_params = 0xa0000100, |
445 | .map_io = pxa_map_io, | 445 | .map_io = pxa27x_map_io, |
446 | .reserve = treo_reserve, | 446 | .reserve = treo_reserve, |
447 | .init_irq = pxa27x_init_irq, | 447 | .init_irq = pxa27x_init_irq, |
448 | .timer = &pxa_timer, | 448 | .timer = &pxa_timer, |
@@ -451,7 +451,7 @@ MACHINE_END | |||
451 | 451 | ||
452 | MACHINE_START(CENTRO, "Palm Centro 685") | 452 | MACHINE_START(CENTRO, "Palm Centro 685") |
453 | .boot_params = 0xa0000100, | 453 | .boot_params = 0xa0000100, |
454 | .map_io = pxa_map_io, | 454 | .map_io = pxa27x_map_io, |
455 | .reserve = treo_reserve, | 455 | .reserve = treo_reserve, |
456 | .init_irq = pxa27x_init_irq, | 456 | .init_irq = pxa27x_init_irq, |
457 | .timer = &pxa_timer, | 457 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index d2060a1d1d68..595f002066cc 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c | |||
@@ -241,7 +241,8 @@ static inline void palmtx_keys_init(void) {} | |||
241 | /****************************************************************************** | 241 | /****************************************************************************** |
242 | * NAND Flash | 242 | * NAND Flash |
243 | ******************************************************************************/ | 243 | ******************************************************************************/ |
244 | #if defined(CONFIG_MTD_NAND_GPIO) || defined(CONFIG_MTD_NAND_GPIO_MODULE) | 244 | #if defined(CONFIG_MTD_NAND_PLATFORM) || \ |
245 | defined(CONFIG_MTD_NAND_PLATFORM_MODULE) | ||
245 | static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd, | 246 | static void palmtx_nand_cmd_ctl(struct mtd_info *mtd, int cmd, |
246 | unsigned int ctrl) | 247 | unsigned int ctrl) |
247 | { | 248 | { |
@@ -333,7 +334,7 @@ static struct map_desc palmtx_io_desc[] __initdata = { | |||
333 | 334 | ||
334 | static void __init palmtx_map_io(void) | 335 | static void __init palmtx_map_io(void) |
335 | { | 336 | { |
336 | pxa_map_io(); | 337 | pxa27x_map_io(); |
337 | iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); | 338 | iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); |
338 | } | 339 | } |
339 | 340 | ||
diff --git a/arch/arm/mach-pxa/palmz72.c b/arch/arm/mach-pxa/palmz72.c index af6203fbca9c..7bf4017326e3 100644 --- a/arch/arm/mach-pxa/palmz72.c +++ b/arch/arm/mach-pxa/palmz72.c | |||
@@ -280,7 +280,7 @@ static void __init palmz72_init(void) | |||
280 | 280 | ||
281 | MACHINE_START(PALMZ72, "Palm Zire72") | 281 | MACHINE_START(PALMZ72, "Palm Zire72") |
282 | .boot_params = 0xa0000100, | 282 | .boot_params = 0xa0000100, |
283 | .map_io = pxa_map_io, | 283 | .map_io = pxa27x_map_io, |
284 | .init_irq = pxa27x_init_irq, | 284 | .init_irq = pxa27x_init_irq, |
285 | .timer = &pxa_timer, | 285 | .timer = &pxa_timer, |
286 | .init_machine = palmz72_init | 286 | .init_machine = palmz72_init |
diff --git a/arch/arm/mach-pxa/pcm027.c b/arch/arm/mach-pxa/pcm027.c index c77e8f30a439..8547c9abc40a 100644 --- a/arch/arm/mach-pxa/pcm027.c +++ b/arch/arm/mach-pxa/pcm027.c | |||
@@ -244,7 +244,7 @@ static void __init pcm027_init(void) | |||
244 | 244 | ||
245 | static void __init pcm027_map_io(void) | 245 | static void __init pcm027_map_io(void) |
246 | { | 246 | { |
247 | pxa_map_io(); | 247 | pxa27x_map_io(); |
248 | 248 | ||
249 | /* initialize sleep mode regs (wake-up sources, etc) */ | 249 | /* initialize sleep mode regs (wake-up sources, etc) */ |
250 | PGSR0 = 0x01308000; | 250 | PGSR0 = 0x01308000; |
diff --git a/arch/arm/mach-pxa/poodle.c b/arch/arm/mach-pxa/poodle.c index 93a191c889df..8451790cb48d 100644 --- a/arch/arm/mach-pxa/poodle.c +++ b/arch/arm/mach-pxa/poodle.c | |||
@@ -466,7 +466,7 @@ static void __init fixup_poodle(struct machine_desc *desc, | |||
466 | 466 | ||
467 | MACHINE_START(POODLE, "SHARP Poodle") | 467 | MACHINE_START(POODLE, "SHARP Poodle") |
468 | .fixup = fixup_poodle, | 468 | .fixup = fixup_poodle, |
469 | .map_io = pxa_map_io, | 469 | .map_io = pxa25x_map_io, |
470 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ | 470 | .nr_irqs = POODLE_NR_IRQS, /* 4 for LoCoMo */ |
471 | .init_irq = pxa25x_init_irq, | 471 | .init_irq = pxa25x_init_irq, |
472 | .timer = &pxa_timer, | 472 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index de53f2e4aa39..3f5241c84894 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/suspend.h> | 23 | #include <linux/suspend.h> |
24 | #include <linux/sysdev.h> | 24 | #include <linux/sysdev.h> |
25 | 25 | ||
26 | #include <asm/mach/map.h> | ||
26 | #include <mach/hardware.h> | 27 | #include <mach/hardware.h> |
27 | #include <mach/irqs.h> | 28 | #include <mach/irqs.h> |
28 | #include <mach/gpio.h> | 29 | #include <mach/gpio.h> |
@@ -30,6 +31,7 @@ | |||
30 | #include <mach/reset.h> | 31 | #include <mach/reset.h> |
31 | #include <mach/pm.h> | 32 | #include <mach/pm.h> |
32 | #include <mach/dma.h> | 33 | #include <mach/dma.h> |
34 | #include <mach/smemc.h> | ||
33 | 35 | ||
34 | #include "generic.h" | 36 | #include "generic.h" |
35 | #include "devices.h" | 37 | #include "devices.h" |
@@ -90,23 +92,21 @@ unsigned int pxa25x_get_clk_frequency_khz(int info) | |||
90 | return (turbo & 1) ? (N/1000) : (M/1000); | 92 | return (turbo & 1) ? (N/1000) : (M/1000); |
91 | } | 93 | } |
92 | 94 | ||
93 | /* | 95 | static unsigned long clk_pxa25x_mem_getrate(struct clk *clk) |
94 | * Return the current memory clock frequency in units of 10kHz | ||
95 | */ | ||
96 | unsigned int pxa25x_get_memclk_frequency_10khz(void) | ||
97 | { | 96 | { |
98 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK / 10000; | 97 | return L_clk_mult[(CCCR >> 0) & 0x1f] * BASE_CLK; |
99 | } | 98 | } |
100 | 99 | ||
101 | static unsigned long clk_pxa25x_lcd_getrate(struct clk *clk) | 100 | static const struct clkops clk_pxa25x_mem_ops = { |
102 | { | 101 | .enable = clk_dummy_enable, |
103 | return pxa25x_get_memclk_frequency_10khz() * 10000; | 102 | .disable = clk_dummy_disable, |
104 | } | 103 | .getrate = clk_pxa25x_mem_getrate, |
104 | }; | ||
105 | 105 | ||
106 | static const struct clkops clk_pxa25x_lcd_ops = { | 106 | static const struct clkops clk_pxa25x_lcd_ops = { |
107 | .enable = clk_cken_enable, | 107 | .enable = clk_pxa2xx_cken_enable, |
108 | .disable = clk_cken_disable, | 108 | .disable = clk_pxa2xx_cken_disable, |
109 | .getrate = clk_pxa25x_lcd_getrate, | 109 | .getrate = clk_pxa25x_mem_getrate, |
110 | }; | 110 | }; |
111 | 111 | ||
112 | static unsigned long gpio12_config_32k[] = { | 112 | static unsigned long gpio12_config_32k[] = { |
@@ -160,31 +160,30 @@ static const struct clkops clk_pxa25x_gpio11_ops = { | |||
160 | * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz | 160 | * 95.842MHz -> MMC 19.169MHz, I2C 31.949MHz, FICP 47.923MHz, USB 47.923MHz |
161 | * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly) | 161 | * 147.456MHz -> UART 14.7456MHz, AC97 12.288MHz, I2S 5.672MHz (allegedly) |
162 | */ | 162 | */ |
163 | static DEFINE_CKEN(pxa25x_hwuart, HWUART, 14745600, 1); | ||
164 | |||
165 | static struct clk_lookup pxa25x_hwuart_clkreg = | ||
166 | INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL); | ||
167 | 163 | ||
168 | /* | 164 | /* |
169 | * PXA 2xx clock declarations. | 165 | * PXA 2xx clock declarations. |
170 | */ | 166 | */ |
167 | static DEFINE_PXA2_CKEN(pxa25x_hwuart, HWUART, 14745600, 1); | ||
168 | static DEFINE_PXA2_CKEN(pxa25x_ffuart, FFUART, 14745600, 1); | ||
169 | static DEFINE_PXA2_CKEN(pxa25x_btuart, BTUART, 14745600, 1); | ||
170 | static DEFINE_PXA2_CKEN(pxa25x_stuart, STUART, 14745600, 1); | ||
171 | static DEFINE_PXA2_CKEN(pxa25x_usb, USB, 47923000, 5); | ||
172 | static DEFINE_PXA2_CKEN(pxa25x_mmc, MMC, 19169000, 0); | ||
173 | static DEFINE_PXA2_CKEN(pxa25x_i2c, I2C, 31949000, 0); | ||
174 | static DEFINE_PXA2_CKEN(pxa25x_ssp, SSP, 3686400, 0); | ||
175 | static DEFINE_PXA2_CKEN(pxa25x_nssp, NSSP, 3686400, 0); | ||
176 | static DEFINE_PXA2_CKEN(pxa25x_assp, ASSP, 3686400, 0); | ||
177 | static DEFINE_PXA2_CKEN(pxa25x_pwm0, PWM0, 3686400, 0); | ||
178 | static DEFINE_PXA2_CKEN(pxa25x_pwm1, PWM1, 3686400, 0); | ||
179 | static DEFINE_PXA2_CKEN(pxa25x_ac97, AC97, 24576000, 0); | ||
180 | static DEFINE_PXA2_CKEN(pxa25x_i2s, I2S, 14745600, 0); | ||
181 | static DEFINE_PXA2_CKEN(pxa25x_ficp, FICP, 47923000, 0); | ||
182 | |||
171 | static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); | 183 | static DEFINE_CK(pxa25x_lcd, LCD, &clk_pxa25x_lcd_ops); |
172 | static DEFINE_CKEN(pxa25x_ffuart, FFUART, 14745600, 1); | ||
173 | static DEFINE_CKEN(pxa25x_btuart, BTUART, 14745600, 1); | ||
174 | static DEFINE_CKEN(pxa25x_stuart, STUART, 14745600, 1); | ||
175 | static DEFINE_CKEN(pxa25x_usb, USB, 47923000, 5); | ||
176 | static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); | 184 | static DEFINE_CLK(pxa25x_gpio11, &clk_pxa25x_gpio11_ops, 3686400, 0); |
177 | static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); | 185 | static DEFINE_CLK(pxa25x_gpio12, &clk_pxa25x_gpio12_ops, 32768, 0); |
178 | static DEFINE_CKEN(pxa25x_mmc, MMC, 19169000, 0); | 186 | static DEFINE_CLK(pxa25x_mem, &clk_pxa25x_mem_ops, 0, 0); |
179 | static DEFINE_CKEN(pxa25x_i2c, I2C, 31949000, 0); | ||
180 | static DEFINE_CKEN(pxa25x_ssp, SSP, 3686400, 0); | ||
181 | static DEFINE_CKEN(pxa25x_nssp, NSSP, 3686400, 0); | ||
182 | static DEFINE_CKEN(pxa25x_assp, ASSP, 3686400, 0); | ||
183 | static DEFINE_CKEN(pxa25x_pwm0, PWM0, 3686400, 0); | ||
184 | static DEFINE_CKEN(pxa25x_pwm1, PWM1, 3686400, 0); | ||
185 | static DEFINE_CKEN(pxa25x_ac97, AC97, 24576000, 0); | ||
186 | static DEFINE_CKEN(pxa25x_i2s, I2S, 14745600, 0); | ||
187 | static DEFINE_CKEN(pxa25x_ficp, FICP, 47923000, 0); | ||
188 | 187 | ||
189 | static struct clk_lookup pxa25x_clkregs[] = { | 188 | static struct clk_lookup pxa25x_clkregs[] = { |
190 | INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), | 189 | INIT_CLKREG(&clk_pxa25x_lcd, "pxa2xx-fb", NULL), |
@@ -205,8 +204,12 @@ static struct clk_lookup pxa25x_clkregs[] = { | |||
205 | INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), | 204 | INIT_CLKREG(&clk_pxa25x_ac97, NULL, "AC97CLK"), |
206 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), | 205 | INIT_CLKREG(&clk_pxa25x_gpio11, NULL, "GPIO11_CLK"), |
207 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), | 206 | INIT_CLKREG(&clk_pxa25x_gpio12, NULL, "GPIO12_CLK"), |
207 | INIT_CLKREG(&clk_pxa25x_mem, "pxa2xx-pcmcia", NULL), | ||
208 | }; | 208 | }; |
209 | 209 | ||
210 | static struct clk_lookup pxa25x_hwuart_clkreg = | ||
211 | INIT_CLKREG(&clk_pxa25x_hwuart, "pxa2xx-uart.3", NULL); | ||
212 | |||
210 | #ifdef CONFIG_PM | 213 | #ifdef CONFIG_PM |
211 | 214 | ||
212 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | 215 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x |
@@ -219,20 +222,17 @@ static struct clk_lookup pxa25x_clkregs[] = { | |||
219 | */ | 222 | */ |
220 | enum { | 223 | enum { |
221 | SLEEP_SAVE_PSTR, | 224 | SLEEP_SAVE_PSTR, |
222 | SLEEP_SAVE_CKEN, | ||
223 | SLEEP_SAVE_COUNT | 225 | SLEEP_SAVE_COUNT |
224 | }; | 226 | }; |
225 | 227 | ||
226 | 228 | ||
227 | static void pxa25x_cpu_pm_save(unsigned long *sleep_save) | 229 | static void pxa25x_cpu_pm_save(unsigned long *sleep_save) |
228 | { | 230 | { |
229 | SAVE(CKEN); | ||
230 | SAVE(PSTR); | 231 | SAVE(PSTR); |
231 | } | 232 | } |
232 | 233 | ||
233 | static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) | 234 | static void pxa25x_cpu_pm_restore(unsigned long *sleep_save) |
234 | { | 235 | { |
235 | RESTORE(CKEN); | ||
236 | RESTORE(PSTR); | 236 | RESTORE(PSTR); |
237 | } | 237 | } |
238 | 238 | ||
@@ -320,6 +320,22 @@ void __init pxa26x_init_irq(void) | |||
320 | } | 320 | } |
321 | #endif | 321 | #endif |
322 | 322 | ||
323 | static struct map_desc pxa25x_io_desc[] __initdata = { | ||
324 | { /* Mem Ctl */ | ||
325 | .virtual = SMEMC_VIRT, | ||
326 | .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE), | ||
327 | .length = 0x00200000, | ||
328 | .type = MT_DEVICE | ||
329 | }, | ||
330 | }; | ||
331 | |||
332 | void __init pxa25x_map_io(void) | ||
333 | { | ||
334 | pxa_map_io(); | ||
335 | iotable_init(ARRAY_AND_SIZE(pxa25x_io_desc)); | ||
336 | pxa25x_get_clk_frequency_khz(1); | ||
337 | } | ||
338 | |||
323 | static struct platform_device *pxa25x_devices[] __initdata = { | 339 | static struct platform_device *pxa25x_devices[] __initdata = { |
324 | &pxa25x_device_udc, | 340 | &pxa25x_device_udc, |
325 | &pxa_device_pmu, | 341 | &pxa_device_pmu, |
@@ -339,7 +355,9 @@ static struct sys_device pxa25x_sysdev[] = { | |||
339 | .cls = &pxa2xx_mfp_sysclass, | 355 | .cls = &pxa2xx_mfp_sysclass, |
340 | }, { | 356 | }, { |
341 | .cls = &pxa_gpio_sysclass, | 357 | .cls = &pxa_gpio_sysclass, |
342 | }, | 358 | }, { |
359 | .cls = &pxa2xx_clock_sysclass, | ||
360 | } | ||
343 | }; | 361 | }; |
344 | 362 | ||
345 | static int __init pxa25x_init(void) | 363 | static int __init pxa25x_init(void) |
diff --git a/arch/arm/mach-pxa/pxa27x.c b/arch/arm/mach-pxa/pxa27x.c index d1fbf29d561c..b2130b7a7b52 100644 --- a/arch/arm/mach-pxa/pxa27x.c +++ b/arch/arm/mach-pxa/pxa27x.c | |||
@@ -17,7 +17,9 @@ | |||
17 | #include <linux/suspend.h> | 17 | #include <linux/suspend.h> |
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/io.h> | ||
20 | 21 | ||
22 | #include <asm/mach/map.h> | ||
21 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
22 | #include <asm/irq.h> | 24 | #include <asm/irq.h> |
23 | #include <mach/irqs.h> | 25 | #include <mach/irqs.h> |
@@ -27,6 +29,8 @@ | |||
27 | #include <mach/ohci.h> | 29 | #include <mach/ohci.h> |
28 | #include <mach/pm.h> | 30 | #include <mach/pm.h> |
29 | #include <mach/dma.h> | 31 | #include <mach/dma.h> |
32 | #include <mach/smemc.h> | ||
33 | |||
30 | #include <plat/i2c.h> | 34 | #include <plat/i2c.h> |
31 | 35 | ||
32 | #include "generic.h" | 36 | #include "generic.h" |
@@ -107,10 +111,9 @@ unsigned int pxa27x_get_clk_frequency_khz(int info) | |||
107 | } | 111 | } |
108 | 112 | ||
109 | /* | 113 | /* |
110 | * Return the current mem clock frequency in units of 10kHz as | 114 | * Return the current mem clock frequency as reflected by CCCR[A], B, and L |
111 | * reflected by CCCR[A], B, and L | ||
112 | */ | 115 | */ |
113 | unsigned int pxa27x_get_memclk_frequency_10khz(void) | 116 | static unsigned long clk_pxa27x_mem_getrate(struct clk *clk) |
114 | { | 117 | { |
115 | unsigned long ccsr, clkcfg; | 118 | unsigned long ccsr, clkcfg; |
116 | unsigned int l, L, m, M; | 119 | unsigned int l, L, m, M; |
@@ -129,9 +132,15 @@ unsigned int pxa27x_get_memclk_frequency_10khz(void) | |||
129 | L = l * BASE_CLK; | 132 | L = l * BASE_CLK; |
130 | M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); | 133 | M = (!cccr_a) ? (L/m) : ((b) ? L : (L/2)); |
131 | 134 | ||
132 | return (M / 10000); | 135 | return M; |
133 | } | 136 | } |
134 | 137 | ||
138 | static const struct clkops clk_pxa27x_mem_ops = { | ||
139 | .enable = clk_dummy_enable, | ||
140 | .disable = clk_dummy_disable, | ||
141 | .getrate = clk_pxa27x_mem_getrate, | ||
142 | }; | ||
143 | |||
135 | /* | 144 | /* |
136 | * Return the current LCD clock frequency in units of 10kHz as | 145 | * Return the current LCD clock frequency in units of 10kHz as |
137 | */ | 146 | */ |
@@ -157,36 +166,38 @@ static unsigned long clk_pxa27x_lcd_getrate(struct clk *clk) | |||
157 | } | 166 | } |
158 | 167 | ||
159 | static const struct clkops clk_pxa27x_lcd_ops = { | 168 | static const struct clkops clk_pxa27x_lcd_ops = { |
160 | .enable = clk_cken_enable, | 169 | .enable = clk_pxa2xx_cken_enable, |
161 | .disable = clk_cken_disable, | 170 | .disable = clk_pxa2xx_cken_disable, |
162 | .getrate = clk_pxa27x_lcd_getrate, | 171 | .getrate = clk_pxa27x_lcd_getrate, |
163 | }; | 172 | }; |
164 | 173 | ||
174 | static DEFINE_PXA2_CKEN(pxa27x_ffuart, FFUART, 14857000, 1); | ||
175 | static DEFINE_PXA2_CKEN(pxa27x_btuart, BTUART, 14857000, 1); | ||
176 | static DEFINE_PXA2_CKEN(pxa27x_stuart, STUART, 14857000, 1); | ||
177 | static DEFINE_PXA2_CKEN(pxa27x_i2s, I2S, 14682000, 0); | ||
178 | static DEFINE_PXA2_CKEN(pxa27x_i2c, I2C, 32842000, 0); | ||
179 | static DEFINE_PXA2_CKEN(pxa27x_usb, USB, 48000000, 5); | ||
180 | static DEFINE_PXA2_CKEN(pxa27x_mmc, MMC, 19500000, 0); | ||
181 | static DEFINE_PXA2_CKEN(pxa27x_ficp, FICP, 48000000, 0); | ||
182 | static DEFINE_PXA2_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0); | ||
183 | static DEFINE_PXA2_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0); | ||
184 | static DEFINE_PXA2_CKEN(pxa27x_keypad, KEYPAD, 32768, 0); | ||
185 | static DEFINE_PXA2_CKEN(pxa27x_ssp1, SSP1, 13000000, 0); | ||
186 | static DEFINE_PXA2_CKEN(pxa27x_ssp2, SSP2, 13000000, 0); | ||
187 | static DEFINE_PXA2_CKEN(pxa27x_ssp3, SSP3, 13000000, 0); | ||
188 | static DEFINE_PXA2_CKEN(pxa27x_pwm0, PWM0, 13000000, 0); | ||
189 | static DEFINE_PXA2_CKEN(pxa27x_pwm1, PWM1, 13000000, 0); | ||
190 | static DEFINE_PXA2_CKEN(pxa27x_ac97, AC97, 24576000, 0); | ||
191 | static DEFINE_PXA2_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0); | ||
192 | static DEFINE_PXA2_CKEN(pxa27x_msl, MSL, 48000000, 0); | ||
193 | static DEFINE_PXA2_CKEN(pxa27x_usim, USIM, 48000000, 0); | ||
194 | static DEFINE_PXA2_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0); | ||
195 | static DEFINE_PXA2_CKEN(pxa27x_im, IM, 0, 0); | ||
196 | static DEFINE_PXA2_CKEN(pxa27x_memc, MEMC, 0, 0); | ||
197 | |||
165 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); | 198 | static DEFINE_CK(pxa27x_lcd, LCD, &clk_pxa27x_lcd_ops); |
166 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); | 199 | static DEFINE_CK(pxa27x_camera, CAMERA, &clk_pxa27x_lcd_ops); |
167 | static DEFINE_CKEN(pxa27x_ffuart, FFUART, 14857000, 1); | 200 | static DEFINE_CLK(pxa27x_mem, &clk_pxa27x_mem_ops, 0, 0); |
168 | static DEFINE_CKEN(pxa27x_btuart, BTUART, 14857000, 1); | ||
169 | static DEFINE_CKEN(pxa27x_stuart, STUART, 14857000, 1); | ||
170 | static DEFINE_CKEN(pxa27x_i2s, I2S, 14682000, 0); | ||
171 | static DEFINE_CKEN(pxa27x_i2c, I2C, 32842000, 0); | ||
172 | static DEFINE_CKEN(pxa27x_usb, USB, 48000000, 5); | ||
173 | static DEFINE_CKEN(pxa27x_mmc, MMC, 19500000, 0); | ||
174 | static DEFINE_CKEN(pxa27x_ficp, FICP, 48000000, 0); | ||
175 | static DEFINE_CKEN(pxa27x_usbhost, USBHOST, 48000000, 0); | ||
176 | static DEFINE_CKEN(pxa27x_pwri2c, PWRI2C, 13000000, 0); | ||
177 | static DEFINE_CKEN(pxa27x_keypad, KEYPAD, 32768, 0); | ||
178 | static DEFINE_CKEN(pxa27x_ssp1, SSP1, 13000000, 0); | ||
179 | static DEFINE_CKEN(pxa27x_ssp2, SSP2, 13000000, 0); | ||
180 | static DEFINE_CKEN(pxa27x_ssp3, SSP3, 13000000, 0); | ||
181 | static DEFINE_CKEN(pxa27x_pwm0, PWM0, 13000000, 0); | ||
182 | static DEFINE_CKEN(pxa27x_pwm1, PWM1, 13000000, 0); | ||
183 | static DEFINE_CKEN(pxa27x_ac97, AC97, 24576000, 0); | ||
184 | static DEFINE_CKEN(pxa27x_ac97conf, AC97CONF, 24576000, 0); | ||
185 | static DEFINE_CKEN(pxa27x_msl, MSL, 48000000, 0); | ||
186 | static DEFINE_CKEN(pxa27x_usim, USIM, 48000000, 0); | ||
187 | static DEFINE_CKEN(pxa27x_memstk, MEMSTK, 19500000, 0); | ||
188 | static DEFINE_CKEN(pxa27x_im, IM, 0, 0); | ||
189 | static DEFINE_CKEN(pxa27x_memc, MEMC, 0, 0); | ||
190 | 201 | ||
191 | static struct clk_lookup pxa27x_clkregs[] = { | 202 | static struct clk_lookup pxa27x_clkregs[] = { |
192 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), | 203 | INIT_CLKREG(&clk_pxa27x_lcd, "pxa2xx-fb", NULL), |
@@ -215,6 +226,7 @@ static struct clk_lookup pxa27x_clkregs[] = { | |||
215 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), | 226 | INIT_CLKREG(&clk_pxa27x_memstk, NULL, "MSTKCLK"), |
216 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), | 227 | INIT_CLKREG(&clk_pxa27x_im, NULL, "IMCLK"), |
217 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), | 228 | INIT_CLKREG(&clk_pxa27x_memc, NULL, "MEMCLK"), |
229 | INIT_CLKREG(&clk_pxa27x_mem, "pxa2xx-pcmcia", NULL), | ||
218 | }; | 230 | }; |
219 | 231 | ||
220 | #ifdef CONFIG_PM | 232 | #ifdef CONFIG_PM |
@@ -246,7 +258,6 @@ int __init pxa27x_set_pwrmode(unsigned int mode) | |||
246 | */ | 258 | */ |
247 | enum { | 259 | enum { |
248 | SLEEP_SAVE_PSTR, | 260 | SLEEP_SAVE_PSTR, |
249 | SLEEP_SAVE_CKEN, | ||
250 | SLEEP_SAVE_MDREFR, | 261 | SLEEP_SAVE_MDREFR, |
251 | SLEEP_SAVE_PCFR, | 262 | SLEEP_SAVE_PCFR, |
252 | SLEEP_SAVE_COUNT | 263 | SLEEP_SAVE_COUNT |
@@ -254,21 +265,19 @@ enum { | |||
254 | 265 | ||
255 | void pxa27x_cpu_pm_save(unsigned long *sleep_save) | 266 | void pxa27x_cpu_pm_save(unsigned long *sleep_save) |
256 | { | 267 | { |
257 | SAVE(MDREFR); | 268 | sleep_save[SLEEP_SAVE_MDREFR] = __raw_readl(MDREFR); |
258 | SAVE(PCFR); | 269 | SAVE(PCFR); |
259 | 270 | ||
260 | SAVE(CKEN); | ||
261 | SAVE(PSTR); | 271 | SAVE(PSTR); |
262 | } | 272 | } |
263 | 273 | ||
264 | void pxa27x_cpu_pm_restore(unsigned long *sleep_save) | 274 | void pxa27x_cpu_pm_restore(unsigned long *sleep_save) |
265 | { | 275 | { |
266 | RESTORE(MDREFR); | 276 | __raw_writel(sleep_save[SLEEP_SAVE_MDREFR], MDREFR); |
267 | RESTORE(PCFR); | 277 | RESTORE(PCFR); |
268 | 278 | ||
269 | PSSR = PSSR_RDH | PSSR_PH; | 279 | PSSR = PSSR_RDH | PSSR_PH; |
270 | 280 | ||
271 | RESTORE(CKEN); | ||
272 | RESTORE(PSTR); | 281 | RESTORE(PSTR); |
273 | } | 282 | } |
274 | 283 | ||
@@ -370,6 +379,27 @@ void __init pxa27x_init_irq(void) | |||
370 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake); | 379 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 120, pxa27x_set_wake); |
371 | } | 380 | } |
372 | 381 | ||
382 | static struct map_desc pxa27x_io_desc[] __initdata = { | ||
383 | { /* Mem Ctl */ | ||
384 | .virtual = SMEMC_VIRT, | ||
385 | .pfn = __phys_to_pfn(PXA2XX_SMEMC_BASE), | ||
386 | .length = 0x00200000, | ||
387 | .type = MT_DEVICE | ||
388 | }, { /* IMem ctl */ | ||
389 | .virtual = 0xfe000000, | ||
390 | .pfn = __phys_to_pfn(0x58000000), | ||
391 | .length = 0x00100000, | ||
392 | .type = MT_DEVICE | ||
393 | }, | ||
394 | }; | ||
395 | |||
396 | void __init pxa27x_map_io(void) | ||
397 | { | ||
398 | pxa_map_io(); | ||
399 | iotable_init(ARRAY_AND_SIZE(pxa27x_io_desc)); | ||
400 | pxa27x_get_clk_frequency_khz(1); | ||
401 | } | ||
402 | |||
373 | /* | 403 | /* |
374 | * device registration specific to PXA27x. | 404 | * device registration specific to PXA27x. |
375 | */ | 405 | */ |
@@ -405,7 +435,9 @@ static struct sys_device pxa27x_sysdev[] = { | |||
405 | .cls = &pxa2xx_mfp_sysclass, | 435 | .cls = &pxa2xx_mfp_sysclass, |
406 | }, { | 436 | }, { |
407 | .cls = &pxa_gpio_sysclass, | 437 | .cls = &pxa_gpio_sysclass, |
408 | }, | 438 | }, { |
439 | .cls = &pxa2xx_clock_sysclass, | ||
440 | } | ||
409 | }; | 441 | }; |
410 | 442 | ||
411 | static int __init pxa27x_init(void) | 443 | static int __init pxa27x_init(void) |
diff --git a/arch/arm/mach-pxa/pxa3xx.c b/arch/arm/mach-pxa/pxa3xx.c index d1c747cdacf8..e14818f5d950 100644 --- a/arch/arm/mach-pxa/pxa3xx.c +++ b/arch/arm/mach-pxa/pxa3xx.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/io.h> | 22 | #include <linux/io.h> |
23 | #include <linux/sysdev.h> | 23 | #include <linux/sysdev.h> |
24 | 24 | ||
25 | #include <asm/mach/map.h> | ||
25 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
26 | #include <mach/gpio.h> | 27 | #include <mach/gpio.h> |
27 | #include <mach/pxa3xx-regs.h> | 28 | #include <mach/pxa3xx-regs.h> |
@@ -30,193 +31,16 @@ | |||
30 | #include <mach/pm.h> | 31 | #include <mach/pm.h> |
31 | #include <mach/dma.h> | 32 | #include <mach/dma.h> |
32 | #include <mach/regs-intc.h> | 33 | #include <mach/regs-intc.h> |
34 | #include <mach/smemc.h> | ||
33 | #include <plat/i2c.h> | 35 | #include <plat/i2c.h> |
34 | 36 | ||
35 | #include "generic.h" | 37 | #include "generic.h" |
36 | #include "devices.h" | 38 | #include "devices.h" |
37 | #include "clock.h" | 39 | #include "clock.h" |
38 | 40 | ||
39 | /* Crystal clock: 13MHz */ | ||
40 | #define BASE_CLK 13000000 | ||
41 | |||
42 | /* Ring Oscillator Clock: 60MHz */ | ||
43 | #define RO_CLK 60000000 | ||
44 | |||
45 | #define ACCR_D0CS (1 << 26) | ||
46 | #define ACCR_PCCE (1 << 11) | ||
47 | |||
48 | #define PECR_IE(n) ((1 << ((n) * 2)) << 28) | 41 | #define PECR_IE(n) ((1 << ((n) * 2)) << 28) |
49 | #define PECR_IS(n) ((1 << ((n) * 2)) << 29) | 42 | #define PECR_IS(n) ((1 << ((n) * 2)) << 29) |
50 | 43 | ||
51 | /* crystal frequency to static memory controller multiplier (SMCFS) */ | ||
52 | static unsigned char smcfs_mult[8] = { 6, 0, 8, 0, 0, 16, }; | ||
53 | |||
54 | /* crystal frequency to HSIO bus frequency multiplier (HSS) */ | ||
55 | static unsigned char hss_mult[4] = { 8, 12, 16, 24 }; | ||
56 | |||
57 | /* | ||
58 | * Get the clock frequency as reflected by CCSR and the turbo flag. | ||
59 | * We assume these values have been applied via a fcs. | ||
60 | * If info is not 0 we also display the current settings. | ||
61 | */ | ||
62 | unsigned int pxa3xx_get_clk_frequency_khz(int info) | ||
63 | { | ||
64 | unsigned long acsr, xclkcfg; | ||
65 | unsigned int t, xl, xn, hss, ro, XL, XN, CLK, HSS; | ||
66 | |||
67 | /* Read XCLKCFG register turbo bit */ | ||
68 | __asm__ __volatile__("mrc\tp14, 0, %0, c6, c0, 0" : "=r"(xclkcfg)); | ||
69 | t = xclkcfg & 0x1; | ||
70 | |||
71 | acsr = ACSR; | ||
72 | |||
73 | xl = acsr & 0x1f; | ||
74 | xn = (acsr >> 8) & 0x7; | ||
75 | hss = (acsr >> 14) & 0x3; | ||
76 | |||
77 | XL = xl * BASE_CLK; | ||
78 | XN = xn * XL; | ||
79 | |||
80 | ro = acsr & ACCR_D0CS; | ||
81 | |||
82 | CLK = (ro) ? RO_CLK : ((t) ? XN : XL); | ||
83 | HSS = (ro) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
84 | |||
85 | if (info) { | ||
86 | pr_info("RO Mode clock: %d.%02dMHz (%sactive)\n", | ||
87 | RO_CLK / 1000000, (RO_CLK % 1000000) / 10000, | ||
88 | (ro) ? "" : "in"); | ||
89 | pr_info("Run Mode clock: %d.%02dMHz (*%d)\n", | ||
90 | XL / 1000000, (XL % 1000000) / 10000, xl); | ||
91 | pr_info("Turbo Mode clock: %d.%02dMHz (*%d, %sactive)\n", | ||
92 | XN / 1000000, (XN % 1000000) / 10000, xn, | ||
93 | (t) ? "" : "in"); | ||
94 | pr_info("HSIO bus clock: %d.%02dMHz\n", | ||
95 | HSS / 1000000, (HSS % 1000000) / 10000); | ||
96 | } | ||
97 | |||
98 | return CLK / 1000; | ||
99 | } | ||
100 | |||
101 | void pxa3xx_clear_reset_status(unsigned int mask) | ||
102 | { | ||
103 | /* RESET_STATUS_* has a 1:1 mapping with ARSR */ | ||
104 | ARSR = mask; | ||
105 | } | ||
106 | |||
107 | /* | ||
108 | * Return the current AC97 clock frequency. | ||
109 | */ | ||
110 | static unsigned long clk_pxa3xx_ac97_getrate(struct clk *clk) | ||
111 | { | ||
112 | unsigned long rate = 312000000; | ||
113 | unsigned long ac97_div; | ||
114 | |||
115 | ac97_div = AC97_DIV; | ||
116 | |||
117 | /* This may loose precision for some rates but won't for the | ||
118 | * standard 24.576MHz. | ||
119 | */ | ||
120 | rate /= (ac97_div >> 12) & 0x7fff; | ||
121 | rate *= (ac97_div & 0xfff); | ||
122 | |||
123 | return rate; | ||
124 | } | ||
125 | |||
126 | /* | ||
127 | * Return the current HSIO bus clock frequency | ||
128 | */ | ||
129 | static unsigned long clk_pxa3xx_hsio_getrate(struct clk *clk) | ||
130 | { | ||
131 | unsigned long acsr; | ||
132 | unsigned int hss, hsio_clk; | ||
133 | |||
134 | acsr = ACSR; | ||
135 | |||
136 | hss = (acsr >> 14) & 0x3; | ||
137 | hsio_clk = (acsr & ACCR_D0CS) ? RO_CLK : hss_mult[hss] * BASE_CLK; | ||
138 | |||
139 | return hsio_clk; | ||
140 | } | ||
141 | |||
142 | void clk_pxa3xx_cken_enable(struct clk *clk) | ||
143 | { | ||
144 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
145 | |||
146 | if (clk->cken < 32) | ||
147 | CKENA |= mask; | ||
148 | else | ||
149 | CKENB |= mask; | ||
150 | } | ||
151 | |||
152 | void clk_pxa3xx_cken_disable(struct clk *clk) | ||
153 | { | ||
154 | unsigned long mask = 1ul << (clk->cken & 0x1f); | ||
155 | |||
156 | if (clk->cken < 32) | ||
157 | CKENA &= ~mask; | ||
158 | else | ||
159 | CKENB &= ~mask; | ||
160 | } | ||
161 | |||
162 | const struct clkops clk_pxa3xx_cken_ops = { | ||
163 | .enable = clk_pxa3xx_cken_enable, | ||
164 | .disable = clk_pxa3xx_cken_disable, | ||
165 | }; | ||
166 | |||
167 | static const struct clkops clk_pxa3xx_hsio_ops = { | ||
168 | .enable = clk_pxa3xx_cken_enable, | ||
169 | .disable = clk_pxa3xx_cken_disable, | ||
170 | .getrate = clk_pxa3xx_hsio_getrate, | ||
171 | }; | ||
172 | |||
173 | static const struct clkops clk_pxa3xx_ac97_ops = { | ||
174 | .enable = clk_pxa3xx_cken_enable, | ||
175 | .disable = clk_pxa3xx_cken_disable, | ||
176 | .getrate = clk_pxa3xx_ac97_getrate, | ||
177 | }; | ||
178 | |||
179 | static void clk_pout_enable(struct clk *clk) | ||
180 | { | ||
181 | OSCC |= OSCC_PEN; | ||
182 | } | ||
183 | |||
184 | static void clk_pout_disable(struct clk *clk) | ||
185 | { | ||
186 | OSCC &= ~OSCC_PEN; | ||
187 | } | ||
188 | |||
189 | static const struct clkops clk_pout_ops = { | ||
190 | .enable = clk_pout_enable, | ||
191 | .disable = clk_pout_disable, | ||
192 | }; | ||
193 | |||
194 | static void clk_dummy_enable(struct clk *clk) | ||
195 | { | ||
196 | } | ||
197 | |||
198 | static void clk_dummy_disable(struct clk *clk) | ||
199 | { | ||
200 | } | ||
201 | |||
202 | static const struct clkops clk_dummy_ops = { | ||
203 | .enable = clk_dummy_enable, | ||
204 | .disable = clk_dummy_disable, | ||
205 | }; | ||
206 | |||
207 | static struct clk clk_pxa3xx_pout = { | ||
208 | .ops = &clk_pout_ops, | ||
209 | .rate = 13000000, | ||
210 | .delay = 70, | ||
211 | }; | ||
212 | |||
213 | static struct clk clk_dummy = { | ||
214 | .ops = &clk_dummy_ops, | ||
215 | }; | ||
216 | |||
217 | static DEFINE_PXA3_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops); | ||
218 | static DEFINE_PXA3_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops); | ||
219 | static DEFINE_PXA3_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops); | ||
220 | static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); | 44 | static DEFINE_PXA3_CKEN(pxa3xx_ffuart, FFUART, 14857000, 1); |
221 | static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); | 45 | static DEFINE_PXA3_CKEN(pxa3xx_btuart, BTUART, 14857000, 1); |
222 | static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); | 46 | static DEFINE_PXA3_CKEN(pxa3xx_stuart, STUART, 14857000, 1); |
@@ -234,6 +58,12 @@ static DEFINE_PXA3_CKEN(pxa3xx_pwm1, PWM1, 13000000, 0); | |||
234 | static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0); | 58 | static DEFINE_PXA3_CKEN(pxa3xx_mmc1, MMC1, 19500000, 0); |
235 | static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0); | 59 | static DEFINE_PXA3_CKEN(pxa3xx_mmc2, MMC2, 19500000, 0); |
236 | 60 | ||
61 | static DEFINE_CK(pxa3xx_lcd, LCD, &clk_pxa3xx_hsio_ops); | ||
62 | static DEFINE_CK(pxa3xx_smemc, SMC, &clk_pxa3xx_smemc_ops); | ||
63 | static DEFINE_CK(pxa3xx_camera, CAMERA, &clk_pxa3xx_hsio_ops); | ||
64 | static DEFINE_CK(pxa3xx_ac97, AC97, &clk_pxa3xx_ac97_ops); | ||
65 | static DEFINE_CLK(pxa3xx_pout, &clk_pxa3xx_pout_ops, 13000000, 70); | ||
66 | |||
237 | static struct clk_lookup pxa3xx_clkregs[] = { | 67 | static struct clk_lookup pxa3xx_clkregs[] = { |
238 | INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), | 68 | INIT_CLKREG(&clk_pxa3xx_pout, NULL, "CLK_POUT"), |
239 | /* Power I2C clock is always on */ | 69 | /* Power I2C clock is always on */ |
@@ -258,6 +88,7 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
258 | INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), | 88 | INIT_CLKREG(&clk_pxa3xx_pwm1, "pxa27x-pwm.1", NULL), |
259 | INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), | 89 | INIT_CLKREG(&clk_pxa3xx_mmc1, "pxa2xx-mci.0", NULL), |
260 | INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), | 90 | INIT_CLKREG(&clk_pxa3xx_mmc2, "pxa2xx-mci.1", NULL), |
91 | INIT_CLKREG(&clk_pxa3xx_smemc, "pxa2xx-pcmcia", NULL), | ||
261 | }; | 92 | }; |
262 | 93 | ||
263 | #ifdef CONFIG_PM | 94 | #ifdef CONFIG_PM |
@@ -268,30 +99,6 @@ static struct clk_lookup pxa3xx_clkregs[] = { | |||
268 | static void __iomem *sram; | 99 | static void __iomem *sram; |
269 | static unsigned long wakeup_src; | 100 | static unsigned long wakeup_src; |
270 | 101 | ||
271 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | ||
272 | #define RESTORE(x) x = sleep_save[SLEEP_SAVE_##x] | ||
273 | |||
274 | enum { SLEEP_SAVE_CKENA, | ||
275 | SLEEP_SAVE_CKENB, | ||
276 | SLEEP_SAVE_ACCR, | ||
277 | |||
278 | SLEEP_SAVE_COUNT, | ||
279 | }; | ||
280 | |||
281 | static void pxa3xx_cpu_pm_save(unsigned long *sleep_save) | ||
282 | { | ||
283 | SAVE(CKENA); | ||
284 | SAVE(CKENB); | ||
285 | SAVE(ACCR); | ||
286 | } | ||
287 | |||
288 | static void pxa3xx_cpu_pm_restore(unsigned long *sleep_save) | ||
289 | { | ||
290 | RESTORE(ACCR); | ||
291 | RESTORE(CKENA); | ||
292 | RESTORE(CKENB); | ||
293 | } | ||
294 | |||
295 | /* | 102 | /* |
296 | * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic | 103 | * Enter a standby mode (S0D1C2 or S0D2C2). Upon wakeup, the dynamic |
297 | * memory controller has to be reinitialised, so we place some code | 104 | * memory controller has to be reinitialised, so we place some code |
@@ -390,9 +197,6 @@ static int pxa3xx_cpu_pm_valid(suspend_state_t state) | |||
390 | } | 197 | } |
391 | 198 | ||
392 | static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = { | 199 | static struct pxa_cpu_pm_fns pxa3xx_cpu_pm_fns = { |
393 | .save_count = SLEEP_SAVE_COUNT, | ||
394 | .save = pxa3xx_cpu_pm_save, | ||
395 | .restore = pxa3xx_cpu_pm_restore, | ||
396 | .valid = pxa3xx_cpu_pm_valid, | 200 | .valid = pxa3xx_cpu_pm_valid, |
397 | .enter = pxa3xx_cpu_pm_enter, | 201 | .enter = pxa3xx_cpu_pm_enter, |
398 | }; | 202 | }; |
@@ -580,6 +384,22 @@ void __init pxa3xx_init_irq(void) | |||
580 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); | 384 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); |
581 | } | 385 | } |
582 | 386 | ||
387 | static struct map_desc pxa3xx_io_desc[] __initdata = { | ||
388 | { /* Mem Ctl */ | ||
389 | .virtual = SMEMC_VIRT, | ||
390 | .pfn = __phys_to_pfn(PXA3XX_SMEMC_BASE), | ||
391 | .length = 0x00200000, | ||
392 | .type = MT_DEVICE | ||
393 | } | ||
394 | }; | ||
395 | |||
396 | void __init pxa3xx_map_io(void) | ||
397 | { | ||
398 | pxa_map_io(); | ||
399 | iotable_init(ARRAY_AND_SIZE(pxa3xx_io_desc)); | ||
400 | pxa3xx_get_clk_frequency_khz(1); | ||
401 | } | ||
402 | |||
583 | /* | 403 | /* |
584 | * device registration specific to PXA3xx. | 404 | * device registration specific to PXA3xx. |
585 | */ | 405 | */ |
@@ -615,7 +435,9 @@ static struct sys_device pxa3xx_sysdev[] = { | |||
615 | .cls = &pxa3xx_mfp_sysclass, | 435 | .cls = &pxa3xx_mfp_sysclass, |
616 | }, { | 436 | }, { |
617 | .cls = &pxa_gpio_sysclass, | 437 | .cls = &pxa_gpio_sysclass, |
618 | }, | 438 | }, { |
439 | .cls = &pxa3xx_clock_sysclass, | ||
440 | } | ||
619 | }; | 441 | }; |
620 | 442 | ||
621 | static int __init pxa3xx_init(void) | 443 | static int __init pxa3xx_init(void) |
diff --git a/arch/arm/mach-pxa/pxa930.c b/arch/arm/mach-pxa/pxa930.c index 7d29dd3af79d..8aeacf908784 100644 --- a/arch/arm/mach-pxa/pxa930.c +++ b/arch/arm/mach-pxa/pxa930.c | |||
@@ -192,7 +192,7 @@ static struct mfp_addr_map pxa935_mfp_addr_map[] __initdata = { | |||
192 | 192 | ||
193 | static int __init pxa930_init(void) | 193 | static int __init pxa930_init(void) |
194 | { | 194 | { |
195 | if (cpu_is_pxa930() || cpu_is_pxa935() || cpu_is_pxa950()) { | 195 | if (cpu_is_pxa93x()) { |
196 | mfp_init_base(io_p2v(MFPR_BASE)); | 196 | mfp_init_base(io_p2v(MFPR_BASE)); |
197 | mfp_init_addr(pxa930_mfp_addr_map); | 197 | mfp_init_addr(pxa930_mfp_addr_map); |
198 | } | 198 | } |
diff --git a/arch/arm/mach-pxa/pxa95x.c b/arch/arm/mach-pxa/pxa95x.c new file mode 100644 index 000000000000..437980f72710 --- /dev/null +++ b/arch/arm/mach-pxa/pxa95x.c | |||
@@ -0,0 +1,308 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/pxa95x.c | ||
3 | * | ||
4 | * code specific to PXA95x aka MGx | ||
5 | * | ||
6 | * Copyright (C) 2009-2010 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/module.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/init.h> | ||
16 | #include <linux/pm.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/irq.h> | ||
19 | #include <linux/io.h> | ||
20 | #include <linux/sysdev.h> | ||
21 | |||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/gpio.h> | ||
24 | #include <mach/pxa3xx-regs.h> | ||
25 | #include <mach/pxa930.h> | ||
26 | #include <mach/reset.h> | ||
27 | #include <mach/pm.h> | ||
28 | #include <mach/dma.h> | ||
29 | #include <mach/regs-intc.h> | ||
30 | #include <plat/i2c.h> | ||
31 | |||
32 | #include "generic.h" | ||
33 | #include "devices.h" | ||
34 | #include "clock.h" | ||
35 | |||
36 | static struct mfp_addr_map pxa95x_mfp_addr_map[] __initdata = { | ||
37 | |||
38 | MFP_ADDR(GPIO0, 0x02e0), | ||
39 | MFP_ADDR(GPIO1, 0x02dc), | ||
40 | MFP_ADDR(GPIO2, 0x02e8), | ||
41 | MFP_ADDR(GPIO3, 0x02d8), | ||
42 | MFP_ADDR(GPIO4, 0x02e4), | ||
43 | MFP_ADDR(GPIO5, 0x02ec), | ||
44 | MFP_ADDR(GPIO6, 0x02f8), | ||
45 | MFP_ADDR(GPIO7, 0x02fc), | ||
46 | MFP_ADDR(GPIO8, 0x0300), | ||
47 | MFP_ADDR(GPIO9, 0x02d4), | ||
48 | MFP_ADDR(GPIO10, 0x02f4), | ||
49 | MFP_ADDR(GPIO11, 0x02f0), | ||
50 | MFP_ADDR(GPIO12, 0x0304), | ||
51 | MFP_ADDR(GPIO13, 0x0310), | ||
52 | MFP_ADDR(GPIO14, 0x0308), | ||
53 | MFP_ADDR(GPIO15, 0x030c), | ||
54 | MFP_ADDR(GPIO16, 0x04e8), | ||
55 | MFP_ADDR(GPIO17, 0x04f4), | ||
56 | MFP_ADDR(GPIO18, 0x04f8), | ||
57 | MFP_ADDR(GPIO19, 0x04fc), | ||
58 | MFP_ADDR(GPIO20, 0x0518), | ||
59 | MFP_ADDR(GPIO21, 0x051c), | ||
60 | MFP_ADDR(GPIO22, 0x04ec), | ||
61 | MFP_ADDR(GPIO23, 0x0500), | ||
62 | MFP_ADDR(GPIO24, 0x04f0), | ||
63 | MFP_ADDR(GPIO25, 0x0504), | ||
64 | MFP_ADDR(GPIO26, 0x0510), | ||
65 | MFP_ADDR(GPIO27, 0x0514), | ||
66 | MFP_ADDR(GPIO28, 0x0520), | ||
67 | MFP_ADDR(GPIO29, 0x0600), | ||
68 | MFP_ADDR(GPIO30, 0x0618), | ||
69 | MFP_ADDR(GPIO31, 0x0610), | ||
70 | MFP_ADDR(GPIO32, 0x060c), | ||
71 | MFP_ADDR(GPIO33, 0x061c), | ||
72 | MFP_ADDR(GPIO34, 0x0620), | ||
73 | MFP_ADDR(GPIO35, 0x0628), | ||
74 | MFP_ADDR(GPIO36, 0x062c), | ||
75 | MFP_ADDR(GPIO37, 0x0630), | ||
76 | MFP_ADDR(GPIO38, 0x0634), | ||
77 | MFP_ADDR(GPIO39, 0x0638), | ||
78 | MFP_ADDR(GPIO40, 0x063c), | ||
79 | MFP_ADDR(GPIO41, 0x0614), | ||
80 | MFP_ADDR(GPIO42, 0x0624), | ||
81 | MFP_ADDR(GPIO43, 0x0608), | ||
82 | MFP_ADDR(GPIO44, 0x0604), | ||
83 | MFP_ADDR(GPIO45, 0x050c), | ||
84 | MFP_ADDR(GPIO46, 0x0508), | ||
85 | MFP_ADDR(GPIO47, 0x02bc), | ||
86 | MFP_ADDR(GPIO48, 0x02b4), | ||
87 | MFP_ADDR(GPIO49, 0x02b8), | ||
88 | MFP_ADDR(GPIO50, 0x02c8), | ||
89 | MFP_ADDR(GPIO51, 0x02c0), | ||
90 | MFP_ADDR(GPIO52, 0x02c4), | ||
91 | MFP_ADDR(GPIO53, 0x02d0), | ||
92 | MFP_ADDR(GPIO54, 0x02cc), | ||
93 | MFP_ADDR(GPIO55, 0x029c), | ||
94 | MFP_ADDR(GPIO56, 0x02a0), | ||
95 | MFP_ADDR(GPIO57, 0x0294), | ||
96 | MFP_ADDR(GPIO58, 0x0298), | ||
97 | MFP_ADDR(GPIO59, 0x02a4), | ||
98 | MFP_ADDR(GPIO60, 0x02a8), | ||
99 | MFP_ADDR(GPIO61, 0x02b0), | ||
100 | MFP_ADDR(GPIO62, 0x02ac), | ||
101 | MFP_ADDR(GPIO63, 0x0640), | ||
102 | MFP_ADDR(GPIO64, 0x065c), | ||
103 | MFP_ADDR(GPIO65, 0x0648), | ||
104 | MFP_ADDR(GPIO66, 0x0644), | ||
105 | MFP_ADDR(GPIO67, 0x0674), | ||
106 | MFP_ADDR(GPIO68, 0x0658), | ||
107 | MFP_ADDR(GPIO69, 0x0654), | ||
108 | MFP_ADDR(GPIO70, 0x0660), | ||
109 | MFP_ADDR(GPIO71, 0x0668), | ||
110 | MFP_ADDR(GPIO72, 0x0664), | ||
111 | MFP_ADDR(GPIO73, 0x0650), | ||
112 | MFP_ADDR(GPIO74, 0x066c), | ||
113 | MFP_ADDR(GPIO75, 0x064c), | ||
114 | MFP_ADDR(GPIO76, 0x0670), | ||
115 | MFP_ADDR(GPIO77, 0x0678), | ||
116 | MFP_ADDR(GPIO78, 0x067c), | ||
117 | MFP_ADDR(GPIO79, 0x0694), | ||
118 | MFP_ADDR(GPIO80, 0x069c), | ||
119 | MFP_ADDR(GPIO81, 0x06a0), | ||
120 | MFP_ADDR(GPIO82, 0x06a4), | ||
121 | MFP_ADDR(GPIO83, 0x0698), | ||
122 | MFP_ADDR(GPIO84, 0x06bc), | ||
123 | MFP_ADDR(GPIO85, 0x06b4), | ||
124 | MFP_ADDR(GPIO86, 0x06b0), | ||
125 | MFP_ADDR(GPIO87, 0x06c0), | ||
126 | MFP_ADDR(GPIO88, 0x06c4), | ||
127 | MFP_ADDR(GPIO89, 0x06ac), | ||
128 | MFP_ADDR(GPIO90, 0x0680), | ||
129 | MFP_ADDR(GPIO91, 0x0684), | ||
130 | MFP_ADDR(GPIO92, 0x0688), | ||
131 | MFP_ADDR(GPIO93, 0x0690), | ||
132 | MFP_ADDR(GPIO94, 0x068c), | ||
133 | MFP_ADDR(GPIO95, 0x06a8), | ||
134 | MFP_ADDR(GPIO96, 0x06b8), | ||
135 | MFP_ADDR(GPIO97, 0x0410), | ||
136 | MFP_ADDR(GPIO98, 0x0418), | ||
137 | MFP_ADDR(GPIO99, 0x041c), | ||
138 | MFP_ADDR(GPIO100, 0x0414), | ||
139 | MFP_ADDR(GPIO101, 0x0408), | ||
140 | MFP_ADDR(GPIO102, 0x0324), | ||
141 | MFP_ADDR(GPIO103, 0x040c), | ||
142 | MFP_ADDR(GPIO104, 0x0400), | ||
143 | MFP_ADDR(GPIO105, 0x0328), | ||
144 | MFP_ADDR(GPIO106, 0x0404), | ||
145 | |||
146 | MFP_ADDR(GPIO159, 0x0524), | ||
147 | MFP_ADDR(GPIO163, 0x0534), | ||
148 | MFP_ADDR(GPIO167, 0x0544), | ||
149 | MFP_ADDR(GPIO168, 0x0548), | ||
150 | MFP_ADDR(GPIO169, 0x054c), | ||
151 | MFP_ADDR(GPIO170, 0x0550), | ||
152 | MFP_ADDR(GPIO171, 0x0554), | ||
153 | MFP_ADDR(GPIO172, 0x0558), | ||
154 | MFP_ADDR(GPIO173, 0x055c), | ||
155 | |||
156 | MFP_ADDR(nXCVREN, 0x0204), | ||
157 | MFP_ADDR(DF_CLE_nOE, 0x020c), | ||
158 | MFP_ADDR(DF_nADV1_ALE, 0x0218), | ||
159 | MFP_ADDR(DF_SCLK_E, 0x0214), | ||
160 | MFP_ADDR(DF_SCLK_S, 0x0210), | ||
161 | MFP_ADDR(nBE0, 0x021c), | ||
162 | MFP_ADDR(nBE1, 0x0220), | ||
163 | MFP_ADDR(DF_nADV2_ALE, 0x0224), | ||
164 | MFP_ADDR(DF_INT_RnB, 0x0228), | ||
165 | MFP_ADDR(DF_nCS0, 0x022c), | ||
166 | MFP_ADDR(DF_nCS1, 0x0230), | ||
167 | MFP_ADDR(nLUA, 0x0254), | ||
168 | MFP_ADDR(nLLA, 0x0258), | ||
169 | MFP_ADDR(DF_nWE, 0x0234), | ||
170 | MFP_ADDR(DF_nRE_nOE, 0x0238), | ||
171 | MFP_ADDR(DF_ADDR0, 0x024c), | ||
172 | MFP_ADDR(DF_ADDR1, 0x0250), | ||
173 | MFP_ADDR(DF_ADDR2, 0x025c), | ||
174 | MFP_ADDR(DF_ADDR3, 0x0260), | ||
175 | MFP_ADDR(DF_IO0, 0x023c), | ||
176 | MFP_ADDR(DF_IO1, 0x0240), | ||
177 | MFP_ADDR(DF_IO2, 0x0244), | ||
178 | MFP_ADDR(DF_IO3, 0x0248), | ||
179 | MFP_ADDR(DF_IO4, 0x0264), | ||
180 | MFP_ADDR(DF_IO5, 0x0268), | ||
181 | MFP_ADDR(DF_IO6, 0x026c), | ||
182 | MFP_ADDR(DF_IO7, 0x0270), | ||
183 | MFP_ADDR(DF_IO8, 0x0274), | ||
184 | MFP_ADDR(DF_IO9, 0x0278), | ||
185 | MFP_ADDR(DF_IO10, 0x027c), | ||
186 | MFP_ADDR(DF_IO11, 0x0280), | ||
187 | MFP_ADDR(DF_IO12, 0x0284), | ||
188 | MFP_ADDR(DF_IO13, 0x0288), | ||
189 | MFP_ADDR(DF_IO14, 0x028c), | ||
190 | MFP_ADDR(DF_IO15, 0x0290), | ||
191 | |||
192 | MFP_ADDR(GSIM_UIO, 0x0314), | ||
193 | MFP_ADDR(GSIM_UCLK, 0x0318), | ||
194 | MFP_ADDR(GSIM_UDET, 0x031c), | ||
195 | MFP_ADDR(GSIM_nURST, 0x0320), | ||
196 | |||
197 | MFP_ADDR(PMIC_INT, 0x06c8), | ||
198 | |||
199 | MFP_ADDR(RDY, 0x0200), | ||
200 | |||
201 | MFP_ADDR_END, | ||
202 | }; | ||
203 | |||
204 | static DEFINE_CK(pxa95x_lcd, LCD, &clk_pxa3xx_hsio_ops); | ||
205 | static DEFINE_CLK(pxa95x_pout, &clk_pxa3xx_pout_ops, 13000000, 70); | ||
206 | static DEFINE_PXA3_CKEN(pxa95x_ffuart, FFUART, 14857000, 1); | ||
207 | static DEFINE_PXA3_CKEN(pxa95x_btuart, BTUART, 14857000, 1); | ||
208 | static DEFINE_PXA3_CKEN(pxa95x_stuart, STUART, 14857000, 1); | ||
209 | static DEFINE_PXA3_CKEN(pxa95x_i2c, I2C, 32842000, 0); | ||
210 | static DEFINE_PXA3_CKEN(pxa95x_keypad, KEYPAD, 32768, 0); | ||
211 | static DEFINE_PXA3_CKEN(pxa95x_ssp1, SSP1, 13000000, 0); | ||
212 | static DEFINE_PXA3_CKEN(pxa95x_ssp2, SSP2, 13000000, 0); | ||
213 | static DEFINE_PXA3_CKEN(pxa95x_ssp3, SSP3, 13000000, 0); | ||
214 | static DEFINE_PXA3_CKEN(pxa95x_ssp4, SSP4, 13000000, 0); | ||
215 | static DEFINE_PXA3_CKEN(pxa95x_pwm0, PWM0, 13000000, 0); | ||
216 | static DEFINE_PXA3_CKEN(pxa95x_pwm1, PWM1, 13000000, 0); | ||
217 | |||
218 | static struct clk_lookup pxa95x_clkregs[] = { | ||
219 | INIT_CLKREG(&clk_pxa95x_pout, NULL, "CLK_POUT"), | ||
220 | /* Power I2C clock is always on */ | ||
221 | INIT_CLKREG(&clk_dummy, "pxa3xx-pwri2c.1", NULL), | ||
222 | INIT_CLKREG(&clk_pxa95x_lcd, "pxa2xx-fb", NULL), | ||
223 | INIT_CLKREG(&clk_pxa95x_ffuart, "pxa2xx-uart.0", NULL), | ||
224 | INIT_CLKREG(&clk_pxa95x_btuart, "pxa2xx-uart.1", NULL), | ||
225 | INIT_CLKREG(&clk_pxa95x_stuart, "pxa2xx-uart.2", NULL), | ||
226 | INIT_CLKREG(&clk_pxa95x_stuart, "pxa2xx-ir", "UARTCLK"), | ||
227 | INIT_CLKREG(&clk_pxa95x_i2c, "pxa2xx-i2c.0", NULL), | ||
228 | INIT_CLKREG(&clk_pxa95x_keypad, "pxa27x-keypad", NULL), | ||
229 | INIT_CLKREG(&clk_pxa95x_ssp1, "pxa27x-ssp.0", NULL), | ||
230 | INIT_CLKREG(&clk_pxa95x_ssp2, "pxa27x-ssp.1", NULL), | ||
231 | INIT_CLKREG(&clk_pxa95x_ssp3, "pxa27x-ssp.2", NULL), | ||
232 | INIT_CLKREG(&clk_pxa95x_ssp4, "pxa27x-ssp.3", NULL), | ||
233 | INIT_CLKREG(&clk_pxa95x_pwm0, "pxa27x-pwm.0", NULL), | ||
234 | INIT_CLKREG(&clk_pxa95x_pwm1, "pxa27x-pwm.1", NULL), | ||
235 | }; | ||
236 | |||
237 | void __init pxa95x_init_irq(void) | ||
238 | { | ||
239 | pxa_init_irq(96, NULL); | ||
240 | pxa_init_gpio(IRQ_GPIO_2_x, 2, 127, NULL); | ||
241 | } | ||
242 | |||
243 | /* | ||
244 | * device registration specific to PXA93x. | ||
245 | */ | ||
246 | |||
247 | void __init pxa95x_set_i2c_power_info(struct i2c_pxa_platform_data *info) | ||
248 | { | ||
249 | pxa_register_device(&pxa3xx_device_i2c_power, info); | ||
250 | } | ||
251 | |||
252 | static struct platform_device *devices[] __initdata = { | ||
253 | &sa1100_device_rtc, | ||
254 | &pxa_device_rtc, | ||
255 | &pxa27x_device_ssp1, | ||
256 | &pxa27x_device_ssp2, | ||
257 | &pxa27x_device_ssp3, | ||
258 | &pxa3xx_device_ssp4, | ||
259 | &pxa27x_device_pwm0, | ||
260 | &pxa27x_device_pwm1, | ||
261 | }; | ||
262 | |||
263 | static struct sys_device pxa95x_sysdev[] = { | ||
264 | { | ||
265 | .cls = &pxa_irq_sysclass, | ||
266 | }, { | ||
267 | .cls = &pxa_gpio_sysclass, | ||
268 | }, { | ||
269 | .cls = &pxa3xx_clock_sysclass, | ||
270 | } | ||
271 | }; | ||
272 | |||
273 | static int __init pxa95x_init(void) | ||
274 | { | ||
275 | int ret = 0, i; | ||
276 | |||
277 | if (cpu_is_pxa95x()) { | ||
278 | mfp_init_base(io_p2v(MFPR_BASE)); | ||
279 | mfp_init_addr(pxa95x_mfp_addr_map); | ||
280 | |||
281 | reset_status = ARSR; | ||
282 | |||
283 | /* | ||
284 | * clear RDH bit every time after reset | ||
285 | * | ||
286 | * Note: the last 3 bits DxS are write-1-to-clear so carefully | ||
287 | * preserve them here in case they will be referenced later | ||
288 | */ | ||
289 | ASCR &= ~(ASCR_RDH | ASCR_D1S | ASCR_D2S | ASCR_D3S); | ||
290 | |||
291 | clkdev_add_table(pxa95x_clkregs, ARRAY_SIZE(pxa95x_clkregs)); | ||
292 | |||
293 | if ((ret = pxa_init_dma(IRQ_DMA, 32))) | ||
294 | return ret; | ||
295 | |||
296 | for (i = 0; i < ARRAY_SIZE(pxa95x_sysdev); i++) { | ||
297 | ret = sysdev_register(&pxa95x_sysdev[i]); | ||
298 | if (ret) | ||
299 | pr_err("failed to register sysdev[%d]\n", i); | ||
300 | } | ||
301 | |||
302 | ret = platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
303 | } | ||
304 | |||
305 | return ret; | ||
306 | } | ||
307 | |||
308 | postcore_initcall(pxa95x_init); | ||
diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c index 4121d03ea2c3..8361151be054 100644 --- a/arch/arm/mach-pxa/raumfeld.c +++ b/arch/arm/mach-pxa/raumfeld.c | |||
@@ -588,6 +588,9 @@ static struct pxafb_mach_info raumfeld_sharp_lcd_info = { | |||
588 | .num_modes = 1, | 588 | .num_modes = 1, |
589 | .video_mem_size = 0x400000, | 589 | .video_mem_size = 0x400000, |
590 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 590 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
591 | #ifdef CONFIG_PXA3XX_GCU | ||
592 | .acceleration_enabled = 1, | ||
593 | #endif | ||
591 | }; | 594 | }; |
592 | 595 | ||
593 | static void __init raumfeld_lcd_init(void) | 596 | static void __init raumfeld_lcd_init(void) |
@@ -616,6 +619,8 @@ static void __init raumfeld_lcd_init(void) | |||
616 | pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); | 619 | pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n"); |
617 | else | 620 | else |
618 | gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); | 621 | gpio_direction_output(GPIO_DISPLAY_ENABLE, 1); |
622 | |||
623 | platform_device_register(&pxa3xx_device_gcu); | ||
619 | } | 624 | } |
620 | 625 | ||
621 | /** | 626 | /** |
@@ -1085,7 +1090,7 @@ static void __init raumfeld_speaker_init(void) | |||
1085 | MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") | 1090 | MACHINE_START(RAUMFELD_RC, "Raumfeld Controller") |
1086 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, | 1091 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, |
1087 | .init_machine = raumfeld_controller_init, | 1092 | .init_machine = raumfeld_controller_init, |
1088 | .map_io = pxa_map_io, | 1093 | .map_io = pxa3xx_map_io, |
1089 | .init_irq = pxa3xx_init_irq, | 1094 | .init_irq = pxa3xx_init_irq, |
1090 | .timer = &pxa_timer, | 1095 | .timer = &pxa_timer, |
1091 | MACHINE_END | 1096 | MACHINE_END |
@@ -1095,7 +1100,7 @@ MACHINE_END | |||
1095 | MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") | 1100 | MACHINE_START(RAUMFELD_CONNECTOR, "Raumfeld Connector") |
1096 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, | 1101 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, |
1097 | .init_machine = raumfeld_connector_init, | 1102 | .init_machine = raumfeld_connector_init, |
1098 | .map_io = pxa_map_io, | 1103 | .map_io = pxa3xx_map_io, |
1099 | .init_irq = pxa3xx_init_irq, | 1104 | .init_irq = pxa3xx_init_irq, |
1100 | .timer = &pxa_timer, | 1105 | .timer = &pxa_timer, |
1101 | MACHINE_END | 1106 | MACHINE_END |
@@ -1105,7 +1110,7 @@ MACHINE_END | |||
1105 | MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") | 1110 | MACHINE_START(RAUMFELD_SPEAKER, "Raumfeld Speaker") |
1106 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, | 1111 | .boot_params = RAUMFELD_SDRAM_BASE + 0x100, |
1107 | .init_machine = raumfeld_speaker_init, | 1112 | .init_machine = raumfeld_speaker_init, |
1108 | .map_io = pxa_map_io, | 1113 | .map_io = pxa3xx_map_io, |
1109 | .init_irq = pxa3xx_init_irq, | 1114 | .init_irq = pxa3xx_init_irq, |
1110 | .timer = &pxa_timer, | 1115 | .timer = &pxa_timer, |
1111 | MACHINE_END | 1116 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/saar.c b/arch/arm/mach-pxa/saar.c index ffa50e633ee6..c1ca8cb467fc 100644 --- a/arch/arm/mach-pxa/saar.c +++ b/arch/arm/mach-pxa/saar.c | |||
@@ -597,7 +597,7 @@ static void __init saar_init(void) | |||
597 | MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") | 597 | MACHINE_START(SAAR, "PXA930 Handheld Platform (aka SAAR)") |
598 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ | 598 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ |
599 | .boot_params = 0xa0000100, | 599 | .boot_params = 0xa0000100, |
600 | .map_io = pxa_map_io, | 600 | .map_io = pxa3xx_map_io, |
601 | .init_irq = pxa3xx_init_irq, | 601 | .init_irq = pxa3xx_init_irq, |
602 | .timer = &pxa_timer, | 602 | .timer = &pxa_timer, |
603 | .init_machine = saar_init, | 603 | .init_machine = saar_init, |
diff --git a/arch/arm/mach-pxa/saarb.c b/arch/arm/mach-pxa/saarb.c new file mode 100644 index 000000000000..e497922f761a --- /dev/null +++ b/arch/arm/mach-pxa/saarb.c | |||
@@ -0,0 +1,114 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/saarb.c | ||
3 | * | ||
4 | * Support for the Marvell Handheld Platform (aka SAARB) | ||
5 | * | ||
6 | * Copyright (C) 2007-2010 Marvell International Ltd. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * publishhed by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #include <linux/init.h> | ||
14 | #include <linux/kernel.h> | ||
15 | #include <linux/i2c.h> | ||
16 | #include <linux/mfd/88pm860x.h> | ||
17 | |||
18 | #include <asm/mach-types.h> | ||
19 | #include <asm/mach/arch.h> | ||
20 | |||
21 | #include <mach/irqs.h> | ||
22 | #include <mach/hardware.h> | ||
23 | #include <mach/mfp.h> | ||
24 | #include <mach/mfp-pxa930.h> | ||
25 | #include <mach/gpio.h> | ||
26 | |||
27 | #include <plat/i2c.h> | ||
28 | |||
29 | #include "generic.h" | ||
30 | |||
31 | #define SAARB_NR_IRQS (IRQ_BOARD_START + 40) | ||
32 | |||
33 | static struct pm860x_touch_pdata saarb_touch = { | ||
34 | .gpadc_prebias = 1, | ||
35 | .slot_cycle = 1, | ||
36 | .tsi_prebias = 6, | ||
37 | .pen_prebias = 16, | ||
38 | .pen_prechg = 2, | ||
39 | .res_x = 300, | ||
40 | }; | ||
41 | |||
42 | static struct pm860x_backlight_pdata saarb_backlight[] = { | ||
43 | { | ||
44 | .id = PM8606_ID_BACKLIGHT, | ||
45 | .iset = PM8606_WLED_CURRENT(24), | ||
46 | .flags = PM8606_BACKLIGHT1, | ||
47 | }, | ||
48 | {}, | ||
49 | }; | ||
50 | |||
51 | static struct pm860x_led_pdata saarb_led[] = { | ||
52 | { | ||
53 | .id = PM8606_ID_LED, | ||
54 | .iset = PM8606_LED_CURRENT(12), | ||
55 | .flags = PM8606_LED1_RED, | ||
56 | }, { | ||
57 | .id = PM8606_ID_LED, | ||
58 | .iset = PM8606_LED_CURRENT(12), | ||
59 | .flags = PM8606_LED1_GREEN, | ||
60 | }, { | ||
61 | .id = PM8606_ID_LED, | ||
62 | .iset = PM8606_LED_CURRENT(12), | ||
63 | .flags = PM8606_LED1_BLUE, | ||
64 | }, { | ||
65 | .id = PM8606_ID_LED, | ||
66 | .iset = PM8606_LED_CURRENT(12), | ||
67 | .flags = PM8606_LED2_RED, | ||
68 | }, { | ||
69 | .id = PM8606_ID_LED, | ||
70 | .iset = PM8606_LED_CURRENT(12), | ||
71 | .flags = PM8606_LED2_GREEN, | ||
72 | }, { | ||
73 | .id = PM8606_ID_LED, | ||
74 | .iset = PM8606_LED_CURRENT(12), | ||
75 | .flags = PM8606_LED2_BLUE, | ||
76 | }, | ||
77 | }; | ||
78 | |||
79 | static struct pm860x_platform_data saarb_pm8607_info = { | ||
80 | .touch = &saarb_touch, | ||
81 | .backlight = &saarb_backlight[0], | ||
82 | .led = &saarb_led[0], | ||
83 | .companion_addr = 0x10, | ||
84 | .irq_mode = 0, | ||
85 | .irq_base = IRQ_BOARD_START, | ||
86 | |||
87 | .i2c_port = GI2C_PORT, | ||
88 | }; | ||
89 | |||
90 | static struct i2c_board_info saarb_i2c_info[] = { | ||
91 | { | ||
92 | .type = "88PM860x", | ||
93 | .addr = 0x34, | ||
94 | .platform_data = &saarb_pm8607_info, | ||
95 | .irq = gpio_to_irq(mfp_to_gpio(MFP_PIN_GPIO83)), | ||
96 | }, | ||
97 | }; | ||
98 | |||
99 | static void __init saarb_init(void) | ||
100 | { | ||
101 | pxa_set_ffuart_info(NULL); | ||
102 | pxa_set_i2c_info(NULL); | ||
103 | i2c_register_board_info(0, ARRAY_AND_SIZE(saarb_i2c_info)); | ||
104 | } | ||
105 | |||
106 | MACHINE_START(SAARB, "PXA955 Handheld Platform (aka SAARB)") | ||
107 | .boot_params = 0xa0000100, | ||
108 | .map_io = pxa_map_io, | ||
109 | .nr_irqs = SAARB_NR_IRQS, | ||
110 | .init_irq = pxa95x_init_irq, | ||
111 | .timer = &pxa_timer, | ||
112 | .init_machine = saarb_init, | ||
113 | MACHINE_END | ||
114 | |||
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S index 52c30b01a671..2f5b08aeb52e 100644 --- a/arch/arm/mach-pxa/sleep.S +++ b/arch/arm/mach-pxa/sleep.S | |||
@@ -14,7 +14,7 @@ | |||
14 | #include <linux/linkage.h> | 14 | #include <linux/linkage.h> |
15 | #include <asm/assembler.h> | 15 | #include <asm/assembler.h> |
16 | #include <mach/hardware.h> | 16 | #include <mach/hardware.h> |
17 | 17 | #include <mach/smemc.h> | |
18 | #include <mach/pxa2xx-regs.h> | 18 | #include <mach/pxa2xx-regs.h> |
19 | 19 | ||
20 | #define MDREFR_KDIV 0x200a4000 // all banks | 20 | #define MDREFR_KDIV 0x200a4000 // all banks |
diff --git a/arch/arm/mach-pxa/smemc.c b/arch/arm/mach-pxa/smemc.c index d6f6904132a6..232b7316ec08 100644 --- a/arch/arm/mach-pxa/smemc.c +++ b/arch/arm/mach-pxa/smemc.c | |||
@@ -9,50 +9,37 @@ | |||
9 | #include <linux/sysdev.h> | 9 | #include <linux/sysdev.h> |
10 | 10 | ||
11 | #include <mach/hardware.h> | 11 | #include <mach/hardware.h> |
12 | 12 | #include <mach/smemc.h> | |
13 | #define SMEMC_PHYS_BASE (0x4A000000) | ||
14 | #define SMEMC_PHYS_SIZE (0x90) | ||
15 | |||
16 | #define MSC0 (0x08) /* Static Memory Controller Register 0 */ | ||
17 | #define MSC1 (0x0C) /* Static Memory Controller Register 1 */ | ||
18 | #define SXCNFG (0x1C) /* Synchronous Static Memory Control Register */ | ||
19 | #define MEMCLKCFG (0x68) /* Clock Configuration */ | ||
20 | #define CSADRCFG0 (0x80) /* Address Configuration Register for CS0 */ | ||
21 | #define CSADRCFG1 (0x84) /* Address Configuration Register for CS1 */ | ||
22 | #define CSADRCFG2 (0x88) /* Address Configuration Register for CS2 */ | ||
23 | #define CSADRCFG3 (0x8C) /* Address Configuration Register for CS3 */ | ||
24 | 13 | ||
25 | #ifdef CONFIG_PM | 14 | #ifdef CONFIG_PM |
26 | static void __iomem *smemc_mmio_base; | ||
27 | |||
28 | static unsigned long msc[2]; | 15 | static unsigned long msc[2]; |
29 | static unsigned long sxcnfg, memclkcfg; | 16 | static unsigned long sxcnfg, memclkcfg; |
30 | static unsigned long csadrcfg[4]; | 17 | static unsigned long csadrcfg[4]; |
31 | 18 | ||
32 | static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) | 19 | static int pxa3xx_smemc_suspend(struct sys_device *dev, pm_message_t state) |
33 | { | 20 | { |
34 | msc[0] = __raw_readl(smemc_mmio_base + MSC0); | 21 | msc[0] = __raw_readl(MSC0); |
35 | msc[1] = __raw_readl(smemc_mmio_base + MSC1); | 22 | msc[1] = __raw_readl(MSC1); |
36 | sxcnfg = __raw_readl(smemc_mmio_base + SXCNFG); | 23 | sxcnfg = __raw_readl(SXCNFG); |
37 | memclkcfg = __raw_readl(smemc_mmio_base + MEMCLKCFG); | 24 | memclkcfg = __raw_readl(MEMCLKCFG); |
38 | csadrcfg[0] = __raw_readl(smemc_mmio_base + CSADRCFG0); | 25 | csadrcfg[0] = __raw_readl(CSADRCFG0); |
39 | csadrcfg[1] = __raw_readl(smemc_mmio_base + CSADRCFG1); | 26 | csadrcfg[1] = __raw_readl(CSADRCFG1); |
40 | csadrcfg[2] = __raw_readl(smemc_mmio_base + CSADRCFG2); | 27 | csadrcfg[2] = __raw_readl(CSADRCFG2); |
41 | csadrcfg[3] = __raw_readl(smemc_mmio_base + CSADRCFG3); | 28 | csadrcfg[3] = __raw_readl(CSADRCFG3); |
42 | 29 | ||
43 | return 0; | 30 | return 0; |
44 | } | 31 | } |
45 | 32 | ||
46 | static int pxa3xx_smemc_resume(struct sys_device *dev) | 33 | static int pxa3xx_smemc_resume(struct sys_device *dev) |
47 | { | 34 | { |
48 | __raw_writel(msc[0], smemc_mmio_base + MSC0); | 35 | __raw_writel(msc[0], MSC0); |
49 | __raw_writel(msc[1], smemc_mmio_base + MSC1); | 36 | __raw_writel(msc[1], MSC1); |
50 | __raw_writel(sxcnfg, smemc_mmio_base + SXCNFG); | 37 | __raw_writel(sxcnfg, SXCNFG); |
51 | __raw_writel(memclkcfg, smemc_mmio_base + MEMCLKCFG); | 38 | __raw_writel(memclkcfg, MEMCLKCFG); |
52 | __raw_writel(csadrcfg[0], smemc_mmio_base + CSADRCFG0); | 39 | __raw_writel(csadrcfg[0], CSADRCFG0); |
53 | __raw_writel(csadrcfg[1], smemc_mmio_base + CSADRCFG1); | 40 | __raw_writel(csadrcfg[1], CSADRCFG1); |
54 | __raw_writel(csadrcfg[2], smemc_mmio_base + CSADRCFG2); | 41 | __raw_writel(csadrcfg[2], CSADRCFG2); |
55 | __raw_writel(csadrcfg[3], smemc_mmio_base + CSADRCFG3); | 42 | __raw_writel(csadrcfg[3], CSADRCFG3); |
56 | 43 | ||
57 | return 0; | 44 | return 0; |
58 | } | 45 | } |
@@ -73,10 +60,6 @@ static int __init smemc_init(void) | |||
73 | int ret = 0; | 60 | int ret = 0; |
74 | 61 | ||
75 | if (cpu_is_pxa3xx()) { | 62 | if (cpu_is_pxa3xx()) { |
76 | smemc_mmio_base = ioremap(SMEMC_PHYS_BASE, SMEMC_PHYS_SIZE); | ||
77 | if (smemc_mmio_base == NULL) | ||
78 | return -ENODEV; | ||
79 | |||
80 | ret = sysdev_class_register(&smemc_sysclass); | 63 | ret = sysdev_class_register(&smemc_sysclass); |
81 | if (ret) | 64 | if (ret) |
82 | return ret; | 65 | return ret; |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index f736119f1ebf..0499a69e7673 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mtd/sharpsl.h> | 27 | #include <linux/mtd/sharpsl.h> |
28 | #include <linux/input/matrix_keypad.h> | 28 | #include <linux/input/matrix_keypad.h> |
29 | #include <linux/regulator/machine.h> | 29 | #include <linux/regulator/machine.h> |
30 | #include <linux/io.h> | ||
30 | 31 | ||
31 | #include <asm/setup.h> | 32 | #include <asm/setup.h> |
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
@@ -44,6 +45,7 @@ | |||
44 | #include <mach/pxa2xx_spi.h> | 45 | #include <mach/pxa2xx_spi.h> |
45 | #include <mach/spitz.h> | 46 | #include <mach/spitz.h> |
46 | #include <mach/sharpsl_pm.h> | 47 | #include <mach/sharpsl_pm.h> |
48 | #include <mach/smemc.h> | ||
47 | 49 | ||
48 | #include <plat/i2c.h> | 50 | #include <plat/i2c.h> |
49 | 51 | ||
@@ -929,9 +931,10 @@ static void spitz_poweroff(void) | |||
929 | 931 | ||
930 | static void spitz_restart(char mode, const char *cmd) | 932 | static void spitz_restart(char mode, const char *cmd) |
931 | { | 933 | { |
934 | uint32_t msc0 = __raw_readl(MSC0); | ||
932 | /* Bootloader magic for a reboot */ | 935 | /* Bootloader magic for a reboot */ |
933 | if ((MSC0 & 0xffff0000) == 0x7ff00000) | 936 | if ((msc0 & 0xffff0000) == 0x7ff00000) |
934 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; | 937 | __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0); |
935 | 938 | ||
936 | spitz_poweroff(); | 939 | spitz_poweroff(); |
937 | } | 940 | } |
@@ -980,7 +983,7 @@ static void __init spitz_fixup(struct machine_desc *desc, | |||
980 | #ifdef CONFIG_MACH_SPITZ | 983 | #ifdef CONFIG_MACH_SPITZ |
981 | MACHINE_START(SPITZ, "SHARP Spitz") | 984 | MACHINE_START(SPITZ, "SHARP Spitz") |
982 | .fixup = spitz_fixup, | 985 | .fixup = spitz_fixup, |
983 | .map_io = pxa_map_io, | 986 | .map_io = pxa27x_map_io, |
984 | .init_irq = pxa27x_init_irq, | 987 | .init_irq = pxa27x_init_irq, |
985 | .init_machine = spitz_init, | 988 | .init_machine = spitz_init, |
986 | .timer = &pxa_timer, | 989 | .timer = &pxa_timer, |
@@ -990,7 +993,7 @@ MACHINE_END | |||
990 | #ifdef CONFIG_MACH_BORZOI | 993 | #ifdef CONFIG_MACH_BORZOI |
991 | MACHINE_START(BORZOI, "SHARP Borzoi") | 994 | MACHINE_START(BORZOI, "SHARP Borzoi") |
992 | .fixup = spitz_fixup, | 995 | .fixup = spitz_fixup, |
993 | .map_io = pxa_map_io, | 996 | .map_io = pxa27x_map_io, |
994 | .init_irq = pxa27x_init_irq, | 997 | .init_irq = pxa27x_init_irq, |
995 | .init_machine = spitz_init, | 998 | .init_machine = spitz_init, |
996 | .timer = &pxa_timer, | 999 | .timer = &pxa_timer, |
@@ -1000,7 +1003,7 @@ MACHINE_END | |||
1000 | #ifdef CONFIG_MACH_AKITA | 1003 | #ifdef CONFIG_MACH_AKITA |
1001 | MACHINE_START(AKITA, "SHARP Akita") | 1004 | MACHINE_START(AKITA, "SHARP Akita") |
1002 | .fixup = spitz_fixup, | 1005 | .fixup = spitz_fixup, |
1003 | .map_io = pxa_map_io, | 1006 | .map_io = pxa27x_map_io, |
1004 | .init_irq = pxa27x_init_irq, | 1007 | .init_irq = pxa27x_init_irq, |
1005 | .init_machine = spitz_init, | 1008 | .init_machine = spitz_init, |
1006 | .timer = &pxa_timer, | 1009 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/stargate2.c b/arch/arm/mach-pxa/stargate2.c index 738adc1773fd..3498a1423943 100644 --- a/arch/arm/mach-pxa/stargate2.c +++ b/arch/arm/mach-pxa/stargate2.c | |||
@@ -48,6 +48,7 @@ | |||
48 | #include <mach/udc.h> | 48 | #include <mach/udc.h> |
49 | #include <mach/pxa2xx_spi.h> | 49 | #include <mach/pxa2xx_spi.h> |
50 | #include <mach/pxa27x-udc.h> | 50 | #include <mach/pxa27x-udc.h> |
51 | #include <mach/smemc.h> | ||
51 | 52 | ||
52 | #include <linux/spi/spi.h> | 53 | #include <linux/spi/spi.h> |
53 | #include <linux/mfd/da903x.h> | 54 | #include <linux/mfd/da903x.h> |
@@ -976,7 +977,7 @@ static void __init stargate2_init(void) | |||
976 | { | 977 | { |
977 | /* This is probably a board specific hack as this must be set | 978 | /* This is probably a board specific hack as this must be set |
978 | prior to connecting the MFP stuff up. */ | 979 | prior to connecting the MFP stuff up. */ |
979 | MECR &= ~MECR_NOS; | 980 | __raw_writel(__raw_readl(MECR) & ~MECR_NOS, MECR); |
980 | 981 | ||
981 | pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); | 982 | pxa2xx_mfp_config(ARRAY_AND_SIZE(stargate2_pin_config)); |
982 | 983 | ||
@@ -998,7 +999,7 @@ static void __init stargate2_init(void) | |||
998 | 999 | ||
999 | #ifdef CONFIG_MACH_INTELMOTE2 | 1000 | #ifdef CONFIG_MACH_INTELMOTE2 |
1000 | MACHINE_START(INTELMOTE2, "IMOTE 2") | 1001 | MACHINE_START(INTELMOTE2, "IMOTE 2") |
1001 | .map_io = pxa_map_io, | 1002 | .map_io = pxa27x_map_io, |
1002 | .init_irq = pxa27x_init_irq, | 1003 | .init_irq = pxa27x_init_irq, |
1003 | .timer = &pxa_timer, | 1004 | .timer = &pxa_timer, |
1004 | .init_machine = imote2_init, | 1005 | .init_machine = imote2_init, |
@@ -1008,7 +1009,7 @@ MACHINE_END | |||
1008 | 1009 | ||
1009 | #ifdef CONFIG_MACH_STARGATE2 | 1010 | #ifdef CONFIG_MACH_STARGATE2 |
1010 | MACHINE_START(STARGATE2, "Stargate 2") | 1011 | MACHINE_START(STARGATE2, "Stargate 2") |
1011 | .map_io = pxa_map_io, | 1012 | .map_io = pxa27x_map_io, |
1012 | .nr_irqs = STARGATE_NR_IRQS, | 1013 | .nr_irqs = STARGATE_NR_IRQS, |
1013 | .init_irq = pxa27x_init_irq, | 1014 | .init_irq = pxa27x_init_irq, |
1014 | .timer = &pxa_timer, | 1015 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/tavorevb.c b/arch/arm/mach-pxa/tavorevb.c index 2ea7545273ad..9cecf8366db8 100644 --- a/arch/arm/mach-pxa/tavorevb.c +++ b/arch/arm/mach-pxa/tavorevb.c | |||
@@ -490,7 +490,7 @@ static void __init tavorevb_init(void) | |||
490 | MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") | 490 | MACHINE_START(TAVOREVB, "PXA930 Evaluation Board (aka TavorEVB)") |
491 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ | 491 | /* Maintainer: Eric Miao <eric.miao@marvell.com> */ |
492 | .boot_params = 0xa0000100, | 492 | .boot_params = 0xa0000100, |
493 | .map_io = pxa_map_io, | 493 | .map_io = pxa3xx_map_io, |
494 | .init_irq = pxa3xx_init_irq, | 494 | .init_irq = pxa3xx_init_irq, |
495 | .timer = &pxa_timer, | 495 | .timer = &pxa_timer, |
496 | .init_machine = tavorevb_init, | 496 | .init_machine = tavorevb_init, |
diff --git a/arch/arm/mach-pxa/tavorevb3.c b/arch/arm/mach-pxa/tavorevb3.c index dc3011697bbf..70191a9450eb 100644 --- a/arch/arm/mach-pxa/tavorevb3.c +++ b/arch/arm/mach-pxa/tavorevb3.c | |||
@@ -127,7 +127,7 @@ static void __init evb3_init(void) | |||
127 | 127 | ||
128 | MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)") | 128 | MACHINE_START(TAVOREVB3, "PXA950 Evaluation Board (aka TavorEVB3)") |
129 | .boot_params = 0xa0000100, | 129 | .boot_params = 0xa0000100, |
130 | .map_io = pxa_map_io, | 130 | .map_io = pxa3xx_map_io, |
131 | .nr_irqs = TAVOREVB3_NR_IRQS, | 131 | .nr_irqs = TAVOREVB3_NR_IRQS, |
132 | .init_irq = pxa3xx_init_irq, | 132 | .init_irq = pxa3xx_init_irq, |
133 | .timer = &pxa_timer, | 133 | .timer = &pxa_timer, |
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 0ee1df49606d..57d61ee9b226 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <mach/tosa_bt.h> | 46 | #include <mach/tosa_bt.h> |
47 | #include <mach/pxa2xx_spi.h> | 47 | #include <mach/pxa2xx_spi.h> |
48 | #include <mach/audio.h> | 48 | #include <mach/audio.h> |
49 | #include <mach/smemc.h> | ||
49 | 50 | ||
50 | #include <asm/mach/arch.h> | 51 | #include <asm/mach/arch.h> |
51 | #include <mach/tosa.h> | 52 | #include <mach/tosa.h> |
@@ -893,9 +894,11 @@ static void tosa_poweroff(void) | |||
893 | 894 | ||
894 | static void tosa_restart(char mode, const char *cmd) | 895 | static void tosa_restart(char mode, const char *cmd) |
895 | { | 896 | { |
897 | uint32_t msc0 = __raw_readl(MSC0); | ||
898 | |||
896 | /* Bootloader magic for a reboot */ | 899 | /* Bootloader magic for a reboot */ |
897 | if((MSC0 & 0xffff0000) == 0x7ff00000) | 900 | if((msc0 & 0xffff0000) == 0x7ff00000) |
898 | MSC0 = (MSC0 & 0xffff) | 0x7ee00000; | 901 | __raw_writel((msc0 & 0xffff) | 0x7ee00000, MSC0); |
899 | 902 | ||
900 | tosa_poweroff(); | 903 | tosa_poweroff(); |
901 | } | 904 | } |
@@ -953,7 +956,7 @@ static void __init fixup_tosa(struct machine_desc *desc, | |||
953 | 956 | ||
954 | MACHINE_START(TOSA, "SHARP Tosa") | 957 | MACHINE_START(TOSA, "SHARP Tosa") |
955 | .fixup = fixup_tosa, | 958 | .fixup = fixup_tosa, |
956 | .map_io = pxa_map_io, | 959 | .map_io = pxa25x_map_io, |
957 | .nr_irqs = TOSA_NR_IRQS, | 960 | .nr_irqs = TOSA_NR_IRQS, |
958 | .init_irq = pxa25x_init_irq, | 961 | .init_irq = pxa25x_init_irq, |
959 | .init_machine = tosa_init, | 962 | .init_machine = tosa_init, |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c index 565d062f51d5..43fc9ca14594 100644 --- a/arch/arm/mach-pxa/trizeps4.c +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <mach/mmc.h> | 47 | #include <mach/mmc.h> |
48 | #include <mach/irda.h> | 48 | #include <mach/irda.h> |
49 | #include <mach/ohci.h> | 49 | #include <mach/ohci.h> |
50 | #include <mach/smemc.h> | ||
50 | #include <plat/i2c.h> | 51 | #include <plat/i2c.h> |
51 | 52 | ||
52 | #include "generic.h" | 53 | #include "generic.h" |
@@ -539,10 +540,10 @@ static void __init trizeps4_init(void) | |||
539 | 540 | ||
540 | static void __init trizeps4_map_io(void) | 541 | static void __init trizeps4_map_io(void) |
541 | { | 542 | { |
542 | pxa_map_io(); | 543 | pxa27x_map_io(); |
543 | iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); | 544 | iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); |
544 | 545 | ||
545 | if ((MSC0 & 0x8) && (BOOT_DEF & 0x1)) { | 546 | if ((__raw_readl(MSC0) & 0x8) && (__raw_readl(BOOT_DEF) & 0x1)) { |
546 | /* if flash is 16 bit wide its a Trizeps4 WL */ | 547 | /* if flash is 16 bit wide its a Trizeps4 WL */ |
547 | __machine_arch_type = MACH_TYPE_TRIZEPS4WL; | 548 | __machine_arch_type = MACH_TYPE_TRIZEPS4WL; |
548 | trizeps4_flash_data[0].width = 2; | 549 | trizeps4_flash_data[0].width = 2; |
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 438fc9a5ed59..de69b203afa7 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -983,7 +983,7 @@ static struct map_desc viper_io_desc[] __initdata = { | |||
983 | 983 | ||
984 | static void __init viper_map_io(void) | 984 | static void __init viper_map_io(void) |
985 | { | 985 | { |
986 | pxa_map_io(); | 986 | pxa25x_map_io(); |
987 | 987 | ||
988 | iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc)); | 988 | iotable_init(viper_io_desc, ARRAY_SIZE(viper_io_desc)); |
989 | 989 | ||
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c index f45ac0961778..b9b579715ff6 100644 --- a/arch/arm/mach-pxa/vpac270.c +++ b/arch/arm/mach-pxa/vpac270.c | |||
@@ -719,7 +719,7 @@ static void __init vpac270_init(void) | |||
719 | 719 | ||
720 | MACHINE_START(VPAC270, "Voipac PXA270") | 720 | MACHINE_START(VPAC270, "Voipac PXA270") |
721 | .boot_params = 0xa0000100, | 721 | .boot_params = 0xa0000100, |
722 | .map_io = pxa_map_io, | 722 | .map_io = pxa27x_map_io, |
723 | .init_irq = pxa27x_init_irq, | 723 | .init_irq = pxa27x_init_irq, |
724 | .timer = &pxa_timer, | 724 | .timer = &pxa_timer, |
725 | .init_machine = vpac270_init | 725 | .init_machine = vpac270_init |
diff --git a/arch/arm/mach-pxa/xcep.c b/arch/arm/mach-pxa/xcep.c index 3260ce73d327..51c0281c6e0a 100644 --- a/arch/arm/mach-pxa/xcep.c +++ b/arch/arm/mach-pxa/xcep.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
32 | #include <mach/pxa2xx-regs.h> | 32 | #include <mach/pxa2xx-regs.h> |
33 | #include <mach/mfp-pxa25x.h> | 33 | #include <mach/mfp-pxa25x.h> |
34 | #include <mach/smemc.h> | ||
34 | 35 | ||
35 | #include "generic.h" | 36 | #include "generic.h" |
36 | 37 | ||
@@ -172,9 +173,9 @@ static void __init xcep_init(void) | |||
172 | 173 | ||
173 | /* See Intel XScale Developer's Guide for details */ | 174 | /* See Intel XScale Developer's Guide for details */ |
174 | /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ | 175 | /* Set RDF and RDN to appropriate values (chip select 3 (smc91x)) */ |
175 | MSC1 = (MSC1 & 0xffff) | 0xD5540000; | 176 | __raw_writel((__raw_readl(MSC1) & 0xffff) | 0xD5540000, MSC1); |
176 | /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */ | 177 | /* Set RDF and RDN to appropriate values (chip select 5 (fpga)) */ |
177 | MSC2 = (MSC2 & 0xffff) | 0x72A00000; | 178 | __raw_writel((__raw_readl(MSC2) & 0xffff) | 0x72A00000, MSC2); |
178 | 179 | ||
179 | platform_add_devices(ARRAY_AND_SIZE(devices)); | 180 | platform_add_devices(ARRAY_AND_SIZE(devices)); |
180 | pxa_set_i2c_info(&xcep_i2c_platform_data); | 181 | pxa_set_i2c_info(&xcep_i2c_platform_data); |
@@ -183,7 +184,7 @@ static void __init xcep_init(void) | |||
183 | MACHINE_START(XCEP, "Iskratel XCEP") | 184 | MACHINE_START(XCEP, "Iskratel XCEP") |
184 | .boot_params = 0xa0000100, | 185 | .boot_params = 0xa0000100, |
185 | .init_machine = xcep_init, | 186 | .init_machine = xcep_init, |
186 | .map_io = pxa_map_io, | 187 | .map_io = pxa25x_map_io, |
187 | .init_irq = pxa25x_init_irq, | 188 | .init_irq = pxa25x_init_irq, |
188 | .timer = &pxa_timer, | 189 | .timer = &pxa_timer, |
189 | MACHINE_END | 190 | MACHINE_END |
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index fefde9848d82..527c2a1ed310 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -704,7 +704,7 @@ static void __init z2_init(void) | |||
704 | 704 | ||
705 | MACHINE_START(ZIPIT2, "Zipit Z2") | 705 | MACHINE_START(ZIPIT2, "Zipit Z2") |
706 | .boot_params = 0xa0000100, | 706 | .boot_params = 0xa0000100, |
707 | .map_io = pxa_map_io, | 707 | .map_io = pxa27x_map_io, |
708 | .init_irq = pxa27x_init_irq, | 708 | .init_irq = pxa27x_init_irq, |
709 | .timer = &pxa_timer, | 709 | .timer = &pxa_timer, |
710 | .init_machine = z2_init, | 710 | .init_machine = z2_init, |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index dea46a2d089b..c87f2b35ee05 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -47,6 +47,7 @@ | |||
47 | #include <mach/audio.h> | 47 | #include <mach/audio.h> |
48 | #include <mach/arcom-pcmcia.h> | 48 | #include <mach/arcom-pcmcia.h> |
49 | #include <mach/zeus.h> | 49 | #include <mach/zeus.h> |
50 | #include <mach/smemc.h> | ||
50 | 51 | ||
51 | #include "generic.h" | 52 | #include "generic.h" |
52 | 53 | ||
@@ -823,13 +824,16 @@ static mfp_cfg_t zeus_pin_config[] __initdata = { | |||
823 | static void __init zeus_init(void) | 824 | static void __init zeus_init(void) |
824 | { | 825 | { |
825 | u16 dm9000_msc = DM9K_MSC_VALUE; | 826 | u16 dm9000_msc = DM9K_MSC_VALUE; |
827 | u32 msc0, msc1; | ||
826 | 828 | ||
827 | system_rev = __raw_readw(ZEUS_CPLD_VERSION); | 829 | system_rev = __raw_readw(ZEUS_CPLD_VERSION); |
828 | pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); | 830 | pr_info("Zeus CPLD V%dI%d\n", (system_rev & 0xf0) >> 4, (system_rev & 0x0f)); |
829 | 831 | ||
830 | /* Fix timings for dm9000s (CS1/CS2)*/ | 832 | /* Fix timings for dm9000s (CS1/CS2)*/ |
831 | MSC0 = (MSC0 & 0xffff) | (dm9000_msc << 16); | 833 | msc0 = __raw_readl(MSC0) & 0x0000ffff | (dm9000_msc << 16); |
832 | MSC1 = (MSC1 & 0xffff0000) | dm9000_msc; | 834 | msc1 = __raw_readl(MSC1) & 0xffff0000 | dm9000_msc; |
835 | __raw_writel(msc0, MSC0); | ||
836 | __raw_writel(msc1, MSC1); | ||
833 | 837 | ||
834 | pm_power_off = zeus_power_off; | 838 | pm_power_off = zeus_power_off; |
835 | zeus_setup_apm(); | 839 | zeus_setup_apm(); |
@@ -883,7 +887,7 @@ static struct map_desc zeus_io_desc[] __initdata = { | |||
883 | 887 | ||
884 | static void __init zeus_map_io(void) | 888 | static void __init zeus_map_io(void) |
885 | { | 889 | { |
886 | pxa_map_io(); | 890 | pxa27x_map_io(); |
887 | 891 | ||
888 | iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc)); | 892 | iotable_init(zeus_io_desc, ARRAY_SIZE(zeus_io_desc)); |
889 | 893 | ||
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 702f7a68e87d..a4c784aab764 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -423,7 +423,7 @@ static void __init zylonite_init(void) | |||
423 | 423 | ||
424 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") | 424 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") |
425 | .boot_params = 0xa0000100, | 425 | .boot_params = 0xa0000100, |
426 | .map_io = pxa_map_io, | 426 | .map_io = pxa3xx_map_io, |
427 | .nr_irqs = ZYLONITE_NR_IRQS, | 427 | .nr_irqs = ZYLONITE_NR_IRQS, |
428 | .init_irq = pxa3xx_init_irq, | 428 | .init_irq = pxa3xx_init_irq, |
429 | .timer = &pxa_timer, | 429 | .timer = &pxa_timer, |
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/Kconfig b/arch/arm/mm/Kconfig index 4414a01e1e8a..a099efed0e63 100644 --- a/arch/arm/mm/Kconfig +++ b/arch/arm/mm/Kconfig | |||
@@ -382,6 +382,12 @@ config CPU_FEROCEON_OLD_ID | |||
382 | for which the CPU ID is equal to the ARM926 ID. | 382 | for which the CPU ID is equal to the ARM926 ID. |
383 | Relevant for Feroceon-1850 and early Feroceon-2850. | 383 | Relevant for Feroceon-1850 and early Feroceon-2850. |
384 | 384 | ||
385 | # Marvell PJ4 | ||
386 | config CPU_PJ4 | ||
387 | bool | ||
388 | select CPU_V7 | ||
389 | select ARM_THUMBEE | ||
390 | |||
385 | # ARMv6 | 391 | # ARMv6 |
386 | config CPU_V6 | 392 | config CPU_V6 |
387 | bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE | 393 | bool "Support ARM V6 processor" if ARCH_INTEGRATOR || MACH_REALVIEW_EB || MACH_REALVIEW_PBX || ARCH_DOVE |
@@ -789,7 +795,7 @@ config CACHE_PL310 | |||
789 | 795 | ||
790 | config CACHE_TAUROS2 | 796 | config CACHE_TAUROS2 |
791 | bool "Enable the Tauros2 L2 cache controller" | 797 | bool "Enable the Tauros2 L2 cache controller" |
792 | depends on (ARCH_DOVE || ARCH_MMP) | 798 | depends on (ARCH_DOVE || ARCH_MMP || CPU_PJ4) |
793 | default y | 799 | default y |
794 | select OUTER_CACHE | 800 | select OUTER_CACHE |
795 | help | 801 | help |
diff --git a/arch/arm/mm/cache-v6.S b/arch/arm/mm/cache-v6.S index 99fa688dfadd..c96fa1b3f49f 100644 --- a/arch/arm/mm/cache-v6.S +++ b/arch/arm/mm/cache-v6.S | |||
@@ -203,6 +203,10 @@ ENTRY(v6_flush_kern_dcache_area) | |||
203 | * - end - virtual end address of region | 203 | * - end - virtual end address of region |
204 | */ | 204 | */ |
205 | v6_dma_inv_range: | 205 | v6_dma_inv_range: |
206 | #ifdef CONFIG_DMA_CACHE_RWFO | ||
207 | ldrb r2, [r0] @ read for ownership | ||
208 | strb r2, [r0] @ write for ownership | ||
209 | #endif | ||
206 | tst r0, #D_CACHE_LINE_SIZE - 1 | 210 | tst r0, #D_CACHE_LINE_SIZE - 1 |
207 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | 211 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 |
208 | #ifdef HARVARD_CACHE | 212 | #ifdef HARVARD_CACHE |
@@ -211,6 +215,10 @@ v6_dma_inv_range: | |||
211 | mcrne p15, 0, r0, c7, c11, 1 @ clean unified line | 215 | mcrne p15, 0, r0, c7, c11, 1 @ clean unified line |
212 | #endif | 216 | #endif |
213 | tst r1, #D_CACHE_LINE_SIZE - 1 | 217 | tst r1, #D_CACHE_LINE_SIZE - 1 |
218 | #ifdef CONFIG_DMA_CACHE_RWFO | ||
219 | ldrneb r2, [r1, #-1] @ read for ownership | ||
220 | strneb r2, [r1, #-1] @ write for ownership | ||
221 | #endif | ||
214 | bic r1, r1, #D_CACHE_LINE_SIZE - 1 | 222 | bic r1, r1, #D_CACHE_LINE_SIZE - 1 |
215 | #ifdef HARVARD_CACHE | 223 | #ifdef HARVARD_CACHE |
216 | mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line | 224 | mcrne p15, 0, r1, c7, c14, 1 @ clean & invalidate D line |
@@ -218,10 +226,6 @@ v6_dma_inv_range: | |||
218 | mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line | 226 | mcrne p15, 0, r1, c7, c15, 1 @ clean & invalidate unified line |
219 | #endif | 227 | #endif |
220 | 1: | 228 | 1: |
221 | #ifdef CONFIG_DMA_CACHE_RWFO | ||
222 | ldr r2, [r0] @ read for ownership | ||
223 | str r2, [r0] @ write for ownership | ||
224 | #endif | ||
225 | #ifdef HARVARD_CACHE | 229 | #ifdef HARVARD_CACHE |
226 | mcr p15, 0, r0, c7, c6, 1 @ invalidate D line | 230 | mcr p15, 0, r0, c7, c6, 1 @ invalidate D line |
227 | #else | 231 | #else |
@@ -229,6 +233,10 @@ v6_dma_inv_range: | |||
229 | #endif | 233 | #endif |
230 | add r0, r0, #D_CACHE_LINE_SIZE | 234 | add r0, r0, #D_CACHE_LINE_SIZE |
231 | cmp r0, r1 | 235 | cmp r0, r1 |
236 | #ifdef CONFIG_DMA_CACHE_RWFO | ||
237 | ldrlo r2, [r0] @ read for ownership | ||
238 | strlo r2, [r0] @ write for ownership | ||
239 | #endif | ||
232 | blo 1b | 240 | blo 1b |
233 | mov r0, #0 | 241 | mov r0, #0 |
234 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 242 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
@@ -263,12 +271,12 @@ v6_dma_clean_range: | |||
263 | * - end - virtual end address of region | 271 | * - end - virtual end address of region |
264 | */ | 272 | */ |
265 | ENTRY(v6_dma_flush_range) | 273 | ENTRY(v6_dma_flush_range) |
266 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | ||
267 | 1: | ||
268 | #ifdef CONFIG_DMA_CACHE_RWFO | 274 | #ifdef CONFIG_DMA_CACHE_RWFO |
269 | ldr r2, [r0] @ read for ownership | 275 | ldrb r2, [r0] @ read for ownership |
270 | str r2, [r0] @ write for ownership | 276 | strb r2, [r0] @ write for ownership |
271 | #endif | 277 | #endif |
278 | bic r0, r0, #D_CACHE_LINE_SIZE - 1 | ||
279 | 1: | ||
272 | #ifdef HARVARD_CACHE | 280 | #ifdef HARVARD_CACHE |
273 | mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line | 281 | mcr p15, 0, r0, c7, c14, 1 @ clean & invalidate D line |
274 | #else | 282 | #else |
@@ -276,6 +284,10 @@ ENTRY(v6_dma_flush_range) | |||
276 | #endif | 284 | #endif |
277 | add r0, r0, #D_CACHE_LINE_SIZE | 285 | add r0, r0, #D_CACHE_LINE_SIZE |
278 | cmp r0, r1 | 286 | cmp r0, r1 |
287 | #ifdef CONFIG_DMA_CACHE_RWFO | ||
288 | ldrlob r2, [r0] @ read for ownership | ||
289 | strlob r2, [r0] @ write for ownership | ||
290 | #endif | ||
279 | blo 1b | 291 | blo 1b |
280 | mov r0, #0 | 292 | mov r0, #0 |
281 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer | 293 | mcr p15, 0, r0, c7, c10, 4 @ drain write buffer |
diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S index a3ebf7a4f49b..6136e68ce953 100644 --- a/arch/arm/mm/cache-v7.S +++ b/arch/arm/mm/cache-v7.S | |||
@@ -173,15 +173,22 @@ ENTRY(v7_coherent_user_range) | |||
173 | UNWIND(.fnstart ) | 173 | UNWIND(.fnstart ) |
174 | dcache_line_size r2, r3 | 174 | dcache_line_size r2, r3 |
175 | sub r3, r2, #1 | 175 | sub r3, r2, #1 |
176 | bic r0, r0, r3 | 176 | bic r12, r0, r3 |
177 | 1: | 177 | 1: |
178 | USER( mcr p15, 0, r0, c7, c11, 1 ) @ clean D line to the point of unification | 178 | USER( mcr p15, 0, r12, c7, c11, 1 ) @ clean D line to the point of unification |
179 | add r12, r12, r2 | ||
180 | cmp r12, r1 | ||
181 | blo 1b | ||
179 | dsb | 182 | dsb |
180 | USER( mcr p15, 0, r0, c7, c5, 1 ) @ invalidate I line | 183 | icache_line_size r2, r3 |
181 | add r0, r0, r2 | 184 | sub r3, r2, #1 |
185 | bic r12, r0, r3 | ||
182 | 2: | 186 | 2: |
183 | cmp r0, r1 | 187 | USER( mcr p15, 0, r12, c7, c5, 1 ) @ invalidate I line |
184 | blo 1b | 188 | add r12, r12, r2 |
189 | cmp r12, r1 | ||
190 | blo 2b | ||
191 | 3: | ||
185 | mov r0, #0 | 192 | mov r0, #0 |
186 | ALT_SMP(mcr p15, 0, r0, c7, c1, 6) @ invalidate BTB Inner Shareable | 193 | ALT_SMP(mcr p15, 0, r0, c7, c1, 6) @ invalidate BTB Inner Shareable |
187 | ALT_UP(mcr p15, 0, r0, c7, c5, 6) @ invalidate BTB | 194 | ALT_UP(mcr p15, 0, r0, c7, c5, 6) @ invalidate BTB |
@@ -194,10 +201,10 @@ ENTRY(v7_coherent_user_range) | |||
194 | * isn't mapped, just try the next page. | 201 | * isn't mapped, just try the next page. |
195 | */ | 202 | */ |
196 | 9001: | 203 | 9001: |
197 | mov r0, r0, lsr #12 | 204 | mov r12, r12, lsr #12 |
198 | mov r0, r0, lsl #12 | 205 | mov r12, r12, lsl #12 |
199 | add r0, r0, #4096 | 206 | add r12, r12, #4096 |
200 | b 2b | 207 | b 3b |
201 | UNWIND(.fnend ) | 208 | UNWIND(.fnend ) |
202 | ENDPROC(v7_coherent_kern_range) | 209 | ENDPROC(v7_coherent_kern_range) |
203 | ENDPROC(v7_coherent_user_range) | 210 | ENDPROC(v7_coherent_user_range) |
diff --git a/arch/arm/mm/proc-macros.S b/arch/arm/mm/proc-macros.S index 7d63beaf9745..b795afd0a2c6 100644 --- a/arch/arm/mm/proc-macros.S +++ b/arch/arm/mm/proc-macros.S | |||
@@ -61,17 +61,27 @@ | |||
61 | .endm | 61 | .endm |
62 | 62 | ||
63 | /* | 63 | /* |
64 | * cache_line_size - get the cache line size from the CSIDR register | 64 | * dcache_line_size - get the minimum D-cache line size from the CTR register |
65 | * (available on ARMv7+). It assumes that the CSSR register was configured | 65 | * on ARMv7. |
66 | * to access the L1 data cache CSIDR. | ||
67 | */ | 66 | */ |
68 | .macro dcache_line_size, reg, tmp | 67 | .macro dcache_line_size, reg, tmp |
69 | mrc p15, 1, \tmp, c0, c0, 0 @ read CSIDR | 68 | mrc p15, 0, \tmp, c0, c0, 1 @ read ctr |
70 | and \tmp, \tmp, #7 @ cache line size encoding | 69 | lsr \tmp, \tmp, #16 |
71 | mov \reg, #16 @ size offset | 70 | and \tmp, \tmp, #0xf @ cache line size encoding |
71 | mov \reg, #4 @ bytes per word | ||
72 | mov \reg, \reg, lsl \tmp @ actual cache line size | 72 | mov \reg, \reg, lsl \tmp @ actual cache line size |
73 | .endm | 73 | .endm |
74 | 74 | ||
75 | /* | ||
76 | * icache_line_size - get the minimum I-cache line size from the CTR register | ||
77 | * on ARMv7. | ||
78 | */ | ||
79 | .macro icache_line_size, reg, tmp | ||
80 | mrc p15, 0, \tmp, c0, c0, 1 @ read ctr | ||
81 | and \tmp, \tmp, #0xf @ cache line size encoding | ||
82 | mov \reg, #4 @ bytes per word | ||
83 | mov \reg, \reg, lsl \tmp @ actual cache line size | ||
84 | .endm | ||
75 | 85 | ||
76 | /* | 86 | /* |
77 | * Sanity check the PTE configuration for the code below - which makes | 87 | * Sanity check the PTE configuration for the code below - which makes |
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-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c index 155fe43a672b..8722a136f3a5 100644 --- a/arch/arm/plat-omap/counter_32k.c +++ b/arch/arm/plat-omap/counter_32k.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
18 | #include <linux/io.h> | 18 | #include <linux/io.h> |
19 | #include <linux/err.h> | ||
19 | 20 | ||
20 | #include <plat/common.h> | 21 | #include <plat/common.h> |
21 | #include <plat/board.h> | 22 | #include <plat/board.h> |
@@ -164,7 +165,7 @@ static int __init omap_init_clocksource_32k(void) | |||
164 | return -ENODEV; | 165 | return -ENODEV; |
165 | 166 | ||
166 | sync_32k_ick = clk_get(NULL, "omap_32ksync_ick"); | 167 | sync_32k_ick = clk_get(NULL, "omap_32ksync_ick"); |
167 | if (sync_32k_ick) | 168 | if (!IS_ERR(sync_32k_ick)) |
168 | clk_enable(sync_32k_ick); | 169 | clk_enable(sync_32k_ick); |
169 | 170 | ||
170 | clocksource_32k.mult = clocksource_hz2mult(32768, | 171 | clocksource_32k.mult = clocksource_hz2mult(32768, |
diff --git a/arch/arm/plat-omap/sram.c b/arch/arm/plat-omap/sram.c index e2c8eebe6b3a..74dac419d328 100644 --- a/arch/arm/plat-omap/sram.c +++ b/arch/arm/plat-omap/sram.c | |||
@@ -166,7 +166,7 @@ static void __init omap_detect_sram(void) | |||
166 | cpu_is_omap1710()) | 166 | cpu_is_omap1710()) |
167 | omap_sram_size = 0x4000; /* 16K */ | 167 | omap_sram_size = 0x4000; /* 16K */ |
168 | else if (cpu_is_omap1611()) | 168 | else if (cpu_is_omap1611()) |
169 | omap_sram_size = 0x3e800; /* 250K */ | 169 | omap_sram_size = SZ_256K; |
170 | else { | 170 | else { |
171 | printk(KERN_ERR "Could not detect SRAM size\n"); | 171 | printk(KERN_ERR "Could not detect SRAM size\n"); |
172 | omap_sram_size = 0x4000; | 172 | omap_sram_size = 0x4000; |
diff --git a/arch/arm/plat-pxa/Makefile b/arch/arm/plat-pxa/Makefile index 4aacdd12c9cc..3aca5ba0f876 100644 --- a/arch/arm/plat-pxa/Makefile +++ b/arch/arm/plat-pxa/Makefile | |||
@@ -6,6 +6,7 @@ obj-y := dma.o | |||
6 | 6 | ||
7 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o | 7 | obj-$(CONFIG_GENERIC_GPIO) += gpio.o |
8 | obj-$(CONFIG_PXA3xx) += mfp.o | 8 | obj-$(CONFIG_PXA3xx) += mfp.o |
9 | obj-$(CONFIG_PXA95x) += mfp.o | ||
9 | obj-$(CONFIG_ARCH_MMP) += mfp.o | 10 | obj-$(CONFIG_ARCH_MMP) += mfp.o |
10 | 11 | ||
11 | obj-$(CONFIG_HAVE_PWM) += pwm.o | 12 | obj-$(CONFIG_HAVE_PWM) += pwm.o |
diff --git a/arch/arm/plat-pxa/include/plat/mfp.h b/arch/arm/plat-pxa/include/plat/mfp.h index 9e604c80618f..75f656471240 100644 --- a/arch/arm/plat-pxa/include/plat/mfp.h +++ b/arch/arm/plat-pxa/include/plat/mfp.h | |||
@@ -423,7 +423,7 @@ typedef unsigned long mfp_cfg_t; | |||
423 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\ | 423 | ((MFP_CFG_DEFAULT & ~(MFP_AF_MASK | MFP_DS_MASK | MFP_LPM_STATE_MASK)) |\ |
424 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm)) | 424 | (MFP_PIN(MFP_PIN_##pin) | MFP_##af | MFP_##drv | MFP_LPM_##lpm)) |
425 | 425 | ||
426 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_ARCH_MMP) | 426 | #if defined(CONFIG_PXA3xx) || defined(CONFIG_PXA95x) || defined(CONFIG_ARCH_MMP) |
427 | /* | 427 | /* |
428 | * each MFP pin will have a MFPR register, since the offset of the | 428 | * each MFP pin will have a MFPR register, since the offset of the |
429 | * register varies between processors, the processor specific code | 429 | * register varies between processors, the processor specific code |
@@ -470,6 +470,6 @@ void mfp_write(int mfp, unsigned long mfpr_val); | |||
470 | void mfp_config(unsigned long *mfp_cfgs, int num); | 470 | void mfp_config(unsigned long *mfp_cfgs, int num); |
471 | void mfp_config_run(void); | 471 | void mfp_config_run(void); |
472 | void mfp_config_lpm(void); | 472 | void mfp_config_lpm(void); |
473 | #endif /* CONFIG_PXA3xx || CONFIG_ARCH_MMP */ | 473 | #endif /* CONFIG_PXA3xx || CONFIG_PXA95x || CONFIG_ARCH_MMP */ |
474 | 474 | ||
475 | #endif /* __ASM_PLAT_MFP_H */ | 475 | #endif /* __ASM_PLAT_MFP_H */ |
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/tools/mach-types b/arch/arm/tools/mach-types index 55590a4d87c9..2fea897ebeb1 100644 --- a/arch/arm/tools/mach-types +++ b/arch/arm/tools/mach-types | |||
@@ -12,7 +12,7 @@ | |||
12 | # | 12 | # |
13 | # http://www.arm.linux.org.uk/developer/machines/?action=new | 13 | # http://www.arm.linux.org.uk/developer/machines/?action=new |
14 | # | 14 | # |
15 | # Last update: Thu Sep 9 22:43:01 2010 | 15 | # Last update: Sun Dec 12 23:24:27 2010 |
16 | # | 16 | # |
17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
18 | # | 18 | # |
@@ -2321,7 +2321,7 @@ mx31txtr MACH_MX31TXTR MX31TXTR 2332 | |||
2321 | u380 MACH_U380 U380 2333 | 2321 | u380 MACH_U380 U380 2333 |
2322 | oamp3_hualu MACH_HUALU_BOARD HUALU_BOARD 2334 | 2322 | oamp3_hualu MACH_HUALU_BOARD HUALU_BOARD 2334 |
2323 | npcmx50 MACH_NPCMX50 NPCMX50 2335 | 2323 | npcmx50 MACH_NPCMX50 NPCMX50 2335 |
2324 | mx51_lange51 MACH_MX51_LANGE51 MX51_LANGE51 2336 | 2324 | mx51_efikamx MACH_MX51_EFIKAMX MX51_EFIKAMX 2336 |
2325 | mx51_lange52 MACH_MX51_LANGE52 MX51_LANGE52 2337 | 2325 | mx51_lange52 MACH_MX51_LANGE52 MX51_LANGE52 2337 |
2326 | riom MACH_RIOM RIOM 2338 | 2326 | riom MACH_RIOM RIOM 2338 |
2327 | comcas MACH_COMCAS COMCAS 2339 | 2327 | comcas MACH_COMCAS COMCAS 2339 |
@@ -2355,7 +2355,7 @@ at91sam9263cs MACH_AT91SAM9263CS AT91SAM9263CS 2366 | |||
2355 | csb732 MACH_CSB732 CSB732 2367 | 2355 | csb732 MACH_CSB732 CSB732 2367 |
2356 | u8500 MACH_U8500 U8500 2368 | 2356 | u8500 MACH_U8500 U8500 2368 |
2357 | huqiu MACH_HUQIU HUQIU 2369 | 2357 | huqiu MACH_HUQIU HUQIU 2369 |
2358 | mx51_kunlun MACH_MX51_KUNLUN MX51_KUNLUN 2370 | 2358 | mx51_efikasb MACH_MX51_EFIKASB MX51_EFIKASB 2370 |
2359 | pmt1g MACH_PMT1G PMT1G 2371 | 2359 | pmt1g MACH_PMT1G PMT1G 2371 |
2360 | htcelf MACH_HTCELF HTCELF 2372 | 2360 | htcelf MACH_HTCELF HTCELF 2372 |
2361 | armadillo420 MACH_ARMADILLO420 ARMADILLO420 2373 | 2361 | armadillo420 MACH_ARMADILLO420 ARMADILLO420 2373 |
@@ -2971,7 +2971,7 @@ premierwave_en MACH_PREMIERWAVE_EN PREMIERWAVE_EN 2985 | |||
2971 | wasabi MACH_WASABI WASABI 2986 | 2971 | wasabi MACH_WASABI WASABI 2986 |
2972 | vivow MACH_VIVOW VIVOW 2987 | 2972 | vivow MACH_VIVOW VIVOW 2987 |
2973 | mx50_rdp MACH_MX50_RDP MX50_RDP 2988 | 2973 | mx50_rdp MACH_MX50_RDP MX50_RDP 2988 |
2974 | universal MACH_UNIVERSAL UNIVERSAL 2989 | 2974 | universal_c210 MACH_UNIVERSAL_C210 UNIVERSAL_C210 2989 |
2975 | real6410 MACH_REAL6410 REAL6410 2990 | 2975 | real6410 MACH_REAL6410 REAL6410 2990 |
2976 | spx_sakura MACH_SPX_SAKURA SPX_SAKURA 2991 | 2976 | spx_sakura MACH_SPX_SAKURA SPX_SAKURA 2991 |
2977 | ij3k_2440 MACH_IJ3K_2440 IJ3K_2440 2992 | 2977 | ij3k_2440 MACH_IJ3K_2440 IJ3K_2440 2992 |
@@ -3044,3 +3044,178 @@ harvest_desoto MACH_HARVEST_DESOTO HARVEST_DESOTO 3059 | |||
3044 | msm8x60_qrdc MACH_MSM8X60_QRDC MSM8X60_QRDC 3060 | 3044 | msm8x60_qrdc MACH_MSM8X60_QRDC MSM8X60_QRDC 3060 |
3045 | spear900 MACH_SPEAR900 SPEAR900 3061 | 3045 | spear900 MACH_SPEAR900 SPEAR900 3061 |
3046 | pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062 | 3046 | pcontrol_g20 MACH_PCONTROL_G20 PCONTROL_G20 3062 |
3047 | rdstor MACH_RDSTOR RDSTOR 3063 | ||
3048 | usdloader MACH_USDLOADER USDLOADER 3064 | ||
3049 | tsoploader MACH_TSOPLOADER TSOPLOADER 3065 | ||
3050 | kronos MACH_KRONOS KRONOS 3066 | ||
3051 | ffcore MACH_FFCORE FFCORE 3067 | ||
3052 | mone MACH_MONE MONE 3068 | ||
3053 | unit2s MACH_UNIT2S UNIT2S 3069 | ||
3054 | acer_a5 MACH_ACER_A5 ACER_A5 3070 | ||
3055 | etherpro_isp MACH_ETHERPRO_ISP ETHERPRO_ISP 3071 | ||
3056 | stretchs7000 MACH_STRETCHS7000 STRETCHS7000 3072 | ||
3057 | p87_smartsim MACH_P87_SMARTSIM P87_SMARTSIM 3073 | ||
3058 | tulip MACH_TULIP TULIP 3074 | ||
3059 | sunflower MACH_SUNFLOWER SUNFLOWER 3075 | ||
3060 | rib MACH_RIB RIB 3076 | ||
3061 | clod MACH_CLOD CLOD 3077 | ||
3062 | rump MACH_RUMP RUMP 3078 | ||
3063 | tenderloin MACH_TENDERLOIN TENDERLOIN 3079 | ||
3064 | shortloin MACH_SHORTLOIN SHORTLOIN 3080 | ||
3065 | crespo MACH_CRESPO CRESPO 3081 | ||
3066 | antares MACH_ANTARES ANTARES 3082 | ||
3067 | wb40n MACH_WB40N WB40N 3083 | ||
3068 | herring MACH_HERRING HERRING 3084 | ||
3069 | naxy400 MACH_NAXY400 NAXY400 3085 | ||
3070 | naxy1200 MACH_NAXY1200 NAXY1200 3086 | ||
3071 | vpr200 MACH_VPR200 VPR200 3087 | ||
3072 | bug20 MACH_BUG20 BUG20 3088 | ||
3073 | goflexnet MACH_GOFLEXNET GOFLEXNET 3089 | ||
3074 | torbreck MACH_TORBRECK TORBRECK 3090 | ||
3075 | saarb_mg1 MACH_SAARB_MG1 SAARB_MG1 3091 | ||
3076 | callisto MACH_CALLISTO CALLISTO 3092 | ||
3077 | multhsu MACH_MULTHSU MULTHSU 3093 | ||
3078 | saluda MACH_SALUDA SALUDA 3094 | ||
3079 | pemp_omap3_apollo MACH_PEMP_OMAP3_APOLLO PEMP_OMAP3_APOLLO 3095 | ||
3080 | vc0718 MACH_VC0718 VC0718 3096 | ||
3081 | mvblx MACH_MVBLX MVBLX 3097 | ||
3082 | inhand_apeiron MACH_INHAND_APEIRON INHAND_APEIRON 3098 | ||
3083 | inhand_fury MACH_INHAND_FURY INHAND_FURY 3099 | ||
3084 | inhand_siren MACH_INHAND_SIREN INHAND_SIREN 3100 | ||
3085 | hdnvp MACH_HDNVP HDNVP 3101 | ||
3086 | softwinner MACH_SOFTWINNER SOFTWINNER 3102 | ||
3087 | prima2_evb MACH_PRIMA2_EVB PRIMA2_EVB 3103 | ||
3088 | nas6210 MACH_NAS6210 NAS6210 3104 | ||
3089 | unisdev MACH_UNISDEV UNISDEV 3105 | ||
3090 | sbca11 MACH_SBCA11 SBCA11 3106 | ||
3091 | saga MACH_SAGA SAGA 3107 | ||
3092 | ns_k330 MACH_NS_K330 NS_K330 3108 | ||
3093 | tanna MACH_TANNA TANNA 3109 | ||
3094 | imate8502 MACH_IMATE8502 IMATE8502 3110 | ||
3095 | aspen MACH_ASPEN ASPEN 3111 | ||
3096 | daintree_cwac MACH_DAINTREE_CWAC DAINTREE_CWAC 3112 | ||
3097 | zmx25 MACH_ZMX25 ZMX25 3113 | ||
3098 | maple1 MACH_MAPLE1 MAPLE1 3114 | ||
3099 | qsd8x72_surf MACH_QSD8X72_SURF QSD8X72_SURF 3115 | ||
3100 | qsd8x72_ffa MACH_QSD8X72_FFA QSD8X72_FFA 3116 | ||
3101 | abilene MACH_ABILENE ABILENE 3117 | ||
3102 | eigen_ttr MACH_EIGEN_TTR EIGEN_TTR 3118 | ||
3103 | iomega_ix2_200 MACH_IOMEGA_IX2_200 IOMEGA_IX2_200 3119 | ||
3104 | coretec_vcx7400 MACH_CORETEC_VCX7400 CORETEC_VCX7400 3120 | ||
3105 | santiago MACH_SANTIAGO SANTIAGO 3121 | ||
3106 | mx257sol MACH_MX257SOL MX257SOL 3122 | ||
3107 | strasbourg MACH_STRASBOURG STRASBOURG 3123 | ||
3108 | msm8x60_fluid MACH_MSM8X60_FLUID MSM8X60_FLUID 3124 | ||
3109 | smartqv5 MACH_SMARTQV5 SMARTQV5 3125 | ||
3110 | smartqv3 MACH_SMARTQV3 SMARTQV3 3126 | ||
3111 | smartqv7 MACH_SMARTQV7 SMARTQV7 3127 | ||
3112 | paz00 MACH_PAZ00 PAZ00 3128 | ||
3113 | acmenetusfoxg20 MACH_ACMENETUSFOXG20 ACMENETUSFOXG20 3129 | ||
3114 | htcwillow MACH_HTCWILLOW HTCWILLOW 3130 | ||
3115 | fwbd_0404 MACH_FWBD_0404 FWBD_0404 3131 | ||
3116 | hdgu MACH_HDGU HDGU 3132 | ||
3117 | pyramid MACH_PYRAMID PYRAMID 3133 | ||
3118 | epiphan MACH_EPIPHAN EPIPHAN 3134 | ||
3119 | omap_bender MACH_OMAP_BENDER OMAP_BENDER 3135 | ||
3120 | gurnard MACH_GURNARD GURNARD 3136 | ||
3121 | gtl_it5100 MACH_GTL_IT5100 GTL_IT5100 3137 | ||
3122 | bcm2708 MACH_BCM2708 BCM2708 3138 | ||
3123 | mx51_ggc MACH_MX51_GGC MX51_GGC 3139 | ||
3124 | sharespace MACH_SHARESPACE SHARESPACE 3140 | ||
3125 | haba_knx_explorer MACH_HABA_KNX_EXPLORER HABA_KNX_EXPLORER 3141 | ||
3126 | simtec_kirkmod MACH_SIMTEC_KIRKMOD SIMTEC_KIRKMOD 3142 | ||
3127 | crux MACH_CRUX CRUX 3143 | ||
3128 | mx51_bravo MACH_MX51_BRAVO MX51_BRAVO 3144 | ||
3129 | charon MACH_CHARON CHARON 3145 | ||
3130 | picocom3 MACH_PICOCOM3 PICOCOM3 3146 | ||
3131 | picocom4 MACH_PICOCOM4 PICOCOM4 3147 | ||
3132 | serrano MACH_SERRANO SERRANO 3148 | ||
3133 | doubleshot MACH_DOUBLESHOT DOUBLESHOT 3149 | ||
3134 | evsy MACH_EVSY EVSY 3150 | ||
3135 | huashan MACH_HUASHAN HUASHAN 3151 | ||
3136 | lausanne MACH_LAUSANNE LAUSANNE 3152 | ||
3137 | emerald MACH_EMERALD EMERALD 3153 | ||
3138 | tqma35 MACH_TQMA35 TQMA35 3154 | ||
3139 | marvel MACH_MARVEL MARVEL 3155 | ||
3140 | manuae MACH_MANUAE MANUAE 3156 | ||
3141 | chacha MACH_CHACHA CHACHA 3157 | ||
3142 | lemon MACH_LEMON LEMON 3158 | ||
3143 | csc MACH_CSC CSC 3159 | ||
3144 | gira_knxip_router MACH_GIRA_KNXIP_ROUTER GIRA_KNXIP_ROUTER 3160 | ||
3145 | t20 MACH_T20 T20 3161 | ||
3146 | hdmini MACH_HDMINI HDMINI 3162 | ||
3147 | sciphone_g2 MACH_SCIPHONE_G2 SCIPHONE_G2 3163 | ||
3148 | express MACH_EXPRESS EXPRESS 3164 | ||
3149 | express_kt MACH_EXPRESS_KT EXPRESS_KT 3165 | ||
3150 | maximasp MACH_MAXIMASP MAXIMASP 3166 | ||
3151 | nitrogen_imx51 MACH_NITROGEN_IMX51 NITROGEN_IMX51 3167 | ||
3152 | nitrogen_imx53 MACH_NITROGEN_IMX53 NITROGEN_IMX53 3168 | ||
3153 | sunfire MACH_SUNFIRE SUNFIRE 3169 | ||
3154 | arowana MACH_AROWANA AROWANA 3170 | ||
3155 | tegra_daytona MACH_TEGRA_DAYTONA TEGRA_DAYTONA 3171 | ||
3156 | tegra_swordfish MACH_TEGRA_SWORDFISH TEGRA_SWORDFISH 3172 | ||
3157 | edison MACH_EDISON EDISON 3173 | ||
3158 | svp8500v1 MACH_SVP8500V1 SVP8500V1 3174 | ||
3159 | svp8500v2 MACH_SVP8500V2 SVP8500V2 3175 | ||
3160 | svp5500 MACH_SVP5500 SVP5500 3176 | ||
3161 | b5500 MACH_B5500 B5500 3177 | ||
3162 | s5500 MACH_S5500 S5500 3178 | ||
3163 | icon MACH_ICON ICON 3179 | ||
3164 | elephant MACH_ELEPHANT ELEPHANT 3180 | ||
3165 | msm8x60_fusion MACH_MSM8X60_FUSION MSM8X60_FUSION 3181 | ||
3166 | shooter MACH_SHOOTER SHOOTER 3182 | ||
3167 | spade_lte MACH_SPADE_LTE SPADE_LTE 3183 | ||
3168 | philhwani MACH_PHILHWANI PHILHWANI 3184 | ||
3169 | gsncomm MACH_GSNCOMM GSNCOMM 3185 | ||
3170 | strasbourg_a2 MACH_STRASBOURG_A2 STRASBOURG_A2 3186 | ||
3171 | mmm MACH_MMM MMM 3187 | ||
3172 | davinci_dm365_bv MACH_DAVINCI_DM365_BV DAVINCI_DM365_BV 3188 | ||
3173 | ag5evm MACH_AG5EVM AG5EVM 3189 | ||
3174 | sc575plc MACH_SC575PLC SC575PLC 3190 | ||
3175 | sc575hmi MACH_SC575IPC SC575IPC 3191 | ||
3176 | omap3_tdm3730 MACH_OMAP3_TDM3730 OMAP3_TDM3730 3192 | ||
3177 | g7 MACH_G7 G7 3193 | ||
3178 | top9000_eval MACH_TOP9000_EVAL TOP9000_EVAL 3194 | ||
3179 | top9000_su MACH_TOP9000_SU TOP9000_SU 3195 | ||
3180 | utm300 MACH_UTM300 UTM300 3196 | ||
3181 | tsunagi MACH_TSUNAGI TSUNAGI 3197 | ||
3182 | ts75xx MACH_TS75XX TS75XX 3198 | ||
3183 | msm8x60_fusn_ffa MACH_MSM8X60_FUSN_FFA MSM8X60_FUSN_FFA 3199 | ||
3184 | ts47xx MACH_TS47XX TS47XX 3200 | ||
3185 | da850_k5 MACH_DA850_K5 DA850_K5 3201 | ||
3186 | ax502 MACH_AX502 AX502 3202 | ||
3187 | igep0032 MACH_IGEP0032 IGEP0032 3203 | ||
3188 | antero MACH_ANTERO ANTERO 3204 | ||
3189 | synergy MACH_SYNERGY SYNERGY 3205 | ||
3190 | ics_if_voip MACH_ICS_IF_VOIP ICS_IF_VOIP 3206 | ||
3191 | wlf_cragg_6410 MACH_WLF_CRAGG_6410 WLF_CRAGG_6410 3207 | ||
3192 | punica MACH_PUNICA PUNICA 3208 | ||
3193 | sbc_nt250 MACH_SBC_NT250 SBC_NT250 3209 | ||
3194 | mx27_wmultra MACH_MX27_WMULTRA MX27_WMULTRA 3210 | ||
3195 | mackerel MACH_MACKEREL MACKEREL 3211 | ||
3196 | fa9x27 MACH_FA9X27 FA9X27 3213 | ||
3197 | ns2816tb MACH_NS2816TB NS2816TB 3214 | ||
3198 | ns2816_ntpad MACH_NS2816_NTPAD NS2816_NTPAD 3215 | ||
3199 | ns2816_ntnb MACH_NS2816_NTNB NS2816_NTNB 3216 | ||
3200 | kaen MACH_KAEN KAEN 3217 | ||
3201 | nv1000 MACH_NV1000 NV1000 3218 | ||
3202 | nuc950ts MACH_NUC950TS NUC950TS 3219 | ||
3203 | nokia_rm680 MACH_NOKIA_RM680 NOKIA_RM680 3220 | ||
3204 | ast2200 MACH_AST2200 AST2200 3221 | ||
3205 | lead MACH_LEAD LEAD 3222 | ||
3206 | unino1 MACH_UNINO1 UNINO1 3223 | ||
3207 | greeco MACH_GREECO GREECO 3224 | ||
3208 | verdi MACH_VERDI VERDI 3225 | ||
3209 | dm6446_adbox MACH_DM6446_ADBOX DM6446_ADBOX 3226 | ||
3210 | quad_salsa MACH_QUAD_SALSA QUAD_SALSA 3227 | ||
3211 | abb_gma_1_1 MACH_ABB_GMA_1_1 ABB_GMA_1_1 3228 | ||
3212 | svcid MACH_SVCID SVCID 3229 | ||
3213 | msm8960_sim MACH_MSM8960_SIM MSM8960_SIM 3230 | ||
3214 | msm8960_rumi3 MACH_MSM8960_RUMI3 MSM8960_RUMI3 3231 | ||
3215 | icon_g MACH_ICON_G ICON_G 3232 | ||
3216 | mb3 MACH_MB3 MB3 3233 | ||
3217 | gsia18s MACH_GSIA18S GSIA18S 3234 | ||
3218 | pivicc MACH_PIVICC PIVICC 3235 | ||
3219 | pcm048 MACH_PCM048 PCM048 3236 | ||
3220 | dds MACH_DDS DDS 3237 | ||
3221 | chalten_xa1 MACH_CHALTEN_XA1 CHALTEN_XA1 3238 | ||
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/Kconfig b/arch/sh/Kconfig index 7f217b3a50a8..2e9d78d21fd3 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig | |||
@@ -22,7 +22,8 @@ config SUPERH | |||
22 | select HAVE_SPARSE_IRQ | 22 | select HAVE_SPARSE_IRQ |
23 | select RTC_LIB | 23 | select RTC_LIB |
24 | select GENERIC_ATOMIC64 | 24 | select GENERIC_ATOMIC64 |
25 | select GENERIC_HARDIRQS_NO_DEPRECATED | 25 | # Support the deprecated APIs until MFD and GPIOLIB catch up. |
26 | select GENERIC_HARDIRQS_NO_DEPRECATED if !MFD_SUPPORT && !GPIOLIB | ||
26 | help | 27 | help |
27 | The SuperH is a RISC processor targeted for use in embedded systems | 28 | The SuperH is a RISC processor targeted for use in embedded systems |
28 | and consumer electronics; it was also used in the Sega Dreamcast | 29 | and consumer electronics; it was also used in the Sega Dreamcast |
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/asm/unistd_32.h b/arch/sh/include/asm/unistd_32.h index 903cd618eb74..d6741fca89a4 100644 --- a/arch/sh/include/asm/unistd_32.h +++ b/arch/sh/include/asm/unistd_32.h | |||
@@ -368,8 +368,9 @@ | |||
368 | #define __NR_sendmsg 355 | 368 | #define __NR_sendmsg 355 |
369 | #define __NR_recvmsg 356 | 369 | #define __NR_recvmsg 356 |
370 | #define __NR_recvmmsg 357 | 370 | #define __NR_recvmmsg 357 |
371 | #define __NR_accept4 358 | ||
371 | 372 | ||
372 | #define NR_syscalls 358 | 373 | #define NR_syscalls 359 |
373 | 374 | ||
374 | #ifdef __KERNEL__ | 375 | #ifdef __KERNEL__ |
375 | 376 | ||
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/kernel/syscalls_32.S b/arch/sh/kernel/syscalls_32.S index e872e81add8a..6fc347ebe59d 100644 --- a/arch/sh/kernel/syscalls_32.S +++ b/arch/sh/kernel/syscalls_32.S | |||
@@ -375,3 +375,4 @@ ENTRY(sys_call_table) | |||
375 | .long sys_sendmsg /* 355 */ | 375 | .long sys_sendmsg /* 355 */ |
376 | .long sys_recvmsg | 376 | .long sys_recvmsg |
377 | .long sys_recvmmsg | 377 | .long sys_recvmmsg |
378 | .long sys_accept4 | ||
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/sparc/include/asm/openprom.h b/arch/sparc/include/asm/openprom.h index 81cd43432dc0..47eaafad15ce 100644 --- a/arch/sparc/include/asm/openprom.h +++ b/arch/sparc/include/asm/openprom.h | |||
@@ -39,7 +39,7 @@ struct linux_dev_v2_funcs { | |||
39 | int (*v2_dev_open)(char *devpath); | 39 | int (*v2_dev_open)(char *devpath); |
40 | void (*v2_dev_close)(int d); | 40 | void (*v2_dev_close)(int d); |
41 | int (*v2_dev_read)(int d, char *buf, int nbytes); | 41 | int (*v2_dev_read)(int d, char *buf, int nbytes); |
42 | int (*v2_dev_write)(int d, char *buf, int nbytes); | 42 | int (*v2_dev_write)(int d, const char *buf, int nbytes); |
43 | int (*v2_dev_seek)(int d, int hi, int lo); | 43 | int (*v2_dev_seek)(int d, int hi, int lo); |
44 | 44 | ||
45 | /* Never issued (multistage load support) */ | 45 | /* Never issued (multistage load support) */ |
diff --git a/arch/sparc/include/asm/oplib_32.h b/arch/sparc/include/asm/oplib_32.h index 51296a6f5005..9e5c64084b86 100644 --- a/arch/sparc/include/asm/oplib_32.h +++ b/arch/sparc/include/asm/oplib_32.h | |||
@@ -60,25 +60,6 @@ extern char *prom_getbootargs(void); | |||
60 | extern char *prom_mapio(char *virt_hint, int io_space, unsigned int phys_addr, unsigned int num_bytes); | 60 | extern char *prom_mapio(char *virt_hint, int io_space, unsigned int phys_addr, unsigned int num_bytes); |
61 | extern void prom_unmapio(char *virt_addr, unsigned int num_bytes); | 61 | extern void prom_unmapio(char *virt_addr, unsigned int num_bytes); |
62 | 62 | ||
63 | /* Device operations. */ | ||
64 | |||
65 | /* Open the device described by the passed string. Note, that the format | ||
66 | * of the string is different on V0 vs. V2->higher proms. The caller must | ||
67 | * know what he/she is doing! Returns the device descriptor, an int. | ||
68 | */ | ||
69 | extern int prom_devopen(char *device_string); | ||
70 | |||
71 | /* Close a previously opened device described by the passed integer | ||
72 | * descriptor. | ||
73 | */ | ||
74 | extern int prom_devclose(int device_handle); | ||
75 | |||
76 | /* Do a seek operation on the device described by the passed integer | ||
77 | * descriptor. | ||
78 | */ | ||
79 | extern void prom_seek(int device_handle, unsigned int seek_hival, | ||
80 | unsigned int seek_lowval); | ||
81 | |||
82 | /* Miscellaneous routines, don't really fit in any category per se. */ | 63 | /* Miscellaneous routines, don't really fit in any category per se. */ |
83 | 64 | ||
84 | /* Reboot the machine with the command line passed. */ | 65 | /* Reboot the machine with the command line passed. */ |
@@ -121,19 +102,8 @@ extern int prom_getrev(void); | |||
121 | /* Get the prom firmware revision. */ | 102 | /* Get the prom firmware revision. */ |
122 | extern int prom_getprev(void); | 103 | extern int prom_getprev(void); |
123 | 104 | ||
124 | /* Character operations to/from the console.... */ | 105 | /* Write a buffer of characters to the console. */ |
125 | 106 | extern void prom_console_write_buf(const char *buf, int len); | |
126 | /* Non-blocking get character from console. */ | ||
127 | extern int prom_nbgetchar(void); | ||
128 | |||
129 | /* Non-blocking put character to console. */ | ||
130 | extern int prom_nbputchar(char character); | ||
131 | |||
132 | /* Blocking get character from console. */ | ||
133 | extern char prom_getchar(void); | ||
134 | |||
135 | /* Blocking put character to console. */ | ||
136 | extern void prom_putchar(char character); | ||
137 | 107 | ||
138 | /* Prom's internal routines, don't use in kernel/boot code. */ | 108 | /* Prom's internal routines, don't use in kernel/boot code. */ |
139 | extern void prom_printf(const char *fmt, ...); | 109 | extern void prom_printf(const char *fmt, ...); |
@@ -238,7 +208,6 @@ extern int prom_node_has_property(phandle node, char *property); | |||
238 | extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, | 208 | extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, |
239 | int value_size); | 209 | int value_size); |
240 | 210 | ||
241 | extern phandle prom_pathtoinode(char *path); | ||
242 | extern phandle prom_inst2pkg(int); | 211 | extern phandle prom_inst2pkg(int); |
243 | 212 | ||
244 | /* Dorking with Bus ranges... */ | 213 | /* Dorking with Bus ranges... */ |
diff --git a/arch/sparc/include/asm/oplib_64.h b/arch/sparc/include/asm/oplib_64.h index c9cc078e3e31..8cd0df34e82b 100644 --- a/arch/sparc/include/asm/oplib_64.h +++ b/arch/sparc/include/asm/oplib_64.h | |||
@@ -67,27 +67,6 @@ extern void prom_init(void *cif_handler, void *cif_stack); | |||
67 | /* Boot argument acquisition, returns the boot command line string. */ | 67 | /* Boot argument acquisition, returns the boot command line string. */ |
68 | extern char *prom_getbootargs(void); | 68 | extern char *prom_getbootargs(void); |
69 | 69 | ||
70 | /* Device utilities. */ | ||
71 | |||
72 | /* Device operations. */ | ||
73 | |||
74 | /* Open the device described by the passed string. Note, that the format | ||
75 | * of the string is different on V0 vs. V2->higher proms. The caller must | ||
76 | * know what he/she is doing! Returns the device descriptor, an int. | ||
77 | */ | ||
78 | extern int prom_devopen(const char *device_string); | ||
79 | |||
80 | /* Close a previously opened device described by the passed integer | ||
81 | * descriptor. | ||
82 | */ | ||
83 | extern int prom_devclose(int device_handle); | ||
84 | |||
85 | /* Do a seek operation on the device described by the passed integer | ||
86 | * descriptor. | ||
87 | */ | ||
88 | extern void prom_seek(int device_handle, unsigned int seek_hival, | ||
89 | unsigned int seek_lowval); | ||
90 | |||
91 | /* Miscellaneous routines, don't really fit in any category per se. */ | 70 | /* Miscellaneous routines, don't really fit in any category per se. */ |
92 | 71 | ||
93 | /* Reboot the machine with the command line passed. */ | 72 | /* Reboot the machine with the command line passed. */ |
@@ -109,33 +88,14 @@ extern void prom_halt(void) __attribute__ ((noreturn)); | |||
109 | /* Halt and power-off the machine. */ | 88 | /* Halt and power-off the machine. */ |
110 | extern void prom_halt_power_off(void) __attribute__ ((noreturn)); | 89 | extern void prom_halt_power_off(void) __attribute__ ((noreturn)); |
111 | 90 | ||
112 | /* Set the PROM 'sync' callback function to the passed function pointer. | ||
113 | * When the user gives the 'sync' command at the prom prompt while the | ||
114 | * kernel is still active, the prom will call this routine. | ||
115 | * | ||
116 | */ | ||
117 | typedef int (*callback_func_t)(long *cmd); | ||
118 | extern void prom_setcallback(callback_func_t func_ptr); | ||
119 | |||
120 | /* Acquire the IDPROM of the root node in the prom device tree. This | 91 | /* Acquire the IDPROM of the root node in the prom device tree. This |
121 | * gets passed a buffer where you would like it stuffed. The return value | 92 | * gets passed a buffer where you would like it stuffed. The return value |
122 | * is the format type of this idprom or 0xff on error. | 93 | * is the format type of this idprom or 0xff on error. |
123 | */ | 94 | */ |
124 | extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); | 95 | extern unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size); |
125 | 96 | ||
126 | /* Character operations to/from the console.... */ | 97 | /* Write a buffer of characters to the console. */ |
127 | 98 | extern void prom_console_write_buf(const char *buf, int len); | |
128 | /* Non-blocking get character from console. */ | ||
129 | extern int prom_nbgetchar(void); | ||
130 | |||
131 | /* Non-blocking put character to console. */ | ||
132 | extern int prom_nbputchar(char character); | ||
133 | |||
134 | /* Blocking get character from console. */ | ||
135 | extern char prom_getchar(void); | ||
136 | |||
137 | /* Blocking put character to console. */ | ||
138 | extern void prom_putchar(char character); | ||
139 | 99 | ||
140 | /* Prom's internal routines, don't use in kernel/boot code. */ | 100 | /* Prom's internal routines, don't use in kernel/boot code. */ |
141 | extern void prom_printf(const char *fmt, ...); | 101 | extern void prom_printf(const char *fmt, ...); |
@@ -279,9 +239,7 @@ extern phandle prom_finddevice(const char *name); | |||
279 | extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, | 239 | extern int prom_setprop(phandle node, const char *prop_name, char *prop_value, |
280 | int value_size); | 240 | int value_size); |
281 | 241 | ||
282 | extern phandle prom_pathtoinode(const char *path); | ||
283 | extern phandle prom_inst2pkg(int); | 242 | extern phandle prom_inst2pkg(int); |
284 | extern int prom_service_exists(const char *service_name); | ||
285 | extern void prom_sun4v_guest_soft_state(void); | 243 | extern void prom_sun4v_guest_soft_state(void); |
286 | 244 | ||
287 | extern int prom_ihandle2path(int handle, char *buffer, int bufsize); | 245 | extern int prom_ihandle2path(int handle, char *buffer, int bufsize); |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index 2d51527d810f..f01c42661ee5 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -114,7 +114,7 @@ void __init leon_init_timers(irq_handler_t counter_fn) | |||
114 | if (leon3_gptimer_regs && leon3_irqctrl_regs) { | 114 | if (leon3_gptimer_regs && leon3_irqctrl_regs) { |
115 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].val, 0); | 115 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].val, 0); |
116 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].rld, | 116 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].rld, |
117 | (((1000000 / 100) - 1))); | 117 | (((1000000 / HZ) - 1))); |
118 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0); | 118 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[0].ctrl, 0); |
119 | 119 | ||
120 | #ifdef CONFIG_SMP | 120 | #ifdef CONFIG_SMP |
@@ -128,7 +128,7 @@ void __init leon_init_timers(irq_handler_t counter_fn) | |||
128 | } | 128 | } |
129 | 129 | ||
130 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].val, 0); | 130 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].val, 0); |
131 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/100) - 1))); | 131 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].rld, (((1000000/HZ) - 1))); |
132 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0); | 132 | LEON3_BYPASS_STORE_PA(&leon3_gptimer_regs->e[1].ctrl, 0); |
133 | # endif | 133 | # endif |
134 | 134 | ||
diff --git a/arch/sparc/prom/Makefile b/arch/sparc/prom/Makefile index 1b8c073adb44..816c0fa12dc0 100644 --- a/arch/sparc/prom/Makefile +++ b/arch/sparc/prom/Makefile | |||
@@ -6,7 +6,6 @@ ccflags := -Werror | |||
6 | 6 | ||
7 | lib-y := bootstr_$(BITS).o | 7 | lib-y := bootstr_$(BITS).o |
8 | lib-$(CONFIG_SPARC32) += devmap.o | 8 | lib-$(CONFIG_SPARC32) += devmap.o |
9 | lib-y += devops_$(BITS).o | ||
10 | lib-y += init_$(BITS).o | 9 | lib-y += init_$(BITS).o |
11 | lib-$(CONFIG_SPARC32) += memory.o | 10 | lib-$(CONFIG_SPARC32) += memory.o |
12 | lib-y += misc_$(BITS).o | 11 | lib-y += misc_$(BITS).o |
diff --git a/arch/sparc/prom/console_32.c b/arch/sparc/prom/console_32.c index 5340264b78f5..48863108a44c 100644 --- a/arch/sparc/prom/console_32.c +++ b/arch/sparc/prom/console_32.c | |||
@@ -16,63 +16,26 @@ | |||
16 | 16 | ||
17 | extern void restore_current(void); | 17 | extern void restore_current(void); |
18 | 18 | ||
19 | /* Non blocking get character from console input device, returns -1 | ||
20 | * if no input was taken. This can be used for polling. | ||
21 | */ | ||
22 | int | ||
23 | prom_nbgetchar(void) | ||
24 | { | ||
25 | static char inc; | ||
26 | int i = -1; | ||
27 | unsigned long flags; | ||
28 | |||
29 | spin_lock_irqsave(&prom_lock, flags); | ||
30 | switch(prom_vers) { | ||
31 | case PROM_V0: | ||
32 | i = (*(romvec->pv_nbgetchar))(); | ||
33 | break; | ||
34 | case PROM_V2: | ||
35 | case PROM_V3: | ||
36 | if( (*(romvec->pv_v2devops).v2_dev_read)(*romvec->pv_v2bootargs.fd_stdin , &inc, 0x1) == 1) { | ||
37 | i = inc; | ||
38 | } else { | ||
39 | i = -1; | ||
40 | } | ||
41 | break; | ||
42 | default: | ||
43 | i = -1; | ||
44 | break; | ||
45 | }; | ||
46 | restore_current(); | ||
47 | spin_unlock_irqrestore(&prom_lock, flags); | ||
48 | return i; /* Ugh, we could spin forever on unsupported proms ;( */ | ||
49 | } | ||
50 | |||
51 | /* Non blocking put character to console device, returns -1 if | 19 | /* Non blocking put character to console device, returns -1 if |
52 | * unsuccessful. | 20 | * unsuccessful. |
53 | */ | 21 | */ |
54 | int | 22 | static int prom_nbputchar(const char *buf) |
55 | prom_nbputchar(char c) | ||
56 | { | 23 | { |
57 | static char outc; | ||
58 | unsigned long flags; | 24 | unsigned long flags; |
59 | int i = -1; | 25 | int i = -1; |
60 | 26 | ||
61 | spin_lock_irqsave(&prom_lock, flags); | 27 | spin_lock_irqsave(&prom_lock, flags); |
62 | switch(prom_vers) { | 28 | switch(prom_vers) { |
63 | case PROM_V0: | 29 | case PROM_V0: |
64 | i = (*(romvec->pv_nbputchar))(c); | 30 | i = (*(romvec->pv_nbputchar))(*buf); |
65 | break; | 31 | break; |
66 | case PROM_V2: | 32 | case PROM_V2: |
67 | case PROM_V3: | 33 | case PROM_V3: |
68 | outc = c; | 34 | if ((*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout, |
69 | if( (*(romvec->pv_v2devops).v2_dev_write)(*romvec->pv_v2bootargs.fd_stdout, &outc, 0x1) == 1) | 35 | buf, 0x1) == 1) |
70 | i = 0; | 36 | i = 0; |
71 | else | ||
72 | i = -1; | ||
73 | break; | 37 | break; |
74 | default: | 38 | default: |
75 | i = -1; | ||
76 | break; | 39 | break; |
77 | }; | 40 | }; |
78 | restore_current(); | 41 | restore_current(); |
@@ -80,18 +43,14 @@ prom_nbputchar(char c) | |||
80 | return i; /* Ugh, we could spin forever on unsupported proms ;( */ | 43 | return i; /* Ugh, we could spin forever on unsupported proms ;( */ |
81 | } | 44 | } |
82 | 45 | ||
83 | /* Blocking version of get character routine above. */ | 46 | void prom_console_write_buf(const char *buf, int len) |
84 | char | ||
85 | prom_getchar(void) | ||
86 | { | 47 | { |
87 | int character; | 48 | while (len) { |
88 | while((character = prom_nbgetchar()) == -1) ; | 49 | int n = prom_nbputchar(buf); |
89 | return (char) character; | 50 | if (n) |
51 | continue; | ||
52 | len--; | ||
53 | buf++; | ||
54 | } | ||
90 | } | 55 | } |
91 | 56 | ||
92 | /* Blocking version of put character routine above. */ | ||
93 | void | ||
94 | prom_putchar(char c) | ||
95 | { | ||
96 | while(prom_nbputchar(c) == -1) ; | ||
97 | } | ||
diff --git a/arch/sparc/prom/console_64.c b/arch/sparc/prom/console_64.c index 10322dc2f557..ed39e75828bd 100644 --- a/arch/sparc/prom/console_64.c +++ b/arch/sparc/prom/console_64.c | |||
@@ -15,85 +15,34 @@ | |||
15 | 15 | ||
16 | extern int prom_stdin, prom_stdout; | 16 | extern int prom_stdin, prom_stdout; |
17 | 17 | ||
18 | /* Non blocking get character from console input device, returns -1 | 18 | static int __prom_console_write_buf(const char *buf, int len) |
19 | * if no input was taken. This can be used for polling. | ||
20 | */ | ||
21 | inline int | ||
22 | prom_nbgetchar(void) | ||
23 | { | ||
24 | unsigned long args[7]; | ||
25 | char inc; | ||
26 | |||
27 | args[0] = (unsigned long) "read"; | ||
28 | args[1] = 3; | ||
29 | args[2] = 1; | ||
30 | args[3] = (unsigned int) prom_stdin; | ||
31 | args[4] = (unsigned long) &inc; | ||
32 | args[5] = 1; | ||
33 | args[6] = (unsigned long) -1; | ||
34 | |||
35 | p1275_cmd_direct(args); | ||
36 | |||
37 | if (args[6] == 1) | ||
38 | return inc; | ||
39 | return -1; | ||
40 | } | ||
41 | |||
42 | /* Non blocking put character to console device, returns -1 if | ||
43 | * unsuccessful. | ||
44 | */ | ||
45 | inline int | ||
46 | prom_nbputchar(char c) | ||
47 | { | 19 | { |
48 | unsigned long args[7]; | 20 | unsigned long args[7]; |
49 | char outc; | 21 | int ret; |
50 | |||
51 | outc = c; | ||
52 | 22 | ||
53 | args[0] = (unsigned long) "write"; | 23 | args[0] = (unsigned long) "write"; |
54 | args[1] = 3; | 24 | args[1] = 3; |
55 | args[2] = 1; | 25 | args[2] = 1; |
56 | args[3] = (unsigned int) prom_stdout; | 26 | args[3] = (unsigned int) prom_stdout; |
57 | args[4] = (unsigned long) &outc; | 27 | args[4] = (unsigned long) buf; |
58 | args[5] = 1; | 28 | args[5] = (unsigned int) len; |
59 | args[6] = (unsigned long) -1; | 29 | args[6] = (unsigned long) -1; |
60 | 30 | ||
61 | p1275_cmd_direct(args); | 31 | p1275_cmd_direct(args); |
62 | 32 | ||
63 | if (args[6] == 1) | 33 | ret = (int) args[6]; |
64 | return 0; | 34 | if (ret < 0) |
65 | else | ||
66 | return -1; | 35 | return -1; |
36 | return ret; | ||
67 | } | 37 | } |
68 | 38 | ||
69 | /* Blocking version of get character routine above. */ | 39 | void prom_console_write_buf(const char *buf, int len) |
70 | char | ||
71 | prom_getchar(void) | ||
72 | { | ||
73 | int character; | ||
74 | while((character = prom_nbgetchar()) == -1) ; | ||
75 | return (char) character; | ||
76 | } | ||
77 | |||
78 | /* Blocking version of put character routine above. */ | ||
79 | void | ||
80 | prom_putchar(char c) | ||
81 | { | 40 | { |
82 | prom_nbputchar(c); | 41 | while (len) { |
83 | } | 42 | int n = __prom_console_write_buf(buf, len); |
84 | 43 | if (n < 0) | |
85 | void | 44 | continue; |
86 | prom_puts(const char *s, int len) | 45 | len -= n; |
87 | { | 46 | buf += len; |
88 | unsigned long args[7]; | 47 | } |
89 | |||
90 | args[0] = (unsigned long) "write"; | ||
91 | args[1] = 3; | ||
92 | args[2] = 1; | ||
93 | args[3] = (unsigned int) prom_stdout; | ||
94 | args[4] = (unsigned long) s; | ||
95 | args[5] = len; | ||
96 | args[6] = (unsigned long) -1; | ||
97 | |||
98 | p1275_cmd_direct(args); | ||
99 | } | 48 | } |
diff --git a/arch/sparc/prom/devops_32.c b/arch/sparc/prom/devops_32.c deleted file mode 100644 index 9c5d4687242a..000000000000 --- a/arch/sparc/prom/devops_32.c +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | /* | ||
2 | * devops.c: Device operations using the PROM. | ||
3 | * | ||
4 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | ||
5 | */ | ||
6 | #include <linux/types.h> | ||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/sched.h> | ||
9 | |||
10 | #include <asm/openprom.h> | ||
11 | #include <asm/oplib.h> | ||
12 | |||
13 | extern void restore_current(void); | ||
14 | |||
15 | /* Open the device described by the string 'dstr'. Returns the handle | ||
16 | * to that device used for subsequent operations on that device. | ||
17 | * Returns -1 on failure. | ||
18 | */ | ||
19 | int | ||
20 | prom_devopen(char *dstr) | ||
21 | { | ||
22 | int handle; | ||
23 | unsigned long flags; | ||
24 | spin_lock_irqsave(&prom_lock, flags); | ||
25 | switch(prom_vers) { | ||
26 | case PROM_V0: | ||
27 | handle = (*(romvec->pv_v0devops.v0_devopen))(dstr); | ||
28 | if(handle == 0) handle = -1; | ||
29 | break; | ||
30 | case PROM_V2: | ||
31 | case PROM_V3: | ||
32 | handle = (*(romvec->pv_v2devops.v2_dev_open))(dstr); | ||
33 | break; | ||
34 | default: | ||
35 | handle = -1; | ||
36 | break; | ||
37 | }; | ||
38 | restore_current(); | ||
39 | spin_unlock_irqrestore(&prom_lock, flags); | ||
40 | |||
41 | return handle; | ||
42 | } | ||
43 | |||
44 | /* Close the device described by device handle 'dhandle'. */ | ||
45 | int | ||
46 | prom_devclose(int dhandle) | ||
47 | { | ||
48 | unsigned long flags; | ||
49 | spin_lock_irqsave(&prom_lock, flags); | ||
50 | switch(prom_vers) { | ||
51 | case PROM_V0: | ||
52 | (*(romvec->pv_v0devops.v0_devclose))(dhandle); | ||
53 | break; | ||
54 | case PROM_V2: | ||
55 | case PROM_V3: | ||
56 | (*(romvec->pv_v2devops.v2_dev_close))(dhandle); | ||
57 | break; | ||
58 | default: | ||
59 | break; | ||
60 | }; | ||
61 | restore_current(); | ||
62 | spin_unlock_irqrestore(&prom_lock, flags); | ||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | /* Seek to specified location described by 'seekhi' and 'seeklo' | ||
67 | * for device 'dhandle'. | ||
68 | */ | ||
69 | void | ||
70 | prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo) | ||
71 | { | ||
72 | unsigned long flags; | ||
73 | spin_lock_irqsave(&prom_lock, flags); | ||
74 | switch(prom_vers) { | ||
75 | case PROM_V0: | ||
76 | (*(romvec->pv_v0devops.v0_seekdev))(dhandle, seekhi, seeklo); | ||
77 | break; | ||
78 | case PROM_V2: | ||
79 | case PROM_V3: | ||
80 | (*(romvec->pv_v2devops.v2_dev_seek))(dhandle, seekhi, seeklo); | ||
81 | break; | ||
82 | default: | ||
83 | break; | ||
84 | }; | ||
85 | restore_current(); | ||
86 | spin_unlock_irqrestore(&prom_lock, flags); | ||
87 | } | ||
diff --git a/arch/sparc/prom/devops_64.c b/arch/sparc/prom/devops_64.c deleted file mode 100644 index a017119e7ef1..000000000000 --- a/arch/sparc/prom/devops_64.c +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | /* | ||
2 | * devops.c: Device operations using the PROM. | ||
3 | * | ||
4 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) | ||
5 | * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz) | ||
6 | */ | ||
7 | #include <linux/types.h> | ||
8 | #include <linux/kernel.h> | ||
9 | #include <linux/sched.h> | ||
10 | |||
11 | #include <asm/openprom.h> | ||
12 | #include <asm/oplib.h> | ||
13 | |||
14 | /* Open the device described by the string 'dstr'. Returns the handle | ||
15 | * to that device used for subsequent operations on that device. | ||
16 | * Returns 0 on failure. | ||
17 | */ | ||
18 | int | ||
19 | prom_devopen(const char *dstr) | ||
20 | { | ||
21 | unsigned long args[5]; | ||
22 | |||
23 | args[0] = (unsigned long) "open"; | ||
24 | args[1] = 1; | ||
25 | args[2] = 1; | ||
26 | args[3] = (unsigned long) dstr; | ||
27 | args[4] = (unsigned long) -1; | ||
28 | |||
29 | p1275_cmd_direct(args); | ||
30 | |||
31 | return (int) args[4]; | ||
32 | } | ||
33 | |||
34 | /* Close the device described by device handle 'dhandle'. */ | ||
35 | int | ||
36 | prom_devclose(int dhandle) | ||
37 | { | ||
38 | unsigned long args[4]; | ||
39 | |||
40 | args[0] = (unsigned long) "close"; | ||
41 | args[1] = 1; | ||
42 | args[2] = 0; | ||
43 | args[3] = (unsigned int) dhandle; | ||
44 | |||
45 | p1275_cmd_direct(args); | ||
46 | |||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | /* Seek to specified location described by 'seekhi' and 'seeklo' | ||
51 | * for device 'dhandle'. | ||
52 | */ | ||
53 | void | ||
54 | prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo) | ||
55 | { | ||
56 | unsigned long args[7]; | ||
57 | |||
58 | args[0] = (unsigned long) "seek"; | ||
59 | args[1] = 3; | ||
60 | args[2] = 1; | ||
61 | args[3] = (unsigned int) dhandle; | ||
62 | args[4] = seekhi; | ||
63 | args[5] = seeklo; | ||
64 | args[6] = (unsigned long) -1; | ||
65 | |||
66 | p1275_cmd_direct(args); | ||
67 | } | ||
diff --git a/arch/sparc/prom/misc_64.c b/arch/sparc/prom/misc_64.c index d24bc44e361e..e4f31d4d3715 100644 --- a/arch/sparc/prom/misc_64.c +++ b/arch/sparc/prom/misc_64.c | |||
@@ -18,7 +18,7 @@ | |||
18 | #include <asm/system.h> | 18 | #include <asm/system.h> |
19 | #include <asm/ldc.h> | 19 | #include <asm/ldc.h> |
20 | 20 | ||
21 | int prom_service_exists(const char *service_name) | 21 | static int prom_service_exists(const char *service_name) |
22 | { | 22 | { |
23 | unsigned long args[5]; | 23 | unsigned long args[5]; |
24 | 24 | ||
@@ -150,20 +150,6 @@ void prom_halt_power_off(void) | |||
150 | prom_halt(); | 150 | prom_halt(); |
151 | } | 151 | } |
152 | 152 | ||
153 | /* Set prom sync handler to call function 'funcp'. */ | ||
154 | void prom_setcallback(callback_func_t funcp) | ||
155 | { | ||
156 | unsigned long args[5]; | ||
157 | if (!funcp) | ||
158 | return; | ||
159 | args[0] = (unsigned long) "set-callback"; | ||
160 | args[1] = 1; | ||
161 | args[2] = 1; | ||
162 | args[3] = (unsigned long) funcp; | ||
163 | args[4] = (unsigned long) -1; | ||
164 | p1275_cmd_direct(args); | ||
165 | } | ||
166 | |||
167 | /* Get the idprom and stuff it into buffer 'idbuf'. Returns the | 153 | /* Get the idprom and stuff it into buffer 'idbuf'. Returns the |
168 | * format type. 'num_bytes' is the number of bytes that your idbuf | 154 | * format type. 'num_bytes' is the number of bytes that your idbuf |
169 | * has space for. Returns 0xff on error. | 155 | * has space for. Returns 0xff on error. |
diff --git a/arch/sparc/prom/printf.c b/arch/sparc/prom/printf.c index ca869266b9f3..d9682f06b3b0 100644 --- a/arch/sparc/prom/printf.c +++ b/arch/sparc/prom/printf.c | |||
@@ -15,22 +15,45 @@ | |||
15 | 15 | ||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
18 | #include <linux/spinlock.h> | ||
18 | 19 | ||
19 | #include <asm/openprom.h> | 20 | #include <asm/openprom.h> |
20 | #include <asm/oplib.h> | 21 | #include <asm/oplib.h> |
21 | 22 | ||
23 | #define CONSOLE_WRITE_BUF_SIZE 1024 | ||
24 | |||
22 | static char ppbuf[1024]; | 25 | static char ppbuf[1024]; |
26 | static char console_write_buf[CONSOLE_WRITE_BUF_SIZE]; | ||
27 | static DEFINE_RAW_SPINLOCK(console_write_lock); | ||
23 | 28 | ||
24 | void notrace prom_write(const char *buf, unsigned int n) | 29 | void notrace prom_write(const char *buf, unsigned int n) |
25 | { | 30 | { |
26 | char ch; | 31 | unsigned int dest_len; |
32 | unsigned long flags; | ||
33 | char *dest; | ||
34 | |||
35 | dest = console_write_buf; | ||
36 | raw_spin_lock_irqsave(&console_write_lock, flags); | ||
27 | 37 | ||
28 | while (n != 0) { | 38 | dest_len = 0; |
29 | --n; | 39 | while (n-- != 0) { |
30 | if ((ch = *buf++) == '\n') | 40 | char ch = *buf++; |
31 | prom_putchar('\r'); | 41 | if (ch == '\n') { |
32 | prom_putchar(ch); | 42 | *dest++ = '\r'; |
43 | dest_len++; | ||
44 | } | ||
45 | *dest++ = ch; | ||
46 | dest_len++; | ||
47 | if (dest_len >= CONSOLE_WRITE_BUF_SIZE - 1) { | ||
48 | prom_console_write_buf(console_write_buf, dest_len); | ||
49 | dest = console_write_buf; | ||
50 | dest_len = 0; | ||
51 | } | ||
33 | } | 52 | } |
53 | if (dest_len) | ||
54 | prom_console_write_buf(console_write_buf, dest_len); | ||
55 | |||
56 | raw_spin_unlock_irqrestore(&console_write_lock, flags); | ||
34 | } | 57 | } |
35 | 58 | ||
36 | void notrace prom_printf(const char *fmt, ...) | 59 | void notrace prom_printf(const char *fmt, ...) |
diff --git a/arch/sparc/prom/tree_32.c b/arch/sparc/prom/tree_32.c index 63e08e149774..535e2e69ac1d 100644 --- a/arch/sparc/prom/tree_32.c +++ b/arch/sparc/prom/tree_32.c | |||
@@ -342,19 +342,3 @@ phandle prom_inst2pkg(int inst) | |||
342 | if (node == -1) return 0; | 342 | if (node == -1) return 0; |
343 | return node; | 343 | return node; |
344 | } | 344 | } |
345 | |||
346 | /* Return 'node' assigned to a particular prom 'path' | ||
347 | * FIXME: Should work for v0 as well | ||
348 | */ | ||
349 | phandle prom_pathtoinode(char *path) | ||
350 | { | ||
351 | phandle node; | ||
352 | int inst; | ||
353 | |||
354 | inst = prom_devopen (path); | ||
355 | if (inst == -1) return 0; | ||
356 | node = prom_inst2pkg (inst); | ||
357 | prom_devclose (inst); | ||
358 | if (node == -1) return 0; | ||
359 | return node; | ||
360 | } | ||
diff --git a/arch/sparc/prom/tree_64.c b/arch/sparc/prom/tree_64.c index 691be68932f8..d93660048376 100644 --- a/arch/sparc/prom/tree_64.c +++ b/arch/sparc/prom/tree_64.c | |||
@@ -374,24 +374,6 @@ inline phandle prom_inst2pkg(int inst) | |||
374 | return node; | 374 | return node; |
375 | } | 375 | } |
376 | 376 | ||
377 | /* Return 'node' assigned to a particular prom 'path' | ||
378 | * FIXME: Should work for v0 as well | ||
379 | */ | ||
380 | phandle prom_pathtoinode(const char *path) | ||
381 | { | ||
382 | phandle node; | ||
383 | int inst; | ||
384 | |||
385 | inst = prom_devopen (path); | ||
386 | if (inst == 0) | ||
387 | return 0; | ||
388 | node = prom_inst2pkg(inst); | ||
389 | prom_devclose(inst); | ||
390 | if (node == -1) | ||
391 | return 0; | ||
392 | return node; | ||
393 | } | ||
394 | |||
395 | int prom_ihandle2path(int handle, char *buffer, int bufsize) | 377 | int prom_ihandle2path(int handle, char *buffer, int bufsize) |
396 | { | 378 | { |
397 | unsigned long args[7]; | 379 | unsigned long args[7]; |
diff --git a/arch/x86/crypto/ghash-clmulni-intel_glue.c b/arch/x86/crypto/ghash-clmulni-intel_glue.c index cbcc8d8ea93a..7a6e68e4f748 100644 --- a/arch/x86/crypto/ghash-clmulni-intel_glue.c +++ b/arch/x86/crypto/ghash-clmulni-intel_glue.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * by the Free Software Foundation. | 10 | * by the Free Software Foundation. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/err.h> | ||
13 | #include <linux/module.h> | 14 | #include <linux/module.h> |
14 | #include <linux/init.h> | 15 | #include <linux/init.h> |
15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
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/block/bsg.c b/block/bsg.c index f20d6a789d48..0c8b64a16484 100644 --- a/block/bsg.c +++ b/block/bsg.c | |||
@@ -250,6 +250,14 @@ bsg_map_hdr(struct bsg_device *bd, struct sg_io_v4 *hdr, fmode_t has_write_perm, | |||
250 | int ret, rw; | 250 | int ret, rw; |
251 | unsigned int dxfer_len; | 251 | unsigned int dxfer_len; |
252 | void *dxferp = NULL; | 252 | void *dxferp = NULL; |
253 | struct bsg_class_device *bcd = &q->bsg_dev; | ||
254 | |||
255 | /* if the LLD has been removed then the bsg_unregister_queue will | ||
256 | * eventually be called and the class_dev was freed, so we can no | ||
257 | * longer use this request_queue. Return no such address. | ||
258 | */ | ||
259 | if (!bcd->class_dev) | ||
260 | return ERR_PTR(-ENXIO); | ||
253 | 261 | ||
254 | dprintk("map hdr %llx/%u %llx/%u\n", (unsigned long long) hdr->dout_xferp, | 262 | dprintk("map hdr %llx/%u %llx/%u\n", (unsigned long long) hdr->dout_xferp, |
255 | hdr->dout_xfer_len, (unsigned long long) hdr->din_xferp, | 263 | hdr->dout_xfer_len, (unsigned long long) hdr->din_xferp, |
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/atm/adummy.c b/drivers/atm/adummy.c index 46b94762125b..f9b983ae6877 100644 --- a/drivers/atm/adummy.c +++ b/drivers/atm/adummy.c | |||
@@ -154,7 +154,7 @@ static int __init adummy_init(void) | |||
154 | err = -ENOMEM; | 154 | err = -ENOMEM; |
155 | goto out; | 155 | goto out; |
156 | } | 156 | } |
157 | atm_dev = atm_dev_register(DEV_LABEL, &adummy_ops, -1, NULL); | 157 | atm_dev = atm_dev_register(DEV_LABEL, NULL, &adummy_ops, -1, NULL); |
158 | if (!atm_dev) { | 158 | if (!atm_dev) { |
159 | printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); | 159 | printk(KERN_ERR DEV_LABEL ": atm_dev_register() failed\n"); |
160 | err = -ENODEV; | 160 | err = -ENODEV; |
diff --git a/drivers/atm/ambassador.c b/drivers/atm/ambassador.c index a33896a482e6..ffe9b655292e 100644 --- a/drivers/atm/ambassador.c +++ b/drivers/atm/ambassador.c | |||
@@ -2244,7 +2244,8 @@ static int __devinit amb_probe(struct pci_dev *pci_dev, const struct pci_device_ | |||
2244 | goto out_reset; | 2244 | goto out_reset; |
2245 | } | 2245 | } |
2246 | 2246 | ||
2247 | dev->atm_dev = atm_dev_register (DEV_LABEL, &amb_ops, -1, NULL); | 2247 | dev->atm_dev = atm_dev_register (DEV_LABEL, &pci_dev->dev, &amb_ops, -1, |
2248 | NULL); | ||
2248 | if (!dev->atm_dev) { | 2249 | if (!dev->atm_dev) { |
2249 | PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); | 2250 | PRINTD (DBG_ERR, "failed to register Madge ATM adapter"); |
2250 | err = -EINVAL; | 2251 | err = -EINVAL; |
diff --git a/drivers/atm/atmtcp.c b/drivers/atm/atmtcp.c index b9101818b47b..2b464b631f22 100644 --- a/drivers/atm/atmtcp.c +++ b/drivers/atm/atmtcp.c | |||
@@ -366,7 +366,7 @@ static int atmtcp_create(int itf,int persist,struct atm_dev **result) | |||
366 | if (!dev_data) | 366 | if (!dev_data) |
367 | return -ENOMEM; | 367 | return -ENOMEM; |
368 | 368 | ||
369 | dev = atm_dev_register(DEV_LABEL,&atmtcp_v_dev_ops,itf,NULL); | 369 | dev = atm_dev_register(DEV_LABEL,NULL,&atmtcp_v_dev_ops,itf,NULL); |
370 | if (!dev) { | 370 | if (!dev) { |
371 | kfree(dev_data); | 371 | kfree(dev_data); |
372 | return itf == -1 ? -ENOMEM : -EBUSY; | 372 | return itf == -1 ? -ENOMEM : -EBUSY; |
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 97c5898cd76e..c495fae74200 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c | |||
@@ -2244,7 +2244,7 @@ static int __devinit eni_init_one(struct pci_dev *pci_dev, | |||
2244 | &zeroes); | 2244 | &zeroes); |
2245 | if (!cpu_zeroes) goto out1; | 2245 | if (!cpu_zeroes) goto out1; |
2246 | } | 2246 | } |
2247 | dev = atm_dev_register(DEV_LABEL,&ops,-1,NULL); | 2247 | dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL); |
2248 | if (!dev) goto out2; | 2248 | if (!dev) goto out2; |
2249 | pci_set_drvdata(pci_dev, dev); | 2249 | pci_set_drvdata(pci_dev, dev); |
2250 | eni_dev->pci_dev = pci_dev; | 2250 | eni_dev->pci_dev = pci_dev; |
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c index 5d86bb803e94..7d912baf01d4 100644 --- a/drivers/atm/firestream.c +++ b/drivers/atm/firestream.c | |||
@@ -1911,7 +1911,7 @@ static int __devinit firestream_init_one (struct pci_dev *pci_dev, | |||
1911 | fs_dev, sizeof (struct fs_dev)); | 1911 | fs_dev, sizeof (struct fs_dev)); |
1912 | if (!fs_dev) | 1912 | if (!fs_dev) |
1913 | goto err_out; | 1913 | goto err_out; |
1914 | atm_dev = atm_dev_register("fs", &ops, -1, NULL); | 1914 | atm_dev = atm_dev_register("fs", &pci_dev->dev, &ops, -1, NULL); |
1915 | if (!atm_dev) | 1915 | if (!atm_dev) |
1916 | goto err_out_free_fs_dev; | 1916 | goto err_out_free_fs_dev; |
1917 | 1917 | ||
diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index c8fc69c85a06..962c309b40c0 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c | |||
@@ -2567,14 +2567,14 @@ release: | |||
2567 | 2567 | ||
2568 | 2568 | ||
2569 | static int __devinit | 2569 | static int __devinit |
2570 | fore200e_register(struct fore200e* fore200e) | 2570 | fore200e_register(struct fore200e* fore200e, struct device *parent) |
2571 | { | 2571 | { |
2572 | struct atm_dev* atm_dev; | 2572 | struct atm_dev* atm_dev; |
2573 | 2573 | ||
2574 | DPRINTK(2, "device %s being registered\n", fore200e->name); | 2574 | DPRINTK(2, "device %s being registered\n", fore200e->name); |
2575 | 2575 | ||
2576 | atm_dev = atm_dev_register(fore200e->bus->proc_name, &fore200e_ops, -1, | 2576 | atm_dev = atm_dev_register(fore200e->bus->proc_name, parent, &fore200e_ops, |
2577 | NULL); | 2577 | -1, NULL); |
2578 | if (atm_dev == NULL) { | 2578 | if (atm_dev == NULL) { |
2579 | printk(FORE200E "unable to register device %s\n", fore200e->name); | 2579 | printk(FORE200E "unable to register device %s\n", fore200e->name); |
2580 | return -ENODEV; | 2580 | return -ENODEV; |
@@ -2594,9 +2594,9 @@ fore200e_register(struct fore200e* fore200e) | |||
2594 | 2594 | ||
2595 | 2595 | ||
2596 | static int __devinit | 2596 | static int __devinit |
2597 | fore200e_init(struct fore200e* fore200e) | 2597 | fore200e_init(struct fore200e* fore200e, struct device *parent) |
2598 | { | 2598 | { |
2599 | if (fore200e_register(fore200e) < 0) | 2599 | if (fore200e_register(fore200e, parent) < 0) |
2600 | return -ENODEV; | 2600 | return -ENODEV; |
2601 | 2601 | ||
2602 | if (fore200e->bus->configure(fore200e) < 0) | 2602 | if (fore200e->bus->configure(fore200e) < 0) |
@@ -2662,7 +2662,7 @@ static int __devinit fore200e_sba_probe(struct platform_device *op, | |||
2662 | 2662 | ||
2663 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); | 2663 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); |
2664 | 2664 | ||
2665 | err = fore200e_init(fore200e); | 2665 | err = fore200e_init(fore200e, &op->dev); |
2666 | if (err < 0) { | 2666 | if (err < 0) { |
2667 | fore200e_shutdown(fore200e); | 2667 | fore200e_shutdown(fore200e); |
2668 | kfree(fore200e); | 2668 | kfree(fore200e); |
@@ -2740,7 +2740,7 @@ fore200e_pca_detect(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent | |||
2740 | 2740 | ||
2741 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); | 2741 | sprintf(fore200e->name, "%s-%d", bus->model_name, index); |
2742 | 2742 | ||
2743 | err = fore200e_init(fore200e); | 2743 | err = fore200e_init(fore200e, &pci_dev->dev); |
2744 | if (err < 0) { | 2744 | if (err < 0) { |
2745 | fore200e_shutdown(fore200e); | 2745 | fore200e_shutdown(fore200e); |
2746 | goto out_free; | 2746 | goto out_free; |
diff --git a/drivers/atm/he.c b/drivers/atm/he.c index 801e8b6e9d1f..6cf59bf281dc 100644 --- a/drivers/atm/he.c +++ b/drivers/atm/he.c | |||
@@ -366,7 +366,7 @@ he_init_one(struct pci_dev *pci_dev, const struct pci_device_id *pci_ent) | |||
366 | goto init_one_failure; | 366 | goto init_one_failure; |
367 | } | 367 | } |
368 | 368 | ||
369 | atm_dev = atm_dev_register(DEV_LABEL, &he_ops, -1, NULL); | 369 | atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &he_ops, -1, NULL); |
370 | if (!atm_dev) { | 370 | if (!atm_dev) { |
371 | err = -ENODEV; | 371 | err = -ENODEV; |
372 | goto init_one_failure; | 372 | goto init_one_failure; |
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index a95790452a68..24761e1d6642 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c | |||
@@ -2733,7 +2733,8 @@ static int __devinit hrz_probe(struct pci_dev *pci_dev, const struct pci_device_ | |||
2733 | PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", | 2733 | PRINTD(DBG_INFO, "found Madge ATM adapter (hrz) at: IO %x, IRQ %u, MEM %p", |
2734 | iobase, irq, membase); | 2734 | iobase, irq, membase); |
2735 | 2735 | ||
2736 | dev->atm_dev = atm_dev_register(DEV_LABEL, &hrz_ops, -1, NULL); | 2736 | dev->atm_dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &hrz_ops, -1, |
2737 | NULL); | ||
2737 | if (!(dev->atm_dev)) { | 2738 | if (!(dev->atm_dev)) { |
2738 | PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); | 2739 | PRINTD(DBG_ERR, "failed to register Madge ATM adapter"); |
2739 | err = -EINVAL; | 2740 | err = -EINVAL; |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index bce57328ddde..bfb7feee0400 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -3698,7 +3698,8 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) | |||
3698 | goto err_out_iounmap; | 3698 | goto err_out_iounmap; |
3699 | } | 3699 | } |
3700 | 3700 | ||
3701 | dev = atm_dev_register("idt77252", &idt77252_ops, -1, NULL); | 3701 | dev = atm_dev_register("idt77252", &pcidev->dev, &idt77252_ops, -1, |
3702 | NULL); | ||
3702 | if (!dev) { | 3703 | if (!dev) { |
3703 | printk("%s: can't register atm device\n", card->name); | 3704 | printk("%s: can't register atm device\n", card->name); |
3704 | err = -EIO; | 3705 | err = -EIO; |
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 9309d4724e13..729254053758 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -3172,7 +3172,7 @@ static int __devinit ia_init_one(struct pci_dev *pdev, | |||
3172 | ret = -ENODEV; | 3172 | ret = -ENODEV; |
3173 | goto err_out_free_iadev; | 3173 | goto err_out_free_iadev; |
3174 | } | 3174 | } |
3175 | dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 3175 | dev = atm_dev_register(DEV_LABEL, &pdev->dev, &ops, -1, NULL); |
3176 | if (!dev) { | 3176 | if (!dev) { |
3177 | ret = -ENOMEM; | 3177 | ret = -ENOMEM; |
3178 | goto err_out_disable_dev; | 3178 | goto err_out_disable_dev; |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index cbe15a86c669..a395c9aab146 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -2591,7 +2591,7 @@ static int __devinit lanai_init_one(struct pci_dev *pci, | |||
2591 | return -ENOMEM; | 2591 | return -ENOMEM; |
2592 | } | 2592 | } |
2593 | 2593 | ||
2594 | atmdev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 2594 | atmdev = atm_dev_register(DEV_LABEL, &pci->dev, &ops, -1, NULL); |
2595 | if (atmdev == NULL) { | 2595 | if (atmdev == NULL) { |
2596 | printk(KERN_ERR DEV_LABEL | 2596 | printk(KERN_ERR DEV_LABEL |
2597 | ": couldn't register atm device!\n"); | 2597 | ": couldn't register atm device!\n"); |
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c index 2f3516b7f118..6b313ee9231b 100644 --- a/drivers/atm/nicstar.c +++ b/drivers/atm/nicstar.c | |||
@@ -771,7 +771,8 @@ static int __devinit ns_init_card(int i, struct pci_dev *pcidev) | |||
771 | } | 771 | } |
772 | 772 | ||
773 | /* Register device */ | 773 | /* Register device */ |
774 | card->atmdev = atm_dev_register("nicstar", &atm_ops, -1, NULL); | 774 | card->atmdev = atm_dev_register("nicstar", &card->pcidev->dev, &atm_ops, |
775 | -1, NULL); | ||
775 | if (card->atmdev == NULL) { | 776 | if (card->atmdev == NULL) { |
776 | printk("nicstar%d: can't register device.\n", i); | 777 | printk("nicstar%d: can't register device.\n", i); |
777 | error = 17; | 778 | error = 17; |
diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c index 2e08c996fd30..73fb1c4f4cd4 100644 --- a/drivers/atm/solos-pci.c +++ b/drivers/atm/solos-pci.c | |||
@@ -166,7 +166,7 @@ static irqreturn_t solos_irq(int irq, void *dev_id); | |||
166 | static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); | 166 | static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci); |
167 | static int list_vccs(int vci); | 167 | static int list_vccs(int vci); |
168 | static void release_vccs(struct atm_dev *dev); | 168 | static void release_vccs(struct atm_dev *dev); |
169 | static int atm_init(struct solos_card *); | 169 | static int atm_init(struct solos_card *, struct device *); |
170 | static void atm_remove(struct solos_card *); | 170 | static void atm_remove(struct solos_card *); |
171 | static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); | 171 | static int send_command(struct solos_card *card, int dev, const char *buf, size_t size); |
172 | static void solos_bh(unsigned long); | 172 | static void solos_bh(unsigned long); |
@@ -1210,7 +1210,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1210 | if (db_firmware_upgrade) | 1210 | if (db_firmware_upgrade) |
1211 | flash_upgrade(card, 3); | 1211 | flash_upgrade(card, 3); |
1212 | 1212 | ||
1213 | err = atm_init(card); | 1213 | err = atm_init(card, &dev->dev); |
1214 | if (err) | 1214 | if (err) |
1215 | goto out_free_irq; | 1215 | goto out_free_irq; |
1216 | 1216 | ||
@@ -1233,7 +1233,7 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1233 | return err; | 1233 | return err; |
1234 | } | 1234 | } |
1235 | 1235 | ||
1236 | static int atm_init(struct solos_card *card) | 1236 | static int atm_init(struct solos_card *card, struct device *parent) |
1237 | { | 1237 | { |
1238 | int i; | 1238 | int i; |
1239 | 1239 | ||
@@ -1244,7 +1244,7 @@ static int atm_init(struct solos_card *card) | |||
1244 | skb_queue_head_init(&card->tx_queue[i]); | 1244 | skb_queue_head_init(&card->tx_queue[i]); |
1245 | skb_queue_head_init(&card->cli_queue[i]); | 1245 | skb_queue_head_init(&card->cli_queue[i]); |
1246 | 1246 | ||
1247 | card->atmdev[i] = atm_dev_register("solos-pci", &fpga_ops, -1, NULL); | 1247 | card->atmdev[i] = atm_dev_register("solos-pci", parent, &fpga_ops, -1, NULL); |
1248 | if (!card->atmdev[i]) { | 1248 | if (!card->atmdev[i]) { |
1249 | dev_err(&card->dev->dev, "Could not register ATM device %d\n", i); | 1249 | dev_err(&card->dev->dev, "Could not register ATM device %d\n", i); |
1250 | atm_remove(card); | 1250 | atm_remove(card); |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 4e885d2da49c..624917902b65 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -1597,7 +1597,7 @@ static int __devinit zatm_init_one(struct pci_dev *pci_dev, | |||
1597 | goto out; | 1597 | goto out; |
1598 | } | 1598 | } |
1599 | 1599 | ||
1600 | dev = atm_dev_register(DEV_LABEL, &ops, -1, NULL); | 1600 | dev = atm_dev_register(DEV_LABEL, &pci_dev->dev, &ops, -1, NULL); |
1601 | if (!dev) | 1601 | if (!dev) |
1602 | goto out_free; | 1602 | goto out_free; |
1603 | 1603 | ||
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/block/xen-blkfront.c b/drivers/block/xen-blkfront.c index 4f9e22f29138..657873e4328d 100644 --- a/drivers/block/xen-blkfront.c +++ b/drivers/block/xen-blkfront.c | |||
@@ -72,7 +72,7 @@ struct blk_shadow { | |||
72 | static DEFINE_MUTEX(blkfront_mutex); | 72 | static DEFINE_MUTEX(blkfront_mutex); |
73 | static const struct block_device_operations xlvbd_block_fops; | 73 | static const struct block_device_operations xlvbd_block_fops; |
74 | 74 | ||
75 | #define BLK_RING_SIZE __RING_SIZE((struct blkif_sring *)0, PAGE_SIZE) | 75 | #define BLK_RING_SIZE __CONST_RING_SIZE(blkif, PAGE_SIZE) |
76 | 76 | ||
77 | /* | 77 | /* |
78 | * We have one of these per vbd, whether ide, scsi or 'other'. They | 78 | * We have one of these per vbd, whether ide, scsi or 'other'. They |
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c index 128cae4e8629..949ed09c6361 100644 --- a/drivers/bluetooth/ath3k.c +++ b/drivers/bluetooth/ath3k.c | |||
@@ -35,6 +35,10 @@ | |||
35 | static struct usb_device_id ath3k_table[] = { | 35 | static struct usb_device_id ath3k_table[] = { |
36 | /* Atheros AR3011 */ | 36 | /* Atheros AR3011 */ |
37 | { USB_DEVICE(0x0CF3, 0x3000) }, | 37 | { USB_DEVICE(0x0CF3, 0x3000) }, |
38 | |||
39 | /* Atheros AR3011 with sflash firmware*/ | ||
40 | { USB_DEVICE(0x0CF3, 0x3002) }, | ||
41 | |||
38 | { } /* Terminating entry */ | 42 | { } /* Terminating entry */ |
39 | }; | 43 | }; |
40 | 44 | ||
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index ab3894f742c3..1da773f899a2 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c | |||
@@ -99,6 +99,9 @@ static struct usb_device_id blacklist_table[] = { | |||
99 | /* Broadcom BCM2033 without firmware */ | 99 | /* Broadcom BCM2033 without firmware */ |
100 | { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, | 100 | { USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE }, |
101 | 101 | ||
102 | /* Atheros 3011 with sflash firmware */ | ||
103 | { USB_DEVICE(0x0cf3, 0x3002), .driver_info = BTUSB_IGNORE }, | ||
104 | |||
102 | /* Broadcom BCM2035 */ | 105 | /* Broadcom BCM2035 */ |
103 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, | 106 | { USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU }, |
104 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, | 107 | { USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU }, |
@@ -239,7 +242,8 @@ static void btusb_intr_complete(struct urb *urb) | |||
239 | 242 | ||
240 | err = usb_submit_urb(urb, GFP_ATOMIC); | 243 | err = usb_submit_urb(urb, GFP_ATOMIC); |
241 | if (err < 0) { | 244 | if (err < 0) { |
242 | BT_ERR("%s urb %p failed to resubmit (%d)", | 245 | if (err != -EPERM) |
246 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
243 | hdev->name, urb, -err); | 247 | hdev->name, urb, -err); |
244 | usb_unanchor_urb(urb); | 248 | usb_unanchor_urb(urb); |
245 | } | 249 | } |
@@ -323,7 +327,8 @@ static void btusb_bulk_complete(struct urb *urb) | |||
323 | 327 | ||
324 | err = usb_submit_urb(urb, GFP_ATOMIC); | 328 | err = usb_submit_urb(urb, GFP_ATOMIC); |
325 | if (err < 0) { | 329 | if (err < 0) { |
326 | BT_ERR("%s urb %p failed to resubmit (%d)", | 330 | if (err != -EPERM) |
331 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
327 | hdev->name, urb, -err); | 332 | hdev->name, urb, -err); |
328 | usb_unanchor_urb(urb); | 333 | usb_unanchor_urb(urb); |
329 | } | 334 | } |
@@ -412,7 +417,8 @@ static void btusb_isoc_complete(struct urb *urb) | |||
412 | 417 | ||
413 | err = usb_submit_urb(urb, GFP_ATOMIC); | 418 | err = usb_submit_urb(urb, GFP_ATOMIC); |
414 | if (err < 0) { | 419 | if (err < 0) { |
415 | BT_ERR("%s urb %p failed to resubmit (%d)", | 420 | if (err != -EPERM) |
421 | BT_ERR("%s urb %p failed to resubmit (%d)", | ||
416 | hdev->name, urb, -err); | 422 | hdev->name, urb, -err); |
417 | usb_unanchor_urb(urb); | 423 | usb_unanchor_urb(urb); |
418 | } | 424 | } |
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/connector/connector.c b/drivers/connector/connector.c index e16c3fa8d2e3..05117f1ad867 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -36,6 +36,7 @@ | |||
36 | MODULE_LICENSE("GPL"); | 36 | MODULE_LICENSE("GPL"); |
37 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); | 37 | MODULE_AUTHOR("Evgeniy Polyakov <zbr@ioremap.net>"); |
38 | MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); | 38 | MODULE_DESCRIPTION("Generic userspace <-> kernelspace connector."); |
39 | MODULE_ALIAS_NET_PF_PROTO(PF_NETLINK, NETLINK_CONNECTOR); | ||
39 | 40 | ||
40 | static struct cn_dev cdev; | 41 | static struct cn_dev cdev; |
41 | 42 | ||
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/i2c/busses/i2c-intel-mid.c b/drivers/i2c/busses/i2c-intel-mid.c index 80f70d3a744d..c71492782bbd 100644 --- a/drivers/i2c/busses/i2c-intel-mid.c +++ b/drivers/i2c/busses/i2c-intel-mid.c | |||
@@ -999,7 +999,7 @@ static int __devinit intel_mid_i2c_probe(struct pci_dev *dev, | |||
999 | 999 | ||
1000 | /* Initialize struct members */ | 1000 | /* Initialize struct members */ |
1001 | snprintf(mrst->adap.name, sizeof(mrst->adap.name), | 1001 | snprintf(mrst->adap.name, sizeof(mrst->adap.name), |
1002 | "MRST/Medfield I2C at %lx", start); | 1002 | "Intel MID I2C at %lx", start); |
1003 | mrst->adap.owner = THIS_MODULE; | 1003 | mrst->adap.owner = THIS_MODULE; |
1004 | mrst->adap.algo = &intel_mid_i2c_algorithm; | 1004 | mrst->adap.algo = &intel_mid_i2c_algorithm; |
1005 | mrst->adap.dev.parent = &dev->dev; | 1005 | mrst->adap.dev.parent = &dev->dev; |
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/md/md.c b/drivers/md/md.c index 84c46a161927..e71c5fa527f5 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -371,10 +371,15 @@ static void md_end_flush(struct bio *bio, int err) | |||
371 | bio_put(bio); | 371 | bio_put(bio); |
372 | } | 372 | } |
373 | 373 | ||
374 | static void submit_flushes(mddev_t *mddev) | 374 | static void md_submit_flush_data(struct work_struct *ws); |
375 | |||
376 | static void submit_flushes(struct work_struct *ws) | ||
375 | { | 377 | { |
378 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); | ||
376 | mdk_rdev_t *rdev; | 379 | mdk_rdev_t *rdev; |
377 | 380 | ||
381 | INIT_WORK(&mddev->flush_work, md_submit_flush_data); | ||
382 | atomic_set(&mddev->flush_pending, 1); | ||
378 | rcu_read_lock(); | 383 | rcu_read_lock(); |
379 | list_for_each_entry_rcu(rdev, &mddev->disks, same_set) | 384 | list_for_each_entry_rcu(rdev, &mddev->disks, same_set) |
380 | if (rdev->raid_disk >= 0 && | 385 | if (rdev->raid_disk >= 0 && |
@@ -397,6 +402,8 @@ static void submit_flushes(mddev_t *mddev) | |||
397 | rdev_dec_pending(rdev, mddev); | 402 | rdev_dec_pending(rdev, mddev); |
398 | } | 403 | } |
399 | rcu_read_unlock(); | 404 | rcu_read_unlock(); |
405 | if (atomic_dec_and_test(&mddev->flush_pending)) | ||
406 | queue_work(md_wq, &mddev->flush_work); | ||
400 | } | 407 | } |
401 | 408 | ||
402 | static void md_submit_flush_data(struct work_struct *ws) | 409 | static void md_submit_flush_data(struct work_struct *ws) |
@@ -404,8 +411,6 @@ static void md_submit_flush_data(struct work_struct *ws) | |||
404 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); | 411 | mddev_t *mddev = container_of(ws, mddev_t, flush_work); |
405 | struct bio *bio = mddev->flush_bio; | 412 | struct bio *bio = mddev->flush_bio; |
406 | 413 | ||
407 | atomic_set(&mddev->flush_pending, 1); | ||
408 | |||
409 | if (bio->bi_size == 0) | 414 | if (bio->bi_size == 0) |
410 | /* an empty barrier - all done */ | 415 | /* an empty barrier - all done */ |
411 | bio_endio(bio, 0); | 416 | bio_endio(bio, 0); |
@@ -414,10 +419,9 @@ static void md_submit_flush_data(struct work_struct *ws) | |||
414 | if (mddev->pers->make_request(mddev, bio)) | 419 | if (mddev->pers->make_request(mddev, bio)) |
415 | generic_make_request(bio); | 420 | generic_make_request(bio); |
416 | } | 421 | } |
417 | if (atomic_dec_and_test(&mddev->flush_pending)) { | 422 | |
418 | mddev->flush_bio = NULL; | 423 | mddev->flush_bio = NULL; |
419 | wake_up(&mddev->sb_wait); | 424 | wake_up(&mddev->sb_wait); |
420 | } | ||
421 | } | 425 | } |
422 | 426 | ||
423 | void md_flush_request(mddev_t *mddev, struct bio *bio) | 427 | void md_flush_request(mddev_t *mddev, struct bio *bio) |
@@ -429,13 +433,8 @@ void md_flush_request(mddev_t *mddev, struct bio *bio) | |||
429 | mddev->flush_bio = bio; | 433 | mddev->flush_bio = bio; |
430 | spin_unlock_irq(&mddev->write_lock); | 434 | spin_unlock_irq(&mddev->write_lock); |
431 | 435 | ||
432 | atomic_set(&mddev->flush_pending, 1); | 436 | INIT_WORK(&mddev->flush_work, submit_flushes); |
433 | INIT_WORK(&mddev->flush_work, md_submit_flush_data); | 437 | queue_work(md_wq, &mddev->flush_work); |
434 | |||
435 | submit_flushes(mddev); | ||
436 | |||
437 | if (atomic_dec_and_test(&mddev->flush_pending)) | ||
438 | queue_work(md_wq, &mddev->flush_work); | ||
439 | } | 438 | } |
440 | EXPORT_SYMBOL(md_flush_request); | 439 | EXPORT_SYMBOL(md_flush_request); |
441 | 440 | ||
@@ -5160,7 +5159,7 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
5160 | PTR_ERR(rdev)); | 5159 | PTR_ERR(rdev)); |
5161 | return PTR_ERR(rdev); | 5160 | return PTR_ERR(rdev); |
5162 | } | 5161 | } |
5163 | /* set save_raid_disk if appropriate */ | 5162 | /* set saved_raid_disk if appropriate */ |
5164 | if (!mddev->persistent) { | 5163 | if (!mddev->persistent) { |
5165 | if (info->state & (1<<MD_DISK_SYNC) && | 5164 | if (info->state & (1<<MD_DISK_SYNC) && |
5166 | info->raid_disk < mddev->raid_disks) | 5165 | info->raid_disk < mddev->raid_disks) |
@@ -5170,7 +5169,10 @@ static int add_new_disk(mddev_t * mddev, mdu_disk_info_t *info) | |||
5170 | } else | 5169 | } else |
5171 | super_types[mddev->major_version]. | 5170 | super_types[mddev->major_version]. |
5172 | validate_super(mddev, rdev); | 5171 | validate_super(mddev, rdev); |
5173 | rdev->saved_raid_disk = rdev->raid_disk; | 5172 | if (test_bit(In_sync, &rdev->flags)) |
5173 | rdev->saved_raid_disk = rdev->raid_disk; | ||
5174 | else | ||
5175 | rdev->saved_raid_disk = -1; | ||
5174 | 5176 | ||
5175 | clear_bit(In_sync, &rdev->flags); /* just to be sure */ | 5177 | clear_bit(In_sync, &rdev->flags); /* just to be sure */ |
5176 | if (info->state & (1<<MD_DISK_WRITEMOSTLY)) | 5178 | if (info->state & (1<<MD_DISK_WRITEMOSTLY)) |
@@ -6042,9 +6044,8 @@ static int md_thread(void * arg) | |||
6042 | || kthread_should_stop(), | 6044 | || kthread_should_stop(), |
6043 | thread->timeout); | 6045 | thread->timeout); |
6044 | 6046 | ||
6045 | clear_bit(THREAD_WAKEUP, &thread->flags); | 6047 | if (test_and_clear_bit(THREAD_WAKEUP, &thread->flags)) |
6046 | 6048 | thread->run(thread->mddev); | |
6047 | thread->run(thread->mddev); | ||
6048 | } | 6049 | } |
6049 | 6050 | ||
6050 | return 0; | 6051 | return 0; |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index c67aa54694ae..0641674827f0 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -2397,13 +2397,13 @@ static int run(mddev_t *mddev) | |||
2397 | return 0; | 2397 | return 0; |
2398 | 2398 | ||
2399 | out_free_conf: | 2399 | out_free_conf: |
2400 | md_unregister_thread(mddev->thread); | ||
2400 | if (conf->r10bio_pool) | 2401 | if (conf->r10bio_pool) |
2401 | mempool_destroy(conf->r10bio_pool); | 2402 | mempool_destroy(conf->r10bio_pool); |
2402 | safe_put_page(conf->tmppage); | 2403 | safe_put_page(conf->tmppage); |
2403 | kfree(conf->mirrors); | 2404 | kfree(conf->mirrors); |
2404 | kfree(conf); | 2405 | kfree(conf); |
2405 | mddev->private = NULL; | 2406 | mddev->private = NULL; |
2406 | md_unregister_thread(mddev->thread); | ||
2407 | out: | 2407 | out: |
2408 | return -EIO; | 2408 | return -EIO; |
2409 | } | 2409 | } |
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/maps/pxa2xx-flash.c b/drivers/mtd/maps/pxa2xx-flash.c index dd90880048cf..d8ae634d347e 100644 --- a/drivers/mtd/maps/pxa2xx-flash.c +++ b/drivers/mtd/maps/pxa2xx-flash.c | |||
@@ -51,7 +51,7 @@ struct pxa2xx_flash_info { | |||
51 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; | 51 | static const char *probes[] = { "RedBoot", "cmdlinepart", NULL }; |
52 | 52 | ||
53 | 53 | ||
54 | static int __init pxa2xx_flash_probe(struct platform_device *pdev) | 54 | static int __devinit pxa2xx_flash_probe(struct platform_device *pdev) |
55 | { | 55 | { |
56 | struct flash_platform_data *flash = pdev->dev.platform_data; | 56 | struct flash_platform_data *flash = pdev->dev.platform_data; |
57 | struct pxa2xx_flash_info *info; | 57 | struct pxa2xx_flash_info *info; |
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c index cd41c58b5bbd..15682ec8530e 100644 --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c | |||
@@ -7,7 +7,6 @@ | |||
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | #define CONFIG_MTD_NAND_OMAP_HWECC | ||
11 | 10 | ||
12 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
13 | #include <linux/dma-mapping.h> | 12 | #include <linux/dma-mapping.h> |
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/b44.c b/drivers/net/b44.c index c6e86315b3f8..2e2b76258ab4 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -381,11 +381,11 @@ static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote) | |||
381 | __b44_set_flow_ctrl(bp, pause_enab); | 381 | __b44_set_flow_ctrl(bp, pause_enab); |
382 | } | 382 | } |
383 | 383 | ||
384 | #ifdef SSB_DRIVER_MIPS | 384 | #ifdef CONFIG_BCM47XX |
385 | extern char *nvram_get(char *name); | 385 | #include <asm/mach-bcm47xx/nvram.h> |
386 | static void b44_wap54g10_workaround(struct b44 *bp) | 386 | static void b44_wap54g10_workaround(struct b44 *bp) |
387 | { | 387 | { |
388 | const char *str; | 388 | char buf[20]; |
389 | u32 val; | 389 | u32 val; |
390 | int err; | 390 | int err; |
391 | 391 | ||
@@ -394,10 +394,9 @@ static void b44_wap54g10_workaround(struct b44 *bp) | |||
394 | * see https://dev.openwrt.org/ticket/146 | 394 | * see https://dev.openwrt.org/ticket/146 |
395 | * check and reset bit "isolate" | 395 | * check and reset bit "isolate" |
396 | */ | 396 | */ |
397 | str = nvram_get("boardnum"); | 397 | if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0) |
398 | if (!str) | ||
399 | return; | 398 | return; |
400 | if (simple_strtoul(str, NULL, 0) == 2) { | 399 | if (simple_strtoul(buf, NULL, 0) == 2) { |
401 | err = __b44_readphy(bp, 0, MII_BMCR, &val); | 400 | err = __b44_readphy(bp, 0, MII_BMCR, &val); |
402 | if (err) | 401 | if (err) |
403 | goto error; | 402 | goto error; |
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 36eca1ce75d4..e4465d222a7d 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -1235,7 +1235,7 @@ int be_cmd_multicast_set(struct be_adapter *adapter, u32 if_id, | |||
1235 | 1235 | ||
1236 | i = 0; | 1236 | i = 0; |
1237 | netdev_for_each_mc_addr(ha, netdev) | 1237 | netdev_for_each_mc_addr(ha, netdev) |
1238 | memcpy(req->mac[i].byte, ha->addr, ETH_ALEN); | 1238 | memcpy(req->mac[i++].byte, ha->addr, ETH_ALEN); |
1239 | } else { | 1239 | } else { |
1240 | req->promiscuous = 1; | 1240 | req->promiscuous = 1; |
1241 | } | 1241 | } |
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index 863e73a85fbe..d255428122fc 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h | |||
@@ -20,8 +20,8 @@ | |||
20 | * (you will need to reboot afterwards) */ | 20 | * (you will need to reboot afterwards) */ |
21 | /* #define BNX2X_STOP_ON_ERROR */ | 21 | /* #define BNX2X_STOP_ON_ERROR */ |
22 | 22 | ||
23 | #define DRV_MODULE_VERSION "1.60.00-4" | 23 | #define DRV_MODULE_VERSION "1.60.01-0" |
24 | #define DRV_MODULE_RELDATE "2010/11/01" | 24 | #define DRV_MODULE_RELDATE "2010/11/12" |
25 | #define BNX2X_BC_VER 0x040200 | 25 | #define BNX2X_BC_VER 0x040200 |
26 | 26 | ||
27 | #define BNX2X_MULTI_QUEUE | 27 | #define BNX2X_MULTI_QUEUE |
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c index 94d5f59d5a6f..0af361e4e3d1 100644 --- a/drivers/net/bnx2x/bnx2x_cmn.c +++ b/drivers/net/bnx2x/bnx2x_cmn.c | |||
@@ -1782,15 +1782,15 @@ exit_lbl: | |||
1782 | } | 1782 | } |
1783 | #endif | 1783 | #endif |
1784 | 1784 | ||
1785 | static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, | 1785 | static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data, |
1786 | struct eth_tx_parse_bd_e2 *pbd, | 1786 | u32 xmit_type) |
1787 | u32 xmit_type) | ||
1788 | { | 1787 | { |
1789 | pbd->parsing_data |= cpu_to_le16(skb_shinfo(skb)->gso_size) << | 1788 | *parsing_data |= (skb_shinfo(skb)->gso_size << |
1790 | ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT; | 1789 | ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT) & |
1790 | ETH_TX_PARSE_BD_E2_LSO_MSS; | ||
1791 | if ((xmit_type & XMIT_GSO_V6) && | 1791 | if ((xmit_type & XMIT_GSO_V6) && |
1792 | (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6)) | 1792 | (ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6)) |
1793 | pbd->parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR; | 1793 | *parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR; |
1794 | } | 1794 | } |
1795 | 1795 | ||
1796 | /** | 1796 | /** |
@@ -1835,15 +1835,15 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb, | |||
1835 | * @return header len | 1835 | * @return header len |
1836 | */ | 1836 | */ |
1837 | static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, | 1837 | static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb, |
1838 | struct eth_tx_parse_bd_e2 *pbd, | 1838 | u32 *parsing_data, u32 xmit_type) |
1839 | u32 xmit_type) | ||
1840 | { | 1839 | { |
1841 | pbd->parsing_data |= cpu_to_le16(tcp_hdrlen(skb)/4) << | 1840 | *parsing_data |= ((tcp_hdrlen(skb)/4) << |
1842 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT; | 1841 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) & |
1842 | ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW; | ||
1843 | 1843 | ||
1844 | pbd->parsing_data |= cpu_to_le16(((unsigned char *)tcp_hdr(skb) - | 1844 | *parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) << |
1845 | skb->data) / 2) << | 1845 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) & |
1846 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT; | 1846 | ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W; |
1847 | 1847 | ||
1848 | return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; | 1848 | return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data; |
1849 | } | 1849 | } |
@@ -1912,6 +1912,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1912 | struct eth_tx_bd *tx_data_bd, *total_pkt_bd = NULL; | 1912 | struct eth_tx_bd *tx_data_bd, *total_pkt_bd = NULL; |
1913 | struct eth_tx_parse_bd_e1x *pbd_e1x = NULL; | 1913 | struct eth_tx_parse_bd_e1x *pbd_e1x = NULL; |
1914 | struct eth_tx_parse_bd_e2 *pbd_e2 = NULL; | 1914 | struct eth_tx_parse_bd_e2 *pbd_e2 = NULL; |
1915 | u32 pbd_e2_parsing_data = 0; | ||
1915 | u16 pkt_prod, bd_prod; | 1916 | u16 pkt_prod, bd_prod; |
1916 | int nbd, fp_index; | 1917 | int nbd, fp_index; |
1917 | dma_addr_t mapping; | 1918 | dma_addr_t mapping; |
@@ -2033,8 +2034,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2033 | memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2)); | 2034 | memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2)); |
2034 | /* Set PBD in checksum offload case */ | 2035 | /* Set PBD in checksum offload case */ |
2035 | if (xmit_type & XMIT_CSUM) | 2036 | if (xmit_type & XMIT_CSUM) |
2036 | hlen = bnx2x_set_pbd_csum_e2(bp, | 2037 | hlen = bnx2x_set_pbd_csum_e2(bp, skb, |
2037 | skb, pbd_e2, xmit_type); | 2038 | &pbd_e2_parsing_data, |
2039 | xmit_type); | ||
2038 | } else { | 2040 | } else { |
2039 | pbd_e1x = &fp->tx_desc_ring[bd_prod].parse_bd_e1x; | 2041 | pbd_e1x = &fp->tx_desc_ring[bd_prod].parse_bd_e1x; |
2040 | memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x)); | 2042 | memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x)); |
@@ -2076,10 +2078,18 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2076 | bd_prod = bnx2x_tx_split(bp, fp, tx_buf, &tx_start_bd, | 2078 | bd_prod = bnx2x_tx_split(bp, fp, tx_buf, &tx_start_bd, |
2077 | hlen, bd_prod, ++nbd); | 2079 | hlen, bd_prod, ++nbd); |
2078 | if (CHIP_IS_E2(bp)) | 2080 | if (CHIP_IS_E2(bp)) |
2079 | bnx2x_set_pbd_gso_e2(skb, pbd_e2, xmit_type); | 2081 | bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data, |
2082 | xmit_type); | ||
2080 | else | 2083 | else |
2081 | bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); | 2084 | bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type); |
2082 | } | 2085 | } |
2086 | |||
2087 | /* Set the PBD's parsing_data field if not zero | ||
2088 | * (for the chips newer than 57711). | ||
2089 | */ | ||
2090 | if (pbd_e2_parsing_data) | ||
2091 | pbd_e2->parsing_data = cpu_to_le32(pbd_e2_parsing_data); | ||
2092 | |||
2083 | tx_data_bd = (struct eth_tx_bd *)tx_start_bd; | 2093 | tx_data_bd = (struct eth_tx_bd *)tx_start_bd; |
2084 | 2094 | ||
2085 | /* Handle fragmented skb */ | 2095 | /* Handle fragmented skb */ |
diff --git a/drivers/net/bnx2x/bnx2x_init_ops.h b/drivers/net/bnx2x/bnx2x_init_ops.h index a306b0e46b61..66df29fcf751 100644 --- a/drivers/net/bnx2x/bnx2x_init_ops.h +++ b/drivers/net/bnx2x/bnx2x_init_ops.h | |||
@@ -838,7 +838,7 @@ static void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count, | |||
838 | /**************************************************************************** | 838 | /**************************************************************************** |
839 | * SRC initializations | 839 | * SRC initializations |
840 | ****************************************************************************/ | 840 | ****************************************************************************/ |
841 | 841 | #ifdef BCM_CNIC | |
842 | /* called during init func stage */ | 842 | /* called during init func stage */ |
843 | static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, | 843 | static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, |
844 | dma_addr_t t2_mapping, int src_cid_count) | 844 | dma_addr_t t2_mapping, int src_cid_count) |
@@ -862,5 +862,5 @@ static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2, | |||
862 | U64_HI((u64)t2_mapping + | 862 | U64_HI((u64)t2_mapping + |
863 | (src_cid_count-1) * sizeof(struct src_ent))); | 863 | (src_cid_count-1) * sizeof(struct src_ent))); |
864 | } | 864 | } |
865 | 865 | #endif | |
866 | #endif /* BNX2X_INIT_OPS_H */ | 866 | #endif /* BNX2X_INIT_OPS_H */ |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 71a169740d05..d0ea760ce419 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -171,7 +171,7 @@ MODULE_PARM_DESC(resend_igmp, "Number of IGMP membership reports to send on link | |||
171 | /*----------------------------- Global variables ----------------------------*/ | 171 | /*----------------------------- Global variables ----------------------------*/ |
172 | 172 | ||
173 | #ifdef CONFIG_NET_POLL_CONTROLLER | 173 | #ifdef CONFIG_NET_POLL_CONTROLLER |
174 | cpumask_var_t netpoll_block_tx; | 174 | atomic_t netpoll_block_tx = ATOMIC_INIT(0); |
175 | #endif | 175 | #endif |
176 | 176 | ||
177 | static const char * const version = | 177 | static const char * const version = |
@@ -1576,7 +1576,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1576 | 1576 | ||
1577 | /* If this is the first slave, then we need to set the master's hardware | 1577 | /* If this is the first slave, then we need to set the master's hardware |
1578 | * address to be the same as the slave's. */ | 1578 | * address to be the same as the slave's. */ |
1579 | if (bond->slave_cnt == 0) | 1579 | if (is_zero_ether_addr(bond->dev->dev_addr)) |
1580 | memcpy(bond->dev->dev_addr, slave_dev->dev_addr, | 1580 | memcpy(bond->dev->dev_addr, slave_dev->dev_addr, |
1581 | slave_dev->addr_len); | 1581 | slave_dev->addr_len); |
1582 | 1582 | ||
@@ -5299,13 +5299,6 @@ static int __init bonding_init(void) | |||
5299 | if (res) | 5299 | if (res) |
5300 | goto out; | 5300 | goto out; |
5301 | 5301 | ||
5302 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5303 | if (!alloc_cpumask_var(&netpoll_block_tx, GFP_KERNEL)) { | ||
5304 | res = -ENOMEM; | ||
5305 | goto out; | ||
5306 | } | ||
5307 | #endif | ||
5308 | |||
5309 | res = register_pernet_subsys(&bond_net_ops); | 5302 | res = register_pernet_subsys(&bond_net_ops); |
5310 | if (res) | 5303 | if (res) |
5311 | goto out; | 5304 | goto out; |
@@ -5334,9 +5327,6 @@ err: | |||
5334 | rtnl_link_unregister(&bond_link_ops); | 5327 | rtnl_link_unregister(&bond_link_ops); |
5335 | err_link: | 5328 | err_link: |
5336 | unregister_pernet_subsys(&bond_net_ops); | 5329 | unregister_pernet_subsys(&bond_net_ops); |
5337 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
5338 | free_cpumask_var(netpoll_block_tx); | ||
5339 | #endif | ||
5340 | goto out; | 5330 | goto out; |
5341 | 5331 | ||
5342 | } | 5332 | } |
@@ -5353,7 +5343,10 @@ static void __exit bonding_exit(void) | |||
5353 | unregister_pernet_subsys(&bond_net_ops); | 5343 | unregister_pernet_subsys(&bond_net_ops); |
5354 | 5344 | ||
5355 | #ifdef CONFIG_NET_POLL_CONTROLLER | 5345 | #ifdef CONFIG_NET_POLL_CONTROLLER |
5356 | free_cpumask_var(netpoll_block_tx); | 5346 | /* |
5347 | * Make sure we don't have an imbalance on our netpoll blocking | ||
5348 | */ | ||
5349 | WARN_ON(atomic_read(&netpoll_block_tx)); | ||
5357 | #endif | 5350 | #endif |
5358 | } | 5351 | } |
5359 | 5352 | ||
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 4eedb12df6ca..c2f081352a03 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -119,26 +119,22 @@ | |||
119 | 119 | ||
120 | 120 | ||
121 | #ifdef CONFIG_NET_POLL_CONTROLLER | 121 | #ifdef CONFIG_NET_POLL_CONTROLLER |
122 | extern cpumask_var_t netpoll_block_tx; | 122 | extern atomic_t netpoll_block_tx; |
123 | 123 | ||
124 | static inline void block_netpoll_tx(void) | 124 | static inline void block_netpoll_tx(void) |
125 | { | 125 | { |
126 | preempt_disable(); | 126 | atomic_inc(&netpoll_block_tx); |
127 | BUG_ON(cpumask_test_and_set_cpu(smp_processor_id(), | ||
128 | netpoll_block_tx)); | ||
129 | } | 127 | } |
130 | 128 | ||
131 | static inline void unblock_netpoll_tx(void) | 129 | static inline void unblock_netpoll_tx(void) |
132 | { | 130 | { |
133 | BUG_ON(!cpumask_test_and_clear_cpu(smp_processor_id(), | 131 | atomic_dec(&netpoll_block_tx); |
134 | netpoll_block_tx)); | ||
135 | preempt_enable(); | ||
136 | } | 132 | } |
137 | 133 | ||
138 | static inline int is_netpoll_tx_blocked(struct net_device *dev) | 134 | static inline int is_netpoll_tx_blocked(struct net_device *dev) |
139 | { | 135 | { |
140 | if (unlikely(dev->priv_flags & IFF_IN_NETPOLL)) | 136 | if (unlikely(dev->priv_flags & IFF_IN_NETPOLL)) |
141 | return cpumask_test_cpu(smp_processor_id(), netpoll_block_tx); | 137 | return atomic_read(&netpoll_block_tx); |
142 | return 0; | 138 | return 0; |
143 | } | 139 | } |
144 | #else | 140 | #else |
diff --git a/drivers/net/caif/caif_shm_u5500.c b/drivers/net/caif/caif_shm_u5500.c index 1cd90da86f13..32b1c6fb2de1 100644 --- a/drivers/net/caif/caif_shm_u5500.c +++ b/drivers/net/caif/caif_shm_u5500.c | |||
@@ -5,7 +5,7 @@ | |||
5 | * License terms: GNU General Public License (GPL) version 2 | 5 | * License terms: GNU General Public License (GPL) version 2 |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #define pr_fmt(fmt) KBUILD_MODNAME ":" __func__ "():" fmt | 8 | #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt |
9 | 9 | ||
10 | #include <linux/version.h> | 10 | #include <linux/version.h> |
11 | #include <linux/init.h> | 11 | #include <linux/init.h> |
diff --git a/drivers/net/caif/caif_shmcore.c b/drivers/net/caif/caif_shmcore.c index 19f9c0656667..80511167f35b 100644 --- a/drivers/net/caif/caif_shmcore.c +++ b/drivers/net/caif/caif_shmcore.c | |||
@@ -6,7 +6,7 @@ | |||
6 | * License terms: GNU General Public License (GPL) version 2 | 6 | * License terms: GNU General Public License (GPL) version 2 |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define pr_fmt(fmt) KBUILD_MODNAME ":" __func__ "():" fmt | 9 | #define pr_fmt(fmt) KBUILD_MODNAME ":" fmt |
10 | 10 | ||
11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
12 | #include <linux/sched.h> | 12 | #include <linux/sched.h> |
diff --git a/drivers/net/cxgb4/t4_hw.c b/drivers/net/cxgb4/t4_hw.c index bb813d94aea8..e97521c801ea 100644 --- a/drivers/net/cxgb4/t4_hw.c +++ b/drivers/net/cxgb4/t4_hw.c | |||
@@ -2408,7 +2408,7 @@ int t4_alloc_mac_filt(struct adapter *adap, unsigned int mbox, | |||
2408 | if (index < NEXACT_MAC) | 2408 | if (index < NEXACT_MAC) |
2409 | ret++; | 2409 | ret++; |
2410 | else if (hash) | 2410 | else if (hash) |
2411 | *hash |= (1 << hash_mac_addr(addr[i])); | 2411 | *hash |= (1ULL << hash_mac_addr(addr[i])); |
2412 | } | 2412 | } |
2413 | return ret; | 2413 | return ret; |
2414 | } | 2414 | } |
diff --git a/drivers/net/cxgb4vf/cxgb4vf_main.c b/drivers/net/cxgb4vf/cxgb4vf_main.c index d887a76cd39d..6bf464afa90e 100644 --- a/drivers/net/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/cxgb4vf/cxgb4vf_main.c | |||
@@ -2269,6 +2269,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2269 | { | 2269 | { |
2270 | struct sge *s = &adapter->sge; | 2270 | struct sge *s = &adapter->sge; |
2271 | int q10g, n10g, qidx, pidx, qs; | 2271 | int q10g, n10g, qidx, pidx, qs; |
2272 | size_t iqe_size; | ||
2272 | 2273 | ||
2273 | /* | 2274 | /* |
2274 | * We should not be called till we know how many Queue Sets we can | 2275 | * We should not be called till we know how many Queue Sets we can |
@@ -2313,6 +2314,13 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2313 | s->ethqsets = qidx; | 2314 | s->ethqsets = qidx; |
2314 | 2315 | ||
2315 | /* | 2316 | /* |
2317 | * The Ingress Queue Entry Size for our various Response Queues needs | ||
2318 | * to be big enough to accommodate the largest message we can receive | ||
2319 | * from the chip/firmware; which is 64 bytes ... | ||
2320 | */ | ||
2321 | iqe_size = 64; | ||
2322 | |||
2323 | /* | ||
2316 | * Set up default Queue Set parameters ... Start off with the | 2324 | * Set up default Queue Set parameters ... Start off with the |
2317 | * shortest interrupt holdoff timer. | 2325 | * shortest interrupt holdoff timer. |
2318 | */ | 2326 | */ |
@@ -2320,7 +2328,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2320 | struct sge_eth_rxq *rxq = &s->ethrxq[qs]; | 2328 | struct sge_eth_rxq *rxq = &s->ethrxq[qs]; |
2321 | struct sge_eth_txq *txq = &s->ethtxq[qs]; | 2329 | struct sge_eth_txq *txq = &s->ethtxq[qs]; |
2322 | 2330 | ||
2323 | init_rspq(&rxq->rspq, 0, 0, 1024, L1_CACHE_BYTES); | 2331 | init_rspq(&rxq->rspq, 0, 0, 1024, iqe_size); |
2324 | rxq->fl.size = 72; | 2332 | rxq->fl.size = 72; |
2325 | txq->q.size = 1024; | 2333 | txq->q.size = 1024; |
2326 | } | 2334 | } |
@@ -2329,8 +2337,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2329 | * The firmware event queue is used for link state changes and | 2337 | * The firmware event queue is used for link state changes and |
2330 | * notifications of TX DMA completions. | 2338 | * notifications of TX DMA completions. |
2331 | */ | 2339 | */ |
2332 | init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, | 2340 | init_rspq(&s->fw_evtq, SGE_TIMER_RSTRT_CNTR, 0, 512, iqe_size); |
2333 | L1_CACHE_BYTES); | ||
2334 | 2341 | ||
2335 | /* | 2342 | /* |
2336 | * The forwarded interrupt queue is used when we're in MSI interrupt | 2343 | * The forwarded interrupt queue is used when we're in MSI interrupt |
@@ -2346,7 +2353,7 @@ static void __devinit cfg_queues(struct adapter *adapter) | |||
2346 | * any time ... | 2353 | * any time ... |
2347 | */ | 2354 | */ |
2348 | init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, | 2355 | init_rspq(&s->intrq, SGE_TIMER_RSTRT_CNTR, 0, MSIX_ENTRIES + 1, |
2349 | L1_CACHE_BYTES); | 2356 | iqe_size); |
2350 | } | 2357 | } |
2351 | 2358 | ||
2352 | /* | 2359 | /* |
diff --git a/drivers/net/ehea/ehea_ethtool.c b/drivers/net/ehea/ehea_ethtool.c index 75b099ce49c9..1f37ee6b2a26 100644 --- a/drivers/net/ehea/ehea_ethtool.c +++ b/drivers/net/ehea/ehea_ethtool.c | |||
@@ -261,6 +261,13 @@ static void ehea_get_ethtool_stats(struct net_device *dev, | |||
261 | 261 | ||
262 | } | 262 | } |
263 | 263 | ||
264 | static int ehea_set_flags(struct net_device *dev, u32 data) | ||
265 | { | ||
266 | return ethtool_op_set_flags(dev, data, ETH_FLAG_LRO | ||
267 | | ETH_FLAG_TXVLAN | ||
268 | | ETH_FLAG_RXVLAN); | ||
269 | } | ||
270 | |||
264 | const struct ethtool_ops ehea_ethtool_ops = { | 271 | const struct ethtool_ops ehea_ethtool_ops = { |
265 | .get_settings = ehea_get_settings, | 272 | .get_settings = ehea_get_settings, |
266 | .get_drvinfo = ehea_get_drvinfo, | 273 | .get_drvinfo = ehea_get_drvinfo, |
@@ -273,6 +280,8 @@ const struct ethtool_ops ehea_ethtool_ops = { | |||
273 | .get_ethtool_stats = ehea_get_ethtool_stats, | 280 | .get_ethtool_stats = ehea_get_ethtool_stats, |
274 | .get_rx_csum = ehea_get_rx_csum, | 281 | .get_rx_csum = ehea_get_rx_csum, |
275 | .set_settings = ehea_set_settings, | 282 | .set_settings = ehea_set_settings, |
283 | .get_flags = ethtool_op_get_flags, | ||
284 | .set_flags = ehea_set_flags, | ||
276 | .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ | 285 | .nway_reset = ehea_nway_reset, /* Restart autonegotiation */ |
277 | }; | 286 | }; |
278 | 287 | ||
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c index 3d0af08483a1..b95f087cd5a9 100644 --- a/drivers/net/ehea/ehea_main.c +++ b/drivers/net/ehea/ehea_main.c | |||
@@ -683,7 +683,7 @@ static void ehea_proc_skb(struct ehea_port_res *pr, struct ehea_cqe *cqe, | |||
683 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && | 683 | int vlan_extracted = ((cqe->status & EHEA_CQE_VLAN_TAG_XTRACT) && |
684 | pr->port->vgrp); | 684 | pr->port->vgrp); |
685 | 685 | ||
686 | if (use_lro) { | 686 | if (skb->dev->features & NETIF_F_LRO) { |
687 | if (vlan_extracted) | 687 | if (vlan_extracted) |
688 | lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, | 688 | lro_vlan_hwaccel_receive_skb(&pr->lro_mgr, skb, |
689 | pr->port->vgrp, | 689 | pr->port->vgrp, |
@@ -787,7 +787,7 @@ static int ehea_proc_rwqes(struct net_device *dev, | |||
787 | } | 787 | } |
788 | cqe = ehea_poll_rq1(qp, &wqe_index); | 788 | cqe = ehea_poll_rq1(qp, &wqe_index); |
789 | } | 789 | } |
790 | if (use_lro) | 790 | if (dev->features & NETIF_F_LRO) |
791 | lro_flush_all(&pr->lro_mgr); | 791 | lro_flush_all(&pr->lro_mgr); |
792 | 792 | ||
793 | pr->rx_packets += processed; | 793 | pr->rx_packets += processed; |
@@ -3278,6 +3278,9 @@ struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter, | |||
3278 | | NETIF_F_LLTX; | 3278 | | NETIF_F_LLTX; |
3279 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; | 3279 | dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT; |
3280 | 3280 | ||
3281 | if (use_lro) | ||
3282 | dev->features |= NETIF_F_LRO; | ||
3283 | |||
3281 | INIT_WORK(&port->reset_task, ehea_reset_port); | 3284 | INIT_WORK(&port->reset_task, ehea_reset_port); |
3282 | 3285 | ||
3283 | ret = register_netdev(dev); | 3286 | ret = register_netdev(dev); |
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index a466ef91dd43..aa28b270c045 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c | |||
@@ -1962,7 +1962,8 @@ static void enic_poll_controller(struct net_device *netdev) | |||
1962 | case VNIC_DEV_INTR_MODE_MSIX: | 1962 | case VNIC_DEV_INTR_MODE_MSIX: |
1963 | for (i = 0; i < enic->rq_count; i++) { | 1963 | for (i = 0; i < enic->rq_count; i++) { |
1964 | intr = enic_msix_rq_intr(enic, i); | 1964 | intr = enic_msix_rq_intr(enic, i); |
1965 | enic_isr_msix_rq(enic->msix_entry[intr].vector, enic); | 1965 | enic_isr_msix_rq(enic->msix_entry[intr].vector, |
1966 | &enic->napi[i]); | ||
1966 | } | 1967 | } |
1967 | intr = enic_msix_wq_intr(enic, i); | 1968 | intr = enic_msix_wq_intr(enic, i); |
1968 | enic_isr_msix_wq(enic->msix_entry[intr].vector, enic); | 1969 | enic_isr_msix_wq(enic->msix_entry[intr].vector, enic); |
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c index ab9f675c5b8b..fe337bd121aa 100644 --- a/drivers/net/ifb.c +++ b/drivers/net/ifb.c | |||
@@ -104,6 +104,8 @@ static void ri_tasklet(unsigned long dev) | |||
104 | rcu_read_unlock(); | 104 | rcu_read_unlock(); |
105 | dev_kfree_skb(skb); | 105 | dev_kfree_skb(skb); |
106 | stats->tx_dropped++; | 106 | stats->tx_dropped++; |
107 | if (skb_queue_len(&dp->tq) != 0) | ||
108 | goto resched; | ||
107 | break; | 109 | break; |
108 | } | 110 | } |
109 | rcu_read_unlock(); | 111 | rcu_read_unlock(); |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index fbad4d819608..eee0b298bd36 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -4771,6 +4771,9 @@ void ixgbe_clear_interrupt_scheme(struct ixgbe_adapter *adapter) | |||
4771 | adapter->rx_ring[i] = NULL; | 4771 | adapter->rx_ring[i] = NULL; |
4772 | } | 4772 | } |
4773 | 4773 | ||
4774 | adapter->num_tx_queues = 0; | ||
4775 | adapter->num_rx_queues = 0; | ||
4776 | |||
4774 | ixgbe_free_q_vectors(adapter); | 4777 | ixgbe_free_q_vectors(adapter); |
4775 | ixgbe_reset_interrupt_capability(adapter); | 4778 | ixgbe_reset_interrupt_capability(adapter); |
4776 | } | 4779 | } |
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/phy/Kconfig b/drivers/net/phy/Kconfig index cb3d13e4e074..35fda5ac8120 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
@@ -64,7 +64,7 @@ config BCM63XX_PHY | |||
64 | config ICPLUS_PHY | 64 | config ICPLUS_PHY |
65 | tristate "Drivers for ICPlus PHYs" | 65 | tristate "Drivers for ICPlus PHYs" |
66 | ---help--- | 66 | ---help--- |
67 | Currently supports the IP175C PHY. | 67 | Currently supports the IP175C and IP1001 PHYs. |
68 | 68 | ||
69 | config REALTEK_PHY | 69 | config REALTEK_PHY |
70 | tristate "Drivers for Realtek PHYs" | 70 | tristate "Drivers for Realtek PHYs" |
diff --git a/drivers/net/phy/icplus.c b/drivers/net/phy/icplus.c index c1d2d251fe8b..9a09e24c30bc 100644 --- a/drivers/net/phy/icplus.c +++ b/drivers/net/phy/icplus.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
31 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
32 | 32 | ||
33 | MODULE_DESCRIPTION("ICPlus IP175C PHY driver"); | 33 | MODULE_DESCRIPTION("ICPlus IP175C/IC1001 PHY drivers"); |
34 | MODULE_AUTHOR("Michael Barkowski"); | 34 | MODULE_AUTHOR("Michael Barkowski"); |
35 | MODULE_LICENSE("GPL"); | 35 | MODULE_LICENSE("GPL"); |
36 | 36 | ||
@@ -89,6 +89,33 @@ static int ip175c_config_init(struct phy_device *phydev) | |||
89 | return 0; | 89 | return 0; |
90 | } | 90 | } |
91 | 91 | ||
92 | static int ip1001_config_init(struct phy_device *phydev) | ||
93 | { | ||
94 | int err, value; | ||
95 | |||
96 | /* Software Reset PHY */ | ||
97 | value = phy_read(phydev, MII_BMCR); | ||
98 | value |= BMCR_RESET; | ||
99 | err = phy_write(phydev, MII_BMCR, value); | ||
100 | if (err < 0) | ||
101 | return err; | ||
102 | |||
103 | do { | ||
104 | value = phy_read(phydev, MII_BMCR); | ||
105 | } while (value & BMCR_RESET); | ||
106 | |||
107 | /* Additional delay (2ns) used to adjust RX clock phase | ||
108 | * at GMII/ RGMII interface */ | ||
109 | value = phy_read(phydev, 16); | ||
110 | value |= 0x3; | ||
111 | |||
112 | err = phy_write(phydev, 16, value); | ||
113 | if (err < 0) | ||
114 | return err; | ||
115 | |||
116 | return err; | ||
117 | } | ||
118 | |||
92 | static int ip175c_read_status(struct phy_device *phydev) | 119 | static int ip175c_read_status(struct phy_device *phydev) |
93 | { | 120 | { |
94 | if (phydev->addr == 4) /* WAN port */ | 121 | if (phydev->addr == 4) /* WAN port */ |
@@ -121,21 +148,43 @@ static struct phy_driver ip175c_driver = { | |||
121 | .driver = { .owner = THIS_MODULE,}, | 148 | .driver = { .owner = THIS_MODULE,}, |
122 | }; | 149 | }; |
123 | 150 | ||
124 | static int __init ip175c_init(void) | 151 | static struct phy_driver ip1001_driver = { |
152 | .phy_id = 0x02430d90, | ||
153 | .name = "ICPlus IP1001", | ||
154 | .phy_id_mask = 0x0ffffff0, | ||
155 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause | | ||
156 | SUPPORTED_Asym_Pause, | ||
157 | .config_init = &ip1001_config_init, | ||
158 | .config_aneg = &genphy_config_aneg, | ||
159 | .read_status = &genphy_read_status, | ||
160 | .suspend = genphy_suspend, | ||
161 | .resume = genphy_resume, | ||
162 | .driver = { .owner = THIS_MODULE,}, | ||
163 | }; | ||
164 | |||
165 | static int __init icplus_init(void) | ||
125 | { | 166 | { |
167 | int ret = 0; | ||
168 | |||
169 | ret = phy_driver_register(&ip1001_driver); | ||
170 | if (ret < 0) | ||
171 | return -ENODEV; | ||
172 | |||
126 | return phy_driver_register(&ip175c_driver); | 173 | return phy_driver_register(&ip175c_driver); |
127 | } | 174 | } |
128 | 175 | ||
129 | static void __exit ip175c_exit(void) | 176 | static void __exit icplus_exit(void) |
130 | { | 177 | { |
178 | phy_driver_unregister(&ip1001_driver); | ||
131 | phy_driver_unregister(&ip175c_driver); | 179 | phy_driver_unregister(&ip175c_driver); |
132 | } | 180 | } |
133 | 181 | ||
134 | module_init(ip175c_init); | 182 | module_init(icplus_init); |
135 | module_exit(ip175c_exit); | 183 | module_exit(icplus_exit); |
136 | 184 | ||
137 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { | 185 | static struct mdio_device_id __maybe_unused icplus_tbl[] = { |
138 | { 0x02430d80, 0x0ffffff0 }, | 186 | { 0x02430d80, 0x0ffffff0 }, |
187 | { 0x02430d90, 0x0ffffff0 }, | ||
139 | { } | 188 | { } |
140 | }; | 189 | }; |
141 | 190 | ||
diff --git a/drivers/net/pppoe.c b/drivers/net/pppoe.c index d72fb0519a2a..78c0e3c9b2b5 100644 --- a/drivers/net/pppoe.c +++ b/drivers/net/pppoe.c | |||
@@ -948,7 +948,7 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb) | |||
948 | 948 | ||
949 | abort: | 949 | abort: |
950 | kfree_skb(skb); | 950 | kfree_skb(skb); |
951 | return 0; | 951 | return 1; |
952 | } | 952 | } |
953 | 953 | ||
954 | /************************************************************************ | 954 | /************************************************************************ |
diff --git a/drivers/net/qlge/qlge.h b/drivers/net/qlge/qlge.h index 22821398fc63..9787dff90d3f 100644 --- a/drivers/net/qlge/qlge.h +++ b/drivers/net/qlge/qlge.h | |||
@@ -2083,6 +2083,7 @@ struct ql_adapter { | |||
2083 | u32 mailbox_in; | 2083 | u32 mailbox_in; |
2084 | u32 mailbox_out; | 2084 | u32 mailbox_out; |
2085 | struct mbox_params idc_mbc; | 2085 | struct mbox_params idc_mbc; |
2086 | struct mutex mpi_mutex; | ||
2086 | 2087 | ||
2087 | int tx_ring_size; | 2088 | int tx_ring_size; |
2088 | int rx_ring_size; | 2089 | int rx_ring_size; |
diff --git a/drivers/net/qlge/qlge_main.c b/drivers/net/qlge/qlge_main.c index 528eaef5308f..2555b1d34f34 100644 --- a/drivers/net/qlge/qlge_main.c +++ b/drivers/net/qlge/qlge_main.c | |||
@@ -4629,6 +4629,7 @@ static int __devinit ql_init_device(struct pci_dev *pdev, | |||
4629 | INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); | 4629 | INIT_DELAYED_WORK(&qdev->mpi_idc_work, ql_mpi_idc_work); |
4630 | INIT_DELAYED_WORK(&qdev->mpi_core_to_log, ql_mpi_core_to_log); | 4630 | INIT_DELAYED_WORK(&qdev->mpi_core_to_log, ql_mpi_core_to_log); |
4631 | init_completion(&qdev->ide_completion); | 4631 | init_completion(&qdev->ide_completion); |
4632 | mutex_init(&qdev->mpi_mutex); | ||
4632 | 4633 | ||
4633 | if (!cards_found) { | 4634 | if (!cards_found) { |
4634 | dev_info(&pdev->dev, "%s\n", DRV_STRING); | 4635 | dev_info(&pdev->dev, "%s\n", DRV_STRING); |
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 0e7c7c7ee164..a2e919bcb3c6 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -534,6 +534,7 @@ static int ql_mailbox_command(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
534 | int status; | 534 | int status; |
535 | unsigned long count; | 535 | unsigned long count; |
536 | 536 | ||
537 | mutex_lock(&qdev->mpi_mutex); | ||
537 | 538 | ||
538 | /* Begin polled mode for MPI */ | 539 | /* Begin polled mode for MPI */ |
539 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); | 540 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); |
@@ -603,6 +604,7 @@ done: | |||
603 | end: | 604 | end: |
604 | /* End polled mode for MPI */ | 605 | /* End polled mode for MPI */ |
605 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); | 606 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); |
607 | mutex_unlock(&qdev->mpi_mutex); | ||
606 | return status; | 608 | return status; |
607 | } | 609 | } |
608 | 610 | ||
@@ -1099,9 +1101,7 @@ int ql_wait_fifo_empty(struct ql_adapter *qdev) | |||
1099 | static int ql_set_port_cfg(struct ql_adapter *qdev) | 1101 | static int ql_set_port_cfg(struct ql_adapter *qdev) |
1100 | { | 1102 | { |
1101 | int status; | 1103 | int status; |
1102 | rtnl_lock(); | ||
1103 | status = ql_mb_set_port_cfg(qdev); | 1104 | status = ql_mb_set_port_cfg(qdev); |
1104 | rtnl_unlock(); | ||
1105 | if (status) | 1105 | if (status) |
1106 | return status; | 1106 | return status; |
1107 | status = ql_idc_wait(qdev); | 1107 | status = ql_idc_wait(qdev); |
@@ -1122,9 +1122,7 @@ void ql_mpi_port_cfg_work(struct work_struct *work) | |||
1122 | container_of(work, struct ql_adapter, mpi_port_cfg_work.work); | 1122 | container_of(work, struct ql_adapter, mpi_port_cfg_work.work); |
1123 | int status; | 1123 | int status; |
1124 | 1124 | ||
1125 | rtnl_lock(); | ||
1126 | status = ql_mb_get_port_cfg(qdev); | 1125 | status = ql_mb_get_port_cfg(qdev); |
1127 | rtnl_unlock(); | ||
1128 | if (status) { | 1126 | if (status) { |
1129 | netif_err(qdev, drv, qdev->ndev, | 1127 | netif_err(qdev, drv, qdev->ndev, |
1130 | "Bug: Failed to get port config data.\n"); | 1128 | "Bug: Failed to get port config data.\n"); |
@@ -1167,7 +1165,6 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
1167 | u32 aen; | 1165 | u32 aen; |
1168 | int timeout; | 1166 | int timeout; |
1169 | 1167 | ||
1170 | rtnl_lock(); | ||
1171 | aen = mbcp->mbox_out[1] >> 16; | 1168 | aen = mbcp->mbox_out[1] >> 16; |
1172 | timeout = (mbcp->mbox_out[1] >> 8) & 0xf; | 1169 | timeout = (mbcp->mbox_out[1] >> 8) & 0xf; |
1173 | 1170 | ||
@@ -1231,7 +1228,6 @@ void ql_mpi_idc_work(struct work_struct *work) | |||
1231 | } | 1228 | } |
1232 | break; | 1229 | break; |
1233 | } | 1230 | } |
1234 | rtnl_unlock(); | ||
1235 | } | 1231 | } |
1236 | 1232 | ||
1237 | void ql_mpi_work(struct work_struct *work) | 1233 | void ql_mpi_work(struct work_struct *work) |
@@ -1242,7 +1238,7 @@ void ql_mpi_work(struct work_struct *work) | |||
1242 | struct mbox_params *mbcp = &mbc; | 1238 | struct mbox_params *mbcp = &mbc; |
1243 | int err = 0; | 1239 | int err = 0; |
1244 | 1240 | ||
1245 | rtnl_lock(); | 1241 | mutex_lock(&qdev->mpi_mutex); |
1246 | /* Begin polled mode for MPI */ | 1242 | /* Begin polled mode for MPI */ |
1247 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); | 1243 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16)); |
1248 | 1244 | ||
@@ -1259,7 +1255,7 @@ void ql_mpi_work(struct work_struct *work) | |||
1259 | 1255 | ||
1260 | /* End polled mode for MPI */ | 1256 | /* End polled mode for MPI */ |
1261 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); | 1257 | ql_write32(qdev, INTR_MASK, (INTR_MASK_PI << 16) | INTR_MASK_PI); |
1262 | rtnl_unlock(); | 1258 | mutex_unlock(&qdev->mpi_mutex); |
1263 | ql_enable_completion_interrupt(qdev, 0); | 1259 | ql_enable_completion_interrupt(qdev, 0); |
1264 | } | 1260 | } |
1265 | 1261 | ||
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 7d33ef4bcb4a..53b13deade95 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -744,26 +744,36 @@ static void rtl8169_xmii_reset_enable(void __iomem *ioaddr) | |||
744 | mdio_write(ioaddr, MII_BMCR, val & 0xffff); | 744 | mdio_write(ioaddr, MII_BMCR, val & 0xffff); |
745 | } | 745 | } |
746 | 746 | ||
747 | static void rtl8169_check_link_status(struct net_device *dev, | 747 | static void __rtl8169_check_link_status(struct net_device *dev, |
748 | struct rtl8169_private *tp, | 748 | struct rtl8169_private *tp, |
749 | void __iomem *ioaddr) | 749 | void __iomem *ioaddr, |
750 | bool pm) | ||
750 | { | 751 | { |
751 | unsigned long flags; | 752 | unsigned long flags; |
752 | 753 | ||
753 | spin_lock_irqsave(&tp->lock, flags); | 754 | spin_lock_irqsave(&tp->lock, flags); |
754 | if (tp->link_ok(ioaddr)) { | 755 | if (tp->link_ok(ioaddr)) { |
755 | /* This is to cancel a scheduled suspend if there's one. */ | 756 | /* This is to cancel a scheduled suspend if there's one. */ |
756 | pm_request_resume(&tp->pci_dev->dev); | 757 | if (pm) |
758 | pm_request_resume(&tp->pci_dev->dev); | ||
757 | netif_carrier_on(dev); | 759 | netif_carrier_on(dev); |
758 | netif_info(tp, ifup, dev, "link up\n"); | 760 | netif_info(tp, ifup, dev, "link up\n"); |
759 | } else { | 761 | } else { |
760 | netif_carrier_off(dev); | 762 | netif_carrier_off(dev); |
761 | netif_info(tp, ifdown, dev, "link down\n"); | 763 | netif_info(tp, ifdown, dev, "link down\n"); |
762 | pm_schedule_suspend(&tp->pci_dev->dev, 100); | 764 | if (pm) |
765 | pm_schedule_suspend(&tp->pci_dev->dev, 100); | ||
763 | } | 766 | } |
764 | spin_unlock_irqrestore(&tp->lock, flags); | 767 | spin_unlock_irqrestore(&tp->lock, flags); |
765 | } | 768 | } |
766 | 769 | ||
770 | static void rtl8169_check_link_status(struct net_device *dev, | ||
771 | struct rtl8169_private *tp, | ||
772 | void __iomem *ioaddr) | ||
773 | { | ||
774 | __rtl8169_check_link_status(dev, tp, ioaddr, false); | ||
775 | } | ||
776 | |||
767 | #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST) | 777 | #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST) |
768 | 778 | ||
769 | static u32 __rtl8169_get_wol(struct rtl8169_private *tp) | 779 | static u32 __rtl8169_get_wol(struct rtl8169_private *tp) |
@@ -4600,7 +4610,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance) | |||
4600 | } | 4610 | } |
4601 | 4611 | ||
4602 | if (status & LinkChg) | 4612 | if (status & LinkChg) |
4603 | rtl8169_check_link_status(dev, tp, ioaddr); | 4613 | __rtl8169_check_link_status(dev, tp, ioaddr, true); |
4604 | 4614 | ||
4605 | /* We need to see the lastest version of tp->intr_mask to | 4615 | /* We need to see the lastest version of tp->intr_mask to |
4606 | * avoid ignoring an MSI interrupt and having to wait for | 4616 | * avoid ignoring an MSI interrupt and having to wait for |
@@ -4890,11 +4900,7 @@ static int rtl8169_runtime_idle(struct device *device) | |||
4890 | struct net_device *dev = pci_get_drvdata(pdev); | 4900 | struct net_device *dev = pci_get_drvdata(pdev); |
4891 | struct rtl8169_private *tp = netdev_priv(dev); | 4901 | struct rtl8169_private *tp = netdev_priv(dev); |
4892 | 4902 | ||
4893 | if (!tp->TxDescArray) | 4903 | return tp->TxDescArray ? -EBUSY : 0; |
4894 | return 0; | ||
4895 | |||
4896 | rtl8169_check_link_status(dev, tp, tp->mmio_addr); | ||
4897 | return -EBUSY; | ||
4898 | } | 4904 | } |
4899 | 4905 | ||
4900 | static const struct dev_pm_ops rtl8169_pm_ops = { | 4906 | static const struct dev_pm_ops rtl8169_pm_ops = { |
diff --git a/drivers/net/sfc/efx.c b/drivers/net/sfc/efx.c index 05df20e47976..fb83cdd94643 100644 --- a/drivers/net/sfc/efx.c +++ b/drivers/net/sfc/efx.c | |||
@@ -197,7 +197,9 @@ MODULE_PARM_DESC(debug, "Bitmapped debugging message enable value"); | |||
197 | 197 | ||
198 | static void efx_remove_channels(struct efx_nic *efx); | 198 | static void efx_remove_channels(struct efx_nic *efx); |
199 | static void efx_remove_port(struct efx_nic *efx); | 199 | static void efx_remove_port(struct efx_nic *efx); |
200 | static void efx_init_napi(struct efx_nic *efx); | ||
200 | static void efx_fini_napi(struct efx_nic *efx); | 201 | static void efx_fini_napi(struct efx_nic *efx); |
202 | static void efx_fini_napi_channel(struct efx_channel *channel); | ||
201 | static void efx_fini_struct(struct efx_nic *efx); | 203 | static void efx_fini_struct(struct efx_nic *efx); |
202 | static void efx_start_all(struct efx_nic *efx); | 204 | static void efx_start_all(struct efx_nic *efx); |
203 | static void efx_stop_all(struct efx_nic *efx); | 205 | static void efx_stop_all(struct efx_nic *efx); |
@@ -335,8 +337,10 @@ void efx_process_channel_now(struct efx_channel *channel) | |||
335 | 337 | ||
336 | /* Disable interrupts and wait for ISRs to complete */ | 338 | /* Disable interrupts and wait for ISRs to complete */ |
337 | efx_nic_disable_interrupts(efx); | 339 | efx_nic_disable_interrupts(efx); |
338 | if (efx->legacy_irq) | 340 | if (efx->legacy_irq) { |
339 | synchronize_irq(efx->legacy_irq); | 341 | synchronize_irq(efx->legacy_irq); |
342 | efx->legacy_irq_enabled = false; | ||
343 | } | ||
340 | if (channel->irq) | 344 | if (channel->irq) |
341 | synchronize_irq(channel->irq); | 345 | synchronize_irq(channel->irq); |
342 | 346 | ||
@@ -351,6 +355,8 @@ void efx_process_channel_now(struct efx_channel *channel) | |||
351 | efx_channel_processed(channel); | 355 | efx_channel_processed(channel); |
352 | 356 | ||
353 | napi_enable(&channel->napi_str); | 357 | napi_enable(&channel->napi_str); |
358 | if (efx->legacy_irq) | ||
359 | efx->legacy_irq_enabled = true; | ||
354 | efx_nic_enable_interrupts(efx); | 360 | efx_nic_enable_interrupts(efx); |
355 | } | 361 | } |
356 | 362 | ||
@@ -426,6 +432,7 @@ efx_alloc_channel(struct efx_nic *efx, int i, struct efx_channel *old_channel) | |||
426 | 432 | ||
427 | *channel = *old_channel; | 433 | *channel = *old_channel; |
428 | 434 | ||
435 | channel->napi_dev = NULL; | ||
429 | memset(&channel->eventq, 0, sizeof(channel->eventq)); | 436 | memset(&channel->eventq, 0, sizeof(channel->eventq)); |
430 | 437 | ||
431 | rx_queue = &channel->rx_queue; | 438 | rx_queue = &channel->rx_queue; |
@@ -736,9 +743,13 @@ efx_realloc_channels(struct efx_nic *efx, u32 rxq_entries, u32 txq_entries) | |||
736 | if (rc) | 743 | if (rc) |
737 | goto rollback; | 744 | goto rollback; |
738 | 745 | ||
746 | efx_init_napi(efx); | ||
747 | |||
739 | /* Destroy old channels */ | 748 | /* Destroy old channels */ |
740 | for (i = 0; i < efx->n_channels; i++) | 749 | for (i = 0; i < efx->n_channels; i++) { |
750 | efx_fini_napi_channel(other_channel[i]); | ||
741 | efx_remove_channel(other_channel[i]); | 751 | efx_remove_channel(other_channel[i]); |
752 | } | ||
742 | out: | 753 | out: |
743 | /* Free unused channel structures */ | 754 | /* Free unused channel structures */ |
744 | for (i = 0; i < efx->n_channels; i++) | 755 | for (i = 0; i < efx->n_channels; i++) |
@@ -1400,6 +1411,8 @@ static void efx_start_all(struct efx_nic *efx) | |||
1400 | efx_start_channel(channel); | 1411 | efx_start_channel(channel); |
1401 | } | 1412 | } |
1402 | 1413 | ||
1414 | if (efx->legacy_irq) | ||
1415 | efx->legacy_irq_enabled = true; | ||
1403 | efx_nic_enable_interrupts(efx); | 1416 | efx_nic_enable_interrupts(efx); |
1404 | 1417 | ||
1405 | /* Switch to event based MCDI completions after enabling interrupts. | 1418 | /* Switch to event based MCDI completions after enabling interrupts. |
@@ -1460,8 +1473,10 @@ static void efx_stop_all(struct efx_nic *efx) | |||
1460 | 1473 | ||
1461 | /* Disable interrupts and wait for ISR to complete */ | 1474 | /* Disable interrupts and wait for ISR to complete */ |
1462 | efx_nic_disable_interrupts(efx); | 1475 | efx_nic_disable_interrupts(efx); |
1463 | if (efx->legacy_irq) | 1476 | if (efx->legacy_irq) { |
1464 | synchronize_irq(efx->legacy_irq); | 1477 | synchronize_irq(efx->legacy_irq); |
1478 | efx->legacy_irq_enabled = false; | ||
1479 | } | ||
1465 | efx_for_each_channel(channel, efx) { | 1480 | efx_for_each_channel(channel, efx) { |
1466 | if (channel->irq) | 1481 | if (channel->irq) |
1467 | synchronize_irq(channel->irq); | 1482 | synchronize_irq(channel->irq); |
@@ -1593,7 +1608,7 @@ static int efx_ioctl(struct net_device *net_dev, struct ifreq *ifr, int cmd) | |||
1593 | * | 1608 | * |
1594 | **************************************************************************/ | 1609 | **************************************************************************/ |
1595 | 1610 | ||
1596 | static int efx_init_napi(struct efx_nic *efx) | 1611 | static void efx_init_napi(struct efx_nic *efx) |
1597 | { | 1612 | { |
1598 | struct efx_channel *channel; | 1613 | struct efx_channel *channel; |
1599 | 1614 | ||
@@ -1602,18 +1617,21 @@ static int efx_init_napi(struct efx_nic *efx) | |||
1602 | netif_napi_add(channel->napi_dev, &channel->napi_str, | 1617 | netif_napi_add(channel->napi_dev, &channel->napi_str, |
1603 | efx_poll, napi_weight); | 1618 | efx_poll, napi_weight); |
1604 | } | 1619 | } |
1605 | return 0; | 1620 | } |
1621 | |||
1622 | static void efx_fini_napi_channel(struct efx_channel *channel) | ||
1623 | { | ||
1624 | if (channel->napi_dev) | ||
1625 | netif_napi_del(&channel->napi_str); | ||
1626 | channel->napi_dev = NULL; | ||
1606 | } | 1627 | } |
1607 | 1628 | ||
1608 | static void efx_fini_napi(struct efx_nic *efx) | 1629 | static void efx_fini_napi(struct efx_nic *efx) |
1609 | { | 1630 | { |
1610 | struct efx_channel *channel; | 1631 | struct efx_channel *channel; |
1611 | 1632 | ||
1612 | efx_for_each_channel(channel, efx) { | 1633 | efx_for_each_channel(channel, efx) |
1613 | if (channel->napi_dev) | 1634 | efx_fini_napi_channel(channel); |
1614 | netif_napi_del(&channel->napi_str); | ||
1615 | channel->napi_dev = NULL; | ||
1616 | } | ||
1617 | } | 1635 | } |
1618 | 1636 | ||
1619 | /************************************************************************** | 1637 | /************************************************************************** |
@@ -2335,9 +2353,7 @@ static int efx_pci_probe_main(struct efx_nic *efx) | |||
2335 | if (rc) | 2353 | if (rc) |
2336 | goto fail1; | 2354 | goto fail1; |
2337 | 2355 | ||
2338 | rc = efx_init_napi(efx); | 2356 | efx_init_napi(efx); |
2339 | if (rc) | ||
2340 | goto fail2; | ||
2341 | 2357 | ||
2342 | rc = efx->type->init(efx); | 2358 | rc = efx->type->init(efx); |
2343 | if (rc) { | 2359 | if (rc) { |
@@ -2368,7 +2384,6 @@ static int efx_pci_probe_main(struct efx_nic *efx) | |||
2368 | efx->type->fini(efx); | 2384 | efx->type->fini(efx); |
2369 | fail3: | 2385 | fail3: |
2370 | efx_fini_napi(efx); | 2386 | efx_fini_napi(efx); |
2371 | fail2: | ||
2372 | efx_remove_all(efx); | 2387 | efx_remove_all(efx); |
2373 | fail1: | 2388 | fail1: |
2374 | return rc; | 2389 | return rc; |
diff --git a/drivers/net/sfc/net_driver.h b/drivers/net/sfc/net_driver.h index 0a7e26d73b52..b137c889152b 100644 --- a/drivers/net/sfc/net_driver.h +++ b/drivers/net/sfc/net_driver.h | |||
@@ -621,6 +621,7 @@ struct efx_filter_state; | |||
621 | * @pci_dev: The PCI device | 621 | * @pci_dev: The PCI device |
622 | * @type: Controller type attributes | 622 | * @type: Controller type attributes |
623 | * @legacy_irq: IRQ number | 623 | * @legacy_irq: IRQ number |
624 | * @legacy_irq_enabled: Are IRQs enabled on NIC (INT_EN_KER register)? | ||
624 | * @workqueue: Workqueue for port reconfigures and the HW monitor. | 625 | * @workqueue: Workqueue for port reconfigures and the HW monitor. |
625 | * Work items do not hold and must not acquire RTNL. | 626 | * Work items do not hold and must not acquire RTNL. |
626 | * @workqueue_name: Name of workqueue | 627 | * @workqueue_name: Name of workqueue |
@@ -709,6 +710,7 @@ struct efx_nic { | |||
709 | struct pci_dev *pci_dev; | 710 | struct pci_dev *pci_dev; |
710 | const struct efx_nic_type *type; | 711 | const struct efx_nic_type *type; |
711 | int legacy_irq; | 712 | int legacy_irq; |
713 | bool legacy_irq_enabled; | ||
712 | struct workqueue_struct *workqueue; | 714 | struct workqueue_struct *workqueue; |
713 | char workqueue_name[16]; | 715 | char workqueue_name[16]; |
714 | struct work_struct reset_work; | 716 | struct work_struct reset_work; |
diff --git a/drivers/net/sfc/nic.c b/drivers/net/sfc/nic.c index 41c36b9a4244..67cb0c96838c 100644 --- a/drivers/net/sfc/nic.c +++ b/drivers/net/sfc/nic.c | |||
@@ -1418,6 +1418,12 @@ static irqreturn_t efx_legacy_interrupt(int irq, void *dev_id) | |||
1418 | u32 queues; | 1418 | u32 queues; |
1419 | int syserr; | 1419 | int syserr; |
1420 | 1420 | ||
1421 | /* Could this be ours? If interrupts are disabled then the | ||
1422 | * channel state may not be valid. | ||
1423 | */ | ||
1424 | if (!efx->legacy_irq_enabled) | ||
1425 | return result; | ||
1426 | |||
1421 | /* Read the ISR which also ACKs the interrupts */ | 1427 | /* Read the ISR which also ACKs the interrupts */ |
1422 | efx_readd(efx, ®, FR_BZ_INT_ISR0); | 1428 | efx_readd(efx, ®, FR_BZ_INT_ISR0); |
1423 | queues = EFX_EXTRACT_DWORD(reg, 0, 31); | 1429 | queues = EFX_EXTRACT_DWORD(reg, 0, 31); |
diff --git a/drivers/net/stmmac/stmmac_main.c b/drivers/net/stmmac/stmmac_main.c index 06bc6034ce81..2114837809e7 100644 --- a/drivers/net/stmmac/stmmac_main.c +++ b/drivers/net/stmmac/stmmac_main.c | |||
@@ -1509,6 +1509,8 @@ static int stmmac_probe(struct net_device *dev) | |||
1509 | pr_warning("\tno valid MAC address;" | 1509 | pr_warning("\tno valid MAC address;" |
1510 | "please, use ifconfig or nwhwconfig!\n"); | 1510 | "please, use ifconfig or nwhwconfig!\n"); |
1511 | 1511 | ||
1512 | spin_lock_init(&priv->lock); | ||
1513 | |||
1512 | ret = register_netdev(dev); | 1514 | ret = register_netdev(dev); |
1513 | if (ret) { | 1515 | if (ret) { |
1514 | pr_err("%s: ERROR %i registering the device\n", | 1516 | pr_err("%s: ERROR %i registering the device\n", |
@@ -1520,8 +1522,6 @@ static int stmmac_probe(struct net_device *dev) | |||
1520 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", | 1522 | dev->name, (dev->features & NETIF_F_SG) ? "on" : "off", |
1521 | (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); | 1523 | (dev->features & NETIF_F_HW_CSUM) ? "on" : "off"); |
1522 | 1524 | ||
1523 | spin_lock_init(&priv->lock); | ||
1524 | |||
1525 | return ret; | 1525 | return ret; |
1526 | } | 1526 | } |
1527 | 1527 | ||
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index a9f7d5d1a269..7064e035757a 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -688,9 +688,6 @@ static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb, | |||
688 | 688 | ||
689 | DMFE_DBUG(0, "dmfe_start_xmit", 0); | 689 | DMFE_DBUG(0, "dmfe_start_xmit", 0); |
690 | 690 | ||
691 | /* Resource flag check */ | ||
692 | netif_stop_queue(dev); | ||
693 | |||
694 | /* Too large packet check */ | 691 | /* Too large packet check */ |
695 | if (skb->len > MAX_PACKET_SIZE) { | 692 | if (skb->len > MAX_PACKET_SIZE) { |
696 | pr_err("big packet = %d\n", (u16)skb->len); | 693 | pr_err("big packet = %d\n", (u16)skb->len); |
@@ -698,6 +695,9 @@ static netdev_tx_t dmfe_start_xmit(struct sk_buff *skb, | |||
698 | return NETDEV_TX_OK; | 695 | return NETDEV_TX_OK; |
699 | } | 696 | } |
700 | 697 | ||
698 | /* Resource flag check */ | ||
699 | netif_stop_queue(dev); | ||
700 | |||
701 | spin_lock_irqsave(&db->lock, flags); | 701 | spin_lock_irqsave(&db->lock, flags); |
702 | 702 | ||
703 | /* No Tx resource check, it never happen nromally */ | 703 | /* No Tx resource check, it never happen nromally */ |
diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 62e9e8dc8190..812edf85d6d3 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c | |||
@@ -958,10 +958,6 @@ static void packetizeRx(struct hso_net *odev, unsigned char *ip_pkt, | |||
958 | /* Packet is complete. Inject into stack. */ | 958 | /* Packet is complete. Inject into stack. */ |
959 | /* We have IP packet here */ | 959 | /* We have IP packet here */ |
960 | odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); | 960 | odev->skb_rx_buf->protocol = cpu_to_be16(ETH_P_IP); |
961 | /* don't check it */ | ||
962 | odev->skb_rx_buf->ip_summed = | ||
963 | CHECKSUM_UNNECESSARY; | ||
964 | |||
965 | skb_reset_mac_header(odev->skb_rx_buf); | 961 | skb_reset_mac_header(odev->skb_rx_buf); |
966 | 962 | ||
967 | /* Ship it off to the kernel */ | 963 | /* Ship it off to the kernel */ |
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c index ea476cbd38b5..e305274f83fb 100644 --- a/drivers/net/wan/hd64572.c +++ b/drivers/net/wan/hd64572.c | |||
@@ -293,6 +293,7 @@ static inline void sca_tx_done(port_t *port) | |||
293 | struct net_device *dev = port->netdev; | 293 | struct net_device *dev = port->netdev; |
294 | card_t* card = port->card; | 294 | card_t* card = port->card; |
295 | u8 stat; | 295 | u8 stat; |
296 | unsigned count = 0; | ||
296 | 297 | ||
297 | spin_lock(&port->lock); | 298 | spin_lock(&port->lock); |
298 | 299 | ||
@@ -316,10 +317,12 @@ static inline void sca_tx_done(port_t *port) | |||
316 | dev->stats.tx_bytes += readw(&desc->len); | 317 | dev->stats.tx_bytes += readw(&desc->len); |
317 | } | 318 | } |
318 | writeb(0, &desc->stat); /* Free descriptor */ | 319 | writeb(0, &desc->stat); /* Free descriptor */ |
320 | count++; | ||
319 | port->txlast = (port->txlast + 1) % card->tx_ring_buffers; | 321 | port->txlast = (port->txlast + 1) % card->tx_ring_buffers; |
320 | } | 322 | } |
321 | 323 | ||
322 | netif_wake_queue(dev); | 324 | if (count) |
325 | netif_wake_queue(dev); | ||
323 | spin_unlock(&port->lock); | 326 | spin_unlock(&port->lock); |
324 | } | 327 | } |
325 | 328 | ||
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/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c index 8251946842e6..42ed923cdb1a 100644 --- a/drivers/net/wireless/ath/ath5k/base.c +++ b/drivers/net/wireless/ath/ath5k/base.c | |||
@@ -1917,7 +1917,8 @@ ath5k_beacon_send(struct ath5k_softc *sc) | |||
1917 | sc->bmisscount = 0; | 1917 | sc->bmisscount = 0; |
1918 | } | 1918 | } |
1919 | 1919 | ||
1920 | if (sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) { | 1920 | if ((sc->opmode == NL80211_IFTYPE_AP && sc->num_ap_vifs > 1) || |
1921 | sc->opmode == NL80211_IFTYPE_MESH_POINT) { | ||
1921 | u64 tsf = ath5k_hw_get_tsf64(ah); | 1922 | u64 tsf = ath5k_hw_get_tsf64(ah); |
1922 | u32 tsftu = TSF_TO_TU(tsf); | 1923 | u32 tsftu = TSF_TO_TU(tsf); |
1923 | int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval; | 1924 | int slot = ((tsftu % sc->bintval) * ATH_BCBUF) / sc->bintval; |
@@ -1949,8 +1950,9 @@ ath5k_beacon_send(struct ath5k_softc *sc) | |||
1949 | /* NB: hw still stops DMA, so proceed */ | 1950 | /* NB: hw still stops DMA, so proceed */ |
1950 | } | 1951 | } |
1951 | 1952 | ||
1952 | /* refresh the beacon for AP mode */ | 1953 | /* refresh the beacon for AP or MESH mode */ |
1953 | if (sc->opmode == NL80211_IFTYPE_AP) | 1954 | if (sc->opmode == NL80211_IFTYPE_AP || |
1955 | sc->opmode == NL80211_IFTYPE_MESH_POINT) | ||
1954 | ath5k_beacon_update(sc->hw, vif); | 1956 | ath5k_beacon_update(sc->hw, vif); |
1955 | 1957 | ||
1956 | ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr); | 1958 | ath5k_hw_set_txdp(ah, sc->bhalq, bf->daddr); |
@@ -2851,7 +2853,8 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
2851 | 2853 | ||
2852 | /* Assign the vap/adhoc to a beacon xmit slot. */ | 2854 | /* Assign the vap/adhoc to a beacon xmit slot. */ |
2853 | if ((avf->opmode == NL80211_IFTYPE_AP) || | 2855 | if ((avf->opmode == NL80211_IFTYPE_AP) || |
2854 | (avf->opmode == NL80211_IFTYPE_ADHOC)) { | 2856 | (avf->opmode == NL80211_IFTYPE_ADHOC) || |
2857 | (avf->opmode == NL80211_IFTYPE_MESH_POINT)) { | ||
2855 | int slot; | 2858 | int slot; |
2856 | 2859 | ||
2857 | WARN_ON(list_empty(&sc->bcbuf)); | 2860 | WARN_ON(list_empty(&sc->bcbuf)); |
@@ -2870,7 +2873,7 @@ static int ath5k_add_interface(struct ieee80211_hw *hw, | |||
2870 | sc->bslot[avf->bslot] = vif; | 2873 | sc->bslot[avf->bslot] = vif; |
2871 | if (avf->opmode == NL80211_IFTYPE_AP) | 2874 | if (avf->opmode == NL80211_IFTYPE_AP) |
2872 | sc->num_ap_vifs++; | 2875 | sc->num_ap_vifs++; |
2873 | else | 2876 | else if (avf->opmode == NL80211_IFTYPE_ADHOC) |
2874 | sc->num_adhoc_vifs++; | 2877 | sc->num_adhoc_vifs++; |
2875 | } | 2878 | } |
2876 | 2879 | ||
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index c4182359bee4..a7b82f0085d2 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | |||
@@ -55,6 +55,8 @@ | |||
55 | #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */ | 55 | #define SUB_NUM_CTL_MODES_AT_5G_40 2 /* excluding HT40, EXT-OFDM */ |
56 | #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */ | 56 | #define SUB_NUM_CTL_MODES_AT_2G_40 3 /* excluding HT40, EXT-OFDM, EXT-CCK */ |
57 | 57 | ||
58 | #define CTL(_tpower, _flag) ((_tpower) | ((_flag) << 6)) | ||
59 | |||
58 | static const struct ar9300_eeprom ar9300_default = { | 60 | static const struct ar9300_eeprom ar9300_default = { |
59 | .eepromVersion = 2, | 61 | .eepromVersion = 2, |
60 | .templateVersion = 2, | 62 | .templateVersion = 2, |
@@ -290,20 +292,21 @@ static const struct ar9300_eeprom ar9300_default = { | |||
290 | } | 292 | } |
291 | }, | 293 | }, |
292 | .ctlPowerData_2G = { | 294 | .ctlPowerData_2G = { |
293 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 295 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
294 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 296 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
295 | { { {60, 1}, {60, 0}, {60, 0}, {60, 1} } }, | 297 | { { CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 1) } }, |
296 | 298 | ||
297 | { { {60, 1}, {60, 0}, {0, 0}, {0, 0} } }, | 299 | { { CTL(60, 1), CTL(60, 0), CTL(0, 0), CTL(0, 0) } }, |
298 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 300 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
299 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 301 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
300 | 302 | ||
301 | { { {60, 0}, {60, 1}, {60, 1}, {60, 0} } }, | 303 | { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0) } }, |
302 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 304 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
303 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 305 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
304 | 306 | ||
305 | { { {60, 0}, {60, 1}, {60, 0}, {60, 0} } }, | 307 | { { CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 0) } }, |
306 | { { {60, 0}, {60, 1}, {60, 1}, {60, 1} } }, | 308 | { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } }, |
309 | { { CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 1) } }, | ||
307 | }, | 310 | }, |
308 | .modalHeader5G = { | 311 | .modalHeader5G = { |
309 | /* 4 idle,t1,t2,b (4 bits per setting) */ | 312 | /* 4 idle,t1,t2,b (4 bits per setting) */ |
@@ -568,56 +571,56 @@ static const struct ar9300_eeprom ar9300_default = { | |||
568 | .ctlPowerData_5G = { | 571 | .ctlPowerData_5G = { |
569 | { | 572 | { |
570 | { | 573 | { |
571 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 574 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
572 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 575 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
573 | } | 576 | } |
574 | }, | 577 | }, |
575 | { | 578 | { |
576 | { | 579 | { |
577 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 580 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
578 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 581 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
579 | } | 582 | } |
580 | }, | 583 | }, |
581 | { | 584 | { |
582 | { | 585 | { |
583 | {60, 0}, {60, 1}, {60, 0}, {60, 1}, | 586 | CTL(60, 0), CTL(60, 1), CTL(60, 0), CTL(60, 1), |
584 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 587 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
585 | } | 588 | } |
586 | }, | 589 | }, |
587 | { | 590 | { |
588 | { | 591 | { |
589 | {60, 0}, {60, 1}, {60, 1}, {60, 0}, | 592 | CTL(60, 0), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
590 | {60, 1}, {60, 0}, {60, 0}, {60, 0}, | 593 | CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0), |
591 | } | 594 | } |
592 | }, | 595 | }, |
593 | { | 596 | { |
594 | { | 597 | { |
595 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 598 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
596 | {60, 0}, {60, 0}, {60, 0}, {60, 0}, | 599 | CTL(60, 0), CTL(60, 0), CTL(60, 0), CTL(60, 0), |
597 | } | 600 | } |
598 | }, | 601 | }, |
599 | { | 602 | { |
600 | { | 603 | { |
601 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 604 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
602 | {60, 1}, {60, 0}, {60, 0}, {60, 0}, | 605 | CTL(60, 1), CTL(60, 0), CTL(60, 0), CTL(60, 0), |
603 | } | 606 | } |
604 | }, | 607 | }, |
605 | { | 608 | { |
606 | { | 609 | { |
607 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 610 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
608 | {60, 1}, {60, 1}, {60, 1}, {60, 1}, | 611 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 1), |
609 | } | 612 | } |
610 | }, | 613 | }, |
611 | { | 614 | { |
612 | { | 615 | { |
613 | {60, 1}, {60, 1}, {60, 0}, {60, 1}, | 616 | CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1), |
614 | {60, 1}, {60, 1}, {60, 1}, {60, 0}, | 617 | CTL(60, 1), CTL(60, 1), CTL(60, 1), CTL(60, 0), |
615 | } | 618 | } |
616 | }, | 619 | }, |
617 | { | 620 | { |
618 | { | 621 | { |
619 | {60, 1}, {60, 0}, {60, 1}, {60, 1}, | 622 | CTL(60, 1), CTL(60, 0), CTL(60, 1), CTL(60, 1), |
620 | {60, 1}, {60, 1}, {60, 0}, {60, 1}, | 623 | CTL(60, 1), CTL(60, 1), CTL(60, 0), CTL(60, 1), |
621 | } | 624 | } |
622 | }, | 625 | }, |
623 | } | 626 | } |
@@ -1827,9 +1830,9 @@ static u16 ar9003_hw_get_direct_edge_power(struct ar9300_eeprom *eep, | |||
1827 | struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G; | 1830 | struct cal_ctl_data_5g *ctl_5g = eep->ctlPowerData_5G; |
1828 | 1831 | ||
1829 | if (is2GHz) | 1832 | if (is2GHz) |
1830 | return ctl_2g[idx].ctlEdges[edge].tPower; | 1833 | return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge]); |
1831 | else | 1834 | else |
1832 | return ctl_5g[idx].ctlEdges[edge].tPower; | 1835 | return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge]); |
1833 | } | 1836 | } |
1834 | 1837 | ||
1835 | static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, | 1838 | static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, |
@@ -1847,12 +1850,12 @@ static u16 ar9003_hw_get_indirect_edge_power(struct ar9300_eeprom *eep, | |||
1847 | 1850 | ||
1848 | if (is2GHz) { | 1851 | if (is2GHz) { |
1849 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq && | 1852 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 1) < freq && |
1850 | ctl_2g[idx].ctlEdges[edge - 1].flag) | 1853 | CTL_EDGE_FLAGS(ctl_2g[idx].ctlEdges[edge - 1])) |
1851 | return ctl_2g[idx].ctlEdges[edge - 1].tPower; | 1854 | return CTL_EDGE_TPOWER(ctl_2g[idx].ctlEdges[edge - 1]); |
1852 | } else { | 1855 | } else { |
1853 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq && | 1856 | if (ath9k_hw_fbin2freq(ctl_freqbin[edge - 1], 0) < freq && |
1854 | ctl_5g[idx].ctlEdges[edge - 1].flag) | 1857 | CTL_EDGE_FLAGS(ctl_5g[idx].ctlEdges[edge - 1])) |
1855 | return ctl_5g[idx].ctlEdges[edge - 1].tPower; | 1858 | return CTL_EDGE_TPOWER(ctl_5g[idx].ctlEdges[edge - 1]); |
1856 | } | 1859 | } |
1857 | 1860 | ||
1858 | return AR9300_MAX_RATE_POWER; | 1861 | return AR9300_MAX_RATE_POWER; |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 3c533bb983c7..655b3033396c 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | |||
@@ -261,17 +261,12 @@ struct cal_tgt_pow_ht { | |||
261 | u8 tPow2x[14]; | 261 | u8 tPow2x[14]; |
262 | } __packed; | 262 | } __packed; |
263 | 263 | ||
264 | struct cal_ctl_edge_pwr { | ||
265 | u8 tPower:6, | ||
266 | flag:2; | ||
267 | } __packed; | ||
268 | |||
269 | struct cal_ctl_data_2g { | 264 | struct cal_ctl_data_2g { |
270 | struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_2G]; | 265 | u8 ctlEdges[AR9300_NUM_BAND_EDGES_2G]; |
271 | } __packed; | 266 | } __packed; |
272 | 267 | ||
273 | struct cal_ctl_data_5g { | 268 | struct cal_ctl_data_5g { |
274 | struct cal_ctl_edge_pwr ctlEdges[AR9300_NUM_BAND_EDGES_5G]; | 269 | u8 ctlEdges[AR9300_NUM_BAND_EDGES_5G]; |
275 | } __packed; | 270 | } __packed; |
276 | 271 | ||
277 | struct ar9300_eeprom { | 272 | struct ar9300_eeprom { |
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 170d44a35ccb..0963071e8f90 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/device.h> | 21 | #include <linux/device.h> |
22 | #include <linux/leds.h> | 22 | #include <linux/leds.h> |
23 | #include <linux/completion.h> | 23 | #include <linux/completion.h> |
24 | #include <linux/pm_qos_params.h> | ||
24 | 25 | ||
25 | #include "debug.h" | 26 | #include "debug.h" |
26 | #include "common.h" | 27 | #include "common.h" |
@@ -328,7 +329,7 @@ int ath_rx_tasklet(struct ath_softc *sc, int flush, bool hp); | |||
328 | struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); | 329 | struct ath_txq *ath_txq_setup(struct ath_softc *sc, int qtype, int subtype); |
329 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); | 330 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq); |
330 | int ath_tx_setup(struct ath_softc *sc, int haltype); | 331 | int ath_tx_setup(struct ath_softc *sc, int haltype); |
331 | void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); | 332 | bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx); |
332 | void ath_draintxq(struct ath_softc *sc, | 333 | void ath_draintxq(struct ath_softc *sc, |
333 | struct ath_txq *txq, bool retry_tx); | 334 | struct ath_txq *txq, bool retry_tx); |
334 | void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an); | 335 | void ath_tx_node_init(struct ath_softc *sc, struct ath_node *an); |
@@ -646,6 +647,8 @@ struct ath_softc { | |||
646 | struct ath_descdma txsdma; | 647 | struct ath_descdma txsdma; |
647 | 648 | ||
648 | struct ath_ant_comb ant_comb; | 649 | struct ath_ant_comb ant_comb; |
650 | |||
651 | struct pm_qos_request_list pm_qos_req; | ||
649 | }; | 652 | }; |
650 | 653 | ||
651 | struct ath_wiphy { | 654 | struct ath_wiphy { |
@@ -675,7 +678,6 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) | |||
675 | } | 678 | } |
676 | 679 | ||
677 | extern struct ieee80211_ops ath9k_ops; | 680 | extern struct ieee80211_ops ath9k_ops; |
678 | extern struct pm_qos_request_list ath9k_pm_qos_req; | ||
679 | extern int modparam_nohwcrypt; | 681 | extern int modparam_nohwcrypt; |
680 | extern int led_blink; | 682 | extern int led_blink; |
681 | 683 | ||
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.c b/drivers/net/wireless/ath/ath9k/eeprom.c index 1266333f586d..2bbf94d0191e 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.c +++ b/drivers/net/wireless/ath/ath9k/eeprom.c | |||
@@ -240,16 +240,16 @@ u16 ath9k_hw_get_max_edge_power(u16 freq, struct cal_ctl_edges *pRdEdgesPower, | |||
240 | for (i = 0; (i < num_band_edges) && | 240 | for (i = 0; (i < num_band_edges) && |
241 | (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { | 241 | (pRdEdgesPower[i].bChannel != AR5416_BCHAN_UNUSED); i++) { |
242 | if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { | 242 | if (freq == ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, is2GHz)) { |
243 | twiceMaxEdgePower = pRdEdgesPower[i].tPower; | 243 | twiceMaxEdgePower = CTL_EDGE_TPOWER(pRdEdgesPower[i].ctl); |
244 | break; | 244 | break; |
245 | } else if ((i > 0) && | 245 | } else if ((i > 0) && |
246 | (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, | 246 | (freq < ath9k_hw_fbin2freq(pRdEdgesPower[i].bChannel, |
247 | is2GHz))) { | 247 | is2GHz))) { |
248 | if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, | 248 | if (ath9k_hw_fbin2freq(pRdEdgesPower[i - 1].bChannel, |
249 | is2GHz) < freq && | 249 | is2GHz) < freq && |
250 | pRdEdgesPower[i - 1].flag) { | 250 | CTL_EDGE_FLAGS(pRdEdgesPower[i - 1].ctl)) { |
251 | twiceMaxEdgePower = | 251 | twiceMaxEdgePower = |
252 | pRdEdgesPower[i - 1].tPower; | 252 | CTL_EDGE_TPOWER(pRdEdgesPower[i - 1].ctl); |
253 | } | 253 | } |
254 | break; | 254 | break; |
255 | } | 255 | } |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom.h b/drivers/net/wireless/ath/ath9k/eeprom.h index dacb45e1b906..dd59f09441a3 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom.h +++ b/drivers/net/wireless/ath/ath9k/eeprom.h | |||
@@ -233,6 +233,18 @@ | |||
233 | 233 | ||
234 | #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) | 234 | #define AR9287_CHECKSUM_LOCATION (AR9287_EEP_START_LOC + 1) |
235 | 235 | ||
236 | #define CTL_EDGE_TPOWER(_ctl) ((_ctl) & 0x3f) | ||
237 | #define CTL_EDGE_FLAGS(_ctl) (((_ctl) >> 6) & 0x03) | ||
238 | |||
239 | #define LNA_CTL_BUF_MODE BIT(0) | ||
240 | #define LNA_CTL_ISEL_LO BIT(1) | ||
241 | #define LNA_CTL_ISEL_HI BIT(2) | ||
242 | #define LNA_CTL_BUF_IN BIT(3) | ||
243 | #define LNA_CTL_FEM_BAND BIT(4) | ||
244 | #define LNA_CTL_LOCAL_BIAS BIT(5) | ||
245 | #define LNA_CTL_FORCE_XPA BIT(6) | ||
246 | #define LNA_CTL_USE_ANT1 BIT(7) | ||
247 | |||
236 | enum eeprom_param { | 248 | enum eeprom_param { |
237 | EEP_NFTHRESH_5, | 249 | EEP_NFTHRESH_5, |
238 | EEP_NFTHRESH_2, | 250 | EEP_NFTHRESH_2, |
@@ -378,10 +390,7 @@ struct modal_eep_header { | |||
378 | u8 xatten2Margin[AR5416_MAX_CHAINS]; | 390 | u8 xatten2Margin[AR5416_MAX_CHAINS]; |
379 | u8 ob_ch1; | 391 | u8 ob_ch1; |
380 | u8 db_ch1; | 392 | u8 db_ch1; |
381 | u8 useAnt1:1, | 393 | u8 lna_ctl; |
382 | force_xpaon:1, | ||
383 | local_bias:1, | ||
384 | femBandSelectUsed:1, xlnabufin:1, xlnaisel:2, xlnabufmode:1; | ||
385 | u8 miscBits; | 394 | u8 miscBits; |
386 | u16 xpaBiasLvlFreq[3]; | 395 | u16 xpaBiasLvlFreq[3]; |
387 | u8 futureModal[6]; | 396 | u8 futureModal[6]; |
@@ -535,18 +544,10 @@ struct cal_target_power_ht { | |||
535 | u8 tPow2x[8]; | 544 | u8 tPow2x[8]; |
536 | } __packed; | 545 | } __packed; |
537 | 546 | ||
538 | |||
539 | #ifdef __BIG_ENDIAN_BITFIELD | ||
540 | struct cal_ctl_edges { | ||
541 | u8 bChannel; | ||
542 | u8 flag:2, tPower:6; | ||
543 | } __packed; | ||
544 | #else | ||
545 | struct cal_ctl_edges { | 547 | struct cal_ctl_edges { |
546 | u8 bChannel; | 548 | u8 bChannel; |
547 | u8 tPower:6, flag:2; | 549 | u8 ctl; |
548 | } __packed; | 550 | } __packed; |
549 | #endif | ||
550 | 551 | ||
551 | struct cal_data_op_loop_ar9287 { | 552 | struct cal_data_op_loop_ar9287 { |
552 | u8 pwrPdg[2][5]; | 553 | u8 pwrPdg[2][5]; |
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_def.c b/drivers/net/wireless/ath/ath9k/eeprom_def.c index 76b4d65472dd..a3ccb1b9638d 100644 --- a/drivers/net/wireless/ath/ath9k/eeprom_def.c +++ b/drivers/net/wireless/ath/ath9k/eeprom_def.c | |||
@@ -451,9 +451,10 @@ static void ath9k_hw_def_set_board_values(struct ath_hw *ah, | |||
451 | ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, | 451 | ath9k_hw_analog_shift_rmw(ah, AR_AN_TOP2, |
452 | AR_AN_TOP2_LOCALBIAS, | 452 | AR_AN_TOP2_LOCALBIAS, |
453 | AR_AN_TOP2_LOCALBIAS_S, | 453 | AR_AN_TOP2_LOCALBIAS_S, |
454 | pModal->local_bias); | 454 | !!(pModal->lna_ctl & |
455 | LNA_CTL_LOCAL_BIAS)); | ||
455 | REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, | 456 | REG_RMW_FIELD(ah, AR_PHY_XPA_CFG, AR_PHY_FORCE_XPA_CFG, |
456 | pModal->force_xpaon); | 457 | !!(pModal->lna_ctl & LNA_CTL_FORCE_XPA)); |
457 | } | 458 | } |
458 | 459 | ||
459 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, | 460 | REG_RMW_FIELD(ah, AR_PHY_SETTLING, AR_PHY_SETTLING_SWITCH, |
@@ -1062,15 +1063,19 @@ static void ath9k_hw_set_def_power_per_rate_table(struct ath_hw *ah, | |||
1062 | case 1: | 1063 | case 1: |
1063 | break; | 1064 | break; |
1064 | case 2: | 1065 | case 2: |
1065 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | 1066 | if (scaledPower > REDUCE_SCALED_POWER_BY_TWO_CHAIN) |
1067 | scaledPower -= REDUCE_SCALED_POWER_BY_TWO_CHAIN; | ||
1068 | else | ||
1069 | scaledPower = 0; | ||
1066 | break; | 1070 | break; |
1067 | case 3: | 1071 | case 3: |
1068 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | 1072 | if (scaledPower > REDUCE_SCALED_POWER_BY_THREE_CHAIN) |
1073 | scaledPower -= REDUCE_SCALED_POWER_BY_THREE_CHAIN; | ||
1074 | else | ||
1075 | scaledPower = 0; | ||
1069 | break; | 1076 | break; |
1070 | } | 1077 | } |
1071 | 1078 | ||
1072 | scaledPower = max((u16)0, scaledPower); | ||
1073 | |||
1074 | if (IS_CHAN_2GHZ(chan)) { | 1079 | if (IS_CHAN_2GHZ(chan)) { |
1075 | numCtlModes = ARRAY_SIZE(ctlModesFor11g) - | 1080 | numCtlModes = ARRAY_SIZE(ctlModesFor11g) - |
1076 | SUB_NUM_CTL_MODES_AT_2G_40; | 1081 | SUB_NUM_CTL_MODES_AT_2G_40; |
@@ -1428,9 +1433,9 @@ static u8 ath9k_hw_def_get_num_ant_config(struct ath_hw *ah, | |||
1428 | 1433 | ||
1429 | num_ant_config = 1; | 1434 | num_ant_config = 1; |
1430 | 1435 | ||
1431 | if (pBase->version >= 0x0E0D) | 1436 | if (pBase->version >= 0x0E0D && |
1432 | if (pModal->useAnt1) | 1437 | (pModal->lna_ctl & LNA_CTL_USE_ANT1)) |
1433 | num_ant_config += 1; | 1438 | num_ant_config += 1; |
1434 | 1439 | ||
1435 | return num_ant_config; | 1440 | return num_ant_config; |
1436 | } | 1441 | } |
diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index dfb6560dab92..0de3c3d3c245 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c | |||
@@ -1024,6 +1024,13 @@ static int ath9k_hif_usb_suspend(struct usb_interface *interface, | |||
1024 | struct hif_device_usb *hif_dev = | 1024 | struct hif_device_usb *hif_dev = |
1025 | (struct hif_device_usb *) usb_get_intfdata(interface); | 1025 | (struct hif_device_usb *) usb_get_intfdata(interface); |
1026 | 1026 | ||
1027 | /* | ||
1028 | * The device has to be set to FULLSLEEP mode in case no | ||
1029 | * interface is up. | ||
1030 | */ | ||
1031 | if (!(hif_dev->flags & HIF_USB_START)) | ||
1032 | ath9k_htc_suspend(hif_dev->htc_handle); | ||
1033 | |||
1027 | ath9k_hif_usb_dealloc_urbs(hif_dev); | 1034 | ath9k_hif_usb_dealloc_urbs(hif_dev); |
1028 | 1035 | ||
1029 | return 0; | 1036 | return 0; |
diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 75ecf6a30d25..c3b561daa6c1 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h | |||
@@ -455,6 +455,8 @@ u32 ath9k_htc_calcrxfilter(struct ath9k_htc_priv *priv); | |||
455 | void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); | 455 | void ath9k_htc_ps_wakeup(struct ath9k_htc_priv *priv); |
456 | void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); | 456 | void ath9k_htc_ps_restore(struct ath9k_htc_priv *priv); |
457 | void ath9k_ps_work(struct work_struct *work); | 457 | void ath9k_ps_work(struct work_struct *work); |
458 | bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, | ||
459 | enum ath9k_power_mode mode); | ||
458 | 460 | ||
459 | void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); | 461 | void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv); |
460 | void ath9k_init_leds(struct ath9k_htc_priv *priv); | 462 | void ath9k_init_leds(struct ath9k_htc_priv *priv); |
@@ -464,6 +466,7 @@ int ath9k_htc_probe_device(struct htc_target *htc_handle, struct device *dev, | |||
464 | u16 devid, char *product); | 466 | u16 devid, char *product); |
465 | void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); | 467 | void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug); |
466 | #ifdef CONFIG_PM | 468 | #ifdef CONFIG_PM |
469 | void ath9k_htc_suspend(struct htc_target *htc_handle); | ||
467 | int ath9k_htc_resume(struct htc_target *htc_handle); | 470 | int ath9k_htc_resume(struct htc_target *htc_handle); |
468 | #endif | 471 | #endif |
469 | #ifdef CONFIG_ATH9K_HTC_DEBUGFS | 472 | #ifdef CONFIG_ATH9K_HTC_DEBUGFS |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index 7c8a38d04561..8776f49ffd41 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c | |||
@@ -891,6 +891,12 @@ void ath9k_htc_disconnect_device(struct htc_target *htc_handle, bool hotunplug) | |||
891 | } | 891 | } |
892 | 892 | ||
893 | #ifdef CONFIG_PM | 893 | #ifdef CONFIG_PM |
894 | |||
895 | void ath9k_htc_suspend(struct htc_target *htc_handle) | ||
896 | { | ||
897 | ath9k_htc_setpower(htc_handle->drv_priv, ATH9K_PM_FULL_SLEEP); | ||
898 | } | ||
899 | |||
894 | int ath9k_htc_resume(struct htc_target *htc_handle) | 900 | int ath9k_htc_resume(struct htc_target *htc_handle) |
895 | { | 901 | { |
896 | int ret; | 902 | int ret; |
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index 9a3be8da755d..51977caca47f 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c | |||
@@ -63,8 +63,8 @@ static enum htc_phymode ath9k_htc_get_curmode(struct ath9k_htc_priv *priv, | |||
63 | return mode; | 63 | return mode; |
64 | } | 64 | } |
65 | 65 | ||
66 | static bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, | 66 | bool ath9k_htc_setpower(struct ath9k_htc_priv *priv, |
67 | enum ath9k_power_mode mode) | 67 | enum ath9k_power_mode mode) |
68 | { | 68 | { |
69 | bool ret; | 69 | bool ret; |
70 | 70 | ||
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index 6ebc68bca91f..c7fbe25cc128 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c | |||
@@ -2044,7 +2044,8 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, u32 gpio) | |||
2044 | val = REG_READ(ah, AR7010_GPIO_IN); | 2044 | val = REG_READ(ah, AR7010_GPIO_IN); |
2045 | return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; | 2045 | return (MS(val, AR7010_GPIO_IN_VAL) & AR_GPIO_BIT(gpio)) == 0; |
2046 | } else if (AR_SREV_9300_20_OR_LATER(ah)) | 2046 | } else if (AR_SREV_9300_20_OR_LATER(ah)) |
2047 | return MS_REG_READ(AR9300, gpio) != 0; | 2047 | return (MS(REG_READ(ah, AR_GPIO_IN), AR9300_GPIO_IN_VAL) & |
2048 | AR_GPIO_BIT(gpio)) != 0; | ||
2048 | else if (AR_SREV_9271(ah)) | 2049 | else if (AR_SREV_9271(ah)) |
2049 | return MS_REG_READ(AR9271, gpio) != 0; | 2050 | return MS_REG_READ(AR9271, gpio) != 0; |
2050 | else if (AR_SREV_9287_11_OR_LATER(ah)) | 2051 | else if (AR_SREV_9287_11_OR_LATER(ah)) |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 92bc5c5f4876..14b8ab386daf 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -15,7 +15,6 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/pm_qos_params.h> | ||
19 | 18 | ||
20 | #include "ath9k.h" | 19 | #include "ath9k.h" |
21 | 20 | ||
@@ -180,8 +179,6 @@ static const struct ath_ops ath9k_common_ops = { | |||
180 | .write = ath9k_iowrite32, | 179 | .write = ath9k_iowrite32, |
181 | }; | 180 | }; |
182 | 181 | ||
183 | struct pm_qos_request_list ath9k_pm_qos_req; | ||
184 | |||
185 | /**************************/ | 182 | /**************************/ |
186 | /* Initialization */ | 183 | /* Initialization */ |
187 | /**************************/ | 184 | /**************************/ |
@@ -664,6 +661,8 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) | |||
664 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; | 661 | hw->flags |= IEEE80211_HW_MFP_CAPABLE; |
665 | 662 | ||
666 | hw->wiphy->interface_modes = | 663 | hw->wiphy->interface_modes = |
664 | BIT(NL80211_IFTYPE_P2P_GO) | | ||
665 | BIT(NL80211_IFTYPE_P2P_CLIENT) | | ||
667 | BIT(NL80211_IFTYPE_AP) | | 666 | BIT(NL80211_IFTYPE_AP) | |
668 | BIT(NL80211_IFTYPE_WDS) | | 667 | BIT(NL80211_IFTYPE_WDS) | |
669 | BIT(NL80211_IFTYPE_STATION) | | 668 | BIT(NL80211_IFTYPE_STATION) | |
@@ -759,7 +758,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, | |||
759 | ath_init_leds(sc); | 758 | ath_init_leds(sc); |
760 | ath_start_rfkill_poll(sc); | 759 | ath_start_rfkill_poll(sc); |
761 | 760 | ||
762 | pm_qos_add_request(&ath9k_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, | 761 | pm_qos_add_request(&sc->pm_qos_req, PM_QOS_CPU_DMA_LATENCY, |
763 | PM_QOS_DEFAULT_VALUE); | 762 | PM_QOS_DEFAULT_VALUE); |
764 | 763 | ||
765 | return 0; | 764 | return 0; |
@@ -830,7 +829,7 @@ void ath9k_deinit_device(struct ath_softc *sc) | |||
830 | } | 829 | } |
831 | 830 | ||
832 | ieee80211_unregister_hw(hw); | 831 | ieee80211_unregister_hw(hw); |
833 | pm_qos_remove_request(&ath9k_pm_qos_req); | 832 | pm_qos_remove_request(&sc->pm_qos_req); |
834 | ath_rx_cleanup(sc); | 833 | ath_rx_cleanup(sc); |
835 | ath_tx_cleanup(sc); | 834 | ath_tx_cleanup(sc); |
836 | ath9k_deinit_softc(sc); | 835 | ath9k_deinit_softc(sc); |
diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c index 8c13479b17cd..c996963ab339 100644 --- a/drivers/net/wireless/ath/ath9k/mac.c +++ b/drivers/net/wireless/ath/ath9k/mac.c | |||
@@ -703,8 +703,7 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds, | |||
703 | rs->rs_phyerr = phyerr; | 703 | rs->rs_phyerr = phyerr; |
704 | } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) | 704 | } else if (ads.ds_rxstatus8 & AR_DecryptCRCErr) |
705 | rs->rs_status |= ATH9K_RXERR_DECRYPT; | 705 | rs->rs_status |= ATH9K_RXERR_DECRYPT; |
706 | else if ((ads.ds_rxstatus8 & AR_MichaelErr) && | 706 | else if (ads.ds_rxstatus8 & AR_MichaelErr) |
707 | rs->rs_keyix != ATH9K_RXKEYIX_INVALID) | ||
708 | rs->rs_status |= ATH9K_RXERR_MIC; | 707 | rs->rs_status |= ATH9K_RXERR_MIC; |
709 | else if (ads.ds_rxstatus8 & AR_KeyMiss) | 708 | else if (ads.ds_rxstatus8 & AR_KeyMiss) |
710 | rs->rs_status |= ATH9K_RXERR_DECRYPT; | 709 | rs->rs_status |= ATH9K_RXERR_DECRYPT; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 25d3ef4c338e..c0c3464d3a86 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -15,7 +15,6 @@ | |||
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include <linux/nl80211.h> | 17 | #include <linux/nl80211.h> |
18 | #include <linux/pm_qos_params.h> | ||
19 | #include "ath9k.h" | 18 | #include "ath9k.h" |
20 | #include "btcoex.h" | 19 | #include "btcoex.h" |
21 | 20 | ||
@@ -245,11 +244,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, | |||
245 | * the relevant bits of the h/w. | 244 | * the relevant bits of the h/w. |
246 | */ | 245 | */ |
247 | ath9k_hw_set_interrupts(ah, 0); | 246 | ath9k_hw_set_interrupts(ah, 0); |
248 | ath_drain_all_txq(sc, false); | 247 | stopped = ath_drain_all_txq(sc, false); |
249 | 248 | ||
250 | spin_lock_bh(&sc->rx.pcu_lock); | 249 | spin_lock_bh(&sc->rx.pcu_lock); |
251 | 250 | ||
252 | stopped = ath_stoprecv(sc); | 251 | if (!ath_stoprecv(sc)) |
252 | stopped = false; | ||
253 | 253 | ||
254 | /* XXX: do not flush receive queue here. We don't want | 254 | /* XXX: do not flush receive queue here. We don't want |
255 | * to flush data frames already in queue because of | 255 | * to flush data frames already in queue because of |
@@ -1244,7 +1244,7 @@ static int ath9k_start(struct ieee80211_hw *hw) | |||
1244 | ath9k_btcoex_timer_resume(sc); | 1244 | ath9k_btcoex_timer_resume(sc); |
1245 | } | 1245 | } |
1246 | 1246 | ||
1247 | pm_qos_update_request(&ath9k_pm_qos_req, 55); | 1247 | pm_qos_update_request(&sc->pm_qos_req, 55); |
1248 | 1248 | ||
1249 | mutex_unlock: | 1249 | mutex_unlock: |
1250 | mutex_unlock(&sc->mutex); | 1250 | mutex_unlock(&sc->mutex); |
@@ -1423,7 +1423,7 @@ static void ath9k_stop(struct ieee80211_hw *hw) | |||
1423 | 1423 | ||
1424 | sc->sc_flags |= SC_OP_INVALID; | 1424 | sc->sc_flags |= SC_OP_INVALID; |
1425 | 1425 | ||
1426 | pm_qos_update_request(&ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE); | 1426 | pm_qos_update_request(&sc->pm_qos_req, PM_QOS_DEFAULT_VALUE); |
1427 | 1427 | ||
1428 | mutex_unlock(&sc->mutex); | 1428 | mutex_unlock(&sc->mutex); |
1429 | 1429 | ||
@@ -1520,7 +1520,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1520 | struct ath_softc *sc = aphy->sc; | 1520 | struct ath_softc *sc = aphy->sc; |
1521 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1521 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
1522 | struct ath_vif *avp = (void *)vif->drv_priv; | 1522 | struct ath_vif *avp = (void *)vif->drv_priv; |
1523 | int i; | ||
1524 | 1523 | ||
1525 | ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); | 1524 | ath_print(common, ATH_DBG_CONFIG, "Detach Interface\n"); |
1526 | 1525 | ||
@@ -1534,21 +1533,24 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw, | |||
1534 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || | 1533 | if ((sc->sc_ah->opmode == NL80211_IFTYPE_AP) || |
1535 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || | 1534 | (sc->sc_ah->opmode == NL80211_IFTYPE_ADHOC) || |
1536 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { | 1535 | (sc->sc_ah->opmode == NL80211_IFTYPE_MESH_POINT)) { |
1536 | /* Disable SWBA interrupt */ | ||
1537 | sc->sc_ah->imask &= ~ATH9K_INT_SWBA; | ||
1537 | ath9k_ps_wakeup(sc); | 1538 | ath9k_ps_wakeup(sc); |
1539 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); | ||
1538 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | 1540 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); |
1539 | ath9k_ps_restore(sc); | 1541 | ath9k_ps_restore(sc); |
1542 | tasklet_kill(&sc->bcon_tasklet); | ||
1540 | } | 1543 | } |
1541 | 1544 | ||
1542 | ath_beacon_return(sc, avp); | 1545 | ath_beacon_return(sc, avp); |
1543 | sc->sc_flags &= ~SC_OP_BEACONS; | 1546 | sc->sc_flags &= ~SC_OP_BEACONS; |
1544 | 1547 | ||
1545 | for (i = 0; i < ARRAY_SIZE(sc->beacon.bslot); i++) { | 1548 | if (sc->nbcnvifs) { |
1546 | if (sc->beacon.bslot[i] == vif) { | 1549 | /* Re-enable SWBA interrupt */ |
1547 | printk(KERN_DEBUG "%s: vif had allocated beacon " | 1550 | sc->sc_ah->imask |= ATH9K_INT_SWBA; |
1548 | "slot\n", __func__); | 1551 | ath9k_ps_wakeup(sc); |
1549 | sc->beacon.bslot[i] = NULL; | 1552 | ath9k_hw_set_interrupts(sc->sc_ah, sc->sc_ah->imask); |
1550 | sc->beacon.bslot_aphy[i] = NULL; | 1553 | ath9k_ps_restore(sc); |
1551 | } | ||
1552 | } | 1554 | } |
1553 | 1555 | ||
1554 | sc->nvifs--; | 1556 | sc->nvifs--; |
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c index 1a62e351ec77..fdc2ec52b42f 100644 --- a/drivers/net/wireless/ath/ath9k/recv.c +++ b/drivers/net/wireless/ath/ath9k/recv.c | |||
@@ -838,6 +838,10 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
838 | struct ath_rx_status *rx_stats, | 838 | struct ath_rx_status *rx_stats, |
839 | bool *decrypt_error) | 839 | bool *decrypt_error) |
840 | { | 840 | { |
841 | #define is_mc_or_valid_tkip_keyix ((is_mc || \ | ||
842 | (rx_stats->rs_keyix != ATH9K_RXKEYIX_INVALID && \ | ||
843 | test_bit(rx_stats->rs_keyix, common->tkip_keymap)))) | ||
844 | |||
841 | struct ath_hw *ah = common->ah; | 845 | struct ath_hw *ah = common->ah; |
842 | __le16 fc; | 846 | __le16 fc; |
843 | u8 rx_status_len = ah->caps.rx_status_len; | 847 | u8 rx_status_len = ah->caps.rx_status_len; |
@@ -879,15 +883,18 @@ static bool ath9k_rx_accept(struct ath_common *common, | |||
879 | if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { | 883 | if (rx_stats->rs_status & ATH9K_RXERR_DECRYPT) { |
880 | *decrypt_error = true; | 884 | *decrypt_error = true; |
881 | } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { | 885 | } else if (rx_stats->rs_status & ATH9K_RXERR_MIC) { |
886 | bool is_mc; | ||
882 | /* | 887 | /* |
883 | * The MIC error bit is only valid if the frame | 888 | * The MIC error bit is only valid if the frame |
884 | * is not a control frame or fragment, and it was | 889 | * is not a control frame or fragment, and it was |
885 | * decrypted using a valid TKIP key. | 890 | * decrypted using a valid TKIP key. |
886 | */ | 891 | */ |
892 | is_mc = !!is_multicast_ether_addr(hdr->addr1); | ||
893 | |||
887 | if (!ieee80211_is_ctl(fc) && | 894 | if (!ieee80211_is_ctl(fc) && |
888 | !ieee80211_has_morefrags(fc) && | 895 | !ieee80211_has_morefrags(fc) && |
889 | !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) && | 896 | !(le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG) && |
890 | test_bit(rx_stats->rs_keyix, common->tkip_keymap)) | 897 | is_mc_or_valid_tkip_keyix) |
891 | rxs->flag |= RX_FLAG_MMIC_ERROR; | 898 | rxs->flag |= RX_FLAG_MMIC_ERROR; |
892 | else | 899 | else |
893 | rx_stats->rs_status &= ~ATH9K_RXERR_MIC; | 900 | rx_stats->rs_status &= ~ATH9K_RXERR_MIC; |
diff --git a/drivers/net/wireless/ath/ath9k/reg.h b/drivers/net/wireless/ath/ath9k/reg.h index dddf579aacf1..2c6a22fbb0f0 100644 --- a/drivers/net/wireless/ath/ath9k/reg.h +++ b/drivers/net/wireless/ath/ath9k/reg.h | |||
@@ -984,11 +984,13 @@ enum { | |||
984 | #define AR9287_GPIO_IN_VAL_S 11 | 984 | #define AR9287_GPIO_IN_VAL_S 11 |
985 | #define AR9271_GPIO_IN_VAL 0xFFFF0000 | 985 | #define AR9271_GPIO_IN_VAL 0xFFFF0000 |
986 | #define AR9271_GPIO_IN_VAL_S 16 | 986 | #define AR9271_GPIO_IN_VAL_S 16 |
987 | #define AR9300_GPIO_IN_VAL 0x0001FFFF | ||
988 | #define AR9300_GPIO_IN_VAL_S 0 | ||
989 | #define AR7010_GPIO_IN_VAL 0x0000FFFF | 987 | #define AR7010_GPIO_IN_VAL 0x0000FFFF |
990 | #define AR7010_GPIO_IN_VAL_S 0 | 988 | #define AR7010_GPIO_IN_VAL_S 0 |
991 | 989 | ||
990 | #define AR_GPIO_IN 0x404c | ||
991 | #define AR9300_GPIO_IN_VAL 0x0001FFFF | ||
992 | #define AR9300_GPIO_IN_VAL_S 0 | ||
993 | |||
992 | #define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) | 994 | #define AR_GPIO_OE_OUT (AR_SREV_9300_20_OR_LATER(ah) ? 0x4050 : 0x404c) |
993 | #define AR_GPIO_OE_OUT_DRV 0x3 | 995 | #define AR_GPIO_OE_OUT_DRV 0x3 |
994 | #define AR_GPIO_OE_OUT_DRV_NO 0x0 | 996 | #define AR_GPIO_OE_OUT_DRV_NO 0x0 |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index f2ade2402ce2..aff04789f794 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1120,7 +1120,7 @@ void ath_draintxq(struct ath_softc *sc, struct ath_txq *txq, bool retry_tx) | |||
1120 | } | 1120 | } |
1121 | } | 1121 | } |
1122 | 1122 | ||
1123 | void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | 1123 | bool ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) |
1124 | { | 1124 | { |
1125 | struct ath_hw *ah = sc->sc_ah; | 1125 | struct ath_hw *ah = sc->sc_ah; |
1126 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | 1126 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); |
@@ -1128,7 +1128,7 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | |||
1128 | int i, npend = 0; | 1128 | int i, npend = 0; |
1129 | 1129 | ||
1130 | if (sc->sc_flags & SC_OP_INVALID) | 1130 | if (sc->sc_flags & SC_OP_INVALID) |
1131 | return; | 1131 | return true; |
1132 | 1132 | ||
1133 | /* Stop beacon queue */ | 1133 | /* Stop beacon queue */ |
1134 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); | 1134 | ath9k_hw_stoptxdma(sc->sc_ah, sc->beacon.beaconq); |
@@ -1142,25 +1142,15 @@ void ath_drain_all_txq(struct ath_softc *sc, bool retry_tx) | |||
1142 | } | 1142 | } |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | if (npend) { | 1145 | if (npend) |
1146 | int r; | 1146 | ath_print(common, ATH_DBG_FATAL, "Failed to stop TX DMA!\n"); |
1147 | |||
1148 | ath_print(common, ATH_DBG_FATAL, | ||
1149 | "Failed to stop TX DMA. Resetting hardware!\n"); | ||
1150 | |||
1151 | spin_lock_bh(&sc->sc_resetlock); | ||
1152 | r = ath9k_hw_reset(ah, sc->sc_ah->curchan, ah->caldata, false); | ||
1153 | if (r) | ||
1154 | ath_print(common, ATH_DBG_FATAL, | ||
1155 | "Unable to reset hardware; reset status %d\n", | ||
1156 | r); | ||
1157 | spin_unlock_bh(&sc->sc_resetlock); | ||
1158 | } | ||
1159 | 1147 | ||
1160 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | 1148 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { |
1161 | if (ATH_TXQ_SETUP(sc, i)) | 1149 | if (ATH_TXQ_SETUP(sc, i)) |
1162 | ath_draintxq(sc, &sc->tx.txq[i], retry_tx); | 1150 | ath_draintxq(sc, &sc->tx.txq[i], retry_tx); |
1163 | } | 1151 | } |
1152 | |||
1153 | return !npend; | ||
1164 | } | 1154 | } |
1165 | 1155 | ||
1166 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) | 1156 | void ath_tx_cleanupq(struct ath_softc *sc, struct ath_txq *txq) |
diff --git a/drivers/net/wireless/ath/carl9170/fw.c b/drivers/net/wireless/ath/carl9170/fw.c index ae6c006bbc56..546b4e4ec5ea 100644 --- a/drivers/net/wireless/ath/carl9170/fw.c +++ b/drivers/net/wireless/ath/carl9170/fw.c | |||
@@ -291,7 +291,8 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len) | |||
291 | 291 | ||
292 | if (SUPP(CARL9170FW_WLANTX_CAB)) { | 292 | if (SUPP(CARL9170FW_WLANTX_CAB)) { |
293 | ar->hw->wiphy->interface_modes |= | 293 | ar->hw->wiphy->interface_modes |= |
294 | BIT(NL80211_IFTYPE_AP); | 294 | BIT(NL80211_IFTYPE_AP) | |
295 | BIT(NL80211_IFTYPE_P2P_GO); | ||
295 | } | 296 | } |
296 | } | 297 | } |
297 | 298 | ||
diff --git a/drivers/net/wireless/ath/carl9170/main.c b/drivers/net/wireless/ath/carl9170/main.c index a314c2c2bfbe..dc7b30b170d0 100644 --- a/drivers/net/wireless/ath/carl9170/main.c +++ b/drivers/net/wireless/ath/carl9170/main.c | |||
@@ -1631,7 +1631,8 @@ void *carl9170_alloc(size_t priv_size) | |||
1631 | * supports these modes. The code which will add the | 1631 | * supports these modes. The code which will add the |
1632 | * additional interface_modes is in fw.c. | 1632 | * additional interface_modes is in fw.c. |
1633 | */ | 1633 | */ |
1634 | hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); | 1634 | hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | |
1635 | BIT(NL80211_IFTYPE_P2P_CLIENT); | ||
1635 | 1636 | ||
1636 | hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | | 1637 | hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS | |
1637 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | | 1638 | IEEE80211_HW_REPORTS_TX_ACK_STATUS | |
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c index b575c865142d..7e6506a77bbb 100644 --- a/drivers/net/wireless/ath/carl9170/tx.c +++ b/drivers/net/wireless/ath/carl9170/tx.c | |||
@@ -810,7 +810,7 @@ static int carl9170_tx_prepare(struct ar9170 *ar, struct sk_buff *skb) | |||
810 | 810 | ||
811 | mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | | 811 | mac_tmp = cpu_to_le16(AR9170_TX_MAC_HW_DURATION | |
812 | AR9170_TX_MAC_BACKOFF); | 812 | AR9170_TX_MAC_BACKOFF); |
813 | mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) && | 813 | mac_tmp |= cpu_to_le16((hw_queue << AR9170_TX_MAC_QOS_S) & |
814 | AR9170_TX_MAC_QOS); | 814 | AR9170_TX_MAC_QOS); |
815 | 815 | ||
816 | no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK); | 816 | no_ack = !!(info->flags & IEEE80211_TX_CTL_NO_ACK); |
diff --git a/drivers/net/wireless/libertas/if_sdio.c b/drivers/net/wireless/libertas/if_sdio.c index e5685dc317a8..b4de0ca10feb 100644 --- a/drivers/net/wireless/libertas/if_sdio.c +++ b/drivers/net/wireless/libertas/if_sdio.c | |||
@@ -1170,7 +1170,6 @@ static void if_sdio_remove(struct sdio_func *func) | |||
1170 | lbs_deb_sdio("call remove card\n"); | 1170 | lbs_deb_sdio("call remove card\n"); |
1171 | lbs_stop_card(card->priv); | 1171 | lbs_stop_card(card->priv); |
1172 | lbs_remove_card(card->priv); | 1172 | lbs_remove_card(card->priv); |
1173 | card->priv->surpriseremoved = 1; | ||
1174 | 1173 | ||
1175 | flush_workqueue(card->workqueue); | 1174 | flush_workqueue(card->workqueue); |
1176 | destroy_workqueue(card->workqueue); | 1175 | destroy_workqueue(card->workqueue); |
diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c index 79bcb4e5d2ca..ecd4d04b2c3c 100644 --- a/drivers/net/wireless/libertas/if_spi.c +++ b/drivers/net/wireless/libertas/if_spi.c | |||
@@ -1055,7 +1055,6 @@ static int __devexit libertas_spi_remove(struct spi_device *spi) | |||
1055 | lbs_stop_card(priv); | 1055 | lbs_stop_card(priv); |
1056 | lbs_remove_card(priv); /* will call free_netdev */ | 1056 | lbs_remove_card(priv); /* will call free_netdev */ |
1057 | 1057 | ||
1058 | priv->surpriseremoved = 1; | ||
1059 | free_irq(spi->irq, card); | 1058 | free_irq(spi->irq, card); |
1060 | if_spi_terminate_spi_thread(card); | 1059 | if_spi_terminate_spi_thread(card); |
1061 | if (card->pdata->teardown) | 1060 | if (card->pdata->teardown) |
diff --git a/drivers/net/wireless/libertas/main.c b/drivers/net/wireless/libertas/main.c index 46b88b118c99..fcd1bbfc632d 100644 --- a/drivers/net/wireless/libertas/main.c +++ b/drivers/net/wireless/libertas/main.c | |||
@@ -915,8 +915,6 @@ void lbs_remove_card(struct lbs_private *priv) | |||
915 | 915 | ||
916 | lbs_free_adapter(priv); | 916 | lbs_free_adapter(priv); |
917 | lbs_cfg_free(priv); | 917 | lbs_cfg_free(priv); |
918 | |||
919 | priv->dev = NULL; | ||
920 | free_netdev(dev); | 918 | free_netdev(dev); |
921 | 919 | ||
922 | lbs_deb_leave(LBS_DEB_MAIN); | 920 | lbs_deb_leave(LBS_DEB_MAIN); |
diff --git a/drivers/net/wireless/orinoco/main.c b/drivers/net/wireless/orinoco/main.c index e8e2d0f4763d..f3d396e7544b 100644 --- a/drivers/net/wireless/orinoco/main.c +++ b/drivers/net/wireless/orinoco/main.c | |||
@@ -1392,10 +1392,9 @@ static void orinoco_process_scan_results(struct work_struct *work) | |||
1392 | orinoco_add_hostscan_results(priv, buf, len); | 1392 | orinoco_add_hostscan_results(priv, buf, len); |
1393 | 1393 | ||
1394 | kfree(buf); | 1394 | kfree(buf); |
1395 | } else if (priv->scan_request) { | 1395 | } else { |
1396 | /* Either abort or complete the scan */ | 1396 | /* Either abort or complete the scan */ |
1397 | cfg80211_scan_done(priv->scan_request, (len < 0)); | 1397 | orinoco_scan_done(priv, (len < 0)); |
1398 | priv->scan_request = NULL; | ||
1399 | } | 1398 | } |
1400 | 1399 | ||
1401 | spin_lock_irqsave(&priv->scan_lock, flags); | 1400 | spin_lock_irqsave(&priv->scan_lock, flags); |
@@ -1684,6 +1683,8 @@ static int __orinoco_down(struct orinoco_private *priv) | |||
1684 | hermes_write_regn(hw, EVACK, 0xffff); | 1683 | hermes_write_regn(hw, EVACK, 0xffff); |
1685 | } | 1684 | } |
1686 | 1685 | ||
1686 | orinoco_scan_done(priv, true); | ||
1687 | |||
1687 | /* firmware will have to reassociate */ | 1688 | /* firmware will have to reassociate */ |
1688 | netif_carrier_off(dev); | 1689 | netif_carrier_off(dev); |
1689 | priv->last_linkstatus = 0xffff; | 1690 | priv->last_linkstatus = 0xffff; |
@@ -1762,10 +1763,7 @@ void orinoco_reset(struct work_struct *work) | |||
1762 | orinoco_unlock(priv, &flags); | 1763 | orinoco_unlock(priv, &flags); |
1763 | 1764 | ||
1764 | /* Scanning support: Notify scan cancellation */ | 1765 | /* Scanning support: Notify scan cancellation */ |
1765 | if (priv->scan_request) { | 1766 | orinoco_scan_done(priv, true); |
1766 | cfg80211_scan_done(priv->scan_request, 1); | ||
1767 | priv->scan_request = NULL; | ||
1768 | } | ||
1769 | 1767 | ||
1770 | if (priv->hard_reset) { | 1768 | if (priv->hard_reset) { |
1771 | err = (*priv->hard_reset)(priv); | 1769 | err = (*priv->hard_reset)(priv); |
@@ -1813,6 +1811,12 @@ static int __orinoco_commit(struct orinoco_private *priv) | |||
1813 | struct net_device *dev = priv->ndev; | 1811 | struct net_device *dev = priv->ndev; |
1814 | int err = 0; | 1812 | int err = 0; |
1815 | 1813 | ||
1814 | /* If we've called commit, we are reconfiguring or bringing the | ||
1815 | * interface up. Maintaining countermeasures across this would | ||
1816 | * be confusing, so note that we've disabled them. The port will | ||
1817 | * be enabled later in orinoco_commit or __orinoco_up. */ | ||
1818 | priv->tkip_cm_active = 0; | ||
1819 | |||
1816 | err = orinoco_hw_program_rids(priv); | 1820 | err = orinoco_hw_program_rids(priv); |
1817 | 1821 | ||
1818 | /* FIXME: what about netif_tx_lock */ | 1822 | /* FIXME: what about netif_tx_lock */ |
diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c index 71b3d68b9403..32954c4b243a 100644 --- a/drivers/net/wireless/orinoco/orinoco_cs.c +++ b/drivers/net/wireless/orinoco/orinoco_cs.c | |||
@@ -151,20 +151,20 @@ orinoco_cs_config(struct pcmcia_device *link) | |||
151 | goto failed; | 151 | goto failed; |
152 | } | 152 | } |
153 | 153 | ||
154 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
155 | if (ret) | ||
156 | goto failed; | ||
157 | |||
158 | /* We initialize the hermes structure before completing PCMCIA | ||
159 | * configuration just in case the interrupt handler gets | ||
160 | * called. */ | ||
161 | mem = ioport_map(link->resource[0]->start, | 154 | mem = ioport_map(link->resource[0]->start, |
162 | resource_size(link->resource[0])); | 155 | resource_size(link->resource[0])); |
163 | if (!mem) | 156 | if (!mem) |
164 | goto failed; | 157 | goto failed; |
165 | 158 | ||
159 | /* We initialize the hermes structure before completing PCMCIA | ||
160 | * configuration just in case the interrupt handler gets | ||
161 | * called. */ | ||
166 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); | 162 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); |
167 | 163 | ||
164 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
165 | if (ret) | ||
166 | goto failed; | ||
167 | |||
168 | ret = pcmcia_enable_device(link); | 168 | ret = pcmcia_enable_device(link); |
169 | if (ret) | 169 | if (ret) |
170 | goto failed; | 170 | goto failed; |
diff --git a/drivers/net/wireless/orinoco/scan.c b/drivers/net/wireless/orinoco/scan.c index 4300d9db7d8c..86cb54c842e7 100644 --- a/drivers/net/wireless/orinoco/scan.c +++ b/drivers/net/wireless/orinoco/scan.c | |||
@@ -229,3 +229,11 @@ void orinoco_add_hostscan_results(struct orinoco_private *priv, | |||
229 | priv->scan_request = NULL; | 229 | priv->scan_request = NULL; |
230 | } | 230 | } |
231 | } | 231 | } |
232 | |||
233 | void orinoco_scan_done(struct orinoco_private *priv, bool abort) | ||
234 | { | ||
235 | if (priv->scan_request) { | ||
236 | cfg80211_scan_done(priv->scan_request, abort); | ||
237 | priv->scan_request = NULL; | ||
238 | } | ||
239 | } | ||
diff --git a/drivers/net/wireless/orinoco/scan.h b/drivers/net/wireless/orinoco/scan.h index 2dc4e046dbdb..27281fb0a6dc 100644 --- a/drivers/net/wireless/orinoco/scan.h +++ b/drivers/net/wireless/orinoco/scan.h | |||
@@ -16,5 +16,6 @@ void orinoco_add_extscan_result(struct orinoco_private *priv, | |||
16 | void orinoco_add_hostscan_results(struct orinoco_private *dev, | 16 | void orinoco_add_hostscan_results(struct orinoco_private *dev, |
17 | unsigned char *buf, | 17 | unsigned char *buf, |
18 | size_t len); | 18 | size_t len); |
19 | void orinoco_scan_done(struct orinoco_private *priv, bool abort); | ||
19 | 20 | ||
20 | #endif /* _ORINOCO_SCAN_H_ */ | 21 | #endif /* _ORINOCO_SCAN_H_ */ |
diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c index fb859a5ad2eb..db34c282e59b 100644 --- a/drivers/net/wireless/orinoco/spectrum_cs.c +++ b/drivers/net/wireless/orinoco/spectrum_cs.c | |||
@@ -214,21 +214,21 @@ spectrum_cs_config(struct pcmcia_device *link) | |||
214 | goto failed; | 214 | goto failed; |
215 | } | 215 | } |
216 | 216 | ||
217 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
218 | if (ret) | ||
219 | goto failed; | ||
220 | |||
221 | /* We initialize the hermes structure before completing PCMCIA | ||
222 | * configuration just in case the interrupt handler gets | ||
223 | * called. */ | ||
224 | mem = ioport_map(link->resource[0]->start, | 217 | mem = ioport_map(link->resource[0]->start, |
225 | resource_size(link->resource[0])); | 218 | resource_size(link->resource[0])); |
226 | if (!mem) | 219 | if (!mem) |
227 | goto failed; | 220 | goto failed; |
228 | 221 | ||
222 | /* We initialize the hermes structure before completing PCMCIA | ||
223 | * configuration just in case the interrupt handler gets | ||
224 | * called. */ | ||
229 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); | 225 | hermes_struct_init(hw, mem, HERMES_16BIT_REGSPACING); |
230 | hw->eeprom_pda = true; | 226 | hw->eeprom_pda = true; |
231 | 227 | ||
228 | ret = pcmcia_request_irq(link, orinoco_interrupt); | ||
229 | if (ret) | ||
230 | goto failed; | ||
231 | |||
232 | ret = pcmcia_enable_device(link); | 232 | ret = pcmcia_enable_device(link); |
233 | if (ret) | 233 | if (ret) |
234 | goto failed; | 234 | goto failed; |
diff --git a/drivers/net/wireless/orinoco/wext.c b/drivers/net/wireless/orinoco/wext.c index 93505f93bf97..e5afabee60d1 100644 --- a/drivers/net/wireless/orinoco/wext.c +++ b/drivers/net/wireless/orinoco/wext.c | |||
@@ -911,10 +911,10 @@ static int orinoco_ioctl_set_auth(struct net_device *dev, | |||
911 | */ | 911 | */ |
912 | if (param->value) { | 912 | if (param->value) { |
913 | priv->tkip_cm_active = 1; | 913 | priv->tkip_cm_active = 1; |
914 | ret = hermes_enable_port(hw, 0); | 914 | ret = hermes_disable_port(hw, 0); |
915 | } else { | 915 | } else { |
916 | priv->tkip_cm_active = 0; | 916 | priv->tkip_cm_active = 0; |
917 | ret = hermes_disable_port(hw, 0); | 917 | ret = hermes_enable_port(hw, 0); |
918 | } | 918 | } |
919 | break; | 919 | break; |
920 | 920 | ||
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index 458bb57914a3..cdbeec9f83ea 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -66,8 +66,8 @@ struct netfront_cb { | |||
66 | 66 | ||
67 | #define GRANT_INVALID_REF 0 | 67 | #define GRANT_INVALID_REF 0 |
68 | 68 | ||
69 | #define NET_TX_RING_SIZE __RING_SIZE((struct xen_netif_tx_sring *)0, PAGE_SIZE) | 69 | #define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE) |
70 | #define NET_RX_RING_SIZE __RING_SIZE((struct xen_netif_rx_sring *)0, PAGE_SIZE) | 70 | #define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE) |
71 | #define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256) | 71 | #define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256) |
72 | 72 | ||
73 | struct netfront_info { | 73 | struct netfront_info { |
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/Kconfig b/drivers/pcmcia/Kconfig index c80a7a6e7698..de886f3dfd39 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig | |||
@@ -215,7 +215,8 @@ config PCMCIA_PXA2XX | |||
215 | depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ | 215 | depends on (ARCH_LUBBOCK || MACH_MAINSTONE || PXA_SHARPSL \ |
216 | || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ | 216 | || MACH_ARMCORE || ARCH_PXA_PALM || TRIZEPS_PCMCIA \ |
217 | || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ | 217 | || ARCOM_PCMCIA || ARCH_PXA_ESERIES || MACH_STARGATE2 \ |
218 | || MACH_VPAC270 || MACH_BALLOON3) | 218 | || MACH_VPAC270 || MACH_BALLOON3 || MACH_COLIBRI \ |
219 | || MACH_COLIBRI320) | ||
219 | select PCMCIA_SOC_COMMON | 220 | select PCMCIA_SOC_COMMON |
220 | help | 221 | help |
221 | Say Y here to include support for the PXA2xx PCMCIA controller | 222 | Say Y here to include support for the PXA2xx PCMCIA controller |
diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index 8d9386a22eb3..9a44a90dcf7a 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile | |||
@@ -70,6 +70,8 @@ pxa2xx-obj-$(CONFIG_MACH_E740) += pxa2xx_e740.o | |||
70 | pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o | 70 | pxa2xx-obj-$(CONFIG_MACH_STARGATE2) += pxa2xx_stargate2.o |
71 | pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o | 71 | pxa2xx-obj-$(CONFIG_MACH_VPAC270) += pxa2xx_vpac270.o |
72 | pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o | 72 | pxa2xx-obj-$(CONFIG_MACH_BALLOON3) += pxa2xx_balloon3.o |
73 | pxa2xx-obj-$(CONFIG_MACH_COLIBRI) += pxa2xx_colibri.o | ||
74 | pxa2xx-obj-$(CONFIG_MACH_COLIBRI320) += pxa2xx_colibri.o | ||
73 | 75 | ||
74 | obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) | 76 | obj-$(CONFIG_PCMCIA_PXA2XX) += pxa2xx_base.o $(pxa2xx-obj-y) |
75 | 77 | ||
diff --git a/drivers/pcmcia/pxa2xx_balloon3.c b/drivers/pcmcia/pxa2xx_balloon3.c index dbbdd0063202..453c54c97612 100644 --- a/drivers/pcmcia/pxa2xx_balloon3.c +++ b/drivers/pcmcia/pxa2xx_balloon3.c | |||
@@ -39,12 +39,10 @@ static struct pcmcia_irqs irqs[] = { | |||
39 | static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | 39 | static int balloon3_pcmcia_hw_init(struct soc_pcmcia_socket *skt) |
40 | { | 40 | { |
41 | uint16_t ver; | 41 | uint16_t ver; |
42 | int ret; | ||
43 | static void __iomem *fpga_ver; | ||
44 | 42 | ||
45 | ver = __raw_readw(BALLOON3_FPGA_VER); | 43 | ver = __raw_readw(BALLOON3_FPGA_VER); |
46 | if (ver > 0x0201) | 44 | if (ver < 0x4f08) |
47 | pr_warn("The FPGA code, version 0x%04x, is newer than rel-0.3. " | 45 | pr_warn("The FPGA code, version 0x%04x, is too old. " |
48 | "PCMCIA/CF support might be broken in this version!", | 46 | "PCMCIA/CF support might be broken in this version!", |
49 | ver); | 47 | ver); |
50 | 48 | ||
@@ -97,8 +95,9 @@ static void balloon3_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | |||
97 | static int balloon3_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | 95 | static int balloon3_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, |
98 | const socket_state_t *state) | 96 | const socket_state_t *state) |
99 | { | 97 | { |
100 | __raw_writew((state->flags & SS_RESET) ? BALLOON3_CF_RESET : 0, | 98 | __raw_writew(BALLOON3_CF_RESET, BALLOON3_CF_CONTROL_REG | |
101 | BALLOON3_CF_CONTROL_REG); | 99 | ((state->flags & SS_RESET) ? |
100 | BALLOON3_FPGA_SETnCLR : 0)); | ||
102 | return 0; | 101 | return 0; |
103 | } | 102 | } |
104 | 103 | ||
diff --git a/drivers/pcmcia/pxa2xx_base.c b/drivers/pcmcia/pxa2xx_base.c index ae07b4db8a6e..3755e7c8c715 100644 --- a/drivers/pcmcia/pxa2xx_base.c +++ b/drivers/pcmcia/pxa2xx_base.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | 27 | ||
28 | #include <mach/hardware.h> | 28 | #include <mach/hardware.h> |
29 | #include <mach/smemc.h> | ||
29 | #include <asm/io.h> | 30 | #include <asm/io.h> |
30 | #include <asm/irq.h> | 31 | #include <asm/irq.h> |
31 | #include <asm/system.h> | 32 | #include <asm/system.h> |
@@ -116,37 +117,49 @@ static inline u_int pxa2xx_pcmcia_cmd_time(u_int mem_clk_10khz, | |||
116 | 117 | ||
117 | static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock ) | 118 | static int pxa2xx_pcmcia_set_mcmem( int sock, int speed, int clock ) |
118 | { | 119 | { |
119 | MCMEM(sock) = ((pxa2xx_mcxx_setup(speed, clock) | 120 | uint32_t val; |
121 | |||
122 | val = ((pxa2xx_mcxx_setup(speed, clock) | ||
120 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) | 123 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) |
121 | | ((pxa2xx_mcxx_asst(speed, clock) | 124 | | ((pxa2xx_mcxx_asst(speed, clock) |
122 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) | 125 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) |
123 | | ((pxa2xx_mcxx_hold(speed, clock) | 126 | | ((pxa2xx_mcxx_hold(speed, clock) |
124 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); | 127 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); |
125 | 128 | ||
129 | __raw_writel(val, MCMEM(sock)); | ||
130 | |||
126 | return 0; | 131 | return 0; |
127 | } | 132 | } |
128 | 133 | ||
129 | static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock ) | 134 | static int pxa2xx_pcmcia_set_mcio( int sock, int speed, int clock ) |
130 | { | 135 | { |
131 | MCIO(sock) = ((pxa2xx_mcxx_setup(speed, clock) | 136 | uint32_t val; |
137 | |||
138 | val = ((pxa2xx_mcxx_setup(speed, clock) | ||
132 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) | 139 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) |
133 | | ((pxa2xx_mcxx_asst(speed, clock) | 140 | | ((pxa2xx_mcxx_asst(speed, clock) |
134 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) | 141 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) |
135 | | ((pxa2xx_mcxx_hold(speed, clock) | 142 | | ((pxa2xx_mcxx_hold(speed, clock) |
136 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); | 143 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); |
137 | 144 | ||
145 | __raw_writel(val, MCIO(sock)); | ||
146 | |||
138 | return 0; | 147 | return 0; |
139 | } | 148 | } |
140 | 149 | ||
141 | static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock ) | 150 | static int pxa2xx_pcmcia_set_mcatt( int sock, int speed, int clock ) |
142 | { | 151 | { |
143 | MCATT(sock) = ((pxa2xx_mcxx_setup(speed, clock) | 152 | uint32_t val; |
153 | |||
154 | val = ((pxa2xx_mcxx_setup(speed, clock) | ||
144 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) | 155 | & MCXX_SETUP_MASK) << MCXX_SETUP_SHIFT) |
145 | | ((pxa2xx_mcxx_asst(speed, clock) | 156 | | ((pxa2xx_mcxx_asst(speed, clock) |
146 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) | 157 | & MCXX_ASST_MASK) << MCXX_ASST_SHIFT) |
147 | | ((pxa2xx_mcxx_hold(speed, clock) | 158 | | ((pxa2xx_mcxx_hold(speed, clock) |
148 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); | 159 | & MCXX_HOLD_MASK) << MCXX_HOLD_SHIFT); |
149 | 160 | ||
161 | __raw_writel(val, MCATT(sock)); | ||
162 | |||
150 | return 0; | 163 | return 0; |
151 | } | 164 | } |
152 | 165 | ||
@@ -166,8 +179,8 @@ static int pxa2xx_pcmcia_set_mcxx(struct soc_pcmcia_socket *skt, unsigned int cl | |||
166 | 179 | ||
167 | static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt) | 180 | static int pxa2xx_pcmcia_set_timing(struct soc_pcmcia_socket *skt) |
168 | { | 181 | { |
169 | unsigned int clk = get_memclk_frequency_10khz(); | 182 | unsigned long clk = clk_get_rate(skt->clk); |
170 | return pxa2xx_pcmcia_set_mcxx(skt, clk); | 183 | return pxa2xx_pcmcia_set_mcxx(skt, clk / 10000); |
171 | } | 184 | } |
172 | 185 | ||
173 | #ifdef CONFIG_CPU_FREQ | 186 | #ifdef CONFIG_CPU_FREQ |
@@ -205,19 +218,18 @@ pxa2xx_pcmcia_frequency_change(struct soc_pcmcia_socket *skt, | |||
205 | static void pxa2xx_configure_sockets(struct device *dev) | 218 | static void pxa2xx_configure_sockets(struct device *dev) |
206 | { | 219 | { |
207 | struct pcmcia_low_level *ops = dev->platform_data; | 220 | struct pcmcia_low_level *ops = dev->platform_data; |
208 | |||
209 | /* | 221 | /* |
210 | * We have at least one socket, so set MECR:CIT | 222 | * We have at least one socket, so set MECR:CIT |
211 | * (Card Is There) | 223 | * (Card Is There) |
212 | */ | 224 | */ |
213 | MECR |= MECR_CIT; | 225 | uint32_t mecr = MECR_CIT; |
214 | 226 | ||
215 | /* Set MECR:NOS (Number Of Sockets) */ | 227 | /* Set MECR:NOS (Number Of Sockets) */ |
216 | if ((ops->first + ops->nr) > 1 || | 228 | if ((ops->first + ops->nr) > 1 || |
217 | machine_is_viper() || machine_is_arcom_zeus()) | 229 | machine_is_viper() || machine_is_arcom_zeus()) |
218 | MECR |= MECR_NOS; | 230 | mecr |= MECR_NOS; |
219 | else | 231 | |
220 | MECR &= ~MECR_NOS; | 232 | __raw_writel(mecr, MECR); |
221 | } | 233 | } |
222 | 234 | ||
223 | static const char *skt_names[] = { | 235 | static const char *skt_names[] = { |
@@ -270,24 +282,41 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
270 | struct pcmcia_low_level *ops; | 282 | struct pcmcia_low_level *ops; |
271 | struct skt_dev_info *sinfo; | 283 | struct skt_dev_info *sinfo; |
272 | struct soc_pcmcia_socket *skt; | 284 | struct soc_pcmcia_socket *skt; |
285 | struct clk *clk; | ||
273 | 286 | ||
274 | ops = (struct pcmcia_low_level *)dev->dev.platform_data; | 287 | ops = (struct pcmcia_low_level *)dev->dev.platform_data; |
275 | if (!ops) | 288 | if (!ops) { |
289 | ret = -ENODEV; | ||
290 | goto err0; | ||
291 | } | ||
292 | |||
293 | if (cpu_is_pxa320() && ops->nr > 1) { | ||
294 | dev_err(&dev->dev, "pxa320 supports only one pcmcia slot"); | ||
295 | ret = -EINVAL; | ||
296 | goto err0; | ||
297 | } | ||
298 | |||
299 | clk = clk_get(&dev->dev, NULL); | ||
300 | if (!clk) | ||
276 | return -ENODEV; | 301 | return -ENODEV; |
277 | 302 | ||
278 | pxa2xx_drv_pcmcia_ops(ops); | 303 | pxa2xx_drv_pcmcia_ops(ops); |
279 | 304 | ||
280 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); | 305 | sinfo = kzalloc(SKT_DEV_INFO_SIZE(ops->nr), GFP_KERNEL); |
281 | if (!sinfo) | 306 | if (!sinfo) { |
307 | clk_put(clk); | ||
282 | return -ENOMEM; | 308 | return -ENOMEM; |
309 | } | ||
283 | 310 | ||
284 | sinfo->nskt = ops->nr; | 311 | sinfo->nskt = ops->nr; |
312 | sinfo->clk = clk; | ||
285 | 313 | ||
286 | /* Initialize processor specific parameters */ | 314 | /* Initialize processor specific parameters */ |
287 | for (i = 0; i < ops->nr; i++) { | 315 | for (i = 0; i < ops->nr; i++) { |
288 | skt = &sinfo->skt[i]; | 316 | skt = &sinfo->skt[i]; |
289 | 317 | ||
290 | skt->nr = ops->first + i; | 318 | skt->nr = ops->first + i; |
319 | skt->clk = clk; | ||
291 | skt->ops = ops; | 320 | skt->ops = ops; |
292 | skt->socket.owner = ops->owner; | 321 | skt->socket.owner = ops->owner; |
293 | skt->socket.dev.parent = &dev->dev; | 322 | skt->socket.dev.parent = &dev->dev; |
@@ -295,18 +324,26 @@ static int pxa2xx_drv_pcmcia_probe(struct platform_device *dev) | |||
295 | 324 | ||
296 | ret = pxa2xx_drv_pcmcia_add_one(skt); | 325 | ret = pxa2xx_drv_pcmcia_add_one(skt); |
297 | if (ret) | 326 | if (ret) |
298 | break; | 327 | goto err1; |
299 | } | 328 | } |
300 | 329 | ||
301 | if (ret) { | 330 | if (ret) { |
302 | while (--i >= 0) | 331 | while (--i >= 0) |
303 | soc_pcmcia_remove_one(&sinfo->skt[i]); | 332 | soc_pcmcia_remove_one(&sinfo->skt[i]); |
304 | kfree(sinfo); | 333 | kfree(sinfo); |
334 | clk_put(clk); | ||
305 | } else { | 335 | } else { |
306 | pxa2xx_configure_sockets(&dev->dev); | 336 | pxa2xx_configure_sockets(&dev->dev); |
307 | dev_set_drvdata(&dev->dev, sinfo); | 337 | dev_set_drvdata(&dev->dev, sinfo); |
308 | } | 338 | } |
309 | 339 | ||
340 | return 0; | ||
341 | |||
342 | err1: | ||
343 | while (--i >= 0) | ||
344 | soc_pcmcia_remove_one(&sinfo->skt[i]); | ||
345 | kfree(sinfo); | ||
346 | err0: | ||
310 | return ret; | 347 | return ret; |
311 | } | 348 | } |
312 | 349 | ||
@@ -320,6 +357,7 @@ static int pxa2xx_drv_pcmcia_remove(struct platform_device *dev) | |||
320 | for (i = 0; i < sinfo->nskt; i++) | 357 | for (i = 0; i < sinfo->nskt; i++) |
321 | soc_pcmcia_remove_one(&sinfo->skt[i]); | 358 | soc_pcmcia_remove_one(&sinfo->skt[i]); |
322 | 359 | ||
360 | clk_put(sinfo->clk); | ||
323 | kfree(sinfo); | 361 | kfree(sinfo); |
324 | return 0; | 362 | return 0; |
325 | } | 363 | } |
diff --git a/drivers/pcmcia/pxa2xx_colibri.c b/drivers/pcmcia/pxa2xx_colibri.c new file mode 100644 index 000000000000..c3f72192af66 --- /dev/null +++ b/drivers/pcmcia/pxa2xx_colibri.c | |||
@@ -0,0 +1,229 @@ | |||
1 | /* | ||
2 | * linux/drivers/pcmcia/pxa2xx_colibri.c | ||
3 | * | ||
4 | * Driver for Toradex Colibri PXA270 CF socket | ||
5 | * | ||
6 | * Copyright (C) 2010 Marek Vasut <marek.vasut@gmail.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #include <linux/module.h> | ||
15 | #include <linux/platform_device.h> | ||
16 | #include <linux/delay.h> | ||
17 | #include <linux/gpio.h> | ||
18 | |||
19 | #include <asm/mach-types.h> | ||
20 | |||
21 | #include "soc_common.h" | ||
22 | |||
23 | #define COLIBRI270_RESET_GPIO 53 | ||
24 | #define COLIBRI270_PPEN_GPIO 107 | ||
25 | #define COLIBRI270_BVD1_GPIO 83 | ||
26 | #define COLIBRI270_BVD2_GPIO 82 | ||
27 | #define COLIBRI270_DETECT_GPIO 84 | ||
28 | #define COLIBRI270_READY_GPIO 1 | ||
29 | |||
30 | #define COLIBRI320_RESET_GPIO 77 | ||
31 | #define COLIBRI320_PPEN_GPIO 57 | ||
32 | #define COLIBRI320_BVD1_GPIO 53 | ||
33 | #define COLIBRI320_BVD2_GPIO 79 | ||
34 | #define COLIBRI320_DETECT_GPIO 81 | ||
35 | #define COLIBRI320_READY_GPIO 29 | ||
36 | |||
37 | static struct { | ||
38 | int reset_gpio; | ||
39 | int ppen_gpio; | ||
40 | int bvd1_gpio; | ||
41 | int bvd2_gpio; | ||
42 | int detect_gpio; | ||
43 | int ready_gpio; | ||
44 | } colibri_pcmcia_gpio; | ||
45 | |||
46 | static struct pcmcia_irqs colibri_irqs[] = { | ||
47 | { | ||
48 | .sock = 0, | ||
49 | .str = "PCMCIA CD" | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | static int colibri_pcmcia_hw_init(struct soc_pcmcia_socket *skt) | ||
54 | { | ||
55 | int ret; | ||
56 | |||
57 | ret = gpio_request(colibri_pcmcia_gpio.detect_gpio, "DETECT"); | ||
58 | if (ret) | ||
59 | goto err1; | ||
60 | ret = gpio_direction_input(colibri_pcmcia_gpio.detect_gpio); | ||
61 | if (ret) | ||
62 | goto err2; | ||
63 | |||
64 | ret = gpio_request(colibri_pcmcia_gpio.ready_gpio, "READY"); | ||
65 | if (ret) | ||
66 | goto err2; | ||
67 | ret = gpio_direction_input(colibri_pcmcia_gpio.ready_gpio); | ||
68 | if (ret) | ||
69 | goto err3; | ||
70 | |||
71 | ret = gpio_request(colibri_pcmcia_gpio.bvd1_gpio, "BVD1"); | ||
72 | if (ret) | ||
73 | goto err3; | ||
74 | ret = gpio_direction_input(colibri_pcmcia_gpio.bvd1_gpio); | ||
75 | if (ret) | ||
76 | goto err4; | ||
77 | |||
78 | ret = gpio_request(colibri_pcmcia_gpio.bvd2_gpio, "BVD2"); | ||
79 | if (ret) | ||
80 | goto err4; | ||
81 | ret = gpio_direction_input(colibri_pcmcia_gpio.bvd2_gpio); | ||
82 | if (ret) | ||
83 | goto err5; | ||
84 | |||
85 | ret = gpio_request(colibri_pcmcia_gpio.ppen_gpio, "PPEN"); | ||
86 | if (ret) | ||
87 | goto err5; | ||
88 | ret = gpio_direction_output(colibri_pcmcia_gpio.ppen_gpio, 0); | ||
89 | if (ret) | ||
90 | goto err6; | ||
91 | |||
92 | ret = gpio_request(colibri_pcmcia_gpio.reset_gpio, "RESET"); | ||
93 | if (ret) | ||
94 | goto err6; | ||
95 | ret = gpio_direction_output(colibri_pcmcia_gpio.reset_gpio, 1); | ||
96 | if (ret) | ||
97 | goto err7; | ||
98 | |||
99 | colibri_irqs[0].irq = gpio_to_irq(colibri_pcmcia_gpio.detect_gpio); | ||
100 | skt->socket.pci_irq = gpio_to_irq(colibri_pcmcia_gpio.ready_gpio); | ||
101 | |||
102 | return soc_pcmcia_request_irqs(skt, colibri_irqs, | ||
103 | ARRAY_SIZE(colibri_irqs)); | ||
104 | |||
105 | err7: | ||
106 | gpio_free(colibri_pcmcia_gpio.detect_gpio); | ||
107 | err6: | ||
108 | gpio_free(colibri_pcmcia_gpio.ready_gpio); | ||
109 | err5: | ||
110 | gpio_free(colibri_pcmcia_gpio.bvd1_gpio); | ||
111 | err4: | ||
112 | gpio_free(colibri_pcmcia_gpio.bvd2_gpio); | ||
113 | err3: | ||
114 | gpio_free(colibri_pcmcia_gpio.reset_gpio); | ||
115 | err2: | ||
116 | gpio_free(colibri_pcmcia_gpio.ppen_gpio); | ||
117 | err1: | ||
118 | return ret; | ||
119 | } | ||
120 | |||
121 | static void colibri_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) | ||
122 | { | ||
123 | gpio_free(colibri_pcmcia_gpio.detect_gpio); | ||
124 | gpio_free(colibri_pcmcia_gpio.ready_gpio); | ||
125 | gpio_free(colibri_pcmcia_gpio.bvd1_gpio); | ||
126 | gpio_free(colibri_pcmcia_gpio.bvd2_gpio); | ||
127 | gpio_free(colibri_pcmcia_gpio.reset_gpio); | ||
128 | gpio_free(colibri_pcmcia_gpio.ppen_gpio); | ||
129 | } | ||
130 | |||
131 | static void colibri_pcmcia_socket_state(struct soc_pcmcia_socket *skt, | ||
132 | struct pcmcia_state *state) | ||
133 | { | ||
134 | |||
135 | state->detect = !!gpio_get_value(colibri_pcmcia_gpio.detect_gpio); | ||
136 | state->ready = !!gpio_get_value(colibri_pcmcia_gpio.ready_gpio); | ||
137 | state->bvd1 = !!gpio_get_value(colibri_pcmcia_gpio.bvd1_gpio); | ||
138 | state->bvd2 = !!gpio_get_value(colibri_pcmcia_gpio.bvd2_gpio); | ||
139 | state->wrprot = 0; | ||
140 | state->vs_3v = 1; | ||
141 | state->vs_Xv = 0; | ||
142 | } | ||
143 | |||
144 | static int | ||
145 | colibri_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, | ||
146 | const socket_state_t *state) | ||
147 | { | ||
148 | gpio_set_value(colibri_pcmcia_gpio.ppen_gpio, | ||
149 | !(state->Vcc == 33 && state->Vpp < 50)); | ||
150 | gpio_set_value(colibri_pcmcia_gpio.reset_gpio, state->flags & SS_RESET); | ||
151 | return 0; | ||
152 | } | ||
153 | |||
154 | static void colibri_pcmcia_socket_init(struct soc_pcmcia_socket *skt) | ||
155 | { | ||
156 | } | ||
157 | |||
158 | static void colibri_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) | ||
159 | { | ||
160 | } | ||
161 | |||
162 | static struct pcmcia_low_level colibri_pcmcia_ops = { | ||
163 | .owner = THIS_MODULE, | ||
164 | |||
165 | .first = 0, | ||
166 | .nr = 1, | ||
167 | |||
168 | .hw_init = colibri_pcmcia_hw_init, | ||
169 | .hw_shutdown = colibri_pcmcia_hw_shutdown, | ||
170 | |||
171 | .socket_state = colibri_pcmcia_socket_state, | ||
172 | .configure_socket = colibri_pcmcia_configure_socket, | ||
173 | |||
174 | .socket_init = colibri_pcmcia_socket_init, | ||
175 | .socket_suspend = colibri_pcmcia_socket_suspend, | ||
176 | }; | ||
177 | |||
178 | static struct platform_device *colibri_pcmcia_device; | ||
179 | |||
180 | static int __init colibri_pcmcia_init(void) | ||
181 | { | ||
182 | int ret; | ||
183 | |||
184 | colibri_pcmcia_device = platform_device_alloc("pxa2xx-pcmcia", -1); | ||
185 | if (!colibri_pcmcia_device) | ||
186 | return -ENOMEM; | ||
187 | |||
188 | /* Colibri PXA270 */ | ||
189 | if (machine_is_colibri()) { | ||
190 | colibri_pcmcia_gpio.reset_gpio = COLIBRI270_RESET_GPIO; | ||
191 | colibri_pcmcia_gpio.ppen_gpio = COLIBRI270_PPEN_GPIO; | ||
192 | colibri_pcmcia_gpio.bvd1_gpio = COLIBRI270_BVD1_GPIO; | ||
193 | colibri_pcmcia_gpio.bvd2_gpio = COLIBRI270_BVD2_GPIO; | ||
194 | colibri_pcmcia_gpio.detect_gpio = COLIBRI270_DETECT_GPIO; | ||
195 | colibri_pcmcia_gpio.ready_gpio = COLIBRI270_READY_GPIO; | ||
196 | /* Colibri PXA320 */ | ||
197 | } else if (machine_is_colibri320()) { | ||
198 | colibri_pcmcia_gpio.reset_gpio = COLIBRI320_RESET_GPIO; | ||
199 | colibri_pcmcia_gpio.ppen_gpio = COLIBRI320_PPEN_GPIO; | ||
200 | colibri_pcmcia_gpio.bvd1_gpio = COLIBRI320_BVD1_GPIO; | ||
201 | colibri_pcmcia_gpio.bvd2_gpio = COLIBRI320_BVD2_GPIO; | ||
202 | colibri_pcmcia_gpio.detect_gpio = COLIBRI320_DETECT_GPIO; | ||
203 | colibri_pcmcia_gpio.ready_gpio = COLIBRI320_READY_GPIO; | ||
204 | } | ||
205 | |||
206 | ret = platform_device_add_data(colibri_pcmcia_device, | ||
207 | &colibri_pcmcia_ops, sizeof(colibri_pcmcia_ops)); | ||
208 | |||
209 | if (!ret) | ||
210 | ret = platform_device_add(colibri_pcmcia_device); | ||
211 | |||
212 | if (ret) | ||
213 | platform_device_put(colibri_pcmcia_device); | ||
214 | |||
215 | return ret; | ||
216 | } | ||
217 | |||
218 | static void __exit colibri_pcmcia_exit(void) | ||
219 | { | ||
220 | platform_device_unregister(colibri_pcmcia_device); | ||
221 | } | ||
222 | |||
223 | module_init(colibri_pcmcia_init); | ||
224 | module_exit(colibri_pcmcia_exit); | ||
225 | |||
226 | MODULE_AUTHOR("Marek Vasut <marek.vasut@gmail.com>"); | ||
227 | MODULE_DESCRIPTION("PCMCIA support for Toradex Colibri PXA270/PXA320"); | ||
228 | MODULE_ALIAS("platform:pxa2xx-pcmcia"); | ||
229 | MODULE_LICENSE("GPL"); | ||
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/pcmcia/soc_common.h b/drivers/pcmcia/soc_common.h index bbcd5385a221..9daa73615c8b 100644 --- a/drivers/pcmcia/soc_common.h +++ b/drivers/pcmcia/soc_common.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #define _ASM_ARCH_PCMCIA | 10 | #define _ASM_ARCH_PCMCIA |
11 | 11 | ||
12 | /* include the world */ | 12 | /* include the world */ |
13 | #include <linux/clk.h> | ||
13 | #include <linux/cpufreq.h> | 14 | #include <linux/cpufreq.h> |
14 | #include <pcmcia/ss.h> | 15 | #include <pcmcia/ss.h> |
15 | #include <pcmcia/cistpl.h> | 16 | #include <pcmcia/cistpl.h> |
@@ -29,6 +30,7 @@ struct soc_pcmcia_socket { | |||
29 | * Info from low level handler | 30 | * Info from low level handler |
30 | */ | 31 | */ |
31 | unsigned int nr; | 32 | unsigned int nr; |
33 | struct clk *clk; | ||
32 | 34 | ||
33 | /* | 35 | /* |
34 | * Core PCMCIA state | 36 | * Core PCMCIA state |
@@ -56,6 +58,7 @@ struct soc_pcmcia_socket { | |||
56 | 58 | ||
57 | struct skt_dev_info { | 59 | struct skt_dev_info { |
58 | int nskt; | 60 | int nskt; |
61 | struct clk *clk; | ||
59 | struct soc_pcmcia_socket skt[0]; | 62 | struct soc_pcmcia_socket skt[0]; |
60 | }; | 63 | }; |
61 | 64 | ||
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/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index d37c7331f244..0bcd5806bd9a 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -156,6 +156,8 @@ static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter, | |||
156 | if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) || | 156 | if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) || |
157 | a_status & ZFCP_STATUS_COMMON_ERP_FAILED) | 157 | a_status & ZFCP_STATUS_COMMON_ERP_FAILED) |
158 | return 0; | 158 | return 0; |
159 | if (p_status & ZFCP_STATUS_COMMON_NOESC) | ||
160 | return need; | ||
159 | if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED)) | 161 | if (!(a_status & ZFCP_STATUS_COMMON_UNBLOCKED)) |
160 | need = ZFCP_ERP_ACTION_REOPEN_ADAPTER; | 162 | need = ZFCP_ERP_ACTION_REOPEN_ADAPTER; |
161 | /* fall through */ | 163 | /* fall through */ |
@@ -188,6 +190,9 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status, | |||
188 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, | 190 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, |
189 | &zfcp_sdev->status); | 191 | &zfcp_sdev->status); |
190 | erp_action = &zfcp_sdev->erp_action; | 192 | erp_action = &zfcp_sdev->erp_action; |
193 | memset(erp_action, 0, sizeof(struct zfcp_erp_action)); | ||
194 | erp_action->port = port; | ||
195 | erp_action->sdev = sdev; | ||
191 | if (!(atomic_read(&zfcp_sdev->status) & | 196 | if (!(atomic_read(&zfcp_sdev->status) & |
192 | ZFCP_STATUS_COMMON_RUNNING)) | 197 | ZFCP_STATUS_COMMON_RUNNING)) |
193 | act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; | 198 | act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; |
@@ -200,6 +205,8 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status, | |||
200 | zfcp_erp_action_dismiss_port(port); | 205 | zfcp_erp_action_dismiss_port(port); |
201 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); | 206 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &port->status); |
202 | erp_action = &port->erp_action; | 207 | erp_action = &port->erp_action; |
208 | memset(erp_action, 0, sizeof(struct zfcp_erp_action)); | ||
209 | erp_action->port = port; | ||
203 | if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING)) | 210 | if (!(atomic_read(&port->status) & ZFCP_STATUS_COMMON_RUNNING)) |
204 | act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; | 211 | act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; |
205 | break; | 212 | break; |
@@ -209,6 +216,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status, | |||
209 | zfcp_erp_action_dismiss_adapter(adapter); | 216 | zfcp_erp_action_dismiss_adapter(adapter); |
210 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status); | 217 | atomic_set_mask(ZFCP_STATUS_COMMON_ERP_INUSE, &adapter->status); |
211 | erp_action = &adapter->erp_action; | 218 | erp_action = &adapter->erp_action; |
219 | memset(erp_action, 0, sizeof(struct zfcp_erp_action)); | ||
212 | if (!(atomic_read(&adapter->status) & | 220 | if (!(atomic_read(&adapter->status) & |
213 | ZFCP_STATUS_COMMON_RUNNING)) | 221 | ZFCP_STATUS_COMMON_RUNNING)) |
214 | act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; | 222 | act_status |= ZFCP_STATUS_ERP_CLOSE_ONLY; |
@@ -218,10 +226,7 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status, | |||
218 | return NULL; | 226 | return NULL; |
219 | } | 227 | } |
220 | 228 | ||
221 | memset(erp_action, 0, sizeof(struct zfcp_erp_action)); | ||
222 | erp_action->adapter = adapter; | 229 | erp_action->adapter = adapter; |
223 | erp_action->port = port; | ||
224 | erp_action->sdev = sdev; | ||
225 | erp_action->action = need; | 230 | erp_action->action = need; |
226 | erp_action->status = act_status; | 231 | erp_action->status = act_status; |
227 | 232 | ||
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index be0317457147..2eb7dd56ab80 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -851,7 +851,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_cmnd(struct scsi_cmnd *scmnd) | |||
851 | 851 | ||
852 | zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); | 852 | zfcp_qdio_set_sbale_last(qdio, &req->qdio_req); |
853 | 853 | ||
854 | req->data = zfcp_sdev; | 854 | req->data = sdev; |
855 | req->handler = zfcp_fsf_abort_fcp_command_handler; | 855 | req->handler = zfcp_fsf_abort_fcp_command_handler; |
856 | req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; | 856 | req->qtcb->header.lun_handle = zfcp_sdev->lun_handle; |
857 | req->qtcb->header.port_handle = zfcp_sdev->port->handle; | 857 | req->qtcb->header.port_handle = zfcp_sdev->port->handle; |
@@ -2069,8 +2069,6 @@ static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req) | |||
2069 | struct fcp_resp_with_ext *fcp_rsp; | 2069 | struct fcp_resp_with_ext *fcp_rsp; |
2070 | unsigned long flags; | 2070 | unsigned long flags; |
2071 | 2071 | ||
2072 | zfcp_fsf_fcp_handler_common(req); | ||
2073 | |||
2074 | read_lock_irqsave(&req->adapter->abort_lock, flags); | 2072 | read_lock_irqsave(&req->adapter->abort_lock, flags); |
2075 | 2073 | ||
2076 | scpnt = req->data; | 2074 | scpnt = req->data; |
@@ -2079,6 +2077,8 @@ static void zfcp_fsf_fcp_cmnd_handler(struct zfcp_fsf_req *req) | |||
2079 | return; | 2077 | return; |
2080 | } | 2078 | } |
2081 | 2079 | ||
2080 | zfcp_fsf_fcp_handler_common(req); | ||
2081 | |||
2082 | if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { | 2082 | if (unlikely(req->status & ZFCP_STATUS_FSFREQ_ERROR)) { |
2083 | set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED); | 2083 | set_host_byte(scpnt, DID_TRANSPORT_DISRUPTED); |
2084 | goto skip_fsfstatus; | 2084 | goto skip_fsfstatus; |
@@ -2170,12 +2170,13 @@ int zfcp_fsf_fcp_cmnd(struct scsi_cmnd *scsi_cmnd) | |||
2170 | struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; | 2170 | struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; |
2171 | struct zfcp_qdio *qdio = adapter->qdio; | 2171 | struct zfcp_qdio *qdio = adapter->qdio; |
2172 | struct fsf_qtcb_bottom_io *io; | 2172 | struct fsf_qtcb_bottom_io *io; |
2173 | unsigned long flags; | ||
2173 | 2174 | ||
2174 | if (unlikely(!(atomic_read(&zfcp_sdev->status) & | 2175 | if (unlikely(!(atomic_read(&zfcp_sdev->status) & |
2175 | ZFCP_STATUS_COMMON_UNBLOCKED))) | 2176 | ZFCP_STATUS_COMMON_UNBLOCKED))) |
2176 | return -EBUSY; | 2177 | return -EBUSY; |
2177 | 2178 | ||
2178 | spin_lock(&qdio->req_q_lock); | 2179 | spin_lock_irqsave(&qdio->req_q_lock, flags); |
2179 | if (atomic_read(&qdio->req_q_free) <= 0) { | 2180 | if (atomic_read(&qdio->req_q_free) <= 0) { |
2180 | atomic_inc(&qdio->req_q_full); | 2181 | atomic_inc(&qdio->req_q_full); |
2181 | goto out; | 2182 | goto out; |
@@ -2239,7 +2240,7 @@ failed_scsi_cmnd: | |||
2239 | zfcp_fsf_req_free(req); | 2240 | zfcp_fsf_req_free(req); |
2240 | scsi_cmnd->host_scribble = NULL; | 2241 | scsi_cmnd->host_scribble = NULL; |
2241 | out: | 2242 | out: |
2242 | spin_unlock(&qdio->req_q_lock); | 2243 | spin_unlock_irqrestore(&qdio->req_q_lock, flags); |
2243 | return retval; | 2244 | return retval; |
2244 | } | 2245 | } |
2245 | 2246 | ||
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 6bd2dbc4c316..63529ed801eb 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -76,8 +76,8 @@ static void zfcp_scsi_command_fail(struct scsi_cmnd *scpnt, int result) | |||
76 | scpnt->scsi_done(scpnt); | 76 | scpnt->scsi_done(scpnt); |
77 | } | 77 | } |
78 | 78 | ||
79 | static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, | 79 | static |
80 | void (*done) (struct scsi_cmnd *)) | 80 | int zfcp_scsi_queuecommand(struct Scsi_Host *shost, struct scsi_cmnd *scpnt) |
81 | { | 81 | { |
82 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); | 82 | struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(scpnt->device); |
83 | struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; | 83 | struct zfcp_adapter *adapter = zfcp_sdev->port->adapter; |
@@ -87,7 +87,6 @@ static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, | |||
87 | /* reset the status for this request */ | 87 | /* reset the status for this request */ |
88 | scpnt->result = 0; | 88 | scpnt->result = 0; |
89 | scpnt->host_scribble = NULL; | 89 | scpnt->host_scribble = NULL; |
90 | scpnt->scsi_done = done; | ||
91 | 90 | ||
92 | scsi_result = fc_remote_port_chkready(rport); | 91 | scsi_result = fc_remote_port_chkready(rport); |
93 | if (unlikely(scsi_result)) { | 92 | if (unlikely(scsi_result)) { |
@@ -127,8 +126,6 @@ static int zfcp_scsi_queuecommand_lck(struct scsi_cmnd *scpnt, | |||
127 | return ret; | 126 | return ret; |
128 | } | 127 | } |
129 | 128 | ||
130 | static DEF_SCSI_QCMD(zfcp_scsi_queuecommand) | ||
131 | |||
132 | static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) | 129 | static int zfcp_scsi_slave_alloc(struct scsi_device *sdev) |
133 | { | 130 | { |
134 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); | 131 | struct fc_rport *rport = starget_to_rport(scsi_target(sdev)); |
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index b2fb2b2a6e70..a6dea08664fc 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c | |||
@@ -90,11 +90,7 @@ static const struct pci_device_id hpsa_pci_device_id[] = { | |||
90 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3252}, | 90 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3252}, |
91 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3253}, | 91 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3253}, |
92 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3254}, | 92 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSE, 0x103C, 0x3254}, |
93 | #define PCI_DEVICE_ID_HP_CISSF 0x333f | 93 | {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
94 | {PCI_VENDOR_ID_HP, PCI_DEVICE_ID_HP_CISSF, 0x103C, 0x333F}, | ||
95 | {PCI_VENDOR_ID_HP, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | ||
96 | PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, | ||
97 | {PCI_VENDOR_ID_COMPAQ, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | ||
98 | PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, | 94 | PCI_CLASS_STORAGE_RAID << 8, 0xffff << 8, 0}, |
99 | {0,} | 95 | {0,} |
100 | }; | 96 | }; |
@@ -113,8 +109,6 @@ static struct board_type products[] = { | |||
113 | {0x3249103C, "Smart Array P812", &SA5_access}, | 109 | {0x3249103C, "Smart Array P812", &SA5_access}, |
114 | {0x324a103C, "Smart Array P712m", &SA5_access}, | 110 | {0x324a103C, "Smart Array P712m", &SA5_access}, |
115 | {0x324b103C, "Smart Array P711m", &SA5_access}, | 111 | {0x324b103C, "Smart Array P711m", &SA5_access}, |
116 | {0x3233103C, "StorageWorks P1210m", &SA5_access}, | ||
117 | {0x333F103C, "StorageWorks P1210m", &SA5_access}, | ||
118 | {0x3250103C, "Smart Array", &SA5_access}, | 112 | {0x3250103C, "Smart Array", &SA5_access}, |
119 | {0x3250113C, "Smart Array", &SA5_access}, | 113 | {0x3250113C, "Smart Array", &SA5_access}, |
120 | {0x3250123C, "Smart Array", &SA5_access}, | 114 | {0x3250123C, "Smart Array", &SA5_access}, |
diff --git a/drivers/scsi/osd/osd_initiator.c b/drivers/scsi/osd/osd_initiator.c index 0433ea6f27c9..b37c8a3c1bb0 100644 --- a/drivers/scsi/osd/osd_initiator.c +++ b/drivers/scsi/osd/osd_initiator.c | |||
@@ -951,8 +951,8 @@ static int _osd_req_finalize_cdb_cont(struct osd_request *or, const u8 *cap_key) | |||
951 | /* create a bio for continuation segment */ | 951 | /* create a bio for continuation segment */ |
952 | bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes, | 952 | bio = bio_map_kern(req_q, or->cdb_cont.buff, or->cdb_cont.total_bytes, |
953 | GFP_KERNEL); | 953 | GFP_KERNEL); |
954 | if (unlikely(!bio)) | 954 | if (IS_ERR(bio)) |
955 | return -ENOMEM; | 955 | return PTR_ERR(bio); |
956 | 956 | ||
957 | bio->bi_rw |= REQ_WRITE; | 957 | bio->bi_rw |= REQ_WRITE; |
958 | 958 | ||
diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c index 5e76a624cb08..300d59f389da 100644 --- a/drivers/scsi/pmcraid.c +++ b/drivers/scsi/pmcraid.c | |||
@@ -62,6 +62,7 @@ | |||
62 | static unsigned int pmcraid_debug_log; | 62 | static unsigned int pmcraid_debug_log; |
63 | static unsigned int pmcraid_disable_aen; | 63 | static unsigned int pmcraid_disable_aen; |
64 | static unsigned int pmcraid_log_level = IOASC_LOG_LEVEL_MUST; | 64 | static unsigned int pmcraid_log_level = IOASC_LOG_LEVEL_MUST; |
65 | static unsigned int pmcraid_enable_msix; | ||
65 | 66 | ||
66 | /* | 67 | /* |
67 | * Data structures to support multiple adapters by the LLD. | 68 | * Data structures to support multiple adapters by the LLD. |
@@ -4691,7 +4692,8 @@ pmcraid_register_interrupt_handler(struct pmcraid_instance *pinstance) | |||
4691 | int rc; | 4692 | int rc; |
4692 | struct pci_dev *pdev = pinstance->pdev; | 4693 | struct pci_dev *pdev = pinstance->pdev; |
4693 | 4694 | ||
4694 | if (pci_find_capability(pdev, PCI_CAP_ID_MSIX)) { | 4695 | if ((pmcraid_enable_msix) && |
4696 | (pci_find_capability(pdev, PCI_CAP_ID_MSIX))) { | ||
4695 | int num_hrrq = PMCRAID_NUM_MSIX_VECTORS; | 4697 | int num_hrrq = PMCRAID_NUM_MSIX_VECTORS; |
4696 | struct msix_entry entries[PMCRAID_NUM_MSIX_VECTORS]; | 4698 | struct msix_entry entries[PMCRAID_NUM_MSIX_VECTORS]; |
4697 | int i; | 4699 | int i; |
diff --git a/drivers/scsi/pmcraid.h b/drivers/scsi/pmcraid.h index 1134279604e8..4db210d93947 100644 --- a/drivers/scsi/pmcraid.h +++ b/drivers/scsi/pmcraid.h | |||
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | #define PMCRAID_DRIVER_NAME "PMC MaxRAID" | 43 | #define PMCRAID_DRIVER_NAME "PMC MaxRAID" |
44 | #define PMCRAID_DEVFILE "pmcsas" | 44 | #define PMCRAID_DEVFILE "pmcsas" |
45 | #define PMCRAID_DRIVER_VERSION "2.0.3" | 45 | #define PMCRAID_DRIVER_VERSION "1.0.3" |
46 | #define PMCRAID_DRIVER_DATE __DATE__ | 46 | #define PMCRAID_DRIVER_DATE __DATE__ |
47 | 47 | ||
48 | #define PMCRAID_FW_VERSION_1 0x002 | 48 | #define PMCRAID_FW_VERSION_1 0x002 |
@@ -333,11 +333,9 @@ struct pmcraid_config_table_entry { | |||
333 | __u8 lun[PMCRAID_LUN_LEN]; | 333 | __u8 lun[PMCRAID_LUN_LEN]; |
334 | } __attribute__((packed, aligned(4))); | 334 | } __attribute__((packed, aligned(4))); |
335 | 335 | ||
336 | /* extended configuration table sizes are of 64 bytes in size */ | 336 | /* extended configuration table sizes are also of 32 bytes in size */ |
337 | #define PMCRAID_CFGTE_EXT_SIZE 32 | ||
338 | struct pmcraid_config_table_entry_ext { | 337 | struct pmcraid_config_table_entry_ext { |
339 | struct pmcraid_config_table_entry cfgte; | 338 | struct pmcraid_config_table_entry cfgte; |
340 | __u8 cfgte_ext[PMCRAID_CFGTE_EXT_SIZE]; | ||
341 | }; | 339 | }; |
342 | 340 | ||
343 | /* resource types (config_table_entry.resource_type values) */ | 341 | /* resource types (config_table_entry.resource_type values) */ |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 3a22effced5f..9ce539d4557e 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -2409,7 +2409,6 @@ struct qla_hw_data { | |||
2409 | uint32_t enable_target_reset :1; | 2409 | uint32_t enable_target_reset :1; |
2410 | uint32_t enable_lip_full_login :1; | 2410 | uint32_t enable_lip_full_login :1; |
2411 | uint32_t enable_led_scheme :1; | 2411 | uint32_t enable_led_scheme :1; |
2412 | uint32_t inta_enabled :1; | ||
2413 | uint32_t msi_enabled :1; | 2412 | uint32_t msi_enabled :1; |
2414 | uint32_t msix_enabled :1; | 2413 | uint32_t msix_enabled :1; |
2415 | uint32_t disable_serdes :1; | 2414 | uint32_t disable_serdes :1; |
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index 5f94430b42f0..4c1ba6263eb3 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c | |||
@@ -1061,6 +1061,7 @@ qla24xx_build_scsi_crc_2_iocbs(srb_t *sp, struct cmd_type_crc_2 *cmd_pkt, | |||
1061 | fcp_cmnd->additional_cdb_len |= 2; | 1061 | fcp_cmnd->additional_cdb_len |= 2; |
1062 | 1062 | ||
1063 | int_to_scsilun(sp->cmd->device->lun, &fcp_cmnd->lun); | 1063 | int_to_scsilun(sp->cmd->device->lun, &fcp_cmnd->lun); |
1064 | host_to_fcp_swap((uint8_t *)&fcp_cmnd->lun, sizeof(fcp_cmnd->lun)); | ||
1064 | memcpy(fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len); | 1065 | memcpy(fcp_cmnd->cdb, cmd->cmnd, cmd->cmd_len); |
1065 | cmd_pkt->fcp_cmnd_dseg_len = cpu_to_le16(fcp_cmnd_len); | 1066 | cmd_pkt->fcp_cmnd_dseg_len = cpu_to_le16(fcp_cmnd_len); |
1066 | cmd_pkt->fcp_cmnd_dseg_address[0] = cpu_to_le32( | 1067 | cmd_pkt->fcp_cmnd_dseg_address[0] = cpu_to_le32( |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 1f06ddd9bdd1..7f77898486a9 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -2491,14 +2491,15 @@ skip_msix: | |||
2491 | skip_msi: | 2491 | skip_msi: |
2492 | 2492 | ||
2493 | ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler, | 2493 | ret = request_irq(ha->pdev->irq, ha->isp_ops->intr_handler, |
2494 | IRQF_SHARED, QLA2XXX_DRIVER_NAME, rsp); | 2494 | ha->flags.msi_enabled ? 0 : IRQF_SHARED, |
2495 | QLA2XXX_DRIVER_NAME, rsp); | ||
2495 | if (ret) { | 2496 | if (ret) { |
2496 | qla_printk(KERN_WARNING, ha, | 2497 | qla_printk(KERN_WARNING, ha, |
2497 | "Failed to reserve interrupt %d already in use.\n", | 2498 | "Failed to reserve interrupt %d already in use.\n", |
2498 | ha->pdev->irq); | 2499 | ha->pdev->irq); |
2499 | goto fail; | 2500 | goto fail; |
2500 | } | 2501 | } |
2501 | ha->flags.inta_enabled = 1; | 2502 | |
2502 | clear_risc_ints: | 2503 | clear_risc_ints: |
2503 | 2504 | ||
2504 | /* | 2505 | /* |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index 8d9edfb39803..ae2acacc0003 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -2749,6 +2749,7 @@ sufficient_dsds: | |||
2749 | goto queuing_error_fcp_cmnd; | 2749 | goto queuing_error_fcp_cmnd; |
2750 | 2750 | ||
2751 | int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun); | 2751 | int_to_scsilun(sp->cmd->device->lun, &cmd_pkt->lun); |
2752 | host_to_fcp_swap((uint8_t *)&cmd_pkt->lun, sizeof(cmd_pkt->lun)); | ||
2752 | 2753 | ||
2753 | /* build FCP_CMND IU */ | 2754 | /* build FCP_CMND IU */ |
2754 | memset(ctx->fcp_cmnd, 0, sizeof(struct fcp_cmnd)); | 2755 | memset(ctx->fcp_cmnd, 0, sizeof(struct fcp_cmnd)); |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 1644eabaafeb..2c0876c81a3f 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -829,7 +829,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
829 | { | 829 | { |
830 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); | 830 | scsi_qla_host_t *vha = shost_priv(cmd->device->host); |
831 | srb_t *sp; | 831 | srb_t *sp; |
832 | int ret; | 832 | int ret = SUCCESS; |
833 | unsigned int id, lun; | 833 | unsigned int id, lun; |
834 | unsigned long flags; | 834 | unsigned long flags; |
835 | int wait = 0; | 835 | int wait = 0; |
@@ -2064,6 +2064,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
2064 | ha->init_cb_size = sizeof(struct mid_init_cb_81xx); | 2064 | ha->init_cb_size = sizeof(struct mid_init_cb_81xx); |
2065 | ha->gid_list_info_size = 8; | 2065 | ha->gid_list_info_size = 8; |
2066 | ha->optrom_size = OPTROM_SIZE_82XX; | 2066 | ha->optrom_size = OPTROM_SIZE_82XX; |
2067 | ha->nvram_npiv_size = QLA_MAX_VPORTS_QLA25XX; | ||
2067 | ha->isp_ops = &qla82xx_isp_ops; | 2068 | ha->isp_ops = &qla82xx_isp_ops; |
2068 | ha->flash_conf_off = FARX_ACCESS_FLASH_CONF; | 2069 | ha->flash_conf_off = FARX_ACCESS_FLASH_CONF; |
2069 | ha->flash_data_off = FARX_ACCESS_FLASH_DATA; | 2070 | ha->flash_data_off = FARX_ACCESS_FLASH_DATA; |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 8edbccb3232d..cf0075a2d0c2 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
@@ -7,9 +7,9 @@ | |||
7 | /* | 7 | /* |
8 | * Driver version | 8 | * Driver version |
9 | */ | 9 | */ |
10 | #define QLA2XXX_VERSION "8.03.04-k0" | 10 | #define QLA2XXX_VERSION "8.03.05-k0" |
11 | 11 | ||
12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
13 | #define QLA_DRIVER_MINOR_VER 3 | 13 | #define QLA_DRIVER_MINOR_VER 3 |
14 | #define QLA_DRIVER_PATCH_VER 4 | 14 | #define QLA_DRIVER_PATCH_VER 5 |
15 | #define QLA_DRIVER_BETA_VER 0 | 15 | #define QLA_DRIVER_BETA_VER 0 |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 824b8fc03ce5..30ac116186f5 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -615,7 +615,7 @@ static int scsi_try_bus_device_reset(struct scsi_cmnd *scmd) | |||
615 | return rtn; | 615 | return rtn; |
616 | } | 616 | } |
617 | 617 | ||
618 | static int __scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) | 618 | static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) |
619 | { | 619 | { |
620 | if (!scmd->device->host->hostt->eh_abort_handler) | 620 | if (!scmd->device->host->hostt->eh_abort_handler) |
621 | return FAILED; | 621 | return FAILED; |
@@ -623,31 +623,9 @@ static int __scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) | |||
623 | return scmd->device->host->hostt->eh_abort_handler(scmd); | 623 | return scmd->device->host->hostt->eh_abort_handler(scmd); |
624 | } | 624 | } |
625 | 625 | ||
626 | /** | ||
627 | * scsi_try_to_abort_cmd - Ask host to abort a running command. | ||
628 | * @scmd: SCSI cmd to abort from Lower Level. | ||
629 | * | ||
630 | * Notes: | ||
631 | * This function will not return until the user's completion function | ||
632 | * has been called. there is no timeout on this operation. if the | ||
633 | * author of the low-level driver wishes this operation to be timed, | ||
634 | * they can provide this facility themselves. helper functions in | ||
635 | * scsi_error.c can be supplied to make this easier to do. | ||
636 | */ | ||
637 | static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) | ||
638 | { | ||
639 | /* | ||
640 | * scsi_done was called just after the command timed out and before | ||
641 | * we had a chance to process it. (db) | ||
642 | */ | ||
643 | if (scmd->serial_number == 0) | ||
644 | return SUCCESS; | ||
645 | return __scsi_try_to_abort_cmd(scmd); | ||
646 | } | ||
647 | |||
648 | static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd) | 626 | static void scsi_abort_eh_cmnd(struct scsi_cmnd *scmd) |
649 | { | 627 | { |
650 | if (__scsi_try_to_abort_cmd(scmd) != SUCCESS) | 628 | if (scsi_try_to_abort_cmd(scmd) != SUCCESS) |
651 | if (scsi_try_bus_device_reset(scmd) != SUCCESS) | 629 | if (scsi_try_bus_device_reset(scmd) != SUCCESS) |
652 | if (scsi_try_target_reset(scmd) != SUCCESS) | 630 | if (scsi_try_target_reset(scmd) != SUCCESS) |
653 | if (scsi_try_bus_reset(scmd) != SUCCESS) | 631 | if (scsi_try_bus_reset(scmd) != SUCCESS) |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index eafeeda6e194..5b6bbaea59fe 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1403,11 +1403,6 @@ static void scsi_softirq_done(struct request *rq) | |||
1403 | 1403 | ||
1404 | INIT_LIST_HEAD(&cmd->eh_entry); | 1404 | INIT_LIST_HEAD(&cmd->eh_entry); |
1405 | 1405 | ||
1406 | /* | ||
1407 | * Set the serial numbers back to zero | ||
1408 | */ | ||
1409 | cmd->serial_number = 0; | ||
1410 | |||
1411 | atomic_inc(&cmd->device->iodone_cnt); | 1406 | atomic_inc(&cmd->device->iodone_cnt); |
1412 | if (cmd->result) | 1407 | if (cmd->result) |
1413 | atomic_inc(&cmd->device->ioerr_cnt); | 1408 | atomic_inc(&cmd->device->ioerr_cnt); |
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/kgdboc.c b/drivers/serial/kgdboc.c index 3374618300af..25a8bc565f40 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c | |||
@@ -90,7 +90,8 @@ static DECLARE_WORK(kgdboc_restore_input_work, kgdboc_restore_input_helper); | |||
90 | 90 | ||
91 | static void kgdboc_restore_input(void) | 91 | static void kgdboc_restore_input(void) |
92 | { | 92 | { |
93 | schedule_work(&kgdboc_restore_input_work); | 93 | if (likely(system_state == SYSTEM_RUNNING)) |
94 | schedule_work(&kgdboc_restore_input_work); | ||
94 | } | 95 | } |
95 | 96 | ||
96 | static int kgdboc_register_kbd(char **cptr) | 97 | static int kgdboc_register_kbd(char **cptr) |
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/spi/dw_spi.c b/drivers/spi/dw_spi.c index 90439314cf67..0838c79861e4 100644 --- a/drivers/spi/dw_spi.c +++ b/drivers/spi/dw_spi.c | |||
@@ -413,6 +413,11 @@ static void poll_transfer(struct dw_spi *dws) | |||
413 | { | 413 | { |
414 | while (dws->write(dws)) | 414 | while (dws->write(dws)) |
415 | dws->read(dws); | 415 | dws->read(dws); |
416 | /* | ||
417 | * There is a possibility that the last word of a transaction | ||
418 | * will be lost if data is not ready. Re-read to solve this issue. | ||
419 | */ | ||
420 | dws->read(dws); | ||
416 | 421 | ||
417 | transfer_complete(dws); | 422 | transfer_complete(dws); |
418 | } | 423 | } |
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/atm/usbatm.c b/drivers/usb/atm/usbatm.c index 05bf5a27b5b0..989e16e4ab5c 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -951,7 +951,9 @@ static int usbatm_atm_init(struct usbatm_data *instance) | |||
951 | * condition: callbacks we register can be executed at once, before we have | 951 | * condition: callbacks we register can be executed at once, before we have |
952 | * initialized the struct atm_dev. To protect against this, all callbacks | 952 | * initialized the struct atm_dev. To protect against this, all callbacks |
953 | * abort if atm_dev->dev_data is NULL. */ | 953 | * abort if atm_dev->dev_data is NULL. */ |
954 | atm_dev = atm_dev_register(instance->driver_name, &usbatm_atm_devops, -1, NULL); | 954 | atm_dev = atm_dev_register(instance->driver_name, |
955 | &instance->usb_intf->dev, &usbatm_atm_devops, | ||
956 | -1, NULL); | ||
955 | if (!atm_dev) { | 957 | if (!atm_dev) { |
956 | usb_err(instance, "%s: failed to register ATM device!\n", __func__); | 958 | usb_err(instance, "%s: failed to register ATM device!\n", __func__); |
957 | return -1; | 959 | return -1; |
@@ -966,14 +968,6 @@ static int usbatm_atm_init(struct usbatm_data *instance) | |||
966 | /* temp init ATM device, set to 128kbit */ | 968 | /* temp init ATM device, set to 128kbit */ |
967 | atm_dev->link_rate = 128 * 1000 / 424; | 969 | atm_dev->link_rate = 128 * 1000 / 424; |
968 | 970 | ||
969 | ret = sysfs_create_link(&atm_dev->class_dev.kobj, | ||
970 | &instance->usb_intf->dev.kobj, "device"); | ||
971 | if (ret) { | ||
972 | atm_err(instance, "%s: sysfs_create_link failed: %d\n", | ||
973 | __func__, ret); | ||
974 | goto fail_sysfs; | ||
975 | } | ||
976 | |||
977 | if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { | 971 | if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) { |
978 | atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); | 972 | atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret); |
979 | goto fail; | 973 | goto fail; |
@@ -992,8 +986,6 @@ static int usbatm_atm_init(struct usbatm_data *instance) | |||
992 | return 0; | 986 | return 0; |
993 | 987 | ||
994 | fail: | 988 | fail: |
995 | sysfs_remove_link(&atm_dev->class_dev.kobj, "device"); | ||
996 | fail_sysfs: | ||
997 | instance->atm_dev = NULL; | 989 | instance->atm_dev = NULL; |
998 | atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ | 990 | atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */ |
999 | return ret; | 991 | return ret; |
@@ -1329,7 +1321,6 @@ void usbatm_usb_disconnect(struct usb_interface *intf) | |||
1329 | 1321 | ||
1330 | /* ATM finalize */ | 1322 | /* ATM finalize */ |
1331 | if (instance->atm_dev) { | 1323 | if (instance->atm_dev) { |
1332 | sysfs_remove_link(&instance->atm_dev->class_dev.kobj, "device"); | ||
1333 | atm_dev_deregister(instance->atm_dev); | 1324 | atm_dev_deregister(instance->atm_dev); |
1334 | instance->atm_dev = NULL; | 1325 | instance->atm_dev = NULL; |
1335 | } | 1326 | } |
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/vhost/vhost.c b/drivers/vhost/vhost.c index 94701ff3a23a..159c77a5746f 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -884,6 +884,7 @@ static int log_write(void __user *log_base, | |||
884 | int r; | 884 | int r; |
885 | if (!write_length) | 885 | if (!write_length) |
886 | return 0; | 886 | return 0; |
887 | write_length += write_address % VHOST_PAGE_SIZE; | ||
887 | write_address /= VHOST_PAGE_SIZE; | 888 | write_address /= VHOST_PAGE_SIZE; |
888 | for (;;) { | 889 | for (;;) { |
889 | u64 base = (u64)(unsigned long)log_base; | 890 | u64 base = (u64)(unsigned long)log_base; |
@@ -897,7 +898,7 @@ static int log_write(void __user *log_base, | |||
897 | if (write_length <= VHOST_PAGE_SIZE) | 898 | if (write_length <= VHOST_PAGE_SIZE) |
898 | break; | 899 | break; |
899 | write_length -= VHOST_PAGE_SIZE; | 900 | write_length -= VHOST_PAGE_SIZE; |
900 | write_address += VHOST_PAGE_SIZE; | 901 | write_address += 1; |
901 | } | 902 | } |
902 | return r; | 903 | return r; |
903 | } | 904 | } |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 27c1fb4b1e0d..ab77297fbed2 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -1850,6 +1850,16 @@ config FB_PXA_PARAMETERS | |||
1850 | 1850 | ||
1851 | <file:Documentation/fb/pxafb.txt> describes the available parameters. | 1851 | <file:Documentation/fb/pxafb.txt> describes the available parameters. |
1852 | 1852 | ||
1853 | config PXA3XX_GCU | ||
1854 | tristate "PXA3xx 2D graphics accelerator driver" | ||
1855 | depends on FB_PXA | ||
1856 | help | ||
1857 | Kernelspace driver for the 2D graphics controller unit (GCU) | ||
1858 | found on PXA3xx processors. There is a counterpart driver in the | ||
1859 | DirectFB suite, see http://www.directfb.org/ | ||
1860 | |||
1861 | If you compile this as a module, it will be called pxa3xx_gcu. | ||
1862 | |||
1853 | config FB_MBX | 1863 | config FB_MBX |
1854 | tristate "2700G LCD framebuffer support" | 1864 | tristate "2700G LCD framebuffer support" |
1855 | depends on FB && ARCH_PXA | 1865 | depends on FB && ARCH_PXA |
diff --git a/drivers/video/Makefile b/drivers/video/Makefile index 485e8ed1318c..9260a898f343 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile | |||
@@ -100,6 +100,7 @@ obj-$(CONFIG_FB_CIRRUS) += cirrusfb.o | |||
100 | obj-$(CONFIG_FB_ASILIANT) += asiliantfb.o | 100 | obj-$(CONFIG_FB_ASILIANT) += asiliantfb.o |
101 | obj-$(CONFIG_FB_PXA) += pxafb.o | 101 | obj-$(CONFIG_FB_PXA) += pxafb.o |
102 | obj-$(CONFIG_FB_PXA168) += pxa168fb.o | 102 | obj-$(CONFIG_FB_PXA168) += pxa168fb.o |
103 | obj-$(CONFIG_PXA3XX_GCU) += pxa3xx-gcu.o | ||
103 | obj-$(CONFIG_FB_W100) += w100fb.o | 104 | obj-$(CONFIG_FB_W100) += w100fb.o |
104 | obj-$(CONFIG_FB_TMIO) += tmiofb.o | 105 | obj-$(CONFIG_FB_TMIO) += tmiofb.o |
105 | obj-$(CONFIG_FB_AU1100) += au1100fb.o | 106 | obj-$(CONFIG_FB_AU1100) += au1100fb.o |
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/video/pxa3xx-gcu.c b/drivers/video/pxa3xx-gcu.c new file mode 100644 index 000000000000..b81168df253d --- /dev/null +++ b/drivers/video/pxa3xx-gcu.c | |||
@@ -0,0 +1,772 @@ | |||
1 | /* | ||
2 | * pxa3xx-gc.c - Linux kernel module for PXA3xx graphics controllers | ||
3 | * | ||
4 | * This driver needs a DirectFB counterpart in user space, communication | ||
5 | * is handled via mmap()ed memory areas and an ioctl. | ||
6 | * | ||
7 | * Copyright (c) 2009 Daniel Mack <daniel@caiaq.de> | ||
8 | * Copyright (c) 2009 Janine Kropp <nin@directfb.org> | ||
9 | * Copyright (c) 2009 Denis Oliver Kropp <dok@directfb.org> | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify | ||
12 | * it under the terms of the GNU General Public License as published by | ||
13 | * the Free Software Foundation; either version 2 of the License, or | ||
14 | * (at your option) any later version. | ||
15 | * | ||
16 | * This program is distributed in the hope that it will be useful, | ||
17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | * GNU General Public License for more details. | ||
20 | * | ||
21 | * You should have received a copy of the GNU General Public License | ||
22 | * along with this program; if not, write to the Free Software | ||
23 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | */ | ||
25 | |||
26 | /* | ||
27 | * WARNING: This controller is attached to System Bus 2 of the PXA which | ||
28 | * needs its arbiter to be enabled explictly (CKENB & 1<<9). | ||
29 | * There is currently no way to do this from Linux, so you need to teach | ||
30 | * your bootloader for now. | ||
31 | */ | ||
32 | |||
33 | #include <linux/module.h> | ||
34 | #include <linux/version.h> | ||
35 | |||
36 | #include <linux/platform_device.h> | ||
37 | #include <linux/dma-mapping.h> | ||
38 | #include <linux/miscdevice.h> | ||
39 | #include <linux/interrupt.h> | ||
40 | #include <linux/spinlock.h> | ||
41 | #include <linux/uaccess.h> | ||
42 | #include <linux/ioctl.h> | ||
43 | #include <linux/delay.h> | ||
44 | #include <linux/sched.h> | ||
45 | #include <linux/slab.h> | ||
46 | #include <linux/clk.h> | ||
47 | #include <linux/fs.h> | ||
48 | #include <linux/io.h> | ||
49 | |||
50 | #include "pxa3xx-gcu.h" | ||
51 | |||
52 | #define DRV_NAME "pxa3xx-gcu" | ||
53 | #define MISCDEV_MINOR 197 | ||
54 | |||
55 | #define REG_GCCR 0x00 | ||
56 | #define GCCR_SYNC_CLR (1 << 9) | ||
57 | #define GCCR_BP_RST (1 << 8) | ||
58 | #define GCCR_ABORT (1 << 6) | ||
59 | #define GCCR_STOP (1 << 4) | ||
60 | |||
61 | #define REG_GCISCR 0x04 | ||
62 | #define REG_GCIECR 0x08 | ||
63 | #define REG_GCRBBR 0x20 | ||
64 | #define REG_GCRBLR 0x24 | ||
65 | #define REG_GCRBHR 0x28 | ||
66 | #define REG_GCRBTR 0x2C | ||
67 | #define REG_GCRBEXHR 0x30 | ||
68 | |||
69 | #define IE_EOB (1 << 0) | ||
70 | #define IE_EEOB (1 << 5) | ||
71 | #define IE_ALL 0xff | ||
72 | |||
73 | #define SHARED_SIZE PAGE_ALIGN(sizeof(struct pxa3xx_gcu_shared)) | ||
74 | |||
75 | /* #define PXA3XX_GCU_DEBUG */ | ||
76 | /* #define PXA3XX_GCU_DEBUG_TIMER */ | ||
77 | |||
78 | #ifdef PXA3XX_GCU_DEBUG | ||
79 | #define QDUMP(msg) \ | ||
80 | do { \ | ||
81 | QPRINT(priv, KERN_DEBUG, msg); \ | ||
82 | } while (0) | ||
83 | #else | ||
84 | #define QDUMP(msg) do {} while (0) | ||
85 | #endif | ||
86 | |||
87 | #define QERROR(msg) \ | ||
88 | do { \ | ||
89 | QPRINT(priv, KERN_ERR, msg); \ | ||
90 | } while (0) | ||
91 | |||
92 | struct pxa3xx_gcu_batch { | ||
93 | struct pxa3xx_gcu_batch *next; | ||
94 | u32 *ptr; | ||
95 | dma_addr_t phys; | ||
96 | unsigned long length; | ||
97 | }; | ||
98 | |||
99 | struct pxa3xx_gcu_priv { | ||
100 | void __iomem *mmio_base; | ||
101 | struct clk *clk; | ||
102 | struct pxa3xx_gcu_shared *shared; | ||
103 | dma_addr_t shared_phys; | ||
104 | struct resource *resource_mem; | ||
105 | struct miscdevice misc_dev; | ||
106 | struct file_operations misc_fops; | ||
107 | wait_queue_head_t wait_idle; | ||
108 | wait_queue_head_t wait_free; | ||
109 | spinlock_t spinlock; | ||
110 | struct timeval base_time; | ||
111 | |||
112 | struct pxa3xx_gcu_batch *free; | ||
113 | |||
114 | struct pxa3xx_gcu_batch *ready; | ||
115 | struct pxa3xx_gcu_batch *ready_last; | ||
116 | struct pxa3xx_gcu_batch *running; | ||
117 | }; | ||
118 | |||
119 | static inline unsigned long | ||
120 | gc_readl(struct pxa3xx_gcu_priv *priv, unsigned int off) | ||
121 | { | ||
122 | return __raw_readl(priv->mmio_base + off); | ||
123 | } | ||
124 | |||
125 | static inline void | ||
126 | gc_writel(struct pxa3xx_gcu_priv *priv, unsigned int off, unsigned long val) | ||
127 | { | ||
128 | __raw_writel(val, priv->mmio_base + off); | ||
129 | } | ||
130 | |||
131 | #define QPRINT(priv, level, msg) \ | ||
132 | do { \ | ||
133 | struct timeval tv; \ | ||
134 | struct pxa3xx_gcu_shared *shared = priv->shared; \ | ||
135 | u32 base = gc_readl(priv, REG_GCRBBR); \ | ||
136 | \ | ||
137 | do_gettimeofday(&tv); \ | ||
138 | \ | ||
139 | printk(level "%ld.%03ld.%03ld - %-17s: %-21s (%s, " \ | ||
140 | "STATUS " \ | ||
141 | "0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, " \ | ||
142 | "T %5ld)\n", \ | ||
143 | tv.tv_sec - priv->base_time.tv_sec, \ | ||
144 | tv.tv_usec / 1000, tv.tv_usec % 1000, \ | ||
145 | __func__, msg, \ | ||
146 | shared->hw_running ? "running" : " idle", \ | ||
147 | gc_readl(priv, REG_GCISCR), \ | ||
148 | gc_readl(priv, REG_GCRBBR), \ | ||
149 | gc_readl(priv, REG_GCRBLR), \ | ||
150 | (gc_readl(priv, REG_GCRBEXHR) - base) / 4, \ | ||
151 | (gc_readl(priv, REG_GCRBHR) - base) / 4, \ | ||
152 | (gc_readl(priv, REG_GCRBTR) - base) / 4); \ | ||
153 | } while (0) | ||
154 | |||
155 | static void | ||
156 | pxa3xx_gcu_reset(struct pxa3xx_gcu_priv *priv) | ||
157 | { | ||
158 | QDUMP("RESET"); | ||
159 | |||
160 | /* disable interrupts */ | ||
161 | gc_writel(priv, REG_GCIECR, 0); | ||
162 | |||
163 | /* reset hardware */ | ||
164 | gc_writel(priv, REG_GCCR, GCCR_ABORT); | ||
165 | gc_writel(priv, REG_GCCR, 0); | ||
166 | |||
167 | memset(priv->shared, 0, SHARED_SIZE); | ||
168 | priv->shared->buffer_phys = priv->shared_phys; | ||
169 | priv->shared->magic = PXA3XX_GCU_SHARED_MAGIC; | ||
170 | |||
171 | do_gettimeofday(&priv->base_time); | ||
172 | |||
173 | /* set up the ring buffer pointers */ | ||
174 | gc_writel(priv, REG_GCRBLR, 0); | ||
175 | gc_writel(priv, REG_GCRBBR, priv->shared_phys); | ||
176 | gc_writel(priv, REG_GCRBTR, priv->shared_phys); | ||
177 | |||
178 | /* enable all IRQs except EOB */ | ||
179 | gc_writel(priv, REG_GCIECR, IE_ALL & ~IE_EOB); | ||
180 | } | ||
181 | |||
182 | static void | ||
183 | dump_whole_state(struct pxa3xx_gcu_priv *priv) | ||
184 | { | ||
185 | struct pxa3xx_gcu_shared *sh = priv->shared; | ||
186 | u32 base = gc_readl(priv, REG_GCRBBR); | ||
187 | |||
188 | QDUMP("DUMP"); | ||
189 | |||
190 | printk(KERN_DEBUG "== PXA3XX-GCU DUMP ==\n" | ||
191 | "%s, STATUS 0x%02lx, B 0x%08lx [%ld], E %5ld, H %5ld, T %5ld\n", | ||
192 | sh->hw_running ? "running" : "idle ", | ||
193 | gc_readl(priv, REG_GCISCR), | ||
194 | gc_readl(priv, REG_GCRBBR), | ||
195 | gc_readl(priv, REG_GCRBLR), | ||
196 | (gc_readl(priv, REG_GCRBEXHR) - base) / 4, | ||
197 | (gc_readl(priv, REG_GCRBHR) - base) / 4, | ||
198 | (gc_readl(priv, REG_GCRBTR) - base) / 4); | ||
199 | } | ||
200 | |||
201 | static void | ||
202 | flush_running(struct pxa3xx_gcu_priv *priv) | ||
203 | { | ||
204 | struct pxa3xx_gcu_batch *running = priv->running; | ||
205 | struct pxa3xx_gcu_batch *next; | ||
206 | |||
207 | while (running) { | ||
208 | next = running->next; | ||
209 | running->next = priv->free; | ||
210 | priv->free = running; | ||
211 | running = next; | ||
212 | } | ||
213 | |||
214 | priv->running = NULL; | ||
215 | } | ||
216 | |||
217 | static void | ||
218 | run_ready(struct pxa3xx_gcu_priv *priv) | ||
219 | { | ||
220 | unsigned int num = 0; | ||
221 | struct pxa3xx_gcu_shared *shared = priv->shared; | ||
222 | struct pxa3xx_gcu_batch *ready = priv->ready; | ||
223 | |||
224 | QDUMP("Start"); | ||
225 | |||
226 | BUG_ON(!ready); | ||
227 | |||
228 | shared->buffer[num++] = 0x05000000; | ||
229 | |||
230 | while (ready) { | ||
231 | shared->buffer[num++] = 0x00000001; | ||
232 | shared->buffer[num++] = ready->phys; | ||
233 | ready = ready->next; | ||
234 | } | ||
235 | |||
236 | shared->buffer[num++] = 0x05000000; | ||
237 | priv->running = priv->ready; | ||
238 | priv->ready = priv->ready_last = NULL; | ||
239 | gc_writel(priv, REG_GCRBLR, 0); | ||
240 | shared->hw_running = 1; | ||
241 | |||
242 | /* ring base address */ | ||
243 | gc_writel(priv, REG_GCRBBR, shared->buffer_phys); | ||
244 | |||
245 | /* ring tail address */ | ||
246 | gc_writel(priv, REG_GCRBTR, shared->buffer_phys + num * 4); | ||
247 | |||
248 | /* ring length */ | ||
249 | gc_writel(priv, REG_GCRBLR, ((num + 63) & ~63) * 4); | ||
250 | } | ||
251 | |||
252 | static irqreturn_t | ||
253 | pxa3xx_gcu_handle_irq(int irq, void *ctx) | ||
254 | { | ||
255 | struct pxa3xx_gcu_priv *priv = ctx; | ||
256 | struct pxa3xx_gcu_shared *shared = priv->shared; | ||
257 | u32 status = gc_readl(priv, REG_GCISCR) & IE_ALL; | ||
258 | |||
259 | QDUMP("-Interrupt"); | ||
260 | |||
261 | if (!status) | ||
262 | return IRQ_NONE; | ||
263 | |||
264 | spin_lock(&priv->spinlock); | ||
265 | shared->num_interrupts++; | ||
266 | |||
267 | if (status & IE_EEOB) { | ||
268 | QDUMP(" [EEOB]"); | ||
269 | |||
270 | flush_running(priv); | ||
271 | wake_up_all(&priv->wait_free); | ||
272 | |||
273 | if (priv->ready) { | ||
274 | run_ready(priv); | ||
275 | } else { | ||
276 | /* There is no more data prepared by the userspace. | ||
277 | * Set hw_running = 0 and wait for the next userspace | ||
278 | * kick-off */ | ||
279 | shared->num_idle++; | ||
280 | shared->hw_running = 0; | ||
281 | |||
282 | QDUMP(" '-> Idle."); | ||
283 | |||
284 | /* set ring buffer length to zero */ | ||
285 | gc_writel(priv, REG_GCRBLR, 0); | ||
286 | |||
287 | wake_up_all(&priv->wait_idle); | ||
288 | } | ||
289 | |||
290 | shared->num_done++; | ||
291 | } else { | ||
292 | QERROR(" [???]"); | ||
293 | dump_whole_state(priv); | ||
294 | } | ||
295 | |||
296 | /* Clear the interrupt */ | ||
297 | gc_writel(priv, REG_GCISCR, status); | ||
298 | spin_unlock(&priv->spinlock); | ||
299 | |||
300 | return IRQ_HANDLED; | ||
301 | } | ||
302 | |||
303 | static int | ||
304 | pxa3xx_gcu_wait_idle(struct pxa3xx_gcu_priv *priv) | ||
305 | { | ||
306 | int ret = 0; | ||
307 | |||
308 | QDUMP("Waiting for idle..."); | ||
309 | |||
310 | /* Does not need to be atomic. There's a lock in user space, | ||
311 | * but anyhow, this is just for statistics. */ | ||
312 | priv->shared->num_wait_idle++; | ||
313 | |||
314 | while (priv->shared->hw_running) { | ||
315 | int num = priv->shared->num_interrupts; | ||
316 | u32 rbexhr = gc_readl(priv, REG_GCRBEXHR); | ||
317 | |||
318 | ret = wait_event_interruptible_timeout(priv->wait_idle, | ||
319 | !priv->shared->hw_running, HZ*4); | ||
320 | |||
321 | if (ret < 0) | ||
322 | break; | ||
323 | |||
324 | if (ret > 0) | ||
325 | continue; | ||
326 | |||
327 | if (gc_readl(priv, REG_GCRBEXHR) == rbexhr && | ||
328 | priv->shared->num_interrupts == num) { | ||
329 | QERROR("TIMEOUT"); | ||
330 | ret = -ETIMEDOUT; | ||
331 | break; | ||
332 | } | ||
333 | } | ||
334 | |||
335 | QDUMP("done"); | ||
336 | |||
337 | return ret; | ||
338 | } | ||
339 | |||
340 | static int | ||
341 | pxa3xx_gcu_wait_free(struct pxa3xx_gcu_priv *priv) | ||
342 | { | ||
343 | int ret = 0; | ||
344 | |||
345 | QDUMP("Waiting for free..."); | ||
346 | |||
347 | /* Does not need to be atomic. There's a lock in user space, | ||
348 | * but anyhow, this is just for statistics. */ | ||
349 | priv->shared->num_wait_free++; | ||
350 | |||
351 | while (!priv->free) { | ||
352 | u32 rbexhr = gc_readl(priv, REG_GCRBEXHR); | ||
353 | |||
354 | ret = wait_event_interruptible_timeout(priv->wait_free, | ||
355 | priv->free, HZ*4); | ||
356 | |||
357 | if (ret < 0) | ||
358 | break; | ||
359 | |||
360 | if (ret > 0) | ||
361 | continue; | ||
362 | |||
363 | if (gc_readl(priv, REG_GCRBEXHR) == rbexhr) { | ||
364 | QERROR("TIMEOUT"); | ||
365 | ret = -ETIMEDOUT; | ||
366 | break; | ||
367 | } | ||
368 | } | ||
369 | |||
370 | QDUMP("done"); | ||
371 | |||
372 | return ret; | ||
373 | } | ||
374 | |||
375 | /* Misc device layer */ | ||
376 | |||
377 | static ssize_t | ||
378 | pxa3xx_gcu_misc_write(struct file *filp, const char *buff, | ||
379 | size_t count, loff_t *offp) | ||
380 | { | ||
381 | int ret; | ||
382 | unsigned long flags; | ||
383 | struct pxa3xx_gcu_batch *buffer; | ||
384 | struct pxa3xx_gcu_priv *priv = | ||
385 | container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops); | ||
386 | |||
387 | int words = count / 4; | ||
388 | |||
389 | /* Does not need to be atomic. There's a lock in user space, | ||
390 | * but anyhow, this is just for statistics. */ | ||
391 | priv->shared->num_writes++; | ||
392 | |||
393 | priv->shared->num_words += words; | ||
394 | |||
395 | /* Last word reserved for batch buffer end command */ | ||
396 | if (words >= PXA3XX_GCU_BATCH_WORDS) | ||
397 | return -E2BIG; | ||
398 | |||
399 | /* Wait for a free buffer */ | ||
400 | if (!priv->free) { | ||
401 | ret = pxa3xx_gcu_wait_free(priv); | ||
402 | if (ret < 0) | ||
403 | return ret; | ||
404 | } | ||
405 | |||
406 | /* | ||
407 | * Get buffer from free list | ||
408 | */ | ||
409 | spin_lock_irqsave(&priv->spinlock, flags); | ||
410 | |||
411 | buffer = priv->free; | ||
412 | priv->free = buffer->next; | ||
413 | |||
414 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
415 | |||
416 | |||
417 | /* Copy data from user into buffer */ | ||
418 | ret = copy_from_user(buffer->ptr, buff, words * 4); | ||
419 | if (ret) { | ||
420 | spin_lock_irqsave(&priv->spinlock, flags); | ||
421 | buffer->next = priv->free; | ||
422 | priv->free = buffer; | ||
423 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
424 | return ret; | ||
425 | } | ||
426 | |||
427 | buffer->length = words; | ||
428 | |||
429 | /* Append batch buffer end command */ | ||
430 | buffer->ptr[words] = 0x01000000; | ||
431 | |||
432 | /* | ||
433 | * Add buffer to ready list | ||
434 | */ | ||
435 | spin_lock_irqsave(&priv->spinlock, flags); | ||
436 | |||
437 | buffer->next = NULL; | ||
438 | |||
439 | if (priv->ready) { | ||
440 | BUG_ON(priv->ready_last == NULL); | ||
441 | |||
442 | priv->ready_last->next = buffer; | ||
443 | } else | ||
444 | priv->ready = buffer; | ||
445 | |||
446 | priv->ready_last = buffer; | ||
447 | |||
448 | if (!priv->shared->hw_running) | ||
449 | run_ready(priv); | ||
450 | |||
451 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
452 | |||
453 | return words * 4; | ||
454 | } | ||
455 | |||
456 | |||
457 | static long | ||
458 | pxa3xx_gcu_misc_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | ||
459 | { | ||
460 | unsigned long flags; | ||
461 | struct pxa3xx_gcu_priv *priv = | ||
462 | container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops); | ||
463 | |||
464 | switch (cmd) { | ||
465 | case PXA3XX_GCU_IOCTL_RESET: | ||
466 | spin_lock_irqsave(&priv->spinlock, flags); | ||
467 | pxa3xx_gcu_reset(priv); | ||
468 | spin_unlock_irqrestore(&priv->spinlock, flags); | ||
469 | return 0; | ||
470 | |||
471 | case PXA3XX_GCU_IOCTL_WAIT_IDLE: | ||
472 | return pxa3xx_gcu_wait_idle(priv); | ||
473 | } | ||
474 | |||
475 | return -ENOSYS; | ||
476 | } | ||
477 | |||
478 | static int | ||
479 | pxa3xx_gcu_misc_mmap(struct file *filp, struct vm_area_struct *vma) | ||
480 | { | ||
481 | unsigned int size = vma->vm_end - vma->vm_start; | ||
482 | struct pxa3xx_gcu_priv *priv = | ||
483 | container_of(filp->f_op, struct pxa3xx_gcu_priv, misc_fops); | ||
484 | |||
485 | switch (vma->vm_pgoff) { | ||
486 | case 0: | ||
487 | /* hand out the shared data area */ | ||
488 | if (size != SHARED_SIZE) | ||
489 | return -EINVAL; | ||
490 | |||
491 | return dma_mmap_coherent(NULL, vma, | ||
492 | priv->shared, priv->shared_phys, size); | ||
493 | |||
494 | case SHARED_SIZE >> PAGE_SHIFT: | ||
495 | /* hand out the MMIO base for direct register access | ||
496 | * from userspace */ | ||
497 | if (size != resource_size(priv->resource_mem)) | ||
498 | return -EINVAL; | ||
499 | |||
500 | vma->vm_flags |= VM_IO; | ||
501 | vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); | ||
502 | |||
503 | return io_remap_pfn_range(vma, vma->vm_start, | ||
504 | priv->resource_mem->start >> PAGE_SHIFT, | ||
505 | size, vma->vm_page_prot); | ||
506 | } | ||
507 | |||
508 | return -EINVAL; | ||
509 | } | ||
510 | |||
511 | |||
512 | #ifdef PXA3XX_GCU_DEBUG_TIMER | ||
513 | static struct timer_list pxa3xx_gcu_debug_timer; | ||
514 | |||
515 | static void pxa3xx_gcu_debug_timedout(unsigned long ptr) | ||
516 | { | ||
517 | struct pxa3xx_gcu_priv *priv = (struct pxa3xx_gcu_priv *) ptr; | ||
518 | |||
519 | QERROR("Timer DUMP"); | ||
520 | |||
521 | /* init the timer structure */ | ||
522 | init_timer(&pxa3xx_gcu_debug_timer); | ||
523 | pxa3xx_gcu_debug_timer.function = pxa3xx_gcu_debug_timedout; | ||
524 | pxa3xx_gcu_debug_timer.data = ptr; | ||
525 | pxa3xx_gcu_debug_timer.expires = jiffies + 5*HZ; /* one second */ | ||
526 | |||
527 | add_timer(&pxa3xx_gcu_debug_timer); | ||
528 | } | ||
529 | |||
530 | static void pxa3xx_gcu_init_debug_timer(void) | ||
531 | { | ||
532 | pxa3xx_gcu_debug_timedout((unsigned long) &pxa3xx_gcu_debug_timer); | ||
533 | } | ||
534 | #else | ||
535 | static inline void pxa3xx_gcu_init_debug_timer(void) {} | ||
536 | #endif | ||
537 | |||
538 | static int | ||
539 | add_buffer(struct platform_device *dev, | ||
540 | struct pxa3xx_gcu_priv *priv) | ||
541 | { | ||
542 | struct pxa3xx_gcu_batch *buffer; | ||
543 | |||
544 | buffer = kzalloc(sizeof(struct pxa3xx_gcu_batch), GFP_KERNEL); | ||
545 | if (!buffer) | ||
546 | return -ENOMEM; | ||
547 | |||
548 | buffer->ptr = dma_alloc_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4, | ||
549 | &buffer->phys, GFP_KERNEL); | ||
550 | if (!buffer->ptr) { | ||
551 | kfree(buffer); | ||
552 | return -ENOMEM; | ||
553 | } | ||
554 | |||
555 | buffer->next = priv->free; | ||
556 | |||
557 | priv->free = buffer; | ||
558 | |||
559 | return 0; | ||
560 | } | ||
561 | |||
562 | static void | ||
563 | free_buffers(struct platform_device *dev, | ||
564 | struct pxa3xx_gcu_priv *priv) | ||
565 | { | ||
566 | struct pxa3xx_gcu_batch *next, *buffer = priv->free; | ||
567 | |||
568 | while (buffer) { | ||
569 | next = buffer->next; | ||
570 | |||
571 | dma_free_coherent(&dev->dev, PXA3XX_GCU_BATCH_WORDS * 4, | ||
572 | buffer->ptr, buffer->phys); | ||
573 | |||
574 | kfree(buffer); | ||
575 | |||
576 | buffer = next; | ||
577 | } | ||
578 | |||
579 | priv->free = NULL; | ||
580 | } | ||
581 | |||
582 | static int __devinit | ||
583 | pxa3xx_gcu_probe(struct platform_device *dev) | ||
584 | { | ||
585 | int i, ret, irq; | ||
586 | struct resource *r; | ||
587 | struct pxa3xx_gcu_priv *priv; | ||
588 | |||
589 | priv = kzalloc(sizeof(struct pxa3xx_gcu_priv), GFP_KERNEL); | ||
590 | if (!priv) | ||
591 | return -ENOMEM; | ||
592 | |||
593 | for (i = 0; i < 8; i++) { | ||
594 | ret = add_buffer(dev, priv); | ||
595 | if (ret) { | ||
596 | dev_err(&dev->dev, "failed to allocate DMA memory\n"); | ||
597 | goto err_free_priv; | ||
598 | } | ||
599 | } | ||
600 | |||
601 | init_waitqueue_head(&priv->wait_idle); | ||
602 | init_waitqueue_head(&priv->wait_free); | ||
603 | spin_lock_init(&priv->spinlock); | ||
604 | |||
605 | /* we allocate the misc device structure as part of our own allocation, | ||
606 | * so we can get a pointer to our priv structure later on with | ||
607 | * container_of(). This isn't really necessary as we have a fixed minor | ||
608 | * number anyway, but this is to avoid statics. */ | ||
609 | |||
610 | priv->misc_fops.owner = THIS_MODULE; | ||
611 | priv->misc_fops.write = pxa3xx_gcu_misc_write; | ||
612 | priv->misc_fops.unlocked_ioctl = pxa3xx_gcu_misc_ioctl; | ||
613 | priv->misc_fops.mmap = pxa3xx_gcu_misc_mmap; | ||
614 | |||
615 | priv->misc_dev.minor = MISCDEV_MINOR, | ||
616 | priv->misc_dev.name = DRV_NAME, | ||
617 | priv->misc_dev.fops = &priv->misc_fops, | ||
618 | |||
619 | /* register misc device */ | ||
620 | ret = misc_register(&priv->misc_dev); | ||
621 | if (ret < 0) { | ||
622 | dev_err(&dev->dev, "misc_register() for minor %d failed\n", | ||
623 | MISCDEV_MINOR); | ||
624 | goto err_free_priv; | ||
625 | } | ||
626 | |||
627 | /* handle IO resources */ | ||
628 | r = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
629 | if (r == NULL) { | ||
630 | dev_err(&dev->dev, "no I/O memory resource defined\n"); | ||
631 | ret = -ENODEV; | ||
632 | goto err_misc_deregister; | ||
633 | } | ||
634 | |||
635 | if (!request_mem_region(r->start, resource_size(r), dev->name)) { | ||
636 | dev_err(&dev->dev, "failed to request I/O memory\n"); | ||
637 | ret = -EBUSY; | ||
638 | goto err_misc_deregister; | ||
639 | } | ||
640 | |||
641 | priv->mmio_base = ioremap_nocache(r->start, resource_size(r)); | ||
642 | if (!priv->mmio_base) { | ||
643 | dev_err(&dev->dev, "failed to map I/O memory\n"); | ||
644 | ret = -EBUSY; | ||
645 | goto err_free_mem_region; | ||
646 | } | ||
647 | |||
648 | /* allocate dma memory */ | ||
649 | priv->shared = dma_alloc_coherent(&dev->dev, SHARED_SIZE, | ||
650 | &priv->shared_phys, GFP_KERNEL); | ||
651 | |||
652 | if (!priv->shared) { | ||
653 | dev_err(&dev->dev, "failed to allocate DMA memory\n"); | ||
654 | ret = -ENOMEM; | ||
655 | goto err_free_io; | ||
656 | } | ||
657 | |||
658 | /* enable the clock */ | ||
659 | priv->clk = clk_get(&dev->dev, NULL); | ||
660 | if (IS_ERR(priv->clk)) { | ||
661 | dev_err(&dev->dev, "failed to get clock\n"); | ||
662 | ret = -ENODEV; | ||
663 | goto err_free_dma; | ||
664 | } | ||
665 | |||
666 | ret = clk_enable(priv->clk); | ||
667 | if (ret < 0) { | ||
668 | dev_err(&dev->dev, "failed to enable clock\n"); | ||
669 | goto err_put_clk; | ||
670 | } | ||
671 | |||
672 | /* request the IRQ */ | ||
673 | irq = platform_get_irq(dev, 0); | ||
674 | if (irq < 0) { | ||
675 | dev_err(&dev->dev, "no IRQ defined\n"); | ||
676 | ret = -ENODEV; | ||
677 | goto err_put_clk; | ||
678 | } | ||
679 | |||
680 | ret = request_irq(irq, pxa3xx_gcu_handle_irq, | ||
681 | IRQF_DISABLED, DRV_NAME, priv); | ||
682 | if (ret) { | ||
683 | dev_err(&dev->dev, "request_irq failed\n"); | ||
684 | ret = -EBUSY; | ||
685 | goto err_put_clk; | ||
686 | } | ||
687 | |||
688 | platform_set_drvdata(dev, priv); | ||
689 | priv->resource_mem = r; | ||
690 | pxa3xx_gcu_reset(priv); | ||
691 | pxa3xx_gcu_init_debug_timer(); | ||
692 | |||
693 | dev_info(&dev->dev, "registered @0x%p, DMA 0x%p (%d bytes), IRQ %d\n", | ||
694 | (void *) r->start, (void *) priv->shared_phys, | ||
695 | SHARED_SIZE, irq); | ||
696 | return 0; | ||
697 | |||
698 | err_put_clk: | ||
699 | clk_disable(priv->clk); | ||
700 | clk_put(priv->clk); | ||
701 | |||
702 | err_free_dma: | ||
703 | dma_free_coherent(&dev->dev, SHARED_SIZE, | ||
704 | priv->shared, priv->shared_phys); | ||
705 | |||
706 | err_free_io: | ||
707 | iounmap(priv->mmio_base); | ||
708 | |||
709 | err_free_mem_region: | ||
710 | release_mem_region(r->start, resource_size(r)); | ||
711 | |||
712 | err_misc_deregister: | ||
713 | misc_deregister(&priv->misc_dev); | ||
714 | |||
715 | err_free_priv: | ||
716 | platform_set_drvdata(dev, NULL); | ||
717 | free_buffers(dev, priv); | ||
718 | kfree(priv); | ||
719 | return ret; | ||
720 | } | ||
721 | |||
722 | static int __devexit | ||
723 | pxa3xx_gcu_remove(struct platform_device *dev) | ||
724 | { | ||
725 | struct pxa3xx_gcu_priv *priv = platform_get_drvdata(dev); | ||
726 | struct resource *r = priv->resource_mem; | ||
727 | |||
728 | pxa3xx_gcu_wait_idle(priv); | ||
729 | |||
730 | misc_deregister(&priv->misc_dev); | ||
731 | dma_free_coherent(&dev->dev, SHARED_SIZE, | ||
732 | priv->shared, priv->shared_phys); | ||
733 | iounmap(priv->mmio_base); | ||
734 | release_mem_region(r->start, resource_size(r)); | ||
735 | platform_set_drvdata(dev, NULL); | ||
736 | clk_disable(priv->clk); | ||
737 | free_buffers(dev, priv); | ||
738 | kfree(priv); | ||
739 | |||
740 | return 0; | ||
741 | } | ||
742 | |||
743 | static struct platform_driver pxa3xx_gcu_driver = { | ||
744 | .probe = pxa3xx_gcu_probe, | ||
745 | .remove = __devexit_p(pxa3xx_gcu_remove), | ||
746 | .driver = { | ||
747 | .owner = THIS_MODULE, | ||
748 | .name = DRV_NAME, | ||
749 | }, | ||
750 | }; | ||
751 | |||
752 | static int __init | ||
753 | pxa3xx_gcu_init(void) | ||
754 | { | ||
755 | return platform_driver_register(&pxa3xx_gcu_driver); | ||
756 | } | ||
757 | |||
758 | static void __exit | ||
759 | pxa3xx_gcu_exit(void) | ||
760 | { | ||
761 | platform_driver_unregister(&pxa3xx_gcu_driver); | ||
762 | } | ||
763 | |||
764 | module_init(pxa3xx_gcu_init); | ||
765 | module_exit(pxa3xx_gcu_exit); | ||
766 | |||
767 | MODULE_DESCRIPTION("PXA3xx graphics controller unit driver"); | ||
768 | MODULE_LICENSE("GPL"); | ||
769 | MODULE_ALIAS_MISCDEV(MISCDEV_MINOR); | ||
770 | MODULE_AUTHOR("Janine Kropp <nin@directfb.org>, " | ||
771 | "Denis Oliver Kropp <dok@directfb.org>, " | ||
772 | "Daniel Mack <daniel@caiaq.de>"); | ||
diff --git a/drivers/video/pxa3xx-gcu.h b/drivers/video/pxa3xx-gcu.h new file mode 100644 index 000000000000..0428ed03dc49 --- /dev/null +++ b/drivers/video/pxa3xx-gcu.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef __PXA3XX_GCU_H__ | ||
2 | #define __PXA3XX_GCU_H__ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Number of 32bit words in display list (ring buffer). */ | ||
7 | #define PXA3XX_GCU_BUFFER_WORDS ((256 * 1024 - 256) / 4) | ||
8 | |||
9 | /* To be increased when breaking the ABI */ | ||
10 | #define PXA3XX_GCU_SHARED_MAGIC 0x30000001 | ||
11 | |||
12 | #define PXA3XX_GCU_BATCH_WORDS 8192 | ||
13 | |||
14 | struct pxa3xx_gcu_shared { | ||
15 | u32 buffer[PXA3XX_GCU_BUFFER_WORDS]; | ||
16 | |||
17 | bool hw_running; | ||
18 | |||
19 | unsigned long buffer_phys; | ||
20 | |||
21 | unsigned int num_words; | ||
22 | unsigned int num_writes; | ||
23 | unsigned int num_done; | ||
24 | unsigned int num_interrupts; | ||
25 | unsigned int num_wait_idle; | ||
26 | unsigned int num_wait_free; | ||
27 | unsigned int num_idle; | ||
28 | |||
29 | u32 magic; | ||
30 | }; | ||
31 | |||
32 | /* Initialization and synchronization. | ||
33 | * Hardware is started upon write(). */ | ||
34 | #define PXA3XX_GCU_IOCTL_RESET _IO('G', 0) | ||
35 | #define PXA3XX_GCU_IOCTL_WAIT_IDLE _IO('G', 2) | ||
36 | |||
37 | #endif /* __PXA3XX_GCU_H__ */ | ||
38 | |||
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 |
@@ -254,6 +275,11 @@ static int __bprm_mm_init(struct linux_binprm *bprm) | |||
254 | vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; | 275 | vma->vm_flags = VM_STACK_FLAGS | VM_STACK_INCOMPLETE_SETUP; |
255 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); | 276 | vma->vm_page_prot = vm_get_page_prot(vma->vm_flags); |
256 | INIT_LIST_HEAD(&vma->anon_vma_chain); | 277 | INIT_LIST_HEAD(&vma->anon_vma_chain); |
278 | |||
279 | err = security_file_mmap(NULL, 0, 0, 0, vma->vm_start, 1); | ||
280 | if (err) | ||
281 | goto err; | ||
282 | |||
257 | err = insert_vm_struct(mm, vma); | 283 | err = insert_vm_struct(mm, vma); |
258 | if (err) | 284 | if (err) |
259 | goto err; | 285 | goto err; |
@@ -276,7 +302,11 @@ static bool valid_arg_len(struct linux_binprm *bprm, long len) | |||
276 | 302 | ||
277 | #else | 303 | #else |
278 | 304 | ||
279 | static struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | 305 | void acct_arg_size(struct linux_binprm *bprm, unsigned long pages) |
306 | { | ||
307 | } | ||
308 | |||
309 | struct page *get_arg_page(struct linux_binprm *bprm, unsigned long pos, | ||
280 | int write) | 310 | int write) |
281 | { | 311 | { |
282 | struct page *page; | 312 | struct page *page; |
@@ -1003,6 +1033,7 @@ int flush_old_exec(struct linux_binprm * bprm) | |||
1003 | /* | 1033 | /* |
1004 | * Release all of the old mmap stuff | 1034 | * Release all of the old mmap stuff |
1005 | */ | 1035 | */ |
1036 | acct_arg_size(bprm, 0); | ||
1006 | retval = exec_mmap(bprm->mm); | 1037 | retval = exec_mmap(bprm->mm); |
1007 | if (retval) | 1038 | if (retval) |
1008 | goto out; | 1039 | goto out; |
@@ -1426,8 +1457,10 @@ int do_execve(const char * filename, | |||
1426 | return retval; | 1457 | return retval; |
1427 | 1458 | ||
1428 | out: | 1459 | out: |
1429 | if (bprm->mm) | 1460 | if (bprm->mm) { |
1430 | mmput (bprm->mm); | 1461 | acct_arg_size(bprm, 0); |
1462 | mmput(bprm->mm); | ||
1463 | } | ||
1431 | 1464 | ||
1432 | out_file: | 1465 | out_file: |
1433 | if (bprm->file) { | 1466 | if (bprm->file) { |
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 6a5edea2d70b..94ce3d7a1c4b 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -910,6 +910,7 @@ struct ext4_inode_info { | |||
910 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ | 910 | #define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */ |
911 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ | 911 | #define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */ |
912 | #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ | 912 | #define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */ |
913 | #define EXT4_MOUNT_MBLK_IO_SUBMIT 0x4000000 /* multi-block io submits */ | ||
913 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ | 914 | #define EXT4_MOUNT_DELALLOC 0x8000000 /* Delalloc support */ |
914 | #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */ | 915 | #define EXT4_MOUNT_DATA_ERR_ABORT 0x10000000 /* Abort on file data write */ |
915 | #define EXT4_MOUNT_BLOCK_VALIDITY 0x20000000 /* Block validity checking */ | 916 | #define EXT4_MOUNT_BLOCK_VALIDITY 0x20000000 /* Block validity checking */ |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index bdbe69902207..e659597b690b 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2125,9 +2125,12 @@ static int mpage_da_submit_io(struct mpage_da_data *mpd, | |||
2125 | */ | 2125 | */ |
2126 | if (unlikely(journal_data && PageChecked(page))) | 2126 | if (unlikely(journal_data && PageChecked(page))) |
2127 | err = __ext4_journalled_writepage(page, len); | 2127 | err = __ext4_journalled_writepage(page, len); |
2128 | else | 2128 | else if (test_opt(inode->i_sb, MBLK_IO_SUBMIT)) |
2129 | err = ext4_bio_write_page(&io_submit, page, | 2129 | err = ext4_bio_write_page(&io_submit, page, |
2130 | len, mpd->wbc); | 2130 | len, mpd->wbc); |
2131 | else | ||
2132 | err = block_write_full_page(page, | ||
2133 | noalloc_get_block_write, mpd->wbc); | ||
2131 | 2134 | ||
2132 | if (!err) | 2135 | if (!err) |
2133 | mpd->pages_written++; | 2136 | mpd->pages_written++; |
diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c index 92203b8a099f..dc40e75cba88 100644 --- a/fs/ext4/namei.c +++ b/fs/ext4/namei.c | |||
@@ -872,7 +872,7 @@ static struct buffer_head * ext4_find_entry (struct inode *dir, | |||
872 | if (namelen > EXT4_NAME_LEN) | 872 | if (namelen > EXT4_NAME_LEN) |
873 | return NULL; | 873 | return NULL; |
874 | if ((namelen <= 2) && (name[0] == '.') && | 874 | if ((namelen <= 2) && (name[0] == '.') && |
875 | (name[1] == '.' || name[1] == '0')) { | 875 | (name[1] == '.' || name[1] == '\0')) { |
876 | /* | 876 | /* |
877 | * "." or ".." will only be in the first block | 877 | * "." or ".." will only be in the first block |
878 | * NFS may look up ".."; "." should be handled by the VFS | 878 | * NFS may look up ".."; "." should be handled by the VFS |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index e32195d6aac3..fb15c9c0be74 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -1026,6 +1026,8 @@ static int ext4_show_options(struct seq_file *seq, struct vfsmount *vfs) | |||
1026 | !(def_mount_opts & EXT4_DEFM_NODELALLOC)) | 1026 | !(def_mount_opts & EXT4_DEFM_NODELALLOC)) |
1027 | seq_puts(seq, ",nodelalloc"); | 1027 | seq_puts(seq, ",nodelalloc"); |
1028 | 1028 | ||
1029 | if (test_opt(sb, MBLK_IO_SUBMIT)) | ||
1030 | seq_puts(seq, ",mblk_io_submit"); | ||
1029 | if (sbi->s_stripe) | 1031 | if (sbi->s_stripe) |
1030 | seq_printf(seq, ",stripe=%lu", sbi->s_stripe); | 1032 | seq_printf(seq, ",stripe=%lu", sbi->s_stripe); |
1031 | /* | 1033 | /* |
@@ -1239,8 +1241,8 @@ enum { | |||
1239 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, | 1241 | Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_jqfmt_vfsv1, Opt_quota, |
1240 | Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, | 1242 | Opt_noquota, Opt_ignore, Opt_barrier, Opt_nobarrier, Opt_err, |
1241 | Opt_resize, Opt_usrquota, Opt_grpquota, Opt_i_version, | 1243 | Opt_resize, Opt_usrquota, Opt_grpquota, Opt_i_version, |
1242 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, | 1244 | Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_mblk_io_submit, |
1243 | Opt_block_validity, Opt_noblock_validity, | 1245 | Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, |
1244 | Opt_inode_readahead_blks, Opt_journal_ioprio, | 1246 | Opt_inode_readahead_blks, Opt_journal_ioprio, |
1245 | Opt_dioread_nolock, Opt_dioread_lock, | 1247 | Opt_dioread_nolock, Opt_dioread_lock, |
1246 | Opt_discard, Opt_nodiscard, | 1248 | Opt_discard, Opt_nodiscard, |
@@ -1304,6 +1306,8 @@ static const match_table_t tokens = { | |||
1304 | {Opt_resize, "resize"}, | 1306 | {Opt_resize, "resize"}, |
1305 | {Opt_delalloc, "delalloc"}, | 1307 | {Opt_delalloc, "delalloc"}, |
1306 | {Opt_nodelalloc, "nodelalloc"}, | 1308 | {Opt_nodelalloc, "nodelalloc"}, |
1309 | {Opt_mblk_io_submit, "mblk_io_submit"}, | ||
1310 | {Opt_nomblk_io_submit, "nomblk_io_submit"}, | ||
1307 | {Opt_block_validity, "block_validity"}, | 1311 | {Opt_block_validity, "block_validity"}, |
1308 | {Opt_noblock_validity, "noblock_validity"}, | 1312 | {Opt_noblock_validity, "noblock_validity"}, |
1309 | {Opt_inode_readahead_blks, "inode_readahead_blks=%u"}, | 1313 | {Opt_inode_readahead_blks, "inode_readahead_blks=%u"}, |
@@ -1725,6 +1729,12 @@ set_qf_format: | |||
1725 | case Opt_nodelalloc: | 1729 | case Opt_nodelalloc: |
1726 | clear_opt(sbi->s_mount_opt, DELALLOC); | 1730 | clear_opt(sbi->s_mount_opt, DELALLOC); |
1727 | break; | 1731 | break; |
1732 | case Opt_mblk_io_submit: | ||
1733 | set_opt(sbi->s_mount_opt, MBLK_IO_SUBMIT); | ||
1734 | break; | ||
1735 | case Opt_nomblk_io_submit: | ||
1736 | clear_opt(sbi->s_mount_opt, MBLK_IO_SUBMIT); | ||
1737 | break; | ||
1728 | case Opt_stripe: | 1738 | case Opt_stripe: |
1729 | if (match_int(&args[0], &option)) | 1739 | if (match_int(&args[0], &option)) |
1730 | return 0; | 1740 | return 0; |
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/atmdev.h b/include/linux/atmdev.h index a8e4e832cdbb..475f8c42c0e9 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -427,8 +427,10 @@ extern rwlock_t vcc_sklist_lock; | |||
427 | 427 | ||
428 | #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) | 428 | #define ATM_SKB(skb) (((struct atm_skb_data *) (skb)->cb)) |
429 | 429 | ||
430 | struct atm_dev *atm_dev_register(const char *type,const struct atmdev_ops *ops, | 430 | struct atm_dev *atm_dev_register(const char *type, struct device *parent, |
431 | int number,unsigned long *flags); /* number == -1: pick first available */ | 431 | const struct atmdev_ops *ops, |
432 | int number, /* -1 == pick first available */ | ||
433 | unsigned long *flags); | ||
432 | struct atm_dev *atm_dev_lookup(int number); | 434 | struct atm_dev *atm_dev_lookup(int number); |
433 | void atm_dev_deregister(struct atm_dev *dev); | 435 | void atm_dev_deregister(struct atm_dev *dev); |
434 | 436 | ||
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/snmp.h b/include/linux/snmp.h index ebb0c80ffd6e..12b2b18e50c1 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -230,6 +230,7 @@ enum | |||
230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ | 230 | LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ |
231 | LINUX_MIB_TCPDEFERACCEPTDROP, | 231 | LINUX_MIB_TCPDEFERACCEPTDROP, |
232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ | 232 | LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ |
233 | LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ | ||
233 | __LINUX_MIB_MAX | 234 | __LINUX_MIB_MAX |
234 | }; | 235 | }; |
235 | 236 | ||
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/net/sock.h b/include/net/sock.h index a6338d039857..659d968d95c5 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1155,6 +1155,8 @@ extern void sk_common_release(struct sock *sk); | |||
1155 | /* Initialise core socket variables */ | 1155 | /* Initialise core socket variables */ |
1156 | extern void sock_init_data(struct socket *sock, struct sock *sk); | 1156 | extern void sock_init_data(struct socket *sock, struct sock *sk); |
1157 | 1157 | ||
1158 | extern void sk_filter_release_rcu(struct rcu_head *rcu); | ||
1159 | |||
1158 | /** | 1160 | /** |
1159 | * sk_filter_release - release a socket filter | 1161 | * sk_filter_release - release a socket filter |
1160 | * @fp: filter to remove | 1162 | * @fp: filter to remove |
@@ -1165,7 +1167,7 @@ extern void sock_init_data(struct socket *sock, struct sock *sk); | |||
1165 | static inline void sk_filter_release(struct sk_filter *fp) | 1167 | static inline void sk_filter_release(struct sk_filter *fp) |
1166 | { | 1168 | { |
1167 | if (atomic_dec_and_test(&fp->refcnt)) | 1169 | if (atomic_dec_and_test(&fp->refcnt)) |
1168 | kfree(fp); | 1170 | call_rcu_bh(&fp->rcu, sk_filter_release_rcu); |
1169 | } | 1171 | } |
1170 | 1172 | ||
1171 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1173 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
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/io/ring.h b/include/xen/interface/io/ring.h index e8cbf431c8cc..75271b9a8f61 100644 --- a/include/xen/interface/io/ring.h +++ b/include/xen/interface/io/ring.h | |||
@@ -24,8 +24,15 @@ typedef unsigned int RING_IDX; | |||
24 | * A ring contains as many entries as will fit, rounded down to the nearest | 24 | * A ring contains as many entries as will fit, rounded down to the nearest |
25 | * power of two (so we can mask with (size-1) to loop around). | 25 | * power of two (so we can mask with (size-1) to loop around). |
26 | */ | 26 | */ |
27 | #define __RING_SIZE(_s, _sz) \ | 27 | #define __CONST_RING_SIZE(_s, _sz) \ |
28 | (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) | 28 | (__RD32(((_sz) - offsetof(struct _s##_sring, ring)) / \ |
29 | sizeof(((struct _s##_sring *)0)->ring[0]))) | ||
30 | |||
31 | /* | ||
32 | * The same for passing in an actual pointer instead of a name tag. | ||
33 | */ | ||
34 | #define __RING_SIZE(_s, _sz) \ | ||
35 | (__RD32(((_sz) - (long)&(_s)->ring + (long)(_s)) / sizeof((_s)->ring[0]))) | ||
29 | 36 | ||
30 | /* | 37 | /* |
31 | * Macros to make the correct C datatypes for a new kind of ring. | 38 | * Macros to make the correct C datatypes for a new kind of ring. |
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/kernel/workqueue.c b/kernel/workqueue.c index 90db1bd1a978..e785b0f2aea5 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -661,7 +661,7 @@ void wq_worker_waking_up(struct task_struct *task, unsigned int cpu) | |||
661 | { | 661 | { |
662 | struct worker *worker = kthread_data(task); | 662 | struct worker *worker = kthread_data(task); |
663 | 663 | ||
664 | if (likely(!(worker->flags & WORKER_NOT_RUNNING))) | 664 | if (!(worker->flags & WORKER_NOT_RUNNING)) |
665 | atomic_inc(get_gcwq_nr_running(cpu)); | 665 | atomic_inc(get_gcwq_nr_running(cpu)); |
666 | } | 666 | } |
667 | 667 | ||
@@ -687,7 +687,7 @@ struct task_struct *wq_worker_sleeping(struct task_struct *task, | |||
687 | struct global_cwq *gcwq = get_gcwq(cpu); | 687 | struct global_cwq *gcwq = get_gcwq(cpu); |
688 | atomic_t *nr_running = get_gcwq_nr_running(cpu); | 688 | atomic_t *nr_running = get_gcwq_nr_running(cpu); |
689 | 689 | ||
690 | if (unlikely(worker->flags & WORKER_NOT_RUNNING)) | 690 | if (worker->flags & WORKER_NOT_RUNNING) |
691 | return NULL; | 691 | return NULL; |
692 | 692 | ||
693 | /* this can only happen on the local cpu */ | 693 | /* this can only happen on the local cpu */ |
@@ -3692,7 +3692,8 @@ static int __init init_workqueues(void) | |||
3692 | system_nrt_wq = alloc_workqueue("events_nrt", WQ_NON_REENTRANT, 0); | 3692 | system_nrt_wq = alloc_workqueue("events_nrt", WQ_NON_REENTRANT, 0); |
3693 | system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND, | 3693 | system_unbound_wq = alloc_workqueue("events_unbound", WQ_UNBOUND, |
3694 | WQ_UNBOUND_MAX_ACTIVE); | 3694 | WQ_UNBOUND_MAX_ACTIVE); |
3695 | BUG_ON(!system_wq || !system_long_wq || !system_nrt_wq); | 3695 | BUG_ON(!system_wq || !system_long_wq || !system_nrt_wq || |
3696 | !system_unbound_wq); | ||
3696 | return 0; | 3697 | return 0; |
3697 | } | 3698 | } |
3698 | early_initcall(init_workqueues); | 3699 | early_initcall(init_workqueues); |
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) |
@@ -2462,6 +2462,7 @@ int install_special_mapping(struct mm_struct *mm, | |||
2462 | unsigned long addr, unsigned long len, | 2462 | unsigned long addr, unsigned long len, |
2463 | unsigned long vm_flags, struct page **pages) | 2463 | unsigned long vm_flags, struct page **pages) |
2464 | { | 2464 | { |
2465 | int ret; | ||
2465 | struct vm_area_struct *vma; | 2466 | struct vm_area_struct *vma; |
2466 | 2467 | ||
2467 | vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); | 2468 | vma = kmem_cache_zalloc(vm_area_cachep, GFP_KERNEL); |
@@ -2479,16 +2480,23 @@ int install_special_mapping(struct mm_struct *mm, | |||
2479 | vma->vm_ops = &special_mapping_vmops; | 2480 | vma->vm_ops = &special_mapping_vmops; |
2480 | vma->vm_private_data = pages; | 2481 | vma->vm_private_data = pages; |
2481 | 2482 | ||
2482 | if (unlikely(insert_vm_struct(mm, vma))) { | 2483 | ret = security_file_mmap(NULL, 0, 0, 0, vma->vm_start, 1); |
2483 | kmem_cache_free(vm_area_cachep, vma); | 2484 | if (ret) |
2484 | return -ENOMEM; | 2485 | goto out; |
2485 | } | 2486 | |
2487 | ret = insert_vm_struct(mm, vma); | ||
2488 | if (ret) | ||
2489 | goto out; | ||
2486 | 2490 | ||
2487 | mm->total_vm += len >> PAGE_SHIFT; | 2491 | mm->total_vm += len >> PAGE_SHIFT; |
2488 | 2492 | ||
2489 | perf_event_mmap(vma); | 2493 | perf_event_mmap(vma); |
2490 | 2494 | ||
2491 | return 0; | 2495 | return 0; |
2496 | |||
2497 | out: | ||
2498 | kmem_cache_free(vm_area_cachep, vma); | ||
2499 | return ret; | ||
2492 | } | 2500 | } |
2493 | 2501 | ||
2494 | static DEFINE_MUTEX(mm_all_locks_mutex); | 2502 | static DEFINE_MUTEX(mm_all_locks_mutex); |
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/atm/atm_sysfs.c b/net/atm/atm_sysfs.c index 799c631f0fed..f7fa67c78766 100644 --- a/net/atm/atm_sysfs.c +++ b/net/atm/atm_sysfs.c | |||
@@ -143,12 +143,13 @@ static struct class atm_class = { | |||
143 | .dev_uevent = atm_uevent, | 143 | .dev_uevent = atm_uevent, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | int atm_register_sysfs(struct atm_dev *adev) | 146 | int atm_register_sysfs(struct atm_dev *adev, struct device *parent) |
147 | { | 147 | { |
148 | struct device *cdev = &adev->class_dev; | 148 | struct device *cdev = &adev->class_dev; |
149 | int i, j, err; | 149 | int i, j, err; |
150 | 150 | ||
151 | cdev->class = &atm_class; | 151 | cdev->class = &atm_class; |
152 | cdev->parent = parent; | ||
152 | dev_set_drvdata(cdev, adev); | 153 | dev_set_drvdata(cdev, adev); |
153 | 154 | ||
154 | dev_set_name(cdev, "%s%d", adev->type, adev->number); | 155 | dev_set_name(cdev, "%s%d", adev->type, adev->number); |
diff --git a/net/atm/resources.c b/net/atm/resources.c index d29e58261511..23f45ce6f351 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c | |||
@@ -74,8 +74,9 @@ struct atm_dev *atm_dev_lookup(int number) | |||
74 | } | 74 | } |
75 | EXPORT_SYMBOL(atm_dev_lookup); | 75 | EXPORT_SYMBOL(atm_dev_lookup); |
76 | 76 | ||
77 | struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, | 77 | struct atm_dev *atm_dev_register(const char *type, struct device *parent, |
78 | int number, unsigned long *flags) | 78 | const struct atmdev_ops *ops, int number, |
79 | unsigned long *flags) | ||
79 | { | 80 | { |
80 | struct atm_dev *dev, *inuse; | 81 | struct atm_dev *dev, *inuse; |
81 | 82 | ||
@@ -115,7 +116,7 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, | |||
115 | goto out_fail; | 116 | goto out_fail; |
116 | } | 117 | } |
117 | 118 | ||
118 | if (atm_register_sysfs(dev) < 0) { | 119 | if (atm_register_sysfs(dev, parent) < 0) { |
119 | pr_err("atm_register_sysfs failed for dev %s\n", type); | 120 | pr_err("atm_register_sysfs failed for dev %s\n", type); |
120 | atm_proc_dev_deregister(dev); | 121 | atm_proc_dev_deregister(dev); |
121 | goto out_fail; | 122 | goto out_fail; |
diff --git a/net/atm/resources.h b/net/atm/resources.h index 126fb1840dfb..521431e30507 100644 --- a/net/atm/resources.h +++ b/net/atm/resources.h | |||
@@ -42,6 +42,6 @@ static inline void atm_proc_dev_deregister(struct atm_dev *dev) | |||
42 | 42 | ||
43 | #endif /* CONFIG_PROC_FS */ | 43 | #endif /* CONFIG_PROC_FS */ |
44 | 44 | ||
45 | int atm_register_sysfs(struct atm_dev *adev); | 45 | int atm_register_sysfs(struct atm_dev *adev, struct device *parent); |
46 | void atm_unregister_sysfs(struct atm_dev *adev); | 46 | void atm_unregister_sysfs(struct atm_dev *adev); |
47 | #endif | 47 | #endif |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index d0927d1fdada..66b9e5c0523a 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -882,7 +882,7 @@ static int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) | |||
882 | int lm = 0; | 882 | int lm = 0; |
883 | 883 | ||
884 | if (type != SCO_LINK && type != ESCO_LINK) | 884 | if (type != SCO_LINK && type != ESCO_LINK) |
885 | return 0; | 885 | return -EINVAL; |
886 | 886 | ||
887 | BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); | 887 | BT_DBG("hdev %s, bdaddr %s", hdev->name, batostr(bdaddr)); |
888 | 888 | ||
@@ -908,7 +908,7 @@ static int sco_connect_cfm(struct hci_conn *hcon, __u8 status) | |||
908 | BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); | 908 | BT_DBG("hcon %p bdaddr %s status %d", hcon, batostr(&hcon->dst), status); |
909 | 909 | ||
910 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) | 910 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) |
911 | return 0; | 911 | return -EINVAL; |
912 | 912 | ||
913 | if (!status) { | 913 | if (!status) { |
914 | struct sco_conn *conn; | 914 | struct sco_conn *conn; |
@@ -927,7 +927,7 @@ static int sco_disconn_cfm(struct hci_conn *hcon, __u8 reason) | |||
927 | BT_DBG("hcon %p reason %d", hcon, reason); | 927 | BT_DBG("hcon %p reason %d", hcon, reason); |
928 | 928 | ||
929 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) | 929 | if (hcon->type != SCO_LINK && hcon->type != ESCO_LINK) |
930 | return 0; | 930 | return -EINVAL; |
931 | 931 | ||
932 | sco_conn_del(hcon, bt_err(reason)); | 932 | sco_conn_del(hcon, bt_err(reason)); |
933 | 933 | ||
diff --git a/net/core/filter.c b/net/core/filter.c index c1ee800bc080..ae21a0d3c4a2 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -589,23 +589,16 @@ int sk_chk_filter(struct sock_filter *filter, int flen) | |||
589 | EXPORT_SYMBOL(sk_chk_filter); | 589 | EXPORT_SYMBOL(sk_chk_filter); |
590 | 590 | ||
591 | /** | 591 | /** |
592 | * sk_filter_rcu_release - Release a socket filter by rcu_head | 592 | * sk_filter_release_rcu - Release a socket filter by rcu_head |
593 | * @rcu: rcu_head that contains the sk_filter to free | 593 | * @rcu: rcu_head that contains the sk_filter to free |
594 | */ | 594 | */ |
595 | static void sk_filter_rcu_release(struct rcu_head *rcu) | 595 | void sk_filter_release_rcu(struct rcu_head *rcu) |
596 | { | 596 | { |
597 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); | 597 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); |
598 | 598 | ||
599 | sk_filter_release(fp); | 599 | kfree(fp); |
600 | } | ||
601 | |||
602 | static void sk_filter_delayed_uncharge(struct sock *sk, struct sk_filter *fp) | ||
603 | { | ||
604 | unsigned int size = sk_filter_len(fp); | ||
605 | |||
606 | atomic_sub(size, &sk->sk_omem_alloc); | ||
607 | call_rcu_bh(&fp->rcu, sk_filter_rcu_release); | ||
608 | } | 600 | } |
601 | EXPORT_SYMBOL(sk_filter_release_rcu); | ||
609 | 602 | ||
610 | /** | 603 | /** |
611 | * sk_attach_filter - attach a socket filter | 604 | * sk_attach_filter - attach a socket filter |
@@ -649,7 +642,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) | |||
649 | rcu_assign_pointer(sk->sk_filter, fp); | 642 | rcu_assign_pointer(sk->sk_filter, fp); |
650 | 643 | ||
651 | if (old_fp) | 644 | if (old_fp) |
652 | sk_filter_delayed_uncharge(sk, old_fp); | 645 | sk_filter_uncharge(sk, old_fp); |
653 | return 0; | 646 | return 0; |
654 | } | 647 | } |
655 | EXPORT_SYMBOL_GPL(sk_attach_filter); | 648 | EXPORT_SYMBOL_GPL(sk_attach_filter); |
@@ -663,7 +656,7 @@ int sk_detach_filter(struct sock *sk) | |||
663 | sock_owned_by_user(sk)); | 656 | sock_owned_by_user(sk)); |
664 | if (filter) { | 657 | if (filter) { |
665 | rcu_assign_pointer(sk->sk_filter, NULL); | 658 | rcu_assign_pointer(sk->sk_filter, NULL); |
666 | sk_filter_delayed_uncharge(sk, filter); | 659 | sk_filter_uncharge(sk, filter); |
667 | ret = 0; | 660 | ret = 0; |
668 | } | 661 | } |
669 | return ret; | 662 | return ret; |
diff --git a/net/core/timestamping.c b/net/core/timestamping.c index 0ae6c22da85b..c19bb4ee405e 100644 --- a/net/core/timestamping.c +++ b/net/core/timestamping.c | |||
@@ -96,11 +96,13 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb) | |||
96 | struct phy_device *phydev; | 96 | struct phy_device *phydev; |
97 | unsigned int type; | 97 | unsigned int type; |
98 | 98 | ||
99 | skb_push(skb, ETH_HLEN); | 99 | if (skb_headroom(skb) < ETH_HLEN) |
100 | return false; | ||
101 | __skb_push(skb, ETH_HLEN); | ||
100 | 102 | ||
101 | type = classify(skb); | 103 | type = classify(skb); |
102 | 104 | ||
103 | skb_pull(skb, ETH_HLEN); | 105 | __skb_pull(skb, ETH_HLEN); |
104 | 106 | ||
105 | switch (type) { | 107 | switch (type) { |
106 | case PTP_CLASS_V1_IPV4: | 108 | case PTP_CLASS_V1_IPV4: |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index 13992e1d2726..15dcc1a586b4 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -661,8 +661,10 @@ static int ec_dev_ioctl(struct socket *sock, unsigned int cmd, void __user *arg) | |||
661 | err = 0; | 661 | err = 0; |
662 | switch (cmd) { | 662 | switch (cmd) { |
663 | case SIOCSIFADDR: | 663 | case SIOCSIFADDR: |
664 | if (!capable(CAP_NET_ADMIN)) | 664 | if (!capable(CAP_NET_ADMIN)) { |
665 | return -EPERM; | 665 | err = -EPERM; |
666 | break; | ||
667 | } | ||
666 | 668 | ||
667 | edev = dev->ec_ptr; | 669 | edev = dev->ec_ptr; |
668 | if (edev == NULL) { | 670 | if (edev == NULL) { |
@@ -849,9 +851,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len) | |||
849 | { | 851 | { |
850 | struct iphdr *ip = ip_hdr(skb); | 852 | struct iphdr *ip = ip_hdr(skb); |
851 | unsigned char stn = ntohl(ip->saddr) & 0xff; | 853 | unsigned char stn = ntohl(ip->saddr) & 0xff; |
854 | struct dst_entry *dst = skb_dst(skb); | ||
855 | struct ec_device *edev = NULL; | ||
852 | struct sock *sk = NULL; | 856 | struct sock *sk = NULL; |
853 | struct sk_buff *newskb; | 857 | struct sk_buff *newskb; |
854 | struct ec_device *edev = skb->dev->ec_ptr; | 858 | |
859 | if (dst) | ||
860 | edev = dst->dev->ec_ptr; | ||
855 | 861 | ||
856 | if (! edev) | 862 | if (! edev) |
857 | goto bad; | 863 | goto bad; |
diff --git a/net/ipv4/proc.c b/net/ipv4/proc.c index 1b48eb1ed453..b14ec7d03b6e 100644 --- a/net/ipv4/proc.c +++ b/net/ipv4/proc.c | |||
@@ -253,6 +253,7 @@ static const struct snmp_mib snmp4_net_list[] = { | |||
253 | SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), | 253 | SNMP_MIB_ITEM("TCPMinTTLDrop", LINUX_MIB_TCPMINTTLDROP), |
254 | SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), | 254 | SNMP_MIB_ITEM("TCPDeferAcceptDrop", LINUX_MIB_TCPDEFERACCEPTDROP), |
255 | SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), | 255 | SNMP_MIB_ITEM("IPReversePathFilter", LINUX_MIB_IPRPFILTER), |
256 | SNMP_MIB_ITEM("TCPTimeWaitOverflow", LINUX_MIB_TCPTIMEWAITOVERFLOW), | ||
256 | SNMP_MIB_SENTINEL | 257 | SNMP_MIB_SENTINEL |
257 | }; | 258 | }; |
258 | 259 | ||
diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index 43cf901d7659..a66735f75963 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c | |||
@@ -347,7 +347,7 @@ void tcp_time_wait(struct sock *sk, int state, int timeo) | |||
347 | * socket up. We've got bigger problems than | 347 | * socket up. We've got bigger problems than |
348 | * non-graceful socket closings. | 348 | * non-graceful socket closings. |
349 | */ | 349 | */ |
350 | LIMIT_NETDEBUG(KERN_INFO "TCP: time wait bucket table overflow\n"); | 350 | NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPTIMEWAITOVERFLOW); |
351 | } | 351 | } |
352 | 352 | ||
353 | tcp_update_metrics(sk); | 353 | tcp_update_metrics(sk); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 05b1ecf36763..61c2463e2753 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -231,11 +231,10 @@ void tcp_select_initial_window(int __space, __u32 mss, | |||
231 | /* when initializing use the value from init_rcv_wnd | 231 | /* when initializing use the value from init_rcv_wnd |
232 | * rather than the default from above | 232 | * rather than the default from above |
233 | */ | 233 | */ |
234 | if (init_rcv_wnd && | 234 | if (init_rcv_wnd) |
235 | (*rcv_wnd > init_rcv_wnd * mss)) | 235 | *rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss); |
236 | *rcv_wnd = init_rcv_wnd * mss; | 236 | else |
237 | else if (*rcv_wnd > init_cwnd * mss) | 237 | *rcv_wnd = min(*rcv_wnd, init_cwnd * mss); |
238 | *rcv_wnd = init_cwnd * mss; | ||
239 | } | 238 | } |
240 | 239 | ||
241 | /* Set the clamp no higher than max representable value */ | 240 | /* Set the clamp no higher than max representable value */ |
@@ -386,27 +385,30 @@ struct tcp_out_options { | |||
386 | */ | 385 | */ |
387 | static u8 tcp_cookie_size_check(u8 desired) | 386 | static u8 tcp_cookie_size_check(u8 desired) |
388 | { | 387 | { |
389 | if (desired > 0) { | 388 | int cookie_size; |
389 | |||
390 | if (desired > 0) | ||
390 | /* previously specified */ | 391 | /* previously specified */ |
391 | return desired; | 392 | return desired; |
392 | } | 393 | |
393 | if (sysctl_tcp_cookie_size <= 0) { | 394 | cookie_size = ACCESS_ONCE(sysctl_tcp_cookie_size); |
395 | if (cookie_size <= 0) | ||
394 | /* no default specified */ | 396 | /* no default specified */ |
395 | return 0; | 397 | return 0; |
396 | } | 398 | |
397 | if (sysctl_tcp_cookie_size <= TCP_COOKIE_MIN) { | 399 | if (cookie_size <= TCP_COOKIE_MIN) |
398 | /* value too small, specify minimum */ | 400 | /* value too small, specify minimum */ |
399 | return TCP_COOKIE_MIN; | 401 | return TCP_COOKIE_MIN; |
400 | } | 402 | |
401 | if (sysctl_tcp_cookie_size >= TCP_COOKIE_MAX) { | 403 | if (cookie_size >= TCP_COOKIE_MAX) |
402 | /* value too large, specify maximum */ | 404 | /* value too large, specify maximum */ |
403 | return TCP_COOKIE_MAX; | 405 | return TCP_COOKIE_MAX; |
404 | } | 406 | |
405 | if (0x1 & sysctl_tcp_cookie_size) { | 407 | if (cookie_size & 1) |
406 | /* 8-bit multiple, illegal, fix it */ | 408 | /* 8-bit multiple, illegal, fix it */ |
407 | return (u8)(sysctl_tcp_cookie_size + 0x1); | 409 | cookie_size++; |
408 | } | 410 | |
409 | return (u8)sysctl_tcp_cookie_size; | 411 | return (u8)cookie_size; |
410 | } | 412 | } |
411 | 413 | ||
412 | /* Write previously computed TCP options to the packet. | 414 | /* Write previously computed TCP options to the packet. |
@@ -1513,6 +1515,7 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
1513 | struct tcp_sock *tp = tcp_sk(sk); | 1515 | struct tcp_sock *tp = tcp_sk(sk); |
1514 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1516 | const struct inet_connection_sock *icsk = inet_csk(sk); |
1515 | u32 send_win, cong_win, limit, in_flight; | 1517 | u32 send_win, cong_win, limit, in_flight; |
1518 | int win_divisor; | ||
1516 | 1519 | ||
1517 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) | 1520 | if (TCP_SKB_CB(skb)->flags & TCPHDR_FIN) |
1518 | goto send_now; | 1521 | goto send_now; |
@@ -1544,13 +1547,14 @@ static int tcp_tso_should_defer(struct sock *sk, struct sk_buff *skb) | |||
1544 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) | 1547 | if ((skb != tcp_write_queue_tail(sk)) && (limit >= skb->len)) |
1545 | goto send_now; | 1548 | goto send_now; |
1546 | 1549 | ||
1547 | if (sysctl_tcp_tso_win_divisor) { | 1550 | win_divisor = ACCESS_ONCE(sysctl_tcp_tso_win_divisor); |
1551 | if (win_divisor) { | ||
1548 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); | 1552 | u32 chunk = min(tp->snd_wnd, tp->snd_cwnd * tp->mss_cache); |
1549 | 1553 | ||
1550 | /* If at least some fraction of a window is available, | 1554 | /* If at least some fraction of a window is available, |
1551 | * just use it. | 1555 | * just use it. |
1552 | */ | 1556 | */ |
1553 | chunk /= sysctl_tcp_tso_win_divisor; | 1557 | chunk /= win_divisor; |
1554 | if (limit >= chunk) | 1558 | if (limit >= chunk) |
1555 | goto send_now; | 1559 | goto send_now; |
1556 | } else { | 1560 | } else { |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 23cc8e1ce8d4..93b7a933a775 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -4021,11 +4021,11 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev) | |||
4021 | kfree_skb(skb); | 4021 | kfree_skb(skb); |
4022 | goto errout; | 4022 | goto errout; |
4023 | } | 4023 | } |
4024 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); | 4024 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFINFO, NULL, GFP_ATOMIC); |
4025 | return; | 4025 | return; |
4026 | errout: | 4026 | errout: |
4027 | if (err < 0) | 4027 | if (err < 0) |
4028 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); | 4028 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFINFO, err); |
4029 | } | 4029 | } |
4030 | 4030 | ||
4031 | static inline size_t inet6_prefix_nlmsg_size(void) | 4031 | static inline size_t inet6_prefix_nlmsg_size(void) |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index 2a59610c2a58..70e891a20fb9 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1175,6 +1175,8 @@ static void ip6_tnl_link_config(struct ip6_tnl *t) | |||
1175 | sizeof (struct ipv6hdr); | 1175 | sizeof (struct ipv6hdr); |
1176 | 1176 | ||
1177 | dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); | 1177 | dev->mtu = rt->rt6i_dev->mtu - sizeof (struct ipv6hdr); |
1178 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | ||
1179 | dev->mtu-=8; | ||
1178 | 1180 | ||
1179 | if (dev->mtu < IPV6_MIN_MTU) | 1181 | if (dev->mtu < IPV6_MIN_MTU) |
1180 | dev->mtu = IPV6_MIN_MTU; | 1182 | dev->mtu = IPV6_MIN_MTU; |
@@ -1363,12 +1365,17 @@ static const struct net_device_ops ip6_tnl_netdev_ops = { | |||
1363 | 1365 | ||
1364 | static void ip6_tnl_dev_setup(struct net_device *dev) | 1366 | static void ip6_tnl_dev_setup(struct net_device *dev) |
1365 | { | 1367 | { |
1368 | struct ip6_tnl *t; | ||
1369 | |||
1366 | dev->netdev_ops = &ip6_tnl_netdev_ops; | 1370 | dev->netdev_ops = &ip6_tnl_netdev_ops; |
1367 | dev->destructor = ip6_dev_free; | 1371 | dev->destructor = ip6_dev_free; |
1368 | 1372 | ||
1369 | dev->type = ARPHRD_TUNNEL6; | 1373 | dev->type = ARPHRD_TUNNEL6; |
1370 | dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); | 1374 | dev->hard_header_len = LL_MAX_HEADER + sizeof (struct ipv6hdr); |
1371 | dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); | 1375 | dev->mtu = ETH_DATA_LEN - sizeof (struct ipv6hdr); |
1376 | t = netdev_priv(dev); | ||
1377 | if (!(t->parms.flags & IP6_TNL_F_IGN_ENCAP_LIMIT)) | ||
1378 | dev->mtu-=8; | ||
1372 | dev->flags |= IFF_NOARP; | 1379 | dev->flags |= IFF_NOARP; |
1373 | dev->addr_len = sizeof(struct in6_addr); | 1380 | dev->addr_len = sizeof(struct in6_addr); |
1374 | dev->features |= NETIF_F_NETNS_LOCAL; | 1381 | dev->features |= NETIF_F_NETNS_LOCAL; |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index d6bfaec3bbbf..8c4d00c7cd2b 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -606,8 +606,9 @@ static int ipip6_rcv(struct sk_buff *skb) | |||
606 | return 0; | 606 | return 0; |
607 | } | 607 | } |
608 | 608 | ||
609 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PORT_UNREACH, 0); | 609 | /* no tunnel matched, let upstream know, ipsec may handle it */ |
610 | rcu_read_unlock(); | 610 | rcu_read_unlock(); |
611 | return 1; | ||
611 | out: | 612 | out: |
612 | kfree_skb(skb); | 613 | kfree_skb(skb); |
613 | return 0; | 614 | return 0; |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 0bf6a59545ab..522e219f3558 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -674,4 +674,8 @@ MODULE_LICENSE("GPL"); | |||
674 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); | 674 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); |
675 | MODULE_DESCRIPTION("L2TP over IP"); | 675 | MODULE_DESCRIPTION("L2TP over IP"); |
676 | MODULE_VERSION("1.0"); | 676 | MODULE_VERSION("1.0"); |
677 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, SOCK_DGRAM, IPPROTO_L2TP); | 677 | |
678 | /* Use the value of SOCK_DGRAM (2) directory, because __stringify does't like | ||
679 | * enums | ||
680 | */ | ||
681 | MODULE_ALIAS_NET_PF_PROTO_TYPE(PF_INET, 2, IPPROTO_L2TP); | ||
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c index 582612998211..e35dbe55f520 100644 --- a/net/llc/af_llc.c +++ b/net/llc/af_llc.c | |||
@@ -317,8 +317,9 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) | |||
317 | goto out; | 317 | goto out; |
318 | rc = -ENODEV; | 318 | rc = -ENODEV; |
319 | rtnl_lock(); | 319 | rtnl_lock(); |
320 | rcu_read_lock(); | ||
320 | if (sk->sk_bound_dev_if) { | 321 | if (sk->sk_bound_dev_if) { |
321 | llc->dev = dev_get_by_index(&init_net, sk->sk_bound_dev_if); | 322 | llc->dev = dev_get_by_index_rcu(&init_net, sk->sk_bound_dev_if); |
322 | if (llc->dev) { | 323 | if (llc->dev) { |
323 | if (!addr->sllc_arphrd) | 324 | if (!addr->sllc_arphrd) |
324 | addr->sllc_arphrd = llc->dev->type; | 325 | addr->sllc_arphrd = llc->dev->type; |
@@ -329,13 +330,13 @@ static int llc_ui_bind(struct socket *sock, struct sockaddr *uaddr, int addrlen) | |||
329 | !llc_mac_match(addr->sllc_mac, | 330 | !llc_mac_match(addr->sllc_mac, |
330 | llc->dev->dev_addr)) { | 331 | llc->dev->dev_addr)) { |
331 | rc = -EINVAL; | 332 | rc = -EINVAL; |
332 | dev_put(llc->dev); | ||
333 | llc->dev = NULL; | 333 | llc->dev = NULL; |
334 | } | 334 | } |
335 | } | 335 | } |
336 | } else | 336 | } else |
337 | llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd, | 337 | llc->dev = dev_getbyhwaddr(&init_net, addr->sllc_arphrd, |
338 | addr->sllc_mac); | 338 | addr->sllc_mac); |
339 | rcu_read_unlock(); | ||
339 | rtnl_unlock(); | 340 | rtnl_unlock(); |
340 | if (!llc->dev) | 341 | if (!llc->dev) |
341 | goto out; | 342 | goto out; |
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/mac80211/rx.c b/net/mac80211/rx.c index 902b03ee8f60..54fb4a0e76f0 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2247,6 +2247,10 @@ ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) | |||
2247 | break; | 2247 | break; |
2248 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | 2248 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): |
2249 | case cpu_to_le16(IEEE80211_STYPE_DISASSOC): | 2249 | case cpu_to_le16(IEEE80211_STYPE_DISASSOC): |
2250 | if (is_multicast_ether_addr(mgmt->da) && | ||
2251 | !is_broadcast_ether_addr(mgmt->da)) | ||
2252 | return RX_DROP_MONITOR; | ||
2253 | |||
2250 | /* process only for station */ | 2254 | /* process only for station */ |
2251 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 2255 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
2252 | return RX_DROP_MONITOR; | 2256 | return RX_DROP_MONITOR; |
@@ -2741,6 +2745,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2741 | 2745 | ||
2742 | if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) | 2746 | if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) |
2743 | return; | 2747 | return; |
2748 | goto out; | ||
2744 | } | 2749 | } |
2745 | } | 2750 | } |
2746 | 2751 | ||
@@ -2780,6 +2785,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2780 | return; | 2785 | return; |
2781 | } | 2786 | } |
2782 | 2787 | ||
2788 | out: | ||
2783 | dev_kfree_skb(skb); | 2789 | dev_kfree_skb(skb); |
2784 | } | 2790 | } |
2785 | 2791 | ||
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 96c594309506..7a637b80a62e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1587,7 +1587,12 @@ static void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, | |||
1587 | list) { | 1587 | list) { |
1588 | if (!ieee80211_sdata_running(tmp_sdata)) | 1588 | if (!ieee80211_sdata_running(tmp_sdata)) |
1589 | continue; | 1589 | continue; |
1590 | if (tmp_sdata->vif.type != NL80211_IFTYPE_AP) | 1590 | if (tmp_sdata->vif.type == |
1591 | NL80211_IFTYPE_MONITOR || | ||
1592 | tmp_sdata->vif.type == | ||
1593 | NL80211_IFTYPE_AP_VLAN || | ||
1594 | tmp_sdata->vif.type == | ||
1595 | NL80211_IFTYPE_WDS) | ||
1591 | continue; | 1596 | continue; |
1592 | if (compare_ether_addr(tmp_sdata->vif.addr, | 1597 | if (compare_ether_addr(tmp_sdata->vif.addr, |
1593 | hdr->addr2) == 0) { | 1598 | hdr->addr2) == 0) { |
@@ -1732,15 +1737,13 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1732 | int nh_pos, h_pos; | 1737 | int nh_pos, h_pos; |
1733 | struct sta_info *sta = NULL; | 1738 | struct sta_info *sta = NULL; |
1734 | u32 sta_flags = 0; | 1739 | u32 sta_flags = 0; |
1740 | struct sk_buff *tmp_skb; | ||
1735 | 1741 | ||
1736 | if (unlikely(skb->len < ETH_HLEN)) { | 1742 | if (unlikely(skb->len < ETH_HLEN)) { |
1737 | ret = NETDEV_TX_OK; | 1743 | ret = NETDEV_TX_OK; |
1738 | goto fail; | 1744 | goto fail; |
1739 | } | 1745 | } |
1740 | 1746 | ||
1741 | nh_pos = skb_network_header(skb) - skb->data; | ||
1742 | h_pos = skb_transport_header(skb) - skb->data; | ||
1743 | |||
1744 | /* convert Ethernet header to proper 802.11 header (based on | 1747 | /* convert Ethernet header to proper 802.11 header (based on |
1745 | * operation mode) */ | 1748 | * operation mode) */ |
1746 | ethertype = (skb->data[12] << 8) | skb->data[13]; | 1749 | ethertype = (skb->data[12] << 8) | skb->data[13]; |
@@ -1913,6 +1916,20 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1913 | goto fail; | 1916 | goto fail; |
1914 | } | 1917 | } |
1915 | 1918 | ||
1919 | /* | ||
1920 | * If the skb is shared we need to obtain our own copy. | ||
1921 | */ | ||
1922 | if (skb_shared(skb)) { | ||
1923 | tmp_skb = skb; | ||
1924 | skb = skb_copy(skb, GFP_ATOMIC); | ||
1925 | kfree_skb(tmp_skb); | ||
1926 | |||
1927 | if (!skb) { | ||
1928 | ret = NETDEV_TX_OK; | ||
1929 | goto fail; | ||
1930 | } | ||
1931 | } | ||
1932 | |||
1916 | hdr.frame_control = fc; | 1933 | hdr.frame_control = fc; |
1917 | hdr.duration_id = 0; | 1934 | hdr.duration_id = 0; |
1918 | hdr.seq_ctrl = 0; | 1935 | hdr.seq_ctrl = 0; |
@@ -1931,6 +1948,9 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, | |||
1931 | encaps_len = 0; | 1948 | encaps_len = 0; |
1932 | } | 1949 | } |
1933 | 1950 | ||
1951 | nh_pos = skb_network_header(skb) - skb->data; | ||
1952 | h_pos = skb_transport_header(skb) - skb->data; | ||
1953 | |||
1934 | skb_pull(skb, skip_header_bytes); | 1954 | skb_pull(skb, skip_header_bytes); |
1935 | nh_pos -= skip_header_bytes; | 1955 | nh_pos -= skip_header_bytes; |
1936 | h_pos -= skip_header_bytes; | 1956 | h_pos -= skip_header_bytes; |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 6bd554323a34..0b9ee34ad35c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2932,6 +2932,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
2932 | struct sctp_association *asoc = NULL; | 2932 | struct sctp_association *asoc = NULL; |
2933 | struct sctp_setpeerprim prim; | 2933 | struct sctp_setpeerprim prim; |
2934 | struct sctp_chunk *chunk; | 2934 | struct sctp_chunk *chunk; |
2935 | struct sctp_af *af; | ||
2935 | int err; | 2936 | int err; |
2936 | 2937 | ||
2937 | sp = sctp_sk(sk); | 2938 | sp = sctp_sk(sk); |
@@ -2959,6 +2960,13 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
2959 | if (!sctp_state(asoc, ESTABLISHED)) | 2960 | if (!sctp_state(asoc, ESTABLISHED)) |
2960 | return -ENOTCONN; | 2961 | return -ENOTCONN; |
2961 | 2962 | ||
2963 | af = sctp_get_af_specific(prim.sspp_addr.ss_family); | ||
2964 | if (!af) | ||
2965 | return -EINVAL; | ||
2966 | |||
2967 | if (!af->addr_valid((union sctp_addr *)&prim.sspp_addr, sp, NULL)) | ||
2968 | return -EADDRNOTAVAIL; | ||
2969 | |||
2962 | if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) | 2970 | if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) |
2963 | return -EADDRNOTAVAIL; | 2971 | return -EADDRNOTAVAIL; |
2964 | 2972 | ||
diff --git a/net/socket.c b/net/socket.c index 3ca2fd9e3720..088fb3fd45e0 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -732,6 +732,21 @@ static int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg, | |||
732 | return ret; | 732 | return ret; |
733 | } | 733 | } |
734 | 734 | ||
735 | /** | ||
736 | * kernel_recvmsg - Receive a message from a socket (kernel space) | ||
737 | * @sock: The socket to receive the message from | ||
738 | * @msg: Received message | ||
739 | * @vec: Input s/g array for message data | ||
740 | * @num: Size of input s/g array | ||
741 | * @size: Number of bytes to read | ||
742 | * @flags: Message flags (MSG_DONTWAIT, etc...) | ||
743 | * | ||
744 | * On return the msg structure contains the scatter/gather array passed in the | ||
745 | * vec argument. The array is modified so that it consists of the unfilled | ||
746 | * portion of the original array. | ||
747 | * | ||
748 | * The returned value is the total number of bytes received, or an error. | ||
749 | */ | ||
735 | int kernel_recvmsg(struct socket *sock, struct msghdr *msg, | 750 | int kernel_recvmsg(struct socket *sock, struct msghdr *msg, |
736 | struct kvec *vec, size_t num, size_t size, int flags) | 751 | struct kvec *vec, size_t num, size_t size, int flags) |
737 | { | 752 | { |
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/net/x25/x25_link.c b/net/x25/x25_link.c index 73e7b954ad28..b25c6463c3e9 100644 --- a/net/x25/x25_link.c +++ b/net/x25/x25_link.c | |||
@@ -394,6 +394,7 @@ void __exit x25_link_free(void) | |||
394 | list_for_each_safe(entry, tmp, &x25_neigh_list) { | 394 | list_for_each_safe(entry, tmp, &x25_neigh_list) { |
395 | nb = list_entry(entry, struct x25_neigh, node); | 395 | nb = list_entry(entry, struct x25_neigh, node); |
396 | __x25_remove_neigh(nb); | 396 | __x25_remove_neigh(nb); |
397 | dev_put(nb->dev); | ||
397 | } | 398 | } |
398 | write_unlock_bh(&x25_neigh_list_lock); | 399 | write_unlock_bh(&x25_neigh_list_lock); |
399 | } | 400 | } |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index eb96ce52f178..220ebc05c7af 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1268,7 +1268,7 @@ struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, | |||
1268 | 1268 | ||
1269 | return xc; | 1269 | return xc; |
1270 | error: | 1270 | error: |
1271 | kfree(xc); | 1271 | xfrm_state_put(xc); |
1272 | return NULL; | 1272 | return NULL; |
1273 | } | 1273 | } |
1274 | EXPORT_SYMBOL(xfrm_state_migrate); | 1274 | EXPORT_SYMBOL(xfrm_state_migrate); |
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 |