diff options
author | David Woodhouse <dwmw2@infradead.org> | 2006-05-24 04:22:21 -0400 |
---|---|---|
committer | David Woodhouse <dwmw2@infradead.org> | 2006-05-24 04:22:21 -0400 |
commit | 66643de455c27973ac31ad6de9f859d399916842 (patch) | |
tree | 7ebed7f051879007d4b11d6aaa9e65a1bcb0b08f | |
parent | 2c23d62abb820e19c54012520f08a198c2233a85 (diff) | |
parent | 387e2b0439026aa738a9edca15a57e5c0bcb4dfc (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
include/asm-powerpc/unistd.h
include/asm-sparc/unistd.h
include/asm-sparc64/unistd.h
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
432 files changed, 9399 insertions, 3746 deletions
@@ -3241,14 +3241,9 @@ S: 12725 SW Millikan Way, Suite 400 | |||
3241 | S: Beaverton, Oregon 97005 | 3241 | S: Beaverton, Oregon 97005 |
3242 | S: USA | 3242 | S: USA |
3243 | 3243 | ||
3244 | N: Marcelo W. Tosatti | 3244 | N: Marcelo Tosatti |
3245 | E: marcelo.tosatti@cyclades.com | 3245 | E: marcelo@kvack.org |
3246 | D: Miscellaneous kernel hacker | ||
3247 | D: v2.4 kernel maintainer | 3246 | D: v2.4 kernel maintainer |
3248 | D: Current pc300/cyclades maintainer | ||
3249 | S: Cyclades Corporation | ||
3250 | S: Av Cristovao Colombo, 462. Floresta. | ||
3251 | S: Porto Alegre | ||
3252 | S: Brazil | 3247 | S: Brazil |
3253 | 3248 | ||
3254 | N: Stefan Traby | 3249 | N: Stefan Traby |
diff --git a/Documentation/devices.txt b/Documentation/devices.txt index 3c406acd4dfa..b369a8c46a73 100644 --- a/Documentation/devices.txt +++ b/Documentation/devices.txt | |||
@@ -1721,11 +1721,6 @@ Your cooperation is appreciated. | |||
1721 | These devices support the same API as the generic SCSI | 1721 | These devices support the same API as the generic SCSI |
1722 | devices. | 1722 | devices. |
1723 | 1723 | ||
1724 | 97 block Packet writing for CD/DVD devices | ||
1725 | 0 = /dev/pktcdvd0 First packet-writing module | ||
1726 | 1 = /dev/pktcdvd1 Second packet-writing module | ||
1727 | ... | ||
1728 | |||
1729 | 98 char Control and Measurement Device (comedi) | 1724 | 98 char Control and Measurement Device (comedi) |
1730 | 0 = /dev/comedi0 First comedi device | 1725 | 0 = /dev/comedi0 First comedi device |
1731 | 1 = /dev/comedi1 Second comedi device | 1726 | 1 = /dev/comedi1 Second comedi device |
diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware index 15fc8fbef67e..4820366b6ae8 100644 --- a/Documentation/dvb/get_dvb_firmware +++ b/Documentation/dvb/get_dvb_firmware | |||
@@ -259,9 +259,9 @@ sub dibusb { | |||
259 | } | 259 | } |
260 | 260 | ||
261 | sub nxt2002 { | 261 | sub nxt2002 { |
262 | my $sourcefile = "Broadband4PC_4_2_11.zip"; | 262 | my $sourcefile = "Technisat_DVB-PC_4_4_COMPACT.zip"; |
263 | my $url = "http://www.bbti.us/download/windows/$sourcefile"; | 263 | my $url = "http://www.bbti.us/download/windows/$sourcefile"; |
264 | my $hash = "c6d2ea47a8f456d887ada0cfb718ff2a"; | 264 | my $hash = "476befae8c7c1bb9648954060b1eec1f"; |
265 | my $outfile = "dvb-fe-nxt2002.fw"; | 265 | my $outfile = "dvb-fe-nxt2002.fw"; |
266 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); | 266 | my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1); |
267 | 267 | ||
@@ -269,8 +269,8 @@ sub nxt2002 { | |||
269 | 269 | ||
270 | wgetfile($sourcefile, $url); | 270 | wgetfile($sourcefile, $url); |
271 | unzip($sourcefile, $tmpdir); | 271 | unzip($sourcefile, $tmpdir); |
272 | verify("$tmpdir/SkyNETU.sys", $hash); | 272 | verify("$tmpdir/SkyNET.sys", $hash); |
273 | extract("$tmpdir/SkyNETU.sys", 375832, 5908, $outfile); | 273 | extract("$tmpdir/SkyNET.sys", 331624, 5908, $outfile); |
274 | 274 | ||
275 | $outfile; | 275 | $outfile; |
276 | } | 276 | } |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 421bcfff6ad2..43ab119963d5 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -57,6 +57,15 @@ Who: Jody McIntyre <scjody@steamballoon.com> | |||
57 | 57 | ||
58 | --------------------------- | 58 | --------------------------- |
59 | 59 | ||
60 | What: sbp2: module parameter "force_inquiry_hack" | ||
61 | When: July 2006 | ||
62 | Why: Superceded by parameter "workarounds". Both parameters are meant to be | ||
63 | used ad-hoc and for single devices only, i.e. not in modprobe.conf, | ||
64 | therefore the impact of this feature replacement should be low. | ||
65 | Who: Stefan Richter <stefanr@s5r6.in-berlin.de> | ||
66 | |||
67 | --------------------------- | ||
68 | |||
60 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. | 69 | What: Video4Linux API 1 ioctls and video_decoder.h from Video devices. |
61 | When: July 2006 | 70 | When: July 2006 |
62 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 | 71 | Why: V4L1 AP1 was replaced by V4L2 API. during migration from 2.4 to 2.6 |
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README index 43e836c07ae8..e9cc8bb26f7d 100644 --- a/Documentation/firmware_class/README +++ b/Documentation/firmware_class/README | |||
@@ -105,20 +105,3 @@ | |||
105 | on the setup, so I think that the choice on what firmware to make | 105 | on the setup, so I think that the choice on what firmware to make |
106 | persistent should be left to userspace. | 106 | persistent should be left to userspace. |
107 | 107 | ||
108 | - Why register_firmware()+__init can be useful: | ||
109 | - For boot devices needing firmware. | ||
110 | - To make the transition easier: | ||
111 | The firmware can be declared __init and register_firmware() | ||
112 | called on module_init. Then the firmware is warranted to be | ||
113 | there even if "firmware hotplug userspace" is not there yet or | ||
114 | it doesn't yet provide the needed firmware. | ||
115 | Once the firmware is widely available in userspace, it can be | ||
116 | removed from the kernel. Or made optional (CONFIG_.*_FIRMWARE). | ||
117 | |||
118 | In either case, if firmware hotplug support is there, it can move the | ||
119 | firmware out of kernel memory into the real filesystem for later | ||
120 | usage. | ||
121 | |||
122 | Note: If persistence is implemented on top of initramfs, | ||
123 | register_firmware() may not be appropriate. | ||
124 | |||
diff --git a/Documentation/firmware_class/firmware_sample_driver.c b/Documentation/firmware_class/firmware_sample_driver.c index ad3edaba4533..87feccdb5c9f 100644 --- a/Documentation/firmware_class/firmware_sample_driver.c +++ b/Documentation/firmware_class/firmware_sample_driver.c | |||
@@ -5,8 +5,6 @@ | |||
5 | * | 5 | * |
6 | * Sample code on how to use request_firmware() from drivers. | 6 | * Sample code on how to use request_firmware() from drivers. |
7 | * | 7 | * |
8 | * Note that register_firmware() is currently useless. | ||
9 | * | ||
10 | */ | 8 | */ |
11 | 9 | ||
12 | #include <linux/module.h> | 10 | #include <linux/module.h> |
@@ -17,11 +15,6 @@ | |||
17 | 15 | ||
18 | #include "linux/firmware.h" | 16 | #include "linux/firmware.h" |
19 | 17 | ||
20 | #define WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE | ||
21 | #ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE | ||
22 | char __init inkernel_firmware[] = "let's say that this is firmware\n"; | ||
23 | #endif | ||
24 | |||
25 | static struct device ghost_device = { | 18 | static struct device ghost_device = { |
26 | .bus_id = "ghost0", | 19 | .bus_id = "ghost0", |
27 | }; | 20 | }; |
@@ -104,10 +97,6 @@ static void sample_probe_async(void) | |||
104 | 97 | ||
105 | static int sample_init(void) | 98 | static int sample_init(void) |
106 | { | 99 | { |
107 | #ifdef WE_CAN_NEED_FIRMWARE_BEFORE_USERSPACE_IS_AVAILABLE | ||
108 | register_firmware("sample_driver_fw", inkernel_firmware, | ||
109 | sizeof(inkernel_firmware)); | ||
110 | #endif | ||
111 | device_initialize(&ghost_device); | 100 | device_initialize(&ghost_device); |
112 | /* since there is no real hardware insertion I just call the | 101 | /* since there is no real hardware insertion I just call the |
113 | * sample probe functions here */ | 102 | * sample probe functions here */ |
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 92f0056d928c..c61d8b876fdb 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -1031,7 +1031,7 @@ conflict on any particular lock. | |||
1031 | LOCKS VS MEMORY ACCESSES | 1031 | LOCKS VS MEMORY ACCESSES |
1032 | ------------------------ | 1032 | ------------------------ |
1033 | 1033 | ||
1034 | Consider the following: the system has a pair of spinlocks (N) and (Q), and | 1034 | Consider the following: the system has a pair of spinlocks (M) and (Q), and |
1035 | three CPUs; then should the following sequence of events occur: | 1035 | three CPUs; then should the following sequence of events occur: |
1036 | 1036 | ||
1037 | CPU 1 CPU 2 | 1037 | CPU 1 CPU 2 |
@@ -1678,7 +1678,7 @@ CPU's caches by some other cache event: | |||
1678 | smp_wmb(); | 1678 | smp_wmb(); |
1679 | <A:modify v=2> <C:busy> | 1679 | <A:modify v=2> <C:busy> |
1680 | <C:queue v=2> | 1680 | <C:queue v=2> |
1681 | p = &b; q = p; | 1681 | p = &v; q = p; |
1682 | <D:request p> | 1682 | <D:request p> |
1683 | <B:modify p=&v> <D:commit p=&v> | 1683 | <B:modify p=&v> <D:commit p=&v> |
1684 | <D:read p> | 1684 | <D:read p> |
diff --git a/Documentation/networking/operstates.txt b/Documentation/networking/operstates.txt new file mode 100644 index 000000000000..4a21d9bb836b --- /dev/null +++ b/Documentation/networking/operstates.txt | |||
@@ -0,0 +1,161 @@ | |||
1 | |||
2 | 1. Introduction | ||
3 | |||
4 | Linux distinguishes between administrative and operational state of an | ||
5 | interface. Admininstrative state is the result of "ip link set dev | ||
6 | <dev> up or down" and reflects whether the administrator wants to use | ||
7 | the device for traffic. | ||
8 | |||
9 | However, an interface is not usable just because the admin enabled it | ||
10 | - ethernet requires to be plugged into the switch and, depending on | ||
11 | a site's networking policy and configuration, an 802.1X authentication | ||
12 | to be performed before user data can be transferred. Operational state | ||
13 | shows the ability of an interface to transmit this user data. | ||
14 | |||
15 | Thanks to 802.1X, userspace must be granted the possibility to | ||
16 | influence operational state. To accommodate this, operational state is | ||
17 | split into two parts: Two flags that can be set by the driver only, and | ||
18 | a RFC2863 compatible state that is derived from these flags, a policy, | ||
19 | and changeable from userspace under certain rules. | ||
20 | |||
21 | |||
22 | 2. Querying from userspace | ||
23 | |||
24 | Both admin and operational state can be queried via the netlink | ||
25 | operation RTM_GETLINK. It is also possible to subscribe to RTMGRP_LINK | ||
26 | to be notified of updates. This is important for setting from userspace. | ||
27 | |||
28 | These values contain interface state: | ||
29 | |||
30 | ifinfomsg::if_flags & IFF_UP: | ||
31 | Interface is admin up | ||
32 | ifinfomsg::if_flags & IFF_RUNNING: | ||
33 | Interface is in RFC2863 operational state UP or UNKNOWN. This is for | ||
34 | backward compatibility, routing daemons, dhcp clients can use this | ||
35 | flag to determine whether they should use the interface. | ||
36 | ifinfomsg::if_flags & IFF_LOWER_UP: | ||
37 | Driver has signaled netif_carrier_on() | ||
38 | ifinfomsg::if_flags & IFF_DORMANT: | ||
39 | Driver has signaled netif_dormant_on() | ||
40 | |||
41 | These interface flags can also be queried without netlink using the | ||
42 | SIOCGIFFLAGS ioctl. | ||
43 | |||
44 | TLV IFLA_OPERSTATE | ||
45 | |||
46 | contains RFC2863 state of the interface in numeric representation: | ||
47 | |||
48 | IF_OPER_UNKNOWN (0): | ||
49 | Interface is in unknown state, neither driver nor userspace has set | ||
50 | operational state. Interface must be considered for user data as | ||
51 | setting operational state has not been implemented in every driver. | ||
52 | IF_OPER_NOTPRESENT (1): | ||
53 | Unused in current kernel (notpresent interfaces normally disappear), | ||
54 | just a numerical placeholder. | ||
55 | IF_OPER_DOWN (2): | ||
56 | Interface is unable to transfer data on L1, f.e. ethernet is not | ||
57 | plugged or interface is ADMIN down. | ||
58 | IF_OPER_LOWERLAYERDOWN (3): | ||
59 | Interfaces stacked on an interface that is IF_OPER_DOWN show this | ||
60 | state (f.e. VLAN). | ||
61 | IF_OPER_TESTING (4): | ||
62 | Unused in current kernel. | ||
63 | IF_OPER_DORMANT (5): | ||
64 | Interface is L1 up, but waiting for an external event, f.e. for a | ||
65 | protocol to establish. (802.1X) | ||
66 | IF_OPER_UP (6): | ||
67 | Interface is operational up and can be used. | ||
68 | |||
69 | This TLV can also be queried via sysfs. | ||
70 | |||
71 | TLV IFLA_LINKMODE | ||
72 | |||
73 | contains link policy. This is needed for userspace interaction | ||
74 | described below. | ||
75 | |||
76 | This TLV can also be queried via sysfs. | ||
77 | |||
78 | |||
79 | 3. Kernel driver API | ||
80 | |||
81 | Kernel drivers have access to two flags that map to IFF_LOWER_UP and | ||
82 | IFF_DORMANT. These flags can be set from everywhere, even from | ||
83 | interrupts. It is guaranteed that only the driver has write access, | ||
84 | however, if different layers of the driver manipulate the same flag, | ||
85 | the driver has to provide the synchronisation needed. | ||
86 | |||
87 | __LINK_STATE_NOCARRIER, maps to !IFF_LOWER_UP: | ||
88 | |||
89 | The driver uses netif_carrier_on() to clear and netif_carrier_off() to | ||
90 | set this flag. On netif_carrier_off(), the scheduler stops sending | ||
91 | packets. The name 'carrier' and the inversion are historical, think of | ||
92 | it as lower layer. | ||
93 | |||
94 | netif_carrier_ok() can be used to query that bit. | ||
95 | |||
96 | __LINK_STATE_DORMANT, maps to IFF_DORMANT: | ||
97 | |||
98 | Set by the driver to express that the device cannot yet be used | ||
99 | because some driver controlled protocol establishment has to | ||
100 | complete. Corresponding functions are netif_dormant_on() to set the | ||
101 | flag, netif_dormant_off() to clear it and netif_dormant() to query. | ||
102 | |||
103 | On device allocation, networking core sets the flags equivalent to | ||
104 | netif_carrier_ok() and !netif_dormant(). | ||
105 | |||
106 | |||
107 | Whenever the driver CHANGES one of these flags, a workqueue event is | ||
108 | scheduled to translate the flag combination to IFLA_OPERSTATE as | ||
109 | follows: | ||
110 | |||
111 | !netif_carrier_ok(): | ||
112 | IF_OPER_LOWERLAYERDOWN if the interface is stacked, IF_OPER_DOWN | ||
113 | otherwise. Kernel can recognise stacked interfaces because their | ||
114 | ifindex != iflink. | ||
115 | |||
116 | netif_carrier_ok() && netif_dormant(): | ||
117 | IF_OPER_DORMANT | ||
118 | |||
119 | netif_carrier_ok() && !netif_dormant(): | ||
120 | IF_OPER_UP if userspace interaction is disabled. Otherwise | ||
121 | IF_OPER_DORMANT with the possibility for userspace to initiate the | ||
122 | IF_OPER_UP transition afterwards. | ||
123 | |||
124 | |||
125 | 4. Setting from userspace | ||
126 | |||
127 | Applications have to use the netlink interface to influence the | ||
128 | RFC2863 operational state of an interface. Setting IFLA_LINKMODE to 1 | ||
129 | via RTM_SETLINK instructs the kernel that an interface should go to | ||
130 | IF_OPER_DORMANT instead of IF_OPER_UP when the combination | ||
131 | netif_carrier_ok() && !netif_dormant() is set by the | ||
132 | driver. Afterwards, the userspace application can set IFLA_OPERSTATE | ||
133 | to IF_OPER_DORMANT or IF_OPER_UP as long as the driver does not set | ||
134 | netif_carrier_off() or netif_dormant_on(). Changes made by userspace | ||
135 | are multicasted on the netlink group RTMGRP_LINK. | ||
136 | |||
137 | So basically a 802.1X supplicant interacts with the kernel like this: | ||
138 | |||
139 | -subscribe to RTMGRP_LINK | ||
140 | -set IFLA_LINKMODE to 1 via RTM_SETLINK | ||
141 | -query RTM_GETLINK once to get initial state | ||
142 | -if initial flags are not (IFF_LOWER_UP && !IFF_DORMANT), wait until | ||
143 | netlink multicast signals this state | ||
144 | -do 802.1X, eventually abort if flags go down again | ||
145 | -send RTM_SETLINK to set operstate to IF_OPER_UP if authentication | ||
146 | succeeds, IF_OPER_DORMANT otherwise | ||
147 | -see how operstate and IFF_RUNNING is echoed via netlink multicast | ||
148 | -set interface back to IF_OPER_DORMANT if 802.1X reauthentication | ||
149 | fails | ||
150 | -restart if kernel changes IFF_LOWER_UP or IFF_DORMANT flag | ||
151 | |||
152 | if supplicant goes down, bring back IFLA_LINKMODE to 0 and | ||
153 | IFLA_OPERSTATE to a sane value. | ||
154 | |||
155 | A routing daemon or dhcp client just needs to care for IFF_RUNNING or | ||
156 | waiting for operstate to go IF_OPER_UP/IF_OPER_UNKNOWN before | ||
157 | considering the interface / querying a DHCP address. | ||
158 | |||
159 | |||
160 | For technical questions and/or comments please e-mail to Stefan Rompf | ||
161 | (stefan at loplof.de). | ||
diff --git a/Documentation/scsi/ChangeLog.megaraid b/Documentation/scsi/ChangeLog.megaraid index 09f6300eda4b..c173806c91fa 100644 --- a/Documentation/scsi/ChangeLog.megaraid +++ b/Documentation/scsi/ChangeLog.megaraid | |||
@@ -1,3 +1,28 @@ | |||
1 | Release Date : Mon Apr 11 12:27:22 EST 2006 - Seokmann Ju <sju@lsil.com> | ||
2 | Current Version : 2.20.4.8 (scsi module), 2.20.2.6 (cmm module) | ||
3 | Older Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) | ||
4 | |||
5 | 1. Fixed a bug in megaraid_reset_handler(). | ||
6 | Customer reported "Unable to handle kernel NULL pointer dereference | ||
7 | at virtual address 00000000" when system goes to reset condition | ||
8 | for some reason. It happened randomly. | ||
9 | Root Cause: in the megaraid_reset_handler(), there is possibility not | ||
10 | returning pending packets in the pend_list if there are multiple | ||
11 | pending packets. | ||
12 | Fix: Made the change in the driver so that it will return all packets | ||
13 | in the pend_list. | ||
14 | |||
15 | 2. Added change request. | ||
16 | As found in the following URL, rmb() only didn't help the | ||
17 | problem. I had to increase the loop counter to 0xFFFFFF. (6 F's) | ||
18 | http://marc.theaimsgroup.com/?l=linux-scsi&m=110971060502497&w=2 | ||
19 | |||
20 | I attached a patch for your reference, too. | ||
21 | Could you check and get this fix in your driver? | ||
22 | |||
23 | Best Regards, | ||
24 | Jun'ichi Nomura | ||
25 | |||
1 | Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com> | 26 | Release Date : Fri Nov 11 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com> |
2 | Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) | 27 | Current Version : 2.20.4.7 (scsi module), 2.20.2.6 (cmm module) |
3 | Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) | 28 | Older Version : 2.20.4.6 (scsi module), 2.20.2.6 (cmm module) |
diff --git a/Documentation/spi/pxa2xx b/Documentation/spi/pxa2xx new file mode 100644 index 000000000000..9c45f3df2e18 --- /dev/null +++ b/Documentation/spi/pxa2xx | |||
@@ -0,0 +1,234 @@ | |||
1 | PXA2xx SPI on SSP driver HOWTO | ||
2 | =================================================== | ||
3 | This a mini howto on the pxa2xx_spi driver. The driver turns a PXA2xx | ||
4 | synchronous serial port into a SPI master controller | ||
5 | (see Documentation/spi/spi_summary). The driver has the following features | ||
6 | |||
7 | - Support for any PXA2xx SSP | ||
8 | - SSP PIO and SSP DMA data transfers. | ||
9 | - External and Internal (SSPFRM) chip selects. | ||
10 | - Per slave device (chip) configuration. | ||
11 | - Full suspend, freeze, resume support. | ||
12 | |||
13 | The driver is built around a "spi_message" fifo serviced by workqueue and a | ||
14 | tasklet. The workqueue, "pump_messages", drives message fifo and the tasklet | ||
15 | (pump_transfer) is responsible for queuing SPI transactions and setting up and | ||
16 | launching the dma/interrupt driven transfers. | ||
17 | |||
18 | Declaring PXA2xx Master Controllers | ||
19 | ----------------------------------- | ||
20 | Typically a SPI master is defined in the arch/.../mach-*/board-*.c as a | ||
21 | "platform device". The master configuration is passed to the driver via a table | ||
22 | found in include/asm-arm/arch-pxa/pxa2xx_spi.h: | ||
23 | |||
24 | struct pxa2xx_spi_master { | ||
25 | enum pxa_ssp_type ssp_type; | ||
26 | u32 clock_enable; | ||
27 | u16 num_chipselect; | ||
28 | u8 enable_dma; | ||
29 | }; | ||
30 | |||
31 | The "pxa2xx_spi_master.ssp_type" field must have a value between 1 and 3 and | ||
32 | informs the driver which features a particular SSP supports. | ||
33 | |||
34 | The "pxa2xx_spi_master.clock_enable" field is used to enable/disable the | ||
35 | corresponding SSP peripheral block in the "Clock Enable Register (CKEN"). See | ||
36 | the "PXA2xx Developer Manual" section "Clocks and Power Management". | ||
37 | |||
38 | The "pxa2xx_spi_master.num_chipselect" field is used to determine the number of | ||
39 | slave device (chips) attached to this SPI master. | ||
40 | |||
41 | The "pxa2xx_spi_master.enable_dma" field informs the driver that SSP DMA should | ||
42 | be used. This caused the driver to acquire two DMA channels: rx_channel and | ||
43 | tx_channel. The rx_channel has a higher DMA service priority the tx_channel. | ||
44 | See the "PXA2xx Developer Manual" section "DMA Controller". | ||
45 | |||
46 | NSSP MASTER SAMPLE | ||
47 | ------------------ | ||
48 | Below is a sample configuration using the PXA255 NSSP. | ||
49 | |||
50 | static struct resource pxa_spi_nssp_resources[] = { | ||
51 | [0] = { | ||
52 | .start = __PREG(SSCR0_P(2)), /* Start address of NSSP */ | ||
53 | .end = __PREG(SSCR0_P(2)) + 0x2c, /* Range of registers */ | ||
54 | .flags = IORESOURCE_MEM, | ||
55 | }, | ||
56 | [1] = { | ||
57 | .start = IRQ_NSSP, /* NSSP IRQ */ | ||
58 | .end = IRQ_NSSP, | ||
59 | .flags = IORESOURCE_IRQ, | ||
60 | }, | ||
61 | }; | ||
62 | |||
63 | static struct pxa2xx_spi_master pxa_nssp_master_info = { | ||
64 | .ssp_type = PXA25x_NSSP, /* Type of SSP */ | ||
65 | .clock_enable = CKEN9_NSSP, /* NSSP Peripheral clock */ | ||
66 | .num_chipselect = 1, /* Matches the number of chips attached to NSSP */ | ||
67 | .enable_dma = 1, /* Enables NSSP DMA */ | ||
68 | }; | ||
69 | |||
70 | static struct platform_device pxa_spi_nssp = { | ||
71 | .name = "pxa2xx-spi", /* MUST BE THIS VALUE, so device match driver */ | ||
72 | .id = 2, /* Bus number, MUST MATCH SSP number 1..n */ | ||
73 | .resource = pxa_spi_nssp_resources, | ||
74 | .num_resources = ARRAY_SIZE(pxa_spi_nssp_resources), | ||
75 | .dev = { | ||
76 | .platform_data = &pxa_nssp_master_info, /* Passed to driver */ | ||
77 | }, | ||
78 | }; | ||
79 | |||
80 | static struct platform_device *devices[] __initdata = { | ||
81 | &pxa_spi_nssp, | ||
82 | }; | ||
83 | |||
84 | static void __init board_init(void) | ||
85 | { | ||
86 | (void)platform_add_device(devices, ARRAY_SIZE(devices)); | ||
87 | } | ||
88 | |||
89 | Declaring Slave Devices | ||
90 | ----------------------- | ||
91 | Typically each SPI slave (chip) is defined in the arch/.../mach-*/board-*.c | ||
92 | using the "spi_board_info" structure found in "linux/spi/spi.h". See | ||
93 | "Documentation/spi/spi_summary" for additional information. | ||
94 | |||
95 | Each slave device attached to the PXA must provide slave specific configuration | ||
96 | information via the structure "pxa2xx_spi_chip" found in | ||
97 | "include/asm-arm/arch-pxa/pxa2xx_spi.h". The pxa2xx_spi master controller driver | ||
98 | will uses the configuration whenever the driver communicates with the slave | ||
99 | device. | ||
100 | |||
101 | struct pxa2xx_spi_chip { | ||
102 | u8 tx_threshold; | ||
103 | u8 rx_threshold; | ||
104 | u8 dma_burst_size; | ||
105 | u32 timeout_microsecs; | ||
106 | u8 enable_loopback; | ||
107 | void (*cs_control)(u32 command); | ||
108 | }; | ||
109 | |||
110 | The "pxa2xx_spi_chip.tx_threshold" and "pxa2xx_spi_chip.rx_threshold" fields are | ||
111 | used to configure the SSP hardware fifo. These fields are critical to the | ||
112 | performance of pxa2xx_spi driver and misconfiguration will result in rx | ||
113 | fifo overruns (especially in PIO mode transfers). Good default values are | ||
114 | |||
115 | .tx_threshold = 12, | ||
116 | .rx_threshold = 4, | ||
117 | |||
118 | The "pxa2xx_spi_chip.dma_burst_size" field is used to configure PXA2xx DMA | ||
119 | engine and is related the "spi_device.bits_per_word" field. Read and understand | ||
120 | the PXA2xx "Developer Manual" sections on the DMA controller and SSP Controllers | ||
121 | to determine the correct value. An SSP configured for byte-wide transfers would | ||
122 | use a value of 8. | ||
123 | |||
124 | The "pxa2xx_spi_chip.timeout_microsecs" fields is used to efficiently handle | ||
125 | trailing bytes in the SSP receiver fifo. The correct value for this field is | ||
126 | dependent on the SPI bus speed ("spi_board_info.max_speed_hz") and the specific | ||
127 | slave device. Please note the the PXA2xx SSP 1 does not support trailing byte | ||
128 | timeouts and must busy-wait any trailing bytes. | ||
129 | |||
130 | The "pxa2xx_spi_chip.enable_loopback" field is used to place the SSP porting | ||
131 | into internal loopback mode. In this mode the SSP controller internally | ||
132 | connects the SSPTX pin the the SSPRX pin. This is useful for initial setup | ||
133 | testing. | ||
134 | |||
135 | The "pxa2xx_spi_chip.cs_control" field is used to point to a board specific | ||
136 | function for asserting/deasserting a slave device chip select. If the field is | ||
137 | NULL, the pxa2xx_spi master controller driver assumes that the SSP port is | ||
138 | configured to use SSPFRM instead. | ||
139 | |||
140 | NSSP SALVE SAMPLE | ||
141 | ----------------- | ||
142 | The pxa2xx_spi_chip structure is passed to the pxa2xx_spi driver in the | ||
143 | "spi_board_info.controller_data" field. Below is a sample configuration using | ||
144 | the PXA255 NSSP. | ||
145 | |||
146 | /* Chip Select control for the CS8415A SPI slave device */ | ||
147 | static void cs8415a_cs_control(u32 command) | ||
148 | { | ||
149 | if (command & PXA2XX_CS_ASSERT) | ||
150 | GPCR(2) = GPIO_bit(2); | ||
151 | else | ||
152 | GPSR(2) = GPIO_bit(2); | ||
153 | } | ||
154 | |||
155 | /* Chip Select control for the CS8405A SPI slave device */ | ||
156 | static void cs8405a_cs_control(u32 command) | ||
157 | { | ||
158 | if (command & PXA2XX_CS_ASSERT) | ||
159 | GPCR(3) = GPIO_bit(3); | ||
160 | else | ||
161 | GPSR(3) = GPIO_bit(3); | ||
162 | } | ||
163 | |||
164 | static struct pxa2xx_spi_chip cs8415a_chip_info = { | ||
165 | .tx_threshold = 12, /* SSP hardward FIFO threshold */ | ||
166 | .rx_threshold = 4, /* SSP hardward FIFO threshold */ | ||
167 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ | ||
168 | .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */ | ||
169 | .cs_control = cs8415a_cs_control, /* Use external chip select */ | ||
170 | }; | ||
171 | |||
172 | static struct pxa2xx_spi_chip cs8405a_chip_info = { | ||
173 | .tx_threshold = 12, /* SSP hardward FIFO threshold */ | ||
174 | .rx_threshold = 4, /* SSP hardward FIFO threshold */ | ||
175 | .dma_burst_size = 8, /* Byte wide transfers used so 8 byte bursts */ | ||
176 | .timeout_microsecs = 64, /* Wait at least 64usec to handle trailing */ | ||
177 | .cs_control = cs8405a_cs_control, /* Use external chip select */ | ||
178 | }; | ||
179 | |||
180 | static struct spi_board_info streetracer_spi_board_info[] __initdata = { | ||
181 | { | ||
182 | .modalias = "cs8415a", /* Name of spi_driver for this device */ | ||
183 | .max_speed_hz = 3686400, /* Run SSP as fast a possbile */ | ||
184 | .bus_num = 2, /* Framework bus number */ | ||
185 | .chip_select = 0, /* Framework chip select */ | ||
186 | .platform_data = NULL; /* No spi_driver specific config */ | ||
187 | .controller_data = &cs8415a_chip_info, /* Master chip config */ | ||
188 | .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */ | ||
189 | }, | ||
190 | { | ||
191 | .modalias = "cs8405a", /* Name of spi_driver for this device */ | ||
192 | .max_speed_hz = 3686400, /* Run SSP as fast a possbile */ | ||
193 | .bus_num = 2, /* Framework bus number */ | ||
194 | .chip_select = 1, /* Framework chip select */ | ||
195 | .controller_data = &cs8405a_chip_info, /* Master chip config */ | ||
196 | .irq = STREETRACER_APCI_IRQ, /* Slave device interrupt */ | ||
197 | }, | ||
198 | }; | ||
199 | |||
200 | static void __init streetracer_init(void) | ||
201 | { | ||
202 | spi_register_board_info(streetracer_spi_board_info, | ||
203 | ARRAY_SIZE(streetracer_spi_board_info)); | ||
204 | } | ||
205 | |||
206 | |||
207 | DMA and PIO I/O Support | ||
208 | ----------------------- | ||
209 | The pxa2xx_spi driver support both DMA and interrupt driven PIO message | ||
210 | transfers. The driver defaults to PIO mode and DMA transfers must enabled by | ||
211 | setting the "enable_dma" flag in the "pxa2xx_spi_master" structure and and | ||
212 | ensuring that the "pxa2xx_spi_chip.dma_burst_size" field is non-zero. The DMA | ||
213 | mode support both coherent and stream based DMA mappings. | ||
214 | |||
215 | The following logic is used to determine the type of I/O to be used on | ||
216 | a per "spi_transfer" basis: | ||
217 | |||
218 | if !enable_dma or dma_burst_size == 0 then | ||
219 | always use PIO transfers | ||
220 | |||
221 | if spi_message.is_dma_mapped and rx_dma_buf != 0 and tx_dma_buf != 0 then | ||
222 | use coherent DMA mode | ||
223 | |||
224 | if rx_buf and tx_buf are aligned on 8 byte boundary then | ||
225 | use streaming DMA mode | ||
226 | |||
227 | otherwise | ||
228 | use PIO transfer | ||
229 | |||
230 | THANKS TO | ||
231 | --------- | ||
232 | |||
233 | David Brownell and others for mentoring the development of this driver. | ||
234 | |||
diff --git a/Documentation/spi/spi-summary b/Documentation/spi/spi-summary index a5ffba33a351..068732d32276 100644 --- a/Documentation/spi/spi-summary +++ b/Documentation/spi/spi-summary | |||
@@ -414,7 +414,33 @@ to get the driver-private data allocated for that device. | |||
414 | The driver will initialize the fields of that spi_master, including the | 414 | The driver will initialize the fields of that spi_master, including the |
415 | bus number (maybe the same as the platform device ID) and three methods | 415 | bus number (maybe the same as the platform device ID) and three methods |
416 | used to interact with the SPI core and SPI protocol drivers. It will | 416 | used to interact with the SPI core and SPI protocol drivers. It will |
417 | also initialize its own internal state. | 417 | also initialize its own internal state. (See below about bus numbering |
418 | and those methods.) | ||
419 | |||
420 | After you initialize the spi_master, then use spi_register_master() to | ||
421 | publish it to the rest of the system. At that time, device nodes for | ||
422 | the controller and any predeclared spi devices will be made available, | ||
423 | and the driver model core will take care of binding them to drivers. | ||
424 | |||
425 | If you need to remove your SPI controller driver, spi_unregister_master() | ||
426 | will reverse the effect of spi_register_master(). | ||
427 | |||
428 | |||
429 | BUS NUMBERING | ||
430 | |||
431 | Bus numbering is important, since that's how Linux identifies a given | ||
432 | SPI bus (shared SCK, MOSI, MISO). Valid bus numbers start at zero. On | ||
433 | SOC systems, the bus numbers should match the numbers defined by the chip | ||
434 | manufacturer. For example, hardware controller SPI2 would be bus number 2, | ||
435 | and spi_board_info for devices connected to it would use that number. | ||
436 | |||
437 | If you don't have such hardware-assigned bus number, and for some reason | ||
438 | you can't just assign them, then provide a negative bus number. That will | ||
439 | then be replaced by a dynamically assigned number. You'd then need to treat | ||
440 | this as a non-static configuration (see above). | ||
441 | |||
442 | |||
443 | SPI MASTER METHODS | ||
418 | 444 | ||
419 | master->setup(struct spi_device *spi) | 445 | master->setup(struct spi_device *spi) |
420 | This sets up the device clock rate, SPI mode, and word sizes. | 446 | This sets up the device clock rate, SPI mode, and word sizes. |
@@ -431,6 +457,9 @@ also initialize its own internal state. | |||
431 | state it dynamically associates with that device. If you do that, | 457 | state it dynamically associates with that device. If you do that, |
432 | be sure to provide the cleanup() method to free that state. | 458 | be sure to provide the cleanup() method to free that state. |
433 | 459 | ||
460 | |||
461 | SPI MESSAGE QUEUE | ||
462 | |||
434 | The bulk of the driver will be managing the I/O queue fed by transfer(). | 463 | The bulk of the driver will be managing the I/O queue fed by transfer(). |
435 | 464 | ||
436 | That queue could be purely conceptual. For example, a driver used only | 465 | That queue could be purely conceptual. For example, a driver used only |
@@ -440,6 +469,9 @@ But the queue will probably be very real, using message->queue, PIO, | |||
440 | often DMA (especially if the root filesystem is in SPI flash), and | 469 | often DMA (especially if the root filesystem is in SPI flash), and |
441 | execution contexts like IRQ handlers, tasklets, or workqueues (such | 470 | execution contexts like IRQ handlers, tasklets, or workqueues (such |
442 | as keventd). Your driver can be as fancy, or as simple, as you need. | 471 | as keventd). Your driver can be as fancy, or as simple, as you need. |
472 | Such a transfer() method would normally just add the message to a | ||
473 | queue, and then start some asynchronous transfer engine (unless it's | ||
474 | already running). | ||
443 | 475 | ||
444 | 476 | ||
445 | THANKS TO | 477 | THANKS TO |
diff --git a/Documentation/watchdog/watchdog-api.txt b/Documentation/watchdog/watchdog-api.txt index c5beb548cfc4..21ed51173662 100644 --- a/Documentation/watchdog/watchdog-api.txt +++ b/Documentation/watchdog/watchdog-api.txt | |||
@@ -36,6 +36,9 @@ timeout or margin. The simplest way to ping the watchdog is to write | |||
36 | some data to the device. So a very simple watchdog daemon would look | 36 | some data to the device. So a very simple watchdog daemon would look |
37 | like this: | 37 | like this: |
38 | 38 | ||
39 | #include <stdlib.h> | ||
40 | #include <fcntl.h> | ||
41 | |||
39 | int main(int argc, const char *argv[]) { | 42 | int main(int argc, const char *argv[]) { |
40 | int fd=open("/dev/watchdog",O_WRONLY); | 43 | int fd=open("/dev/watchdog",O_WRONLY); |
41 | if (fd==-1) { | 44 | if (fd==-1) { |
diff --git a/MAINTAINERS b/MAINTAINERS index d6a8e5b434ec..bd10b2af2223 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -40,11 +40,20 @@ trivial patch so apply some common sense. | |||
40 | PLEASE document known bugs. If it doesn't work for everything | 40 | PLEASE document known bugs. If it doesn't work for everything |
41 | or does something very odd once a month document it. | 41 | or does something very odd once a month document it. |
42 | 42 | ||
43 | PLEASE remember that submissions must be made under the terms | ||
44 | of the OSDL certificate of contribution | ||
45 | (http://www.osdl.org/newsroom/press_releases/2004/2004_05_24_dco.html) | ||
46 | and should include a Signed-off-by: line. | ||
47 | |||
43 | 6. Make sure you have the right to send any changes you make. If you | 48 | 6. Make sure you have the right to send any changes you make. If you |
44 | do changes at work you may find your employer owns the patch | 49 | do changes at work you may find your employer owns the patch |
45 | not you. | 50 | not you. |
46 | 51 | ||
47 | 7. Happy hacking. | 52 | 7. When sending security related changes or reports to a maintainer |
53 | please Cc: security@kernel.org, especially if the maintainer | ||
54 | does not respond. | ||
55 | |||
56 | 8. Happy hacking. | ||
48 | 57 | ||
49 | ----------------------------------- | 58 | ----------------------------------- |
50 | 59 | ||
@@ -969,7 +978,7 @@ S: Maintained | |||
969 | EXT3 FILE SYSTEM | 978 | EXT3 FILE SYSTEM |
970 | P: Stephen Tweedie, Andrew Morton | 979 | P: Stephen Tweedie, Andrew Morton |
971 | M: sct@redhat.com, akpm@osdl.org, adilger@clusterfs.com | 980 | M: sct@redhat.com, akpm@osdl.org, adilger@clusterfs.com |
972 | L: ext3-users@redhat.com | 981 | L: ext2-devel@lists.sourceforge.net |
973 | S: Maintained | 982 | S: Maintained |
974 | 983 | ||
975 | F71805F HARDWARE MONITORING DRIVER | 984 | F71805F HARDWARE MONITORING DRIVER |
@@ -1480,10 +1489,11 @@ L: netdev@vger.kernel.org | |||
1480 | S: Maintained | 1489 | S: Maintained |
1481 | 1490 | ||
1482 | IRDA SUBSYSTEM | 1491 | IRDA SUBSYSTEM |
1483 | P: Jean Tourrilhes | 1492 | P: Samuel Ortiz |
1493 | M: samuel@sortiz.org | ||
1484 | L: irda-users@lists.sourceforge.net (subscribers-only) | 1494 | L: irda-users@lists.sourceforge.net (subscribers-only) |
1485 | W: http://irda.sourceforge.net/ | 1495 | W: http://irda.sourceforge.net/ |
1486 | S: Odd Fixes | 1496 | S: Maintained |
1487 | 1497 | ||
1488 | ISAPNP | 1498 | ISAPNP |
1489 | P: Jaroslav Kysela | 1499 | P: Jaroslav Kysela |
@@ -1529,12 +1539,28 @@ W: http://jfs.sourceforge.net/ | |||
1529 | T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git | 1539 | T: git kernel.org:/pub/scm/linux/kernel/git/shaggy/jfs-2.6.git |
1530 | S: Supported | 1540 | S: Supported |
1531 | 1541 | ||
1542 | JOURNALLING LAYER FOR BLOCK DEVICS (JBD) | ||
1543 | P: Stephen Tweedie, Andrew Morton | ||
1544 | M: sct@redhat.com, akpm@osdl.org | ||
1545 | L: ext2-devel@lists.sourceforge.net | ||
1546 | S: Maintained | ||
1547 | |||
1532 | KCONFIG | 1548 | KCONFIG |
1533 | P: Roman Zippel | 1549 | P: Roman Zippel |
1534 | M: zippel@linux-m68k.org | 1550 | M: zippel@linux-m68k.org |
1535 | L: kbuild-devel@lists.sourceforge.net | 1551 | L: kbuild-devel@lists.sourceforge.net |
1536 | S: Maintained | 1552 | S: Maintained |
1537 | 1553 | ||
1554 | KDUMP | ||
1555 | P: Vivek Goyal | ||
1556 | M: vgoyal@in.ibm.com | ||
1557 | P: Haren Myneni | ||
1558 | M: hbabu@us.ibm.com | ||
1559 | L: fastboot@lists.osdl.org | ||
1560 | L: linux-kernel@vger.kernel.org | ||
1561 | W: http://lse.sourceforge.net/kdump/ | ||
1562 | S: Maintained | ||
1563 | |||
1538 | KERNEL AUTOMOUNTER (AUTOFS) | 1564 | KERNEL AUTOMOUNTER (AUTOFS) |
1539 | P: H. Peter Anvin | 1565 | P: H. Peter Anvin |
1540 | M: hpa@zytor.com | 1566 | M: hpa@zytor.com |
@@ -1602,6 +1628,11 @@ M: James.Bottomley@HansenPartnership.com | |||
1602 | L: linux-scsi@vger.kernel.org | 1628 | L: linux-scsi@vger.kernel.org |
1603 | S: Maintained | 1629 | S: Maintained |
1604 | 1630 | ||
1631 | LED SUBSYSTEM | ||
1632 | P: Richard Purdie | ||
1633 | M: rpurdie@rpsys.net | ||
1634 | S: Maintained | ||
1635 | |||
1605 | LEGO USB Tower driver | 1636 | LEGO USB Tower driver |
1606 | P: Juergen Stuber | 1637 | P: Juergen Stuber |
1607 | M: starblue@users.sourceforge.net | 1638 | M: starblue@users.sourceforge.net |
@@ -1661,7 +1692,7 @@ S: Maintained | |||
1661 | 1692 | ||
1662 | LINUX FOR POWERPC EMBEDDED PPC8XX | 1693 | LINUX FOR POWERPC EMBEDDED PPC8XX |
1663 | P: Marcelo Tosatti | 1694 | P: Marcelo Tosatti |
1664 | M: marcelo.tosatti@cyclades.com | 1695 | M: marcelo@kvack.org |
1665 | W: http://www.penguinppc.org/ | 1696 | W: http://www.penguinppc.org/ |
1666 | L: linuxppc-embedded@ozlabs.org | 1697 | L: linuxppc-embedded@ozlabs.org |
1667 | S: Maintained | 1698 | S: Maintained |
@@ -2512,6 +2543,12 @@ M: perex@suse.cz | |||
2512 | L: alsa-devel@alsa-project.org | 2543 | L: alsa-devel@alsa-project.org |
2513 | S: Maintained | 2544 | S: Maintained |
2514 | 2545 | ||
2546 | SPI SUBSYSTEM | ||
2547 | P: David Brownell | ||
2548 | M: dbrownell@users.sourceforge.net | ||
2549 | L: spi-devel-general@lists.sourceforge.net | ||
2550 | S: Maintained | ||
2551 | |||
2515 | TPM DEVICE DRIVER | 2552 | TPM DEVICE DRIVER |
2516 | P: Kylene Hall | 2553 | P: Kylene Hall |
2517 | M: kjhall@us.ibm.com | 2554 | M: kjhall@us.ibm.com |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 17 | 3 | SUBLEVEL = 17 |
4 | EXTRAVERSION =-rc3 | 4 | EXTRAVERSION =-rc4 |
5 | NAME=Sliding Snow Leopard | 5 | NAME=Sliding Snow Leopard |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
@@ -344,16 +344,14 @@ scripts_basic: | |||
344 | scripts/basic/%: scripts_basic ; | 344 | scripts/basic/%: scripts_basic ; |
345 | 345 | ||
346 | PHONY += outputmakefile | 346 | PHONY += outputmakefile |
347 | # outputmakefile generate a Makefile to be placed in output directory, if | 347 | # outputmakefile generates a Makefile in the output directory, if using a |
348 | # using a seperate output directory. This allows convinient use | 348 | # separate output directory. This allows convenient use of make in the |
349 | # of make in output directory | 349 | # output directory. |
350 | outputmakefile: | 350 | outputmakefile: |
351 | $(Q)if test ! $(srctree) -ef $(objtree); then \ | 351 | ifneq ($(KBUILD_SRC),) |
352 | $(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ | 352 | $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkmakefile \ |
353 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) \ | 353 | $(srctree) $(objtree) $(VERSION) $(PATCHLEVEL) |
354 | > $(objtree)/Makefile; \ | 354 | endif |
355 | echo ' GEN $(objtree)/Makefile'; \ | ||
356 | fi | ||
357 | 355 | ||
358 | # To make sure we do not include .config for any of the *config targets | 356 | # To make sure we do not include .config for any of the *config targets |
359 | # catch them early, and hand them over to scripts/kconfig/Makefile | 357 | # catch them early, and hand them over to scripts/kconfig/Makefile |
@@ -796,8 +794,8 @@ prepare2: prepare3 outputmakefile | |||
796 | prepare1: prepare2 include/linux/version.h include/asm \ | 794 | prepare1: prepare2 include/linux/version.h include/asm \ |
797 | include/config/MARKER | 795 | include/config/MARKER |
798 | ifneq ($(KBUILD_MODULES),) | 796 | ifneq ($(KBUILD_MODULES),) |
799 | $(Q)rm -rf $(MODVERDIR) | ||
800 | $(Q)mkdir -p $(MODVERDIR) | 797 | $(Q)mkdir -p $(MODVERDIR) |
798 | $(Q)rm -f $(MODVERDIR)/* | ||
801 | endif | 799 | endif |
802 | 800 | ||
803 | archprepare: prepare1 scripts_basic | 801 | archprepare: prepare1 scripts_basic |
@@ -1086,8 +1084,8 @@ else # KBUILD_EXTMOD | |||
1086 | KBUILD_MODULES := 1 | 1084 | KBUILD_MODULES := 1 |
1087 | PHONY += crmodverdir | 1085 | PHONY += crmodverdir |
1088 | crmodverdir: | 1086 | crmodverdir: |
1089 | $(Q)rm -rf $(MODVERDIR) | ||
1090 | $(Q)mkdir -p $(MODVERDIR) | 1087 | $(Q)mkdir -p $(MODVERDIR) |
1088 | $(Q)rm -f $(MODVERDIR)/* | ||
1091 | 1089 | ||
1092 | PHONY += $(objtree)/Module.symvers | 1090 | PHONY += $(objtree)/Module.symvers |
1093 | $(objtree)/Module.symvers: | 1091 | $(objtree)/Module.symvers: |
diff --git a/arch/arm/configs/collie_defconfig b/arch/arm/configs/collie_defconfig index c9aa878e610a..074c47a4fb2e 100644 --- a/arch/arm/configs/collie_defconfig +++ b/arch/arm/configs/collie_defconfig | |||
@@ -1,21 +1,21 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.14-rc3 | 3 | # Linux kernel version: 2.6.17-rc1 |
4 | # Sun Oct 9 16:55:14 2005 | 4 | # Fri Apr 14 19:09:52 2006 |
5 | # | 5 | # |
6 | CONFIG_ARM=y | 6 | CONFIG_ARM=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
8 | CONFIG_UID16=y | ||
9 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 8 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
9 | CONFIG_GENERIC_HWEIGHT=y | ||
10 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 10 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
11 | CONFIG_ARCH_MTD_XIP=y | ||
12 | CONFIG_VECTORS_BASE=0xffff0000 | ||
11 | 13 | ||
12 | # | 14 | # |
13 | # Code maturity level options | 15 | # Code maturity level options |
14 | # | 16 | # |
15 | CONFIG_EXPERIMENTAL=y | 17 | CONFIG_EXPERIMENTAL=y |
16 | CONFIG_CLEAN_COMPILE=y | ||
17 | CONFIG_BROKEN_ON_SMP=y | 18 | CONFIG_BROKEN_ON_SMP=y |
18 | CONFIG_LOCK_KERNEL=y | ||
19 | CONFIG_INIT_ENV_ARG_LIMIT=32 | 19 | CONFIG_INIT_ENV_ARG_LIMIT=32 |
20 | 20 | ||
21 | # | 21 | # |
@@ -23,45 +23,58 @@ CONFIG_INIT_ENV_ARG_LIMIT=32 | |||
23 | # | 23 | # |
24 | CONFIG_LOCALVERSION="" | 24 | CONFIG_LOCALVERSION="" |
25 | CONFIG_LOCALVERSION_AUTO=y | 25 | CONFIG_LOCALVERSION_AUTO=y |
26 | CONFIG_SWAP=y | 26 | # CONFIG_SWAP is not set |
27 | CONFIG_SYSVIPC=y | 27 | CONFIG_SYSVIPC=y |
28 | # CONFIG_POSIX_MQUEUE is not set | 28 | # CONFIG_POSIX_MQUEUE is not set |
29 | CONFIG_BSD_PROCESS_ACCT=y | 29 | # CONFIG_BSD_PROCESS_ACCT is not set |
30 | # CONFIG_BSD_PROCESS_ACCT_V3 is not set | ||
31 | CONFIG_SYSCTL=y | 30 | CONFIG_SYSCTL=y |
32 | # CONFIG_AUDIT is not set | 31 | # CONFIG_AUDIT is not set |
33 | CONFIG_HOTPLUG=y | ||
34 | CONFIG_KOBJECT_UEVENT=y | ||
35 | # CONFIG_IKCONFIG is not set | 32 | # CONFIG_IKCONFIG is not set |
33 | # CONFIG_RELAY is not set | ||
36 | CONFIG_INITRAMFS_SOURCE="" | 34 | CONFIG_INITRAMFS_SOURCE="" |
35 | CONFIG_UID16=y | ||
36 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
37 | CONFIG_EMBEDDED=y | 37 | CONFIG_EMBEDDED=y |
38 | CONFIG_KALLSYMS=y | 38 | CONFIG_KALLSYMS=y |
39 | # CONFIG_KALLSYMS_ALL is not set | 39 | # CONFIG_KALLSYMS_ALL is not set |
40 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 40 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
41 | CONFIG_HOTPLUG=y | ||
41 | CONFIG_PRINTK=y | 42 | CONFIG_PRINTK=y |
42 | CONFIG_BUG=y | 43 | CONFIG_BUG=y |
43 | CONFIG_BASE_FULL=y | 44 | CONFIG_ELF_CORE=y |
45 | # CONFIG_BASE_FULL is not set | ||
44 | CONFIG_FUTEX=y | 46 | CONFIG_FUTEX=y |
45 | CONFIG_EPOLL=y | 47 | # CONFIG_EPOLL is not set |
46 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | ||
47 | CONFIG_SHMEM=y | 48 | CONFIG_SHMEM=y |
48 | CONFIG_CC_ALIGN_FUNCTIONS=0 | 49 | # CONFIG_SLAB is not set |
49 | CONFIG_CC_ALIGN_LABELS=0 | 50 | CONFIG_DOUBLEFAULT=y |
50 | CONFIG_CC_ALIGN_LOOPS=0 | ||
51 | CONFIG_CC_ALIGN_JUMPS=0 | ||
52 | # CONFIG_TINY_SHMEM is not set | 51 | # CONFIG_TINY_SHMEM is not set |
53 | CONFIG_BASE_SMALL=0 | 52 | CONFIG_BASE_SMALL=1 |
53 | CONFIG_SLOB=y | ||
54 | CONFIG_OBSOLETE_INTERMODULE=y | ||
54 | 55 | ||
55 | # | 56 | # |
56 | # Loadable module support | 57 | # Loadable module support |
57 | # | 58 | # |
58 | CONFIG_MODULES=y | 59 | # CONFIG_MODULES is not set |
59 | CONFIG_MODULE_UNLOAD=y | 60 | |
60 | CONFIG_MODULE_FORCE_UNLOAD=y | 61 | # |
61 | CONFIG_OBSOLETE_MODPARM=y | 62 | # Block layer |
62 | CONFIG_MODVERSIONS=y | 63 | # |
63 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 64 | # CONFIG_BLK_DEV_IO_TRACE is not set |
64 | CONFIG_KMOD=y | 65 | |
66 | # | ||
67 | # IO Schedulers | ||
68 | # | ||
69 | CONFIG_IOSCHED_NOOP=y | ||
70 | CONFIG_IOSCHED_AS=y | ||
71 | # CONFIG_IOSCHED_DEADLINE is not set | ||
72 | # CONFIG_IOSCHED_CFQ is not set | ||
73 | CONFIG_DEFAULT_AS=y | ||
74 | # CONFIG_DEFAULT_DEADLINE is not set | ||
75 | # CONFIG_DEFAULT_CFQ is not set | ||
76 | # CONFIG_DEFAULT_NOOP is not set | ||
77 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
65 | 78 | ||
66 | # | 79 | # |
67 | # System Type | 80 | # System Type |
@@ -70,11 +83,13 @@ CONFIG_KMOD=y | |||
70 | # CONFIG_ARCH_CLPS711X is not set | 83 | # CONFIG_ARCH_CLPS711X is not set |
71 | # CONFIG_ARCH_CO285 is not set | 84 | # CONFIG_ARCH_CO285 is not set |
72 | # CONFIG_ARCH_EBSA110 is not set | 85 | # CONFIG_ARCH_EBSA110 is not set |
86 | # CONFIG_ARCH_EP93XX is not set | ||
73 | # CONFIG_ARCH_FOOTBRIDGE is not set | 87 | # CONFIG_ARCH_FOOTBRIDGE is not set |
74 | # CONFIG_ARCH_INTEGRATOR is not set | 88 | # CONFIG_ARCH_INTEGRATOR is not set |
75 | # CONFIG_ARCH_IOP3XX is not set | 89 | # CONFIG_ARCH_IOP3XX is not set |
76 | # CONFIG_ARCH_IXP4XX is not set | 90 | # CONFIG_ARCH_IXP4XX is not set |
77 | # CONFIG_ARCH_IXP2000 is not set | 91 | # CONFIG_ARCH_IXP2000 is not set |
92 | # CONFIG_ARCH_IXP23XX is not set | ||
78 | # CONFIG_ARCH_L7200 is not set | 93 | # CONFIG_ARCH_L7200 is not set |
79 | # CONFIG_ARCH_PXA is not set | 94 | # CONFIG_ARCH_PXA is not set |
80 | # CONFIG_ARCH_RPC is not set | 95 | # CONFIG_ARCH_RPC is not set |
@@ -84,9 +99,11 @@ CONFIG_ARCH_SA1100=y | |||
84 | # CONFIG_ARCH_LH7A40X is not set | 99 | # CONFIG_ARCH_LH7A40X is not set |
85 | # CONFIG_ARCH_OMAP is not set | 100 | # CONFIG_ARCH_OMAP is not set |
86 | # CONFIG_ARCH_VERSATILE is not set | 101 | # CONFIG_ARCH_VERSATILE is not set |
102 | # CONFIG_ARCH_REALVIEW is not set | ||
87 | # CONFIG_ARCH_IMX is not set | 103 | # CONFIG_ARCH_IMX is not set |
88 | # CONFIG_ARCH_H720X is not set | 104 | # CONFIG_ARCH_H720X is not set |
89 | # CONFIG_ARCH_AAEC2000 is not set | 105 | # CONFIG_ARCH_AAEC2000 is not set |
106 | # CONFIG_ARCH_AT91RM9200 is not set | ||
90 | 107 | ||
91 | # | 108 | # |
92 | # SA11x0 Implementations | 109 | # SA11x0 Implementations |
@@ -128,20 +145,32 @@ CONFIG_SHARP_SCOOP=y | |||
128 | # Bus support | 145 | # Bus support |
129 | # | 146 | # |
130 | CONFIG_ISA=y | 147 | CONFIG_ISA=y |
131 | CONFIG_ISA_DMA_API=y | ||
132 | 148 | ||
133 | # | 149 | # |
134 | # PCCARD (PCMCIA/CardBus) support | 150 | # PCCARD (PCMCIA/CardBus) support |
135 | # | 151 | # |
136 | # CONFIG_PCCARD is not set | 152 | CONFIG_PCCARD=y |
153 | CONFIG_PCMCIA_DEBUG=y | ||
154 | CONFIG_PCMCIA=y | ||
155 | CONFIG_PCMCIA_LOAD_CIS=y | ||
156 | CONFIG_PCMCIA_IOCTL=y | ||
157 | |||
158 | # | ||
159 | # PC-card bridges | ||
160 | # | ||
161 | # CONFIG_I82365 is not set | ||
162 | # CONFIG_TCIC is not set | ||
163 | CONFIG_PCMCIA_SA1100=y | ||
137 | 164 | ||
138 | # | 165 | # |
139 | # Kernel Features | 166 | # Kernel Features |
140 | # | 167 | # |
141 | # CONFIG_SMP is not set | 168 | # CONFIG_PREEMPT is not set |
142 | CONFIG_PREEMPT=y | ||
143 | # CONFIG_NO_IDLE_HZ is not set | 169 | # CONFIG_NO_IDLE_HZ is not set |
170 | CONFIG_HZ=100 | ||
171 | # CONFIG_AEABI is not set | ||
144 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y | 172 | CONFIG_ARCH_DISCONTIGMEM_ENABLE=y |
173 | CONFIG_NODES_SHIFT=2 | ||
145 | CONFIG_SELECT_MEMORY_MODEL=y | 174 | CONFIG_SELECT_MEMORY_MODEL=y |
146 | # CONFIG_FLATMEM_MANUAL is not set | 175 | # CONFIG_FLATMEM_MANUAL is not set |
147 | CONFIG_DISCONTIGMEM_MANUAL=y | 176 | CONFIG_DISCONTIGMEM_MANUAL=y |
@@ -150,6 +179,7 @@ CONFIG_DISCONTIGMEM=y | |||
150 | CONFIG_FLAT_NODE_MEM_MAP=y | 179 | CONFIG_FLAT_NODE_MEM_MAP=y |
151 | CONFIG_NEED_MULTIPLE_NODES=y | 180 | CONFIG_NEED_MULTIPLE_NODES=y |
152 | # CONFIG_SPARSEMEM_STATIC is not set | 181 | # CONFIG_SPARSEMEM_STATIC is not set |
182 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
153 | # CONFIG_LEDS is not set | 183 | # CONFIG_LEDS is not set |
154 | CONFIG_ALIGNMENT_TRAP=y | 184 | CONFIG_ALIGNMENT_TRAP=y |
155 | 185 | ||
@@ -158,7 +188,7 @@ CONFIG_ALIGNMENT_TRAP=y | |||
158 | # | 188 | # |
159 | CONFIG_ZBOOT_ROM_TEXT=0x0 | 189 | CONFIG_ZBOOT_ROM_TEXT=0x0 |
160 | CONFIG_ZBOOT_ROM_BSS=0x0 | 190 | CONFIG_ZBOOT_ROM_BSS=0x0 |
161 | CONFIG_CMDLINE="console=ttyS0,115200n8 console=tty1 noinitrd root=/dev/mtdblock2 rootfstype=jffs2 debug" | 191 | CONFIG_CMDLINE="noinitrd root=/dev/mtdblock2 rootfstype=jffs2 fbcon=rotate:1" |
162 | # CONFIG_XIP_KERNEL is not set | 192 | # CONFIG_XIP_KERNEL is not set |
163 | 193 | ||
164 | # | 194 | # |
@@ -181,14 +211,16 @@ CONFIG_FPE_NWFPE=y | |||
181 | # Userspace binary formats | 211 | # Userspace binary formats |
182 | # | 212 | # |
183 | CONFIG_BINFMT_ELF=y | 213 | CONFIG_BINFMT_ELF=y |
184 | CONFIG_BINFMT_AOUT=m | 214 | # CONFIG_BINFMT_AOUT is not set |
185 | CONFIG_BINFMT_MISC=m | 215 | # CONFIG_BINFMT_MISC is not set |
186 | # CONFIG_ARTHUR is not set | 216 | # CONFIG_ARTHUR is not set |
187 | 217 | ||
188 | # | 218 | # |
189 | # Power management options | 219 | # Power management options |
190 | # | 220 | # |
191 | CONFIG_PM=y | 221 | CONFIG_PM=y |
222 | CONFIG_PM_LEGACY=y | ||
223 | # CONFIG_PM_DEBUG is not set | ||
192 | CONFIG_APM=y | 224 | CONFIG_APM=y |
193 | 225 | ||
194 | # | 226 | # |
@@ -199,6 +231,7 @@ CONFIG_NET=y | |||
199 | # | 231 | # |
200 | # Networking options | 232 | # Networking options |
201 | # | 233 | # |
234 | # CONFIG_NETDEBUG is not set | ||
202 | CONFIG_PACKET=y | 235 | CONFIG_PACKET=y |
203 | CONFIG_PACKET_MMAP=y | 236 | CONFIG_PACKET_MMAP=y |
204 | CONFIG_UNIX=y | 237 | CONFIG_UNIX=y |
@@ -211,16 +244,19 @@ CONFIG_IP_FIB_HASH=y | |||
211 | # CONFIG_NET_IPIP is not set | 244 | # CONFIG_NET_IPIP is not set |
212 | # CONFIG_NET_IPGRE is not set | 245 | # CONFIG_NET_IPGRE is not set |
213 | # CONFIG_ARPD is not set | 246 | # CONFIG_ARPD is not set |
214 | CONFIG_SYN_COOKIES=y | 247 | # CONFIG_SYN_COOKIES is not set |
215 | # CONFIG_INET_AH is not set | 248 | # CONFIG_INET_AH is not set |
216 | # CONFIG_INET_ESP is not set | 249 | # CONFIG_INET_ESP is not set |
217 | # CONFIG_INET_IPCOMP is not set | 250 | # CONFIG_INET_IPCOMP is not set |
251 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
218 | # CONFIG_INET_TUNNEL is not set | 252 | # CONFIG_INET_TUNNEL is not set |
219 | CONFIG_INET_DIAG=y | 253 | CONFIG_INET_DIAG=y |
220 | CONFIG_INET_TCP_DIAG=y | 254 | CONFIG_INET_TCP_DIAG=y |
221 | # CONFIG_TCP_CONG_ADVANCED is not set | 255 | # CONFIG_TCP_CONG_ADVANCED is not set |
222 | CONFIG_TCP_CONG_BIC=y | 256 | CONFIG_TCP_CONG_BIC=y |
223 | # CONFIG_IPV6 is not set | 257 | # CONFIG_IPV6 is not set |
258 | # CONFIG_INET6_XFRM_TUNNEL is not set | ||
259 | # CONFIG_INET6_TUNNEL is not set | ||
224 | # CONFIG_NETFILTER is not set | 260 | # CONFIG_NETFILTER is not set |
225 | 261 | ||
226 | # | 262 | # |
@@ -232,6 +268,11 @@ CONFIG_TCP_CONG_BIC=y | |||
232 | # SCTP Configuration (EXPERIMENTAL) | 268 | # SCTP Configuration (EXPERIMENTAL) |
233 | # | 269 | # |
234 | # CONFIG_IP_SCTP is not set | 270 | # CONFIG_IP_SCTP is not set |
271 | |||
272 | # | ||
273 | # TIPC Configuration (EXPERIMENTAL) | ||
274 | # | ||
275 | # CONFIG_TIPC is not set | ||
235 | # CONFIG_ATM is not set | 276 | # CONFIG_ATM is not set |
236 | # CONFIG_BRIDGE is not set | 277 | # CONFIG_BRIDGE is not set |
237 | # CONFIG_VLAN_8021Q is not set | 278 | # CONFIG_VLAN_8021Q is not set |
@@ -244,8 +285,11 @@ CONFIG_TCP_CONG_BIC=y | |||
244 | # CONFIG_NET_DIVERT is not set | 285 | # CONFIG_NET_DIVERT is not set |
245 | # CONFIG_ECONET is not set | 286 | # CONFIG_ECONET is not set |
246 | # CONFIG_WAN_ROUTER is not set | 287 | # CONFIG_WAN_ROUTER is not set |
288 | |||
289 | # | ||
290 | # QoS and/or fair queueing | ||
291 | # | ||
247 | # CONFIG_NET_SCHED is not set | 292 | # CONFIG_NET_SCHED is not set |
248 | # CONFIG_NET_CLS_ROUTE is not set | ||
249 | 293 | ||
250 | # | 294 | # |
251 | # Network testing | 295 | # Network testing |
@@ -265,10 +309,15 @@ CONFIG_TCP_CONG_BIC=y | |||
265 | # | 309 | # |
266 | CONFIG_STANDALONE=y | 310 | CONFIG_STANDALONE=y |
267 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 311 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
268 | CONFIG_FW_LOADER=m | 312 | CONFIG_FW_LOADER=y |
269 | # CONFIG_DEBUG_DRIVER is not set | 313 | # CONFIG_DEBUG_DRIVER is not set |
270 | 314 | ||
271 | # | 315 | # |
316 | # Connector - unified userspace <-> kernelspace linker | ||
317 | # | ||
318 | # CONFIG_CONNECTOR is not set | ||
319 | |||
320 | # | ||
272 | # Memory Technology Devices (MTD) | 321 | # Memory Technology Devices (MTD) |
273 | # | 322 | # |
274 | CONFIG_MTD=y | 323 | CONFIG_MTD=y |
@@ -287,32 +336,49 @@ CONFIG_MTD_BLOCK=y | |||
287 | # CONFIG_FTL is not set | 336 | # CONFIG_FTL is not set |
288 | # CONFIG_NFTL is not set | 337 | # CONFIG_NFTL is not set |
289 | # CONFIG_INFTL is not set | 338 | # CONFIG_INFTL is not set |
339 | # CONFIG_RFD_FTL is not set | ||
290 | 340 | ||
291 | # | 341 | # |
292 | # RAM/ROM/Flash chip drivers | 342 | # RAM/ROM/Flash chip drivers |
293 | # | 343 | # |
294 | # CONFIG_MTD_CFI is not set | 344 | CONFIG_MTD_CFI=y |
295 | # CONFIG_MTD_JEDECPROBE is not set | 345 | CONFIG_MTD_JEDECPROBE=y |
296 | CONFIG_MTD_MAP_BANK_WIDTH_1=y | 346 | CONFIG_MTD_GEN_PROBE=y |
297 | CONFIG_MTD_MAP_BANK_WIDTH_2=y | 347 | CONFIG_MTD_CFI_ADV_OPTIONS=y |
348 | CONFIG_MTD_CFI_NOSWAP=y | ||
349 | # CONFIG_MTD_CFI_BE_BYTE_SWAP is not set | ||
350 | # CONFIG_MTD_CFI_LE_BYTE_SWAP is not set | ||
351 | CONFIG_MTD_CFI_GEOMETRY=y | ||
352 | # CONFIG_MTD_MAP_BANK_WIDTH_1 is not set | ||
353 | # CONFIG_MTD_MAP_BANK_WIDTH_2 is not set | ||
298 | CONFIG_MTD_MAP_BANK_WIDTH_4=y | 354 | CONFIG_MTD_MAP_BANK_WIDTH_4=y |
299 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | 355 | # CONFIG_MTD_MAP_BANK_WIDTH_8 is not set |
300 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | 356 | # CONFIG_MTD_MAP_BANK_WIDTH_16 is not set |
301 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | 357 | # CONFIG_MTD_MAP_BANK_WIDTH_32 is not set |
302 | CONFIG_MTD_CFI_I1=y | 358 | # CONFIG_MTD_CFI_I1 is not set |
303 | CONFIG_MTD_CFI_I2=y | 359 | # CONFIG_MTD_CFI_I2 is not set |
304 | # CONFIG_MTD_CFI_I4 is not set | 360 | CONFIG_MTD_CFI_I4=y |
305 | # CONFIG_MTD_CFI_I8 is not set | 361 | # CONFIG_MTD_CFI_I8 is not set |
362 | # CONFIG_MTD_OTP is not set | ||
363 | CONFIG_MTD_CFI_INTELEXT=y | ||
364 | # CONFIG_MTD_CFI_AMDSTD is not set | ||
365 | # CONFIG_MTD_CFI_STAA is not set | ||
366 | CONFIG_MTD_CFI_UTIL=y | ||
306 | # CONFIG_MTD_RAM is not set | 367 | # CONFIG_MTD_RAM is not set |
307 | # CONFIG_MTD_ROM is not set | 368 | # CONFIG_MTD_ROM is not set |
308 | # CONFIG_MTD_ABSENT is not set | 369 | # CONFIG_MTD_ABSENT is not set |
309 | CONFIG_MTD_OBSOLETE_CHIPS=y | 370 | CONFIG_MTD_OBSOLETE_CHIPS=y |
310 | CONFIG_MTD_SHARP=y | 371 | CONFIG_MTD_SHARP=y |
372 | # CONFIG_MTD_XIP is not set | ||
311 | 373 | ||
312 | # | 374 | # |
313 | # Mapping drivers for chip access | 375 | # Mapping drivers for chip access |
314 | # | 376 | # |
315 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | 377 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set |
378 | # CONFIG_MTD_PHYSMAP is not set | ||
379 | # CONFIG_MTD_ARM_INTEGRATOR is not set | ||
380 | CONFIG_MTD_SA1100=y | ||
381 | # CONFIG_MTD_IMPA7 is not set | ||
316 | # CONFIG_MTD_PLATRAM is not set | 382 | # CONFIG_MTD_PLATRAM is not set |
317 | 383 | ||
318 | # | 384 | # |
@@ -321,7 +387,6 @@ CONFIG_MTD_SHARP=y | |||
321 | # CONFIG_MTD_SLRAM is not set | 387 | # CONFIG_MTD_SLRAM is not set |
322 | # CONFIG_MTD_PHRAM is not set | 388 | # CONFIG_MTD_PHRAM is not set |
323 | # CONFIG_MTD_MTDRAM is not set | 389 | # CONFIG_MTD_MTDRAM is not set |
324 | # CONFIG_MTD_BLKMTD is not set | ||
325 | # CONFIG_MTD_BLOCK2MTD is not set | 390 | # CONFIG_MTD_BLOCK2MTD is not set |
326 | 391 | ||
327 | # | 392 | # |
@@ -337,6 +402,11 @@ CONFIG_MTD_SHARP=y | |||
337 | # CONFIG_MTD_NAND is not set | 402 | # CONFIG_MTD_NAND is not set |
338 | 403 | ||
339 | # | 404 | # |
405 | # OneNAND Flash Device Drivers | ||
406 | # | ||
407 | # CONFIG_MTD_ONENAND is not set | ||
408 | |||
409 | # | ||
340 | # Parallel port support | 410 | # Parallel port support |
341 | # | 411 | # |
342 | # CONFIG_PARPORT is not set | 412 | # CONFIG_PARPORT is not set |
@@ -349,7 +419,6 @@ CONFIG_MTD_SHARP=y | |||
349 | # | 419 | # |
350 | # Block devices | 420 | # Block devices |
351 | # | 421 | # |
352 | # CONFIG_BLK_DEV_XD is not set | ||
353 | # CONFIG_BLK_DEV_COW_COMMON is not set | 422 | # CONFIG_BLK_DEV_COW_COMMON is not set |
354 | CONFIG_BLK_DEV_LOOP=y | 423 | CONFIG_BLK_DEV_LOOP=y |
355 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set | 424 | # CONFIG_BLK_DEV_CRYPTOLOOP is not set |
@@ -359,20 +428,35 @@ CONFIG_BLK_DEV_RAM_COUNT=16 | |||
359 | CONFIG_BLK_DEV_RAM_SIZE=1024 | 428 | CONFIG_BLK_DEV_RAM_SIZE=1024 |
360 | CONFIG_BLK_DEV_INITRD=y | 429 | CONFIG_BLK_DEV_INITRD=y |
361 | # CONFIG_CDROM_PKTCDVD is not set | 430 | # CONFIG_CDROM_PKTCDVD is not set |
431 | # CONFIG_ATA_OVER_ETH is not set | ||
362 | 432 | ||
363 | # | 433 | # |
364 | # IO Schedulers | 434 | # ATA/ATAPI/MFM/RLL support |
365 | # | 435 | # |
366 | CONFIG_IOSCHED_NOOP=y | 436 | CONFIG_IDE=y |
367 | CONFIG_IOSCHED_AS=y | 437 | CONFIG_BLK_DEV_IDE=y |
368 | CONFIG_IOSCHED_DEADLINE=y | ||
369 | CONFIG_IOSCHED_CFQ=y | ||
370 | CONFIG_ATA_OVER_ETH=m | ||
371 | 438 | ||
372 | # | 439 | # |
373 | # ATA/ATAPI/MFM/RLL support | 440 | # Please see Documentation/ide.txt for help/info on IDE drives |
441 | # | ||
442 | # CONFIG_BLK_DEV_IDE_SATA is not set | ||
443 | CONFIG_BLK_DEV_IDEDISK=y | ||
444 | CONFIG_IDEDISK_MULTI_MODE=y | ||
445 | CONFIG_BLK_DEV_IDECS=y | ||
446 | # CONFIG_BLK_DEV_IDECD is not set | ||
447 | # CONFIG_BLK_DEV_IDETAPE is not set | ||
448 | # CONFIG_BLK_DEV_IDEFLOPPY is not set | ||
449 | # CONFIG_IDE_TASK_IOCTL is not set | ||
450 | |||
451 | # | ||
452 | # IDE chipset support/bugfixes | ||
374 | # | 453 | # |
375 | # CONFIG_IDE is not set | 454 | CONFIG_IDE_GENERIC=y |
455 | # CONFIG_IDE_ARM is not set | ||
456 | # CONFIG_IDE_CHIPSETS is not set | ||
457 | # CONFIG_BLK_DEV_IDEDMA is not set | ||
458 | # CONFIG_IDEDMA_AUTO is not set | ||
459 | # CONFIG_BLK_DEV_HD is not set | ||
376 | 460 | ||
377 | # | 461 | # |
378 | # SCSI device support | 462 | # SCSI device support |
@@ -402,6 +486,39 @@ CONFIG_ATA_OVER_ETH=m | |||
402 | # Network device support | 486 | # Network device support |
403 | # | 487 | # |
404 | # CONFIG_NETDEVICES is not set | 488 | # CONFIG_NETDEVICES is not set |
489 | # CONFIG_DUMMY is not set | ||
490 | # CONFIG_BONDING is not set | ||
491 | # CONFIG_EQUALIZER is not set | ||
492 | # CONFIG_TUN is not set | ||
493 | |||
494 | # | ||
495 | # PHY device support | ||
496 | # | ||
497 | |||
498 | # | ||
499 | # Ethernet (10 or 100Mbit) | ||
500 | # | ||
501 | # CONFIG_NET_ETHERNET is not set | ||
502 | |||
503 | # | ||
504 | # Ethernet (1000 Mbit) | ||
505 | # | ||
506 | |||
507 | # | ||
508 | # Ethernet (10000 Mbit) | ||
509 | # | ||
510 | CONFIG_PPP=y | ||
511 | # CONFIG_PPP_MULTILINK is not set | ||
512 | # CONFIG_PPP_FILTER is not set | ||
513 | CONFIG_PPP_ASYNC=y | ||
514 | # CONFIG_PPP_SYNC_TTY is not set | ||
515 | # CONFIG_PPP_DEFLATE is not set | ||
516 | # CONFIG_PPP_BSDCOMP is not set | ||
517 | # CONFIG_PPP_MPPE is not set | ||
518 | # CONFIG_PPPOE is not set | ||
519 | # CONFIG_SLIP is not set | ||
520 | # CONFIG_SHAPER is not set | ||
521 | # CONFIG_NETCONSOLE is not set | ||
405 | # CONFIG_NETPOLL is not set | 522 | # CONFIG_NETPOLL is not set |
406 | # CONFIG_NET_POLL_CONTROLLER is not set | 523 | # CONFIG_NET_POLL_CONTROLLER is not set |
407 | 524 | ||
@@ -424,7 +541,7 @@ CONFIG_INPUT_TSDEV=y | |||
424 | CONFIG_INPUT_TSDEV_SCREEN_X=240 | 541 | CONFIG_INPUT_TSDEV_SCREEN_X=240 |
425 | CONFIG_INPUT_TSDEV_SCREEN_Y=320 | 542 | CONFIG_INPUT_TSDEV_SCREEN_Y=320 |
426 | CONFIG_INPUT_EVDEV=y | 543 | CONFIG_INPUT_EVDEV=y |
427 | CONFIG_INPUT_EVBUG=y | 544 | # CONFIG_INPUT_EVBUG is not set |
428 | 545 | ||
429 | # | 546 | # |
430 | # Input Device Drivers | 547 | # Input Device Drivers |
@@ -438,7 +555,11 @@ CONFIG_KEYBOARD_LOCOMO=y | |||
438 | # CONFIG_KEYBOARD_NEWTON is not set | 555 | # CONFIG_KEYBOARD_NEWTON is not set |
439 | # CONFIG_INPUT_MOUSE is not set | 556 | # CONFIG_INPUT_MOUSE is not set |
440 | # CONFIG_INPUT_JOYSTICK is not set | 557 | # CONFIG_INPUT_JOYSTICK is not set |
441 | # CONFIG_INPUT_TOUCHSCREEN is not set | 558 | CONFIG_INPUT_TOUCHSCREEN=y |
559 | # CONFIG_TOUCHSCREEN_GUNZE is not set | ||
560 | # CONFIG_TOUCHSCREEN_ELO is not set | ||
561 | # CONFIG_TOUCHSCREEN_MTOUCH is not set | ||
562 | # CONFIG_TOUCHSCREEN_MK712 is not set | ||
442 | # CONFIG_INPUT_MISC is not set | 563 | # CONFIG_INPUT_MISC is not set |
443 | 564 | ||
444 | # | 565 | # |
@@ -461,7 +582,16 @@ CONFIG_HW_CONSOLE=y | |||
461 | # | 582 | # |
462 | # Serial drivers | 583 | # Serial drivers |
463 | # | 584 | # |
464 | # CONFIG_SERIAL_8250 is not set | 585 | CONFIG_SERIAL_8250=y |
586 | # CONFIG_SERIAL_8250_CONSOLE is not set | ||
587 | CONFIG_SERIAL_8250_CS=y | ||
588 | CONFIG_SERIAL_8250_NR_UARTS=4 | ||
589 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | ||
590 | CONFIG_SERIAL_8250_EXTENDED=y | ||
591 | # CONFIG_SERIAL_8250_MANY_PORTS is not set | ||
592 | # CONFIG_SERIAL_8250_SHARE_IRQ is not set | ||
593 | # CONFIG_SERIAL_8250_DETECT_IRQ is not set | ||
594 | # CONFIG_SERIAL_8250_RSA is not set | ||
465 | 595 | ||
466 | # | 596 | # |
467 | # Non-8250 serial port support | 597 | # Non-8250 serial port support |
@@ -483,94 +613,48 @@ CONFIG_UNIX98_PTYS=y | |||
483 | # | 613 | # |
484 | # CONFIG_WATCHDOG is not set | 614 | # CONFIG_WATCHDOG is not set |
485 | # CONFIG_NVRAM is not set | 615 | # CONFIG_NVRAM is not set |
486 | # CONFIG_RTC is not set | ||
487 | # CONFIG_DTLK is not set | 616 | # CONFIG_DTLK is not set |
488 | # CONFIG_R3964 is not set | 617 | # CONFIG_R3964 is not set |
489 | 618 | ||
490 | # | 619 | # |
491 | # Ftape, the floppy tape device driver | 620 | # Ftape, the floppy tape device driver |
492 | # | 621 | # |
493 | # CONFIG_RAW_DRIVER is not set | ||
494 | 622 | ||
495 | # | 623 | # |
496 | # TPM devices | 624 | # PCMCIA character devices |
497 | # | 625 | # |
626 | # CONFIG_SYNCLINK_CS is not set | ||
627 | # CONFIG_CARDMAN_4000 is not set | ||
628 | # CONFIG_CARDMAN_4040 is not set | ||
629 | # CONFIG_RAW_DRIVER is not set | ||
498 | 630 | ||
499 | # | 631 | # |
500 | # I2C support | 632 | # TPM devices |
501 | # | 633 | # |
502 | CONFIG_I2C=m | 634 | # CONFIG_TCG_TPM is not set |
503 | # CONFIG_I2C_CHARDEV is not set | 635 | # CONFIG_TELCLOCK is not set |
504 | 636 | ||
505 | # | 637 | # |
506 | # I2C Algorithms | 638 | # I2C support |
507 | # | 639 | # |
508 | CONFIG_I2C_ALGOBIT=m | 640 | # CONFIG_I2C is not set |
509 | # CONFIG_I2C_ALGOPCF is not set | ||
510 | # CONFIG_I2C_ALGOPCA is not set | ||
511 | 641 | ||
512 | # | 642 | # |
513 | # I2C Hardware Bus support | 643 | # SPI support |
514 | # | 644 | # |
515 | # CONFIG_I2C_ELEKTOR is not set | 645 | # CONFIG_SPI is not set |
516 | # CONFIG_I2C_PARPORT_LIGHT is not set | 646 | # CONFIG_SPI_MASTER is not set |
517 | # CONFIG_I2C_STUB is not set | ||
518 | # CONFIG_I2C_PCA_ISA is not set | ||
519 | 647 | ||
520 | # | 648 | # |
521 | # Miscellaneous I2C Chip support | 649 | # Dallas's 1-wire bus |
522 | # | 650 | # |
523 | # CONFIG_SENSORS_DS1337 is not set | 651 | # CONFIG_W1 is not set |
524 | # CONFIG_SENSORS_DS1374 is not set | ||
525 | # CONFIG_SENSORS_EEPROM is not set | ||
526 | # CONFIG_SENSORS_PCF8574 is not set | ||
527 | # CONFIG_SENSORS_PCA9539 is not set | ||
528 | # CONFIG_SENSORS_PCF8591 is not set | ||
529 | # CONFIG_SENSORS_RTC8564 is not set | ||
530 | # CONFIG_SENSORS_MAX6875 is not set | ||
531 | # CONFIG_I2C_DEBUG_CORE is not set | ||
532 | # CONFIG_I2C_DEBUG_ALGO is not set | ||
533 | # CONFIG_I2C_DEBUG_BUS is not set | ||
534 | # CONFIG_I2C_DEBUG_CHIP is not set | ||
535 | 652 | ||
536 | # | 653 | # |
537 | # Hardware Monitoring support | 654 | # Hardware Monitoring support |
538 | # | 655 | # |
539 | CONFIG_HWMON=y | 656 | # CONFIG_HWMON is not set |
540 | # CONFIG_HWMON_VID is not set | 657 | # CONFIG_HWMON_VID is not set |
541 | # CONFIG_SENSORS_ADM1021 is not set | ||
542 | # CONFIG_SENSORS_ADM1025 is not set | ||
543 | # CONFIG_SENSORS_ADM1026 is not set | ||
544 | # CONFIG_SENSORS_ADM1031 is not set | ||
545 | # CONFIG_SENSORS_ADM9240 is not set | ||
546 | # CONFIG_SENSORS_ASB100 is not set | ||
547 | # CONFIG_SENSORS_ATXP1 is not set | ||
548 | # CONFIG_SENSORS_DS1621 is not set | ||
549 | # CONFIG_SENSORS_FSCHER is not set | ||
550 | # CONFIG_SENSORS_FSCPOS is not set | ||
551 | # CONFIG_SENSORS_GL518SM is not set | ||
552 | # CONFIG_SENSORS_GL520SM is not set | ||
553 | # CONFIG_SENSORS_IT87 is not set | ||
554 | # CONFIG_SENSORS_LM63 is not set | ||
555 | # CONFIG_SENSORS_LM75 is not set | ||
556 | # CONFIG_SENSORS_LM77 is not set | ||
557 | # CONFIG_SENSORS_LM78 is not set | ||
558 | # CONFIG_SENSORS_LM80 is not set | ||
559 | # CONFIG_SENSORS_LM83 is not set | ||
560 | # CONFIG_SENSORS_LM85 is not set | ||
561 | # CONFIG_SENSORS_LM87 is not set | ||
562 | # CONFIG_SENSORS_LM90 is not set | ||
563 | # CONFIG_SENSORS_LM92 is not set | ||
564 | # CONFIG_SENSORS_MAX1619 is not set | ||
565 | # CONFIG_SENSORS_PC87360 is not set | ||
566 | # CONFIG_SENSORS_SMSC47M1 is not set | ||
567 | # CONFIG_SENSORS_SMSC47B397 is not set | ||
568 | # CONFIG_SENSORS_W83781D is not set | ||
569 | # CONFIG_SENSORS_W83792D is not set | ||
570 | # CONFIG_SENSORS_W83L785TS is not set | ||
571 | # CONFIG_SENSORS_W83627HF is not set | ||
572 | # CONFIG_SENSORS_W83627EHF is not set | ||
573 | # CONFIG_HWMON_DEBUG_CHIP is not set | ||
574 | 658 | ||
575 | # | 659 | # |
576 | # Misc devices | 660 | # Misc devices |
@@ -579,42 +663,33 @@ CONFIG_HWMON=y | |||
579 | # | 663 | # |
580 | # Multimedia Capabilities Port drivers | 664 | # Multimedia Capabilities Port drivers |
581 | # | 665 | # |
582 | # CONFIG_MCP_SA11X0 is not set | 666 | CONFIG_MCP=y |
667 | CONFIG_MCP_SA11X0=y | ||
668 | CONFIG_MCP_UCB1200=y | ||
669 | CONFIG_MCP_UCB1200_TS=y | ||
583 | 670 | ||
584 | # | 671 | # |
585 | # Multimedia devices | 672 | # LED devices |
586 | # | 673 | # |
587 | CONFIG_VIDEO_DEV=m | 674 | CONFIG_NEW_LEDS=y |
675 | CONFIG_LEDS_CLASS=y | ||
588 | 676 | ||
589 | # | 677 | # |
590 | # Video For Linux | 678 | # LED drivers |
591 | # | 679 | # |
680 | CONFIG_LEDS_LOCOMO=y | ||
592 | 681 | ||
593 | # | 682 | # |
594 | # Video Adapters | 683 | # LED Triggers |
595 | # | 684 | # |
596 | # CONFIG_VIDEO_PMS is not set | 685 | CONFIG_LEDS_TRIGGERS=y |
597 | # CONFIG_VIDEO_CPIA is not set | 686 | CONFIG_LEDS_TRIGGER_TIMER=y |
598 | # CONFIG_VIDEO_SAA5246A is not set | 687 | CONFIG_LEDS_TRIGGER_IDE_DISK=y |
599 | # CONFIG_VIDEO_SAA5249 is not set | ||
600 | # CONFIG_TUNER_3036 is not set | ||
601 | # CONFIG_VIDEO_OVCAMCHIP is not set | ||
602 | 688 | ||
603 | # | 689 | # |
604 | # Radio Adapters | 690 | # Multimedia devices |
605 | # | 691 | # |
606 | # CONFIG_RADIO_CADET is not set | 692 | # CONFIG_VIDEO_DEV is not set |
607 | # CONFIG_RADIO_RTRACK is not set | ||
608 | # CONFIG_RADIO_RTRACK2 is not set | ||
609 | # CONFIG_RADIO_AZTECH is not set | ||
610 | # CONFIG_RADIO_GEMTEK is not set | ||
611 | # CONFIG_RADIO_MAESTRO is not set | ||
612 | # CONFIG_RADIO_SF16FMI is not set | ||
613 | # CONFIG_RADIO_SF16FMR2 is not set | ||
614 | # CONFIG_RADIO_TERRATEC is not set | ||
615 | # CONFIG_RADIO_TRUST is not set | ||
616 | # CONFIG_RADIO_TYPHOON is not set | ||
617 | # CONFIG_RADIO_ZOLTRIX is not set | ||
618 | 693 | ||
619 | # | 694 | # |
620 | # Digital Video Broadcasting Devices | 695 | # Digital Video Broadcasting Devices |
@@ -628,8 +703,8 @@ CONFIG_FB=y | |||
628 | CONFIG_FB_CFB_FILLRECT=y | 703 | CONFIG_FB_CFB_FILLRECT=y |
629 | CONFIG_FB_CFB_COPYAREA=y | 704 | CONFIG_FB_CFB_COPYAREA=y |
630 | CONFIG_FB_CFB_IMAGEBLIT=y | 705 | CONFIG_FB_CFB_IMAGEBLIT=y |
631 | CONFIG_FB_SOFT_CURSOR=y | ||
632 | # CONFIG_FB_MACMODES is not set | 706 | # CONFIG_FB_MACMODES is not set |
707 | # CONFIG_FB_FIRMWARE_EDID is not set | ||
633 | CONFIG_FB_MODE_HELPERS=y | 708 | CONFIG_FB_MODE_HELPERS=y |
634 | # CONFIG_FB_TILEBLITTING is not set | 709 | # CONFIG_FB_TILEBLITTING is not set |
635 | CONFIG_FB_SA1100=y | 710 | CONFIG_FB_SA1100=y |
@@ -643,14 +718,15 @@ CONFIG_FB_SA1100=y | |||
643 | # CONFIG_MDA_CONSOLE is not set | 718 | # CONFIG_MDA_CONSOLE is not set |
644 | CONFIG_DUMMY_CONSOLE=y | 719 | CONFIG_DUMMY_CONSOLE=y |
645 | CONFIG_FRAMEBUFFER_CONSOLE=y | 720 | CONFIG_FRAMEBUFFER_CONSOLE=y |
721 | CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y | ||
646 | CONFIG_FONTS=y | 722 | CONFIG_FONTS=y |
647 | CONFIG_FONT_8x8=y | 723 | # CONFIG_FONT_8x8 is not set |
648 | # CONFIG_FONT_8x16 is not set | 724 | # CONFIG_FONT_8x16 is not set |
649 | # CONFIG_FONT_6x11 is not set | 725 | # CONFIG_FONT_6x11 is not set |
650 | # CONFIG_FONT_7x14 is not set | 726 | # CONFIG_FONT_7x14 is not set |
651 | # CONFIG_FONT_PEARL_8x8 is not set | 727 | # CONFIG_FONT_PEARL_8x8 is not set |
652 | # CONFIG_FONT_ACORN_8x8 is not set | 728 | # CONFIG_FONT_ACORN_8x8 is not set |
653 | # CONFIG_FONT_MINI_4x6 is not set | 729 | CONFIG_FONT_MINI_4x6=y |
654 | # CONFIG_FONT_SUN8x16 is not set | 730 | # CONFIG_FONT_SUN8x16 is not set |
655 | # CONFIG_FONT_SUN12x22 is not set | 731 | # CONFIG_FONT_SUN12x22 is not set |
656 | # CONFIG_FONT_10x18 is not set | 732 | # CONFIG_FONT_10x18 is not set |
@@ -659,7 +735,11 @@ CONFIG_FONT_8x8=y | |||
659 | # Logo configuration | 735 | # Logo configuration |
660 | # | 736 | # |
661 | # CONFIG_LOGO is not set | 737 | # CONFIG_LOGO is not set |
662 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | 738 | CONFIG_BACKLIGHT_LCD_SUPPORT=y |
739 | CONFIG_BACKLIGHT_CLASS_DEVICE=y | ||
740 | CONFIG_BACKLIGHT_DEVICE=y | ||
741 | CONFIG_LCD_CLASS_DEVICE=y | ||
742 | CONFIG_LCD_DEVICE=y | ||
663 | 743 | ||
664 | # | 744 | # |
665 | # Sound | 745 | # Sound |
@@ -671,20 +751,17 @@ CONFIG_FONT_8x8=y | |||
671 | # | 751 | # |
672 | CONFIG_USB_ARCH_HAS_HCD=y | 752 | CONFIG_USB_ARCH_HAS_HCD=y |
673 | # CONFIG_USB_ARCH_HAS_OHCI is not set | 753 | # CONFIG_USB_ARCH_HAS_OHCI is not set |
754 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
674 | # CONFIG_USB is not set | 755 | # CONFIG_USB is not set |
675 | 756 | ||
676 | # | 757 | # |
758 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
759 | # | ||
760 | |||
761 | # | ||
677 | # USB Gadget Support | 762 | # USB Gadget Support |
678 | # | 763 | # |
679 | CONFIG_USB_GADGET=y | 764 | # CONFIG_USB_GADGET is not set |
680 | # CONFIG_USB_GADGET_DEBUG_FILES is not set | ||
681 | # CONFIG_USB_GADGET_NET2280 is not set | ||
682 | # CONFIG_USB_GADGET_PXA2XX is not set | ||
683 | # CONFIG_USB_GADGET_GOKU is not set | ||
684 | # CONFIG_USB_GADGET_LH7A40X is not set | ||
685 | # CONFIG_USB_GADGET_OMAP is not set | ||
686 | # CONFIG_USB_GADGET_DUMMY_HCD is not set | ||
687 | # CONFIG_USB_GADGET_DUALSPEED is not set | ||
688 | 765 | ||
689 | # | 766 | # |
690 | # MMC/SD Card support | 767 | # MMC/SD Card support |
@@ -692,23 +769,24 @@ CONFIG_USB_GADGET=y | |||
692 | # CONFIG_MMC is not set | 769 | # CONFIG_MMC is not set |
693 | 770 | ||
694 | # | 771 | # |
772 | # Real Time Clock | ||
773 | # | ||
774 | CONFIG_RTC_LIB=y | ||
775 | # CONFIG_RTC_CLASS is not set | ||
776 | |||
777 | # | ||
695 | # File systems | 778 | # File systems |
696 | # | 779 | # |
697 | CONFIG_EXT2_FS=y | 780 | # CONFIG_EXT2_FS is not set |
698 | CONFIG_EXT2_FS_XATTR=y | ||
699 | CONFIG_EXT2_FS_POSIX_ACL=y | ||
700 | CONFIG_EXT2_FS_SECURITY=y | ||
701 | # CONFIG_EXT2_FS_XIP is not set | ||
702 | # CONFIG_EXT3_FS is not set | 781 | # CONFIG_EXT3_FS is not set |
703 | # CONFIG_JBD is not set | ||
704 | CONFIG_FS_MBCACHE=y | ||
705 | # CONFIG_REISERFS_FS is not set | 782 | # CONFIG_REISERFS_FS is not set |
706 | # CONFIG_JFS_FS is not set | 783 | # CONFIG_JFS_FS is not set |
707 | CONFIG_FS_POSIX_ACL=y | 784 | # CONFIG_FS_POSIX_ACL is not set |
708 | # CONFIG_XFS_FS is not set | 785 | # CONFIG_XFS_FS is not set |
786 | # CONFIG_OCFS2_FS is not set | ||
709 | # CONFIG_MINIX_FS is not set | 787 | # CONFIG_MINIX_FS is not set |
710 | CONFIG_ROMFS_FS=y | 788 | CONFIG_ROMFS_FS=y |
711 | CONFIG_INOTIFY=y | 789 | # CONFIG_INOTIFY is not set |
712 | # CONFIG_QUOTA is not set | 790 | # CONFIG_QUOTA is not set |
713 | # CONFIG_DNOTIFY is not set | 791 | # CONFIG_DNOTIFY is not set |
714 | # CONFIG_AUTOFS_FS is not set | 792 | # CONFIG_AUTOFS_FS is not set |
@@ -725,7 +803,7 @@ CONFIG_INOTIFY=y | |||
725 | # DOS/FAT/NT Filesystems | 803 | # DOS/FAT/NT Filesystems |
726 | # | 804 | # |
727 | CONFIG_FAT_FS=y | 805 | CONFIG_FAT_FS=y |
728 | CONFIG_MSDOS_FS=y | 806 | # CONFIG_MSDOS_FS is not set |
729 | CONFIG_VFAT_FS=y | 807 | CONFIG_VFAT_FS=y |
730 | CONFIG_FAT_DEFAULT_CODEPAGE=437 | 808 | CONFIG_FAT_DEFAULT_CODEPAGE=437 |
731 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | 809 | CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" |
@@ -739,7 +817,7 @@ CONFIG_SYSFS=y | |||
739 | CONFIG_TMPFS=y | 817 | CONFIG_TMPFS=y |
740 | # CONFIG_HUGETLB_PAGE is not set | 818 | # CONFIG_HUGETLB_PAGE is not set |
741 | CONFIG_RAMFS=y | 819 | CONFIG_RAMFS=y |
742 | # CONFIG_RELAYFS_FS is not set | 820 | # CONFIG_CONFIGFS_FS is not set |
743 | 821 | ||
744 | # | 822 | # |
745 | # Miscellaneous filesystems | 823 | # Miscellaneous filesystems |
@@ -755,11 +833,12 @@ CONFIG_RAMFS=y | |||
755 | CONFIG_JFFS2_FS=y | 833 | CONFIG_JFFS2_FS=y |
756 | CONFIG_JFFS2_FS_DEBUG=0 | 834 | CONFIG_JFFS2_FS_DEBUG=0 |
757 | CONFIG_JFFS2_FS_WRITEBUFFER=y | 835 | CONFIG_JFFS2_FS_WRITEBUFFER=y |
836 | # CONFIG_JFFS2_SUMMARY is not set | ||
758 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | 837 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set |
759 | CONFIG_JFFS2_ZLIB=y | 838 | CONFIG_JFFS2_ZLIB=y |
760 | CONFIG_JFFS2_RTIME=y | 839 | CONFIG_JFFS2_RTIME=y |
761 | # CONFIG_JFFS2_RUBIN is not set | 840 | # CONFIG_JFFS2_RUBIN is not set |
762 | CONFIG_CRAMFS=y | 841 | # CONFIG_CRAMFS is not set |
763 | # CONFIG_VXFS_FS is not set | 842 | # CONFIG_VXFS_FS is not set |
764 | # CONFIG_HPFS_FS is not set | 843 | # CONFIG_HPFS_FS is not set |
765 | # CONFIG_QNX4FS_FS is not set | 844 | # CONFIG_QNX4FS_FS is not set |
@@ -789,7 +868,7 @@ CONFIG_MSDOS_PARTITION=y | |||
789 | # | 868 | # |
790 | CONFIG_NLS=y | 869 | CONFIG_NLS=y |
791 | CONFIG_NLS_DEFAULT="cp437" | 870 | CONFIG_NLS_DEFAULT="cp437" |
792 | CONFIG_NLS_CODEPAGE_437=m | 871 | CONFIG_NLS_CODEPAGE_437=y |
793 | # CONFIG_NLS_CODEPAGE_737 is not set | 872 | # CONFIG_NLS_CODEPAGE_737 is not set |
794 | # CONFIG_NLS_CODEPAGE_775 is not set | 873 | # CONFIG_NLS_CODEPAGE_775 is not set |
795 | # CONFIG_NLS_CODEPAGE_850 is not set | 874 | # CONFIG_NLS_CODEPAGE_850 is not set |
@@ -813,7 +892,7 @@ CONFIG_NLS_CODEPAGE_437=m | |||
813 | # CONFIG_NLS_CODEPAGE_1250 is not set | 892 | # CONFIG_NLS_CODEPAGE_1250 is not set |
814 | # CONFIG_NLS_CODEPAGE_1251 is not set | 893 | # CONFIG_NLS_CODEPAGE_1251 is not set |
815 | # CONFIG_NLS_ASCII is not set | 894 | # CONFIG_NLS_ASCII is not set |
816 | CONFIG_NLS_ISO8859_1=m | 895 | CONFIG_NLS_ISO8859_1=y |
817 | # CONFIG_NLS_ISO8859_2 is not set | 896 | # CONFIG_NLS_ISO8859_2 is not set |
818 | # CONFIG_NLS_ISO8859_3 is not set | 897 | # CONFIG_NLS_ISO8859_3 is not set |
819 | # CONFIG_NLS_ISO8859_4 is not set | 898 | # CONFIG_NLS_ISO8859_4 is not set |
@@ -826,7 +905,7 @@ CONFIG_NLS_ISO8859_1=m | |||
826 | # CONFIG_NLS_ISO8859_15 is not set | 905 | # CONFIG_NLS_ISO8859_15 is not set |
827 | # CONFIG_NLS_KOI8_R is not set | 906 | # CONFIG_NLS_KOI8_R is not set |
828 | # CONFIG_NLS_KOI8_U is not set | 907 | # CONFIG_NLS_KOI8_U is not set |
829 | CONFIG_NLS_UTF8=m | 908 | # CONFIG_NLS_UTF8 is not set |
830 | 909 | ||
831 | # | 910 | # |
832 | # Profiling support | 911 | # Profiling support |
@@ -837,20 +916,23 @@ CONFIG_NLS_UTF8=m | |||
837 | # Kernel hacking | 916 | # Kernel hacking |
838 | # | 917 | # |
839 | # CONFIG_PRINTK_TIME is not set | 918 | # CONFIG_PRINTK_TIME is not set |
840 | CONFIG_DEBUG_KERNEL=y | ||
841 | CONFIG_MAGIC_SYSRQ=y | 919 | CONFIG_MAGIC_SYSRQ=y |
920 | CONFIG_DEBUG_KERNEL=y | ||
842 | CONFIG_LOG_BUF_SHIFT=14 | 921 | CONFIG_LOG_BUF_SHIFT=14 |
843 | CONFIG_DETECT_SOFTLOCKUP=y | 922 | # CONFIG_DETECT_SOFTLOCKUP is not set |
844 | # CONFIG_SCHEDSTATS is not set | 923 | # CONFIG_SCHEDSTATS is not set |
845 | # CONFIG_DEBUG_SLAB is not set | 924 | CONFIG_DEBUG_MUTEXES=y |
846 | CONFIG_DEBUG_PREEMPT=y | ||
847 | # CONFIG_DEBUG_SPINLOCK is not set | 925 | # CONFIG_DEBUG_SPINLOCK is not set |
848 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 926 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
849 | # CONFIG_DEBUG_KOBJECT is not set | 927 | # CONFIG_DEBUG_KOBJECT is not set |
850 | # CONFIG_DEBUG_BUGVERBOSE is not set | 928 | # CONFIG_DEBUG_BUGVERBOSE is not set |
851 | # CONFIG_DEBUG_INFO is not set | 929 | # CONFIG_DEBUG_INFO is not set |
852 | # CONFIG_DEBUG_FS is not set | 930 | # CONFIG_DEBUG_FS is not set |
931 | # CONFIG_DEBUG_VM is not set | ||
853 | CONFIG_FRAME_POINTER=y | 932 | CONFIG_FRAME_POINTER=y |
933 | # CONFIG_UNWIND_INFO is not set | ||
934 | CONFIG_FORCED_INLINING=y | ||
935 | # CONFIG_RCU_TORTURE_TEST is not set | ||
854 | # CONFIG_DEBUG_USER is not set | 936 | # CONFIG_DEBUG_USER is not set |
855 | # CONFIG_DEBUG_WAITQ is not set | 937 | # CONFIG_DEBUG_WAITQ is not set |
856 | CONFIG_DEBUG_ERRORS=y | 938 | CONFIG_DEBUG_ERRORS=y |
@@ -874,7 +956,7 @@ CONFIG_DEBUG_ERRORS=y | |||
874 | # | 956 | # |
875 | # Library routines | 957 | # Library routines |
876 | # | 958 | # |
877 | # CONFIG_CRC_CCITT is not set | 959 | CONFIG_CRC_CCITT=y |
878 | # CONFIG_CRC16 is not set | 960 | # CONFIG_CRC16 is not set |
879 | CONFIG_CRC32=y | 961 | CONFIG_CRC32=y |
880 | # CONFIG_LIBCRC32C is not set | 962 | # CONFIG_LIBCRC32C is not set |
diff --git a/arch/arm/configs/versatile_defconfig b/arch/arm/configs/versatile_defconfig index 2687a225aa6a..96b7a7762426 100644 --- a/arch/arm/configs/versatile_defconfig +++ b/arch/arm/configs/versatile_defconfig | |||
@@ -1,50 +1,55 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.12-rc1-bk2 | 3 | # Linux kernel version: 2.6.17-rc3 |
4 | # Mon Mar 28 00:20:50 2005 | 4 | # Mon May 8 20:15:57 2006 |
5 | # | 5 | # |
6 | CONFIG_ARM=y | 6 | CONFIG_ARM=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
8 | CONFIG_UID16=y | ||
9 | CONFIG_RWSEM_GENERIC_SPINLOCK=y | 8 | CONFIG_RWSEM_GENERIC_SPINLOCK=y |
9 | CONFIG_GENERIC_HWEIGHT=y | ||
10 | CONFIG_GENERIC_CALIBRATE_DELAY=y | 10 | CONFIG_GENERIC_CALIBRATE_DELAY=y |
11 | CONFIG_GENERIC_IOMAP=y | 11 | CONFIG_VECTORS_BASE=0xffff0000 |
12 | 12 | ||
13 | # | 13 | # |
14 | # Code maturity level options | 14 | # Code maturity level options |
15 | # | 15 | # |
16 | CONFIG_EXPERIMENTAL=y | 16 | CONFIG_EXPERIMENTAL=y |
17 | CONFIG_CLEAN_COMPILE=y | ||
18 | CONFIG_BROKEN_ON_SMP=y | 17 | CONFIG_BROKEN_ON_SMP=y |
18 | CONFIG_INIT_ENV_ARG_LIMIT=32 | ||
19 | 19 | ||
20 | # | 20 | # |
21 | # General setup | 21 | # General setup |
22 | # | 22 | # |
23 | CONFIG_LOCALVERSION="" | 23 | CONFIG_LOCALVERSION="" |
24 | # CONFIG_LOCALVERSION_AUTO is not set | ||
24 | CONFIG_SWAP=y | 25 | CONFIG_SWAP=y |
25 | CONFIG_SYSVIPC=y | 26 | CONFIG_SYSVIPC=y |
26 | # CONFIG_POSIX_MQUEUE is not set | 27 | # CONFIG_POSIX_MQUEUE is not set |
27 | # CONFIG_BSD_PROCESS_ACCT is not set | 28 | # CONFIG_BSD_PROCESS_ACCT is not set |
28 | CONFIG_SYSCTL=y | 29 | CONFIG_SYSCTL=y |
29 | # CONFIG_AUDIT is not set | 30 | # CONFIG_AUDIT is not set |
30 | CONFIG_HOTPLUG=y | ||
31 | CONFIG_KOBJECT_UEVENT=y | ||
32 | # CONFIG_IKCONFIG is not set | 31 | # CONFIG_IKCONFIG is not set |
32 | # CONFIG_RELAY is not set | ||
33 | CONFIG_INITRAMFS_SOURCE="" | ||
34 | CONFIG_UID16=y | ||
35 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
33 | # CONFIG_EMBEDDED is not set | 36 | # CONFIG_EMBEDDED is not set |
34 | CONFIG_KALLSYMS=y | 37 | CONFIG_KALLSYMS=y |
35 | # CONFIG_KALLSYMS_ALL is not set | 38 | # CONFIG_KALLSYMS_ALL is not set |
36 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 39 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
40 | CONFIG_HOTPLUG=y | ||
41 | CONFIG_PRINTK=y | ||
42 | CONFIG_BUG=y | ||
43 | CONFIG_ELF_CORE=y | ||
37 | CONFIG_BASE_FULL=y | 44 | CONFIG_BASE_FULL=y |
38 | CONFIG_FUTEX=y | 45 | CONFIG_FUTEX=y |
39 | CONFIG_EPOLL=y | 46 | CONFIG_EPOLL=y |
40 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | ||
41 | CONFIG_SHMEM=y | 47 | CONFIG_SHMEM=y |
42 | CONFIG_CC_ALIGN_FUNCTIONS=0 | 48 | CONFIG_SLAB=y |
43 | CONFIG_CC_ALIGN_LABELS=0 | ||
44 | CONFIG_CC_ALIGN_LOOPS=0 | ||
45 | CONFIG_CC_ALIGN_JUMPS=0 | ||
46 | # CONFIG_TINY_SHMEM is not set | 49 | # CONFIG_TINY_SHMEM is not set |
47 | CONFIG_BASE_SMALL=0 | 50 | CONFIG_BASE_SMALL=0 |
51 | # CONFIG_SLOB is not set | ||
52 | CONFIG_OBSOLETE_INTERMODULE=y | ||
48 | 53 | ||
49 | # | 54 | # |
50 | # Loadable module support | 55 | # Loadable module support |
@@ -52,23 +57,42 @@ CONFIG_BASE_SMALL=0 | |||
52 | CONFIG_MODULES=y | 57 | CONFIG_MODULES=y |
53 | CONFIG_MODULE_UNLOAD=y | 58 | CONFIG_MODULE_UNLOAD=y |
54 | # CONFIG_MODULE_FORCE_UNLOAD is not set | 59 | # CONFIG_MODULE_FORCE_UNLOAD is not set |
55 | CONFIG_OBSOLETE_MODPARM=y | ||
56 | # CONFIG_MODVERSIONS is not set | 60 | # CONFIG_MODVERSIONS is not set |
57 | # CONFIG_MODULE_SRCVERSION_ALL is not set | 61 | # CONFIG_MODULE_SRCVERSION_ALL is not set |
58 | CONFIG_KMOD=y | 62 | CONFIG_KMOD=y |
59 | 63 | ||
60 | # | 64 | # |
65 | # Block layer | ||
66 | # | ||
67 | # CONFIG_BLK_DEV_IO_TRACE is not set | ||
68 | |||
69 | # | ||
70 | # IO Schedulers | ||
71 | # | ||
72 | CONFIG_IOSCHED_NOOP=y | ||
73 | CONFIG_IOSCHED_AS=y | ||
74 | CONFIG_IOSCHED_DEADLINE=y | ||
75 | CONFIG_IOSCHED_CFQ=y | ||
76 | CONFIG_DEFAULT_AS=y | ||
77 | # CONFIG_DEFAULT_DEADLINE is not set | ||
78 | # CONFIG_DEFAULT_CFQ is not set | ||
79 | # CONFIG_DEFAULT_NOOP is not set | ||
80 | CONFIG_DEFAULT_IOSCHED="anticipatory" | ||
81 | |||
82 | # | ||
61 | # System Type | 83 | # System Type |
62 | # | 84 | # |
63 | # CONFIG_ARCH_CLPS7500 is not set | 85 | # CONFIG_ARCH_CLPS7500 is not set |
64 | # CONFIG_ARCH_CLPS711X is not set | 86 | # CONFIG_ARCH_CLPS711X is not set |
65 | # CONFIG_ARCH_CO285 is not set | 87 | # CONFIG_ARCH_CO285 is not set |
66 | # CONFIG_ARCH_EBSA110 is not set | 88 | # CONFIG_ARCH_EBSA110 is not set |
89 | # CONFIG_ARCH_EP93XX is not set | ||
67 | # CONFIG_ARCH_FOOTBRIDGE is not set | 90 | # CONFIG_ARCH_FOOTBRIDGE is not set |
68 | # CONFIG_ARCH_INTEGRATOR is not set | 91 | # CONFIG_ARCH_INTEGRATOR is not set |
69 | # CONFIG_ARCH_IOP3XX is not set | 92 | # CONFIG_ARCH_IOP3XX is not set |
70 | # CONFIG_ARCH_IXP4XX is not set | 93 | # CONFIG_ARCH_IXP4XX is not set |
71 | # CONFIG_ARCH_IXP2000 is not set | 94 | # CONFIG_ARCH_IXP2000 is not set |
95 | # CONFIG_ARCH_IXP23XX is not set | ||
72 | # CONFIG_ARCH_L7200 is not set | 96 | # CONFIG_ARCH_L7200 is not set |
73 | # CONFIG_ARCH_PXA is not set | 97 | # CONFIG_ARCH_PXA is not set |
74 | # CONFIG_ARCH_RPC is not set | 98 | # CONFIG_ARCH_RPC is not set |
@@ -78,14 +102,17 @@ CONFIG_KMOD=y | |||
78 | # CONFIG_ARCH_LH7A40X is not set | 102 | # CONFIG_ARCH_LH7A40X is not set |
79 | # CONFIG_ARCH_OMAP is not set | 103 | # CONFIG_ARCH_OMAP is not set |
80 | CONFIG_ARCH_VERSATILE=y | 104 | CONFIG_ARCH_VERSATILE=y |
105 | # CONFIG_ARCH_REALVIEW is not set | ||
81 | # CONFIG_ARCH_IMX is not set | 106 | # CONFIG_ARCH_IMX is not set |
82 | # CONFIG_ARCH_H720X is not set | 107 | # CONFIG_ARCH_H720X is not set |
108 | # CONFIG_ARCH_AAEC2000 is not set | ||
109 | # CONFIG_ARCH_AT91RM9200 is not set | ||
83 | 110 | ||
84 | # | 111 | # |
85 | # Versatile platform type | 112 | # Versatile platform type |
86 | # | 113 | # |
87 | CONFIG_ARCH_VERSATILE_PB=y | 114 | CONFIG_ARCH_VERSATILE_PB=y |
88 | # CONFIG_MACH_VERSATILE_AB is not set | 115 | CONFIG_MACH_VERSATILE_AB=y |
89 | 116 | ||
90 | # | 117 | # |
91 | # Processor Type | 118 | # Processor Type |
@@ -106,12 +133,14 @@ CONFIG_ARM_THUMB=y | |||
106 | # CONFIG_CPU_DCACHE_DISABLE is not set | 133 | # CONFIG_CPU_DCACHE_DISABLE is not set |
107 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set | 134 | # CONFIG_CPU_DCACHE_WRITETHROUGH is not set |
108 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set | 135 | # CONFIG_CPU_CACHE_ROUND_ROBIN is not set |
136 | CONFIG_ARM_VIC=y | ||
109 | CONFIG_ICST307=y | 137 | CONFIG_ICST307=y |
110 | 138 | ||
111 | # | 139 | # |
112 | # Bus support | 140 | # Bus support |
113 | # | 141 | # |
114 | CONFIG_ARM_AMBA=y | 142 | CONFIG_ARM_AMBA=y |
143 | # CONFIG_PCI is not set | ||
115 | 144 | ||
116 | # | 145 | # |
117 | # PCCARD (PCMCIA/CardBus) support | 146 | # PCCARD (PCMCIA/CardBus) support |
@@ -122,6 +151,18 @@ CONFIG_ARM_AMBA=y | |||
122 | # Kernel Features | 151 | # Kernel Features |
123 | # | 152 | # |
124 | # CONFIG_PREEMPT is not set | 153 | # CONFIG_PREEMPT is not set |
154 | # CONFIG_NO_IDLE_HZ is not set | ||
155 | CONFIG_HZ=100 | ||
156 | # CONFIG_AEABI is not set | ||
157 | # CONFIG_ARCH_DISCONTIGMEM_ENABLE is not set | ||
158 | CONFIG_SELECT_MEMORY_MODEL=y | ||
159 | CONFIG_FLATMEM_MANUAL=y | ||
160 | # CONFIG_DISCONTIGMEM_MANUAL is not set | ||
161 | # CONFIG_SPARSEMEM_MANUAL is not set | ||
162 | CONFIG_FLATMEM=y | ||
163 | CONFIG_FLAT_NODE_MEM_MAP=y | ||
164 | # CONFIG_SPARSEMEM_STATIC is not set | ||
165 | CONFIG_SPLIT_PTLOCK_CPUS=4096 | ||
125 | CONFIG_LEDS=y | 166 | CONFIG_LEDS=y |
126 | CONFIG_LEDS_TIMER=y | 167 | CONFIG_LEDS_TIMER=y |
127 | CONFIG_LEDS_CPU=y | 168 | CONFIG_LEDS_CPU=y |
@@ -145,7 +186,7 @@ CONFIG_CMDLINE="root=1f03 mem=32M" | |||
145 | CONFIG_FPE_NWFPE=y | 186 | CONFIG_FPE_NWFPE=y |
146 | # CONFIG_FPE_NWFPE_XP is not set | 187 | # CONFIG_FPE_NWFPE_XP is not set |
147 | # CONFIG_FPE_FASTFPE is not set | 188 | # CONFIG_FPE_FASTFPE is not set |
148 | # CONFIG_VFP is not set | 189 | CONFIG_VFP=y |
149 | 190 | ||
150 | # | 191 | # |
151 | # Userspace binary formats | 192 | # Userspace binary formats |
@@ -159,9 +200,92 @@ CONFIG_BINFMT_ELF=y | |||
159 | # Power management options | 200 | # Power management options |
160 | # | 201 | # |
161 | CONFIG_PM=y | 202 | CONFIG_PM=y |
203 | CONFIG_PM_LEGACY=y | ||
204 | # CONFIG_PM_DEBUG is not set | ||
162 | # CONFIG_APM is not set | 205 | # CONFIG_APM is not set |
163 | 206 | ||
164 | # | 207 | # |
208 | # Networking | ||
209 | # | ||
210 | CONFIG_NET=y | ||
211 | |||
212 | # | ||
213 | # Networking options | ||
214 | # | ||
215 | # CONFIG_NETDEBUG is not set | ||
216 | CONFIG_PACKET=y | ||
217 | CONFIG_PACKET_MMAP=y | ||
218 | CONFIG_UNIX=y | ||
219 | # CONFIG_NET_KEY is not set | ||
220 | CONFIG_INET=y | ||
221 | CONFIG_IP_MULTICAST=y | ||
222 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
223 | CONFIG_IP_FIB_HASH=y | ||
224 | CONFIG_IP_PNP=y | ||
225 | # CONFIG_IP_PNP_DHCP is not set | ||
226 | CONFIG_IP_PNP_BOOTP=y | ||
227 | # CONFIG_IP_PNP_RARP is not set | ||
228 | # CONFIG_NET_IPIP is not set | ||
229 | # CONFIG_NET_IPGRE is not set | ||
230 | # CONFIG_IP_MROUTE is not set | ||
231 | # CONFIG_ARPD is not set | ||
232 | # CONFIG_SYN_COOKIES is not set | ||
233 | # CONFIG_INET_AH is not set | ||
234 | # CONFIG_INET_ESP is not set | ||
235 | # CONFIG_INET_IPCOMP is not set | ||
236 | # CONFIG_INET_XFRM_TUNNEL is not set | ||
237 | # CONFIG_INET_TUNNEL is not set | ||
238 | # CONFIG_INET_DIAG is not set | ||
239 | CONFIG_INET_TCP_DIAG=y | ||
240 | # CONFIG_TCP_CONG_ADVANCED is not set | ||
241 | CONFIG_TCP_CONG_BIC=y | ||
242 | # CONFIG_IPV6 is not set | ||
243 | # CONFIG_INET6_XFRM_TUNNEL is not set | ||
244 | # CONFIG_INET6_TUNNEL is not set | ||
245 | # CONFIG_NETFILTER is not set | ||
246 | |||
247 | # | ||
248 | # DCCP Configuration (EXPERIMENTAL) | ||
249 | # | ||
250 | # CONFIG_IP_DCCP is not set | ||
251 | |||
252 | # | ||
253 | # SCTP Configuration (EXPERIMENTAL) | ||
254 | # | ||
255 | # CONFIG_IP_SCTP is not set | ||
256 | |||
257 | # | ||
258 | # TIPC Configuration (EXPERIMENTAL) | ||
259 | # | ||
260 | # CONFIG_TIPC is not set | ||
261 | # CONFIG_ATM is not set | ||
262 | # CONFIG_BRIDGE is not set | ||
263 | # CONFIG_VLAN_8021Q is not set | ||
264 | # CONFIG_DECNET is not set | ||
265 | # CONFIG_LLC2 is not set | ||
266 | # CONFIG_IPX is not set | ||
267 | # CONFIG_ATALK is not set | ||
268 | # CONFIG_X25 is not set | ||
269 | # CONFIG_LAPB is not set | ||
270 | # CONFIG_NET_DIVERT is not set | ||
271 | # CONFIG_ECONET is not set | ||
272 | # CONFIG_WAN_ROUTER is not set | ||
273 | |||
274 | # | ||
275 | # QoS and/or fair queueing | ||
276 | # | ||
277 | # CONFIG_NET_SCHED is not set | ||
278 | |||
279 | # | ||
280 | # Network testing | ||
281 | # | ||
282 | # CONFIG_NET_PKTGEN is not set | ||
283 | # CONFIG_HAMRADIO is not set | ||
284 | # CONFIG_IRDA is not set | ||
285 | # CONFIG_BT is not set | ||
286 | # CONFIG_IEEE80211 is not set | ||
287 | |||
288 | # | ||
165 | # Device Drivers | 289 | # Device Drivers |
166 | # | 290 | # |
167 | 291 | ||
@@ -174,6 +298,11 @@ CONFIG_PREVENT_FIRMWARE_BUILD=y | |||
174 | # CONFIG_DEBUG_DRIVER is not set | 298 | # CONFIG_DEBUG_DRIVER is not set |
175 | 299 | ||
176 | # | 300 | # |
301 | # Connector - unified userspace <-> kernelspace linker | ||
302 | # | ||
303 | # CONFIG_CONNECTOR is not set | ||
304 | |||
305 | # | ||
177 | # Memory Technology Devices (MTD) | 306 | # Memory Technology Devices (MTD) |
178 | # | 307 | # |
179 | CONFIG_MTD=y | 308 | CONFIG_MTD=y |
@@ -192,6 +321,7 @@ CONFIG_MTD_BLOCK=y | |||
192 | # CONFIG_FTL is not set | 321 | # CONFIG_FTL is not set |
193 | # CONFIG_NFTL is not set | 322 | # CONFIG_NFTL is not set |
194 | # CONFIG_INFTL is not set | 323 | # CONFIG_INFTL is not set |
324 | # CONFIG_RFD_FTL is not set | ||
195 | 325 | ||
196 | # | 326 | # |
197 | # RAM/ROM/Flash chip drivers | 327 | # RAM/ROM/Flash chip drivers |
@@ -214,6 +344,7 @@ CONFIG_MTD_CFI_I1=y | |||
214 | CONFIG_MTD_CFI_I2=y | 344 | CONFIG_MTD_CFI_I2=y |
215 | # CONFIG_MTD_CFI_I4 is not set | 345 | # CONFIG_MTD_CFI_I4 is not set |
216 | # CONFIG_MTD_CFI_I8 is not set | 346 | # CONFIG_MTD_CFI_I8 is not set |
347 | # CONFIG_MTD_OTP is not set | ||
217 | CONFIG_MTD_CFI_INTELEXT=y | 348 | CONFIG_MTD_CFI_INTELEXT=y |
218 | # CONFIG_MTD_CFI_AMDSTD is not set | 349 | # CONFIG_MTD_CFI_AMDSTD is not set |
219 | # CONFIG_MTD_CFI_STAA is not set | 350 | # CONFIG_MTD_CFI_STAA is not set |
@@ -221,7 +352,7 @@ CONFIG_MTD_CFI_UTIL=y | |||
221 | # CONFIG_MTD_RAM is not set | 352 | # CONFIG_MTD_RAM is not set |
222 | # CONFIG_MTD_ROM is not set | 353 | # CONFIG_MTD_ROM is not set |
223 | # CONFIG_MTD_ABSENT is not set | 354 | # CONFIG_MTD_ABSENT is not set |
224 | # CONFIG_MTD_XIP is not set | 355 | # CONFIG_MTD_OBSOLETE_CHIPS is not set |
225 | 356 | ||
226 | # | 357 | # |
227 | # Mapping drivers for chip access | 358 | # Mapping drivers for chip access |
@@ -229,7 +360,7 @@ CONFIG_MTD_CFI_UTIL=y | |||
229 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set | 360 | # CONFIG_MTD_COMPLEX_MAPPINGS is not set |
230 | # CONFIG_MTD_PHYSMAP is not set | 361 | # CONFIG_MTD_PHYSMAP is not set |
231 | CONFIG_MTD_ARM_INTEGRATOR=y | 362 | CONFIG_MTD_ARM_INTEGRATOR=y |
232 | # CONFIG_MTD_EDB7312 is not set | 363 | # CONFIG_MTD_PLATRAM is not set |
233 | 364 | ||
234 | # | 365 | # |
235 | # Self-contained MTD device drivers | 366 | # Self-contained MTD device drivers |
@@ -237,7 +368,6 @@ CONFIG_MTD_ARM_INTEGRATOR=y | |||
237 | # CONFIG_MTD_SLRAM is not set | 368 | # CONFIG_MTD_SLRAM is not set |
238 | # CONFIG_MTD_PHRAM is not set | 369 | # CONFIG_MTD_PHRAM is not set |
239 | # CONFIG_MTD_MTDRAM is not set | 370 | # CONFIG_MTD_MTDRAM is not set |
240 | # CONFIG_MTD_BLKMTD is not set | ||
241 | # CONFIG_MTD_BLOCK2MTD is not set | 371 | # CONFIG_MTD_BLOCK2MTD is not set |
242 | 372 | ||
243 | # | 373 | # |
@@ -253,6 +383,11 @@ CONFIG_MTD_ARM_INTEGRATOR=y | |||
253 | # CONFIG_MTD_NAND is not set | 383 | # CONFIG_MTD_NAND is not set |
254 | 384 | ||
255 | # | 385 | # |
386 | # OneNAND Flash Device Drivers | ||
387 | # | ||
388 | # CONFIG_MTD_ONENAND is not set | ||
389 | |||
390 | # | ||
256 | # Parallel port support | 391 | # Parallel port support |
257 | # | 392 | # |
258 | # CONFIG_PARPORT is not set | 393 | # CONFIG_PARPORT is not set |
@@ -264,7 +399,6 @@ CONFIG_MTD_ARM_INTEGRATOR=y | |||
264 | # | 399 | # |
265 | # Block devices | 400 | # Block devices |
266 | # | 401 | # |
267 | # CONFIG_BLK_DEV_FD is not set | ||
268 | # CONFIG_BLK_DEV_COW_COMMON is not set | 402 | # CONFIG_BLK_DEV_COW_COMMON is not set |
269 | # CONFIG_BLK_DEV_LOOP is not set | 403 | # CONFIG_BLK_DEV_LOOP is not set |
270 | # CONFIG_BLK_DEV_NBD is not set | 404 | # CONFIG_BLK_DEV_NBD is not set |
@@ -272,21 +406,13 @@ CONFIG_BLK_DEV_RAM=y | |||
272 | CONFIG_BLK_DEV_RAM_COUNT=16 | 406 | CONFIG_BLK_DEV_RAM_COUNT=16 |
273 | CONFIG_BLK_DEV_RAM_SIZE=4096 | 407 | CONFIG_BLK_DEV_RAM_SIZE=4096 |
274 | CONFIG_BLK_DEV_INITRD=y | 408 | CONFIG_BLK_DEV_INITRD=y |
275 | CONFIG_INITRAMFS_SOURCE="" | ||
276 | # CONFIG_CDROM_PKTCDVD is not set | 409 | # CONFIG_CDROM_PKTCDVD is not set |
277 | |||
278 | # | ||
279 | # IO Schedulers | ||
280 | # | ||
281 | CONFIG_IOSCHED_NOOP=y | ||
282 | CONFIG_IOSCHED_AS=y | ||
283 | CONFIG_IOSCHED_DEADLINE=y | ||
284 | CONFIG_IOSCHED_CFQ=y | ||
285 | # CONFIG_ATA_OVER_ETH is not set | 410 | # CONFIG_ATA_OVER_ETH is not set |
286 | 411 | ||
287 | # | 412 | # |
288 | # SCSI device support | 413 | # SCSI device support |
289 | # | 414 | # |
415 | # CONFIG_RAID_ATTRS is not set | ||
290 | # CONFIG_SCSI is not set | 416 | # CONFIG_SCSI is not set |
291 | 417 | ||
292 | # | 418 | # |
@@ -297,6 +423,7 @@ CONFIG_IOSCHED_CFQ=y | |||
297 | # | 423 | # |
298 | # Fusion MPT device support | 424 | # Fusion MPT device support |
299 | # | 425 | # |
426 | # CONFIG_FUSION is not set | ||
300 | 427 | ||
301 | # | 428 | # |
302 | # IEEE 1394 (FireWire) support | 429 | # IEEE 1394 (FireWire) support |
@@ -307,71 +434,8 @@ CONFIG_IOSCHED_CFQ=y | |||
307 | # | 434 | # |
308 | 435 | ||
309 | # | 436 | # |
310 | # Networking support | 437 | # Network device support |
311 | # | ||
312 | CONFIG_NET=y | ||
313 | |||
314 | # | ||
315 | # Networking options | ||
316 | # | ||
317 | CONFIG_PACKET=y | ||
318 | CONFIG_PACKET_MMAP=y | ||
319 | # CONFIG_NETLINK_DEV is not set | ||
320 | CONFIG_UNIX=y | ||
321 | # CONFIG_NET_KEY is not set | ||
322 | CONFIG_INET=y | ||
323 | CONFIG_IP_MULTICAST=y | ||
324 | # CONFIG_IP_ADVANCED_ROUTER is not set | ||
325 | CONFIG_IP_PNP=y | ||
326 | # CONFIG_IP_PNP_DHCP is not set | ||
327 | CONFIG_IP_PNP_BOOTP=y | ||
328 | # CONFIG_IP_PNP_RARP is not set | ||
329 | # CONFIG_NET_IPIP is not set | ||
330 | # CONFIG_NET_IPGRE is not set | ||
331 | # CONFIG_IP_MROUTE is not set | ||
332 | # CONFIG_ARPD is not set | ||
333 | # CONFIG_SYN_COOKIES is not set | ||
334 | # CONFIG_INET_AH is not set | ||
335 | # CONFIG_INET_ESP is not set | ||
336 | # CONFIG_INET_IPCOMP is not set | ||
337 | # CONFIG_INET_TUNNEL is not set | ||
338 | # CONFIG_IP_TCPDIAG is not set | ||
339 | # CONFIG_IP_TCPDIAG_IPV6 is not set | ||
340 | # CONFIG_IPV6 is not set | ||
341 | # CONFIG_NETFILTER is not set | ||
342 | |||
343 | # | ||
344 | # SCTP Configuration (EXPERIMENTAL) | ||
345 | # | ||
346 | # CONFIG_IP_SCTP is not set | ||
347 | # CONFIG_ATM is not set | ||
348 | # CONFIG_BRIDGE is not set | ||
349 | # CONFIG_VLAN_8021Q is not set | ||
350 | # CONFIG_DECNET is not set | ||
351 | # CONFIG_LLC2 is not set | ||
352 | # CONFIG_IPX is not set | ||
353 | # CONFIG_ATALK is not set | ||
354 | # CONFIG_X25 is not set | ||
355 | # CONFIG_LAPB is not set | ||
356 | # CONFIG_NET_DIVERT is not set | ||
357 | # CONFIG_ECONET is not set | ||
358 | # CONFIG_WAN_ROUTER is not set | ||
359 | |||
360 | # | ||
361 | # QoS and/or fair queueing | ||
362 | # | ||
363 | # CONFIG_NET_SCHED is not set | ||
364 | # CONFIG_NET_CLS_ROUTE is not set | ||
365 | |||
366 | # | ||
367 | # Network testing | ||
368 | # | 438 | # |
369 | # CONFIG_NET_PKTGEN is not set | ||
370 | # CONFIG_NETPOLL is not set | ||
371 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
372 | # CONFIG_HAMRADIO is not set | ||
373 | # CONFIG_IRDA is not set | ||
374 | # CONFIG_BT is not set | ||
375 | CONFIG_NETDEVICES=y | 439 | CONFIG_NETDEVICES=y |
376 | # CONFIG_DUMMY is not set | 440 | # CONFIG_DUMMY is not set |
377 | # CONFIG_BONDING is not set | 441 | # CONFIG_BONDING is not set |
@@ -379,11 +443,17 @@ CONFIG_NETDEVICES=y | |||
379 | # CONFIG_TUN is not set | 443 | # CONFIG_TUN is not set |
380 | 444 | ||
381 | # | 445 | # |
446 | # PHY device support | ||
447 | # | ||
448 | # CONFIG_PHYLIB is not set | ||
449 | |||
450 | # | ||
382 | # Ethernet (10 or 100Mbit) | 451 | # Ethernet (10 or 100Mbit) |
383 | # | 452 | # |
384 | CONFIG_NET_ETHERNET=y | 453 | CONFIG_NET_ETHERNET=y |
385 | CONFIG_MII=y | 454 | CONFIG_MII=y |
386 | CONFIG_SMC91X=y | 455 | CONFIG_SMC91X=y |
456 | # CONFIG_DM9000 is not set | ||
387 | 457 | ||
388 | # | 458 | # |
389 | # Ethernet (1000 Mbit) | 459 | # Ethernet (1000 Mbit) |
@@ -410,6 +480,8 @@ CONFIG_SMC91X=y | |||
410 | # CONFIG_SLIP is not set | 480 | # CONFIG_SLIP is not set |
411 | # CONFIG_SHAPER is not set | 481 | # CONFIG_SHAPER is not set |
412 | # CONFIG_NETCONSOLE is not set | 482 | # CONFIG_NETCONSOLE is not set |
483 | # CONFIG_NETPOLL is not set | ||
484 | # CONFIG_NET_POLL_CONTROLLER is not set | ||
413 | 485 | ||
414 | # | 486 | # |
415 | # ISDN subsystem | 487 | # ISDN subsystem |
@@ -459,7 +531,6 @@ CONFIG_SERIO_AMBAKMI=y | |||
459 | CONFIG_SERIO_LIBPS2=y | 531 | CONFIG_SERIO_LIBPS2=y |
460 | # CONFIG_SERIO_RAW is not set | 532 | # CONFIG_SERIO_RAW is not set |
461 | # CONFIG_GAMEPORT is not set | 533 | # CONFIG_GAMEPORT is not set |
462 | CONFIG_SOUND_GAMEPORT=y | ||
463 | 534 | ||
464 | # | 535 | # |
465 | # Character devices | 536 | # Character devices |
@@ -474,17 +545,16 @@ CONFIG_HW_CONSOLE=y | |||
474 | # | 545 | # |
475 | CONFIG_SERIAL_8250=m | 546 | CONFIG_SERIAL_8250=m |
476 | CONFIG_SERIAL_8250_NR_UARTS=4 | 547 | CONFIG_SERIAL_8250_NR_UARTS=4 |
548 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | ||
477 | CONFIG_SERIAL_8250_EXTENDED=y | 549 | CONFIG_SERIAL_8250_EXTENDED=y |
478 | CONFIG_SERIAL_8250_MANY_PORTS=y | 550 | CONFIG_SERIAL_8250_MANY_PORTS=y |
479 | CONFIG_SERIAL_8250_SHARE_IRQ=y | 551 | CONFIG_SERIAL_8250_SHARE_IRQ=y |
480 | # CONFIG_SERIAL_8250_DETECT_IRQ is not set | 552 | # CONFIG_SERIAL_8250_DETECT_IRQ is not set |
481 | CONFIG_SERIAL_8250_MULTIPORT=y | ||
482 | CONFIG_SERIAL_8250_RSA=y | 553 | CONFIG_SERIAL_8250_RSA=y |
483 | 554 | ||
484 | # | 555 | # |
485 | # Non-8250 serial port support | 556 | # Non-8250 serial port support |
486 | # | 557 | # |
487 | # CONFIG_SERIAL_AMBA_PL010 is not set | ||
488 | CONFIG_SERIAL_AMBA_PL011=y | 558 | CONFIG_SERIAL_AMBA_PL011=y |
489 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y | 559 | CONFIG_SERIAL_AMBA_PL011_CONSOLE=y |
490 | CONFIG_SERIAL_CORE=y | 560 | CONFIG_SERIAL_CORE=y |
@@ -503,20 +573,19 @@ CONFIG_LEGACY_PTY_COUNT=16 | |||
503 | # | 573 | # |
504 | # CONFIG_WATCHDOG is not set | 574 | # CONFIG_WATCHDOG is not set |
505 | # CONFIG_NVRAM is not set | 575 | # CONFIG_NVRAM is not set |
506 | # CONFIG_RTC is not set | ||
507 | # CONFIG_DTLK is not set | 576 | # CONFIG_DTLK is not set |
508 | # CONFIG_R3964 is not set | 577 | # CONFIG_R3964 is not set |
509 | 578 | ||
510 | # | 579 | # |
511 | # Ftape, the floppy tape device driver | 580 | # Ftape, the floppy tape device driver |
512 | # | 581 | # |
513 | # CONFIG_DRM is not set | ||
514 | # CONFIG_RAW_DRIVER is not set | 582 | # CONFIG_RAW_DRIVER is not set |
515 | 583 | ||
516 | # | 584 | # |
517 | # TPM devices | 585 | # TPM devices |
518 | # | 586 | # |
519 | # CONFIG_TCG_TPM is not set | 587 | # CONFIG_TCG_TPM is not set |
588 | # CONFIG_TELCLOCK is not set | ||
520 | 589 | ||
521 | # | 590 | # |
522 | # I2C support | 591 | # I2C support |
@@ -534,60 +603,60 @@ CONFIG_I2C_ALGOBIT=y | |||
534 | # | 603 | # |
535 | # I2C Hardware Bus support | 604 | # I2C Hardware Bus support |
536 | # | 605 | # |
537 | # CONFIG_I2C_ISA is not set | ||
538 | # CONFIG_I2C_PARPORT_LIGHT is not set | 606 | # CONFIG_I2C_PARPORT_LIGHT is not set |
539 | # CONFIG_I2C_STUB is not set | 607 | # CONFIG_I2C_STUB is not set |
540 | # CONFIG_I2C_PCA_ISA is not set | 608 | # CONFIG_I2C_PCA_ISA is not set |
541 | 609 | ||
542 | # | 610 | # |
543 | # Hardware Sensors Chip support | 611 | # Miscellaneous I2C Chip support |
544 | # | ||
545 | CONFIG_I2C_SENSOR=m | ||
546 | # CONFIG_SENSORS_ADM1021 is not set | ||
547 | # CONFIG_SENSORS_ADM1025 is not set | ||
548 | # CONFIG_SENSORS_ADM1026 is not set | ||
549 | # CONFIG_SENSORS_ADM1031 is not set | ||
550 | # CONFIG_SENSORS_ASB100 is not set | ||
551 | # CONFIG_SENSORS_DS1621 is not set | ||
552 | # CONFIG_SENSORS_FSCHER is not set | ||
553 | # CONFIG_SENSORS_FSCPOS is not set | ||
554 | # CONFIG_SENSORS_GL518SM is not set | ||
555 | # CONFIG_SENSORS_GL520SM is not set | ||
556 | # CONFIG_SENSORS_IT87 is not set | ||
557 | # CONFIG_SENSORS_LM63 is not set | ||
558 | # CONFIG_SENSORS_LM75 is not set | ||
559 | # CONFIG_SENSORS_LM77 is not set | ||
560 | # CONFIG_SENSORS_LM78 is not set | ||
561 | # CONFIG_SENSORS_LM80 is not set | ||
562 | # CONFIG_SENSORS_LM83 is not set | ||
563 | # CONFIG_SENSORS_LM85 is not set | ||
564 | # CONFIG_SENSORS_LM87 is not set | ||
565 | # CONFIG_SENSORS_LM90 is not set | ||
566 | # CONFIG_SENSORS_MAX1619 is not set | ||
567 | # CONFIG_SENSORS_PC87360 is not set | ||
568 | # CONFIG_SENSORS_SMSC47B397 is not set | ||
569 | # CONFIG_SENSORS_SMSC47M1 is not set | ||
570 | # CONFIG_SENSORS_W83781D is not set | ||
571 | # CONFIG_SENSORS_W83L785TS is not set | ||
572 | # CONFIG_SENSORS_W83627HF is not set | ||
573 | |||
574 | # | ||
575 | # Other I2C Chip support | ||
576 | # | 612 | # |
613 | # CONFIG_SENSORS_DS1337 is not set | ||
614 | # CONFIG_SENSORS_DS1374 is not set | ||
577 | CONFIG_SENSORS_EEPROM=m | 615 | CONFIG_SENSORS_EEPROM=m |
578 | # CONFIG_SENSORS_PCF8574 is not set | 616 | # CONFIG_SENSORS_PCF8574 is not set |
617 | # CONFIG_SENSORS_PCA9539 is not set | ||
579 | # CONFIG_SENSORS_PCF8591 is not set | 618 | # CONFIG_SENSORS_PCF8591 is not set |
580 | # CONFIG_SENSORS_RTC8564 is not set | 619 | # CONFIG_SENSORS_MAX6875 is not set |
581 | # CONFIG_I2C_DEBUG_CORE is not set | 620 | # CONFIG_I2C_DEBUG_CORE is not set |
582 | # CONFIG_I2C_DEBUG_ALGO is not set | 621 | # CONFIG_I2C_DEBUG_ALGO is not set |
583 | # CONFIG_I2C_DEBUG_BUS is not set | 622 | # CONFIG_I2C_DEBUG_BUS is not set |
584 | # CONFIG_I2C_DEBUG_CHIP is not set | 623 | # CONFIG_I2C_DEBUG_CHIP is not set |
585 | 624 | ||
586 | # | 625 | # |
626 | # SPI support | ||
627 | # | ||
628 | # CONFIG_SPI is not set | ||
629 | # CONFIG_SPI_MASTER is not set | ||
630 | |||
631 | # | ||
632 | # Dallas's 1-wire bus | ||
633 | # | ||
634 | # CONFIG_W1 is not set | ||
635 | |||
636 | # | ||
637 | # Hardware Monitoring support | ||
638 | # | ||
639 | # CONFIG_HWMON is not set | ||
640 | # CONFIG_HWMON_VID is not set | ||
641 | |||
642 | # | ||
587 | # Misc devices | 643 | # Misc devices |
588 | # | 644 | # |
589 | 645 | ||
590 | # | 646 | # |
647 | # LED devices | ||
648 | # | ||
649 | # CONFIG_NEW_LEDS is not set | ||
650 | |||
651 | # | ||
652 | # LED drivers | ||
653 | # | ||
654 | |||
655 | # | ||
656 | # LED Triggers | ||
657 | # | ||
658 | |||
659 | # | ||
591 | # Multimedia devices | 660 | # Multimedia devices |
592 | # | 661 | # |
593 | # CONFIG_VIDEO_DEV is not set | 662 | # CONFIG_VIDEO_DEV is not set |
@@ -604,27 +673,31 @@ CONFIG_FB=y | |||
604 | CONFIG_FB_CFB_FILLRECT=y | 673 | CONFIG_FB_CFB_FILLRECT=y |
605 | CONFIG_FB_CFB_COPYAREA=y | 674 | CONFIG_FB_CFB_COPYAREA=y |
606 | CONFIG_FB_CFB_IMAGEBLIT=y | 675 | CONFIG_FB_CFB_IMAGEBLIT=y |
607 | CONFIG_FB_SOFT_CURSOR=y | 676 | # CONFIG_FB_MACMODES is not set |
677 | # CONFIG_FB_FIRMWARE_EDID is not set | ||
608 | # CONFIG_FB_MODE_HELPERS is not set | 678 | # CONFIG_FB_MODE_HELPERS is not set |
609 | # CONFIG_FB_TILEBLITTING is not set | 679 | # CONFIG_FB_TILEBLITTING is not set |
610 | CONFIG_FB_ARMCLCD=y | 680 | CONFIG_FB_ARMCLCD=y |
681 | # CONFIG_FB_S1D13XXX is not set | ||
611 | # CONFIG_FB_VIRTUAL is not set | 682 | # CONFIG_FB_VIRTUAL is not set |
612 | 683 | ||
613 | # | 684 | # |
614 | # Console display driver support | 685 | # Console display driver support |
615 | # | 686 | # |
616 | # CONFIG_VGA_CONSOLE is not set | ||
617 | CONFIG_DUMMY_CONSOLE=y | 687 | CONFIG_DUMMY_CONSOLE=y |
618 | CONFIG_FRAMEBUFFER_CONSOLE=y | 688 | CONFIG_FRAMEBUFFER_CONSOLE=y |
689 | # CONFIG_FRAMEBUFFER_CONSOLE_ROTATION is not set | ||
619 | CONFIG_FONTS=y | 690 | CONFIG_FONTS=y |
620 | # CONFIG_FONT_8x8 is not set | 691 | # CONFIG_FONT_8x8 is not set |
621 | # CONFIG_FONT_8x16 is not set | 692 | # CONFIG_FONT_8x16 is not set |
622 | # CONFIG_FONT_6x11 is not set | 693 | # CONFIG_FONT_6x11 is not set |
694 | # CONFIG_FONT_7x14 is not set | ||
623 | # CONFIG_FONT_PEARL_8x8 is not set | 695 | # CONFIG_FONT_PEARL_8x8 is not set |
624 | CONFIG_FONT_ACORN_8x8=y | 696 | CONFIG_FONT_ACORN_8x8=y |
625 | # CONFIG_FONT_MINI_4x6 is not set | 697 | # CONFIG_FONT_MINI_4x6 is not set |
626 | # CONFIG_FONT_SUN8x16 is not set | 698 | # CONFIG_FONT_SUN8x16 is not set |
627 | # CONFIG_FONT_SUN12x22 is not set | 699 | # CONFIG_FONT_SUN12x22 is not set |
700 | # CONFIG_FONT_10x18 is not set | ||
628 | 701 | ||
629 | # | 702 | # |
630 | # Logo configuration | 703 | # Logo configuration |
@@ -647,12 +720,18 @@ CONFIG_SND_PCM=m | |||
647 | CONFIG_SND_OSSEMUL=y | 720 | CONFIG_SND_OSSEMUL=y |
648 | CONFIG_SND_MIXER_OSS=m | 721 | CONFIG_SND_MIXER_OSS=m |
649 | CONFIG_SND_PCM_OSS=m | 722 | CONFIG_SND_PCM_OSS=m |
723 | CONFIG_SND_PCM_OSS_PLUGINS=y | ||
724 | # CONFIG_SND_DYNAMIC_MINORS is not set | ||
725 | CONFIG_SND_SUPPORT_OLD_API=y | ||
726 | CONFIG_SND_VERBOSE_PROCFS=y | ||
650 | # CONFIG_SND_VERBOSE_PRINTK is not set | 727 | # CONFIG_SND_VERBOSE_PRINTK is not set |
651 | # CONFIG_SND_DEBUG is not set | 728 | # CONFIG_SND_DEBUG is not set |
652 | 729 | ||
653 | # | 730 | # |
654 | # Generic devices | 731 | # Generic devices |
655 | # | 732 | # |
733 | CONFIG_SND_AC97_CODEC=m | ||
734 | CONFIG_SND_AC97_BUS=m | ||
656 | # CONFIG_SND_DUMMY is not set | 735 | # CONFIG_SND_DUMMY is not set |
657 | # CONFIG_SND_MTPAV is not set | 736 | # CONFIG_SND_MTPAV is not set |
658 | # CONFIG_SND_SERIAL_U16550 is not set | 737 | # CONFIG_SND_SERIAL_U16550 is not set |
@@ -661,6 +740,7 @@ CONFIG_SND_PCM_OSS=m | |||
661 | # | 740 | # |
662 | # ALSA ARM devices | 741 | # ALSA ARM devices |
663 | # | 742 | # |
743 | CONFIG_SND_ARMAACI=m | ||
664 | 744 | ||
665 | # | 745 | # |
666 | # Open Sound System | 746 | # Open Sound System |
@@ -672,9 +752,14 @@ CONFIG_SND_PCM_OSS=m | |||
672 | # | 752 | # |
673 | CONFIG_USB_ARCH_HAS_HCD=y | 753 | CONFIG_USB_ARCH_HAS_HCD=y |
674 | # CONFIG_USB_ARCH_HAS_OHCI is not set | 754 | # CONFIG_USB_ARCH_HAS_OHCI is not set |
755 | # CONFIG_USB_ARCH_HAS_EHCI is not set | ||
675 | # CONFIG_USB is not set | 756 | # CONFIG_USB is not set |
676 | 757 | ||
677 | # | 758 | # |
759 | # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | ||
760 | # | ||
761 | |||
762 | # | ||
678 | # USB Gadget Support | 763 | # USB Gadget Support |
679 | # | 764 | # |
680 | # CONFIG_USB_GADGET is not set | 765 | # CONFIG_USB_GADGET is not set |
@@ -688,25 +773,31 @@ CONFIG_MMC_BLOCK=y | |||
688 | CONFIG_MMC_ARMMMCI=m | 773 | CONFIG_MMC_ARMMMCI=m |
689 | 774 | ||
690 | # | 775 | # |
776 | # Real Time Clock | ||
777 | # | ||
778 | CONFIG_RTC_LIB=y | ||
779 | # CONFIG_RTC_CLASS is not set | ||
780 | |||
781 | # | ||
691 | # File systems | 782 | # File systems |
692 | # | 783 | # |
693 | CONFIG_EXT2_FS=y | 784 | CONFIG_EXT2_FS=y |
694 | # CONFIG_EXT2_FS_XATTR is not set | 785 | # CONFIG_EXT2_FS_XATTR is not set |
786 | # CONFIG_EXT2_FS_XIP is not set | ||
695 | # CONFIG_EXT3_FS is not set | 787 | # CONFIG_EXT3_FS is not set |
696 | # CONFIG_JBD is not set | ||
697 | # CONFIG_REISERFS_FS is not set | 788 | # CONFIG_REISERFS_FS is not set |
698 | # CONFIG_JFS_FS is not set | 789 | # CONFIG_JFS_FS is not set |
699 | 790 | # CONFIG_FS_POSIX_ACL is not set | |
700 | # | ||
701 | # XFS support | ||
702 | # | ||
703 | # CONFIG_XFS_FS is not set | 791 | # CONFIG_XFS_FS is not set |
792 | # CONFIG_OCFS2_FS is not set | ||
704 | CONFIG_MINIX_FS=y | 793 | CONFIG_MINIX_FS=y |
705 | CONFIG_ROMFS_FS=y | 794 | CONFIG_ROMFS_FS=y |
795 | # CONFIG_INOTIFY is not set | ||
706 | # CONFIG_QUOTA is not set | 796 | # CONFIG_QUOTA is not set |
707 | CONFIG_DNOTIFY=y | 797 | CONFIG_DNOTIFY=y |
708 | # CONFIG_AUTOFS_FS is not set | 798 | # CONFIG_AUTOFS_FS is not set |
709 | # CONFIG_AUTOFS4_FS is not set | 799 | # CONFIG_AUTOFS4_FS is not set |
800 | # CONFIG_FUSE_FS is not set | ||
710 | 801 | ||
711 | # | 802 | # |
712 | # CD-ROM/DVD Filesystems | 803 | # CD-ROM/DVD Filesystems |
@@ -729,11 +820,10 @@ CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | |||
729 | # | 820 | # |
730 | CONFIG_PROC_FS=y | 821 | CONFIG_PROC_FS=y |
731 | CONFIG_SYSFS=y | 822 | CONFIG_SYSFS=y |
732 | # CONFIG_DEVFS_FS is not set | ||
733 | # CONFIG_DEVPTS_FS_XATTR is not set | ||
734 | # CONFIG_TMPFS is not set | 823 | # CONFIG_TMPFS is not set |
735 | # CONFIG_HUGETLB_PAGE is not set | 824 | # CONFIG_HUGETLB_PAGE is not set |
736 | CONFIG_RAMFS=y | 825 | CONFIG_RAMFS=y |
826 | # CONFIG_CONFIGFS_FS is not set | ||
737 | 827 | ||
738 | # | 828 | # |
739 | # Miscellaneous filesystems | 829 | # Miscellaneous filesystems |
@@ -748,8 +838,8 @@ CONFIG_RAMFS=y | |||
748 | # CONFIG_JFFS_FS is not set | 838 | # CONFIG_JFFS_FS is not set |
749 | CONFIG_JFFS2_FS=y | 839 | CONFIG_JFFS2_FS=y |
750 | CONFIG_JFFS2_FS_DEBUG=0 | 840 | CONFIG_JFFS2_FS_DEBUG=0 |
751 | # CONFIG_JFFS2_FS_NAND is not set | 841 | CONFIG_JFFS2_FS_WRITEBUFFER=y |
752 | # CONFIG_JFFS2_FS_NOR_ECC is not set | 842 | # CONFIG_JFFS2_SUMMARY is not set |
753 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | 843 | # CONFIG_JFFS2_COMPRESSION_OPTIONS is not set |
754 | CONFIG_JFFS2_ZLIB=y | 844 | CONFIG_JFFS2_ZLIB=y |
755 | CONFIG_JFFS2_RTIME=y | 845 | CONFIG_JFFS2_RTIME=y |
@@ -766,16 +856,19 @@ CONFIG_CRAMFS=y | |||
766 | # | 856 | # |
767 | CONFIG_NFS_FS=y | 857 | CONFIG_NFS_FS=y |
768 | CONFIG_NFS_V3=y | 858 | CONFIG_NFS_V3=y |
859 | # CONFIG_NFS_V3_ACL is not set | ||
769 | # CONFIG_NFS_V4 is not set | 860 | # CONFIG_NFS_V4 is not set |
770 | # CONFIG_NFS_DIRECTIO is not set | 861 | # CONFIG_NFS_DIRECTIO is not set |
771 | CONFIG_NFSD=y | 862 | CONFIG_NFSD=y |
772 | CONFIG_NFSD_V3=y | 863 | CONFIG_NFSD_V3=y |
864 | # CONFIG_NFSD_V3_ACL is not set | ||
773 | # CONFIG_NFSD_V4 is not set | 865 | # CONFIG_NFSD_V4 is not set |
774 | # CONFIG_NFSD_TCP is not set | 866 | # CONFIG_NFSD_TCP is not set |
775 | CONFIG_ROOT_NFS=y | 867 | CONFIG_ROOT_NFS=y |
776 | CONFIG_LOCKD=y | 868 | CONFIG_LOCKD=y |
777 | CONFIG_LOCKD_V4=y | 869 | CONFIG_LOCKD_V4=y |
778 | CONFIG_EXPORTFS=y | 870 | CONFIG_EXPORTFS=y |
871 | CONFIG_NFS_COMMON=y | ||
779 | CONFIG_SUNRPC=y | 872 | CONFIG_SUNRPC=y |
780 | # CONFIG_RPCSEC_GSS_KRB5 is not set | 873 | # CONFIG_RPCSEC_GSS_KRB5 is not set |
781 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 874 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
@@ -784,6 +877,7 @@ CONFIG_SUNRPC=y | |||
784 | # CONFIG_NCP_FS is not set | 877 | # CONFIG_NCP_FS is not set |
785 | # CONFIG_CODA_FS is not set | 878 | # CONFIG_CODA_FS is not set |
786 | # CONFIG_AFS_FS is not set | 879 | # CONFIG_AFS_FS is not set |
880 | # CONFIG_9P_FS is not set | ||
787 | 881 | ||
788 | # | 882 | # |
789 | # Partition Types | 883 | # Partition Types |
@@ -803,6 +897,7 @@ CONFIG_MSDOS_PARTITION=y | |||
803 | # CONFIG_SGI_PARTITION is not set | 897 | # CONFIG_SGI_PARTITION is not set |
804 | # CONFIG_ULTRIX_PARTITION is not set | 898 | # CONFIG_ULTRIX_PARTITION is not set |
805 | # CONFIG_SUN_PARTITION is not set | 899 | # CONFIG_SUN_PARTITION is not set |
900 | # CONFIG_KARMA_PARTITION is not set | ||
806 | # CONFIG_EFI_PARTITION is not set | 901 | # CONFIG_EFI_PARTITION is not set |
807 | 902 | ||
808 | # | 903 | # |
@@ -858,18 +953,24 @@ CONFIG_NLS_ISO8859_1=m | |||
858 | # Kernel hacking | 953 | # Kernel hacking |
859 | # | 954 | # |
860 | # CONFIG_PRINTK_TIME is not set | 955 | # CONFIG_PRINTK_TIME is not set |
861 | CONFIG_DEBUG_KERNEL=y | ||
862 | CONFIG_MAGIC_SYSRQ=y | 956 | CONFIG_MAGIC_SYSRQ=y |
957 | CONFIG_DEBUG_KERNEL=y | ||
863 | CONFIG_LOG_BUF_SHIFT=14 | 958 | CONFIG_LOG_BUF_SHIFT=14 |
959 | CONFIG_DETECT_SOFTLOCKUP=y | ||
864 | # CONFIG_SCHEDSTATS is not set | 960 | # CONFIG_SCHEDSTATS is not set |
865 | # CONFIG_DEBUG_SLAB is not set | 961 | # CONFIG_DEBUG_SLAB is not set |
962 | # CONFIG_DEBUG_MUTEXES is not set | ||
866 | # CONFIG_DEBUG_SPINLOCK is not set | 963 | # CONFIG_DEBUG_SPINLOCK is not set |
867 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 964 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
868 | # CONFIG_DEBUG_KOBJECT is not set | 965 | # CONFIG_DEBUG_KOBJECT is not set |
869 | CONFIG_DEBUG_BUGVERBOSE=y | 966 | CONFIG_DEBUG_BUGVERBOSE=y |
870 | # CONFIG_DEBUG_INFO is not set | 967 | # CONFIG_DEBUG_INFO is not set |
871 | # CONFIG_DEBUG_FS is not set | 968 | # CONFIG_DEBUG_FS is not set |
969 | # CONFIG_DEBUG_VM is not set | ||
872 | CONFIG_FRAME_POINTER=y | 970 | CONFIG_FRAME_POINTER=y |
971 | # CONFIG_UNWIND_INFO is not set | ||
972 | CONFIG_FORCED_INLINING=y | ||
973 | # CONFIG_RCU_TORTURE_TEST is not set | ||
873 | CONFIG_DEBUG_USER=y | 974 | CONFIG_DEBUG_USER=y |
874 | # CONFIG_DEBUG_WAITQ is not set | 975 | # CONFIG_DEBUG_WAITQ is not set |
875 | CONFIG_DEBUG_ERRORS=y | 976 | CONFIG_DEBUG_ERRORS=y |
@@ -895,6 +996,7 @@ CONFIG_DEBUG_LL=y | |||
895 | # Library routines | 996 | # Library routines |
896 | # | 997 | # |
897 | # CONFIG_CRC_CCITT is not set | 998 | # CONFIG_CRC_CCITT is not set |
999 | # CONFIG_CRC16 is not set | ||
898 | CONFIG_CRC32=y | 1000 | CONFIG_CRC32=y |
899 | # CONFIG_LIBCRC32C is not set | 1001 | # CONFIG_LIBCRC32C is not set |
900 | CONFIG_ZLIB_INFLATE=y | 1002 | CONFIG_ZLIB_INFLATE=y |
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 45fdf4a51a2a..396efba9bacd 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -99,6 +99,8 @@ int main(void) | |||
99 | DEFINE(MACHINFO_NAME, offsetof(struct machine_desc, name)); | 99 | DEFINE(MACHINFO_NAME, offsetof(struct machine_desc, name)); |
100 | DEFINE(MACHINFO_PHYSIO, offsetof(struct machine_desc, phys_io)); | 100 | DEFINE(MACHINFO_PHYSIO, offsetof(struct machine_desc, phys_io)); |
101 | DEFINE(MACHINFO_PGOFFIO, offsetof(struct machine_desc, io_pg_offst)); | 101 | DEFINE(MACHINFO_PGOFFIO, offsetof(struct machine_desc, io_pg_offst)); |
102 | BLANK(); | ||
103 | DEFINE(PROC_INFO_SZ, sizeof(struct proc_info_list)); | ||
102 | DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush)); | 104 | DEFINE(PROCINFO_INITFUNC, offsetof(struct proc_info_list, __cpu_flush)); |
103 | DEFINE(PROCINFO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mmu_flags)); | 105 | DEFINE(PROCINFO_MMUFLAGS, offsetof(struct proc_info_list, __cpu_mmu_flags)); |
104 | return 0; | 106 | return 0; |
diff --git a/arch/arm/kernel/dma-isa.c b/arch/arm/kernel/dma-isa.c index 03532769a97f..0a3e9ad297d8 100644 --- a/arch/arm/kernel/dma-isa.c +++ b/arch/arm/kernel/dma-isa.c | |||
@@ -143,12 +143,23 @@ static struct dma_ops isa_dma_ops = { | |||
143 | .residue = isa_get_dma_residue, | 143 | .residue = isa_get_dma_residue, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | static struct resource dma_resources[] = { | 146 | static struct resource dma_resources[] = { { |
147 | { "dma1", 0x0000, 0x000f }, | 147 | .name = "dma1", |
148 | { "dma low page", 0x0080, 0x008f }, | 148 | .start = 0x0000, |
149 | { "dma2", 0x00c0, 0x00df }, | 149 | .end = 0x000f |
150 | { "dma high page", 0x0480, 0x048f } | 150 | }, { |
151 | }; | 151 | .name = "dma low page", |
152 | .start = 0x0080, | ||
153 | .end = 0x008f | ||
154 | }, { | ||
155 | .name = "dma2", | ||
156 | .start = 0x00c0, | ||
157 | .end = 0x00df | ||
158 | }, { | ||
159 | .name = "dma high page", | ||
160 | .start = 0x0480, | ||
161 | .end = 0x048f | ||
162 | } }; | ||
152 | 163 | ||
153 | void __init isa_init_dma(dma_t *dma) | 164 | void __init isa_init_dma(dma_t *dma) |
154 | { | 165 | { |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index 1ff75cee4b0d..7df6e1aaa323 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -264,8 +264,12 @@ void show_fpregs(struct user_fp *regs) | |||
264 | /* | 264 | /* |
265 | * Task structure and kernel stack allocation. | 265 | * Task structure and kernel stack allocation. |
266 | */ | 266 | */ |
267 | static unsigned long *thread_info_head; | 267 | struct thread_info_list { |
268 | static unsigned int nr_thread_info; | 268 | unsigned long *head; |
269 | unsigned int nr; | ||
270 | }; | ||
271 | |||
272 | static DEFINE_PER_CPU(struct thread_info_list, thread_info_list) = { NULL, 0 }; | ||
269 | 273 | ||
270 | #define EXTRA_TASK_STRUCT 4 | 274 | #define EXTRA_TASK_STRUCT 4 |
271 | 275 | ||
@@ -274,12 +278,15 @@ struct thread_info *alloc_thread_info(struct task_struct *task) | |||
274 | struct thread_info *thread = NULL; | 278 | struct thread_info *thread = NULL; |
275 | 279 | ||
276 | if (EXTRA_TASK_STRUCT) { | 280 | if (EXTRA_TASK_STRUCT) { |
277 | unsigned long *p = thread_info_head; | 281 | struct thread_info_list *th = &get_cpu_var(thread_info_list); |
282 | unsigned long *p = th->head; | ||
278 | 283 | ||
279 | if (p) { | 284 | if (p) { |
280 | thread_info_head = (unsigned long *)p[0]; | 285 | th->head = (unsigned long *)p[0]; |
281 | nr_thread_info -= 1; | 286 | th->nr -= 1; |
282 | } | 287 | } |
288 | put_cpu_var(thread_info_list); | ||
289 | |||
283 | thread = (struct thread_info *)p; | 290 | thread = (struct thread_info *)p; |
284 | } | 291 | } |
285 | 292 | ||
@@ -300,13 +307,19 @@ struct thread_info *alloc_thread_info(struct task_struct *task) | |||
300 | 307 | ||
301 | void free_thread_info(struct thread_info *thread) | 308 | void free_thread_info(struct thread_info *thread) |
302 | { | 309 | { |
303 | if (EXTRA_TASK_STRUCT && nr_thread_info < EXTRA_TASK_STRUCT) { | 310 | if (EXTRA_TASK_STRUCT) { |
304 | unsigned long *p = (unsigned long *)thread; | 311 | struct thread_info_list *th = &get_cpu_var(thread_info_list); |
305 | p[0] = (unsigned long)thread_info_head; | 312 | if (th->nr < EXTRA_TASK_STRUCT) { |
306 | thread_info_head = p; | 313 | unsigned long *p = (unsigned long *)thread; |
307 | nr_thread_info += 1; | 314 | p[0] = (unsigned long)th->head; |
308 | } else | 315 | th->head = p; |
309 | free_pages((unsigned long)thread, THREAD_SIZE_ORDER); | 316 | th->nr += 1; |
317 | put_cpu_var(thread_info_list); | ||
318 | return; | ||
319 | } | ||
320 | put_cpu_var(thread_info_list); | ||
321 | } | ||
322 | free_pages((unsigned long)thread, THREAD_SIZE_ORDER); | ||
310 | } | 323 | } |
311 | 324 | ||
312 | /* | 325 | /* |
diff --git a/arch/arm/lib/backtrace.S b/arch/arm/lib/backtrace.S index 3bdc8c6949c5..16153c86c3f8 100644 --- a/arch/arm/lib/backtrace.S +++ b/arch/arm/lib/backtrace.S | |||
@@ -122,7 +122,7 @@ ENTRY(c_backtrace) | |||
122 | #define reg r5 | 122 | #define reg r5 |
123 | #define stack r6 | 123 | #define stack r6 |
124 | 124 | ||
125 | .Ldumpstm: stmfd sp!, {instr, reg, stack, r7, lr} | 125 | .Ldumpstm: stmfd sp!, {instr, reg, stack, r7, r8, lr} |
126 | mov stack, r0 | 126 | mov stack, r0 |
127 | mov instr, r1 | 127 | mov instr, r1 |
128 | mov reg, #9 | 128 | mov reg, #9 |
@@ -145,7 +145,7 @@ ENTRY(c_backtrace) | |||
145 | adrne r0, .Lcr | 145 | adrne r0, .Lcr |
146 | blne printk | 146 | blne printk |
147 | mov r0, stack | 147 | mov r0, stack |
148 | LOADREGS(fd, sp!, {instr, reg, stack, r7, pc}) | 148 | LOADREGS(fd, sp!, {instr, reg, stack, r7, r8, pc}) |
149 | 149 | ||
150 | .Lfp: .asciz " r%d = %08X%c" | 150 | .Lfp: .asciz " r%d = %08X%c" |
151 | .Lcr: .asciz "\n" | 151 | .Lcr: .asciz "\n" |
diff --git a/arch/arm/lib/div64.S b/arch/arm/lib/div64.S index ec9a1cd6176f..58eef6607629 100644 --- a/arch/arm/lib/div64.S +++ b/arch/arm/lib/div64.S | |||
@@ -189,12 +189,12 @@ ENTRY(__do_div64) | |||
189 | moveq pc, lr | 189 | moveq pc, lr |
190 | 190 | ||
191 | @ Division by 0: | 191 | @ Division by 0: |
192 | str lr, [sp, #-4]! | 192 | str lr, [sp, #-8]! |
193 | bl __div0 | 193 | bl __div0 |
194 | 194 | ||
195 | @ as wrong as it could be... | 195 | @ as wrong as it could be... |
196 | mov yl, #0 | 196 | mov yl, #0 |
197 | mov yh, #0 | 197 | mov yh, #0 |
198 | mov xh, #0 | 198 | mov xh, #0 |
199 | ldr pc, [sp], #4 | 199 | ldr pc, [sp], #8 |
200 | 200 | ||
diff --git a/arch/arm/mach-aaec2000/aaed2000.c b/arch/arm/mach-aaec2000/aaed2000.c index dc5fa8e5ebef..83f57da3184c 100644 --- a/arch/arm/mach-aaec2000/aaed2000.c +++ b/arch/arm/mach-aaec2000/aaed2000.c | |||
@@ -79,7 +79,12 @@ static void __init aaed2000_init(void) | |||
79 | } | 79 | } |
80 | 80 | ||
81 | static struct map_desc aaed2000_io_desc[] __initdata = { | 81 | static struct map_desc aaed2000_io_desc[] __initdata = { |
82 | { EXT_GPIO_VBASE, EXT_GPIO_PBASE, EXT_GPIO_LENGTH, MT_DEVICE }, /* Ext GPIO */ | 82 | { |
83 | .virtual = EXT_GPIO_VBASE, | ||
84 | .pfn = __phys_to_pfn(EXT_GPIO_PBASE), | ||
85 | .length = EXT_GPIO_LENGTH, | ||
86 | .type = MT_DEVICE | ||
87 | }, | ||
83 | }; | 88 | }; |
84 | 89 | ||
85 | static void __init aaed2000_map_io(void) | 90 | static void __init aaed2000_map_io(void) |
diff --git a/arch/arm/mach-aaec2000/core.c b/arch/arm/mach-aaec2000/core.c index dce4815cf53c..65be5efd633c 100644 --- a/arch/arm/mach-aaec2000/core.c +++ b/arch/arm/mach-aaec2000/core.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/timex.h> | 21 | #include <linux/timex.h> |
22 | #include <linux/signal.h> | 22 | #include <linux/signal.h> |
23 | #include <linux/amba/bus.h> | ||
24 | 23 | ||
25 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
26 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
@@ -50,12 +49,12 @@ | |||
50 | static struct map_desc standard_io_desc[] __initdata = { | 49 | static struct map_desc standard_io_desc[] __initdata = { |
51 | { | 50 | { |
52 | .virtual = VIO_APB_BASE, | 51 | .virtual = VIO_APB_BASE, |
53 | .physical = __phys_to_pfn(PIO_APB_BASE), | 52 | .pfn = __phys_to_pfn(PIO_APB_BASE), |
54 | .length = IO_APB_LENGTH, | 53 | .length = IO_APB_LENGTH, |
55 | .type = MT_DEVICE | 54 | .type = MT_DEVICE |
56 | }, { | 55 | }, { |
57 | .virtual = VIO_AHB_BASE, | 56 | .virtual = VIO_AHB_BASE, |
58 | .physical = __phys_to_pfn(PIO_AHB_BASE), | 57 | .pfn = __phys_to_pfn(PIO_AHB_BASE), |
59 | .length = IO_AHB_LENGTH, | 58 | .length = IO_AHB_LENGTH, |
60 | .type = MT_DEVICE | 59 | .type = MT_DEVICE |
61 | } | 60 | } |
diff --git a/arch/arm/mach-aaec2000/core.h b/arch/arm/mach-aaec2000/core.h index b6029a95f19c..59501b573167 100644 --- a/arch/arm/mach-aaec2000/core.h +++ b/arch/arm/mach-aaec2000/core.h | |||
@@ -9,6 +9,7 @@ | |||
9 | * | 9 | * |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/amba/bus.h> | ||
12 | #include <linux/amba/clcd.h> | 13 | #include <linux/amba/clcd.h> |
13 | 14 | ||
14 | struct sys_timer; | 15 | struct sys_timer; |
diff --git a/arch/arm/mach-imx/mx1ads.c b/arch/arm/mach-imx/mx1ads.c index e1f6c0bbe1e7..da893c80d471 100644 --- a/arch/arm/mach-imx/mx1ads.c +++ b/arch/arm/mach-imx/mx1ads.c | |||
@@ -161,7 +161,7 @@ mx1ads_map_io(void) | |||
161 | MACHINE_START(MX1ADS, "Motorola MX1ADS") | 161 | MACHINE_START(MX1ADS, "Motorola MX1ADS") |
162 | /* Maintainer: Sascha Hauer, Pengutronix */ | 162 | /* Maintainer: Sascha Hauer, Pengutronix */ |
163 | .phys_io = 0x00200000, | 163 | .phys_io = 0x00200000, |
164 | .io_pg_offst = ((0xe0200000) >> 18) & 0xfffc, | 164 | .io_pg_offst = ((0xe0000000) >> 18) & 0xfffc, |
165 | .boot_params = 0x08000100, | 165 | .boot_params = 0x08000100, |
166 | .map_io = mx1ads_map_io, | 166 | .map_io = mx1ads_map_io, |
167 | .init_irq = imx_init_irq, | 167 | .init_irq = imx_init_irq, |
diff --git a/arch/arm/mach-pxa/mainstone.c b/arch/arm/mach-pxa/mainstone.c index 98356f810007..02e188d98e7d 100644 --- a/arch/arm/mach-pxa/mainstone.c +++ b/arch/arm/mach-pxa/mainstone.c | |||
@@ -95,7 +95,10 @@ static void __init mainstone_init_irq(void) | |||
95 | for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) { | 95 | for(irq = MAINSTONE_IRQ(0); irq <= MAINSTONE_IRQ(15); irq++) { |
96 | set_irq_chip(irq, &mainstone_irq_chip); | 96 | set_irq_chip(irq, &mainstone_irq_chip); |
97 | set_irq_handler(irq, do_level_IRQ); | 97 | set_irq_handler(irq, do_level_IRQ); |
98 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 98 | if (irq == MAINSTONE_IRQ(10) || irq == MAINSTONE_IRQ(14)) |
99 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE | IRQF_NOAUTOEN); | ||
100 | else | ||
101 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | ||
99 | } | 102 | } |
100 | set_irq_flags(MAINSTONE_IRQ(8), 0); | 103 | set_irq_flags(MAINSTONE_IRQ(8), 0); |
101 | set_irq_flags(MAINSTONE_IRQ(12), 0); | 104 | set_irq_flags(MAINSTONE_IRQ(12), 0); |
diff --git a/arch/arm/mach-realview/realview_eb.c b/arch/arm/mach-realview/realview_eb.c index d4a586e38d5b..693fb1e396e0 100644 --- a/arch/arm/mach-realview/realview_eb.c +++ b/arch/arm/mach-realview/realview_eb.c | |||
@@ -137,8 +137,11 @@ static struct amba_device *amba_devs[] __initdata = { | |||
137 | static void __init gic_init_irq(void) | 137 | static void __init gic_init_irq(void) |
138 | { | 138 | { |
139 | #ifdef CONFIG_REALVIEW_MPCORE | 139 | #ifdef CONFIG_REALVIEW_MPCORE |
140 | unsigned int pldctrl; | ||
140 | writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK)); | 141 | writel(0x0000a05f, __io_address(REALVIEW_SYS_LOCK)); |
141 | writel(0x008003c0, __io_address(REALVIEW_SYS_BASE) + 0xd8); | 142 | pldctrl = readl(__io_address(REALVIEW_SYS_BASE) + 0xd8); |
143 | pldctrl |= 0x00800000; /* New irq mode */ | ||
144 | writel(pldctrl, __io_address(REALVIEW_SYS_BASE) + 0xd8); | ||
142 | writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); | 145 | writel(0x00000000, __io_address(REALVIEW_SYS_LOCK)); |
143 | #endif | 146 | #endif |
144 | gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE)); | 147 | gic_dist_init(__io_address(REALVIEW_GIC_DIST_BASE)); |
diff --git a/arch/arm/mach-s3c2410/sleep.S b/arch/arm/mach-s3c2410/sleep.S index 832fb86a03b4..73de2eaca22a 100644 --- a/arch/arm/mach-s3c2410/sleep.S +++ b/arch/arm/mach-s3c2410/sleep.S | |||
@@ -59,8 +59,7 @@ ENTRY(s3c2410_cpu_suspend) | |||
59 | mrc p15, 0, r5, c13, c0, 0 @ PID | 59 | mrc p15, 0, r5, c13, c0, 0 @ PID |
60 | mrc p15, 0, r6, c3, c0, 0 @ Domain ID | 60 | mrc p15, 0, r6, c3, c0, 0 @ Domain ID |
61 | mrc p15, 0, r7, c2, c0, 0 @ translation table base address | 61 | mrc p15, 0, r7, c2, c0, 0 @ translation table base address |
62 | mrc p15, 0, r8, c2, c0, 0 @ auxiliary control register | 62 | mrc p15, 0, r8, c1, c0, 0 @ control register |
63 | mrc p15, 0, r9, c1, c0, 0 @ control register | ||
64 | 63 | ||
65 | stmia r0, { r4 - r13 } | 64 | stmia r0, { r4 - r13 } |
66 | 65 | ||
@@ -165,7 +164,6 @@ ENTRY(s3c2410_cpu_resume) | |||
165 | mcr p15, 0, r5, c13, c0, 0 @ PID | 164 | mcr p15, 0, r5, c13, c0, 0 @ PID |
166 | mcr p15, 0, r6, c3, c0, 0 @ Domain ID | 165 | mcr p15, 0, r6, c3, c0, 0 @ Domain ID |
167 | mcr p15, 0, r7, c2, c0, 0 @ translation table base | 166 | mcr p15, 0, r7, c2, c0, 0 @ translation table base |
168 | mcr p15, 0, r8, c1, c1, 0 @ auxilliary control | ||
169 | 167 | ||
170 | #ifdef CONFIG_DEBUG_RESUME | 168 | #ifdef CONFIG_DEBUG_RESUME |
171 | mov r3, #'R' | 169 | mov r3, #'R' |
@@ -173,7 +171,7 @@ ENTRY(s3c2410_cpu_resume) | |||
173 | #endif | 171 | #endif |
174 | 172 | ||
175 | ldr r2, =resume_with_mmu | 173 | ldr r2, =resume_with_mmu |
176 | mcr p15, 0, r9, c1, c0, 0 @ turn on MMU, etc | 174 | mcr p15, 0, r8, c1, c0, 0 @ turn on MMU, etc |
177 | nop @ second-to-last before mmu | 175 | nop @ second-to-last before mmu |
178 | mov pc, r2 @ go back to virtual address | 176 | mov pc, r2 @ go back to virtual address |
179 | 177 | ||
diff --git a/arch/arm/mach-sa1100/irq.c b/arch/arm/mach-sa1100/irq.c index c131a5201b5b..b3a56024182e 100644 --- a/arch/arm/mach-sa1100/irq.c +++ b/arch/arm/mach-sa1100/irq.c | |||
@@ -199,10 +199,26 @@ static void sa1100_unmask_irq(unsigned int irq) | |||
199 | ICMR |= (1 << irq); | 199 | ICMR |= (1 << irq); |
200 | } | 200 | } |
201 | 201 | ||
202 | /* | ||
203 | * Apart form GPIOs, only the RTC alarm can be a wakeup event. | ||
204 | */ | ||
205 | static int sa1100_set_wake(unsigned int irq, unsigned int on) | ||
206 | { | ||
207 | if (irq == IRQ_RTCAlrm) { | ||
208 | if (on) | ||
209 | PWER |= PWER_RTC; | ||
210 | else | ||
211 | PWER &= ~PWER_RTC; | ||
212 | return 0; | ||
213 | } | ||
214 | return -EINVAL; | ||
215 | } | ||
216 | |||
202 | static struct irqchip sa1100_normal_chip = { | 217 | static struct irqchip sa1100_normal_chip = { |
203 | .ack = sa1100_mask_irq, | 218 | .ack = sa1100_mask_irq, |
204 | .mask = sa1100_mask_irq, | 219 | .mask = sa1100_mask_irq, |
205 | .unmask = sa1100_unmask_irq, | 220 | .unmask = sa1100_unmask_irq, |
221 | .set_wake = sa1100_set_wake, | ||
206 | }; | 222 | }; |
207 | 223 | ||
208 | static struct resource irq_resource = { | 224 | static struct resource irq_resource = { |
diff --git a/arch/arm/mm/ioremap.c b/arch/arm/mm/ioremap.c index 25e0ca3e598c..c1f7180c7bed 100644 --- a/arch/arm/mm/ioremap.c +++ b/arch/arm/mm/ioremap.c | |||
@@ -141,7 +141,7 @@ __ioremap_pfn(unsigned long pfn, unsigned long offset, size_t size, | |||
141 | return NULL; | 141 | return NULL; |
142 | addr = (unsigned long)area->addr; | 142 | addr = (unsigned long)area->addr; |
143 | if (remap_area_pages(addr, pfn, size, flags)) { | 143 | if (remap_area_pages(addr, pfn, size, flags)) { |
144 | vfree((void *)addr); | 144 | vunmap((void *)addr); |
145 | return NULL; | 145 | return NULL; |
146 | } | 146 | } |
147 | return (void __iomem *) (offset + (char *)addr); | 147 | return (void __iomem *) (offset + (char *)addr); |
@@ -173,7 +173,7 @@ EXPORT_SYMBOL(__ioremap); | |||
173 | 173 | ||
174 | void __iounmap(void __iomem *addr) | 174 | void __iounmap(void __iomem *addr) |
175 | { | 175 | { |
176 | vfree((void *) (PAGE_MASK & (unsigned long) addr)); | 176 | vunmap((void *)(PAGE_MASK & (unsigned long)addr)); |
177 | } | 177 | } |
178 | EXPORT_SYMBOL(__iounmap); | 178 | EXPORT_SYMBOL(__iounmap); |
179 | 179 | ||
diff --git a/arch/arm/tools/mach-types b/arch/arm/tools/mach-types index 8ab5300dcb94..6d7de9c0412f 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: Mon Feb 20 10:18:02 2006 | 15 | # Last update: Mon May 8 20:11:05 2006 |
16 | # | 16 | # |
17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number | 17 | # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number |
18 | # | 18 | # |
@@ -566,8 +566,8 @@ switchgrass MACH_SWITCHGRASS SWITCHGRASS 549 | |||
566 | ens_cmu MACH_ENS_CMU ENS_CMU 550 | 566 | ens_cmu MACH_ENS_CMU ENS_CMU 550 |
567 | mm6_sdb MACH_MM6_SDB MM6_SDB 551 | 567 | mm6_sdb MACH_MM6_SDB MM6_SDB 551 |
568 | saturn MACH_SATURN SATURN 552 | 568 | saturn MACH_SATURN SATURN 552 |
569 | argonplusevb MACH_ARGONPLUSEVB ARGONPLUSEVB 553 | 569 | i30030evb MACH_ARGONPLUSEVB ARGONPLUSEVB 553 |
570 | scma11evb MACH_SCMA11EVB SCMA11EVB 554 | 570 | mxc27530evb MACH_SCMA11EVB SCMA11EVB 554 |
571 | smdk2800 MACH_SMDK2800 SMDK2800 555 | 571 | smdk2800 MACH_SMDK2800 SMDK2800 555 |
572 | mtwilson MACH_MTWILSON MTWILSON 556 | 572 | mtwilson MACH_MTWILSON MTWILSON 556 |
573 | ziti MACH_ZITI ZITI 557 | 573 | ziti MACH_ZITI ZITI 557 |
@@ -647,7 +647,7 @@ sendt MACH_SENDT SENDT 630 | |||
647 | mx2jazz MACH_MX2JAZZ MX2JAZZ 631 | 647 | mx2jazz MACH_MX2JAZZ MX2JAZZ 631 |
648 | multiio MACH_MULTIIO MULTIIO 632 | 648 | multiio MACH_MULTIIO MULTIIO 632 |
649 | hrdisplay MACH_HRDISPLAY HRDISPLAY 633 | 649 | hrdisplay MACH_HRDISPLAY HRDISPLAY 633 |
650 | scma11bb MACH_SCMA11BB SCMA11BB 634 | 650 | mxc27530ads MACH_SCMA11BB SCMA11BB 634 |
651 | trizeps3 MACH_TRIZEPS3 TRIZEPS3 635 | 651 | trizeps3 MACH_TRIZEPS3 TRIZEPS3 635 |
652 | zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636 | 652 | zefeerdza MACH_ZEFEERDZA ZEFEERDZA 636 |
653 | zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637 | 653 | zefeerdzb MACH_ZEFEERDZB ZEFEERDZB 637 |
@@ -721,7 +721,7 @@ gp32 MACH_GP32 GP32 706 | |||
721 | gem MACH_GEM GEM 707 | 721 | gem MACH_GEM GEM 707 |
722 | i858 MACH_I858 I858 708 | 722 | i858 MACH_I858 I858 708 |
723 | hx2750 MACH_HX2750 HX2750 709 | 723 | hx2750 MACH_HX2750 HX2750 709 |
724 | zeusevb MACH_ZEUSEVB ZEUSEVB 710 | 724 | mxc91131evb MACH_ZEUSEVB ZEUSEVB 710 |
725 | p700 MACH_P700 P700 711 | 725 | p700 MACH_P700 P700 711 |
726 | cpe MACH_CPE CPE 712 | 726 | cpe MACH_CPE CPE 712 |
727 | spitz MACH_SPITZ SPITZ 713 | 727 | spitz MACH_SPITZ SPITZ 713 |
@@ -802,7 +802,7 @@ cpuat91 MACH_CPUAT91 CPUAT91 787 | |||
802 | rea9200 MACH_REA9200 REA9200 788 | 802 | rea9200 MACH_REA9200 REA9200 788 |
803 | acts_pune_sa1110 MACH_ACTS_PUNE_SA1110 ACTS_PUNE_SA1110 789 | 803 | acts_pune_sa1110 MACH_ACTS_PUNE_SA1110 ACTS_PUNE_SA1110 789 |
804 | ixp425 MACH_IXP425 IXP425 790 | 804 | ixp425 MACH_IXP425 IXP425 790 |
805 | argonplusodyssey MACH_ARGONPLUSODYSSEY ARGONPLUSODYSSEY 791 | 805 | i30030ads MACH_ARGONPLUSODYSSEY ARGONPLUSODYSSEY 791 |
806 | perch MACH_PERCH PERCH 792 | 806 | perch MACH_PERCH PERCH 792 |
807 | eis05r1 MACH_EIS05R1 EIS05R1 793 | 807 | eis05r1 MACH_EIS05R1 EIS05R1 793 |
808 | pepperpad MACH_PEPPERPAD PEPPERPAD 794 | 808 | pepperpad MACH_PEPPERPAD PEPPERPAD 794 |
@@ -827,7 +827,7 @@ micro9l MACH_MICRO9L MICRO9L 812 | |||
827 | uc5471dsp MACH_UC5471DSP UC5471DSP 813 | 827 | uc5471dsp MACH_UC5471DSP UC5471DSP 813 |
828 | sj5471eng MACH_SJ5471ENG SJ5471ENG 814 | 828 | sj5471eng MACH_SJ5471ENG SJ5471ENG 814 |
829 | none MACH_CMPXA26X CMPXA26X 815 | 829 | none MACH_CMPXA26X CMPXA26X 815 |
830 | nc MACH_NC NC 816 | 830 | nc1 MACH_NC NC 816 |
831 | omap_palmte MACH_OMAP_PALMTE OMAP_PALMTE 817 | 831 | omap_palmte MACH_OMAP_PALMTE OMAP_PALMTE 817 |
832 | ajax52x MACH_AJAX52X AJAX52X 818 | 832 | ajax52x MACH_AJAX52X AJAX52X 818 |
833 | siriustar MACH_SIRIUSTAR SIRIUSTAR 819 | 833 | siriustar MACH_SIRIUSTAR SIRIUSTAR 819 |
@@ -930,7 +930,7 @@ netclient MACH_NETCLIENT NETCLIENT 916 | |||
930 | xscale_palmtt5 MACH_XSCALE_PALMTT5 XSCALE_PALMTT5 917 | 930 | xscale_palmtt5 MACH_XSCALE_PALMTT5 XSCALE_PALMTT5 917 |
931 | xscale_palmtc MACH_OMAP_PALMTC OMAP_PALMTC 918 | 931 | xscale_palmtc MACH_OMAP_PALMTC OMAP_PALMTC 918 |
932 | omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919 | 932 | omap_apollon MACH_OMAP_APOLLON OMAP_APOLLON 919 |
933 | argonlvevb MACH_ARGONLVEVB ARGONLVEVB 920 | 933 | mxc30030evb MACH_ARGONLVEVB ARGONLVEVB 920 |
934 | rea_2d MACH_REA_2D REA_2D 921 | 934 | rea_2d MACH_REA_2D REA_2D 921 |
935 | eti3e524 MACH_TI3E524 TI3E524 922 | 935 | eti3e524 MACH_TI3E524 TI3E524 922 |
936 | ateb9200 MACH_ATEB9200 ATEB9200 923 | 936 | ateb9200 MACH_ATEB9200 ATEB9200 923 |
@@ -965,7 +965,78 @@ sisteron MACH_SISTERON SISTERON 951 | |||
965 | rx1950 MACH_RX1950 RX1950 952 | 965 | rx1950 MACH_RX1950 RX1950 952 |
966 | tsc_venus MACH_TSC_VENUS TSC_VENUS 953 | 966 | tsc_venus MACH_TSC_VENUS TSC_VENUS 953 |
967 | ds101j MACH_DS101J DS101J 954 | 967 | ds101j MACH_DS101J DS101J 954 |
968 | mxc300_30ads MACH_MXC30030ADS MXC30030ADS 955 | 968 | mxc30030ads MACH_MXC30030ADS MXC30030ADS 955 |
969 | fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956 | 969 | fujitsu_wimaxsoc MACH_FUJITSU_WIMAXSOC FUJITSU_WIMAXSOC 956 |
970 | dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957 | 970 | dualpcmodem MACH_DUALPCMODEM DUALPCMODEM 957 |
971 | gesbc9312 MACH_GESBC9312 GESBC9312 958 | 971 | gesbc9312 MACH_GESBC9312 GESBC9312 958 |
972 | htcapache MACH_HTCAPACHE HTCAPACHE 959 | ||
973 | ixdp435 MACH_IXDP435 IXDP435 960 | ||
974 | catprovt100 MACH_CATPROVT100 CATPROVT100 961 | ||
975 | picotux1xx MACH_PICOTUX1XX PICOTUX1XX 962 | ||
976 | picotux2xx MACH_PICOTUX2XX PICOTUX2XX 963 | ||
977 | dsmg600 MACH_DSMG600 DSMG600 964 | ||
978 | empc2 MACH_EMPC2 EMPC2 965 | ||
979 | ventura MACH_VENTURA VENTURA 966 | ||
980 | phidget_sbc MACH_PHIDGET_SBC PHIDGET_SBC 967 | ||
981 | ij3k MACH_IJ3K IJ3K 968 | ||
982 | pisgah MACH_PISGAH PISGAH 969 | ||
983 | omap_fsample MACH_OMAP_FSAMPLE OMAP_FSAMPLE 970 | ||
984 | sg720 MACH_SG720 SG720 971 | ||
985 | redfox MACH_REDFOX REDFOX 972 | ||
986 | mysh_ep9315_1 MACH_MYSH_EP9315_1 MYSH_EP9315_1 973 | ||
987 | tpf106 MACH_TPF106 TPF106 974 | ||
988 | at91rm9200kg MACH_AT91RM9200KG AT91RM9200KG 975 | ||
989 | racemt2 MACH_SLEDB SLEDB 976 | ||
990 | ontrack MACH_ONTRACK ONTRACK 977 | ||
991 | pm1200 MACH_PM1200 PM1200 978 | ||
992 | ess24562 MACH_ESS24XXX ESS24XXX 979 | ||
993 | coremp7 MACH_COREMP7 COREMP7 980 | ||
994 | nexcoder_6446 MACH_NEXCODER_6446 NEXCODER_6446 981 | ||
995 | stvc8380 MACH_STVC8380 STVC8380 982 | ||
996 | teklynx MACH_TEKLYNX TEKLYNX 983 | ||
997 | carbonado MACH_CARBONADO CARBONADO 984 | ||
998 | sysmos_mp730 MACH_SYSMOS_MP730 SYSMOS_MP730 985 | ||
999 | snapper_cl15 MACH_SNAPPER_CL15 SNAPPER_CL15 986 | ||
1000 | pgigim MACH_PGIGIM PGIGIM 987 | ||
1001 | ptx9160p2 MACH_PTX9160P2 PTX9160P2 988 | ||
1002 | dcore1 MACH_DCORE1 DCORE1 989 | ||
1003 | victorpxa MACH_VICTORPXA VICTORPXA 990 | ||
1004 | mx2dtb MACH_MX2DTB MX2DTB 991 | ||
1005 | pxa_irex_er0100 MACH_PXA_IREX_ER0100 PXA_IREX_ER0100 992 | ||
1006 | omap_palmz71 MACH_OMAP_PALMZ71 OMAP_PALMZ71 993 | ||
1007 | bartec_deg MACH_BARTEC_DEG BARTEC_DEG 994 | ||
1008 | hw50251 MACH_HW50251 HW50251 995 | ||
1009 | ibox MACH_IBOX IBOX 996 | ||
1010 | atlaslh7a404 MACH_ATLASLH7A404 ATLASLH7A404 997 | ||
1011 | pt2026 MACH_PT2026 PT2026 998 | ||
1012 | htcalpine MACH_HTCALPINE HTCALPINE 999 | ||
1013 | bartec_vtu MACH_BARTEC_VTU BARTEC_VTU 1000 | ||
1014 | vcoreii MACH_VCOREII VCOREII 1001 | ||
1015 | pdnb3 MACH_PDNB3 PDNB3 1002 | ||
1016 | htcbeetles MACH_HTCBEETLES HTCBEETLES 1003 | ||
1017 | s3c6400 MACH_S3C6400 S3C6400 1004 | ||
1018 | s3c2443 MACH_S3C2443 S3C2443 1005 | ||
1019 | omap_ldk MACH_OMAP_LDK OMAP_LDK 1006 | ||
1020 | smdk2460 MACH_SMDK2460 SMDK2460 1007 | ||
1021 | smdk2440 MACH_SMDK2440 SMDK2440 1008 | ||
1022 | smdk2412 MACH_SMDK2412 SMDK2412 1009 | ||
1023 | webbox MACH_WEBBOX WEBBOX 1010 | ||
1024 | cwwndp MACH_CWWNDP CWWNDP 1011 | ||
1025 | dragon MACH_DRAGON DRAGON 1012 | ||
1026 | opendo_cpu_board MACH_OPENDO_CPU_BOARD OPENDO_CPU_BOARD 1013 | ||
1027 | ccm2200 MACH_CCM2200 CCM2200 1014 | ||
1028 | etwarm MACH_ETWARM ETWARM 1015 | ||
1029 | m93030 MACH_M93030 M93030 1016 | ||
1030 | cc7u MACH_CC7U CC7U 1017 | ||
1031 | mtt_ranger MACH_MTT_RANGER MTT_RANGER 1018 | ||
1032 | nexus MACH_NEXUS NEXUS 1019 | ||
1033 | desman MACH_DESMAN DESMAN 1020 | ||
1034 | bkde303 MACH_BKDE303 BKDE303 1021 | ||
1035 | smdk2413 MACH_SMDK2413 SMDK2413 1022 | ||
1036 | aml_m7200 MACH_AML_M7200 AML_M7200 1023 | ||
1037 | aml_m5900 MACH_AML_M5900 AML_M5900 1024 | ||
1038 | sg640 MACH_SG640 SG640 1025 | ||
1039 | edg79524 MACH_EDG79524 EDG79524 1026 | ||
1040 | ai2410 MACH_AI2410 AI2410 1027 | ||
1041 | ixp465 MACH_IXP465 IXP465 1028 | ||
1042 | balloon3 MACH_BALLOON3 BALLOON3 1029 | ||
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index c6fe99e57a05..8dfa3054f10f 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -758,10 +758,10 @@ config HOTPLUG_CPU | |||
758 | bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" | 758 | bool "Support for hot-pluggable CPUs (EXPERIMENTAL)" |
759 | depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER | 759 | depends on SMP && HOTPLUG && EXPERIMENTAL && !X86_VOYAGER |
760 | ---help--- | 760 | ---help--- |
761 | Say Y here to experiment with turning CPUs off and on. CPUs | 761 | Say Y here to experiment with turning CPUs off and on, and to |
762 | can be controlled through /sys/devices/system/cpu. | 762 | enable suspend on SMP systems. CPUs can be controlled through |
763 | /sys/devices/system/cpu. | ||
763 | 764 | ||
764 | Say N. | ||
765 | 765 | ||
766 | endmenu | 766 | endmenu |
767 | 767 | ||
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index 40e5aba3ad3d..daee69579b1c 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -1066,6 +1066,14 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = { | |||
1066 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), | 1066 | DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"), |
1067 | }, | 1067 | }, |
1068 | }, | 1068 | }, |
1069 | { | ||
1070 | .callback = disable_acpi_pci, | ||
1071 | .ident = "HP xw9300", | ||
1072 | .matches = { | ||
1073 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
1074 | DMI_MATCH(DMI_PRODUCT_NAME, "HP xw9300 Workstation"), | ||
1075 | }, | ||
1076 | }, | ||
1069 | {} | 1077 | {} |
1070 | }; | 1078 | }; |
1071 | 1079 | ||
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 013b85df18c6..3d4b2f3d116a 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -1341,6 +1341,14 @@ int __init APIC_init_uniprocessor (void) | |||
1341 | 1341 | ||
1342 | connect_bsp_APIC(); | 1342 | connect_bsp_APIC(); |
1343 | 1343 | ||
1344 | /* | ||
1345 | * Hack: In case of kdump, after a crash, kernel might be booting | ||
1346 | * on a cpu with non-zero lapic id. But boot_cpu_physical_apicid | ||
1347 | * might be zero if read from MP tables. Get it from LAPIC. | ||
1348 | */ | ||
1349 | #ifdef CONFIG_CRASH_DUMP | ||
1350 | boot_cpu_physical_apicid = GET_APIC_ID(apic_read(APIC_ID)); | ||
1351 | #endif | ||
1344 | phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); | 1352 | phys_cpu_present_map = physid_mask_of_physid(boot_cpu_physical_apicid); |
1345 | 1353 | ||
1346 | setup_local_APIC(); | 1354 | setup_local_APIC(); |
diff --git a/arch/i386/kernel/io_apic.c b/arch/i386/kernel/io_apic.c index f8f132aa5472..d70f2ade5cde 100644 --- a/arch/i386/kernel/io_apic.c +++ b/arch/i386/kernel/io_apic.c | |||
@@ -2238,6 +2238,8 @@ static inline void unlock_ExtINT_logic(void) | |||
2238 | spin_unlock_irqrestore(&ioapic_lock, flags); | 2238 | spin_unlock_irqrestore(&ioapic_lock, flags); |
2239 | } | 2239 | } |
2240 | 2240 | ||
2241 | int timer_uses_ioapic_pin_0; | ||
2242 | |||
2241 | /* | 2243 | /* |
2242 | * This code may look a bit paranoid, but it's supposed to cooperate with | 2244 | * This code may look a bit paranoid, but it's supposed to cooperate with |
2243 | * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ | 2245 | * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ |
@@ -2274,6 +2276,9 @@ static inline void check_timer(void) | |||
2274 | pin2 = ioapic_i8259.pin; | 2276 | pin2 = ioapic_i8259.pin; |
2275 | apic2 = ioapic_i8259.apic; | 2277 | apic2 = ioapic_i8259.apic; |
2276 | 2278 | ||
2279 | if (pin1 == 0) | ||
2280 | timer_uses_ioapic_pin_0 = 1; | ||
2281 | |||
2277 | printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", | 2282 | printk(KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", |
2278 | vector, apic1, pin1, apic2, pin2); | 2283 | vector, apic1, pin1, apic2, pin2); |
2279 | 2284 | ||
diff --git a/arch/i386/kernel/mpparse.c b/arch/i386/kernel/mpparse.c index 34d21e21e012..6b1392d33ed5 100644 --- a/arch/i386/kernel/mpparse.c +++ b/arch/i386/kernel/mpparse.c | |||
@@ -1130,7 +1130,17 @@ int mp_register_gsi (u32 gsi, int triggering, int polarity) | |||
1130 | */ | 1130 | */ |
1131 | int irq = gsi; | 1131 | int irq = gsi; |
1132 | if (gsi < MAX_GSI_NUM) { | 1132 | if (gsi < MAX_GSI_NUM) { |
1133 | if (gsi > 15) | 1133 | /* |
1134 | * Retain the VIA chipset work-around (gsi > 15), but | ||
1135 | * avoid a problem where the 8254 timer (IRQ0) is setup | ||
1136 | * via an override (so it's not on pin 0 of the ioapic), | ||
1137 | * and at the same time, the pin 0 interrupt is a PCI | ||
1138 | * type. The gsi > 15 test could cause these two pins | ||
1139 | * to be shared as IRQ0, and they are not shareable. | ||
1140 | * So test for this condition, and if necessary, avoid | ||
1141 | * the pin collision. | ||
1142 | */ | ||
1143 | if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0)) | ||
1134 | gsi = pci_irq++; | 1144 | gsi = pci_irq++; |
1135 | /* | 1145 | /* |
1136 | * Don't assign IRQ used by ACPI SCI | 1146 | * Don't assign IRQ used by ACPI SCI |
diff --git a/arch/i386/kernel/setup.c b/arch/i386/kernel/setup.c index d77e89ac0d54..846e1639ef7c 100644 --- a/arch/i386/kernel/setup.c +++ b/arch/i386/kernel/setup.c | |||
@@ -1320,6 +1320,8 @@ legacy_init_iomem_resources(struct resource *code_resource, struct resource *dat | |||
1320 | probe_roms(); | 1320 | probe_roms(); |
1321 | for (i = 0; i < e820.nr_map; i++) { | 1321 | for (i = 0; i < e820.nr_map; i++) { |
1322 | struct resource *res; | 1322 | struct resource *res; |
1323 | if (e820.map[i].addr + e820.map[i].size > 0x100000000ULL) | ||
1324 | continue; | ||
1323 | res = kzalloc(sizeof(struct resource), GFP_ATOMIC); | 1325 | res = kzalloc(sizeof(struct resource), GFP_ATOMIC); |
1324 | switch (e820.map[i].type) { | 1326 | switch (e820.map[i].type) { |
1325 | case E820_RAM: res->name = "System RAM"; break; | 1327 | case E820_RAM: res->name = "System RAM"; break; |
diff --git a/arch/i386/kernel/traps.c b/arch/i386/kernel/traps.c index 2d22f5761b1d..0e498369f35e 100644 --- a/arch/i386/kernel/traps.c +++ b/arch/i386/kernel/traps.c | |||
@@ -130,9 +130,8 @@ static inline int print_addr_and_symbol(unsigned long addr, char *log_lvl, | |||
130 | print_symbol("%s", addr); | 130 | print_symbol("%s", addr); |
131 | 131 | ||
132 | printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS; | 132 | printed = (printed + 1) % CONFIG_STACK_BACKTRACE_COLS; |
133 | |||
134 | if (printed) | 133 | if (printed) |
135 | printk(" "); | 134 | printk(" "); |
136 | else | 135 | else |
137 | printk("\n"); | 136 | printk("\n"); |
138 | 137 | ||
@@ -212,7 +211,6 @@ static void show_stack_log_lvl(struct task_struct *task, unsigned long *esp, | |||
212 | } | 211 | } |
213 | 212 | ||
214 | stack = esp; | 213 | stack = esp; |
215 | printk(log_lvl); | ||
216 | for(i = 0; i < kstack_depth_to_print; i++) { | 214 | for(i = 0; i < kstack_depth_to_print; i++) { |
217 | if (kstack_end(stack)) | 215 | if (kstack_end(stack)) |
218 | break; | 216 | break; |
diff --git a/arch/i386/mm/init.c b/arch/i386/mm/init.c index ae6534ad8161..3df1371d4520 100644 --- a/arch/i386/mm/init.c +++ b/arch/i386/mm/init.c | |||
@@ -651,7 +651,7 @@ void __init mem_init(void) | |||
651 | * Specifically, in the case of x86, we will always add | 651 | * Specifically, in the case of x86, we will always add |
652 | * memory to the highmem for now. | 652 | * memory to the highmem for now. |
653 | */ | 653 | */ |
654 | #ifdef CONFIG_HOTPLUG_MEMORY | 654 | #ifdef CONFIG_MEMORY_HOTPLUG |
655 | #ifndef CONFIG_NEED_MULTIPLE_NODES | 655 | #ifndef CONFIG_NEED_MULTIPLE_NODES |
656 | int add_memory(u64 start, u64 size) | 656 | int add_memory(u64 start, u64 size) |
657 | { | 657 | { |
diff --git a/arch/i386/oprofile/nmi_int.c b/arch/i386/oprofile/nmi_int.c index 1a2076ce6f6a..ec0fd3cfa774 100644 --- a/arch/i386/oprofile/nmi_int.c +++ b/arch/i386/oprofile/nmi_int.c | |||
@@ -332,10 +332,11 @@ static int __init ppro_init(char ** cpu_type) | |||
332 | { | 332 | { |
333 | __u8 cpu_model = boot_cpu_data.x86_model; | 333 | __u8 cpu_model = boot_cpu_data.x86_model; |
334 | 334 | ||
335 | if (cpu_model > 0xd) | 335 | if (cpu_model == 14) |
336 | *cpu_type = "i386/core"; | ||
337 | else if (cpu_model > 0xd) | ||
336 | return 0; | 338 | return 0; |
337 | 339 | else if (cpu_model == 9) { | |
338 | if (cpu_model == 9) { | ||
339 | *cpu_type = "i386/p6_mobile"; | 340 | *cpu_type = "i386/p6_mobile"; |
340 | } else if (cpu_model > 5) { | 341 | } else if (cpu_model > 5) { |
341 | *cpu_type = "i386/piii"; | 342 | *cpu_type = "i386/piii"; |
diff --git a/arch/i386/power/cpu.c b/arch/i386/power/cpu.c index 50a0bef8c85f..79b2370c7fac 100644 --- a/arch/i386/power/cpu.c +++ b/arch/i386/power/cpu.c | |||
@@ -92,7 +92,7 @@ void __restore_processor_state(struct saved_context *ctxt) | |||
92 | write_cr4(ctxt->cr4); | 92 | write_cr4(ctxt->cr4); |
93 | write_cr3(ctxt->cr3); | 93 | write_cr3(ctxt->cr3); |
94 | write_cr2(ctxt->cr2); | 94 | write_cr2(ctxt->cr2); |
95 | write_cr2(ctxt->cr0); | 95 | write_cr0(ctxt->cr0); |
96 | 96 | ||
97 | /* | 97 | /* |
98 | * now restore the descriptor tables to their proper values | 98 | * now restore the descriptor tables to their proper values |
diff --git a/arch/ia64/configs/sn2_defconfig b/arch/ia64/configs/sn2_defconfig index f6a8853cd1b4..9ea35398e10d 100644 --- a/arch/ia64/configs/sn2_defconfig +++ b/arch/ia64/configs/sn2_defconfig | |||
@@ -134,7 +134,7 @@ CONFIG_ARCH_FLATMEM_ENABLE=y | |||
134 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | 134 | CONFIG_ARCH_SPARSEMEM_ENABLE=y |
135 | CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y | 135 | CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y |
136 | CONFIG_NUMA=y | 136 | CONFIG_NUMA=y |
137 | CONFIG_NODES_SHIFT=8 | 137 | CONFIG_NODES_SHIFT=10 |
138 | CONFIG_VIRTUAL_MEM_MAP=y | 138 | CONFIG_VIRTUAL_MEM_MAP=y |
139 | CONFIG_HOLES_IN_ZONE=y | 139 | CONFIG_HOLES_IN_ZONE=y |
140 | CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y | 140 | CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y |
@@ -1159,7 +1159,7 @@ CONFIG_DETECT_SOFTLOCKUP=y | |||
1159 | # CONFIG_SCHEDSTATS is not set | 1159 | # CONFIG_SCHEDSTATS is not set |
1160 | # CONFIG_DEBUG_SLAB is not set | 1160 | # CONFIG_DEBUG_SLAB is not set |
1161 | CONFIG_DEBUG_PREEMPT=y | 1161 | CONFIG_DEBUG_PREEMPT=y |
1162 | CONFIG_DEBUG_MUTEXES=y | 1162 | # CONFIG_DEBUG_MUTEXES is not set |
1163 | # CONFIG_DEBUG_SPINLOCK is not set | 1163 | # CONFIG_DEBUG_SPINLOCK is not set |
1164 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set | 1164 | # CONFIG_DEBUG_SPINLOCK_SLEEP is not set |
1165 | # CONFIG_DEBUG_KOBJECT is not set | 1165 | # CONFIG_DEBUG_KOBJECT is not set |
diff --git a/arch/ia64/kernel/iosapic.c b/arch/ia64/kernel/iosapic.c index 7956eb9058fc..d58c1c5c903a 100644 --- a/arch/ia64/kernel/iosapic.c +++ b/arch/ia64/kernel/iosapic.c | |||
@@ -416,7 +416,7 @@ iosapic_end_level_irq (unsigned int irq) | |||
416 | ia64_vector vec = irq_to_vector(irq); | 416 | ia64_vector vec = irq_to_vector(irq); |
417 | struct iosapic_rte_info *rte; | 417 | struct iosapic_rte_info *rte; |
418 | 418 | ||
419 | move_irq(irq); | 419 | move_native_irq(irq); |
420 | list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) | 420 | list_for_each_entry(rte, &iosapic_intr_info[vec].rtes, rte_list) |
421 | iosapic_eoi(rte->addr, vec); | 421 | iosapic_eoi(rte->addr, vec); |
422 | } | 422 | } |
@@ -458,7 +458,7 @@ iosapic_ack_edge_irq (unsigned int irq) | |||
458 | { | 458 | { |
459 | irq_desc_t *idesc = irq_descp(irq); | 459 | irq_desc_t *idesc = irq_descp(irq); |
460 | 460 | ||
461 | move_irq(irq); | 461 | move_native_irq(irq); |
462 | /* | 462 | /* |
463 | * Once we have recorded IRQ_PENDING already, we can mask the | 463 | * Once we have recorded IRQ_PENDING already, we can mask the |
464 | * interrupt for real. This prevents IRQ storms from unhandled | 464 | * interrupt for real. This prevents IRQ storms from unhandled |
diff --git a/arch/ia64/kernel/irq.c b/arch/ia64/kernel/irq.c index 5ce908ef9c95..9c72ea3f6432 100644 --- a/arch/ia64/kernel/irq.c +++ b/arch/ia64/kernel/irq.c | |||
@@ -101,7 +101,6 @@ void set_irq_affinity_info (unsigned int irq, int hwid, int redir) | |||
101 | 101 | ||
102 | if (irq < NR_IRQS) { | 102 | if (irq < NR_IRQS) { |
103 | irq_affinity[irq] = mask; | 103 | irq_affinity[irq] = mask; |
104 | set_irq_info(irq, mask); | ||
105 | irq_redir[irq] = (char) (redir & 0xff); | 104 | irq_redir[irq] = (char) (redir & 0xff); |
106 | } | 105 | } |
107 | } | 106 | } |
diff --git a/arch/ia64/lib/memcpy_mck.S b/arch/ia64/lib/memcpy_mck.S index 46c9331e7ab5..9e534d52b1d5 100644 --- a/arch/ia64/lib/memcpy_mck.S +++ b/arch/ia64/lib/memcpy_mck.S | |||
@@ -6,7 +6,9 @@ | |||
6 | * in1: source address | 6 | * in1: source address |
7 | * in2: number of bytes to copy | 7 | * in2: number of bytes to copy |
8 | * Output: | 8 | * Output: |
9 | * 0 if success, or number of byte NOT copied if error occurred. | 9 | * for memcpy: return dest |
10 | * for copy_user: return 0 if success, | ||
11 | * or number of byte NOT copied if error occurred. | ||
10 | * | 12 | * |
11 | * Copyright (C) 2002 Intel Corp. | 13 | * Copyright (C) 2002 Intel Corp. |
12 | * Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com> | 14 | * Copyright (C) 2002 Ken Chen <kenneth.w.chen@intel.com> |
@@ -73,6 +75,7 @@ GLOBAL_ENTRY(memcpy) | |||
73 | and r28=0x7,in0 | 75 | and r28=0x7,in0 |
74 | and r29=0x7,in1 | 76 | and r29=0x7,in1 |
75 | mov f6=f0 | 77 | mov f6=f0 |
78 | mov retval=in0 | ||
76 | br.cond.sptk .common_code | 79 | br.cond.sptk .common_code |
77 | ;; | 80 | ;; |
78 | END(memcpy) | 81 | END(memcpy) |
@@ -84,7 +87,7 @@ GLOBAL_ENTRY(__copy_user) | |||
84 | mov f6=f1 | 87 | mov f6=f1 |
85 | mov saved_in0=in0 // save dest pointer | 88 | mov saved_in0=in0 // save dest pointer |
86 | mov saved_in1=in1 // save src pointer | 89 | mov saved_in1=in1 // save src pointer |
87 | mov saved_in2=in2 // save len | 90 | mov retval=r0 // initialize return value |
88 | ;; | 91 | ;; |
89 | .common_code: | 92 | .common_code: |
90 | cmp.gt p15,p0=8,in2 // check for small size | 93 | cmp.gt p15,p0=8,in2 // check for small size |
@@ -92,7 +95,7 @@ GLOBAL_ENTRY(__copy_user) | |||
92 | cmp.ne p14,p0=0,r29 // check src alignment | 95 | cmp.ne p14,p0=0,r29 // check src alignment |
93 | add src0=0,in1 | 96 | add src0=0,in1 |
94 | sub r30=8,r28 // for .align_dest | 97 | sub r30=8,r28 // for .align_dest |
95 | mov retval=r0 // initialize return value | 98 | mov saved_in2=in2 // save len |
96 | ;; | 99 | ;; |
97 | add dst0=0,in0 | 100 | add dst0=0,in0 |
98 | add dst1=1,in0 // dest odd index | 101 | add dst1=1,in0 // dest odd index |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 078fb5533541..2d80653aa2af 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -1636,7 +1636,7 @@ static int __init prom_find_machine_type(void) | |||
1636 | compat, sizeof(compat)-1); | 1636 | compat, sizeof(compat)-1); |
1637 | if (len <= 0) | 1637 | if (len <= 0) |
1638 | return PLATFORM_GENERIC; | 1638 | return PLATFORM_GENERIC; |
1639 | if (strncmp(compat, RELOC("chrp"), 4)) | 1639 | if (strcmp(compat, RELOC("chrp"))) |
1640 | return PLATFORM_GENERIC; | 1640 | return PLATFORM_GENERIC; |
1641 | 1641 | ||
1642 | /* Default to pSeries. We need to know if we are running LPAR */ | 1642 | /* Default to pSeries. We need to know if we are running LPAR */ |
diff --git a/arch/powerpc/kernel/systbl.S b/arch/powerpc/kernel/systbl.S index cf56a1d499ff..26ed1f5ef16e 100644 --- a/arch/powerpc/kernel/systbl.S +++ b/arch/powerpc/kernel/systbl.S | |||
@@ -338,6 +338,8 @@ SYSCALL(symlinkat) | |||
338 | SYSCALL(readlinkat) | 338 | SYSCALL(readlinkat) |
339 | SYSCALL(fchmodat) | 339 | SYSCALL(fchmodat) |
340 | SYSCALL(faccessat) | 340 | SYSCALL(faccessat) |
341 | COMPAT_SYS(get_robust_list) | ||
342 | COMPAT_SYS(set_robust_list) | ||
341 | 343 | ||
342 | /* | 344 | /* |
343 | * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c | 345 | * please add new calls to arch/powerpc/platforms/cell/spu_callbacks.c |
diff --git a/arch/powerpc/platforms/cell/spu_callbacks.c b/arch/powerpc/platforms/cell/spu_callbacks.c index 95b36430aa0f..b47fcc5ddb78 100644 --- a/arch/powerpc/platforms/cell/spu_callbacks.c +++ b/arch/powerpc/platforms/cell/spu_callbacks.c | |||
@@ -258,6 +258,7 @@ void *spu_syscall_table[] = { | |||
258 | [__NR_futex] sys_futex, | 258 | [__NR_futex] sys_futex, |
259 | [__NR_sched_setaffinity] sys_sched_setaffinity, | 259 | [__NR_sched_setaffinity] sys_sched_setaffinity, |
260 | [__NR_sched_getaffinity] sys_sched_getaffinity, | 260 | [__NR_sched_getaffinity] sys_sched_getaffinity, |
261 | [224] sys_ni_syscall, | ||
261 | [__NR_tuxcall] sys_ni_syscall, | 262 | [__NR_tuxcall] sys_ni_syscall, |
262 | [226] sys_ni_syscall, | 263 | [226] sys_ni_syscall, |
263 | [__NR_io_setup] sys_io_setup, | 264 | [__NR_io_setup] sys_io_setup, |
@@ -332,19 +333,21 @@ void *spu_syscall_table[] = { | |||
332 | [__NR_readlinkat] sys_readlinkat, | 333 | [__NR_readlinkat] sys_readlinkat, |
333 | [__NR_fchmodat] sys_fchmodat, | 334 | [__NR_fchmodat] sys_fchmodat, |
334 | [__NR_faccessat] sys_faccessat, | 335 | [__NR_faccessat] sys_faccessat, |
336 | [__NR_get_robust_list] sys_get_robust_list, | ||
337 | [__NR_set_robust_list] sys_set_robust_list, | ||
335 | }; | 338 | }; |
336 | 339 | ||
337 | long spu_sys_callback(struct spu_syscall_block *s) | 340 | long spu_sys_callback(struct spu_syscall_block *s) |
338 | { | 341 | { |
339 | long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); | 342 | long (*syscall)(u64 a1, u64 a2, u64 a3, u64 a4, u64 a5, u64 a6); |
340 | 343 | ||
341 | syscall = spu_syscall_table[s->nr_ret]; | ||
342 | |||
343 | if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { | 344 | if (s->nr_ret >= ARRAY_SIZE(spu_syscall_table)) { |
344 | pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); | 345 | pr_debug("%s: invalid syscall #%ld", __FUNCTION__, s->nr_ret); |
345 | return -ENOSYS; | 346 | return -ENOSYS; |
346 | } | 347 | } |
347 | 348 | ||
349 | syscall = spu_syscall_table[s->nr_ret]; | ||
350 | |||
348 | #ifdef DEBUG | 351 | #ifdef DEBUG |
349 | print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); | 352 | print_symbol(KERN_DEBUG "SPU-syscall %s:", (unsigned long)syscall); |
350 | printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", | 353 | printk("syscall%ld(%lx, %lx, %lx, %lx, %lx, %lx)\n", |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 5eb55ef1c91c..5f79f01c44f2 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -255,7 +255,7 @@ static int __init pSeries_init_panel(void) | |||
255 | { | 255 | { |
256 | /* Manually leave the kernel version on the panel. */ | 256 | /* Manually leave the kernel version on the panel. */ |
257 | ppc_md.progress("Linux ppc64\n", 0); | 257 | ppc_md.progress("Linux ppc64\n", 0); |
258 | ppc_md.progress(system_utsname.version, 0); | 258 | ppc_md.progress(system_utsname.release, 0); |
259 | 259 | ||
260 | return 0; | 260 | return 0; |
261 | } | 261 | } |
diff --git a/arch/ppc/kernel/head_8xx.S b/arch/ppc/kernel/head_8xx.S index ec53c7d65f2b..7a2f20583be4 100644 --- a/arch/ppc/kernel/head_8xx.S +++ b/arch/ppc/kernel/head_8xx.S | |||
@@ -355,9 +355,7 @@ InstructionTLBMiss: | |||
355 | 355 | ||
356 | . = 0x1200 | 356 | . = 0x1200 |
357 | DataStoreTLBMiss: | 357 | DataStoreTLBMiss: |
358 | #ifdef CONFIG_8xx_CPU6 | ||
359 | stw r3, 8(r0) | 358 | stw r3, 8(r0) |
360 | #endif | ||
361 | DO_8xx_CPU6(0x3f80, r3) | 359 | DO_8xx_CPU6(0x3f80, r3) |
362 | mtspr SPRN_M_TW, r10 /* Save a couple of working registers */ | 360 | mtspr SPRN_M_TW, r10 /* Save a couple of working registers */ |
363 | mfcr r10 | 361 | mfcr r10 |
@@ -417,9 +415,7 @@ DataStoreTLBMiss: | |||
417 | lwz r11, 0(r0) | 415 | lwz r11, 0(r0) |
418 | mtcr r11 | 416 | mtcr r11 |
419 | lwz r11, 4(r0) | 417 | lwz r11, 4(r0) |
420 | #ifdef CONFIG_8xx_CPU6 | ||
421 | lwz r3, 8(r0) | 418 | lwz r3, 8(r0) |
422 | #endif | ||
423 | rfi | 419 | rfi |
424 | 420 | ||
425 | /* This is an instruction TLB error on the MPC8xx. This could be due | 421 | /* This is an instruction TLB error on the MPC8xx. This could be due |
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index ef5b9c44b86b..4d53b2739357 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1650,3 +1650,11 @@ sys_tee_wrapper: | |||
1650 | llgfr %r4,%r4 # size_t | 1650 | llgfr %r4,%r4 # size_t |
1651 | llgfr %r5,%r5 # unsigned int | 1651 | llgfr %r5,%r5 # unsigned int |
1652 | jg sys_tee | 1652 | jg sys_tee |
1653 | |||
1654 | .globl compat_sys_vmsplice_wrapper | ||
1655 | compat_sys_vmsplice_wrapper: | ||
1656 | lgfr %r2,%r2 # int | ||
1657 | llgtr %r3,%r3 # compat_iovec * | ||
1658 | llgfr %r4,%r4 # unsigned int | ||
1659 | llgfr %r5,%r5 # unsigned int | ||
1660 | jg compat_sys_vmsplice | ||
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index fc2c0767202b..93be1d56c036 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -317,3 +317,4 @@ SYSCALL(sys_get_robust_list,sys_get_robust_list,compat_sys_get_robust_list_wrapp | |||
317 | SYSCALL(sys_splice,sys_splice,sys_splice_wrapper) | 317 | SYSCALL(sys_splice,sys_splice,sys_splice_wrapper) |
318 | SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper) | 318 | SYSCALL(sys_sync_file_range,sys_sync_file_range,sys_sync_file_range_wrapper) |
319 | SYSCALL(sys_tee,sys_tee,sys_tee_wrapper) | 319 | SYSCALL(sys_tee,sys_tee,sys_tee_wrapper) |
320 | SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper) | ||
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index fea043b69b91..ce19ad4e92ec 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -249,18 +249,19 @@ static inline void stop_hz_timer(void) | |||
249 | unsigned long flags; | 249 | unsigned long flags; |
250 | unsigned long seq, next; | 250 | unsigned long seq, next; |
251 | __u64 timer, todval; | 251 | __u64 timer, todval; |
252 | int cpu = smp_processor_id(); | ||
252 | 253 | ||
253 | if (sysctl_hz_timer != 0) | 254 | if (sysctl_hz_timer != 0) |
254 | return; | 255 | return; |
255 | 256 | ||
256 | cpu_set(smp_processor_id(), nohz_cpu_mask); | 257 | cpu_set(cpu, nohz_cpu_mask); |
257 | 258 | ||
258 | /* | 259 | /* |
259 | * Leave the clock comparator set up for the next timer | 260 | * Leave the clock comparator set up for the next timer |
260 | * tick if either rcu or a softirq is pending. | 261 | * tick if either rcu or a softirq is pending. |
261 | */ | 262 | */ |
262 | if (rcu_pending(smp_processor_id()) || local_softirq_pending()) { | 263 | if (rcu_needs_cpu(cpu) || local_softirq_pending()) { |
263 | cpu_clear(smp_processor_id(), nohz_cpu_mask); | 264 | cpu_clear(cpu, nohz_cpu_mask); |
264 | return; | 265 | return; |
265 | } | 266 | } |
266 | 267 | ||
@@ -271,7 +272,7 @@ static inline void stop_hz_timer(void) | |||
271 | next = next_timer_interrupt(); | 272 | next = next_timer_interrupt(); |
272 | do { | 273 | do { |
273 | seq = read_seqbegin_irqsave(&xtime_lock, flags); | 274 | seq = read_seqbegin_irqsave(&xtime_lock, flags); |
274 | timer = (__u64)(next - jiffies) + jiffies_64; | 275 | timer = (__u64 next) - (__u64 jiffies) + jiffies_64; |
275 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); | 276 | } while (read_seqretry_irqrestore(&xtime_lock, seq, flags)); |
276 | todval = -1ULL; | 277 | todval = -1ULL; |
277 | /* Be careful about overflows. */ | 278 | /* Be careful about overflows. */ |
diff --git a/arch/sparc/kernel/ioport.c b/arch/sparc/kernel/ioport.c index 460f72e640e6..f9ff29734848 100644 --- a/arch/sparc/kernel/ioport.c +++ b/arch/sparc/kernel/ioport.c | |||
@@ -274,6 +274,11 @@ void *sbus_alloc_consistent(struct sbus_dev *sdev, long len, u32 *dma_addrp) | |||
274 | if (mmu_map_dma_area(dma_addrp, va, res->start, len_total) != 0) | 274 | if (mmu_map_dma_area(dma_addrp, va, res->start, len_total) != 0) |
275 | goto err_noiommu; | 275 | goto err_noiommu; |
276 | 276 | ||
277 | /* Set the resource name, if known. */ | ||
278 | if (sdev) { | ||
279 | res->name = sdev->prom_name; | ||
280 | } | ||
281 | |||
277 | return (void *)res->start; | 282 | return (void *)res->start; |
278 | 283 | ||
279 | err_noiommu: | 284 | err_noiommu: |
diff --git a/arch/sparc/kernel/module.c b/arch/sparc/kernel/module.c index 787d5f1347ec..598682f31ebf 100644 --- a/arch/sparc/kernel/module.c +++ b/arch/sparc/kernel/module.c | |||
@@ -113,6 +113,7 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, | |||
113 | 113 | ||
114 | switch (ELF32_R_TYPE(rel[i].r_info)) { | 114 | switch (ELF32_R_TYPE(rel[i].r_info)) { |
115 | case R_SPARC_32: | 115 | case R_SPARC_32: |
116 | case R_SPARC_UA32: | ||
116 | location[0] = v >> 24; | 117 | location[0] = v >> 24; |
117 | location[1] = v >> 16; | 118 | location[1] = v >> 16; |
118 | location[2] = v >> 8; | 119 | location[2] = v >> 8; |
diff --git a/arch/sparc/kernel/sparc_ksyms.c b/arch/sparc/kernel/sparc_ksyms.c index ec1c9687d679..4b376fae752c 100644 --- a/arch/sparc/kernel/sparc_ksyms.c +++ b/arch/sparc/kernel/sparc_ksyms.c | |||
@@ -251,19 +251,9 @@ EXPORT_SYMBOL(__prom_getchild); | |||
251 | EXPORT_SYMBOL(__prom_getsibling); | 251 | EXPORT_SYMBOL(__prom_getsibling); |
252 | 252 | ||
253 | /* sparc library symbols */ | 253 | /* sparc library symbols */ |
254 | EXPORT_SYMBOL(memchr); | ||
255 | EXPORT_SYMBOL(memscan); | 254 | EXPORT_SYMBOL(memscan); |
256 | EXPORT_SYMBOL(strlen); | 255 | EXPORT_SYMBOL(strlen); |
257 | EXPORT_SYMBOL(strnlen); | ||
258 | EXPORT_SYMBOL(strcpy); | ||
259 | EXPORT_SYMBOL(strncpy); | ||
260 | EXPORT_SYMBOL(strcat); | ||
261 | EXPORT_SYMBOL(strncat); | ||
262 | EXPORT_SYMBOL(strcmp); | ||
263 | EXPORT_SYMBOL(strncmp); | 256 | EXPORT_SYMBOL(strncmp); |
264 | EXPORT_SYMBOL(strchr); | ||
265 | EXPORT_SYMBOL(strrchr); | ||
266 | EXPORT_SYMBOL(strstr); | ||
267 | EXPORT_SYMBOL(page_kernel); | 257 | EXPORT_SYMBOL(page_kernel); |
268 | 258 | ||
269 | /* Special internal versions of library functions. */ | 259 | /* Special internal versions of library functions. */ |
@@ -317,6 +307,3 @@ EXPORT_SYMBOL(do_BUG); | |||
317 | 307 | ||
318 | /* Sun Power Management Idle Handler */ | 308 | /* Sun Power Management Idle Handler */ |
319 | EXPORT_SYMBOL(pm_idle); | 309 | EXPORT_SYMBOL(pm_idle); |
320 | |||
321 | /* Binfmt_misc needs this */ | ||
322 | EXPORT_SYMBOL(sys_close); | ||
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S index 6e1135cc03b0..2856551bddf1 100644 --- a/arch/sparc/kernel/systbls.S +++ b/arch/sparc/kernel/systbls.S | |||
@@ -79,6 +79,7 @@ sys_call_table: | |||
79 | /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 | 79 | /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 |
80 | /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 80 | /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
81 | /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare | 81 | /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare |
82 | /*300*/ .long sys_set_robust_list, sys_get_robust_list | ||
82 | 83 | ||
83 | #ifdef CONFIG_SUNOS_EMUL | 84 | #ifdef CONFIG_SUNOS_EMUL |
84 | /* Now the SunOS syscall table. */ | 85 | /* Now the SunOS syscall table. */ |
@@ -190,6 +191,6 @@ sunos_sys_table: | |||
190 | /*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys | 191 | /*290*/ .long sunos_nosys, sunos_nosys, sunos_nosys |
191 | .long sunos_nosys, sunos_nosys, sunos_nosys | 192 | .long sunos_nosys, sunos_nosys, sunos_nosys |
192 | .long sunos_nosys, sunos_nosys, sunos_nosys | 193 | .long sunos_nosys, sunos_nosys, sunos_nosys |
193 | .long sunos_nosys | 194 | .long sunos_nosys, sunos_nosys, sunos_nosys |
194 | 195 | ||
195 | #endif | 196 | #endif |
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 1317380fa937..f09a70b8aabd 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.16 | 3 | # Linux kernel version: 2.6.17-rc3 |
4 | # Sun Apr 2 19:31:04 2006 | 4 | # Fri May 12 12:43:49 2006 |
5 | # | 5 | # |
6 | CONFIG_SPARC=y | 6 | CONFIG_SPARC=y |
7 | CONFIG_SPARC64=y | 7 | CONFIG_SPARC64=y |
@@ -114,6 +114,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y | |||
114 | CONFIG_HUGETLB_PAGE_SIZE_4MB=y | 114 | CONFIG_HUGETLB_PAGE_SIZE_4MB=y |
115 | # CONFIG_HUGETLB_PAGE_SIZE_512K is not set | 115 | # CONFIG_HUGETLB_PAGE_SIZE_512K is not set |
116 | # CONFIG_HUGETLB_PAGE_SIZE_64K is not set | 116 | # CONFIG_HUGETLB_PAGE_SIZE_64K is not set |
117 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | ||
117 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | 118 | CONFIG_ARCH_SPARSEMEM_ENABLE=y |
118 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y | 119 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y |
119 | CONFIG_LARGE_ALLOCS=y | 120 | CONFIG_LARGE_ALLOCS=y |
@@ -430,7 +431,6 @@ CONFIG_ISCSI_TCP=m | |||
430 | # CONFIG_SCSI_INIA100 is not set | 431 | # CONFIG_SCSI_INIA100 is not set |
431 | # CONFIG_SCSI_SYM53C8XX_2 is not set | 432 | # CONFIG_SCSI_SYM53C8XX_2 is not set |
432 | # CONFIG_SCSI_IPR is not set | 433 | # CONFIG_SCSI_IPR is not set |
433 | # CONFIG_SCSI_QLOGIC_FC is not set | ||
434 | # CONFIG_SCSI_QLOGIC_1280 is not set | 434 | # CONFIG_SCSI_QLOGIC_1280 is not set |
435 | # CONFIG_SCSI_QLOGICPTI is not set | 435 | # CONFIG_SCSI_QLOGICPTI is not set |
436 | # CONFIG_SCSI_QLA_FC is not set | 436 | # CONFIG_SCSI_QLA_FC is not set |
@@ -1042,9 +1042,7 @@ CONFIG_USB_HIDDEV=y | |||
1042 | # CONFIG_USB_ACECAD is not set | 1042 | # CONFIG_USB_ACECAD is not set |
1043 | # CONFIG_USB_KBTAB is not set | 1043 | # CONFIG_USB_KBTAB is not set |
1044 | # CONFIG_USB_POWERMATE is not set | 1044 | # CONFIG_USB_POWERMATE is not set |
1045 | # CONFIG_USB_MTOUCH is not set | 1045 | # CONFIG_USB_TOUCHSCREEN is not set |
1046 | # CONFIG_USB_ITMTOUCH is not set | ||
1047 | # CONFIG_USB_EGALAX is not set | ||
1048 | # CONFIG_USB_YEALINK is not set | 1046 | # CONFIG_USB_YEALINK is not set |
1049 | # CONFIG_USB_XPAD is not set | 1047 | # CONFIG_USB_XPAD is not set |
1050 | # CONFIG_USB_ATI_REMOTE is not set | 1048 | # CONFIG_USB_ATI_REMOTE is not set |
@@ -1115,6 +1113,14 @@ CONFIG_USB_HIDDEV=y | |||
1115 | # CONFIG_NEW_LEDS is not set | 1113 | # CONFIG_NEW_LEDS is not set |
1116 | 1114 | ||
1117 | # | 1115 | # |
1116 | # LED drivers | ||
1117 | # | ||
1118 | |||
1119 | # | ||
1120 | # LED Triggers | ||
1121 | # | ||
1122 | |||
1123 | # | ||
1118 | # InfiniBand support | 1124 | # InfiniBand support |
1119 | # | 1125 | # |
1120 | # CONFIG_INFINIBAND is not set | 1126 | # CONFIG_INFINIBAND is not set |
@@ -1303,6 +1309,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
1303 | # CONFIG_DEBUG_INFO is not set | 1309 | # CONFIG_DEBUG_INFO is not set |
1304 | CONFIG_DEBUG_FS=y | 1310 | CONFIG_DEBUG_FS=y |
1305 | # CONFIG_DEBUG_VM is not set | 1311 | # CONFIG_DEBUG_VM is not set |
1312 | # CONFIG_UNWIND_INFO is not set | ||
1306 | CONFIG_FORCED_INLINING=y | 1313 | CONFIG_FORCED_INLINING=y |
1307 | # CONFIG_RCU_TORTURE_TEST is not set | 1314 | # CONFIG_RCU_TORTURE_TEST is not set |
1308 | # CONFIG_DEBUG_STACK_USAGE is not set | 1315 | # CONFIG_DEBUG_STACK_USAGE is not set |
diff --git a/arch/sparc64/kernel/module.c b/arch/sparc64/kernel/module.c index 6c83e372f75d..579871527699 100644 --- a/arch/sparc64/kernel/module.c +++ b/arch/sparc64/kernel/module.c | |||
@@ -143,6 +143,11 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, | |||
143 | location[3] = v >> 0; | 143 | location[3] = v >> 0; |
144 | break; | 144 | break; |
145 | 145 | ||
146 | case R_SPARC_DISP32: | ||
147 | v -= (Elf64_Addr) location; | ||
148 | *loc32 = v; | ||
149 | break; | ||
150 | |||
146 | case R_SPARC_WDISP30: | 151 | case R_SPARC_WDISP30: |
147 | v -= (Elf64_Addr) location; | 152 | v -= (Elf64_Addr) location; |
148 | *loc32 = (*loc32 & ~0x3fffffff) | | 153 | *loc32 = (*loc32 & ~0x3fffffff) | |
diff --git a/arch/sparc64/kernel/pci_iommu.c b/arch/sparc64/kernel/pci_iommu.c index 8efbc139769d..82e5455134c6 100644 --- a/arch/sparc64/kernel/pci_iommu.c +++ b/arch/sparc64/kernel/pci_iommu.c | |||
@@ -218,7 +218,7 @@ static inline void iommu_free_ctx(struct pci_iommu *iommu, int ctx) | |||
218 | * DMA for PCI device PDEV. Return non-NULL cpu-side address if | 218 | * DMA for PCI device PDEV. Return non-NULL cpu-side address if |
219 | * successful and set *DMA_ADDRP to the PCI side dma address. | 219 | * successful and set *DMA_ADDRP to the PCI side dma address. |
220 | */ | 220 | */ |
221 | static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) | 221 | static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp) |
222 | { | 222 | { |
223 | struct pcidev_cookie *pcp; | 223 | struct pcidev_cookie *pcp; |
224 | struct pci_iommu *iommu; | 224 | struct pci_iommu *iommu; |
@@ -232,7 +232,7 @@ static void *pci_4u_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr | |||
232 | if (order >= 10) | 232 | if (order >= 10) |
233 | return NULL; | 233 | return NULL; |
234 | 234 | ||
235 | first_page = __get_free_pages(GFP_ATOMIC, order); | 235 | first_page = __get_free_pages(gfp, order); |
236 | if (first_page == 0UL) | 236 | if (first_page == 0UL) |
237 | return NULL; | 237 | return NULL; |
238 | memset((char *)first_page, 0, PAGE_SIZE << order); | 238 | memset((char *)first_page, 0, PAGE_SIZE << order); |
diff --git a/arch/sparc64/kernel/pci_sun4v.c b/arch/sparc64/kernel/pci_sun4v.c index 9e94db2573a2..2b7a1f316a93 100644 --- a/arch/sparc64/kernel/pci_sun4v.c +++ b/arch/sparc64/kernel/pci_sun4v.c | |||
@@ -154,7 +154,7 @@ static void pci_arena_free(struct pci_iommu_arena *arena, unsigned long base, un | |||
154 | __clear_bit(i, arena->map); | 154 | __clear_bit(i, arena->map); |
155 | } | 155 | } |
156 | 156 | ||
157 | static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp) | 157 | static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr_t *dma_addrp, gfp_t gfp) |
158 | { | 158 | { |
159 | struct pcidev_cookie *pcp; | 159 | struct pcidev_cookie *pcp; |
160 | struct pci_iommu *iommu; | 160 | struct pci_iommu *iommu; |
@@ -169,7 +169,7 @@ static void *pci_4v_alloc_consistent(struct pci_dev *pdev, size_t size, dma_addr | |||
169 | 169 | ||
170 | npages = size >> IO_PAGE_SHIFT; | 170 | npages = size >> IO_PAGE_SHIFT; |
171 | 171 | ||
172 | first_page = __get_free_pages(GFP_ATOMIC, order); | 172 | first_page = __get_free_pages(gfp, order); |
173 | if (unlikely(first_page == 0UL)) | 173 | if (unlikely(first_page == 0UL)) |
174 | return NULL; | 174 | return NULL; |
175 | 175 | ||
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index d4b39cd30310..1136fc465e37 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S | |||
@@ -78,8 +78,9 @@ sys_call_table32: | |||
78 | .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid | 78 | .word compat_sys_mq_timedsend, compat_sys_mq_timedreceive, compat_sys_mq_notify, compat_sys_mq_getsetattr, compat_sys_waitid |
79 | /*280*/ .word sys32_tee, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat | 79 | /*280*/ .word sys32_tee, sys_add_key, sys_request_key, sys_keyctl, compat_sys_openat |
80 | .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 | 80 | .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 |
81 | /*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 81 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
82 | .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare | 82 | .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare |
83 | /*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list | ||
83 | 84 | ||
84 | #endif /* CONFIG_COMPAT */ | 85 | #endif /* CONFIG_COMPAT */ |
85 | 86 | ||
@@ -147,8 +148,9 @@ sys_call_table: | |||
147 | .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid | 148 | .word sys_mq_timedsend, sys_mq_timedreceive, sys_mq_notify, sys_mq_getsetattr, sys_waitid |
148 | /*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat | 149 | /*280*/ .word sys_tee, sys_add_key, sys_request_key, sys_keyctl, sys_openat |
149 | .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 | 150 | .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 |
150 | /*285*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 151 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
151 | .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare | 152 | .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare |
153 | /*300*/ .word sys_set_robust_list, sys_get_robust_list | ||
152 | 154 | ||
153 | #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ | 155 | #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ |
154 | defined(CONFIG_SOLARIS_EMUL_MODULE) | 156 | defined(CONFIG_SOLARIS_EMUL_MODULE) |
@@ -261,5 +263,5 @@ sunos_sys_table: | |||
261 | /*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys | 263 | /*290*/ .word sunos_nosys, sunos_nosys, sunos_nosys |
262 | .word sunos_nosys, sunos_nosys, sunos_nosys | 264 | .word sunos_nosys, sunos_nosys, sunos_nosys |
263 | .word sunos_nosys, sunos_nosys, sunos_nosys | 265 | .word sunos_nosys, sunos_nosys, sunos_nosys |
264 | .word sunos_nosys | 266 | .word sunos_nosys, sunos_nosys, sunos_nosys |
265 | #endif | 267 | #endif |
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index 62776c07cff1..222b5b46d2b2 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -76,6 +76,12 @@ static inline int bad_addr(unsigned long *addrp, unsigned long size) | |||
76 | *addrp = __pa_symbol(&_end); | 76 | *addrp = __pa_symbol(&_end); |
77 | return 1; | 77 | return 1; |
78 | } | 78 | } |
79 | |||
80 | if (last >= ebda_addr && addr < ebda_addr + ebda_size) { | ||
81 | *addrp = ebda_addr + ebda_size; | ||
82 | return 1; | ||
83 | } | ||
84 | |||
79 | /* XXX ramdisk image here? */ | 85 | /* XXX ramdisk image here? */ |
80 | return 0; | 86 | return 0; |
81 | } | 87 | } |
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 77b4c608cca0..0de3ea938830 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -1777,6 +1777,8 @@ static inline void unlock_ExtINT_logic(void) | |||
1777 | spin_unlock_irqrestore(&ioapic_lock, flags); | 1777 | spin_unlock_irqrestore(&ioapic_lock, flags); |
1778 | } | 1778 | } |
1779 | 1779 | ||
1780 | int timer_uses_ioapic_pin_0; | ||
1781 | |||
1780 | /* | 1782 | /* |
1781 | * This code may look a bit paranoid, but it's supposed to cooperate with | 1783 | * This code may look a bit paranoid, but it's supposed to cooperate with |
1782 | * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ | 1784 | * a wide range of boards and BIOS bugs. Fortunately only the timer IRQ |
@@ -1814,6 +1816,9 @@ static inline void check_timer(void) | |||
1814 | pin2 = ioapic_i8259.pin; | 1816 | pin2 = ioapic_i8259.pin; |
1815 | apic2 = ioapic_i8259.apic; | 1817 | apic2 = ioapic_i8259.apic; |
1816 | 1818 | ||
1819 | if (pin1 == 0) | ||
1820 | timer_uses_ioapic_pin_0 = 1; | ||
1821 | |||
1817 | apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", | 1822 | apic_printk(APIC_VERBOSE,KERN_INFO "..TIMER: vector=0x%02X apic1=%d pin1=%d apic2=%d pin2=%d\n", |
1818 | vector, apic1, pin1, apic2, pin2); | 1823 | vector, apic1, pin1, apic2, pin2); |
1819 | 1824 | ||
diff --git a/arch/x86_64/kernel/kprobes.c b/arch/x86_64/kernel/kprobes.c index 1eaa5dae6174..fa1d19ca700a 100644 --- a/arch/x86_64/kernel/kprobes.c +++ b/arch/x86_64/kernel/kprobes.c | |||
@@ -514,13 +514,13 @@ static void __kprobes resume_execution(struct kprobe *p, | |||
514 | *tos = orig_rip + (*tos - copy_rip); | 514 | *tos = orig_rip + (*tos - copy_rip); |
515 | break; | 515 | break; |
516 | case 0xff: | 516 | case 0xff: |
517 | if ((*insn & 0x30) == 0x10) { | 517 | if ((insn[1] & 0x30) == 0x10) { |
518 | /* call absolute, indirect */ | 518 | /* call absolute, indirect */ |
519 | /* Fix return addr; rip is correct. */ | 519 | /* Fix return addr; rip is correct. */ |
520 | next_rip = regs->rip; | 520 | next_rip = regs->rip; |
521 | *tos = orig_rip + (*tos - copy_rip); | 521 | *tos = orig_rip + (*tos - copy_rip); |
522 | } else if (((*insn & 0x31) == 0x20) || /* jmp near, absolute indirect */ | 522 | } else if (((insn[1] & 0x31) == 0x20) || /* jmp near, absolute indirect */ |
523 | ((*insn & 0x31) == 0x21)) { /* jmp far, absolute indirect */ | 523 | ((insn[1] & 0x31) == 0x21)) { /* jmp far, absolute indirect */ |
524 | /* rip is correct. */ | 524 | /* rip is correct. */ |
525 | next_rip = regs->rip; | 525 | next_rip = regs->rip; |
526 | } | 526 | } |
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index b17cf3eba359..083da7e606b1 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -968,7 +968,17 @@ int mp_register_gsi(u32 gsi, int triggering, int polarity) | |||
968 | */ | 968 | */ |
969 | int irq = gsi; | 969 | int irq = gsi; |
970 | if (gsi < MAX_GSI_NUM) { | 970 | if (gsi < MAX_GSI_NUM) { |
971 | if (gsi > 15) | 971 | /* |
972 | * Retain the VIA chipset work-around (gsi > 15), but | ||
973 | * avoid a problem where the 8254 timer (IRQ0) is setup | ||
974 | * via an override (so it's not on pin 0 of the ioapic), | ||
975 | * and at the same time, the pin 0 interrupt is a PCI | ||
976 | * type. The gsi > 15 test could cause these two pins | ||
977 | * to be shared as IRQ0, and they are not shareable. | ||
978 | * So test for this condition, and if necessary, avoid | ||
979 | * the pin collision. | ||
980 | */ | ||
981 | if (gsi > 15 || (gsi == 0 && !timer_uses_ioapic_pin_0)) | ||
972 | gsi = pci_irq++; | 982 | gsi = pci_irq++; |
973 | /* | 983 | /* |
974 | * Don't assign IRQ used by ACPI SCI | 984 | * Don't assign IRQ used by ACPI SCI |
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index 9d3d76c85ae7..2480d3f08a47 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c | |||
@@ -639,6 +639,14 @@ static int __init pci_iommu_init(void) | |||
639 | return -1; | 639 | return -1; |
640 | } | 640 | } |
641 | 641 | ||
642 | i = 0; | ||
643 | for_all_nb(dev) | ||
644 | i++; | ||
645 | if (i > MAX_NB) { | ||
646 | printk(KERN_ERR "PCI-GART: Too many northbridges (%ld). Disabled\n", i); | ||
647 | return -1; | ||
648 | } | ||
649 | |||
642 | printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); | 650 | printk(KERN_INFO "PCI-DMA: using GART IOMMU.\n"); |
643 | aper_size = info.aper_size * 1024 * 1024; | 651 | aper_size = info.aper_size * 1024 * 1024; |
644 | iommu_size = check_iommu_size(info.aper_base, aper_size); | 652 | iommu_size = check_iommu_size(info.aper_base, aper_size); |
diff --git a/arch/x86_64/kernel/pci-nommu.c b/arch/x86_64/kernel/pci-nommu.c index 44adcc2d5e5b..1f6ecc62061d 100644 --- a/arch/x86_64/kernel/pci-nommu.c +++ b/arch/x86_64/kernel/pci-nommu.c | |||
@@ -12,9 +12,10 @@ static int | |||
12 | check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size) | 12 | check_addr(char *name, struct device *hwdev, dma_addr_t bus, size_t size) |
13 | { | 13 | { |
14 | if (hwdev && bus + size > *hwdev->dma_mask) { | 14 | if (hwdev && bus + size > *hwdev->dma_mask) { |
15 | printk(KERN_ERR | 15 | if (*hwdev->dma_mask >= 0xffffffffULL) |
16 | "nommu_%s: overflow %Lx+%lu of device mask %Lx\n", | 16 | printk(KERN_ERR |
17 | name, (long long)bus, size, (long long)*hwdev->dma_mask); | 17 | "nommu_%s: overflow %Lx+%lu of device mask %Lx\n", |
18 | name, (long long)bus, size, (long long)*hwdev->dma_mask); | ||
18 | return 0; | 19 | return 0; |
19 | } | 20 | } |
20 | return 1; | 21 | return 1; |
diff --git a/arch/x86_64/kernel/setup.c b/arch/x86_64/kernel/setup.c index ebc3c33b1c6c..f0870bef24d1 100644 --- a/arch/x86_64/kernel/setup.c +++ b/arch/x86_64/kernel/setup.c | |||
@@ -571,17 +571,28 @@ static inline void copy_edd(void) | |||
571 | #endif | 571 | #endif |
572 | 572 | ||
573 | #define EBDA_ADDR_POINTER 0x40E | 573 | #define EBDA_ADDR_POINTER 0x40E |
574 | static void __init reserve_ebda_region(void) | 574 | |
575 | unsigned __initdata ebda_addr; | ||
576 | unsigned __initdata ebda_size; | ||
577 | |||
578 | static void discover_ebda(void) | ||
575 | { | 579 | { |
576 | unsigned int addr; | 580 | /* |
577 | /** | ||
578 | * there is a real-mode segmented pointer pointing to the | 581 | * there is a real-mode segmented pointer pointing to the |
579 | * 4K EBDA area at 0x40E | 582 | * 4K EBDA area at 0x40E |
580 | */ | 583 | */ |
581 | addr = *(unsigned short *)phys_to_virt(EBDA_ADDR_POINTER); | 584 | ebda_addr = *(unsigned short *)EBDA_ADDR_POINTER; |
582 | addr <<= 4; | 585 | ebda_addr <<= 4; |
583 | if (addr) | 586 | |
584 | reserve_bootmem_generic(addr, PAGE_SIZE); | 587 | ebda_size = *(unsigned short *)(unsigned long)ebda_addr; |
588 | |||
589 | /* Round EBDA up to pages */ | ||
590 | if (ebda_size == 0) | ||
591 | ebda_size = 1; | ||
592 | ebda_size <<= 10; | ||
593 | ebda_size = round_up(ebda_size + (ebda_addr & ~PAGE_MASK), PAGE_SIZE); | ||
594 | if (ebda_size > 64*1024) | ||
595 | ebda_size = 64*1024; | ||
585 | } | 596 | } |
586 | 597 | ||
587 | void __init setup_arch(char **cmdline_p) | 598 | void __init setup_arch(char **cmdline_p) |
@@ -627,6 +638,8 @@ void __init setup_arch(char **cmdline_p) | |||
627 | 638 | ||
628 | check_efer(); | 639 | check_efer(); |
629 | 640 | ||
641 | discover_ebda(); | ||
642 | |||
630 | init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); | 643 | init_memory_mapping(0, (end_pfn_map << PAGE_SHIFT)); |
631 | 644 | ||
632 | dmi_scan_machine(); | 645 | dmi_scan_machine(); |
@@ -669,7 +682,8 @@ void __init setup_arch(char **cmdline_p) | |||
669 | reserve_bootmem_generic(0, PAGE_SIZE); | 682 | reserve_bootmem_generic(0, PAGE_SIZE); |
670 | 683 | ||
671 | /* reserve ebda region */ | 684 | /* reserve ebda region */ |
672 | reserve_ebda_region(); | 685 | if (ebda_addr) |
686 | reserve_bootmem_generic(ebda_addr, ebda_size); | ||
673 | 687 | ||
674 | #ifdef CONFIG_SMP | 688 | #ifdef CONFIG_SMP |
675 | /* | 689 | /* |
diff --git a/arch/x86_64/kernel/traps.c b/arch/x86_64/kernel/traps.c index 2700b1375c1f..cea335e8746c 100644 --- a/arch/x86_64/kernel/traps.c +++ b/arch/x86_64/kernel/traps.c | |||
@@ -102,6 +102,8 @@ static inline void preempt_conditional_cli(struct pt_regs *regs) | |||
102 | { | 102 | { |
103 | if (regs->eflags & X86_EFLAGS_IF) | 103 | if (regs->eflags & X86_EFLAGS_IF) |
104 | local_irq_disable(); | 104 | local_irq_disable(); |
105 | /* Make sure to not schedule here because we could be running | ||
106 | on an exception stack. */ | ||
105 | preempt_enable_no_resched(); | 107 | preempt_enable_no_resched(); |
106 | } | 108 | } |
107 | 109 | ||
@@ -385,6 +387,7 @@ void out_of_line_bug(void) | |||
385 | 387 | ||
386 | static DEFINE_SPINLOCK(die_lock); | 388 | static DEFINE_SPINLOCK(die_lock); |
387 | static int die_owner = -1; | 389 | static int die_owner = -1; |
390 | static unsigned int die_nest_count; | ||
388 | 391 | ||
389 | unsigned __kprobes long oops_begin(void) | 392 | unsigned __kprobes long oops_begin(void) |
390 | { | 393 | { |
@@ -399,6 +402,7 @@ unsigned __kprobes long oops_begin(void) | |||
399 | else | 402 | else |
400 | spin_lock(&die_lock); | 403 | spin_lock(&die_lock); |
401 | } | 404 | } |
405 | die_nest_count++; | ||
402 | die_owner = cpu; | 406 | die_owner = cpu; |
403 | console_verbose(); | 407 | console_verbose(); |
404 | bust_spinlocks(1); | 408 | bust_spinlocks(1); |
@@ -409,7 +413,13 @@ void __kprobes oops_end(unsigned long flags) | |||
409 | { | 413 | { |
410 | die_owner = -1; | 414 | die_owner = -1; |
411 | bust_spinlocks(0); | 415 | bust_spinlocks(0); |
412 | spin_unlock_irqrestore(&die_lock, flags); | 416 | die_nest_count--; |
417 | if (die_nest_count) | ||
418 | /* We still own the lock */ | ||
419 | local_irq_restore(flags); | ||
420 | else | ||
421 | /* Nest count reaches zero, release the lock. */ | ||
422 | spin_unlock_irqrestore(&die_lock, flags); | ||
413 | if (panic_on_oops) | 423 | if (panic_on_oops) |
414 | panic("Oops"); | 424 | panic("Oops"); |
415 | } | 425 | } |
@@ -464,6 +474,8 @@ void __kprobes die_nmi(char *str, struct pt_regs *regs) | |||
464 | panic("nmi watchdog"); | 474 | panic("nmi watchdog"); |
465 | printk("console shuts up ...\n"); | 475 | printk("console shuts up ...\n"); |
466 | oops_end(flags); | 476 | oops_end(flags); |
477 | nmi_exit(); | ||
478 | local_irq_enable(); | ||
467 | do_exit(SIGSEGV); | 479 | do_exit(SIGSEGV); |
468 | } | 480 | } |
469 | 481 | ||
@@ -473,8 +485,6 @@ static void __kprobes do_trap(int trapnr, int signr, char *str, | |||
473 | { | 485 | { |
474 | struct task_struct *tsk = current; | 486 | struct task_struct *tsk = current; |
475 | 487 | ||
476 | conditional_sti(regs); | ||
477 | |||
478 | tsk->thread.error_code = error_code; | 488 | tsk->thread.error_code = error_code; |
479 | tsk->thread.trap_no = trapnr; | 489 | tsk->thread.trap_no = trapnr; |
480 | 490 | ||
@@ -511,6 +521,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ | |||
511 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ | 521 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ |
512 | == NOTIFY_STOP) \ | 522 | == NOTIFY_STOP) \ |
513 | return; \ | 523 | return; \ |
524 | conditional_sti(regs); \ | ||
514 | do_trap(trapnr, signr, str, regs, error_code, NULL); \ | 525 | do_trap(trapnr, signr, str, regs, error_code, NULL); \ |
515 | } | 526 | } |
516 | 527 | ||
@@ -525,6 +536,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ | |||
525 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ | 536 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ |
526 | == NOTIFY_STOP) \ | 537 | == NOTIFY_STOP) \ |
527 | return; \ | 538 | return; \ |
539 | conditional_sti(regs); \ | ||
528 | do_trap(trapnr, signr, str, regs, error_code, &info); \ | 540 | do_trap(trapnr, signr, str, regs, error_code, &info); \ |
529 | } | 541 | } |
530 | 542 | ||
@@ -538,7 +550,17 @@ DO_ERROR(10, SIGSEGV, "invalid TSS", invalid_TSS) | |||
538 | DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) | 550 | DO_ERROR(11, SIGBUS, "segment not present", segment_not_present) |
539 | DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) | 551 | DO_ERROR_INFO(17, SIGBUS, "alignment check", alignment_check, BUS_ADRALN, 0) |
540 | DO_ERROR(18, SIGSEGV, "reserved", reserved) | 552 | DO_ERROR(18, SIGSEGV, "reserved", reserved) |
541 | DO_ERROR(12, SIGBUS, "stack segment", stack_segment) | 553 | |
554 | /* Runs on IST stack */ | ||
555 | asmlinkage void do_stack_segment(struct pt_regs *regs, long error_code) | ||
556 | { | ||
557 | if (notify_die(DIE_TRAP, "stack segment", regs, error_code, | ||
558 | 12, SIGBUS) == NOTIFY_STOP) | ||
559 | return; | ||
560 | preempt_conditional_sti(regs); | ||
561 | do_trap(12, SIGBUS, "stack segment", regs, error_code, NULL); | ||
562 | preempt_conditional_cli(regs); | ||
563 | } | ||
542 | 564 | ||
543 | asmlinkage void do_double_fault(struct pt_regs * regs, long error_code) | 565 | asmlinkage void do_double_fault(struct pt_regs * regs, long error_code) |
544 | { | 566 | { |
@@ -672,8 +694,9 @@ asmlinkage void __kprobes do_int3(struct pt_regs * regs, long error_code) | |||
672 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { | 694 | if (notify_die(DIE_INT3, "int3", regs, error_code, 3, SIGTRAP) == NOTIFY_STOP) { |
673 | return; | 695 | return; |
674 | } | 696 | } |
697 | preempt_conditional_sti(regs); | ||
675 | do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); | 698 | do_trap(3, SIGTRAP, "int3", regs, error_code, NULL); |
676 | return; | 699 | preempt_conditional_cli(regs); |
677 | } | 700 | } |
678 | 701 | ||
679 | /* Help handler running on IST stack to switch back to user stack | 702 | /* Help handler running on IST stack to switch back to user stack |
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index 15ae9fcd65a7..e1513532df29 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
@@ -34,7 +34,10 @@ static nodemask_t nodes_found __initdata; | |||
34 | static struct bootnode nodes[MAX_NUMNODES] __initdata; | 34 | static struct bootnode nodes[MAX_NUMNODES] __initdata; |
35 | static struct bootnode nodes_add[MAX_NUMNODES] __initdata; | 35 | static struct bootnode nodes_add[MAX_NUMNODES] __initdata; |
36 | static int found_add_area __initdata; | 36 | static int found_add_area __initdata; |
37 | int hotadd_percent __initdata = 10; | 37 | int hotadd_percent __initdata = 0; |
38 | #ifndef RESERVE_HOTADD | ||
39 | #define hotadd_percent 0 /* Ignore all settings */ | ||
40 | #endif | ||
38 | static u8 pxm2node[256] = { [0 ... 255] = 0xff }; | 41 | static u8 pxm2node[256] = { [0 ... 255] = 0xff }; |
39 | 42 | ||
40 | /* Too small nodes confuse the VM badly. Usually they result | 43 | /* Too small nodes confuse the VM badly. Usually they result |
@@ -103,6 +106,7 @@ static __init void bad_srat(void) | |||
103 | int i; | 106 | int i; |
104 | printk(KERN_ERR "SRAT: SRAT not used.\n"); | 107 | printk(KERN_ERR "SRAT: SRAT not used.\n"); |
105 | acpi_numa = -1; | 108 | acpi_numa = -1; |
109 | found_add_area = 0; | ||
106 | for (i = 0; i < MAX_LOCAL_APIC; i++) | 110 | for (i = 0; i < MAX_LOCAL_APIC; i++) |
107 | apicid_to_node[i] = NUMA_NO_NODE; | 111 | apicid_to_node[i] = NUMA_NO_NODE; |
108 | for (i = 0; i < MAX_NUMNODES; i++) | 112 | for (i = 0; i < MAX_NUMNODES; i++) |
@@ -154,7 +158,8 @@ acpi_numa_processor_affinity_init(struct acpi_table_processor_affinity *pa) | |||
154 | int pxm, node; | 158 | int pxm, node; |
155 | if (srat_disabled()) | 159 | if (srat_disabled()) |
156 | return; | 160 | return; |
157 | if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) { bad_srat(); | 161 | if (pa->header.length != sizeof(struct acpi_table_processor_affinity)) { |
162 | bad_srat(); | ||
158 | return; | 163 | return; |
159 | } | 164 | } |
160 | if (pa->flags.enabled == 0) | 165 | if (pa->flags.enabled == 0) |
@@ -191,15 +196,17 @@ static int hotadd_enough_memory(struct bootnode *nd) | |||
191 | allowed = (end_pfn - e820_hole_size(0, end_pfn)) * PAGE_SIZE; | 196 | allowed = (end_pfn - e820_hole_size(0, end_pfn)) * PAGE_SIZE; |
192 | allowed = (allowed / 100) * hotadd_percent; | 197 | allowed = (allowed / 100) * hotadd_percent; |
193 | if (allocated + mem > allowed) { | 198 | if (allocated + mem > allowed) { |
199 | unsigned long range; | ||
194 | /* Give them at least part of their hotadd memory upto hotadd_percent | 200 | /* Give them at least part of their hotadd memory upto hotadd_percent |
195 | It would be better to spread the limit out | 201 | It would be better to spread the limit out |
196 | over multiple hotplug areas, but that is too complicated | 202 | over multiple hotplug areas, but that is too complicated |
197 | right now */ | 203 | right now */ |
198 | if (allocated >= allowed) | 204 | if (allocated >= allowed) |
199 | return 0; | 205 | return 0; |
200 | pages = (allowed - allocated + mem) / sizeof(struct page); | 206 | range = allowed - allocated; |
207 | pages = (range / PAGE_SIZE); | ||
201 | mem = pages * sizeof(struct page); | 208 | mem = pages * sizeof(struct page); |
202 | nd->end = nd->start + pages*PAGE_SIZE; | 209 | nd->end = nd->start + range; |
203 | } | 210 | } |
204 | /* Not completely fool proof, but a good sanity check */ | 211 | /* Not completely fool proof, but a good sanity check */ |
205 | addr = find_e820_area(last_area_end, end_pfn<<PAGE_SHIFT, mem); | 212 | addr = find_e820_area(last_area_end, end_pfn<<PAGE_SHIFT, mem); |
diff --git a/block/elevator.c b/block/elevator.c index 29825792cbd5..8768a367fdde 100644 --- a/block/elevator.c +++ b/block/elevator.c | |||
@@ -333,6 +333,7 @@ void elv_insert(request_queue_t *q, struct request *rq, int where) | |||
333 | { | 333 | { |
334 | struct list_head *pos; | 334 | struct list_head *pos; |
335 | unsigned ordseq; | 335 | unsigned ordseq; |
336 | int unplug_it = 1; | ||
336 | 337 | ||
337 | blk_add_trace_rq(q, rq, BLK_TA_INSERT); | 338 | blk_add_trace_rq(q, rq, BLK_TA_INSERT); |
338 | 339 | ||
@@ -399,6 +400,11 @@ void elv_insert(request_queue_t *q, struct request *rq, int where) | |||
399 | } | 400 | } |
400 | 401 | ||
401 | list_add_tail(&rq->queuelist, pos); | 402 | list_add_tail(&rq->queuelist, pos); |
403 | /* | ||
404 | * most requeues happen because of a busy condition, don't | ||
405 | * force unplug of the queue for that case. | ||
406 | */ | ||
407 | unplug_it = 0; | ||
402 | break; | 408 | break; |
403 | 409 | ||
404 | default: | 410 | default: |
@@ -407,7 +413,7 @@ void elv_insert(request_queue_t *q, struct request *rq, int where) | |||
407 | BUG(); | 413 | BUG(); |
408 | } | 414 | } |
409 | 415 | ||
410 | if (blk_queue_plugged(q)) { | 416 | if (unplug_it && blk_queue_plugged(q)) { |
411 | int nrq = q->rq.count[READ] + q->rq.count[WRITE] | 417 | int nrq = q->rq.count[READ] + q->rq.count[WRITE] |
412 | - q->in_flight; | 418 | - q->in_flight; |
413 | 419 | ||
diff --git a/block/genhd.c b/block/genhd.c index d96572589621..5a8d3bf02f17 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -182,7 +182,6 @@ static int exact_lock(dev_t dev, void *data) | |||
182 | */ | 182 | */ |
183 | void add_disk(struct gendisk *disk) | 183 | void add_disk(struct gendisk *disk) |
184 | { | 184 | { |
185 | get_device(disk->driverfs_dev); | ||
186 | disk->flags |= GENHD_FL_UP; | 185 | disk->flags |= GENHD_FL_UP; |
187 | blk_register_region(MKDEV(disk->major, disk->first_minor), | 186 | blk_register_region(MKDEV(disk->major, disk->first_minor), |
188 | disk->minors, NULL, exact_match, exact_lock, disk); | 187 | disk->minors, NULL, exact_match, exact_lock, disk); |
@@ -428,7 +427,6 @@ static struct attribute * default_attrs[] = { | |||
428 | static void disk_release(struct kobject * kobj) | 427 | static void disk_release(struct kobject * kobj) |
429 | { | 428 | { |
430 | struct gendisk *disk = to_disk(kobj); | 429 | struct gendisk *disk = to_disk(kobj); |
431 | put_device(disk->driverfs_dev); | ||
432 | kfree(disk->random); | 430 | kfree(disk->random); |
433 | kfree(disk->part); | 431 | kfree(disk->part); |
434 | free_disk_stats(disk); | 432 | free_disk_stats(disk); |
diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c index e5041a02e21f..7eb36c53f4b7 100644 --- a/block/ll_rw_blk.c +++ b/block/ll_rw_blk.c | |||
@@ -1732,8 +1732,21 @@ void blk_run_queue(struct request_queue *q) | |||
1732 | 1732 | ||
1733 | spin_lock_irqsave(q->queue_lock, flags); | 1733 | spin_lock_irqsave(q->queue_lock, flags); |
1734 | blk_remove_plug(q); | 1734 | blk_remove_plug(q); |
1735 | if (!elv_queue_empty(q)) | 1735 | |
1736 | q->request_fn(q); | 1736 | /* |
1737 | * Only recurse once to avoid overrunning the stack, let the unplug | ||
1738 | * handling reinvoke the handler shortly if we already got there. | ||
1739 | */ | ||
1740 | if (!elv_queue_empty(q)) { | ||
1741 | if (!test_and_set_bit(QUEUE_FLAG_REENTER, &q->queue_flags)) { | ||
1742 | q->request_fn(q); | ||
1743 | clear_bit(QUEUE_FLAG_REENTER, &q->queue_flags); | ||
1744 | } else { | ||
1745 | blk_plug_device(q); | ||
1746 | kblockd_schedule_work(&q->unplug_work); | ||
1747 | } | ||
1748 | } | ||
1749 | |||
1737 | spin_unlock_irqrestore(q->queue_lock, flags); | 1750 | spin_unlock_irqrestore(q->queue_lock, flags); |
1738 | } | 1751 | } |
1739 | EXPORT_SYMBOL(blk_run_queue); | 1752 | EXPORT_SYMBOL(blk_run_queue); |
@@ -3439,7 +3452,12 @@ void end_that_request_last(struct request *req, int uptodate) | |||
3439 | if (unlikely(laptop_mode) && blk_fs_request(req)) | 3452 | if (unlikely(laptop_mode) && blk_fs_request(req)) |
3440 | laptop_io_completion(); | 3453 | laptop_io_completion(); |
3441 | 3454 | ||
3442 | if (disk && blk_fs_request(req)) { | 3455 | /* |
3456 | * Account IO completion. bar_rq isn't accounted as a normal | ||
3457 | * IO on queueing nor completion. Accounting the containing | ||
3458 | * request is enough. | ||
3459 | */ | ||
3460 | if (disk && blk_fs_request(req) && req != &req->q->bar_rq) { | ||
3443 | unsigned long duration = jiffies - req->start_time; | 3461 | unsigned long duration = jiffies - req->start_time; |
3444 | const int rw = rq_data_dir(req); | 3462 | const int rw = rq_data_dir(req); |
3445 | 3463 | ||
diff --git a/drivers/base/class.c b/drivers/base/class.c index 0e71dff327cd..b1ea4df85c7d 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -456,6 +456,35 @@ static void class_device_remove_attrs(struct class_device * cd) | |||
456 | } | 456 | } |
457 | } | 457 | } |
458 | 458 | ||
459 | static int class_device_add_groups(struct class_device * cd) | ||
460 | { | ||
461 | int i; | ||
462 | int error = 0; | ||
463 | |||
464 | if (cd->groups) { | ||
465 | for (i = 0; cd->groups[i]; i++) { | ||
466 | error = sysfs_create_group(&cd->kobj, cd->groups[i]); | ||
467 | if (error) { | ||
468 | while (--i >= 0) | ||
469 | sysfs_remove_group(&cd->kobj, cd->groups[i]); | ||
470 | goto out; | ||
471 | } | ||
472 | } | ||
473 | } | ||
474 | out: | ||
475 | return error; | ||
476 | } | ||
477 | |||
478 | static void class_device_remove_groups(struct class_device * cd) | ||
479 | { | ||
480 | int i; | ||
481 | if (cd->groups) { | ||
482 | for (i = 0; cd->groups[i]; i++) { | ||
483 | sysfs_remove_group(&cd->kobj, cd->groups[i]); | ||
484 | } | ||
485 | } | ||
486 | } | ||
487 | |||
459 | static ssize_t show_dev(struct class_device *class_dev, char *buf) | 488 | static ssize_t show_dev(struct class_device *class_dev, char *buf) |
460 | { | 489 | { |
461 | return print_dev_t(buf, class_dev->devt); | 490 | return print_dev_t(buf, class_dev->devt); |
@@ -559,6 +588,8 @@ int class_device_add(struct class_device *class_dev) | |||
559 | class_name); | 588 | class_name); |
560 | } | 589 | } |
561 | 590 | ||
591 | class_device_add_groups(class_dev); | ||
592 | |||
562 | kobject_uevent(&class_dev->kobj, KOBJ_ADD); | 593 | kobject_uevent(&class_dev->kobj, KOBJ_ADD); |
563 | 594 | ||
564 | /* notify any interfaces this device is now here */ | 595 | /* notify any interfaces this device is now here */ |
@@ -672,6 +703,7 @@ void class_device_del(struct class_device *class_dev) | |||
672 | if (class_dev->devt_attr) | 703 | if (class_dev->devt_attr) |
673 | class_device_remove_file(class_dev, class_dev->devt_attr); | 704 | class_device_remove_file(class_dev, class_dev->devt_attr); |
674 | class_device_remove_attrs(class_dev); | 705 | class_device_remove_attrs(class_dev); |
706 | class_device_remove_groups(class_dev); | ||
675 | 707 | ||
676 | kobject_uevent(&class_dev->kobj, KOBJ_REMOVE); | 708 | kobject_uevent(&class_dev->kobj, KOBJ_REMOVE); |
677 | kobject_del(&class_dev->kobj); | 709 | kobject_del(&class_dev->kobj); |
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index 472318205236..0c99ae6a3407 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -86,18 +86,9 @@ firmware_timeout_store(struct class *class, const char *buf, size_t count) | |||
86 | static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store); | 86 | static CLASS_ATTR(timeout, 0644, firmware_timeout_show, firmware_timeout_store); |
87 | 87 | ||
88 | static void fw_class_dev_release(struct class_device *class_dev); | 88 | static void fw_class_dev_release(struct class_device *class_dev); |
89 | int firmware_class_uevent(struct class_device *dev, char **envp, | ||
90 | int num_envp, char *buffer, int buffer_size); | ||
91 | 89 | ||
92 | static struct class firmware_class = { | 90 | static int firmware_class_uevent(struct class_device *class_dev, char **envp, |
93 | .name = "firmware", | 91 | int num_envp, char *buffer, int buffer_size) |
94 | .uevent = firmware_class_uevent, | ||
95 | .release = fw_class_dev_release, | ||
96 | }; | ||
97 | |||
98 | int | ||
99 | firmware_class_uevent(struct class_device *class_dev, char **envp, | ||
100 | int num_envp, char *buffer, int buffer_size) | ||
101 | { | 92 | { |
102 | struct firmware_priv *fw_priv = class_get_devdata(class_dev); | 93 | struct firmware_priv *fw_priv = class_get_devdata(class_dev); |
103 | int i = 0, len = 0; | 94 | int i = 0, len = 0; |
@@ -116,6 +107,12 @@ firmware_class_uevent(struct class_device *class_dev, char **envp, | |||
116 | return 0; | 107 | return 0; |
117 | } | 108 | } |
118 | 109 | ||
110 | static struct class firmware_class = { | ||
111 | .name = "firmware", | ||
112 | .uevent = firmware_class_uevent, | ||
113 | .release = fw_class_dev_release, | ||
114 | }; | ||
115 | |||
119 | static ssize_t | 116 | static ssize_t |
120 | firmware_loading_show(struct class_device *class_dev, char *buf) | 117 | firmware_loading_show(struct class_device *class_dev, char *buf) |
121 | { | 118 | { |
@@ -493,25 +490,6 @@ release_firmware(const struct firmware *fw) | |||
493 | } | 490 | } |
494 | } | 491 | } |
495 | 492 | ||
496 | /** | ||
497 | * register_firmware: - provide a firmware image for later usage | ||
498 | * @name: name of firmware image file | ||
499 | * @data: buffer pointer for the firmware image | ||
500 | * @size: size of the data buffer area | ||
501 | * | ||
502 | * Make sure that @data will be available by requesting firmware @name. | ||
503 | * | ||
504 | * Note: This will not be possible until some kind of persistence | ||
505 | * is available. | ||
506 | **/ | ||
507 | void | ||
508 | register_firmware(const char *name, const u8 *data, size_t size) | ||
509 | { | ||
510 | /* This is meaningless without firmware caching, so until we | ||
511 | * decide if firmware caching is reasonable just leave it as a | ||
512 | * noop */ | ||
513 | } | ||
514 | |||
515 | /* Async support */ | 493 | /* Async support */ |
516 | struct firmware_work { | 494 | struct firmware_work { |
517 | struct work_struct work; | 495 | struct work_struct work; |
@@ -630,4 +608,3 @@ module_exit(firmware_class_exit); | |||
630 | EXPORT_SYMBOL(release_firmware); | 608 | EXPORT_SYMBOL(release_firmware); |
631 | EXPORT_SYMBOL(request_firmware); | 609 | EXPORT_SYMBOL(request_firmware); |
632 | EXPORT_SYMBOL(request_firmware_nowait); | 610 | EXPORT_SYMBOL(request_firmware_nowait); |
633 | EXPORT_SYMBOL(register_firmware); | ||
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index f73446f580df..c688c25992e4 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -536,6 +536,9 @@ static void ub_cleanup(struct ub_dev *sc) | |||
536 | kfree(lun); | 536 | kfree(lun); |
537 | } | 537 | } |
538 | 538 | ||
539 | usb_set_intfdata(sc->intf, NULL); | ||
540 | usb_put_intf(sc->intf); | ||
541 | usb_put_dev(sc->dev); | ||
539 | kfree(sc); | 542 | kfree(sc); |
540 | } | 543 | } |
541 | 544 | ||
@@ -2221,7 +2224,12 @@ static int ub_probe(struct usb_interface *intf, | |||
2221 | // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; | 2224 | // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; |
2222 | usb_set_intfdata(intf, sc); | 2225 | usb_set_intfdata(intf, sc); |
2223 | usb_get_dev(sc->dev); | 2226 | usb_get_dev(sc->dev); |
2224 | // usb_get_intf(sc->intf); /* Do we need this? */ | 2227 | /* |
2228 | * Since we give the interface struct to the block level through | ||
2229 | * disk->driverfs_dev, we have to pin it. Otherwise, block_uevent | ||
2230 | * oopses on close after a disconnect (kernels 2.6.16 and up). | ||
2231 | */ | ||
2232 | usb_get_intf(sc->intf); | ||
2225 | 2233 | ||
2226 | snprintf(sc->name, 12, DRV_NAME "(%d.%d)", | 2234 | snprintf(sc->name, 12, DRV_NAME "(%d.%d)", |
2227 | sc->dev->bus->busnum, sc->dev->devnum); | 2235 | sc->dev->bus->busnum, sc->dev->devnum); |
@@ -2286,7 +2294,7 @@ static int ub_probe(struct usb_interface *intf, | |||
2286 | 2294 | ||
2287 | err_dev_desc: | 2295 | err_dev_desc: |
2288 | usb_set_intfdata(intf, NULL); | 2296 | usb_set_intfdata(intf, NULL); |
2289 | // usb_put_intf(sc->intf); | 2297 | usb_put_intf(sc->intf); |
2290 | usb_put_dev(sc->dev); | 2298 | usb_put_dev(sc->dev); |
2291 | kfree(sc); | 2299 | kfree(sc); |
2292 | err_core: | 2300 | err_core: |
@@ -2461,12 +2469,6 @@ static void ub_disconnect(struct usb_interface *intf) | |||
2461 | * and no URBs left in transit. | 2469 | * and no URBs left in transit. |
2462 | */ | 2470 | */ |
2463 | 2471 | ||
2464 | usb_set_intfdata(intf, NULL); | ||
2465 | // usb_put_intf(sc->intf); | ||
2466 | sc->intf = NULL; | ||
2467 | usb_put_dev(sc->dev); | ||
2468 | sc->dev = NULL; | ||
2469 | |||
2470 | ub_put(sc); | 2472 | ub_put(sc); |
2471 | } | 2473 | } |
2472 | 2474 | ||
diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig index 402296670d3a..78d928f9d9f1 100644 --- a/drivers/char/Kconfig +++ b/drivers/char/Kconfig | |||
@@ -291,7 +291,7 @@ config SX | |||
291 | 291 | ||
292 | config RIO | 292 | config RIO |
293 | tristate "Specialix RIO system support" | 293 | tristate "Specialix RIO system support" |
294 | depends on SERIAL_NONSTANDARD && !64BIT | 294 | depends on SERIAL_NONSTANDARD |
295 | help | 295 | help |
296 | This is a driver for the Specialix RIO, a smart serial card which | 296 | This is a driver for the Specialix RIO, a smart serial card which |
297 | drives an outboard box that can support up to 128 ports. Product | 297 | drives an outboard box that can support up to 128 ports. Product |
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 02114a0bd0d9..128b2632512d 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -1981,10 +1981,6 @@ static int __init cmm_init(void) | |||
1981 | if (!cmm_class) | 1981 | if (!cmm_class) |
1982 | return -1; | 1982 | return -1; |
1983 | 1983 | ||
1984 | rc = pcmcia_register_driver(&cm4000_driver); | ||
1985 | if (rc < 0) | ||
1986 | return rc; | ||
1987 | |||
1988 | major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); | 1984 | major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); |
1989 | if (major < 0) { | 1985 | if (major < 0) { |
1990 | printk(KERN_WARNING MODULE_NAME | 1986 | printk(KERN_WARNING MODULE_NAME |
@@ -1992,6 +1988,12 @@ static int __init cmm_init(void) | |||
1992 | return -1; | 1988 | return -1; |
1993 | } | 1989 | } |
1994 | 1990 | ||
1991 | rc = pcmcia_register_driver(&cm4000_driver); | ||
1992 | if (rc < 0) { | ||
1993 | unregister_chrdev(major, DEVICE_NAME); | ||
1994 | return rc; | ||
1995 | } | ||
1996 | |||
1995 | return 0; | 1997 | return 0; |
1996 | } | 1998 | } |
1997 | 1999 | ||
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 29efa64580a8..47a8465bf95b 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -724,16 +724,19 @@ static int __init cm4040_init(void) | |||
724 | if (!cmx_class) | 724 | if (!cmx_class) |
725 | return -1; | 725 | return -1; |
726 | 726 | ||
727 | rc = pcmcia_register_driver(&reader_driver); | ||
728 | if (rc < 0) | ||
729 | return rc; | ||
730 | |||
731 | major = register_chrdev(0, DEVICE_NAME, &reader_fops); | 727 | major = register_chrdev(0, DEVICE_NAME, &reader_fops); |
732 | if (major < 0) { | 728 | if (major < 0) { |
733 | printk(KERN_WARNING MODULE_NAME | 729 | printk(KERN_WARNING MODULE_NAME |
734 | ": could not get major number\n"); | 730 | ": could not get major number\n"); |
735 | return -1; | 731 | return -1; |
736 | } | 732 | } |
733 | |||
734 | rc = pcmcia_register_driver(&reader_driver); | ||
735 | if (rc < 0) { | ||
736 | unregister_chrdev(major, DEVICE_NAME); | ||
737 | return rc; | ||
738 | } | ||
739 | |||
737 | return 0; | 740 | return 0; |
738 | } | 741 | } |
739 | 742 | ||
diff --git a/drivers/char/rio/host.h b/drivers/char/rio/host.h index 3ec73d1a279a..179cdbea712b 100644 --- a/drivers/char/rio/host.h +++ b/drivers/char/rio/host.h | |||
@@ -33,12 +33,6 @@ | |||
33 | #ifndef __rio_host_h__ | 33 | #ifndef __rio_host_h__ |
34 | #define __rio_host_h__ | 34 | #define __rio_host_h__ |
35 | 35 | ||
36 | #ifdef SCCS_LABELS | ||
37 | #ifndef lint | ||
38 | static char *_host_h_sccs_ = "@(#)host.h 1.2"; | ||
39 | #endif | ||
40 | #endif | ||
41 | |||
42 | /* | 36 | /* |
43 | ** the host structure - one per host card in the system. | 37 | ** the host structure - one per host card in the system. |
44 | */ | 38 | */ |
@@ -77,9 +71,6 @@ struct Host { | |||
77 | #define RC_STARTUP 1 | 71 | #define RC_STARTUP 1 |
78 | #define RC_RUNNING 2 | 72 | #define RC_RUNNING 2 |
79 | #define RC_STUFFED 3 | 73 | #define RC_STUFFED 3 |
80 | #define RC_SOMETHING 4 | ||
81 | #define RC_SOMETHING_NEW 5 | ||
82 | #define RC_SOMETHING_ELSE 6 | ||
83 | #define RC_READY 7 | 74 | #define RC_READY 7 |
84 | #define RUN_STATE 7 | 75 | #define RUN_STATE 7 |
85 | /* | 76 | /* |
diff --git a/drivers/char/rio/rioboot.c b/drivers/char/rio/rioboot.c index acda9326c2ef..290143addd34 100644 --- a/drivers/char/rio/rioboot.c +++ b/drivers/char/rio/rioboot.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | #include <linux/termios.h> | 35 | #include <linux/termios.h> |
36 | #include <linux/serial.h> | 36 | #include <linux/serial.h> |
37 | #include <linux/vmalloc.h> | ||
37 | #include <asm/semaphore.h> | 38 | #include <asm/semaphore.h> |
38 | #include <linux/generic_serial.h> | 39 | #include <linux/generic_serial.h> |
39 | #include <linux/errno.h> | 40 | #include <linux/errno.h> |
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c index d31aba62bb7f..75b2557c37ec 100644 --- a/drivers/char/rio/rioctrl.c +++ b/drivers/char/rio/rioctrl.c | |||
@@ -1394,14 +1394,17 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) | |||
1394 | return RIO_FAIL; | 1394 | return RIO_FAIL; |
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | if (((int) ((char) PortP->InUse) == -1) || !(CmdBlkP = RIOGetCmdBlk())) { | 1397 | if ((PortP->InUse == (typeof(PortP->InUse))-1) || |
1398 | rio_dprintk(RIO_DEBUG_CTRL, "Cannot allocate command block for command %d on port %d\n", Cmd, PortP->PortNum); | 1398 | !(CmdBlkP = RIOGetCmdBlk())) { |
1399 | rio_dprintk(RIO_DEBUG_CTRL, "Cannot allocate command block " | ||
1400 | "for command %d on port %d\n", Cmd, PortP->PortNum); | ||
1399 | return RIO_FAIL; | 1401 | return RIO_FAIL; |
1400 | } | 1402 | } |
1401 | 1403 | ||
1402 | rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n", CmdBlkP, PortP->InUse); | 1404 | rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n", |
1405 | CmdBlkP, PortP->InUse); | ||
1403 | 1406 | ||
1404 | PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0]; | 1407 | PktCmdP = (struct PktCmd_M *)&CmdBlkP->Packet.data[0]; |
1405 | 1408 | ||
1406 | CmdBlkP->Packet.src_unit = 0; | 1409 | CmdBlkP->Packet.src_unit = 0; |
1407 | if (PortP->SecondBlock) | 1410 | if (PortP->SecondBlock) |
@@ -1425,38 +1428,46 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) | |||
1425 | 1428 | ||
1426 | switch (Cmd) { | 1429 | switch (Cmd) { |
1427 | case MEMDUMP: | 1430 | case MEMDUMP: |
1428 | rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); | 1431 | rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p " |
1432 | "(addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); | ||
1429 | PktCmdP->SubCommand = MEMDUMP; | 1433 | PktCmdP->SubCommand = MEMDUMP; |
1430 | PktCmdP->SubAddr = SubCmd.Addr; | 1434 | PktCmdP->SubAddr = SubCmd.Addr; |
1431 | break; | 1435 | break; |
1432 | case FCLOSE: | 1436 | case FCLOSE: |
1433 | rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", CmdBlkP); | 1437 | rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", |
1438 | CmdBlkP); | ||
1434 | break; | 1439 | break; |
1435 | case READ_REGISTER: | 1440 | case READ_REGISTER: |
1436 | rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk %p\n", (int) SubCmd.Addr, CmdBlkP); | 1441 | rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) " |
1442 | "command blk %p\n", (int) SubCmd.Addr, CmdBlkP); | ||
1437 | PktCmdP->SubCommand = READ_REGISTER; | 1443 | PktCmdP->SubCommand = READ_REGISTER; |
1438 | PktCmdP->SubAddr = SubCmd.Addr; | 1444 | PktCmdP->SubAddr = SubCmd.Addr; |
1439 | break; | 1445 | break; |
1440 | case RESUME: | 1446 | case RESUME: |
1441 | rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", CmdBlkP); | 1447 | rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", |
1448 | CmdBlkP); | ||
1442 | break; | 1449 | break; |
1443 | case RFLUSH: | 1450 | case RFLUSH: |
1444 | rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", CmdBlkP); | 1451 | rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", |
1452 | CmdBlkP); | ||
1445 | CmdBlkP->PostFuncP = RIORFlushEnable; | 1453 | CmdBlkP->PostFuncP = RIORFlushEnable; |
1446 | break; | 1454 | break; |
1447 | case SUSPEND: | 1455 | case SUSPEND: |
1448 | rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", CmdBlkP); | 1456 | rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", |
1457 | CmdBlkP); | ||
1449 | break; | 1458 | break; |
1450 | 1459 | ||
1451 | case MGET: | 1460 | case MGET: |
1452 | rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", CmdBlkP); | 1461 | rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", |
1462 | CmdBlkP); | ||
1453 | break; | 1463 | break; |
1454 | 1464 | ||
1455 | case MSET: | 1465 | case MSET: |
1456 | case MBIC: | 1466 | case MBIC: |
1457 | case MBIS: | 1467 | case MBIS: |
1458 | CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; | 1468 | CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; |
1459 | rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk %p\n", CmdBlkP); | 1469 | rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command " |
1470 | "blk %p\n", CmdBlkP); | ||
1460 | break; | 1471 | break; |
1461 | 1472 | ||
1462 | case WFLUSH: | 1473 | case WFLUSH: |
@@ -1465,12 +1476,14 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd) | |||
1465 | ** allowed then we should not bother sending any more to the | 1476 | ** allowed then we should not bother sending any more to the |
1466 | ** RTA. | 1477 | ** RTA. |
1467 | */ | 1478 | */ |
1468 | if ((int) ((char) PortP->WflushFlag) == (int) -1) { | 1479 | if (PortP->WflushFlag == (typeof(PortP->WflushFlag))-1) { |
1469 | rio_dprintk(RIO_DEBUG_CTRL, "Trashed WFLUSH, WflushFlag about to wrap!"); | 1480 | rio_dprintk(RIO_DEBUG_CTRL, "Trashed WFLUSH, " |
1481 | "WflushFlag about to wrap!"); | ||
1470 | RIOFreeCmdBlk(CmdBlkP); | 1482 | RIOFreeCmdBlk(CmdBlkP); |
1471 | return (RIO_FAIL); | 1483 | return (RIO_FAIL); |
1472 | } else { | 1484 | } else { |
1473 | rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk %p\n", CmdBlkP); | 1485 | rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command " |
1486 | "blk %p\n", CmdBlkP); | ||
1474 | CmdBlkP->PostFuncP = RIOWFlushMark; | 1487 | CmdBlkP->PostFuncP = RIOWFlushMark; |
1475 | } | 1488 | } |
1476 | break; | 1489 | break; |
diff --git a/drivers/char/rio/rioioctl.h b/drivers/char/rio/rioioctl.h index 14b83fae75c8..e8af5b30519e 100644 --- a/drivers/char/rio/rioioctl.h +++ b/drivers/char/rio/rioioctl.h | |||
@@ -33,10 +33,6 @@ | |||
33 | #ifndef __rioioctl_h__ | 33 | #ifndef __rioioctl_h__ |
34 | #define __rioioctl_h__ | 34 | #define __rioioctl_h__ |
35 | 35 | ||
36 | #ifdef SCCS_LABELS | ||
37 | static char *_rioioctl_h_sccs_ = "@(#)rioioctl.h 1.2"; | ||
38 | #endif | ||
39 | |||
40 | /* | 36 | /* |
41 | ** RIO device driver - user ioctls and associated structures. | 37 | ** RIO device driver - user ioctls and associated structures. |
42 | */ | 38 | */ |
@@ -44,55 +40,13 @@ static char *_rioioctl_h_sccs_ = "@(#)rioioctl.h 1.2"; | |||
44 | struct portStats { | 40 | struct portStats { |
45 | int port; | 41 | int port; |
46 | int gather; | 42 | int gather; |
47 | ulong txchars; | 43 | unsigned long txchars; |
48 | ulong rxchars; | 44 | unsigned long rxchars; |
49 | ulong opens; | 45 | unsigned long opens; |
50 | ulong closes; | 46 | unsigned long closes; |
51 | ulong ioctls; | 47 | unsigned long ioctls; |
52 | }; | 48 | }; |
53 | 49 | ||
54 | |||
55 | #define rIOC ('r'<<8) | ||
56 | #define TCRIOSTATE (rIOC | 1) | ||
57 | #define TCRIOXPON (rIOC | 2) | ||
58 | #define TCRIOXPOFF (rIOC | 3) | ||
59 | #define TCRIOXPCPS (rIOC | 4) | ||
60 | #define TCRIOXPRINT (rIOC | 5) | ||
61 | #define TCRIOIXANYON (rIOC | 6) | ||
62 | #define TCRIOIXANYOFF (rIOC | 7) | ||
63 | #define TCRIOIXONON (rIOC | 8) | ||
64 | #define TCRIOIXONOFF (rIOC | 9) | ||
65 | #define TCRIOMBIS (rIOC | 10) | ||
66 | #define TCRIOMBIC (rIOC | 11) | ||
67 | #define TCRIOTRIAD (rIOC | 12) | ||
68 | #define TCRIOTSTATE (rIOC | 13) | ||
69 | |||
70 | /* | ||
71 | ** 15.10.1998 ARG - ESIL 0761 part fix | ||
72 | ** Add RIO ioctls for manipulating RTS and CTS flow control, (as LynxOS | ||
73 | ** appears to not support hardware flow control). | ||
74 | */ | ||
75 | #define TCRIOCTSFLOWEN (rIOC | 14) /* enable CTS flow control */ | ||
76 | #define TCRIOCTSFLOWDIS (rIOC | 15) /* disable CTS flow control */ | ||
77 | #define TCRIORTSFLOWEN (rIOC | 16) /* enable RTS flow control */ | ||
78 | #define TCRIORTSFLOWDIS (rIOC | 17) /* disable RTS flow control */ | ||
79 | |||
80 | /* | ||
81 | ** 09.12.1998 ARG - ESIL 0776 part fix | ||
82 | ** Definition for 'RIOC' also appears in daemon.h, so we'd better do a | ||
83 | ** #ifndef here first. | ||
84 | ** 'RIO_QUICK_CHECK' also #define'd here as this ioctl is now | ||
85 | ** allowed to be used by customers. | ||
86 | ** | ||
87 | ** 05.02.1999 ARG - | ||
88 | ** This is what I've decied to do with ioctls etc., which are intended to be | ||
89 | ** invoked from users applications : | ||
90 | ** Anything that needs to be defined here will be removed from daemon.h, that | ||
91 | ** way it won't end up having to be defined/maintained in two places. The only | ||
92 | ** consequence of this is that this file should now be #include'd by daemon.h | ||
93 | ** | ||
94 | ** 'stats' ioctls now #define'd here as they are to be used by customers. | ||
95 | */ | ||
96 | #define RIOC ('R'<<8)|('i'<<16)|('o'<<24) | 50 | #define RIOC ('R'<<8)|('i'<<16)|('o'<<24) |
97 | 51 | ||
98 | #define RIO_QUICK_CHECK (RIOC | 105) | 52 | #define RIO_QUICK_CHECK (RIOC | 105) |
diff --git a/drivers/char/tpm/Kconfig b/drivers/char/tpm/Kconfig index 1efde3b27619..fe00c7dfb649 100644 --- a/drivers/char/tpm/Kconfig +++ b/drivers/char/tpm/Kconfig | |||
@@ -22,7 +22,7 @@ config TCG_TPM | |||
22 | 22 | ||
23 | config TCG_TIS | 23 | config TCG_TIS |
24 | tristate "TPM Interface Specification 1.2 Interface" | 24 | tristate "TPM Interface Specification 1.2 Interface" |
25 | depends on TCG_TPM | 25 | depends on TCG_TPM && PNPACPI |
26 | ---help--- | 26 | ---help--- |
27 | If you have a TPM security chip that is compliant with the | 27 | If you have a TPM security chip that is compliant with the |
28 | TCG TIS 1.2 TPM specification say Yes and it will be accessible | 28 | TCG TIS 1.2 TPM specification say Yes and it will be accessible |
diff --git a/drivers/char/tpm/tpm.h b/drivers/char/tpm/tpm.h index 54a4c804e25f..050ced247f68 100644 --- a/drivers/char/tpm/tpm.h +++ b/drivers/char/tpm/tpm.h | |||
@@ -140,7 +140,7 @@ extern int tpm_pm_resume(struct device *); | |||
140 | extern struct dentry ** tpm_bios_log_setup(char *); | 140 | extern struct dentry ** tpm_bios_log_setup(char *); |
141 | extern void tpm_bios_log_teardown(struct dentry **); | 141 | extern void tpm_bios_log_teardown(struct dentry **); |
142 | #else | 142 | #else |
143 | static inline struct dentry* tpm_bios_log_setup(char *name) | 143 | static inline struct dentry ** tpm_bios_log_setup(char *name) |
144 | { | 144 | { |
145 | return NULL; | 145 | return NULL; |
146 | } | 146 | } |
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index b9cae9a238bb..f621168f38ae 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -55,7 +55,7 @@ enum tis_int_flags { | |||
55 | }; | 55 | }; |
56 | 56 | ||
57 | enum tis_defaults { | 57 | enum tis_defaults { |
58 | TIS_MEM_BASE = 0xFED4000, | 58 | TIS_MEM_BASE = 0xFED40000, |
59 | TIS_MEM_LEN = 0x5000, | 59 | TIS_MEM_LEN = 0x5000, |
60 | TIS_SHORT_TIMEOUT = 750, /* ms */ | 60 | TIS_SHORT_TIMEOUT = 750, /* ms */ |
61 | TIS_LONG_TIMEOUT = 2000, /* 2 sec */ | 61 | TIS_LONG_TIMEOUT = 2000, /* 2 sec */ |
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index f07637a8f88f..a88b94a82b14 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -398,7 +398,7 @@ int tty_insert_flip_string_flags(struct tty_struct *tty, | |||
398 | while (unlikely(size > copied)); | 398 | while (unlikely(size > copied)); |
399 | return copied; | 399 | return copied; |
400 | } | 400 | } |
401 | EXPORT_SYMBOL_GPL(tty_insert_flip_string_flags); | 401 | EXPORT_SYMBOL(tty_insert_flip_string_flags); |
402 | 402 | ||
403 | void tty_schedule_flip(struct tty_struct *tty) | 403 | void tty_schedule_flip(struct tty_struct *tty) |
404 | { | 404 | { |
diff --git a/drivers/char/watchdog/i8xx_tco.c b/drivers/char/watchdog/i8xx_tco.c index a13395e2c372..fa2ba9ebe42a 100644 --- a/drivers/char/watchdog/i8xx_tco.c +++ b/drivers/char/watchdog/i8xx_tco.c | |||
@@ -33,11 +33,6 @@ | |||
33 | * 82801E (C-ICH) : document number 273599-001, 273645-002, | 33 | * 82801E (C-ICH) : document number 273599-001, 273645-002, |
34 | * 82801EB (ICH5) : document number 252516-001, 252517-003, | 34 | * 82801EB (ICH5) : document number 252516-001, 252517-003, |
35 | * 82801ER (ICH5R) : document number 252516-001, 252517-003, | 35 | * 82801ER (ICH5R) : document number 252516-001, 252517-003, |
36 | * 82801FB (ICH6) : document number 301473-002, 301474-007, | ||
37 | * 82801FR (ICH6R) : document number 301473-002, 301474-007, | ||
38 | * 82801FBM (ICH6-M) : document number 301473-002, 301474-007, | ||
39 | * 82801FW (ICH6W) : document number 301473-001, 301474-007, | ||
40 | * 82801FRW (ICH6RW) : document number 301473-001, 301474-007 | ||
41 | * | 36 | * |
42 | * 20000710 Nils Faerber | 37 | * 20000710 Nils Faerber |
43 | * Initial Version 0.01 | 38 | * Initial Version 0.01 |
@@ -66,6 +61,10 @@ | |||
66 | * 20050807 Wim Van Sebroeck <wim@iguana.be> | 61 | * 20050807 Wim Van Sebroeck <wim@iguana.be> |
67 | * 0.08 Make sure that the watchdog is only "armed" when started. | 62 | * 0.08 Make sure that the watchdog is only "armed" when started. |
68 | * (Kernel Bug 4251) | 63 | * (Kernel Bug 4251) |
64 | * 20060416 Wim Van Sebroeck <wim@iguana.be> | ||
65 | * 0.09 Remove support for the ICH6, ICH6R, ICH6-M, ICH6W and ICH6RW and | ||
66 | * ICH7 chipsets. (See Kernel Bug 6031 - other code will support these | ||
67 | * chipsets) | ||
69 | */ | 68 | */ |
70 | 69 | ||
71 | /* | 70 | /* |
@@ -90,7 +89,7 @@ | |||
90 | #include "i8xx_tco.h" | 89 | #include "i8xx_tco.h" |
91 | 90 | ||
92 | /* Module and version information */ | 91 | /* Module and version information */ |
93 | #define TCO_VERSION "0.08" | 92 | #define TCO_VERSION "0.09" |
94 | #define TCO_MODULE_NAME "i8xx TCO timer" | 93 | #define TCO_MODULE_NAME "i8xx TCO timer" |
95 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION | 94 | #define TCO_DRIVER_NAME TCO_MODULE_NAME ", v" TCO_VERSION |
96 | #define PFX TCO_MODULE_NAME ": " | 95 | #define PFX TCO_MODULE_NAME ": " |
@@ -391,11 +390,6 @@ static struct pci_device_id i8xx_tco_pci_tbl[] = { | |||
391 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, }, | 390 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, }, |
392 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0, PCI_ANY_ID, PCI_ANY_ID, }, | 391 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0, PCI_ANY_ID, PCI_ANY_ID, }, |
393 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, PCI_ANY_ID, PCI_ANY_ID, }, | 392 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, PCI_ANY_ID, PCI_ANY_ID, }, |
394 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_0, PCI_ANY_ID, PCI_ANY_ID, }, | ||
395 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, PCI_ANY_ID, PCI_ANY_ID, }, | ||
396 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_2, PCI_ANY_ID, PCI_ANY_ID, }, | ||
397 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_0, PCI_ANY_ID, PCI_ANY_ID, }, | ||
398 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH7_1, PCI_ANY_ID, PCI_ANY_ID, }, | ||
399 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, PCI_ANY_ID, PCI_ANY_ID, }, | 393 | { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, PCI_ANY_ID, PCI_ANY_ID, }, |
400 | { 0, }, /* End of list */ | 394 | { 0, }, /* End of list */ |
401 | }; | 395 | }; |
diff --git a/drivers/char/watchdog/s3c2410_wdt.c b/drivers/char/watchdog/s3c2410_wdt.c index 9dc54736e4eb..1ea04e9b2b0b 100644 --- a/drivers/char/watchdog/s3c2410_wdt.c +++ b/drivers/char/watchdog/s3c2410_wdt.c | |||
@@ -423,6 +423,12 @@ static int s3c2410wdt_probe(struct platform_device *pdev) | |||
423 | if (tmr_atboot && started == 0) { | 423 | if (tmr_atboot && started == 0) { |
424 | printk(KERN_INFO PFX "Starting Watchdog Timer\n"); | 424 | printk(KERN_INFO PFX "Starting Watchdog Timer\n"); |
425 | s3c2410wdt_start(); | 425 | s3c2410wdt_start(); |
426 | } else if (!tmr_atboot) { | ||
427 | /* if we're not enabling the watchdog, then ensure it is | ||
428 | * disabled if it has been left running from the bootloader | ||
429 | * or other source */ | ||
430 | |||
431 | s3c2410wdt_stop(); | ||
426 | } | 432 | } |
427 | 433 | ||
428 | return 0; | 434 | return 0; |
diff --git a/drivers/char/watchdog/sc1200wdt.c b/drivers/char/watchdog/sc1200wdt.c index 515ce7572049..20b88f9b7be2 100644 --- a/drivers/char/watchdog/sc1200wdt.c +++ b/drivers/char/watchdog/sc1200wdt.c | |||
@@ -377,7 +377,7 @@ static int __init sc1200wdt_init(void) | |||
377 | { | 377 | { |
378 | int ret; | 378 | int ret; |
379 | 379 | ||
380 | printk(banner); | 380 | printk("%s\n", banner); |
381 | 381 | ||
382 | spin_lock_init(&sc1200wdt_lock); | 382 | spin_lock_init(&sc1200wdt_lock); |
383 | sema_init(&open_sem, 1); | 383 | sema_init(&open_sem, 1); |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 956d121cb161..3e6ffcaa5af4 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -74,6 +74,8 @@ static unsigned int dbs_enable; /* number of CPUs using this policy */ | |||
74 | static DEFINE_MUTEX (dbs_mutex); | 74 | static DEFINE_MUTEX (dbs_mutex); |
75 | static DECLARE_WORK (dbs_work, do_dbs_timer, NULL); | 75 | static DECLARE_WORK (dbs_work, do_dbs_timer, NULL); |
76 | 76 | ||
77 | static struct workqueue_struct *dbs_workq; | ||
78 | |||
77 | struct dbs_tuners { | 79 | struct dbs_tuners { |
78 | unsigned int sampling_rate; | 80 | unsigned int sampling_rate; |
79 | unsigned int sampling_down_factor; | 81 | unsigned int sampling_down_factor; |
@@ -364,23 +366,29 @@ static void do_dbs_timer(void *data) | |||
364 | mutex_lock(&dbs_mutex); | 366 | mutex_lock(&dbs_mutex); |
365 | for_each_online_cpu(i) | 367 | for_each_online_cpu(i) |
366 | dbs_check_cpu(i); | 368 | dbs_check_cpu(i); |
367 | schedule_delayed_work(&dbs_work, | 369 | queue_delayed_work(dbs_workq, &dbs_work, |
368 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); | 370 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); |
369 | mutex_unlock(&dbs_mutex); | 371 | mutex_unlock(&dbs_mutex); |
370 | } | 372 | } |
371 | 373 | ||
372 | static inline void dbs_timer_init(void) | 374 | static inline void dbs_timer_init(void) |
373 | { | 375 | { |
374 | INIT_WORK(&dbs_work, do_dbs_timer, NULL); | 376 | INIT_WORK(&dbs_work, do_dbs_timer, NULL); |
375 | schedule_delayed_work(&dbs_work, | 377 | if (!dbs_workq) |
376 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); | 378 | dbs_workq = create_singlethread_workqueue("ondemand"); |
379 | if (!dbs_workq) { | ||
380 | printk(KERN_ERR "ondemand: Cannot initialize kernel thread\n"); | ||
381 | return; | ||
382 | } | ||
383 | queue_delayed_work(dbs_workq, &dbs_work, | ||
384 | usecs_to_jiffies(dbs_tuners_ins.sampling_rate)); | ||
377 | return; | 385 | return; |
378 | } | 386 | } |
379 | 387 | ||
380 | static inline void dbs_timer_exit(void) | 388 | static inline void dbs_timer_exit(void) |
381 | { | 389 | { |
382 | cancel_delayed_work(&dbs_work); | 390 | if (dbs_workq) |
383 | return; | 391 | cancel_rearming_delayed_workqueue(dbs_workq, &dbs_work); |
384 | } | 392 | } |
385 | 393 | ||
386 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, | 394 | static int cpufreq_governor_dbs(struct cpufreq_policy *policy, |
@@ -489,8 +497,12 @@ static int __init cpufreq_gov_dbs_init(void) | |||
489 | 497 | ||
490 | static void __exit cpufreq_gov_dbs_exit(void) | 498 | static void __exit cpufreq_gov_dbs_exit(void) |
491 | { | 499 | { |
492 | /* Make sure that the scheduled work is indeed not running */ | 500 | /* Make sure that the scheduled work is indeed not running. |
493 | flush_scheduled_work(); | 501 | Assumes the timer has been cancelled first. */ |
502 | if (dbs_workq) { | ||
503 | flush_workqueue(dbs_workq); | ||
504 | destroy_workqueue(dbs_workq); | ||
505 | } | ||
494 | 506 | ||
495 | cpufreq_unregister_governor(&cpufreq_gov_dbs); | 507 | cpufreq_unregister_governor(&cpufreq_gov_dbs); |
496 | } | 508 | } |
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 8bd305e47f0d..a140e4536a4e 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -133,6 +133,9 @@ static void scx200_acb_machine(struct scx200_acb_iface *iface, u8 status) | |||
133 | 133 | ||
134 | outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); | 134 | outb(inb(ACBCTL1) | ACBCTL1_STOP, ACBCTL1); |
135 | outb(ACBST_STASTR | ACBST_NEGACK, ACBST); | 135 | outb(ACBST_STASTR | ACBST_NEGACK, ACBST); |
136 | |||
137 | /* Reset the status register */ | ||
138 | outb(0, ACBST); | ||
136 | return; | 139 | return; |
137 | } | 140 | } |
138 | 141 | ||
@@ -228,6 +231,10 @@ static void scx200_acb_poll(struct scx200_acb_iface *iface) | |||
228 | timeout = jiffies + POLL_TIMEOUT; | 231 | timeout = jiffies + POLL_TIMEOUT; |
229 | while (time_before(jiffies, timeout)) { | 232 | while (time_before(jiffies, timeout)) { |
230 | status = inb(ACBST); | 233 | status = inb(ACBST); |
234 | |||
235 | /* Reset the status register to avoid the hang */ | ||
236 | outb(0, ACBST); | ||
237 | |||
231 | if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) { | 238 | if ((status & (ACBST_SDAST|ACBST_BER|ACBST_NEGACK)) != 0) { |
232 | scx200_acb_machine(iface, status); | 239 | scx200_acb_machine(iface, status); |
233 | return; | 240 | return; |
@@ -415,7 +422,6 @@ static int __init scx200_acb_create(const char *text, int base, int index) | |||
415 | struct scx200_acb_iface *iface; | 422 | struct scx200_acb_iface *iface; |
416 | struct i2c_adapter *adapter; | 423 | struct i2c_adapter *adapter; |
417 | int rc; | 424 | int rc; |
418 | char description[64]; | ||
419 | 425 | ||
420 | iface = kzalloc(sizeof(*iface), GFP_KERNEL); | 426 | iface = kzalloc(sizeof(*iface), GFP_KERNEL); |
421 | if (!iface) { | 427 | if (!iface) { |
@@ -434,10 +440,7 @@ static int __init scx200_acb_create(const char *text, int base, int index) | |||
434 | 440 | ||
435 | mutex_init(&iface->mutex); | 441 | mutex_init(&iface->mutex); |
436 | 442 | ||
437 | snprintf(description, sizeof(description), "%s ACCESS.bus [%s]", | 443 | if (!request_region(base, 8, adapter->name)) { |
438 | text, adapter->name); | ||
439 | |||
440 | if (request_region(base, 8, description) == 0) { | ||
441 | printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n", | 444 | printk(KERN_ERR NAME ": can't allocate io 0x%x-0x%x\n", |
442 | base, base + 8-1); | 445 | base, base + 8-1); |
443 | rc = -EBUSY; | 446 | rc = -EBUSY; |
@@ -524,6 +527,9 @@ static int __init scx200_acb_init(void) | |||
524 | } else if (pci_dev_present(divil_pci)) | 527 | } else if (pci_dev_present(divil_pci)) |
525 | rc = scx200_add_cs553x(); | 528 | rc = scx200_add_cs553x(); |
526 | 529 | ||
530 | /* If at least one bus was created, init must succeed */ | ||
531 | if (scx200_acb_list) | ||
532 | return 0; | ||
527 | return rc; | 533 | return rc; |
528 | } | 534 | } |
529 | 535 | ||
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 4961f1e764a7..602797a44208 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c | |||
@@ -392,6 +392,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
392 | PCMCIA_DEVICE_PROD_ID12("FREECOM", "PCCARD-IDE", 0x5714cbf7, 0x48e0ab8e), | 392 | PCMCIA_DEVICE_PROD_ID12("FREECOM", "PCCARD-IDE", 0x5714cbf7, 0x48e0ab8e), |
393 | PCMCIA_DEVICE_PROD_ID12("HITACHI", "FLASH", 0xf4f43949, 0x9eb86aae), | 393 | PCMCIA_DEVICE_PROD_ID12("HITACHI", "FLASH", 0xf4f43949, 0x9eb86aae), |
394 | PCMCIA_DEVICE_PROD_ID12("HITACHI", "microdrive", 0xf4f43949, 0xa6d76178), | 394 | PCMCIA_DEVICE_PROD_ID12("HITACHI", "microdrive", 0xf4f43949, 0xa6d76178), |
395 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), | ||
395 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), | 396 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), |
396 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), | 397 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), |
397 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), | 398 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "PCIDE", 0x547e66dc, 0x5c5ab149), |
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c index 78e30f803671..ffca8b63ee79 100644 --- a/drivers/ide/ppc/pmac.c +++ b/drivers/ide/ppc/pmac.c | |||
@@ -553,6 +553,8 @@ pmac_ide_init_hwif_ports(hw_regs_t *hw, | |||
553 | 553 | ||
554 | if (irq != NULL) | 554 | if (irq != NULL) |
555 | *irq = pmac_ide[ix].irq; | 555 | *irq = pmac_ide[ix].irq; |
556 | |||
557 | hw->dev = &pmac_ide[ix].mdev->ofdev.dev; | ||
556 | } | 558 | } |
557 | 559 | ||
558 | #define PMAC_IDE_REG(x) ((void __iomem *)(IDE_DATA_REG+(x))) | 560 | #define PMAC_IDE_REG(x) ((void __iomem *)(IDE_DATA_REG+(x))) |
diff --git a/drivers/ieee1394/ohci1394.c b/drivers/ieee1394/ohci1394.c index 19222878aae9..11f13778f139 100644 --- a/drivers/ieee1394/ohci1394.c +++ b/drivers/ieee1394/ohci1394.c | |||
@@ -553,7 +553,7 @@ static void ohci_initialize(struct ti_ohci *ohci) | |||
553 | * register content. | 553 | * register content. |
554 | * To actually enable physical responses is the job of our interrupt | 554 | * To actually enable physical responses is the job of our interrupt |
555 | * handler which programs the physical request filter. */ | 555 | * handler which programs the physical request filter. */ |
556 | reg_write(ohci, OHCI1394_PhyUpperBound, 0xffff0000); | 556 | reg_write(ohci, OHCI1394_PhyUpperBound, 0x01000000); |
557 | 557 | ||
558 | DBGMSG("physUpperBoundOffset=%08x", | 558 | DBGMSG("physUpperBoundOffset=%08x", |
559 | reg_read(ohci, OHCI1394_PhyUpperBound)); | 559 | reg_read(ohci, OHCI1394_PhyUpperBound)); |
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index f4206604db03..8a23fb54c693 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/kernel.h> | 42 | #include <linux/kernel.h> |
43 | #include <linux/list.h> | 43 | #include <linux/list.h> |
44 | #include <linux/string.h> | 44 | #include <linux/string.h> |
45 | #include <linux/stringify.h> | ||
45 | #include <linux/slab.h> | 46 | #include <linux/slab.h> |
46 | #include <linux/interrupt.h> | 47 | #include <linux/interrupt.h> |
47 | #include <linux/fs.h> | 48 | #include <linux/fs.h> |
@@ -117,7 +118,8 @@ MODULE_PARM_DESC(serialize_io, "Serialize I/O coming from scsi drivers (default | |||
117 | */ | 118 | */ |
118 | static int max_sectors = SBP2_MAX_SECTORS; | 119 | static int max_sectors = SBP2_MAX_SECTORS; |
119 | module_param(max_sectors, int, 0444); | 120 | module_param(max_sectors, int, 0444); |
120 | MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported (default = 255)"); | 121 | MODULE_PARM_DESC(max_sectors, "Change max sectors per I/O supported (default = " |
122 | __stringify(SBP2_MAX_SECTORS) ")"); | ||
121 | 123 | ||
122 | /* | 124 | /* |
123 | * Exclusive login to sbp2 device? In most cases, the sbp2 driver should | 125 | * Exclusive login to sbp2 device? In most cases, the sbp2 driver should |
@@ -135,18 +137,45 @@ module_param(exclusive_login, int, 0644); | |||
135 | MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)"); | 137 | MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)"); |
136 | 138 | ||
137 | /* | 139 | /* |
138 | * SCSI inquiry hack for really badly behaved sbp2 devices. Turn this on | 140 | * If any of the following workarounds is required for your device to work, |
139 | * if your sbp2 device is not properly handling the SCSI inquiry command. | 141 | * please submit the kernel messages logged by sbp2 to the linux1394-devel |
140 | * This hack makes the inquiry look more like a typical MS Windows inquiry | 142 | * mailing list. |
141 | * by enforcing 36 byte inquiry and avoiding access to mode_sense page 8. | ||
142 | * | 143 | * |
143 | * If force_inquiry_hack=1 is required for your device to work, | 144 | * - 128kB max transfer |
144 | * please submit the logged sbp2_firmware_revision value of this device to | 145 | * Limit transfer size. Necessary for some old bridges. |
145 | * the linux1394-devel mailing list. | 146 | * |
147 | * - 36 byte inquiry | ||
148 | * When scsi_mod probes the device, let the inquiry command look like that | ||
149 | * from MS Windows. | ||
150 | * | ||
151 | * - skip mode page 8 | ||
152 | * Suppress sending of mode_sense for mode page 8 if the device pretends to | ||
153 | * support the SCSI Primary Block commands instead of Reduced Block Commands. | ||
154 | * | ||
155 | * - fix capacity | ||
156 | * Tell sd_mod to correct the last sector number reported by read_capacity. | ||
157 | * Avoids access beyond actual disk limits on devices with an off-by-one bug. | ||
158 | * Don't use this with devices which don't have this bug. | ||
159 | * | ||
160 | * - override internal blacklist | ||
161 | * Instead of adding to the built-in blacklist, use only the workarounds | ||
162 | * specified in the module load parameter. | ||
163 | * Useful if a blacklist entry interfered with a non-broken device. | ||
146 | */ | 164 | */ |
165 | static int sbp2_default_workarounds; | ||
166 | module_param_named(workarounds, sbp2_default_workarounds, int, 0644); | ||
167 | MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0" | ||
168 | ", 128kB max transfer = " __stringify(SBP2_WORKAROUND_128K_MAX_TRANS) | ||
169 | ", 36 byte inquiry = " __stringify(SBP2_WORKAROUND_INQUIRY_36) | ||
170 | ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8) | ||
171 | ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY) | ||
172 | ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE) | ||
173 | ", or a combination)"); | ||
174 | |||
175 | /* legacy parameter */ | ||
147 | static int force_inquiry_hack; | 176 | static int force_inquiry_hack; |
148 | module_param(force_inquiry_hack, int, 0644); | 177 | module_param(force_inquiry_hack, int, 0644); |
149 | MODULE_PARM_DESC(force_inquiry_hack, "Force SCSI inquiry hack (default = 0)"); | 178 | MODULE_PARM_DESC(force_inquiry_hack, "Deprecated, use 'workarounds'"); |
150 | 179 | ||
151 | /* | 180 | /* |
152 | * Export information about protocols/devices supported by this driver. | 181 | * Export information about protocols/devices supported by this driver. |
@@ -266,14 +295,55 @@ static struct hpsb_protocol_driver sbp2_driver = { | |||
266 | }; | 295 | }; |
267 | 296 | ||
268 | /* | 297 | /* |
269 | * List of device firmwares that require the inquiry hack. | 298 | * List of devices with known bugs. |
270 | * Yields a few false positives but did not break other devices so far. | 299 | * |
300 | * The firmware_revision field, masked with 0xffff00, is the best indicator | ||
301 | * for the type of bridge chip of a device. It yields a few false positives | ||
302 | * but this did not break correctly behaving devices so far. | ||
271 | */ | 303 | */ |
272 | static u32 sbp2_broken_inquiry_list[] = { | 304 | static const struct { |
273 | 0x00002800, /* Stefan Richter <stefanr@s5r6.in-berlin.de> */ | 305 | u32 firmware_revision; |
274 | /* DViCO Momobay CX-1 */ | 306 | u32 model_id; |
275 | 0x00000200 /* Andreas Plesch <plesch@fas.harvard.edu> */ | 307 | unsigned workarounds; |
276 | /* QPS Fire DVDBurner */ | 308 | } sbp2_workarounds_table[] = { |
309 | /* TSB42AA9 */ { | ||
310 | .firmware_revision = 0x002800, | ||
311 | .workarounds = SBP2_WORKAROUND_INQUIRY_36 | | ||
312 | SBP2_WORKAROUND_MODE_SENSE_8, | ||
313 | }, | ||
314 | /* Initio bridges, actually only needed for some older ones */ { | ||
315 | .firmware_revision = 0x000200, | ||
316 | .workarounds = SBP2_WORKAROUND_INQUIRY_36, | ||
317 | }, | ||
318 | /* Symbios bridge */ { | ||
319 | .firmware_revision = 0xa0b800, | ||
320 | .workarounds = SBP2_WORKAROUND_128K_MAX_TRANS, | ||
321 | }, | ||
322 | /* | ||
323 | * Note about the following Apple iPod blacklist entries: | ||
324 | * | ||
325 | * There are iPods (2nd gen, 3rd gen) with model_id==0. Since our | ||
326 | * matching logic treats 0 as a wildcard, we cannot match this ID | ||
327 | * without rewriting the matching routine. Fortunately these iPods | ||
328 | * do not feature the read_capacity bug according to one report. | ||
329 | * Read_capacity behaviour as well as model_id could change due to | ||
330 | * Apple-supplied firmware updates though. | ||
331 | */ | ||
332 | /* iPod 4th generation */ { | ||
333 | .firmware_revision = 0x0a2700, | ||
334 | .model_id = 0x000021, | ||
335 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | ||
336 | }, | ||
337 | /* iPod mini */ { | ||
338 | .firmware_revision = 0x0a2700, | ||
339 | .model_id = 0x000023, | ||
340 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | ||
341 | }, | ||
342 | /* iPod Photo */ { | ||
343 | .firmware_revision = 0x0a2700, | ||
344 | .model_id = 0x00007e, | ||
345 | .workarounds = SBP2_WORKAROUND_FIX_CAPACITY, | ||
346 | } | ||
277 | }; | 347 | }; |
278 | 348 | ||
279 | /************************************** | 349 | /************************************** |
@@ -765,11 +835,16 @@ static struct scsi_id_instance_data *sbp2_alloc_device(struct unit_directory *ud | |||
765 | 835 | ||
766 | /* Register the status FIFO address range. We could use the same FIFO | 836 | /* Register the status FIFO address range. We could use the same FIFO |
767 | * for targets at different nodes. However we need different FIFOs per | 837 | * for targets at different nodes. However we need different FIFOs per |
768 | * target in order to support multi-unit devices. */ | 838 | * target in order to support multi-unit devices. |
839 | * The FIFO is located out of the local host controller's physical range | ||
840 | * but, if possible, within the posted write area. Status writes will | ||
841 | * then be performed as unified transactions. This slightly reduces | ||
842 | * bandwidth usage, and some Prolific based devices seem to require it. | ||
843 | */ | ||
769 | scsi_id->status_fifo_addr = hpsb_allocate_and_register_addrspace( | 844 | scsi_id->status_fifo_addr = hpsb_allocate_and_register_addrspace( |
770 | &sbp2_highlevel, ud->ne->host, &sbp2_ops, | 845 | &sbp2_highlevel, ud->ne->host, &sbp2_ops, |
771 | sizeof(struct sbp2_status_block), sizeof(quadlet_t), | 846 | sizeof(struct sbp2_status_block), sizeof(quadlet_t), |
772 | ~0ULL, ~0ULL); | 847 | 0x010000000000ULL, CSR1212_ALL_SPACE_END); |
773 | if (!scsi_id->status_fifo_addr) { | 848 | if (!scsi_id->status_fifo_addr) { |
774 | SBP2_ERR("failed to allocate status FIFO address range"); | 849 | SBP2_ERR("failed to allocate status FIFO address range"); |
775 | goto failed_alloc; | 850 | goto failed_alloc; |
@@ -1450,7 +1525,8 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, | |||
1450 | struct csr1212_dentry *dentry; | 1525 | struct csr1212_dentry *dentry; |
1451 | u64 management_agent_addr; | 1526 | u64 management_agent_addr; |
1452 | u32 command_set_spec_id, command_set, unit_characteristics, | 1527 | u32 command_set_spec_id, command_set, unit_characteristics, |
1453 | firmware_revision, workarounds; | 1528 | firmware_revision; |
1529 | unsigned workarounds; | ||
1454 | int i; | 1530 | int i; |
1455 | 1531 | ||
1456 | SBP2_DEBUG_ENTER(); | 1532 | SBP2_DEBUG_ENTER(); |
@@ -1506,12 +1582,8 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, | |||
1506 | case SBP2_FIRMWARE_REVISION_KEY: | 1582 | case SBP2_FIRMWARE_REVISION_KEY: |
1507 | /* Firmware revision */ | 1583 | /* Firmware revision */ |
1508 | firmware_revision = kv->value.immediate; | 1584 | firmware_revision = kv->value.immediate; |
1509 | if (force_inquiry_hack) | 1585 | SBP2_DEBUG("sbp2_firmware_revision = %x", |
1510 | SBP2_INFO("sbp2_firmware_revision = %x", | 1586 | (unsigned int)firmware_revision); |
1511 | (unsigned int)firmware_revision); | ||
1512 | else | ||
1513 | SBP2_DEBUG("sbp2_firmware_revision = %x", | ||
1514 | (unsigned int)firmware_revision); | ||
1515 | break; | 1587 | break; |
1516 | 1588 | ||
1517 | default: | 1589 | default: |
@@ -1519,41 +1591,44 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, | |||
1519 | } | 1591 | } |
1520 | } | 1592 | } |
1521 | 1593 | ||
1522 | /* This is the start of our broken device checking. We try to hack | 1594 | workarounds = sbp2_default_workarounds; |
1523 | * around oddities and known defects. */ | 1595 | if (force_inquiry_hack) { |
1524 | workarounds = 0x0; | 1596 | SBP2_WARN("force_inquiry_hack is deprecated. " |
1597 | "Use parameter 'workarounds' instead."); | ||
1598 | workarounds |= SBP2_WORKAROUND_INQUIRY_36; | ||
1599 | } | ||
1525 | 1600 | ||
1526 | /* If the vendor id is 0xa0b8 (Symbios vendor id), then we have a | 1601 | if (!(workarounds & SBP2_WORKAROUND_OVERRIDE)) |
1527 | * bridge with 128KB max transfer size limitation. For sanity, we | 1602 | for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) { |
1528 | * only voice this when the current max_sectors setting | 1603 | if (sbp2_workarounds_table[i].firmware_revision && |
1529 | * exceeds the 128k limit. By default, that is not the case. | 1604 | sbp2_workarounds_table[i].firmware_revision != |
1530 | * | 1605 | (firmware_revision & 0xffff00)) |
1531 | * It would be really nice if we could detect this before the scsi | 1606 | continue; |
1532 | * host gets initialized. That way we can down-force the | 1607 | if (sbp2_workarounds_table[i].model_id && |
1533 | * max_sectors to account for it. That is not currently | 1608 | sbp2_workarounds_table[i].model_id != ud->model_id) |
1534 | * possible. */ | 1609 | continue; |
1535 | if ((firmware_revision & 0xffff00) == | 1610 | workarounds |= sbp2_workarounds_table[i].workarounds; |
1536 | SBP2_128KB_BROKEN_FIRMWARE && | 1611 | break; |
1537 | (max_sectors * 512) > (128*1024)) { | ||
1538 | SBP2_WARN("Node " NODE_BUS_FMT ": Bridge only supports 128KB max transfer size.", | ||
1539 | NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid)); | ||
1540 | SBP2_WARN("WARNING: Current max_sectors setting is larger than 128KB (%d sectors)!", | ||
1541 | max_sectors); | ||
1542 | workarounds |= SBP2_BREAKAGE_128K_MAX_TRANSFER; | ||
1543 | } | ||
1544 | |||
1545 | /* Check for a blacklisted set of devices that require us to force | ||
1546 | * a 36 byte host inquiry. This can be overriden as a module param | ||
1547 | * (to force all hosts). */ | ||
1548 | for (i = 0; i < ARRAY_SIZE(sbp2_broken_inquiry_list); i++) { | ||
1549 | if ((firmware_revision & 0xffff00) == | ||
1550 | sbp2_broken_inquiry_list[i]) { | ||
1551 | SBP2_WARN("Node " NODE_BUS_FMT ": Using 36byte inquiry workaround", | ||
1552 | NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid)); | ||
1553 | workarounds |= SBP2_BREAKAGE_INQUIRY_HACK; | ||
1554 | break; /* No need to continue. */ | ||
1555 | } | 1612 | } |
1556 | } | 1613 | |
1614 | if (workarounds) | ||
1615 | SBP2_INFO("Workarounds for node " NODE_BUS_FMT ": 0x%x " | ||
1616 | "(firmware_revision 0x%06x, vendor_id 0x%06x," | ||
1617 | " model_id 0x%06x)", | ||
1618 | NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid), | ||
1619 | workarounds, firmware_revision, | ||
1620 | ud->vendor_id ? ud->vendor_id : ud->ne->vendor_id, | ||
1621 | ud->model_id); | ||
1622 | |||
1623 | /* We would need one SCSI host template for each target to adjust | ||
1624 | * max_sectors on the fly, therefore warn only. */ | ||
1625 | if (workarounds & SBP2_WORKAROUND_128K_MAX_TRANS && | ||
1626 | (max_sectors * 512) > (128 * 1024)) | ||
1627 | SBP2_WARN("Node " NODE_BUS_FMT ": Bridge only supports 128KB " | ||
1628 | "max transfer size. WARNING: Current max_sectors " | ||
1629 | "setting is larger than 128KB (%d sectors)", | ||
1630 | NODE_BUS_ARGS(ud->ne->host, ud->ne->nodeid), | ||
1631 | max_sectors); | ||
1557 | 1632 | ||
1558 | /* If this is a logical unit directory entry, process the parent | 1633 | /* If this is a logical unit directory entry, process the parent |
1559 | * to get the values. */ | 1634 | * to get the values. */ |
@@ -2447,19 +2522,25 @@ static int sbp2scsi_slave_alloc(struct scsi_device *sdev) | |||
2447 | 2522 | ||
2448 | scsi_id->sdev = sdev; | 2523 | scsi_id->sdev = sdev; |
2449 | 2524 | ||
2450 | if (force_inquiry_hack || | 2525 | if (scsi_id->workarounds & SBP2_WORKAROUND_INQUIRY_36) |
2451 | scsi_id->workarounds & SBP2_BREAKAGE_INQUIRY_HACK) { | ||
2452 | sdev->inquiry_len = 36; | 2526 | sdev->inquiry_len = 36; |
2453 | sdev->skip_ms_page_8 = 1; | ||
2454 | } | ||
2455 | return 0; | 2527 | return 0; |
2456 | } | 2528 | } |
2457 | 2529 | ||
2458 | static int sbp2scsi_slave_configure(struct scsi_device *sdev) | 2530 | static int sbp2scsi_slave_configure(struct scsi_device *sdev) |
2459 | { | 2531 | { |
2532 | struct scsi_id_instance_data *scsi_id = | ||
2533 | (struct scsi_id_instance_data *)sdev->host->hostdata[0]; | ||
2534 | |||
2460 | blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); | 2535 | blk_queue_dma_alignment(sdev->request_queue, (512 - 1)); |
2461 | sdev->use_10_for_rw = 1; | 2536 | sdev->use_10_for_rw = 1; |
2462 | sdev->use_10_for_ms = 1; | 2537 | sdev->use_10_for_ms = 1; |
2538 | |||
2539 | if (sdev->type == TYPE_DISK && | ||
2540 | scsi_id->workarounds & SBP2_WORKAROUND_MODE_SENSE_8) | ||
2541 | sdev->skip_ms_page_8 = 1; | ||
2542 | if (scsi_id->workarounds & SBP2_WORKAROUND_FIX_CAPACITY) | ||
2543 | sdev->fix_capacity = 1; | ||
2463 | return 0; | 2544 | return 0; |
2464 | } | 2545 | } |
2465 | 2546 | ||
@@ -2603,7 +2684,9 @@ static int sbp2_module_init(void) | |||
2603 | scsi_driver_template.cmd_per_lun = 1; | 2684 | scsi_driver_template.cmd_per_lun = 1; |
2604 | } | 2685 | } |
2605 | 2686 | ||
2606 | /* Set max sectors (module load option). Default is 255 sectors. */ | 2687 | if (sbp2_default_workarounds & SBP2_WORKAROUND_128K_MAX_TRANS && |
2688 | (max_sectors * 512) > (128 * 1024)) | ||
2689 | max_sectors = 128 * 1024 / 512; | ||
2607 | scsi_driver_template.max_sectors = max_sectors; | 2690 | scsi_driver_template.max_sectors = max_sectors; |
2608 | 2691 | ||
2609 | /* Register our high level driver with 1394 stack */ | 2692 | /* Register our high level driver with 1394 stack */ |
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index e2d357a9ea3a..f4ccc9d0fba4 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
@@ -227,11 +227,6 @@ struct sbp2_status_block { | |||
227 | #define SBP2_SW_VERSION_ENTRY 0x00010483 | 227 | #define SBP2_SW_VERSION_ENTRY 0x00010483 |
228 | 228 | ||
229 | /* | 229 | /* |
230 | * Other misc defines | ||
231 | */ | ||
232 | #define SBP2_128KB_BROKEN_FIRMWARE 0xa0b800 | ||
233 | |||
234 | /* | ||
235 | * SCSI specific stuff | 230 | * SCSI specific stuff |
236 | */ | 231 | */ |
237 | 232 | ||
@@ -239,6 +234,13 @@ struct sbp2_status_block { | |||
239 | #define SBP2_MAX_SECTORS 255 /* Max sectors supported */ | 234 | #define SBP2_MAX_SECTORS 255 /* Max sectors supported */ |
240 | #define SBP2_MAX_CMDS 8 /* This should be safe */ | 235 | #define SBP2_MAX_CMDS 8 /* This should be safe */ |
241 | 236 | ||
237 | /* Flags for detected oddities and brokeness */ | ||
238 | #define SBP2_WORKAROUND_128K_MAX_TRANS 0x1 | ||
239 | #define SBP2_WORKAROUND_INQUIRY_36 0x2 | ||
240 | #define SBP2_WORKAROUND_MODE_SENSE_8 0x4 | ||
241 | #define SBP2_WORKAROUND_FIX_CAPACITY 0x8 | ||
242 | #define SBP2_WORKAROUND_OVERRIDE 0x100 | ||
243 | |||
242 | /* This is the two dma types we use for cmd_dma below */ | 244 | /* This is the two dma types we use for cmd_dma below */ |
243 | enum cmd_dma_types { | 245 | enum cmd_dma_types { |
244 | CMD_DMA_NONE, | 246 | CMD_DMA_NONE, |
@@ -268,10 +270,6 @@ struct sbp2_command_info { | |||
268 | 270 | ||
269 | }; | 271 | }; |
270 | 272 | ||
271 | /* A list of flags for detected oddities and brokeness. */ | ||
272 | #define SBP2_BREAKAGE_128K_MAX_TRANSFER 0x1 | ||
273 | #define SBP2_BREAKAGE_INQUIRY_HACK 0x2 | ||
274 | |||
275 | struct sbp2scsi_host_info; | 273 | struct sbp2scsi_host_info; |
276 | 274 | ||
277 | /* | 275 | /* |
@@ -345,7 +343,7 @@ struct scsi_id_instance_data { | |||
345 | struct Scsi_Host *scsi_host; | 343 | struct Scsi_Host *scsi_host; |
346 | 344 | ||
347 | /* Device specific workarounds/brokeness */ | 345 | /* Device specific workarounds/brokeness */ |
348 | u32 workarounds; | 346 | unsigned workarounds; |
349 | }; | 347 | }; |
350 | 348 | ||
351 | /* Sbp2 host data structure (one per IEEE1394 host) */ | 349 | /* Sbp2 host data structure (one per IEEE1394 host) */ |
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c index 7cfedb8d9bcd..86fee43502cd 100644 --- a/drivers/infiniband/core/cm.c +++ b/drivers/infiniband/core/cm.c | |||
@@ -34,6 +34,8 @@ | |||
34 | * | 34 | * |
35 | * $Id: cm.c 2821 2005-07-08 17:07:28Z sean.hefty $ | 35 | * $Id: cm.c 2821 2005-07-08 17:07:28Z sean.hefty $ |
36 | */ | 36 | */ |
37 | |||
38 | #include <linux/completion.h> | ||
37 | #include <linux/dma-mapping.h> | 39 | #include <linux/dma-mapping.h> |
38 | #include <linux/err.h> | 40 | #include <linux/err.h> |
39 | #include <linux/idr.h> | 41 | #include <linux/idr.h> |
@@ -122,7 +124,7 @@ struct cm_id_private { | |||
122 | struct rb_node service_node; | 124 | struct rb_node service_node; |
123 | struct rb_node sidr_id_node; | 125 | struct rb_node sidr_id_node; |
124 | spinlock_t lock; /* Do not acquire inside cm.lock */ | 126 | spinlock_t lock; /* Do not acquire inside cm.lock */ |
125 | wait_queue_head_t wait; | 127 | struct completion comp; |
126 | atomic_t refcount; | 128 | atomic_t refcount; |
127 | 129 | ||
128 | struct ib_mad_send_buf *msg; | 130 | struct ib_mad_send_buf *msg; |
@@ -159,7 +161,7 @@ static void cm_work_handler(void *data); | |||
159 | static inline void cm_deref_id(struct cm_id_private *cm_id_priv) | 161 | static inline void cm_deref_id(struct cm_id_private *cm_id_priv) |
160 | { | 162 | { |
161 | if (atomic_dec_and_test(&cm_id_priv->refcount)) | 163 | if (atomic_dec_and_test(&cm_id_priv->refcount)) |
162 | wake_up(&cm_id_priv->wait); | 164 | complete(&cm_id_priv->comp); |
163 | } | 165 | } |
164 | 166 | ||
165 | static int cm_alloc_msg(struct cm_id_private *cm_id_priv, | 167 | static int cm_alloc_msg(struct cm_id_private *cm_id_priv, |
@@ -559,7 +561,7 @@ struct ib_cm_id *ib_create_cm_id(struct ib_device *device, | |||
559 | goto error; | 561 | goto error; |
560 | 562 | ||
561 | spin_lock_init(&cm_id_priv->lock); | 563 | spin_lock_init(&cm_id_priv->lock); |
562 | init_waitqueue_head(&cm_id_priv->wait); | 564 | init_completion(&cm_id_priv->comp); |
563 | INIT_LIST_HEAD(&cm_id_priv->work_list); | 565 | INIT_LIST_HEAD(&cm_id_priv->work_list); |
564 | atomic_set(&cm_id_priv->work_count, -1); | 566 | atomic_set(&cm_id_priv->work_count, -1); |
565 | atomic_set(&cm_id_priv->refcount, 1); | 567 | atomic_set(&cm_id_priv->refcount, 1); |
@@ -724,8 +726,8 @@ retest: | |||
724 | } | 726 | } |
725 | 727 | ||
726 | cm_free_id(cm_id->local_id); | 728 | cm_free_id(cm_id->local_id); |
727 | atomic_dec(&cm_id_priv->refcount); | 729 | cm_deref_id(cm_id_priv); |
728 | wait_event(cm_id_priv->wait, !atomic_read(&cm_id_priv->refcount)); | 730 | wait_for_completion(&cm_id_priv->comp); |
729 | while ((work = cm_dequeue_work(cm_id_priv)) != NULL) | 731 | while ((work = cm_dequeue_work(cm_id_priv)) != NULL) |
730 | cm_free_work(work); | 732 | cm_free_work(work); |
731 | if (cm_id_priv->private_data && cm_id_priv->private_data_len) | 733 | if (cm_id_priv->private_data && cm_id_priv->private_data_len) |
diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c index 469b6923a2e2..5ad41a64314c 100644 --- a/drivers/infiniband/core/mad.c +++ b/drivers/infiniband/core/mad.c | |||
@@ -352,7 +352,7 @@ struct ib_mad_agent *ib_register_mad_agent(struct ib_device *device, | |||
352 | INIT_WORK(&mad_agent_priv->local_work, local_completions, | 352 | INIT_WORK(&mad_agent_priv->local_work, local_completions, |
353 | mad_agent_priv); | 353 | mad_agent_priv); |
354 | atomic_set(&mad_agent_priv->refcount, 1); | 354 | atomic_set(&mad_agent_priv->refcount, 1); |
355 | init_waitqueue_head(&mad_agent_priv->wait); | 355 | init_completion(&mad_agent_priv->comp); |
356 | 356 | ||
357 | return &mad_agent_priv->agent; | 357 | return &mad_agent_priv->agent; |
358 | 358 | ||
@@ -467,7 +467,7 @@ struct ib_mad_agent *ib_register_mad_snoop(struct ib_device *device, | |||
467 | mad_snoop_priv->agent.qp = port_priv->qp_info[qpn].qp; | 467 | mad_snoop_priv->agent.qp = port_priv->qp_info[qpn].qp; |
468 | mad_snoop_priv->agent.port_num = port_num; | 468 | mad_snoop_priv->agent.port_num = port_num; |
469 | mad_snoop_priv->mad_snoop_flags = mad_snoop_flags; | 469 | mad_snoop_priv->mad_snoop_flags = mad_snoop_flags; |
470 | init_waitqueue_head(&mad_snoop_priv->wait); | 470 | init_completion(&mad_snoop_priv->comp); |
471 | mad_snoop_priv->snoop_index = register_snoop_agent( | 471 | mad_snoop_priv->snoop_index = register_snoop_agent( |
472 | &port_priv->qp_info[qpn], | 472 | &port_priv->qp_info[qpn], |
473 | mad_snoop_priv); | 473 | mad_snoop_priv); |
@@ -486,6 +486,18 @@ error1: | |||
486 | } | 486 | } |
487 | EXPORT_SYMBOL(ib_register_mad_snoop); | 487 | EXPORT_SYMBOL(ib_register_mad_snoop); |
488 | 488 | ||
489 | static inline void deref_mad_agent(struct ib_mad_agent_private *mad_agent_priv) | ||
490 | { | ||
491 | if (atomic_dec_and_test(&mad_agent_priv->refcount)) | ||
492 | complete(&mad_agent_priv->comp); | ||
493 | } | ||
494 | |||
495 | static inline void deref_snoop_agent(struct ib_mad_snoop_private *mad_snoop_priv) | ||
496 | { | ||
497 | if (atomic_dec_and_test(&mad_snoop_priv->refcount)) | ||
498 | complete(&mad_snoop_priv->comp); | ||
499 | } | ||
500 | |||
489 | static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv) | 501 | static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv) |
490 | { | 502 | { |
491 | struct ib_mad_port_private *port_priv; | 503 | struct ib_mad_port_private *port_priv; |
@@ -509,9 +521,8 @@ static void unregister_mad_agent(struct ib_mad_agent_private *mad_agent_priv) | |||
509 | flush_workqueue(port_priv->wq); | 521 | flush_workqueue(port_priv->wq); |
510 | ib_cancel_rmpp_recvs(mad_agent_priv); | 522 | ib_cancel_rmpp_recvs(mad_agent_priv); |
511 | 523 | ||
512 | atomic_dec(&mad_agent_priv->refcount); | 524 | deref_mad_agent(mad_agent_priv); |
513 | wait_event(mad_agent_priv->wait, | 525 | wait_for_completion(&mad_agent_priv->comp); |
514 | !atomic_read(&mad_agent_priv->refcount)); | ||
515 | 526 | ||
516 | kfree(mad_agent_priv->reg_req); | 527 | kfree(mad_agent_priv->reg_req); |
517 | ib_dereg_mr(mad_agent_priv->agent.mr); | 528 | ib_dereg_mr(mad_agent_priv->agent.mr); |
@@ -529,9 +540,8 @@ static void unregister_mad_snoop(struct ib_mad_snoop_private *mad_snoop_priv) | |||
529 | atomic_dec(&qp_info->snoop_count); | 540 | atomic_dec(&qp_info->snoop_count); |
530 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); | 541 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); |
531 | 542 | ||
532 | atomic_dec(&mad_snoop_priv->refcount); | 543 | deref_snoop_agent(mad_snoop_priv); |
533 | wait_event(mad_snoop_priv->wait, | 544 | wait_for_completion(&mad_snoop_priv->comp); |
534 | !atomic_read(&mad_snoop_priv->refcount)); | ||
535 | 545 | ||
536 | kfree(mad_snoop_priv); | 546 | kfree(mad_snoop_priv); |
537 | } | 547 | } |
@@ -600,8 +610,7 @@ static void snoop_send(struct ib_mad_qp_info *qp_info, | |||
600 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); | 610 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); |
601 | mad_snoop_priv->agent.snoop_handler(&mad_snoop_priv->agent, | 611 | mad_snoop_priv->agent.snoop_handler(&mad_snoop_priv->agent, |
602 | send_buf, mad_send_wc); | 612 | send_buf, mad_send_wc); |
603 | if (atomic_dec_and_test(&mad_snoop_priv->refcount)) | 613 | deref_snoop_agent(mad_snoop_priv); |
604 | wake_up(&mad_snoop_priv->wait); | ||
605 | spin_lock_irqsave(&qp_info->snoop_lock, flags); | 614 | spin_lock_irqsave(&qp_info->snoop_lock, flags); |
606 | } | 615 | } |
607 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); | 616 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); |
@@ -626,8 +635,7 @@ static void snoop_recv(struct ib_mad_qp_info *qp_info, | |||
626 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); | 635 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); |
627 | mad_snoop_priv->agent.recv_handler(&mad_snoop_priv->agent, | 636 | mad_snoop_priv->agent.recv_handler(&mad_snoop_priv->agent, |
628 | mad_recv_wc); | 637 | mad_recv_wc); |
629 | if (atomic_dec_and_test(&mad_snoop_priv->refcount)) | 638 | deref_snoop_agent(mad_snoop_priv); |
630 | wake_up(&mad_snoop_priv->wait); | ||
631 | spin_lock_irqsave(&qp_info->snoop_lock, flags); | 639 | spin_lock_irqsave(&qp_info->snoop_lock, flags); |
632 | } | 640 | } |
633 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); | 641 | spin_unlock_irqrestore(&qp_info->snoop_lock, flags); |
@@ -968,8 +976,7 @@ void ib_free_send_mad(struct ib_mad_send_buf *send_buf) | |||
968 | 976 | ||
969 | free_send_rmpp_list(mad_send_wr); | 977 | free_send_rmpp_list(mad_send_wr); |
970 | kfree(send_buf->mad); | 978 | kfree(send_buf->mad); |
971 | if (atomic_dec_and_test(&mad_agent_priv->refcount)) | 979 | deref_mad_agent(mad_agent_priv); |
972 | wake_up(&mad_agent_priv->wait); | ||
973 | } | 980 | } |
974 | EXPORT_SYMBOL(ib_free_send_mad); | 981 | EXPORT_SYMBOL(ib_free_send_mad); |
975 | 982 | ||
@@ -1757,8 +1764,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv, | |||
1757 | mad_recv_wc = ib_process_rmpp_recv_wc(mad_agent_priv, | 1764 | mad_recv_wc = ib_process_rmpp_recv_wc(mad_agent_priv, |
1758 | mad_recv_wc); | 1765 | mad_recv_wc); |
1759 | if (!mad_recv_wc) { | 1766 | if (!mad_recv_wc) { |
1760 | if (atomic_dec_and_test(&mad_agent_priv->refcount)) | 1767 | deref_mad_agent(mad_agent_priv); |
1761 | wake_up(&mad_agent_priv->wait); | ||
1762 | return; | 1768 | return; |
1763 | } | 1769 | } |
1764 | } | 1770 | } |
@@ -1770,8 +1776,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv, | |||
1770 | if (!mad_send_wr) { | 1776 | if (!mad_send_wr) { |
1771 | spin_unlock_irqrestore(&mad_agent_priv->lock, flags); | 1777 | spin_unlock_irqrestore(&mad_agent_priv->lock, flags); |
1772 | ib_free_recv_mad(mad_recv_wc); | 1778 | ib_free_recv_mad(mad_recv_wc); |
1773 | if (atomic_dec_and_test(&mad_agent_priv->refcount)) | 1779 | deref_mad_agent(mad_agent_priv); |
1774 | wake_up(&mad_agent_priv->wait); | ||
1775 | return; | 1780 | return; |
1776 | } | 1781 | } |
1777 | ib_mark_mad_done(mad_send_wr); | 1782 | ib_mark_mad_done(mad_send_wr); |
@@ -1790,8 +1795,7 @@ static void ib_mad_complete_recv(struct ib_mad_agent_private *mad_agent_priv, | |||
1790 | } else { | 1795 | } else { |
1791 | mad_agent_priv->agent.recv_handler(&mad_agent_priv->agent, | 1796 | mad_agent_priv->agent.recv_handler(&mad_agent_priv->agent, |
1792 | mad_recv_wc); | 1797 | mad_recv_wc); |
1793 | if (atomic_dec_and_test(&mad_agent_priv->refcount)) | 1798 | deref_mad_agent(mad_agent_priv); |
1794 | wake_up(&mad_agent_priv->wait); | ||
1795 | } | 1799 | } |
1796 | } | 1800 | } |
1797 | 1801 | ||
@@ -2021,8 +2025,7 @@ void ib_mad_complete_send_wr(struct ib_mad_send_wr_private *mad_send_wr, | |||
2021 | mad_send_wc); | 2025 | mad_send_wc); |
2022 | 2026 | ||
2023 | /* Release reference on agent taken when sending */ | 2027 | /* Release reference on agent taken when sending */ |
2024 | if (atomic_dec_and_test(&mad_agent_priv->refcount)) | 2028 | deref_mad_agent(mad_agent_priv); |
2025 | wake_up(&mad_agent_priv->wait); | ||
2026 | return; | 2029 | return; |
2027 | done: | 2030 | done: |
2028 | spin_unlock_irqrestore(&mad_agent_priv->lock, flags); | 2031 | spin_unlock_irqrestore(&mad_agent_priv->lock, flags); |
diff --git a/drivers/infiniband/core/mad_priv.h b/drivers/infiniband/core/mad_priv.h index 6c9c133d71ef..b4fa28d3160f 100644 --- a/drivers/infiniband/core/mad_priv.h +++ b/drivers/infiniband/core/mad_priv.h | |||
@@ -37,6 +37,7 @@ | |||
37 | #ifndef __IB_MAD_PRIV_H__ | 37 | #ifndef __IB_MAD_PRIV_H__ |
38 | #define __IB_MAD_PRIV_H__ | 38 | #define __IB_MAD_PRIV_H__ |
39 | 39 | ||
40 | #include <linux/completion.h> | ||
40 | #include <linux/pci.h> | 41 | #include <linux/pci.h> |
41 | #include <linux/kthread.h> | 42 | #include <linux/kthread.h> |
42 | #include <linux/workqueue.h> | 43 | #include <linux/workqueue.h> |
@@ -108,7 +109,7 @@ struct ib_mad_agent_private { | |||
108 | struct list_head rmpp_list; | 109 | struct list_head rmpp_list; |
109 | 110 | ||
110 | atomic_t refcount; | 111 | atomic_t refcount; |
111 | wait_queue_head_t wait; | 112 | struct completion comp; |
112 | }; | 113 | }; |
113 | 114 | ||
114 | struct ib_mad_snoop_private { | 115 | struct ib_mad_snoop_private { |
@@ -117,7 +118,7 @@ struct ib_mad_snoop_private { | |||
117 | int snoop_index; | 118 | int snoop_index; |
118 | int mad_snoop_flags; | 119 | int mad_snoop_flags; |
119 | atomic_t refcount; | 120 | atomic_t refcount; |
120 | wait_queue_head_t wait; | 121 | struct completion comp; |
121 | }; | 122 | }; |
122 | 123 | ||
123 | struct ib_mad_send_wr_private { | 124 | struct ib_mad_send_wr_private { |
diff --git a/drivers/infiniband/core/mad_rmpp.c b/drivers/infiniband/core/mad_rmpp.c index dfd4e588ce03..d4704e054e30 100644 --- a/drivers/infiniband/core/mad_rmpp.c +++ b/drivers/infiniband/core/mad_rmpp.c | |||
@@ -49,7 +49,7 @@ struct mad_rmpp_recv { | |||
49 | struct list_head list; | 49 | struct list_head list; |
50 | struct work_struct timeout_work; | 50 | struct work_struct timeout_work; |
51 | struct work_struct cleanup_work; | 51 | struct work_struct cleanup_work; |
52 | wait_queue_head_t wait; | 52 | struct completion comp; |
53 | enum rmpp_state state; | 53 | enum rmpp_state state; |
54 | spinlock_t lock; | 54 | spinlock_t lock; |
55 | atomic_t refcount; | 55 | atomic_t refcount; |
@@ -69,10 +69,16 @@ struct mad_rmpp_recv { | |||
69 | u8 method; | 69 | u8 method; |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static inline void deref_rmpp_recv(struct mad_rmpp_recv *rmpp_recv) | ||
73 | { | ||
74 | if (atomic_dec_and_test(&rmpp_recv->refcount)) | ||
75 | complete(&rmpp_recv->comp); | ||
76 | } | ||
77 | |||
72 | static void destroy_rmpp_recv(struct mad_rmpp_recv *rmpp_recv) | 78 | static void destroy_rmpp_recv(struct mad_rmpp_recv *rmpp_recv) |
73 | { | 79 | { |
74 | atomic_dec(&rmpp_recv->refcount); | 80 | deref_rmpp_recv(rmpp_recv); |
75 | wait_event(rmpp_recv->wait, !atomic_read(&rmpp_recv->refcount)); | 81 | wait_for_completion(&rmpp_recv->comp); |
76 | ib_destroy_ah(rmpp_recv->ah); | 82 | ib_destroy_ah(rmpp_recv->ah); |
77 | kfree(rmpp_recv); | 83 | kfree(rmpp_recv); |
78 | } | 84 | } |
@@ -253,7 +259,7 @@ create_rmpp_recv(struct ib_mad_agent_private *agent, | |||
253 | goto error; | 259 | goto error; |
254 | 260 | ||
255 | rmpp_recv->agent = agent; | 261 | rmpp_recv->agent = agent; |
256 | init_waitqueue_head(&rmpp_recv->wait); | 262 | init_completion(&rmpp_recv->comp); |
257 | INIT_WORK(&rmpp_recv->timeout_work, recv_timeout_handler, rmpp_recv); | 263 | INIT_WORK(&rmpp_recv->timeout_work, recv_timeout_handler, rmpp_recv); |
258 | INIT_WORK(&rmpp_recv->cleanup_work, recv_cleanup_handler, rmpp_recv); | 264 | INIT_WORK(&rmpp_recv->cleanup_work, recv_cleanup_handler, rmpp_recv); |
259 | spin_lock_init(&rmpp_recv->lock); | 265 | spin_lock_init(&rmpp_recv->lock); |
@@ -279,12 +285,6 @@ error: kfree(rmpp_recv); | |||
279 | return NULL; | 285 | return NULL; |
280 | } | 286 | } |
281 | 287 | ||
282 | static inline void deref_rmpp_recv(struct mad_rmpp_recv *rmpp_recv) | ||
283 | { | ||
284 | if (atomic_dec_and_test(&rmpp_recv->refcount)) | ||
285 | wake_up(&rmpp_recv->wait); | ||
286 | } | ||
287 | |||
288 | static struct mad_rmpp_recv * | 288 | static struct mad_rmpp_recv * |
289 | find_rmpp_recv(struct ib_mad_agent_private *agent, | 289 | find_rmpp_recv(struct ib_mad_agent_private *agent, |
290 | struct ib_mad_recv_wc *mad_recv_wc) | 290 | struct ib_mad_recv_wc *mad_recv_wc) |
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c index 15121cb5a1f6..21f9282c1b25 100644 --- a/drivers/infiniband/core/sysfs.c +++ b/drivers/infiniband/core/sysfs.c | |||
@@ -336,7 +336,7 @@ static ssize_t show_pma_counter(struct ib_port *p, struct port_attribute *attr, | |||
336 | switch (width) { | 336 | switch (width) { |
337 | case 4: | 337 | case 4: |
338 | ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >> | 338 | ret = sprintf(buf, "%u\n", (out_mad->data[40 + offset / 8] >> |
339 | (offset % 4)) & 0xf); | 339 | (4 - (offset % 8))) & 0xf); |
340 | break; | 340 | break; |
341 | case 8: | 341 | case 8: |
342 | ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]); | 342 | ret = sprintf(buf, "%u\n", out_mad->data[40 + offset / 8]); |
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c index f6a05965a4e8..9164a09b6ccd 100644 --- a/drivers/infiniband/core/ucm.c +++ b/drivers/infiniband/core/ucm.c | |||
@@ -32,6 +32,8 @@ | |||
32 | * | 32 | * |
33 | * $Id: ucm.c 2594 2005-06-13 19:46:02Z libor $ | 33 | * $Id: ucm.c 2594 2005-06-13 19:46:02Z libor $ |
34 | */ | 34 | */ |
35 | |||
36 | #include <linux/completion.h> | ||
35 | #include <linux/init.h> | 37 | #include <linux/init.h> |
36 | #include <linux/fs.h> | 38 | #include <linux/fs.h> |
37 | #include <linux/module.h> | 39 | #include <linux/module.h> |
@@ -72,7 +74,7 @@ struct ib_ucm_file { | |||
72 | 74 | ||
73 | struct ib_ucm_context { | 75 | struct ib_ucm_context { |
74 | int id; | 76 | int id; |
75 | wait_queue_head_t wait; | 77 | struct completion comp; |
76 | atomic_t ref; | 78 | atomic_t ref; |
77 | int events_reported; | 79 | int events_reported; |
78 | 80 | ||
@@ -138,7 +140,7 @@ static struct ib_ucm_context *ib_ucm_ctx_get(struct ib_ucm_file *file, int id) | |||
138 | static void ib_ucm_ctx_put(struct ib_ucm_context *ctx) | 140 | static void ib_ucm_ctx_put(struct ib_ucm_context *ctx) |
139 | { | 141 | { |
140 | if (atomic_dec_and_test(&ctx->ref)) | 142 | if (atomic_dec_and_test(&ctx->ref)) |
141 | wake_up(&ctx->wait); | 143 | complete(&ctx->comp); |
142 | } | 144 | } |
143 | 145 | ||
144 | static inline int ib_ucm_new_cm_id(int event) | 146 | static inline int ib_ucm_new_cm_id(int event) |
@@ -178,7 +180,7 @@ static struct ib_ucm_context *ib_ucm_ctx_alloc(struct ib_ucm_file *file) | |||
178 | return NULL; | 180 | return NULL; |
179 | 181 | ||
180 | atomic_set(&ctx->ref, 1); | 182 | atomic_set(&ctx->ref, 1); |
181 | init_waitqueue_head(&ctx->wait); | 183 | init_completion(&ctx->comp); |
182 | ctx->file = file; | 184 | ctx->file = file; |
183 | INIT_LIST_HEAD(&ctx->events); | 185 | INIT_LIST_HEAD(&ctx->events); |
184 | 186 | ||
@@ -586,8 +588,8 @@ static ssize_t ib_ucm_destroy_id(struct ib_ucm_file *file, | |||
586 | if (IS_ERR(ctx)) | 588 | if (IS_ERR(ctx)) |
587 | return PTR_ERR(ctx); | 589 | return PTR_ERR(ctx); |
588 | 590 | ||
589 | atomic_dec(&ctx->ref); | 591 | ib_ucm_ctx_put(ctx); |
590 | wait_event(ctx->wait, !atomic_read(&ctx->ref)); | 592 | wait_for_completion(&ctx->comp); |
591 | 593 | ||
592 | /* No new events will be generated after destroying the cm_id. */ | 594 | /* No new events will be generated after destroying the cm_id. */ |
593 | ib_destroy_cm_id(ctx->cm_id); | 595 | ib_destroy_cm_id(ctx->cm_id); |
diff --git a/drivers/infiniband/core/uverbs_mem.c b/drivers/infiniband/core/uverbs_mem.c index 36a32c315668..efe147dbeb42 100644 --- a/drivers/infiniband/core/uverbs_mem.c +++ b/drivers/infiniband/core/uverbs_mem.c | |||
@@ -211,8 +211,10 @@ void ib_umem_release_on_close(struct ib_device *dev, struct ib_umem *umem) | |||
211 | */ | 211 | */ |
212 | 212 | ||
213 | work = kmalloc(sizeof *work, GFP_KERNEL); | 213 | work = kmalloc(sizeof *work, GFP_KERNEL); |
214 | if (!work) | 214 | if (!work) { |
215 | mmput(mm); | ||
215 | return; | 216 | return; |
217 | } | ||
216 | 218 | ||
217 | INIT_WORK(&work->work, ib_umem_account, work); | 219 | INIT_WORK(&work->work, ib_umem_account, work); |
218 | work->mm = mm; | 220 | work->mm = mm; |
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index 398add4d4cb1..3697edafd6d2 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
@@ -116,10 +116,9 @@ static int __devinit ipath_init_one(struct pci_dev *, | |||
116 | #define PCI_DEVICE_ID_INFINIPATH_PE800 0x10 | 116 | #define PCI_DEVICE_ID_INFINIPATH_PE800 0x10 |
117 | 117 | ||
118 | static const struct pci_device_id ipath_pci_tbl[] = { | 118 | static const struct pci_device_id ipath_pci_tbl[] = { |
119 | {PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, | 119 | { PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, PCI_DEVICE_ID_INFINIPATH_HT) }, |
120 | PCI_DEVICE_ID_INFINIPATH_HT)}, | 120 | { PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, PCI_DEVICE_ID_INFINIPATH_PE800) }, |
121 | {PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, | 121 | { 0, } |
122 | PCI_DEVICE_ID_INFINIPATH_PE800)}, | ||
123 | }; | 122 | }; |
124 | 123 | ||
125 | MODULE_DEVICE_TABLE(pci, ipath_pci_tbl); | 124 | MODULE_DEVICE_TABLE(pci, ipath_pci_tbl); |
diff --git a/drivers/infiniband/hw/mthca/mthca_cmd.c b/drivers/infiniband/hw/mthca/mthca_cmd.c index 1985b5dfa481..798e13e14faf 100644 --- a/drivers/infiniband/hw/mthca/mthca_cmd.c +++ b/drivers/infiniband/hw/mthca/mthca_cmd.c | |||
@@ -182,7 +182,7 @@ struct mthca_cmd_context { | |||
182 | u8 status; | 182 | u8 status; |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static int fw_cmd_doorbell = 1; | 185 | static int fw_cmd_doorbell = 0; |
186 | module_param(fw_cmd_doorbell, int, 0644); | 186 | module_param(fw_cmd_doorbell, int, 0644); |
187 | MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " | 187 | MODULE_PARM_DESC(fw_cmd_doorbell, "post FW commands through doorbell page if nonzero " |
188 | "(and supported by FW)"); | 188 | "(and supported by FW)"); |
diff --git a/drivers/infiniband/hw/mthca/mthca_cq.c b/drivers/infiniband/hw/mthca/mthca_cq.c index 312cf90731ea..205854e9c662 100644 --- a/drivers/infiniband/hw/mthca/mthca_cq.c +++ b/drivers/infiniband/hw/mthca/mthca_cq.c | |||
@@ -238,9 +238,9 @@ void mthca_cq_event(struct mthca_dev *dev, u32 cqn, | |||
238 | spin_lock(&dev->cq_table.lock); | 238 | spin_lock(&dev->cq_table.lock); |
239 | 239 | ||
240 | cq = mthca_array_get(&dev->cq_table.cq, cqn & (dev->limits.num_cqs - 1)); | 240 | cq = mthca_array_get(&dev->cq_table.cq, cqn & (dev->limits.num_cqs - 1)); |
241 | |||
242 | if (cq) | 241 | if (cq) |
243 | atomic_inc(&cq->refcount); | 242 | ++cq->refcount; |
243 | |||
244 | spin_unlock(&dev->cq_table.lock); | 244 | spin_unlock(&dev->cq_table.lock); |
245 | 245 | ||
246 | if (!cq) { | 246 | if (!cq) { |
@@ -254,8 +254,10 @@ void mthca_cq_event(struct mthca_dev *dev, u32 cqn, | |||
254 | if (cq->ibcq.event_handler) | 254 | if (cq->ibcq.event_handler) |
255 | cq->ibcq.event_handler(&event, cq->ibcq.cq_context); | 255 | cq->ibcq.event_handler(&event, cq->ibcq.cq_context); |
256 | 256 | ||
257 | if (atomic_dec_and_test(&cq->refcount)) | 257 | spin_lock(&dev->cq_table.lock); |
258 | if (!--cq->refcount) | ||
258 | wake_up(&cq->wait); | 259 | wake_up(&cq->wait); |
260 | spin_unlock(&dev->cq_table.lock); | ||
259 | } | 261 | } |
260 | 262 | ||
261 | static inline int is_recv_cqe(struct mthca_cqe *cqe) | 263 | static inline int is_recv_cqe(struct mthca_cqe *cqe) |
@@ -267,23 +269,13 @@ static inline int is_recv_cqe(struct mthca_cqe *cqe) | |||
267 | return !(cqe->is_send & 0x80); | 269 | return !(cqe->is_send & 0x80); |
268 | } | 270 | } |
269 | 271 | ||
270 | void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, | 272 | void mthca_cq_clean(struct mthca_dev *dev, struct mthca_cq *cq, u32 qpn, |
271 | struct mthca_srq *srq) | 273 | struct mthca_srq *srq) |
272 | { | 274 | { |
273 | struct mthca_cq *cq; | ||
274 | struct mthca_cqe *cqe; | 275 | struct mthca_cqe *cqe; |
275 | u32 prod_index; | 276 | u32 prod_index; |
276 | int nfreed = 0; | 277 | int nfreed = 0; |
277 | 278 | ||
278 | spin_lock_irq(&dev->cq_table.lock); | ||
279 | cq = mthca_array_get(&dev->cq_table.cq, cqn & (dev->limits.num_cqs - 1)); | ||
280 | if (cq) | ||
281 | atomic_inc(&cq->refcount); | ||
282 | spin_unlock_irq(&dev->cq_table.lock); | ||
283 | |||
284 | if (!cq) | ||
285 | return; | ||
286 | |||
287 | spin_lock_irq(&cq->lock); | 279 | spin_lock_irq(&cq->lock); |
288 | 280 | ||
289 | /* | 281 | /* |
@@ -301,7 +293,7 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, | |||
301 | 293 | ||
302 | if (0) | 294 | if (0) |
303 | mthca_dbg(dev, "Cleaning QPN %06x from CQN %06x; ci %d, pi %d\n", | 295 | mthca_dbg(dev, "Cleaning QPN %06x from CQN %06x; ci %d, pi %d\n", |
304 | qpn, cqn, cq->cons_index, prod_index); | 296 | qpn, cq->cqn, cq->cons_index, prod_index); |
305 | 297 | ||
306 | /* | 298 | /* |
307 | * Now sweep backwards through the CQ, removing CQ entries | 299 | * Now sweep backwards through the CQ, removing CQ entries |
@@ -325,8 +317,6 @@ void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, | |||
325 | } | 317 | } |
326 | 318 | ||
327 | spin_unlock_irq(&cq->lock); | 319 | spin_unlock_irq(&cq->lock); |
328 | if (atomic_dec_and_test(&cq->refcount)) | ||
329 | wake_up(&cq->wait); | ||
330 | } | 320 | } |
331 | 321 | ||
332 | void mthca_cq_resize_copy_cqes(struct mthca_cq *cq) | 322 | void mthca_cq_resize_copy_cqes(struct mthca_cq *cq) |
@@ -821,7 +811,7 @@ int mthca_init_cq(struct mthca_dev *dev, int nent, | |||
821 | } | 811 | } |
822 | 812 | ||
823 | spin_lock_init(&cq->lock); | 813 | spin_lock_init(&cq->lock); |
824 | atomic_set(&cq->refcount, 1); | 814 | cq->refcount = 1; |
825 | init_waitqueue_head(&cq->wait); | 815 | init_waitqueue_head(&cq->wait); |
826 | 816 | ||
827 | memset(cq_context, 0, sizeof *cq_context); | 817 | memset(cq_context, 0, sizeof *cq_context); |
@@ -896,6 +886,17 @@ err_out: | |||
896 | return err; | 886 | return err; |
897 | } | 887 | } |
898 | 888 | ||
889 | static inline int get_cq_refcount(struct mthca_dev *dev, struct mthca_cq *cq) | ||
890 | { | ||
891 | int c; | ||
892 | |||
893 | spin_lock_irq(&dev->cq_table.lock); | ||
894 | c = cq->refcount; | ||
895 | spin_unlock_irq(&dev->cq_table.lock); | ||
896 | |||
897 | return c; | ||
898 | } | ||
899 | |||
899 | void mthca_free_cq(struct mthca_dev *dev, | 900 | void mthca_free_cq(struct mthca_dev *dev, |
900 | struct mthca_cq *cq) | 901 | struct mthca_cq *cq) |
901 | { | 902 | { |
@@ -929,6 +930,7 @@ void mthca_free_cq(struct mthca_dev *dev, | |||
929 | spin_lock_irq(&dev->cq_table.lock); | 930 | spin_lock_irq(&dev->cq_table.lock); |
930 | mthca_array_clear(&dev->cq_table.cq, | 931 | mthca_array_clear(&dev->cq_table.cq, |
931 | cq->cqn & (dev->limits.num_cqs - 1)); | 932 | cq->cqn & (dev->limits.num_cqs - 1)); |
933 | --cq->refcount; | ||
932 | spin_unlock_irq(&dev->cq_table.lock); | 934 | spin_unlock_irq(&dev->cq_table.lock); |
933 | 935 | ||
934 | if (dev->mthca_flags & MTHCA_FLAG_MSI_X) | 936 | if (dev->mthca_flags & MTHCA_FLAG_MSI_X) |
@@ -936,8 +938,7 @@ void mthca_free_cq(struct mthca_dev *dev, | |||
936 | else | 938 | else |
937 | synchronize_irq(dev->pdev->irq); | 939 | synchronize_irq(dev->pdev->irq); |
938 | 940 | ||
939 | atomic_dec(&cq->refcount); | 941 | wait_event(cq->wait, !get_cq_refcount(dev, cq)); |
940 | wait_event(cq->wait, !atomic_read(&cq->refcount)); | ||
941 | 942 | ||
942 | if (cq->is_kernel) { | 943 | if (cq->is_kernel) { |
943 | mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); | 944 | mthca_free_cq_buf(dev, &cq->buf, cq->ibcq.cqe); |
diff --git a/drivers/infiniband/hw/mthca/mthca_dev.h b/drivers/infiniband/hw/mthca/mthca_dev.h index 4c1dcb4c1822..f8160b8de090 100644 --- a/drivers/infiniband/hw/mthca/mthca_dev.h +++ b/drivers/infiniband/hw/mthca/mthca_dev.h | |||
@@ -496,7 +496,7 @@ void mthca_free_cq(struct mthca_dev *dev, | |||
496 | void mthca_cq_completion(struct mthca_dev *dev, u32 cqn); | 496 | void mthca_cq_completion(struct mthca_dev *dev, u32 cqn); |
497 | void mthca_cq_event(struct mthca_dev *dev, u32 cqn, | 497 | void mthca_cq_event(struct mthca_dev *dev, u32 cqn, |
498 | enum ib_event_type event_type); | 498 | enum ib_event_type event_type); |
499 | void mthca_cq_clean(struct mthca_dev *dev, u32 cqn, u32 qpn, | 499 | void mthca_cq_clean(struct mthca_dev *dev, struct mthca_cq *cq, u32 qpn, |
500 | struct mthca_srq *srq); | 500 | struct mthca_srq *srq); |
501 | void mthca_cq_resize_copy_cqes(struct mthca_cq *cq); | 501 | void mthca_cq_resize_copy_cqes(struct mthca_cq *cq); |
502 | int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent); | 502 | int mthca_alloc_cq_buf(struct mthca_dev *dev, struct mthca_cq_buf *buf, int nent); |
diff --git a/drivers/infiniband/hw/mthca/mthca_mr.c b/drivers/infiniband/hw/mthca/mthca_mr.c index 25e1c1db9a40..a486dec1707e 100644 --- a/drivers/infiniband/hw/mthca/mthca_mr.c +++ b/drivers/infiniband/hw/mthca/mthca_mr.c | |||
@@ -761,6 +761,7 @@ void mthca_arbel_fmr_unmap(struct mthca_dev *dev, struct mthca_fmr *fmr) | |||
761 | 761 | ||
762 | int __devinit mthca_init_mr_table(struct mthca_dev *dev) | 762 | int __devinit mthca_init_mr_table(struct mthca_dev *dev) |
763 | { | 763 | { |
764 | unsigned long addr; | ||
764 | int err, i; | 765 | int err, i; |
765 | 766 | ||
766 | err = mthca_alloc_init(&dev->mr_table.mpt_alloc, | 767 | err = mthca_alloc_init(&dev->mr_table.mpt_alloc, |
@@ -796,9 +797,12 @@ int __devinit mthca_init_mr_table(struct mthca_dev *dev) | |||
796 | goto err_fmr_mpt; | 797 | goto err_fmr_mpt; |
797 | } | 798 | } |
798 | 799 | ||
800 | addr = pci_resource_start(dev->pdev, 4) + | ||
801 | ((pci_resource_len(dev->pdev, 4) - 1) & | ||
802 | dev->mr_table.mpt_base); | ||
803 | |||
799 | dev->mr_table.tavor_fmr.mpt_base = | 804 | dev->mr_table.tavor_fmr.mpt_base = |
800 | ioremap(dev->mr_table.mpt_base, | 805 | ioremap(addr, (1 << i) * sizeof(struct mthca_mpt_entry)); |
801 | (1 << i) * sizeof (struct mthca_mpt_entry)); | ||
802 | 806 | ||
803 | if (!dev->mr_table.tavor_fmr.mpt_base) { | 807 | if (!dev->mr_table.tavor_fmr.mpt_base) { |
804 | mthca_warn(dev, "MPT ioremap for FMR failed.\n"); | 808 | mthca_warn(dev, "MPT ioremap for FMR failed.\n"); |
@@ -806,9 +810,12 @@ int __devinit mthca_init_mr_table(struct mthca_dev *dev) | |||
806 | goto err_fmr_mpt; | 810 | goto err_fmr_mpt; |
807 | } | 811 | } |
808 | 812 | ||
813 | addr = pci_resource_start(dev->pdev, 4) + | ||
814 | ((pci_resource_len(dev->pdev, 4) - 1) & | ||
815 | dev->mr_table.mtt_base); | ||
816 | |||
809 | dev->mr_table.tavor_fmr.mtt_base = | 817 | dev->mr_table.tavor_fmr.mtt_base = |
810 | ioremap(dev->mr_table.mtt_base, | 818 | ioremap(addr, (1 << i) * MTHCA_MTT_SEG_SIZE); |
811 | (1 << i) * MTHCA_MTT_SEG_SIZE); | ||
812 | if (!dev->mr_table.tavor_fmr.mtt_base) { | 819 | if (!dev->mr_table.tavor_fmr.mtt_base) { |
813 | mthca_warn(dev, "MTT ioremap for FMR failed.\n"); | 820 | mthca_warn(dev, "MTT ioremap for FMR failed.\n"); |
814 | err = -ENOMEM; | 821 | err = -ENOMEM; |
diff --git a/drivers/infiniband/hw/mthca/mthca_provider.h b/drivers/infiniband/hw/mthca/mthca_provider.h index 6676a786d690..179a8f610d0f 100644 --- a/drivers/infiniband/hw/mthca/mthca_provider.h +++ b/drivers/infiniband/hw/mthca/mthca_provider.h | |||
@@ -139,11 +139,12 @@ struct mthca_ah { | |||
139 | * a qp may be locked, with the send cq locked first. No other | 139 | * a qp may be locked, with the send cq locked first. No other |
140 | * nesting should be done. | 140 | * nesting should be done. |
141 | * | 141 | * |
142 | * Each struct mthca_cq/qp also has an atomic_t ref count. The | 142 | * Each struct mthca_cq/qp also has an ref count, protected by the |
143 | * pointer from the cq/qp_table to the struct counts as one reference. | 143 | * corresponding table lock. The pointer from the cq/qp_table to the |
144 | * This reference also is good for access through the consumer API, so | 144 | * struct counts as one reference. This reference also is good for |
145 | * modifying the CQ/QP etc doesn't need to take another reference. | 145 | * access through the consumer API, so modifying the CQ/QP etc doesn't |
146 | * Access because of a completion being polled does need a reference. | 146 | * need to take another reference. Access to a QP because of a |
147 | * completion being polled does not need a reference either. | ||
147 | * | 148 | * |
148 | * Finally, each struct mthca_cq/qp has a wait_queue_head_t for the | 149 | * Finally, each struct mthca_cq/qp has a wait_queue_head_t for the |
149 | * destroy function to sleep on. | 150 | * destroy function to sleep on. |
@@ -159,8 +160,9 @@ struct mthca_ah { | |||
159 | * - decrement ref count; if zero, wake up waiters | 160 | * - decrement ref count; if zero, wake up waiters |
160 | * | 161 | * |
161 | * To destroy a CQ/QP, we can do the following: | 162 | * To destroy a CQ/QP, we can do the following: |
162 | * - lock cq/qp_table, remove pointer, unlock cq/qp_table lock | 163 | * - lock cq/qp_table |
163 | * - decrement ref count | 164 | * - remove pointer and decrement ref count |
165 | * - unlock cq/qp_table lock | ||
164 | * - wait_event until ref count is zero | 166 | * - wait_event until ref count is zero |
165 | * | 167 | * |
166 | * It is the consumer's responsibilty to make sure that no QP | 168 | * It is the consumer's responsibilty to make sure that no QP |
@@ -197,7 +199,7 @@ struct mthca_cq_resize { | |||
197 | struct mthca_cq { | 199 | struct mthca_cq { |
198 | struct ib_cq ibcq; | 200 | struct ib_cq ibcq; |
199 | spinlock_t lock; | 201 | spinlock_t lock; |
200 | atomic_t refcount; | 202 | int refcount; |
201 | int cqn; | 203 | int cqn; |
202 | u32 cons_index; | 204 | u32 cons_index; |
203 | struct mthca_cq_buf buf; | 205 | struct mthca_cq_buf buf; |
@@ -217,7 +219,7 @@ struct mthca_cq { | |||
217 | struct mthca_srq { | 219 | struct mthca_srq { |
218 | struct ib_srq ibsrq; | 220 | struct ib_srq ibsrq; |
219 | spinlock_t lock; | 221 | spinlock_t lock; |
220 | atomic_t refcount; | 222 | int refcount; |
221 | int srqn; | 223 | int srqn; |
222 | int max; | 224 | int max; |
223 | int max_gs; | 225 | int max_gs; |
@@ -254,7 +256,7 @@ struct mthca_wq { | |||
254 | 256 | ||
255 | struct mthca_qp { | 257 | struct mthca_qp { |
256 | struct ib_qp ibqp; | 258 | struct ib_qp ibqp; |
257 | atomic_t refcount; | 259 | int refcount; |
258 | u32 qpn; | 260 | u32 qpn; |
259 | int is_direct; | 261 | int is_direct; |
260 | u8 port; /* for SQP and memfree use only */ | 262 | u8 port; /* for SQP and memfree use only */ |
diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index f37b0e367323..07c13be07a4a 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c | |||
@@ -240,7 +240,7 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn, | |||
240 | spin_lock(&dev->qp_table.lock); | 240 | spin_lock(&dev->qp_table.lock); |
241 | qp = mthca_array_get(&dev->qp_table.qp, qpn & (dev->limits.num_qps - 1)); | 241 | qp = mthca_array_get(&dev->qp_table.qp, qpn & (dev->limits.num_qps - 1)); |
242 | if (qp) | 242 | if (qp) |
243 | atomic_inc(&qp->refcount); | 243 | ++qp->refcount; |
244 | spin_unlock(&dev->qp_table.lock); | 244 | spin_unlock(&dev->qp_table.lock); |
245 | 245 | ||
246 | if (!qp) { | 246 | if (!qp) { |
@@ -257,8 +257,10 @@ void mthca_qp_event(struct mthca_dev *dev, u32 qpn, | |||
257 | if (qp->ibqp.event_handler) | 257 | if (qp->ibqp.event_handler) |
258 | qp->ibqp.event_handler(&event, qp->ibqp.qp_context); | 258 | qp->ibqp.event_handler(&event, qp->ibqp.qp_context); |
259 | 259 | ||
260 | if (atomic_dec_and_test(&qp->refcount)) | 260 | spin_lock(&dev->qp_table.lock); |
261 | if (!--qp->refcount) | ||
261 | wake_up(&qp->wait); | 262 | wake_up(&qp->wait); |
263 | spin_unlock(&dev->qp_table.lock); | ||
262 | } | 264 | } |
263 | 265 | ||
264 | static int to_mthca_state(enum ib_qp_state ib_state) | 266 | static int to_mthca_state(enum ib_qp_state ib_state) |
@@ -833,10 +835,10 @@ int mthca_modify_qp(struct ib_qp *ibqp, struct ib_qp_attr *attr, int attr_mask) | |||
833 | * entries and reinitialize the QP. | 835 | * entries and reinitialize the QP. |
834 | */ | 836 | */ |
835 | if (new_state == IB_QPS_RESET && !qp->ibqp.uobject) { | 837 | if (new_state == IB_QPS_RESET && !qp->ibqp.uobject) { |
836 | mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, | 838 | mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq), qp->qpn, |
837 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); | 839 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); |
838 | if (qp->ibqp.send_cq != qp->ibqp.recv_cq) | 840 | if (qp->ibqp.send_cq != qp->ibqp.recv_cq) |
839 | mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq)->cqn, qp->qpn, | 841 | mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn, |
840 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); | 842 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); |
841 | 843 | ||
842 | mthca_wq_init(&qp->sq); | 844 | mthca_wq_init(&qp->sq); |
@@ -1096,7 +1098,7 @@ static int mthca_alloc_qp_common(struct mthca_dev *dev, | |||
1096 | int ret; | 1098 | int ret; |
1097 | int i; | 1099 | int i; |
1098 | 1100 | ||
1099 | atomic_set(&qp->refcount, 1); | 1101 | qp->refcount = 1; |
1100 | init_waitqueue_head(&qp->wait); | 1102 | init_waitqueue_head(&qp->wait); |
1101 | qp->state = IB_QPS_RESET; | 1103 | qp->state = IB_QPS_RESET; |
1102 | qp->atomic_rd_en = 0; | 1104 | qp->atomic_rd_en = 0; |
@@ -1318,6 +1320,17 @@ int mthca_alloc_sqp(struct mthca_dev *dev, | |||
1318 | return err; | 1320 | return err; |
1319 | } | 1321 | } |
1320 | 1322 | ||
1323 | static inline int get_qp_refcount(struct mthca_dev *dev, struct mthca_qp *qp) | ||
1324 | { | ||
1325 | int c; | ||
1326 | |||
1327 | spin_lock_irq(&dev->qp_table.lock); | ||
1328 | c = qp->refcount; | ||
1329 | spin_unlock_irq(&dev->qp_table.lock); | ||
1330 | |||
1331 | return c; | ||
1332 | } | ||
1333 | |||
1321 | void mthca_free_qp(struct mthca_dev *dev, | 1334 | void mthca_free_qp(struct mthca_dev *dev, |
1322 | struct mthca_qp *qp) | 1335 | struct mthca_qp *qp) |
1323 | { | 1336 | { |
@@ -1339,14 +1352,14 @@ void mthca_free_qp(struct mthca_dev *dev, | |||
1339 | spin_lock(&dev->qp_table.lock); | 1352 | spin_lock(&dev->qp_table.lock); |
1340 | mthca_array_clear(&dev->qp_table.qp, | 1353 | mthca_array_clear(&dev->qp_table.qp, |
1341 | qp->qpn & (dev->limits.num_qps - 1)); | 1354 | qp->qpn & (dev->limits.num_qps - 1)); |
1355 | --qp->refcount; | ||
1342 | spin_unlock(&dev->qp_table.lock); | 1356 | spin_unlock(&dev->qp_table.lock); |
1343 | 1357 | ||
1344 | if (send_cq != recv_cq) | 1358 | if (send_cq != recv_cq) |
1345 | spin_unlock(&recv_cq->lock); | 1359 | spin_unlock(&recv_cq->lock); |
1346 | spin_unlock_irq(&send_cq->lock); | 1360 | spin_unlock_irq(&send_cq->lock); |
1347 | 1361 | ||
1348 | atomic_dec(&qp->refcount); | 1362 | wait_event(qp->wait, !get_qp_refcount(dev, qp)); |
1349 | wait_event(qp->wait, !atomic_read(&qp->refcount)); | ||
1350 | 1363 | ||
1351 | if (qp->state != IB_QPS_RESET) | 1364 | if (qp->state != IB_QPS_RESET) |
1352 | mthca_MODIFY_QP(dev, qp->state, IB_QPS_RESET, qp->qpn, 0, | 1365 | mthca_MODIFY_QP(dev, qp->state, IB_QPS_RESET, qp->qpn, 0, |
@@ -1358,10 +1371,10 @@ void mthca_free_qp(struct mthca_dev *dev, | |||
1358 | * unref the mem-free tables and free the QPN in our table. | 1371 | * unref the mem-free tables and free the QPN in our table. |
1359 | */ | 1372 | */ |
1360 | if (!qp->ibqp.uobject) { | 1373 | if (!qp->ibqp.uobject) { |
1361 | mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq)->cqn, qp->qpn, | 1374 | mthca_cq_clean(dev, to_mcq(qp->ibqp.send_cq), qp->qpn, |
1362 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); | 1375 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); |
1363 | if (qp->ibqp.send_cq != qp->ibqp.recv_cq) | 1376 | if (qp->ibqp.send_cq != qp->ibqp.recv_cq) |
1364 | mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq)->cqn, qp->qpn, | 1377 | mthca_cq_clean(dev, to_mcq(qp->ibqp.recv_cq), qp->qpn, |
1365 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); | 1378 | qp->ibqp.srq ? to_msrq(qp->ibqp.srq) : NULL); |
1366 | 1379 | ||
1367 | mthca_free_memfree(dev, qp); | 1380 | mthca_free_memfree(dev, qp); |
@@ -1714,23 +1727,7 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, | |||
1714 | 1727 | ||
1715 | ind = qp->rq.next_ind; | 1728 | ind = qp->rq.next_ind; |
1716 | 1729 | ||
1717 | for (nreq = 0; wr; ++nreq, wr = wr->next) { | 1730 | for (nreq = 0; wr; wr = wr->next) { |
1718 | if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { | ||
1719 | nreq = 0; | ||
1720 | |||
1721 | doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0); | ||
1722 | doorbell[1] = cpu_to_be32(qp->qpn << 8); | ||
1723 | |||
1724 | wmb(); | ||
1725 | |||
1726 | mthca_write64(doorbell, | ||
1727 | dev->kar + MTHCA_RECEIVE_DOORBELL, | ||
1728 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | ||
1729 | |||
1730 | qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB; | ||
1731 | size0 = 0; | ||
1732 | } | ||
1733 | |||
1734 | if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { | 1731 | if (mthca_wq_overflow(&qp->rq, nreq, qp->ibqp.recv_cq)) { |
1735 | mthca_err(dev, "RQ %06x full (%u head, %u tail," | 1732 | mthca_err(dev, "RQ %06x full (%u head, %u tail," |
1736 | " %d max, %d nreq)\n", qp->qpn, | 1733 | " %d max, %d nreq)\n", qp->qpn, |
@@ -1784,6 +1781,23 @@ int mthca_tavor_post_receive(struct ib_qp *ibqp, struct ib_recv_wr *wr, | |||
1784 | ++ind; | 1781 | ++ind; |
1785 | if (unlikely(ind >= qp->rq.max)) | 1782 | if (unlikely(ind >= qp->rq.max)) |
1786 | ind -= qp->rq.max; | 1783 | ind -= qp->rq.max; |
1784 | |||
1785 | ++nreq; | ||
1786 | if (unlikely(nreq == MTHCA_TAVOR_MAX_WQES_PER_RECV_DB)) { | ||
1787 | nreq = 0; | ||
1788 | |||
1789 | doorbell[0] = cpu_to_be32((qp->rq.next_ind << qp->rq.wqe_shift) | size0); | ||
1790 | doorbell[1] = cpu_to_be32(qp->qpn << 8); | ||
1791 | |||
1792 | wmb(); | ||
1793 | |||
1794 | mthca_write64(doorbell, | ||
1795 | dev->kar + MTHCA_RECEIVE_DOORBELL, | ||
1796 | MTHCA_GET_DOORBELL_LOCK(&dev->doorbell_lock)); | ||
1797 | |||
1798 | qp->rq.head += MTHCA_TAVOR_MAX_WQES_PER_RECV_DB; | ||
1799 | size0 = 0; | ||
1800 | } | ||
1787 | } | 1801 | } |
1788 | 1802 | ||
1789 | out: | 1803 | out: |
diff --git a/drivers/infiniband/hw/mthca/mthca_srq.c b/drivers/infiniband/hw/mthca/mthca_srq.c index adcaf85355ae..1ea433291fa7 100644 --- a/drivers/infiniband/hw/mthca/mthca_srq.c +++ b/drivers/infiniband/hw/mthca/mthca_srq.c | |||
@@ -241,7 +241,7 @@ int mthca_alloc_srq(struct mthca_dev *dev, struct mthca_pd *pd, | |||
241 | goto err_out_mailbox; | 241 | goto err_out_mailbox; |
242 | 242 | ||
243 | spin_lock_init(&srq->lock); | 243 | spin_lock_init(&srq->lock); |
244 | atomic_set(&srq->refcount, 1); | 244 | srq->refcount = 1; |
245 | init_waitqueue_head(&srq->wait); | 245 | init_waitqueue_head(&srq->wait); |
246 | 246 | ||
247 | if (mthca_is_memfree(dev)) | 247 | if (mthca_is_memfree(dev)) |
@@ -308,6 +308,17 @@ err_out: | |||
308 | return err; | 308 | return err; |
309 | } | 309 | } |
310 | 310 | ||
311 | static inline int get_srq_refcount(struct mthca_dev *dev, struct mthca_srq *srq) | ||
312 | { | ||
313 | int c; | ||
314 | |||
315 | spin_lock_irq(&dev->srq_table.lock); | ||
316 | c = srq->refcount; | ||
317 | spin_unlock_irq(&dev->srq_table.lock); | ||
318 | |||
319 | return c; | ||
320 | } | ||
321 | |||
311 | void mthca_free_srq(struct mthca_dev *dev, struct mthca_srq *srq) | 322 | void mthca_free_srq(struct mthca_dev *dev, struct mthca_srq *srq) |
312 | { | 323 | { |
313 | struct mthca_mailbox *mailbox; | 324 | struct mthca_mailbox *mailbox; |
@@ -329,10 +340,10 @@ void mthca_free_srq(struct mthca_dev *dev, struct mthca_srq *srq) | |||
329 | spin_lock_irq(&dev->srq_table.lock); | 340 | spin_lock_irq(&dev->srq_table.lock); |
330 | mthca_array_clear(&dev->srq_table.srq, | 341 | mthca_array_clear(&dev->srq_table.srq, |
331 | srq->srqn & (dev->limits.num_srqs - 1)); | 342 | srq->srqn & (dev->limits.num_srqs - 1)); |
343 | --srq->refcount; | ||
332 | spin_unlock_irq(&dev->srq_table.lock); | 344 | spin_unlock_irq(&dev->srq_table.lock); |
333 | 345 | ||
334 | atomic_dec(&srq->refcount); | 346 | wait_event(srq->wait, !get_srq_refcount(dev, srq)); |
335 | wait_event(srq->wait, !atomic_read(&srq->refcount)); | ||
336 | 347 | ||
337 | if (!srq->ibsrq.uobject) { | 348 | if (!srq->ibsrq.uobject) { |
338 | mthca_free_srq_buf(dev, srq); | 349 | mthca_free_srq_buf(dev, srq); |
@@ -414,7 +425,7 @@ void mthca_srq_event(struct mthca_dev *dev, u32 srqn, | |||
414 | spin_lock(&dev->srq_table.lock); | 425 | spin_lock(&dev->srq_table.lock); |
415 | srq = mthca_array_get(&dev->srq_table.srq, srqn & (dev->limits.num_srqs - 1)); | 426 | srq = mthca_array_get(&dev->srq_table.srq, srqn & (dev->limits.num_srqs - 1)); |
416 | if (srq) | 427 | if (srq) |
417 | atomic_inc(&srq->refcount); | 428 | ++srq->refcount; |
418 | spin_unlock(&dev->srq_table.lock); | 429 | spin_unlock(&dev->srq_table.lock); |
419 | 430 | ||
420 | if (!srq) { | 431 | if (!srq) { |
@@ -431,8 +442,10 @@ void mthca_srq_event(struct mthca_dev *dev, u32 srqn, | |||
431 | srq->ibsrq.event_handler(&event, srq->ibsrq.srq_context); | 442 | srq->ibsrq.event_handler(&event, srq->ibsrq.srq_context); |
432 | 443 | ||
433 | out: | 444 | out: |
434 | if (atomic_dec_and_test(&srq->refcount)) | 445 | spin_lock(&dev->srq_table.lock); |
446 | if (!--srq->refcount) | ||
435 | wake_up(&srq->wait); | 447 | wake_up(&srq->wait); |
448 | spin_unlock(&dev->srq_table.lock); | ||
436 | } | 449 | } |
437 | 450 | ||
438 | /* | 451 | /* |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c index 4ca175553f9f..f887780e8093 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_vlan.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_vlan.c | |||
@@ -158,10 +158,8 @@ int ipoib_vlan_delete(struct net_device *pdev, unsigned short pkey) | |||
158 | if (priv->pkey == pkey) { | 158 | if (priv->pkey == pkey) { |
159 | unregister_netdev(priv->dev); | 159 | unregister_netdev(priv->dev); |
160 | ipoib_dev_cleanup(priv->dev); | 160 | ipoib_dev_cleanup(priv->dev); |
161 | |||
162 | list_del(&priv->list); | 161 | list_del(&priv->list); |
163 | 162 | free_netdev(priv->dev); | |
164 | kfree(priv); | ||
165 | 163 | ||
166 | ret = 0; | 164 | ret = 0; |
167 | break; | 165 | break; |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 5bb55742ada6..9cbdffa08dc2 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -340,7 +340,10 @@ static void srp_disconnect_target(struct srp_target_port *target) | |||
340 | /* XXX should send SRP_I_LOGOUT request */ | 340 | /* XXX should send SRP_I_LOGOUT request */ |
341 | 341 | ||
342 | init_completion(&target->done); | 342 | init_completion(&target->done); |
343 | ib_send_cm_dreq(target->cm_id, NULL, 0); | 343 | if (ib_send_cm_dreq(target->cm_id, NULL, 0)) { |
344 | printk(KERN_DEBUG PFX "Sending CM DREQ failed\n"); | ||
345 | return; | ||
346 | } | ||
344 | wait_for_completion(&target->done); | 347 | wait_for_completion(&target->done); |
345 | } | 348 | } |
346 | 349 | ||
@@ -351,7 +354,6 @@ static void srp_remove_work(void *target_ptr) | |||
351 | spin_lock_irq(target->scsi_host->host_lock); | 354 | spin_lock_irq(target->scsi_host->host_lock); |
352 | if (target->state != SRP_TARGET_DEAD) { | 355 | if (target->state != SRP_TARGET_DEAD) { |
353 | spin_unlock_irq(target->scsi_host->host_lock); | 356 | spin_unlock_irq(target->scsi_host->host_lock); |
354 | scsi_host_put(target->scsi_host); | ||
355 | return; | 357 | return; |
356 | } | 358 | } |
357 | target->state = SRP_TARGET_REMOVED; | 359 | target->state = SRP_TARGET_REMOVED; |
@@ -365,8 +367,6 @@ static void srp_remove_work(void *target_ptr) | |||
365 | ib_destroy_cm_id(target->cm_id); | 367 | ib_destroy_cm_id(target->cm_id); |
366 | srp_free_target_ib(target); | 368 | srp_free_target_ib(target); |
367 | scsi_host_put(target->scsi_host); | 369 | scsi_host_put(target->scsi_host); |
368 | /* And another put to really free the target port... */ | ||
369 | scsi_host_put(target->scsi_host); | ||
370 | } | 370 | } |
371 | 371 | ||
372 | static int srp_connect_target(struct srp_target_port *target) | 372 | static int srp_connect_target(struct srp_target_port *target) |
@@ -409,6 +409,34 @@ static int srp_connect_target(struct srp_target_port *target) | |||
409 | } | 409 | } |
410 | } | 410 | } |
411 | 411 | ||
412 | static void srp_unmap_data(struct scsi_cmnd *scmnd, | ||
413 | struct srp_target_port *target, | ||
414 | struct srp_request *req) | ||
415 | { | ||
416 | struct scatterlist *scat; | ||
417 | int nents; | ||
418 | |||
419 | if (!scmnd->request_buffer || | ||
420 | (scmnd->sc_data_direction != DMA_TO_DEVICE && | ||
421 | scmnd->sc_data_direction != DMA_FROM_DEVICE)) | ||
422 | return; | ||
423 | |||
424 | /* | ||
425 | * This handling of non-SG commands can be killed when the | ||
426 | * SCSI midlayer no longer generates non-SG commands. | ||
427 | */ | ||
428 | if (likely(scmnd->use_sg)) { | ||
429 | nents = scmnd->use_sg; | ||
430 | scat = scmnd->request_buffer; | ||
431 | } else { | ||
432 | nents = 1; | ||
433 | scat = &req->fake_sg; | ||
434 | } | ||
435 | |||
436 | dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents, | ||
437 | scmnd->sc_data_direction); | ||
438 | } | ||
439 | |||
412 | static int srp_reconnect_target(struct srp_target_port *target) | 440 | static int srp_reconnect_target(struct srp_target_port *target) |
413 | { | 441 | { |
414 | struct ib_cm_id *new_cm_id; | 442 | struct ib_cm_id *new_cm_id; |
@@ -455,16 +483,16 @@ static int srp_reconnect_target(struct srp_target_port *target) | |||
455 | list_for_each_entry(req, &target->req_queue, list) { | 483 | list_for_each_entry(req, &target->req_queue, list) { |
456 | req->scmnd->result = DID_RESET << 16; | 484 | req->scmnd->result = DID_RESET << 16; |
457 | req->scmnd->scsi_done(req->scmnd); | 485 | req->scmnd->scsi_done(req->scmnd); |
486 | srp_unmap_data(req->scmnd, target, req); | ||
458 | } | 487 | } |
459 | 488 | ||
460 | target->rx_head = 0; | 489 | target->rx_head = 0; |
461 | target->tx_head = 0; | 490 | target->tx_head = 0; |
462 | target->tx_tail = 0; | 491 | target->tx_tail = 0; |
463 | target->req_head = 0; | 492 | INIT_LIST_HEAD(&target->free_reqs); |
464 | for (i = 0; i < SRP_SQ_SIZE - 1; ++i) | ||
465 | target->req_ring[i].next = i + 1; | ||
466 | target->req_ring[SRP_SQ_SIZE - 1].next = -1; | ||
467 | INIT_LIST_HEAD(&target->req_queue); | 493 | INIT_LIST_HEAD(&target->req_queue); |
494 | for (i = 0; i < SRP_SQ_SIZE; ++i) | ||
495 | list_add_tail(&target->req_ring[i].list, &target->free_reqs); | ||
468 | 496 | ||
469 | ret = srp_connect_target(target); | 497 | ret = srp_connect_target(target); |
470 | if (ret) | 498 | if (ret) |
@@ -589,40 +617,10 @@ static int srp_map_data(struct scsi_cmnd *scmnd, struct srp_target_port *target, | |||
589 | return len; | 617 | return len; |
590 | } | 618 | } |
591 | 619 | ||
592 | static void srp_unmap_data(struct scsi_cmnd *scmnd, | 620 | static void srp_remove_req(struct srp_target_port *target, struct srp_request *req) |
593 | struct srp_target_port *target, | ||
594 | struct srp_request *req) | ||
595 | { | ||
596 | struct scatterlist *scat; | ||
597 | int nents; | ||
598 | |||
599 | if (!scmnd->request_buffer || | ||
600 | (scmnd->sc_data_direction != DMA_TO_DEVICE && | ||
601 | scmnd->sc_data_direction != DMA_FROM_DEVICE)) | ||
602 | return; | ||
603 | |||
604 | /* | ||
605 | * This handling of non-SG commands can be killed when the | ||
606 | * SCSI midlayer no longer generates non-SG commands. | ||
607 | */ | ||
608 | if (likely(scmnd->use_sg)) { | ||
609 | nents = scmnd->use_sg; | ||
610 | scat = scmnd->request_buffer; | ||
611 | } else { | ||
612 | nents = 1; | ||
613 | scat = &req->fake_sg; | ||
614 | } | ||
615 | |||
616 | dma_unmap_sg(target->srp_host->dev->dma_device, scat, nents, | ||
617 | scmnd->sc_data_direction); | ||
618 | } | ||
619 | |||
620 | static void srp_remove_req(struct srp_target_port *target, struct srp_request *req, | ||
621 | int index) | ||
622 | { | 621 | { |
623 | list_del(&req->list); | 622 | srp_unmap_data(req->scmnd, target, req); |
624 | req->next = target->req_head; | 623 | list_move_tail(&req->list, &target->free_reqs); |
625 | target->req_head = index; | ||
626 | } | 624 | } |
627 | 625 | ||
628 | static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) | 626 | static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) |
@@ -647,7 +645,7 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) | |||
647 | req->tsk_status = rsp->data[3]; | 645 | req->tsk_status = rsp->data[3]; |
648 | complete(&req->done); | 646 | complete(&req->done); |
649 | } else { | 647 | } else { |
650 | scmnd = req->scmnd; | 648 | scmnd = req->scmnd; |
651 | if (!scmnd) | 649 | if (!scmnd) |
652 | printk(KERN_ERR "Null scmnd for RSP w/tag %016llx\n", | 650 | printk(KERN_ERR "Null scmnd for RSP w/tag %016llx\n", |
653 | (unsigned long long) rsp->tag); | 651 | (unsigned long long) rsp->tag); |
@@ -665,14 +663,11 @@ static void srp_process_rsp(struct srp_target_port *target, struct srp_rsp *rsp) | |||
665 | else if (rsp->flags & (SRP_RSP_FLAG_DIOVER | SRP_RSP_FLAG_DIUNDER)) | 663 | else if (rsp->flags & (SRP_RSP_FLAG_DIOVER | SRP_RSP_FLAG_DIUNDER)) |
666 | scmnd->resid = be32_to_cpu(rsp->data_in_res_cnt); | 664 | scmnd->resid = be32_to_cpu(rsp->data_in_res_cnt); |
667 | 665 | ||
668 | srp_unmap_data(scmnd, target, req); | ||
669 | |||
670 | if (!req->tsk_mgmt) { | 666 | if (!req->tsk_mgmt) { |
671 | req->scmnd = NULL; | ||
672 | scmnd->host_scribble = (void *) -1L; | 667 | scmnd->host_scribble = (void *) -1L; |
673 | scmnd->scsi_done(scmnd); | 668 | scmnd->scsi_done(scmnd); |
674 | 669 | ||
675 | srp_remove_req(target, req, rsp->tag & ~SRP_TAG_TSK_MGMT); | 670 | srp_remove_req(target, req); |
676 | } else | 671 | } else |
677 | req->cmd_done = 1; | 672 | req->cmd_done = 1; |
678 | } | 673 | } |
@@ -859,7 +854,6 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd, | |||
859 | struct srp_request *req; | 854 | struct srp_request *req; |
860 | struct srp_iu *iu; | 855 | struct srp_iu *iu; |
861 | struct srp_cmd *cmd; | 856 | struct srp_cmd *cmd; |
862 | long req_index; | ||
863 | int len; | 857 | int len; |
864 | 858 | ||
865 | if (target->state == SRP_TARGET_CONNECTING) | 859 | if (target->state == SRP_TARGET_CONNECTING) |
@@ -879,22 +873,20 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd, | |||
879 | dma_sync_single_for_cpu(target->srp_host->dev->dma_device, iu->dma, | 873 | dma_sync_single_for_cpu(target->srp_host->dev->dma_device, iu->dma, |
880 | SRP_MAX_IU_LEN, DMA_TO_DEVICE); | 874 | SRP_MAX_IU_LEN, DMA_TO_DEVICE); |
881 | 875 | ||
882 | req_index = target->req_head; | 876 | req = list_entry(target->free_reqs.next, struct srp_request, list); |
883 | 877 | ||
884 | scmnd->scsi_done = done; | 878 | scmnd->scsi_done = done; |
885 | scmnd->result = 0; | 879 | scmnd->result = 0; |
886 | scmnd->host_scribble = (void *) req_index; | 880 | scmnd->host_scribble = (void *) (long) req->index; |
887 | 881 | ||
888 | cmd = iu->buf; | 882 | cmd = iu->buf; |
889 | memset(cmd, 0, sizeof *cmd); | 883 | memset(cmd, 0, sizeof *cmd); |
890 | 884 | ||
891 | cmd->opcode = SRP_CMD; | 885 | cmd->opcode = SRP_CMD; |
892 | cmd->lun = cpu_to_be64((u64) scmnd->device->lun << 48); | 886 | cmd->lun = cpu_to_be64((u64) scmnd->device->lun << 48); |
893 | cmd->tag = req_index; | 887 | cmd->tag = req->index; |
894 | memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len); | 888 | memcpy(cmd->cdb, scmnd->cmnd, scmnd->cmd_len); |
895 | 889 | ||
896 | req = &target->req_ring[req_index]; | ||
897 | |||
898 | req->scmnd = scmnd; | 890 | req->scmnd = scmnd; |
899 | req->cmd = iu; | 891 | req->cmd = iu; |
900 | req->cmd_done = 0; | 892 | req->cmd_done = 0; |
@@ -919,8 +911,7 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd, | |||
919 | goto err_unmap; | 911 | goto err_unmap; |
920 | } | 912 | } |
921 | 913 | ||
922 | target->req_head = req->next; | 914 | list_move_tail(&req->list, &target->req_queue); |
923 | list_add_tail(&req->list, &target->req_queue); | ||
924 | 915 | ||
925 | return 0; | 916 | return 0; |
926 | 917 | ||
@@ -1143,30 +1134,20 @@ static int srp_cm_handler(struct ib_cm_id *cm_id, struct ib_cm_event *event) | |||
1143 | return 0; | 1134 | return 0; |
1144 | } | 1135 | } |
1145 | 1136 | ||
1146 | static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func) | 1137 | static int srp_send_tsk_mgmt(struct srp_target_port *target, |
1138 | struct srp_request *req, u8 func) | ||
1147 | { | 1139 | { |
1148 | struct srp_target_port *target = host_to_target(scmnd->device->host); | ||
1149 | struct srp_request *req; | ||
1150 | struct srp_iu *iu; | 1140 | struct srp_iu *iu; |
1151 | struct srp_tsk_mgmt *tsk_mgmt; | 1141 | struct srp_tsk_mgmt *tsk_mgmt; |
1152 | int req_index; | ||
1153 | int ret = FAILED; | ||
1154 | 1142 | ||
1155 | spin_lock_irq(target->scsi_host->host_lock); | 1143 | spin_lock_irq(target->scsi_host->host_lock); |
1156 | 1144 | ||
1157 | if (target->state == SRP_TARGET_DEAD || | 1145 | if (target->state == SRP_TARGET_DEAD || |
1158 | target->state == SRP_TARGET_REMOVED) { | 1146 | target->state == SRP_TARGET_REMOVED) { |
1159 | scmnd->result = DID_BAD_TARGET << 16; | 1147 | req->scmnd->result = DID_BAD_TARGET << 16; |
1160 | goto out; | 1148 | goto out; |
1161 | } | 1149 | } |
1162 | 1150 | ||
1163 | if (scmnd->host_scribble == (void *) -1L) | ||
1164 | goto out; | ||
1165 | |||
1166 | req_index = (long) scmnd->host_scribble; | ||
1167 | printk(KERN_ERR "Abort for req_index %d\n", req_index); | ||
1168 | |||
1169 | req = &target->req_ring[req_index]; | ||
1170 | init_completion(&req->done); | 1151 | init_completion(&req->done); |
1171 | 1152 | ||
1172 | iu = __srp_get_tx_iu(target); | 1153 | iu = __srp_get_tx_iu(target); |
@@ -1177,10 +1158,10 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func) | |||
1177 | memset(tsk_mgmt, 0, sizeof *tsk_mgmt); | 1158 | memset(tsk_mgmt, 0, sizeof *tsk_mgmt); |
1178 | 1159 | ||
1179 | tsk_mgmt->opcode = SRP_TSK_MGMT; | 1160 | tsk_mgmt->opcode = SRP_TSK_MGMT; |
1180 | tsk_mgmt->lun = cpu_to_be64((u64) scmnd->device->lun << 48); | 1161 | tsk_mgmt->lun = cpu_to_be64((u64) req->scmnd->device->lun << 48); |
1181 | tsk_mgmt->tag = req_index | SRP_TAG_TSK_MGMT; | 1162 | tsk_mgmt->tag = req->index | SRP_TAG_TSK_MGMT; |
1182 | tsk_mgmt->tsk_mgmt_func = func; | 1163 | tsk_mgmt->tsk_mgmt_func = func; |
1183 | tsk_mgmt->task_tag = req_index; | 1164 | tsk_mgmt->task_tag = req->index; |
1184 | 1165 | ||
1185 | if (__srp_post_send(target, iu, sizeof *tsk_mgmt)) | 1166 | if (__srp_post_send(target, iu, sizeof *tsk_mgmt)) |
1186 | goto out; | 1167 | goto out; |
@@ -1188,37 +1169,85 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func) | |||
1188 | req->tsk_mgmt = iu; | 1169 | req->tsk_mgmt = iu; |
1189 | 1170 | ||
1190 | spin_unlock_irq(target->scsi_host->host_lock); | 1171 | spin_unlock_irq(target->scsi_host->host_lock); |
1172 | |||
1191 | if (!wait_for_completion_timeout(&req->done, | 1173 | if (!wait_for_completion_timeout(&req->done, |
1192 | msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS))) | 1174 | msecs_to_jiffies(SRP_ABORT_TIMEOUT_MS))) |
1193 | return FAILED; | 1175 | return -1; |
1194 | spin_lock_irq(target->scsi_host->host_lock); | ||
1195 | 1176 | ||
1196 | if (req->cmd_done) { | 1177 | return 0; |
1197 | srp_remove_req(target, req, req_index); | ||
1198 | scmnd->scsi_done(scmnd); | ||
1199 | } else if (!req->tsk_status) { | ||
1200 | srp_remove_req(target, req, req_index); | ||
1201 | scmnd->result = DID_ABORT << 16; | ||
1202 | ret = SUCCESS; | ||
1203 | } | ||
1204 | 1178 | ||
1205 | out: | 1179 | out: |
1206 | spin_unlock_irq(target->scsi_host->host_lock); | 1180 | spin_unlock_irq(target->scsi_host->host_lock); |
1207 | return ret; | 1181 | return -1; |
1182 | } | ||
1183 | |||
1184 | static int srp_find_req(struct srp_target_port *target, | ||
1185 | struct scsi_cmnd *scmnd, | ||
1186 | struct srp_request **req) | ||
1187 | { | ||
1188 | if (scmnd->host_scribble == (void *) -1L) | ||
1189 | return -1; | ||
1190 | |||
1191 | *req = &target->req_ring[(long) scmnd->host_scribble]; | ||
1192 | |||
1193 | return 0; | ||
1208 | } | 1194 | } |
1209 | 1195 | ||
1210 | static int srp_abort(struct scsi_cmnd *scmnd) | 1196 | static int srp_abort(struct scsi_cmnd *scmnd) |
1211 | { | 1197 | { |
1198 | struct srp_target_port *target = host_to_target(scmnd->device->host); | ||
1199 | struct srp_request *req; | ||
1200 | int ret = SUCCESS; | ||
1201 | |||
1212 | printk(KERN_ERR "SRP abort called\n"); | 1202 | printk(KERN_ERR "SRP abort called\n"); |
1213 | 1203 | ||
1214 | return srp_send_tsk_mgmt(scmnd, SRP_TSK_ABORT_TASK); | 1204 | if (srp_find_req(target, scmnd, &req)) |
1205 | return FAILED; | ||
1206 | if (srp_send_tsk_mgmt(target, req, SRP_TSK_ABORT_TASK)) | ||
1207 | return FAILED; | ||
1208 | |||
1209 | spin_lock_irq(target->scsi_host->host_lock); | ||
1210 | |||
1211 | if (req->cmd_done) { | ||
1212 | srp_remove_req(target, req); | ||
1213 | scmnd->scsi_done(scmnd); | ||
1214 | } else if (!req->tsk_status) { | ||
1215 | srp_remove_req(target, req); | ||
1216 | scmnd->result = DID_ABORT << 16; | ||
1217 | } else | ||
1218 | ret = FAILED; | ||
1219 | |||
1220 | spin_unlock_irq(target->scsi_host->host_lock); | ||
1221 | |||
1222 | return ret; | ||
1215 | } | 1223 | } |
1216 | 1224 | ||
1217 | static int srp_reset_device(struct scsi_cmnd *scmnd) | 1225 | static int srp_reset_device(struct scsi_cmnd *scmnd) |
1218 | { | 1226 | { |
1227 | struct srp_target_port *target = host_to_target(scmnd->device->host); | ||
1228 | struct srp_request *req, *tmp; | ||
1229 | |||
1219 | printk(KERN_ERR "SRP reset_device called\n"); | 1230 | printk(KERN_ERR "SRP reset_device called\n"); |
1220 | 1231 | ||
1221 | return srp_send_tsk_mgmt(scmnd, SRP_TSK_LUN_RESET); | 1232 | if (srp_find_req(target, scmnd, &req)) |
1233 | return FAILED; | ||
1234 | if (srp_send_tsk_mgmt(target, req, SRP_TSK_LUN_RESET)) | ||
1235 | return FAILED; | ||
1236 | if (req->tsk_status) | ||
1237 | return FAILED; | ||
1238 | |||
1239 | spin_lock_irq(target->scsi_host->host_lock); | ||
1240 | |||
1241 | list_for_each_entry_safe(req, tmp, &target->req_queue, list) | ||
1242 | if (req->scmnd->device == scmnd->device) { | ||
1243 | req->scmnd->result = DID_RESET << 16; | ||
1244 | req->scmnd->scsi_done(req->scmnd); | ||
1245 | srp_remove_req(target, req); | ||
1246 | } | ||
1247 | |||
1248 | spin_unlock_irq(target->scsi_host->host_lock); | ||
1249 | |||
1250 | return SUCCESS; | ||
1222 | } | 1251 | } |
1223 | 1252 | ||
1224 | static int srp_reset_host(struct scsi_cmnd *scmnd) | 1253 | static int srp_reset_host(struct scsi_cmnd *scmnd) |
@@ -1518,10 +1547,12 @@ static ssize_t srp_create_target(struct class_device *class_dev, | |||
1518 | 1547 | ||
1519 | INIT_WORK(&target->work, srp_reconnect_work, target); | 1548 | INIT_WORK(&target->work, srp_reconnect_work, target); |
1520 | 1549 | ||
1521 | for (i = 0; i < SRP_SQ_SIZE - 1; ++i) | 1550 | INIT_LIST_HEAD(&target->free_reqs); |
1522 | target->req_ring[i].next = i + 1; | ||
1523 | target->req_ring[SRP_SQ_SIZE - 1].next = -1; | ||
1524 | INIT_LIST_HEAD(&target->req_queue); | 1551 | INIT_LIST_HEAD(&target->req_queue); |
1552 | for (i = 0; i < SRP_SQ_SIZE; ++i) { | ||
1553 | target->req_ring[i].index = i; | ||
1554 | list_add_tail(&target->req_ring[i].list, &target->free_reqs); | ||
1555 | } | ||
1525 | 1556 | ||
1526 | ret = srp_parse_options(buf, target); | 1557 | ret = srp_parse_options(buf, target); |
1527 | if (ret) | 1558 | if (ret) |
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h index bd7f7c3115de..c5cd43aae860 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.h +++ b/drivers/infiniband/ulp/srp/ib_srp.h | |||
@@ -101,7 +101,7 @@ struct srp_request { | |||
101 | */ | 101 | */ |
102 | struct scatterlist fake_sg; | 102 | struct scatterlist fake_sg; |
103 | struct completion done; | 103 | struct completion done; |
104 | short next; | 104 | short index; |
105 | u8 cmd_done; | 105 | u8 cmd_done; |
106 | u8 tsk_status; | 106 | u8 tsk_status; |
107 | }; | 107 | }; |
@@ -133,7 +133,7 @@ struct srp_target_port { | |||
133 | unsigned tx_tail; | 133 | unsigned tx_tail; |
134 | struct srp_iu *tx_ring[SRP_SQ_SIZE + 1]; | 134 | struct srp_iu *tx_ring[SRP_SQ_SIZE + 1]; |
135 | 135 | ||
136 | int req_head; | 136 | struct list_head free_reqs; |
137 | struct list_head req_queue; | 137 | struct list_head req_queue; |
138 | struct srp_request req_ring[SRP_SQ_SIZE]; | 138 | struct srp_request req_ring[SRP_SQ_SIZE]; |
139 | 139 | ||
diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c index 9b493f0becc4..173c899a1fb4 100644 --- a/drivers/isdn/capi/capi.c +++ b/drivers/isdn/capi/capi.c | |||
@@ -1499,7 +1499,6 @@ static int __init capi_init(void) | |||
1499 | printk(KERN_ERR "capi20: unable to get major %d\n", capi_major); | 1499 | printk(KERN_ERR "capi20: unable to get major %d\n", capi_major); |
1500 | return major_ret; | 1500 | return major_ret; |
1501 | } | 1501 | } |
1502 | capi_major = major_ret; | ||
1503 | capi_class = class_create(THIS_MODULE, "capi"); | 1502 | capi_class = class_create(THIS_MODULE, "capi"); |
1504 | if (IS_ERR(capi_class)) { | 1503 | if (IS_ERR(capi_class)) { |
1505 | unregister_chrdev(capi_major, "capi20"); | 1504 | unregister_chrdev(capi_major, "capi20"); |
diff --git a/drivers/isdn/gigaset/usb-gigaset.c b/drivers/isdn/gigaset/usb-gigaset.c index bfb73fd5077e..d86ab68114b0 100644 --- a/drivers/isdn/gigaset/usb-gigaset.c +++ b/drivers/isdn/gigaset/usb-gigaset.c | |||
@@ -710,8 +710,8 @@ static int gigaset_probe(struct usb_interface *interface, | |||
710 | retval = -ENODEV; //FIXME | 710 | retval = -ENODEV; //FIXME |
711 | 711 | ||
712 | /* See if the device offered us matches what we can accept */ | 712 | /* See if the device offered us matches what we can accept */ |
713 | if ((le16_to_cpu(udev->descriptor.idVendor != USB_M105_VENDOR_ID)) || | 713 | if ((le16_to_cpu(udev->descriptor.idVendor) != USB_M105_VENDOR_ID) || |
714 | (le16_to_cpu(udev->descriptor.idProduct != USB_M105_PRODUCT_ID))) | 714 | (le16_to_cpu(udev->descriptor.idProduct) != USB_M105_PRODUCT_ID)) |
715 | return -ENODEV; | 715 | return -ENODEV; |
716 | 716 | ||
717 | /* this starts to become ascii art... */ | 717 | /* this starts to become ascii art... */ |
diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 3585fb1f3344..2ac90242d263 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c | |||
@@ -2880,7 +2880,7 @@ isdn_tty_cmd_ATand(char **p, modem_info * info) | |||
2880 | p[0]++; | 2880 | p[0]++; |
2881 | i = 0; | 2881 | i = 0; |
2882 | while (*p[0] && (strchr("0123456789,-*[]?;", *p[0])) && | 2882 | while (*p[0] && (strchr("0123456789,-*[]?;", *p[0])) && |
2883 | (i < ISDN_LMSNLEN)) | 2883 | (i < ISDN_LMSNLEN - 1)) |
2884 | m->lmsn[i++] = *p[0]++; | 2884 | m->lmsn[i++] = *p[0]++; |
2885 | m->lmsn[i] = '\0'; | 2885 | m->lmsn[i] = '\0'; |
2886 | break; | 2886 | break; |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 3f5b64794542..626506234b76 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -4,8 +4,11 @@ menu "LED devices" | |||
4 | config NEW_LEDS | 4 | config NEW_LEDS |
5 | bool "LED Support" | 5 | bool "LED Support" |
6 | help | 6 | help |
7 | Say Y to enable Linux LED support. This is not related to standard | 7 | Say Y to enable Linux LED support. This allows control of supported |
8 | keyboard LEDs which are controlled via the input system. | 8 | LEDs from both userspace and optionally, by kernel events (triggers). |
9 | |||
10 | This is not related to standard keyboard LEDs which are controlled | ||
11 | via the input system. | ||
9 | 12 | ||
10 | config LEDS_CLASS | 13 | config LEDS_CLASS |
11 | tristate "LED Class Support" | 14 | tristate "LED Class Support" |
diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c index b0b5d05fadd6..c75d0ef1609c 100644 --- a/drivers/leds/led-class.c +++ b/drivers/leds/led-class.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/sysdev.h> | 19 | #include <linux/sysdev.h> |
20 | #include <linux/timer.h> | 20 | #include <linux/timer.h> |
21 | #include <linux/err.h> | 21 | #include <linux/err.h> |
22 | #include <linux/ctype.h> | ||
22 | #include <linux/leds.h> | 23 | #include <linux/leds.h> |
23 | #include "leds.h" | 24 | #include "leds.h" |
24 | 25 | ||
@@ -43,9 +44,13 @@ static ssize_t led_brightness_store(struct class_device *dev, | |||
43 | ssize_t ret = -EINVAL; | 44 | ssize_t ret = -EINVAL; |
44 | char *after; | 45 | char *after; |
45 | unsigned long state = simple_strtoul(buf, &after, 10); | 46 | unsigned long state = simple_strtoul(buf, &after, 10); |
47 | size_t count = after - buf; | ||
46 | 48 | ||
47 | if (after - buf > 0) { | 49 | if (*after && isspace(*after)) |
48 | ret = after - buf; | 50 | count++; |
51 | |||
52 | if (count == size) { | ||
53 | ret = count; | ||
49 | led_set_brightness(led_cdev, state); | 54 | led_set_brightness(led_cdev, state); |
50 | } | 55 | } |
51 | 56 | ||
diff --git a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c index f484b5d6dbf8..fbf141ef46ec 100644 --- a/drivers/leds/ledtrig-timer.c +++ b/drivers/leds/ledtrig-timer.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/device.h> | 20 | #include <linux/device.h> |
21 | #include <linux/sysdev.h> | 21 | #include <linux/sysdev.h> |
22 | #include <linux/timer.h> | 22 | #include <linux/timer.h> |
23 | #include <linux/ctype.h> | ||
23 | #include <linux/leds.h> | 24 | #include <linux/leds.h> |
24 | #include "leds.h" | 25 | #include "leds.h" |
25 | 26 | ||
@@ -69,11 +70,15 @@ static ssize_t led_delay_on_store(struct class_device *dev, const char *buf, | |||
69 | int ret = -EINVAL; | 70 | int ret = -EINVAL; |
70 | char *after; | 71 | char *after; |
71 | unsigned long state = simple_strtoul(buf, &after, 10); | 72 | unsigned long state = simple_strtoul(buf, &after, 10); |
73 | size_t count = after - buf; | ||
72 | 74 | ||
73 | if (after - buf > 0) { | 75 | if (*after && isspace(*after)) |
76 | count++; | ||
77 | |||
78 | if (count == size) { | ||
74 | timer_data->delay_on = state; | 79 | timer_data->delay_on = state; |
75 | mod_timer(&timer_data->timer, jiffies + 1); | 80 | mod_timer(&timer_data->timer, jiffies + 1); |
76 | ret = after - buf; | 81 | ret = count; |
77 | } | 82 | } |
78 | 83 | ||
79 | return ret; | 84 | return ret; |
@@ -97,11 +102,15 @@ static ssize_t led_delay_off_store(struct class_device *dev, const char *buf, | |||
97 | int ret = -EINVAL; | 102 | int ret = -EINVAL; |
98 | char *after; | 103 | char *after; |
99 | unsigned long state = simple_strtoul(buf, &after, 10); | 104 | unsigned long state = simple_strtoul(buf, &after, 10); |
105 | size_t count = after - buf; | ||
106 | |||
107 | if (*after && isspace(*after)) | ||
108 | count++; | ||
100 | 109 | ||
101 | if (after - buf > 0) { | 110 | if (count == size) { |
102 | timer_data->delay_off = state; | 111 | timer_data->delay_off = state; |
103 | mod_timer(&timer_data->timer, jiffies + 1); | 112 | mod_timer(&timer_data->timer, jiffies + 1); |
104 | ret = after - buf; | 113 | ret = count; |
105 | } | 114 | } |
106 | 115 | ||
107 | return ret; | 116 | return ret; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index d7316b829a62..3ca3cfb03a7e 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2252,7 +2252,7 @@ action_store(mddev_t *mddev, const char *page, size_t len) | |||
2252 | } else { | 2252 | } else { |
2253 | if (cmd_match(page, "check")) | 2253 | if (cmd_match(page, "check")) |
2254 | set_bit(MD_RECOVERY_CHECK, &mddev->recovery); | 2254 | set_bit(MD_RECOVERY_CHECK, &mddev->recovery); |
2255 | else if (cmd_match(page, "repair")) | 2255 | else if (!cmd_match(page, "repair")) |
2256 | return -EINVAL; | 2256 | return -EINVAL; |
2257 | set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); | 2257 | set_bit(MD_RECOVERY_REQUESTED, &mddev->recovery); |
2258 | set_bit(MD_RECOVERY_SYNC, &mddev->recovery); | 2258 | set_bit(MD_RECOVERY_SYNC, &mddev->recovery); |
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 678f4dbbea1d..cb8c6317e4e5 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c | |||
@@ -331,13 +331,14 @@ static int raid0_run (mddev_t *mddev) | |||
331 | goto out_free_conf; | 331 | goto out_free_conf; |
332 | size = conf->strip_zone[cur].size; | 332 | size = conf->strip_zone[cur].size; |
333 | 333 | ||
334 | for (i=0; i< nb_zone; i++) { | 334 | conf->hash_table[0] = conf->strip_zone + cur; |
335 | conf->hash_table[i] = conf->strip_zone + cur; | 335 | for (i=1; i< nb_zone; i++) { |
336 | while (size <= conf->hash_spacing) { | 336 | while (size <= conf->hash_spacing) { |
337 | cur++; | 337 | cur++; |
338 | size += conf->strip_zone[cur].size; | 338 | size += conf->strip_zone[cur].size; |
339 | } | 339 | } |
340 | size -= conf->hash_spacing; | 340 | size -= conf->hash_spacing; |
341 | conf->hash_table[i] = conf->strip_zone + cur; | ||
341 | } | 342 | } |
342 | if (conf->preshift) { | 343 | if (conf->preshift) { |
343 | conf->hash_spacing >>= conf->preshift; | 344 | conf->hash_spacing >>= conf->preshift; |
diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index fffc711c260c..344d83aae3ec 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig | |||
@@ -8,22 +8,54 @@ config VIDEO_DEV | |||
8 | tristate "Video For Linux" | 8 | tristate "Video For Linux" |
9 | ---help--- | 9 | ---help--- |
10 | Support for audio/video capture and overlay devices and FM radio | 10 | Support for audio/video capture and overlay devices and FM radio |
11 | cards. The exact capabilities of each device vary. User tools for | 11 | cards. The exact capabilities of each device vary. |
12 | this are available from | ||
13 | <ftp://ftp.uk.linux.org/pub/linux/video4linux/>. | ||
14 | 12 | ||
15 | This kernel includes support for the new Video for Linux Two API, | 13 | This kernel includes support for the new Video for Linux Two API, |
16 | (V4L2) as well as the original system. Drivers and applications | 14 | (V4L2) as well as the original system. Drivers and applications |
17 | need to be rewritten to use V4L2, but drivers for popular cards | 15 | need to be rewritten to use V4L2, but drivers for popular cards |
18 | and applications for most video capture functions already exist. | 16 | and applications for most video capture functions already exist. |
19 | 17 | ||
20 | Documentation for the original API is included in the file | 18 | Additional info and docs are available on the web at |
21 | <file:Documentation/video4linux/API.html>. Documentation for V4L2 is | 19 | <http://linuxtv.org> |
22 | available on the web at <http://bytesex.org/v4l/>. | 20 | |
21 | Documentation for V4L2 is also available on the web at | ||
22 | <http://bytesex.org/v4l/>. | ||
23 | 23 | ||
24 | To compile this driver as a module, choose M here: the | 24 | To compile this driver as a module, choose M here: the |
25 | module will be called videodev. | 25 | module will be called videodev. |
26 | 26 | ||
27 | config VIDEO_V4L1 | ||
28 | boolean "Enable Video For Linux API 1 (DEPRECATED)" | ||
29 | depends on VIDEO_DEV | ||
30 | select VIDEO_V4L1_COMPAT | ||
31 | default y | ||
32 | ---help--- | ||
33 | Enables a compatibility API used by most V4L2 devices to allow | ||
34 | its usage with legacy applications that supports only V4L1 api. | ||
35 | |||
36 | If you are unsure as to whether this is required, answer Y. | ||
37 | |||
38 | config VIDEO_V4L1_COMPAT | ||
39 | boolean "Enable Video For Linux API 1 compatible Layer" | ||
40 | depends on VIDEO_DEV | ||
41 | default y | ||
42 | ---help--- | ||
43 | This api were developed to be used at Kernel 2.2 and 2.4, but | ||
44 | lacks support for several video standards. There are several | ||
45 | drivers at kernel that still depends on it. | ||
46 | |||
47 | Documentation for the original API is included in the file | ||
48 | <Documentation/video4linux/API.html>. | ||
49 | |||
50 | User tools for this are available from | ||
51 | <ftp://ftp.uk.linux.org/pub/linux/video4linux/>. | ||
52 | |||
53 | If you are unsure as to whether this is required, answer Y. | ||
54 | |||
55 | config VIDEO_V4L2 | ||
56 | tristate | ||
57 | default y | ||
58 | |||
27 | source "drivers/media/video/Kconfig" | 59 | source "drivers/media/video/Kconfig" |
28 | 60 | ||
29 | source "drivers/media/radio/Kconfig" | 61 | source "drivers/media/radio/Kconfig" |
@@ -65,4 +97,3 @@ config USB_DABUSB | |||
65 | module will be called dabusb. | 97 | module will be called dabusb. |
66 | 98 | ||
67 | endmenu | 99 | endmenu |
68 | |||
diff --git a/drivers/media/common/Kconfig b/drivers/media/common/Kconfig index 6a901a0268e1..9c45b983e0de 100644 --- a/drivers/media/common/Kconfig +++ b/drivers/media/common/Kconfig | |||
@@ -4,6 +4,7 @@ config VIDEO_SAA7146 | |||
4 | 4 | ||
5 | config VIDEO_SAA7146_VV | 5 | config VIDEO_SAA7146_VV |
6 | tristate | 6 | tristate |
7 | select VIDEO_V4L2 | ||
7 | select VIDEO_BUF | 8 | select VIDEO_BUF |
8 | select VIDEO_VIDEOBUF | 9 | select VIDEO_VIDEOBUF |
9 | select VIDEO_SAA7146 | 10 | select VIDEO_SAA7146 |
diff --git a/drivers/media/dvb/Kconfig b/drivers/media/dvb/Kconfig index 3f0ec6be03ae..a97c8f5e9a5d 100644 --- a/drivers/media/dvb/Kconfig +++ b/drivers/media/dvb/Kconfig | |||
@@ -22,26 +22,26 @@ config DVB | |||
22 | source "drivers/media/dvb/dvb-core/Kconfig" | 22 | source "drivers/media/dvb/dvb-core/Kconfig" |
23 | 23 | ||
24 | comment "Supported SAA7146 based PCI Adapters" | 24 | comment "Supported SAA7146 based PCI Adapters" |
25 | depends on DVB_CORE && PCI | 25 | depends on DVB_CORE && PCI && I2C |
26 | source "drivers/media/dvb/ttpci/Kconfig" | 26 | source "drivers/media/dvb/ttpci/Kconfig" |
27 | 27 | ||
28 | comment "Supported USB Adapters" | 28 | comment "Supported USB Adapters" |
29 | depends on DVB_CORE && USB | 29 | depends on DVB_CORE && USB && I2C |
30 | source "drivers/media/dvb/dvb-usb/Kconfig" | 30 | source "drivers/media/dvb/dvb-usb/Kconfig" |
31 | source "drivers/media/dvb/ttusb-budget/Kconfig" | 31 | source "drivers/media/dvb/ttusb-budget/Kconfig" |
32 | source "drivers/media/dvb/ttusb-dec/Kconfig" | 32 | source "drivers/media/dvb/ttusb-dec/Kconfig" |
33 | source "drivers/media/dvb/cinergyT2/Kconfig" | 33 | source "drivers/media/dvb/cinergyT2/Kconfig" |
34 | 34 | ||
35 | comment "Supported FlexCopII (B2C2) Adapters" | 35 | comment "Supported FlexCopII (B2C2) Adapters" |
36 | depends on DVB_CORE && (PCI || USB) | 36 | depends on DVB_CORE && (PCI || USB) && I2C |
37 | source "drivers/media/dvb/b2c2/Kconfig" | 37 | source "drivers/media/dvb/b2c2/Kconfig" |
38 | 38 | ||
39 | comment "Supported BT878 Adapters" | 39 | comment "Supported BT878 Adapters" |
40 | depends on DVB_CORE && PCI | 40 | depends on DVB_CORE && PCI && I2C |
41 | source "drivers/media/dvb/bt8xx/Kconfig" | 41 | source "drivers/media/dvb/bt8xx/Kconfig" |
42 | 42 | ||
43 | comment "Supported Pluto2 Adapters" | 43 | comment "Supported Pluto2 Adapters" |
44 | depends on DVB_CORE && PCI | 44 | depends on DVB_CORE && PCI && I2C |
45 | source "drivers/media/dvb/pluto2/Kconfig" | 45 | source "drivers/media/dvb/pluto2/Kconfig" |
46 | 46 | ||
47 | comment "Supported DVB Frontends" | 47 | comment "Supported DVB Frontends" |
diff --git a/drivers/media/dvb/b2c2/Kconfig b/drivers/media/dvb/b2c2/Kconfig index 2963605c0ecc..d7f1fd5b7b02 100644 --- a/drivers/media/dvb/b2c2/Kconfig +++ b/drivers/media/dvb/b2c2/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_B2C2_FLEXCOP | 1 | config DVB_B2C2_FLEXCOP |
2 | tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" | 2 | tristate "Technisat/B2C2 FlexCopII(b) and FlexCopIII adapters" |
3 | depends on DVB_CORE | 3 | depends on DVB_CORE && I2C |
4 | select DVB_STV0299 | 4 | select DVB_STV0299 |
5 | select DVB_MT352 | 5 | select DVB_MT352 |
6 | select DVB_MT312 | 6 | select DVB_MT312 |
@@ -16,7 +16,7 @@ config DVB_B2C2_FLEXCOP | |||
16 | 16 | ||
17 | config DVB_B2C2_FLEXCOP_PCI | 17 | config DVB_B2C2_FLEXCOP_PCI |
18 | tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI" | 18 | tristate "Technisat/B2C2 Air/Sky/Cable2PC PCI" |
19 | depends on DVB_B2C2_FLEXCOP && PCI | 19 | depends on DVB_B2C2_FLEXCOP && PCI && I2C |
20 | help | 20 | help |
21 | Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2. | 21 | Support for the Air/Sky/CableStar2 PCI card (DVB/ATSC) by Technisat/B2C2. |
22 | 22 | ||
@@ -24,7 +24,7 @@ config DVB_B2C2_FLEXCOP_PCI | |||
24 | 24 | ||
25 | config DVB_B2C2_FLEXCOP_USB | 25 | config DVB_B2C2_FLEXCOP_USB |
26 | tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" | 26 | tristate "Technisat/B2C2 Air/Sky/Cable2PC USB" |
27 | depends on DVB_B2C2_FLEXCOP && USB | 27 | depends on DVB_B2C2_FLEXCOP && USB && I2C |
28 | help | 28 | help |
29 | Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, | 29 | Support for the Air/Sky/Cable2PC USB1.1 box (DVB/ATSC) by Technisat/B2C2, |
30 | 30 | ||
diff --git a/drivers/media/dvb/bt8xx/Kconfig b/drivers/media/dvb/bt8xx/Kconfig index 376ca48f1d1d..f394002118f8 100644 --- a/drivers/media/dvb/bt8xx/Kconfig +++ b/drivers/media/dvb/bt8xx/Kconfig | |||
@@ -1,12 +1,13 @@ | |||
1 | config DVB_BT8XX | 1 | config DVB_BT8XX |
2 | tristate "BT8xx based PCI cards" | 2 | tristate "BT8xx based PCI cards" |
3 | depends on DVB_CORE && PCI && VIDEO_BT848 | 3 | depends on DVB_CORE && PCI && I2C && VIDEO_BT848 |
4 | select DVB_MT352 | 4 | select DVB_MT352 |
5 | select DVB_SP887X | 5 | select DVB_SP887X |
6 | select DVB_NXT6000 | 6 | select DVB_NXT6000 |
7 | select DVB_CX24110 | 7 | select DVB_CX24110 |
8 | select DVB_OR51211 | 8 | select DVB_OR51211 |
9 | select DVB_LGDT330X | 9 | select DVB_LGDT330X |
10 | select DVB_ZL10353 | ||
10 | select FW_LOADER | 11 | select FW_LOADER |
11 | help | 12 | help |
12 | Support for PCI cards based on the Bt8xx PCI bridge. Examples are | 13 | Support for PCI cards based on the Bt8xx PCI bridge. Examples are |
diff --git a/drivers/media/dvb/bt8xx/dvb-bt8xx.c b/drivers/media/dvb/bt8xx/dvb-bt8xx.c index baa8227ef87c..ccc7b2eb4a2d 100644 --- a/drivers/media/dvb/bt8xx/dvb-bt8xx.c +++ b/drivers/media/dvb/bt8xx/dvb-bt8xx.c | |||
@@ -115,7 +115,7 @@ static int is_pci_slot_eq(struct pci_dev* adev, struct pci_dev* bdev) | |||
115 | return 0; | 115 | return 0; |
116 | } | 116 | } |
117 | 117 | ||
118 | static struct bt878 __init *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) | 118 | static struct bt878 __devinit *dvb_bt8xx_878_match(unsigned int bttv_nr, struct pci_dev* bttv_pci_dev) |
119 | { | 119 | { |
120 | unsigned int card_nr; | 120 | unsigned int card_nr; |
121 | 121 | ||
@@ -709,7 +709,7 @@ static void frontend_init(struct dvb_bt8xx_card *card, u32 type) | |||
709 | } | 709 | } |
710 | } | 710 | } |
711 | 711 | ||
712 | static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | 712 | static int __devinit dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) |
713 | { | 713 | { |
714 | int result; | 714 | int result; |
715 | 715 | ||
@@ -794,7 +794,7 @@ static int __init dvb_bt8xx_load_card(struct dvb_bt8xx_card *card, u32 type) | |||
794 | return 0; | 794 | return 0; |
795 | } | 795 | } |
796 | 796 | ||
797 | static int dvb_bt8xx_probe(struct bttv_sub_device *sub) | 797 | static int __devinit dvb_bt8xx_probe(struct bttv_sub_device *sub) |
798 | { | 798 | { |
799 | struct dvb_bt8xx_card *card; | 799 | struct dvb_bt8xx_card *card; |
800 | struct pci_dev* bttv_pci_dev; | 800 | struct pci_dev* bttv_pci_dev; |
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c index 71b575dc22bd..9325d039ea65 100644 --- a/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/drivers/media/dvb/cinergyT2/cinergyT2.c | |||
@@ -902,7 +902,10 @@ static int cinergyt2_probe (struct usb_interface *intf, | |||
902 | return -ENOMEM; | 902 | return -ENOMEM; |
903 | } | 903 | } |
904 | 904 | ||
905 | dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE); | 905 | if ((err = dvb_register_adapter(&cinergyt2->adapter, DRIVER_NAME, THIS_MODULE)) < 0) { |
906 | kfree(cinergyt2); | ||
907 | return err; | ||
908 | } | ||
906 | 909 | ||
907 | cinergyt2->demux.priv = cinergyt2; | 910 | cinergyt2->demux.priv = cinergyt2; |
908 | cinergyt2->demux.filternum = 256; | 911 | cinergyt2->demux.filternum = 256; |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 4f8f257e6795..a051790161b0 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
@@ -106,6 +106,8 @@ struct dvb_frontend_private { | |||
106 | unsigned long tune_mode_flags; | 106 | unsigned long tune_mode_flags; |
107 | unsigned int delay; | 107 | unsigned int delay; |
108 | unsigned int reinitialise; | 108 | unsigned int reinitialise; |
109 | int tone; | ||
110 | int voltage; | ||
109 | 111 | ||
110 | /* swzigzag values */ | 112 | /* swzigzag values */ |
111 | unsigned int state; | 113 | unsigned int state; |
@@ -537,6 +539,12 @@ static int dvb_frontend_thread(void *data) | |||
537 | 539 | ||
538 | if (fepriv->reinitialise) { | 540 | if (fepriv->reinitialise) { |
539 | dvb_frontend_init(fe); | 541 | dvb_frontend_init(fe); |
542 | if (fepriv->tone != -1) { | ||
543 | fe->ops->set_tone(fe, fepriv->tone); | ||
544 | } | ||
545 | if (fepriv->voltage != -1) { | ||
546 | fe->ops->set_voltage(fe, fepriv->voltage); | ||
547 | } | ||
540 | fepriv->reinitialise = 0; | 548 | fepriv->reinitialise = 0; |
541 | } | 549 | } |
542 | 550 | ||
@@ -788,6 +796,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
788 | case FE_SET_TONE: | 796 | case FE_SET_TONE: |
789 | if (fe->ops->set_tone) { | 797 | if (fe->ops->set_tone) { |
790 | err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); | 798 | err = fe->ops->set_tone(fe, (fe_sec_tone_mode_t) parg); |
799 | fepriv->tone = (fe_sec_tone_mode_t) parg; | ||
791 | fepriv->state = FESTATE_DISEQC; | 800 | fepriv->state = FESTATE_DISEQC; |
792 | fepriv->status = 0; | 801 | fepriv->status = 0; |
793 | } | 802 | } |
@@ -796,6 +805,7 @@ static int dvb_frontend_ioctl(struct inode *inode, struct file *file, | |||
796 | case FE_SET_VOLTAGE: | 805 | case FE_SET_VOLTAGE: |
797 | if (fe->ops->set_voltage) { | 806 | if (fe->ops->set_voltage) { |
798 | err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); | 807 | err = fe->ops->set_voltage(fe, (fe_sec_voltage_t) parg); |
808 | fepriv->voltage = (fe_sec_voltage_t) parg; | ||
799 | fepriv->state = FESTATE_DISEQC; | 809 | fepriv->state = FESTATE_DISEQC; |
800 | fepriv->status = 0; | 810 | fepriv->status = 0; |
801 | } | 811 | } |
@@ -995,6 +1005,8 @@ static int dvb_frontend_open(struct inode *inode, struct file *file) | |||
995 | 1005 | ||
996 | /* normal tune mode when opened R/W */ | 1006 | /* normal tune mode when opened R/W */ |
997 | fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; | 1007 | fepriv->tune_mode_flags &= ~FE_TUNE_MODE_ONESHOT; |
1008 | fepriv->tone = -1; | ||
1009 | fepriv->voltage = -1; | ||
998 | } | 1010 | } |
999 | 1011 | ||
1000 | return ret; | 1012 | return ret; |
diff --git a/drivers/media/dvb/dvb-core/dvbdev.c b/drivers/media/dvb/dvb-core/dvbdev.c index 96fe0ecae250..3852430d0260 100644 --- a/drivers/media/dvb/dvb-core/dvbdev.c +++ b/drivers/media/dvb/dvb-core/dvbdev.c | |||
@@ -219,8 +219,6 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
219 | return -ENOMEM; | 219 | return -ENOMEM; |
220 | } | 220 | } |
221 | 221 | ||
222 | mutex_unlock(&dvbdev_register_lock); | ||
223 | |||
224 | memcpy(dvbdev, template, sizeof(struct dvb_device)); | 222 | memcpy(dvbdev, template, sizeof(struct dvb_device)); |
225 | dvbdev->type = type; | 223 | dvbdev->type = type; |
226 | dvbdev->id = id; | 224 | dvbdev->id = id; |
@@ -231,6 +229,8 @@ int dvb_register_device(struct dvb_adapter *adap, struct dvb_device **pdvbdev, | |||
231 | 229 | ||
232 | list_add_tail (&dvbdev->list_head, &adap->device_list); | 230 | list_add_tail (&dvbdev->list_head, &adap->device_list); |
233 | 231 | ||
232 | mutex_unlock(&dvbdev_register_lock); | ||
233 | |||
234 | devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), | 234 | devfs_mk_cdev(MKDEV(DVB_MAJOR, nums2minor(adap->num, type, id)), |
235 | S_IFCHR | S_IRUSR | S_IWUSR, | 235 | S_IFCHR | S_IRUSR | S_IWUSR, |
236 | "dvb/adapter%d/%s%d", adap->num, dnames[type], id); | 236 | "dvb/adapter%d/%s%d", adap->num, dnames[type], id); |
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index d3df12039b06..e388fb1567d6 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_USB | 1 | config DVB_USB |
2 | tristate "Support for various USB DVB devices" | 2 | tristate "Support for various USB DVB devices" |
3 | depends on DVB_CORE && USB | 3 | depends on DVB_CORE && USB && I2C |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | help | 5 | help |
6 | By enabling this you will be able to choose the various supported | 6 | By enabling this you will be able to choose the various supported |
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index 7edd6362b9cc..1f0d3e995c8d 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -150,6 +150,15 @@ static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff) | |||
150 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); | 150 | return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0); |
151 | } | 151 | } |
152 | 152 | ||
153 | static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff) | ||
154 | { | ||
155 | u8 b = 0; | ||
156 | if (onoff) | ||
157 | return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0); | ||
158 | else | ||
159 | return 0; | ||
160 | } | ||
161 | |||
153 | static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) | 162 | static int cxusb_streaming_ctrl(struct dvb_usb_device *d, int onoff) |
154 | { | 163 | { |
155 | u8 buf[2] = { 0x03, 0x00 }; | 164 | u8 buf[2] = { 0x03, 0x00 }; |
@@ -544,7 +553,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { | |||
544 | .size_of_priv = sizeof(struct cxusb_state), | 553 | .size_of_priv = sizeof(struct cxusb_state), |
545 | 554 | ||
546 | .streaming_ctrl = cxusb_streaming_ctrl, | 555 | .streaming_ctrl = cxusb_streaming_ctrl, |
547 | .power_ctrl = cxusb_power_ctrl, | 556 | .power_ctrl = cxusb_bluebird_power_ctrl, |
548 | .frontend_attach = cxusb_lgdt3303_frontend_attach, | 557 | .frontend_attach = cxusb_lgdt3303_frontend_attach, |
549 | .tuner_attach = cxusb_lgh064f_tuner_attach, | 558 | .tuner_attach = cxusb_lgh064f_tuner_attach, |
550 | 559 | ||
@@ -589,7 +598,7 @@ static struct dvb_usb_properties cxusb_bluebird_dee1601_properties = { | |||
589 | .size_of_priv = sizeof(struct cxusb_state), | 598 | .size_of_priv = sizeof(struct cxusb_state), |
590 | 599 | ||
591 | .streaming_ctrl = cxusb_streaming_ctrl, | 600 | .streaming_ctrl = cxusb_streaming_ctrl, |
592 | .power_ctrl = cxusb_power_ctrl, | 601 | .power_ctrl = cxusb_bluebird_power_ctrl, |
593 | .frontend_attach = cxusb_dee1601_frontend_attach, | 602 | .frontend_attach = cxusb_dee1601_frontend_attach, |
594 | .tuner_attach = cxusb_dee1601_tuner_attach, | 603 | .tuner_attach = cxusb_dee1601_tuner_attach, |
595 | 604 | ||
@@ -638,7 +647,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgz201_properties = { | |||
638 | .size_of_priv = sizeof(struct cxusb_state), | 647 | .size_of_priv = sizeof(struct cxusb_state), |
639 | 648 | ||
640 | .streaming_ctrl = cxusb_streaming_ctrl, | 649 | .streaming_ctrl = cxusb_streaming_ctrl, |
641 | .power_ctrl = cxusb_power_ctrl, | 650 | .power_ctrl = cxusb_bluebird_power_ctrl, |
642 | .frontend_attach = cxusb_mt352_frontend_attach, | 651 | .frontend_attach = cxusb_mt352_frontend_attach, |
643 | .tuner_attach = cxusb_lgz201_tuner_attach, | 652 | .tuner_attach = cxusb_lgz201_tuner_attach, |
644 | 653 | ||
@@ -683,7 +692,7 @@ static struct dvb_usb_properties cxusb_bluebird_dtt7579_properties = { | |||
683 | .size_of_priv = sizeof(struct cxusb_state), | 692 | .size_of_priv = sizeof(struct cxusb_state), |
684 | 693 | ||
685 | .streaming_ctrl = cxusb_streaming_ctrl, | 694 | .streaming_ctrl = cxusb_streaming_ctrl, |
686 | .power_ctrl = cxusb_power_ctrl, | 695 | .power_ctrl = cxusb_bluebird_power_ctrl, |
687 | .frontend_attach = cxusb_mt352_frontend_attach, | 696 | .frontend_attach = cxusb_mt352_frontend_attach, |
688 | .tuner_attach = cxusb_dtt7579_tuner_attach, | 697 | .tuner_attach = cxusb_dtt7579_tuner_attach, |
689 | 698 | ||
diff --git a/drivers/media/dvb/frontends/cx24123.c b/drivers/media/dvb/frontends/cx24123.c index d661c6f9cbe5..691dc840dcc0 100644 --- a/drivers/media/dvb/frontends/cx24123.c +++ b/drivers/media/dvb/frontends/cx24123.c | |||
@@ -29,6 +29,9 @@ | |||
29 | #include "dvb_frontend.h" | 29 | #include "dvb_frontend.h" |
30 | #include "cx24123.h" | 30 | #include "cx24123.h" |
31 | 31 | ||
32 | #define XTAL 10111000 | ||
33 | |||
34 | static int force_band; | ||
32 | static int debug; | 35 | static int debug; |
33 | #define dprintk(args...) \ | 36 | #define dprintk(args...) \ |
34 | do { \ | 37 | do { \ |
@@ -52,6 +55,7 @@ struct cx24123_state | |||
52 | u32 VGAarg; | 55 | u32 VGAarg; |
53 | u32 bandselectarg; | 56 | u32 bandselectarg; |
54 | u32 pllarg; | 57 | u32 pllarg; |
58 | u32 FILTune; | ||
55 | 59 | ||
56 | /* The Demod/Tuner can't easily provide these, we cache them */ | 60 | /* The Demod/Tuner can't easily provide these, we cache them */ |
57 | u32 currentfreq; | 61 | u32 currentfreq; |
@@ -63,43 +67,33 @@ static struct | |||
63 | { | 67 | { |
64 | u32 symbolrate_low; | 68 | u32 symbolrate_low; |
65 | u32 symbolrate_high; | 69 | u32 symbolrate_high; |
66 | u32 VCAslope; | ||
67 | u32 VCAoffset; | ||
68 | u32 VGA1offset; | ||
69 | u32 VGA2offset; | ||
70 | u32 VCAprogdata; | 70 | u32 VCAprogdata; |
71 | u32 VGAprogdata; | 71 | u32 VGAprogdata; |
72 | u32 FILTune; | ||
72 | } cx24123_AGC_vals[] = | 73 | } cx24123_AGC_vals[] = |
73 | { | 74 | { |
74 | { | 75 | { |
75 | .symbolrate_low = 1000000, | 76 | .symbolrate_low = 1000000, |
76 | .symbolrate_high = 4999999, | 77 | .symbolrate_high = 4999999, |
77 | .VCAslope = 0x07, | 78 | /* the specs recommend other values for VGA offsets, |
78 | .VCAoffset = 0x0f, | 79 | but tests show they are wrong */ |
79 | .VGA1offset = 0x1f8, | 80 | .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0, |
80 | .VGA2offset = 0x1f8, | 81 | .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x07, |
81 | .VGAprogdata = (2 << 18) | (0x1f8 << 9) | 0x1f8, | 82 | .FILTune = 0x27f /* 0.41 V */ |
82 | .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x07, | ||
83 | }, | 83 | }, |
84 | { | 84 | { |
85 | .symbolrate_low = 5000000, | 85 | .symbolrate_low = 5000000, |
86 | .symbolrate_high = 14999999, | 86 | .symbolrate_high = 14999999, |
87 | .VCAslope = 0x1f, | 87 | .VGAprogdata = (1 << 19) | (0x180 << 9) | 0x1e0, |
88 | .VCAoffset = 0x1f, | 88 | .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x1f, |
89 | .VGA1offset = 0x1e0, | 89 | .FILTune = 0x317 /* 0.90 V */ |
90 | .VGA2offset = 0x180, | ||
91 | .VGAprogdata = (2 << 18) | (0x180 << 9) | 0x1e0, | ||
92 | .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x1f, | ||
93 | }, | 90 | }, |
94 | { | 91 | { |
95 | .symbolrate_low = 15000000, | 92 | .symbolrate_low = 15000000, |
96 | .symbolrate_high = 45000000, | 93 | .symbolrate_high = 45000000, |
97 | .VCAslope = 0x3f, | 94 | .VGAprogdata = (1 << 19) | (0x100 << 9) | 0x180, |
98 | .VCAoffset = 0x3f, | 95 | .VCAprogdata = (2 << 19) | (0x07 << 9) | 0x3f, |
99 | .VGA1offset = 0x180, | 96 | .FILTune = 0x145 /* 2.70 V */ |
100 | .VGA2offset = 0x100, | ||
101 | .VGAprogdata = (2 << 18) | (0x100 << 9) | 0x180, | ||
102 | .VCAprogdata = (4 << 18) | (0x07 << 9) | 0x3f, | ||
103 | }, | 97 | }, |
104 | }; | 98 | }; |
105 | 99 | ||
@@ -112,91 +106,80 @@ static struct | |||
112 | { | 106 | { |
113 | u32 freq_low; | 107 | u32 freq_low; |
114 | u32 freq_high; | 108 | u32 freq_high; |
115 | u32 bandselect; | ||
116 | u32 VCOdivider; | 109 | u32 VCOdivider; |
117 | u32 VCOnumber; | ||
118 | u32 progdata; | 110 | u32 progdata; |
119 | } cx24123_bandselect_vals[] = | 111 | } cx24123_bandselect_vals[] = |
120 | { | 112 | { |
113 | /* band 1 */ | ||
121 | { | 114 | { |
122 | .freq_low = 950000, | 115 | .freq_low = 950000, |
123 | .freq_high = 1018999, | ||
124 | .bandselect = 0x40, | ||
125 | .VCOdivider = 4, | ||
126 | .VCOnumber = 7, | ||
127 | .progdata = (0 << 18) | (0 << 9) | 0x40, | ||
128 | }, | ||
129 | { | ||
130 | .freq_low = 1019000, | ||
131 | .freq_high = 1074999, | 116 | .freq_high = 1074999, |
132 | .bandselect = 0x80, | ||
133 | .VCOdivider = 4, | 117 | .VCOdivider = 4, |
134 | .VCOnumber = 8, | 118 | .progdata = (0 << 19) | (0 << 9) | 0x40, |
135 | .progdata = (0 << 18) | (0 << 9) | 0x80, | ||
136 | }, | 119 | }, |
120 | |||
121 | /* band 2 */ | ||
137 | { | 122 | { |
138 | .freq_low = 1075000, | 123 | .freq_low = 1075000, |
139 | .freq_high = 1227999, | 124 | .freq_high = 1177999, |
140 | .bandselect = 0x01, | 125 | .VCOdivider = 4, |
141 | .VCOdivider = 2, | 126 | .progdata = (0 << 19) | (0 << 9) | 0x80, |
142 | .VCOnumber = 1, | ||
143 | .progdata = (0 << 18) | (1 << 9) | 0x01, | ||
144 | }, | 127 | }, |
128 | |||
129 | /* band 3 */ | ||
145 | { | 130 | { |
146 | .freq_low = 1228000, | 131 | .freq_low = 1178000, |
147 | .freq_high = 1349999, | 132 | .freq_high = 1295999, |
148 | .bandselect = 0x02, | ||
149 | .VCOdivider = 2, | 133 | .VCOdivider = 2, |
150 | .VCOnumber = 2, | 134 | .progdata = (0 << 19) | (1 << 9) | 0x01, |
151 | .progdata = (0 << 18) | (1 << 9) | 0x02, | ||
152 | }, | 135 | }, |
136 | |||
137 | /* band 4 */ | ||
153 | { | 138 | { |
154 | .freq_low = 1350000, | 139 | .freq_low = 1296000, |
155 | .freq_high = 1481999, | 140 | .freq_high = 1431999, |
156 | .bandselect = 0x04, | ||
157 | .VCOdivider = 2, | 141 | .VCOdivider = 2, |
158 | .VCOnumber = 3, | 142 | .progdata = (0 << 19) | (1 << 9) | 0x02, |
159 | .progdata = (0 << 18) | (1 << 9) | 0x04, | ||
160 | }, | 143 | }, |
144 | |||
145 | /* band 5 */ | ||
161 | { | 146 | { |
162 | .freq_low = 1482000, | 147 | .freq_low = 1432000, |
163 | .freq_high = 1595999, | 148 | .freq_high = 1575999, |
164 | .bandselect = 0x08, | ||
165 | .VCOdivider = 2, | 149 | .VCOdivider = 2, |
166 | .VCOnumber = 4, | 150 | .progdata = (0 << 19) | (1 << 9) | 0x04, |
167 | .progdata = (0 << 18) | (1 << 9) | 0x08, | ||
168 | }, | 151 | }, |
152 | |||
153 | /* band 6 */ | ||
169 | { | 154 | { |
170 | .freq_low = 1596000, | 155 | .freq_low = 1576000, |
171 | .freq_high = 1717999, | 156 | .freq_high = 1717999, |
172 | .bandselect = 0x10, | ||
173 | .VCOdivider = 2, | 157 | .VCOdivider = 2, |
174 | .VCOnumber = 5, | 158 | .progdata = (0 << 19) | (1 << 9) | 0x08, |
175 | .progdata = (0 << 18) | (1 << 9) | 0x10, | ||
176 | }, | 159 | }, |
160 | |||
161 | /* band 7 */ | ||
177 | { | 162 | { |
178 | .freq_low = 1718000, | 163 | .freq_low = 1718000, |
179 | .freq_high = 1855999, | 164 | .freq_high = 1855999, |
180 | .bandselect = 0x20, | ||
181 | .VCOdivider = 2, | 165 | .VCOdivider = 2, |
182 | .VCOnumber = 6, | 166 | .progdata = (0 << 19) | (1 << 9) | 0x10, |
183 | .progdata = (0 << 18) | (1 << 9) | 0x20, | ||
184 | }, | 167 | }, |
168 | |||
169 | /* band 8 */ | ||
185 | { | 170 | { |
186 | .freq_low = 1856000, | 171 | .freq_low = 1856000, |
187 | .freq_high = 2035999, | 172 | .freq_high = 2035999, |
188 | .bandselect = 0x40, | ||
189 | .VCOdivider = 2, | 173 | .VCOdivider = 2, |
190 | .VCOnumber = 7, | 174 | .progdata = (0 << 19) | (1 << 9) | 0x20, |
191 | .progdata = (0 << 18) | (1 << 9) | 0x40, | ||
192 | }, | 175 | }, |
176 | |||
177 | /* band 9 */ | ||
193 | { | 178 | { |
194 | .freq_low = 2036000, | 179 | .freq_low = 2036000, |
195 | .freq_high = 2149999, | 180 | .freq_high = 2150000, |
196 | .bandselect = 0x80, | ||
197 | .VCOdivider = 2, | 181 | .VCOdivider = 2, |
198 | .VCOnumber = 8, | 182 | .progdata = (0 << 19) | (1 << 9) | 0x40, |
199 | .progdata = (0 << 18) | (1 << 9) | 0x80, | ||
200 | }, | 183 | }, |
201 | }; | 184 | }; |
202 | 185 | ||
@@ -207,49 +190,44 @@ static struct { | |||
207 | { | 190 | { |
208 | {0x00, 0x03}, /* Reset system */ | 191 | {0x00, 0x03}, /* Reset system */ |
209 | {0x00, 0x00}, /* Clear reset */ | 192 | {0x00, 0x00}, /* Clear reset */ |
210 | {0x01, 0x3b}, /* Apply sensible defaults, from an i2c sniffer */ | 193 | {0x03, 0x07}, /* QPSK, DVB, Auto Acquisition (default) */ |
211 | {0x03, 0x07}, | 194 | {0x04, 0x10}, /* MPEG */ |
212 | {0x04, 0x10}, | 195 | {0x05, 0x04}, /* MPEG */ |
213 | {0x05, 0x04}, | 196 | {0x06, 0x31}, /* MPEG (default) */ |
214 | {0x06, 0x31}, | 197 | {0x0b, 0x00}, /* Freq search start point (default) */ |
215 | {0x0d, 0x02}, | 198 | {0x0c, 0x00}, /* Demodulator sample gain (default) */ |
216 | {0x0e, 0x03}, | 199 | {0x0d, 0x02}, /* Frequency search range = Fsymbol / 4 (default) */ |
217 | {0x0f, 0xfe}, | 200 | {0x0e, 0x03}, /* Default non-inverted, FEC 3/4 (default) */ |
218 | {0x10, 0x01}, | 201 | {0x0f, 0xfe}, /* FEC search mask (all supported codes) */ |
219 | {0x14, 0x01}, | 202 | {0x10, 0x01}, /* Default search inversion, no repeat (default) */ |
220 | {0x15, 0x98}, | 203 | {0x16, 0x00}, /* Enable reading of frequency */ |
221 | {0x16, 0x00}, | 204 | {0x17, 0x01}, /* Enable EsNO Ready Counter */ |
222 | {0x17, 0x01}, | 205 | {0x1c, 0x80}, /* Enable error counter */ |
223 | {0x1b, 0x05}, | 206 | {0x20, 0x00}, /* Tuner burst clock rate = 500KHz */ |
224 | {0x1c, 0x80}, | 207 | {0x21, 0x15}, /* Tuner burst mode, word length = 0x15 */ |
225 | {0x1d, 0x00}, | 208 | {0x28, 0x00}, /* Enable FILTERV with positive pol., DiSEqC 2.x off */ |
226 | {0x1e, 0x00}, | 209 | {0x29, 0x00}, /* DiSEqC LNB_DC off */ |
227 | {0x20, 0x41}, | 210 | {0x2a, 0xb0}, /* DiSEqC Parameters (default) */ |
228 | {0x21, 0x15}, | 211 | {0x2b, 0x73}, /* DiSEqC Tone Frequency (default) */ |
229 | {0x27, 0x14}, | 212 | {0x2c, 0x00}, /* DiSEqC Message (0x2c - 0x31) */ |
230 | {0x28, 0x46}, | ||
231 | {0x29, 0x00}, | ||
232 | {0x2a, 0xb0}, | ||
233 | {0x2b, 0x73}, | ||
234 | {0x2c, 0x00}, | ||
235 | {0x2d, 0x00}, | 213 | {0x2d, 0x00}, |
236 | {0x2e, 0x00}, | 214 | {0x2e, 0x00}, |
237 | {0x2f, 0x00}, | 215 | {0x2f, 0x00}, |
238 | {0x30, 0x00}, | 216 | {0x30, 0x00}, |
239 | {0x31, 0x00}, | 217 | {0x31, 0x00}, |
240 | {0x32, 0x8c}, | 218 | {0x32, 0x8c}, /* DiSEqC Parameters (default) */ |
241 | {0x33, 0x00}, | 219 | {0x33, 0x00}, /* Interrupts off (0x33 - 0x34) */ |
242 | {0x34, 0x00}, | 220 | {0x34, 0x00}, |
243 | {0x35, 0x03}, | 221 | {0x35, 0x03}, /* DiSEqC Tone Amplitude (default) */ |
244 | {0x36, 0x02}, | 222 | {0x36, 0x02}, /* DiSEqC Parameters (default) */ |
245 | {0x37, 0x3a}, | 223 | {0x37, 0x3a}, /* DiSEqC Parameters (default) */ |
246 | {0x3a, 0x00}, /* Enable AGC accumulator */ | 224 | {0x3a, 0x00}, /* Enable AGC accumulator (for signal strength) */ |
247 | {0x44, 0x00}, | 225 | {0x44, 0x00}, /* Constellation (default) */ |
248 | {0x45, 0x00}, | 226 | {0x45, 0x00}, /* Symbol count (default) */ |
249 | {0x46, 0x05}, | 227 | {0x46, 0x0d}, /* Symbol rate estimator on (default) */ |
250 | {0x56, 0x41}, | 228 | {0x56, 0x41}, /* Various (default) */ |
251 | {0x57, 0xff}, | 229 | {0x57, 0xff}, /* Error Counter Window (default) */ |
252 | {0x67, 0x83}, | 230 | {0x67, 0x83}, /* Non-DCII symbol clock */ |
253 | }; | 231 | }; |
254 | 232 | ||
255 | static int cx24123_writereg(struct cx24123_state* state, int reg, int data) | 233 | static int cx24123_writereg(struct cx24123_state* state, int reg, int data) |
@@ -258,6 +236,10 @@ static int cx24123_writereg(struct cx24123_state* state, int reg, int data) | |||
258 | struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; | 236 | struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0, .buf = buf, .len = 2 }; |
259 | int err; | 237 | int err; |
260 | 238 | ||
239 | if (debug>1) | ||
240 | printk("cx24123: %s: write reg 0x%02x, value 0x%02x\n", | ||
241 | __FUNCTION__,reg, data); | ||
242 | |||
261 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | 243 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { |
262 | printk("%s: writereg error(err == %i, reg == 0x%02x," | 244 | printk("%s: writereg error(err == %i, reg == 0x%02x," |
263 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); | 245 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); |
@@ -274,6 +256,10 @@ static int cx24123_writelnbreg(struct cx24123_state* state, int reg, int data) | |||
274 | struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 }; | 256 | struct i2c_msg msg = { .addr = 0x08, .flags = 0, .buf = buf, .len = 2 }; |
275 | int err; | 257 | int err; |
276 | 258 | ||
259 | if (debug>1) | ||
260 | printk("cx24123: %s: writeln addr=0x08, reg 0x%02x, value 0x%02x\n", | ||
261 | __FUNCTION__,reg, data); | ||
262 | |||
277 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { | 263 | if ((err = i2c_transfer(state->i2c, &msg, 1)) != 1) { |
278 | printk("%s: writelnbreg error (err == %i, reg == 0x%02x," | 264 | printk("%s: writelnbreg error (err == %i, reg == 0x%02x," |
279 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); | 265 | " data == 0x%02x)\n", __FUNCTION__, err, reg, data); |
@@ -303,6 +289,9 @@ static int cx24123_readreg(struct cx24123_state* state, u8 reg) | |||
303 | return ret; | 289 | return ret; |
304 | } | 290 | } |
305 | 291 | ||
292 | if (debug>1) | ||
293 | printk("cx24123: read reg 0x%02x, value 0x%02x\n",reg, ret); | ||
294 | |||
306 | return b1[0]; | 295 | return b1[0]; |
307 | } | 296 | } |
308 | 297 | ||
@@ -313,17 +302,23 @@ static int cx24123_readlnbreg(struct cx24123_state* state, u8 reg) | |||
313 | 302 | ||
314 | static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion) | 303 | static int cx24123_set_inversion(struct cx24123_state* state, fe_spectral_inversion_t inversion) |
315 | { | 304 | { |
305 | u8 nom_reg = cx24123_readreg(state, 0x0e); | ||
306 | u8 auto_reg = cx24123_readreg(state, 0x10); | ||
307 | |||
316 | switch (inversion) { | 308 | switch (inversion) { |
317 | case INVERSION_OFF: | 309 | case INVERSION_OFF: |
318 | cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) & 0x7f); | 310 | dprintk("%s: inversion off\n",__FUNCTION__); |
319 | cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); | 311 | cx24123_writereg(state, 0x0e, nom_reg & ~0x80); |
312 | cx24123_writereg(state, 0x10, auto_reg | 0x80); | ||
320 | break; | 313 | break; |
321 | case INVERSION_ON: | 314 | case INVERSION_ON: |
322 | cx24123_writereg(state, 0x0e, cx24123_readreg(state, 0x0e) | 0x80); | 315 | dprintk("%s: inversion on\n",__FUNCTION__); |
323 | cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) | 0x80); | 316 | cx24123_writereg(state, 0x0e, nom_reg | 0x80); |
317 | cx24123_writereg(state, 0x10, auto_reg | 0x80); | ||
324 | break; | 318 | break; |
325 | case INVERSION_AUTO: | 319 | case INVERSION_AUTO: |
326 | cx24123_writereg(state, 0x10, cx24123_readreg(state, 0x10) & 0x7f); | 320 | dprintk("%s: inversion auto\n",__FUNCTION__); |
321 | cx24123_writereg(state, 0x10, auto_reg & ~0x80); | ||
327 | break; | 322 | break; |
328 | default: | 323 | default: |
329 | return -EINVAL; | 324 | return -EINVAL; |
@@ -338,92 +333,191 @@ static int cx24123_get_inversion(struct cx24123_state* state, fe_spectral_invers | |||
338 | 333 | ||
339 | val = cx24123_readreg(state, 0x1b) >> 7; | 334 | val = cx24123_readreg(state, 0x1b) >> 7; |
340 | 335 | ||
341 | if (val == 0) | 336 | if (val == 0) { |
337 | dprintk("%s: read inversion off\n",__FUNCTION__); | ||
342 | *inversion = INVERSION_OFF; | 338 | *inversion = INVERSION_OFF; |
343 | else | 339 | } else { |
340 | dprintk("%s: read inversion on\n",__FUNCTION__); | ||
344 | *inversion = INVERSION_ON; | 341 | *inversion = INVERSION_ON; |
342 | } | ||
345 | 343 | ||
346 | return 0; | 344 | return 0; |
347 | } | 345 | } |
348 | 346 | ||
349 | static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec) | 347 | static int cx24123_set_fec(struct cx24123_state* state, fe_code_rate_t fec) |
350 | { | 348 | { |
349 | u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07; | ||
350 | |||
351 | if ( (fec < FEC_NONE) || (fec > FEC_AUTO) ) | 351 | if ( (fec < FEC_NONE) || (fec > FEC_AUTO) ) |
352 | fec = FEC_AUTO; | 352 | fec = FEC_AUTO; |
353 | 353 | ||
354 | /* Hardware has 5/11 and 3/5 but are never unused */ | ||
355 | switch (fec) { | 354 | switch (fec) { |
356 | case FEC_NONE: | ||
357 | return cx24123_writereg(state, 0x0f, 0x01); | ||
358 | case FEC_1_2: | 355 | case FEC_1_2: |
359 | return cx24123_writereg(state, 0x0f, 0x02); | 356 | dprintk("%s: set FEC to 1/2\n",__FUNCTION__); |
357 | cx24123_writereg(state, 0x0e, nom_reg | 0x01); | ||
358 | cx24123_writereg(state, 0x0f, 0x02); | ||
359 | break; | ||
360 | case FEC_2_3: | 360 | case FEC_2_3: |
361 | return cx24123_writereg(state, 0x0f, 0x04); | 361 | dprintk("%s: set FEC to 2/3\n",__FUNCTION__); |
362 | cx24123_writereg(state, 0x0e, nom_reg | 0x02); | ||
363 | cx24123_writereg(state, 0x0f, 0x04); | ||
364 | break; | ||
362 | case FEC_3_4: | 365 | case FEC_3_4: |
363 | return cx24123_writereg(state, 0x0f, 0x08); | 366 | dprintk("%s: set FEC to 3/4\n",__FUNCTION__); |
367 | cx24123_writereg(state, 0x0e, nom_reg | 0x03); | ||
368 | cx24123_writereg(state, 0x0f, 0x08); | ||
369 | break; | ||
370 | case FEC_4_5: | ||
371 | dprintk("%s: set FEC to 4/5\n",__FUNCTION__); | ||
372 | cx24123_writereg(state, 0x0e, nom_reg | 0x04); | ||
373 | cx24123_writereg(state, 0x0f, 0x10); | ||
374 | break; | ||
364 | case FEC_5_6: | 375 | case FEC_5_6: |
365 | return cx24123_writereg(state, 0x0f, 0x20); | 376 | dprintk("%s: set FEC to 5/6\n",__FUNCTION__); |
377 | cx24123_writereg(state, 0x0e, nom_reg | 0x05); | ||
378 | cx24123_writereg(state, 0x0f, 0x20); | ||
379 | break; | ||
380 | case FEC_6_7: | ||
381 | dprintk("%s: set FEC to 6/7\n",__FUNCTION__); | ||
382 | cx24123_writereg(state, 0x0e, nom_reg | 0x06); | ||
383 | cx24123_writereg(state, 0x0f, 0x40); | ||
384 | break; | ||
366 | case FEC_7_8: | 385 | case FEC_7_8: |
367 | return cx24123_writereg(state, 0x0f, 0x80); | 386 | dprintk("%s: set FEC to 7/8\n",__FUNCTION__); |
387 | cx24123_writereg(state, 0x0e, nom_reg | 0x07); | ||
388 | cx24123_writereg(state, 0x0f, 0x80); | ||
389 | break; | ||
368 | case FEC_AUTO: | 390 | case FEC_AUTO: |
369 | return cx24123_writereg(state, 0x0f, 0xae); | 391 | dprintk("%s: set FEC to auto\n",__FUNCTION__); |
392 | cx24123_writereg(state, 0x0f, 0xfe); | ||
393 | break; | ||
370 | default: | 394 | default: |
371 | return -EOPNOTSUPP; | 395 | return -EOPNOTSUPP; |
372 | } | 396 | } |
397 | |||
398 | return 0; | ||
373 | } | 399 | } |
374 | 400 | ||
375 | static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec) | 401 | static int cx24123_get_fec(struct cx24123_state* state, fe_code_rate_t *fec) |
376 | { | 402 | { |
377 | int ret; | 403 | int ret; |
378 | u8 val; | ||
379 | 404 | ||
380 | ret = cx24123_readreg (state, 0x1b); | 405 | ret = cx24123_readreg (state, 0x1b); |
381 | if (ret < 0) | 406 | if (ret < 0) |
382 | return ret; | 407 | return ret; |
383 | val = ret & 0x07; | 408 | ret = ret & 0x07; |
384 | switch (val) { | 409 | |
410 | switch (ret) { | ||
385 | case 1: | 411 | case 1: |
386 | *fec = FEC_1_2; | 412 | *fec = FEC_1_2; |
387 | break; | 413 | break; |
388 | case 3: | 414 | case 2: |
389 | *fec = FEC_2_3; | 415 | *fec = FEC_2_3; |
390 | break; | 416 | break; |
391 | case 4: | 417 | case 3: |
392 | *fec = FEC_3_4; | 418 | *fec = FEC_3_4; |
393 | break; | 419 | break; |
394 | case 5: | 420 | case 4: |
395 | *fec = FEC_4_5; | 421 | *fec = FEC_4_5; |
396 | break; | 422 | break; |
397 | case 6: | 423 | case 5: |
398 | *fec = FEC_5_6; | 424 | *fec = FEC_5_6; |
399 | break; | 425 | break; |
426 | case 6: | ||
427 | *fec = FEC_6_7; | ||
428 | break; | ||
400 | case 7: | 429 | case 7: |
401 | *fec = FEC_7_8; | 430 | *fec = FEC_7_8; |
402 | break; | 431 | break; |
403 | case 2: /* *fec = FEC_3_5; break; */ | ||
404 | case 0: /* *fec = FEC_5_11; break; */ | ||
405 | *fec = FEC_AUTO; | ||
406 | break; | ||
407 | default: | 432 | default: |
408 | *fec = FEC_NONE; // can't happen | 433 | /* this can happen when there's no lock */ |
434 | *fec = FEC_NONE; | ||
409 | } | 435 | } |
410 | 436 | ||
411 | return 0; | 437 | return 0; |
412 | } | 438 | } |
413 | 439 | ||
414 | /* fixme: Symbol rates < 3MSps may not work because of precision loss */ | 440 | /* Approximation of closest integer of log2(a/b). It actually gives the |
441 | lowest integer i such that 2^i >= round(a/b) */ | ||
442 | static u32 cx24123_int_log2(u32 a, u32 b) | ||
443 | { | ||
444 | u32 exp, nearest = 0; | ||
445 | u32 div = a / b; | ||
446 | if(a % b >= b / 2) ++div; | ||
447 | if(div < (1 << 31)) | ||
448 | { | ||
449 | for(exp = 1; div > exp; nearest++) | ||
450 | exp += exp; | ||
451 | } | ||
452 | return nearest; | ||
453 | } | ||
454 | |||
415 | static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate) | 455 | static int cx24123_set_symbolrate(struct cx24123_state* state, u32 srate) |
416 | { | 456 | { |
417 | u32 val; | 457 | u32 tmp, sample_rate, ratio, sample_gain; |
458 | u8 pll_mult; | ||
459 | |||
460 | /* check if symbol rate is within limits */ | ||
461 | if ((srate > state->ops.info.symbol_rate_max) || | ||
462 | (srate < state->ops.info.symbol_rate_min)) | ||
463 | return -EOPNOTSUPP;; | ||
464 | |||
465 | /* choose the sampling rate high enough for the required operation, | ||
466 | while optimizing the power consumed by the demodulator */ | ||
467 | if (srate < (XTAL*2)/2) | ||
468 | pll_mult = 2; | ||
469 | else if (srate < (XTAL*3)/2) | ||
470 | pll_mult = 3; | ||
471 | else if (srate < (XTAL*4)/2) | ||
472 | pll_mult = 4; | ||
473 | else if (srate < (XTAL*5)/2) | ||
474 | pll_mult = 5; | ||
475 | else if (srate < (XTAL*6)/2) | ||
476 | pll_mult = 6; | ||
477 | else if (srate < (XTAL*7)/2) | ||
478 | pll_mult = 7; | ||
479 | else if (srate < (XTAL*8)/2) | ||
480 | pll_mult = 8; | ||
481 | else | ||
482 | pll_mult = 9; | ||
483 | |||
484 | |||
485 | sample_rate = pll_mult * XTAL; | ||
486 | |||
487 | /* | ||
488 | SYSSymbolRate[21:0] = (srate << 23) / sample_rate | ||
489 | |||
490 | We have to use 32 bit unsigned arithmetic without precision loss. | ||
491 | The maximum srate is 45000000 or 0x02AEA540. This number has | ||
492 | only 6 clear bits on top, hence we can shift it left only 6 bits | ||
493 | at a time. Borrowed from cx24110.c | ||
494 | */ | ||
495 | |||
496 | tmp = srate << 6; | ||
497 | ratio = tmp / sample_rate; | ||
498 | |||
499 | tmp = (tmp % sample_rate) << 6; | ||
500 | ratio = (ratio << 6) + (tmp / sample_rate); | ||
501 | |||
502 | tmp = (tmp % sample_rate) << 6; | ||
503 | ratio = (ratio << 6) + (tmp / sample_rate); | ||
504 | |||
505 | tmp = (tmp % sample_rate) << 5; | ||
506 | ratio = (ratio << 5) + (tmp / sample_rate); | ||
507 | |||
508 | |||
509 | cx24123_writereg(state, 0x01, pll_mult * 6); | ||
418 | 510 | ||
419 | val = (srate / 1185) * 100; | 511 | cx24123_writereg(state, 0x08, (ratio >> 16) & 0x3f ); |
512 | cx24123_writereg(state, 0x09, (ratio >> 8) & 0xff ); | ||
513 | cx24123_writereg(state, 0x0a, (ratio ) & 0xff ); | ||
420 | 514 | ||
421 | /* Compensate for scaling up, by removing 17 symbols per 1Msps */ | 515 | /* also set the demodulator sample gain */ |
422 | val = val - (17 * (srate / 1000000)); | 516 | sample_gain = cx24123_int_log2(sample_rate, srate); |
517 | tmp = cx24123_readreg(state, 0x0c) & ~0xe0; | ||
518 | cx24123_writereg(state, 0x0c, tmp | sample_gain << 5); | ||
423 | 519 | ||
424 | cx24123_writereg(state, 0x08, (val >> 16) & 0xff ); | 520 | dprintk("%s: srate=%d, ratio=0x%08x, sample_rate=%i sample_gain=%d\n", __FUNCTION__, srate, ratio, sample_rate, sample_gain); |
425 | cx24123_writereg(state, 0x09, (val >> 8) & 0xff ); | ||
426 | cx24123_writereg(state, 0x0a, (val ) & 0xff ); | ||
427 | 521 | ||
428 | return 0; | 522 | return 0; |
429 | } | 523 | } |
@@ -437,6 +531,9 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
437 | struct cx24123_state *state = fe->demodulator_priv; | 531 | struct cx24123_state *state = fe->demodulator_priv; |
438 | u32 ndiv = 0, adiv = 0, vco_div = 0; | 532 | u32 ndiv = 0, adiv = 0, vco_div = 0; |
439 | int i = 0; | 533 | int i = 0; |
534 | int pump = 2; | ||
535 | int band = 0; | ||
536 | int num_bands = sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); | ||
440 | 537 | ||
441 | /* Defaults for low freq, low rate */ | 538 | /* Defaults for low freq, low rate */ |
442 | state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; | 539 | state->VCAarg = cx24123_AGC_vals[0].VCAprogdata; |
@@ -444,38 +541,49 @@ static int cx24123_pll_calculate(struct dvb_frontend* fe, struct dvb_frontend_pa | |||
444 | state->bandselectarg = cx24123_bandselect_vals[0].progdata; | 541 | state->bandselectarg = cx24123_bandselect_vals[0].progdata; |
445 | vco_div = cx24123_bandselect_vals[0].VCOdivider; | 542 | vco_div = cx24123_bandselect_vals[0].VCOdivider; |
446 | 543 | ||
447 | /* For the given symbolerate, determine the VCA and VGA programming bits */ | 544 | /* For the given symbol rate, determine the VCA, VGA and FILTUNE programming bits */ |
448 | for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) | 545 | for (i = 0; i < sizeof(cx24123_AGC_vals) / sizeof(cx24123_AGC_vals[0]); i++) |
449 | { | 546 | { |
450 | if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && | 547 | if ((cx24123_AGC_vals[i].symbolrate_low <= p->u.qpsk.symbol_rate) && |
451 | (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { | 548 | (cx24123_AGC_vals[i].symbolrate_high >= p->u.qpsk.symbol_rate) ) { |
452 | state->VCAarg = cx24123_AGC_vals[i].VCAprogdata; | 549 | state->VCAarg = cx24123_AGC_vals[i].VCAprogdata; |
453 | state->VGAarg = cx24123_AGC_vals[i].VGAprogdata; | 550 | state->VGAarg = cx24123_AGC_vals[i].VGAprogdata; |
551 | state->FILTune = cx24123_AGC_vals[i].FILTune; | ||
454 | } | 552 | } |
455 | } | 553 | } |
456 | 554 | ||
457 | /* For the given frequency, determine the bandselect programming bits */ | 555 | /* determine the band to use */ |
458 | for (i = 0; i < sizeof(cx24123_bandselect_vals) / sizeof(cx24123_bandselect_vals[0]); i++) | 556 | if(force_band < 1 || force_band > num_bands) |
459 | { | 557 | { |
460 | if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && | 558 | for (i = 0; i < num_bands; i++) |
461 | (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) { | 559 | { |
462 | state->bandselectarg = cx24123_bandselect_vals[i].progdata; | 560 | if ((cx24123_bandselect_vals[i].freq_low <= p->frequency) && |
463 | vco_div = cx24123_bandselect_vals[i].VCOdivider; | 561 | (cx24123_bandselect_vals[i].freq_high >= p->frequency) ) |
562 | band = i; | ||
464 | } | 563 | } |
465 | } | 564 | } |
565 | else | ||
566 | band = force_band - 1; | ||
567 | |||
568 | state->bandselectarg = cx24123_bandselect_vals[band].progdata; | ||
569 | vco_div = cx24123_bandselect_vals[band].VCOdivider; | ||
570 | |||
571 | /* determine the charge pump current */ | ||
572 | if ( p->frequency < (cx24123_bandselect_vals[band].freq_low + cx24123_bandselect_vals[band].freq_high)/2 ) | ||
573 | pump = 0x01; | ||
574 | else | ||
575 | pump = 0x02; | ||
466 | 576 | ||
467 | /* Determine the N/A dividers for the requested lband freq (in kHz). */ | 577 | /* Determine the N/A dividers for the requested lband freq (in kHz). */ |
468 | /* Note: 10111 (kHz) is the Crystal Freq and divider of 10. */ | 578 | /* Note: the reference divider R=10, frequency is in KHz, XTAL is in Hz */ |
469 | ndiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) / 32) & 0x1ff; | 579 | ndiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) / 32) & 0x1ff; |
470 | adiv = ( ((p->frequency * vco_div) / (10111 / 10) / 2) % 32) & 0x1f; | 580 | adiv = ( ((p->frequency * vco_div * 10) / (2 * XTAL / 1000)) % 32) & 0x1f; |
471 | 581 | ||
472 | if (adiv == 0) | 582 | if (adiv == 0) |
473 | adiv++; | 583 | ndiv++; |
474 | 584 | ||
475 | /* determine the correct pll frequency values. */ | 585 | /* control bits 11, refdiv 11, charge pump polarity 1, charge pump current, ndiv, adiv */ |
476 | /* Command 11, refdiv 11, cpump polarity 1, cpump current 3mA 10. */ | 586 | state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (pump << 14) | (ndiv << 5) | adiv; |
477 | state->pllarg = (3 << 19) | (3 << 17) | (1 << 16) | (2 << 14); | ||
478 | state->pllarg |= (ndiv << 5) | adiv; | ||
479 | 587 | ||
480 | return 0; | 588 | return 0; |
481 | } | 589 | } |
@@ -489,6 +597,8 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par | |||
489 | struct cx24123_state *state = fe->demodulator_priv; | 597 | struct cx24123_state *state = fe->demodulator_priv; |
490 | unsigned long timeout; | 598 | unsigned long timeout; |
491 | 599 | ||
600 | dprintk("%s: pll writereg called, data=0x%08x\n",__FUNCTION__,data); | ||
601 | |||
492 | /* align the 21 bytes into to bit23 boundary */ | 602 | /* align the 21 bytes into to bit23 boundary */ |
493 | data = data << 3; | 603 | data = data << 3; |
494 | 604 | ||
@@ -538,6 +648,9 @@ static int cx24123_pll_writereg(struct dvb_frontend* fe, struct dvb_frontend_par | |||
538 | static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) | 648 | static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_parameters *p) |
539 | { | 649 | { |
540 | struct cx24123_state *state = fe->demodulator_priv; | 650 | struct cx24123_state *state = fe->demodulator_priv; |
651 | u8 val; | ||
652 | |||
653 | dprintk("frequency=%i\n", p->frequency); | ||
541 | 654 | ||
542 | if (cx24123_pll_calculate(fe, p) != 0) { | 655 | if (cx24123_pll_calculate(fe, p) != 0) { |
543 | printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__); | 656 | printk("%s: cx24123_pll_calcutate failed\n",__FUNCTION__); |
@@ -552,6 +665,14 @@ static int cx24123_pll_tune(struct dvb_frontend* fe, struct dvb_frontend_paramet | |||
552 | cx24123_pll_writereg(fe, p, state->bandselectarg); | 665 | cx24123_pll_writereg(fe, p, state->bandselectarg); |
553 | cx24123_pll_writereg(fe, p, state->pllarg); | 666 | cx24123_pll_writereg(fe, p, state->pllarg); |
554 | 667 | ||
668 | /* set the FILTUNE voltage */ | ||
669 | val = cx24123_readreg(state, 0x28) & ~0x3; | ||
670 | cx24123_writereg(state, 0x27, state->FILTune >> 2); | ||
671 | cx24123_writereg(state, 0x28, val | (state->FILTune & 0x3)); | ||
672 | |||
673 | dprintk("%s: pll tune VCA=%d, band=%d, pll=%d\n",__FUNCTION__,state->VCAarg, | ||
674 | state->bandselectarg,state->pllarg); | ||
675 | |||
555 | return 0; | 676 | return 0; |
556 | } | 677 | } |
557 | 678 | ||
@@ -560,6 +681,8 @@ static int cx24123_initfe(struct dvb_frontend* fe) | |||
560 | struct cx24123_state *state = fe->demodulator_priv; | 681 | struct cx24123_state *state = fe->demodulator_priv; |
561 | int i; | 682 | int i; |
562 | 683 | ||
684 | dprintk("%s: init frontend\n",__FUNCTION__); | ||
685 | |||
563 | /* Configure the demod to a good set of defaults */ | 686 | /* Configure the demod to a good set of defaults */ |
564 | for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) | 687 | for (i = 0; i < sizeof(cx24123_regdata) / sizeof(cx24123_regdata[0]); i++) |
565 | cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); | 688 | cx24123_writereg(state, cx24123_regdata[i].reg, cx24123_regdata[i].data); |
@@ -587,10 +710,13 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage | |||
587 | 710 | ||
588 | switch (voltage) { | 711 | switch (voltage) { |
589 | case SEC_VOLTAGE_13: | 712 | case SEC_VOLTAGE_13: |
713 | dprintk("%s: isl6421 voltage = 13V\n",__FUNCTION__); | ||
590 | return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ | 714 | return cx24123_writelnbreg(state, 0x0, val & 0x32); /* V 13v */ |
591 | case SEC_VOLTAGE_18: | 715 | case SEC_VOLTAGE_18: |
716 | dprintk("%s: isl6421 voltage = 18V\n",__FUNCTION__); | ||
592 | return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ | 717 | return cx24123_writelnbreg(state, 0x0, val | 0x04); /* H 18v */ |
593 | case SEC_VOLTAGE_OFF: | 718 | case SEC_VOLTAGE_OFF: |
719 | dprintk("%s: isl5421 voltage off\n",__FUNCTION__); | ||
594 | return cx24123_writelnbreg(state, 0x0, val & 0x30); | 720 | return cx24123_writelnbreg(state, 0x0, val & 0x30); |
595 | default: | 721 | default: |
596 | return -EINVAL; | 722 | return -EINVAL; |
@@ -624,13 +750,93 @@ static int cx24123_set_voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage | |||
624 | return 0; | 750 | return 0; |
625 | } | 751 | } |
626 | 752 | ||
627 | static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, | 753 | /* wait for diseqc queue to become ready (or timeout) */ |
628 | struct dvb_diseqc_master_cmd *cmd) | 754 | static void cx24123_wait_for_diseqc(struct cx24123_state *state) |
755 | { | ||
756 | unsigned long timeout = jiffies + msecs_to_jiffies(200); | ||
757 | while (!(cx24123_readreg(state, 0x29) & 0x40)) { | ||
758 | if(time_after(jiffies, timeout)) { | ||
759 | printk("%s: diseqc queue not ready, command may be lost.\n", __FUNCTION__); | ||
760 | break; | ||
761 | } | ||
762 | msleep(10); | ||
763 | } | ||
764 | } | ||
765 | |||
766 | static int cx24123_send_diseqc_msg(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd *cmd) | ||
629 | { | 767 | { |
630 | /* fixme: Implement diseqc */ | 768 | struct cx24123_state *state = fe->demodulator_priv; |
631 | printk("%s: No support yet\n",__FUNCTION__); | 769 | int i, val; |
770 | |||
771 | dprintk("%s:\n",__FUNCTION__); | ||
772 | |||
773 | /* check if continuous tone has been stopped */ | ||
774 | if (state->config->use_isl6421) | ||
775 | val = cx24123_readlnbreg(state, 0x00) & 0x10; | ||
776 | else | ||
777 | val = cx24123_readreg(state, 0x29) & 0x10; | ||
632 | 778 | ||
633 | return -ENOTSUPP; | 779 | |
780 | if (val) { | ||
781 | printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__); | ||
782 | return -ENOTSUPP; | ||
783 | } | ||
784 | |||
785 | /* wait for diseqc queue ready */ | ||
786 | cx24123_wait_for_diseqc(state); | ||
787 | |||
788 | /* select tone mode */ | ||
789 | cx24123_writereg(state, 0x2a, cx24123_readreg(state, 0x2a) & 0xf8); | ||
790 | |||
791 | for (i = 0; i < cmd->msg_len; i++) | ||
792 | cx24123_writereg(state, 0x2C + i, cmd->msg[i]); | ||
793 | |||
794 | val = cx24123_readreg(state, 0x29); | ||
795 | cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40) | ((cmd->msg_len-3) & 3)); | ||
796 | |||
797 | /* wait for diseqc message to finish sending */ | ||
798 | cx24123_wait_for_diseqc(state); | ||
799 | |||
800 | return 0; | ||
801 | } | ||
802 | |||
803 | static int cx24123_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst) | ||
804 | { | ||
805 | struct cx24123_state *state = fe->demodulator_priv; | ||
806 | int val; | ||
807 | |||
808 | dprintk("%s:\n", __FUNCTION__); | ||
809 | |||
810 | /* check if continuous tone has been stoped */ | ||
811 | if (state->config->use_isl6421) | ||
812 | val = cx24123_readlnbreg(state, 0x00) & 0x10; | ||
813 | else | ||
814 | val = cx24123_readreg(state, 0x29) & 0x10; | ||
815 | |||
816 | |||
817 | if (val) { | ||
818 | printk("%s: ERROR: attempt to send diseqc command before tone is off\n", __FUNCTION__); | ||
819 | return -ENOTSUPP; | ||
820 | } | ||
821 | |||
822 | cx24123_wait_for_diseqc(state); | ||
823 | |||
824 | /* select tone mode */ | ||
825 | val = cx24123_readreg(state, 0x2a) & 0xf8; | ||
826 | cx24123_writereg(state, 0x2a, val | 0x04); | ||
827 | |||
828 | val = cx24123_readreg(state, 0x29); | ||
829 | |||
830 | if (burst == SEC_MINI_A) | ||
831 | cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x00)); | ||
832 | else if (burst == SEC_MINI_B) | ||
833 | cx24123_writereg(state, 0x29, ((val & 0x90) | 0x40 | 0x08)); | ||
834 | else | ||
835 | return -EINVAL; | ||
836 | |||
837 | cx24123_wait_for_diseqc(state); | ||
838 | |||
839 | return 0; | ||
634 | } | 840 | } |
635 | 841 | ||
636 | static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) | 842 | static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) |
@@ -642,13 +848,15 @@ static int cx24123_read_status(struct dvb_frontend* fe, fe_status_t* status) | |||
642 | 848 | ||
643 | *status = 0; | 849 | *status = 0; |
644 | if (lock & 0x01) | 850 | if (lock & 0x01) |
645 | *status |= FE_HAS_CARRIER | FE_HAS_SIGNAL; | 851 | *status |= FE_HAS_SIGNAL; |
852 | if (sync & 0x02) | ||
853 | *status |= FE_HAS_CARRIER; | ||
646 | if (sync & 0x04) | 854 | if (sync & 0x04) |
647 | *status |= FE_HAS_VITERBI; | 855 | *status |= FE_HAS_VITERBI; |
648 | if (sync & 0x08) | 856 | if (sync & 0x08) |
649 | *status |= FE_HAS_CARRIER; | 857 | *status |= FE_HAS_SYNC; |
650 | if (sync & 0x80) | 858 | if (sync & 0x80) |
651 | *status |= FE_HAS_SYNC | FE_HAS_LOCK; | 859 | *status |= FE_HAS_LOCK; |
652 | 860 | ||
653 | return 0; | 861 | return 0; |
654 | } | 862 | } |
@@ -681,6 +889,8 @@ static int cx24123_read_ber(struct dvb_frontend* fe, u32* ber) | |||
681 | else | 889 | else |
682 | state->snr = 0; | 890 | state->snr = 0; |
683 | 891 | ||
892 | dprintk("%s: BER = %d, S/N index = %d\n",__FUNCTION__,state->lastber, state->snr); | ||
893 | |||
684 | *ber = state->lastber; | 894 | *ber = state->lastber; |
685 | 895 | ||
686 | return 0; | 896 | return 0; |
@@ -691,6 +901,8 @@ static int cx24123_read_signal_strength(struct dvb_frontend* fe, u16* signal_str | |||
691 | struct cx24123_state *state = fe->demodulator_priv; | 901 | struct cx24123_state *state = fe->demodulator_priv; |
692 | *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */ | 902 | *signal_strength = cx24123_readreg(state, 0x3b) << 8; /* larger = better */ |
693 | 903 | ||
904 | dprintk("%s: Signal strength = %d\n",__FUNCTION__,*signal_strength); | ||
905 | |||
694 | return 0; | 906 | return 0; |
695 | } | 907 | } |
696 | 908 | ||
@@ -699,6 +911,8 @@ static int cx24123_read_snr(struct dvb_frontend* fe, u16* snr) | |||
699 | struct cx24123_state *state = fe->demodulator_priv; | 911 | struct cx24123_state *state = fe->demodulator_priv; |
700 | *snr = state->snr; | 912 | *snr = state->snr; |
701 | 913 | ||
914 | dprintk("%s: read S/N index = %d\n",__FUNCTION__,*snr); | ||
915 | |||
702 | return 0; | 916 | return 0; |
703 | } | 917 | } |
704 | 918 | ||
@@ -707,6 +921,8 @@ static int cx24123_read_ucblocks(struct dvb_frontend* fe, u32* ucblocks) | |||
707 | struct cx24123_state *state = fe->demodulator_priv; | 921 | struct cx24123_state *state = fe->demodulator_priv; |
708 | *ucblocks = state->lastber; | 922 | *ucblocks = state->lastber; |
709 | 923 | ||
924 | dprintk("%s: ucblocks (ber) = %d\n",__FUNCTION__,*ucblocks); | ||
925 | |||
710 | return 0; | 926 | return 0; |
711 | } | 927 | } |
712 | 928 | ||
@@ -714,6 +930,8 @@ static int cx24123_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
714 | { | 930 | { |
715 | struct cx24123_state *state = fe->demodulator_priv; | 931 | struct cx24123_state *state = fe->demodulator_priv; |
716 | 932 | ||
933 | dprintk("%s: set_frontend\n",__FUNCTION__); | ||
934 | |||
717 | if (state->config->set_ts_params) | 935 | if (state->config->set_ts_params) |
718 | state->config->set_ts_params(fe, 0); | 936 | state->config->set_ts_params(fe, 0); |
719 | 937 | ||
@@ -737,6 +955,8 @@ static int cx24123_get_frontend(struct dvb_frontend* fe, struct dvb_frontend_par | |||
737 | { | 955 | { |
738 | struct cx24123_state *state = fe->demodulator_priv; | 956 | struct cx24123_state *state = fe->demodulator_priv; |
739 | 957 | ||
958 | dprintk("%s: get_frontend\n",__FUNCTION__); | ||
959 | |||
740 | if (cx24123_get_inversion(state, &p->inversion) != 0) { | 960 | if (cx24123_get_inversion(state, &p->inversion) != 0) { |
741 | printk("%s: Failed to get inversion status\n",__FUNCTION__); | 961 | printk("%s: Failed to get inversion status\n",__FUNCTION__); |
742 | return -EREMOTEIO; | 962 | return -EREMOTEIO; |
@@ -763,8 +983,10 @@ static int cx24123_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone) | |||
763 | 983 | ||
764 | switch (tone) { | 984 | switch (tone) { |
765 | case SEC_TONE_ON: | 985 | case SEC_TONE_ON: |
986 | dprintk("%s: isl6421 sec tone on\n",__FUNCTION__); | ||
766 | return cx24123_writelnbreg(state, 0x0, val | 0x10); | 987 | return cx24123_writelnbreg(state, 0x0, val | 0x10); |
767 | case SEC_TONE_OFF: | 988 | case SEC_TONE_OFF: |
989 | dprintk("%s: isl6421 sec tone off\n",__FUNCTION__); | ||
768 | return cx24123_writelnbreg(state, 0x0, val & 0x2f); | 990 | return cx24123_writelnbreg(state, 0x0, val & 0x2f); |
769 | default: | 991 | default: |
770 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); | 992 | printk("%s: CASE reached default with tone=%d\n", __FUNCTION__, tone); |
@@ -855,12 +1077,13 @@ static struct dvb_frontend_ops cx24123_ops = { | |||
855 | .frequency_min = 950000, | 1077 | .frequency_min = 950000, |
856 | .frequency_max = 2150000, | 1078 | .frequency_max = 2150000, |
857 | .frequency_stepsize = 1011, /* kHz for QPSK frontends */ | 1079 | .frequency_stepsize = 1011, /* kHz for QPSK frontends */ |
858 | .frequency_tolerance = 29500, | 1080 | .frequency_tolerance = 5000, |
859 | .symbol_rate_min = 1000000, | 1081 | .symbol_rate_min = 1000000, |
860 | .symbol_rate_max = 45000000, | 1082 | .symbol_rate_max = 45000000, |
861 | .caps = FE_CAN_INVERSION_AUTO | | 1083 | .caps = FE_CAN_INVERSION_AUTO | |
862 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | | 1084 | FE_CAN_FEC_1_2 | FE_CAN_FEC_2_3 | FE_CAN_FEC_3_4 | |
863 | FE_CAN_FEC_5_6 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | 1085 | FE_CAN_FEC_4_5 | FE_CAN_FEC_5_6 | FE_CAN_FEC_6_7 | |
1086 | FE_CAN_FEC_7_8 | FE_CAN_FEC_AUTO | | ||
864 | FE_CAN_QPSK | FE_CAN_RECOVER | 1087 | FE_CAN_QPSK | FE_CAN_RECOVER |
865 | }, | 1088 | }, |
866 | 1089 | ||
@@ -875,12 +1098,16 @@ static struct dvb_frontend_ops cx24123_ops = { | |||
875 | .read_snr = cx24123_read_snr, | 1098 | .read_snr = cx24123_read_snr, |
876 | .read_ucblocks = cx24123_read_ucblocks, | 1099 | .read_ucblocks = cx24123_read_ucblocks, |
877 | .diseqc_send_master_cmd = cx24123_send_diseqc_msg, | 1100 | .diseqc_send_master_cmd = cx24123_send_diseqc_msg, |
1101 | .diseqc_send_burst = cx24123_diseqc_send_burst, | ||
878 | .set_tone = cx24123_set_tone, | 1102 | .set_tone = cx24123_set_tone, |
879 | .set_voltage = cx24123_set_voltage, | 1103 | .set_voltage = cx24123_set_voltage, |
880 | }; | 1104 | }; |
881 | 1105 | ||
882 | module_param(debug, int, 0644); | 1106 | module_param(debug, int, 0644); |
883 | MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); | 1107 | MODULE_PARM_DESC(debug, "Activates frontend debugging (default:0)"); |
1108 | |||
1109 | module_param(force_band, int, 0644); | ||
1110 | MODULE_PARM_DESC(force_band, "Force a specific band select (1-9, default:off)."); | ||
884 | 1111 | ||
885 | MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware"); | 1112 | MODULE_DESCRIPTION("DVB Frontend module for Conexant cx24123/cx24109 hardware"); |
886 | MODULE_AUTHOR("Steven Toth"); | 1113 | MODULE_AUTHOR("Steven Toth"); |
diff --git a/drivers/media/dvb/frontends/dvb-pll.c b/drivers/media/dvb/frontends/dvb-pll.c index b6e2c387a04c..791706ec1da3 100644 --- a/drivers/media/dvb/frontends/dvb-pll.c +++ b/drivers/media/dvb/frontends/dvb-pll.c | |||
@@ -235,8 +235,8 @@ struct dvb_pll_desc dvb_pll_tdvs_tua6034 = { | |||
235 | .max = 863000000, | 235 | .max = 863000000, |
236 | .count = 3, | 236 | .count = 3, |
237 | .entries = { | 237 | .entries = { |
238 | { 160000000, 44000000, 62500, 0xce, 0x01 }, | 238 | { 165000000, 44000000, 62500, 0xce, 0x01 }, |
239 | { 455000000, 44000000, 62500, 0xce, 0x02 }, | 239 | { 450000000, 44000000, 62500, 0xce, 0x02 }, |
240 | { 999999999, 44000000, 62500, 0xce, 0x04 }, | 240 | { 999999999, 44000000, 62500, 0xce, 0x04 }, |
241 | }, | 241 | }, |
242 | }; | 242 | }; |
diff --git a/drivers/media/dvb/pluto2/Kconfig b/drivers/media/dvb/pluto2/Kconfig index 84f8f9f52869..48252e9ce586 100644 --- a/drivers/media/dvb/pluto2/Kconfig +++ b/drivers/media/dvb/pluto2/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config DVB_PLUTO2 | 1 | config DVB_PLUTO2 |
2 | tristate "Pluto2 cards" | 2 | tristate "Pluto2 cards" |
3 | depends on DVB_CORE && PCI | 3 | depends on DVB_CORE && PCI && I2C |
4 | select I2C | 4 | select I2C |
5 | select I2C_ALGOBIT | 5 | select I2C_ALGOBIT |
6 | select DVB_TDA1004X | 6 | select DVB_TDA1004X |
diff --git a/drivers/media/dvb/pluto2/Makefile b/drivers/media/dvb/pluto2/Makefile index 86ca84b2be6e..ce6a9aaf937e 100644 --- a/drivers/media/dvb/pluto2/Makefile +++ b/drivers/media/dvb/pluto2/Makefile | |||
@@ -1,3 +1,3 @@ | |||
1 | obj-$(CONFIG_DVB_PLUTO2) = pluto2.o | 1 | obj-$(CONFIG_DVB_PLUTO2) += pluto2.o |
2 | 2 | ||
3 | EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ | 3 | EXTRA_CFLAGS = -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/ |
diff --git a/drivers/media/dvb/ttpci/Kconfig b/drivers/media/dvb/ttpci/Kconfig index 5b2aadb8385c..b5ac7dfde52f 100644 --- a/drivers/media/dvb/ttpci/Kconfig +++ b/drivers/media/dvb/ttpci/Kconfig | |||
@@ -1,8 +1,7 @@ | |||
1 | config DVB_AV7110 | 1 | config DVB_AV7110 |
2 | tristate "AV7110 cards" | 2 | tristate "AV7110 cards" |
3 | depends on DVB_CORE && PCI | 3 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
4 | select FW_LOADER | 4 | select FW_LOADER |
5 | select VIDEO_DEV | ||
6 | select VIDEO_SAA7146_VV | 5 | select VIDEO_SAA7146_VV |
7 | select DVB_VES1820 | 6 | select DVB_VES1820 |
8 | select DVB_VES1X93 | 7 | select DVB_VES1X93 |
@@ -59,7 +58,7 @@ config DVB_AV7110_OSD | |||
59 | 58 | ||
60 | config DVB_BUDGET | 59 | config DVB_BUDGET |
61 | tristate "Budget cards" | 60 | tristate "Budget cards" |
62 | depends on DVB_CORE && PCI | 61 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
63 | select VIDEO_SAA7146 | 62 | select VIDEO_SAA7146 |
64 | select DVB_STV0299 | 63 | select DVB_STV0299 |
65 | select DVB_VES1X93 | 64 | select DVB_VES1X93 |
@@ -80,7 +79,7 @@ config DVB_BUDGET | |||
80 | 79 | ||
81 | config DVB_BUDGET_CI | 80 | config DVB_BUDGET_CI |
82 | tristate "Budget cards with onboard CI connector" | 81 | tristate "Budget cards with onboard CI connector" |
83 | depends on DVB_CORE && PCI | 82 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
84 | select VIDEO_SAA7146 | 83 | select VIDEO_SAA7146 |
85 | select DVB_STV0297 | 84 | select DVB_STV0297 |
86 | select DVB_STV0299 | 85 | select DVB_STV0299 |
@@ -100,8 +99,7 @@ config DVB_BUDGET_CI | |||
100 | 99 | ||
101 | config DVB_BUDGET_AV | 100 | config DVB_BUDGET_AV |
102 | tristate "Budget cards with analog video inputs" | 101 | tristate "Budget cards with analog video inputs" |
103 | depends on DVB_CORE && PCI | 102 | depends on DVB_CORE && PCI && I2C && VIDEO_V4L1 |
104 | select VIDEO_DEV | ||
105 | select VIDEO_SAA7146_VV | 103 | select VIDEO_SAA7146_VV |
106 | select DVB_STV0299 | 104 | select DVB_STV0299 |
107 | select DVB_TDA1004X | 105 | select DVB_TDA1004X |
@@ -119,7 +117,7 @@ config DVB_BUDGET_AV | |||
119 | 117 | ||
120 | config DVB_BUDGET_PATCH | 118 | config DVB_BUDGET_PATCH |
121 | tristate "AV7110 cards with Budget Patch" | 119 | tristate "AV7110 cards with Budget Patch" |
122 | depends on DVB_CORE && DVB_BUDGET | 120 | depends on DVB_CORE && DVB_BUDGET && VIDEO_V4L1 |
123 | select DVB_AV7110 | 121 | select DVB_AV7110 |
124 | select DVB_STV0299 | 122 | select DVB_STV0299 |
125 | select DVB_VES1X93 | 123 | select DVB_VES1X93 |
diff --git a/drivers/media/dvb/ttpci/budget-av.c b/drivers/media/dvb/ttpci/budget-av.c index 8efe3ce5f66c..8a7cd7d505cf 100644 --- a/drivers/media/dvb/ttpci/budget-av.c +++ b/drivers/media/dvb/ttpci/budget-av.c | |||
@@ -1190,8 +1190,6 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio | |||
1190 | SAA7146_HPS_SYNC_PORT_A); | 1190 | SAA7146_HPS_SYNC_PORT_A); |
1191 | 1191 | ||
1192 | saa7113_setinput(budget_av, 0); | 1192 | saa7113_setinput(budget_av, 0); |
1193 | } else { | ||
1194 | ciintf_init(budget_av); | ||
1195 | } | 1193 | } |
1196 | 1194 | ||
1197 | /* fixme: find some sane values here... */ | 1195 | /* fixme: find some sane values here... */ |
@@ -1211,6 +1209,10 @@ static int budget_av_attach(struct saa7146_dev *dev, struct saa7146_pci_extensio | |||
1211 | budget_av->budget.dvb_adapter.priv = budget_av; | 1209 | budget_av->budget.dvb_adapter.priv = budget_av; |
1212 | frontend_init(budget_av); | 1210 | frontend_init(budget_av); |
1213 | 1211 | ||
1212 | if (!budget_av->has_saa7113) { | ||
1213 | ciintf_init(budget_av); | ||
1214 | } | ||
1215 | |||
1214 | return 0; | 1216 | return 0; |
1215 | } | 1217 | } |
1216 | 1218 | ||
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 5f91036f5b87..e64a609cf4ff 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -71,6 +71,7 @@ struct budget_ci { | |||
71 | struct tasklet_struct msp430_irq_tasklet; | 71 | struct tasklet_struct msp430_irq_tasklet; |
72 | struct tasklet_struct ciintf_irq_tasklet; | 72 | struct tasklet_struct ciintf_irq_tasklet; |
73 | int slot_status; | 73 | int slot_status; |
74 | int ci_irq; | ||
74 | struct dvb_ca_en50221 ca; | 75 | struct dvb_ca_en50221 ca; |
75 | char ir_dev_name[50]; | 76 | char ir_dev_name[50]; |
76 | u8 tuner_pll_address; /* used for philips_tdm1316l configs */ | 77 | u8 tuner_pll_address; /* used for philips_tdm1316l configs */ |
@@ -276,8 +277,10 @@ static int ciintf_slot_reset(struct dvb_ca_en50221 *ca, int slot) | |||
276 | if (slot != 0) | 277 | if (slot != 0) |
277 | return -EINVAL; | 278 | return -EINVAL; |
278 | 279 | ||
279 | // trigger on RISING edge during reset so we know when READY is re-asserted | 280 | if (budget_ci->ci_irq) { |
280 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | 281 | // trigger on RISING edge during reset so we know when READY is re-asserted |
282 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | ||
283 | } | ||
281 | budget_ci->slot_status = SLOTSTATUS_RESET; | 284 | budget_ci->slot_status = SLOTSTATUS_RESET; |
282 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); | 285 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); |
283 | msleep(1); | 286 | msleep(1); |
@@ -370,11 +373,50 @@ static void ciintf_interrupt(unsigned long data) | |||
370 | } | 373 | } |
371 | } | 374 | } |
372 | 375 | ||
376 | static int ciintf_poll_slot_status(struct dvb_ca_en50221 *ca, int slot, int open) | ||
377 | { | ||
378 | struct budget_ci *budget_ci = (struct budget_ci *) ca->data; | ||
379 | unsigned int flags; | ||
380 | |||
381 | // ensure we don't get spurious IRQs during initialisation | ||
382 | if (!budget_ci->budget.ci_present) | ||
383 | return -EINVAL; | ||
384 | |||
385 | // read the CAM status | ||
386 | flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); | ||
387 | if (flags & CICONTROL_CAMDETECT) { | ||
388 | // mark it as present if it wasn't before | ||
389 | if (budget_ci->slot_status & SLOTSTATUS_NONE) { | ||
390 | budget_ci->slot_status = SLOTSTATUS_PRESENT; | ||
391 | } | ||
392 | |||
393 | // during a RESET, we check if we can read from IO memory to see when CAM is ready | ||
394 | if (budget_ci->slot_status & SLOTSTATUS_RESET) { | ||
395 | if (ciintf_read_attribute_mem(ca, slot, 0) == 0x1d) { | ||
396 | budget_ci->slot_status = SLOTSTATUS_READY; | ||
397 | } | ||
398 | } | ||
399 | } else { | ||
400 | budget_ci->slot_status = SLOTSTATUS_NONE; | ||
401 | } | ||
402 | |||
403 | if (budget_ci->slot_status != SLOTSTATUS_NONE) { | ||
404 | if (budget_ci->slot_status & SLOTSTATUS_READY) { | ||
405 | return DVB_CA_EN50221_POLL_CAM_PRESENT | DVB_CA_EN50221_POLL_CAM_READY; | ||
406 | } | ||
407 | return DVB_CA_EN50221_POLL_CAM_PRESENT; | ||
408 | } | ||
409 | |||
410 | return 0; | ||
411 | } | ||
412 | |||
373 | static int ciintf_init(struct budget_ci *budget_ci) | 413 | static int ciintf_init(struct budget_ci *budget_ci) |
374 | { | 414 | { |
375 | struct saa7146_dev *saa = budget_ci->budget.dev; | 415 | struct saa7146_dev *saa = budget_ci->budget.dev; |
376 | int flags; | 416 | int flags; |
377 | int result; | 417 | int result; |
418 | int ci_version; | ||
419 | int ca_flags; | ||
378 | 420 | ||
379 | memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); | 421 | memset(&budget_ci->ca, 0, sizeof(struct dvb_ca_en50221)); |
380 | 422 | ||
@@ -382,16 +424,29 @@ static int ciintf_init(struct budget_ci *budget_ci) | |||
382 | saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); | 424 | saa7146_write(saa, MC1, saa7146_read(saa, MC1) | (0x800 << 16) | 0x800); |
383 | 425 | ||
384 | // test if it is there | 426 | // test if it is there |
385 | if ((ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0) & 0xa0) != 0xa0) { | 427 | ci_version = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CIVERSION, 1, 1, 0); |
428 | if ((ci_version & 0xa0) != 0xa0) { | ||
386 | result = -ENODEV; | 429 | result = -ENODEV; |
387 | goto error; | 430 | goto error; |
388 | } | 431 | } |
432 | |||
389 | // determine whether a CAM is present or not | 433 | // determine whether a CAM is present or not |
390 | flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); | 434 | flags = ttpci_budget_debiread(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 1, 0); |
391 | budget_ci->slot_status = SLOTSTATUS_NONE; | 435 | budget_ci->slot_status = SLOTSTATUS_NONE; |
392 | if (flags & CICONTROL_CAMDETECT) | 436 | if (flags & CICONTROL_CAMDETECT) |
393 | budget_ci->slot_status = SLOTSTATUS_PRESENT; | 437 | budget_ci->slot_status = SLOTSTATUS_PRESENT; |
394 | 438 | ||
439 | // version 0xa2 of the CI firmware doesn't generate interrupts | ||
440 | if (ci_version == 0xa2) { | ||
441 | ca_flags = 0; | ||
442 | budget_ci->ci_irq = 0; | ||
443 | } else { | ||
444 | ca_flags = DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | | ||
445 | DVB_CA_EN50221_FLAG_IRQ_FR | | ||
446 | DVB_CA_EN50221_FLAG_IRQ_DA; | ||
447 | budget_ci->ci_irq = 1; | ||
448 | } | ||
449 | |||
395 | // register CI interface | 450 | // register CI interface |
396 | budget_ci->ca.owner = THIS_MODULE; | 451 | budget_ci->ca.owner = THIS_MODULE; |
397 | budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem; | 452 | budget_ci->ca.read_attribute_mem = ciintf_read_attribute_mem; |
@@ -401,23 +456,27 @@ static int ciintf_init(struct budget_ci *budget_ci) | |||
401 | budget_ci->ca.slot_reset = ciintf_slot_reset; | 456 | budget_ci->ca.slot_reset = ciintf_slot_reset; |
402 | budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; | 457 | budget_ci->ca.slot_shutdown = ciintf_slot_shutdown; |
403 | budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; | 458 | budget_ci->ca.slot_ts_enable = ciintf_slot_ts_enable; |
459 | budget_ci->ca.poll_slot_status = ciintf_poll_slot_status; | ||
404 | budget_ci->ca.data = budget_ci; | 460 | budget_ci->ca.data = budget_ci; |
405 | if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, | 461 | if ((result = dvb_ca_en50221_init(&budget_ci->budget.dvb_adapter, |
406 | &budget_ci->ca, | 462 | &budget_ci->ca, |
407 | DVB_CA_EN50221_FLAG_IRQ_CAMCHANGE | | 463 | ca_flags, 1)) != 0) { |
408 | DVB_CA_EN50221_FLAG_IRQ_FR | | ||
409 | DVB_CA_EN50221_FLAG_IRQ_DA, 1)) != 0) { | ||
410 | printk("budget_ci: CI interface detected, but initialisation failed.\n"); | 464 | printk("budget_ci: CI interface detected, but initialisation failed.\n"); |
411 | goto error; | 465 | goto error; |
412 | } | 466 | } |
467 | |||
413 | // Setup CI slot IRQ | 468 | // Setup CI slot IRQ |
414 | tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); | 469 | if (budget_ci->ci_irq) { |
415 | if (budget_ci->slot_status != SLOTSTATUS_NONE) { | 470 | tasklet_init(&budget_ci->ciintf_irq_tasklet, ciintf_interrupt, (unsigned long) budget_ci); |
416 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); | 471 | if (budget_ci->slot_status != SLOTSTATUS_NONE) { |
417 | } else { | 472 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQLO); |
418 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | 473 | } else { |
474 | saa7146_setgpio(saa, 0, SAA7146_GPIO_IRQHI); | ||
475 | } | ||
476 | saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); | ||
419 | } | 477 | } |
420 | saa7146_write(saa, IER, saa7146_read(saa, IER) | MASK_03); | 478 | |
479 | // enable interface | ||
421 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, | 480 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, |
422 | CICONTROL_RESET, 1, 0); | 481 | CICONTROL_RESET, 1, 0); |
423 | 482 | ||
@@ -426,10 +485,12 @@ static int ciintf_init(struct budget_ci *budget_ci) | |||
426 | budget_ci->budget.ci_present = 1; | 485 | budget_ci->budget.ci_present = 1; |
427 | 486 | ||
428 | // forge a fake CI IRQ so the CAM state is setup correctly | 487 | // forge a fake CI IRQ so the CAM state is setup correctly |
429 | flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; | 488 | if (budget_ci->ci_irq) { |
430 | if (budget_ci->slot_status != SLOTSTATUS_NONE) | 489 | flags = DVB_CA_EN50221_CAMCHANGE_REMOVED; |
431 | flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; | 490 | if (budget_ci->slot_status != SLOTSTATUS_NONE) |
432 | dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); | 491 | flags = DVB_CA_EN50221_CAMCHANGE_INSERTED; |
492 | dvb_ca_en50221_camchange_irq(&budget_ci->ca, 0, flags); | ||
493 | } | ||
433 | 494 | ||
434 | return 0; | 495 | return 0; |
435 | 496 | ||
@@ -443,9 +504,13 @@ static void ciintf_deinit(struct budget_ci *budget_ci) | |||
443 | struct saa7146_dev *saa = budget_ci->budget.dev; | 504 | struct saa7146_dev *saa = budget_ci->budget.dev; |
444 | 505 | ||
445 | // disable CI interrupts | 506 | // disable CI interrupts |
446 | saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); | 507 | if (budget_ci->ci_irq) { |
447 | saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); | 508 | saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_03); |
448 | tasklet_kill(&budget_ci->ciintf_irq_tasklet); | 509 | saa7146_setgpio(saa, 0, SAA7146_GPIO_INPUT); |
510 | tasklet_kill(&budget_ci->ciintf_irq_tasklet); | ||
511 | } | ||
512 | |||
513 | // reset interface | ||
449 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); | 514 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, 0, 1, 0); |
450 | msleep(1); | 515 | msleep(1); |
451 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, | 516 | ttpci_budget_debiwrite(&budget_ci->budget, DEBICICTL, DEBIADDR_CICONTROL, 1, |
@@ -473,7 +538,7 @@ static void budget_ci_irq(struct saa7146_dev *dev, u32 * isr) | |||
473 | if (*isr & MASK_10) | 538 | if (*isr & MASK_10) |
474 | ttpci_budget_irq10_handler(dev, isr); | 539 | ttpci_budget_irq10_handler(dev, isr); |
475 | 540 | ||
476 | if ((*isr & MASK_03) && (budget_ci->budget.ci_present)) | 541 | if ((*isr & MASK_03) && (budget_ci->budget.ci_present) && (budget_ci->ci_irq)) |
477 | tasklet_schedule(&budget_ci->ciintf_irq_tasklet); | 542 | tasklet_schedule(&budget_ci->ciintf_irq_tasklet); |
478 | } | 543 | } |
479 | 544 | ||
diff --git a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c index 248fdc7accfb..6ceae38125c7 100644 --- a/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c +++ b/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c | |||
@@ -1507,7 +1507,11 @@ static int ttusb_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
1507 | 1507 | ||
1508 | mutex_unlock(&ttusb->semi2c); | 1508 | mutex_unlock(&ttusb->semi2c); |
1509 | 1509 | ||
1510 | dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE); | 1510 | if ((result = dvb_register_adapter(&ttusb->adapter, "Technotrend/Hauppauge Nova-USB", THIS_MODULE)) < 0) { |
1511 | ttusb_free_iso_urbs(ttusb); | ||
1512 | kfree(ttusb); | ||
1513 | return result; | ||
1514 | } | ||
1511 | ttusb->adapter.priv = ttusb; | 1515 | ttusb->adapter.priv = ttusb; |
1512 | 1516 | ||
1513 | /* i2c */ | 1517 | /* i2c */ |
diff --git a/drivers/media/radio/Kconfig b/drivers/media/radio/Kconfig index d318be383de6..3fff75763693 100644 --- a/drivers/media/radio/Kconfig +++ b/drivers/media/radio/Kconfig | |||
@@ -7,7 +7,7 @@ menu "Radio Adapters" | |||
7 | 7 | ||
8 | config RADIO_CADET | 8 | config RADIO_CADET |
9 | tristate "ADS Cadet AM/FM Tuner" | 9 | tristate "ADS Cadet AM/FM Tuner" |
10 | depends on ISA && VIDEO_DEV | 10 | depends on ISA && VIDEO_V4L1 |
11 | ---help--- | 11 | ---help--- |
12 | Choose Y here if you have one of these AM/FM radio cards, and then | 12 | Choose Y here if you have one of these AM/FM radio cards, and then |
13 | fill in the port address below. | 13 | fill in the port address below. |
@@ -25,7 +25,7 @@ config RADIO_CADET | |||
25 | 25 | ||
26 | config RADIO_RTRACK | 26 | config RADIO_RTRACK |
27 | tristate "AIMSlab RadioTrack (aka RadioReveal) support" | 27 | tristate "AIMSlab RadioTrack (aka RadioReveal) support" |
28 | depends on ISA && VIDEO_DEV | 28 | depends on ISA && VIDEO_V4L1 |
29 | ---help--- | 29 | ---help--- |
30 | Choose Y here if you have one of these FM radio cards, and then fill | 30 | Choose Y here if you have one of these FM radio cards, and then fill |
31 | in the port address below. | 31 | in the port address below. |
@@ -59,7 +59,7 @@ config RADIO_RTRACK_PORT | |||
59 | 59 | ||
60 | config RADIO_RTRACK2 | 60 | config RADIO_RTRACK2 |
61 | tristate "AIMSlab RadioTrack II support" | 61 | tristate "AIMSlab RadioTrack II support" |
62 | depends on ISA && VIDEO_DEV | 62 | depends on ISA && VIDEO_V4L1 |
63 | ---help--- | 63 | ---help--- |
64 | Choose Y here if you have this FM radio card, and then fill in the | 64 | Choose Y here if you have this FM radio card, and then fill in the |
65 | port address below. | 65 | port address below. |
@@ -82,7 +82,7 @@ config RADIO_RTRACK2_PORT | |||
82 | 82 | ||
83 | config RADIO_AZTECH | 83 | config RADIO_AZTECH |
84 | tristate "Aztech/Packard Bell Radio" | 84 | tristate "Aztech/Packard Bell Radio" |
85 | depends on ISA && VIDEO_DEV | 85 | depends on ISA && VIDEO_V4L1 |
86 | ---help--- | 86 | ---help--- |
87 | Choose Y here if you have one of these FM radio cards, and then fill | 87 | Choose Y here if you have one of these FM radio cards, and then fill |
88 | in the port address below. | 88 | in the port address below. |
@@ -106,7 +106,7 @@ config RADIO_AZTECH_PORT | |||
106 | 106 | ||
107 | config RADIO_GEMTEK | 107 | config RADIO_GEMTEK |
108 | tristate "GemTek Radio Card support" | 108 | tristate "GemTek Radio Card support" |
109 | depends on ISA && VIDEO_DEV | 109 | depends on ISA && VIDEO_V4L1 |
110 | ---help--- | 110 | ---help--- |
111 | Choose Y here if you have this FM radio card, and then fill in the | 111 | Choose Y here if you have this FM radio card, and then fill in the |
112 | port address below. | 112 | port address below. |
@@ -131,7 +131,7 @@ config RADIO_GEMTEK_PORT | |||
131 | 131 | ||
132 | config RADIO_GEMTEK_PCI | 132 | config RADIO_GEMTEK_PCI |
133 | tristate "GemTek PCI Radio Card support" | 133 | tristate "GemTek PCI Radio Card support" |
134 | depends on VIDEO_DEV && PCI | 134 | depends on VIDEO_V4L1 && PCI |
135 | ---help--- | 135 | ---help--- |
136 | Choose Y here if you have this PCI FM radio card. | 136 | Choose Y here if you have this PCI FM radio card. |
137 | 137 | ||
@@ -145,7 +145,7 @@ config RADIO_GEMTEK_PCI | |||
145 | 145 | ||
146 | config RADIO_MAXIRADIO | 146 | config RADIO_MAXIRADIO |
147 | tristate "Guillemot MAXI Radio FM 2000 radio" | 147 | tristate "Guillemot MAXI Radio FM 2000 radio" |
148 | depends on VIDEO_DEV && PCI | 148 | depends on VIDEO_V4L1 && PCI |
149 | ---help--- | 149 | ---help--- |
150 | Choose Y here if you have this radio card. This card may also be | 150 | Choose Y here if you have this radio card. This card may also be |
151 | found as Gemtek PCI FM. | 151 | found as Gemtek PCI FM. |
@@ -160,7 +160,7 @@ config RADIO_MAXIRADIO | |||
160 | 160 | ||
161 | config RADIO_MAESTRO | 161 | config RADIO_MAESTRO |
162 | tristate "Maestro on board radio" | 162 | tristate "Maestro on board radio" |
163 | depends on VIDEO_DEV | 163 | depends on VIDEO_V4L1 |
164 | ---help--- | 164 | ---help--- |
165 | Say Y here to directly support the on-board radio tuner on the | 165 | Say Y here to directly support the on-board radio tuner on the |
166 | Maestro 2 or 2E sound card. | 166 | Maestro 2 or 2E sound card. |
@@ -175,7 +175,7 @@ config RADIO_MAESTRO | |||
175 | 175 | ||
176 | config RADIO_MIROPCM20 | 176 | config RADIO_MIROPCM20 |
177 | tristate "miroSOUND PCM20 radio" | 177 | tristate "miroSOUND PCM20 radio" |
178 | depends on ISA && VIDEO_DEV && SOUND_ACI_MIXER | 178 | depends on ISA && VIDEO_V4L1 && SOUND_ACI_MIXER |
179 | ---help--- | 179 | ---help--- |
180 | Choose Y here if you have this FM radio card. You also need to say Y | 180 | Choose Y here if you have this FM radio card. You also need to say Y |
181 | to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound") | 181 | to "ACI mixer (miroSOUND PCM1-pro/PCM12/PCM20 radio)" (in "Sound") |
@@ -208,7 +208,7 @@ config RADIO_MIROPCM20_RDS | |||
208 | 208 | ||
209 | config RADIO_SF16FMI | 209 | config RADIO_SF16FMI |
210 | tristate "SF16FMI Radio" | 210 | tristate "SF16FMI Radio" |
211 | depends on ISA && VIDEO_DEV | 211 | depends on ISA && VIDEO_V4L1 |
212 | ---help--- | 212 | ---help--- |
213 | Choose Y here if you have one of these FM radio cards. If you | 213 | Choose Y here if you have one of these FM radio cards. If you |
214 | compile the driver into the kernel and your card is not PnP one, you | 214 | compile the driver into the kernel and your card is not PnP one, you |
@@ -225,7 +225,7 @@ config RADIO_SF16FMI | |||
225 | 225 | ||
226 | config RADIO_SF16FMR2 | 226 | config RADIO_SF16FMR2 |
227 | tristate "SF16FMR2 Radio" | 227 | tristate "SF16FMR2 Radio" |
228 | depends on ISA && VIDEO_DEV | 228 | depends on ISA && VIDEO_V4L1 |
229 | ---help--- | 229 | ---help--- |
230 | Choose Y here if you have one of these FM radio cards. | 230 | Choose Y here if you have one of these FM radio cards. |
231 | 231 | ||
@@ -239,7 +239,7 @@ config RADIO_SF16FMR2 | |||
239 | 239 | ||
240 | config RADIO_TERRATEC | 240 | config RADIO_TERRATEC |
241 | tristate "TerraTec ActiveRadio ISA Standalone" | 241 | tristate "TerraTec ActiveRadio ISA Standalone" |
242 | depends on ISA && VIDEO_DEV | 242 | depends on ISA && VIDEO_V4L1 |
243 | ---help--- | 243 | ---help--- |
244 | Choose Y here if you have this FM radio card, and then fill in the | 244 | Choose Y here if you have this FM radio card, and then fill in the |
245 | port address below. (TODO) | 245 | port address below. (TODO) |
@@ -268,7 +268,7 @@ config RADIO_TERRATEC_PORT | |||
268 | 268 | ||
269 | config RADIO_TRUST | 269 | config RADIO_TRUST |
270 | tristate "Trust FM radio card" | 270 | tristate "Trust FM radio card" |
271 | depends on ISA && VIDEO_DEV | 271 | depends on ISA && VIDEO_V4L1 |
272 | help | 272 | help |
273 | This is a driver for the Trust FM radio cards. Say Y if you have | 273 | This is a driver for the Trust FM radio cards. Say Y if you have |
274 | such a card and want to use it under Linux. | 274 | such a card and want to use it under Linux. |
@@ -286,7 +286,7 @@ config RADIO_TRUST_PORT | |||
286 | 286 | ||
287 | config RADIO_TYPHOON | 287 | config RADIO_TYPHOON |
288 | tristate "Typhoon Radio (a.k.a. EcoRadio)" | 288 | tristate "Typhoon Radio (a.k.a. EcoRadio)" |
289 | depends on ISA && VIDEO_DEV | 289 | depends on ISA && VIDEO_V4L1 |
290 | ---help--- | 290 | ---help--- |
291 | Choose Y here if you have one of these FM radio cards, and then fill | 291 | Choose Y here if you have one of these FM radio cards, and then fill |
292 | in the port address and the frequency used for muting below. | 292 | in the port address and the frequency used for muting below. |
@@ -330,7 +330,7 @@ config RADIO_TYPHOON_MUTEFREQ | |||
330 | 330 | ||
331 | config RADIO_ZOLTRIX | 331 | config RADIO_ZOLTRIX |
332 | tristate "Zoltrix Radio" | 332 | tristate "Zoltrix Radio" |
333 | depends on ISA && VIDEO_DEV | 333 | depends on ISA && VIDEO_V4L1 |
334 | ---help--- | 334 | ---help--- |
335 | Choose Y here if you have one of these FM radio cards, and then fill | 335 | Choose Y here if you have one of these FM radio cards, and then fill |
336 | in the port address below. | 336 | in the port address below. |
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 85888a8a93c9..6b4197018561 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig | |||
@@ -2,10 +2,10 @@ | |||
2 | # Multimedia Video device configuration | 2 | # Multimedia Video device configuration |
3 | # | 3 | # |
4 | 4 | ||
5 | menu "Video For Linux" | 5 | menu "Video Capture Adapters" |
6 | depends on VIDEO_DEV | 6 | depends on VIDEO_DEV |
7 | 7 | ||
8 | comment "Video Adapters" | 8 | comment "Video Capture Adapters" |
9 | 9 | ||
10 | config VIDEO_ADV_DEBUG | 10 | config VIDEO_ADV_DEBUG |
11 | bool "Enable advanced debug functionality" | 11 | bool "Enable advanced debug functionality" |
@@ -16,11 +16,23 @@ config VIDEO_ADV_DEBUG | |||
16 | V4L devices. | 16 | V4L devices. |
17 | In doubt, say N. | 17 | In doubt, say N. |
18 | 18 | ||
19 | config VIDEO_VIVI | ||
20 | tristate "Virtual Video Driver" | ||
21 | depends on VIDEO_V4L2 && !SPARC32 && !SPARC64 | ||
22 | select VIDEO_BUF | ||
23 | default n | ||
24 | ---help--- | ||
25 | Enables a virtual video driver. This device shows a color bar | ||
26 | and a timestamp, as a real device would generate by using V4L2 | ||
27 | api. | ||
28 | Say Y here if you want to test video apps or debug V4L devices. | ||
29 | In doubt, say N. | ||
30 | |||
19 | source "drivers/media/video/bt8xx/Kconfig" | 31 | source "drivers/media/video/bt8xx/Kconfig" |
20 | 32 | ||
21 | config VIDEO_SAA6588 | 33 | config VIDEO_SAA6588 |
22 | tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" | 34 | tristate "SAA6588 Radio Chip RDS decoder support on BT848 cards" |
23 | depends on VIDEO_DEV && I2C && VIDEO_BT848 | 35 | depends on I2C && VIDEO_BT848 |
24 | 36 | ||
25 | help | 37 | help |
26 | Support for Radio Data System (RDS) decoder. This allows seeing | 38 | Support for Radio Data System (RDS) decoder. This allows seeing |
@@ -32,7 +44,7 @@ config VIDEO_SAA6588 | |||
32 | 44 | ||
33 | config VIDEO_PMS | 45 | config VIDEO_PMS |
34 | tristate "Mediavision Pro Movie Studio Video For Linux" | 46 | tristate "Mediavision Pro Movie Studio Video For Linux" |
35 | depends on VIDEO_DEV && ISA | 47 | depends on ISA && VIDEO_V4L1 |
36 | help | 48 | help |
37 | Say Y if you have such a thing. | 49 | Say Y if you have such a thing. |
38 | 50 | ||
@@ -41,7 +53,7 @@ config VIDEO_PMS | |||
41 | 53 | ||
42 | config VIDEO_PLANB | 54 | config VIDEO_PLANB |
43 | tristate "PlanB Video-In on PowerMac" | 55 | tristate "PlanB Video-In on PowerMac" |
44 | depends on PPC_PMAC && VIDEO_DEV && BROKEN | 56 | depends on PPC_PMAC && VIDEO_V4L1 && BROKEN |
45 | help | 57 | help |
46 | PlanB is the V4L driver for the PowerMac 7x00/8x00 series video | 58 | PlanB is the V4L driver for the PowerMac 7x00/8x00 series video |
47 | input hardware. If you want to experiment with this, say Y. | 59 | input hardware. If you want to experiment with this, say Y. |
@@ -52,7 +64,7 @@ config VIDEO_PLANB | |||
52 | 64 | ||
53 | config VIDEO_BWQCAM | 65 | config VIDEO_BWQCAM |
54 | tristate "Quickcam BW Video For Linux" | 66 | tristate "Quickcam BW Video For Linux" |
55 | depends on VIDEO_DEV && PARPORT | 67 | depends on PARPORT && VIDEO_V4L1 |
56 | help | 68 | help |
57 | Say Y have if you the black and white version of the QuickCam | 69 | Say Y have if you the black and white version of the QuickCam |
58 | camera. See the next option for the color version. | 70 | camera. See the next option for the color version. |
@@ -62,7 +74,7 @@ config VIDEO_BWQCAM | |||
62 | 74 | ||
63 | config VIDEO_CQCAM | 75 | config VIDEO_CQCAM |
64 | tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)" | 76 | tristate "QuickCam Colour Video For Linux (EXPERIMENTAL)" |
65 | depends on EXPERIMENTAL && VIDEO_DEV && PARPORT | 77 | depends on EXPERIMENTAL && PARPORT && VIDEO_V4L1 |
66 | help | 78 | help |
67 | This is the video4linux driver for the colour version of the | 79 | This is the video4linux driver for the colour version of the |
68 | Connectix QuickCam. If you have one of these cameras, say Y here, | 80 | Connectix QuickCam. If you have one of these cameras, say Y here, |
@@ -73,7 +85,7 @@ config VIDEO_CQCAM | |||
73 | 85 | ||
74 | config VIDEO_W9966 | 86 | config VIDEO_W9966 |
75 | tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux" | 87 | tristate "W9966CF Webcam (FlyCam Supra and others) Video For Linux" |
76 | depends on PARPORT_1284 && VIDEO_DEV && PARPORT | 88 | depends on PARPORT_1284 && PARPORT && VIDEO_V4L1 |
77 | help | 89 | help |
78 | Video4linux driver for Winbond's w9966 based Webcams. | 90 | Video4linux driver for Winbond's w9966 based Webcams. |
79 | Currently tested with the LifeView FlyCam Supra. | 91 | Currently tested with the LifeView FlyCam Supra. |
@@ -86,7 +98,7 @@ config VIDEO_W9966 | |||
86 | 98 | ||
87 | config VIDEO_CPIA | 99 | config VIDEO_CPIA |
88 | tristate "CPiA Video For Linux" | 100 | tristate "CPiA Video For Linux" |
89 | depends on VIDEO_DEV | 101 | depends on VIDEO_V4L1 |
90 | ---help--- | 102 | ---help--- |
91 | This is the video4linux driver for cameras based on Vision's CPiA | 103 | This is the video4linux driver for cameras based on Vision's CPiA |
92 | (Colour Processor Interface ASIC), such as the Creative Labs Video | 104 | (Colour Processor Interface ASIC), such as the Creative Labs Video |
@@ -123,7 +135,7 @@ source "drivers/media/video/cpia2/Kconfig" | |||
123 | 135 | ||
124 | config VIDEO_SAA5246A | 136 | config VIDEO_SAA5246A |
125 | tristate "SAA5246A, SAA5281 Teletext processor" | 137 | tristate "SAA5246A, SAA5281 Teletext processor" |
126 | depends on VIDEO_DEV && I2C | 138 | depends on I2C && VIDEO_V4L1 |
127 | help | 139 | help |
128 | Support for I2C bus based teletext using the SAA5246A or SAA5281 | 140 | Support for I2C bus based teletext using the SAA5246A or SAA5281 |
129 | chip. Useful only if you live in Europe. | 141 | chip. Useful only if you live in Europe. |
@@ -150,7 +162,7 @@ config TUNER_3036 | |||
150 | 162 | ||
151 | config VIDEO_VINO | 163 | config VIDEO_VINO |
152 | tristate "SGI Vino Video For Linux (EXPERIMENTAL)" | 164 | tristate "SGI Vino Video For Linux (EXPERIMENTAL)" |
153 | depends on VIDEO_DEV && I2C && SGI_IP22 && EXPERIMENTAL | 165 | depends on I2C && SGI_IP22 && EXPERIMENTAL && VIDEO_V4L1 |
154 | select I2C_ALGO_SGI | 166 | select I2C_ALGO_SGI |
155 | help | 167 | help |
156 | Say Y here to build in support for the Vino video input system found | 168 | Say Y here to build in support for the Vino video input system found |
@@ -158,7 +170,7 @@ config VIDEO_VINO | |||
158 | 170 | ||
159 | config VIDEO_STRADIS | 171 | config VIDEO_STRADIS |
160 | tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)" | 172 | tristate "Stradis 4:2:2 MPEG-2 video driver (EXPERIMENTAL)" |
161 | depends on EXPERIMENTAL && VIDEO_DEV && PCI | 173 | depends on EXPERIMENTAL && PCI && VIDEO_V4L1 && !PPC64 |
162 | help | 174 | help |
163 | Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video | 175 | Say Y here to enable support for the Stradis 4:2:2 MPEG-2 video |
164 | driver for PCI. There is a product page at | 176 | driver for PCI. There is a product page at |
@@ -166,7 +178,7 @@ config VIDEO_STRADIS | |||
166 | 178 | ||
167 | config VIDEO_ZORAN | 179 | config VIDEO_ZORAN |
168 | tristate "Zoran ZR36057/36067 Video For Linux" | 180 | tristate "Zoran ZR36057/36067 Video For Linux" |
169 | depends on VIDEO_DEV && PCI && I2C_ALGOBIT | 181 | depends on PCI && I2C_ALGOBIT && VIDEO_V4L1 && !PPC64 |
170 | help | 182 | help |
171 | Say Y for support for MJPEG capture cards based on the Zoran | 183 | Say Y for support for MJPEG capture cards based on the Zoran |
172 | 36057/36067 PCI controller chipset. This includes the Iomega | 184 | 36057/36067 PCI controller chipset. This includes the Iomega |
@@ -214,7 +226,7 @@ config VIDEO_ZORAN_LML33R10 | |||
214 | 226 | ||
215 | config VIDEO_ZR36120 | 227 | config VIDEO_ZR36120 |
216 | tristate "Zoran ZR36120/36125 Video For Linux" | 228 | tristate "Zoran ZR36120/36125 Video For Linux" |
217 | depends on VIDEO_DEV && PCI && I2C && BROKEN | 229 | depends on PCI && I2C && VIDEO_V4L1 && BROKEN |
218 | help | 230 | help |
219 | Support for ZR36120/ZR36125 based frame grabber/overlay boards. | 231 | Support for ZR36120/ZR36125 based frame grabber/overlay boards. |
220 | This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, | 232 | This includes the Victor II, WaveWatcher, Video Wonder, Maxi-TV, |
@@ -226,7 +238,7 @@ config VIDEO_ZR36120 | |||
226 | 238 | ||
227 | config VIDEO_MEYE | 239 | config VIDEO_MEYE |
228 | tristate "Sony Vaio Picturebook Motion Eye Video For Linux" | 240 | tristate "Sony Vaio Picturebook Motion Eye Video For Linux" |
229 | depends on VIDEO_DEV && PCI && SONYPI | 241 | depends on PCI && SONYPI && VIDEO_V4L1 |
230 | ---help--- | 242 | ---help--- |
231 | This is the video4linux driver for the Motion Eye camera found | 243 | This is the video4linux driver for the Motion Eye camera found |
232 | in the Vaio Picturebook laptops. Please read the material in | 244 | in the Vaio Picturebook laptops. Please read the material in |
@@ -242,7 +254,7 @@ source "drivers/media/video/saa7134/Kconfig" | |||
242 | 254 | ||
243 | config VIDEO_MXB | 255 | config VIDEO_MXB |
244 | tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" | 256 | tristate "Siemens-Nixdorf 'Multimedia eXtension Board'" |
245 | depends on VIDEO_DEV && PCI | 257 | depends on PCI && VIDEO_V4L1 |
246 | select VIDEO_SAA7146_VV | 258 | select VIDEO_SAA7146_VV |
247 | select VIDEO_TUNER | 259 | select VIDEO_TUNER |
248 | ---help--- | 260 | ---help--- |
@@ -254,8 +266,9 @@ config VIDEO_MXB | |||
254 | 266 | ||
255 | config VIDEO_DPC | 267 | config VIDEO_DPC |
256 | tristate "Philips-Semiconductors 'dpc7146 demonstration board'" | 268 | tristate "Philips-Semiconductors 'dpc7146 demonstration board'" |
257 | depends on VIDEO_DEV && PCI | 269 | depends on PCI && VIDEO_V4L1 |
258 | select VIDEO_SAA7146_VV | 270 | select VIDEO_SAA7146_VV |
271 | select VIDEO_V4L2 | ||
259 | ---help--- | 272 | ---help--- |
260 | This is a video4linux driver for the 'dpc7146 demonstration | 273 | This is a video4linux driver for the 'dpc7146 demonstration |
261 | board' by Philips-Semiconductors. It's the reference design | 274 | board' by Philips-Semiconductors. It's the reference design |
@@ -268,8 +281,9 @@ config VIDEO_DPC | |||
268 | 281 | ||
269 | config VIDEO_HEXIUM_ORION | 282 | config VIDEO_HEXIUM_ORION |
270 | tristate "Hexium HV-PCI6 and Orion frame grabber" | 283 | tristate "Hexium HV-PCI6 and Orion frame grabber" |
271 | depends on VIDEO_DEV && PCI | 284 | depends on PCI && VIDEO_V4L1 |
272 | select VIDEO_SAA7146_VV | 285 | select VIDEO_SAA7146_VV |
286 | select VIDEO_V4L2 | ||
273 | ---help--- | 287 | ---help--- |
274 | This is a video4linux driver for the Hexium HV-PCI6 and | 288 | This is a video4linux driver for the Hexium HV-PCI6 and |
275 | Orion frame grabber cards by Hexium. | 289 | Orion frame grabber cards by Hexium. |
@@ -279,8 +293,9 @@ config VIDEO_HEXIUM_ORION | |||
279 | 293 | ||
280 | config VIDEO_HEXIUM_GEMINI | 294 | config VIDEO_HEXIUM_GEMINI |
281 | tristate "Hexium Gemini frame grabber" | 295 | tristate "Hexium Gemini frame grabber" |
282 | depends on VIDEO_DEV && PCI | 296 | depends on PCI && VIDEO_V4L1 |
283 | select VIDEO_SAA7146_VV | 297 | select VIDEO_SAA7146_VV |
298 | select VIDEO_V4L2 | ||
284 | ---help--- | 299 | ---help--- |
285 | This is a video4linux driver for the Hexium Gemini frame | 300 | This is a video4linux driver for the Hexium Gemini frame |
286 | grabber card by Hexium. Please note that the Gemini Dual | 301 | grabber card by Hexium. Please note that the Gemini Dual |
@@ -293,7 +308,7 @@ source "drivers/media/video/cx88/Kconfig" | |||
293 | 308 | ||
294 | config VIDEO_OVCAMCHIP | 309 | config VIDEO_OVCAMCHIP |
295 | tristate "OmniVision Camera Chip support" | 310 | tristate "OmniVision Camera Chip support" |
296 | depends on VIDEO_DEV && I2C | 311 | depends on I2C && VIDEO_V4L1 |
297 | ---help--- | 312 | ---help--- |
298 | Support for the OmniVision OV6xxx and OV7xxx series of camera chips. | 313 | Support for the OmniVision OV6xxx and OV7xxx series of camera chips. |
299 | This driver is intended to be used with the ov511 and w9968cf USB | 314 | This driver is intended to be used with the ov511 and w9968cf USB |
@@ -304,7 +319,7 @@ config VIDEO_OVCAMCHIP | |||
304 | 319 | ||
305 | config VIDEO_M32R_AR | 320 | config VIDEO_M32R_AR |
306 | tristate "AR devices" | 321 | tristate "AR devices" |
307 | depends on M32R | 322 | depends on M32R && VIDEO_V4L1 |
308 | ---help--- | 323 | ---help--- |
309 | This is a video4linux driver for the Renesas AR (Artificial Retina) | 324 | This is a video4linux driver for the Renesas AR (Artificial Retina) |
310 | camera module. | 325 | camera module. |
@@ -365,17 +380,17 @@ config VIDEO_WM8739 | |||
365 | source "drivers/media/video/cx25840/Kconfig" | 380 | source "drivers/media/video/cx25840/Kconfig" |
366 | 381 | ||
367 | config VIDEO_SAA711X | 382 | config VIDEO_SAA711X |
368 | tristate "Philips SAA7113/4/5 video decoders" | 383 | tristate "Philips SAA7113/4/5 video decoders (OBSOLETED)" |
369 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 384 | depends on VIDEO_V4L1 && I2C && EXPERIMENTAL |
370 | ---help--- | 385 | ---help--- |
371 | Support for the Philips SAA7113/4/5 video decoders. | 386 | Old support for the Philips SAA7113/4 video decoders. |
372 | 387 | ||
373 | To compile this driver as a module, choose M here: the | 388 | To compile this driver as a module, choose M here: the |
374 | module will be called saa7115. | 389 | module will be called saa7115. |
375 | 390 | ||
376 | config VIDEO_SAA7127 | 391 | config VIDEO_SAA7127 |
377 | tristate "Philips SAA7127/9 digital video encoders" | 392 | tristate "Philips SAA7127/9 digital video encoders" |
378 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 393 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
379 | ---help--- | 394 | ---help--- |
380 | Support for the Philips SAA7127/9 digital video encoders. | 395 | Support for the Philips SAA7127/9 digital video encoders. |
381 | 396 | ||
@@ -384,7 +399,7 @@ config VIDEO_SAA7127 | |||
384 | 399 | ||
385 | config VIDEO_UPD64031A | 400 | config VIDEO_UPD64031A |
386 | tristate "NEC Electronics uPD64031A Ghost Reduction" | 401 | tristate "NEC Electronics uPD64031A Ghost Reduction" |
387 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 402 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
388 | ---help--- | 403 | ---help--- |
389 | Support for the NEC Electronics uPD64031A Ghost Reduction | 404 | Support for the NEC Electronics uPD64031A Ghost Reduction |
390 | video chip. It is most often found in NTSC TV cards made for | 405 | video chip. It is most often found in NTSC TV cards made for |
@@ -396,7 +411,7 @@ config VIDEO_UPD64031A | |||
396 | 411 | ||
397 | config VIDEO_UPD64083 | 412 | config VIDEO_UPD64083 |
398 | tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" | 413 | tristate "NEC Electronics uPD64083 3-Dimensional Y/C separation" |
399 | depends on VIDEO_DEV && I2C && EXPERIMENTAL | 414 | depends on VIDEO_V4L2 && I2C && EXPERIMENTAL |
400 | ---help--- | 415 | ---help--- |
401 | Support for the NEC Electronics uPD64083 3-Dimensional Y/C | 416 | Support for the NEC Electronics uPD64083 3-Dimensional Y/C |
402 | separation video chip. It is used to improve the quality of | 417 | separation video chip. It is used to improve the quality of |
@@ -418,7 +433,7 @@ source "drivers/media/video/em28xx/Kconfig" | |||
418 | 433 | ||
419 | config USB_DSBR | 434 | config USB_DSBR |
420 | tristate "D-Link USB FM radio support (EXPERIMENTAL)" | 435 | tristate "D-Link USB FM radio support (EXPERIMENTAL)" |
421 | depends on USB && VIDEO_DEV && EXPERIMENTAL | 436 | depends on USB && VIDEO_V4L1 && EXPERIMENTAL |
422 | ---help--- | 437 | ---help--- |
423 | Say Y here if you want to connect this type of radio to your | 438 | Say Y here if you want to connect this type of radio to your |
424 | computer's USB port. Note that the audio is not digital, and | 439 | computer's USB port. Note that the audio is not digital, and |
@@ -434,7 +449,7 @@ source "drivers/media/video/et61x251/Kconfig" | |||
434 | 449 | ||
435 | config USB_OV511 | 450 | config USB_OV511 |
436 | tristate "USB OV511 Camera support" | 451 | tristate "USB OV511 Camera support" |
437 | depends on USB && VIDEO_DEV | 452 | depends on USB && VIDEO_V4L1 |
438 | ---help--- | 453 | ---help--- |
439 | Say Y here if you want to connect this type of camera to your | 454 | Say Y here if you want to connect this type of camera to your |
440 | computer's USB port. See <file:Documentation/video4linux/ov511.txt> | 455 | computer's USB port. See <file:Documentation/video4linux/ov511.txt> |
@@ -445,7 +460,7 @@ config USB_OV511 | |||
445 | 460 | ||
446 | config USB_SE401 | 461 | config USB_SE401 |
447 | tristate "USB SE401 Camera support" | 462 | tristate "USB SE401 Camera support" |
448 | depends on USB && VIDEO_DEV | 463 | depends on USB && VIDEO_V4L1 |
449 | ---help--- | 464 | ---help--- |
450 | Say Y here if you want to connect this type of camera to your | 465 | Say Y here if you want to connect this type of camera to your |
451 | computer's USB port. See <file:Documentation/video4linux/se401.txt> | 466 | computer's USB port. See <file:Documentation/video4linux/se401.txt> |
@@ -458,7 +473,7 @@ source "drivers/media/video/sn9c102/Kconfig" | |||
458 | 473 | ||
459 | config USB_STV680 | 474 | config USB_STV680 |
460 | tristate "USB STV680 (Pencam) Camera support" | 475 | tristate "USB STV680 (Pencam) Camera support" |
461 | depends on USB && VIDEO_DEV | 476 | depends on USB && VIDEO_V4L1 |
462 | ---help--- | 477 | ---help--- |
463 | Say Y here if you want to connect this type of camera to your | 478 | Say Y here if you want to connect this type of camera to your |
464 | computer's USB port. This includes the Pencam line of cameras. | 479 | computer's USB port. This includes the Pencam line of cameras. |
@@ -470,7 +485,7 @@ config USB_STV680 | |||
470 | 485 | ||
471 | config USB_W9968CF | 486 | config USB_W9968CF |
472 | tristate "USB W996[87]CF JPEG Dual Mode Camera support" | 487 | tristate "USB W996[87]CF JPEG Dual Mode Camera support" |
473 | depends on USB && VIDEO_DEV && I2C | 488 | depends on USB && VIDEO_V4L1 && I2C |
474 | select VIDEO_OVCAMCHIP | 489 | select VIDEO_OVCAMCHIP |
475 | ---help--- | 490 | ---help--- |
476 | Say Y here if you want support for cameras based on OV681 or | 491 | Say Y here if you want support for cameras based on OV681 or |
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile index b3ea2d63db9b..e5bf2687b76d 100644 --- a/drivers/media/video/Makefile +++ b/drivers/media/video/Makefile | |||
@@ -10,7 +10,11 @@ tuner-objs := tuner-core.o tuner-types.o tuner-simple.o \ | |||
10 | 10 | ||
11 | msp3400-objs := msp3400-driver.o msp3400-kthreads.o | 11 | msp3400-objs := msp3400-driver.o msp3400-kthreads.o |
12 | 12 | ||
13 | obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o v4l1-compat.o compat_ioctl32.o | 13 | obj-$(CONFIG_VIDEO_DEV) += videodev.o v4l2-common.o compat_ioctl32.o |
14 | |||
15 | ifeq ($(CONFIG_VIDEO_V4L1_COMPAT),y) | ||
16 | obj-$(CONFIG_VIDEO_DEV) += v4l1-compat.o | ||
17 | endif | ||
14 | 18 | ||
15 | obj-$(CONFIG_VIDEO_BT848) += bt8xx/ | 19 | obj-$(CONFIG_VIDEO_BT848) += bt8xx/ |
16 | obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o | 20 | obj-$(CONFIG_VIDEO_BT848) += tvaudio.o tda7432.o tda9875.o ir-kbd-i2c.o |
@@ -84,4 +88,8 @@ obj-$(CONFIG_USB_IBMCAM) += usbvideo/ | |||
84 | obj-$(CONFIG_USB_KONICAWC) += usbvideo/ | 88 | obj-$(CONFIG_USB_KONICAWC) += usbvideo/ |
85 | obj-$(CONFIG_USB_VICAM) += usbvideo/ | 89 | obj-$(CONFIG_USB_VICAM) += usbvideo/ |
86 | 90 | ||
91 | obj-$(CONFIG_VIDEO_VIVI) += vivi.o | ||
92 | |||
87 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core | 93 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core |
94 | extra-cflags-$(CONFIG_VIDEO_V4L1_COMPAT) += -DCONFIG_VIDEO_V4L1_COMPAT | ||
95 | |||
diff --git a/drivers/media/video/bt8xx/Kconfig b/drivers/media/video/bt8xx/Kconfig index 085477c12612..153f6a4a96c9 100644 --- a/drivers/media/video/bt8xx/Kconfig +++ b/drivers/media/video/bt8xx/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_BT848 | 1 | config VIDEO_BT848 |
2 | tristate "BT848 Video For Linux" | 2 | tristate "BT848 Video For Linux" |
3 | depends on VIDEO_DEV && PCI && I2C | 3 | depends on VIDEO_DEV && PCI && I2C && VIDEO_V4L2 |
4 | select I2C_ALGOBIT | 4 | select I2C_ALGOBIT |
5 | select FW_LOADER | 5 | select FW_LOADER |
6 | select VIDEO_BTCX | 6 | select VIDEO_BTCX |
diff --git a/drivers/media/video/bt8xx/Makefile b/drivers/media/video/bt8xx/Makefile index db641a36b197..a096a03418aa 100644 --- a/drivers/media/video/bt8xx/Makefile +++ b/drivers/media/video/bt8xx/Makefile | |||
@@ -8,5 +8,5 @@ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ | |||
8 | 8 | ||
9 | obj-$(CONFIG_VIDEO_BT848) += bttv.o | 9 | obj-$(CONFIG_VIDEO_BT848) += bttv.o |
10 | 10 | ||
11 | EXTRA_CFLAGS += -I$(src)/.. | 11 | EXTRA_CFLAGS += -Idrivers/media/video |
12 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core | 12 | EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core |
diff --git a/drivers/media/video/bt8xx/bttv-cards.c b/drivers/media/video/bt8xx/bttv-cards.c index f209a7492051..2b64aa835b42 100644 --- a/drivers/media/video/bt8xx/bttv-cards.c +++ b/drivers/media/video/bt8xx/bttv-cards.c | |||
@@ -2991,13 +2991,13 @@ void __devinit bttv_idcard(struct bttv *btv) | |||
2991 | 2991 | ||
2992 | if (UNSET != audiomux[0]) { | 2992 | if (UNSET != audiomux[0]) { |
2993 | gpiobits = 0; | 2993 | gpiobits = 0; |
2994 | for (i = 0; i < 5; i++) { | 2994 | for (i = 0; i < 4; i++) { |
2995 | bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; | 2995 | bttv_tvcards[btv->c.type].gpiomux[i] = audiomux[i]; |
2996 | gpiobits |= audiomux[i]; | 2996 | gpiobits |= audiomux[i]; |
2997 | } | 2997 | } |
2998 | } else { | 2998 | } else { |
2999 | gpiobits = audioall; | 2999 | gpiobits = audioall; |
3000 | for (i = 0; i < 5; i++) { | 3000 | for (i = 0; i < 4; i++) { |
3001 | bttv_tvcards[btv->c.type].gpiomux[i] = audioall; | 3001 | bttv_tvcards[btv->c.type].gpiomux[i] = audioall; |
3002 | } | 3002 | } |
3003 | } | 3003 | } |
diff --git a/drivers/media/video/bt8xx/bttv-risc.c b/drivers/media/video/bt8xx/bttv-risc.c index 16323a5d68ac..afcfe71e3792 100644 --- a/drivers/media/video/bt8xx/bttv-risc.c +++ b/drivers/media/video/bt8xx/bttv-risc.c | |||
@@ -233,7 +233,7 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
233 | const struct bttv_format *fmt, struct bttv_overlay *ov, | 233 | const struct bttv_format *fmt, struct bttv_overlay *ov, |
234 | int skip_even, int skip_odd) | 234 | int skip_even, int skip_odd) |
235 | { | 235 | { |
236 | int instructions,rc,line,maxy,start,end,skip,nskips; | 236 | int dwords,rc,line,maxy,start,end,skip,nskips; |
237 | struct btcx_skiplist *skips; | 237 | struct btcx_skiplist *skips; |
238 | u32 *rp,ri,ra; | 238 | u32 *rp,ri,ra; |
239 | u32 addr; | 239 | u32 addr; |
@@ -242,12 +242,12 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
242 | if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) | 242 | if (NULL == (skips = kmalloc(sizeof(*skips) * ov->nclips,GFP_KERNEL))) |
243 | return -ENOMEM; | 243 | return -ENOMEM; |
244 | 244 | ||
245 | /* estimate risc mem: worst case is (clip+1) * lines instructions | 245 | /* estimate risc mem: worst case is (1.5*clip+1) * lines instructions |
246 | + sync + jump (all 2 dwords) */ | 246 | + sync + jump (all 2 dwords) */ |
247 | instructions = (ov->nclips + 1) * | 247 | dwords = (3 * ov->nclips + 2) * |
248 | ((skip_even || skip_odd) ? ov->w.height>>1 : ov->w.height); | 248 | ((skip_even || skip_odd) ? (ov->w.height+1)>>1 : ov->w.height); |
249 | instructions += 2; | 249 | dwords += 4; |
250 | if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,instructions*8)) < 0) { | 250 | if ((rc = btcx_riscmem_alloc(btv->c.pci,risc,dwords*4)) < 0) { |
251 | kfree(skips); | 251 | kfree(skips); |
252 | return rc; | 252 | return rc; |
253 | } | 253 | } |
@@ -276,8 +276,6 @@ bttv_risc_overlay(struct bttv *btv, struct btcx_riscmem *risc, | |||
276 | if (line > maxy) | 276 | if (line > maxy) |
277 | btcx_calc_skips(line, ov->w.width, &maxy, | 277 | btcx_calc_skips(line, ov->w.width, &maxy, |
278 | skips, &nskips, ov->clips, ov->nclips); | 278 | skips, &nskips, ov->clips, ov->nclips); |
279 | else | ||
280 | nskips = 0; | ||
281 | 279 | ||
282 | /* write out risc code */ | 280 | /* write out risc code */ |
283 | for (start = 0, skip = 0; start < ov->w.width; start = end) { | 281 | for (start = 0, skip = 0; start < ov->w.width; start = end) { |
diff --git a/drivers/media/video/cx25840/cx25840-firmware.c b/drivers/media/video/cx25840/cx25840-firmware.c index f59ced181c55..1958d4016ea1 100644 --- a/drivers/media/video/cx25840/cx25840-firmware.c +++ b/drivers/media/video/cx25840/cx25840-firmware.c | |||
@@ -39,29 +39,12 @@ | |||
39 | 39 | ||
40 | #define FWDEV(x) &((x)->adapter->dev) | 40 | #define FWDEV(x) &((x)->adapter->dev) |
41 | 41 | ||
42 | static int fastfw = 1; | ||
43 | static char *firmware = FWFILE; | 42 | static char *firmware = FWFILE; |
44 | 43 | ||
45 | module_param(fastfw, bool, 0444); | ||
46 | module_param(firmware, charp, 0444); | 44 | module_param(firmware, charp, 0444); |
47 | 45 | ||
48 | MODULE_PARM_DESC(fastfw, "Load firmware fast [0=100MHz 1=333MHz (default)]"); | ||
49 | MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); | 46 | MODULE_PARM_DESC(firmware, "Firmware image [default: " FWFILE "]"); |
50 | 47 | ||
51 | static void set_i2c_delay(struct i2c_client *client, int delay) | ||
52 | { | ||
53 | struct i2c_algo_bit_data *algod = client->adapter->algo_data; | ||
54 | |||
55 | /* We aren't guaranteed to be using algo_bit, | ||
56 | * so avoid the null pointer dereference | ||
57 | * and disable the 'fast firmware load' */ | ||
58 | if (algod) { | ||
59 | algod->udelay = delay; | ||
60 | } else { | ||
61 | fastfw = 0; | ||
62 | } | ||
63 | } | ||
64 | |||
65 | static void start_fw_load(struct i2c_client *client) | 48 | static void start_fw_load(struct i2c_client *client) |
66 | { | 49 | { |
67 | /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ | 50 | /* DL_ADDR_LB=0 DL_ADDR_HB=0 */ |
@@ -71,16 +54,10 @@ static void start_fw_load(struct i2c_client *client) | |||
71 | cx25840_write(client, 0x803, 0x0b); | 54 | cx25840_write(client, 0x803, 0x0b); |
72 | /* AUTO_INC_DIS=1 */ | 55 | /* AUTO_INC_DIS=1 */ |
73 | cx25840_write(client, 0x000, 0x20); | 56 | cx25840_write(client, 0x000, 0x20); |
74 | |||
75 | if (fastfw) | ||
76 | set_i2c_delay(client, 3); | ||
77 | } | 57 | } |
78 | 58 | ||
79 | static void end_fw_load(struct i2c_client *client) | 59 | static void end_fw_load(struct i2c_client *client) |
80 | { | 60 | { |
81 | if (fastfw) | ||
82 | set_i2c_delay(client, 10); | ||
83 | |||
84 | /* AUTO_INC_DIS=0 */ | 61 | /* AUTO_INC_DIS=0 */ |
85 | cx25840_write(client, 0x000, 0x00); | 62 | cx25840_write(client, 0x000, 0x00); |
86 | /* DL_ENABLE=0 */ | 63 | /* DL_ENABLE=0 */ |
@@ -107,30 +84,8 @@ static int fw_write(struct i2c_client *client, u8 * data, int size) | |||
107 | int sent; | 84 | int sent; |
108 | 85 | ||
109 | if ((sent = i2c_master_send(client, data, size)) < size) { | 86 | if ((sent = i2c_master_send(client, data, size)) < size) { |
110 | 87 | v4l_err(client, "firmware load i2c failure\n"); | |
111 | if (fastfw) { | 88 | return -ENOSYS; |
112 | v4l_err(client, "333MHz i2c firmware load failed\n"); | ||
113 | fastfw = 0; | ||
114 | set_i2c_delay(client, 10); | ||
115 | |||
116 | if (sent > 2) { | ||
117 | u16 dl_addr = cx25840_read(client, 0x801) << 8; | ||
118 | dl_addr |= cx25840_read(client, 0x800); | ||
119 | dl_addr -= sent - 2; | ||
120 | cx25840_write(client, 0x801, dl_addr >> 8); | ||
121 | cx25840_write(client, 0x800, dl_addr & 0xff); | ||
122 | } | ||
123 | |||
124 | if (i2c_master_send(client, data, size) < size) { | ||
125 | v4l_err(client, "100MHz i2c firmware load failed\n"); | ||
126 | return -ENOSYS; | ||
127 | } | ||
128 | |||
129 | } else { | ||
130 | v4l_err(client, "firmware load i2c failure\n"); | ||
131 | return -ENOSYS; | ||
132 | } | ||
133 | |||
134 | } | 89 | } |
135 | 90 | ||
136 | return 0; | 91 | return 0; |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index c7042cf41231..f80154b87d22 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -564,7 +564,7 @@ struct cx88_board cx88_boards[] = { | |||
564 | }, | 564 | }, |
565 | [CX88_BOARD_PCHDTV_HD3000] = { | 565 | [CX88_BOARD_PCHDTV_HD3000] = { |
566 | .name = "pcHDTV HD3000 HDTV", | 566 | .name = "pcHDTV HD3000 HDTV", |
567 | .tuner_type = TUNER_THOMSON_DTT7610, | 567 | .tuner_type = TUNER_THOMSON_DTT761X, |
568 | .radio_type = UNSET, | 568 | .radio_type = UNSET, |
569 | .tuner_addr = ADDR_UNSET, | 569 | .tuner_addr = ADDR_UNSET, |
570 | .radio_addr = ADDR_UNSET, | 570 | .radio_addr = ADDR_UNSET, |
diff --git a/drivers/media/video/cx88/cx88-core.c b/drivers/media/video/cx88/cx88-core.c index 2c3d9f1999be..e1092d5d4628 100644 --- a/drivers/media/video/cx88/cx88-core.c +++ b/drivers/media/video/cx88/cx88-core.c | |||
@@ -146,9 +146,11 @@ int cx88_risc_buffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
146 | fields++; | 146 | fields++; |
147 | 147 | ||
148 | /* estimate risc mem: worst case is one write per page border + | 148 | /* estimate risc mem: worst case is one write per page border + |
149 | one write per scan line + syncs + jump (all 2 dwords) */ | 149 | one write per scan line + syncs + jump (all 2 dwords). Padding |
150 | instructions = (bpl * lines * fields) / PAGE_SIZE + lines * fields; | 150 | can cause next bpl to start close to a page border. First DMA |
151 | instructions += 3 + 4; | 151 | region may be smaller than PAGE_SIZE */ |
152 | instructions = fields * (1 + ((bpl + padding) * lines) / PAGE_SIZE + lines); | ||
153 | instructions += 2; | ||
152 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) | 154 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) |
153 | return rc; | 155 | return rc; |
154 | 156 | ||
@@ -176,9 +178,11 @@ int cx88_risc_databuffer(struct pci_dev *pci, struct btcx_riscmem *risc, | |||
176 | int rc; | 178 | int rc; |
177 | 179 | ||
178 | /* estimate risc mem: worst case is one write per page border + | 180 | /* estimate risc mem: worst case is one write per page border + |
179 | one write per scan line + syncs + jump (all 2 dwords) */ | 181 | one write per scan line + syncs + jump (all 2 dwords). Here |
180 | instructions = (bpl * lines) / PAGE_SIZE + lines; | 182 | there is no padding and no sync. First DMA region may be smaller |
181 | instructions += 3 + 4; | 183 | than PAGE_SIZE */ |
184 | instructions = 1 + (bpl * lines) / PAGE_SIZE + lines; | ||
185 | instructions += 1; | ||
182 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) | 186 | if ((rc = btcx_riscmem_alloc(pci,risc,instructions*8)) < 0) |
183 | return rc; | 187 | return rc; |
184 | 188 | ||
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index f0ea9b5cdbc2..3619a449aefd 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -372,7 +372,7 @@ static int or51132_set_ts_param(struct dvb_frontend* fe, | |||
372 | static struct or51132_config pchdtv_hd3000 = { | 372 | static struct or51132_config pchdtv_hd3000 = { |
373 | .demod_address = 0x15, | 373 | .demod_address = 0x15, |
374 | .pll_address = 0x61, | 374 | .pll_address = 0x61, |
375 | .pll_desc = &dvb_pll_thomson_dtt7610, | 375 | .pll_desc = &dvb_pll_thomson_dtt761x, |
376 | .set_ts_params = or51132_set_ts_param, | 376 | .set_ts_params = or51132_set_ts_param, |
377 | }; | 377 | }; |
378 | #endif | 378 | #endif |
diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 72a417b31745..694d1d80ff3f 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c | |||
@@ -35,8 +35,10 @@ | |||
35 | #include "cx88.h" | 35 | #include "cx88.h" |
36 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
37 | 37 | ||
38 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
38 | /* Include V4L1 specific functions. Should be removed soon */ | 39 | /* Include V4L1 specific functions. Should be removed soon */ |
39 | #include <linux/videodev.h> | 40 | #include <linux/videodev.h> |
41 | #endif | ||
40 | 42 | ||
41 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); | 43 | MODULE_DESCRIPTION("v4l2 driver module for cx2388x based TV cards"); |
42 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 44 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
diff --git a/drivers/media/video/em28xx/Kconfig b/drivers/media/video/em28xx/Kconfig index 5a793ae7cc23..dfb15bfb83dc 100644 --- a/drivers/media/video/em28xx/Kconfig +++ b/drivers/media/video/em28xx/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config VIDEO_EM28XX | 1 | config VIDEO_EM28XX |
2 | tristate "Empia EM2800/2820/2840 USB video capture support" | 2 | tristate "Empia EM2800/2820/2840 USB video capture support" |
3 | depends on VIDEO_DEV && USB && I2C | 3 | depends on VIDEO_V4L1 && USB && I2C |
4 | select VIDEO_BUF | 4 | select VIDEO_BUF |
5 | select VIDEO_TUNER | 5 | select VIDEO_TUNER |
6 | select VIDEO_TVEEPROM | 6 | select VIDEO_TVEEPROM |
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index ddc92cbb5276..cf7cdf9ef617 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1576,8 +1576,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1576 | errCode = em28xx_config(dev); | 1576 | errCode = em28xx_config(dev); |
1577 | if (errCode) { | 1577 | if (errCode) { |
1578 | em28xx_errdev("error configuring device\n"); | 1578 | em28xx_errdev("error configuring device\n"); |
1579 | kfree(dev); | ||
1580 | em28xx_devused&=~(1<<dev->devno); | 1579 | em28xx_devused&=~(1<<dev->devno); |
1580 | kfree(dev); | ||
1581 | return -ENOMEM; | 1581 | return -ENOMEM; |
1582 | } | 1582 | } |
1583 | 1583 | ||
@@ -1603,8 +1603,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1603 | dev->vdev = video_device_alloc(); | 1603 | dev->vdev = video_device_alloc(); |
1604 | if (NULL == dev->vdev) { | 1604 | if (NULL == dev->vdev) { |
1605 | em28xx_errdev("cannot allocate video_device.\n"); | 1605 | em28xx_errdev("cannot allocate video_device.\n"); |
1606 | kfree(dev); | ||
1607 | em28xx_devused&=~(1<<dev->devno); | 1606 | em28xx_devused&=~(1<<dev->devno); |
1607 | kfree(dev); | ||
1608 | return -ENOMEM; | 1608 | return -ENOMEM; |
1609 | } | 1609 | } |
1610 | 1610 | ||
@@ -1612,8 +1612,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1612 | if (NULL == dev->vbi_dev) { | 1612 | if (NULL == dev->vbi_dev) { |
1613 | em28xx_errdev("cannot allocate video_device.\n"); | 1613 | em28xx_errdev("cannot allocate video_device.\n"); |
1614 | kfree(dev->vdev); | 1614 | kfree(dev->vdev); |
1615 | kfree(dev); | ||
1616 | em28xx_devused&=~(1<<dev->devno); | 1615 | em28xx_devused&=~(1<<dev->devno); |
1616 | kfree(dev); | ||
1617 | return -ENOMEM; | 1617 | return -ENOMEM; |
1618 | } | 1618 | } |
1619 | 1619 | ||
@@ -1650,8 +1650,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1650 | mutex_unlock(&dev->lock); | 1650 | mutex_unlock(&dev->lock); |
1651 | list_del(&dev->devlist); | 1651 | list_del(&dev->devlist); |
1652 | video_device_release(dev->vdev); | 1652 | video_device_release(dev->vdev); |
1653 | kfree(dev); | ||
1654 | em28xx_devused&=~(1<<dev->devno); | 1653 | em28xx_devused&=~(1<<dev->devno); |
1654 | kfree(dev); | ||
1655 | return -ENODEV; | 1655 | return -ENODEV; |
1656 | } | 1656 | } |
1657 | 1657 | ||
@@ -1662,8 +1662,8 @@ static int em28xx_init_dev(struct em28xx **devhandle, struct usb_device *udev, | |||
1662 | list_del(&dev->devlist); | 1662 | list_del(&dev->devlist); |
1663 | video_device_release(dev->vbi_dev); | 1663 | video_device_release(dev->vbi_dev); |
1664 | video_device_release(dev->vdev); | 1664 | video_device_release(dev->vdev); |
1665 | kfree(dev); | ||
1666 | em28xx_devused&=~(1<<dev->devno); | 1665 | em28xx_devused&=~(1<<dev->devno); |
1666 | kfree(dev); | ||
1667 | return -ENODEV; | 1667 | return -ENODEV; |
1668 | } else { | 1668 | } else { |
1669 | printk("registered VBI\n"); | 1669 | printk("registered VBI\n"); |
diff --git a/drivers/media/video/et61x251/Kconfig b/drivers/media/video/et61x251/Kconfig index 6c43a90c6569..c6bff705688d 100644 --- a/drivers/media/video/et61x251/Kconfig +++ b/drivers/media/video/et61x251/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_ET61X251 | 1 | config USB_ET61X251 |
2 | tristate "USB ET61X[12]51 PC Camera Controller support" | 2 | tristate "USB ET61X[12]51 PC Camera Controller support" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on Etoms ET61X151 | 5 | Say Y here if you want support for cameras based on Etoms ET61X151 |
6 | or ET61X251 PC Camera Controllers. | 6 | or ET61X251 PC Camera Controllers. |
diff --git a/drivers/media/video/pwc/Kconfig b/drivers/media/video/pwc/Kconfig index 86376556f108..53cbc950f95c 100644 --- a/drivers/media/video/pwc/Kconfig +++ b/drivers/media/video/pwc/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_PWC | 1 | config USB_PWC |
2 | tristate "USB Philips Cameras" | 2 | tristate "USB Philips Cameras" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y or M here if you want to use one of these Philips & OEM | 5 | Say Y or M here if you want to use one of these Philips & OEM |
6 | webcams: | 6 | webcams: |
diff --git a/drivers/media/video/pwc/Makefile b/drivers/media/video/pwc/Makefile index 8326684f49f3..33d60126c024 100644 --- a/drivers/media/video/pwc/Makefile +++ b/drivers/media/video/pwc/Makefile | |||
@@ -1,20 +1,3 @@ | |||
1 | ifneq ($(KERNELRELEASE),) | ||
2 | |||
3 | pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o | 1 | pwc-objs := pwc-if.o pwc-misc.o pwc-ctrl.o pwc-uncompress.o pwc-timon.o pwc-kiara.o |
4 | 2 | ||
5 | obj-$(CONFIG_USB_PWC) += pwc.o | 3 | obj-$(CONFIG_USB_PWC) += pwc.o |
6 | |||
7 | else | ||
8 | |||
9 | KDIR := /lib/modules/$(shell uname -r)/build | ||
10 | PWD := $(shell pwd) | ||
11 | |||
12 | default: | ||
13 | $(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules | ||
14 | |||
15 | endif | ||
16 | |||
17 | clean: | ||
18 | rm -f *.[oas] .*.flags *.ko .*.cmd .*.d .*.tmp *.mod.c | ||
19 | rm -rf .tmp_versions | ||
20 | |||
diff --git a/drivers/media/video/saa7127.c b/drivers/media/video/saa7127.c index 133f9e5252fe..c271e2e14105 100644 --- a/drivers/media/video/saa7127.c +++ b/drivers/media/video/saa7127.c | |||
@@ -142,6 +142,7 @@ struct i2c_reg_value { | |||
142 | static const struct i2c_reg_value saa7129_init_config_extra[] = { | 142 | static const struct i2c_reg_value saa7129_init_config_extra[] = { |
143 | { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, | 143 | { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x38 }, |
144 | { SAA7127_REG_VTRIG, 0xfa }, | 144 | { SAA7127_REG_VTRIG, 0xfa }, |
145 | { 0, 0 } | ||
145 | }; | 146 | }; |
146 | 147 | ||
147 | static const struct i2c_reg_value saa7127_init_config_common[] = { | 148 | static const struct i2c_reg_value saa7127_init_config_common[] = { |
diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index e666a4465ca4..86eae3528330 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c | |||
@@ -3504,6 +3504,7 @@ int saa7134_board_init1(struct saa7134_dev *dev) | |||
3504 | /* power-up tuner chip */ | 3504 | /* power-up tuner chip */ |
3505 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); | 3505 | saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); |
3506 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); | 3506 | saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); |
3507 | break; | ||
3507 | case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: | 3508 | case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: |
3508 | /* this turns the remote control chip off to work around a bug in it */ | 3509 | /* this turns the remote control chip off to work around a bug in it */ |
3509 | saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); | 3510 | saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); |
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 13de05532e0a..f0c2111f14ad 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -548,6 +548,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
548 | if (report & SAA7134_IRQ_REPORT_GPIO16) { | 548 | if (report & SAA7134_IRQ_REPORT_GPIO16) { |
549 | switch (dev->has_remote) { | 549 | switch (dev->has_remote) { |
550 | case SAA7134_REMOTE_GPIO: | 550 | case SAA7134_REMOTE_GPIO: |
551 | if (!dev->remote) | ||
552 | break; | ||
551 | if (dev->remote->mask_keydown & 0x10000) { | 553 | if (dev->remote->mask_keydown & 0x10000) { |
552 | saa7134_input_irq(dev); | 554 | saa7134_input_irq(dev); |
553 | } | 555 | } |
@@ -564,6 +566,8 @@ static irqreturn_t saa7134_irq(int irq, void *dev_id, struct pt_regs *regs) | |||
564 | if (report & SAA7134_IRQ_REPORT_GPIO18) { | 566 | if (report & SAA7134_IRQ_REPORT_GPIO18) { |
565 | switch (dev->has_remote) { | 567 | switch (dev->has_remote) { |
566 | case SAA7134_REMOTE_GPIO: | 568 | case SAA7134_REMOTE_GPIO: |
569 | if (!dev->remote) | ||
570 | break; | ||
567 | if ((dev->remote->mask_keydown & 0x40000) || | 571 | if ((dev->remote->mask_keydown & 0x40000) || |
568 | (dev->remote->mask_keyup & 0x40000)) { | 572 | (dev->remote->mask_keyup & 0x40000)) { |
569 | saa7134_input_irq(dev); | 573 | saa7134_input_irq(dev); |
@@ -676,7 +680,7 @@ static int saa7134_hwinit2(struct saa7134_dev *dev) | |||
676 | SAA7134_IRQ2_INTE_PE | | 680 | SAA7134_IRQ2_INTE_PE | |
677 | SAA7134_IRQ2_INTE_AR; | 681 | SAA7134_IRQ2_INTE_AR; |
678 | 682 | ||
679 | if (dev->has_remote == SAA7134_REMOTE_GPIO) { | 683 | if (dev->has_remote == SAA7134_REMOTE_GPIO && dev->remote) { |
680 | if (dev->remote->mask_keydown & 0x10000) | 684 | if (dev->remote->mask_keydown & 0x10000) |
681 | irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; | 685 | irq2_mask |= SAA7134_IRQ2_INTE_GPIO16; |
682 | else if (dev->remote->mask_keydown & 0x40000) | 686 | else if (dev->remote->mask_keydown & 0x40000) |
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index aeef80f88a6b..e4156ec9c6d7 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -31,8 +31,10 @@ | |||
31 | #include "saa7134.h" | 31 | #include "saa7134.h" |
32 | #include <media/v4l2-common.h> | 32 | #include <media/v4l2-common.h> |
33 | 33 | ||
34 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
34 | /* Include V4L1 specific functions. Should be removed soon */ | 35 | /* Include V4L1 specific functions. Should be removed soon */ |
35 | #include <linux/videodev.h> | 36 | #include <linux/videodev.h> |
37 | #endif | ||
36 | 38 | ||
37 | /* ------------------------------------------------------------------ */ | 39 | /* ------------------------------------------------------------------ */ |
38 | 40 | ||
diff --git a/drivers/media/video/sn9c102/Kconfig b/drivers/media/video/sn9c102/Kconfig index 55f2bc11964b..cf552e6b8ecf 100644 --- a/drivers/media/video/sn9c102/Kconfig +++ b/drivers/media/video/sn9c102/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_SN9C102 | 1 | config USB_SN9C102 |
2 | tristate "USB SN9C10x PC Camera Controller support" | 2 | tristate "USB SN9C10x PC Camera Controller support" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on SONiX SN9C101, | 5 | Say Y here if you want support for cameras based on SONiX SN9C101, |
6 | SN9C102 or SN9C103 PC Camera Controllers. | 6 | SN9C102 or SN9C103 PC Camera Controllers. |
diff --git a/drivers/media/video/tuner-types.c b/drivers/media/video/tuner-types.c index 72e0f01db563..a1ae036b44ec 100644 --- a/drivers/media/video/tuner-types.c +++ b/drivers/media/video/tuner-types.c | |||
@@ -877,8 +877,8 @@ static struct tuner_params tuner_philips_fmd1216me_mk3_params[] = { | |||
877 | /* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ | 877 | /* ------------ TUNER_LG_TDVS_H062F - INFINEON ATSC ------------ */ |
878 | 878 | ||
879 | static struct tuner_range tuner_tua6034_ntsc_ranges[] = { | 879 | static struct tuner_range tuner_tua6034_ntsc_ranges[] = { |
880 | { 16 * 160.00 /*MHz*/, 0x8e, 0x01 }, | 880 | { 16 * 165.00 /*MHz*/, 0x8e, 0x01 }, |
881 | { 16 * 455.00 /*MHz*/, 0x8e, 0x02 }, | 881 | { 16 * 450.00 /*MHz*/, 0x8e, 0x02 }, |
882 | { 16 * 999.99 , 0x8e, 0x04 }, | 882 | { 16 * 999.99 , 0x8e, 0x04 }, |
883 | }; | 883 | }; |
884 | 884 | ||
diff --git a/drivers/media/video/tveeprom.c b/drivers/media/video/tveeprom.c index 431c3e2f6c42..b463e996961a 100644 --- a/drivers/media/video/tveeprom.c +++ b/drivers/media/video/tveeprom.c | |||
@@ -218,7 +218,7 @@ hauppauge_tuner[] = | |||
218 | /* 110-119 */ | 218 | /* 110-119 */ |
219 | { TUNER_ABSENT, "Thompson DTT75105"}, | 219 | { TUNER_ABSENT, "Thompson DTT75105"}, |
220 | { TUNER_ABSENT, "Conexant_CX24109"}, | 220 | { TUNER_ABSENT, "Conexant_CX24109"}, |
221 | { TUNER_ABSENT, "TCL M2523_5N_E"}, | 221 | { TUNER_TCL_2002N, "TCL M2523_5N_E"}, |
222 | { TUNER_ABSENT, "TCL M2523_3DB_E"}, | 222 | { TUNER_ABSENT, "TCL M2523_3DB_E"}, |
223 | { TUNER_ABSENT, "Philips 8275A"}, | 223 | { TUNER_ABSENT, "Philips 8275A"}, |
224 | { TUNER_ABSENT, "Microtune MT2060"}, | 224 | { TUNER_ABSENT, "Microtune MT2060"}, |
diff --git a/drivers/media/video/usbvideo/Kconfig b/drivers/media/video/usbvideo/Kconfig index 08a5d20bb2c0..39269a2c5635 100644 --- a/drivers/media/video/usbvideo/Kconfig +++ b/drivers/media/video/usbvideo/Kconfig | |||
@@ -3,7 +3,7 @@ config VIDEO_USBVIDEO | |||
3 | 3 | ||
4 | config USB_VICAM | 4 | config USB_VICAM |
5 | tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" | 5 | tristate "USB 3com HomeConnect (aka vicam) support (EXPERIMENTAL)" |
6 | depends on USB && VIDEO_DEV && EXPERIMENTAL | 6 | depends on USB && VIDEO_V4L1 && EXPERIMENTAL |
7 | select VIDEO_USBVIDEO | 7 | select VIDEO_USBVIDEO |
8 | ---help--- | 8 | ---help--- |
9 | Say Y here if you have 3com homeconnect camera (vicam). | 9 | Say Y here if you have 3com homeconnect camera (vicam). |
@@ -13,7 +13,7 @@ config USB_VICAM | |||
13 | 13 | ||
14 | config USB_IBMCAM | 14 | config USB_IBMCAM |
15 | tristate "USB IBM (Xirlink) C-it Camera support" | 15 | tristate "USB IBM (Xirlink) C-it Camera support" |
16 | depends on USB && VIDEO_DEV | 16 | depends on USB && VIDEO_V4L1 |
17 | select VIDEO_USBVIDEO | 17 | select VIDEO_USBVIDEO |
18 | ---help--- | 18 | ---help--- |
19 | Say Y here if you want to connect a IBM "C-It" camera, also known as | 19 | Say Y here if you want to connect a IBM "C-It" camera, also known as |
@@ -28,7 +28,7 @@ config USB_IBMCAM | |||
28 | 28 | ||
29 | config USB_KONICAWC | 29 | config USB_KONICAWC |
30 | tristate "USB Konica Webcam support" | 30 | tristate "USB Konica Webcam support" |
31 | depends on USB && VIDEO_DEV | 31 | depends on USB && VIDEO_V4L1 |
32 | select VIDEO_USBVIDEO | 32 | select VIDEO_USBVIDEO |
33 | ---help--- | 33 | ---help--- |
34 | Say Y here if you want support for webcams based on a Konica | 34 | Say Y here if you want support for webcams based on a Konica |
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 5e813404d068..779db26771c0 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -26,6 +26,11 @@ | |||
26 | #include <linux/random.h> | 26 | #include <linux/random.h> |
27 | #include <linux/version.h> | 27 | #include <linux/version.h> |
28 | #include <linux/videodev2.h> | 28 | #include <linux/videodev2.h> |
29 | #include <linux/dma-mapping.h> | ||
30 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
31 | /* Include V4L1 specific functions. Should be removed soon */ | ||
32 | #include <linux/videodev.h> | ||
33 | #endif | ||
29 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
30 | #include <media/video-buf.h> | 35 | #include <media/video-buf.h> |
31 | #include <media/v4l2-common.h> | 36 | #include <media/v4l2-common.h> |
diff --git a/drivers/media/video/zc0301/Kconfig b/drivers/media/video/zc0301/Kconfig index c3bf886b80cd..115833e4f4dd 100644 --- a/drivers/media/video/zc0301/Kconfig +++ b/drivers/media/video/zc0301/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config USB_ZC0301 | 1 | config USB_ZC0301 |
2 | tristate "USB ZC0301 Image Processor and Control Chip support" | 2 | tristate "USB ZC0301 Image Processor and Control Chip support" |
3 | depends on USB && VIDEO_DEV | 3 | depends on USB && VIDEO_V4L1 |
4 | ---help--- | 4 | ---help--- |
5 | Say Y here if you want support for cameras based on the ZC0301 | 5 | Say Y here if you want support for cameras based on the ZC0301 |
6 | Image Processor and Control Chip. | 6 | Image Processor and Control Chip. |
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 266414ca2814..9080853fe283 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -1189,7 +1189,6 @@ mpt_attach(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1189 | ioc->diagPending = 0; | 1189 | ioc->diagPending = 0; |
1190 | spin_lock_init(&ioc->diagLock); | 1190 | spin_lock_init(&ioc->diagLock); |
1191 | spin_lock_init(&ioc->fc_rescan_work_lock); | 1191 | spin_lock_init(&ioc->fc_rescan_work_lock); |
1192 | spin_lock_init(&ioc->fc_rport_lock); | ||
1193 | spin_lock_init(&ioc->initializing_hba_lock); | 1192 | spin_lock_init(&ioc->initializing_hba_lock); |
1194 | 1193 | ||
1195 | /* Initialize the event logging. | 1194 | /* Initialize the event logging. |
@@ -5736,11 +5735,13 @@ mpt_HardResetHandler(MPT_ADAPTER *ioc, int sleepFlag) | |||
5736 | return rc; | 5735 | return rc; |
5737 | } | 5736 | } |
5738 | 5737 | ||
5738 | # define EVENT_DESCR_STR_SZ 100 | ||
5739 | |||
5739 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5740 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
5740 | static void | 5741 | static void |
5741 | EventDescriptionStr(u8 event, u32 evData0, char *evStr) | 5742 | EventDescriptionStr(u8 event, u32 evData0, char *evStr) |
5742 | { | 5743 | { |
5743 | char *ds; | 5744 | char *ds = NULL; |
5744 | 5745 | ||
5745 | switch(event) { | 5746 | switch(event) { |
5746 | case MPI_EVENT_NONE: | 5747 | case MPI_EVENT_NONE: |
@@ -5777,9 +5778,9 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5777 | if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP) | 5778 | if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LIP) |
5778 | ds = "Loop State(LIP) Change"; | 5779 | ds = "Loop State(LIP) Change"; |
5779 | else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE) | 5780 | else if (evData0 == MPI_EVENT_LOOP_STATE_CHANGE_LPE) |
5780 | ds = "Loop State(LPE) Change"; /* ??? */ | 5781 | ds = "Loop State(LPE) Change"; /* ??? */ |
5781 | else | 5782 | else |
5782 | ds = "Loop State(LPB) Change"; /* ??? */ | 5783 | ds = "Loop State(LPB) Change"; /* ??? */ |
5783 | break; | 5784 | break; |
5784 | case MPI_EVENT_LOGOUT: | 5785 | case MPI_EVENT_LOGOUT: |
5785 | ds = "Logout"; | 5786 | ds = "Logout"; |
@@ -5841,27 +5842,32 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5841 | break; | 5842 | break; |
5842 | case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: | 5843 | case MPI_EVENT_SAS_DEVICE_STATUS_CHANGE: |
5843 | { | 5844 | { |
5844 | char buf[50]; | ||
5845 | u8 id = (u8)(evData0); | 5845 | u8 id = (u8)(evData0); |
5846 | u8 ReasonCode = (u8)(evData0 >> 16); | 5846 | u8 ReasonCode = (u8)(evData0 >> 16); |
5847 | switch (ReasonCode) { | 5847 | switch (ReasonCode) { |
5848 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: | 5848 | case MPI_EVENT_SAS_DEV_STAT_RC_ADDED: |
5849 | sprintf(buf,"SAS Device Status Change: Added: id=%d", id); | 5849 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5850 | "SAS Device Status Change: Added: id=%d", id); | ||
5850 | break; | 5851 | break; |
5851 | case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: | 5852 | case MPI_EVENT_SAS_DEV_STAT_RC_NOT_RESPONDING: |
5852 | sprintf(buf,"SAS Device Status Change: Deleted: id=%d", id); | 5853 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5854 | "SAS Device Status Change: Deleted: id=%d", id); | ||
5853 | break; | 5855 | break; |
5854 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: | 5856 | case MPI_EVENT_SAS_DEV_STAT_RC_SMART_DATA: |
5855 | sprintf(buf,"SAS Device Status Change: SMART Data: id=%d", id); | 5857 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5858 | "SAS Device Status Change: SMART Data: id=%d", | ||
5859 | id); | ||
5856 | break; | 5860 | break; |
5857 | case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: | 5861 | case MPI_EVENT_SAS_DEV_STAT_RC_NO_PERSIST_ADDED: |
5858 | sprintf(buf,"SAS Device Status Change: No Persistancy Added: id=%d", id); | 5862 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5863 | "SAS Device Status Change: No Persistancy " | ||
5864 | "Added: id=%d", id); | ||
5859 | break; | 5865 | break; |
5860 | default: | 5866 | default: |
5861 | sprintf(buf,"SAS Device Status Change: Unknown: id=%d", id); | 5867 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5862 | break; | 5868 | "SAS Device Status Change: Unknown: id=%d", id); |
5869 | break; | ||
5863 | } | 5870 | } |
5864 | ds = buf; | ||
5865 | break; | 5871 | break; |
5866 | } | 5872 | } |
5867 | case MPI_EVENT_ON_BUS_TIMER_EXPIRED: | 5873 | case MPI_EVENT_ON_BUS_TIMER_EXPIRED: |
@@ -5878,41 +5884,46 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5878 | break; | 5884 | break; |
5879 | case MPI_EVENT_SAS_PHY_LINK_STATUS: | 5885 | case MPI_EVENT_SAS_PHY_LINK_STATUS: |
5880 | { | 5886 | { |
5881 | char buf[50]; | ||
5882 | u8 LinkRates = (u8)(evData0 >> 8); | 5887 | u8 LinkRates = (u8)(evData0 >> 8); |
5883 | u8 PhyNumber = (u8)(evData0); | 5888 | u8 PhyNumber = (u8)(evData0); |
5884 | LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >> | 5889 | LinkRates = (LinkRates & MPI_EVENT_SAS_PLS_LR_CURRENT_MASK) >> |
5885 | MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT; | 5890 | MPI_EVENT_SAS_PLS_LR_CURRENT_SHIFT; |
5886 | switch (LinkRates) { | 5891 | switch (LinkRates) { |
5887 | case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN: | 5892 | case MPI_EVENT_SAS_PLS_LR_RATE_UNKNOWN: |
5888 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5893 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5894 | "SAS PHY Link Status: Phy=%d:" | ||
5889 | " Rate Unknown",PhyNumber); | 5895 | " Rate Unknown",PhyNumber); |
5890 | break; | 5896 | break; |
5891 | case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED: | 5897 | case MPI_EVENT_SAS_PLS_LR_RATE_PHY_DISABLED: |
5892 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5898 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5899 | "SAS PHY Link Status: Phy=%d:" | ||
5893 | " Phy Disabled",PhyNumber); | 5900 | " Phy Disabled",PhyNumber); |
5894 | break; | 5901 | break; |
5895 | case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION: | 5902 | case MPI_EVENT_SAS_PLS_LR_RATE_FAILED_SPEED_NEGOTIATION: |
5896 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5903 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5904 | "SAS PHY Link Status: Phy=%d:" | ||
5897 | " Failed Speed Nego",PhyNumber); | 5905 | " Failed Speed Nego",PhyNumber); |
5898 | break; | 5906 | break; |
5899 | case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE: | 5907 | case MPI_EVENT_SAS_PLS_LR_RATE_SATA_OOB_COMPLETE: |
5900 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5908 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5909 | "SAS PHY Link Status: Phy=%d:" | ||
5901 | " Sata OOB Completed",PhyNumber); | 5910 | " Sata OOB Completed",PhyNumber); |
5902 | break; | 5911 | break; |
5903 | case MPI_EVENT_SAS_PLS_LR_RATE_1_5: | 5912 | case MPI_EVENT_SAS_PLS_LR_RATE_1_5: |
5904 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5913 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5914 | "SAS PHY Link Status: Phy=%d:" | ||
5905 | " Rate 1.5 Gbps",PhyNumber); | 5915 | " Rate 1.5 Gbps",PhyNumber); |
5906 | break; | 5916 | break; |
5907 | case MPI_EVENT_SAS_PLS_LR_RATE_3_0: | 5917 | case MPI_EVENT_SAS_PLS_LR_RATE_3_0: |
5908 | sprintf(buf,"SAS PHY Link Status: Phy=%d:" | 5918 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5919 | "SAS PHY Link Status: Phy=%d:" | ||
5909 | " Rate 3.0 Gpbs",PhyNumber); | 5920 | " Rate 3.0 Gpbs",PhyNumber); |
5910 | break; | 5921 | break; |
5911 | default: | 5922 | default: |
5912 | sprintf(buf,"SAS PHY Link Status: Phy=%d", PhyNumber); | 5923 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5924 | "SAS PHY Link Status: Phy=%d", PhyNumber); | ||
5913 | break; | 5925 | break; |
5914 | } | 5926 | } |
5915 | ds = buf; | ||
5916 | break; | 5927 | break; |
5917 | } | 5928 | } |
5918 | case MPI_EVENT_SAS_DISCOVERY_ERROR: | 5929 | case MPI_EVENT_SAS_DISCOVERY_ERROR: |
@@ -5921,9 +5932,8 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5921 | case MPI_EVENT_IR_RESYNC_UPDATE: | 5932 | case MPI_EVENT_IR_RESYNC_UPDATE: |
5922 | { | 5933 | { |
5923 | u8 resync_complete = (u8)(evData0 >> 16); | 5934 | u8 resync_complete = (u8)(evData0 >> 16); |
5924 | char buf[40]; | 5935 | snprintf(evStr, EVENT_DESCR_STR_SZ, |
5925 | sprintf(buf,"IR Resync Update: Complete = %d:",resync_complete); | 5936 | "IR Resync Update: Complete = %d:",resync_complete); |
5926 | ds = buf; | ||
5927 | break; | 5937 | break; |
5928 | } | 5938 | } |
5929 | case MPI_EVENT_IR2: | 5939 | case MPI_EVENT_IR2: |
@@ -5976,7 +5986,8 @@ EventDescriptionStr(u8 event, u32 evData0, char *evStr) | |||
5976 | ds = "Unknown"; | 5986 | ds = "Unknown"; |
5977 | break; | 5987 | break; |
5978 | } | 5988 | } |
5979 | strcpy(evStr,ds); | 5989 | if (ds) |
5990 | strncpy(evStr, ds, EVENT_DESCR_STR_SZ); | ||
5980 | } | 5991 | } |
5981 | 5992 | ||
5982 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 5993 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
@@ -5998,7 +6009,7 @@ ProcessEventNotification(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply | |||
5998 | int ii; | 6009 | int ii; |
5999 | int r = 0; | 6010 | int r = 0; |
6000 | int handlers = 0; | 6011 | int handlers = 0; |
6001 | char evStr[100]; | 6012 | char evStr[EVENT_DESCR_STR_SZ]; |
6002 | u8 event; | 6013 | u8 event; |
6003 | 6014 | ||
6004 | /* | 6015 | /* |
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h index be7e8501b53c..f673cca507e1 100644 --- a/drivers/message/fusion/mptbase.h +++ b/drivers/message/fusion/mptbase.h | |||
@@ -76,8 +76,8 @@ | |||
76 | #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR | 76 | #define COPYRIGHT "Copyright (c) 1999-2005 " MODULEAUTHOR |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | #define MPT_LINUX_VERSION_COMMON "3.03.08" | 79 | #define MPT_LINUX_VERSION_COMMON "3.03.09" |
80 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.08" | 80 | #define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-3.03.09" |
81 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" | 81 | #define WHAT_MAGIC_STRING "@" "(" "#" ")" |
82 | 82 | ||
83 | #define show_mptmod_ver(s,ver) \ | 83 | #define show_mptmod_ver(s,ver) \ |
@@ -489,7 +489,6 @@ typedef struct _RaidCfgData { | |||
489 | 489 | ||
490 | #define MPT_RPORT_INFO_FLAGS_REGISTERED 0x01 /* rport registered */ | 490 | #define MPT_RPORT_INFO_FLAGS_REGISTERED 0x01 /* rport registered */ |
491 | #define MPT_RPORT_INFO_FLAGS_MISSING 0x02 /* missing from DevPage0 scan */ | 491 | #define MPT_RPORT_INFO_FLAGS_MISSING 0x02 /* missing from DevPage0 scan */ |
492 | #define MPT_RPORT_INFO_FLAGS_MAPPED_VDEV 0x04 /* target mapped in vdev */ | ||
493 | 492 | ||
494 | /* | 493 | /* |
495 | * data allocated for each fc rport device | 494 | * data allocated for each fc rport device |
@@ -501,7 +500,6 @@ struct mptfc_rport_info | |||
501 | struct scsi_target *starget; | 500 | struct scsi_target *starget; |
502 | FCDevicePage0_t pg0; | 501 | FCDevicePage0_t pg0; |
503 | u8 flags; | 502 | u8 flags; |
504 | u8 remap_needed; | ||
505 | }; | 503 | }; |
506 | 504 | ||
507 | /* | 505 | /* |
@@ -628,11 +626,11 @@ typedef struct _MPT_ADAPTER | |||
628 | struct work_struct mptscsih_persistTask; | 626 | struct work_struct mptscsih_persistTask; |
629 | 627 | ||
630 | struct list_head fc_rports; | 628 | struct list_head fc_rports; |
631 | spinlock_t fc_rport_lock; /* list and ri flags */ | ||
632 | spinlock_t fc_rescan_work_lock; | 629 | spinlock_t fc_rescan_work_lock; |
633 | int fc_rescan_work_count; | 630 | int fc_rescan_work_count; |
634 | struct work_struct fc_rescan_work; | 631 | struct work_struct fc_rescan_work; |
635 | 632 | char fc_rescan_work_q_name[KOBJ_NAME_LEN]; | |
633 | struct workqueue_struct *fc_rescan_work_q; | ||
636 | } MPT_ADAPTER; | 634 | } MPT_ADAPTER; |
637 | 635 | ||
638 | /* | 636 | /* |
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index b343f2a68b1c..856487741ef4 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -341,9 +341,6 @@ mptfc_generate_rport_ids(FCDevicePage0_t *pg0, struct fc_rport_identifiers *rid) | |||
341 | rid->port_name = ((u64)pg0->WWPN.High) << 32 | (u64)pg0->WWPN.Low; | 341 | rid->port_name = ((u64)pg0->WWPN.High) << 32 | (u64)pg0->WWPN.Low; |
342 | rid->port_id = pg0->PortIdentifier; | 342 | rid->port_id = pg0->PortIdentifier; |
343 | rid->roles = FC_RPORT_ROLE_UNKNOWN; | 343 | rid->roles = FC_RPORT_ROLE_UNKNOWN; |
344 | rid->roles |= FC_RPORT_ROLE_FCP_TARGET; | ||
345 | if (pg0->Protocol & MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR) | ||
346 | rid->roles |= FC_RPORT_ROLE_FCP_INITIATOR; | ||
347 | 344 | ||
348 | return 0; | 345 | return 0; |
349 | } | 346 | } |
@@ -355,15 +352,18 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
355 | struct fc_rport *rport; | 352 | struct fc_rport *rport; |
356 | struct mptfc_rport_info *ri; | 353 | struct mptfc_rport_info *ri; |
357 | int new_ri = 1; | 354 | int new_ri = 1; |
358 | u64 pn; | 355 | u64 pn, nn; |
359 | unsigned long flags; | ||
360 | VirtTarget *vtarget; | 356 | VirtTarget *vtarget; |
357 | u32 roles = FC_RPORT_ROLE_UNKNOWN; | ||
361 | 358 | ||
362 | if (mptfc_generate_rport_ids(pg0, &rport_ids) < 0) | 359 | if (mptfc_generate_rport_ids(pg0, &rport_ids) < 0) |
363 | return; | 360 | return; |
364 | 361 | ||
362 | roles |= FC_RPORT_ROLE_FCP_TARGET; | ||
363 | if (pg0->Protocol & MPI_FC_DEVICE_PAGE0_PROT_FCP_INITIATOR) | ||
364 | roles |= FC_RPORT_ROLE_FCP_INITIATOR; | ||
365 | |||
365 | /* scan list looking for a match */ | 366 | /* scan list looking for a match */ |
366 | spin_lock_irqsave(&ioc->fc_rport_lock, flags); | ||
367 | list_for_each_entry(ri, &ioc->fc_rports, list) { | 367 | list_for_each_entry(ri, &ioc->fc_rports, list) { |
368 | pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; | 368 | pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; |
369 | if (pn == rport_ids.port_name) { /* match */ | 369 | if (pn == rport_ids.port_name) { /* match */ |
@@ -373,11 +373,9 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
373 | } | 373 | } |
374 | } | 374 | } |
375 | if (new_ri) { /* allocate one */ | 375 | if (new_ri) { /* allocate one */ |
376 | spin_unlock_irqrestore(&ioc->fc_rport_lock, flags); | ||
377 | ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL); | 376 | ri = kzalloc(sizeof(struct mptfc_rport_info), GFP_KERNEL); |
378 | if (!ri) | 377 | if (!ri) |
379 | return; | 378 | return; |
380 | spin_lock_irqsave(&ioc->fc_rport_lock, flags); | ||
381 | list_add_tail(&ri->list, &ioc->fc_rports); | 379 | list_add_tail(&ri->list, &ioc->fc_rports); |
382 | } | 380 | } |
383 | 381 | ||
@@ -387,14 +385,11 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
387 | /* MPT_RPORT_INFO_FLAGS_REGISTERED - rport not previously deleted */ | 385 | /* MPT_RPORT_INFO_FLAGS_REGISTERED - rport not previously deleted */ |
388 | if (!(ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED)) { | 386 | if (!(ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED)) { |
389 | ri->flags |= MPT_RPORT_INFO_FLAGS_REGISTERED; | 387 | ri->flags |= MPT_RPORT_INFO_FLAGS_REGISTERED; |
390 | spin_unlock_irqrestore(&ioc->fc_rport_lock, flags); | ||
391 | rport = fc_remote_port_add(ioc->sh, channel, &rport_ids); | 388 | rport = fc_remote_port_add(ioc->sh, channel, &rport_ids); |
392 | spin_lock_irqsave(&ioc->fc_rport_lock, flags); | ||
393 | if (rport) { | 389 | if (rport) { |
394 | ri->rport = rport; | 390 | ri->rport = rport; |
395 | if (new_ri) /* may have been reset by user */ | 391 | if (new_ri) /* may have been reset by user */ |
396 | rport->dev_loss_tmo = mptfc_dev_loss_tmo; | 392 | rport->dev_loss_tmo = mptfc_dev_loss_tmo; |
397 | *((struct mptfc_rport_info **)rport->dd_data) = ri; | ||
398 | /* | 393 | /* |
399 | * if already mapped, remap here. If not mapped, | 394 | * if already mapped, remap here. If not mapped, |
400 | * target_alloc will allocate vtarget and map, | 395 | * target_alloc will allocate vtarget and map, |
@@ -406,16 +401,21 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
406 | vtarget->target_id = pg0->CurrentTargetID; | 401 | vtarget->target_id = pg0->CurrentTargetID; |
407 | vtarget->bus_id = pg0->CurrentBus; | 402 | vtarget->bus_id = pg0->CurrentBus; |
408 | } | 403 | } |
409 | ri->remap_needed = 0; | ||
410 | } | 404 | } |
405 | *((struct mptfc_rport_info **)rport->dd_data) = ri; | ||
406 | /* scan will be scheduled once rport becomes a target */ | ||
407 | fc_remote_port_rolechg(rport,roles); | ||
408 | |||
409 | pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; | ||
410 | nn = (u64)ri->pg0.WWNN.High << 32 | (u64)ri->pg0.WWNN.Low; | ||
411 | dfcprintk ((MYIOC_s_INFO_FMT | 411 | dfcprintk ((MYIOC_s_INFO_FMT |
412 | "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " | 412 | "mptfc_reg_dev.%d: %x, %llx / %llx, tid %d, " |
413 | "rport tid %d, tmo %d\n", | 413 | "rport tid %d, tmo %d\n", |
414 | ioc->name, | 414 | ioc->name, |
415 | ioc->sh->host_no, | 415 | ioc->sh->host_no, |
416 | pg0->PortIdentifier, | 416 | pg0->PortIdentifier, |
417 | pg0->WWNN, | 417 | (unsigned long long)nn, |
418 | pg0->WWPN, | 418 | (unsigned long long)pn, |
419 | pg0->CurrentTargetID, | 419 | pg0->CurrentTargetID, |
420 | ri->rport->scsi_target_id, | 420 | ri->rport->scsi_target_id, |
421 | ri->rport->dev_loss_tmo)); | 421 | ri->rport->dev_loss_tmo)); |
@@ -425,8 +425,6 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) | |||
425 | ri = NULL; | 425 | ri = NULL; |
426 | } | 426 | } |
427 | } | 427 | } |
428 | spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); | ||
429 | |||
430 | } | 428 | } |
431 | 429 | ||
432 | /* | 430 | /* |
@@ -476,7 +474,6 @@ mptfc_target_alloc(struct scsi_target *starget) | |||
476 | vtarget->target_id = ri->pg0.CurrentTargetID; | 474 | vtarget->target_id = ri->pg0.CurrentTargetID; |
477 | vtarget->bus_id = ri->pg0.CurrentBus; | 475 | vtarget->bus_id = ri->pg0.CurrentBus; |
478 | ri->starget = starget; | 476 | ri->starget = starget; |
479 | ri->remap_needed = 0; | ||
480 | rc = 0; | 477 | rc = 0; |
481 | } | 478 | } |
482 | } | 479 | } |
@@ -502,10 +499,10 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
502 | VirtDevice *vdev; | 499 | VirtDevice *vdev; |
503 | struct scsi_target *starget; | 500 | struct scsi_target *starget; |
504 | struct fc_rport *rport; | 501 | struct fc_rport *rport; |
505 | unsigned long flags; | ||
506 | 502 | ||
507 | 503 | ||
508 | rport = starget_to_rport(scsi_target(sdev)); | 504 | starget = scsi_target(sdev); |
505 | rport = starget_to_rport(starget); | ||
509 | 506 | ||
510 | if (!rport || fc_remote_port_chkready(rport)) | 507 | if (!rport || fc_remote_port_chkready(rport)) |
511 | return -ENXIO; | 508 | return -ENXIO; |
@@ -519,10 +516,8 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
519 | return -ENOMEM; | 516 | return -ENOMEM; |
520 | } | 517 | } |
521 | 518 | ||
522 | spin_lock_irqsave(&hd->ioc->fc_rport_lock,flags); | ||
523 | 519 | ||
524 | sdev->hostdata = vdev; | 520 | sdev->hostdata = vdev; |
525 | starget = scsi_target(sdev); | ||
526 | vtarget = starget->hostdata; | 521 | vtarget = starget->hostdata; |
527 | 522 | ||
528 | if (vtarget->num_luns == 0) { | 523 | if (vtarget->num_luns == 0) { |
@@ -535,14 +530,16 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
535 | vdev->vtarget = vtarget; | 530 | vdev->vtarget = vtarget; |
536 | vdev->lun = sdev->lun; | 531 | vdev->lun = sdev->lun; |
537 | 532 | ||
538 | spin_unlock_irqrestore(&hd->ioc->fc_rport_lock,flags); | ||
539 | |||
540 | vtarget->num_luns++; | 533 | vtarget->num_luns++; |
541 | 534 | ||
535 | |||
542 | #ifdef DMPT_DEBUG_FC | 536 | #ifdef DMPT_DEBUG_FC |
543 | { | 537 | { |
538 | u64 nn, pn; | ||
544 | struct mptfc_rport_info *ri; | 539 | struct mptfc_rport_info *ri; |
545 | ri = *((struct mptfc_rport_info **)rport->dd_data); | 540 | ri = *((struct mptfc_rport_info **)rport->dd_data); |
541 | pn = (u64)ri->pg0.WWPN.High << 32 | (u64)ri->pg0.WWPN.Low; | ||
542 | nn = (u64)ri->pg0.WWNN.High << 32 | (u64)ri->pg0.WWNN.Low; | ||
546 | dfcprintk ((MYIOC_s_INFO_FMT | 543 | dfcprintk ((MYIOC_s_INFO_FMT |
547 | "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " | 544 | "mptfc_slv_alloc.%d: num_luns %d, sdev.id %d, " |
548 | "CurrentTargetID %d, %x %llx %llx\n", | 545 | "CurrentTargetID %d, %x %llx %llx\n", |
@@ -550,7 +547,9 @@ mptfc_slave_alloc(struct scsi_device *sdev) | |||
550 | sdev->host->host_no, | 547 | sdev->host->host_no, |
551 | vtarget->num_luns, | 548 | vtarget->num_luns, |
552 | sdev->id, ri->pg0.CurrentTargetID, | 549 | sdev->id, ri->pg0.CurrentTargetID, |
553 | ri->pg0.PortIdentifier, ri->pg0.WWPN, ri->pg0.WWNN)); | 550 | ri->pg0.PortIdentifier, |
551 | (unsigned long long)pn, | ||
552 | (unsigned long long)nn)); | ||
554 | } | 553 | } |
555 | #endif | 554 | #endif |
556 | 555 | ||
@@ -570,11 +569,31 @@ mptfc_qcmd(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
570 | done(SCpnt); | 569 | done(SCpnt); |
571 | return 0; | 570 | return 0; |
572 | } | 571 | } |
572 | |||
573 | /* dd_data is null until finished adding target */ | ||
573 | ri = *((struct mptfc_rport_info **)rport->dd_data); | 574 | ri = *((struct mptfc_rport_info **)rport->dd_data); |
574 | if (unlikely(ri->remap_needed)) | 575 | if (unlikely(!ri)) { |
575 | return SCSI_MLQUEUE_HOST_BUSY; | 576 | dfcprintk ((MYIOC_s_INFO_FMT |
577 | "mptfc_qcmd.%d: %d:%d, dd_data is null.\n", | ||
578 | ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->name, | ||
579 | ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->sh->host_no, | ||
580 | SCpnt->device->id,SCpnt->device->lun)); | ||
581 | SCpnt->result = DID_IMM_RETRY << 16; | ||
582 | done(SCpnt); | ||
583 | return 0; | ||
584 | } | ||
576 | 585 | ||
577 | return mptscsih_qcmd(SCpnt,done); | 586 | err = mptscsih_qcmd(SCpnt,done); |
587 | #ifdef DMPT_DEBUG_FC | ||
588 | if (unlikely(err)) { | ||
589 | dfcprintk ((MYIOC_s_INFO_FMT | ||
590 | "mptfc_qcmd.%d: %d:%d, mptscsih_qcmd returns non-zero.\n", | ||
591 | ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->name, | ||
592 | ((MPT_SCSI_HOST *) SCpnt->device->host->hostdata)->ioc->sh->host_no, | ||
593 | SCpnt->device->id,SCpnt->device->lun)); | ||
594 | } | ||
595 | #endif | ||
596 | return err; | ||
578 | } | 597 | } |
579 | 598 | ||
580 | static void | 599 | static void |
@@ -615,18 +634,17 @@ mptfc_rescan_devices(void *arg) | |||
615 | MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; | 634 | MPT_ADAPTER *ioc = (MPT_ADAPTER *)arg; |
616 | int ii; | 635 | int ii; |
617 | int work_to_do; | 636 | int work_to_do; |
637 | u64 pn; | ||
618 | unsigned long flags; | 638 | unsigned long flags; |
619 | struct mptfc_rport_info *ri; | 639 | struct mptfc_rport_info *ri; |
620 | 640 | ||
621 | do { | 641 | do { |
622 | /* start by tagging all ports as missing */ | 642 | /* start by tagging all ports as missing */ |
623 | spin_lock_irqsave(&ioc->fc_rport_lock,flags); | ||
624 | list_for_each_entry(ri, &ioc->fc_rports, list) { | 643 | list_for_each_entry(ri, &ioc->fc_rports, list) { |
625 | if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) { | 644 | if (ri->flags & MPT_RPORT_INFO_FLAGS_REGISTERED) { |
626 | ri->flags |= MPT_RPORT_INFO_FLAGS_MISSING; | 645 | ri->flags |= MPT_RPORT_INFO_FLAGS_MISSING; |
627 | } | 646 | } |
628 | } | 647 | } |
629 | spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); | ||
630 | 648 | ||
631 | /* | 649 | /* |
632 | * now rescan devices known to adapter, | 650 | * now rescan devices known to adapter, |
@@ -639,33 +657,24 @@ mptfc_rescan_devices(void *arg) | |||
639 | } | 657 | } |
640 | 658 | ||
641 | /* delete devices still missing */ | 659 | /* delete devices still missing */ |
642 | spin_lock_irqsave(&ioc->fc_rport_lock, flags); | ||
643 | list_for_each_entry(ri, &ioc->fc_rports, list) { | 660 | list_for_each_entry(ri, &ioc->fc_rports, list) { |
644 | /* if newly missing, delete it */ | 661 | /* if newly missing, delete it */ |
645 | if ((ri->flags & (MPT_RPORT_INFO_FLAGS_REGISTERED | | 662 | if (ri->flags & MPT_RPORT_INFO_FLAGS_MISSING) { |
646 | MPT_RPORT_INFO_FLAGS_MISSING)) | ||
647 | == (MPT_RPORT_INFO_FLAGS_REGISTERED | | ||
648 | MPT_RPORT_INFO_FLAGS_MISSING)) { | ||
649 | 663 | ||
650 | ri->flags &= ~(MPT_RPORT_INFO_FLAGS_REGISTERED| | 664 | ri->flags &= ~(MPT_RPORT_INFO_FLAGS_REGISTERED| |
651 | MPT_RPORT_INFO_FLAGS_MISSING); | 665 | MPT_RPORT_INFO_FLAGS_MISSING); |
652 | ri->remap_needed = 1; | 666 | fc_remote_port_delete(ri->rport); /* won't sleep */ |
653 | fc_remote_port_delete(ri->rport); | ||
654 | /* | ||
655 | * remote port not really deleted 'cause | ||
656 | * binding is by WWPN and driver only | ||
657 | * registers FCP_TARGETs but cannot trust | ||
658 | * data structures. | ||
659 | */ | ||
660 | ri->rport = NULL; | 667 | ri->rport = NULL; |
668 | |||
669 | pn = (u64)ri->pg0.WWPN.High << 32 | | ||
670 | (u64)ri->pg0.WWPN.Low; | ||
661 | dfcprintk ((MYIOC_s_INFO_FMT | 671 | dfcprintk ((MYIOC_s_INFO_FMT |
662 | "mptfc_rescan.%d: %llx deleted\n", | 672 | "mptfc_rescan.%d: %llx deleted\n", |
663 | ioc->name, | 673 | ioc->name, |
664 | ioc->sh->host_no, | 674 | ioc->sh->host_no, |
665 | ri->pg0.WWPN)); | 675 | (unsigned long long)pn)); |
666 | } | 676 | } |
667 | } | 677 | } |
668 | spin_unlock_irqrestore(&ioc->fc_rport_lock,flags); | ||
669 | 678 | ||
670 | /* | 679 | /* |
671 | * allow multiple passes as target state | 680 | * allow multiple passes as target state |
@@ -870,10 +879,23 @@ mptfc_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
870 | goto out_mptfc_probe; | 879 | goto out_mptfc_probe; |
871 | } | 880 | } |
872 | 881 | ||
873 | for (ii=0; ii < ioc->facts.NumberOfPorts; ii++) { | 882 | /* initialize workqueue */ |
874 | mptfc_init_host_attr(ioc,ii); | 883 | |
875 | mptfc_GetFcDevPage0(ioc,ii,mptfc_register_dev); | 884 | snprintf(ioc->fc_rescan_work_q_name, KOBJ_NAME_LEN, "mptfc_wq_%d", |
876 | } | 885 | sh->host_no); |
886 | ioc->fc_rescan_work_q = | ||
887 | create_singlethread_workqueue(ioc->fc_rescan_work_q_name); | ||
888 | if (!ioc->fc_rescan_work_q) | ||
889 | goto out_mptfc_probe; | ||
890 | |||
891 | /* | ||
892 | * scan for rports - | ||
893 | * by doing it via the workqueue, some locking is eliminated | ||
894 | */ | ||
895 | |||
896 | ioc->fc_rescan_work_count = 1; | ||
897 | queue_work(ioc->fc_rescan_work_q, &ioc->fc_rescan_work); | ||
898 | flush_workqueue(ioc->fc_rescan_work_q); | ||
877 | 899 | ||
878 | return 0; | 900 | return 0; |
879 | 901 | ||
@@ -949,8 +971,18 @@ mptfc_init(void) | |||
949 | static void __devexit | 971 | static void __devexit |
950 | mptfc_remove(struct pci_dev *pdev) | 972 | mptfc_remove(struct pci_dev *pdev) |
951 | { | 973 | { |
952 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); | 974 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); |
953 | struct mptfc_rport_info *p, *n; | 975 | struct mptfc_rport_info *p, *n; |
976 | struct workqueue_struct *work_q; | ||
977 | unsigned long flags; | ||
978 | |||
979 | /* destroy workqueue */ | ||
980 | if ((work_q=ioc->fc_rescan_work_q)) { | ||
981 | spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); | ||
982 | ioc->fc_rescan_work_q = NULL; | ||
983 | spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); | ||
984 | destroy_workqueue(work_q); | ||
985 | } | ||
954 | 986 | ||
955 | fc_remove_host(ioc->sh); | 987 | fc_remove_host(ioc->sh); |
956 | 988 | ||
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index e9716b10acea..af6ec553ff7c 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c | |||
@@ -91,6 +91,7 @@ enum mptsas_hotplug_action { | |||
91 | MPTSAS_DEL_DEVICE, | 91 | MPTSAS_DEL_DEVICE, |
92 | MPTSAS_ADD_RAID, | 92 | MPTSAS_ADD_RAID, |
93 | MPTSAS_DEL_RAID, | 93 | MPTSAS_DEL_RAID, |
94 | MPTSAS_IGNORE_EVENT, | ||
94 | }; | 95 | }; |
95 | 96 | ||
96 | struct mptsas_hotplug_event { | 97 | struct mptsas_hotplug_event { |
@@ -298,6 +299,26 @@ mptsas_find_portinfo_by_handle(MPT_ADAPTER *ioc, u16 handle) | |||
298 | return rc; | 299 | return rc; |
299 | } | 300 | } |
300 | 301 | ||
302 | /* | ||
303 | * Returns true if there is a scsi end device | ||
304 | */ | ||
305 | static inline int | ||
306 | mptsas_is_end_device(struct mptsas_devinfo * attached) | ||
307 | { | ||
308 | if ((attached->handle) && | ||
309 | (attached->device_info & | ||
310 | MPI_SAS_DEVICE_INFO_END_DEVICE) && | ||
311 | ((attached->device_info & | ||
312 | MPI_SAS_DEVICE_INFO_SSP_TARGET) | | ||
313 | (attached->device_info & | ||
314 | MPI_SAS_DEVICE_INFO_STP_TARGET) | | ||
315 | (attached->device_info & | ||
316 | MPI_SAS_DEVICE_INFO_SATA_DEVICE))) | ||
317 | return 1; | ||
318 | else | ||
319 | return 0; | ||
320 | } | ||
321 | |||
301 | static int | 322 | static int |
302 | mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure, | 323 | mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure, |
303 | u32 form, u32 form_specific) | 324 | u32 form, u32 form_specific) |
@@ -872,7 +893,11 @@ mptsas_sas_device_pg0(MPT_ADAPTER *ioc, struct mptsas_devinfo *device_info, | |||
872 | SasDevicePage0_t *buffer; | 893 | SasDevicePage0_t *buffer; |
873 | dma_addr_t dma_handle; | 894 | dma_addr_t dma_handle; |
874 | __le64 sas_address; | 895 | __le64 sas_address; |
875 | int error; | 896 | int error=0; |
897 | |||
898 | if (ioc->sas_discovery_runtime && | ||
899 | mptsas_is_end_device(device_info)) | ||
900 | goto out; | ||
876 | 901 | ||
877 | hdr.PageVersion = MPI_SASDEVICE0_PAGEVERSION; | 902 | hdr.PageVersion = MPI_SASDEVICE0_PAGEVERSION; |
878 | hdr.ExtPageLength = 0; | 903 | hdr.ExtPageLength = 0; |
@@ -1009,7 +1034,11 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, | |||
1009 | CONFIGPARMS cfg; | 1034 | CONFIGPARMS cfg; |
1010 | SasExpanderPage1_t *buffer; | 1035 | SasExpanderPage1_t *buffer; |
1011 | dma_addr_t dma_handle; | 1036 | dma_addr_t dma_handle; |
1012 | int error; | 1037 | int error=0; |
1038 | |||
1039 | if (ioc->sas_discovery_runtime && | ||
1040 | mptsas_is_end_device(&phy_info->attached)) | ||
1041 | goto out; | ||
1013 | 1042 | ||
1014 | hdr.PageVersion = MPI_SASEXPANDER0_PAGEVERSION; | 1043 | hdr.PageVersion = MPI_SASEXPANDER0_PAGEVERSION; |
1015 | hdr.ExtPageLength = 0; | 1044 | hdr.ExtPageLength = 0; |
@@ -1068,26 +1097,6 @@ mptsas_sas_expander_pg1(MPT_ADAPTER *ioc, struct mptsas_phyinfo *phy_info, | |||
1068 | return error; | 1097 | return error; |
1069 | } | 1098 | } |
1070 | 1099 | ||
1071 | /* | ||
1072 | * Returns true if there is a scsi end device | ||
1073 | */ | ||
1074 | static inline int | ||
1075 | mptsas_is_end_device(struct mptsas_devinfo * attached) | ||
1076 | { | ||
1077 | if ((attached->handle) && | ||
1078 | (attached->device_info & | ||
1079 | MPI_SAS_DEVICE_INFO_END_DEVICE) && | ||
1080 | ((attached->device_info & | ||
1081 | MPI_SAS_DEVICE_INFO_SSP_TARGET) | | ||
1082 | (attached->device_info & | ||
1083 | MPI_SAS_DEVICE_INFO_STP_TARGET) | | ||
1084 | (attached->device_info & | ||
1085 | MPI_SAS_DEVICE_INFO_SATA_DEVICE))) | ||
1086 | return 1; | ||
1087 | else | ||
1088 | return 0; | ||
1089 | } | ||
1090 | |||
1091 | static void | 1100 | static void |
1092 | mptsas_parse_device_info(struct sas_identify *identify, | 1101 | mptsas_parse_device_info(struct sas_identify *identify, |
1093 | struct mptsas_devinfo *device_info) | 1102 | struct mptsas_devinfo *device_info) |
@@ -1737,6 +1746,9 @@ mptsas_hotplug_work(void *arg) | |||
1737 | break; | 1746 | break; |
1738 | case MPTSAS_ADD_DEVICE: | 1747 | case MPTSAS_ADD_DEVICE: |
1739 | 1748 | ||
1749 | if (ev->phys_disk_num_valid) | ||
1750 | mpt_findImVolumes(ioc); | ||
1751 | |||
1740 | /* | 1752 | /* |
1741 | * Refresh sas device pg0 data | 1753 | * Refresh sas device pg0 data |
1742 | */ | 1754 | */ |
@@ -1868,6 +1880,9 @@ mptsas_hotplug_work(void *arg) | |||
1868 | scsi_device_put(sdev); | 1880 | scsi_device_put(sdev); |
1869 | mpt_findImVolumes(ioc); | 1881 | mpt_findImVolumes(ioc); |
1870 | break; | 1882 | break; |
1883 | case MPTSAS_IGNORE_EVENT: | ||
1884 | default: | ||
1885 | break; | ||
1871 | } | 1886 | } |
1872 | 1887 | ||
1873 | kfree(ev); | 1888 | kfree(ev); |
@@ -1940,7 +1955,8 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc, | |||
1940 | EVENT_DATA_RAID *raid_event_data) | 1955 | EVENT_DATA_RAID *raid_event_data) |
1941 | { | 1956 | { |
1942 | struct mptsas_hotplug_event *ev; | 1957 | struct mptsas_hotplug_event *ev; |
1943 | RAID_VOL0_STATUS * volumeStatus; | 1958 | int status = le32_to_cpu(raid_event_data->SettingsStatus); |
1959 | int state = (status >> 8) & 0xff; | ||
1944 | 1960 | ||
1945 | if (ioc->bus_type != SAS) | 1961 | if (ioc->bus_type != SAS) |
1946 | return; | 1962 | return; |
@@ -1955,6 +1971,7 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc, | |||
1955 | INIT_WORK(&ev->work, mptsas_hotplug_work, ev); | 1971 | INIT_WORK(&ev->work, mptsas_hotplug_work, ev); |
1956 | ev->ioc = ioc; | 1972 | ev->ioc = ioc; |
1957 | ev->id = raid_event_data->VolumeID; | 1973 | ev->id = raid_event_data->VolumeID; |
1974 | ev->event_type = MPTSAS_IGNORE_EVENT; | ||
1958 | 1975 | ||
1959 | switch (raid_event_data->ReasonCode) { | 1976 | switch (raid_event_data->ReasonCode) { |
1960 | case MPI_EVENT_RAID_RC_PHYSDISK_DELETED: | 1977 | case MPI_EVENT_RAID_RC_PHYSDISK_DELETED: |
@@ -1966,6 +1983,25 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc, | |||
1966 | ev->phys_disk_num = raid_event_data->PhysDiskNum; | 1983 | ev->phys_disk_num = raid_event_data->PhysDiskNum; |
1967 | ev->event_type = MPTSAS_DEL_DEVICE; | 1984 | ev->event_type = MPTSAS_DEL_DEVICE; |
1968 | break; | 1985 | break; |
1986 | case MPI_EVENT_RAID_RC_PHYSDISK_STATUS_CHANGED: | ||
1987 | switch (state) { | ||
1988 | case MPI_PD_STATE_ONLINE: | ||
1989 | ioc->raid_data.isRaid = 1; | ||
1990 | ev->phys_disk_num_valid = 1; | ||
1991 | ev->phys_disk_num = raid_event_data->PhysDiskNum; | ||
1992 | ev->event_type = MPTSAS_ADD_DEVICE; | ||
1993 | break; | ||
1994 | case MPI_PD_STATE_MISSING: | ||
1995 | case MPI_PD_STATE_NOT_COMPATIBLE: | ||
1996 | case MPI_PD_STATE_OFFLINE_AT_HOST_REQUEST: | ||
1997 | case MPI_PD_STATE_FAILED_AT_HOST_REQUEST: | ||
1998 | case MPI_PD_STATE_OFFLINE_FOR_ANOTHER_REASON: | ||
1999 | ev->event_type = MPTSAS_DEL_DEVICE; | ||
2000 | break; | ||
2001 | default: | ||
2002 | break; | ||
2003 | } | ||
2004 | break; | ||
1969 | case MPI_EVENT_RAID_RC_VOLUME_DELETED: | 2005 | case MPI_EVENT_RAID_RC_VOLUME_DELETED: |
1970 | ev->event_type = MPTSAS_DEL_RAID; | 2006 | ev->event_type = MPTSAS_DEL_RAID; |
1971 | break; | 2007 | break; |
@@ -1973,11 +2009,18 @@ mptscsih_send_raid_event(MPT_ADAPTER *ioc, | |||
1973 | ev->event_type = MPTSAS_ADD_RAID; | 2009 | ev->event_type = MPTSAS_ADD_RAID; |
1974 | break; | 2010 | break; |
1975 | case MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED: | 2011 | case MPI_EVENT_RAID_RC_VOLUME_STATUS_CHANGED: |
1976 | volumeStatus = (RAID_VOL0_STATUS *) & | 2012 | switch (state) { |
1977 | raid_event_data->SettingsStatus; | 2013 | case MPI_RAIDVOL0_STATUS_STATE_FAILED: |
1978 | ev->event_type = (volumeStatus->State == | 2014 | case MPI_RAIDVOL0_STATUS_STATE_MISSING: |
1979 | MPI_RAIDVOL0_STATUS_STATE_FAILED) ? | 2015 | ev->event_type = MPTSAS_DEL_RAID; |
1980 | MPTSAS_DEL_RAID : MPTSAS_ADD_RAID; | 2016 | break; |
2017 | case MPI_RAIDVOL0_STATUS_STATE_OPTIMAL: | ||
2018 | case MPI_RAIDVOL0_STATUS_STATE_DEGRADED: | ||
2019 | ev->event_type = MPTSAS_ADD_RAID; | ||
2020 | break; | ||
2021 | default: | ||
2022 | break; | ||
2023 | } | ||
1981 | break; | 2024 | break; |
1982 | default: | 2025 | default: |
1983 | break; | 2026 | break; |
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 3729062db317..84fa271eb8f4 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c | |||
@@ -632,7 +632,11 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr) | |||
632 | 632 | ||
633 | case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ | 633 | case MPI_IOCSTATUS_SCSI_DEVICE_NOT_THERE: /* 0x0043 */ |
634 | /* Spoof to SCSI Selection Timeout! */ | 634 | /* Spoof to SCSI Selection Timeout! */ |
635 | sc->result = DID_NO_CONNECT << 16; | 635 | if (ioc->bus_type != FC) |
636 | sc->result = DID_NO_CONNECT << 16; | ||
637 | /* else fibre, just stall until rescan event */ | ||
638 | else | ||
639 | sc->result = DID_REQUEUE << 16; | ||
636 | 640 | ||
637 | if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) | 641 | if (hd->sel_timeout[pScsiReq->TargetID] < 0xFFFF) |
638 | hd->sel_timeout[pScsiReq->TargetID]++; | 642 | hd->sel_timeout[pScsiReq->TargetID]++; |
@@ -877,7 +881,7 @@ mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) | |||
877 | struct scsi_cmnd *sc; | 881 | struct scsi_cmnd *sc; |
878 | 882 | ||
879 | dsprintk((KERN_INFO MYNAM ": search_running target %d lun %d max %d\n", | 883 | dsprintk((KERN_INFO MYNAM ": search_running target %d lun %d max %d\n", |
880 | vdevice->target_id, vdevice->lun, max)); | 884 | vdevice->vtarget->target_id, vdevice->lun, max)); |
881 | 885 | ||
882 | for (ii=0; ii < max; ii++) { | 886 | for (ii=0; ii < max; ii++) { |
883 | if ((sc = hd->ScsiLookup[ii]) != NULL) { | 887 | if ((sc = hd->ScsiLookup[ii]) != NULL) { |
@@ -1645,7 +1649,6 @@ int | |||
1645 | mptscsih_abort(struct scsi_cmnd * SCpnt) | 1649 | mptscsih_abort(struct scsi_cmnd * SCpnt) |
1646 | { | 1650 | { |
1647 | MPT_SCSI_HOST *hd; | 1651 | MPT_SCSI_HOST *hd; |
1648 | MPT_ADAPTER *ioc; | ||
1649 | MPT_FRAME_HDR *mf; | 1652 | MPT_FRAME_HDR *mf; |
1650 | u32 ctx2abort; | 1653 | u32 ctx2abort; |
1651 | int scpnt_idx; | 1654 | int scpnt_idx; |
@@ -1663,14 +1666,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
1663 | return FAILED; | 1666 | return FAILED; |
1664 | } | 1667 | } |
1665 | 1668 | ||
1666 | ioc = hd->ioc; | ||
1667 | if (hd->resetPending) { | ||
1668 | return FAILED; | ||
1669 | } | ||
1670 | |||
1671 | if (hd->timeouts < -1) | ||
1672 | hd->timeouts++; | ||
1673 | |||
1674 | /* Find this command | 1669 | /* Find this command |
1675 | */ | 1670 | */ |
1676 | if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { | 1671 | if ((scpnt_idx = SCPNT_TO_LOOKUP_IDX(SCpnt)) < 0) { |
@@ -1684,6 +1679,13 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
1684 | return SUCCESS; | 1679 | return SUCCESS; |
1685 | } | 1680 | } |
1686 | 1681 | ||
1682 | if (hd->resetPending) { | ||
1683 | return FAILED; | ||
1684 | } | ||
1685 | |||
1686 | if (hd->timeouts < -1) | ||
1687 | hd->timeouts++; | ||
1688 | |||
1687 | printk(KERN_WARNING MYNAM ": %s: attempting task abort! (sc=%p)\n", | 1689 | printk(KERN_WARNING MYNAM ": %s: attempting task abort! (sc=%p)\n", |
1688 | hd->ioc->name, SCpnt); | 1690 | hd->ioc->name, SCpnt); |
1689 | scsi_print_command(SCpnt); | 1691 | scsi_print_command(SCpnt); |
@@ -1703,7 +1705,7 @@ mptscsih_abort(struct scsi_cmnd * SCpnt) | |||
1703 | vdev = SCpnt->device->hostdata; | 1705 | vdev = SCpnt->device->hostdata; |
1704 | retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, | 1706 | retval = mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, |
1705 | vdev->vtarget->bus_id, vdev->vtarget->target_id, vdev->lun, | 1707 | vdev->vtarget->bus_id, vdev->vtarget->target_id, vdev->lun, |
1706 | ctx2abort, mptscsih_get_tm_timeout(ioc)); | 1708 | ctx2abort, mptscsih_get_tm_timeout(hd->ioc)); |
1707 | 1709 | ||
1708 | printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", | 1710 | printk (KERN_WARNING MYNAM ": %s: task abort: %s (sc=%p)\n", |
1709 | hd->ioc->name, | 1711 | hd->ioc->name, |
@@ -2521,15 +2523,15 @@ mptscsih_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | |||
2521 | 2523 | ||
2522 | /* 7. FC: Rescan for blocked rports which might have returned. | 2524 | /* 7. FC: Rescan for blocked rports which might have returned. |
2523 | */ | 2525 | */ |
2524 | else if (ioc->bus_type == FC) { | 2526 | if (ioc->bus_type == FC) { |
2525 | int work_count; | ||
2526 | unsigned long flags; | ||
2527 | |||
2528 | spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); | 2527 | spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); |
2529 | work_count = ++ioc->fc_rescan_work_count; | 2528 | if (ioc->fc_rescan_work_q) { |
2529 | if (ioc->fc_rescan_work_count++ == 0) { | ||
2530 | queue_work(ioc->fc_rescan_work_q, | ||
2531 | &ioc->fc_rescan_work); | ||
2532 | } | ||
2533 | } | ||
2530 | spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); | 2534 | spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); |
2531 | if (work_count == 1) | ||
2532 | schedule_work(&ioc->fc_rescan_work); | ||
2533 | } | 2535 | } |
2534 | dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name)); | 2536 | dtmprintk((MYIOC_s_WARN_FMT "Post-Reset complete.\n", ioc->name)); |
2535 | 2537 | ||
@@ -2544,7 +2546,6 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) | |||
2544 | { | 2546 | { |
2545 | MPT_SCSI_HOST *hd; | 2547 | MPT_SCSI_HOST *hd; |
2546 | u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; | 2548 | u8 event = le32_to_cpu(pEvReply->Event) & 0xFF; |
2547 | int work_count; | ||
2548 | unsigned long flags; | 2549 | unsigned long flags; |
2549 | 2550 | ||
2550 | devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", | 2551 | devtverboseprintk((MYIOC_s_INFO_FMT "MPT event (=%02Xh) routed to SCSI host driver!\n", |
@@ -2569,10 +2570,13 @@ mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply) | |||
2569 | 2570 | ||
2570 | case MPI_EVENT_RESCAN: /* 06 */ | 2571 | case MPI_EVENT_RESCAN: /* 06 */ |
2571 | spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); | 2572 | spin_lock_irqsave(&ioc->fc_rescan_work_lock, flags); |
2572 | work_count = ++ioc->fc_rescan_work_count; | 2573 | if (ioc->fc_rescan_work_q) { |
2574 | if (ioc->fc_rescan_work_count++ == 0) { | ||
2575 | queue_work(ioc->fc_rescan_work_q, | ||
2576 | &ioc->fc_rescan_work); | ||
2577 | } | ||
2578 | } | ||
2573 | spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); | 2579 | spin_unlock_irqrestore(&ioc->fc_rescan_work_lock, flags); |
2574 | if (work_count == 1) | ||
2575 | schedule_work(&ioc->fc_rescan_work); | ||
2576 | break; | 2580 | break; |
2577 | 2581 | ||
2578 | /* | 2582 | /* |
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 09c745b19cc8..f2a4d382ea19 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c | |||
@@ -783,6 +783,70 @@ static struct pci_device_id mptspi_pci_table[] = { | |||
783 | }; | 783 | }; |
784 | MODULE_DEVICE_TABLE(pci, mptspi_pci_table); | 784 | MODULE_DEVICE_TABLE(pci, mptspi_pci_table); |
785 | 785 | ||
786 | |||
787 | /* | ||
788 | * renegotiate for a given target | ||
789 | */ | ||
790 | static void | ||
791 | mptspi_dv_renegotiate_work(void *data) | ||
792 | { | ||
793 | struct work_queue_wrapper *wqw = (struct work_queue_wrapper *)data; | ||
794 | struct _MPT_SCSI_HOST *hd = wqw->hd; | ||
795 | struct scsi_device *sdev; | ||
796 | |||
797 | kfree(wqw); | ||
798 | |||
799 | shost_for_each_device(sdev, hd->ioc->sh) | ||
800 | mptspi_dv_device(hd, sdev); | ||
801 | } | ||
802 | |||
803 | static void | ||
804 | mptspi_dv_renegotiate(struct _MPT_SCSI_HOST *hd) | ||
805 | { | ||
806 | struct work_queue_wrapper *wqw = kmalloc(sizeof(*wqw), GFP_ATOMIC); | ||
807 | |||
808 | if (!wqw) | ||
809 | return; | ||
810 | |||
811 | INIT_WORK(&wqw->work, mptspi_dv_renegotiate_work, wqw); | ||
812 | wqw->hd = hd; | ||
813 | |||
814 | schedule_work(&wqw->work); | ||
815 | } | ||
816 | |||
817 | /* | ||
818 | * spi module reset handler | ||
819 | */ | ||
820 | static int | ||
821 | mptspi_ioc_reset(MPT_ADAPTER *ioc, int reset_phase) | ||
822 | { | ||
823 | struct _MPT_SCSI_HOST *hd = (struct _MPT_SCSI_HOST *)ioc->sh->hostdata; | ||
824 | int rc; | ||
825 | |||
826 | rc = mptscsih_ioc_reset(ioc, reset_phase); | ||
827 | |||
828 | if (reset_phase == MPT_IOC_POST_RESET) | ||
829 | mptspi_dv_renegotiate(hd); | ||
830 | |||
831 | return rc; | ||
832 | } | ||
833 | |||
834 | /* | ||
835 | * spi module resume handler | ||
836 | */ | ||
837 | static int | ||
838 | mptspi_resume(struct pci_dev *pdev) | ||
839 | { | ||
840 | MPT_ADAPTER *ioc = pci_get_drvdata(pdev); | ||
841 | struct _MPT_SCSI_HOST *hd = (struct _MPT_SCSI_HOST *)ioc->sh->hostdata; | ||
842 | int rc; | ||
843 | |||
844 | rc = mptscsih_resume(pdev); | ||
845 | mptspi_dv_renegotiate(hd); | ||
846 | |||
847 | return rc; | ||
848 | } | ||
849 | |||
786 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 850 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
787 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ | 851 | /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ |
788 | /* | 852 | /* |
@@ -1032,7 +1096,7 @@ static struct pci_driver mptspi_driver = { | |||
1032 | .shutdown = mptscsih_shutdown, | 1096 | .shutdown = mptscsih_shutdown, |
1033 | #ifdef CONFIG_PM | 1097 | #ifdef CONFIG_PM |
1034 | .suspend = mptscsih_suspend, | 1098 | .suspend = mptscsih_suspend, |
1035 | .resume = mptscsih_resume, | 1099 | .resume = mptspi_resume, |
1036 | #endif | 1100 | #endif |
1037 | }; | 1101 | }; |
1038 | 1102 | ||
@@ -1061,7 +1125,7 @@ mptspi_init(void) | |||
1061 | ": Registered for IOC event notifications\n")); | 1125 | ": Registered for IOC event notifications\n")); |
1062 | } | 1126 | } |
1063 | 1127 | ||
1064 | if (mpt_reset_register(mptspiDoneCtx, mptscsih_ioc_reset) == 0) { | 1128 | if (mpt_reset_register(mptspiDoneCtx, mptspi_ioc_reset) == 0) { |
1065 | dprintk((KERN_INFO MYNAM | 1129 | dprintk((KERN_INFO MYNAM |
1066 | ": Registered for IOC reset notifications\n")); | 1130 | ": Registered for IOC reset notifications\n")); |
1067 | } | 1131 | } |
diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c index 914d62b24064..5dc4bee7abeb 100644 --- a/drivers/mmc/au1xmmc.c +++ b/drivers/mmc/au1xmmc.c | |||
@@ -310,7 +310,7 @@ static void au1xmmc_data_complete(struct au1xmmc_host *host, u32 status) | |||
310 | } | 310 | } |
311 | else | 311 | else |
312 | data->bytes_xfered = | 312 | data->bytes_xfered = |
313 | (data->blocks * (1 << data->blksz_bits)) - | 313 | (data->blocks * data->blksz) - |
314 | host->pio.len; | 314 | host->pio.len; |
315 | } | 315 | } |
316 | 316 | ||
@@ -575,7 +575,7 @@ static int | |||
575 | au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data) | 575 | au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data) |
576 | { | 576 | { |
577 | 577 | ||
578 | int datalen = data->blocks * (1 << data->blksz_bits); | 578 | int datalen = data->blocks * data->blksz; |
579 | 579 | ||
580 | if (dma != 0) | 580 | if (dma != 0) |
581 | host->flags |= HOST_F_DMA; | 581 | host->flags |= HOST_F_DMA; |
@@ -596,7 +596,7 @@ au1xmmc_prepare_data(struct au1xmmc_host *host, struct mmc_data *data) | |||
596 | if (host->dma.len == 0) | 596 | if (host->dma.len == 0) |
597 | return MMC_ERR_TIMEOUT; | 597 | return MMC_ERR_TIMEOUT; |
598 | 598 | ||
599 | au_writel((1 << data->blksz_bits) - 1, HOST_BLKSIZE(host)); | 599 | au_writel(data->blksz - 1, HOST_BLKSIZE(host)); |
600 | 600 | ||
601 | if (host->flags & HOST_F_DMA) { | 601 | if (host->flags & HOST_F_DMA) { |
602 | int i; | 602 | int i; |
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index 79358e223f57..a4eb1d0e7a71 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c | |||
@@ -218,8 +218,10 @@ static int imxmci_busy_wait_for_status(struct imxmci_host *host, | |||
218 | if(!loops) | 218 | if(!loops) |
219 | return 0; | 219 | return 0; |
220 | 220 | ||
221 | dev_info(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n", | 221 | /* The busy-wait is expected there for clock <8MHz due to SDHC hardware flaws */ |
222 | loops, where, *pstat, stat_mask); | 222 | if(!(stat_mask & STATUS_END_CMD_RESP) || (host->mmc->ios.clock>=8000000)) |
223 | dev_info(mmc_dev(host->mmc), "busy wait for %d usec in %s, STATUS = 0x%x (0x%x)\n", | ||
224 | loops, where, *pstat, stat_mask); | ||
223 | return loops; | 225 | return loops; |
224 | } | 226 | } |
225 | 227 | ||
@@ -333,6 +335,9 @@ static void imxmci_start_cmd(struct imxmci_host *host, struct mmc_command *cmd, | |||
333 | WARN_ON(host->cmd != NULL); | 335 | WARN_ON(host->cmd != NULL); |
334 | host->cmd = cmd; | 336 | host->cmd = cmd; |
335 | 337 | ||
338 | /* Ensure, that clock are stopped else command programming and start fails */ | ||
339 | imxmci_stop_clock(host); | ||
340 | |||
336 | if (cmd->flags & MMC_RSP_BUSY) | 341 | if (cmd->flags & MMC_RSP_BUSY) |
337 | cmdat |= CMD_DAT_CONT_BUSY; | 342 | cmdat |= CMD_DAT_CONT_BUSY; |
338 | 343 | ||
@@ -553,7 +558,7 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat) | |||
553 | int trans_done = 0; | 558 | int trans_done = 0; |
554 | unsigned int stat = *pstat; | 559 | unsigned int stat = *pstat; |
555 | 560 | ||
556 | if(host->actual_bus_width == MMC_BUS_WIDTH_4) | 561 | if(host->actual_bus_width != MMC_BUS_WIDTH_4) |
557 | burst_len = 16; | 562 | burst_len = 16; |
558 | else | 563 | else |
559 | burst_len = 64; | 564 | burst_len = 64; |
@@ -591,8 +596,7 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat) | |||
591 | stat = MMC_STATUS; | 596 | stat = MMC_STATUS; |
592 | 597 | ||
593 | /* Flush extra bytes from FIFO */ | 598 | /* Flush extra bytes from FIFO */ |
594 | while(flush_len >= 2){ | 599 | while(flush_len && !(stat & STATUS_DATA_TRANS_DONE)){ |
595 | flush_len -= 2; | ||
596 | i = MMC_BUFFER_ACCESS; | 600 | i = MMC_BUFFER_ACCESS; |
597 | stat = MMC_STATUS; | 601 | stat = MMC_STATUS; |
598 | stat &= ~STATUS_CRC_READ_ERR; /* Stupid but required there */ | 602 | stat &= ~STATUS_CRC_READ_ERR; /* Stupid but required there */ |
@@ -746,10 +750,6 @@ static void imxmci_tasklet_fnc(unsigned long data) | |||
746 | data_dir_mask = STATUS_DATA_TRANS_DONE; | 750 | data_dir_mask = STATUS_DATA_TRANS_DONE; |
747 | } | 751 | } |
748 | 752 | ||
749 | imxmci_busy_wait_for_status(host, &stat, | ||
750 | data_dir_mask, | ||
751 | 50, "imxmci_tasklet_fnc data"); | ||
752 | |||
753 | if(stat & data_dir_mask) { | 753 | if(stat & data_dir_mask) { |
754 | clear_bit(IMXMCI_PEND_DMA_END_b, &host->pending_events); | 754 | clear_bit(IMXMCI_PEND_DMA_END_b, &host->pending_events); |
755 | imxmci_data_done(host, stat); | 755 | imxmci_data_done(host, stat); |
@@ -865,7 +865,11 @@ static void imxmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
865 | 865 | ||
866 | imxmci_stop_clock(host); | 866 | imxmci_stop_clock(host); |
867 | MMC_CLK_RATE = (prescaler<<3) | clk; | 867 | MMC_CLK_RATE = (prescaler<<3) | clk; |
868 | imxmci_start_clock(host); | 868 | /* |
869 | * Under my understanding, clock should not be started there, because it would | ||
870 | * initiate SDHC sequencer and send last or random command into card | ||
871 | */ | ||
872 | /*imxmci_start_clock(host);*/ | ||
869 | 873 | ||
870 | dev_dbg(mmc_dev(host->mmc), "MMC_CLK_RATE: 0x%08x\n", MMC_CLK_RATE); | 874 | dev_dbg(mmc_dev(host->mmc), "MMC_CLK_RATE: 0x%08x\n", MMC_CLK_RATE); |
871 | } else { | 875 | } else { |
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 1ca2c8b9c9b5..6201f3086a02 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c | |||
@@ -951,6 +951,7 @@ static void mmc_read_scrs(struct mmc_host *host) | |||
951 | data.timeout_ns = card->csd.tacc_ns * 10; | 951 | data.timeout_ns = card->csd.tacc_ns * 10; |
952 | data.timeout_clks = card->csd.tacc_clks * 10; | 952 | data.timeout_clks = card->csd.tacc_clks * 10; |
953 | data.blksz_bits = 3; | 953 | data.blksz_bits = 3; |
954 | data.blksz = 1 << 3; | ||
954 | data.blocks = 1; | 955 | data.blocks = 1; |
955 | data.flags = MMC_DATA_READ; | 956 | data.flags = MMC_DATA_READ; |
956 | data.sg = &sg; | 957 | data.sg = &sg; |
diff --git a/drivers/mmc/mmc_block.c b/drivers/mmc/mmc_block.c index 06bd1f4cb9b1..e39cc05c64c2 100644 --- a/drivers/mmc/mmc_block.c +++ b/drivers/mmc/mmc_block.c | |||
@@ -175,6 +175,7 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) | |||
175 | brq.data.timeout_ns = card->csd.tacc_ns * 10; | 175 | brq.data.timeout_ns = card->csd.tacc_ns * 10; |
176 | brq.data.timeout_clks = card->csd.tacc_clks * 10; | 176 | brq.data.timeout_clks = card->csd.tacc_clks * 10; |
177 | brq.data.blksz_bits = md->block_bits; | 177 | brq.data.blksz_bits = md->block_bits; |
178 | brq.data.blksz = 1 << md->block_bits; | ||
178 | brq.data.blocks = req->nr_sectors >> (md->block_bits - 9); | 179 | brq.data.blocks = req->nr_sectors >> (md->block_bits - 9); |
179 | brq.stop.opcode = MMC_STOP_TRANSMISSION; | 180 | brq.stop.opcode = MMC_STOP_TRANSMISSION; |
180 | brq.stop.arg = 0; | 181 | brq.stop.arg = 0; |
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index f97b472085cb..b49368fd96b8 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -119,7 +119,7 @@ static void pxamci_setup_data(struct pxamci_host *host, struct mmc_data *data) | |||
119 | nob = 0xffff; | 119 | nob = 0xffff; |
120 | 120 | ||
121 | writel(nob, host->base + MMC_NOB); | 121 | writel(nob, host->base + MMC_NOB); |
122 | writel(1 << data->blksz_bits, host->base + MMC_BLKLEN); | 122 | writel(data->blksz, host->base + MMC_BLKLEN); |
123 | 123 | ||
124 | clks = (unsigned long long)data->timeout_ns * CLOCKRATE; | 124 | clks = (unsigned long long)data->timeout_ns * CLOCKRATE; |
125 | do_div(clks, 1000000000UL); | 125 | do_div(clks, 1000000000UL); |
@@ -283,7 +283,7 @@ static int pxamci_data_done(struct pxamci_host *host, unsigned int stat) | |||
283 | * data blocks as being in error. | 283 | * data blocks as being in error. |
284 | */ | 284 | */ |
285 | if (data->error == MMC_ERR_NONE) | 285 | if (data->error == MMC_ERR_NONE) |
286 | data->bytes_xfered = data->blocks << data->blksz_bits; | 286 | data->bytes_xfered = data->blocks * data->blksz; |
287 | else | 287 | else |
288 | data->bytes_xfered = 0; | 288 | data->bytes_xfered = 0; |
289 | 289 | ||
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 39b3d97f891e..8167332d4013 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -662,14 +662,14 @@ static void wbsd_prepare_data(struct wbsd_host *host, struct mmc_data *data) | |||
662 | unsigned long dmaflags; | 662 | unsigned long dmaflags; |
663 | 663 | ||
664 | DBGF("blksz %04x blks %04x flags %08x\n", | 664 | DBGF("blksz %04x blks %04x flags %08x\n", |
665 | 1 << data->blksz_bits, data->blocks, data->flags); | 665 | data->blksz, data->blocks, data->flags); |
666 | DBGF("tsac %d ms nsac %d clk\n", | 666 | DBGF("tsac %d ms nsac %d clk\n", |
667 | data->timeout_ns / 1000000, data->timeout_clks); | 667 | data->timeout_ns / 1000000, data->timeout_clks); |
668 | 668 | ||
669 | /* | 669 | /* |
670 | * Calculate size. | 670 | * Calculate size. |
671 | */ | 671 | */ |
672 | host->size = data->blocks << data->blksz_bits; | 672 | host->size = data->blocks * data->blksz; |
673 | 673 | ||
674 | /* | 674 | /* |
675 | * Check timeout values for overflow. | 675 | * Check timeout values for overflow. |
@@ -696,12 +696,12 @@ static void wbsd_prepare_data(struct wbsd_host *host, struct mmc_data *data) | |||
696 | * Two bytes are needed for each data line. | 696 | * Two bytes are needed for each data line. |
697 | */ | 697 | */ |
698 | if (host->bus_width == MMC_BUS_WIDTH_1) { | 698 | if (host->bus_width == MMC_BUS_WIDTH_1) { |
699 | blksize = (1 << data->blksz_bits) + 2; | 699 | blksize = data->blksz + 2; |
700 | 700 | ||
701 | wbsd_write_index(host, WBSD_IDX_PBSMSB, (blksize >> 4) & 0xF0); | 701 | wbsd_write_index(host, WBSD_IDX_PBSMSB, (blksize >> 4) & 0xF0); |
702 | wbsd_write_index(host, WBSD_IDX_PBSLSB, blksize & 0xFF); | 702 | wbsd_write_index(host, WBSD_IDX_PBSLSB, blksize & 0xFF); |
703 | } else if (host->bus_width == MMC_BUS_WIDTH_4) { | 703 | } else if (host->bus_width == MMC_BUS_WIDTH_4) { |
704 | blksize = (1 << data->blksz_bits) + 2 * 4; | 704 | blksize = data->blksz + 2 * 4; |
705 | 705 | ||
706 | wbsd_write_index(host, WBSD_IDX_PBSMSB, | 706 | wbsd_write_index(host, WBSD_IDX_PBSMSB, |
707 | ((blksize >> 4) & 0xF0) | WBSD_DATA_WIDTH); | 707 | ((blksize >> 4) & 0xF0) | WBSD_DATA_WIDTH); |
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 1363083b4d83..14dbad14afb6 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <linux/mii.h> | 52 | #include <linux/mii.h> |
53 | #include <linux/skbuff.h> | 53 | #include <linux/skbuff.h> |
54 | #include <linux/delay.h> | 54 | #include <linux/delay.h> |
55 | #include <linux/crc32.h> | ||
55 | #include <asm/mipsregs.h> | 56 | #include <asm/mipsregs.h> |
56 | #include <asm/irq.h> | 57 | #include <asm/irq.h> |
57 | #include <asm/io.h> | 58 | #include <asm/io.h> |
@@ -2070,23 +2071,6 @@ static void au1000_tx_timeout(struct net_device *dev) | |||
2070 | netif_wake_queue(dev); | 2071 | netif_wake_queue(dev); |
2071 | } | 2072 | } |
2072 | 2073 | ||
2073 | |||
2074 | static unsigned const ethernet_polynomial = 0x04c11db7U; | ||
2075 | static inline u32 ether_crc(int length, unsigned char *data) | ||
2076 | { | ||
2077 | int crc = -1; | ||
2078 | |||
2079 | while(--length >= 0) { | ||
2080 | unsigned char current_octet = *data++; | ||
2081 | int bit; | ||
2082 | for (bit = 0; bit < 8; bit++, current_octet >>= 1) | ||
2083 | crc = (crc << 1) ^ | ||
2084 | ((crc < 0) ^ (current_octet & 1) ? | ||
2085 | ethernet_polynomial : 0); | ||
2086 | } | ||
2087 | return crc; | ||
2088 | } | ||
2089 | |||
2090 | static void set_rx_mode(struct net_device *dev) | 2074 | static void set_rx_mode(struct net_device *dev) |
2091 | { | 2075 | { |
2092 | struct au1000_private *aup = (struct au1000_private *) dev->priv; | 2076 | struct au1000_private *aup = (struct au1000_private *) dev->priv; |
diff --git a/drivers/net/b44.c b/drivers/net/b44.c index 3d306681919e..d8233e0b7899 100644 --- a/drivers/net/b44.c +++ b/drivers/net/b44.c | |||
@@ -650,9 +650,11 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
650 | 650 | ||
651 | /* Hardware bug work-around, the chip is unable to do PCI DMA | 651 | /* Hardware bug work-around, the chip is unable to do PCI DMA |
652 | to/from anything above 1GB :-( */ | 652 | to/from anything above 1GB :-( */ |
653 | if (mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { | 653 | if (dma_mapping_error(mapping) || |
654 | mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { | ||
654 | /* Sigh... */ | 655 | /* Sigh... */ |
655 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); | 656 | if (!dma_mapping_error(mapping)) |
657 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); | ||
656 | dev_kfree_skb_any(skb); | 658 | dev_kfree_skb_any(skb); |
657 | skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA); | 659 | skb = __dev_alloc_skb(RX_PKT_BUF_SZ,GFP_DMA); |
658 | if (skb == NULL) | 660 | if (skb == NULL) |
@@ -660,8 +662,10 @@ static int b44_alloc_rx_skb(struct b44 *bp, int src_idx, u32 dest_idx_unmasked) | |||
660 | mapping = pci_map_single(bp->pdev, skb->data, | 662 | mapping = pci_map_single(bp->pdev, skb->data, |
661 | RX_PKT_BUF_SZ, | 663 | RX_PKT_BUF_SZ, |
662 | PCI_DMA_FROMDEVICE); | 664 | PCI_DMA_FROMDEVICE); |
663 | if (mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { | 665 | if (dma_mapping_error(mapping) || |
664 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); | 666 | mapping + RX_PKT_BUF_SZ > B44_DMA_MASK) { |
667 | if (!dma_mapping_error(mapping)) | ||
668 | pci_unmap_single(bp->pdev, mapping, RX_PKT_BUF_SZ,PCI_DMA_FROMDEVICE); | ||
665 | dev_kfree_skb_any(skb); | 669 | dev_kfree_skb_any(skb); |
666 | return -ENOMEM; | 670 | return -ENOMEM; |
667 | } | 671 | } |
@@ -967,9 +971,10 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
967 | } | 971 | } |
968 | 972 | ||
969 | mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); | 973 | mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE); |
970 | if (mapping + len > B44_DMA_MASK) { | 974 | if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) { |
971 | /* Chip can't handle DMA to/from >1GB, use bounce buffer */ | 975 | /* Chip can't handle DMA to/from >1GB, use bounce buffer */ |
972 | pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); | 976 | if (!dma_mapping_error(mapping)) |
977 | pci_unmap_single(bp->pdev, mapping, len, PCI_DMA_TODEVICE); | ||
973 | 978 | ||
974 | bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ, | 979 | bounce_skb = __dev_alloc_skb(TX_PKT_BUF_SZ, |
975 | GFP_ATOMIC|GFP_DMA); | 980 | GFP_ATOMIC|GFP_DMA); |
@@ -978,8 +983,9 @@ static int b44_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
978 | 983 | ||
979 | mapping = pci_map_single(bp->pdev, bounce_skb->data, | 984 | mapping = pci_map_single(bp->pdev, bounce_skb->data, |
980 | len, PCI_DMA_TODEVICE); | 985 | len, PCI_DMA_TODEVICE); |
981 | if (mapping + len > B44_DMA_MASK) { | 986 | if (dma_mapping_error(mapping) || mapping + len > B44_DMA_MASK) { |
982 | pci_unmap_single(bp->pdev, mapping, | 987 | if (!dma_mapping_error(mapping)) |
988 | pci_unmap_single(bp->pdev, mapping, | ||
983 | len, PCI_DMA_TODEVICE); | 989 | len, PCI_DMA_TODEVICE); |
984 | dev_kfree_skb_any(bounce_skb); | 990 | dev_kfree_skb_any(bounce_skb); |
985 | goto err_out; | 991 | goto err_out; |
@@ -1203,7 +1209,8 @@ static int b44_alloc_consistent(struct b44 *bp) | |||
1203 | DMA_TABLE_BYTES, | 1209 | DMA_TABLE_BYTES, |
1204 | DMA_BIDIRECTIONAL); | 1210 | DMA_BIDIRECTIONAL); |
1205 | 1211 | ||
1206 | if (rx_ring_dma + size > B44_DMA_MASK) { | 1212 | if (dma_mapping_error(rx_ring_dma) || |
1213 | rx_ring_dma + size > B44_DMA_MASK) { | ||
1207 | kfree(rx_ring); | 1214 | kfree(rx_ring); |
1208 | goto out_err; | 1215 | goto out_err; |
1209 | } | 1216 | } |
@@ -1229,7 +1236,8 @@ static int b44_alloc_consistent(struct b44 *bp) | |||
1229 | DMA_TABLE_BYTES, | 1236 | DMA_TABLE_BYTES, |
1230 | DMA_TO_DEVICE); | 1237 | DMA_TO_DEVICE); |
1231 | 1238 | ||
1232 | if (tx_ring_dma + size > B44_DMA_MASK) { | 1239 | if (dma_mapping_error(tx_ring_dma) || |
1240 | tx_ring_dma + size > B44_DMA_MASK) { | ||
1233 | kfree(tx_ring); | 1241 | kfree(tx_ring); |
1234 | goto out_err; | 1242 | goto out_err; |
1235 | } | 1243 | } |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 5ca99e26660a..54161aef3cac 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -55,8 +55,8 @@ | |||
55 | 55 | ||
56 | #define DRV_MODULE_NAME "bnx2" | 56 | #define DRV_MODULE_NAME "bnx2" |
57 | #define PFX DRV_MODULE_NAME ": " | 57 | #define PFX DRV_MODULE_NAME ": " |
58 | #define DRV_MODULE_VERSION "1.4.39" | 58 | #define DRV_MODULE_VERSION "1.4.40" |
59 | #define DRV_MODULE_RELDATE "March 22, 2006" | 59 | #define DRV_MODULE_RELDATE "May 22, 2006" |
60 | 60 | ||
61 | #define RUN_AT(x) (jiffies + (x)) | 61 | #define RUN_AT(x) (jiffies + (x)) |
62 | 62 | ||
@@ -2945,7 +2945,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
2945 | int buf_size) | 2945 | int buf_size) |
2946 | { | 2946 | { |
2947 | u32 written, offset32, len32; | 2947 | u32 written, offset32, len32; |
2948 | u8 *buf, start[4], end[4]; | 2948 | u8 *buf, start[4], end[4], *flash_buffer = NULL; |
2949 | int rc = 0; | 2949 | int rc = 0; |
2950 | int align_start, align_end; | 2950 | int align_start, align_end; |
2951 | 2951 | ||
@@ -2985,12 +2985,19 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
2985 | memcpy(buf + align_start, data_buf, buf_size); | 2985 | memcpy(buf + align_start, data_buf, buf_size); |
2986 | } | 2986 | } |
2987 | 2987 | ||
2988 | if (bp->flash_info->buffered == 0) { | ||
2989 | flash_buffer = kmalloc(264, GFP_KERNEL); | ||
2990 | if (flash_buffer == NULL) { | ||
2991 | rc = -ENOMEM; | ||
2992 | goto nvram_write_end; | ||
2993 | } | ||
2994 | } | ||
2995 | |||
2988 | written = 0; | 2996 | written = 0; |
2989 | while ((written < len32) && (rc == 0)) { | 2997 | while ((written < len32) && (rc == 0)) { |
2990 | u32 page_start, page_end, data_start, data_end; | 2998 | u32 page_start, page_end, data_start, data_end; |
2991 | u32 addr, cmd_flags; | 2999 | u32 addr, cmd_flags; |
2992 | int i; | 3000 | int i; |
2993 | u8 flash_buffer[264]; | ||
2994 | 3001 | ||
2995 | /* Find the page_start addr */ | 3002 | /* Find the page_start addr */ |
2996 | page_start = offset32 + written; | 3003 | page_start = offset32 + written; |
@@ -3061,7 +3068,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3061 | } | 3068 | } |
3062 | 3069 | ||
3063 | /* Loop to write the new data from data_start to data_end */ | 3070 | /* Loop to write the new data from data_start to data_end */ |
3064 | for (addr = data_start; addr < data_end; addr += 4, i++) { | 3071 | for (addr = data_start; addr < data_end; addr += 4, i += 4) { |
3065 | if ((addr == page_end - 4) || | 3072 | if ((addr == page_end - 4) || |
3066 | ((bp->flash_info->buffered) && | 3073 | ((bp->flash_info->buffered) && |
3067 | (addr == data_end - 4))) { | 3074 | (addr == data_end - 4))) { |
@@ -3109,6 +3116,9 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf, | |||
3109 | } | 3116 | } |
3110 | 3117 | ||
3111 | nvram_write_end: | 3118 | nvram_write_end: |
3119 | if (bp->flash_info->buffered == 0) | ||
3120 | kfree(flash_buffer); | ||
3121 | |||
3112 | if (align_start || align_end) | 3122 | if (align_start || align_end) |
3113 | kfree(buf); | 3123 | kfree(buf); |
3114 | return rc; | 3124 | return rc; |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 1f3627470c95..038447fb5c5e 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -53,6 +53,7 @@ | |||
53 | #define DRV_VERSION "v1.17b" | 53 | #define DRV_VERSION "v1.17b" |
54 | #define DRV_RELDATE "2006/03/10" | 54 | #define DRV_RELDATE "2006/03/10" |
55 | #include "dl2k.h" | 55 | #include "dl2k.h" |
56 | #include <linux/dma-mapping.h> | ||
56 | 57 | ||
57 | static char version[] __devinitdata = | 58 | static char version[] __devinitdata = |
58 | KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n"; | 59 | KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n"; |
@@ -765,7 +766,7 @@ rio_free_tx (struct net_device *dev, int irq) | |||
765 | break; | 766 | break; |
766 | skb = np->tx_skbuff[entry]; | 767 | skb = np->tx_skbuff[entry]; |
767 | pci_unmap_single (np->pdev, | 768 | pci_unmap_single (np->pdev, |
768 | np->tx_ring[entry].fraginfo & 0xffffffffffff, | 769 | np->tx_ring[entry].fraginfo & DMA_48BIT_MASK, |
769 | skb->len, PCI_DMA_TODEVICE); | 770 | skb->len, PCI_DMA_TODEVICE); |
770 | if (irq) | 771 | if (irq) |
771 | dev_kfree_skb_irq (skb); | 772 | dev_kfree_skb_irq (skb); |
@@ -893,7 +894,7 @@ receive_packet (struct net_device *dev) | |||
893 | /* Small skbuffs for short packets */ | 894 | /* Small skbuffs for short packets */ |
894 | if (pkt_len > copy_thresh) { | 895 | if (pkt_len > copy_thresh) { |
895 | pci_unmap_single (np->pdev, | 896 | pci_unmap_single (np->pdev, |
896 | desc->fraginfo & 0xffffffffffff, | 897 | desc->fraginfo & DMA_48BIT_MASK, |
897 | np->rx_buf_sz, | 898 | np->rx_buf_sz, |
898 | PCI_DMA_FROMDEVICE); | 899 | PCI_DMA_FROMDEVICE); |
899 | skb_put (skb = np->rx_skbuff[entry], pkt_len); | 900 | skb_put (skb = np->rx_skbuff[entry], pkt_len); |
@@ -901,7 +902,7 @@ receive_packet (struct net_device *dev) | |||
901 | } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { | 902 | } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { |
902 | pci_dma_sync_single_for_cpu(np->pdev, | 903 | pci_dma_sync_single_for_cpu(np->pdev, |
903 | desc->fraginfo & | 904 | desc->fraginfo & |
904 | 0xffffffffffff, | 905 | DMA_48BIT_MASK, |
905 | np->rx_buf_sz, | 906 | np->rx_buf_sz, |
906 | PCI_DMA_FROMDEVICE); | 907 | PCI_DMA_FROMDEVICE); |
907 | skb->dev = dev; | 908 | skb->dev = dev; |
@@ -913,7 +914,7 @@ receive_packet (struct net_device *dev) | |||
913 | skb_put (skb, pkt_len); | 914 | skb_put (skb, pkt_len); |
914 | pci_dma_sync_single_for_device(np->pdev, | 915 | pci_dma_sync_single_for_device(np->pdev, |
915 | desc->fraginfo & | 916 | desc->fraginfo & |
916 | 0xffffffffffff, | 917 | DMA_48BIT_MASK, |
917 | np->rx_buf_sz, | 918 | np->rx_buf_sz, |
918 | PCI_DMA_FROMDEVICE); | 919 | PCI_DMA_FROMDEVICE); |
919 | } | 920 | } |
@@ -1800,7 +1801,7 @@ rio_close (struct net_device *dev) | |||
1800 | skb = np->rx_skbuff[i]; | 1801 | skb = np->rx_skbuff[i]; |
1801 | if (skb) { | 1802 | if (skb) { |
1802 | pci_unmap_single(np->pdev, | 1803 | pci_unmap_single(np->pdev, |
1803 | np->rx_ring[i].fraginfo & 0xffffffffffff, | 1804 | np->rx_ring[i].fraginfo & DMA_48BIT_MASK, |
1804 | skb->len, PCI_DMA_FROMDEVICE); | 1805 | skb->len, PCI_DMA_FROMDEVICE); |
1805 | dev_kfree_skb (skb); | 1806 | dev_kfree_skb (skb); |
1806 | np->rx_skbuff[i] = NULL; | 1807 | np->rx_skbuff[i] = NULL; |
@@ -1810,7 +1811,7 @@ rio_close (struct net_device *dev) | |||
1810 | skb = np->tx_skbuff[i]; | 1811 | skb = np->tx_skbuff[i]; |
1811 | if (skb) { | 1812 | if (skb) { |
1812 | pci_unmap_single(np->pdev, | 1813 | pci_unmap_single(np->pdev, |
1813 | np->tx_ring[i].fraginfo & 0xffffffffffff, | 1814 | np->tx_ring[i].fraginfo & DMA_48BIT_MASK, |
1814 | skb->len, PCI_DMA_TODEVICE); | 1815 | skb->len, PCI_DMA_TODEVICE); |
1815 | dev_kfree_skb (skb); | 1816 | dev_kfree_skb (skb); |
1816 | np->tx_skbuff[i] = NULL; | 1817 | np->tx_skbuff[i] = NULL; |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index f7235c9bc421..705e1229d89d 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -2891,78 +2891,6 @@ static int nv_open(struct net_device *dev) | |||
2891 | goto out_drain; | 2891 | goto out_drain; |
2892 | } | 2892 | } |
2893 | 2893 | ||
2894 | if (np->msi_flags & NV_MSI_X_CAPABLE) { | ||
2895 | for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) { | ||
2896 | np->msi_x_entry[i].entry = i; | ||
2897 | } | ||
2898 | if ((ret = pci_enable_msix(np->pci_dev, np->msi_x_entry, (np->msi_flags & NV_MSI_X_VECTORS_MASK))) == 0) { | ||
2899 | np->msi_flags |= NV_MSI_X_ENABLED; | ||
2900 | if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT) { | ||
2901 | /* Request irq for rx handling */ | ||
2902 | if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_RX].vector, &nv_nic_irq_rx, SA_SHIRQ, dev->name, dev) != 0) { | ||
2903 | printk(KERN_INFO "forcedeth: request_irq failed for rx %d\n", ret); | ||
2904 | pci_disable_msix(np->pci_dev); | ||
2905 | np->msi_flags &= ~NV_MSI_X_ENABLED; | ||
2906 | goto out_drain; | ||
2907 | } | ||
2908 | /* Request irq for tx handling */ | ||
2909 | if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_TX].vector, &nv_nic_irq_tx, SA_SHIRQ, dev->name, dev) != 0) { | ||
2910 | printk(KERN_INFO "forcedeth: request_irq failed for tx %d\n", ret); | ||
2911 | pci_disable_msix(np->pci_dev); | ||
2912 | np->msi_flags &= ~NV_MSI_X_ENABLED; | ||
2913 | goto out_drain; | ||
2914 | } | ||
2915 | /* Request irq for link and timer handling */ | ||
2916 | if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_OTHER].vector, &nv_nic_irq_other, SA_SHIRQ, dev->name, dev) != 0) { | ||
2917 | printk(KERN_INFO "forcedeth: request_irq failed for link %d\n", ret); | ||
2918 | pci_disable_msix(np->pci_dev); | ||
2919 | np->msi_flags &= ~NV_MSI_X_ENABLED; | ||
2920 | goto out_drain; | ||
2921 | } | ||
2922 | |||
2923 | /* map interrupts to their respective vector */ | ||
2924 | writel(0, base + NvRegMSIXMap0); | ||
2925 | writel(0, base + NvRegMSIXMap1); | ||
2926 | set_msix_vector_map(dev, NV_MSI_X_VECTOR_RX, NVREG_IRQ_RX_ALL); | ||
2927 | set_msix_vector_map(dev, NV_MSI_X_VECTOR_TX, NVREG_IRQ_TX_ALL); | ||
2928 | set_msix_vector_map(dev, NV_MSI_X_VECTOR_OTHER, NVREG_IRQ_OTHER); | ||
2929 | } else { | ||
2930 | /* Request irq for all interrupts */ | ||
2931 | if (request_irq(np->msi_x_entry[NV_MSI_X_VECTOR_ALL].vector, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) { | ||
2932 | printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret); | ||
2933 | pci_disable_msix(np->pci_dev); | ||
2934 | np->msi_flags &= ~NV_MSI_X_ENABLED; | ||
2935 | goto out_drain; | ||
2936 | } | ||
2937 | |||
2938 | /* map interrupts to vector 0 */ | ||
2939 | writel(0, base + NvRegMSIXMap0); | ||
2940 | writel(0, base + NvRegMSIXMap1); | ||
2941 | } | ||
2942 | } | ||
2943 | } | ||
2944 | if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) { | ||
2945 | if ((ret = pci_enable_msi(np->pci_dev)) == 0) { | ||
2946 | np->msi_flags |= NV_MSI_ENABLED; | ||
2947 | if (request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) { | ||
2948 | printk(KERN_INFO "forcedeth: request_irq failed %d\n", ret); | ||
2949 | pci_disable_msi(np->pci_dev); | ||
2950 | np->msi_flags &= ~NV_MSI_ENABLED; | ||
2951 | goto out_drain; | ||
2952 | } | ||
2953 | |||
2954 | /* map interrupts to vector 0 */ | ||
2955 | writel(0, base + NvRegMSIMap0); | ||
2956 | writel(0, base + NvRegMSIMap1); | ||
2957 | /* enable msi vector 0 */ | ||
2958 | writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask); | ||
2959 | } | ||
2960 | } | ||
2961 | if (ret != 0) { | ||
2962 | if (request_irq(np->pci_dev->irq, &nv_nic_irq, SA_SHIRQ, dev->name, dev) != 0) | ||
2963 | goto out_drain; | ||
2964 | } | ||
2965 | |||
2966 | /* ask for interrupts */ | 2894 | /* ask for interrupts */ |
2967 | nv_enable_hw_interrupts(dev, np->irqmask); | 2895 | nv_enable_hw_interrupts(dev, np->irqmask); |
2968 | 2896 | ||
diff --git a/drivers/net/irda/Makefile b/drivers/net/irda/Makefile index 27ab75f20799..c1ce2398efea 100644 --- a/drivers/net/irda/Makefile +++ b/drivers/net/irda/Makefile | |||
@@ -46,4 +46,4 @@ obj-$(CONFIG_MA600_DONGLE) += ma600-sir.o | |||
46 | obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o | 46 | obj-$(CONFIG_TOIM3232_DONGLE) += toim3232-sir.o |
47 | 47 | ||
48 | # The SIR helper module | 48 | # The SIR helper module |
49 | sir-dev-objs := sir_dev.o sir_dongle.o sir_kthread.o | 49 | sir-dev-objs := sir_dev.o sir_dongle.o |
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c index 96bdb73c2283..cd87593e4e8a 100644 --- a/drivers/net/irda/irda-usb.c +++ b/drivers/net/irda/irda-usb.c | |||
@@ -1778,7 +1778,7 @@ static int irda_usb_probe(struct usb_interface *intf, | |||
1778 | 1778 | ||
1779 | if (self->needspatch) { | 1779 | if (self->needspatch) { |
1780 | ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0), | 1780 | ret = usb_control_msg (self->usbdev, usb_sndctrlpipe (self->usbdev, 0), |
1781 | 0x02, 0x40, 0, 0, 0, 0, msecs_to_jiffies(500)); | 1781 | 0x02, 0x40, 0, 0, NULL, 0, 500); |
1782 | if (ret < 0) { | 1782 | if (ret < 0) { |
1783 | IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret); | 1783 | IRDA_DEBUG (0, "usb_control_msg failed %d\n", ret); |
1784 | goto err_out_3; | 1784 | goto err_out_3; |
diff --git a/drivers/net/irda/sir-dev.h b/drivers/net/irda/sir-dev.h index f69fb4cec76f..9fa294a546d6 100644 --- a/drivers/net/irda/sir-dev.h +++ b/drivers/net/irda/sir-dev.h | |||
@@ -15,23 +15,14 @@ | |||
15 | #define IRDA_SIR_H | 15 | #define IRDA_SIR_H |
16 | 16 | ||
17 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
18 | #include <linux/workqueue.h> | ||
18 | 19 | ||
19 | #include <net/irda/irda.h> | 20 | #include <net/irda/irda.h> |
20 | #include <net/irda/irda_device.h> // iobuff_t | 21 | #include <net/irda/irda_device.h> // iobuff_t |
21 | 22 | ||
22 | /* FIXME: unify irda_request with sir_fsm! */ | ||
23 | |||
24 | struct irda_request { | ||
25 | struct list_head lh_request; | ||
26 | unsigned long pending; | ||
27 | void (*func)(void *); | ||
28 | void *data; | ||
29 | struct timer_list timer; | ||
30 | }; | ||
31 | |||
32 | struct sir_fsm { | 23 | struct sir_fsm { |
33 | struct semaphore sem; | 24 | struct semaphore sem; |
34 | struct irda_request rq; | 25 | struct work_struct work; |
35 | unsigned state, substate; | 26 | unsigned state, substate; |
36 | int param; | 27 | int param; |
37 | int result; | 28 | int result; |
diff --git a/drivers/net/irda/sir_dev.c b/drivers/net/irda/sir_dev.c index ea7c9464d46a..3b5854d10c17 100644 --- a/drivers/net/irda/sir_dev.c +++ b/drivers/net/irda/sir_dev.c | |||
@@ -23,6 +23,298 @@ | |||
23 | 23 | ||
24 | #include "sir-dev.h" | 24 | #include "sir-dev.h" |
25 | 25 | ||
26 | |||
27 | static struct workqueue_struct *irda_sir_wq; | ||
28 | |||
29 | /* STATE MACHINE */ | ||
30 | |||
31 | /* substate handler of the config-fsm to handle the cases where we want | ||
32 | * to wait for transmit completion before changing the port configuration | ||
33 | */ | ||
34 | |||
35 | static int sirdev_tx_complete_fsm(struct sir_dev *dev) | ||
36 | { | ||
37 | struct sir_fsm *fsm = &dev->fsm; | ||
38 | unsigned next_state, delay; | ||
39 | unsigned bytes_left; | ||
40 | |||
41 | do { | ||
42 | next_state = fsm->substate; /* default: stay in current substate */ | ||
43 | delay = 0; | ||
44 | |||
45 | switch(fsm->substate) { | ||
46 | |||
47 | case SIRDEV_STATE_WAIT_XMIT: | ||
48 | if (dev->drv->chars_in_buffer) | ||
49 | bytes_left = dev->drv->chars_in_buffer(dev); | ||
50 | else | ||
51 | bytes_left = 0; | ||
52 | if (!bytes_left) { | ||
53 | next_state = SIRDEV_STATE_WAIT_UNTIL_SENT; | ||
54 | break; | ||
55 | } | ||
56 | |||
57 | if (dev->speed > 115200) | ||
58 | delay = (bytes_left*8*10000) / (dev->speed/100); | ||
59 | else if (dev->speed > 0) | ||
60 | delay = (bytes_left*10*10000) / (dev->speed/100); | ||
61 | else | ||
62 | delay = 0; | ||
63 | /* expected delay (usec) until remaining bytes are sent */ | ||
64 | if (delay < 100) { | ||
65 | udelay(delay); | ||
66 | delay = 0; | ||
67 | break; | ||
68 | } | ||
69 | /* sleep some longer delay (msec) */ | ||
70 | delay = (delay+999) / 1000; | ||
71 | break; | ||
72 | |||
73 | case SIRDEV_STATE_WAIT_UNTIL_SENT: | ||
74 | /* block until underlaying hardware buffer are empty */ | ||
75 | if (dev->drv->wait_until_sent) | ||
76 | dev->drv->wait_until_sent(dev); | ||
77 | next_state = SIRDEV_STATE_TX_DONE; | ||
78 | break; | ||
79 | |||
80 | case SIRDEV_STATE_TX_DONE: | ||
81 | return 0; | ||
82 | |||
83 | default: | ||
84 | IRDA_ERROR("%s - undefined state\n", __FUNCTION__); | ||
85 | return -EINVAL; | ||
86 | } | ||
87 | fsm->substate = next_state; | ||
88 | } while (delay == 0); | ||
89 | return delay; | ||
90 | } | ||
91 | |||
92 | /* | ||
93 | * Function sirdev_config_fsm | ||
94 | * | ||
95 | * State machine to handle the configuration of the device (and attached dongle, if any). | ||
96 | * This handler is scheduled for execution in kIrDAd context, so we can sleep. | ||
97 | * however, kIrDAd is shared by all sir_dev devices so we better don't sleep there too | ||
98 | * long. Instead, for longer delays we start a timer to reschedule us later. | ||
99 | * On entry, fsm->sem is always locked and the netdev xmit queue stopped. | ||
100 | * Both must be unlocked/restarted on completion - but only on final exit. | ||
101 | */ | ||
102 | |||
103 | static void sirdev_config_fsm(void *data) | ||
104 | { | ||
105 | struct sir_dev *dev = data; | ||
106 | struct sir_fsm *fsm = &dev->fsm; | ||
107 | int next_state; | ||
108 | int ret = -1; | ||
109 | unsigned delay; | ||
110 | |||
111 | IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies); | ||
112 | |||
113 | do { | ||
114 | IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n", | ||
115 | __FUNCTION__, fsm->state, fsm->substate); | ||
116 | |||
117 | next_state = fsm->state; | ||
118 | delay = 0; | ||
119 | |||
120 | switch(fsm->state) { | ||
121 | |||
122 | case SIRDEV_STATE_DONGLE_OPEN: | ||
123 | if (dev->dongle_drv != NULL) { | ||
124 | ret = sirdev_put_dongle(dev); | ||
125 | if (ret) { | ||
126 | fsm->result = -EINVAL; | ||
127 | next_state = SIRDEV_STATE_ERROR; | ||
128 | break; | ||
129 | } | ||
130 | } | ||
131 | |||
132 | /* Initialize dongle */ | ||
133 | ret = sirdev_get_dongle(dev, fsm->param); | ||
134 | if (ret) { | ||
135 | fsm->result = ret; | ||
136 | next_state = SIRDEV_STATE_ERROR; | ||
137 | break; | ||
138 | } | ||
139 | |||
140 | /* Dongles are powered through the modem control lines which | ||
141 | * were just set during open. Before resetting, let's wait for | ||
142 | * the power to stabilize. This is what some dongle drivers did | ||
143 | * in open before, while others didn't - should be safe anyway. | ||
144 | */ | ||
145 | |||
146 | delay = 50; | ||
147 | fsm->substate = SIRDEV_STATE_DONGLE_RESET; | ||
148 | next_state = SIRDEV_STATE_DONGLE_RESET; | ||
149 | |||
150 | fsm->param = 9600; | ||
151 | |||
152 | break; | ||
153 | |||
154 | case SIRDEV_STATE_DONGLE_CLOSE: | ||
155 | /* shouldn't we just treat this as success=? */ | ||
156 | if (dev->dongle_drv == NULL) { | ||
157 | fsm->result = -EINVAL; | ||
158 | next_state = SIRDEV_STATE_ERROR; | ||
159 | break; | ||
160 | } | ||
161 | |||
162 | ret = sirdev_put_dongle(dev); | ||
163 | if (ret) { | ||
164 | fsm->result = ret; | ||
165 | next_state = SIRDEV_STATE_ERROR; | ||
166 | break; | ||
167 | } | ||
168 | next_state = SIRDEV_STATE_DONE; | ||
169 | break; | ||
170 | |||
171 | case SIRDEV_STATE_SET_DTR_RTS: | ||
172 | ret = sirdev_set_dtr_rts(dev, | ||
173 | (fsm->param&0x02) ? TRUE : FALSE, | ||
174 | (fsm->param&0x01) ? TRUE : FALSE); | ||
175 | next_state = SIRDEV_STATE_DONE; | ||
176 | break; | ||
177 | |||
178 | case SIRDEV_STATE_SET_SPEED: | ||
179 | fsm->substate = SIRDEV_STATE_WAIT_XMIT; | ||
180 | next_state = SIRDEV_STATE_DONGLE_CHECK; | ||
181 | break; | ||
182 | |||
183 | case SIRDEV_STATE_DONGLE_CHECK: | ||
184 | ret = sirdev_tx_complete_fsm(dev); | ||
185 | if (ret < 0) { | ||
186 | fsm->result = ret; | ||
187 | next_state = SIRDEV_STATE_ERROR; | ||
188 | break; | ||
189 | } | ||
190 | if ((delay=ret) != 0) | ||
191 | break; | ||
192 | |||
193 | if (dev->dongle_drv) { | ||
194 | fsm->substate = SIRDEV_STATE_DONGLE_RESET; | ||
195 | next_state = SIRDEV_STATE_DONGLE_RESET; | ||
196 | } | ||
197 | else { | ||
198 | dev->speed = fsm->param; | ||
199 | next_state = SIRDEV_STATE_PORT_SPEED; | ||
200 | } | ||
201 | break; | ||
202 | |||
203 | case SIRDEV_STATE_DONGLE_RESET: | ||
204 | if (dev->dongle_drv->reset) { | ||
205 | ret = dev->dongle_drv->reset(dev); | ||
206 | if (ret < 0) { | ||
207 | fsm->result = ret; | ||
208 | next_state = SIRDEV_STATE_ERROR; | ||
209 | break; | ||
210 | } | ||
211 | } | ||
212 | else | ||
213 | ret = 0; | ||
214 | if ((delay=ret) == 0) { | ||
215 | /* set serial port according to dongle default speed */ | ||
216 | if (dev->drv->set_speed) | ||
217 | dev->drv->set_speed(dev, dev->speed); | ||
218 | fsm->substate = SIRDEV_STATE_DONGLE_SPEED; | ||
219 | next_state = SIRDEV_STATE_DONGLE_SPEED; | ||
220 | } | ||
221 | break; | ||
222 | |||
223 | case SIRDEV_STATE_DONGLE_SPEED: | ||
224 | if (dev->dongle_drv->reset) { | ||
225 | ret = dev->dongle_drv->set_speed(dev, fsm->param); | ||
226 | if (ret < 0) { | ||
227 | fsm->result = ret; | ||
228 | next_state = SIRDEV_STATE_ERROR; | ||
229 | break; | ||
230 | } | ||
231 | } | ||
232 | else | ||
233 | ret = 0; | ||
234 | if ((delay=ret) == 0) | ||
235 | next_state = SIRDEV_STATE_PORT_SPEED; | ||
236 | break; | ||
237 | |||
238 | case SIRDEV_STATE_PORT_SPEED: | ||
239 | /* Finally we are ready to change the serial port speed */ | ||
240 | if (dev->drv->set_speed) | ||
241 | dev->drv->set_speed(dev, dev->speed); | ||
242 | dev->new_speed = 0; | ||
243 | next_state = SIRDEV_STATE_DONE; | ||
244 | break; | ||
245 | |||
246 | case SIRDEV_STATE_DONE: | ||
247 | /* Signal network layer so it can send more frames */ | ||
248 | netif_wake_queue(dev->netdev); | ||
249 | next_state = SIRDEV_STATE_COMPLETE; | ||
250 | break; | ||
251 | |||
252 | default: | ||
253 | IRDA_ERROR("%s - undefined state\n", __FUNCTION__); | ||
254 | fsm->result = -EINVAL; | ||
255 | /* fall thru */ | ||
256 | |||
257 | case SIRDEV_STATE_ERROR: | ||
258 | IRDA_ERROR("%s - error: %d\n", __FUNCTION__, fsm->result); | ||
259 | |||
260 | #if 0 /* don't enable this before we have netdev->tx_timeout to recover */ | ||
261 | netif_stop_queue(dev->netdev); | ||
262 | #else | ||
263 | netif_wake_queue(dev->netdev); | ||
264 | #endif | ||
265 | /* fall thru */ | ||
266 | |||
267 | case SIRDEV_STATE_COMPLETE: | ||
268 | /* config change finished, so we are not busy any longer */ | ||
269 | sirdev_enable_rx(dev); | ||
270 | up(&fsm->sem); | ||
271 | return; | ||
272 | } | ||
273 | fsm->state = next_state; | ||
274 | } while(!delay); | ||
275 | |||
276 | queue_delayed_work(irda_sir_wq, &fsm->work, msecs_to_jiffies(delay)); | ||
277 | } | ||
278 | |||
279 | /* schedule some device configuration task for execution by kIrDAd | ||
280 | * on behalf of the above state machine. | ||
281 | * can be called from process or interrupt/tasklet context. | ||
282 | */ | ||
283 | |||
284 | int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned param) | ||
285 | { | ||
286 | struct sir_fsm *fsm = &dev->fsm; | ||
287 | |||
288 | IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param); | ||
289 | |||
290 | if (down_trylock(&fsm->sem)) { | ||
291 | if (in_interrupt() || in_atomic() || irqs_disabled()) { | ||
292 | IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__); | ||
293 | return -EWOULDBLOCK; | ||
294 | } else | ||
295 | down(&fsm->sem); | ||
296 | } | ||
297 | |||
298 | if (fsm->state == SIRDEV_STATE_DEAD) { | ||
299 | /* race with sirdev_close should never happen */ | ||
300 | IRDA_ERROR("%s(), instance staled!\n", __FUNCTION__); | ||
301 | up(&fsm->sem); | ||
302 | return -ESTALE; /* or better EPIPE? */ | ||
303 | } | ||
304 | |||
305 | netif_stop_queue(dev->netdev); | ||
306 | atomic_set(&dev->enable_rx, 0); | ||
307 | |||
308 | fsm->state = initial_state; | ||
309 | fsm->param = param; | ||
310 | fsm->result = 0; | ||
311 | |||
312 | INIT_WORK(&fsm->work, sirdev_config_fsm, dev); | ||
313 | queue_work(irda_sir_wq, &fsm->work); | ||
314 | return 0; | ||
315 | } | ||
316 | |||
317 | |||
26 | /***************************************************************************/ | 318 | /***************************************************************************/ |
27 | 319 | ||
28 | void sirdev_enable_rx(struct sir_dev *dev) | 320 | void sirdev_enable_rx(struct sir_dev *dev) |
@@ -619,10 +911,6 @@ struct sir_dev * sirdev_get_instance(const struct sir_driver *drv, const char *n | |||
619 | spin_lock_init(&dev->tx_lock); | 911 | spin_lock_init(&dev->tx_lock); |
620 | init_MUTEX(&dev->fsm.sem); | 912 | init_MUTEX(&dev->fsm.sem); |
621 | 913 | ||
622 | INIT_LIST_HEAD(&dev->fsm.rq.lh_request); | ||
623 | dev->fsm.rq.pending = 0; | ||
624 | init_timer(&dev->fsm.rq.timer); | ||
625 | |||
626 | dev->drv = drv; | 914 | dev->drv = drv; |
627 | dev->netdev = ndev; | 915 | dev->netdev = ndev; |
628 | 916 | ||
@@ -682,3 +970,22 @@ int sirdev_put_instance(struct sir_dev *dev) | |||
682 | } | 970 | } |
683 | EXPORT_SYMBOL(sirdev_put_instance); | 971 | EXPORT_SYMBOL(sirdev_put_instance); |
684 | 972 | ||
973 | static int __init sir_wq_init(void) | ||
974 | { | ||
975 | irda_sir_wq = create_singlethread_workqueue("irda_sir_wq"); | ||
976 | if (!irda_sir_wq) | ||
977 | return -ENOMEM; | ||
978 | return 0; | ||
979 | } | ||
980 | |||
981 | static void __exit sir_wq_exit(void) | ||
982 | { | ||
983 | destroy_workqueue(irda_sir_wq); | ||
984 | } | ||
985 | |||
986 | module_init(sir_wq_init); | ||
987 | module_exit(sir_wq_exit); | ||
988 | |||
989 | MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>"); | ||
990 | MODULE_DESCRIPTION("IrDA SIR core"); | ||
991 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/irda/sir_kthread.c b/drivers/net/irda/sir_kthread.c deleted file mode 100644 index e3904d6bfecd..000000000000 --- a/drivers/net/irda/sir_kthread.c +++ /dev/null | |||
@@ -1,508 +0,0 @@ | |||
1 | /********************************************************************* | ||
2 | * | ||
3 | * sir_kthread.c: dedicated thread to process scheduled | ||
4 | * sir device setup requests | ||
5 | * | ||
6 | * Copyright (c) 2002 Martin Diehl | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License as | ||
10 | * published by the Free Software Foundation; either version 2 of | ||
11 | * the License, or (at your option) any later version. | ||
12 | * | ||
13 | ********************************************************************/ | ||
14 | |||
15 | #include <linux/module.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/version.h> | ||
18 | #include <linux/init.h> | ||
19 | #include <linux/smp_lock.h> | ||
20 | #include <linux/completion.h> | ||
21 | #include <linux/delay.h> | ||
22 | |||
23 | #include <net/irda/irda.h> | ||
24 | |||
25 | #include "sir-dev.h" | ||
26 | |||
27 | /************************************************************************** | ||
28 | * | ||
29 | * kIrDAd kernel thread and config state machine | ||
30 | * | ||
31 | */ | ||
32 | |||
33 | struct irda_request_queue { | ||
34 | struct list_head request_list; | ||
35 | spinlock_t lock; | ||
36 | task_t *thread; | ||
37 | struct completion exit; | ||
38 | wait_queue_head_t kick, done; | ||
39 | atomic_t num_pending; | ||
40 | }; | ||
41 | |||
42 | static struct irda_request_queue irda_rq_queue; | ||
43 | |||
44 | static int irda_queue_request(struct irda_request *rq) | ||
45 | { | ||
46 | int ret = 0; | ||
47 | unsigned long flags; | ||
48 | |||
49 | if (!test_and_set_bit(0, &rq->pending)) { | ||
50 | spin_lock_irqsave(&irda_rq_queue.lock, flags); | ||
51 | list_add_tail(&rq->lh_request, &irda_rq_queue.request_list); | ||
52 | wake_up(&irda_rq_queue.kick); | ||
53 | atomic_inc(&irda_rq_queue.num_pending); | ||
54 | spin_unlock_irqrestore(&irda_rq_queue.lock, flags); | ||
55 | ret = 1; | ||
56 | } | ||
57 | return ret; | ||
58 | } | ||
59 | |||
60 | static void irda_request_timer(unsigned long data) | ||
61 | { | ||
62 | struct irda_request *rq = (struct irda_request *)data; | ||
63 | unsigned long flags; | ||
64 | |||
65 | spin_lock_irqsave(&irda_rq_queue.lock, flags); | ||
66 | list_add_tail(&rq->lh_request, &irda_rq_queue.request_list); | ||
67 | wake_up(&irda_rq_queue.kick); | ||
68 | spin_unlock_irqrestore(&irda_rq_queue.lock, flags); | ||
69 | } | ||
70 | |||
71 | static int irda_queue_delayed_request(struct irda_request *rq, unsigned long delay) | ||
72 | { | ||
73 | int ret = 0; | ||
74 | struct timer_list *timer = &rq->timer; | ||
75 | |||
76 | if (!test_and_set_bit(0, &rq->pending)) { | ||
77 | timer->expires = jiffies + delay; | ||
78 | timer->function = irda_request_timer; | ||
79 | timer->data = (unsigned long)rq; | ||
80 | atomic_inc(&irda_rq_queue.num_pending); | ||
81 | add_timer(timer); | ||
82 | ret = 1; | ||
83 | } | ||
84 | return ret; | ||
85 | } | ||
86 | |||
87 | static void run_irda_queue(void) | ||
88 | { | ||
89 | unsigned long flags; | ||
90 | struct list_head *entry, *tmp; | ||
91 | struct irda_request *rq; | ||
92 | |||
93 | spin_lock_irqsave(&irda_rq_queue.lock, flags); | ||
94 | list_for_each_safe(entry, tmp, &irda_rq_queue.request_list) { | ||
95 | rq = list_entry(entry, struct irda_request, lh_request); | ||
96 | list_del_init(entry); | ||
97 | spin_unlock_irqrestore(&irda_rq_queue.lock, flags); | ||
98 | |||
99 | clear_bit(0, &rq->pending); | ||
100 | rq->func(rq->data); | ||
101 | |||
102 | if (atomic_dec_and_test(&irda_rq_queue.num_pending)) | ||
103 | wake_up(&irda_rq_queue.done); | ||
104 | |||
105 | spin_lock_irqsave(&irda_rq_queue.lock, flags); | ||
106 | } | ||
107 | spin_unlock_irqrestore(&irda_rq_queue.lock, flags); | ||
108 | } | ||
109 | |||
110 | static int irda_thread(void *startup) | ||
111 | { | ||
112 | DECLARE_WAITQUEUE(wait, current); | ||
113 | |||
114 | daemonize("kIrDAd"); | ||
115 | |||
116 | irda_rq_queue.thread = current; | ||
117 | |||
118 | complete((struct completion *)startup); | ||
119 | |||
120 | while (irda_rq_queue.thread != NULL) { | ||
121 | |||
122 | /* We use TASK_INTERRUPTIBLE, rather than | ||
123 | * TASK_UNINTERRUPTIBLE. Andrew Morton made this | ||
124 | * change ; he told me that it is safe, because "signal | ||
125 | * blocking is now handled in daemonize()", he added | ||
126 | * that the problem is that "uninterruptible sleep | ||
127 | * contributes to load average", making user worry. | ||
128 | * Jean II */ | ||
129 | set_task_state(current, TASK_INTERRUPTIBLE); | ||
130 | add_wait_queue(&irda_rq_queue.kick, &wait); | ||
131 | if (list_empty(&irda_rq_queue.request_list)) | ||
132 | schedule(); | ||
133 | else | ||
134 | __set_task_state(current, TASK_RUNNING); | ||
135 | remove_wait_queue(&irda_rq_queue.kick, &wait); | ||
136 | |||
137 | /* make swsusp happy with our thread */ | ||
138 | try_to_freeze(); | ||
139 | |||
140 | run_irda_queue(); | ||
141 | } | ||
142 | |||
143 | #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,35) | ||
144 | reparent_to_init(); | ||
145 | #endif | ||
146 | complete_and_exit(&irda_rq_queue.exit, 0); | ||
147 | /* never reached */ | ||
148 | return 0; | ||
149 | } | ||
150 | |||
151 | |||
152 | static void flush_irda_queue(void) | ||
153 | { | ||
154 | if (atomic_read(&irda_rq_queue.num_pending)) { | ||
155 | |||
156 | DECLARE_WAITQUEUE(wait, current); | ||
157 | |||
158 | if (!list_empty(&irda_rq_queue.request_list)) | ||
159 | run_irda_queue(); | ||
160 | |||
161 | set_task_state(current, TASK_UNINTERRUPTIBLE); | ||
162 | add_wait_queue(&irda_rq_queue.done, &wait); | ||
163 | if (atomic_read(&irda_rq_queue.num_pending)) | ||
164 | schedule(); | ||
165 | else | ||
166 | __set_task_state(current, TASK_RUNNING); | ||
167 | remove_wait_queue(&irda_rq_queue.done, &wait); | ||
168 | } | ||
169 | } | ||
170 | |||
171 | /* substate handler of the config-fsm to handle the cases where we want | ||
172 | * to wait for transmit completion before changing the port configuration | ||
173 | */ | ||
174 | |||
175 | static int irda_tx_complete_fsm(struct sir_dev *dev) | ||
176 | { | ||
177 | struct sir_fsm *fsm = &dev->fsm; | ||
178 | unsigned next_state, delay; | ||
179 | unsigned bytes_left; | ||
180 | |||
181 | do { | ||
182 | next_state = fsm->substate; /* default: stay in current substate */ | ||
183 | delay = 0; | ||
184 | |||
185 | switch(fsm->substate) { | ||
186 | |||
187 | case SIRDEV_STATE_WAIT_XMIT: | ||
188 | if (dev->drv->chars_in_buffer) | ||
189 | bytes_left = dev->drv->chars_in_buffer(dev); | ||
190 | else | ||
191 | bytes_left = 0; | ||
192 | if (!bytes_left) { | ||
193 | next_state = SIRDEV_STATE_WAIT_UNTIL_SENT; | ||
194 | break; | ||
195 | } | ||
196 | |||
197 | if (dev->speed > 115200) | ||
198 | delay = (bytes_left*8*10000) / (dev->speed/100); | ||
199 | else if (dev->speed > 0) | ||
200 | delay = (bytes_left*10*10000) / (dev->speed/100); | ||
201 | else | ||
202 | delay = 0; | ||
203 | /* expected delay (usec) until remaining bytes are sent */ | ||
204 | if (delay < 100) { | ||
205 | udelay(delay); | ||
206 | delay = 0; | ||
207 | break; | ||
208 | } | ||
209 | /* sleep some longer delay (msec) */ | ||
210 | delay = (delay+999) / 1000; | ||
211 | break; | ||
212 | |||
213 | case SIRDEV_STATE_WAIT_UNTIL_SENT: | ||
214 | /* block until underlaying hardware buffer are empty */ | ||
215 | if (dev->drv->wait_until_sent) | ||
216 | dev->drv->wait_until_sent(dev); | ||
217 | next_state = SIRDEV_STATE_TX_DONE; | ||
218 | break; | ||
219 | |||
220 | case SIRDEV_STATE_TX_DONE: | ||
221 | return 0; | ||
222 | |||
223 | default: | ||
224 | IRDA_ERROR("%s - undefined state\n", __FUNCTION__); | ||
225 | return -EINVAL; | ||
226 | } | ||
227 | fsm->substate = next_state; | ||
228 | } while (delay == 0); | ||
229 | return delay; | ||
230 | } | ||
231 | |||
232 | /* | ||
233 | * Function irda_config_fsm | ||
234 | * | ||
235 | * State machine to handle the configuration of the device (and attached dongle, if any). | ||
236 | * This handler is scheduled for execution in kIrDAd context, so we can sleep. | ||
237 | * however, kIrDAd is shared by all sir_dev devices so we better don't sleep there too | ||
238 | * long. Instead, for longer delays we start a timer to reschedule us later. | ||
239 | * On entry, fsm->sem is always locked and the netdev xmit queue stopped. | ||
240 | * Both must be unlocked/restarted on completion - but only on final exit. | ||
241 | */ | ||
242 | |||
243 | static void irda_config_fsm(void *data) | ||
244 | { | ||
245 | struct sir_dev *dev = data; | ||
246 | struct sir_fsm *fsm = &dev->fsm; | ||
247 | int next_state; | ||
248 | int ret = -1; | ||
249 | unsigned delay; | ||
250 | |||
251 | IRDA_DEBUG(2, "%s(), <%ld>\n", __FUNCTION__, jiffies); | ||
252 | |||
253 | do { | ||
254 | IRDA_DEBUG(3, "%s - state=0x%04x / substate=0x%04x\n", | ||
255 | __FUNCTION__, fsm->state, fsm->substate); | ||
256 | |||
257 | next_state = fsm->state; | ||
258 | delay = 0; | ||
259 | |||
260 | switch(fsm->state) { | ||
261 | |||
262 | case SIRDEV_STATE_DONGLE_OPEN: | ||
263 | if (dev->dongle_drv != NULL) { | ||
264 | ret = sirdev_put_dongle(dev); | ||
265 | if (ret) { | ||
266 | fsm->result = -EINVAL; | ||
267 | next_state = SIRDEV_STATE_ERROR; | ||
268 | break; | ||
269 | } | ||
270 | } | ||
271 | |||
272 | /* Initialize dongle */ | ||
273 | ret = sirdev_get_dongle(dev, fsm->param); | ||
274 | if (ret) { | ||
275 | fsm->result = ret; | ||
276 | next_state = SIRDEV_STATE_ERROR; | ||
277 | break; | ||
278 | } | ||
279 | |||
280 | /* Dongles are powered through the modem control lines which | ||
281 | * were just set during open. Before resetting, let's wait for | ||
282 | * the power to stabilize. This is what some dongle drivers did | ||
283 | * in open before, while others didn't - should be safe anyway. | ||
284 | */ | ||
285 | |||
286 | delay = 50; | ||
287 | fsm->substate = SIRDEV_STATE_DONGLE_RESET; | ||
288 | next_state = SIRDEV_STATE_DONGLE_RESET; | ||
289 | |||
290 | fsm->param = 9600; | ||
291 | |||
292 | break; | ||
293 | |||
294 | case SIRDEV_STATE_DONGLE_CLOSE: | ||
295 | /* shouldn't we just treat this as success=? */ | ||
296 | if (dev->dongle_drv == NULL) { | ||
297 | fsm->result = -EINVAL; | ||
298 | next_state = SIRDEV_STATE_ERROR; | ||
299 | break; | ||
300 | } | ||
301 | |||
302 | ret = sirdev_put_dongle(dev); | ||
303 | if (ret) { | ||
304 | fsm->result = ret; | ||
305 | next_state = SIRDEV_STATE_ERROR; | ||
306 | break; | ||
307 | } | ||
308 | next_state = SIRDEV_STATE_DONE; | ||
309 | break; | ||
310 | |||
311 | case SIRDEV_STATE_SET_DTR_RTS: | ||
312 | ret = sirdev_set_dtr_rts(dev, | ||
313 | (fsm->param&0x02) ? TRUE : FALSE, | ||
314 | (fsm->param&0x01) ? TRUE : FALSE); | ||
315 | next_state = SIRDEV_STATE_DONE; | ||
316 | break; | ||
317 | |||
318 | case SIRDEV_STATE_SET_SPEED: | ||
319 | fsm->substate = SIRDEV_STATE_WAIT_XMIT; | ||
320 | next_state = SIRDEV_STATE_DONGLE_CHECK; | ||
321 | break; | ||
322 | |||
323 | case SIRDEV_STATE_DONGLE_CHECK: | ||
324 | ret = irda_tx_complete_fsm(dev); | ||
325 | if (ret < 0) { | ||
326 | fsm->result = ret; | ||
327 | next_state = SIRDEV_STATE_ERROR; | ||
328 | break; | ||
329 | } | ||
330 | if ((delay=ret) != 0) | ||
331 | break; | ||
332 | |||
333 | if (dev->dongle_drv) { | ||
334 | fsm->substate = SIRDEV_STATE_DONGLE_RESET; | ||
335 | next_state = SIRDEV_STATE_DONGLE_RESET; | ||
336 | } | ||
337 | else { | ||
338 | dev->speed = fsm->param; | ||
339 | next_state = SIRDEV_STATE_PORT_SPEED; | ||
340 | } | ||
341 | break; | ||
342 | |||
343 | case SIRDEV_STATE_DONGLE_RESET: | ||
344 | if (dev->dongle_drv->reset) { | ||
345 | ret = dev->dongle_drv->reset(dev); | ||
346 | if (ret < 0) { | ||
347 | fsm->result = ret; | ||
348 | next_state = SIRDEV_STATE_ERROR; | ||
349 | break; | ||
350 | } | ||
351 | } | ||
352 | else | ||
353 | ret = 0; | ||
354 | if ((delay=ret) == 0) { | ||
355 | /* set serial port according to dongle default speed */ | ||
356 | if (dev->drv->set_speed) | ||
357 | dev->drv->set_speed(dev, dev->speed); | ||
358 | fsm->substate = SIRDEV_STATE_DONGLE_SPEED; | ||
359 | next_state = SIRDEV_STATE_DONGLE_SPEED; | ||
360 | } | ||
361 | break; | ||
362 | |||
363 | case SIRDEV_STATE_DONGLE_SPEED: | ||
364 | if (dev->dongle_drv->reset) { | ||
365 | ret = dev->dongle_drv->set_speed(dev, fsm->param); | ||
366 | if (ret < 0) { | ||
367 | fsm->result = ret; | ||
368 | next_state = SIRDEV_STATE_ERROR; | ||
369 | break; | ||
370 | } | ||
371 | } | ||
372 | else | ||
373 | ret = 0; | ||
374 | if ((delay=ret) == 0) | ||
375 | next_state = SIRDEV_STATE_PORT_SPEED; | ||
376 | break; | ||
377 | |||
378 | case SIRDEV_STATE_PORT_SPEED: | ||
379 | /* Finally we are ready to change the serial port speed */ | ||
380 | if (dev->drv->set_speed) | ||
381 | dev->drv->set_speed(dev, dev->speed); | ||
382 | dev->new_speed = 0; | ||
383 | next_state = SIRDEV_STATE_DONE; | ||
384 | break; | ||
385 | |||
386 | case SIRDEV_STATE_DONE: | ||
387 | /* Signal network layer so it can send more frames */ | ||
388 | netif_wake_queue(dev->netdev); | ||
389 | next_state = SIRDEV_STATE_COMPLETE; | ||
390 | break; | ||
391 | |||
392 | default: | ||
393 | IRDA_ERROR("%s - undefined state\n", __FUNCTION__); | ||
394 | fsm->result = -EINVAL; | ||
395 | /* fall thru */ | ||
396 | |||
397 | case SIRDEV_STATE_ERROR: | ||
398 | IRDA_ERROR("%s - error: %d\n", __FUNCTION__, fsm->result); | ||
399 | |||
400 | #if 0 /* don't enable this before we have netdev->tx_timeout to recover */ | ||
401 | netif_stop_queue(dev->netdev); | ||
402 | #else | ||
403 | netif_wake_queue(dev->netdev); | ||
404 | #endif | ||
405 | /* fall thru */ | ||
406 | |||
407 | case SIRDEV_STATE_COMPLETE: | ||
408 | /* config change finished, so we are not busy any longer */ | ||
409 | sirdev_enable_rx(dev); | ||
410 | up(&fsm->sem); | ||
411 | return; | ||
412 | } | ||
413 | fsm->state = next_state; | ||
414 | } while(!delay); | ||
415 | |||
416 | irda_queue_delayed_request(&fsm->rq, msecs_to_jiffies(delay)); | ||
417 | } | ||
418 | |||
419 | /* schedule some device configuration task for execution by kIrDAd | ||
420 | * on behalf of the above state machine. | ||
421 | * can be called from process or interrupt/tasklet context. | ||
422 | */ | ||
423 | |||
424 | int sirdev_schedule_request(struct sir_dev *dev, int initial_state, unsigned param) | ||
425 | { | ||
426 | struct sir_fsm *fsm = &dev->fsm; | ||
427 | int xmit_was_down; | ||
428 | |||
429 | IRDA_DEBUG(2, "%s - state=0x%04x / param=%u\n", __FUNCTION__, initial_state, param); | ||
430 | |||
431 | if (down_trylock(&fsm->sem)) { | ||
432 | if (in_interrupt() || in_atomic() || irqs_disabled()) { | ||
433 | IRDA_DEBUG(1, "%s(), state machine busy!\n", __FUNCTION__); | ||
434 | return -EWOULDBLOCK; | ||
435 | } else | ||
436 | down(&fsm->sem); | ||
437 | } | ||
438 | |||
439 | if (fsm->state == SIRDEV_STATE_DEAD) { | ||
440 | /* race with sirdev_close should never happen */ | ||
441 | IRDA_ERROR("%s(), instance staled!\n", __FUNCTION__); | ||
442 | up(&fsm->sem); | ||
443 | return -ESTALE; /* or better EPIPE? */ | ||
444 | } | ||
445 | |||
446 | xmit_was_down = netif_queue_stopped(dev->netdev); | ||
447 | netif_stop_queue(dev->netdev); | ||
448 | atomic_set(&dev->enable_rx, 0); | ||
449 | |||
450 | fsm->state = initial_state; | ||
451 | fsm->param = param; | ||
452 | fsm->result = 0; | ||
453 | |||
454 | INIT_LIST_HEAD(&fsm->rq.lh_request); | ||
455 | fsm->rq.pending = 0; | ||
456 | fsm->rq.func = irda_config_fsm; | ||
457 | fsm->rq.data = dev; | ||
458 | |||
459 | if (!irda_queue_request(&fsm->rq)) { /* returns 0 on error! */ | ||
460 | atomic_set(&dev->enable_rx, 1); | ||
461 | if (!xmit_was_down) | ||
462 | netif_wake_queue(dev->netdev); | ||
463 | up(&fsm->sem); | ||
464 | return -EAGAIN; | ||
465 | } | ||
466 | return 0; | ||
467 | } | ||
468 | |||
469 | static int __init irda_thread_create(void) | ||
470 | { | ||
471 | struct completion startup; | ||
472 | int pid; | ||
473 | |||
474 | spin_lock_init(&irda_rq_queue.lock); | ||
475 | irda_rq_queue.thread = NULL; | ||
476 | INIT_LIST_HEAD(&irda_rq_queue.request_list); | ||
477 | init_waitqueue_head(&irda_rq_queue.kick); | ||
478 | init_waitqueue_head(&irda_rq_queue.done); | ||
479 | atomic_set(&irda_rq_queue.num_pending, 0); | ||
480 | |||
481 | init_completion(&startup); | ||
482 | pid = kernel_thread(irda_thread, &startup, CLONE_FS|CLONE_FILES); | ||
483 | if (pid <= 0) | ||
484 | return -EAGAIN; | ||
485 | else | ||
486 | wait_for_completion(&startup); | ||
487 | |||
488 | return 0; | ||
489 | } | ||
490 | |||
491 | static void __exit irda_thread_join(void) | ||
492 | { | ||
493 | if (irda_rq_queue.thread) { | ||
494 | flush_irda_queue(); | ||
495 | init_completion(&irda_rq_queue.exit); | ||
496 | irda_rq_queue.thread = NULL; | ||
497 | wake_up(&irda_rq_queue.kick); | ||
498 | wait_for_completion(&irda_rq_queue.exit); | ||
499 | } | ||
500 | } | ||
501 | |||
502 | module_init(irda_thread_create); | ||
503 | module_exit(irda_thread_join); | ||
504 | |||
505 | MODULE_AUTHOR("Martin Diehl <info@mdiehl.de>"); | ||
506 | MODULE_DESCRIPTION("IrDA SIR core"); | ||
507 | MODULE_LICENSE("GPL"); | ||
508 | |||
diff --git a/drivers/net/irda/smsc-ircc2.c b/drivers/net/irda/smsc-ircc2.c index 58f76cefbc83..a4674044bd6f 100644 --- a/drivers/net/irda/smsc-ircc2.c +++ b/drivers/net/irda/smsc-ircc2.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <linux/rtnetlink.h> | 54 | #include <linux/rtnetlink.h> |
55 | #include <linux/serial_reg.h> | 55 | #include <linux/serial_reg.h> |
56 | #include <linux/dma-mapping.h> | 56 | #include <linux/dma-mapping.h> |
57 | #include <linux/pnp.h> | ||
57 | #include <linux/platform_device.h> | 58 | #include <linux/platform_device.h> |
58 | 59 | ||
59 | #include <asm/io.h> | 60 | #include <asm/io.h> |
@@ -358,6 +359,16 @@ static inline void register_bank(int iobase, int bank) | |||
358 | iobase + IRCC_MASTER); | 359 | iobase + IRCC_MASTER); |
359 | } | 360 | } |
360 | 361 | ||
362 | #ifdef CONFIG_PNP | ||
363 | /* PNP hotplug support */ | ||
364 | static const struct pnp_device_id smsc_ircc_pnp_table[] = { | ||
365 | { .id = "SMCf010", .driver_data = 0 }, | ||
366 | /* and presumably others */ | ||
367 | { } | ||
368 | }; | ||
369 | MODULE_DEVICE_TABLE(pnp, smsc_ircc_pnp_table); | ||
370 | #endif | ||
371 | |||
361 | 372 | ||
362 | /******************************************************************************* | 373 | /******************************************************************************* |
363 | * | 374 | * |
@@ -2072,7 +2083,8 @@ static void smsc_ircc_sir_wait_hw_transmitter_finish(struct smsc_ircc_cb *self) | |||
2072 | 2083 | ||
2073 | /* PROBING | 2084 | /* PROBING |
2074 | * | 2085 | * |
2075 | * | 2086 | * REVISIT we can be told about the device by PNP, and should use that info |
2087 | * instead of probing hardware and creating a platform_device ... | ||
2076 | */ | 2088 | */ |
2077 | 2089 | ||
2078 | static int __init smsc_ircc_look_for_chips(void) | 2090 | static int __init smsc_ircc_look_for_chips(void) |
diff --git a/drivers/net/ixp2000/enp2611.c b/drivers/net/ixp2000/enp2611.c index 6f7dce8eba51..b67f586d7392 100644 --- a/drivers/net/ixp2000/enp2611.c +++ b/drivers/net/ixp2000/enp2611.c | |||
@@ -149,6 +149,8 @@ static void enp2611_check_link_status(unsigned long __dummy) | |||
149 | int status; | 149 | int status; |
150 | 150 | ||
151 | dev = nds[i]; | 151 | dev = nds[i]; |
152 | if (dev == NULL) | ||
153 | continue; | ||
152 | 154 | ||
153 | status = pm3386_is_link_up(i); | 155 | status = pm3386_is_link_up(i); |
154 | if (status && !netif_carrier_ok(dev)) { | 156 | if (status && !netif_carrier_ok(dev)) { |
@@ -191,6 +193,7 @@ static void enp2611_set_port_admin_status(int port, int up) | |||
191 | 193 | ||
192 | static int __init enp2611_init_module(void) | 194 | static int __init enp2611_init_module(void) |
193 | { | 195 | { |
196 | int ports; | ||
194 | int i; | 197 | int i; |
195 | 198 | ||
196 | if (!machine_is_enp2611()) | 199 | if (!machine_is_enp2611()) |
@@ -199,7 +202,8 @@ static int __init enp2611_init_module(void) | |||
199 | caleb_reset(); | 202 | caleb_reset(); |
200 | pm3386_reset(); | 203 | pm3386_reset(); |
201 | 204 | ||
202 | for (i = 0; i < 3; i++) { | 205 | ports = pm3386_port_count(); |
206 | for (i = 0; i < ports; i++) { | ||
203 | nds[i] = ixpdev_alloc(i, sizeof(struct enp2611_ixpdev_priv)); | 207 | nds[i] = ixpdev_alloc(i, sizeof(struct enp2611_ixpdev_priv)); |
204 | if (nds[i] == NULL) { | 208 | if (nds[i] == NULL) { |
205 | while (--i >= 0) | 209 | while (--i >= 0) |
@@ -215,9 +219,10 @@ static int __init enp2611_init_module(void) | |||
215 | 219 | ||
216 | ixp2400_msf_init(&enp2611_msf_parameters); | 220 | ixp2400_msf_init(&enp2611_msf_parameters); |
217 | 221 | ||
218 | if (ixpdev_init(3, nds, enp2611_set_port_admin_status)) { | 222 | if (ixpdev_init(ports, nds, enp2611_set_port_admin_status)) { |
219 | for (i = 0; i < 3; i++) | 223 | for (i = 0; i < ports; i++) |
220 | free_netdev(nds[i]); | 224 | if (nds[i]) |
225 | free_netdev(nds[i]); | ||
221 | return -EINVAL; | 226 | return -EINVAL; |
222 | } | 227 | } |
223 | 228 | ||
diff --git a/drivers/net/ixp2000/pm3386.c b/drivers/net/ixp2000/pm3386.c index 5c7ab7564053..5224651c9aac 100644 --- a/drivers/net/ixp2000/pm3386.c +++ b/drivers/net/ixp2000/pm3386.c | |||
@@ -86,40 +86,53 @@ static void pm3386_port_reg_write(int port, int _reg, int spacing, u16 value) | |||
86 | pm3386_reg_write(port >> 1, reg, value); | 86 | pm3386_reg_write(port >> 1, reg, value); |
87 | } | 87 | } |
88 | 88 | ||
89 | int pm3386_secondary_present(void) | ||
90 | { | ||
91 | return pm3386_reg_read(1, 0) == 0x3386; | ||
92 | } | ||
89 | 93 | ||
90 | void pm3386_reset(void) | 94 | void pm3386_reset(void) |
91 | { | 95 | { |
92 | u8 mac[3][6]; | 96 | u8 mac[3][6]; |
97 | int secondary; | ||
98 | |||
99 | secondary = pm3386_secondary_present(); | ||
93 | 100 | ||
94 | /* Save programmed MAC addresses. */ | 101 | /* Save programmed MAC addresses. */ |
95 | pm3386_get_mac(0, mac[0]); | 102 | pm3386_get_mac(0, mac[0]); |
96 | pm3386_get_mac(1, mac[1]); | 103 | pm3386_get_mac(1, mac[1]); |
97 | pm3386_get_mac(2, mac[2]); | 104 | if (secondary) |
105 | pm3386_get_mac(2, mac[2]); | ||
98 | 106 | ||
99 | /* Assert analog and digital reset. */ | 107 | /* Assert analog and digital reset. */ |
100 | pm3386_reg_write(0, 0x002, 0x0060); | 108 | pm3386_reg_write(0, 0x002, 0x0060); |
101 | pm3386_reg_write(1, 0x002, 0x0060); | 109 | if (secondary) |
110 | pm3386_reg_write(1, 0x002, 0x0060); | ||
102 | mdelay(1); | 111 | mdelay(1); |
103 | 112 | ||
104 | /* Deassert analog reset. */ | 113 | /* Deassert analog reset. */ |
105 | pm3386_reg_write(0, 0x002, 0x0062); | 114 | pm3386_reg_write(0, 0x002, 0x0062); |
106 | pm3386_reg_write(1, 0x002, 0x0062); | 115 | if (secondary) |
116 | pm3386_reg_write(1, 0x002, 0x0062); | ||
107 | mdelay(10); | 117 | mdelay(10); |
108 | 118 | ||
109 | /* Deassert digital reset. */ | 119 | /* Deassert digital reset. */ |
110 | pm3386_reg_write(0, 0x002, 0x0063); | 120 | pm3386_reg_write(0, 0x002, 0x0063); |
111 | pm3386_reg_write(1, 0x002, 0x0063); | 121 | if (secondary) |
122 | pm3386_reg_write(1, 0x002, 0x0063); | ||
112 | mdelay(10); | 123 | mdelay(10); |
113 | 124 | ||
114 | /* Restore programmed MAC addresses. */ | 125 | /* Restore programmed MAC addresses. */ |
115 | pm3386_set_mac(0, mac[0]); | 126 | pm3386_set_mac(0, mac[0]); |
116 | pm3386_set_mac(1, mac[1]); | 127 | pm3386_set_mac(1, mac[1]); |
117 | pm3386_set_mac(2, mac[2]); | 128 | if (secondary) |
129 | pm3386_set_mac(2, mac[2]); | ||
118 | 130 | ||
119 | /* Disable carrier on all ports. */ | 131 | /* Disable carrier on all ports. */ |
120 | pm3386_set_carrier(0, 0); | 132 | pm3386_set_carrier(0, 0); |
121 | pm3386_set_carrier(1, 0); | 133 | pm3386_set_carrier(1, 0); |
122 | pm3386_set_carrier(2, 0); | 134 | if (secondary) |
135 | pm3386_set_carrier(2, 0); | ||
123 | } | 136 | } |
124 | 137 | ||
125 | static u16 swaph(u16 x) | 138 | static u16 swaph(u16 x) |
@@ -127,6 +140,11 @@ static u16 swaph(u16 x) | |||
127 | return ((x << 8) | (x >> 8)) & 0xffff; | 140 | return ((x << 8) | (x >> 8)) & 0xffff; |
128 | } | 141 | } |
129 | 142 | ||
143 | int pm3386_port_count(void) | ||
144 | { | ||
145 | return 2 + pm3386_secondary_present(); | ||
146 | } | ||
147 | |||
130 | void pm3386_init_port(int port) | 148 | void pm3386_init_port(int port) |
131 | { | 149 | { |
132 | int pm = port >> 1; | 150 | int pm = port >> 1; |
diff --git a/drivers/net/ixp2000/pm3386.h b/drivers/net/ixp2000/pm3386.h index fe92bb056ac4..cc4183dca911 100644 --- a/drivers/net/ixp2000/pm3386.h +++ b/drivers/net/ixp2000/pm3386.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define __PM3386_H | 13 | #define __PM3386_H |
14 | 14 | ||
15 | void pm3386_reset(void); | 15 | void pm3386_reset(void); |
16 | int pm3386_port_count(void); | ||
16 | void pm3386_init_port(int port); | 17 | void pm3386_init_port(int port); |
17 | void pm3386_get_mac(int port, u8 *mac); | 18 | void pm3386_get_mac(int port, u8 *mac); |
18 | void pm3386_set_mac(int port, u8 *mac); | 19 | void pm3386_set_mac(int port, u8 *mac); |
diff --git a/drivers/net/ne.c b/drivers/net/ne.c index 93c494bcd18d..b32765215f75 100644 --- a/drivers/net/ne.c +++ b/drivers/net/ne.c | |||
@@ -139,8 +139,9 @@ bad_clone_list[] __initdata = { | |||
139 | 139 | ||
140 | #if defined(CONFIG_PLAT_MAPPI) | 140 | #if defined(CONFIG_PLAT_MAPPI) |
141 | # define DCR_VAL 0x4b | 141 | # define DCR_VAL 0x4b |
142 | #elif defined(CONFIG_PLAT_OAKS32R) | 142 | #elif defined(CONFIG_PLAT_OAKS32R) || \ |
143 | # define DCR_VAL 0x48 | 143 | defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938) |
144 | # define DCR_VAL 0x48 /* 8-bit mode */ | ||
144 | #else | 145 | #else |
145 | # define DCR_VAL 0x49 | 146 | # define DCR_VAL 0x49 |
146 | #endif | 147 | #endif |
@@ -396,10 +397,22 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr) | |||
396 | /* We must set the 8390 for word mode. */ | 397 | /* We must set the 8390 for word mode. */ |
397 | outb_p(DCR_VAL, ioaddr + EN0_DCFG); | 398 | outb_p(DCR_VAL, ioaddr + EN0_DCFG); |
398 | start_page = NESM_START_PG; | 399 | start_page = NESM_START_PG; |
399 | stop_page = NESM_STOP_PG; | 400 | |
401 | /* | ||
402 | * Realtek RTL8019AS datasheet says that the PSTOP register | ||
403 | * shouldn't exceed 0x60 in 8-bit mode. | ||
404 | * This chip can be identified by reading the signature from | ||
405 | * the remote byte count registers (otherwise write-only)... | ||
406 | */ | ||
407 | if ((DCR_VAL & 0x01) == 0 && /* 8-bit mode */ | ||
408 | inb(ioaddr + EN0_RCNTLO) == 0x50 && | ||
409 | inb(ioaddr + EN0_RCNTHI) == 0x70) | ||
410 | stop_page = 0x60; | ||
411 | else | ||
412 | stop_page = NESM_STOP_PG; | ||
400 | } else { | 413 | } else { |
401 | start_page = NE1SM_START_PG; | 414 | start_page = NE1SM_START_PG; |
402 | stop_page = NE1SM_STOP_PG; | 415 | stop_page = NE1SM_STOP_PG; |
403 | } | 416 | } |
404 | 417 | ||
405 | #if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R) | 418 | #if defined(CONFIG_PLAT_MAPPI) || defined(CONFIG_PLAT_OAKS32R) |
@@ -509,15 +522,9 @@ static int __init ne_probe1(struct net_device *dev, int ioaddr) | |||
509 | ei_status.name = name; | 522 | ei_status.name = name; |
510 | ei_status.tx_start_page = start_page; | 523 | ei_status.tx_start_page = start_page; |
511 | ei_status.stop_page = stop_page; | 524 | ei_status.stop_page = stop_page; |
512 | #if defined(CONFIG_TOSHIBA_RBTX4927) || defined(CONFIG_TOSHIBA_RBTX4938) | ||
513 | wordlength = 1; | ||
514 | #endif | ||
515 | 525 | ||
516 | #ifdef CONFIG_PLAT_OAKS32R | 526 | /* Use 16-bit mode only if this wasn't overridden by DCR_VAL */ |
517 | ei_status.word16 = 0; | 527 | ei_status.word16 = (wordlength == 2 && (DCR_VAL & 0x01)); |
518 | #else | ||
519 | ei_status.word16 = (wordlength == 2); | ||
520 | #endif | ||
521 | 528 | ||
522 | ei_status.rx_start_page = start_page + TX_PAGES; | 529 | ei_status.rx_start_page = start_page + TX_PAGES; |
523 | #ifdef PACKETBUF_MEMSIZE | 530 | #ifdef PACKETBUF_MEMSIZE |
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 448a09488529..2ea66aca648b 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c | |||
@@ -1691,17 +1691,6 @@ static void do_set_multicast_list(struct net_device *dev) | |||
1691 | memset(ei_local->mcfilter, 0xFF, 8); | 1691 | memset(ei_local->mcfilter, 0xFF, 8); |
1692 | } | 1692 | } |
1693 | 1693 | ||
1694 | /* | ||
1695 | * DP8390 manuals don't specify any magic sequence for altering | ||
1696 | * the multicast regs on an already running card. To be safe, we | ||
1697 | * ensure multicast mode is off prior to loading up the new hash | ||
1698 | * table. If this proves to be not enough, we can always resort | ||
1699 | * to stopping the NIC, loading the table and then restarting. | ||
1700 | */ | ||
1701 | |||
1702 | if (netif_running(dev)) | ||
1703 | outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR); | ||
1704 | |||
1705 | outb_p(E8390_NODMA + E8390_PAGE1, e8390_base + E8390_CMD); | 1694 | outb_p(E8390_NODMA + E8390_PAGE1, e8390_base + E8390_CMD); |
1706 | for(i = 0; i < 8; i++) | 1695 | for(i = 0; i < 8; i++) |
1707 | { | 1696 | { |
@@ -1715,6 +1704,8 @@ static void do_set_multicast_list(struct net_device *dev) | |||
1715 | outb_p(E8390_RXCONFIG | 0x48, e8390_base + EN0_RXCR); | 1704 | outb_p(E8390_RXCONFIG | 0x48, e8390_base + EN0_RXCR); |
1716 | else | 1705 | else |
1717 | outb_p(E8390_RXCONFIG | 0x40, e8390_base + EN0_RXCR); | 1706 | outb_p(E8390_RXCONFIG | 0x40, e8390_base + EN0_RXCR); |
1707 | |||
1708 | outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base+E8390_CMD); | ||
1718 | } | 1709 | } |
1719 | 1710 | ||
1720 | /* | 1711 | /* |
diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c index 459443b572ce..1b236bdf6b92 100644 --- a/drivers/net/phy/mdio_bus.c +++ b/drivers/net/phy/mdio_bus.c | |||
@@ -60,8 +60,10 @@ int mdiobus_register(struct mii_bus *bus) | |||
60 | for (i = 0; i < PHY_MAX_ADDR; i++) { | 60 | for (i = 0; i < PHY_MAX_ADDR; i++) { |
61 | struct phy_device *phydev; | 61 | struct phy_device *phydev; |
62 | 62 | ||
63 | if (bus->phy_mask & (1 << i)) | 63 | if (bus->phy_mask & (1 << i)) { |
64 | bus->phy_map[i] = NULL; | ||
64 | continue; | 65 | continue; |
66 | } | ||
65 | 67 | ||
66 | phydev = get_phy_device(bus, i); | 68 | phydev = get_phy_device(bus, i); |
67 | 69 | ||
diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index b82191d2bee1..f5a3bf4d959a 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c | |||
@@ -127,6 +127,7 @@ static const struct mii_chip_info { | |||
127 | } mii_chip_table[] = { | 127 | } mii_chip_table[] = { |
128 | { "SiS 900 Internal MII PHY", 0x001d, 0x8000, LAN }, | 128 | { "SiS 900 Internal MII PHY", 0x001d, 0x8000, LAN }, |
129 | { "SiS 7014 Physical Layer Solution", 0x0016, 0xf830, LAN }, | 129 | { "SiS 7014 Physical Layer Solution", 0x0016, 0xf830, LAN }, |
130 | { "SiS 900 on Foxconn 661 7MI", 0x0143, 0xBC70, LAN }, | ||
130 | { "Altimata AC101LF PHY", 0x0022, 0x5520, LAN }, | 131 | { "Altimata AC101LF PHY", 0x0022, 0x5520, LAN }, |
131 | { "ADM 7001 LAN PHY", 0x002e, 0xcc60, LAN }, | 132 | { "ADM 7001 LAN PHY", 0x002e, 0xcc60, LAN }, |
132 | { "AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, LAN }, | 133 | { "AMD 79C901 10BASE-T PHY", 0x0000, 0x6B70, LAN }, |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index a70c2b0cc104..5ca5a1b546a1 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -78,8 +78,7 @@ static const struct pci_device_id skge_id_table[] = { | |||
78 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) }, | 78 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_GE) }, |
79 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) }, | 79 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_YU) }, |
80 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), }, | 80 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, PCI_DEVICE_ID_DLINK_DGE510T), }, |
81 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, | 81 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, /* DGE-530T */ |
82 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b01) }, | ||
83 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, | 82 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4320) }, |
84 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */ | 83 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x5005) }, /* Belkin */ |
85 | { PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) }, | 84 | { PCI_DEVICE(PCI_VENDOR_ID_CNET, PCI_DEVICE_ID_CNET_GIGACARD) }, |
@@ -402,7 +401,7 @@ static int skge_set_ring_param(struct net_device *dev, | |||
402 | int err; | 401 | int err; |
403 | 402 | ||
404 | if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || | 403 | if (p->rx_pending == 0 || p->rx_pending > MAX_RX_RING_SIZE || |
405 | p->tx_pending == 0 || p->tx_pending > MAX_TX_RING_SIZE) | 404 | p->tx_pending < MAX_SKB_FRAGS+1 || p->tx_pending > MAX_TX_RING_SIZE) |
406 | return -EINVAL; | 405 | return -EINVAL; |
407 | 406 | ||
408 | skge->rx_ring.count = p->rx_pending; | 407 | skge->rx_ring.count = p->rx_pending; |
@@ -2717,8 +2716,7 @@ static int skge_poll(struct net_device *dev, int *budget) | |||
2717 | if (control & BMU_OWN) | 2716 | if (control & BMU_OWN) |
2718 | break; | 2717 | break; |
2719 | 2718 | ||
2720 | skb = skge_rx_get(skge, e, control, rd->status, | 2719 | skb = skge_rx_get(skge, e, control, rd->status, rd->csum2); |
2721 | le16_to_cpu(rd->csum2)); | ||
2722 | if (likely(skb)) { | 2720 | if (likely(skb)) { |
2723 | dev->last_rx = jiffies; | 2721 | dev->last_rx = jiffies; |
2724 | netif_receive_skb(skb); | 2722 | netif_receive_skb(skb); |
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 227df9876a2c..60779ebf2ff6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "sky2.h" | 51 | #include "sky2.h" |
52 | 52 | ||
53 | #define DRV_NAME "sky2" | 53 | #define DRV_NAME "sky2" |
54 | #define DRV_VERSION "1.2" | 54 | #define DRV_VERSION "1.4" |
55 | #define PFX DRV_NAME " " | 55 | #define PFX DRV_NAME " " |
56 | 56 | ||
57 | /* | 57 | /* |
@@ -79,6 +79,8 @@ | |||
79 | #define NAPI_WEIGHT 64 | 79 | #define NAPI_WEIGHT 64 |
80 | #define PHY_RETRIES 1000 | 80 | #define PHY_RETRIES 1000 |
81 | 81 | ||
82 | #define RING_NEXT(x,s) (((x)+1) & ((s)-1)) | ||
83 | |||
82 | static const u32 default_msg = | 84 | static const u32 default_msg = |
83 | NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK | 85 | NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK |
84 | | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR | 86 | | NETIF_MSG_TIMER | NETIF_MSG_TX_ERR | NETIF_MSG_RX_ERR |
@@ -96,9 +98,14 @@ static int disable_msi = 0; | |||
96 | module_param(disable_msi, int, 0); | 98 | module_param(disable_msi, int, 0); |
97 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); | 99 | MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); |
98 | 100 | ||
101 | static int idle_timeout = 100; | ||
102 | module_param(idle_timeout, int, 0); | ||
103 | MODULE_PARM_DESC(idle_timeout, "Idle timeout workaround for lost interrupts (ms)"); | ||
104 | |||
99 | static const struct pci_device_id sky2_id_table[] = { | 105 | static const struct pci_device_id sky2_id_table[] = { |
100 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, | 106 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, |
101 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, | 107 | { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, |
108 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4b00) }, /* DGE-560T */ | ||
102 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) }, | 109 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4340) }, |
103 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) }, | 110 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4341) }, |
104 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) }, | 111 | { PCI_DEVICE(PCI_VENDOR_ID_MARVELL, 0x4342) }, |
@@ -122,6 +129,7 @@ MODULE_DEVICE_TABLE(pci, sky2_id_table); | |||
122 | /* Avoid conditionals by using array */ | 129 | /* Avoid conditionals by using array */ |
123 | static const unsigned txqaddr[] = { Q_XA1, Q_XA2 }; | 130 | static const unsigned txqaddr[] = { Q_XA1, Q_XA2 }; |
124 | static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; | 131 | static const unsigned rxqaddr[] = { Q_R1, Q_R2 }; |
132 | static const u32 portirq_msk[] = { Y2_IS_PORT_1, Y2_IS_PORT_2 }; | ||
125 | 133 | ||
126 | /* This driver supports yukon2 chipset only */ | 134 | /* This driver supports yukon2 chipset only */ |
127 | static const char *yukon2_name[] = { | 135 | static const char *yukon2_name[] = { |
@@ -228,6 +236,7 @@ static int sky2_set_power_state(struct sky2_hw *hw, pci_power_t state) | |||
228 | } | 236 | } |
229 | 237 | ||
230 | if (hw->chip_id == CHIP_ID_YUKON_EC_U) { | 238 | if (hw->chip_id == CHIP_ID_YUKON_EC_U) { |
239 | sky2_write16(hw, B0_CTST, Y2_HW_WOL_ON); | ||
231 | sky2_pci_write32(hw, PCI_DEV_REG3, 0); | 240 | sky2_pci_write32(hw, PCI_DEV_REG3, 0); |
232 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG4); | 241 | reg1 = sky2_pci_read32(hw, PCI_DEV_REG4); |
233 | reg1 &= P_ASPM_CONTROL_MSK; | 242 | reg1 &= P_ASPM_CONTROL_MSK; |
@@ -298,7 +307,8 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
298 | struct sky2_port *sky2 = netdev_priv(hw->dev[port]); | 307 | struct sky2_port *sky2 = netdev_priv(hw->dev[port]); |
299 | u16 ctrl, ct1000, adv, pg, ledctrl, ledover; | 308 | u16 ctrl, ct1000, adv, pg, ledctrl, ledover; |
300 | 309 | ||
301 | if (sky2->autoneg == AUTONEG_ENABLE && hw->chip_id != CHIP_ID_YUKON_XL) { | 310 | if (sky2->autoneg == AUTONEG_ENABLE && |
311 | !(hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)) { | ||
302 | u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); | 312 | u16 ectrl = gm_phy_read(hw, port, PHY_MARV_EXT_CTRL); |
303 | 313 | ||
304 | ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | | 314 | ectrl &= ~(PHY_M_EC_M_DSC_MSK | PHY_M_EC_S_DSC_MSK | |
@@ -326,7 +336,7 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
326 | ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); | 336 | ctrl |= PHY_M_PC_MDI_XMODE(PHY_M_PC_ENA_AUTO); |
327 | 337 | ||
328 | if (sky2->autoneg == AUTONEG_ENABLE && | 338 | if (sky2->autoneg == AUTONEG_ENABLE && |
329 | hw->chip_id == CHIP_ID_YUKON_XL) { | 339 | (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U)) { |
330 | ctrl &= ~PHY_M_PC_DSC_MSK; | 340 | ctrl &= ~PHY_M_PC_DSC_MSK; |
331 | ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; | 341 | ctrl |= PHY_M_PC_DSC(2) | PHY_M_PC_DOWN_S_ENA; |
332 | } | 342 | } |
@@ -442,10 +452,11 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
442 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); | 452 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); |
443 | 453 | ||
444 | /* set LED Function Control register */ | 454 | /* set LED Function Control register */ |
445 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ | 455 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, |
446 | PHY_M_LEDC_INIT_CTRL(7) | /* 10 Mbps */ | 456 | (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ |
447 | PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */ | 457 | PHY_M_LEDC_INIT_CTRL(7) | /* 10 Mbps */ |
448 | PHY_M_LEDC_STA0_CTRL(7))); /* 1000 Mbps */ | 458 | PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */ |
459 | PHY_M_LEDC_STA0_CTRL(7))); /* 1000 Mbps */ | ||
449 | 460 | ||
450 | /* set Polarity Control register */ | 461 | /* set Polarity Control register */ |
451 | gm_phy_write(hw, port, PHY_MARV_PHY_STAT, | 462 | gm_phy_write(hw, port, PHY_MARV_PHY_STAT, |
@@ -459,6 +470,25 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
459 | /* restore page register */ | 470 | /* restore page register */ |
460 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | 471 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); |
461 | break; | 472 | break; |
473 | case CHIP_ID_YUKON_EC_U: | ||
474 | pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); | ||
475 | |||
476 | /* select page 3 to access LED control register */ | ||
477 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); | ||
478 | |||
479 | /* set LED Function Control register */ | ||
480 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, | ||
481 | (PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ | ||
482 | PHY_M_LEDC_INIT_CTRL(8) | /* 10 Mbps */ | ||
483 | PHY_M_LEDC_STA1_CTRL(7) | /* 100 Mbps */ | ||
484 | PHY_M_LEDC_STA0_CTRL(7)));/* 1000 Mbps */ | ||
485 | |||
486 | /* set Blink Rate in LED Timer Control Register */ | ||
487 | gm_phy_write(hw, port, PHY_MARV_INT_MASK, | ||
488 | ledctrl | PHY_M_LED_BLINK_RT(BLINK_84MS)); | ||
489 | /* restore page register */ | ||
490 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | ||
491 | break; | ||
462 | 492 | ||
463 | default: | 493 | default: |
464 | /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ | 494 | /* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */ |
@@ -467,19 +497,21 @@ static void sky2_phy_init(struct sky2_hw *hw, unsigned port) | |||
467 | ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); | 497 | ledover |= PHY_M_LED_MO_RX(MO_LED_OFF); |
468 | } | 498 | } |
469 | 499 | ||
470 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev >= 2) { | 500 | if (hw->chip_id == CHIP_ID_YUKON_EC_U && hw->chip_rev == CHIP_REV_YU_EC_A1) { |
471 | /* apply fixes in PHY AFE */ | 501 | /* apply fixes in PHY AFE */ |
472 | gm_phy_write(hw, port, 22, 255); | 502 | pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); |
503 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 255); | ||
504 | |||
473 | /* increase differential signal amplitude in 10BASE-T */ | 505 | /* increase differential signal amplitude in 10BASE-T */ |
474 | gm_phy_write(hw, port, 24, 0xaa99); | 506 | gm_phy_write(hw, port, 0x18, 0xaa99); |
475 | gm_phy_write(hw, port, 23, 0x2011); | 507 | gm_phy_write(hw, port, 0x17, 0x2011); |
476 | 508 | ||
477 | /* fix for IEEE A/B Symmetry failure in 1000BASE-T */ | 509 | /* fix for IEEE A/B Symmetry failure in 1000BASE-T */ |
478 | gm_phy_write(hw, port, 24, 0xa204); | 510 | gm_phy_write(hw, port, 0x18, 0xa204); |
479 | gm_phy_write(hw, port, 23, 0x2002); | 511 | gm_phy_write(hw, port, 0x17, 0x2002); |
480 | 512 | ||
481 | /* set page register to 0 */ | 513 | /* set page register to 0 */ |
482 | gm_phy_write(hw, port, 22, 0); | 514 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); |
483 | } else { | 515 | } else { |
484 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); | 516 | gm_phy_write(hw, port, PHY_MARV_LED_CTRL, ledctrl); |
485 | 517 | ||
@@ -553,6 +585,11 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) | |||
553 | 585 | ||
554 | if (sky2->duplex == DUPLEX_FULL) | 586 | if (sky2->duplex == DUPLEX_FULL) |
555 | reg |= GM_GPCR_DUP_FULL; | 587 | reg |= GM_GPCR_DUP_FULL; |
588 | |||
589 | /* turn off pause in 10/100mbps half duplex */ | ||
590 | else if (sky2->speed != SPEED_1000 && | ||
591 | hw->chip_id != CHIP_ID_YUKON_EC_U) | ||
592 | sky2->tx_pause = sky2->rx_pause = 0; | ||
556 | } else | 593 | } else |
557 | reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; | 594 | reg = GM_GPCR_SPEED_1000 | GM_GPCR_SPEED_100 | GM_GPCR_DUP_FULL; |
558 | 595 | ||
@@ -719,7 +756,7 @@ static inline struct sky2_tx_le *get_tx_le(struct sky2_port *sky2) | |||
719 | { | 756 | { |
720 | struct sky2_tx_le *le = sky2->tx_le + sky2->tx_prod; | 757 | struct sky2_tx_le *le = sky2->tx_le + sky2->tx_prod; |
721 | 758 | ||
722 | sky2->tx_prod = (sky2->tx_prod + 1) % TX_RING_SIZE; | 759 | sky2->tx_prod = RING_NEXT(sky2->tx_prod, TX_RING_SIZE); |
723 | return le; | 760 | return le; |
724 | } | 761 | } |
725 | 762 | ||
@@ -735,7 +772,7 @@ static inline void sky2_put_idx(struct sky2_hw *hw, unsigned q, u16 idx) | |||
735 | static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2) | 772 | static inline struct sky2_rx_le *sky2_next_rx(struct sky2_port *sky2) |
736 | { | 773 | { |
737 | struct sky2_rx_le *le = sky2->rx_le + sky2->rx_put; | 774 | struct sky2_rx_le *le = sky2->rx_le + sky2->rx_put; |
738 | sky2->rx_put = (sky2->rx_put + 1) % RX_LE_SIZE; | 775 | sky2->rx_put = RING_NEXT(sky2->rx_put, RX_LE_SIZE); |
739 | return le; | 776 | return le; |
740 | } | 777 | } |
741 | 778 | ||
@@ -985,7 +1022,25 @@ static int sky2_up(struct net_device *dev) | |||
985 | struct sky2_hw *hw = sky2->hw; | 1022 | struct sky2_hw *hw = sky2->hw; |
986 | unsigned port = sky2->port; | 1023 | unsigned port = sky2->port; |
987 | u32 ramsize, rxspace, imask; | 1024 | u32 ramsize, rxspace, imask; |
988 | int err = -ENOMEM; | 1025 | int cap, err = -ENOMEM; |
1026 | struct net_device *otherdev = hw->dev[sky2->port^1]; | ||
1027 | |||
1028 | /* | ||
1029 | * On dual port PCI-X card, there is an problem where status | ||
1030 | * can be received out of order due to split transactions | ||
1031 | */ | ||
1032 | if (otherdev && netif_running(otherdev) && | ||
1033 | (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) { | ||
1034 | struct sky2_port *osky2 = netdev_priv(otherdev); | ||
1035 | u16 cmd; | ||
1036 | |||
1037 | cmd = sky2_pci_read16(hw, cap + PCI_X_CMD); | ||
1038 | cmd &= ~PCI_X_CMD_MAX_SPLIT; | ||
1039 | sky2_pci_write16(hw, cap + PCI_X_CMD, cmd); | ||
1040 | |||
1041 | sky2->rx_csum = 0; | ||
1042 | osky2->rx_csum = 0; | ||
1043 | } | ||
989 | 1044 | ||
990 | if (netif_msg_ifup(sky2)) | 1045 | if (netif_msg_ifup(sky2)) |
991 | printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); | 1046 | printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); |
@@ -1050,7 +1105,7 @@ static int sky2_up(struct net_device *dev) | |||
1050 | 1105 | ||
1051 | /* Enable interrupts from phy/mac for port */ | 1106 | /* Enable interrupts from phy/mac for port */ |
1052 | imask = sky2_read32(hw, B0_IMSK); | 1107 | imask = sky2_read32(hw, B0_IMSK); |
1053 | imask |= (port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2; | 1108 | imask |= portirq_msk[port]; |
1054 | sky2_write32(hw, B0_IMSK, imask); | 1109 | sky2_write32(hw, B0_IMSK, imask); |
1055 | 1110 | ||
1056 | return 0; | 1111 | return 0; |
@@ -1078,7 +1133,7 @@ err_out: | |||
1078 | /* Modular subtraction in ring */ | 1133 | /* Modular subtraction in ring */ |
1079 | static inline int tx_dist(unsigned tail, unsigned head) | 1134 | static inline int tx_dist(unsigned tail, unsigned head) |
1080 | { | 1135 | { |
1081 | return (head - tail) % TX_RING_SIZE; | 1136 | return (head - tail) & (TX_RING_SIZE - 1); |
1082 | } | 1137 | } |
1083 | 1138 | ||
1084 | /* Number of list elements available for next tx */ | 1139 | /* Number of list elements available for next tx */ |
@@ -1255,7 +1310,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) | |||
1255 | le->opcode = OP_BUFFER | HW_OWNER; | 1310 | le->opcode = OP_BUFFER | HW_OWNER; |
1256 | 1311 | ||
1257 | fre = sky2->tx_ring | 1312 | fre = sky2->tx_ring |
1258 | + ((re - sky2->tx_ring) + i + 1) % TX_RING_SIZE; | 1313 | + RING_NEXT((re - sky2->tx_ring) + i, TX_RING_SIZE); |
1259 | pci_unmap_addr_set(fre, mapaddr, mapping); | 1314 | pci_unmap_addr_set(fre, mapaddr, mapping); |
1260 | } | 1315 | } |
1261 | 1316 | ||
@@ -1315,7 +1370,7 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) | |||
1315 | 1370 | ||
1316 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | 1371 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { |
1317 | struct tx_ring_info *fre; | 1372 | struct tx_ring_info *fre; |
1318 | fre = sky2->tx_ring + (put + i + 1) % TX_RING_SIZE; | 1373 | fre = sky2->tx_ring + RING_NEXT(put + i, TX_RING_SIZE); |
1319 | pci_unmap_page(pdev, pci_unmap_addr(fre, mapaddr), | 1374 | pci_unmap_page(pdev, pci_unmap_addr(fre, mapaddr), |
1320 | skb_shinfo(skb)->frags[i].size, | 1375 | skb_shinfo(skb)->frags[i].size, |
1321 | PCI_DMA_TODEVICE); | 1376 | PCI_DMA_TODEVICE); |
@@ -1401,7 +1456,7 @@ static int sky2_down(struct net_device *dev) | |||
1401 | 1456 | ||
1402 | /* Disable port IRQ */ | 1457 | /* Disable port IRQ */ |
1403 | imask = sky2_read32(hw, B0_IMSK); | 1458 | imask = sky2_read32(hw, B0_IMSK); |
1404 | imask &= ~(sky2->port == 0) ? Y2_IS_PORT_1 : Y2_IS_PORT_2; | 1459 | imask &= ~portirq_msk[port]; |
1405 | sky2_write32(hw, B0_IMSK, imask); | 1460 | sky2_write32(hw, B0_IMSK, imask); |
1406 | 1461 | ||
1407 | /* turn off LED's */ | 1462 | /* turn off LED's */ |
@@ -1498,17 +1553,26 @@ static void sky2_link_up(struct sky2_port *sky2) | |||
1498 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), | 1553 | sky2_write8(hw, SK_REG(port, LNK_LED_REG), |
1499 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); | 1554 | LINKLED_ON | LINKLED_BLINK_OFF | LINKLED_LINKSYNC_OFF); |
1500 | 1555 | ||
1501 | if (hw->chip_id == CHIP_ID_YUKON_XL) { | 1556 | if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U) { |
1502 | u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); | 1557 | u16 pg = gm_phy_read(hw, port, PHY_MARV_EXT_ADR); |
1558 | u16 led = PHY_M_LEDC_LOS_CTRL(1); /* link active */ | ||
1559 | |||
1560 | switch(sky2->speed) { | ||
1561 | case SPEED_10: | ||
1562 | led |= PHY_M_LEDC_INIT_CTRL(7); | ||
1563 | break; | ||
1564 | |||
1565 | case SPEED_100: | ||
1566 | led |= PHY_M_LEDC_STA1_CTRL(7); | ||
1567 | break; | ||
1568 | |||
1569 | case SPEED_1000: | ||
1570 | led |= PHY_M_LEDC_STA0_CTRL(7); | ||
1571 | break; | ||
1572 | } | ||
1503 | 1573 | ||
1504 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); | 1574 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, 3); |
1505 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, PHY_M_LEDC_LOS_CTRL(1) | /* LINK/ACT */ | 1575 | gm_phy_write(hw, port, PHY_MARV_PHY_CTRL, led); |
1506 | PHY_M_LEDC_INIT_CTRL(sky2->speed == | ||
1507 | SPEED_10 ? 7 : 0) | | ||
1508 | PHY_M_LEDC_STA1_CTRL(sky2->speed == | ||
1509 | SPEED_100 ? 7 : 0) | | ||
1510 | PHY_M_LEDC_STA0_CTRL(sky2->speed == | ||
1511 | SPEED_1000 ? 7 : 0)); | ||
1512 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); | 1576 | gm_phy_write(hw, port, PHY_MARV_EXT_ADR, pg); |
1513 | } | 1577 | } |
1514 | 1578 | ||
@@ -1583,7 +1647,7 @@ static int sky2_autoneg_done(struct sky2_port *sky2, u16 aux) | |||
1583 | sky2->speed = sky2_phy_speed(hw, aux); | 1647 | sky2->speed = sky2_phy_speed(hw, aux); |
1584 | 1648 | ||
1585 | /* Pause bits are offset (9..8) */ | 1649 | /* Pause bits are offset (9..8) */ |
1586 | if (hw->chip_id == CHIP_ID_YUKON_XL) | 1650 | if (hw->chip_id == CHIP_ID_YUKON_XL || hw->chip_id == CHIP_ID_YUKON_EC_U) |
1587 | aux >>= 6; | 1651 | aux >>= 6; |
1588 | 1652 | ||
1589 | sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0; | 1653 | sky2->rx_pause = (aux & PHY_M_PS_RX_P_EN) != 0; |
@@ -1855,39 +1919,38 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) | |||
1855 | } | 1919 | } |
1856 | } | 1920 | } |
1857 | 1921 | ||
1922 | /* Is status ring empty or is there more to do? */ | ||
1923 | static inline int sky2_more_work(const struct sky2_hw *hw) | ||
1924 | { | ||
1925 | return (hw->st_idx != sky2_read16(hw, STAT_PUT_IDX)); | ||
1926 | } | ||
1927 | |||
1858 | /* Process status response ring */ | 1928 | /* Process status response ring */ |
1859 | static int sky2_status_intr(struct sky2_hw *hw, int to_do) | 1929 | static int sky2_status_intr(struct sky2_hw *hw, int to_do) |
1860 | { | 1930 | { |
1861 | int work_done = 0; | 1931 | int work_done = 0; |
1932 | u16 hwidx = sky2_read16(hw, STAT_PUT_IDX); | ||
1862 | 1933 | ||
1863 | rmb(); | 1934 | rmb(); |
1864 | 1935 | ||
1865 | for(;;) { | 1936 | while (hw->st_idx != hwidx) { |
1866 | struct sky2_status_le *le = hw->st_le + hw->st_idx; | 1937 | struct sky2_status_le *le = hw->st_le + hw->st_idx; |
1867 | struct net_device *dev; | 1938 | struct net_device *dev; |
1868 | struct sky2_port *sky2; | 1939 | struct sky2_port *sky2; |
1869 | struct sk_buff *skb; | 1940 | struct sk_buff *skb; |
1870 | u32 status; | 1941 | u32 status; |
1871 | u16 length; | 1942 | u16 length; |
1872 | u8 link, opcode; | ||
1873 | 1943 | ||
1874 | opcode = le->opcode; | 1944 | hw->st_idx = RING_NEXT(hw->st_idx, STATUS_RING_SIZE); |
1875 | if (!opcode) | ||
1876 | break; | ||
1877 | opcode &= ~HW_OWNER; | ||
1878 | 1945 | ||
1879 | hw->st_idx = (hw->st_idx + 1) % STATUS_RING_SIZE; | 1946 | BUG_ON(le->link >= 2); |
1880 | le->opcode = 0; | 1947 | dev = hw->dev[le->link]; |
1881 | |||
1882 | link = le->link; | ||
1883 | BUG_ON(link >= 2); | ||
1884 | dev = hw->dev[link]; | ||
1885 | 1948 | ||
1886 | sky2 = netdev_priv(dev); | 1949 | sky2 = netdev_priv(dev); |
1887 | length = le->length; | 1950 | length = le->length; |
1888 | status = le->status; | 1951 | status = le->status; |
1889 | 1952 | ||
1890 | switch (opcode) { | 1953 | switch (le->opcode & ~HW_OWNER) { |
1891 | case OP_RXSTAT: | 1954 | case OP_RXSTAT: |
1892 | skb = sky2_receive(sky2, length, status); | 1955 | skb = sky2_receive(sky2, length, status); |
1893 | if (!skb) | 1956 | if (!skb) |
@@ -1927,7 +1990,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) | |||
1927 | 1990 | ||
1928 | case OP_TXINDEXLE: | 1991 | case OP_TXINDEXLE: |
1929 | /* TX index reports status for both ports */ | 1992 | /* TX index reports status for both ports */ |
1930 | sky2_tx_done(hw->dev[0], status & 0xffff); | 1993 | BUILD_BUG_ON(TX_RING_SIZE > 0x1000); |
1994 | sky2_tx_done(hw->dev[0], status & 0xfff); | ||
1931 | if (hw->dev[1]) | 1995 | if (hw->dev[1]) |
1932 | sky2_tx_done(hw->dev[1], | 1996 | sky2_tx_done(hw->dev[1], |
1933 | ((status >> 24) & 0xff) | 1997 | ((status >> 24) & 0xff) |
@@ -1937,8 +2001,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do) | |||
1937 | default: | 2001 | default: |
1938 | if (net_ratelimit()) | 2002 | if (net_ratelimit()) |
1939 | printk(KERN_WARNING PFX | 2003 | printk(KERN_WARNING PFX |
1940 | "unknown status opcode 0x%x\n", opcode); | 2004 | "unknown status opcode 0x%x\n", le->opcode); |
1941 | break; | 2005 | goto exit_loop; |
1942 | } | 2006 | } |
1943 | } | 2007 | } |
1944 | 2008 | ||
@@ -2089,12 +2153,13 @@ static void sky2_descriptor_error(struct sky2_hw *hw, unsigned port, | |||
2089 | */ | 2153 | */ |
2090 | static void sky2_idle(unsigned long arg) | 2154 | static void sky2_idle(unsigned long arg) |
2091 | { | 2155 | { |
2092 | struct net_device *dev = (struct net_device *) arg; | 2156 | struct sky2_hw *hw = (struct sky2_hw *) arg; |
2157 | struct net_device *dev = hw->dev[0]; | ||
2093 | 2158 | ||
2094 | local_irq_disable(); | ||
2095 | if (__netif_rx_schedule_prep(dev)) | 2159 | if (__netif_rx_schedule_prep(dev)) |
2096 | __netif_rx_schedule(dev); | 2160 | __netif_rx_schedule(dev); |
2097 | local_irq_enable(); | 2161 | |
2162 | mod_timer(&hw->idle_timer, jiffies + msecs_to_jiffies(idle_timeout)); | ||
2098 | } | 2163 | } |
2099 | 2164 | ||
2100 | 2165 | ||
@@ -2105,65 +2170,46 @@ static int sky2_poll(struct net_device *dev0, int *budget) | |||
2105 | int work_done = 0; | 2170 | int work_done = 0; |
2106 | u32 status = sky2_read32(hw, B0_Y2_SP_EISR); | 2171 | u32 status = sky2_read32(hw, B0_Y2_SP_EISR); |
2107 | 2172 | ||
2108 | restart_poll: | 2173 | if (status & Y2_IS_HW_ERR) |
2109 | if (unlikely(status & ~Y2_IS_STAT_BMU)) { | 2174 | sky2_hw_intr(hw); |
2110 | if (status & Y2_IS_HW_ERR) | ||
2111 | sky2_hw_intr(hw); | ||
2112 | 2175 | ||
2113 | if (status & Y2_IS_IRQ_PHY1) | 2176 | if (status & Y2_IS_IRQ_PHY1) |
2114 | sky2_phy_intr(hw, 0); | 2177 | sky2_phy_intr(hw, 0); |
2115 | 2178 | ||
2116 | if (status & Y2_IS_IRQ_PHY2) | 2179 | if (status & Y2_IS_IRQ_PHY2) |
2117 | sky2_phy_intr(hw, 1); | 2180 | sky2_phy_intr(hw, 1); |
2118 | 2181 | ||
2119 | if (status & Y2_IS_IRQ_MAC1) | 2182 | if (status & Y2_IS_IRQ_MAC1) |
2120 | sky2_mac_intr(hw, 0); | 2183 | sky2_mac_intr(hw, 0); |
2121 | 2184 | ||
2122 | if (status & Y2_IS_IRQ_MAC2) | 2185 | if (status & Y2_IS_IRQ_MAC2) |
2123 | sky2_mac_intr(hw, 1); | 2186 | sky2_mac_intr(hw, 1); |
2124 | 2187 | ||
2125 | if (status & Y2_IS_CHK_RX1) | 2188 | if (status & Y2_IS_CHK_RX1) |
2126 | sky2_descriptor_error(hw, 0, "receive", Y2_IS_CHK_RX1); | 2189 | sky2_descriptor_error(hw, 0, "receive", Y2_IS_CHK_RX1); |
2127 | 2190 | ||
2128 | if (status & Y2_IS_CHK_RX2) | 2191 | if (status & Y2_IS_CHK_RX2) |
2129 | sky2_descriptor_error(hw, 1, "receive", Y2_IS_CHK_RX2); | 2192 | sky2_descriptor_error(hw, 1, "receive", Y2_IS_CHK_RX2); |
2130 | 2193 | ||
2131 | if (status & Y2_IS_CHK_TXA1) | 2194 | if (status & Y2_IS_CHK_TXA1) |
2132 | sky2_descriptor_error(hw, 0, "transmit", Y2_IS_CHK_TXA1); | 2195 | sky2_descriptor_error(hw, 0, "transmit", Y2_IS_CHK_TXA1); |
2133 | 2196 | ||
2134 | if (status & Y2_IS_CHK_TXA2) | 2197 | if (status & Y2_IS_CHK_TXA2) |
2135 | sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2); | 2198 | sky2_descriptor_error(hw, 1, "transmit", Y2_IS_CHK_TXA2); |
2136 | } | ||
2137 | |||
2138 | if (status & Y2_IS_STAT_BMU) { | ||
2139 | work_done += sky2_status_intr(hw, work_limit - work_done); | ||
2140 | *budget -= work_done; | ||
2141 | dev0->quota -= work_done; | ||
2142 | 2199 | ||
2143 | if (work_done >= work_limit) | 2200 | work_done = sky2_status_intr(hw, work_limit); |
2144 | return 1; | 2201 | *budget -= work_done; |
2202 | dev0->quota -= work_done; | ||
2145 | 2203 | ||
2204 | if (status & Y2_IS_STAT_BMU) | ||
2146 | sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); | 2205 | sky2_write32(hw, STAT_CTRL, SC_STAT_CLR_IRQ); |
2147 | } | ||
2148 | |||
2149 | mod_timer(&hw->idle_timer, jiffies + HZ); | ||
2150 | 2206 | ||
2151 | local_irq_disable(); | 2207 | if (sky2_more_work(hw)) |
2152 | __netif_rx_complete(dev0); | 2208 | return 1; |
2153 | 2209 | ||
2154 | status = sky2_read32(hw, B0_Y2_SP_LISR); | 2210 | netif_rx_complete(dev0); |
2155 | |||
2156 | if (unlikely(status)) { | ||
2157 | /* More work pending, try and keep going */ | ||
2158 | if (__netif_rx_schedule_prep(dev0)) { | ||
2159 | __netif_rx_reschedule(dev0, work_done); | ||
2160 | status = sky2_read32(hw, B0_Y2_SP_EISR); | ||
2161 | local_irq_enable(); | ||
2162 | goto restart_poll; | ||
2163 | } | ||
2164 | } | ||
2165 | 2211 | ||
2166 | local_irq_enable(); | 2212 | sky2_read32(hw, B0_Y2_SP_LISR); |
2167 | return 0; | 2213 | return 0; |
2168 | } | 2214 | } |
2169 | 2215 | ||
@@ -2244,13 +2290,6 @@ static int __devinit sky2_reset(struct sky2_hw *hw) | |||
2244 | return -EOPNOTSUPP; | 2290 | return -EOPNOTSUPP; |
2245 | } | 2291 | } |
2246 | 2292 | ||
2247 | /* This chip is new and not tested yet */ | ||
2248 | if (hw->chip_id == CHIP_ID_YUKON_EC_U) { | ||
2249 | pr_info(PFX "%s: is a version of Yukon 2 chipset that has not been tested yet.\n", | ||
2250 | pci_name(hw->pdev)); | ||
2251 | pr_info("Please report success/failure to maintainer <shemminger@osdl.org>\n"); | ||
2252 | } | ||
2253 | |||
2254 | /* disable ASF */ | 2293 | /* disable ASF */ |
2255 | if (hw->chip_id <= CHIP_ID_YUKON_EC) { | 2294 | if (hw->chip_id <= CHIP_ID_YUKON_EC) { |
2256 | sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); | 2295 | sky2_write8(hw, B28_Y2_ASF_STAT_CMD, Y2_ASF_RESET); |
@@ -3054,12 +3093,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, | |||
3054 | sky2->duplex = -1; | 3093 | sky2->duplex = -1; |
3055 | sky2->speed = -1; | 3094 | sky2->speed = -1; |
3056 | sky2->advertising = sky2_supported_modes(hw); | 3095 | sky2->advertising = sky2_supported_modes(hw); |
3057 | 3096 | sky2->rx_csum = 1; | |
3058 | /* Receive checksum disabled for Yukon XL | ||
3059 | * because of observed problems with incorrect | ||
3060 | * values when multiple packets are received in one interrupt | ||
3061 | */ | ||
3062 | sky2->rx_csum = (hw->chip_id != CHIP_ID_YUKON_XL); | ||
3063 | 3097 | ||
3064 | spin_lock_init(&sky2->phy_lock); | 3098 | spin_lock_init(&sky2->phy_lock); |
3065 | sky2->tx_pending = TX_DEF_PENDING; | 3099 | sky2->tx_pending = TX_DEF_PENDING; |
@@ -3302,7 +3336,10 @@ static int __devinit sky2_probe(struct pci_dev *pdev, | |||
3302 | 3336 | ||
3303 | sky2_write32(hw, B0_IMSK, Y2_IS_BASE); | 3337 | sky2_write32(hw, B0_IMSK, Y2_IS_BASE); |
3304 | 3338 | ||
3305 | setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) dev); | 3339 | setup_timer(&hw->idle_timer, sky2_idle, (unsigned long) hw); |
3340 | if (idle_timeout > 0) | ||
3341 | mod_timer(&hw->idle_timer, | ||
3342 | jiffies + msecs_to_jiffies(idle_timeout)); | ||
3306 | 3343 | ||
3307 | pci_set_drvdata(pdev, hw); | 3344 | pci_set_drvdata(pdev, hw); |
3308 | 3345 | ||
@@ -3342,6 +3379,8 @@ static void __devexit sky2_remove(struct pci_dev *pdev) | |||
3342 | del_timer_sync(&hw->idle_timer); | 3379 | del_timer_sync(&hw->idle_timer); |
3343 | 3380 | ||
3344 | sky2_write32(hw, B0_IMSK, 0); | 3381 | sky2_write32(hw, B0_IMSK, 0); |
3382 | synchronize_irq(hw->pdev->irq); | ||
3383 | |||
3345 | dev0 = hw->dev[0]; | 3384 | dev0 = hw->dev[0]; |
3346 | dev1 = hw->dev[1]; | 3385 | dev1 = hw->dev[1]; |
3347 | if (dev1) | 3386 | if (dev1) |
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index b026f5653f04..8a0bc5525f0a 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h | |||
@@ -214,6 +214,8 @@ enum csr_regs { | |||
214 | enum { | 214 | enum { |
215 | Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */ | 215 | Y2_VMAIN_AVAIL = 1<<17,/* VMAIN available (YUKON-2 only) */ |
216 | Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */ | 216 | Y2_VAUX_AVAIL = 1<<16,/* VAUX available (YUKON-2 only) */ |
217 | Y2_HW_WOL_ON = 1<<15,/* HW WOL On (Yukon-EC Ultra A1 only) */ | ||
218 | Y2_HW_WOL_OFF = 1<<14,/* HW WOL On (Yukon-EC Ultra A1 only) */ | ||
217 | Y2_ASF_ENABLE = 1<<13,/* ASF Unit Enable (YUKON-2 only) */ | 219 | Y2_ASF_ENABLE = 1<<13,/* ASF Unit Enable (YUKON-2 only) */ |
218 | Y2_ASF_DISABLE = 1<<12,/* ASF Unit Disable (YUKON-2 only) */ | 220 | Y2_ASF_DISABLE = 1<<12,/* ASF Unit Disable (YUKON-2 only) */ |
219 | Y2_CLK_RUN_ENA = 1<<11,/* CLK_RUN Enable (YUKON-2 only) */ | 221 | Y2_CLK_RUN_ENA = 1<<11,/* CLK_RUN Enable (YUKON-2 only) */ |
@@ -378,6 +380,9 @@ enum { | |||
378 | CHIP_REV_YU_EC_A1 = 0, /* Chip Rev. for Yukon-EC A1/A0 */ | 380 | CHIP_REV_YU_EC_A1 = 0, /* Chip Rev. for Yukon-EC A1/A0 */ |
379 | CHIP_REV_YU_EC_A2 = 1, /* Chip Rev. for Yukon-EC A2 */ | 381 | CHIP_REV_YU_EC_A2 = 1, /* Chip Rev. for Yukon-EC A2 */ |
380 | CHIP_REV_YU_EC_A3 = 2, /* Chip Rev. for Yukon-EC A3 */ | 382 | CHIP_REV_YU_EC_A3 = 2, /* Chip Rev. for Yukon-EC A3 */ |
383 | |||
384 | CHIP_REV_YU_EC_U_A0 = 0, | ||
385 | CHIP_REV_YU_EC_U_A1 = 1, | ||
381 | }; | 386 | }; |
382 | 387 | ||
383 | /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ | 388 | /* B2_Y2_CLK_GATE 8 bit Clock Gating (Yukon-2 only) */ |
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c index 43f5e86fc559..394339d5e87c 100644 --- a/drivers/net/spider_net.c +++ b/drivers/net/spider_net.c | |||
@@ -1652,6 +1652,8 @@ spider_net_enable_card(struct spider_net_card *card) | |||
1652 | { SPIDER_NET_GFTRESTRT, SPIDER_NET_RESTART_VALUE }, | 1652 | { SPIDER_NET_GFTRESTRT, SPIDER_NET_RESTART_VALUE }, |
1653 | 1653 | ||
1654 | { SPIDER_NET_GMRWOLCTRL, 0 }, | 1654 | { SPIDER_NET_GMRWOLCTRL, 0 }, |
1655 | { SPIDER_NET_GTESTMD, 0x10000000 }, | ||
1656 | { SPIDER_NET_GTTQMSK, 0x00400040 }, | ||
1655 | { SPIDER_NET_GTESTMD, 0 }, | 1657 | { SPIDER_NET_GTESTMD, 0 }, |
1656 | 1658 | ||
1657 | { SPIDER_NET_GMACINTEN, 0 }, | 1659 | { SPIDER_NET_GMACINTEN, 0 }, |
@@ -1792,15 +1794,7 @@ spider_net_setup_phy(struct spider_net_card *card) | |||
1792 | if (phy->def->ops->setup_forced) | 1794 | if (phy->def->ops->setup_forced) |
1793 | phy->def->ops->setup_forced(phy, SPEED_1000, DUPLEX_FULL); | 1795 | phy->def->ops->setup_forced(phy, SPEED_1000, DUPLEX_FULL); |
1794 | 1796 | ||
1795 | /* the following two writes could be moved to sungem_phy.c */ | 1797 | phy->def->ops->enable_fiber(phy); |
1796 | /* enable fiber mode */ | ||
1797 | spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x9020); | ||
1798 | /* LEDs active in both modes, autosense prio = fiber */ | ||
1799 | spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0x945f); | ||
1800 | |||
1801 | /* switch off fibre autoneg */ | ||
1802 | spider_net_write_phy(card->netdev, 1, MII_NCONFIG, 0xfc01); | ||
1803 | spider_net_write_phy(card->netdev, 1, 0x0b, 0x0004); | ||
1804 | 1798 | ||
1805 | phy->def->ops->read_link(phy); | 1799 | phy->def->ops->read_link(phy); |
1806 | pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name, | 1800 | pr_info("Found %s with %i Mbps, %s-duplex.\n", phy->def->name, |
diff --git a/drivers/net/spider_net.h b/drivers/net/spider_net.h index 5922b529a048..3b8d951cf73c 100644 --- a/drivers/net/spider_net.h +++ b/drivers/net/spider_net.h | |||
@@ -120,6 +120,8 @@ extern char spider_net_driver_name[]; | |||
120 | #define SPIDER_NET_GMRUAFILnR 0x00000500 | 120 | #define SPIDER_NET_GMRUAFILnR 0x00000500 |
121 | #define SPIDER_NET_GMRUA0FIL15R 0x00000578 | 121 | #define SPIDER_NET_GMRUA0FIL15R 0x00000578 |
122 | 122 | ||
123 | #define SPIDER_NET_GTTQMSK 0x00000934 | ||
124 | |||
123 | /* RX DMA controller registers, all 0x00000a.. are for DMA controller A, | 125 | /* RX DMA controller registers, all 0x00000a.. are for DMA controller A, |
124 | * 0x00000b.. for DMA controller B, etc. */ | 126 | * 0x00000b.. for DMA controller B, etc. */ |
125 | #define SPIDER_NET_GDADCHA 0x00000a00 | 127 | #define SPIDER_NET_GDADCHA 0x00000a00 |
diff --git a/drivers/net/sungem_phy.c b/drivers/net/sungem_phy.c index 046371ee5bbe..b2ddd5e79303 100644 --- a/drivers/net/sungem_phy.c +++ b/drivers/net/sungem_phy.c | |||
@@ -329,6 +329,30 @@ static int bcm5421_init(struct mii_phy* phy) | |||
329 | return 0; | 329 | return 0; |
330 | } | 330 | } |
331 | 331 | ||
332 | static int bcm5421_enable_fiber(struct mii_phy* phy) | ||
333 | { | ||
334 | /* enable fiber mode */ | ||
335 | phy_write(phy, MII_NCONFIG, 0x9020); | ||
336 | /* LEDs active in both modes, autosense prio = fiber */ | ||
337 | phy_write(phy, MII_NCONFIG, 0x945f); | ||
338 | |||
339 | /* switch off fibre autoneg */ | ||
340 | phy_write(phy, MII_NCONFIG, 0xfc01); | ||
341 | phy_write(phy, 0x0b, 0x0004); | ||
342 | |||
343 | return 0; | ||
344 | } | ||
345 | |||
346 | static int bcm5461_enable_fiber(struct mii_phy* phy) | ||
347 | { | ||
348 | phy_write(phy, MII_NCONFIG, 0xfc0c); | ||
349 | phy_write(phy, MII_BMCR, 0x4140); | ||
350 | phy_write(phy, MII_NCONFIG, 0xfc0b); | ||
351 | phy_write(phy, MII_BMCR, 0x0140); | ||
352 | |||
353 | return 0; | ||
354 | } | ||
355 | |||
332 | static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) | 356 | static int bcm54xx_setup_aneg(struct mii_phy *phy, u32 advertise) |
333 | { | 357 | { |
334 | u16 ctl, adv; | 358 | u16 ctl, adv; |
@@ -762,6 +786,7 @@ static struct mii_phy_ops bcm5421_phy_ops = { | |||
762 | .setup_forced = bcm54xx_setup_forced, | 786 | .setup_forced = bcm54xx_setup_forced, |
763 | .poll_link = genmii_poll_link, | 787 | .poll_link = genmii_poll_link, |
764 | .read_link = bcm54xx_read_link, | 788 | .read_link = bcm54xx_read_link, |
789 | .enable_fiber = bcm5421_enable_fiber, | ||
765 | }; | 790 | }; |
766 | 791 | ||
767 | static struct mii_phy_def bcm5421_phy_def = { | 792 | static struct mii_phy_def bcm5421_phy_def = { |
@@ -792,6 +817,25 @@ static struct mii_phy_def bcm5421k2_phy_def = { | |||
792 | .ops = &bcm5421k2_phy_ops | 817 | .ops = &bcm5421k2_phy_ops |
793 | }; | 818 | }; |
794 | 819 | ||
820 | static struct mii_phy_ops bcm5461_phy_ops = { | ||
821 | .init = bcm5421_init, | ||
822 | .suspend = generic_suspend, | ||
823 | .setup_aneg = bcm54xx_setup_aneg, | ||
824 | .setup_forced = bcm54xx_setup_forced, | ||
825 | .poll_link = genmii_poll_link, | ||
826 | .read_link = bcm54xx_read_link, | ||
827 | .enable_fiber = bcm5461_enable_fiber, | ||
828 | }; | ||
829 | |||
830 | static struct mii_phy_def bcm5461_phy_def = { | ||
831 | .phy_id = 0x002060c0, | ||
832 | .phy_id_mask = 0xfffffff0, | ||
833 | .name = "BCM5461", | ||
834 | .features = MII_GBIT_FEATURES, | ||
835 | .magic_aneg = 1, | ||
836 | .ops = &bcm5461_phy_ops | ||
837 | }; | ||
838 | |||
795 | /* Broadcom BCM 5462 built-in Vesta */ | 839 | /* Broadcom BCM 5462 built-in Vesta */ |
796 | static struct mii_phy_ops bcm5462V_phy_ops = { | 840 | static struct mii_phy_ops bcm5462V_phy_ops = { |
797 | .init = bcm5421_init, | 841 | .init = bcm5421_init, |
@@ -857,6 +901,7 @@ static struct mii_phy_def* mii_phy_table[] = { | |||
857 | &bcm5411_phy_def, | 901 | &bcm5411_phy_def, |
858 | &bcm5421_phy_def, | 902 | &bcm5421_phy_def, |
859 | &bcm5421k2_phy_def, | 903 | &bcm5421k2_phy_def, |
904 | &bcm5461_phy_def, | ||
860 | &bcm5462V_phy_def, | 905 | &bcm5462V_phy_def, |
861 | &marvell_phy_def, | 906 | &marvell_phy_def, |
862 | &genmii_phy_def, | 907 | &genmii_phy_def, |
diff --git a/drivers/net/sungem_phy.h b/drivers/net/sungem_phy.h index 430544496c52..69e125197fcf 100644 --- a/drivers/net/sungem_phy.h +++ b/drivers/net/sungem_phy.h | |||
@@ -12,6 +12,7 @@ struct mii_phy_ops | |||
12 | int (*setup_forced)(struct mii_phy *phy, int speed, int fd); | 12 | int (*setup_forced)(struct mii_phy *phy, int speed, int fd); |
13 | int (*poll_link)(struct mii_phy *phy); | 13 | int (*poll_link)(struct mii_phy *phy); |
14 | int (*read_link)(struct mii_phy *phy); | 14 | int (*read_link)(struct mii_phy *phy); |
15 | int (*enable_fiber)(struct mii_phy *phy); | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | /* Structure used to statically define an mii/gii based PHY */ | 18 | /* Structure used to statically define an mii/gii based PHY */ |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index beeb612be98f..49ad60b72657 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -69,8 +69,8 @@ | |||
69 | 69 | ||
70 | #define DRV_MODULE_NAME "tg3" | 70 | #define DRV_MODULE_NAME "tg3" |
71 | #define PFX DRV_MODULE_NAME ": " | 71 | #define PFX DRV_MODULE_NAME ": " |
72 | #define DRV_MODULE_VERSION "3.57" | 72 | #define DRV_MODULE_VERSION "3.58" |
73 | #define DRV_MODULE_RELDATE "Apr 28, 2006" | 73 | #define DRV_MODULE_RELDATE "May 22, 2006" |
74 | 74 | ||
75 | #define TG3_DEF_MAC_MODE 0 | 75 | #define TG3_DEF_MAC_MODE 0 |
76 | #define TG3_DEF_RX_MODE 0 | 76 | #define TG3_DEF_RX_MODE 0 |
@@ -6488,6 +6488,10 @@ static void tg3_periodic_fetch_stats(struct tg3 *tp) | |||
6488 | TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); | 6488 | TG3_STAT_ADD32(&sp->rx_frame_too_long_errors, MAC_RX_STATS_FRAME_TOO_LONG); |
6489 | TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); | 6489 | TG3_STAT_ADD32(&sp->rx_jabbers, MAC_RX_STATS_JABBERS); |
6490 | TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); | 6490 | TG3_STAT_ADD32(&sp->rx_undersize_packets, MAC_RX_STATS_UNDERSIZE); |
6491 | |||
6492 | TG3_STAT_ADD32(&sp->rxbds_empty, RCVLPC_NO_RCV_BD_CNT); | ||
6493 | TG3_STAT_ADD32(&sp->rx_discards, RCVLPC_IN_DISCARDS_CNT); | ||
6494 | TG3_STAT_ADD32(&sp->rx_errors, RCVLPC_IN_ERRORS_CNT); | ||
6491 | } | 6495 | } |
6492 | 6496 | ||
6493 | static void tg3_timer(unsigned long __opaque) | 6497 | static void tg3_timer(unsigned long __opaque) |
@@ -7653,21 +7657,23 @@ static int tg3_get_settings(struct net_device *dev, struct ethtool_cmd *cmd) | |||
7653 | cmd->supported |= (SUPPORTED_1000baseT_Half | | 7657 | cmd->supported |= (SUPPORTED_1000baseT_Half | |
7654 | SUPPORTED_1000baseT_Full); | 7658 | SUPPORTED_1000baseT_Full); |
7655 | 7659 | ||
7656 | if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) | 7660 | if (!(tp->tg3_flags2 & TG3_FLG2_ANY_SERDES)) { |
7657 | cmd->supported |= (SUPPORTED_100baseT_Half | | 7661 | cmd->supported |= (SUPPORTED_100baseT_Half | |
7658 | SUPPORTED_100baseT_Full | | 7662 | SUPPORTED_100baseT_Full | |
7659 | SUPPORTED_10baseT_Half | | 7663 | SUPPORTED_10baseT_Half | |
7660 | SUPPORTED_10baseT_Full | | 7664 | SUPPORTED_10baseT_Full | |
7661 | SUPPORTED_MII); | 7665 | SUPPORTED_MII); |
7662 | else | 7666 | cmd->port = PORT_TP; |
7667 | } else { | ||
7663 | cmd->supported |= SUPPORTED_FIBRE; | 7668 | cmd->supported |= SUPPORTED_FIBRE; |
7669 | cmd->port = PORT_FIBRE; | ||
7670 | } | ||
7664 | 7671 | ||
7665 | cmd->advertising = tp->link_config.advertising; | 7672 | cmd->advertising = tp->link_config.advertising; |
7666 | if (netif_running(dev)) { | 7673 | if (netif_running(dev)) { |
7667 | cmd->speed = tp->link_config.active_speed; | 7674 | cmd->speed = tp->link_config.active_speed; |
7668 | cmd->duplex = tp->link_config.active_duplex; | 7675 | cmd->duplex = tp->link_config.active_duplex; |
7669 | } | 7676 | } |
7670 | cmd->port = 0; | ||
7671 | cmd->phy_address = PHY_ADDR; | 7677 | cmd->phy_address = PHY_ADDR; |
7672 | cmd->transceiver = 0; | 7678 | cmd->transceiver = 0; |
7673 | cmd->autoneg = tp->link_config.autoneg; | 7679 | cmd->autoneg = tp->link_config.autoneg; |
@@ -8454,6 +8460,9 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) | |||
8454 | 8460 | ||
8455 | tx_len = 1514; | 8461 | tx_len = 1514; |
8456 | skb = dev_alloc_skb(tx_len); | 8462 | skb = dev_alloc_skb(tx_len); |
8463 | if (!skb) | ||
8464 | return -ENOMEM; | ||
8465 | |||
8457 | tx_data = skb_put(skb, tx_len); | 8466 | tx_data = skb_put(skb, tx_len); |
8458 | memcpy(tx_data, tp->dev->dev_addr, 6); | 8467 | memcpy(tx_data, tp->dev->dev_addr, 6); |
8459 | memset(tx_data + 6, 0x0, 8); | 8468 | memset(tx_data + 6, 0x0, 8); |
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c index ba05dedf29d3..136a70c4d5e4 100644 --- a/drivers/net/tulip/winbond-840.c +++ b/drivers/net/tulip/winbond-840.c | |||
@@ -850,7 +850,7 @@ static void init_rxtx_rings(struct net_device *dev) | |||
850 | break; | 850 | break; |
851 | skb->dev = dev; /* Mark as being used by this device. */ | 851 | skb->dev = dev; /* Mark as being used by this device. */ |
852 | np->rx_addr[i] = pci_map_single(np->pci_dev,skb->data, | 852 | np->rx_addr[i] = pci_map_single(np->pci_dev,skb->data, |
853 | skb->len,PCI_DMA_FROMDEVICE); | 853 | np->rx_buf_sz,PCI_DMA_FROMDEVICE); |
854 | 854 | ||
855 | np->rx_ring[i].buffer1 = np->rx_addr[i]; | 855 | np->rx_ring[i].buffer1 = np->rx_addr[i]; |
856 | np->rx_ring[i].status = DescOwn; | 856 | np->rx_ring[i].status = DescOwn; |
@@ -1316,7 +1316,7 @@ static int netdev_rx(struct net_device *dev) | |||
1316 | skb->dev = dev; /* Mark as being used by this device. */ | 1316 | skb->dev = dev; /* Mark as being used by this device. */ |
1317 | np->rx_addr[entry] = pci_map_single(np->pci_dev, | 1317 | np->rx_addr[entry] = pci_map_single(np->pci_dev, |
1318 | skb->data, | 1318 | skb->data, |
1319 | skb->len, PCI_DMA_FROMDEVICE); | 1319 | np->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1320 | np->rx_ring[entry].buffer1 = np->rx_addr[entry]; | 1320 | np->rx_ring[entry].buffer1 = np->rx_addr[entry]; |
1321 | } | 1321 | } |
1322 | wmb(); | 1322 | wmb(); |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index a6dc53b4250d..fdc21037f6dc 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -491,8 +491,6 @@ struct rhine_private { | |||
491 | u8 tx_thresh, rx_thresh; | 491 | u8 tx_thresh, rx_thresh; |
492 | 492 | ||
493 | struct mii_if_info mii_if; | 493 | struct mii_if_info mii_if; |
494 | struct work_struct tx_timeout_task; | ||
495 | struct work_struct check_media_task; | ||
496 | void __iomem *base; | 494 | void __iomem *base; |
497 | }; | 495 | }; |
498 | 496 | ||
@@ -500,8 +498,6 @@ static int mdio_read(struct net_device *dev, int phy_id, int location); | |||
500 | static void mdio_write(struct net_device *dev, int phy_id, int location, int value); | 498 | static void mdio_write(struct net_device *dev, int phy_id, int location, int value); |
501 | static int rhine_open(struct net_device *dev); | 499 | static int rhine_open(struct net_device *dev); |
502 | static void rhine_tx_timeout(struct net_device *dev); | 500 | static void rhine_tx_timeout(struct net_device *dev); |
503 | static void rhine_tx_timeout_task(struct net_device *dev); | ||
504 | static void rhine_check_media_task(struct net_device *dev); | ||
505 | static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev); | 501 | static int rhine_start_tx(struct sk_buff *skb, struct net_device *dev); |
506 | static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); | 502 | static irqreturn_t rhine_interrupt(int irq, void *dev_instance, struct pt_regs *regs); |
507 | static void rhine_tx(struct net_device *dev); | 503 | static void rhine_tx(struct net_device *dev); |
@@ -856,12 +852,6 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
856 | if (rp->quirks & rqRhineI) | 852 | if (rp->quirks & rqRhineI) |
857 | dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM; | 853 | dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM; |
858 | 854 | ||
859 | INIT_WORK(&rp->tx_timeout_task, | ||
860 | (void (*)(void *))rhine_tx_timeout_task, dev); | ||
861 | |||
862 | INIT_WORK(&rp->check_media_task, | ||
863 | (void (*)(void *))rhine_check_media_task, dev); | ||
864 | |||
865 | /* dev->name not defined before register_netdev()! */ | 855 | /* dev->name not defined before register_netdev()! */ |
866 | rc = register_netdev(dev); | 856 | rc = register_netdev(dev); |
867 | if (rc) | 857 | if (rc) |
@@ -1108,11 +1098,6 @@ static void rhine_set_carrier(struct mii_if_info *mii) | |||
1108 | netif_carrier_ok(mii->dev)); | 1098 | netif_carrier_ok(mii->dev)); |
1109 | } | 1099 | } |
1110 | 1100 | ||
1111 | static void rhine_check_media_task(struct net_device *dev) | ||
1112 | { | ||
1113 | rhine_check_media(dev, 0); | ||
1114 | } | ||
1115 | |||
1116 | static void init_registers(struct net_device *dev) | 1101 | static void init_registers(struct net_device *dev) |
1117 | { | 1102 | { |
1118 | struct rhine_private *rp = netdev_priv(dev); | 1103 | struct rhine_private *rp = netdev_priv(dev); |
@@ -1166,8 +1151,8 @@ static void rhine_disable_linkmon(void __iomem *ioaddr, u32 quirks) | |||
1166 | if (quirks & rqRhineI) { | 1151 | if (quirks & rqRhineI) { |
1167 | iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR | 1152 | iowrite8(0x01, ioaddr + MIIRegAddr); // MII_BMSR |
1168 | 1153 | ||
1169 | /* Do not call from ISR! */ | 1154 | /* Can be called from ISR. Evil. */ |
1170 | msleep(1); | 1155 | mdelay(1); |
1171 | 1156 | ||
1172 | /* 0x80 must be set immediately before turning it off */ | 1157 | /* 0x80 must be set immediately before turning it off */ |
1173 | iowrite8(0x80, ioaddr + MIICmd); | 1158 | iowrite8(0x80, ioaddr + MIICmd); |
@@ -1257,16 +1242,6 @@ static int rhine_open(struct net_device *dev) | |||
1257 | static void rhine_tx_timeout(struct net_device *dev) | 1242 | static void rhine_tx_timeout(struct net_device *dev) |
1258 | { | 1243 | { |
1259 | struct rhine_private *rp = netdev_priv(dev); | 1244 | struct rhine_private *rp = netdev_priv(dev); |
1260 | |||
1261 | /* | ||
1262 | * Move bulk of work outside of interrupt context | ||
1263 | */ | ||
1264 | schedule_work(&rp->tx_timeout_task); | ||
1265 | } | ||
1266 | |||
1267 | static void rhine_tx_timeout_task(struct net_device *dev) | ||
1268 | { | ||
1269 | struct rhine_private *rp = netdev_priv(dev); | ||
1270 | void __iomem *ioaddr = rp->base; | 1245 | void __iomem *ioaddr = rp->base; |
1271 | 1246 | ||
1272 | printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status " | 1247 | printk(KERN_WARNING "%s: Transmit timed out, status %4.4x, PHY status " |
@@ -1677,7 +1652,7 @@ static void rhine_error(struct net_device *dev, int intr_status) | |||
1677 | spin_lock(&rp->lock); | 1652 | spin_lock(&rp->lock); |
1678 | 1653 | ||
1679 | if (intr_status & IntrLinkChange) | 1654 | if (intr_status & IntrLinkChange) |
1680 | schedule_work(&rp->check_media_task); | 1655 | rhine_check_media(dev, 0); |
1681 | if (intr_status & IntrStatsMax) { | 1656 | if (intr_status & IntrStatsMax) { |
1682 | rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); | 1657 | rp->stats.rx_crc_errors += ioread16(ioaddr + RxCRCErrs); |
1683 | rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); | 1658 | rp->stats.rx_missed_errors += ioread16(ioaddr + RxMissed); |
@@ -1927,9 +1902,6 @@ static int rhine_close(struct net_device *dev) | |||
1927 | spin_unlock_irq(&rp->lock); | 1902 | spin_unlock_irq(&rp->lock); |
1928 | 1903 | ||
1929 | free_irq(rp->pdev->irq, dev); | 1904 | free_irq(rp->pdev->irq, dev); |
1930 | |||
1931 | flush_scheduled_work(); | ||
1932 | |||
1933 | free_rbufs(dev); | 1905 | free_rbufs(dev); |
1934 | free_tbufs(dev); | 1906 | free_tbufs(dev); |
1935 | free_ring(dev); | 1907 | free_ring(dev); |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 9a06e61df0a2..7ed18cad29f7 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -939,9 +939,9 @@ static int bcm43xx_sprom_extract(struct bcm43xx_private *bcm) | |||
939 | return 0; | 939 | return 0; |
940 | } | 940 | } |
941 | 941 | ||
942 | static void bcm43xx_geo_init(struct bcm43xx_private *bcm) | 942 | static int bcm43xx_geo_init(struct bcm43xx_private *bcm) |
943 | { | 943 | { |
944 | struct ieee80211_geo geo; | 944 | struct ieee80211_geo *geo; |
945 | struct ieee80211_channel *chan; | 945 | struct ieee80211_channel *chan; |
946 | int have_a = 0, have_bg = 0; | 946 | int have_a = 0, have_bg = 0; |
947 | int i; | 947 | int i; |
@@ -949,7 +949,10 @@ static void bcm43xx_geo_init(struct bcm43xx_private *bcm) | |||
949 | struct bcm43xx_phyinfo *phy; | 949 | struct bcm43xx_phyinfo *phy; |
950 | const char *iso_country; | 950 | const char *iso_country; |
951 | 951 | ||
952 | memset(&geo, 0, sizeof(geo)); | 952 | geo = kzalloc(sizeof(*geo), GFP_KERNEL); |
953 | if (!geo) | ||
954 | return -ENOMEM; | ||
955 | |||
953 | for (i = 0; i < bcm->nr_80211_available; i++) { | 956 | for (i = 0; i < bcm->nr_80211_available; i++) { |
954 | phy = &(bcm->core_80211_ext[i].phy); | 957 | phy = &(bcm->core_80211_ext[i].phy); |
955 | switch (phy->type) { | 958 | switch (phy->type) { |
@@ -967,31 +970,36 @@ static void bcm43xx_geo_init(struct bcm43xx_private *bcm) | |||
967 | iso_country = bcm43xx_locale_iso(bcm->sprom.locale); | 970 | iso_country = bcm43xx_locale_iso(bcm->sprom.locale); |
968 | 971 | ||
969 | if (have_a) { | 972 | if (have_a) { |
970 | for (i = 0, channel = 0; channel < 201; channel++) { | 973 | for (i = 0, channel = IEEE80211_52GHZ_MIN_CHANNEL; |
971 | chan = &geo.a[i++]; | 974 | channel <= IEEE80211_52GHZ_MAX_CHANNEL; channel++) { |
975 | chan = &geo->a[i++]; | ||
972 | chan->freq = bcm43xx_channel_to_freq_a(channel); | 976 | chan->freq = bcm43xx_channel_to_freq_a(channel); |
973 | chan->channel = channel; | 977 | chan->channel = channel; |
974 | } | 978 | } |
975 | geo.a_channels = i; | 979 | geo->a_channels = i; |
976 | } | 980 | } |
977 | if (have_bg) { | 981 | if (have_bg) { |
978 | for (i = 0, channel = 1; channel < 15; channel++) { | 982 | for (i = 0, channel = IEEE80211_24GHZ_MIN_CHANNEL; |
979 | chan = &geo.bg[i++]; | 983 | channel <= IEEE80211_24GHZ_MAX_CHANNEL; channel++) { |
984 | chan = &geo->bg[i++]; | ||
980 | chan->freq = bcm43xx_channel_to_freq_bg(channel); | 985 | chan->freq = bcm43xx_channel_to_freq_bg(channel); |
981 | chan->channel = channel; | 986 | chan->channel = channel; |
982 | } | 987 | } |
983 | geo.bg_channels = i; | 988 | geo->bg_channels = i; |
984 | } | 989 | } |
985 | memcpy(geo.name, iso_country, 2); | 990 | memcpy(geo->name, iso_country, 2); |
986 | if (0 /*TODO: Outdoor use only */) | 991 | if (0 /*TODO: Outdoor use only */) |
987 | geo.name[2] = 'O'; | 992 | geo->name[2] = 'O'; |
988 | else if (0 /*TODO: Indoor use only */) | 993 | else if (0 /*TODO: Indoor use only */) |
989 | geo.name[2] = 'I'; | 994 | geo->name[2] = 'I'; |
990 | else | 995 | else |
991 | geo.name[2] = ' '; | 996 | geo->name[2] = ' '; |
992 | geo.name[3] = '\0'; | 997 | geo->name[3] = '\0'; |
998 | |||
999 | ieee80211_set_geo(bcm->ieee, geo); | ||
1000 | kfree(geo); | ||
993 | 1001 | ||
994 | ieee80211_set_geo(bcm->ieee, &geo); | 1002 | return 0; |
995 | } | 1003 | } |
996 | 1004 | ||
997 | /* DummyTransmission function, as documented on | 1005 | /* DummyTransmission function, as documented on |
@@ -3263,6 +3271,9 @@ static int bcm43xx_init_board(struct bcm43xx_private *bcm) | |||
3263 | bcm43xx_sysfs_register(bcm); | 3271 | bcm43xx_sysfs_register(bcm); |
3264 | //FIXME: check for bcm43xx_sysfs_register failure. This function is a bit messy regarding unwinding, though... | 3272 | //FIXME: check for bcm43xx_sysfs_register failure. This function is a bit messy regarding unwinding, though... |
3265 | 3273 | ||
3274 | /*FIXME: This should be handled by softmac instead. */ | ||
3275 | schedule_work(&bcm->softmac->associnfo.work); | ||
3276 | |||
3266 | assert(err == 0); | 3277 | assert(err == 0); |
3267 | out: | 3278 | out: |
3268 | return err; | 3279 | return err; |
@@ -3479,16 +3490,17 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) | |||
3479 | goto err_80211_unwind; | 3490 | goto err_80211_unwind; |
3480 | bcm43xx_wireless_core_disable(bcm); | 3491 | bcm43xx_wireless_core_disable(bcm); |
3481 | } | 3492 | } |
3493 | err = bcm43xx_geo_init(bcm); | ||
3494 | if (err) | ||
3495 | goto err_80211_unwind; | ||
3482 | bcm43xx_pctl_set_crystal(bcm, 0); | 3496 | bcm43xx_pctl_set_crystal(bcm, 0); |
3483 | 3497 | ||
3484 | /* Set the MAC address in the networking subsystem */ | 3498 | /* Set the MAC address in the networking subsystem */ |
3485 | if (bcm43xx_current_phy(bcm)->type == BCM43xx_PHYTYPE_A) | 3499 | if (is_valid_ether_addr(bcm->sprom.et1macaddr)) |
3486 | memcpy(bcm->net_dev->dev_addr, bcm->sprom.et1macaddr, 6); | 3500 | memcpy(bcm->net_dev->dev_addr, bcm->sprom.et1macaddr, 6); |
3487 | else | 3501 | else |
3488 | memcpy(bcm->net_dev->dev_addr, bcm->sprom.il0macaddr, 6); | 3502 | memcpy(bcm->net_dev->dev_addr, bcm->sprom.il0macaddr, 6); |
3489 | 3503 | ||
3490 | bcm43xx_geo_init(bcm); | ||
3491 | |||
3492 | snprintf(bcm->nick, IW_ESSID_MAX_SIZE, | 3504 | snprintf(bcm->nick, IW_ESSID_MAX_SIZE, |
3493 | "Broadcom %04X", bcm->chip_id); | 3505 | "Broadcom %04X", bcm->chip_id); |
3494 | 3506 | ||
@@ -3937,9 +3949,6 @@ static int bcm43xx_resume(struct pci_dev *pdev) | |||
3937 | 3949 | ||
3938 | netif_device_attach(net_dev); | 3950 | netif_device_attach(net_dev); |
3939 | 3951 | ||
3940 | /*FIXME: This should be handled by softmac instead. */ | ||
3941 | schedule_work(&bcm->softmac->associnfo.work); | ||
3942 | |||
3943 | dprintk(KERN_INFO PFX "Device resumed.\n"); | 3952 | dprintk(KERN_INFO PFX "Device resumed.\n"); |
3944 | 3953 | ||
3945 | return 0; | 3954 | return 0; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.h b/drivers/net/wireless/bcm43xx/bcm43xx_main.h index eca79a38594a..30a202b258b5 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.h +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.h | |||
@@ -118,12 +118,14 @@ int bcm43xx_channel_to_freq(struct bcm43xx_private *bcm, | |||
118 | static inline | 118 | static inline |
119 | int bcm43xx_is_valid_channel_a(u8 channel) | 119 | int bcm43xx_is_valid_channel_a(u8 channel) |
120 | { | 120 | { |
121 | return (channel <= 200); | 121 | return (channel >= IEEE80211_52GHZ_MIN_CHANNEL |
122 | && channel <= IEEE80211_52GHZ_MAX_CHANNEL); | ||
122 | } | 123 | } |
123 | static inline | 124 | static inline |
124 | int bcm43xx_is_valid_channel_bg(u8 channel) | 125 | int bcm43xx_is_valid_channel_bg(u8 channel) |
125 | { | 126 | { |
126 | return (channel >= 1 && channel <= 14); | 127 | return (channel >= IEEE80211_24GHZ_MIN_CHANNEL |
128 | && channel <= IEEE80211_24GHZ_MAX_CHANNEL); | ||
127 | } | 129 | } |
128 | static inline | 130 | static inline |
129 | int bcm43xx_is_valid_channel(struct bcm43xx_private *bcm, | 131 | int bcm43xx_is_valid_channel(struct bcm43xx_private *bcm, |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index 33137165727f..b0abac515530 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -1287,7 +1287,7 @@ static void bcm43xx_phy_initg(struct bcm43xx_private *bcm) | |||
1287 | if (radio->revision == 8) | 1287 | if (radio->revision == 8) |
1288 | bcm43xx_phy_write(bcm, 0x0805, 0x3230); | 1288 | bcm43xx_phy_write(bcm, 0x0805, 0x3230); |
1289 | bcm43xx_phy_init_pctl(bcm); | 1289 | bcm43xx_phy_init_pctl(bcm); |
1290 | if (bcm->chip_id == 0x4306 && bcm->chip_package != 2) { | 1290 | if (bcm->chip_id == 0x4306 && bcm->chip_package == 2) { |
1291 | bcm43xx_phy_write(bcm, 0x0429, | 1291 | bcm43xx_phy_write(bcm, 0x0429, |
1292 | bcm43xx_phy_read(bcm, 0x0429) & 0xBFFF); | 1292 | bcm43xx_phy_read(bcm, 0x0429) & 0xBFFF); |
1293 | bcm43xx_phy_write(bcm, 0x04C3, | 1293 | bcm43xx_phy_write(bcm, 0x04C3, |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c index 3edbb481a0a0..b45063974ae9 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_wx.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_wx.c | |||
@@ -182,8 +182,11 @@ static int bcm43xx_wx_set_mode(struct net_device *net_dev, | |||
182 | mode = BCM43xx_INITIAL_IWMODE; | 182 | mode = BCM43xx_INITIAL_IWMODE; |
183 | 183 | ||
184 | bcm43xx_lock_mmio(bcm, flags); | 184 | bcm43xx_lock_mmio(bcm, flags); |
185 | if (bcm->ieee->iw_mode != mode) | 185 | if (bcm->initialized) { |
186 | bcm43xx_set_iwmode(bcm, mode); | 186 | if (bcm->ieee->iw_mode != mode) |
187 | bcm43xx_set_iwmode(bcm, mode); | ||
188 | } else | ||
189 | bcm->ieee->iw_mode = mode; | ||
187 | bcm43xx_unlock_mmio(bcm, flags); | 190 | bcm43xx_unlock_mmio(bcm, flags); |
188 | 191 | ||
189 | return 0; | 192 | return 0; |
diff --git a/drivers/net/wireless/orinoco.c b/drivers/net/wireless/orinoco.c index 06523e2a8471..c2d0b09e0418 100644 --- a/drivers/net/wireless/orinoco.c +++ b/drivers/net/wireless/orinoco.c | |||
@@ -812,7 +812,6 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, | |||
812 | if (datalen > IEEE80211_DATA_LEN + 12) { | 812 | if (datalen > IEEE80211_DATA_LEN + 12) { |
813 | printk(KERN_DEBUG "%s: oversized monitor frame, " | 813 | printk(KERN_DEBUG "%s: oversized monitor frame, " |
814 | "data length = %d\n", dev->name, datalen); | 814 | "data length = %d\n", dev->name, datalen); |
815 | err = -EIO; | ||
816 | stats->rx_length_errors++; | 815 | stats->rx_length_errors++; |
817 | goto update_stats; | 816 | goto update_stats; |
818 | } | 817 | } |
@@ -821,8 +820,7 @@ static void orinoco_rx_monitor(struct net_device *dev, u16 rxfid, | |||
821 | if (!skb) { | 820 | if (!skb) { |
822 | printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", | 821 | printk(KERN_WARNING "%s: Cannot allocate skb for monitor frame\n", |
823 | dev->name); | 822 | dev->name); |
824 | err = -ENOMEM; | 823 | goto update_stats; |
825 | goto drop; | ||
826 | } | 824 | } |
827 | 825 | ||
828 | /* Copy the 802.11 header to the skb */ | 826 | /* Copy the 802.11 header to the skb */ |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 6917c6cb0912..c2ecae5ff0c1 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
@@ -33,13 +33,10 @@ acpi_query_osc ( | |||
33 | acpi_status status; | 33 | acpi_status status; |
34 | struct acpi_object_list input; | 34 | struct acpi_object_list input; |
35 | union acpi_object in_params[4]; | 35 | union acpi_object in_params[4]; |
36 | struct acpi_buffer output; | 36 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; |
37 | union acpi_object out_obj; | 37 | union acpi_object *out_obj; |
38 | u32 osc_dw0; | 38 | u32 osc_dw0; |
39 | 39 | ||
40 | /* Setting up output buffer */ | ||
41 | output.length = sizeof(out_obj) + 3*sizeof(u32); | ||
42 | output.pointer = &out_obj; | ||
43 | 40 | ||
44 | /* Setting up input parameters */ | 41 | /* Setting up input parameters */ |
45 | input.count = 4; | 42 | input.count = 4; |
@@ -61,12 +58,15 @@ acpi_query_osc ( | |||
61 | "Evaluate _OSC Set fails. Status = 0x%04x\n", status); | 58 | "Evaluate _OSC Set fails. Status = 0x%04x\n", status); |
62 | return status; | 59 | return status; |
63 | } | 60 | } |
64 | if (out_obj.type != ACPI_TYPE_BUFFER) { | 61 | out_obj = output.pointer; |
62 | |||
63 | if (out_obj->type != ACPI_TYPE_BUFFER) { | ||
65 | printk(KERN_DEBUG | 64 | printk(KERN_DEBUG |
66 | "Evaluate _OSC returns wrong type\n"); | 65 | "Evaluate _OSC returns wrong type\n"); |
67 | return AE_TYPE; | 66 | status = AE_TYPE; |
67 | goto query_osc_out; | ||
68 | } | 68 | } |
69 | osc_dw0 = *((u32 *) out_obj.buffer.pointer); | 69 | osc_dw0 = *((u32 *) out_obj->buffer.pointer); |
70 | if (osc_dw0) { | 70 | if (osc_dw0) { |
71 | if (osc_dw0 & OSC_REQUEST_ERROR) | 71 | if (osc_dw0 & OSC_REQUEST_ERROR) |
72 | printk(KERN_DEBUG "_OSC request fails\n"); | 72 | printk(KERN_DEBUG "_OSC request fails\n"); |
@@ -76,15 +76,21 @@ acpi_query_osc ( | |||
76 | printk(KERN_DEBUG "_OSC invalid revision\n"); | 76 | printk(KERN_DEBUG "_OSC invalid revision\n"); |
77 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { | 77 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { |
78 | /* Update Global Control Set */ | 78 | /* Update Global Control Set */ |
79 | global_ctrlsets = *((u32 *)(out_obj.buffer.pointer+8)); | 79 | global_ctrlsets = *((u32 *)(out_obj->buffer.pointer+8)); |
80 | return AE_OK; | 80 | status = AE_OK; |
81 | goto query_osc_out; | ||
81 | } | 82 | } |
82 | return AE_ERROR; | 83 | status = AE_ERROR; |
84 | goto query_osc_out; | ||
83 | } | 85 | } |
84 | 86 | ||
85 | /* Update Global Control Set */ | 87 | /* Update Global Control Set */ |
86 | global_ctrlsets = *((u32 *)(out_obj.buffer.pointer + 8)); | 88 | global_ctrlsets = *((u32 *)(out_obj->buffer.pointer + 8)); |
87 | return AE_OK; | 89 | status = AE_OK; |
90 | |||
91 | query_osc_out: | ||
92 | kfree(output.pointer); | ||
93 | return status; | ||
88 | } | 94 | } |
89 | 95 | ||
90 | 96 | ||
@@ -96,14 +102,10 @@ acpi_run_osc ( | |||
96 | acpi_status status; | 102 | acpi_status status; |
97 | struct acpi_object_list input; | 103 | struct acpi_object_list input; |
98 | union acpi_object in_params[4]; | 104 | union acpi_object in_params[4]; |
99 | struct acpi_buffer output; | 105 | struct acpi_buffer output = {ACPI_ALLOCATE_BUFFER, NULL}; |
100 | union acpi_object out_obj; | 106 | union acpi_object *out_obj; |
101 | u32 osc_dw0; | 107 | u32 osc_dw0; |
102 | 108 | ||
103 | /* Setting up output buffer */ | ||
104 | output.length = sizeof(out_obj) + 3*sizeof(u32); | ||
105 | output.pointer = &out_obj; | ||
106 | |||
107 | /* Setting up input parameters */ | 109 | /* Setting up input parameters */ |
108 | input.count = 4; | 110 | input.count = 4; |
109 | input.pointer = in_params; | 111 | input.pointer = in_params; |
@@ -124,12 +126,14 @@ acpi_run_osc ( | |||
124 | "Evaluate _OSC Set fails. Status = 0x%04x\n", status); | 126 | "Evaluate _OSC Set fails. Status = 0x%04x\n", status); |
125 | return status; | 127 | return status; |
126 | } | 128 | } |
127 | if (out_obj.type != ACPI_TYPE_BUFFER) { | 129 | out_obj = output.pointer; |
130 | if (out_obj->type != ACPI_TYPE_BUFFER) { | ||
128 | printk(KERN_DEBUG | 131 | printk(KERN_DEBUG |
129 | "Evaluate _OSC returns wrong type\n"); | 132 | "Evaluate _OSC returns wrong type\n"); |
130 | return AE_TYPE; | 133 | status = AE_TYPE; |
134 | goto run_osc_out; | ||
131 | } | 135 | } |
132 | osc_dw0 = *((u32 *) out_obj.buffer.pointer); | 136 | osc_dw0 = *((u32 *) out_obj->buffer.pointer); |
133 | if (osc_dw0) { | 137 | if (osc_dw0) { |
134 | if (osc_dw0 & OSC_REQUEST_ERROR) | 138 | if (osc_dw0 & OSC_REQUEST_ERROR) |
135 | printk(KERN_DEBUG "_OSC request fails\n"); | 139 | printk(KERN_DEBUG "_OSC request fails\n"); |
@@ -139,11 +143,17 @@ acpi_run_osc ( | |||
139 | printk(KERN_DEBUG "_OSC invalid revision\n"); | 143 | printk(KERN_DEBUG "_OSC invalid revision\n"); |
140 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { | 144 | if (osc_dw0 & OSC_CAPABILITIES_MASK_ERROR) { |
141 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); | 145 | printk(KERN_DEBUG "_OSC FW not grant req. control\n"); |
142 | return AE_SUPPORT; | 146 | status = AE_SUPPORT; |
147 | goto run_osc_out; | ||
143 | } | 148 | } |
144 | return AE_ERROR; | 149 | status = AE_ERROR; |
150 | goto run_osc_out; | ||
145 | } | 151 | } |
146 | return AE_OK; | 152 | status = AE_OK; |
153 | |||
154 | run_osc_out: | ||
155 | kfree(output.pointer); | ||
156 | return status; | ||
147 | } | 157 | } |
148 | 158 | ||
149 | /** | 159 | /** |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 19e2b174d33c..d378478612fb 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -634,6 +634,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_vi | |||
634 | * non-x86 architectures (yes Via exists on PPC among other places), | 634 | * non-x86 architectures (yes Via exists on PPC among other places), |
635 | * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get | 635 | * we must mask the PCI_INTERRUPT_LINE value versus 0xf to get |
636 | * interrupts delivered properly. | 636 | * interrupts delivered properly. |
637 | * | ||
638 | * Some of the on-chip devices are actually '586 devices' so they are | ||
639 | * listed here. | ||
637 | */ | 640 | */ |
638 | static void quirk_via_irq(struct pci_dev *dev) | 641 | static void quirk_via_irq(struct pci_dev *dev) |
639 | { | 642 | { |
@@ -648,6 +651,10 @@ static void quirk_via_irq(struct pci_dev *dev) | |||
648 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq); | 651 | pci_write_config_byte(dev, PCI_INTERRUPT_LINE, new_irq); |
649 | } | 652 | } |
650 | } | 653 | } |
654 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_0, quirk_via_irq); | ||
655 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, quirk_via_irq); | ||
656 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_2, quirk_via_irq); | ||
657 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, quirk_via_irq); | ||
651 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq); | 658 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686, quirk_via_irq); |
652 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq); | 659 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_4, quirk_via_irq); |
653 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq); | 660 | DECLARE_PCI_FIXUP_ENABLE(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C686_5, quirk_via_irq); |
@@ -895,6 +902,7 @@ static void __init k8t_sound_hostbridge(struct pci_dev *dev) | |||
895 | } | 902 | } |
896 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge); | 903 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_hostbridge); |
897 | 904 | ||
905 | #ifndef CONFIG_ACPI_SLEEP | ||
898 | /* | 906 | /* |
899 | * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge | 907 | * On ASUS P4B boards, the SMBus PCI Device within the ICH2/4 southbridge |
900 | * is not activated. The myth is that Asus said that they do not want the | 908 | * is not activated. The myth is that Asus said that they do not want the |
@@ -906,8 +914,12 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, k8t_sound_ho | |||
906 | * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it | 914 | * bridge. Unfortunately, this device has no subvendor/subdevice ID. So it |
907 | * becomes necessary to do this tweak in two steps -- I've chosen the Host | 915 | * becomes necessary to do this tweak in two steps -- I've chosen the Host |
908 | * bridge as trigger. | 916 | * bridge as trigger. |
917 | * | ||
918 | * Actually, leaving it unhidden and not redoing the quirk over suspend2ram | ||
919 | * will cause thermal management to break down, and causing machine to | ||
920 | * overheat. | ||
909 | */ | 921 | */ |
910 | static int __initdata asus_hides_smbus = 0; | 922 | static int __initdata asus_hides_smbus; |
911 | 923 | ||
912 | static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) | 924 | static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) |
913 | { | 925 | { |
@@ -1050,6 +1062,8 @@ static void __init asus_hides_smbus_lpc_ich6(struct pci_dev *dev) | |||
1050 | } | 1062 | } |
1051 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6 ); | 1063 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH6_1, asus_hides_smbus_lpc_ich6 ); |
1052 | 1064 | ||
1065 | #endif | ||
1066 | |||
1053 | /* | 1067 | /* |
1054 | * SiS 96x south bridge: BIOS typically hides SMBus device... | 1068 | * SiS 96x south bridge: BIOS typically hides SMBus device... |
1055 | */ | 1069 | */ |
diff --git a/drivers/pcmcia/pcmcia_ioctl.c b/drivers/pcmcia/pcmcia_ioctl.c index c53db7ceda5e..738b1ef595a3 100644 --- a/drivers/pcmcia/pcmcia_ioctl.c +++ b/drivers/pcmcia/pcmcia_ioctl.c | |||
@@ -426,7 +426,7 @@ static int ds_open(struct inode *inode, struct file *file) | |||
426 | 426 | ||
427 | if (!warning_printed) { | 427 | if (!warning_printed) { |
428 | printk(KERN_INFO "pcmcia: Detected deprecated PCMCIA ioctl " | 428 | printk(KERN_INFO "pcmcia: Detected deprecated PCMCIA ioctl " |
429 | "usage.\n"); | 429 | "usage from process: %s.\n", current->comm); |
430 | printk(KERN_INFO "pcmcia: This interface will soon be removed from " | 430 | printk(KERN_INFO "pcmcia: This interface will soon be removed from " |
431 | "the kernel; please expect breakage unless you upgrade " | 431 | "the kernel; please expect breakage unless you upgrade " |
432 | "to new tools.\n"); | 432 | "to new tools.\n"); |
@@ -601,8 +601,12 @@ static int ds_ioctl(struct inode * inode, struct file * file, | |||
601 | ret = CS_BAD_ARGS; | 601 | ret = CS_BAD_ARGS; |
602 | else { | 602 | else { |
603 | struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function); | 603 | struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->config.Function); |
604 | ret = pccard_get_configuration_info(s, p_dev, &buf->config); | 604 | if (p_dev == NULL) |
605 | pcmcia_put_dev(p_dev); | 605 | ret = CS_BAD_ARGS; |
606 | else { | ||
607 | ret = pccard_get_configuration_info(s, p_dev, &buf->config); | ||
608 | pcmcia_put_dev(p_dev); | ||
609 | } | ||
606 | } | 610 | } |
607 | break; | 611 | break; |
608 | case DS_GET_FIRST_TUPLE: | 612 | case DS_GET_FIRST_TUPLE: |
@@ -632,8 +636,12 @@ static int ds_ioctl(struct inode * inode, struct file * file, | |||
632 | ret = CS_BAD_ARGS; | 636 | ret = CS_BAD_ARGS; |
633 | else { | 637 | else { |
634 | struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function); | 638 | struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->status.Function); |
635 | ret = pccard_get_status(s, p_dev, &buf->status); | 639 | if (p_dev == NULL) |
636 | pcmcia_put_dev(p_dev); | 640 | ret = CS_BAD_ARGS; |
641 | else { | ||
642 | ret = pccard_get_status(s, p_dev, &buf->status); | ||
643 | pcmcia_put_dev(p_dev); | ||
644 | } | ||
637 | } | 645 | } |
638 | break; | 646 | break; |
639 | case DS_VALIDATE_CIS: | 647 | case DS_VALIDATE_CIS: |
@@ -665,9 +673,10 @@ static int ds_ioctl(struct inode * inode, struct file * file, | |||
665 | if (!(buf->conf_reg.Function && | 673 | if (!(buf->conf_reg.Function && |
666 | (buf->conf_reg.Function >= s->functions))) { | 674 | (buf->conf_reg.Function >= s->functions))) { |
667 | struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->conf_reg.Function); | 675 | struct pcmcia_device *p_dev = get_pcmcia_device(s, buf->conf_reg.Function); |
668 | if (p_dev) | 676 | if (p_dev) { |
669 | ret = pcmcia_access_configuration_register(p_dev, &buf->conf_reg); | 677 | ret = pcmcia_access_configuration_register(p_dev, &buf->conf_reg); |
670 | pcmcia_put_dev(p_dev); | 678 | pcmcia_put_dev(p_dev); |
679 | } | ||
671 | } | 680 | } |
672 | break; | 681 | break; |
673 | case DS_GET_FIRST_REGION: | 682 | case DS_GET_FIRST_REGION: |
diff --git a/drivers/pcmcia/pd6729.c b/drivers/pcmcia/pd6729.c index 16d1ea7b0a18..247ab837f841 100644 --- a/drivers/pcmcia/pd6729.c +++ b/drivers/pcmcia/pd6729.c | |||
@@ -589,7 +589,7 @@ static int pd6729_check_irq(int irq, int flags) | |||
589 | return 0; | 589 | return 0; |
590 | } | 590 | } |
591 | 591 | ||
592 | static u_int __init pd6729_isa_scan(void) | 592 | static u_int __devinit pd6729_isa_scan(void) |
593 | { | 593 | { |
594 | u_int mask0, mask = 0; | 594 | u_int mask0, mask = 0; |
595 | int i; | 595 | int i; |
diff --git a/drivers/rtc/rtc-dev.c b/drivers/rtc/rtc-dev.c index 6c9ad92747fd..2011567005f9 100644 --- a/drivers/rtc/rtc-dev.c +++ b/drivers/rtc/rtc-dev.c | |||
@@ -141,13 +141,13 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file, | |||
141 | /* try the driver's ioctl interface */ | 141 | /* try the driver's ioctl interface */ |
142 | if (ops->ioctl) { | 142 | if (ops->ioctl) { |
143 | err = ops->ioctl(class_dev->dev, cmd, arg); | 143 | err = ops->ioctl(class_dev->dev, cmd, arg); |
144 | if (err != -EINVAL) | 144 | if (err != -ENOIOCTLCMD) |
145 | return err; | 145 | return err; |
146 | } | 146 | } |
147 | 147 | ||
148 | /* if the driver does not provide the ioctl interface | 148 | /* if the driver does not provide the ioctl interface |
149 | * or if that particular ioctl was not implemented | 149 | * or if that particular ioctl was not implemented |
150 | * (-EINVAL), we will try to emulate here. | 150 | * (-ENOIOCTLCMD), we will try to emulate here. |
151 | */ | 151 | */ |
152 | 152 | ||
153 | switch (cmd) { | 153 | switch (cmd) { |
@@ -233,7 +233,7 @@ static int rtc_dev_ioctl(struct inode *inode, struct file *file, | |||
233 | break; | 233 | break; |
234 | 234 | ||
235 | default: | 235 | default: |
236 | err = -EINVAL; | 236 | err = -ENOTTY; |
237 | break; | 237 | break; |
238 | } | 238 | } |
239 | 239 | ||
diff --git a/drivers/rtc/rtc-sa1100.c b/drivers/rtc/rtc-sa1100.c index a23ec54989f6..a997529f8926 100644 --- a/drivers/rtc/rtc-sa1100.c +++ b/drivers/rtc/rtc-sa1100.c | |||
@@ -178,9 +178,9 @@ static int sa1100_rtc_open(struct device *dev) | |||
178 | return 0; | 178 | return 0; |
179 | 179 | ||
180 | fail_pi: | 180 | fail_pi: |
181 | free_irq(IRQ_RTCAlrm, NULL); | 181 | free_irq(IRQ_RTCAlrm, dev); |
182 | fail_ai: | 182 | fail_ai: |
183 | free_irq(IRQ_RTC1Hz, NULL); | 183 | free_irq(IRQ_RTC1Hz, dev); |
184 | fail_ui: | 184 | fail_ui: |
185 | return ret; | 185 | return ret; |
186 | } | 186 | } |
@@ -247,7 +247,7 @@ static int sa1100_rtc_ioctl(struct device *dev, unsigned int cmd, | |||
247 | rtc_freq = arg; | 247 | rtc_freq = arg; |
248 | return 0; | 248 | return 0; |
249 | } | 249 | } |
250 | return -EINVAL; | 250 | return -ENOIOCTLCMD; |
251 | } | 251 | } |
252 | 252 | ||
253 | static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm) | 253 | static int sa1100_rtc_read_time(struct device *dev, struct rtc_time *tm) |
@@ -295,7 +295,7 @@ static int sa1100_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) | |||
295 | 295 | ||
296 | static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) | 296 | static int sa1100_rtc_proc(struct device *dev, struct seq_file *seq) |
297 | { | 297 | { |
298 | seq_printf(seq, "trim/divider\t: 0x%08x\n", RTTR); | 298 | seq_printf(seq, "trim/divider\t: 0x%08lx\n", RTTR); |
299 | seq_printf(seq, "alarm_IRQ\t: %s\n", | 299 | seq_printf(seq, "alarm_IRQ\t: %s\n", |
300 | (RTSR & RTSR_ALE) ? "yes" : "no" ); | 300 | (RTSR & RTSR_ALE) ? "yes" : "no" ); |
301 | seq_printf(seq, "update_IRQ\t: %s\n", | 301 | seq_printf(seq, "update_IRQ\t: %s\n", |
diff --git a/drivers/rtc/rtc-test.c b/drivers/rtc/rtc-test.c index e1f7e8e86daf..e1fa5fe7901f 100644 --- a/drivers/rtc/rtc-test.c +++ b/drivers/rtc/rtc-test.c | |||
@@ -71,7 +71,7 @@ static int test_rtc_ioctl(struct device *dev, unsigned int cmd, | |||
71 | return 0; | 71 | return 0; |
72 | 72 | ||
73 | default: | 73 | default: |
74 | return -EINVAL; | 74 | return -ENOIOCTLCMD; |
75 | } | 75 | } |
76 | } | 76 | } |
77 | 77 | ||
diff --git a/drivers/rtc/rtc-vr41xx.c b/drivers/rtc/rtc-vr41xx.c index 4d49fd501198..277596c302e3 100644 --- a/drivers/rtc/rtc-vr41xx.c +++ b/drivers/rtc/rtc-vr41xx.c | |||
@@ -270,7 +270,7 @@ static int vr41xx_rtc_ioctl(struct device *dev, unsigned int cmd, unsigned long | |||
270 | epoch = arg; | 270 | epoch = arg; |
271 | break; | 271 | break; |
272 | default: | 272 | default: |
273 | return -EINVAL; | 273 | return -ENOIOCTLCMD; |
274 | } | 274 | } |
275 | 275 | ||
276 | return 0; | 276 | return 0; |
diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index 5d6b7a57b02f..e65da921a827 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c | |||
@@ -1348,7 +1348,7 @@ lcs_irq(struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1348 | index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) | 1348 | index = (struct ccw1 *) __va((addr_t) irb->scsw.cpa) |
1349 | - channel->ccws; | 1349 | - channel->ccws; |
1350 | if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || | 1350 | if ((irb->scsw.actl & SCSW_ACTL_SUSPENDED) || |
1351 | (irb->scsw.cstat | SCHN_STAT_PCI)) | 1351 | (irb->scsw.cstat & SCHN_STAT_PCI)) |
1352 | /* Bloody io subsystem tells us lies about cpa... */ | 1352 | /* Bloody io subsystem tells us lies about cpa... */ |
1353 | index = (index - 1) & (LCS_NUM_BUFFS - 1); | 1353 | index = (index - 1) & (LCS_NUM_BUFFS - 1); |
1354 | while (channel->io_idx != index) { | 1354 | while (channel->io_idx != index) { |
diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c index 383a95f34a0d..239e108b8ed1 100644 --- a/drivers/sbus/char/openprom.c +++ b/drivers/sbus/char/openprom.c | |||
@@ -392,13 +392,16 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file, | |||
392 | return -ENOMEM; | 392 | return -ENOMEM; |
393 | } | 393 | } |
394 | 394 | ||
395 | prom_getproperty(op.op_nodeid, str, tmp, len); | 395 | cnt = prom_getproperty(op.op_nodeid, str, tmp, len); |
396 | 396 | if (cnt <= 0) { | |
397 | tmp[len] = '\0'; | 397 | error = -EINVAL; |
398 | } else { | ||
399 | tmp[len] = '\0'; | ||
398 | 400 | ||
399 | if (__copy_to_user(argp, &op, sizeof(op)) != 0 | 401 | if (__copy_to_user(argp, &op, sizeof(op)) != 0 || |
400 | || copy_to_user(op.op_buf, tmp, len) != 0) | 402 | copy_to_user(op.op_buf, tmp, len) != 0) |
401 | error = -EFAULT; | 403 | error = -EFAULT; |
404 | } | ||
402 | 405 | ||
403 | kfree(tmp); | 406 | kfree(tmp); |
404 | kfree(str); | 407 | kfree(str); |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index cb30d9c1153d..0c9c2f400bf6 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | |||
@@ -219,6 +219,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
219 | ahc->flags |= AHC_39BIT_ADDRESSING; | 219 | ahc->flags |= AHC_39BIT_ADDRESSING; |
220 | } else { | 220 | } else { |
221 | if (dma_set_mask(dev, DMA_32BIT_MASK)) { | 221 | if (dma_set_mask(dev, DMA_32BIT_MASK)) { |
222 | ahc_free(ahc); | ||
222 | printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n"); | 223 | printk(KERN_WARNING "aic7xxx: No suitable DMA available.\n"); |
223 | return (-ENODEV); | 224 | return (-ENODEV); |
224 | } | 225 | } |
diff --git a/drivers/scsi/aic7xxx/aic7xxx_pci.c b/drivers/scsi/aic7xxx/aic7xxx_pci.c index 5f586140e057..3adecef21783 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_pci.c | |||
@@ -2036,12 +2036,12 @@ ahc_pci_resume(struct ahc_softc *ahc) | |||
2036 | * that the OS doesn't know about and rely on our chip | 2036 | * that the OS doesn't know about and rely on our chip |
2037 | * reset handler to handle the rest. | 2037 | * reset handler to handle the rest. |
2038 | */ | 2038 | */ |
2039 | ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, /*bytes*/4, | 2039 | ahc_pci_write_config(ahc->dev_softc, DEVCONFIG, |
2040 | ahc->bus_softc.pci_softc.devconfig); | 2040 | ahc->bus_softc.pci_softc.devconfig, /*bytes*/4); |
2041 | ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/1, | 2041 | ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, |
2042 | ahc->bus_softc.pci_softc.command); | 2042 | ahc->bus_softc.pci_softc.command, /*bytes*/1); |
2043 | ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, /*bytes*/1, | 2043 | ahc_pci_write_config(ahc->dev_softc, CSIZE_LATTIME, |
2044 | ahc->bus_softc.pci_softc.csize_lattime); | 2044 | ahc->bus_softc.pci_softc.csize_lattime, /*bytes*/1); |
2045 | if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) { | 2045 | if ((ahc->flags & AHC_HAS_TERM_LOGIC) != 0) { |
2046 | struct seeprom_descriptor sd; | 2046 | struct seeprom_descriptor sd; |
2047 | u_int sxfrctl1; | 2047 | u_int sxfrctl1; |
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 0a8ad37ae899..2e9be83a697f 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -739,7 +739,8 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata) | |||
739 | { | 739 | { |
740 | struct viosrp_adapter_info *req; | 740 | struct viosrp_adapter_info *req; |
741 | struct srp_event_struct *evt_struct; | 741 | struct srp_event_struct *evt_struct; |
742 | 742 | dma_addr_t addr; | |
743 | |||
743 | evt_struct = get_event_struct(&hostdata->pool); | 744 | evt_struct = get_event_struct(&hostdata->pool); |
744 | if (!evt_struct) { | 745 | if (!evt_struct) { |
745 | printk(KERN_ERR "ibmvscsi: couldn't allocate an event " | 746 | printk(KERN_ERR "ibmvscsi: couldn't allocate an event " |
@@ -757,10 +758,10 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata) | |||
757 | 758 | ||
758 | req->common.type = VIOSRP_ADAPTER_INFO_TYPE; | 759 | req->common.type = VIOSRP_ADAPTER_INFO_TYPE; |
759 | req->common.length = sizeof(hostdata->madapter_info); | 760 | req->common.length = sizeof(hostdata->madapter_info); |
760 | req->buffer = dma_map_single(hostdata->dev, | 761 | req->buffer = addr = dma_map_single(hostdata->dev, |
761 | &hostdata->madapter_info, | 762 | &hostdata->madapter_info, |
762 | sizeof(hostdata->madapter_info), | 763 | sizeof(hostdata->madapter_info), |
763 | DMA_BIDIRECTIONAL); | 764 | DMA_BIDIRECTIONAL); |
764 | 765 | ||
765 | if (dma_mapping_error(req->buffer)) { | 766 | if (dma_mapping_error(req->buffer)) { |
766 | printk(KERN_ERR | 767 | printk(KERN_ERR |
@@ -770,8 +771,13 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata) | |||
770 | return; | 771 | return; |
771 | } | 772 | } |
772 | 773 | ||
773 | if (ibmvscsi_send_srp_event(evt_struct, hostdata)) | 774 | if (ibmvscsi_send_srp_event(evt_struct, hostdata)) { |
774 | printk(KERN_ERR "ibmvscsi: couldn't send ADAPTER_INFO_REQ!\n"); | 775 | printk(KERN_ERR "ibmvscsi: couldn't send ADAPTER_INFO_REQ!\n"); |
776 | dma_unmap_single(hostdata->dev, | ||
777 | addr, | ||
778 | sizeof(hostdata->madapter_info), | ||
779 | DMA_BIDIRECTIONAL); | ||
780 | } | ||
775 | }; | 781 | }; |
776 | 782 | ||
777 | /** | 783 | /** |
@@ -1259,6 +1265,7 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata, | |||
1259 | { | 1265 | { |
1260 | struct viosrp_host_config *host_config; | 1266 | struct viosrp_host_config *host_config; |
1261 | struct srp_event_struct *evt_struct; | 1267 | struct srp_event_struct *evt_struct; |
1268 | dma_addr_t addr; | ||
1262 | int rc; | 1269 | int rc; |
1263 | 1270 | ||
1264 | evt_struct = get_event_struct(&hostdata->pool); | 1271 | evt_struct = get_event_struct(&hostdata->pool); |
@@ -1279,8 +1286,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata, | |||
1279 | memset(host_config, 0x00, sizeof(*host_config)); | 1286 | memset(host_config, 0x00, sizeof(*host_config)); |
1280 | host_config->common.type = VIOSRP_HOST_CONFIG_TYPE; | 1287 | host_config->common.type = VIOSRP_HOST_CONFIG_TYPE; |
1281 | host_config->common.length = length; | 1288 | host_config->common.length = length; |
1282 | host_config->buffer = dma_map_single(hostdata->dev, buffer, length, | 1289 | host_config->buffer = addr = dma_map_single(hostdata->dev, buffer, |
1283 | DMA_BIDIRECTIONAL); | 1290 | length, |
1291 | DMA_BIDIRECTIONAL); | ||
1284 | 1292 | ||
1285 | if (dma_mapping_error(host_config->buffer)) { | 1293 | if (dma_mapping_error(host_config->buffer)) { |
1286 | printk(KERN_ERR | 1294 | printk(KERN_ERR |
@@ -1291,11 +1299,9 @@ static int ibmvscsi_do_host_config(struct ibmvscsi_host_data *hostdata, | |||
1291 | 1299 | ||
1292 | init_completion(&evt_struct->comp); | 1300 | init_completion(&evt_struct->comp); |
1293 | rc = ibmvscsi_send_srp_event(evt_struct, hostdata); | 1301 | rc = ibmvscsi_send_srp_event(evt_struct, hostdata); |
1294 | if (rc == 0) { | 1302 | if (rc == 0) |
1295 | wait_for_completion(&evt_struct->comp); | 1303 | wait_for_completion(&evt_struct->comp); |
1296 | dma_unmap_single(hostdata->dev, host_config->buffer, | 1304 | dma_unmap_single(hostdata->dev, addr, length, DMA_BIDIRECTIONAL); |
1297 | length, DMA_BIDIRECTIONAL); | ||
1298 | } | ||
1299 | 1305 | ||
1300 | return rc; | 1306 | return rc; |
1301 | } | 1307 | } |
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index bd147207f25d..823dfa78c0ba 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c | |||
@@ -864,6 +864,9 @@ static unsigned int ata_id_xfermask(const u16 *id) | |||
864 | /** | 864 | /** |
865 | * ata_port_queue_task - Queue port_task | 865 | * ata_port_queue_task - Queue port_task |
866 | * @ap: The ata_port to queue port_task for | 866 | * @ap: The ata_port to queue port_task for |
867 | * @fn: workqueue function to be scheduled | ||
868 | * @data: data value to pass to workqueue function | ||
869 | * @delay: delay time for workqueue function | ||
867 | * | 870 | * |
868 | * Schedule @fn(@data) for execution after @delay jiffies using | 871 | * Schedule @fn(@data) for execution after @delay jiffies using |
869 | * port_task. There is one port_task per port and it's the | 872 | * port_task. There is one port_task per port and it's the |
@@ -2739,6 +2742,8 @@ static unsigned int ata_dev_set_xfermode(struct ata_port *ap, | |||
2739 | * ata_dev_init_params - Issue INIT DEV PARAMS command | 2742 | * ata_dev_init_params - Issue INIT DEV PARAMS command |
2740 | * @ap: Port associated with device @dev | 2743 | * @ap: Port associated with device @dev |
2741 | * @dev: Device to which command will be sent | 2744 | * @dev: Device to which command will be sent |
2745 | * @heads: Number of heads (taskfile parameter) | ||
2746 | * @sectors: Number of sectors (taskfile parameter) | ||
2742 | * | 2747 | * |
2743 | * LOCKING: | 2748 | * LOCKING: |
2744 | * Kernel thread context (may sleep) | 2749 | * Kernel thread context (may sleep) |
@@ -4302,6 +4307,7 @@ int ata_device_resume(struct ata_port *ap, struct ata_device *dev) | |||
4302 | * ata_device_suspend - prepare a device for suspend | 4307 | * ata_device_suspend - prepare a device for suspend |
4303 | * @ap: port the device is connected to | 4308 | * @ap: port the device is connected to |
4304 | * @dev: the device to suspend | 4309 | * @dev: the device to suspend |
4310 | * @state: target power management state | ||
4305 | * | 4311 | * |
4306 | * Flush the cache on the drive, if appropriate, then issue a | 4312 | * Flush the cache on the drive, if appropriate, then issue a |
4307 | * standbynow command. | 4313 | * standbynow command. |
diff --git a/drivers/scsi/lpfc/lpfc_crtn.h b/drivers/scsi/lpfc/lpfc_crtn.h index fad607b2e6f4..ee22173fce43 100644 --- a/drivers/scsi/lpfc/lpfc_crtn.h +++ b/drivers/scsi/lpfc/lpfc_crtn.h | |||
@@ -27,7 +27,6 @@ void lpfc_config_link(struct lpfc_hba *, LPFC_MBOXQ_t *); | |||
27 | int lpfc_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *); | 27 | int lpfc_read_sparam(struct lpfc_hba *, LPFC_MBOXQ_t *); |
28 | void lpfc_read_config(struct lpfc_hba *, LPFC_MBOXQ_t *); | 28 | void lpfc_read_config(struct lpfc_hba *, LPFC_MBOXQ_t *); |
29 | void lpfc_read_lnk_stat(struct lpfc_hba *, LPFC_MBOXQ_t *); | 29 | void lpfc_read_lnk_stat(struct lpfc_hba *, LPFC_MBOXQ_t *); |
30 | void lpfc_set_slim(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t, uint32_t); | ||
31 | int lpfc_reg_login(struct lpfc_hba *, uint32_t, uint8_t *, LPFC_MBOXQ_t *, | 30 | int lpfc_reg_login(struct lpfc_hba *, uint32_t, uint8_t *, LPFC_MBOXQ_t *, |
32 | uint32_t); | 31 | uint32_t); |
33 | void lpfc_unreg_login(struct lpfc_hba *, uint32_t, LPFC_MBOXQ_t *); | 32 | void lpfc_unreg_login(struct lpfc_hba *, uint32_t, LPFC_MBOXQ_t *); |
diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h index 8932b1be2b60..41cf5d3ea6ce 100644 --- a/drivers/scsi/lpfc/lpfc_disc.h +++ b/drivers/scsi/lpfc/lpfc_disc.h | |||
@@ -113,6 +113,7 @@ struct lpfc_nodelist { | |||
113 | #define NLP_NPR_ADISC 0x2000000 /* Issue ADISC when dq'ed from | 113 | #define NLP_NPR_ADISC 0x2000000 /* Issue ADISC when dq'ed from |
114 | NPR list */ | 114 | NPR list */ |
115 | #define NLP_DELAY_REMOVE 0x4000000 /* Defer removal till end of DSM */ | 115 | #define NLP_DELAY_REMOVE 0x4000000 /* Defer removal till end of DSM */ |
116 | #define NLP_NODEV_REMOVE 0x8000000 /* Defer removal till discovery ends */ | ||
116 | 117 | ||
117 | /* Defines for list searchs */ | 118 | /* Defines for list searchs */ |
118 | #define NLP_SEARCH_MAPPED 0x1 /* search mapped */ | 119 | #define NLP_SEARCH_MAPPED 0x1 /* search mapped */ |
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 4813beaaca8f..283b7d824c34 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -302,10 +302,6 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp, | |||
302 | if (lpfc_reg_login(phba, Fabric_DID, (uint8_t *) sp, mbox, 0)) | 302 | if (lpfc_reg_login(phba, Fabric_DID, (uint8_t *) sp, mbox, 0)) |
303 | goto fail_free_mbox; | 303 | goto fail_free_mbox; |
304 | 304 | ||
305 | /* | ||
306 | * set_slim mailbox command needs to execute first, | ||
307 | * queue this command to be processed later. | ||
308 | */ | ||
309 | mbox->mbox_cmpl = lpfc_mbx_cmpl_fabric_reg_login; | 305 | mbox->mbox_cmpl = lpfc_mbx_cmpl_fabric_reg_login; |
310 | mbox->context2 = ndlp; | 306 | mbox->context2 = ndlp; |
311 | 307 | ||
@@ -781,25 +777,26 @@ lpfc_cmpl_els_plogi(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | |||
781 | if (disc && phba->num_disc_nodes) { | 777 | if (disc && phba->num_disc_nodes) { |
782 | /* Check to see if there are more PLOGIs to be sent */ | 778 | /* Check to see if there are more PLOGIs to be sent */ |
783 | lpfc_more_plogi(phba); | 779 | lpfc_more_plogi(phba); |
784 | } | ||
785 | 780 | ||
786 | if (phba->num_disc_nodes == 0) { | 781 | if (phba->num_disc_nodes == 0) { |
787 | spin_lock_irq(phba->host->host_lock); | 782 | spin_lock_irq(phba->host->host_lock); |
788 | phba->fc_flag &= ~FC_NDISC_ACTIVE; | 783 | phba->fc_flag &= ~FC_NDISC_ACTIVE; |
789 | spin_unlock_irq(phba->host->host_lock); | 784 | spin_unlock_irq(phba->host->host_lock); |
790 | 785 | ||
791 | lpfc_can_disctmo(phba); | 786 | lpfc_can_disctmo(phba); |
792 | if (phba->fc_flag & FC_RSCN_MODE) { | 787 | if (phba->fc_flag & FC_RSCN_MODE) { |
793 | /* Check to see if more RSCNs came in while we were | 788 | /* |
794 | * processing this one. | 789 | * Check to see if more RSCNs came in while |
795 | */ | 790 | * we were processing this one. |
796 | if ((phba->fc_rscn_id_cnt == 0) && | 791 | */ |
797 | (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { | 792 | if ((phba->fc_rscn_id_cnt == 0) && |
798 | spin_lock_irq(phba->host->host_lock); | 793 | (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { |
799 | phba->fc_flag &= ~FC_RSCN_MODE; | 794 | spin_lock_irq(phba->host->host_lock); |
800 | spin_unlock_irq(phba->host->host_lock); | 795 | phba->fc_flag &= ~FC_RSCN_MODE; |
801 | } else { | 796 | spin_unlock_irq(phba->host->host_lock); |
802 | lpfc_els_handle_rscn(phba); | 797 | } else { |
798 | lpfc_els_handle_rscn(phba); | ||
799 | } | ||
803 | } | 800 | } |
804 | } | 801 | } |
805 | } | 802 | } |
@@ -1263,7 +1260,7 @@ lpfc_issue_els_logo(struct lpfc_hba * phba, struct lpfc_nodelist * ndlp, | |||
1263 | psli = &phba->sli; | 1260 | psli = &phba->sli; |
1264 | pring = &psli->ring[LPFC_ELS_RING]; | 1261 | pring = &psli->ring[LPFC_ELS_RING]; |
1265 | 1262 | ||
1266 | cmdsize = 2 * (sizeof (uint32_t) + sizeof (struct lpfc_name)); | 1263 | cmdsize = (2 * sizeof (uint32_t)) + sizeof (struct lpfc_name); |
1267 | elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp, | 1264 | elsiocb = lpfc_prep_els_iocb(phba, 1, cmdsize, retry, ndlp, |
1268 | ndlp->nlp_DID, ELS_CMD_LOGO); | 1265 | ndlp->nlp_DID, ELS_CMD_LOGO); |
1269 | if (!elsiocb) | 1266 | if (!elsiocb) |
@@ -1451,22 +1448,23 @@ lpfc_cancel_retry_delay_tmo(struct lpfc_hba *phba, struct lpfc_nodelist * nlp) | |||
1451 | * PLOGIs to be sent | 1448 | * PLOGIs to be sent |
1452 | */ | 1449 | */ |
1453 | lpfc_more_plogi(phba); | 1450 | lpfc_more_plogi(phba); |
1454 | } | ||
1455 | 1451 | ||
1456 | if (phba->num_disc_nodes == 0) { | 1452 | if (phba->num_disc_nodes == 0) { |
1457 | phba->fc_flag &= ~FC_NDISC_ACTIVE; | 1453 | phba->fc_flag &= ~FC_NDISC_ACTIVE; |
1458 | lpfc_can_disctmo(phba); | 1454 | lpfc_can_disctmo(phba); |
1459 | if (phba->fc_flag & FC_RSCN_MODE) { | 1455 | if (phba->fc_flag & FC_RSCN_MODE) { |
1460 | /* Check to see if more RSCNs | 1456 | /* |
1461 | * came in while we were | 1457 | * Check to see if more RSCNs |
1462 | * processing this one. | 1458 | * came in while we were |
1463 | */ | 1459 | * processing this one. |
1464 | if((phba->fc_rscn_id_cnt==0) && | 1460 | */ |
1465 | (!(phba->fc_flag & FC_RSCN_DISCOVERY))) { | 1461 | if((phba->fc_rscn_id_cnt==0) && |
1466 | phba->fc_flag &= ~FC_RSCN_MODE; | 1462 | !(phba->fc_flag & FC_RSCN_DISCOVERY)) { |
1467 | } | 1463 | phba->fc_flag &= ~FC_RSCN_MODE; |
1468 | else { | 1464 | } |
1469 | lpfc_els_handle_rscn(phba); | 1465 | else { |
1466 | lpfc_els_handle_rscn(phba); | ||
1467 | } | ||
1470 | } | 1468 | } |
1471 | } | 1469 | } |
1472 | } | 1470 | } |
@@ -1872,9 +1870,6 @@ lpfc_cmpl_els_acc(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, | |||
1872 | if (mbox) { | 1870 | if (mbox) { |
1873 | if ((rspiocb->iocb.ulpStatus == 0) | 1871 | if ((rspiocb->iocb.ulpStatus == 0) |
1874 | && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { | 1872 | && (ndlp->nlp_flag & NLP_ACC_REGLOGIN)) { |
1875 | /* set_slim mailbox command needs to execute first, | ||
1876 | * queue this command to be processed later. | ||
1877 | */ | ||
1878 | lpfc_unreg_rpi(phba, ndlp); | 1873 | lpfc_unreg_rpi(phba, ndlp); |
1879 | mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; | 1874 | mbox->mbox_cmpl = lpfc_mbx_cmpl_reg_login; |
1880 | mbox->context2 = ndlp; | 1875 | mbox->context2 = ndlp; |
@@ -1920,6 +1915,7 @@ lpfc_els_rsp_acc(struct lpfc_hba * phba, uint32_t flag, | |||
1920 | uint8_t *pcmd; | 1915 | uint8_t *pcmd; |
1921 | uint16_t cmdsize; | 1916 | uint16_t cmdsize; |
1922 | int rc; | 1917 | int rc; |
1918 | ELS_PKT *els_pkt_ptr; | ||
1923 | 1919 | ||
1924 | psli = &phba->sli; | 1920 | psli = &phba->sli; |
1925 | pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ | 1921 | pring = &psli->ring[LPFC_ELS_RING]; /* ELS ring */ |
@@ -1958,6 +1954,23 @@ lpfc_els_rsp_acc(struct lpfc_hba * phba, uint32_t flag, | |||
1958 | pcmd += sizeof (uint32_t); | 1954 | pcmd += sizeof (uint32_t); |
1959 | memcpy(pcmd, &phba->fc_sparam, sizeof (struct serv_parm)); | 1955 | memcpy(pcmd, &phba->fc_sparam, sizeof (struct serv_parm)); |
1960 | break; | 1956 | break; |
1957 | case ELS_CMD_PRLO: | ||
1958 | cmdsize = sizeof (uint32_t) + sizeof (PRLO); | ||
1959 | elsiocb = lpfc_prep_els_iocb(phba, 0, cmdsize, oldiocb->retry, | ||
1960 | ndlp, ndlp->nlp_DID, ELS_CMD_PRLO); | ||
1961 | if (!elsiocb) | ||
1962 | return 1; | ||
1963 | |||
1964 | icmd = &elsiocb->iocb; | ||
1965 | icmd->ulpContext = oldcmd->ulpContext; /* Xri */ | ||
1966 | pcmd = (((struct lpfc_dmabuf *) elsiocb->context2)->virt); | ||
1967 | |||
1968 | memcpy(pcmd, ((struct lpfc_dmabuf *) oldiocb->context2)->virt, | ||
1969 | sizeof (uint32_t) + sizeof (PRLO)); | ||
1970 | *((uint32_t *) (pcmd)) = ELS_CMD_PRLO_ACC; | ||
1971 | els_pkt_ptr = (ELS_PKT *) pcmd; | ||
1972 | els_pkt_ptr->un.prlo.acceptRspCode = PRLO_REQ_EXECUTED; | ||
1973 | break; | ||
1961 | default: | 1974 | default: |
1962 | return 1; | 1975 | return 1; |
1963 | } | 1976 | } |
@@ -2498,7 +2511,7 @@ lpfc_els_rcv_rscn(struct lpfc_hba * phba, | |||
2498 | /* If we are about to begin discovery, just ACC the RSCN. | 2511 | /* If we are about to begin discovery, just ACC the RSCN. |
2499 | * Discovery processing will satisfy it. | 2512 | * Discovery processing will satisfy it. |
2500 | */ | 2513 | */ |
2501 | if (phba->hba_state < LPFC_NS_QRY) { | 2514 | if (phba->hba_state <= LPFC_NS_QRY) { |
2502 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, | 2515 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, |
2503 | newnode); | 2516 | newnode); |
2504 | return 0; | 2517 | return 0; |
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index 6721e679df62..adb086009ae0 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c | |||
@@ -311,8 +311,8 @@ lpfc_workq_post_event(struct lpfc_hba * phba, void *arg1, void *arg2, | |||
311 | evtp->evt_arg2 = arg2; | 311 | evtp->evt_arg2 = arg2; |
312 | evtp->evt = evt; | 312 | evtp->evt = evt; |
313 | 313 | ||
314 | list_add_tail(&evtp->evt_listp, &phba->work_list); | ||
315 | spin_lock_irq(phba->host->host_lock); | 314 | spin_lock_irq(phba->host->host_lock); |
315 | list_add_tail(&evtp->evt_listp, &phba->work_list); | ||
316 | if (phba->work_wait) | 316 | if (phba->work_wait) |
317 | wake_up(phba->work_wait); | 317 | wake_up(phba->work_wait); |
318 | spin_unlock_irq(phba->host->host_lock); | 318 | spin_unlock_irq(phba->host->host_lock); |
@@ -1071,10 +1071,6 @@ lpfc_register_remote_port(struct lpfc_hba * phba, | |||
1071 | /* initialize static port data */ | 1071 | /* initialize static port data */ |
1072 | rport->maxframe_size = ndlp->nlp_maxframe; | 1072 | rport->maxframe_size = ndlp->nlp_maxframe; |
1073 | rport->supported_classes = ndlp->nlp_class_sup; | 1073 | rport->supported_classes = ndlp->nlp_class_sup; |
1074 | if ((rport->scsi_target_id != -1) && | ||
1075 | (rport->scsi_target_id < MAX_FCP_TARGET)) { | ||
1076 | ndlp->nlp_sid = rport->scsi_target_id; | ||
1077 | } | ||
1078 | rdata = rport->dd_data; | 1074 | rdata = rport->dd_data; |
1079 | rdata->pnode = ndlp; | 1075 | rdata->pnode = ndlp; |
1080 | 1076 | ||
@@ -1087,6 +1083,10 @@ lpfc_register_remote_port(struct lpfc_hba * phba, | |||
1087 | if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) | 1083 | if (rport_ids.roles != FC_RPORT_ROLE_UNKNOWN) |
1088 | fc_remote_port_rolechg(rport, rport_ids.roles); | 1084 | fc_remote_port_rolechg(rport, rport_ids.roles); |
1089 | 1085 | ||
1086 | if ((rport->scsi_target_id != -1) && | ||
1087 | (rport->scsi_target_id < MAX_FCP_TARGET)) { | ||
1088 | ndlp->nlp_sid = rport->scsi_target_id; | ||
1089 | } | ||
1090 | 1090 | ||
1091 | return; | 1091 | return; |
1092 | } | 1092 | } |
@@ -1238,6 +1238,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list) | |||
1238 | evt_listp); | 1238 | evt_listp); |
1239 | 1239 | ||
1240 | } | 1240 | } |
1241 | nlp->nlp_flag &= ~NLP_NODEV_REMOVE; | ||
1241 | nlp->nlp_type |= NLP_FC_NODE; | 1242 | nlp->nlp_type |= NLP_FC_NODE; |
1242 | break; | 1243 | break; |
1243 | case NLP_MAPPED_LIST: | 1244 | case NLP_MAPPED_LIST: |
@@ -1258,6 +1259,7 @@ lpfc_nlp_list(struct lpfc_hba * phba, struct lpfc_nodelist * nlp, int list) | |||
1258 | evt_listp); | 1259 | evt_listp); |
1259 | 1260 | ||
1260 | } | 1261 | } |
1262 | nlp->nlp_flag &= ~NLP_NODEV_REMOVE; | ||
1261 | break; | 1263 | break; |
1262 | case NLP_NPR_LIST: | 1264 | case NLP_NPR_LIST: |
1263 | nlp->nlp_flag |= list; | 1265 | nlp->nlp_flag |= list; |
@@ -1402,6 +1404,8 @@ lpfc_check_sli_ndlp(struct lpfc_hba * phba, | |||
1402 | if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) | 1404 | if (icmd->ulpContext == (volatile ushort)ndlp->nlp_rpi) |
1403 | return 1; | 1405 | return 1; |
1404 | case CMD_ELS_REQUEST64_CR: | 1406 | case CMD_ELS_REQUEST64_CR: |
1407 | if (icmd->un.elsreq64.remoteID == ndlp->nlp_DID) | ||
1408 | return 1; | ||
1405 | case CMD_XMIT_ELS_RSP64_CX: | 1409 | case CMD_XMIT_ELS_RSP64_CX: |
1406 | if (iocb->context1 == (uint8_t *) ndlp) | 1410 | if (iocb->context1 == (uint8_t *) ndlp) |
1407 | return 1; | 1411 | return 1; |
@@ -1901,10 +1905,8 @@ lpfc_setup_disc_node(struct lpfc_hba * phba, uint32_t did) | |||
1901 | */ | 1905 | */ |
1902 | if (ndlp->nlp_flag & NLP_DELAY_TMO) | 1906 | if (ndlp->nlp_flag & NLP_DELAY_TMO) |
1903 | lpfc_cancel_retry_delay_tmo(phba, ndlp); | 1907 | lpfc_cancel_retry_delay_tmo(phba, ndlp); |
1904 | } else { | 1908 | } else |
1905 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | ||
1906 | ndlp = NULL; | 1909 | ndlp = NULL; |
1907 | } | ||
1908 | } else { | 1910 | } else { |
1909 | flg = ndlp->nlp_flag & NLP_LIST_MASK; | 1911 | flg = ndlp->nlp_flag & NLP_LIST_MASK; |
1910 | if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST)) | 1912 | if ((flg == NLP_ADISC_LIST) || (flg == NLP_PLOGI_LIST)) |
diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index 54d04188f7cc..eedf98801366 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h | |||
@@ -449,6 +449,7 @@ struct serv_parm { /* Structure is in Big Endian format */ | |||
449 | #define ELS_CMD_RRQ 0x12000000 | 449 | #define ELS_CMD_RRQ 0x12000000 |
450 | #define ELS_CMD_PRLI 0x20100014 | 450 | #define ELS_CMD_PRLI 0x20100014 |
451 | #define ELS_CMD_PRLO 0x21100014 | 451 | #define ELS_CMD_PRLO 0x21100014 |
452 | #define ELS_CMD_PRLO_ACC 0x02100014 | ||
452 | #define ELS_CMD_PDISC 0x50000000 | 453 | #define ELS_CMD_PDISC 0x50000000 |
453 | #define ELS_CMD_FDISC 0x51000000 | 454 | #define ELS_CMD_FDISC 0x51000000 |
454 | #define ELS_CMD_ADISC 0x52000000 | 455 | #define ELS_CMD_ADISC 0x52000000 |
@@ -484,6 +485,7 @@ struct serv_parm { /* Structure is in Big Endian format */ | |||
484 | #define ELS_CMD_RRQ 0x12 | 485 | #define ELS_CMD_RRQ 0x12 |
485 | #define ELS_CMD_PRLI 0x14001020 | 486 | #define ELS_CMD_PRLI 0x14001020 |
486 | #define ELS_CMD_PRLO 0x14001021 | 487 | #define ELS_CMD_PRLO 0x14001021 |
488 | #define ELS_CMD_PRLO_ACC 0x14001002 | ||
487 | #define ELS_CMD_PDISC 0x50 | 489 | #define ELS_CMD_PDISC 0x50 |
488 | #define ELS_CMD_FDISC 0x51 | 490 | #define ELS_CMD_FDISC 0x51 |
489 | #define ELS_CMD_ADISC 0x52 | 491 | #define ELS_CMD_ADISC 0x52 |
@@ -1539,6 +1541,7 @@ typedef struct { | |||
1539 | 1541 | ||
1540 | #define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */ | 1542 | #define FLAGS_TOPOLOGY_FAILOVER 0x0400 /* Bit 10 */ |
1541 | #define FLAGS_LINK_SPEED 0x0800 /* Bit 11 */ | 1543 | #define FLAGS_LINK_SPEED 0x0800 /* Bit 11 */ |
1544 | #define FLAGS_IMED_ABORT 0x04000 /* Bit 14 */ | ||
1542 | 1545 | ||
1543 | uint32_t link_speed; | 1546 | uint32_t link_speed; |
1544 | #define LINK_SPEED_AUTO 0 /* Auto selection */ | 1547 | #define LINK_SPEED_AUTO 0 /* Auto selection */ |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 66d5d003555d..908d0f27706f 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -294,15 +294,6 @@ lpfc_config_port_post(struct lpfc_hba * phba) | |||
294 | } | 294 | } |
295 | } | 295 | } |
296 | 296 | ||
297 | /* This should turn on DELAYED ABTS for ELS timeouts */ | ||
298 | lpfc_set_slim(phba, pmb, 0x052198, 0x1); | ||
299 | if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { | ||
300 | phba->hba_state = LPFC_HBA_ERROR; | ||
301 | mempool_free( pmb, phba->mbox_mem_pool); | ||
302 | return -EIO; | ||
303 | } | ||
304 | |||
305 | |||
306 | lpfc_read_config(phba, pmb); | 297 | lpfc_read_config(phba, pmb); |
307 | if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { | 298 | if (lpfc_sli_issue_mbox(phba, pmb, MBX_POLL) != MBX_SUCCESS) { |
308 | lpfc_printf_log(phba, | 299 | lpfc_printf_log(phba, |
@@ -804,7 +795,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba * phba, uint8_t * mdp, uint8_t * descp) | |||
804 | int max_speed; | 795 | int max_speed; |
805 | char * ports; | 796 | char * ports; |
806 | char * bus; | 797 | char * bus; |
807 | } m; | 798 | } m = {"<Unknown>", 0, "", ""}; |
808 | 799 | ||
809 | pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); | 800 | pci_read_config_byte(phba->pcidev, PCI_HEADER_TYPE, &hdrtype); |
810 | ports = (hdrtype == 0x80) ? "2-port " : ""; | 801 | ports = (hdrtype == 0x80) ? "2-port " : ""; |
@@ -1627,7 +1618,7 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1627 | 1618 | ||
1628 | error = lpfc_alloc_sysfs_attr(phba); | 1619 | error = lpfc_alloc_sysfs_attr(phba); |
1629 | if (error) | 1620 | if (error) |
1630 | goto out_kthread_stop; | 1621 | goto out_remove_host; |
1631 | 1622 | ||
1632 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ, | 1623 | error = request_irq(phba->pcidev->irq, lpfc_intr_handler, SA_SHIRQ, |
1633 | LPFC_DRIVER_NAME, phba); | 1624 | LPFC_DRIVER_NAME, phba); |
@@ -1644,8 +1635,10 @@ lpfc_pci_probe_one(struct pci_dev *pdev, const struct pci_device_id *pid) | |||
1644 | phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; | 1635 | phba->HCregaddr = phba->ctrl_regs_memmap_p + HC_REG_OFFSET; |
1645 | 1636 | ||
1646 | error = lpfc_sli_hba_setup(phba); | 1637 | error = lpfc_sli_hba_setup(phba); |
1647 | if (error) | 1638 | if (error) { |
1639 | error = -ENODEV; | ||
1648 | goto out_free_irq; | 1640 | goto out_free_irq; |
1641 | } | ||
1649 | 1642 | ||
1650 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { | 1643 | if (phba->cfg_poll & DISABLE_FCP_RING_INT) { |
1651 | spin_lock_irq(phba->host->host_lock); | 1644 | spin_lock_irq(phba->host->host_lock); |
@@ -1700,6 +1693,9 @@ out_free_irq: | |||
1700 | free_irq(phba->pcidev->irq, phba); | 1693 | free_irq(phba->pcidev->irq, phba); |
1701 | out_free_sysfs_attr: | 1694 | out_free_sysfs_attr: |
1702 | lpfc_free_sysfs_attr(phba); | 1695 | lpfc_free_sysfs_attr(phba); |
1696 | out_remove_host: | ||
1697 | fc_remove_host(phba->host); | ||
1698 | scsi_remove_host(phba->host); | ||
1703 | out_kthread_stop: | 1699 | out_kthread_stop: |
1704 | kthread_stop(phba->worker_thread); | 1700 | kthread_stop(phba->worker_thread); |
1705 | out_free_iocbq: | 1701 | out_free_iocbq: |
@@ -1721,12 +1717,14 @@ out_iounmap_slim: | |||
1721 | out_idr_remove: | 1717 | out_idr_remove: |
1722 | idr_remove(&lpfc_hba_index, phba->brd_no); | 1718 | idr_remove(&lpfc_hba_index, phba->brd_no); |
1723 | out_put_host: | 1719 | out_put_host: |
1720 | phba->host = NULL; | ||
1724 | scsi_host_put(host); | 1721 | scsi_host_put(host); |
1725 | out_release_regions: | 1722 | out_release_regions: |
1726 | pci_release_regions(pdev); | 1723 | pci_release_regions(pdev); |
1727 | out_disable_device: | 1724 | out_disable_device: |
1728 | pci_disable_device(pdev); | 1725 | pci_disable_device(pdev); |
1729 | out: | 1726 | out: |
1727 | pci_set_drvdata(pdev, NULL); | ||
1730 | return error; | 1728 | return error; |
1731 | } | 1729 | } |
1732 | 1730 | ||
diff --git a/drivers/scsi/lpfc/lpfc_mbox.c b/drivers/scsi/lpfc/lpfc_mbox.c index c585e2b2e589..e42f22aaf71b 100644 --- a/drivers/scsi/lpfc/lpfc_mbox.c +++ b/drivers/scsi/lpfc/lpfc_mbox.c | |||
@@ -200,6 +200,9 @@ lpfc_init_link(struct lpfc_hba * phba, | |||
200 | break; | 200 | break; |
201 | } | 201 | } |
202 | 202 | ||
203 | /* Enable asynchronous ABTS responses from firmware */ | ||
204 | mb->un.varInitLnk.link_flags |= FLAGS_IMED_ABORT; | ||
205 | |||
203 | /* NEW_FEATURE | 206 | /* NEW_FEATURE |
204 | * Setting up the link speed | 207 | * Setting up the link speed |
205 | */ | 208 | */ |
@@ -292,36 +295,6 @@ lpfc_unreg_did(struct lpfc_hba * phba, uint32_t did, LPFC_MBOXQ_t * pmb) | |||
292 | return; | 295 | return; |
293 | } | 296 | } |
294 | 297 | ||
295 | /***********************************************/ | ||
296 | |||
297 | /* command to write slim */ | ||
298 | /***********************************************/ | ||
299 | void | ||
300 | lpfc_set_slim(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb, uint32_t addr, | ||
301 | uint32_t value) | ||
302 | { | ||
303 | MAILBOX_t *mb; | ||
304 | |||
305 | mb = &pmb->mb; | ||
306 | memset(pmb, 0, sizeof (LPFC_MBOXQ_t)); | ||
307 | |||
308 | /* addr = 0x090597 is AUTO ABTS disable for ELS commands */ | ||
309 | /* addr = 0x052198 is DELAYED ABTS enable for ELS commands */ | ||
310 | |||
311 | /* | ||
312 | * Always turn on DELAYED ABTS for ELS timeouts | ||
313 | */ | ||
314 | if ((addr == 0x052198) && (value == 0)) | ||
315 | value = 1; | ||
316 | |||
317 | mb->un.varWords[0] = addr; | ||
318 | mb->un.varWords[1] = value; | ||
319 | |||
320 | mb->mbxCommand = MBX_SET_SLIM; | ||
321 | mb->mbxOwner = OWN_HOST; | ||
322 | return; | ||
323 | } | ||
324 | |||
325 | /**********************************************/ | 298 | /**********************************************/ |
326 | /* lpfc_read_nv Issue a READ CONFIG */ | 299 | /* lpfc_read_nv Issue a READ CONFIG */ |
327 | /* mailbox command */ | 300 | /* mailbox command */ |
diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 3d77bd999b70..27d60ad897cd 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c | |||
@@ -465,14 +465,18 @@ lpfc_rcv_padisc(struct lpfc_hba * phba, | |||
465 | static int | 465 | static int |
466 | lpfc_rcv_logo(struct lpfc_hba * phba, | 466 | lpfc_rcv_logo(struct lpfc_hba * phba, |
467 | struct lpfc_nodelist * ndlp, | 467 | struct lpfc_nodelist * ndlp, |
468 | struct lpfc_iocbq *cmdiocb) | 468 | struct lpfc_iocbq *cmdiocb, |
469 | uint32_t els_cmd) | ||
469 | { | 470 | { |
470 | /* Put ndlp on NPR list with 1 sec timeout for plogi, ACC logo */ | 471 | /* Put ndlp on NPR list with 1 sec timeout for plogi, ACC logo */ |
471 | /* Only call LOGO ACC for first LOGO, this avoids sending unnecessary | 472 | /* Only call LOGO ACC for first LOGO, this avoids sending unnecessary |
472 | * PLOGIs during LOGO storms from a device. | 473 | * PLOGIs during LOGO storms from a device. |
473 | */ | 474 | */ |
474 | ndlp->nlp_flag |= NLP_LOGO_ACC; | 475 | ndlp->nlp_flag |= NLP_LOGO_ACC; |
475 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); | 476 | if (els_cmd == ELS_CMD_PRLO) |
477 | lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); | ||
478 | else | ||
479 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); | ||
476 | 480 | ||
477 | if (!(ndlp->nlp_type & NLP_FABRIC) || | 481 | if (!(ndlp->nlp_type & NLP_FABRIC) || |
478 | (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { | 482 | (ndlp->nlp_state == NLP_STE_ADISC_ISSUE)) { |
@@ -681,7 +685,7 @@ lpfc_rcv_logo_plogi_issue(struct lpfc_hba * phba, | |||
681 | /* software abort outstanding PLOGI */ | 685 | /* software abort outstanding PLOGI */ |
682 | lpfc_els_abort(phba, ndlp, 1); | 686 | lpfc_els_abort(phba, ndlp, 1); |
683 | 687 | ||
684 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 688 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
685 | return ndlp->nlp_state; | 689 | return ndlp->nlp_state; |
686 | } | 690 | } |
687 | 691 | ||
@@ -788,10 +792,6 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_hba * phba, | |||
788 | if (lpfc_reg_login | 792 | if (lpfc_reg_login |
789 | (phba, irsp->un.elsreq64.remoteID, | 793 | (phba, irsp->un.elsreq64.remoteID, |
790 | (uint8_t *) sp, mbox, 0) == 0) { | 794 | (uint8_t *) sp, mbox, 0) == 0) { |
791 | /* set_slim mailbox command needs to | ||
792 | * execute first, queue this command to | ||
793 | * be processed later. | ||
794 | */ | ||
795 | switch (ndlp->nlp_DID) { | 795 | switch (ndlp->nlp_DID) { |
796 | case NameServer_DID: | 796 | case NameServer_DID: |
797 | mbox->mbox_cmpl = | 797 | mbox->mbox_cmpl = |
@@ -832,11 +832,17 @@ static uint32_t | |||
832 | lpfc_device_rm_plogi_issue(struct lpfc_hba * phba, | 832 | lpfc_device_rm_plogi_issue(struct lpfc_hba * phba, |
833 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) | 833 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) |
834 | { | 834 | { |
835 | /* software abort outstanding PLOGI */ | 835 | if(ndlp->nlp_flag & NLP_NPR_2B_DISC) { |
836 | lpfc_els_abort(phba, ndlp, 1); | 836 | ndlp->nlp_flag |= NLP_NODEV_REMOVE; |
837 | return ndlp->nlp_state; | ||
838 | } | ||
839 | else { | ||
840 | /* software abort outstanding PLOGI */ | ||
841 | lpfc_els_abort(phba, ndlp, 1); | ||
837 | 842 | ||
838 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | 843 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); |
839 | return NLP_STE_FREED_NODE; | 844 | return NLP_STE_FREED_NODE; |
845 | } | ||
840 | } | 846 | } |
841 | 847 | ||
842 | static uint32_t | 848 | static uint32_t |
@@ -851,7 +857,7 @@ lpfc_device_recov_plogi_issue(struct lpfc_hba * phba, | |||
851 | ndlp->nlp_state = NLP_STE_NPR_NODE; | 857 | ndlp->nlp_state = NLP_STE_NPR_NODE; |
852 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); | 858 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); |
853 | spin_lock_irq(phba->host->host_lock); | 859 | spin_lock_irq(phba->host->host_lock); |
854 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 860 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
855 | spin_unlock_irq(phba->host->host_lock); | 861 | spin_unlock_irq(phba->host->host_lock); |
856 | 862 | ||
857 | return ndlp->nlp_state; | 863 | return ndlp->nlp_state; |
@@ -905,7 +911,7 @@ lpfc_rcv_logo_adisc_issue(struct lpfc_hba * phba, | |||
905 | /* software abort outstanding ADISC */ | 911 | /* software abort outstanding ADISC */ |
906 | lpfc_els_abort(phba, ndlp, 0); | 912 | lpfc_els_abort(phba, ndlp, 0); |
907 | 913 | ||
908 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 914 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
909 | return ndlp->nlp_state; | 915 | return ndlp->nlp_state; |
910 | } | 916 | } |
911 | 917 | ||
@@ -932,7 +938,7 @@ lpfc_rcv_prlo_adisc_issue(struct lpfc_hba * phba, | |||
932 | cmdiocb = (struct lpfc_iocbq *) arg; | 938 | cmdiocb = (struct lpfc_iocbq *) arg; |
933 | 939 | ||
934 | /* Treat like rcv logo */ | 940 | /* Treat like rcv logo */ |
935 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 941 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_PRLO); |
936 | return ndlp->nlp_state; | 942 | return ndlp->nlp_state; |
937 | } | 943 | } |
938 | 944 | ||
@@ -987,11 +993,17 @@ lpfc_device_rm_adisc_issue(struct lpfc_hba * phba, | |||
987 | struct lpfc_nodelist * ndlp, void *arg, | 993 | struct lpfc_nodelist * ndlp, void *arg, |
988 | uint32_t evt) | 994 | uint32_t evt) |
989 | { | 995 | { |
990 | /* software abort outstanding ADISC */ | 996 | if(ndlp->nlp_flag & NLP_NPR_2B_DISC) { |
991 | lpfc_els_abort(phba, ndlp, 1); | 997 | ndlp->nlp_flag |= NLP_NODEV_REMOVE; |
998 | return ndlp->nlp_state; | ||
999 | } | ||
1000 | else { | ||
1001 | /* software abort outstanding ADISC */ | ||
1002 | lpfc_els_abort(phba, ndlp, 1); | ||
992 | 1003 | ||
993 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | 1004 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); |
994 | return NLP_STE_FREED_NODE; | 1005 | return NLP_STE_FREED_NODE; |
1006 | } | ||
995 | } | 1007 | } |
996 | 1008 | ||
997 | static uint32_t | 1009 | static uint32_t |
@@ -1006,7 +1018,7 @@ lpfc_device_recov_adisc_issue(struct lpfc_hba * phba, | |||
1006 | ndlp->nlp_state = NLP_STE_NPR_NODE; | 1018 | ndlp->nlp_state = NLP_STE_NPR_NODE; |
1007 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); | 1019 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); |
1008 | spin_lock_irq(phba->host->host_lock); | 1020 | spin_lock_irq(phba->host->host_lock); |
1009 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 1021 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
1010 | ndlp->nlp_flag |= NLP_NPR_ADISC; | 1022 | ndlp->nlp_flag |= NLP_NPR_ADISC; |
1011 | spin_unlock_irq(phba->host->host_lock); | 1023 | spin_unlock_irq(phba->host->host_lock); |
1012 | 1024 | ||
@@ -1048,7 +1060,7 @@ lpfc_rcv_logo_reglogin_issue(struct lpfc_hba * phba, | |||
1048 | 1060 | ||
1049 | cmdiocb = (struct lpfc_iocbq *) arg; | 1061 | cmdiocb = (struct lpfc_iocbq *) arg; |
1050 | 1062 | ||
1051 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 1063 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
1052 | return ndlp->nlp_state; | 1064 | return ndlp->nlp_state; |
1053 | } | 1065 | } |
1054 | 1066 | ||
@@ -1073,7 +1085,7 @@ lpfc_rcv_prlo_reglogin_issue(struct lpfc_hba * phba, | |||
1073 | struct lpfc_iocbq *cmdiocb; | 1085 | struct lpfc_iocbq *cmdiocb; |
1074 | 1086 | ||
1075 | cmdiocb = (struct lpfc_iocbq *) arg; | 1087 | cmdiocb = (struct lpfc_iocbq *) arg; |
1076 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); | 1088 | lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); |
1077 | return ndlp->nlp_state; | 1089 | return ndlp->nlp_state; |
1078 | } | 1090 | } |
1079 | 1091 | ||
@@ -1133,8 +1145,14 @@ lpfc_device_rm_reglogin_issue(struct lpfc_hba * phba, | |||
1133 | struct lpfc_nodelist * ndlp, void *arg, | 1145 | struct lpfc_nodelist * ndlp, void *arg, |
1134 | uint32_t evt) | 1146 | uint32_t evt) |
1135 | { | 1147 | { |
1136 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | 1148 | if(ndlp->nlp_flag & NLP_NPR_2B_DISC) { |
1137 | return NLP_STE_FREED_NODE; | 1149 | ndlp->nlp_flag |= NLP_NODEV_REMOVE; |
1150 | return ndlp->nlp_state; | ||
1151 | } | ||
1152 | else { | ||
1153 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | ||
1154 | return NLP_STE_FREED_NODE; | ||
1155 | } | ||
1138 | } | 1156 | } |
1139 | 1157 | ||
1140 | static uint32_t | 1158 | static uint32_t |
@@ -1146,7 +1164,7 @@ lpfc_device_recov_reglogin_issue(struct lpfc_hba * phba, | |||
1146 | ndlp->nlp_state = NLP_STE_NPR_NODE; | 1164 | ndlp->nlp_state = NLP_STE_NPR_NODE; |
1147 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); | 1165 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); |
1148 | spin_lock_irq(phba->host->host_lock); | 1166 | spin_lock_irq(phba->host->host_lock); |
1149 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 1167 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
1150 | spin_unlock_irq(phba->host->host_lock); | 1168 | spin_unlock_irq(phba->host->host_lock); |
1151 | return ndlp->nlp_state; | 1169 | return ndlp->nlp_state; |
1152 | } | 1170 | } |
@@ -1186,7 +1204,7 @@ lpfc_rcv_logo_prli_issue(struct lpfc_hba * phba, | |||
1186 | /* Software abort outstanding PRLI before sending acc */ | 1204 | /* Software abort outstanding PRLI before sending acc */ |
1187 | lpfc_els_abort(phba, ndlp, 1); | 1205 | lpfc_els_abort(phba, ndlp, 1); |
1188 | 1206 | ||
1189 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 1207 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
1190 | return ndlp->nlp_state; | 1208 | return ndlp->nlp_state; |
1191 | } | 1209 | } |
1192 | 1210 | ||
@@ -1214,7 +1232,7 @@ lpfc_rcv_prlo_prli_issue(struct lpfc_hba * phba, | |||
1214 | struct lpfc_iocbq *cmdiocb; | 1232 | struct lpfc_iocbq *cmdiocb; |
1215 | 1233 | ||
1216 | cmdiocb = (struct lpfc_iocbq *) arg; | 1234 | cmdiocb = (struct lpfc_iocbq *) arg; |
1217 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); | 1235 | lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); |
1218 | return ndlp->nlp_state; | 1236 | return ndlp->nlp_state; |
1219 | } | 1237 | } |
1220 | 1238 | ||
@@ -1278,11 +1296,17 @@ static uint32_t | |||
1278 | lpfc_device_rm_prli_issue(struct lpfc_hba * phba, | 1296 | lpfc_device_rm_prli_issue(struct lpfc_hba * phba, |
1279 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) | 1297 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) |
1280 | { | 1298 | { |
1281 | /* software abort outstanding PRLI */ | 1299 | if(ndlp->nlp_flag & NLP_NPR_2B_DISC) { |
1282 | lpfc_els_abort(phba, ndlp, 1); | 1300 | ndlp->nlp_flag |= NLP_NODEV_REMOVE; |
1301 | return ndlp->nlp_state; | ||
1302 | } | ||
1303 | else { | ||
1304 | /* software abort outstanding PLOGI */ | ||
1305 | lpfc_els_abort(phba, ndlp, 1); | ||
1283 | 1306 | ||
1284 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | 1307 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); |
1285 | return NLP_STE_FREED_NODE; | 1308 | return NLP_STE_FREED_NODE; |
1309 | } | ||
1286 | } | 1310 | } |
1287 | 1311 | ||
1288 | 1312 | ||
@@ -1313,7 +1337,7 @@ lpfc_device_recov_prli_issue(struct lpfc_hba * phba, | |||
1313 | ndlp->nlp_state = NLP_STE_NPR_NODE; | 1337 | ndlp->nlp_state = NLP_STE_NPR_NODE; |
1314 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); | 1338 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); |
1315 | spin_lock_irq(phba->host->host_lock); | 1339 | spin_lock_irq(phba->host->host_lock); |
1316 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 1340 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
1317 | spin_unlock_irq(phba->host->host_lock); | 1341 | spin_unlock_irq(phba->host->host_lock); |
1318 | return ndlp->nlp_state; | 1342 | return ndlp->nlp_state; |
1319 | } | 1343 | } |
@@ -1351,7 +1375,7 @@ lpfc_rcv_logo_unmap_node(struct lpfc_hba * phba, | |||
1351 | 1375 | ||
1352 | cmdiocb = (struct lpfc_iocbq *) arg; | 1376 | cmdiocb = (struct lpfc_iocbq *) arg; |
1353 | 1377 | ||
1354 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 1378 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
1355 | return ndlp->nlp_state; | 1379 | return ndlp->nlp_state; |
1356 | } | 1380 | } |
1357 | 1381 | ||
@@ -1375,7 +1399,7 @@ lpfc_rcv_prlo_unmap_node(struct lpfc_hba * phba, | |||
1375 | 1399 | ||
1376 | cmdiocb = (struct lpfc_iocbq *) arg; | 1400 | cmdiocb = (struct lpfc_iocbq *) arg; |
1377 | 1401 | ||
1378 | lpfc_els_rsp_acc(phba, ELS_CMD_ACC, cmdiocb, ndlp, NULL, 0); | 1402 | lpfc_els_rsp_acc(phba, ELS_CMD_PRLO, cmdiocb, ndlp, NULL, 0); |
1379 | return ndlp->nlp_state; | 1403 | return ndlp->nlp_state; |
1380 | } | 1404 | } |
1381 | 1405 | ||
@@ -1386,7 +1410,7 @@ lpfc_device_recov_unmap_node(struct lpfc_hba * phba, | |||
1386 | ndlp->nlp_prev_state = NLP_STE_UNMAPPED_NODE; | 1410 | ndlp->nlp_prev_state = NLP_STE_UNMAPPED_NODE; |
1387 | ndlp->nlp_state = NLP_STE_NPR_NODE; | 1411 | ndlp->nlp_state = NLP_STE_NPR_NODE; |
1388 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); | 1412 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); |
1389 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 1413 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
1390 | lpfc_disc_set_adisc(phba, ndlp); | 1414 | lpfc_disc_set_adisc(phba, ndlp); |
1391 | 1415 | ||
1392 | return ndlp->nlp_state; | 1416 | return ndlp->nlp_state; |
@@ -1424,7 +1448,7 @@ lpfc_rcv_logo_mapped_node(struct lpfc_hba * phba, | |||
1424 | 1448 | ||
1425 | cmdiocb = (struct lpfc_iocbq *) arg; | 1449 | cmdiocb = (struct lpfc_iocbq *) arg; |
1426 | 1450 | ||
1427 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 1451 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
1428 | return ndlp->nlp_state; | 1452 | return ndlp->nlp_state; |
1429 | } | 1453 | } |
1430 | 1454 | ||
@@ -1456,7 +1480,7 @@ lpfc_rcv_prlo_mapped_node(struct lpfc_hba * phba, | |||
1456 | spin_unlock_irq(phba->host->host_lock); | 1480 | spin_unlock_irq(phba->host->host_lock); |
1457 | 1481 | ||
1458 | /* Treat like rcv logo */ | 1482 | /* Treat like rcv logo */ |
1459 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 1483 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_PRLO); |
1460 | return ndlp->nlp_state; | 1484 | return ndlp->nlp_state; |
1461 | } | 1485 | } |
1462 | 1486 | ||
@@ -1469,7 +1493,7 @@ lpfc_device_recov_mapped_node(struct lpfc_hba * phba, | |||
1469 | ndlp->nlp_state = NLP_STE_NPR_NODE; | 1493 | ndlp->nlp_state = NLP_STE_NPR_NODE; |
1470 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); | 1494 | lpfc_nlp_list(phba, ndlp, NLP_NPR_LIST); |
1471 | spin_lock_irq(phba->host->host_lock); | 1495 | spin_lock_irq(phba->host->host_lock); |
1472 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 1496 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
1473 | spin_unlock_irq(phba->host->host_lock); | 1497 | spin_unlock_irq(phba->host->host_lock); |
1474 | lpfc_disc_set_adisc(phba, ndlp); | 1498 | lpfc_disc_set_adisc(phba, ndlp); |
1475 | return ndlp->nlp_state; | 1499 | return ndlp->nlp_state; |
@@ -1551,7 +1575,7 @@ lpfc_rcv_logo_npr_node(struct lpfc_hba * phba, | |||
1551 | 1575 | ||
1552 | cmdiocb = (struct lpfc_iocbq *) arg; | 1576 | cmdiocb = (struct lpfc_iocbq *) arg; |
1553 | 1577 | ||
1554 | lpfc_rcv_logo(phba, ndlp, cmdiocb); | 1578 | lpfc_rcv_logo(phba, ndlp, cmdiocb, ELS_CMD_LOGO); |
1555 | return ndlp->nlp_state; | 1579 | return ndlp->nlp_state; |
1556 | } | 1580 | } |
1557 | 1581 | ||
@@ -1617,9 +1641,16 @@ lpfc_cmpl_plogi_npr_node(struct lpfc_hba * phba, | |||
1617 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) | 1641 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) |
1618 | { | 1642 | { |
1619 | struct lpfc_iocbq *cmdiocb, *rspiocb; | 1643 | struct lpfc_iocbq *cmdiocb, *rspiocb; |
1644 | IOCB_t *irsp; | ||
1620 | 1645 | ||
1621 | cmdiocb = (struct lpfc_iocbq *) arg; | 1646 | cmdiocb = (struct lpfc_iocbq *) arg; |
1622 | rspiocb = cmdiocb->context_un.rsp_iocb; | 1647 | rspiocb = cmdiocb->context_un.rsp_iocb; |
1648 | |||
1649 | irsp = &rspiocb->iocb; | ||
1650 | if (irsp->ulpStatus) { | ||
1651 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | ||
1652 | return NLP_STE_FREED_NODE; | ||
1653 | } | ||
1623 | return ndlp->nlp_state; | 1654 | return ndlp->nlp_state; |
1624 | } | 1655 | } |
1625 | 1656 | ||
@@ -1628,9 +1659,16 @@ lpfc_cmpl_prli_npr_node(struct lpfc_hba * phba, | |||
1628 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) | 1659 | struct lpfc_nodelist * ndlp, void *arg, uint32_t evt) |
1629 | { | 1660 | { |
1630 | struct lpfc_iocbq *cmdiocb, *rspiocb; | 1661 | struct lpfc_iocbq *cmdiocb, *rspiocb; |
1662 | IOCB_t *irsp; | ||
1631 | 1663 | ||
1632 | cmdiocb = (struct lpfc_iocbq *) arg; | 1664 | cmdiocb = (struct lpfc_iocbq *) arg; |
1633 | rspiocb = cmdiocb->context_un.rsp_iocb; | 1665 | rspiocb = cmdiocb->context_un.rsp_iocb; |
1666 | |||
1667 | irsp = &rspiocb->iocb; | ||
1668 | if (irsp->ulpStatus && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) { | ||
1669 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | ||
1670 | return NLP_STE_FREED_NODE; | ||
1671 | } | ||
1634 | return ndlp->nlp_state; | 1672 | return ndlp->nlp_state; |
1635 | } | 1673 | } |
1636 | 1674 | ||
@@ -1649,9 +1687,16 @@ lpfc_cmpl_adisc_npr_node(struct lpfc_hba * phba, | |||
1649 | uint32_t evt) | 1687 | uint32_t evt) |
1650 | { | 1688 | { |
1651 | struct lpfc_iocbq *cmdiocb, *rspiocb; | 1689 | struct lpfc_iocbq *cmdiocb, *rspiocb; |
1690 | IOCB_t *irsp; | ||
1652 | 1691 | ||
1653 | cmdiocb = (struct lpfc_iocbq *) arg; | 1692 | cmdiocb = (struct lpfc_iocbq *) arg; |
1654 | rspiocb = cmdiocb->context_un.rsp_iocb; | 1693 | rspiocb = cmdiocb->context_un.rsp_iocb; |
1694 | |||
1695 | irsp = &rspiocb->iocb; | ||
1696 | if (irsp->ulpStatus && (ndlp->nlp_flag & NLP_NODEV_REMOVE)) { | ||
1697 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | ||
1698 | return NLP_STE_FREED_NODE; | ||
1699 | } | ||
1655 | return ndlp->nlp_state; | 1700 | return ndlp->nlp_state; |
1656 | } | 1701 | } |
1657 | 1702 | ||
@@ -1668,7 +1713,12 @@ lpfc_cmpl_reglogin_npr_node(struct lpfc_hba * phba, | |||
1668 | 1713 | ||
1669 | if (!mb->mbxStatus) | 1714 | if (!mb->mbxStatus) |
1670 | ndlp->nlp_rpi = mb->un.varWords[0]; | 1715 | ndlp->nlp_rpi = mb->un.varWords[0]; |
1671 | 1716 | else { | |
1717 | if (ndlp->nlp_flag & NLP_NODEV_REMOVE) { | ||
1718 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | ||
1719 | return NLP_STE_FREED_NODE; | ||
1720 | } | ||
1721 | } | ||
1672 | return ndlp->nlp_state; | 1722 | return ndlp->nlp_state; |
1673 | } | 1723 | } |
1674 | 1724 | ||
@@ -1677,6 +1727,10 @@ lpfc_device_rm_npr_node(struct lpfc_hba * phba, | |||
1677 | struct lpfc_nodelist * ndlp, void *arg, | 1727 | struct lpfc_nodelist * ndlp, void *arg, |
1678 | uint32_t evt) | 1728 | uint32_t evt) |
1679 | { | 1729 | { |
1730 | if (ndlp->nlp_flag & NLP_NPR_2B_DISC) { | ||
1731 | ndlp->nlp_flag |= NLP_NODEV_REMOVE; | ||
1732 | return ndlp->nlp_state; | ||
1733 | } | ||
1680 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); | 1734 | lpfc_nlp_list(phba, ndlp, NLP_NO_LIST); |
1681 | return NLP_STE_FREED_NODE; | 1735 | return NLP_STE_FREED_NODE; |
1682 | } | 1736 | } |
@@ -1687,7 +1741,7 @@ lpfc_device_recov_npr_node(struct lpfc_hba * phba, | |||
1687 | uint32_t evt) | 1741 | uint32_t evt) |
1688 | { | 1742 | { |
1689 | spin_lock_irq(phba->host->host_lock); | 1743 | spin_lock_irq(phba->host->host_lock); |
1690 | ndlp->nlp_flag &= ~NLP_NPR_2B_DISC; | 1744 | ndlp->nlp_flag &= ~(NLP_NODEV_REMOVE | NLP_NPR_2B_DISC); |
1691 | spin_unlock_irq(phba->host->host_lock); | 1745 | spin_unlock_irq(phba->host->host_lock); |
1692 | if (ndlp->nlp_flag & NLP_DELAY_TMO) { | 1746 | if (ndlp->nlp_flag & NLP_DELAY_TMO) { |
1693 | lpfc_cancel_retry_delay_tmo(phba, ndlp); | 1747 | lpfc_cancel_retry_delay_tmo(phba, ndlp); |
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index f93799873721..7dc4c2e6bed2 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c | |||
@@ -629,8 +629,7 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba, | |||
629 | struct lpfc_iocbq *piocbq; | 629 | struct lpfc_iocbq *piocbq; |
630 | IOCB_t *piocb; | 630 | IOCB_t *piocb; |
631 | struct fcp_cmnd *fcp_cmnd; | 631 | struct fcp_cmnd *fcp_cmnd; |
632 | struct scsi_device *scsi_dev = lpfc_cmd->pCmd->device; | 632 | struct lpfc_rport_data *rdata = lpfc_cmd->rdata; |
633 | struct lpfc_rport_data *rdata = scsi_dev->hostdata; | ||
634 | struct lpfc_nodelist *ndlp = rdata->pnode; | 633 | struct lpfc_nodelist *ndlp = rdata->pnode; |
635 | 634 | ||
636 | if ((ndlp == NULL) || (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) { | 635 | if ((ndlp == NULL) || (ndlp->nlp_state != NLP_STE_MAPPED_NODE)) { |
@@ -665,56 +664,18 @@ lpfc_scsi_prep_task_mgmt_cmd(struct lpfc_hba *phba, | |||
665 | piocb->ulpTimeout = lpfc_cmd->timeout; | 664 | piocb->ulpTimeout = lpfc_cmd->timeout; |
666 | } | 665 | } |
667 | 666 | ||
668 | lpfc_cmd->rdata = rdata; | ||
669 | |||
670 | switch (task_mgmt_cmd) { | ||
671 | case FCP_LUN_RESET: | ||
672 | /* Issue LUN Reset to TGT <num> LUN <num> */ | ||
673 | lpfc_printf_log(phba, | ||
674 | KERN_INFO, | ||
675 | LOG_FCP, | ||
676 | "%d:0703 Issue LUN Reset to TGT %d LUN %d " | ||
677 | "Data: x%x x%x\n", | ||
678 | phba->brd_no, | ||
679 | scsi_dev->id, scsi_dev->lun, | ||
680 | ndlp->nlp_rpi, ndlp->nlp_flag); | ||
681 | |||
682 | break; | ||
683 | case FCP_ABORT_TASK_SET: | ||
684 | /* Issue Abort Task Set to TGT <num> LUN <num> */ | ||
685 | lpfc_printf_log(phba, | ||
686 | KERN_INFO, | ||
687 | LOG_FCP, | ||
688 | "%d:0701 Issue Abort Task Set to TGT %d LUN %d " | ||
689 | "Data: x%x x%x\n", | ||
690 | phba->brd_no, | ||
691 | scsi_dev->id, scsi_dev->lun, | ||
692 | ndlp->nlp_rpi, ndlp->nlp_flag); | ||
693 | |||
694 | break; | ||
695 | case FCP_TARGET_RESET: | ||
696 | /* Issue Target Reset to TGT <num> */ | ||
697 | lpfc_printf_log(phba, | ||
698 | KERN_INFO, | ||
699 | LOG_FCP, | ||
700 | "%d:0702 Issue Target Reset to TGT %d " | ||
701 | "Data: x%x x%x\n", | ||
702 | phba->brd_no, | ||
703 | scsi_dev->id, ndlp->nlp_rpi, | ||
704 | ndlp->nlp_flag); | ||
705 | break; | ||
706 | } | ||
707 | |||
708 | return (1); | 667 | return (1); |
709 | } | 668 | } |
710 | 669 | ||
711 | static int | 670 | static int |
712 | lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba) | 671 | lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba, |
672 | unsigned tgt_id, struct lpfc_rport_data *rdata) | ||
713 | { | 673 | { |
714 | struct lpfc_iocbq *iocbq; | 674 | struct lpfc_iocbq *iocbq; |
715 | struct lpfc_iocbq *iocbqrsp; | 675 | struct lpfc_iocbq *iocbqrsp; |
716 | int ret; | 676 | int ret; |
717 | 677 | ||
678 | lpfc_cmd->rdata = rdata; | ||
718 | ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_TARGET_RESET); | 679 | ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_TARGET_RESET); |
719 | if (!ret) | 680 | if (!ret) |
720 | return FAILED; | 681 | return FAILED; |
@@ -726,6 +687,13 @@ lpfc_scsi_tgt_reset(struct lpfc_scsi_buf * lpfc_cmd, struct lpfc_hba * phba) | |||
726 | if (!iocbqrsp) | 687 | if (!iocbqrsp) |
727 | return FAILED; | 688 | return FAILED; |
728 | 689 | ||
690 | /* Issue Target Reset to TGT <num> */ | ||
691 | lpfc_printf_log(phba, KERN_INFO, LOG_FCP, | ||
692 | "%d:0702 Issue Target Reset to TGT %d " | ||
693 | "Data: x%x x%x\n", | ||
694 | phba->brd_no, tgt_id, rdata->pnode->nlp_rpi, | ||
695 | rdata->pnode->nlp_flag); | ||
696 | |||
729 | ret = lpfc_sli_issue_iocb_wait(phba, | 697 | ret = lpfc_sli_issue_iocb_wait(phba, |
730 | &phba->sli.ring[phba->sli.fcp_ring], | 698 | &phba->sli.ring[phba->sli.fcp_ring], |
731 | iocbq, iocbqrsp, lpfc_cmd->timeout); | 699 | iocbq, iocbqrsp, lpfc_cmd->timeout); |
@@ -1021,6 +989,7 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) | |||
1021 | lpfc_cmd->pCmd = cmnd; | 989 | lpfc_cmd->pCmd = cmnd; |
1022 | lpfc_cmd->timeout = 60; | 990 | lpfc_cmd->timeout = 60; |
1023 | lpfc_cmd->scsi_hba = phba; | 991 | lpfc_cmd->scsi_hba = phba; |
992 | lpfc_cmd->rdata = rdata; | ||
1024 | 993 | ||
1025 | ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_LUN_RESET); | 994 | ret = lpfc_scsi_prep_task_mgmt_cmd(phba, lpfc_cmd, FCP_LUN_RESET); |
1026 | if (!ret) | 995 | if (!ret) |
@@ -1033,6 +1002,11 @@ lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) | |||
1033 | if (iocbqrsp == NULL) | 1002 | if (iocbqrsp == NULL) |
1034 | goto out_free_scsi_buf; | 1003 | goto out_free_scsi_buf; |
1035 | 1004 | ||
1005 | lpfc_printf_log(phba, KERN_INFO, LOG_FCP, | ||
1006 | "%d:0703 Issue LUN Reset to TGT %d LUN %d " | ||
1007 | "Data: x%x x%x\n", phba->brd_no, cmnd->device->id, | ||
1008 | cmnd->device->lun, pnode->nlp_rpi, pnode->nlp_flag); | ||
1009 | |||
1036 | ret = lpfc_sli_issue_iocb_wait(phba, | 1010 | ret = lpfc_sli_issue_iocb_wait(phba, |
1037 | &phba->sli.ring[phba->sli.fcp_ring], | 1011 | &phba->sli.ring[phba->sli.fcp_ring], |
1038 | iocbq, iocbqrsp, lpfc_cmd->timeout); | 1012 | iocbq, iocbqrsp, lpfc_cmd->timeout); |
@@ -1104,7 +1078,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) | |||
1104 | int match; | 1078 | int match; |
1105 | int ret = FAILED, i, err_count = 0; | 1079 | int ret = FAILED, i, err_count = 0; |
1106 | int cnt, loopcnt; | 1080 | int cnt, loopcnt; |
1107 | unsigned int midlayer_id = 0; | ||
1108 | struct lpfc_scsi_buf * lpfc_cmd; | 1081 | struct lpfc_scsi_buf * lpfc_cmd; |
1109 | 1082 | ||
1110 | lpfc_block_requests(phba); | 1083 | lpfc_block_requests(phba); |
@@ -1124,7 +1097,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) | |||
1124 | * targets known to the driver. Should any target reset | 1097 | * targets known to the driver. Should any target reset |
1125 | * fail, this routine returns failure to the midlayer. | 1098 | * fail, this routine returns failure to the midlayer. |
1126 | */ | 1099 | */ |
1127 | midlayer_id = cmnd->device->id; | ||
1128 | for (i = 0; i < MAX_FCP_TARGET; i++) { | 1100 | for (i = 0; i < MAX_FCP_TARGET; i++) { |
1129 | /* Search the mapped list for this target ID */ | 1101 | /* Search the mapped list for this target ID */ |
1130 | match = 0; | 1102 | match = 0; |
@@ -1137,9 +1109,8 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) | |||
1137 | if (!match) | 1109 | if (!match) |
1138 | continue; | 1110 | continue; |
1139 | 1111 | ||
1140 | lpfc_cmd->pCmd->device->id = i; | 1112 | ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba, |
1141 | lpfc_cmd->pCmd->device->hostdata = ndlp->rport->dd_data; | 1113 | i, ndlp->rport->dd_data); |
1142 | ret = lpfc_scsi_tgt_reset(lpfc_cmd, phba); | ||
1143 | if (ret != SUCCESS) { | 1114 | if (ret != SUCCESS) { |
1144 | lpfc_printf_log(phba, KERN_ERR, LOG_FCP, | 1115 | lpfc_printf_log(phba, KERN_ERR, LOG_FCP, |
1145 | "%d:0713 Bus Reset on target %d failed\n", | 1116 | "%d:0713 Bus Reset on target %d failed\n", |
@@ -1158,7 +1129,6 @@ lpfc_reset_bus_handler(struct scsi_cmnd *cmnd) | |||
1158 | * the targets. Unfortunately, some targets do not abide by | 1129 | * the targets. Unfortunately, some targets do not abide by |
1159 | * this forcing the driver to double check. | 1130 | * this forcing the driver to double check. |
1160 | */ | 1131 | */ |
1161 | cmnd->device->id = midlayer_id; | ||
1162 | cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], | 1132 | cnt = lpfc_sli_sum_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], |
1163 | 0, 0, LPFC_CTX_HOST); | 1133 | 0, 0, LPFC_CTX_HOST); |
1164 | if (cnt) | 1134 | if (cnt) |
diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index 4cf1366108b7..6b737568b831 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h | |||
@@ -18,7 +18,7 @@ | |||
18 | * included with this package. * | 18 | * included with this package. * |
19 | *******************************************************************/ | 19 | *******************************************************************/ |
20 | 20 | ||
21 | #define LPFC_DRIVER_VERSION "8.1.4" | 21 | #define LPFC_DRIVER_VERSION "8.1.6" |
22 | 22 | ||
23 | #define LPFC_DRIVER_NAME "lpfc" | 23 | #define LPFC_DRIVER_NAME "lpfc" |
24 | 24 | ||
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 80b68a2481b3..de35ffe2f79d 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c | |||
@@ -4471,7 +4471,6 @@ mega_internal_command(adapter_t *adapter, megacmd_t *mc, mega_passthru *pthru) | |||
4471 | { | 4471 | { |
4472 | Scsi_Cmnd *scmd; | 4472 | Scsi_Cmnd *scmd; |
4473 | struct scsi_device *sdev; | 4473 | struct scsi_device *sdev; |
4474 | unsigned long flags = 0; | ||
4475 | scb_t *scb; | 4474 | scb_t *scb; |
4476 | int rval; | 4475 | int rval; |
4477 | 4476 | ||
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index c11e5ce6865e..bec1424eda85 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c | |||
@@ -10,7 +10,7 @@ | |||
10 | * 2 of the License, or (at your option) any later version. | 10 | * 2 of the License, or (at your option) any later version. |
11 | * | 11 | * |
12 | * FILE : megaraid_mbox.c | 12 | * FILE : megaraid_mbox.c |
13 | * Version : v2.20.4.7 (Nov 14 2005) | 13 | * Version : v2.20.4.8 (Apr 11 2006) |
14 | * | 14 | * |
15 | * Authors: | 15 | * Authors: |
16 | * Atul Mukker <Atul.Mukker@lsil.com> | 16 | * Atul Mukker <Atul.Mukker@lsil.com> |
@@ -2278,6 +2278,7 @@ megaraid_mbox_dpc(unsigned long devp) | |||
2278 | unsigned long flags; | 2278 | unsigned long flags; |
2279 | uint8_t c; | 2279 | uint8_t c; |
2280 | int status; | 2280 | int status; |
2281 | uioc_t *kioc; | ||
2281 | 2282 | ||
2282 | 2283 | ||
2283 | if (!adapter) return; | 2284 | if (!adapter) return; |
@@ -2320,6 +2321,9 @@ megaraid_mbox_dpc(unsigned long devp) | |||
2320 | // remove from local clist | 2321 | // remove from local clist |
2321 | list_del_init(&scb->list); | 2322 | list_del_init(&scb->list); |
2322 | 2323 | ||
2324 | kioc = (uioc_t *)scb->gp; | ||
2325 | kioc->status = 0; | ||
2326 | |||
2323 | megaraid_mbox_mm_done(adapter, scb); | 2327 | megaraid_mbox_mm_done(adapter, scb); |
2324 | 2328 | ||
2325 | continue; | 2329 | continue; |
@@ -2636,6 +2640,7 @@ megaraid_reset_handler(struct scsi_cmnd *scp) | |||
2636 | int recovery_window; | 2640 | int recovery_window; |
2637 | int recovering; | 2641 | int recovering; |
2638 | int i; | 2642 | int i; |
2643 | uioc_t *kioc; | ||
2639 | 2644 | ||
2640 | adapter = SCP2ADAPTER(scp); | 2645 | adapter = SCP2ADAPTER(scp); |
2641 | raid_dev = ADAP2RAIDDEV(adapter); | 2646 | raid_dev = ADAP2RAIDDEV(adapter); |
@@ -2655,32 +2660,51 @@ megaraid_reset_handler(struct scsi_cmnd *scp) | |||
2655 | // Also, reset all the commands currently owned by the driver | 2660 | // Also, reset all the commands currently owned by the driver |
2656 | spin_lock_irqsave(PENDING_LIST_LOCK(adapter), flags); | 2661 | spin_lock_irqsave(PENDING_LIST_LOCK(adapter), flags); |
2657 | list_for_each_entry_safe(scb, tmp, &adapter->pend_list, list) { | 2662 | list_for_each_entry_safe(scb, tmp, &adapter->pend_list, list) { |
2658 | |||
2659 | list_del_init(&scb->list); // from pending list | 2663 | list_del_init(&scb->list); // from pending list |
2660 | 2664 | ||
2661 | con_log(CL_ANN, (KERN_WARNING | 2665 | if (scb->sno >= MBOX_MAX_SCSI_CMDS) { |
2662 | "megaraid: %ld:%d[%d:%d], reset from pending list\n", | 2666 | con_log(CL_ANN, (KERN_WARNING |
2663 | scp->serial_number, scb->sno, | 2667 | "megaraid: IOCTL packet with %d[%d:%d] being reset\n", |
2664 | scb->dev_channel, scb->dev_target)); | 2668 | scb->sno, scb->dev_channel, scb->dev_target)); |
2665 | 2669 | ||
2666 | scp->result = (DID_RESET << 16); | 2670 | scb->status = -1; |
2667 | scp->scsi_done(scp); | ||
2668 | 2671 | ||
2669 | megaraid_dealloc_scb(adapter, scb); | 2672 | kioc = (uioc_t *)scb->gp; |
2673 | kioc->status = -EFAULT; | ||
2674 | |||
2675 | megaraid_mbox_mm_done(adapter, scb); | ||
2676 | } else { | ||
2677 | if (scb->scp == scp) { // Found command | ||
2678 | con_log(CL_ANN, (KERN_WARNING | ||
2679 | "megaraid: %ld:%d[%d:%d], reset from pending list\n", | ||
2680 | scp->serial_number, scb->sno, | ||
2681 | scb->dev_channel, scb->dev_target)); | ||
2682 | } else { | ||
2683 | con_log(CL_ANN, (KERN_WARNING | ||
2684 | "megaraid: IO packet with %d[%d:%d] being reset\n", | ||
2685 | scb->sno, scb->dev_channel, scb->dev_target)); | ||
2686 | } | ||
2687 | |||
2688 | scb->scp->result = (DID_RESET << 16); | ||
2689 | scb->scp->scsi_done(scb->scp); | ||
2690 | |||
2691 | megaraid_dealloc_scb(adapter, scb); | ||
2692 | } | ||
2670 | } | 2693 | } |
2671 | spin_unlock_irqrestore(PENDING_LIST_LOCK(adapter), flags); | 2694 | spin_unlock_irqrestore(PENDING_LIST_LOCK(adapter), flags); |
2672 | 2695 | ||
2673 | if (adapter->outstanding_cmds) { | 2696 | if (adapter->outstanding_cmds) { |
2674 | con_log(CL_ANN, (KERN_NOTICE | 2697 | con_log(CL_ANN, (KERN_NOTICE |
2675 | "megaraid: %d outstanding commands. Max wait %d sec\n", | 2698 | "megaraid: %d outstanding commands. Max wait %d sec\n", |
2676 | adapter->outstanding_cmds, MBOX_RESET_WAIT)); | 2699 | adapter->outstanding_cmds, |
2700 | (MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT))); | ||
2677 | } | 2701 | } |
2678 | 2702 | ||
2679 | recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; | 2703 | recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; |
2680 | 2704 | ||
2681 | recovering = adapter->outstanding_cmds; | 2705 | recovering = adapter->outstanding_cmds; |
2682 | 2706 | ||
2683 | for (i = 0; i < recovery_window && adapter->outstanding_cmds; i++) { | 2707 | for (i = 0; i < recovery_window; i++) { |
2684 | 2708 | ||
2685 | megaraid_ack_sequence(adapter); | 2709 | megaraid_ack_sequence(adapter); |
2686 | 2710 | ||
@@ -2689,12 +2713,11 @@ megaraid_reset_handler(struct scsi_cmnd *scp) | |||
2689 | con_log(CL_ANN, ( | 2713 | con_log(CL_ANN, ( |
2690 | "megaraid mbox: Wait for %d commands to complete:%d\n", | 2714 | "megaraid mbox: Wait for %d commands to complete:%d\n", |
2691 | adapter->outstanding_cmds, | 2715 | adapter->outstanding_cmds, |
2692 | MBOX_RESET_WAIT - i)); | 2716 | (MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT) - i)); |
2693 | } | 2717 | } |
2694 | 2718 | ||
2695 | // bailout if no recovery happended in reset time | 2719 | // bailout if no recovery happended in reset time |
2696 | if ((i == MBOX_RESET_WAIT) && | 2720 | if (adapter->outstanding_cmds == 0) { |
2697 | (recovering == adapter->outstanding_cmds)) { | ||
2698 | break; | 2721 | break; |
2699 | } | 2722 | } |
2700 | 2723 | ||
@@ -2918,12 +2941,13 @@ mbox_post_sync_cmd_fast(adapter_t *adapter, uint8_t raw_mbox[]) | |||
2918 | wmb(); | 2941 | wmb(); |
2919 | WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); | 2942 | WRINDOOR(raid_dev, raid_dev->mbox_dma | 0x1); |
2920 | 2943 | ||
2921 | for (i = 0; i < 0xFFFFF; i++) { | 2944 | for (i = 0; i < MBOX_SYNC_WAIT_CNT; i++) { |
2922 | if (mbox->numstatus != 0xFF) break; | 2945 | if (mbox->numstatus != 0xFF) break; |
2923 | rmb(); | 2946 | rmb(); |
2947 | udelay(MBOX_SYNC_DELAY_200); | ||
2924 | } | 2948 | } |
2925 | 2949 | ||
2926 | if (i == 0xFFFFF) { | 2950 | if (i == MBOX_SYNC_WAIT_CNT) { |
2927 | // We may need to re-calibrate the counter | 2951 | // We may need to re-calibrate the counter |
2928 | con_log(CL_ANN, (KERN_CRIT | 2952 | con_log(CL_ANN, (KERN_CRIT |
2929 | "megaraid: fast sync command timed out\n")); | 2953 | "megaraid: fast sync command timed out\n")); |
@@ -3475,7 +3499,7 @@ megaraid_cmm_register(adapter_t *adapter) | |||
3475 | adp.drvr_data = (unsigned long)adapter; | 3499 | adp.drvr_data = (unsigned long)adapter; |
3476 | adp.pdev = adapter->pdev; | 3500 | adp.pdev = adapter->pdev; |
3477 | adp.issue_uioc = megaraid_mbox_mm_handler; | 3501 | adp.issue_uioc = megaraid_mbox_mm_handler; |
3478 | adp.timeout = 300; | 3502 | adp.timeout = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; |
3479 | adp.max_kioc = MBOX_MAX_USER_CMDS; | 3503 | adp.max_kioc = MBOX_MAX_USER_CMDS; |
3480 | 3504 | ||
3481 | if ((rval = mraid_mm_register_adp(&adp)) != 0) { | 3505 | if ((rval = mraid_mm_register_adp(&adp)) != 0) { |
@@ -3702,7 +3726,6 @@ megaraid_mbox_mm_done(adapter_t *adapter, scb_t *scb) | |||
3702 | unsigned long flags; | 3726 | unsigned long flags; |
3703 | 3727 | ||
3704 | kioc = (uioc_t *)scb->gp; | 3728 | kioc = (uioc_t *)scb->gp; |
3705 | kioc->status = 0; | ||
3706 | mbox64 = (mbox64_t *)(unsigned long)kioc->cmdbuf; | 3729 | mbox64 = (mbox64_t *)(unsigned long)kioc->cmdbuf; |
3707 | mbox64->mbox32.status = scb->status; | 3730 | mbox64->mbox32.status = scb->status; |
3708 | raw_mbox = (uint8_t *)&mbox64->mbox32; | 3731 | raw_mbox = (uint8_t *)&mbox64->mbox32; |
diff --git a/drivers/scsi/megaraid/megaraid_mbox.h b/drivers/scsi/megaraid/megaraid_mbox.h index 882fb1a0b575..868fb0ec93e7 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.h +++ b/drivers/scsi/megaraid/megaraid_mbox.h | |||
@@ -21,8 +21,8 @@ | |||
21 | #include "megaraid_ioctl.h" | 21 | #include "megaraid_ioctl.h" |
22 | 22 | ||
23 | 23 | ||
24 | #define MEGARAID_VERSION "2.20.4.7" | 24 | #define MEGARAID_VERSION "2.20.4.8" |
25 | #define MEGARAID_EXT_VERSION "(Release Date: Mon Nov 14 12:27:22 EST 2005)" | 25 | #define MEGARAID_EXT_VERSION "(Release Date: Mon Apr 11 12:27:22 EST 2006)" |
26 | 26 | ||
27 | 27 | ||
28 | /* | 28 | /* |
@@ -100,6 +100,9 @@ | |||
100 | #define MBOX_BUSY_WAIT 10 // max usec to wait for busy mailbox | 100 | #define MBOX_BUSY_WAIT 10 // max usec to wait for busy mailbox |
101 | #define MBOX_RESET_WAIT 180 // wait these many seconds in reset | 101 | #define MBOX_RESET_WAIT 180 // wait these many seconds in reset |
102 | #define MBOX_RESET_EXT_WAIT 120 // extended wait reset | 102 | #define MBOX_RESET_EXT_WAIT 120 // extended wait reset |
103 | #define MBOX_SYNC_WAIT_CNT 0xFFFF // wait loop index for synchronous mode | ||
104 | |||
105 | #define MBOX_SYNC_DELAY_200 200 // 200 micro-seconds | ||
103 | 106 | ||
104 | /* | 107 | /* |
105 | * maximum transfer that can happen through the firmware commands issued | 108 | * maximum transfer that can happen through the firmware commands issued |
diff --git a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c index 8f3ce0432295..e8f534fb336b 100644 --- a/drivers/scsi/megaraid/megaraid_mm.c +++ b/drivers/scsi/megaraid/megaraid_mm.c | |||
@@ -898,10 +898,8 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp) | |||
898 | 898 | ||
899 | adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL); | 899 | adapter = kmalloc(sizeof(mraid_mmadp_t), GFP_KERNEL); |
900 | 900 | ||
901 | if (!adapter) { | 901 | if (!adapter) |
902 | rval = -ENOMEM; | 902 | return -ENOMEM; |
903 | goto memalloc_error; | ||
904 | } | ||
905 | 903 | ||
906 | memset(adapter, 0, sizeof(mraid_mmadp_t)); | 904 | memset(adapter, 0, sizeof(mraid_mmadp_t)); |
907 | 905 | ||
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 017729c59a49..584fe5d8e507 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -599,6 +599,7 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha) | |||
599 | * Either SUCCESS or FAILED. | 599 | * Either SUCCESS or FAILED. |
600 | * | 600 | * |
601 | * Note: | 601 | * Note: |
602 | * Only return FAILED if command not returned by firmware. | ||
602 | **************************************************************************/ | 603 | **************************************************************************/ |
603 | int | 604 | int |
604 | qla2xxx_eh_abort(struct scsi_cmnd *cmd) | 605 | qla2xxx_eh_abort(struct scsi_cmnd *cmd) |
@@ -609,11 +610,12 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
609 | unsigned int id, lun; | 610 | unsigned int id, lun; |
610 | unsigned long serial; | 611 | unsigned long serial; |
611 | unsigned long flags; | 612 | unsigned long flags; |
613 | int wait = 0; | ||
612 | 614 | ||
613 | if (!CMD_SP(cmd)) | 615 | if (!CMD_SP(cmd)) |
614 | return FAILED; | 616 | return SUCCESS; |
615 | 617 | ||
616 | ret = FAILED; | 618 | ret = SUCCESS; |
617 | 619 | ||
618 | id = cmd->device->id; | 620 | id = cmd->device->id; |
619 | lun = cmd->device->lun; | 621 | lun = cmd->device->lun; |
@@ -642,7 +644,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
642 | } else { | 644 | } else { |
643 | DEBUG3(printk("%s(%ld): abort_command " | 645 | DEBUG3(printk("%s(%ld): abort_command " |
644 | "mbx success.\n", __func__, ha->host_no)); | 646 | "mbx success.\n", __func__, ha->host_no)); |
645 | ret = SUCCESS; | 647 | wait = 1; |
646 | } | 648 | } |
647 | spin_lock_irqsave(&ha->hardware_lock, flags); | 649 | spin_lock_irqsave(&ha->hardware_lock, flags); |
648 | 650 | ||
@@ -651,17 +653,18 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
651 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 653 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
652 | 654 | ||
653 | /* Wait for the command to be returned. */ | 655 | /* Wait for the command to be returned. */ |
654 | if (ret == SUCCESS) { | 656 | if (wait) { |
655 | if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { | 657 | if (qla2x00_eh_wait_on_command(ha, cmd) != QLA_SUCCESS) { |
656 | qla_printk(KERN_ERR, ha, | 658 | qla_printk(KERN_ERR, ha, |
657 | "scsi(%ld:%d:%d): Abort handler timed out -- %lx " | 659 | "scsi(%ld:%d:%d): Abort handler timed out -- %lx " |
658 | "%x.\n", ha->host_no, id, lun, serial, ret); | 660 | "%x.\n", ha->host_no, id, lun, serial, ret); |
661 | ret = FAILED; | ||
659 | } | 662 | } |
660 | } | 663 | } |
661 | 664 | ||
662 | qla_printk(KERN_INFO, ha, | 665 | qla_printk(KERN_INFO, ha, |
663 | "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, | 666 | "scsi(%ld:%d:%d): Abort command issued -- %d %lx %x.\n", |
664 | id, lun, serial, ret); | 667 | ha->host_no, id, lun, wait, serial, ret); |
665 | 668 | ||
666 | return ret; | 669 | return ret; |
667 | } | 670 | } |
@@ -1700,8 +1703,8 @@ qla2x00_free_device(scsi_qla_host_t *ha) | |||
1700 | ha->flags.online = 0; | 1703 | ha->flags.online = 0; |
1701 | 1704 | ||
1702 | /* Detach interrupts */ | 1705 | /* Detach interrupts */ |
1703 | if (ha->pdev->irq) | 1706 | if (ha->host->irq) |
1704 | free_irq(ha->pdev->irq, ha); | 1707 | free_irq(ha->host->irq, ha); |
1705 | 1708 | ||
1706 | /* release io space registers */ | 1709 | /* release io space registers */ |
1707 | if (ha->iobase) | 1710 | if (ha->iobase) |
diff --git a/drivers/scsi/sata_mv.c b/drivers/scsi/sata_mv.c index d5fdcb9a8842..9b8bca1ac1f0 100644 --- a/drivers/scsi/sata_mv.c +++ b/drivers/scsi/sata_mv.c | |||
@@ -37,7 +37,7 @@ | |||
37 | #include <asm/io.h> | 37 | #include <asm/io.h> |
38 | 38 | ||
39 | #define DRV_NAME "sata_mv" | 39 | #define DRV_NAME "sata_mv" |
40 | #define DRV_VERSION "0.6" | 40 | #define DRV_VERSION "0.7" |
41 | 41 | ||
42 | enum { | 42 | enum { |
43 | /* BAR's are enumerated in terms of pci_resource_start() terms */ | 43 | /* BAR's are enumerated in terms of pci_resource_start() terms */ |
@@ -50,6 +50,12 @@ enum { | |||
50 | 50 | ||
51 | MV_PCI_REG_BASE = 0, | 51 | MV_PCI_REG_BASE = 0, |
52 | MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */ | 52 | MV_IRQ_COAL_REG_BASE = 0x18000, /* 6xxx part only */ |
53 | MV_IRQ_COAL_CAUSE = (MV_IRQ_COAL_REG_BASE + 0x08), | ||
54 | MV_IRQ_COAL_CAUSE_LO = (MV_IRQ_COAL_REG_BASE + 0x88), | ||
55 | MV_IRQ_COAL_CAUSE_HI = (MV_IRQ_COAL_REG_BASE + 0x8c), | ||
56 | MV_IRQ_COAL_THRESHOLD = (MV_IRQ_COAL_REG_BASE + 0xcc), | ||
57 | MV_IRQ_COAL_TIME_THRESHOLD = (MV_IRQ_COAL_REG_BASE + 0xd0), | ||
58 | |||
53 | MV_SATAHC0_REG_BASE = 0x20000, | 59 | MV_SATAHC0_REG_BASE = 0x20000, |
54 | MV_FLASH_CTL = 0x1046c, | 60 | MV_FLASH_CTL = 0x1046c, |
55 | MV_GPIO_PORT_CTL = 0x104f0, | 61 | MV_GPIO_PORT_CTL = 0x104f0, |
@@ -302,9 +308,6 @@ struct mv_port_priv { | |||
302 | dma_addr_t crpb_dma; | 308 | dma_addr_t crpb_dma; |
303 | struct mv_sg *sg_tbl; | 309 | struct mv_sg *sg_tbl; |
304 | dma_addr_t sg_tbl_dma; | 310 | dma_addr_t sg_tbl_dma; |
305 | |||
306 | unsigned req_producer; /* cp of req_in_ptr */ | ||
307 | unsigned rsp_consumer; /* cp of rsp_out_ptr */ | ||
308 | u32 pp_flags; | 311 | u32 pp_flags; |
309 | }; | 312 | }; |
310 | 313 | ||
@@ -937,8 +940,6 @@ static int mv_port_start(struct ata_port *ap) | |||
937 | writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK, | 940 | writelfl(pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK, |
938 | port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); | 941 | port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); |
939 | 942 | ||
940 | pp->req_producer = pp->rsp_consumer = 0; | ||
941 | |||
942 | /* Don't turn on EDMA here...do it before DMA commands only. Else | 943 | /* Don't turn on EDMA here...do it before DMA commands only. Else |
943 | * we'll be unable to send non-data, PIO, etc due to restricted access | 944 | * we'll be unable to send non-data, PIO, etc due to restricted access |
944 | * to shadow regs. | 945 | * to shadow regs. |
@@ -1022,16 +1023,16 @@ static void mv_fill_sg(struct ata_queued_cmd *qc) | |||
1022 | } | 1023 | } |
1023 | } | 1024 | } |
1024 | 1025 | ||
1025 | static inline unsigned mv_inc_q_index(unsigned *index) | 1026 | static inline unsigned mv_inc_q_index(unsigned index) |
1026 | { | 1027 | { |
1027 | *index = (*index + 1) & MV_MAX_Q_DEPTH_MASK; | 1028 | return (index + 1) & MV_MAX_Q_DEPTH_MASK; |
1028 | return *index; | ||
1029 | } | 1029 | } |
1030 | 1030 | ||
1031 | static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last) | 1031 | static inline void mv_crqb_pack_cmd(u16 *cmdw, u8 data, u8 addr, unsigned last) |
1032 | { | 1032 | { |
1033 | *cmdw = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS | | 1033 | u16 tmp = data | (addr << CRQB_CMD_ADDR_SHIFT) | CRQB_CMD_CS | |
1034 | (last ? CRQB_CMD_LAST : 0); | 1034 | (last ? CRQB_CMD_LAST : 0); |
1035 | *cmdw = cpu_to_le16(tmp); | ||
1035 | } | 1036 | } |
1036 | 1037 | ||
1037 | /** | 1038 | /** |
@@ -1053,15 +1054,11 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) | |||
1053 | u16 *cw; | 1054 | u16 *cw; |
1054 | struct ata_taskfile *tf; | 1055 | struct ata_taskfile *tf; |
1055 | u16 flags = 0; | 1056 | u16 flags = 0; |
1057 | unsigned in_index; | ||
1056 | 1058 | ||
1057 | if (ATA_PROT_DMA != qc->tf.protocol) | 1059 | if (ATA_PROT_DMA != qc->tf.protocol) |
1058 | return; | 1060 | return; |
1059 | 1061 | ||
1060 | /* the req producer index should be the same as we remember it */ | ||
1061 | WARN_ON(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >> | ||
1062 | EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != | ||
1063 | pp->req_producer); | ||
1064 | |||
1065 | /* Fill in command request block | 1062 | /* Fill in command request block |
1066 | */ | 1063 | */ |
1067 | if (!(qc->tf.flags & ATA_TFLAG_WRITE)) | 1064 | if (!(qc->tf.flags & ATA_TFLAG_WRITE)) |
@@ -1069,13 +1066,17 @@ static void mv_qc_prep(struct ata_queued_cmd *qc) | |||
1069 | WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); | 1066 | WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); |
1070 | flags |= qc->tag << CRQB_TAG_SHIFT; | 1067 | flags |= qc->tag << CRQB_TAG_SHIFT; |
1071 | 1068 | ||
1072 | pp->crqb[pp->req_producer].sg_addr = | 1069 | /* get current queue index from hardware */ |
1070 | in_index = (readl(mv_ap_base(ap) + EDMA_REQ_Q_IN_PTR_OFS) | ||
1071 | >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK; | ||
1072 | |||
1073 | pp->crqb[in_index].sg_addr = | ||
1073 | cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); | 1074 | cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); |
1074 | pp->crqb[pp->req_producer].sg_addr_hi = | 1075 | pp->crqb[in_index].sg_addr_hi = |
1075 | cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); | 1076 | cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); |
1076 | pp->crqb[pp->req_producer].ctrl_flags = cpu_to_le16(flags); | 1077 | pp->crqb[in_index].ctrl_flags = cpu_to_le16(flags); |
1077 | 1078 | ||
1078 | cw = &pp->crqb[pp->req_producer].ata_cmd[0]; | 1079 | cw = &pp->crqb[in_index].ata_cmd[0]; |
1079 | tf = &qc->tf; | 1080 | tf = &qc->tf; |
1080 | 1081 | ||
1081 | /* Sadly, the CRQB cannot accomodate all registers--there are | 1082 | /* Sadly, the CRQB cannot accomodate all registers--there are |
@@ -1144,16 +1145,12 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc) | |||
1144 | struct mv_port_priv *pp = ap->private_data; | 1145 | struct mv_port_priv *pp = ap->private_data; |
1145 | struct mv_crqb_iie *crqb; | 1146 | struct mv_crqb_iie *crqb; |
1146 | struct ata_taskfile *tf; | 1147 | struct ata_taskfile *tf; |
1148 | unsigned in_index; | ||
1147 | u32 flags = 0; | 1149 | u32 flags = 0; |
1148 | 1150 | ||
1149 | if (ATA_PROT_DMA != qc->tf.protocol) | 1151 | if (ATA_PROT_DMA != qc->tf.protocol) |
1150 | return; | 1152 | return; |
1151 | 1153 | ||
1152 | /* the req producer index should be the same as we remember it */ | ||
1153 | WARN_ON(((readl(mv_ap_base(qc->ap) + EDMA_REQ_Q_IN_PTR_OFS) >> | ||
1154 | EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != | ||
1155 | pp->req_producer); | ||
1156 | |||
1157 | /* Fill in Gen IIE command request block | 1154 | /* Fill in Gen IIE command request block |
1158 | */ | 1155 | */ |
1159 | if (!(qc->tf.flags & ATA_TFLAG_WRITE)) | 1156 | if (!(qc->tf.flags & ATA_TFLAG_WRITE)) |
@@ -1162,7 +1159,11 @@ static void mv_qc_prep_iie(struct ata_queued_cmd *qc) | |||
1162 | WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); | 1159 | WARN_ON(MV_MAX_Q_DEPTH <= qc->tag); |
1163 | flags |= qc->tag << CRQB_TAG_SHIFT; | 1160 | flags |= qc->tag << CRQB_TAG_SHIFT; |
1164 | 1161 | ||
1165 | crqb = (struct mv_crqb_iie *) &pp->crqb[pp->req_producer]; | 1162 | /* get current queue index from hardware */ |
1163 | in_index = (readl(mv_ap_base(ap) + EDMA_REQ_Q_IN_PTR_OFS) | ||
1164 | >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK; | ||
1165 | |||
1166 | crqb = (struct mv_crqb_iie *) &pp->crqb[in_index]; | ||
1166 | crqb->addr = cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); | 1167 | crqb->addr = cpu_to_le32(pp->sg_tbl_dma & 0xffffffff); |
1167 | crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); | 1168 | crqb->addr_hi = cpu_to_le32((pp->sg_tbl_dma >> 16) >> 16); |
1168 | crqb->flags = cpu_to_le32(flags); | 1169 | crqb->flags = cpu_to_le32(flags); |
@@ -1210,6 +1211,7 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc) | |||
1210 | { | 1211 | { |
1211 | void __iomem *port_mmio = mv_ap_base(qc->ap); | 1212 | void __iomem *port_mmio = mv_ap_base(qc->ap); |
1212 | struct mv_port_priv *pp = qc->ap->private_data; | 1213 | struct mv_port_priv *pp = qc->ap->private_data; |
1214 | unsigned in_index; | ||
1213 | u32 in_ptr; | 1215 | u32 in_ptr; |
1214 | 1216 | ||
1215 | if (ATA_PROT_DMA != qc->tf.protocol) { | 1217 | if (ATA_PROT_DMA != qc->tf.protocol) { |
@@ -1221,23 +1223,20 @@ static unsigned int mv_qc_issue(struct ata_queued_cmd *qc) | |||
1221 | return ata_qc_issue_prot(qc); | 1223 | return ata_qc_issue_prot(qc); |
1222 | } | 1224 | } |
1223 | 1225 | ||
1224 | in_ptr = readl(port_mmio + EDMA_REQ_Q_IN_PTR_OFS); | 1226 | in_ptr = readl(port_mmio + EDMA_REQ_Q_IN_PTR_OFS); |
1227 | in_index = (in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK; | ||
1225 | 1228 | ||
1226 | /* the req producer index should be the same as we remember it */ | ||
1227 | WARN_ON(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != | ||
1228 | pp->req_producer); | ||
1229 | /* until we do queuing, the queue should be empty at this point */ | 1229 | /* until we do queuing, the queue should be empty at this point */ |
1230 | WARN_ON(((in_ptr >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != | 1230 | WARN_ON(in_index != ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) |
1231 | ((readl(port_mmio + EDMA_REQ_Q_OUT_PTR_OFS) >> | 1231 | >> EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK)); |
1232 | EDMA_REQ_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK)); | ||
1233 | 1232 | ||
1234 | mv_inc_q_index(&pp->req_producer); /* now incr producer index */ | 1233 | in_index = mv_inc_q_index(in_index); /* now incr producer index */ |
1235 | 1234 | ||
1236 | mv_start_dma(port_mmio, pp); | 1235 | mv_start_dma(port_mmio, pp); |
1237 | 1236 | ||
1238 | /* and write the request in pointer to kick the EDMA to life */ | 1237 | /* and write the request in pointer to kick the EDMA to life */ |
1239 | in_ptr &= EDMA_REQ_Q_BASE_LO_MASK; | 1238 | in_ptr &= EDMA_REQ_Q_BASE_LO_MASK; |
1240 | in_ptr |= pp->req_producer << EDMA_REQ_Q_PTR_SHIFT; | 1239 | in_ptr |= in_index << EDMA_REQ_Q_PTR_SHIFT; |
1241 | writelfl(in_ptr, port_mmio + EDMA_REQ_Q_IN_PTR_OFS); | 1240 | writelfl(in_ptr, port_mmio + EDMA_REQ_Q_IN_PTR_OFS); |
1242 | 1241 | ||
1243 | return 0; | 1242 | return 0; |
@@ -1260,28 +1259,26 @@ static u8 mv_get_crpb_status(struct ata_port *ap) | |||
1260 | { | 1259 | { |
1261 | void __iomem *port_mmio = mv_ap_base(ap); | 1260 | void __iomem *port_mmio = mv_ap_base(ap); |
1262 | struct mv_port_priv *pp = ap->private_data; | 1261 | struct mv_port_priv *pp = ap->private_data; |
1262 | unsigned out_index; | ||
1263 | u32 out_ptr; | 1263 | u32 out_ptr; |
1264 | u8 ata_status; | 1264 | u8 ata_status; |
1265 | 1265 | ||
1266 | out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); | 1266 | out_ptr = readl(port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); |
1267 | out_index = (out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK; | ||
1267 | 1268 | ||
1268 | /* the response consumer index should be the same as we remember it */ | 1269 | ata_status = le16_to_cpu(pp->crpb[out_index].flags) |
1269 | WARN_ON(((out_ptr >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != | 1270 | >> CRPB_FLAG_STATUS_SHIFT; |
1270 | pp->rsp_consumer); | ||
1271 | |||
1272 | ata_status = pp->crpb[pp->rsp_consumer].flags >> CRPB_FLAG_STATUS_SHIFT; | ||
1273 | 1271 | ||
1274 | /* increment our consumer index... */ | 1272 | /* increment our consumer index... */ |
1275 | pp->rsp_consumer = mv_inc_q_index(&pp->rsp_consumer); | 1273 | out_index = mv_inc_q_index(out_index); |
1276 | 1274 | ||
1277 | /* and, until we do NCQ, there should only be 1 CRPB waiting */ | 1275 | /* and, until we do NCQ, there should only be 1 CRPB waiting */ |
1278 | WARN_ON(((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) >> | 1276 | WARN_ON(out_index != ((readl(port_mmio + EDMA_RSP_Q_IN_PTR_OFS) |
1279 | EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK) != | 1277 | >> EDMA_RSP_Q_PTR_SHIFT) & MV_MAX_Q_DEPTH_MASK)); |
1280 | pp->rsp_consumer); | ||
1281 | 1278 | ||
1282 | /* write out our inc'd consumer index so EDMA knows we're caught up */ | 1279 | /* write out our inc'd consumer index so EDMA knows we're caught up */ |
1283 | out_ptr &= EDMA_RSP_Q_BASE_LO_MASK; | 1280 | out_ptr &= EDMA_RSP_Q_BASE_LO_MASK; |
1284 | out_ptr |= pp->rsp_consumer << EDMA_RSP_Q_PTR_SHIFT; | 1281 | out_ptr |= out_index << EDMA_RSP_Q_PTR_SHIFT; |
1285 | writelfl(out_ptr, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); | 1282 | writelfl(out_ptr, port_mmio + EDMA_RSP_Q_OUT_PTR_OFS); |
1286 | 1283 | ||
1287 | /* Return ATA status register for completed CRPB */ | 1284 | /* Return ATA status register for completed CRPB */ |
@@ -1291,6 +1288,7 @@ static u8 mv_get_crpb_status(struct ata_port *ap) | |||
1291 | /** | 1288 | /** |
1292 | * mv_err_intr - Handle error interrupts on the port | 1289 | * mv_err_intr - Handle error interrupts on the port |
1293 | * @ap: ATA channel to manipulate | 1290 | * @ap: ATA channel to manipulate |
1291 | * @reset_allowed: bool: 0 == don't trigger from reset here | ||
1294 | * | 1292 | * |
1295 | * In most cases, just clear the interrupt and move on. However, | 1293 | * In most cases, just clear the interrupt and move on. However, |
1296 | * some cases require an eDMA reset, which is done right before | 1294 | * some cases require an eDMA reset, which is done right before |
@@ -1301,7 +1299,7 @@ static u8 mv_get_crpb_status(struct ata_port *ap) | |||
1301 | * LOCKING: | 1299 | * LOCKING: |
1302 | * Inherited from caller. | 1300 | * Inherited from caller. |
1303 | */ | 1301 | */ |
1304 | static void mv_err_intr(struct ata_port *ap) | 1302 | static void mv_err_intr(struct ata_port *ap, int reset_allowed) |
1305 | { | 1303 | { |
1306 | void __iomem *port_mmio = mv_ap_base(ap); | 1304 | void __iomem *port_mmio = mv_ap_base(ap); |
1307 | u32 edma_err_cause, serr = 0; | 1305 | u32 edma_err_cause, serr = 0; |
@@ -1323,9 +1321,8 @@ static void mv_err_intr(struct ata_port *ap) | |||
1323 | writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); | 1321 | writelfl(0, port_mmio + EDMA_ERR_IRQ_CAUSE_OFS); |
1324 | 1322 | ||
1325 | /* check for fatal here and recover if needed */ | 1323 | /* check for fatal here and recover if needed */ |
1326 | if (EDMA_ERR_FATAL & edma_err_cause) { | 1324 | if (reset_allowed && (EDMA_ERR_FATAL & edma_err_cause)) |
1327 | mv_stop_and_reset(ap); | 1325 | mv_stop_and_reset(ap); |
1328 | } | ||
1329 | } | 1326 | } |
1330 | 1327 | ||
1331 | /** | 1328 | /** |
@@ -1374,12 +1371,12 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, | |||
1374 | struct ata_port *ap = host_set->ports[port]; | 1371 | struct ata_port *ap = host_set->ports[port]; |
1375 | struct mv_port_priv *pp = ap->private_data; | 1372 | struct mv_port_priv *pp = ap->private_data; |
1376 | 1373 | ||
1377 | hard_port = port & MV_PORT_MASK; /* range 0-3 */ | 1374 | hard_port = mv_hardport_from_port(port); /* range 0..3 */ |
1378 | handled = 0; /* ensure ata_status is set if handled++ */ | 1375 | handled = 0; /* ensure ata_status is set if handled++ */ |
1379 | 1376 | ||
1380 | /* Note that DEV_IRQ might happen spuriously during EDMA, | 1377 | /* Note that DEV_IRQ might happen spuriously during EDMA, |
1381 | * and should be ignored in such cases. We could mask it, | 1378 | * and should be ignored in such cases. |
1382 | * but it's pretty rare and may not be worth the overhead. | 1379 | * The cause of this is still under investigation. |
1383 | */ | 1380 | */ |
1384 | if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) { | 1381 | if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) { |
1385 | /* EDMA: check for response queue interrupt */ | 1382 | /* EDMA: check for response queue interrupt */ |
@@ -1393,6 +1390,11 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, | |||
1393 | ata_status = readb((void __iomem *) | 1390 | ata_status = readb((void __iomem *) |
1394 | ap->ioaddr.status_addr); | 1391 | ap->ioaddr.status_addr); |
1395 | handled = 1; | 1392 | handled = 1; |
1393 | /* ignore spurious intr if drive still BUSY */ | ||
1394 | if (ata_status & ATA_BUSY) { | ||
1395 | ata_status = 0; | ||
1396 | handled = 0; | ||
1397 | } | ||
1396 | } | 1398 | } |
1397 | } | 1399 | } |
1398 | 1400 | ||
@@ -1406,7 +1408,7 @@ static void mv_host_intr(struct ata_host_set *host_set, u32 relevant, | |||
1406 | shift++; /* skip bit 8 in the HC Main IRQ reg */ | 1408 | shift++; /* skip bit 8 in the HC Main IRQ reg */ |
1407 | } | 1409 | } |
1408 | if ((PORT0_ERR << shift) & relevant) { | 1410 | if ((PORT0_ERR << shift) & relevant) { |
1409 | mv_err_intr(ap); | 1411 | mv_err_intr(ap, 1); |
1410 | err_mask |= AC_ERR_OTHER; | 1412 | err_mask |= AC_ERR_OTHER; |
1411 | handled = 1; | 1413 | handled = 1; |
1412 | } | 1414 | } |
@@ -1448,6 +1450,7 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance, | |||
1448 | struct ata_host_set *host_set = dev_instance; | 1450 | struct ata_host_set *host_set = dev_instance; |
1449 | unsigned int hc, handled = 0, n_hcs; | 1451 | unsigned int hc, handled = 0, n_hcs; |
1450 | void __iomem *mmio = host_set->mmio_base; | 1452 | void __iomem *mmio = host_set->mmio_base; |
1453 | struct mv_host_priv *hpriv; | ||
1451 | u32 irq_stat; | 1454 | u32 irq_stat; |
1452 | 1455 | ||
1453 | irq_stat = readl(mmio + HC_MAIN_IRQ_CAUSE_OFS); | 1456 | irq_stat = readl(mmio + HC_MAIN_IRQ_CAUSE_OFS); |
@@ -1469,6 +1472,17 @@ static irqreturn_t mv_interrupt(int irq, void *dev_instance, | |||
1469 | handled++; | 1472 | handled++; |
1470 | } | 1473 | } |
1471 | } | 1474 | } |
1475 | |||
1476 | hpriv = host_set->private_data; | ||
1477 | if (IS_60XX(hpriv)) { | ||
1478 | /* deal with the interrupt coalescing bits */ | ||
1479 | if (irq_stat & (TRAN_LO_DONE | TRAN_HI_DONE | PORTS_0_7_COAL_DONE)) { | ||
1480 | writelfl(0, mmio + MV_IRQ_COAL_CAUSE_LO); | ||
1481 | writelfl(0, mmio + MV_IRQ_COAL_CAUSE_HI); | ||
1482 | writelfl(0, mmio + MV_IRQ_COAL_CAUSE); | ||
1483 | } | ||
1484 | } | ||
1485 | |||
1472 | if (PCI_ERR & irq_stat) { | 1486 | if (PCI_ERR & irq_stat) { |
1473 | printk(KERN_ERR DRV_NAME ": PCI ERROR; PCI IRQ cause=0x%08x\n", | 1487 | printk(KERN_ERR DRV_NAME ": PCI ERROR; PCI IRQ cause=0x%08x\n", |
1474 | readl(mmio + PCI_IRQ_CAUSE_OFS)); | 1488 | readl(mmio + PCI_IRQ_CAUSE_OFS)); |
@@ -1867,7 +1881,8 @@ static void mv_channel_reset(struct mv_host_priv *hpriv, void __iomem *mmio, | |||
1867 | 1881 | ||
1868 | if (IS_60XX(hpriv)) { | 1882 | if (IS_60XX(hpriv)) { |
1869 | u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); | 1883 | u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); |
1870 | ifctl |= (1 << 12) | (1 << 7); | 1884 | ifctl |= (1 << 7); /* enable gen2i speed */ |
1885 | ifctl = (ifctl & 0xfff) | 0x9b1000; /* from chip spec */ | ||
1871 | writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); | 1886 | writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); |
1872 | } | 1887 | } |
1873 | 1888 | ||
@@ -2031,11 +2046,14 @@ static void mv_eng_timeout(struct ata_port *ap) | |||
2031 | ap->host_set->mmio_base, ap, qc, qc->scsicmd, | 2046 | ap->host_set->mmio_base, ap, qc, qc->scsicmd, |
2032 | &qc->scsicmd->cmnd); | 2047 | &qc->scsicmd->cmnd); |
2033 | 2048 | ||
2034 | mv_err_intr(ap); | 2049 | mv_err_intr(ap, 0); |
2035 | mv_stop_and_reset(ap); | 2050 | mv_stop_and_reset(ap); |
2036 | 2051 | ||
2037 | qc->err_mask |= AC_ERR_TIMEOUT; | 2052 | WARN_ON(!(qc->flags & ATA_QCFLAG_ACTIVE)); |
2038 | ata_eh_qc_complete(qc); | 2053 | if (qc->flags & ATA_QCFLAG_ACTIVE) { |
2054 | qc->err_mask |= AC_ERR_TIMEOUT; | ||
2055 | ata_eh_qc_complete(qc); | ||
2056 | } | ||
2039 | } | 2057 | } |
2040 | 2058 | ||
2041 | /** | 2059 | /** |
@@ -2229,7 +2247,8 @@ static int mv_init_host(struct pci_dev *pdev, struct ata_probe_ent *probe_ent, | |||
2229 | void __iomem *port_mmio = mv_port_base(mmio, port); | 2247 | void __iomem *port_mmio = mv_port_base(mmio, port); |
2230 | 2248 | ||
2231 | u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); | 2249 | u32 ifctl = readl(port_mmio + SATA_INTERFACE_CTL); |
2232 | ifctl |= (1 << 12); | 2250 | ifctl |= (1 << 7); /* enable gen2i speed */ |
2251 | ifctl = (ifctl & 0xfff) | 0x9b1000; /* from chip spec */ | ||
2233 | writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); | 2252 | writelfl(ifctl, port_mmio + SATA_INTERFACE_CTL); |
2234 | } | 2253 | } |
2235 | 2254 | ||
@@ -2330,6 +2349,7 @@ static int mv_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2330 | if (rc) { | 2349 | if (rc) { |
2331 | return rc; | 2350 | return rc; |
2332 | } | 2351 | } |
2352 | pci_set_master(pdev); | ||
2333 | 2353 | ||
2334 | rc = pci_request_regions(pdev, DRV_NAME); | 2354 | rc = pci_request_regions(pdev, DRV_NAME); |
2335 | if (rc) { | 2355 | if (rc) { |
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index c750d3399a97..941c1e15c899 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c | |||
@@ -56,6 +56,8 @@ static struct { | |||
56 | {"DENON", "DRD-25X", "V", BLIST_NOLUN}, /* locks up */ | 56 | {"DENON", "DRD-25X", "V", BLIST_NOLUN}, /* locks up */ |
57 | {"HITACHI", "DK312C", "CM81", BLIST_NOLUN}, /* responds to all lun */ | 57 | {"HITACHI", "DK312C", "CM81", BLIST_NOLUN}, /* responds to all lun */ |
58 | {"HITACHI", "DK314C", "CR21", BLIST_NOLUN}, /* responds to all lun */ | 58 | {"HITACHI", "DK314C", "CR21", BLIST_NOLUN}, /* responds to all lun */ |
59 | {"IBM", "2104-DU3", NULL, BLIST_NOLUN}, /* locks up */ | ||
60 | {"IBM", "2104-TU3", NULL, BLIST_NOLUN}, /* locks up */ | ||
59 | {"IMS", "CDD521/10", "2.06", BLIST_NOLUN}, /* locks up */ | 61 | {"IMS", "CDD521/10", "2.06", BLIST_NOLUN}, /* locks up */ |
60 | {"MAXTOR", "XT-3280", "PR02", BLIST_NOLUN}, /* locks up */ | 62 | {"MAXTOR", "XT-3280", "PR02", BLIST_NOLUN}, /* locks up */ |
61 | {"MAXTOR", "XT-4380S", "B3C", BLIST_NOLUN}, /* locks up */ | 63 | {"MAXTOR", "XT-4380S", "B3C", BLIST_NOLUN}, /* locks up */ |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 7b0f9a3810d2..764a8b375ead 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1067,16 +1067,29 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes, | |||
1067 | break; | 1067 | break; |
1068 | case NOT_READY: | 1068 | case NOT_READY: |
1069 | /* | 1069 | /* |
1070 | * If the device is in the process of becoming ready, | 1070 | * If the device is in the process of becoming |
1071 | * retry. | 1071 | * ready, or has a temporary blockage, retry. |
1072 | */ | 1072 | */ |
1073 | if (sshdr.asc == 0x04 && sshdr.ascq == 0x01) { | 1073 | if (sshdr.asc == 0x04) { |
1074 | scsi_requeue_command(q, cmd); | 1074 | switch (sshdr.ascq) { |
1075 | return; | 1075 | case 0x01: /* becoming ready */ |
1076 | case 0x04: /* format in progress */ | ||
1077 | case 0x05: /* rebuild in progress */ | ||
1078 | case 0x06: /* recalculation in progress */ | ||
1079 | case 0x07: /* operation in progress */ | ||
1080 | case 0x08: /* Long write in progress */ | ||
1081 | case 0x09: /* self test in progress */ | ||
1082 | scsi_requeue_command(q, cmd); | ||
1083 | return; | ||
1084 | default: | ||
1085 | break; | ||
1086 | } | ||
1076 | } | 1087 | } |
1077 | if (!(req->flags & REQ_QUIET)) | 1088 | if (!(req->flags & REQ_QUIET)) { |
1078 | scmd_printk(KERN_INFO, cmd, | 1089 | scmd_printk(KERN_INFO, cmd, |
1079 | "Device not ready.\n"); | 1090 | "Device not ready: "); |
1091 | scsi_print_sense_hdr("", &sshdr); | ||
1092 | } | ||
1080 | scsi_end_request(cmd, 0, this_count, 1); | 1093 | scsi_end_request(cmd, 0, this_count, 1); |
1081 | return; | 1094 | return; |
1082 | case VOLUME_OVERFLOW: | 1095 | case VOLUME_OVERFLOW: |
diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c index 3274ab76c8d3..255886a9ac55 100644 --- a/drivers/scsi/sim710.c +++ b/drivers/scsi/sim710.c | |||
@@ -75,7 +75,7 @@ param_setup(char *str) | |||
75 | else if(!strncmp(pos, "id:", 3)) { | 75 | else if(!strncmp(pos, "id:", 3)) { |
76 | if(slot == -1) { | 76 | if(slot == -1) { |
77 | printk(KERN_WARNING "sim710: Must specify slot for id parameter\n"); | 77 | printk(KERN_WARNING "sim710: Must specify slot for id parameter\n"); |
78 | } else if(slot > MAX_SLOTS) { | 78 | } else if(slot >= MAX_SLOTS) { |
79 | printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val); | 79 | printk(KERN_WARNING "sim710: Illegal slot %d for id %d\n", slot, val); |
80 | } else { | 80 | } else { |
81 | id_array[slot] = val; | 81 | id_array[slot] = val; |
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index d40e7c871c36..56cb49006116 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c | |||
@@ -4054,7 +4054,7 @@ static int st_probe(struct device *dev) | |||
4054 | } | 4054 | } |
4055 | 4055 | ||
4056 | sdev_printk(KERN_WARNING, SDp, | 4056 | sdev_printk(KERN_WARNING, SDp, |
4057 | "Attached scsi tape %s", tape_name(tpnt)); | 4057 | "Attached scsi tape %s\n", tape_name(tpnt)); |
4058 | printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n", | 4058 | printk(KERN_WARNING "%s: try direct i/o: %s (alignment %d B)\n", |
4059 | tape_name(tpnt), tpnt->try_dio ? "yes" : "no", | 4059 | tape_name(tpnt), tpnt->try_dio ? "yes" : "no", |
4060 | queue_dma_alignment(SDp->request_queue) + 1); | 4060 | queue_dma_alignment(SDp->request_queue) + 1); |
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c index 674b15c78f68..bbf78aaf9e01 100644 --- a/drivers/serial/8250.c +++ b/drivers/serial/8250.c | |||
@@ -362,6 +362,40 @@ serial_out(struct uart_8250_port *up, int offset, int value) | |||
362 | #define serial_inp(up, offset) serial_in(up, offset) | 362 | #define serial_inp(up, offset) serial_in(up, offset) |
363 | #define serial_outp(up, offset, value) serial_out(up, offset, value) | 363 | #define serial_outp(up, offset, value) serial_out(up, offset, value) |
364 | 364 | ||
365 | /* Uart divisor latch read */ | ||
366 | static inline int _serial_dl_read(struct uart_8250_port *up) | ||
367 | { | ||
368 | return serial_inp(up, UART_DLL) | serial_inp(up, UART_DLM) << 8; | ||
369 | } | ||
370 | |||
371 | /* Uart divisor latch write */ | ||
372 | static inline void _serial_dl_write(struct uart_8250_port *up, int value) | ||
373 | { | ||
374 | serial_outp(up, UART_DLL, value & 0xff); | ||
375 | serial_outp(up, UART_DLM, value >> 8 & 0xff); | ||
376 | } | ||
377 | |||
378 | #ifdef CONFIG_SERIAL_8250_AU1X00 | ||
379 | /* Au1x00 haven't got a standard divisor latch */ | ||
380 | static int serial_dl_read(struct uart_8250_port *up) | ||
381 | { | ||
382 | if (up->port.iotype == UPIO_AU) | ||
383 | return __raw_readl(up->port.membase + 0x28); | ||
384 | else | ||
385 | return _serial_dl_read(up); | ||
386 | } | ||
387 | |||
388 | static void serial_dl_write(struct uart_8250_port *up, int value) | ||
389 | { | ||
390 | if (up->port.iotype == UPIO_AU) | ||
391 | __raw_writel(value, up->port.membase + 0x28); | ||
392 | else | ||
393 | _serial_dl_write(up, value); | ||
394 | } | ||
395 | #else | ||
396 | #define serial_dl_read(up) _serial_dl_read(up) | ||
397 | #define serial_dl_write(up, value) _serial_dl_write(up, value) | ||
398 | #endif | ||
365 | 399 | ||
366 | /* | 400 | /* |
367 | * For the 16C950 | 401 | * For the 16C950 |
@@ -494,7 +528,8 @@ static void disable_rsa(struct uart_8250_port *up) | |||
494 | */ | 528 | */ |
495 | static int size_fifo(struct uart_8250_port *up) | 529 | static int size_fifo(struct uart_8250_port *up) |
496 | { | 530 | { |
497 | unsigned char old_fcr, old_mcr, old_dll, old_dlm, old_lcr; | 531 | unsigned char old_fcr, old_mcr, old_lcr; |
532 | unsigned short old_dl; | ||
498 | int count; | 533 | int count; |
499 | 534 | ||
500 | old_lcr = serial_inp(up, UART_LCR); | 535 | old_lcr = serial_inp(up, UART_LCR); |
@@ -505,10 +540,8 @@ static int size_fifo(struct uart_8250_port *up) | |||
505 | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); | 540 | UART_FCR_CLEAR_RCVR | UART_FCR_CLEAR_XMIT); |
506 | serial_outp(up, UART_MCR, UART_MCR_LOOP); | 541 | serial_outp(up, UART_MCR, UART_MCR_LOOP); |
507 | serial_outp(up, UART_LCR, UART_LCR_DLAB); | 542 | serial_outp(up, UART_LCR, UART_LCR_DLAB); |
508 | old_dll = serial_inp(up, UART_DLL); | 543 | old_dl = serial_dl_read(up); |
509 | old_dlm = serial_inp(up, UART_DLM); | 544 | serial_dl_write(up, 0x0001); |
510 | serial_outp(up, UART_DLL, 0x01); | ||
511 | serial_outp(up, UART_DLM, 0x00); | ||
512 | serial_outp(up, UART_LCR, 0x03); | 545 | serial_outp(up, UART_LCR, 0x03); |
513 | for (count = 0; count < 256; count++) | 546 | for (count = 0; count < 256; count++) |
514 | serial_outp(up, UART_TX, count); | 547 | serial_outp(up, UART_TX, count); |
@@ -519,8 +552,7 @@ static int size_fifo(struct uart_8250_port *up) | |||
519 | serial_outp(up, UART_FCR, old_fcr); | 552 | serial_outp(up, UART_FCR, old_fcr); |
520 | serial_outp(up, UART_MCR, old_mcr); | 553 | serial_outp(up, UART_MCR, old_mcr); |
521 | serial_outp(up, UART_LCR, UART_LCR_DLAB); | 554 | serial_outp(up, UART_LCR, UART_LCR_DLAB); |
522 | serial_outp(up, UART_DLL, old_dll); | 555 | serial_dl_write(up, old_dl); |
523 | serial_outp(up, UART_DLM, old_dlm); | ||
524 | serial_outp(up, UART_LCR, old_lcr); | 556 | serial_outp(up, UART_LCR, old_lcr); |
525 | 557 | ||
526 | return count; | 558 | return count; |
@@ -750,8 +782,7 @@ static void autoconfig_16550a(struct uart_8250_port *up) | |||
750 | 782 | ||
751 | serial_outp(up, UART_LCR, 0xE0); | 783 | serial_outp(up, UART_LCR, 0xE0); |
752 | 784 | ||
753 | quot = serial_inp(up, UART_DLM) << 8; | 785 | quot = serial_dl_read(up); |
754 | quot += serial_inp(up, UART_DLL); | ||
755 | quot <<= 3; | 786 | quot <<= 3; |
756 | 787 | ||
757 | status1 = serial_in(up, 0x04); /* EXCR1 */ | 788 | status1 = serial_in(up, 0x04); /* EXCR1 */ |
@@ -759,8 +790,7 @@ static void autoconfig_16550a(struct uart_8250_port *up) | |||
759 | status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ | 790 | status1 |= 0x10; /* 1.625 divisor for baud_base --> 921600 */ |
760 | serial_outp(up, 0x04, status1); | 791 | serial_outp(up, 0x04, status1); |
761 | 792 | ||
762 | serial_outp(up, UART_DLL, quot & 0xff); | 793 | serial_dl_write(up, quot); |
763 | serial_outp(up, UART_DLM, quot >> 8); | ||
764 | 794 | ||
765 | serial_outp(up, UART_LCR, 0); | 795 | serial_outp(up, UART_LCR, 0); |
766 | 796 | ||
@@ -1862,8 +1892,7 @@ serial8250_set_termios(struct uart_port *port, struct termios *termios, | |||
1862 | serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ | 1892 | serial_outp(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ |
1863 | } | 1893 | } |
1864 | 1894 | ||
1865 | serial_outp(up, UART_DLL, quot & 0xff); /* LS of divisor */ | 1895 | serial_dl_write(up, quot); |
1866 | serial_outp(up, UART_DLM, quot >> 8); /* MS of divisor */ | ||
1867 | 1896 | ||
1868 | /* | 1897 | /* |
1869 | * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR | 1898 | * LCR DLAB must be set to enable 64-byte FIFO mode. If the FCR |
@@ -1906,6 +1935,9 @@ static int serial8250_request_std_resource(struct uart_8250_port *up) | |||
1906 | int ret = 0; | 1935 | int ret = 0; |
1907 | 1936 | ||
1908 | switch (up->port.iotype) { | 1937 | switch (up->port.iotype) { |
1938 | case UPIO_AU: | ||
1939 | size = 0x100000; | ||
1940 | /* fall thru */ | ||
1909 | case UPIO_MEM: | 1941 | case UPIO_MEM: |
1910 | if (!up->port.mapbase) | 1942 | if (!up->port.mapbase) |
1911 | break; | 1943 | break; |
@@ -1938,6 +1970,9 @@ static void serial8250_release_std_resource(struct uart_8250_port *up) | |||
1938 | unsigned int size = 8 << up->port.regshift; | 1970 | unsigned int size = 8 << up->port.regshift; |
1939 | 1971 | ||
1940 | switch (up->port.iotype) { | 1972 | switch (up->port.iotype) { |
1973 | case UPIO_AU: | ||
1974 | size = 0x100000; | ||
1975 | /* fall thru */ | ||
1941 | case UPIO_MEM: | 1976 | case UPIO_MEM: |
1942 | if (!up->port.mapbase) | 1977 | if (!up->port.mapbase) |
1943 | break; | 1978 | break; |
@@ -2200,10 +2235,17 @@ static void | |||
2200 | serial8250_console_write(struct console *co, const char *s, unsigned int count) | 2235 | serial8250_console_write(struct console *co, const char *s, unsigned int count) |
2201 | { | 2236 | { |
2202 | struct uart_8250_port *up = &serial8250_ports[co->index]; | 2237 | struct uart_8250_port *up = &serial8250_ports[co->index]; |
2238 | unsigned long flags; | ||
2203 | unsigned int ier; | 2239 | unsigned int ier; |
2240 | int locked = 1; | ||
2204 | 2241 | ||
2205 | touch_nmi_watchdog(); | 2242 | touch_nmi_watchdog(); |
2206 | 2243 | ||
2244 | if (oops_in_progress) { | ||
2245 | locked = spin_trylock_irqsave(&up->port.lock, flags); | ||
2246 | } else | ||
2247 | spin_lock_irqsave(&up->port.lock, flags); | ||
2248 | |||
2207 | /* | 2249 | /* |
2208 | * First save the IER then disable the interrupts | 2250 | * First save the IER then disable the interrupts |
2209 | */ | 2251 | */ |
@@ -2221,8 +2263,10 @@ serial8250_console_write(struct console *co, const char *s, unsigned int count) | |||
2221 | * and restore the IER | 2263 | * and restore the IER |
2222 | */ | 2264 | */ |
2223 | wait_for_xmitr(up, BOTH_EMPTY); | 2265 | wait_for_xmitr(up, BOTH_EMPTY); |
2224 | up->ier |= UART_IER_THRI; | 2266 | serial_out(up, UART_IER, ier); |
2225 | serial_out(up, UART_IER, ier | UART_IER_THRI); | 2267 | |
2268 | if (locked) | ||
2269 | spin_unlock_irqrestore(&up->port.lock, flags); | ||
2226 | } | 2270 | } |
2227 | 2271 | ||
2228 | static int serial8250_console_setup(struct console *co, char *options) | 2272 | static int serial8250_console_setup(struct console *co, char *options) |
diff --git a/drivers/serial/8250_au1x00.c b/drivers/serial/8250_au1x00.c index 3d1bfd07208d..58015fd14be9 100644 --- a/drivers/serial/8250_au1x00.c +++ b/drivers/serial/8250_au1x00.c | |||
@@ -30,13 +30,12 @@ | |||
30 | { \ | 30 | { \ |
31 | .iobase = _base, \ | 31 | .iobase = _base, \ |
32 | .membase = (void __iomem *)_base,\ | 32 | .membase = (void __iomem *)_base,\ |
33 | .mapbase = _base, \ | 33 | .mapbase = CPHYSADDR(_base), \ |
34 | .irq = _irq, \ | 34 | .irq = _irq, \ |
35 | .uartclk = 0, /* filled */ \ | 35 | .uartclk = 0, /* filled */ \ |
36 | .regshift = 2, \ | 36 | .regshift = 2, \ |
37 | .iotype = UPIO_AU, \ | 37 | .iotype = UPIO_AU, \ |
38 | .flags = UPF_SKIP_TEST | \ | 38 | .flags = UPF_SKIP_TEST \ |
39 | UPF_IOREMAP, \ | ||
40 | } | 39 | } |
41 | 40 | ||
42 | static struct plat_serial8250_port au1x00_data[] = { | 41 | static struct plat_serial8250_port au1x00_data[] = { |
diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index fcd7744c4253..17839e753e4c 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c | |||
@@ -1500,20 +1500,18 @@ uart_block_til_ready(struct file *filp, struct uart_state *state) | |||
1500 | static struct uart_state *uart_get(struct uart_driver *drv, int line) | 1500 | static struct uart_state *uart_get(struct uart_driver *drv, int line) |
1501 | { | 1501 | { |
1502 | struct uart_state *state; | 1502 | struct uart_state *state; |
1503 | int ret = 0; | ||
1503 | 1504 | ||
1504 | mutex_lock(&port_mutex); | ||
1505 | state = drv->state + line; | 1505 | state = drv->state + line; |
1506 | if (mutex_lock_interruptible(&state->mutex)) { | 1506 | if (mutex_lock_interruptible(&state->mutex)) { |
1507 | state = ERR_PTR(-ERESTARTSYS); | 1507 | ret = -ERESTARTSYS; |
1508 | goto out; | 1508 | goto err; |
1509 | } | 1509 | } |
1510 | 1510 | ||
1511 | state->count++; | 1511 | state->count++; |
1512 | if (!state->port) { | 1512 | if (!state->port || state->port->flags & UPF_DEAD) { |
1513 | state->count--; | 1513 | ret = -ENXIO; |
1514 | mutex_unlock(&state->mutex); | 1514 | goto err_unlock; |
1515 | state = ERR_PTR(-ENXIO); | ||
1516 | goto out; | ||
1517 | } | 1515 | } |
1518 | 1516 | ||
1519 | if (!state->info) { | 1517 | if (!state->info) { |
@@ -1531,15 +1529,17 @@ static struct uart_state *uart_get(struct uart_driver *drv, int line) | |||
1531 | tasklet_init(&state->info->tlet, uart_tasklet_action, | 1529 | tasklet_init(&state->info->tlet, uart_tasklet_action, |
1532 | (unsigned long)state); | 1530 | (unsigned long)state); |
1533 | } else { | 1531 | } else { |
1534 | state->count--; | 1532 | ret = -ENOMEM; |
1535 | mutex_unlock(&state->mutex); | 1533 | goto err_unlock; |
1536 | state = ERR_PTR(-ENOMEM); | ||
1537 | } | 1534 | } |
1538 | } | 1535 | } |
1539 | |||
1540 | out: | ||
1541 | mutex_unlock(&port_mutex); | ||
1542 | return state; | 1536 | return state; |
1537 | |||
1538 | err_unlock: | ||
1539 | state->count--; | ||
1540 | mutex_unlock(&state->mutex); | ||
1541 | err: | ||
1542 | return ERR_PTR(ret); | ||
1543 | } | 1543 | } |
1544 | 1544 | ||
1545 | /* | 1545 | /* |
@@ -1907,9 +1907,12 @@ uart_set_options(struct uart_port *port, struct console *co, | |||
1907 | static void uart_change_pm(struct uart_state *state, int pm_state) | 1907 | static void uart_change_pm(struct uart_state *state, int pm_state) |
1908 | { | 1908 | { |
1909 | struct uart_port *port = state->port; | 1909 | struct uart_port *port = state->port; |
1910 | if (port->ops->pm) | 1910 | |
1911 | port->ops->pm(port, pm_state, state->pm_state); | 1911 | if (state->pm_state != pm_state) { |
1912 | state->pm_state = pm_state; | 1912 | if (port->ops->pm) |
1913 | port->ops->pm(port, pm_state, state->pm_state); | ||
1914 | state->pm_state = pm_state; | ||
1915 | } | ||
1913 | } | 1916 | } |
1914 | 1917 | ||
1915 | int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) | 1918 | int uart_suspend_port(struct uart_driver *drv, struct uart_port *port) |
@@ -2085,45 +2088,6 @@ uart_configure_port(struct uart_driver *drv, struct uart_state *state, | |||
2085 | } | 2088 | } |
2086 | } | 2089 | } |
2087 | 2090 | ||
2088 | /* | ||
2089 | * This reverses the effects of uart_configure_port, hanging up the | ||
2090 | * port before removal. | ||
2091 | */ | ||
2092 | static void | ||
2093 | uart_unconfigure_port(struct uart_driver *drv, struct uart_state *state) | ||
2094 | { | ||
2095 | struct uart_port *port = state->port; | ||
2096 | struct uart_info *info = state->info; | ||
2097 | |||
2098 | if (info && info->tty) | ||
2099 | tty_vhangup(info->tty); | ||
2100 | |||
2101 | mutex_lock(&state->mutex); | ||
2102 | |||
2103 | state->info = NULL; | ||
2104 | |||
2105 | /* | ||
2106 | * Free the port IO and memory resources, if any. | ||
2107 | */ | ||
2108 | if (port->type != PORT_UNKNOWN) | ||
2109 | port->ops->release_port(port); | ||
2110 | |||
2111 | /* | ||
2112 | * Indicate that there isn't a port here anymore. | ||
2113 | */ | ||
2114 | port->type = PORT_UNKNOWN; | ||
2115 | |||
2116 | /* | ||
2117 | * Kill the tasklet, and free resources. | ||
2118 | */ | ||
2119 | if (info) { | ||
2120 | tasklet_kill(&info->tlet); | ||
2121 | kfree(info); | ||
2122 | } | ||
2123 | |||
2124 | mutex_unlock(&state->mutex); | ||
2125 | } | ||
2126 | |||
2127 | static struct tty_operations uart_ops = { | 2091 | static struct tty_operations uart_ops = { |
2128 | .open = uart_open, | 2092 | .open = uart_open, |
2129 | .close = uart_close, | 2093 | .close = uart_close, |
@@ -2270,6 +2234,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2270 | state = drv->state + port->line; | 2234 | state = drv->state + port->line; |
2271 | 2235 | ||
2272 | mutex_lock(&port_mutex); | 2236 | mutex_lock(&port_mutex); |
2237 | mutex_lock(&state->mutex); | ||
2273 | if (state->port) { | 2238 | if (state->port) { |
2274 | ret = -EINVAL; | 2239 | ret = -EINVAL; |
2275 | goto out; | 2240 | goto out; |
@@ -2304,7 +2269,13 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2304 | port->cons && !(port->cons->flags & CON_ENABLED)) | 2269 | port->cons && !(port->cons->flags & CON_ENABLED)) |
2305 | register_console(port->cons); | 2270 | register_console(port->cons); |
2306 | 2271 | ||
2272 | /* | ||
2273 | * Ensure UPF_DEAD is not set. | ||
2274 | */ | ||
2275 | port->flags &= ~UPF_DEAD; | ||
2276 | |||
2307 | out: | 2277 | out: |
2278 | mutex_unlock(&state->mutex); | ||
2308 | mutex_unlock(&port_mutex); | 2279 | mutex_unlock(&port_mutex); |
2309 | 2280 | ||
2310 | return ret; | 2281 | return ret; |
@@ -2322,6 +2293,7 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2322 | int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) | 2293 | int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) |
2323 | { | 2294 | { |
2324 | struct uart_state *state = drv->state + port->line; | 2295 | struct uart_state *state = drv->state + port->line; |
2296 | struct uart_info *info; | ||
2325 | 2297 | ||
2326 | BUG_ON(in_interrupt()); | 2298 | BUG_ON(in_interrupt()); |
2327 | 2299 | ||
@@ -2332,11 +2304,48 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *port) | |||
2332 | mutex_lock(&port_mutex); | 2304 | mutex_lock(&port_mutex); |
2333 | 2305 | ||
2334 | /* | 2306 | /* |
2307 | * Mark the port "dead" - this prevents any opens from | ||
2308 | * succeeding while we shut down the port. | ||
2309 | */ | ||
2310 | mutex_lock(&state->mutex); | ||
2311 | port->flags |= UPF_DEAD; | ||
2312 | mutex_unlock(&state->mutex); | ||
2313 | |||
2314 | /* | ||
2335 | * Remove the devices from devfs | 2315 | * Remove the devices from devfs |
2336 | */ | 2316 | */ |
2337 | tty_unregister_device(drv->tty_driver, port->line); | 2317 | tty_unregister_device(drv->tty_driver, port->line); |
2338 | 2318 | ||
2339 | uart_unconfigure_port(drv, state); | 2319 | info = state->info; |
2320 | if (info && info->tty) | ||
2321 | tty_vhangup(info->tty); | ||
2322 | |||
2323 | /* | ||
2324 | * All users of this port should now be disconnected from | ||
2325 | * this driver, and the port shut down. We should be the | ||
2326 | * only thread fiddling with this port from now on. | ||
2327 | */ | ||
2328 | state->info = NULL; | ||
2329 | |||
2330 | /* | ||
2331 | * Free the port IO and memory resources, if any. | ||
2332 | */ | ||
2333 | if (port->type != PORT_UNKNOWN) | ||
2334 | port->ops->release_port(port); | ||
2335 | |||
2336 | /* | ||
2337 | * Indicate that there isn't a port here anymore. | ||
2338 | */ | ||
2339 | port->type = PORT_UNKNOWN; | ||
2340 | |||
2341 | /* | ||
2342 | * Kill the tasklet, and free resources. | ||
2343 | */ | ||
2344 | if (info) { | ||
2345 | tasklet_kill(&info->tlet); | ||
2346 | kfree(info); | ||
2347 | } | ||
2348 | |||
2340 | state->port = NULL; | 2349 | state->port = NULL; |
2341 | mutex_unlock(&port_mutex); | 2350 | mutex_unlock(&port_mutex); |
2342 | 2351 | ||
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 1c4396c2962d..2b4f96541b8e 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c | |||
@@ -1730,3 +1730,4 @@ static void __exit sunsu_exit(void) | |||
1730 | 1730 | ||
1731 | module_init(sunsu_probe); | 1731 | module_init(sunsu_probe); |
1732 | module_exit(sunsu_exit); | 1732 | module_exit(sunsu_exit); |
1733 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig index 7a75faeb0526..23334c8bc4c7 100644 --- a/drivers/spi/Kconfig +++ b/drivers/spi/Kconfig | |||
@@ -75,11 +75,45 @@ config SPI_BUTTERFLY | |||
75 | inexpensive battery powered microcontroller evaluation board. | 75 | inexpensive battery powered microcontroller evaluation board. |
76 | This same cable can be used to flash new firmware. | 76 | This same cable can be used to flash new firmware. |
77 | 77 | ||
78 | config SPI_MPC83xx | ||
79 | tristate "Freescale MPC83xx SPI controller" | ||
80 | depends on SPI_MASTER && PPC_83xx && EXPERIMENTAL | ||
81 | select SPI_BITBANG | ||
82 | help | ||
83 | This enables using the Freescale MPC83xx SPI controller in master | ||
84 | mode. | ||
85 | |||
86 | Note, this driver uniquely supports the SPI controller on the MPC83xx | ||
87 | family of PowerPC processors. The MPC83xx uses a simple set of shift | ||
88 | registers for data (opposed to the CPM based descriptor model). | ||
89 | |||
90 | config SPI_PXA2XX | ||
91 | tristate "PXA2xx SSP SPI master" | ||
92 | depends on SPI_MASTER && ARCH_PXA && EXPERIMENTAL | ||
93 | help | ||
94 | This enables using a PXA2xx SSP port as a SPI master controller. | ||
95 | The driver can be configured to use any SSP port and additional | ||
96 | documentation can be found a Documentation/spi/pxa2xx. | ||
97 | |||
98 | config SPI_S3C24XX_GPIO | ||
99 | tristate "Samsung S3C24XX series SPI by GPIO" | ||
100 | depends on SPI_MASTER && ARCH_S3C2410 && SPI_BITBANG && EXPERIMENTAL | ||
101 | help | ||
102 | SPI driver for Samsung S3C24XX series ARM SoCs using | ||
103 | GPIO lines to provide the SPI bus. This can be used where | ||
104 | the inbuilt hardware cannot provide the transfer mode, or | ||
105 | where the board is using non hardware connected pins. | ||
78 | # | 106 | # |
79 | # Add new SPI master controllers in alphabetical order above this line | 107 | # Add new SPI master controllers in alphabetical order above this line |
80 | # | 108 | # |
81 | 109 | ||
82 | 110 | ||
111 | config SPI_S3C24XX | ||
112 | tristate "Samsung S3C24XX series SPI" | ||
113 | depends on SPI_MASTER && ARCH_S3C2410 && EXPERIMENTAL | ||
114 | help | ||
115 | SPI driver for Samsung S3C24XX series ARM SoCs | ||
116 | |||
83 | # | 117 | # |
84 | # There are lots of SPI device types, with sensors and memory | 118 | # There are lots of SPI device types, with sensors and memory |
85 | # being probably the most widely used ones. | 119 | # being probably the most widely used ones. |
diff --git a/drivers/spi/Makefile b/drivers/spi/Makefile index c2c87e845abf..8f4cb67997b3 100644 --- a/drivers/spi/Makefile +++ b/drivers/spi/Makefile | |||
@@ -13,6 +13,10 @@ obj-$(CONFIG_SPI_MASTER) += spi.o | |||
13 | # SPI master controller drivers (bus) | 13 | # SPI master controller drivers (bus) |
14 | obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o | 14 | obj-$(CONFIG_SPI_BITBANG) += spi_bitbang.o |
15 | obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o | 15 | obj-$(CONFIG_SPI_BUTTERFLY) += spi_butterfly.o |
16 | obj-$(CONFIG_SPI_PXA2XX) += pxa2xx_spi.o | ||
17 | obj-$(CONFIG_SPI_MPC83xx) += spi_mpc83xx.o | ||
18 | obj-$(CONFIG_SPI_S3C24XX_GPIO) += spi_s3c24xx_gpio.o | ||
19 | obj-$(CONFIG_SPI_S3C24XX) += spi_s3c24xx.o | ||
16 | # ... add above this line ... | 20 | # ... add above this line ... |
17 | 21 | ||
18 | # SPI protocol drivers (device/link on bus) | 22 | # SPI protocol drivers (device/link on bus) |
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c new file mode 100644 index 000000000000..29aec77f98be --- /dev/null +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -0,0 +1,1486 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #include <linux/init.h> | ||
20 | #include <linux/module.h> | ||
21 | #include <linux/device.h> | ||
22 | #include <linux/ioport.h> | ||
23 | #include <linux/errno.h> | ||
24 | #include <linux/interrupt.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | #include <linux/dma-mapping.h> | ||
27 | #include <linux/spi/spi.h> | ||
28 | #include <linux/workqueue.h> | ||
29 | #include <linux/errno.h> | ||
30 | #include <linux/delay.h> | ||
31 | |||
32 | #include <asm/io.h> | ||
33 | #include <asm/irq.h> | ||
34 | #include <asm/hardware.h> | ||
35 | #include <asm/delay.h> | ||
36 | #include <asm/dma.h> | ||
37 | |||
38 | #include <asm/arch/hardware.h> | ||
39 | #include <asm/arch/pxa-regs.h> | ||
40 | #include <asm/arch/pxa2xx_spi.h> | ||
41 | |||
42 | MODULE_AUTHOR("Stephen Street"); | ||
43 | MODULE_DESCRIPTION("PXA2xx SSP SPI Contoller"); | ||
44 | MODULE_LICENSE("GPL"); | ||
45 | |||
46 | #define MAX_BUSES 3 | ||
47 | |||
48 | #define DMA_INT_MASK (DCSR_ENDINTR | DCSR_STARTINTR | DCSR_BUSERR) | ||
49 | #define RESET_DMA_CHANNEL (DCSR_NODESC | DMA_INT_MASK) | ||
50 | #define IS_DMA_ALIGNED(x) (((u32)(x)&0x07)==0) | ||
51 | |||
52 | #define DEFINE_SSP_REG(reg, off) \ | ||
53 | static inline u32 read_##reg(void *p) { return __raw_readl(p + (off)); } \ | ||
54 | static inline void write_##reg(u32 v, void *p) { __raw_writel(v, p + (off)); } | ||
55 | |||
56 | DEFINE_SSP_REG(SSCR0, 0x00) | ||
57 | DEFINE_SSP_REG(SSCR1, 0x04) | ||
58 | DEFINE_SSP_REG(SSSR, 0x08) | ||
59 | DEFINE_SSP_REG(SSITR, 0x0c) | ||
60 | DEFINE_SSP_REG(SSDR, 0x10) | ||
61 | DEFINE_SSP_REG(SSTO, 0x28) | ||
62 | DEFINE_SSP_REG(SSPSP, 0x2c) | ||
63 | |||
64 | #define START_STATE ((void*)0) | ||
65 | #define RUNNING_STATE ((void*)1) | ||
66 | #define DONE_STATE ((void*)2) | ||
67 | #define ERROR_STATE ((void*)-1) | ||
68 | |||
69 | #define QUEUE_RUNNING 0 | ||
70 | #define QUEUE_STOPPED 1 | ||
71 | |||
72 | struct driver_data { | ||
73 | /* Driver model hookup */ | ||
74 | struct platform_device *pdev; | ||
75 | |||
76 | /* SPI framework hookup */ | ||
77 | enum pxa_ssp_type ssp_type; | ||
78 | struct spi_master *master; | ||
79 | |||
80 | /* PXA hookup */ | ||
81 | struct pxa2xx_spi_master *master_info; | ||
82 | |||
83 | /* DMA setup stuff */ | ||
84 | int rx_channel; | ||
85 | int tx_channel; | ||
86 | u32 *null_dma_buf; | ||
87 | |||
88 | /* SSP register addresses */ | ||
89 | void *ioaddr; | ||
90 | u32 ssdr_physical; | ||
91 | |||
92 | /* SSP masks*/ | ||
93 | u32 dma_cr1; | ||
94 | u32 int_cr1; | ||
95 | u32 clear_sr; | ||
96 | u32 mask_sr; | ||
97 | |||
98 | /* Driver message queue */ | ||
99 | struct workqueue_struct *workqueue; | ||
100 | struct work_struct pump_messages; | ||
101 | spinlock_t lock; | ||
102 | struct list_head queue; | ||
103 | int busy; | ||
104 | int run; | ||
105 | |||
106 | /* Message Transfer pump */ | ||
107 | struct tasklet_struct pump_transfers; | ||
108 | |||
109 | /* Current message transfer state info */ | ||
110 | struct spi_message* cur_msg; | ||
111 | struct spi_transfer* cur_transfer; | ||
112 | struct chip_data *cur_chip; | ||
113 | size_t len; | ||
114 | void *tx; | ||
115 | void *tx_end; | ||
116 | void *rx; | ||
117 | void *rx_end; | ||
118 | int dma_mapped; | ||
119 | dma_addr_t rx_dma; | ||
120 | dma_addr_t tx_dma; | ||
121 | size_t rx_map_len; | ||
122 | size_t tx_map_len; | ||
123 | u8 n_bytes; | ||
124 | u32 dma_width; | ||
125 | int cs_change; | ||
126 | void (*write)(struct driver_data *drv_data); | ||
127 | void (*read)(struct driver_data *drv_data); | ||
128 | irqreturn_t (*transfer_handler)(struct driver_data *drv_data); | ||
129 | void (*cs_control)(u32 command); | ||
130 | }; | ||
131 | |||
132 | struct chip_data { | ||
133 | u32 cr0; | ||
134 | u32 cr1; | ||
135 | u32 to; | ||
136 | u32 psp; | ||
137 | u32 timeout; | ||
138 | u8 n_bytes; | ||
139 | u32 dma_width; | ||
140 | u32 dma_burst_size; | ||
141 | u32 threshold; | ||
142 | u32 dma_threshold; | ||
143 | u8 enable_dma; | ||
144 | u8 bits_per_word; | ||
145 | u32 speed_hz; | ||
146 | void (*write)(struct driver_data *drv_data); | ||
147 | void (*read)(struct driver_data *drv_data); | ||
148 | void (*cs_control)(u32 command); | ||
149 | }; | ||
150 | |||
151 | static void pump_messages(void *data); | ||
152 | |||
153 | static int flush(struct driver_data *drv_data) | ||
154 | { | ||
155 | unsigned long limit = loops_per_jiffy << 1; | ||
156 | |||
157 | void *reg = drv_data->ioaddr; | ||
158 | |||
159 | do { | ||
160 | while (read_SSSR(reg) & SSSR_RNE) { | ||
161 | read_SSDR(reg); | ||
162 | } | ||
163 | } while ((read_SSSR(reg) & SSSR_BSY) && limit--); | ||
164 | write_SSSR(SSSR_ROR, reg); | ||
165 | |||
166 | return limit; | ||
167 | } | ||
168 | |||
169 | static void restore_state(struct driver_data *drv_data) | ||
170 | { | ||
171 | void *reg = drv_data->ioaddr; | ||
172 | |||
173 | /* Clear status and disable clock */ | ||
174 | write_SSSR(drv_data->clear_sr, reg); | ||
175 | write_SSCR0(drv_data->cur_chip->cr0 & ~SSCR0_SSE, reg); | ||
176 | |||
177 | /* Load the registers */ | ||
178 | write_SSCR1(drv_data->cur_chip->cr1, reg); | ||
179 | write_SSCR0(drv_data->cur_chip->cr0, reg); | ||
180 | if (drv_data->ssp_type != PXA25x_SSP) { | ||
181 | write_SSTO(0, reg); | ||
182 | write_SSPSP(drv_data->cur_chip->psp, reg); | ||
183 | } | ||
184 | } | ||
185 | |||
186 | static void null_cs_control(u32 command) | ||
187 | { | ||
188 | } | ||
189 | |||
190 | static void null_writer(struct driver_data *drv_data) | ||
191 | { | ||
192 | void *reg = drv_data->ioaddr; | ||
193 | u8 n_bytes = drv_data->n_bytes; | ||
194 | |||
195 | while ((read_SSSR(reg) & SSSR_TNF) | ||
196 | && (drv_data->tx < drv_data->tx_end)) { | ||
197 | write_SSDR(0, reg); | ||
198 | drv_data->tx += n_bytes; | ||
199 | } | ||
200 | } | ||
201 | |||
202 | static void null_reader(struct driver_data *drv_data) | ||
203 | { | ||
204 | void *reg = drv_data->ioaddr; | ||
205 | u8 n_bytes = drv_data->n_bytes; | ||
206 | |||
207 | while ((read_SSSR(reg) & SSSR_RNE) | ||
208 | && (drv_data->rx < drv_data->rx_end)) { | ||
209 | read_SSDR(reg); | ||
210 | drv_data->rx += n_bytes; | ||
211 | } | ||
212 | } | ||
213 | |||
214 | static void u8_writer(struct driver_data *drv_data) | ||
215 | { | ||
216 | void *reg = drv_data->ioaddr; | ||
217 | |||
218 | while ((read_SSSR(reg) & SSSR_TNF) | ||
219 | && (drv_data->tx < drv_data->tx_end)) { | ||
220 | write_SSDR(*(u8 *)(drv_data->tx), reg); | ||
221 | ++drv_data->tx; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | static void u8_reader(struct driver_data *drv_data) | ||
226 | { | ||
227 | void *reg = drv_data->ioaddr; | ||
228 | |||
229 | while ((read_SSSR(reg) & SSSR_RNE) | ||
230 | && (drv_data->rx < drv_data->rx_end)) { | ||
231 | *(u8 *)(drv_data->rx) = read_SSDR(reg); | ||
232 | ++drv_data->rx; | ||
233 | } | ||
234 | } | ||
235 | |||
236 | static void u16_writer(struct driver_data *drv_data) | ||
237 | { | ||
238 | void *reg = drv_data->ioaddr; | ||
239 | |||
240 | while ((read_SSSR(reg) & SSSR_TNF) | ||
241 | && (drv_data->tx < drv_data->tx_end)) { | ||
242 | write_SSDR(*(u16 *)(drv_data->tx), reg); | ||
243 | drv_data->tx += 2; | ||
244 | } | ||
245 | } | ||
246 | |||
247 | static void u16_reader(struct driver_data *drv_data) | ||
248 | { | ||
249 | void *reg = drv_data->ioaddr; | ||
250 | |||
251 | while ((read_SSSR(reg) & SSSR_RNE) | ||
252 | && (drv_data->rx < drv_data->rx_end)) { | ||
253 | *(u16 *)(drv_data->rx) = read_SSDR(reg); | ||
254 | drv_data->rx += 2; | ||
255 | } | ||
256 | } | ||
257 | static void u32_writer(struct driver_data *drv_data) | ||
258 | { | ||
259 | void *reg = drv_data->ioaddr; | ||
260 | |||
261 | while ((read_SSSR(reg) & SSSR_TNF) | ||
262 | && (drv_data->tx < drv_data->tx_end)) { | ||
263 | write_SSDR(*(u32 *)(drv_data->tx), reg); | ||
264 | drv_data->tx += 4; | ||
265 | } | ||
266 | } | ||
267 | |||
268 | static void u32_reader(struct driver_data *drv_data) | ||
269 | { | ||
270 | void *reg = drv_data->ioaddr; | ||
271 | |||
272 | while ((read_SSSR(reg) & SSSR_RNE) | ||
273 | && (drv_data->rx < drv_data->rx_end)) { | ||
274 | *(u32 *)(drv_data->rx) = read_SSDR(reg); | ||
275 | drv_data->rx += 4; | ||
276 | } | ||
277 | } | ||
278 | |||
279 | static void *next_transfer(struct driver_data *drv_data) | ||
280 | { | ||
281 | struct spi_message *msg = drv_data->cur_msg; | ||
282 | struct spi_transfer *trans = drv_data->cur_transfer; | ||
283 | |||
284 | /* Move to next transfer */ | ||
285 | if (trans->transfer_list.next != &msg->transfers) { | ||
286 | drv_data->cur_transfer = | ||
287 | list_entry(trans->transfer_list.next, | ||
288 | struct spi_transfer, | ||
289 | transfer_list); | ||
290 | return RUNNING_STATE; | ||
291 | } else | ||
292 | return DONE_STATE; | ||
293 | } | ||
294 | |||
295 | static int map_dma_buffers(struct driver_data *drv_data) | ||
296 | { | ||
297 | struct spi_message *msg = drv_data->cur_msg; | ||
298 | struct device *dev = &msg->spi->dev; | ||
299 | |||
300 | if (!drv_data->cur_chip->enable_dma) | ||
301 | return 0; | ||
302 | |||
303 | if (msg->is_dma_mapped) | ||
304 | return drv_data->rx_dma && drv_data->tx_dma; | ||
305 | |||
306 | if (!IS_DMA_ALIGNED(drv_data->rx) || !IS_DMA_ALIGNED(drv_data->tx)) | ||
307 | return 0; | ||
308 | |||
309 | /* Modify setup if rx buffer is null */ | ||
310 | if (drv_data->rx == NULL) { | ||
311 | *drv_data->null_dma_buf = 0; | ||
312 | drv_data->rx = drv_data->null_dma_buf; | ||
313 | drv_data->rx_map_len = 4; | ||
314 | } else | ||
315 | drv_data->rx_map_len = drv_data->len; | ||
316 | |||
317 | |||
318 | /* Modify setup if tx buffer is null */ | ||
319 | if (drv_data->tx == NULL) { | ||
320 | *drv_data->null_dma_buf = 0; | ||
321 | drv_data->tx = drv_data->null_dma_buf; | ||
322 | drv_data->tx_map_len = 4; | ||
323 | } else | ||
324 | drv_data->tx_map_len = drv_data->len; | ||
325 | |||
326 | /* Stream map the rx buffer */ | ||
327 | drv_data->rx_dma = dma_map_single(dev, drv_data->rx, | ||
328 | drv_data->rx_map_len, | ||
329 | DMA_FROM_DEVICE); | ||
330 | if (dma_mapping_error(drv_data->rx_dma)) | ||
331 | return 0; | ||
332 | |||
333 | /* Stream map the tx buffer */ | ||
334 | drv_data->tx_dma = dma_map_single(dev, drv_data->tx, | ||
335 | drv_data->tx_map_len, | ||
336 | DMA_TO_DEVICE); | ||
337 | |||
338 | if (dma_mapping_error(drv_data->tx_dma)) { | ||
339 | dma_unmap_single(dev, drv_data->rx_dma, | ||
340 | drv_data->rx_map_len, DMA_FROM_DEVICE); | ||
341 | return 0; | ||
342 | } | ||
343 | |||
344 | return 1; | ||
345 | } | ||
346 | |||
347 | static void unmap_dma_buffers(struct driver_data *drv_data) | ||
348 | { | ||
349 | struct device *dev; | ||
350 | |||
351 | if (!drv_data->dma_mapped) | ||
352 | return; | ||
353 | |||
354 | if (!drv_data->cur_msg->is_dma_mapped) { | ||
355 | dev = &drv_data->cur_msg->spi->dev; | ||
356 | dma_unmap_single(dev, drv_data->rx_dma, | ||
357 | drv_data->rx_map_len, DMA_FROM_DEVICE); | ||
358 | dma_unmap_single(dev, drv_data->tx_dma, | ||
359 | drv_data->tx_map_len, DMA_TO_DEVICE); | ||
360 | } | ||
361 | |||
362 | drv_data->dma_mapped = 0; | ||
363 | } | ||
364 | |||
365 | /* caller already set message->status; dma and pio irqs are blocked */ | ||
366 | static void giveback(struct driver_data *drv_data) | ||
367 | { | ||
368 | struct spi_transfer* last_transfer; | ||
369 | unsigned long flags; | ||
370 | struct spi_message *msg; | ||
371 | |||
372 | spin_lock_irqsave(&drv_data->lock, flags); | ||
373 | msg = drv_data->cur_msg; | ||
374 | drv_data->cur_msg = NULL; | ||
375 | drv_data->cur_transfer = NULL; | ||
376 | drv_data->cur_chip = NULL; | ||
377 | queue_work(drv_data->workqueue, &drv_data->pump_messages); | ||
378 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
379 | |||
380 | last_transfer = list_entry(msg->transfers.prev, | ||
381 | struct spi_transfer, | ||
382 | transfer_list); | ||
383 | |||
384 | if (!last_transfer->cs_change) | ||
385 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
386 | |||
387 | msg->state = NULL; | ||
388 | if (msg->complete) | ||
389 | msg->complete(msg->context); | ||
390 | } | ||
391 | |||
392 | static int wait_ssp_rx_stall(void *ioaddr) | ||
393 | { | ||
394 | unsigned long limit = loops_per_jiffy << 1; | ||
395 | |||
396 | while ((read_SSSR(ioaddr) & SSSR_BSY) && limit--) | ||
397 | cpu_relax(); | ||
398 | |||
399 | return limit; | ||
400 | } | ||
401 | |||
402 | static int wait_dma_channel_stop(int channel) | ||
403 | { | ||
404 | unsigned long limit = loops_per_jiffy << 1; | ||
405 | |||
406 | while (!(DCSR(channel) & DCSR_STOPSTATE) && limit--) | ||
407 | cpu_relax(); | ||
408 | |||
409 | return limit; | ||
410 | } | ||
411 | |||
412 | static void dma_handler(int channel, void *data, struct pt_regs *regs) | ||
413 | { | ||
414 | struct driver_data *drv_data = data; | ||
415 | struct spi_message *msg = drv_data->cur_msg; | ||
416 | void *reg = drv_data->ioaddr; | ||
417 | u32 irq_status = DCSR(channel) & DMA_INT_MASK; | ||
418 | u32 trailing_sssr = 0; | ||
419 | |||
420 | if (irq_status & DCSR_BUSERR) { | ||
421 | |||
422 | /* Disable interrupts, clear status and reset DMA */ | ||
423 | write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg); | ||
424 | write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg); | ||
425 | if (drv_data->ssp_type != PXA25x_SSP) | ||
426 | write_SSTO(0, reg); | ||
427 | write_SSSR(drv_data->clear_sr, reg); | ||
428 | DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL; | ||
429 | DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL; | ||
430 | |||
431 | if (flush(drv_data) == 0) | ||
432 | dev_err(&drv_data->pdev->dev, | ||
433 | "dma_handler: flush fail\n"); | ||
434 | |||
435 | unmap_dma_buffers(drv_data); | ||
436 | |||
437 | if (channel == drv_data->tx_channel) | ||
438 | dev_err(&drv_data->pdev->dev, | ||
439 | "dma_handler: bad bus address on " | ||
440 | "tx channel %d, source %x target = %x\n", | ||
441 | channel, DSADR(channel), DTADR(channel)); | ||
442 | else | ||
443 | dev_err(&drv_data->pdev->dev, | ||
444 | "dma_handler: bad bus address on " | ||
445 | "rx channel %d, source %x target = %x\n", | ||
446 | channel, DSADR(channel), DTADR(channel)); | ||
447 | |||
448 | msg->state = ERROR_STATE; | ||
449 | tasklet_schedule(&drv_data->pump_transfers); | ||
450 | } | ||
451 | |||
452 | /* PXA255x_SSP has no timeout interrupt, wait for tailing bytes */ | ||
453 | if ((drv_data->ssp_type == PXA25x_SSP) | ||
454 | && (channel == drv_data->tx_channel) | ||
455 | && (irq_status & DCSR_ENDINTR)) { | ||
456 | |||
457 | /* Wait for rx to stall */ | ||
458 | if (wait_ssp_rx_stall(drv_data->ioaddr) == 0) | ||
459 | dev_err(&drv_data->pdev->dev, | ||
460 | "dma_handler: ssp rx stall failed\n"); | ||
461 | |||
462 | /* Clear and disable interrupts on SSP and DMA channels*/ | ||
463 | write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg); | ||
464 | write_SSSR(drv_data->clear_sr, reg); | ||
465 | DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL; | ||
466 | DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL; | ||
467 | if (wait_dma_channel_stop(drv_data->rx_channel) == 0) | ||
468 | dev_err(&drv_data->pdev->dev, | ||
469 | "dma_handler: dma rx channel stop failed\n"); | ||
470 | |||
471 | unmap_dma_buffers(drv_data); | ||
472 | |||
473 | /* Read trailing bytes */ | ||
474 | /* Calculate number of trailing bytes, read them */ | ||
475 | trailing_sssr = read_SSSR(reg); | ||
476 | if ((trailing_sssr & 0xf008) != 0xf000) { | ||
477 | drv_data->rx = drv_data->rx_end - | ||
478 | (((trailing_sssr >> 12) & 0x0f) + 1); | ||
479 | drv_data->read(drv_data); | ||
480 | } | ||
481 | msg->actual_length += drv_data->len; | ||
482 | |||
483 | /* Release chip select if requested, transfer delays are | ||
484 | * handled in pump_transfers */ | ||
485 | if (drv_data->cs_change) | ||
486 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
487 | |||
488 | /* Move to next transfer */ | ||
489 | msg->state = next_transfer(drv_data); | ||
490 | |||
491 | /* Schedule transfer tasklet */ | ||
492 | tasklet_schedule(&drv_data->pump_transfers); | ||
493 | } | ||
494 | } | ||
495 | |||
496 | static irqreturn_t dma_transfer(struct driver_data *drv_data) | ||
497 | { | ||
498 | u32 irq_status; | ||
499 | u32 trailing_sssr = 0; | ||
500 | struct spi_message *msg = drv_data->cur_msg; | ||
501 | void *reg = drv_data->ioaddr; | ||
502 | |||
503 | irq_status = read_SSSR(reg) & drv_data->mask_sr; | ||
504 | if (irq_status & SSSR_ROR) { | ||
505 | /* Clear and disable interrupts on SSP and DMA channels*/ | ||
506 | write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg); | ||
507 | write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg); | ||
508 | if (drv_data->ssp_type != PXA25x_SSP) | ||
509 | write_SSTO(0, reg); | ||
510 | write_SSSR(drv_data->clear_sr, reg); | ||
511 | DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL; | ||
512 | DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL; | ||
513 | unmap_dma_buffers(drv_data); | ||
514 | |||
515 | if (flush(drv_data) == 0) | ||
516 | dev_err(&drv_data->pdev->dev, | ||
517 | "dma_transfer: flush fail\n"); | ||
518 | |||
519 | dev_warn(&drv_data->pdev->dev, "dma_transfer: fifo overun\n"); | ||
520 | |||
521 | drv_data->cur_msg->state = ERROR_STATE; | ||
522 | tasklet_schedule(&drv_data->pump_transfers); | ||
523 | |||
524 | return IRQ_HANDLED; | ||
525 | } | ||
526 | |||
527 | /* Check for false positive timeout */ | ||
528 | if ((irq_status & SSSR_TINT) && DCSR(drv_data->tx_channel) & DCSR_RUN) { | ||
529 | write_SSSR(SSSR_TINT, reg); | ||
530 | return IRQ_HANDLED; | ||
531 | } | ||
532 | |||
533 | if (irq_status & SSSR_TINT || drv_data->rx == drv_data->rx_end) { | ||
534 | |||
535 | /* Clear and disable interrupts on SSP and DMA channels*/ | ||
536 | write_SSCR1(read_SSCR1(reg) & ~drv_data->dma_cr1, reg); | ||
537 | if (drv_data->ssp_type != PXA25x_SSP) | ||
538 | write_SSTO(0, reg); | ||
539 | write_SSSR(drv_data->clear_sr, reg); | ||
540 | DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL; | ||
541 | DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL; | ||
542 | |||
543 | if (wait_dma_channel_stop(drv_data->rx_channel) == 0) | ||
544 | dev_err(&drv_data->pdev->dev, | ||
545 | "dma_transfer: dma rx channel stop failed\n"); | ||
546 | |||
547 | if (wait_ssp_rx_stall(drv_data->ioaddr) == 0) | ||
548 | dev_err(&drv_data->pdev->dev, | ||
549 | "dma_transfer: ssp rx stall failed\n"); | ||
550 | |||
551 | unmap_dma_buffers(drv_data); | ||
552 | |||
553 | /* Calculate number of trailing bytes, read them */ | ||
554 | trailing_sssr = read_SSSR(reg); | ||
555 | if ((trailing_sssr & 0xf008) != 0xf000) { | ||
556 | drv_data->rx = drv_data->rx_end - | ||
557 | (((trailing_sssr >> 12) & 0x0f) + 1); | ||
558 | drv_data->read(drv_data); | ||
559 | } | ||
560 | msg->actual_length += drv_data->len; | ||
561 | |||
562 | /* Release chip select if requested, transfer delays are | ||
563 | * handled in pump_transfers */ | ||
564 | if (drv_data->cs_change) | ||
565 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
566 | |||
567 | /* Move to next transfer */ | ||
568 | msg->state = next_transfer(drv_data); | ||
569 | |||
570 | /* Schedule transfer tasklet */ | ||
571 | tasklet_schedule(&drv_data->pump_transfers); | ||
572 | |||
573 | return IRQ_HANDLED; | ||
574 | } | ||
575 | |||
576 | /* Opps problem detected */ | ||
577 | return IRQ_NONE; | ||
578 | } | ||
579 | |||
580 | static irqreturn_t interrupt_transfer(struct driver_data *drv_data) | ||
581 | { | ||
582 | struct spi_message *msg = drv_data->cur_msg; | ||
583 | void *reg = drv_data->ioaddr; | ||
584 | unsigned long limit = loops_per_jiffy << 1; | ||
585 | u32 irq_status; | ||
586 | u32 irq_mask = (read_SSCR1(reg) & SSCR1_TIE) ? | ||
587 | drv_data->mask_sr : drv_data->mask_sr & ~SSSR_TFS; | ||
588 | |||
589 | while ((irq_status = read_SSSR(reg) & irq_mask)) { | ||
590 | |||
591 | if (irq_status & SSSR_ROR) { | ||
592 | |||
593 | /* Clear and disable interrupts */ | ||
594 | write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg); | ||
595 | write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg); | ||
596 | if (drv_data->ssp_type != PXA25x_SSP) | ||
597 | write_SSTO(0, reg); | ||
598 | write_SSSR(drv_data->clear_sr, reg); | ||
599 | |||
600 | if (flush(drv_data) == 0) | ||
601 | dev_err(&drv_data->pdev->dev, | ||
602 | "interrupt_transfer: flush fail\n"); | ||
603 | |||
604 | /* Stop the SSP */ | ||
605 | |||
606 | dev_warn(&drv_data->pdev->dev, | ||
607 | "interrupt_transfer: fifo overun\n"); | ||
608 | |||
609 | msg->state = ERROR_STATE; | ||
610 | tasklet_schedule(&drv_data->pump_transfers); | ||
611 | |||
612 | return IRQ_HANDLED; | ||
613 | } | ||
614 | |||
615 | /* Look for false positive timeout */ | ||
616 | if ((irq_status & SSSR_TINT) | ||
617 | && (drv_data->rx < drv_data->rx_end)) | ||
618 | write_SSSR(SSSR_TINT, reg); | ||
619 | |||
620 | /* Pump data */ | ||
621 | drv_data->read(drv_data); | ||
622 | drv_data->write(drv_data); | ||
623 | |||
624 | if (drv_data->tx == drv_data->tx_end) { | ||
625 | /* Disable tx interrupt */ | ||
626 | write_SSCR1(read_SSCR1(reg) & ~SSCR1_TIE, reg); | ||
627 | irq_mask = drv_data->mask_sr & ~SSSR_TFS; | ||
628 | |||
629 | /* PXA25x_SSP has no timeout, read trailing bytes */ | ||
630 | if (drv_data->ssp_type == PXA25x_SSP) { | ||
631 | while ((read_SSSR(reg) & SSSR_BSY) && limit--) | ||
632 | drv_data->read(drv_data); | ||
633 | |||
634 | if (limit == 0) | ||
635 | dev_err(&drv_data->pdev->dev, | ||
636 | "interrupt_transfer: " | ||
637 | "trailing byte read failed\n"); | ||
638 | } | ||
639 | } | ||
640 | |||
641 | if ((irq_status & SSSR_TINT) | ||
642 | || (drv_data->rx == drv_data->rx_end)) { | ||
643 | |||
644 | /* Clear timeout */ | ||
645 | write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg); | ||
646 | if (drv_data->ssp_type != PXA25x_SSP) | ||
647 | write_SSTO(0, reg); | ||
648 | write_SSSR(drv_data->clear_sr, reg); | ||
649 | |||
650 | /* Update total byte transfered */ | ||
651 | msg->actual_length += drv_data->len; | ||
652 | |||
653 | /* Release chip select if requested, transfer delays are | ||
654 | * handled in pump_transfers */ | ||
655 | if (drv_data->cs_change) | ||
656 | drv_data->cs_control(PXA2XX_CS_DEASSERT); | ||
657 | |||
658 | /* Move to next transfer */ | ||
659 | msg->state = next_transfer(drv_data); | ||
660 | |||
661 | /* Schedule transfer tasklet */ | ||
662 | tasklet_schedule(&drv_data->pump_transfers); | ||
663 | } | ||
664 | } | ||
665 | |||
666 | /* We did something */ | ||
667 | return IRQ_HANDLED; | ||
668 | } | ||
669 | |||
670 | static irqreturn_t ssp_int(int irq, void *dev_id, struct pt_regs *regs) | ||
671 | { | ||
672 | struct driver_data *drv_data = (struct driver_data *)dev_id; | ||
673 | void *reg = drv_data->ioaddr; | ||
674 | |||
675 | if (!drv_data->cur_msg) { | ||
676 | |||
677 | write_SSCR0(read_SSCR0(reg) & ~SSCR0_SSE, reg); | ||
678 | write_SSCR1(read_SSCR1(reg) & ~drv_data->int_cr1, reg); | ||
679 | if (drv_data->ssp_type != PXA25x_SSP) | ||
680 | write_SSTO(0, reg); | ||
681 | write_SSSR(drv_data->clear_sr, reg); | ||
682 | |||
683 | dev_err(&drv_data->pdev->dev, "bad message state " | ||
684 | "in interrupt handler"); | ||
685 | |||
686 | /* Never fail */ | ||
687 | return IRQ_HANDLED; | ||
688 | } | ||
689 | |||
690 | return drv_data->transfer_handler(drv_data); | ||
691 | } | ||
692 | |||
693 | static void pump_transfers(unsigned long data) | ||
694 | { | ||
695 | struct driver_data *drv_data = (struct driver_data *)data; | ||
696 | struct spi_message *message = NULL; | ||
697 | struct spi_transfer *transfer = NULL; | ||
698 | struct spi_transfer *previous = NULL; | ||
699 | struct chip_data *chip = NULL; | ||
700 | void *reg = drv_data->ioaddr; | ||
701 | u32 clk_div = 0; | ||
702 | u8 bits = 0; | ||
703 | u32 speed = 0; | ||
704 | u32 cr0; | ||
705 | |||
706 | /* Get current state information */ | ||
707 | message = drv_data->cur_msg; | ||
708 | transfer = drv_data->cur_transfer; | ||
709 | chip = drv_data->cur_chip; | ||
710 | |||
711 | /* Handle for abort */ | ||
712 | if (message->state == ERROR_STATE) { | ||
713 | message->status = -EIO; | ||
714 | giveback(drv_data); | ||
715 | return; | ||
716 | } | ||
717 | |||
718 | /* Handle end of message */ | ||
719 | if (message->state == DONE_STATE) { | ||
720 | message->status = 0; | ||
721 | giveback(drv_data); | ||
722 | return; | ||
723 | } | ||
724 | |||
725 | /* Delay if requested at end of transfer*/ | ||
726 | if (message->state == RUNNING_STATE) { | ||
727 | previous = list_entry(transfer->transfer_list.prev, | ||
728 | struct spi_transfer, | ||
729 | transfer_list); | ||
730 | if (previous->delay_usecs) | ||
731 | udelay(previous->delay_usecs); | ||
732 | } | ||
733 | |||
734 | /* Setup the transfer state based on the type of transfer */ | ||
735 | if (flush(drv_data) == 0) { | ||
736 | dev_err(&drv_data->pdev->dev, "pump_transfers: flush failed\n"); | ||
737 | message->status = -EIO; | ||
738 | giveback(drv_data); | ||
739 | return; | ||
740 | } | ||
741 | drv_data->n_bytes = chip->n_bytes; | ||
742 | drv_data->dma_width = chip->dma_width; | ||
743 | drv_data->cs_control = chip->cs_control; | ||
744 | drv_data->tx = (void *)transfer->tx_buf; | ||
745 | drv_data->tx_end = drv_data->tx + transfer->len; | ||
746 | drv_data->rx = transfer->rx_buf; | ||
747 | drv_data->rx_end = drv_data->rx + transfer->len; | ||
748 | drv_data->rx_dma = transfer->rx_dma; | ||
749 | drv_data->tx_dma = transfer->tx_dma; | ||
750 | drv_data->len = transfer->len; | ||
751 | drv_data->write = drv_data->tx ? chip->write : null_writer; | ||
752 | drv_data->read = drv_data->rx ? chip->read : null_reader; | ||
753 | drv_data->cs_change = transfer->cs_change; | ||
754 | |||
755 | /* Change speed and bit per word on a per transfer */ | ||
756 | if (transfer->speed_hz || transfer->bits_per_word) { | ||
757 | |||
758 | /* Disable clock */ | ||
759 | write_SSCR0(chip->cr0 & ~SSCR0_SSE, reg); | ||
760 | cr0 = chip->cr0; | ||
761 | bits = chip->bits_per_word; | ||
762 | speed = chip->speed_hz; | ||
763 | |||
764 | if (transfer->speed_hz) | ||
765 | speed = transfer->speed_hz; | ||
766 | |||
767 | if (transfer->bits_per_word) | ||
768 | bits = transfer->bits_per_word; | ||
769 | |||
770 | if (reg == SSP1_VIRT) | ||
771 | clk_div = SSP1_SerClkDiv(speed); | ||
772 | else if (reg == SSP2_VIRT) | ||
773 | clk_div = SSP2_SerClkDiv(speed); | ||
774 | else if (reg == SSP3_VIRT) | ||
775 | clk_div = SSP3_SerClkDiv(speed); | ||
776 | |||
777 | if (bits <= 8) { | ||
778 | drv_data->n_bytes = 1; | ||
779 | drv_data->dma_width = DCMD_WIDTH1; | ||
780 | drv_data->read = drv_data->read != null_reader ? | ||
781 | u8_reader : null_reader; | ||
782 | drv_data->write = drv_data->write != null_writer ? | ||
783 | u8_writer : null_writer; | ||
784 | } else if (bits <= 16) { | ||
785 | drv_data->n_bytes = 2; | ||
786 | drv_data->dma_width = DCMD_WIDTH2; | ||
787 | drv_data->read = drv_data->read != null_reader ? | ||
788 | u16_reader : null_reader; | ||
789 | drv_data->write = drv_data->write != null_writer ? | ||
790 | u16_writer : null_writer; | ||
791 | } else if (bits <= 32) { | ||
792 | drv_data->n_bytes = 4; | ||
793 | drv_data->dma_width = DCMD_WIDTH4; | ||
794 | drv_data->read = drv_data->read != null_reader ? | ||
795 | u32_reader : null_reader; | ||
796 | drv_data->write = drv_data->write != null_writer ? | ||
797 | u32_writer : null_writer; | ||
798 | } | ||
799 | |||
800 | cr0 = clk_div | ||
801 | | SSCR0_Motorola | ||
802 | | SSCR0_DataSize(bits > 16 ? bits - 16 : bits) | ||
803 | | SSCR0_SSE | ||
804 | | (bits > 16 ? SSCR0_EDSS : 0); | ||
805 | |||
806 | /* Start it back up */ | ||
807 | write_SSCR0(cr0, reg); | ||
808 | } | ||
809 | |||
810 | message->state = RUNNING_STATE; | ||
811 | |||
812 | /* Try to map dma buffer and do a dma transfer if successful */ | ||
813 | if ((drv_data->dma_mapped = map_dma_buffers(drv_data))) { | ||
814 | |||
815 | /* Ensure we have the correct interrupt handler */ | ||
816 | drv_data->transfer_handler = dma_transfer; | ||
817 | |||
818 | /* Setup rx DMA Channel */ | ||
819 | DCSR(drv_data->rx_channel) = RESET_DMA_CHANNEL; | ||
820 | DSADR(drv_data->rx_channel) = drv_data->ssdr_physical; | ||
821 | DTADR(drv_data->rx_channel) = drv_data->rx_dma; | ||
822 | if (drv_data->rx == drv_data->null_dma_buf) | ||
823 | /* No target address increment */ | ||
824 | DCMD(drv_data->rx_channel) = DCMD_FLOWSRC | ||
825 | | drv_data->dma_width | ||
826 | | chip->dma_burst_size | ||
827 | | drv_data->len; | ||
828 | else | ||
829 | DCMD(drv_data->rx_channel) = DCMD_INCTRGADDR | ||
830 | | DCMD_FLOWSRC | ||
831 | | drv_data->dma_width | ||
832 | | chip->dma_burst_size | ||
833 | | drv_data->len; | ||
834 | |||
835 | /* Setup tx DMA Channel */ | ||
836 | DCSR(drv_data->tx_channel) = RESET_DMA_CHANNEL; | ||
837 | DSADR(drv_data->tx_channel) = drv_data->tx_dma; | ||
838 | DTADR(drv_data->tx_channel) = drv_data->ssdr_physical; | ||
839 | if (drv_data->tx == drv_data->null_dma_buf) | ||
840 | /* No source address increment */ | ||
841 | DCMD(drv_data->tx_channel) = DCMD_FLOWTRG | ||
842 | | drv_data->dma_width | ||
843 | | chip->dma_burst_size | ||
844 | | drv_data->len; | ||
845 | else | ||
846 | DCMD(drv_data->tx_channel) = DCMD_INCSRCADDR | ||
847 | | DCMD_FLOWTRG | ||
848 | | drv_data->dma_width | ||
849 | | chip->dma_burst_size | ||
850 | | drv_data->len; | ||
851 | |||
852 | /* Enable dma end irqs on SSP to detect end of transfer */ | ||
853 | if (drv_data->ssp_type == PXA25x_SSP) | ||
854 | DCMD(drv_data->tx_channel) |= DCMD_ENDIRQEN; | ||
855 | |||
856 | /* Fix me, need to handle cs polarity */ | ||
857 | drv_data->cs_control(PXA2XX_CS_ASSERT); | ||
858 | |||
859 | /* Go baby, go */ | ||
860 | write_SSSR(drv_data->clear_sr, reg); | ||
861 | DCSR(drv_data->rx_channel) |= DCSR_RUN; | ||
862 | DCSR(drv_data->tx_channel) |= DCSR_RUN; | ||
863 | if (drv_data->ssp_type != PXA25x_SSP) | ||
864 | write_SSTO(chip->timeout, reg); | ||
865 | write_SSCR1(chip->cr1 | ||
866 | | chip->dma_threshold | ||
867 | | drv_data->dma_cr1, | ||
868 | reg); | ||
869 | } else { | ||
870 | /* Ensure we have the correct interrupt handler */ | ||
871 | drv_data->transfer_handler = interrupt_transfer; | ||
872 | |||
873 | /* Fix me, need to handle cs polarity */ | ||
874 | drv_data->cs_control(PXA2XX_CS_ASSERT); | ||
875 | |||
876 | /* Go baby, go */ | ||
877 | write_SSSR(drv_data->clear_sr, reg); | ||
878 | if (drv_data->ssp_type != PXA25x_SSP) | ||
879 | write_SSTO(chip->timeout, reg); | ||
880 | write_SSCR1(chip->cr1 | ||
881 | | chip->threshold | ||
882 | | drv_data->int_cr1, | ||
883 | reg); | ||
884 | } | ||
885 | } | ||
886 | |||
887 | static void pump_messages(void *data) | ||
888 | { | ||
889 | struct driver_data *drv_data = data; | ||
890 | unsigned long flags; | ||
891 | |||
892 | /* Lock queue and check for queue work */ | ||
893 | spin_lock_irqsave(&drv_data->lock, flags); | ||
894 | if (list_empty(&drv_data->queue) || drv_data->run == QUEUE_STOPPED) { | ||
895 | drv_data->busy = 0; | ||
896 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
897 | return; | ||
898 | } | ||
899 | |||
900 | /* Make sure we are not already running a message */ | ||
901 | if (drv_data->cur_msg) { | ||
902 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
903 | return; | ||
904 | } | ||
905 | |||
906 | /* Extract head of queue */ | ||
907 | drv_data->cur_msg = list_entry(drv_data->queue.next, | ||
908 | struct spi_message, queue); | ||
909 | list_del_init(&drv_data->cur_msg->queue); | ||
910 | |||
911 | /* Initial message state*/ | ||
912 | drv_data->cur_msg->state = START_STATE; | ||
913 | drv_data->cur_transfer = list_entry(drv_data->cur_msg->transfers.next, | ||
914 | struct spi_transfer, | ||
915 | transfer_list); | ||
916 | |||
917 | /* Setup the SSP using the per chip configuration */ | ||
918 | drv_data->cur_chip = spi_get_ctldata(drv_data->cur_msg->spi); | ||
919 | restore_state(drv_data); | ||
920 | |||
921 | /* Mark as busy and launch transfers */ | ||
922 | tasklet_schedule(&drv_data->pump_transfers); | ||
923 | |||
924 | drv_data->busy = 1; | ||
925 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
926 | } | ||
927 | |||
928 | static int transfer(struct spi_device *spi, struct spi_message *msg) | ||
929 | { | ||
930 | struct driver_data *drv_data = spi_master_get_devdata(spi->master); | ||
931 | unsigned long flags; | ||
932 | |||
933 | spin_lock_irqsave(&drv_data->lock, flags); | ||
934 | |||
935 | if (drv_data->run == QUEUE_STOPPED) { | ||
936 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
937 | return -ESHUTDOWN; | ||
938 | } | ||
939 | |||
940 | msg->actual_length = 0; | ||
941 | msg->status = -EINPROGRESS; | ||
942 | msg->state = START_STATE; | ||
943 | |||
944 | list_add_tail(&msg->queue, &drv_data->queue); | ||
945 | |||
946 | if (drv_data->run == QUEUE_RUNNING && !drv_data->busy) | ||
947 | queue_work(drv_data->workqueue, &drv_data->pump_messages); | ||
948 | |||
949 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
950 | |||
951 | return 0; | ||
952 | } | ||
953 | |||
954 | static int setup(struct spi_device *spi) | ||
955 | { | ||
956 | struct pxa2xx_spi_chip *chip_info = NULL; | ||
957 | struct chip_data *chip; | ||
958 | struct driver_data *drv_data = spi_master_get_devdata(spi->master); | ||
959 | unsigned int clk_div; | ||
960 | |||
961 | if (!spi->bits_per_word) | ||
962 | spi->bits_per_word = 8; | ||
963 | |||
964 | if (drv_data->ssp_type != PXA25x_SSP | ||
965 | && (spi->bits_per_word < 4 || spi->bits_per_word > 32)) | ||
966 | return -EINVAL; | ||
967 | else if (spi->bits_per_word < 4 || spi->bits_per_word > 16) | ||
968 | return -EINVAL; | ||
969 | |||
970 | /* Only alloc (or use chip_info) on first setup */ | ||
971 | chip = spi_get_ctldata(spi); | ||
972 | if (chip == NULL) { | ||
973 | chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); | ||
974 | if (!chip) | ||
975 | return -ENOMEM; | ||
976 | |||
977 | chip->cs_control = null_cs_control; | ||
978 | chip->enable_dma = 0; | ||
979 | chip->timeout = SSP_TIMEOUT(1000); | ||
980 | chip->threshold = SSCR1_RxTresh(1) | SSCR1_TxTresh(1); | ||
981 | chip->dma_burst_size = drv_data->master_info->enable_dma ? | ||
982 | DCMD_BURST8 : 0; | ||
983 | |||
984 | chip_info = spi->controller_data; | ||
985 | } | ||
986 | |||
987 | /* chip_info isn't always needed */ | ||
988 | if (chip_info) { | ||
989 | if (chip_info->cs_control) | ||
990 | chip->cs_control = chip_info->cs_control; | ||
991 | |||
992 | chip->timeout = SSP_TIMEOUT(chip_info->timeout_microsecs); | ||
993 | |||
994 | chip->threshold = SSCR1_RxTresh(chip_info->rx_threshold) | ||
995 | | SSCR1_TxTresh(chip_info->tx_threshold); | ||
996 | |||
997 | chip->enable_dma = chip_info->dma_burst_size != 0 | ||
998 | && drv_data->master_info->enable_dma; | ||
999 | chip->dma_threshold = 0; | ||
1000 | |||
1001 | if (chip->enable_dma) { | ||
1002 | if (chip_info->dma_burst_size <= 8) { | ||
1003 | chip->dma_threshold = SSCR1_RxTresh(8) | ||
1004 | | SSCR1_TxTresh(8); | ||
1005 | chip->dma_burst_size = DCMD_BURST8; | ||
1006 | } else if (chip_info->dma_burst_size <= 16) { | ||
1007 | chip->dma_threshold = SSCR1_RxTresh(16) | ||
1008 | | SSCR1_TxTresh(16); | ||
1009 | chip->dma_burst_size = DCMD_BURST16; | ||
1010 | } else { | ||
1011 | chip->dma_threshold = SSCR1_RxTresh(32) | ||
1012 | | SSCR1_TxTresh(32); | ||
1013 | chip->dma_burst_size = DCMD_BURST32; | ||
1014 | } | ||
1015 | } | ||
1016 | |||
1017 | |||
1018 | if (chip_info->enable_loopback) | ||
1019 | chip->cr1 = SSCR1_LBM; | ||
1020 | } | ||
1021 | |||
1022 | if (drv_data->ioaddr == SSP1_VIRT) | ||
1023 | clk_div = SSP1_SerClkDiv(spi->max_speed_hz); | ||
1024 | else if (drv_data->ioaddr == SSP2_VIRT) | ||
1025 | clk_div = SSP2_SerClkDiv(spi->max_speed_hz); | ||
1026 | else if (drv_data->ioaddr == SSP3_VIRT) | ||
1027 | clk_div = SSP3_SerClkDiv(spi->max_speed_hz); | ||
1028 | else | ||
1029 | return -ENODEV; | ||
1030 | chip->speed_hz = spi->max_speed_hz; | ||
1031 | |||
1032 | chip->cr0 = clk_div | ||
1033 | | SSCR0_Motorola | ||
1034 | | SSCR0_DataSize(spi->bits_per_word > 16 ? | ||
1035 | spi->bits_per_word - 16 : spi->bits_per_word) | ||
1036 | | SSCR0_SSE | ||
1037 | | (spi->bits_per_word > 16 ? SSCR0_EDSS : 0); | ||
1038 | chip->cr1 |= (((spi->mode & SPI_CPHA) != 0) << 4) | ||
1039 | | (((spi->mode & SPI_CPOL) != 0) << 3); | ||
1040 | |||
1041 | /* NOTE: PXA25x_SSP _could_ use external clocking ... */ | ||
1042 | if (drv_data->ssp_type != PXA25x_SSP) | ||
1043 | dev_dbg(&spi->dev, "%d bits/word, %d Hz, mode %d\n", | ||
1044 | spi->bits_per_word, | ||
1045 | (CLOCK_SPEED_HZ) | ||
1046 | / (1 + ((chip->cr0 & SSCR0_SCR) >> 8)), | ||
1047 | spi->mode & 0x3); | ||
1048 | else | ||
1049 | dev_dbg(&spi->dev, "%d bits/word, %d Hz, mode %d\n", | ||
1050 | spi->bits_per_word, | ||
1051 | (CLOCK_SPEED_HZ/2) | ||
1052 | / (1 + ((chip->cr0 & SSCR0_SCR) >> 8)), | ||
1053 | spi->mode & 0x3); | ||
1054 | |||
1055 | if (spi->bits_per_word <= 8) { | ||
1056 | chip->n_bytes = 1; | ||
1057 | chip->dma_width = DCMD_WIDTH1; | ||
1058 | chip->read = u8_reader; | ||
1059 | chip->write = u8_writer; | ||
1060 | } else if (spi->bits_per_word <= 16) { | ||
1061 | chip->n_bytes = 2; | ||
1062 | chip->dma_width = DCMD_WIDTH2; | ||
1063 | chip->read = u16_reader; | ||
1064 | chip->write = u16_writer; | ||
1065 | } else if (spi->bits_per_word <= 32) { | ||
1066 | chip->cr0 |= SSCR0_EDSS; | ||
1067 | chip->n_bytes = 4; | ||
1068 | chip->dma_width = DCMD_WIDTH4; | ||
1069 | chip->read = u32_reader; | ||
1070 | chip->write = u32_writer; | ||
1071 | } else { | ||
1072 | dev_err(&spi->dev, "invalid wordsize\n"); | ||
1073 | kfree(chip); | ||
1074 | return -ENODEV; | ||
1075 | } | ||
1076 | chip->bits_per_word = spi->bits_per_word; | ||
1077 | |||
1078 | spi_set_ctldata(spi, chip); | ||
1079 | |||
1080 | return 0; | ||
1081 | } | ||
1082 | |||
1083 | static void cleanup(const struct spi_device *spi) | ||
1084 | { | ||
1085 | struct chip_data *chip = spi_get_ctldata((struct spi_device *)spi); | ||
1086 | |||
1087 | kfree(chip); | ||
1088 | } | ||
1089 | |||
1090 | static int init_queue(struct driver_data *drv_data) | ||
1091 | { | ||
1092 | INIT_LIST_HEAD(&drv_data->queue); | ||
1093 | spin_lock_init(&drv_data->lock); | ||
1094 | |||
1095 | drv_data->run = QUEUE_STOPPED; | ||
1096 | drv_data->busy = 0; | ||
1097 | |||
1098 | tasklet_init(&drv_data->pump_transfers, | ||
1099 | pump_transfers, (unsigned long)drv_data); | ||
1100 | |||
1101 | INIT_WORK(&drv_data->pump_messages, pump_messages, drv_data); | ||
1102 | drv_data->workqueue = create_singlethread_workqueue( | ||
1103 | drv_data->master->cdev.dev->bus_id); | ||
1104 | if (drv_data->workqueue == NULL) | ||
1105 | return -EBUSY; | ||
1106 | |||
1107 | return 0; | ||
1108 | } | ||
1109 | |||
1110 | static int start_queue(struct driver_data *drv_data) | ||
1111 | { | ||
1112 | unsigned long flags; | ||
1113 | |||
1114 | spin_lock_irqsave(&drv_data->lock, flags); | ||
1115 | |||
1116 | if (drv_data->run == QUEUE_RUNNING || drv_data->busy) { | ||
1117 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
1118 | return -EBUSY; | ||
1119 | } | ||
1120 | |||
1121 | drv_data->run = QUEUE_RUNNING; | ||
1122 | drv_data->cur_msg = NULL; | ||
1123 | drv_data->cur_transfer = NULL; | ||
1124 | drv_data->cur_chip = NULL; | ||
1125 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
1126 | |||
1127 | queue_work(drv_data->workqueue, &drv_data->pump_messages); | ||
1128 | |||
1129 | return 0; | ||
1130 | } | ||
1131 | |||
1132 | static int stop_queue(struct driver_data *drv_data) | ||
1133 | { | ||
1134 | unsigned long flags; | ||
1135 | unsigned limit = 500; | ||
1136 | int status = 0; | ||
1137 | |||
1138 | spin_lock_irqsave(&drv_data->lock, flags); | ||
1139 | |||
1140 | /* This is a bit lame, but is optimized for the common execution path. | ||
1141 | * A wait_queue on the drv_data->busy could be used, but then the common | ||
1142 | * execution path (pump_messages) would be required to call wake_up or | ||
1143 | * friends on every SPI message. Do this instead */ | ||
1144 | drv_data->run = QUEUE_STOPPED; | ||
1145 | while (!list_empty(&drv_data->queue) && drv_data->busy && limit--) { | ||
1146 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
1147 | msleep(10); | ||
1148 | spin_lock_irqsave(&drv_data->lock, flags); | ||
1149 | } | ||
1150 | |||
1151 | if (!list_empty(&drv_data->queue) || drv_data->busy) | ||
1152 | status = -EBUSY; | ||
1153 | |||
1154 | spin_unlock_irqrestore(&drv_data->lock, flags); | ||
1155 | |||
1156 | return status; | ||
1157 | } | ||
1158 | |||
1159 | static int destroy_queue(struct driver_data *drv_data) | ||
1160 | { | ||
1161 | int status; | ||
1162 | |||
1163 | status = stop_queue(drv_data); | ||
1164 | if (status != 0) | ||
1165 | return status; | ||
1166 | |||
1167 | destroy_workqueue(drv_data->workqueue); | ||
1168 | |||
1169 | return 0; | ||
1170 | } | ||
1171 | |||
1172 | static int pxa2xx_spi_probe(struct platform_device *pdev) | ||
1173 | { | ||
1174 | struct device *dev = &pdev->dev; | ||
1175 | struct pxa2xx_spi_master *platform_info; | ||
1176 | struct spi_master *master; | ||
1177 | struct driver_data *drv_data = 0; | ||
1178 | struct resource *memory_resource; | ||
1179 | int irq; | ||
1180 | int status = 0; | ||
1181 | |||
1182 | platform_info = dev->platform_data; | ||
1183 | |||
1184 | if (platform_info->ssp_type == SSP_UNDEFINED) { | ||
1185 | dev_err(&pdev->dev, "undefined SSP\n"); | ||
1186 | return -ENODEV; | ||
1187 | } | ||
1188 | |||
1189 | /* Allocate master with space for drv_data and null dma buffer */ | ||
1190 | master = spi_alloc_master(dev, sizeof(struct driver_data) + 16); | ||
1191 | if (!master) { | ||
1192 | dev_err(&pdev->dev, "can not alloc spi_master\n"); | ||
1193 | return -ENOMEM; | ||
1194 | } | ||
1195 | drv_data = spi_master_get_devdata(master); | ||
1196 | drv_data->master = master; | ||
1197 | drv_data->master_info = platform_info; | ||
1198 | drv_data->pdev = pdev; | ||
1199 | |||
1200 | master->bus_num = pdev->id; | ||
1201 | master->num_chipselect = platform_info->num_chipselect; | ||
1202 | master->cleanup = cleanup; | ||
1203 | master->setup = setup; | ||
1204 | master->transfer = transfer; | ||
1205 | |||
1206 | drv_data->ssp_type = platform_info->ssp_type; | ||
1207 | drv_data->null_dma_buf = (u32 *)ALIGN((u32)(drv_data + | ||
1208 | sizeof(struct driver_data)), 8); | ||
1209 | |||
1210 | /* Setup register addresses */ | ||
1211 | memory_resource = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
1212 | if (!memory_resource) { | ||
1213 | dev_err(&pdev->dev, "memory resources not defined\n"); | ||
1214 | status = -ENODEV; | ||
1215 | goto out_error_master_alloc; | ||
1216 | } | ||
1217 | |||
1218 | drv_data->ioaddr = (void *)io_p2v((unsigned long)(memory_resource->start)); | ||
1219 | drv_data->ssdr_physical = memory_resource->start + 0x00000010; | ||
1220 | if (platform_info->ssp_type == PXA25x_SSP) { | ||
1221 | drv_data->int_cr1 = SSCR1_TIE | SSCR1_RIE; | ||
1222 | drv_data->dma_cr1 = 0; | ||
1223 | drv_data->clear_sr = SSSR_ROR; | ||
1224 | drv_data->mask_sr = SSSR_RFS | SSSR_TFS | SSSR_ROR; | ||
1225 | } else { | ||
1226 | drv_data->int_cr1 = SSCR1_TIE | SSCR1_RIE | SSCR1_TINTE; | ||
1227 | drv_data->dma_cr1 = SSCR1_TSRE | SSCR1_RSRE | SSCR1_TINTE; | ||
1228 | drv_data->clear_sr = SSSR_ROR | SSSR_TINT; | ||
1229 | drv_data->mask_sr = SSSR_TINT | SSSR_RFS | SSSR_TFS | SSSR_ROR; | ||
1230 | } | ||
1231 | |||
1232 | /* Attach to IRQ */ | ||
1233 | irq = platform_get_irq(pdev, 0); | ||
1234 | if (irq < 0) { | ||
1235 | dev_err(&pdev->dev, "irq resource not defined\n"); | ||
1236 | status = -ENODEV; | ||
1237 | goto out_error_master_alloc; | ||
1238 | } | ||
1239 | |||
1240 | status = request_irq(irq, ssp_int, 0, dev->bus_id, drv_data); | ||
1241 | if (status < 0) { | ||
1242 | dev_err(&pdev->dev, "can not get IRQ\n"); | ||
1243 | goto out_error_master_alloc; | ||
1244 | } | ||
1245 | |||
1246 | /* Setup DMA if requested */ | ||
1247 | drv_data->tx_channel = -1; | ||
1248 | drv_data->rx_channel = -1; | ||
1249 | if (platform_info->enable_dma) { | ||
1250 | |||
1251 | /* Get two DMA channels (rx and tx) */ | ||
1252 | drv_data->rx_channel = pxa_request_dma("pxa2xx_spi_ssp_rx", | ||
1253 | DMA_PRIO_HIGH, | ||
1254 | dma_handler, | ||
1255 | drv_data); | ||
1256 | if (drv_data->rx_channel < 0) { | ||
1257 | dev_err(dev, "problem (%d) requesting rx channel\n", | ||
1258 | drv_data->rx_channel); | ||
1259 | status = -ENODEV; | ||
1260 | goto out_error_irq_alloc; | ||
1261 | } | ||
1262 | drv_data->tx_channel = pxa_request_dma("pxa2xx_spi_ssp_tx", | ||
1263 | DMA_PRIO_MEDIUM, | ||
1264 | dma_handler, | ||
1265 | drv_data); | ||
1266 | if (drv_data->tx_channel < 0) { | ||
1267 | dev_err(dev, "problem (%d) requesting tx channel\n", | ||
1268 | drv_data->tx_channel); | ||
1269 | status = -ENODEV; | ||
1270 | goto out_error_dma_alloc; | ||
1271 | } | ||
1272 | |||
1273 | if (drv_data->ioaddr == SSP1_VIRT) { | ||
1274 | DRCMRRXSSDR = DRCMR_MAPVLD | ||
1275 | | drv_data->rx_channel; | ||
1276 | DRCMRTXSSDR = DRCMR_MAPVLD | ||
1277 | | drv_data->tx_channel; | ||
1278 | } else if (drv_data->ioaddr == SSP2_VIRT) { | ||
1279 | DRCMRRXSS2DR = DRCMR_MAPVLD | ||
1280 | | drv_data->rx_channel; | ||
1281 | DRCMRTXSS2DR = DRCMR_MAPVLD | ||
1282 | | drv_data->tx_channel; | ||
1283 | } else if (drv_data->ioaddr == SSP3_VIRT) { | ||
1284 | DRCMRRXSS3DR = DRCMR_MAPVLD | ||
1285 | | drv_data->rx_channel; | ||
1286 | DRCMRTXSS3DR = DRCMR_MAPVLD | ||
1287 | | drv_data->tx_channel; | ||
1288 | } else { | ||
1289 | dev_err(dev, "bad SSP type\n"); | ||
1290 | goto out_error_dma_alloc; | ||
1291 | } | ||
1292 | } | ||
1293 | |||
1294 | /* Enable SOC clock */ | ||
1295 | pxa_set_cken(platform_info->clock_enable, 1); | ||
1296 | |||
1297 | /* Load default SSP configuration */ | ||
1298 | write_SSCR0(0, drv_data->ioaddr); | ||
1299 | write_SSCR1(SSCR1_RxTresh(4) | SSCR1_TxTresh(12), drv_data->ioaddr); | ||
1300 | write_SSCR0(SSCR0_SerClkDiv(2) | ||
1301 | | SSCR0_Motorola | ||
1302 | | SSCR0_DataSize(8), | ||
1303 | drv_data->ioaddr); | ||
1304 | if (drv_data->ssp_type != PXA25x_SSP) | ||
1305 | write_SSTO(0, drv_data->ioaddr); | ||
1306 | write_SSPSP(0, drv_data->ioaddr); | ||
1307 | |||
1308 | /* Initial and start queue */ | ||
1309 | status = init_queue(drv_data); | ||
1310 | if (status != 0) { | ||
1311 | dev_err(&pdev->dev, "problem initializing queue\n"); | ||
1312 | goto out_error_clock_enabled; | ||
1313 | } | ||
1314 | status = start_queue(drv_data); | ||
1315 | if (status != 0) { | ||
1316 | dev_err(&pdev->dev, "problem starting queue\n"); | ||
1317 | goto out_error_clock_enabled; | ||
1318 | } | ||
1319 | |||
1320 | /* Register with the SPI framework */ | ||
1321 | platform_set_drvdata(pdev, drv_data); | ||
1322 | status = spi_register_master(master); | ||
1323 | if (status != 0) { | ||
1324 | dev_err(&pdev->dev, "problem registering spi master\n"); | ||
1325 | goto out_error_queue_alloc; | ||
1326 | } | ||
1327 | |||
1328 | return status; | ||
1329 | |||
1330 | out_error_queue_alloc: | ||
1331 | destroy_queue(drv_data); | ||
1332 | |||
1333 | out_error_clock_enabled: | ||
1334 | pxa_set_cken(platform_info->clock_enable, 0); | ||
1335 | |||
1336 | out_error_dma_alloc: | ||
1337 | if (drv_data->tx_channel != -1) | ||
1338 | pxa_free_dma(drv_data->tx_channel); | ||
1339 | if (drv_data->rx_channel != -1) | ||
1340 | pxa_free_dma(drv_data->rx_channel); | ||
1341 | |||
1342 | out_error_irq_alloc: | ||
1343 | free_irq(irq, drv_data); | ||
1344 | |||
1345 | out_error_master_alloc: | ||
1346 | spi_master_put(master); | ||
1347 | return status; | ||
1348 | } | ||
1349 | |||
1350 | static int pxa2xx_spi_remove(struct platform_device *pdev) | ||
1351 | { | ||
1352 | struct driver_data *drv_data = platform_get_drvdata(pdev); | ||
1353 | int irq; | ||
1354 | int status = 0; | ||
1355 | |||
1356 | if (!drv_data) | ||
1357 | return 0; | ||
1358 | |||
1359 | /* Remove the queue */ | ||
1360 | status = destroy_queue(drv_data); | ||
1361 | if (status != 0) | ||
1362 | return status; | ||
1363 | |||
1364 | /* Disable the SSP at the peripheral and SOC level */ | ||
1365 | write_SSCR0(0, drv_data->ioaddr); | ||
1366 | pxa_set_cken(drv_data->master_info->clock_enable, 0); | ||
1367 | |||
1368 | /* Release DMA */ | ||
1369 | if (drv_data->master_info->enable_dma) { | ||
1370 | if (drv_data->ioaddr == SSP1_VIRT) { | ||
1371 | DRCMRRXSSDR = 0; | ||
1372 | DRCMRTXSSDR = 0; | ||
1373 | } else if (drv_data->ioaddr == SSP2_VIRT) { | ||
1374 | DRCMRRXSS2DR = 0; | ||
1375 | DRCMRTXSS2DR = 0; | ||
1376 | } else if (drv_data->ioaddr == SSP3_VIRT) { | ||
1377 | DRCMRRXSS3DR = 0; | ||
1378 | DRCMRTXSS3DR = 0; | ||
1379 | } | ||
1380 | pxa_free_dma(drv_data->tx_channel); | ||
1381 | pxa_free_dma(drv_data->rx_channel); | ||
1382 | } | ||
1383 | |||
1384 | /* Release IRQ */ | ||
1385 | irq = platform_get_irq(pdev, 0); | ||
1386 | if (irq >= 0) | ||
1387 | free_irq(irq, drv_data); | ||
1388 | |||
1389 | /* Disconnect from the SPI framework */ | ||
1390 | spi_unregister_master(drv_data->master); | ||
1391 | |||
1392 | /* Prevent double remove */ | ||
1393 | platform_set_drvdata(pdev, NULL); | ||
1394 | |||
1395 | return 0; | ||
1396 | } | ||
1397 | |||
1398 | static void pxa2xx_spi_shutdown(struct platform_device *pdev) | ||
1399 | { | ||
1400 | int status = 0; | ||
1401 | |||
1402 | if ((status = pxa2xx_spi_remove(pdev)) != 0) | ||
1403 | dev_err(&pdev->dev, "shutdown failed with %d\n", status); | ||
1404 | } | ||
1405 | |||
1406 | #ifdef CONFIG_PM | ||
1407 | static int suspend_devices(struct device *dev, void *pm_message) | ||
1408 | { | ||
1409 | pm_message_t *state = pm_message; | ||
1410 | |||
1411 | if (dev->power.power_state.event != state->event) { | ||
1412 | dev_warn(dev, "pm state does not match request\n"); | ||
1413 | return -1; | ||
1414 | } | ||
1415 | |||
1416 | return 0; | ||
1417 | } | ||
1418 | |||
1419 | static int pxa2xx_spi_suspend(struct platform_device *pdev, pm_message_t state) | ||
1420 | { | ||
1421 | struct driver_data *drv_data = platform_get_drvdata(pdev); | ||
1422 | int status = 0; | ||
1423 | |||
1424 | /* Check all childern for current power state */ | ||
1425 | if (device_for_each_child(&pdev->dev, &state, suspend_devices) != 0) { | ||
1426 | dev_warn(&pdev->dev, "suspend aborted\n"); | ||
1427 | return -1; | ||
1428 | } | ||
1429 | |||
1430 | status = stop_queue(drv_data); | ||
1431 | if (status != 0) | ||
1432 | return status; | ||
1433 | write_SSCR0(0, drv_data->ioaddr); | ||
1434 | pxa_set_cken(drv_data->master_info->clock_enable, 0); | ||
1435 | |||
1436 | return 0; | ||
1437 | } | ||
1438 | |||
1439 | static int pxa2xx_spi_resume(struct platform_device *pdev) | ||
1440 | { | ||
1441 | struct driver_data *drv_data = platform_get_drvdata(pdev); | ||
1442 | int status = 0; | ||
1443 | |||
1444 | /* Enable the SSP clock */ | ||
1445 | pxa_set_cken(drv_data->master_info->clock_enable, 1); | ||
1446 | |||
1447 | /* Start the queue running */ | ||
1448 | status = start_queue(drv_data); | ||
1449 | if (status != 0) { | ||
1450 | dev_err(&pdev->dev, "problem starting queue (%d)\n", status); | ||
1451 | return status; | ||
1452 | } | ||
1453 | |||
1454 | return 0; | ||
1455 | } | ||
1456 | #else | ||
1457 | #define pxa2xx_spi_suspend NULL | ||
1458 | #define pxa2xx_spi_resume NULL | ||
1459 | #endif /* CONFIG_PM */ | ||
1460 | |||
1461 | static struct platform_driver driver = { | ||
1462 | .driver = { | ||
1463 | .name = "pxa2xx-spi", | ||
1464 | .bus = &platform_bus_type, | ||
1465 | .owner = THIS_MODULE, | ||
1466 | }, | ||
1467 | .probe = pxa2xx_spi_probe, | ||
1468 | .remove = __devexit_p(pxa2xx_spi_remove), | ||
1469 | .shutdown = pxa2xx_spi_shutdown, | ||
1470 | .suspend = pxa2xx_spi_suspend, | ||
1471 | .resume = pxa2xx_spi_resume, | ||
1472 | }; | ||
1473 | |||
1474 | static int __init pxa2xx_spi_init(void) | ||
1475 | { | ||
1476 | platform_driver_register(&driver); | ||
1477 | |||
1478 | return 0; | ||
1479 | } | ||
1480 | module_init(pxa2xx_spi_init); | ||
1481 | |||
1482 | static void __exit pxa2xx_spi_exit(void) | ||
1483 | { | ||
1484 | platform_driver_unregister(&driver); | ||
1485 | } | ||
1486 | module_exit(pxa2xx_spi_exit); | ||
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 94f5e8ed83a7..1cea4a6799fe 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c | |||
@@ -338,18 +338,18 @@ static struct class spi_master_class = { | |||
338 | * spi_alloc_master - allocate SPI master controller | 338 | * spi_alloc_master - allocate SPI master controller |
339 | * @dev: the controller, possibly using the platform_bus | 339 | * @dev: the controller, possibly using the platform_bus |
340 | * @size: how much driver-private data to preallocate; the pointer to this | 340 | * @size: how much driver-private data to preallocate; the pointer to this |
341 | * memory is in the class_data field of the returned class_device, | 341 | * memory is in the class_data field of the returned class_device, |
342 | * accessible with spi_master_get_devdata(). | 342 | * accessible with spi_master_get_devdata(). |
343 | * | 343 | * |
344 | * This call is used only by SPI master controller drivers, which are the | 344 | * This call is used only by SPI master controller drivers, which are the |
345 | * only ones directly touching chip registers. It's how they allocate | 345 | * only ones directly touching chip registers. It's how they allocate |
346 | * an spi_master structure, prior to calling spi_add_master(). | 346 | * an spi_master structure, prior to calling spi_register_master(). |
347 | * | 347 | * |
348 | * This must be called from context that can sleep. It returns the SPI | 348 | * This must be called from context that can sleep. It returns the SPI |
349 | * master structure on success, else NULL. | 349 | * master structure on success, else NULL. |
350 | * | 350 | * |
351 | * The caller is responsible for assigning the bus number and initializing | 351 | * The caller is responsible for assigning the bus number and initializing |
352 | * the master's methods before calling spi_add_master(); and (after errors | 352 | * the master's methods before calling spi_register_master(); and (after errors |
353 | * adding the device) calling spi_master_put() to prevent a memory leak. | 353 | * adding the device) calling spi_master_put() to prevent a memory leak. |
354 | */ | 354 | */ |
355 | struct spi_master * __init_or_module | 355 | struct spi_master * __init_or_module |
@@ -395,7 +395,7 @@ EXPORT_SYMBOL_GPL(spi_alloc_master); | |||
395 | int __init_or_module | 395 | int __init_or_module |
396 | spi_register_master(struct spi_master *master) | 396 | spi_register_master(struct spi_master *master) |
397 | { | 397 | { |
398 | static atomic_t dyn_bus_id = ATOMIC_INIT(0); | 398 | static atomic_t dyn_bus_id = ATOMIC_INIT((1<<16) - 1); |
399 | struct device *dev = master->cdev.dev; | 399 | struct device *dev = master->cdev.dev; |
400 | int status = -ENODEV; | 400 | int status = -ENODEV; |
401 | int dynamic = 0; | 401 | int dynamic = 0; |
@@ -404,7 +404,7 @@ spi_register_master(struct spi_master *master) | |||
404 | return -ENODEV; | 404 | return -ENODEV; |
405 | 405 | ||
406 | /* convention: dynamically assigned bus IDs count down from the max */ | 406 | /* convention: dynamically assigned bus IDs count down from the max */ |
407 | if (master->bus_num == 0) { | 407 | if (master->bus_num < 0) { |
408 | master->bus_num = atomic_dec_return(&dyn_bus_id); | 408 | master->bus_num = atomic_dec_return(&dyn_bus_id); |
409 | dynamic = 1; | 409 | dynamic = 1; |
410 | } | 410 | } |
@@ -522,7 +522,8 @@ int spi_sync(struct spi_device *spi, struct spi_message *message) | |||
522 | } | 522 | } |
523 | EXPORT_SYMBOL_GPL(spi_sync); | 523 | EXPORT_SYMBOL_GPL(spi_sync); |
524 | 524 | ||
525 | #define SPI_BUFSIZ (SMP_CACHE_BYTES) | 525 | /* portable code must never pass more than 32 bytes */ |
526 | #define SPI_BUFSIZ max(32,SMP_CACHE_BYTES) | ||
526 | 527 | ||
527 | static u8 *buf; | 528 | static u8 *buf; |
528 | 529 | ||
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index f037e5593269..dd2f950b21a7 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c | |||
@@ -138,6 +138,45 @@ static unsigned bitbang_txrx_32( | |||
138 | return t->len - count; | 138 | return t->len - count; |
139 | } | 139 | } |
140 | 140 | ||
141 | int spi_bitbang_setup_transfer(struct spi_device *spi, struct spi_transfer *t) | ||
142 | { | ||
143 | struct spi_bitbang_cs *cs = spi->controller_state; | ||
144 | u8 bits_per_word; | ||
145 | u32 hz; | ||
146 | |||
147 | if (t) { | ||
148 | bits_per_word = t->bits_per_word; | ||
149 | hz = t->speed_hz; | ||
150 | } else { | ||
151 | bits_per_word = 0; | ||
152 | hz = 0; | ||
153 | } | ||
154 | |||
155 | /* spi_transfer level calls that work per-word */ | ||
156 | if (!bits_per_word) | ||
157 | bits_per_word = spi->bits_per_word; | ||
158 | if (bits_per_word <= 8) | ||
159 | cs->txrx_bufs = bitbang_txrx_8; | ||
160 | else if (bits_per_word <= 16) | ||
161 | cs->txrx_bufs = bitbang_txrx_16; | ||
162 | else if (bits_per_word <= 32) | ||
163 | cs->txrx_bufs = bitbang_txrx_32; | ||
164 | else | ||
165 | return -EINVAL; | ||
166 | |||
167 | /* nsecs = (clock period)/2 */ | ||
168 | if (!hz) | ||
169 | hz = spi->max_speed_hz; | ||
170 | if (hz) { | ||
171 | cs->nsecs = (1000000000/2) / hz; | ||
172 | if (cs->nsecs > (MAX_UDELAY_MS * 1000 * 1000)) | ||
173 | return -EINVAL; | ||
174 | } | ||
175 | |||
176 | return 0; | ||
177 | } | ||
178 | EXPORT_SYMBOL_GPL(spi_bitbang_setup_transfer); | ||
179 | |||
141 | /** | 180 | /** |
142 | * spi_bitbang_setup - default setup for per-word I/O loops | 181 | * spi_bitbang_setup - default setup for per-word I/O loops |
143 | */ | 182 | */ |
@@ -145,8 +184,16 @@ int spi_bitbang_setup(struct spi_device *spi) | |||
145 | { | 184 | { |
146 | struct spi_bitbang_cs *cs = spi->controller_state; | 185 | struct spi_bitbang_cs *cs = spi->controller_state; |
147 | struct spi_bitbang *bitbang; | 186 | struct spi_bitbang *bitbang; |
187 | int retval; | ||
148 | 188 | ||
149 | if (!spi->max_speed_hz) | 189 | bitbang = spi_master_get_devdata(spi->master); |
190 | |||
191 | /* REVISIT: some systems will want to support devices using lsb-first | ||
192 | * bit encodings on the wire. In pure software that would be trivial, | ||
193 | * just bitbang_txrx_le_cphaX() routines shifting the other way, and | ||
194 | * some hardware controllers also have this support. | ||
195 | */ | ||
196 | if ((spi->mode & SPI_LSB_FIRST) != 0) | ||
150 | return -EINVAL; | 197 | return -EINVAL; |
151 | 198 | ||
152 | if (!cs) { | 199 | if (!cs) { |
@@ -155,32 +202,20 @@ int spi_bitbang_setup(struct spi_device *spi) | |||
155 | return -ENOMEM; | 202 | return -ENOMEM; |
156 | spi->controller_state = cs; | 203 | spi->controller_state = cs; |
157 | } | 204 | } |
158 | bitbang = spi_master_get_devdata(spi->master); | ||
159 | 205 | ||
160 | if (!spi->bits_per_word) | 206 | if (!spi->bits_per_word) |
161 | spi->bits_per_word = 8; | 207 | spi->bits_per_word = 8; |
162 | 208 | ||
163 | /* spi_transfer level calls that work per-word */ | ||
164 | if (spi->bits_per_word <= 8) | ||
165 | cs->txrx_bufs = bitbang_txrx_8; | ||
166 | else if (spi->bits_per_word <= 16) | ||
167 | cs->txrx_bufs = bitbang_txrx_16; | ||
168 | else if (spi->bits_per_word <= 32) | ||
169 | cs->txrx_bufs = bitbang_txrx_32; | ||
170 | else | ||
171 | return -EINVAL; | ||
172 | |||
173 | /* per-word shift register access, in hardware or bitbanging */ | 209 | /* per-word shift register access, in hardware or bitbanging */ |
174 | cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL|SPI_CPHA)]; | 210 | cs->txrx_word = bitbang->txrx_word[spi->mode & (SPI_CPOL|SPI_CPHA)]; |
175 | if (!cs->txrx_word) | 211 | if (!cs->txrx_word) |
176 | return -EINVAL; | 212 | return -EINVAL; |
177 | 213 | ||
178 | /* nsecs = (clock period)/2 */ | 214 | retval = spi_bitbang_setup_transfer(spi, NULL); |
179 | cs->nsecs = (1000000000/2) / (spi->max_speed_hz); | 215 | if (retval < 0) |
180 | if (cs->nsecs > MAX_UDELAY_MS * 1000) | 216 | return retval; |
181 | return -EINVAL; | ||
182 | 217 | ||
183 | dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec\n", | 218 | dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec/bit\n", |
184 | __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA), | 219 | __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA), |
185 | spi->bits_per_word, 2 * cs->nsecs); | 220 | spi->bits_per_word, 2 * cs->nsecs); |
186 | 221 | ||
@@ -246,6 +281,8 @@ static void bitbang_work(void *_bitbang) | |||
246 | unsigned tmp; | 281 | unsigned tmp; |
247 | unsigned cs_change; | 282 | unsigned cs_change; |
248 | int status; | 283 | int status; |
284 | int (*setup_transfer)(struct spi_device *, | ||
285 | struct spi_transfer *); | ||
249 | 286 | ||
250 | m = container_of(bitbang->queue.next, struct spi_message, | 287 | m = container_of(bitbang->queue.next, struct spi_message, |
251 | queue); | 288 | queue); |
@@ -262,6 +299,7 @@ static void bitbang_work(void *_bitbang) | |||
262 | tmp = 0; | 299 | tmp = 0; |
263 | cs_change = 1; | 300 | cs_change = 1; |
264 | status = 0; | 301 | status = 0; |
302 | setup_transfer = NULL; | ||
265 | 303 | ||
266 | list_for_each_entry (t, &m->transfers, transfer_list) { | 304 | list_for_each_entry (t, &m->transfers, transfer_list) { |
267 | if (bitbang->shutdown) { | 305 | if (bitbang->shutdown) { |
@@ -269,6 +307,20 @@ static void bitbang_work(void *_bitbang) | |||
269 | break; | 307 | break; |
270 | } | 308 | } |
271 | 309 | ||
310 | /* override or restore speed and wordsize */ | ||
311 | if (t->speed_hz || t->bits_per_word) { | ||
312 | setup_transfer = bitbang->setup_transfer; | ||
313 | if (!setup_transfer) { | ||
314 | status = -ENOPROTOOPT; | ||
315 | break; | ||
316 | } | ||
317 | } | ||
318 | if (setup_transfer) { | ||
319 | status = setup_transfer(spi, t); | ||
320 | if (status < 0) | ||
321 | break; | ||
322 | } | ||
323 | |||
272 | /* set up default clock polarity, and activate chip; | 324 | /* set up default clock polarity, and activate chip; |
273 | * this implicitly updates clock and spi modes as | 325 | * this implicitly updates clock and spi modes as |
274 | * previously recorded for this device via setup(). | 326 | * previously recorded for this device via setup(). |
@@ -325,6 +377,10 @@ static void bitbang_work(void *_bitbang) | |||
325 | m->status = status; | 377 | m->status = status; |
326 | m->complete(m->context); | 378 | m->complete(m->context); |
327 | 379 | ||
380 | /* restore speed and wordsize */ | ||
381 | if (setup_transfer) | ||
382 | setup_transfer(spi, NULL); | ||
383 | |||
328 | /* normally deactivate chipselect ... unless no error and | 384 | /* normally deactivate chipselect ... unless no error and |
329 | * cs_change has hinted that the next message will probably | 385 | * cs_change has hinted that the next message will probably |
330 | * be for this chip too. | 386 | * be for this chip too. |
@@ -348,6 +404,7 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m) | |||
348 | { | 404 | { |
349 | struct spi_bitbang *bitbang; | 405 | struct spi_bitbang *bitbang; |
350 | unsigned long flags; | 406 | unsigned long flags; |
407 | int status = 0; | ||
351 | 408 | ||
352 | m->actual_length = 0; | 409 | m->actual_length = 0; |
353 | m->status = -EINPROGRESS; | 410 | m->status = -EINPROGRESS; |
@@ -357,11 +414,15 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m) | |||
357 | return -ESHUTDOWN; | 414 | return -ESHUTDOWN; |
358 | 415 | ||
359 | spin_lock_irqsave(&bitbang->lock, flags); | 416 | spin_lock_irqsave(&bitbang->lock, flags); |
360 | list_add_tail(&m->queue, &bitbang->queue); | 417 | if (!spi->max_speed_hz) |
361 | queue_work(bitbang->workqueue, &bitbang->work); | 418 | status = -ENETDOWN; |
419 | else { | ||
420 | list_add_tail(&m->queue, &bitbang->queue); | ||
421 | queue_work(bitbang->workqueue, &bitbang->work); | ||
422 | } | ||
362 | spin_unlock_irqrestore(&bitbang->lock, flags); | 423 | spin_unlock_irqrestore(&bitbang->lock, flags); |
363 | 424 | ||
364 | return 0; | 425 | return status; |
365 | } | 426 | } |
366 | EXPORT_SYMBOL_GPL(spi_bitbang_transfer); | 427 | EXPORT_SYMBOL_GPL(spi_bitbang_transfer); |
367 | 428 | ||
@@ -406,6 +467,9 @@ int spi_bitbang_start(struct spi_bitbang *bitbang) | |||
406 | bitbang->use_dma = 0; | 467 | bitbang->use_dma = 0; |
407 | bitbang->txrx_bufs = spi_bitbang_bufs; | 468 | bitbang->txrx_bufs = spi_bitbang_bufs; |
408 | if (!bitbang->master->setup) { | 469 | if (!bitbang->master->setup) { |
470 | if (!bitbang->setup_transfer) | ||
471 | bitbang->setup_transfer = | ||
472 | spi_bitbang_setup_transfer; | ||
409 | bitbang->master->setup = spi_bitbang_setup; | 473 | bitbang->master->setup = spi_bitbang_setup; |
410 | bitbang->master->cleanup = spi_bitbang_cleanup; | 474 | bitbang->master->cleanup = spi_bitbang_cleanup; |
411 | } | 475 | } |
diff --git a/drivers/spi/spi_butterfly.c b/drivers/spi/spi_butterfly.c index ff9e5faa4dc9..a006a1ee27ac 100644 --- a/drivers/spi/spi_butterfly.c +++ b/drivers/spi/spi_butterfly.c | |||
@@ -321,6 +321,7 @@ static void butterfly_attach(struct parport *p) | |||
321 | * (firmware resets at45, acts as spi slave) or neither (we ignore | 321 | * (firmware resets at45, acts as spi slave) or neither (we ignore |
322 | * both, AVR uses AT45). Here we expect firmware for the first option. | 322 | * both, AVR uses AT45). Here we expect firmware for the first option. |
323 | */ | 323 | */ |
324 | |||
324 | pp->info[0].max_speed_hz = 15 * 1000 * 1000; | 325 | pp->info[0].max_speed_hz = 15 * 1000 * 1000; |
325 | strcpy(pp->info[0].modalias, "mtd_dataflash"); | 326 | strcpy(pp->info[0].modalias, "mtd_dataflash"); |
326 | pp->info[0].platform_data = &flash; | 327 | pp->info[0].platform_data = &flash; |
diff --git a/drivers/spi/spi_mpc83xx.c b/drivers/spi/spi_mpc83xx.c new file mode 100644 index 000000000000..5d92a7e5cb41 --- /dev/null +++ b/drivers/spi/spi_mpc83xx.c | |||
@@ -0,0 +1,483 @@ | |||
1 | /* | ||
2 | * MPC83xx SPI controller driver. | ||
3 | * | ||
4 | * Maintainer: Kumar Gala | ||
5 | * | ||
6 | * Copyright (C) 2006 Polycom, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the | ||
10 | * Free Software Foundation; either version 2 of the License, or (at your | ||
11 | * option) any later version. | ||
12 | */ | ||
13 | #include <linux/module.h> | ||
14 | #include <linux/init.h> | ||
15 | #include <linux/types.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/completion.h> | ||
18 | #include <linux/interrupt.h> | ||
19 | #include <linux/delay.h> | ||
20 | #include <linux/irq.h> | ||
21 | #include <linux/device.h> | ||
22 | #include <linux/spi/spi.h> | ||
23 | #include <linux/spi/spi_bitbang.h> | ||
24 | #include <linux/platform_device.h> | ||
25 | #include <linux/fsl_devices.h> | ||
26 | |||
27 | #include <asm/irq.h> | ||
28 | #include <asm/io.h> | ||
29 | |||
30 | /* SPI Controller registers */ | ||
31 | struct mpc83xx_spi_reg { | ||
32 | u8 res1[0x20]; | ||
33 | __be32 mode; | ||
34 | __be32 event; | ||
35 | __be32 mask; | ||
36 | __be32 command; | ||
37 | __be32 transmit; | ||
38 | __be32 receive; | ||
39 | }; | ||
40 | |||
41 | /* SPI Controller mode register definitions */ | ||
42 | #define SPMODE_CI_INACTIVEHIGH (1 << 29) | ||
43 | #define SPMODE_CP_BEGIN_EDGECLK (1 << 28) | ||
44 | #define SPMODE_DIV16 (1 << 27) | ||
45 | #define SPMODE_REV (1 << 26) | ||
46 | #define SPMODE_MS (1 << 25) | ||
47 | #define SPMODE_ENABLE (1 << 24) | ||
48 | #define SPMODE_LEN(x) ((x) << 20) | ||
49 | #define SPMODE_PM(x) ((x) << 16) | ||
50 | |||
51 | /* | ||
52 | * Default for SPI Mode: | ||
53 | * SPI MODE 0 (inactive low, phase middle, MSB, 8-bit length, slow clk | ||
54 | */ | ||
55 | #define SPMODE_INIT_VAL (SPMODE_CI_INACTIVEHIGH | SPMODE_DIV16 | SPMODE_REV | \ | ||
56 | SPMODE_MS | SPMODE_LEN(7) | SPMODE_PM(0xf)) | ||
57 | |||
58 | /* SPIE register values */ | ||
59 | #define SPIE_NE 0x00000200 /* Not empty */ | ||
60 | #define SPIE_NF 0x00000100 /* Not full */ | ||
61 | |||
62 | /* SPIM register values */ | ||
63 | #define SPIM_NE 0x00000200 /* Not empty */ | ||
64 | #define SPIM_NF 0x00000100 /* Not full */ | ||
65 | |||
66 | /* SPI Controller driver's private data. */ | ||
67 | struct mpc83xx_spi { | ||
68 | /* bitbang has to be first */ | ||
69 | struct spi_bitbang bitbang; | ||
70 | struct completion done; | ||
71 | |||
72 | struct mpc83xx_spi_reg __iomem *base; | ||
73 | |||
74 | /* rx & tx bufs from the spi_transfer */ | ||
75 | const void *tx; | ||
76 | void *rx; | ||
77 | |||
78 | /* functions to deal with different sized buffers */ | ||
79 | void (*get_rx) (u32 rx_data, struct mpc83xx_spi *); | ||
80 | u32(*get_tx) (struct mpc83xx_spi *); | ||
81 | |||
82 | unsigned int count; | ||
83 | u32 irq; | ||
84 | |||
85 | unsigned nsecs; /* (clock cycle time)/2 */ | ||
86 | |||
87 | u32 sysclk; | ||
88 | void (*activate_cs) (u8 cs, u8 polarity); | ||
89 | void (*deactivate_cs) (u8 cs, u8 polarity); | ||
90 | }; | ||
91 | |||
92 | static inline void mpc83xx_spi_write_reg(__be32 __iomem * reg, u32 val) | ||
93 | { | ||
94 | out_be32(reg, val); | ||
95 | } | ||
96 | |||
97 | static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg) | ||
98 | { | ||
99 | return in_be32(reg); | ||
100 | } | ||
101 | |||
102 | #define MPC83XX_SPI_RX_BUF(type) \ | ||
103 | void mpc83xx_spi_rx_buf_##type(u32 data, struct mpc83xx_spi *mpc83xx_spi) \ | ||
104 | { \ | ||
105 | type * rx = mpc83xx_spi->rx; \ | ||
106 | *rx++ = (type)data; \ | ||
107 | mpc83xx_spi->rx = rx; \ | ||
108 | } | ||
109 | |||
110 | #define MPC83XX_SPI_TX_BUF(type) \ | ||
111 | u32 mpc83xx_spi_tx_buf_##type(struct mpc83xx_spi *mpc83xx_spi) \ | ||
112 | { \ | ||
113 | u32 data; \ | ||
114 | const type * tx = mpc83xx_spi->tx; \ | ||
115 | data = *tx++; \ | ||
116 | mpc83xx_spi->tx = tx; \ | ||
117 | return data; \ | ||
118 | } | ||
119 | |||
120 | MPC83XX_SPI_RX_BUF(u8) | ||
121 | MPC83XX_SPI_RX_BUF(u16) | ||
122 | MPC83XX_SPI_RX_BUF(u32) | ||
123 | MPC83XX_SPI_TX_BUF(u8) | ||
124 | MPC83XX_SPI_TX_BUF(u16) | ||
125 | MPC83XX_SPI_TX_BUF(u32) | ||
126 | |||
127 | static void mpc83xx_spi_chipselect(struct spi_device *spi, int value) | ||
128 | { | ||
129 | struct mpc83xx_spi *mpc83xx_spi; | ||
130 | u8 pol = spi->mode & SPI_CS_HIGH ? 1 : 0; | ||
131 | |||
132 | mpc83xx_spi = spi_master_get_devdata(spi->master); | ||
133 | |||
134 | if (value == BITBANG_CS_INACTIVE) { | ||
135 | if (mpc83xx_spi->deactivate_cs) | ||
136 | mpc83xx_spi->deactivate_cs(spi->chip_select, pol); | ||
137 | } | ||
138 | |||
139 | if (value == BITBANG_CS_ACTIVE) { | ||
140 | u32 regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); | ||
141 | u32 len = spi->bits_per_word; | ||
142 | if (len == 32) | ||
143 | len = 0; | ||
144 | else | ||
145 | len = len - 1; | ||
146 | |||
147 | /* mask out bits we are going to set */ | ||
148 | regval &= ~0x38ff0000; | ||
149 | |||
150 | if (spi->mode & SPI_CPHA) | ||
151 | regval |= SPMODE_CP_BEGIN_EDGECLK; | ||
152 | if (spi->mode & SPI_CPOL) | ||
153 | regval |= SPMODE_CI_INACTIVEHIGH; | ||
154 | |||
155 | regval |= SPMODE_LEN(len); | ||
156 | |||
157 | if ((mpc83xx_spi->sysclk / spi->max_speed_hz) >= 64) { | ||
158 | u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 64); | ||
159 | regval |= SPMODE_PM(pm) | SPMODE_DIV16; | ||
160 | } else { | ||
161 | u8 pm = mpc83xx_spi->sysclk / (spi->max_speed_hz * 4); | ||
162 | regval |= SPMODE_PM(pm); | ||
163 | } | ||
164 | |||
165 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); | ||
166 | if (mpc83xx_spi->activate_cs) | ||
167 | mpc83xx_spi->activate_cs(spi->chip_select, pol); | ||
168 | } | ||
169 | } | ||
170 | |||
171 | static | ||
172 | int mpc83xx_spi_setup_transfer(struct spi_device *spi, struct spi_transfer *t) | ||
173 | { | ||
174 | struct mpc83xx_spi *mpc83xx_spi; | ||
175 | u32 regval; | ||
176 | u8 bits_per_word; | ||
177 | u32 hz; | ||
178 | |||
179 | mpc83xx_spi = spi_master_get_devdata(spi->master); | ||
180 | |||
181 | if (t) { | ||
182 | bits_per_word = t->bits_per_word; | ||
183 | hz = t->speed_hz; | ||
184 | } else { | ||
185 | bits_per_word = 0; | ||
186 | hz = 0; | ||
187 | } | ||
188 | |||
189 | /* spi_transfer level calls that work per-word */ | ||
190 | if (!bits_per_word) | ||
191 | bits_per_word = spi->bits_per_word; | ||
192 | |||
193 | /* Make sure its a bit width we support [4..16, 32] */ | ||
194 | if ((bits_per_word < 4) | ||
195 | || ((bits_per_word > 16) && (bits_per_word != 32))) | ||
196 | return -EINVAL; | ||
197 | |||
198 | if (bits_per_word <= 8) { | ||
199 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; | ||
200 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; | ||
201 | } else if (bits_per_word <= 16) { | ||
202 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u16; | ||
203 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u16; | ||
204 | } else if (bits_per_word <= 32) { | ||
205 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u32; | ||
206 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u32; | ||
207 | } else | ||
208 | return -EINVAL; | ||
209 | |||
210 | /* nsecs = (clock period)/2 */ | ||
211 | if (!hz) | ||
212 | hz = spi->max_speed_hz; | ||
213 | mpc83xx_spi->nsecs = (1000000000 / 2) / hz; | ||
214 | if (mpc83xx_spi->nsecs > MAX_UDELAY_MS * 1000) | ||
215 | return -EINVAL; | ||
216 | |||
217 | if (bits_per_word == 32) | ||
218 | bits_per_word = 0; | ||
219 | else | ||
220 | bits_per_word = bits_per_word - 1; | ||
221 | |||
222 | regval = mpc83xx_spi_read_reg(&mpc83xx_spi->base->mode); | ||
223 | |||
224 | /* Mask out bits_per_wordgth */ | ||
225 | regval &= 0xff0fffff; | ||
226 | regval |= SPMODE_LEN(bits_per_word); | ||
227 | |||
228 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); | ||
229 | |||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | static int mpc83xx_spi_setup(struct spi_device *spi) | ||
234 | { | ||
235 | struct spi_bitbang *bitbang; | ||
236 | struct mpc83xx_spi *mpc83xx_spi; | ||
237 | int retval; | ||
238 | |||
239 | if (!spi->max_speed_hz) | ||
240 | return -EINVAL; | ||
241 | |||
242 | bitbang = spi_master_get_devdata(spi->master); | ||
243 | mpc83xx_spi = spi_master_get_devdata(spi->master); | ||
244 | |||
245 | if (!spi->bits_per_word) | ||
246 | spi->bits_per_word = 8; | ||
247 | |||
248 | retval = mpc83xx_spi_setup_transfer(spi, NULL); | ||
249 | if (retval < 0) | ||
250 | return retval; | ||
251 | |||
252 | dev_dbg(&spi->dev, "%s, mode %d, %u bits/w, %u nsec\n", | ||
253 | __FUNCTION__, spi->mode & (SPI_CPOL | SPI_CPHA), | ||
254 | spi->bits_per_word, 2 * mpc83xx_spi->nsecs); | ||
255 | |||
256 | /* NOTE we _need_ to call chipselect() early, ideally with adapter | ||
257 | * setup, unless the hardware defaults cooperate to avoid confusion | ||
258 | * between normal (active low) and inverted chipselects. | ||
259 | */ | ||
260 | |||
261 | /* deselect chip (low or high) */ | ||
262 | spin_lock(&bitbang->lock); | ||
263 | if (!bitbang->busy) { | ||
264 | bitbang->chipselect(spi, BITBANG_CS_INACTIVE); | ||
265 | ndelay(mpc83xx_spi->nsecs); | ||
266 | } | ||
267 | spin_unlock(&bitbang->lock); | ||
268 | |||
269 | return 0; | ||
270 | } | ||
271 | |||
272 | static int mpc83xx_spi_bufs(struct spi_device *spi, struct spi_transfer *t) | ||
273 | { | ||
274 | struct mpc83xx_spi *mpc83xx_spi; | ||
275 | u32 word; | ||
276 | |||
277 | mpc83xx_spi = spi_master_get_devdata(spi->master); | ||
278 | |||
279 | mpc83xx_spi->tx = t->tx_buf; | ||
280 | mpc83xx_spi->rx = t->rx_buf; | ||
281 | mpc83xx_spi->count = t->len; | ||
282 | INIT_COMPLETION(mpc83xx_spi->done); | ||
283 | |||
284 | /* enable rx ints */ | ||
285 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, SPIM_NE); | ||
286 | |||
287 | /* transmit word */ | ||
288 | word = mpc83xx_spi->get_tx(mpc83xx_spi); | ||
289 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, word); | ||
290 | |||
291 | wait_for_completion(&mpc83xx_spi->done); | ||
292 | |||
293 | /* disable rx ints */ | ||
294 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0); | ||
295 | |||
296 | return t->len - mpc83xx_spi->count; | ||
297 | } | ||
298 | |||
299 | irqreturn_t mpc83xx_spi_irq(s32 irq, void *context_data, | ||
300 | struct pt_regs * ptregs) | ||
301 | { | ||
302 | struct mpc83xx_spi *mpc83xx_spi = context_data; | ||
303 | u32 event; | ||
304 | irqreturn_t ret = IRQ_NONE; | ||
305 | |||
306 | /* Get interrupt events(tx/rx) */ | ||
307 | event = mpc83xx_spi_read_reg(&mpc83xx_spi->base->event); | ||
308 | |||
309 | /* We need handle RX first */ | ||
310 | if (event & SPIE_NE) { | ||
311 | u32 rx_data = mpc83xx_spi_read_reg(&mpc83xx_spi->base->receive); | ||
312 | |||
313 | if (mpc83xx_spi->rx) | ||
314 | mpc83xx_spi->get_rx(rx_data, mpc83xx_spi); | ||
315 | |||
316 | ret = IRQ_HANDLED; | ||
317 | } | ||
318 | |||
319 | if ((event & SPIE_NF) == 0) | ||
320 | /* spin until TX is done */ | ||
321 | while (((event = | ||
322 | mpc83xx_spi_read_reg(&mpc83xx_spi->base->event)) & | ||
323 | SPIE_NF) == 0) | ||
324 | cpu_relax(); | ||
325 | |||
326 | mpc83xx_spi->count -= 1; | ||
327 | if (mpc83xx_spi->count) { | ||
328 | if (mpc83xx_spi->tx) { | ||
329 | u32 word = mpc83xx_spi->get_tx(mpc83xx_spi); | ||
330 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->transmit, | ||
331 | word); | ||
332 | } | ||
333 | } else { | ||
334 | complete(&mpc83xx_spi->done); | ||
335 | } | ||
336 | |||
337 | /* Clear the events */ | ||
338 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->event, event); | ||
339 | |||
340 | return ret; | ||
341 | } | ||
342 | |||
343 | static int __init mpc83xx_spi_probe(struct platform_device *dev) | ||
344 | { | ||
345 | struct spi_master *master; | ||
346 | struct mpc83xx_spi *mpc83xx_spi; | ||
347 | struct fsl_spi_platform_data *pdata; | ||
348 | struct resource *r; | ||
349 | u32 regval; | ||
350 | int ret = 0; | ||
351 | |||
352 | /* Get resources(memory, IRQ) associated with the device */ | ||
353 | master = spi_alloc_master(&dev->dev, sizeof(struct mpc83xx_spi)); | ||
354 | |||
355 | if (master == NULL) { | ||
356 | ret = -ENOMEM; | ||
357 | goto err; | ||
358 | } | ||
359 | |||
360 | platform_set_drvdata(dev, master); | ||
361 | pdata = dev->dev.platform_data; | ||
362 | |||
363 | if (pdata == NULL) { | ||
364 | ret = -ENODEV; | ||
365 | goto free_master; | ||
366 | } | ||
367 | |||
368 | r = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
369 | if (r == NULL) { | ||
370 | ret = -ENODEV; | ||
371 | goto free_master; | ||
372 | } | ||
373 | |||
374 | mpc83xx_spi = spi_master_get_devdata(master); | ||
375 | mpc83xx_spi->bitbang.master = spi_master_get(master); | ||
376 | mpc83xx_spi->bitbang.chipselect = mpc83xx_spi_chipselect; | ||
377 | mpc83xx_spi->bitbang.setup_transfer = mpc83xx_spi_setup_transfer; | ||
378 | mpc83xx_spi->bitbang.txrx_bufs = mpc83xx_spi_bufs; | ||
379 | mpc83xx_spi->sysclk = pdata->sysclk; | ||
380 | mpc83xx_spi->activate_cs = pdata->activate_cs; | ||
381 | mpc83xx_spi->deactivate_cs = pdata->deactivate_cs; | ||
382 | mpc83xx_spi->get_rx = mpc83xx_spi_rx_buf_u8; | ||
383 | mpc83xx_spi->get_tx = mpc83xx_spi_tx_buf_u8; | ||
384 | |||
385 | mpc83xx_spi->bitbang.master->setup = mpc83xx_spi_setup; | ||
386 | init_completion(&mpc83xx_spi->done); | ||
387 | |||
388 | mpc83xx_spi->base = ioremap(r->start, r->end - r->start + 1); | ||
389 | if (mpc83xx_spi->base == NULL) { | ||
390 | ret = -ENOMEM; | ||
391 | goto put_master; | ||
392 | } | ||
393 | |||
394 | mpc83xx_spi->irq = platform_get_irq(dev, 0); | ||
395 | |||
396 | if (mpc83xx_spi->irq < 0) { | ||
397 | ret = -ENXIO; | ||
398 | goto unmap_io; | ||
399 | } | ||
400 | |||
401 | /* Register for SPI Interrupt */ | ||
402 | ret = request_irq(mpc83xx_spi->irq, mpc83xx_spi_irq, | ||
403 | 0, "mpc83xx_spi", mpc83xx_spi); | ||
404 | |||
405 | if (ret != 0) | ||
406 | goto unmap_io; | ||
407 | |||
408 | master->bus_num = pdata->bus_num; | ||
409 | master->num_chipselect = pdata->max_chipselect; | ||
410 | |||
411 | /* SPI controller initializations */ | ||
412 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, 0); | ||
413 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mask, 0); | ||
414 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->command, 0); | ||
415 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->event, 0xffffffff); | ||
416 | |||
417 | /* Enable SPI interface */ | ||
418 | regval = pdata->initial_spmode | SPMODE_INIT_VAL | SPMODE_ENABLE; | ||
419 | mpc83xx_spi_write_reg(&mpc83xx_spi->base->mode, regval); | ||
420 | |||
421 | ret = spi_bitbang_start(&mpc83xx_spi->bitbang); | ||
422 | |||
423 | if (ret != 0) | ||
424 | goto free_irq; | ||
425 | |||
426 | printk(KERN_INFO | ||
427 | "%s: MPC83xx SPI Controller driver at 0x%p (irq = %d)\n", | ||
428 | dev->dev.bus_id, mpc83xx_spi->base, mpc83xx_spi->irq); | ||
429 | |||
430 | return ret; | ||
431 | |||
432 | free_irq: | ||
433 | free_irq(mpc83xx_spi->irq, mpc83xx_spi); | ||
434 | unmap_io: | ||
435 | iounmap(mpc83xx_spi->base); | ||
436 | put_master: | ||
437 | spi_master_put(master); | ||
438 | free_master: | ||
439 | kfree(master); | ||
440 | err: | ||
441 | return ret; | ||
442 | } | ||
443 | |||
444 | static int __devexit mpc83xx_spi_remove(struct platform_device *dev) | ||
445 | { | ||
446 | struct mpc83xx_spi *mpc83xx_spi; | ||
447 | struct spi_master *master; | ||
448 | |||
449 | master = platform_get_drvdata(dev); | ||
450 | mpc83xx_spi = spi_master_get_devdata(master); | ||
451 | |||
452 | spi_bitbang_stop(&mpc83xx_spi->bitbang); | ||
453 | free_irq(mpc83xx_spi->irq, mpc83xx_spi); | ||
454 | iounmap(mpc83xx_spi->base); | ||
455 | spi_master_put(mpc83xx_spi->bitbang.master); | ||
456 | |||
457 | return 0; | ||
458 | } | ||
459 | |||
460 | static struct platform_driver mpc83xx_spi_driver = { | ||
461 | .probe = mpc83xx_spi_probe, | ||
462 | .remove = __devexit_p(mpc83xx_spi_remove), | ||
463 | .driver = { | ||
464 | .name = "mpc83xx_spi", | ||
465 | }, | ||
466 | }; | ||
467 | |||
468 | static int __init mpc83xx_spi_init(void) | ||
469 | { | ||
470 | return platform_driver_register(&mpc83xx_spi_driver); | ||
471 | } | ||
472 | |||
473 | static void __exit mpc83xx_spi_exit(void) | ||
474 | { | ||
475 | platform_driver_unregister(&mpc83xx_spi_driver); | ||
476 | } | ||
477 | |||
478 | module_init(mpc83xx_spi_init); | ||
479 | module_exit(mpc83xx_spi_exit); | ||
480 | |||
481 | MODULE_AUTHOR("Kumar Gala"); | ||
482 | MODULE_DESCRIPTION("Simple MPC83xx SPI Driver"); | ||
483 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c new file mode 100644 index 000000000000..9de4b5a04d70 --- /dev/null +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -0,0 +1,453 @@ | |||
1 | /* linux/drivers/spi/spi_s3c24xx.c | ||
2 | * | ||
3 | * Copyright (c) 2006 Ben Dooks | ||
4 | * Copyright (c) 2006 Simtec Electronics | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | |||
14 | //#define DEBUG | ||
15 | |||
16 | #include <linux/config.h> | ||
17 | #include <linux/init.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | #include <linux/workqueue.h> | ||
20 | #include <linux/interrupt.h> | ||
21 | #include <linux/delay.h> | ||
22 | #include <linux/errno.h> | ||
23 | #include <linux/err.h> | ||
24 | #include <linux/clk.h> | ||
25 | #include <linux/platform_device.h> | ||
26 | |||
27 | #include <linux/spi/spi.h> | ||
28 | #include <linux/spi/spi_bitbang.h> | ||
29 | |||
30 | #include <asm/io.h> | ||
31 | #include <asm/dma.h> | ||
32 | #include <asm/hardware.h> | ||
33 | |||
34 | #include <asm/arch/regs-gpio.h> | ||
35 | #include <asm/arch/regs-spi.h> | ||
36 | #include <asm/arch/spi.h> | ||
37 | |||
38 | struct s3c24xx_spi { | ||
39 | /* bitbang has to be first */ | ||
40 | struct spi_bitbang bitbang; | ||
41 | struct completion done; | ||
42 | |||
43 | void __iomem *regs; | ||
44 | int irq; | ||
45 | int len; | ||
46 | int count; | ||
47 | |||
48 | /* data buffers */ | ||
49 | const unsigned char *tx; | ||
50 | unsigned char *rx; | ||
51 | |||
52 | struct clk *clk; | ||
53 | struct resource *ioarea; | ||
54 | struct spi_master *master; | ||
55 | struct spi_device *curdev; | ||
56 | struct device *dev; | ||
57 | struct s3c2410_spi_info *pdata; | ||
58 | }; | ||
59 | |||
60 | #define SPCON_DEFAULT (S3C2410_SPCON_MSTR | S3C2410_SPCON_SMOD_INT) | ||
61 | #define SPPIN_DEFAULT (S3C2410_SPPIN_KEEP) | ||
62 | |||
63 | static inline struct s3c24xx_spi *to_hw(struct spi_device *sdev) | ||
64 | { | ||
65 | return spi_master_get_devdata(sdev->master); | ||
66 | } | ||
67 | |||
68 | static void s3c24xx_spi_chipsel(struct spi_device *spi, int value) | ||
69 | { | ||
70 | struct s3c24xx_spi *hw = to_hw(spi); | ||
71 | unsigned int cspol = spi->mode & SPI_CS_HIGH ? 1 : 0; | ||
72 | unsigned int spcon; | ||
73 | |||
74 | switch (value) { | ||
75 | case BITBANG_CS_INACTIVE: | ||
76 | if (hw->pdata->set_cs) | ||
77 | hw->pdata->set_cs(hw->pdata, value, cspol); | ||
78 | else | ||
79 | s3c2410_gpio_setpin(hw->pdata->pin_cs, cspol ^ 1); | ||
80 | break; | ||
81 | |||
82 | case BITBANG_CS_ACTIVE: | ||
83 | spcon = readb(hw->regs + S3C2410_SPCON); | ||
84 | |||
85 | if (spi->mode & SPI_CPHA) | ||
86 | spcon |= S3C2410_SPCON_CPHA_FMTB; | ||
87 | else | ||
88 | spcon &= ~S3C2410_SPCON_CPHA_FMTB; | ||
89 | |||
90 | if (spi->mode & SPI_CPOL) | ||
91 | spcon |= S3C2410_SPCON_CPOL_HIGH; | ||
92 | else | ||
93 | spcon &= ~S3C2410_SPCON_CPOL_HIGH; | ||
94 | |||
95 | spcon |= S3C2410_SPCON_ENSCK; | ||
96 | |||
97 | /* write new configration */ | ||
98 | |||
99 | writeb(spcon, hw->regs + S3C2410_SPCON); | ||
100 | |||
101 | if (hw->pdata->set_cs) | ||
102 | hw->pdata->set_cs(hw->pdata, value, cspol); | ||
103 | else | ||
104 | s3c2410_gpio_setpin(hw->pdata->pin_cs, cspol); | ||
105 | |||
106 | break; | ||
107 | |||
108 | } | ||
109 | } | ||
110 | |||
111 | static int s3c24xx_spi_setupxfer(struct spi_device *spi, | ||
112 | struct spi_transfer *t) | ||
113 | { | ||
114 | struct s3c24xx_spi *hw = to_hw(spi); | ||
115 | unsigned int bpw; | ||
116 | unsigned int hz; | ||
117 | unsigned int div; | ||
118 | |||
119 | bpw = t ? t->bits_per_word : spi->bits_per_word; | ||
120 | hz = t ? t->speed_hz : spi->max_speed_hz; | ||
121 | |||
122 | if (bpw != 8) { | ||
123 | dev_err(&spi->dev, "invalid bits-per-word (%d)\n", bpw); | ||
124 | return -EINVAL; | ||
125 | } | ||
126 | |||
127 | div = clk_get_rate(hw->clk) / hz; | ||
128 | |||
129 | /* is clk = pclk / (2 * (pre+1)), or is it | ||
130 | * clk = (pclk * 2) / ( pre + 1) */ | ||
131 | |||
132 | div = (div / 2) - 1; | ||
133 | |||
134 | if (div < 0) | ||
135 | div = 1; | ||
136 | |||
137 | if (div > 255) | ||
138 | div = 255; | ||
139 | |||
140 | dev_dbg(&spi->dev, "setting pre-scaler to %d (hz %d)\n", div, hz); | ||
141 | writeb(div, hw->regs + S3C2410_SPPRE); | ||
142 | |||
143 | spin_lock(&hw->bitbang.lock); | ||
144 | if (!hw->bitbang.busy) { | ||
145 | hw->bitbang.chipselect(spi, BITBANG_CS_INACTIVE); | ||
146 | /* need to ndelay for 0.5 clocktick ? */ | ||
147 | } | ||
148 | spin_unlock(&hw->bitbang.lock); | ||
149 | |||
150 | return 0; | ||
151 | } | ||
152 | |||
153 | static int s3c24xx_spi_setup(struct spi_device *spi) | ||
154 | { | ||
155 | int ret; | ||
156 | |||
157 | if (!spi->bits_per_word) | ||
158 | spi->bits_per_word = 8; | ||
159 | |||
160 | if ((spi->mode & SPI_LSB_FIRST) != 0) | ||
161 | return -EINVAL; | ||
162 | |||
163 | ret = s3c24xx_spi_setupxfer(spi, NULL); | ||
164 | if (ret < 0) { | ||
165 | dev_err(&spi->dev, "setupxfer returned %d\n", ret); | ||
166 | return ret; | ||
167 | } | ||
168 | |||
169 | dev_dbg(&spi->dev, "%s: mode %d, %u bpw, %d hz\n", | ||
170 | __FUNCTION__, spi->mode, spi->bits_per_word, | ||
171 | spi->max_speed_hz); | ||
172 | |||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | static inline unsigned int hw_txbyte(struct s3c24xx_spi *hw, int count) | ||
177 | { | ||
178 | return hw->tx ? hw->tx[count] : 0xff; | ||
179 | } | ||
180 | |||
181 | static int s3c24xx_spi_txrx(struct spi_device *spi, struct spi_transfer *t) | ||
182 | { | ||
183 | struct s3c24xx_spi *hw = to_hw(spi); | ||
184 | |||
185 | dev_dbg(&spi->dev, "txrx: tx %p, rx %p, len %d\n", | ||
186 | t->tx_buf, t->rx_buf, t->len); | ||
187 | |||
188 | hw->tx = t->tx_buf; | ||
189 | hw->rx = t->rx_buf; | ||
190 | hw->len = t->len; | ||
191 | hw->count = 0; | ||
192 | |||
193 | /* send the first byte */ | ||
194 | writeb(hw_txbyte(hw, 0), hw->regs + S3C2410_SPTDAT); | ||
195 | wait_for_completion(&hw->done); | ||
196 | |||
197 | return hw->count; | ||
198 | } | ||
199 | |||
200 | static irqreturn_t s3c24xx_spi_irq(int irq, void *dev, struct pt_regs *regs) | ||
201 | { | ||
202 | struct s3c24xx_spi *hw = dev; | ||
203 | unsigned int spsta = readb(hw->regs + S3C2410_SPSTA); | ||
204 | unsigned int count = hw->count; | ||
205 | |||
206 | if (spsta & S3C2410_SPSTA_DCOL) { | ||
207 | dev_dbg(hw->dev, "data-collision\n"); | ||
208 | complete(&hw->done); | ||
209 | goto irq_done; | ||
210 | } | ||
211 | |||
212 | if (!(spsta & S3C2410_SPSTA_READY)) { | ||
213 | dev_dbg(hw->dev, "spi not ready for tx?\n"); | ||
214 | complete(&hw->done); | ||
215 | goto irq_done; | ||
216 | } | ||
217 | |||
218 | hw->count++; | ||
219 | |||
220 | if (hw->rx) | ||
221 | hw->rx[count] = readb(hw->regs + S3C2410_SPRDAT); | ||
222 | |||
223 | count++; | ||
224 | |||
225 | if (count < hw->len) | ||
226 | writeb(hw_txbyte(hw, count), hw->regs + S3C2410_SPTDAT); | ||
227 | else | ||
228 | complete(&hw->done); | ||
229 | |||
230 | irq_done: | ||
231 | return IRQ_HANDLED; | ||
232 | } | ||
233 | |||
234 | static int s3c24xx_spi_probe(struct platform_device *pdev) | ||
235 | { | ||
236 | struct s3c24xx_spi *hw; | ||
237 | struct spi_master *master; | ||
238 | struct spi_board_info *bi; | ||
239 | struct resource *res; | ||
240 | int err = 0; | ||
241 | int i; | ||
242 | |||
243 | master = spi_alloc_master(&pdev->dev, sizeof(struct s3c24xx_spi)); | ||
244 | if (master == NULL) { | ||
245 | dev_err(&pdev->dev, "No memory for spi_master\n"); | ||
246 | err = -ENOMEM; | ||
247 | goto err_nomem; | ||
248 | } | ||
249 | |||
250 | hw = spi_master_get_devdata(master); | ||
251 | memset(hw, 0, sizeof(struct s3c24xx_spi)); | ||
252 | |||
253 | hw->master = spi_master_get(master); | ||
254 | hw->pdata = pdev->dev.platform_data; | ||
255 | hw->dev = &pdev->dev; | ||
256 | |||
257 | if (hw->pdata == NULL) { | ||
258 | dev_err(&pdev->dev, "No platform data supplied\n"); | ||
259 | err = -ENOENT; | ||
260 | goto err_no_pdata; | ||
261 | } | ||
262 | |||
263 | platform_set_drvdata(pdev, hw); | ||
264 | init_completion(&hw->done); | ||
265 | |||
266 | /* setup the state for the bitbang driver */ | ||
267 | |||
268 | hw->bitbang.master = hw->master; | ||
269 | hw->bitbang.setup_transfer = s3c24xx_spi_setupxfer; | ||
270 | hw->bitbang.chipselect = s3c24xx_spi_chipsel; | ||
271 | hw->bitbang.txrx_bufs = s3c24xx_spi_txrx; | ||
272 | hw->bitbang.master->setup = s3c24xx_spi_setup; | ||
273 | |||
274 | dev_dbg(hw->dev, "bitbang at %p\n", &hw->bitbang); | ||
275 | |||
276 | /* find and map our resources */ | ||
277 | |||
278 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
279 | if (res == NULL) { | ||
280 | dev_err(&pdev->dev, "Cannot get IORESOURCE_MEM\n"); | ||
281 | err = -ENOENT; | ||
282 | goto err_no_iores; | ||
283 | } | ||
284 | |||
285 | hw->ioarea = request_mem_region(res->start, (res->end - res->start)+1, | ||
286 | pdev->name); | ||
287 | |||
288 | if (hw->ioarea == NULL) { | ||
289 | dev_err(&pdev->dev, "Cannot reserve region\n"); | ||
290 | err = -ENXIO; | ||
291 | goto err_no_iores; | ||
292 | } | ||
293 | |||
294 | hw->regs = ioremap(res->start, (res->end - res->start)+1); | ||
295 | if (hw->regs == NULL) { | ||
296 | dev_err(&pdev->dev, "Cannot map IO\n"); | ||
297 | err = -ENXIO; | ||
298 | goto err_no_iomap; | ||
299 | } | ||
300 | |||
301 | hw->irq = platform_get_irq(pdev, 0); | ||
302 | if (hw->irq < 0) { | ||
303 | dev_err(&pdev->dev, "No IRQ specified\n"); | ||
304 | err = -ENOENT; | ||
305 | goto err_no_irq; | ||
306 | } | ||
307 | |||
308 | err = request_irq(hw->irq, s3c24xx_spi_irq, 0, pdev->name, hw); | ||
309 | if (err) { | ||
310 | dev_err(&pdev->dev, "Cannot claim IRQ\n"); | ||
311 | goto err_no_irq; | ||
312 | } | ||
313 | |||
314 | hw->clk = clk_get(&pdev->dev, "spi"); | ||
315 | if (IS_ERR(hw->clk)) { | ||
316 | dev_err(&pdev->dev, "No clock for device\n"); | ||
317 | err = PTR_ERR(hw->clk); | ||
318 | goto err_no_clk; | ||
319 | } | ||
320 | |||
321 | /* for the moment, permanently enable the clock */ | ||
322 | |||
323 | clk_enable(hw->clk); | ||
324 | |||
325 | /* program defaults into the registers */ | ||
326 | |||
327 | writeb(0xff, hw->regs + S3C2410_SPPRE); | ||
328 | writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN); | ||
329 | writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON); | ||
330 | |||
331 | /* setup any gpio we can */ | ||
332 | |||
333 | if (!hw->pdata->set_cs) { | ||
334 | s3c2410_gpio_setpin(hw->pdata->pin_cs, 1); | ||
335 | s3c2410_gpio_cfgpin(hw->pdata->pin_cs, S3C2410_GPIO_OUTPUT); | ||
336 | } | ||
337 | |||
338 | /* register our spi controller */ | ||
339 | |||
340 | err = spi_bitbang_start(&hw->bitbang); | ||
341 | if (err) { | ||
342 | dev_err(&pdev->dev, "Failed to register SPI master\n"); | ||
343 | goto err_register; | ||
344 | } | ||
345 | |||
346 | dev_dbg(hw->dev, "shutdown=%d\n", hw->bitbang.shutdown); | ||
347 | |||
348 | /* register all the devices associated */ | ||
349 | |||
350 | bi = &hw->pdata->board_info[0]; | ||
351 | for (i = 0; i < hw->pdata->board_size; i++, bi++) { | ||
352 | dev_info(hw->dev, "registering %s\n", bi->modalias); | ||
353 | |||
354 | bi->controller_data = hw; | ||
355 | spi_new_device(master, bi); | ||
356 | } | ||
357 | |||
358 | return 0; | ||
359 | |||
360 | err_register: | ||
361 | clk_disable(hw->clk); | ||
362 | clk_put(hw->clk); | ||
363 | |||
364 | err_no_clk: | ||
365 | free_irq(hw->irq, hw); | ||
366 | |||
367 | err_no_irq: | ||
368 | iounmap(hw->regs); | ||
369 | |||
370 | err_no_iomap: | ||
371 | release_resource(hw->ioarea); | ||
372 | kfree(hw->ioarea); | ||
373 | |||
374 | err_no_iores: | ||
375 | err_no_pdata: | ||
376 | spi_master_put(hw->master);; | ||
377 | |||
378 | err_nomem: | ||
379 | return err; | ||
380 | } | ||
381 | |||
382 | static int s3c24xx_spi_remove(struct platform_device *dev) | ||
383 | { | ||
384 | struct s3c24xx_spi *hw = platform_get_drvdata(dev); | ||
385 | |||
386 | platform_set_drvdata(dev, NULL); | ||
387 | |||
388 | spi_unregister_master(hw->master); | ||
389 | |||
390 | clk_disable(hw->clk); | ||
391 | clk_put(hw->clk); | ||
392 | |||
393 | free_irq(hw->irq, hw); | ||
394 | iounmap(hw->regs); | ||
395 | |||
396 | release_resource(hw->ioarea); | ||
397 | kfree(hw->ioarea); | ||
398 | |||
399 | spi_master_put(hw->master); | ||
400 | return 0; | ||
401 | } | ||
402 | |||
403 | |||
404 | #ifdef CONFIG_PM | ||
405 | |||
406 | static int s3c24xx_spi_suspend(struct platform_device *pdev, pm_message_t msg) | ||
407 | { | ||
408 | struct s3c24xx_spi *hw = platform_get_drvdata(dev); | ||
409 | |||
410 | clk_disable(hw->clk); | ||
411 | return 0; | ||
412 | } | ||
413 | |||
414 | static int s3c24xx_spi_resume(struct platform_device *pdev) | ||
415 | { | ||
416 | struct s3c24xx_spi *hw = platform_get_drvdata(dev); | ||
417 | |||
418 | clk_enable(hw->clk); | ||
419 | return 0; | ||
420 | } | ||
421 | |||
422 | #else | ||
423 | #define s3c24xx_spi_suspend NULL | ||
424 | #define s3c24xx_spi_resume NULL | ||
425 | #endif | ||
426 | |||
427 | static struct platform_driver s3c24xx_spidrv = { | ||
428 | .probe = s3c24xx_spi_probe, | ||
429 | .remove = s3c24xx_spi_remove, | ||
430 | .suspend = s3c24xx_spi_suspend, | ||
431 | .resume = s3c24xx_spi_resume, | ||
432 | .driver = { | ||
433 | .name = "s3c2410-spi", | ||
434 | .owner = THIS_MODULE, | ||
435 | }, | ||
436 | }; | ||
437 | |||
438 | static int __init s3c24xx_spi_init(void) | ||
439 | { | ||
440 | return platform_driver_register(&s3c24xx_spidrv); | ||
441 | } | ||
442 | |||
443 | static void __exit s3c24xx_spi_exit(void) | ||
444 | { | ||
445 | platform_driver_unregister(&s3c24xx_spidrv); | ||
446 | } | ||
447 | |||
448 | module_init(s3c24xx_spi_init); | ||
449 | module_exit(s3c24xx_spi_exit); | ||
450 | |||
451 | MODULE_DESCRIPTION("S3C24XX SPI Driver"); | ||
452 | MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); | ||
453 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/spi/spi_s3c24xx_gpio.c b/drivers/spi/spi_s3c24xx_gpio.c new file mode 100644 index 000000000000..aacdceb8f44b --- /dev/null +++ b/drivers/spi/spi_s3c24xx_gpio.c | |||
@@ -0,0 +1,188 @@ | |||
1 | /* linux/drivers/spi/spi_s3c24xx_gpio.c | ||
2 | * | ||
3 | * Copyright (c) 2006 Ben Dooks | ||
4 | * Copyright (c) 2006 Simtec Electronics | ||
5 | * | ||
6 | * S3C24XX GPIO based SPI driver | ||
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/config.h> | ||
15 | #include <linux/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/delay.h> | ||
18 | #include <linux/spinlock.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | |||
21 | #include <linux/spi/spi.h> | ||
22 | #include <linux/spi/spi_bitbang.h> | ||
23 | |||
24 | #include <asm/arch/regs-gpio.h> | ||
25 | #include <asm/arch/spi-gpio.h> | ||
26 | #include <asm/arch/hardware.h> | ||
27 | |||
28 | struct s3c2410_spigpio { | ||
29 | struct spi_bitbang bitbang; | ||
30 | |||
31 | struct s3c2410_spigpio_info *info; | ||
32 | struct platform_device *dev; | ||
33 | }; | ||
34 | |||
35 | static inline struct s3c2410_spigpio *spidev_to_sg(struct spi_device *spi) | ||
36 | { | ||
37 | return spi->controller_data; | ||
38 | } | ||
39 | |||
40 | static inline void setsck(struct spi_device *dev, int on) | ||
41 | { | ||
42 | struct s3c2410_spigpio *sg = spidev_to_sg(dev); | ||
43 | s3c2410_gpio_setpin(sg->info->pin_clk, on ? 1 : 0); | ||
44 | } | ||
45 | |||
46 | static inline void setmosi(struct spi_device *dev, int on) | ||
47 | { | ||
48 | struct s3c2410_spigpio *sg = spidev_to_sg(dev); | ||
49 | s3c2410_gpio_setpin(sg->info->pin_mosi, on ? 1 : 0); | ||
50 | } | ||
51 | |||
52 | static inline u32 getmiso(struct spi_device *dev) | ||
53 | { | ||
54 | struct s3c2410_spigpio *sg = spidev_to_sg(dev); | ||
55 | return s3c2410_gpio_getpin(sg->info->pin_miso) ? 1 : 0; | ||
56 | } | ||
57 | |||
58 | #define spidelay(x) ndelay(x) | ||
59 | |||
60 | #define EXPAND_BITBANG_TXRX | ||
61 | #include <linux/spi/spi_bitbang.h> | ||
62 | |||
63 | |||
64 | static u32 s3c2410_spigpio_txrx_mode0(struct spi_device *spi, | ||
65 | unsigned nsecs, u32 word, u8 bits) | ||
66 | { | ||
67 | return bitbang_txrx_be_cpha0(spi, nsecs, 0, word, bits); | ||
68 | } | ||
69 | |||
70 | static u32 s3c2410_spigpio_txrx_mode1(struct spi_device *spi, | ||
71 | unsigned nsecs, u32 word, u8 bits) | ||
72 | { | ||
73 | return bitbang_txrx_be_cpha1(spi, nsecs, 0, word, bits); | ||
74 | } | ||
75 | |||
76 | static void s3c2410_spigpio_chipselect(struct spi_device *dev, int value) | ||
77 | { | ||
78 | struct s3c2410_spigpio *sg = spidev_to_sg(dev); | ||
79 | |||
80 | if (sg->info && sg->info->chip_select) | ||
81 | (sg->info->chip_select)(sg->info, value); | ||
82 | } | ||
83 | |||
84 | static int s3c2410_spigpio_probe(struct platform_device *dev) | ||
85 | { | ||
86 | struct spi_master *master; | ||
87 | struct s3c2410_spigpio *sp; | ||
88 | int ret; | ||
89 | int i; | ||
90 | |||
91 | master = spi_alloc_master(&dev->dev, sizeof(struct s3c2410_spigpio)); | ||
92 | if (master == NULL) { | ||
93 | dev_err(&dev->dev, "failed to allocate spi master\n"); | ||
94 | ret = -ENOMEM; | ||
95 | goto err; | ||
96 | } | ||
97 | |||
98 | sp = spi_master_get_devdata(master); | ||
99 | |||
100 | platform_set_drvdata(dev, sp); | ||
101 | |||
102 | /* copy in the plkatform data */ | ||
103 | sp->info = dev->dev.platform_data; | ||
104 | |||
105 | /* setup spi bitbang adaptor */ | ||
106 | sp->bitbang.master = spi_master_get(master); | ||
107 | sp->bitbang.chipselect = s3c2410_spigpio_chipselect; | ||
108 | |||
109 | sp->bitbang.txrx_word[SPI_MODE_0] = s3c2410_spigpio_txrx_mode0; | ||
110 | sp->bitbang.txrx_word[SPI_MODE_1] = s3c2410_spigpio_txrx_mode1; | ||
111 | |||
112 | /* set state of spi pins */ | ||
113 | s3c2410_gpio_setpin(sp->info->pin_clk, 0); | ||
114 | s3c2410_gpio_setpin(sp->info->pin_mosi, 0); | ||
115 | |||
116 | s3c2410_gpio_cfgpin(sp->info->pin_clk, S3C2410_GPIO_OUTPUT); | ||
117 | s3c2410_gpio_cfgpin(sp->info->pin_mosi, S3C2410_GPIO_OUTPUT); | ||
118 | s3c2410_gpio_cfgpin(sp->info->pin_miso, S3C2410_GPIO_INPUT); | ||
119 | |||
120 | ret = spi_bitbang_start(&sp->bitbang); | ||
121 | if (ret) | ||
122 | goto err_no_bitbang; | ||
123 | |||
124 | /* register the chips to go with the board */ | ||
125 | |||
126 | for (i = 0; i < sp->info->board_size; i++) { | ||
127 | dev_info(&dev->dev, "registering %p: %s\n", | ||
128 | &sp->info->board_info[i], | ||
129 | sp->info->board_info[i].modalias); | ||
130 | |||
131 | sp->info->board_info[i].controller_data = sp; | ||
132 | spi_new_device(master, sp->info->board_info + i); | ||
133 | } | ||
134 | |||
135 | return 0; | ||
136 | |||
137 | err_no_bitbang: | ||
138 | spi_master_put(sp->bitbang.master); | ||
139 | err: | ||
140 | return ret; | ||
141 | |||
142 | } | ||
143 | |||
144 | static int s3c2410_spigpio_remove(struct platform_device *dev) | ||
145 | { | ||
146 | struct s3c2410_spigpio *sp = platform_get_drvdata(dev); | ||
147 | |||
148 | spi_bitbang_stop(&sp->bitbang); | ||
149 | spi_master_put(sp->bitbang.master); | ||
150 | |||
151 | return 0; | ||
152 | } | ||
153 | |||
154 | /* all gpio should be held over suspend/resume, so we should | ||
155 | * not need to deal with this | ||
156 | */ | ||
157 | |||
158 | #define s3c2410_spigpio_suspend NULL | ||
159 | #define s3c2410_spigpio_resume NULL | ||
160 | |||
161 | |||
162 | static struct platform_driver s3c2410_spigpio_drv = { | ||
163 | .probe = s3c2410_spigpio_probe, | ||
164 | .remove = s3c2410_spigpio_remove, | ||
165 | .suspend = s3c2410_spigpio_suspend, | ||
166 | .resume = s3c2410_spigpio_resume, | ||
167 | .driver = { | ||
168 | .name = "s3c24xx-spi-gpio", | ||
169 | .owner = THIS_MODULE, | ||
170 | }, | ||
171 | }; | ||
172 | |||
173 | static int __init s3c2410_spigpio_init(void) | ||
174 | { | ||
175 | return platform_driver_register(&s3c2410_spigpio_drv); | ||
176 | } | ||
177 | |||
178 | static void __exit s3c2410_spigpio_exit(void) | ||
179 | { | ||
180 | platform_driver_unregister(&s3c2410_spigpio_drv); | ||
181 | } | ||
182 | |||
183 | module_init(s3c2410_spigpio_init); | ||
184 | module_exit(s3c2410_spigpio_exit); | ||
185 | |||
186 | MODULE_DESCRIPTION("S3C24XX SPI Driver"); | ||
187 | MODULE_AUTHOR("Ben Dooks, <ben@simtec.co.uk>"); | ||
188 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/usb/atm/speedtch.c b/drivers/usb/atm/speedtch.c index 7860c8a5800d..956b7a1e8af9 100644 --- a/drivers/usb/atm/speedtch.c +++ b/drivers/usb/atm/speedtch.c | |||
@@ -69,7 +69,7 @@ static const char speedtch_driver_name[] = "speedtch"; | |||
69 | #define RESUBMIT_DELAY 1000 /* milliseconds */ | 69 | #define RESUBMIT_DELAY 1000 /* milliseconds */ |
70 | 70 | ||
71 | #define DEFAULT_BULK_ALTSETTING 1 | 71 | #define DEFAULT_BULK_ALTSETTING 1 |
72 | #define DEFAULT_ISOC_ALTSETTING 2 | 72 | #define DEFAULT_ISOC_ALTSETTING 3 |
73 | #define DEFAULT_DL_512_FIRST 0 | 73 | #define DEFAULT_DL_512_FIRST 0 |
74 | #define DEFAULT_ENABLE_ISOC 0 | 74 | #define DEFAULT_ENABLE_ISOC 0 |
75 | #define DEFAULT_SW_BUFFERING 0 | 75 | #define DEFAULT_SW_BUFFERING 0 |
diff --git a/drivers/usb/atm/usbatm.c b/drivers/usb/atm/usbatm.c index c1211fc037d9..546249843b8e 100644 --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c | |||
@@ -99,11 +99,11 @@ static const char usbatm_driver_name[] = "usbatm"; | |||
99 | 99 | ||
100 | #define UDSL_MAX_RCV_URBS 16 | 100 | #define UDSL_MAX_RCV_URBS 16 |
101 | #define UDSL_MAX_SND_URBS 16 | 101 | #define UDSL_MAX_SND_URBS 16 |
102 | #define UDSL_MAX_BUF_SIZE 64 * 1024 /* bytes */ | 102 | #define UDSL_MAX_BUF_SIZE 65536 |
103 | #define UDSL_DEFAULT_RCV_URBS 4 | 103 | #define UDSL_DEFAULT_RCV_URBS 4 |
104 | #define UDSL_DEFAULT_SND_URBS 4 | 104 | #define UDSL_DEFAULT_SND_URBS 4 |
105 | #define UDSL_DEFAULT_RCV_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ | 105 | #define UDSL_DEFAULT_RCV_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */ |
106 | #define UDSL_DEFAULT_SND_BUF_SIZE 64 * ATM_CELL_SIZE /* bytes */ | 106 | #define UDSL_DEFAULT_SND_BUF_SIZE 3392 /* 64 * ATM_CELL_SIZE */ |
107 | 107 | ||
108 | #define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD) | 108 | #define ATM_CELL_HEADER (ATM_CELL_SIZE - ATM_CELL_PAYLOAD) |
109 | 109 | ||
@@ -135,7 +135,7 @@ MODULE_PARM_DESC(rcv_buf_bytes, | |||
135 | module_param(snd_buf_bytes, uint, S_IRUGO); | 135 | module_param(snd_buf_bytes, uint, S_IRUGO); |
136 | MODULE_PARM_DESC(snd_buf_bytes, | 136 | MODULE_PARM_DESC(snd_buf_bytes, |
137 | "Size of the buffers used for transmission, in bytes (range: 1-" | 137 | "Size of the buffers used for transmission, in bytes (range: 1-" |
138 | __MODULE_STRING(UDSL_MAX_SND_BUF_SIZE) ", default: " | 138 | __MODULE_STRING(UDSL_MAX_BUF_SIZE) ", default: " |
139 | __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")"); | 139 | __MODULE_STRING(UDSL_DEFAULT_SND_BUF_SIZE) ")"); |
140 | 140 | ||
141 | 141 | ||
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index fbd938d4ea58..e2e00ba4e1e6 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -1805,6 +1805,12 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
1805 | USB_SPEED_FULL; | 1805 | USB_SPEED_FULL; |
1806 | hcd->self.root_hub = rhdev; | 1806 | hcd->self.root_hub = rhdev; |
1807 | 1807 | ||
1808 | /* wakeup flag init defaults to "everything works" for root hubs, | ||
1809 | * but drivers can override it in reset() if needed, along with | ||
1810 | * recording the overall controller's system wakeup capability. | ||
1811 | */ | ||
1812 | device_init_wakeup(&rhdev->dev, 1); | ||
1813 | |||
1808 | /* "reset" is misnamed; its role is now one-time init. the controller | 1814 | /* "reset" is misnamed; its role is now one-time init. the controller |
1809 | * should already have been reset (and boot firmware kicked off etc). | 1815 | * should already have been reset (and boot firmware kicked off etc). |
1810 | */ | 1816 | */ |
@@ -1813,13 +1819,6 @@ int usb_add_hcd(struct usb_hcd *hcd, | |||
1813 | goto err_hcd_driver_setup; | 1819 | goto err_hcd_driver_setup; |
1814 | } | 1820 | } |
1815 | 1821 | ||
1816 | /* wakeup flag init is in transition; for now we can't rely on PCI to | ||
1817 | * initialize these bits properly, so we let reset() override it. | ||
1818 | * This init should _precede_ the reset() once PCI behaves. | ||
1819 | */ | ||
1820 | device_init_wakeup(&rhdev->dev, | ||
1821 | device_can_wakeup(hcd->self.controller)); | ||
1822 | |||
1823 | /* NOTE: root hub and controller capabilities may not be the same */ | 1822 | /* NOTE: root hub and controller capabilities may not be the same */ |
1824 | if (device_can_wakeup(hcd->self.controller) | 1823 | if (device_can_wakeup(hcd->self.controller) |
1825 | && device_can_wakeup(&hcd->self.root_hub->dev)) | 1824 | && device_can_wakeup(&hcd->self.root_hub->dev)) |
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 0c87f73f2933..90b8d43c6b33 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -1168,19 +1168,9 @@ static inline const char *plural(int n) | |||
1168 | static int choose_configuration(struct usb_device *udev) | 1168 | static int choose_configuration(struct usb_device *udev) |
1169 | { | 1169 | { |
1170 | int i; | 1170 | int i; |
1171 | u16 devstatus; | ||
1172 | int bus_powered; | ||
1173 | int num_configs; | 1171 | int num_configs; |
1174 | struct usb_host_config *c, *best; | 1172 | struct usb_host_config *c, *best; |
1175 | 1173 | ||
1176 | /* If this fails, assume the device is bus-powered */ | ||
1177 | devstatus = 0; | ||
1178 | usb_get_status(udev, USB_RECIP_DEVICE, 0, &devstatus); | ||
1179 | le16_to_cpus(&devstatus); | ||
1180 | bus_powered = ((devstatus & (1 << USB_DEVICE_SELF_POWERED)) == 0); | ||
1181 | dev_dbg(&udev->dev, "device is %s-powered\n", | ||
1182 | bus_powered ? "bus" : "self"); | ||
1183 | |||
1184 | best = NULL; | 1174 | best = NULL; |
1185 | c = udev->config; | 1175 | c = udev->config; |
1186 | num_configs = udev->descriptor.bNumConfigurations; | 1176 | num_configs = udev->descriptor.bNumConfigurations; |
@@ -1197,6 +1187,19 @@ static int choose_configuration(struct usb_device *udev) | |||
1197 | * similar errors in their descriptors. If the next test | 1187 | * similar errors in their descriptors. If the next test |
1198 | * were allowed to execute, such configurations would always | 1188 | * were allowed to execute, such configurations would always |
1199 | * be rejected and the devices would not work as expected. | 1189 | * be rejected and the devices would not work as expected. |
1190 | * In the meantime, we run the risk of selecting a config | ||
1191 | * that requires external power at a time when that power | ||
1192 | * isn't available. It seems to be the lesser of two evils. | ||
1193 | * | ||
1194 | * Bugzilla #6448 reports a device that appears to crash | ||
1195 | * when it receives a GET_DEVICE_STATUS request! We don't | ||
1196 | * have any other way to tell whether a device is self-powered, | ||
1197 | * but since we don't use that information anywhere but here, | ||
1198 | * the call has been removed. | ||
1199 | * | ||
1200 | * Maybe the GET_DEVICE_STATUS call and the test below can | ||
1201 | * be reinstated when device firmwares become more reliable. | ||
1202 | * Don't hold your breath. | ||
1200 | */ | 1203 | */ |
1201 | #if 0 | 1204 | #if 0 |
1202 | /* Rule out self-powered configs for a bus-powered device */ | 1205 | /* Rule out self-powered configs for a bus-powered device */ |
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index 544f7589912f..73f5a379d9b3 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c | |||
@@ -863,7 +863,7 @@ static int ohci_restart (struct ohci_hcd *ohci) | |||
863 | i = ohci->num_ports; | 863 | i = ohci->num_ports; |
864 | while (i--) | 864 | while (i--) |
865 | ohci_writel (ohci, RH_PS_PSS, | 865 | ohci_writel (ohci, RH_PS_PSS, |
866 | &ohci->regs->roothub.portstatus [temp]); | 866 | &ohci->regs->roothub.portstatus [i]); |
867 | ohci_dbg (ohci, "restart complete\n"); | 867 | ohci_dbg (ohci, "restart complete\n"); |
868 | } | 868 | } |
869 | return 0; | 869 | return 0; |
diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index f419bd82ab7f..435273e7c85c 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c | |||
@@ -1557,6 +1557,9 @@ void hid_init_reports(struct hid_device *hid) | |||
1557 | #define USB_VENDOR_ID_HP 0x03f0 | 1557 | #define USB_VENDOR_ID_HP 0x03f0 |
1558 | #define USB_DEVICE_ID_HP_USBHUB_KB 0x020c | 1558 | #define USB_DEVICE_ID_HP_USBHUB_KB 0x020c |
1559 | 1559 | ||
1560 | #define USB_VENDOR_ID_IBM 0x04b3 | ||
1561 | #define USB_DEVICE_ID_IBM_USBHUB_KB 0x3005 | ||
1562 | |||
1560 | #define USB_VENDOR_ID_CREATIVELABS 0x062a | 1563 | #define USB_VENDOR_ID_CREATIVELABS 0x062a |
1561 | #define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201 | 1564 | #define USB_DEVICE_ID_CREATIVELABS_SILVERCREST 0x0201 |
1562 | 1565 | ||
@@ -1681,6 +1684,7 @@ static const struct hid_blacklist { | |||
1681 | { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, | 1684 | { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, |
1682 | { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET }, | 1685 | { USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVELABS_SILVERCREST, HID_QUIRK_NOGET }, |
1683 | { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, | 1686 | { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, |
1687 | { USB_VENDOR_ID_IBM, USB_DEVICE_ID_IBM_USBHUB_KB, HID_QUIRK_NOGET }, | ||
1684 | { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, | 1688 | { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, |
1685 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, | 1689 | { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, |
1686 | { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET }, | 1690 | { USB_VENDOR_ID_SILVERCREST, USB_DEVICE_ID_SILVERCREST_KB, HID_QUIRK_NOGET }, |
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index 6dd666696178..c4670e1d4654 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c | |||
@@ -317,6 +317,7 @@ static ssize_t hiddev_read(struct file * file, char __user * buffer, size_t coun | |||
317 | } | 317 | } |
318 | 318 | ||
319 | schedule(); | 319 | schedule(); |
320 | set_current_state(TASK_INTERRUPTIBLE); | ||
320 | } | 321 | } |
321 | 322 | ||
322 | set_current_state(TASK_RUNNING); | 323 | set_current_state(TASK_RUNNING); |
diff --git a/drivers/usb/misc/emi26.c b/drivers/usb/misc/emi26.c index 3824df33094e..1fd9cb85f4ca 100644 --- a/drivers/usb/misc/emi26.c +++ b/drivers/usb/misc/emi26.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | #include <linux/usb.h> | 17 | #include <linux/usb.h> |
18 | #include <linux/delay.h> | ||
18 | 19 | ||
19 | #define MAX_INTEL_HEX_RECORD_LENGTH 16 | 20 | #define MAX_INTEL_HEX_RECORD_LENGTH 16 |
20 | typedef struct _INTEL_HEX_RECORD | 21 | typedef struct _INTEL_HEX_RECORD |
@@ -114,6 +115,7 @@ static int emi26_load_firmware (struct usb_device *dev) | |||
114 | 115 | ||
115 | /* De-assert reset (let the CPU run) */ | 116 | /* De-assert reset (let the CPU run) */ |
116 | err = emi26_set_reset(dev,0); | 117 | err = emi26_set_reset(dev,0); |
118 | msleep(250); /* let device settle */ | ||
117 | 119 | ||
118 | /* 2. We upload the FPGA firmware into the EMI | 120 | /* 2. We upload the FPGA firmware into the EMI |
119 | * Note: collect up to 1023 (yes!) bytes and send them with | 121 | * Note: collect up to 1023 (yes!) bytes and send them with |
@@ -150,6 +152,7 @@ static int emi26_load_firmware (struct usb_device *dev) | |||
150 | goto wraperr; | 152 | goto wraperr; |
151 | } | 153 | } |
152 | } | 154 | } |
155 | msleep(250); /* let device settle */ | ||
153 | 156 | ||
154 | /* De-assert reset (let the CPU run) */ | 157 | /* De-assert reset (let the CPU run) */ |
155 | err = emi26_set_reset(dev,0); | 158 | err = emi26_set_reset(dev,0); |
@@ -192,6 +195,7 @@ static int emi26_load_firmware (struct usb_device *dev) | |||
192 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); | 195 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); |
193 | goto wraperr; | 196 | goto wraperr; |
194 | } | 197 | } |
198 | msleep(250); /* let device settle */ | ||
195 | 199 | ||
196 | /* return 1 to fail the driver inialization | 200 | /* return 1 to fail the driver inialization |
197 | * and give real driver change to load */ | 201 | * and give real driver change to load */ |
diff --git a/drivers/usb/misc/emi62.c b/drivers/usb/misc/emi62.c index 52fea2e08db8..fe351371f274 100644 --- a/drivers/usb/misc/emi62.c +++ b/drivers/usb/misc/emi62.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/init.h> | 15 | #include <linux/init.h> |
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/usb.h> | 17 | #include <linux/usb.h> |
18 | #include <linux/delay.h> | ||
18 | 19 | ||
19 | #define MAX_INTEL_HEX_RECORD_LENGTH 16 | 20 | #define MAX_INTEL_HEX_RECORD_LENGTH 16 |
20 | typedef struct _INTEL_HEX_RECORD | 21 | typedef struct _INTEL_HEX_RECORD |
@@ -123,6 +124,7 @@ static int emi62_load_firmware (struct usb_device *dev) | |||
123 | 124 | ||
124 | /* De-assert reset (let the CPU run) */ | 125 | /* De-assert reset (let the CPU run) */ |
125 | err = emi62_set_reset(dev,0); | 126 | err = emi62_set_reset(dev,0); |
127 | msleep(250); /* let device settle */ | ||
126 | 128 | ||
127 | /* 2. We upload the FPGA firmware into the EMI | 129 | /* 2. We upload the FPGA firmware into the EMI |
128 | * Note: collect up to 1023 (yes!) bytes and send them with | 130 | * Note: collect up to 1023 (yes!) bytes and send them with |
@@ -166,6 +168,7 @@ static int emi62_load_firmware (struct usb_device *dev) | |||
166 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); | 168 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); |
167 | goto wraperr; | 169 | goto wraperr; |
168 | } | 170 | } |
171 | msleep(250); /* let device settle */ | ||
169 | 172 | ||
170 | /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ | 173 | /* 4. We put the part of the firmware that lies in the external RAM into the EZ-USB */ |
171 | 174 | ||
@@ -228,6 +231,7 @@ static int emi62_load_firmware (struct usb_device *dev) | |||
228 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); | 231 | err("%s - error loading firmware: error = %d", __FUNCTION__, err); |
229 | goto wraperr; | 232 | goto wraperr; |
230 | } | 233 | } |
234 | msleep(250); /* let device settle */ | ||
231 | 235 | ||
232 | kfree(buf); | 236 | kfree(buf); |
233 | 237 | ||
diff --git a/drivers/usb/net/pegasus.c b/drivers/usb/net/pegasus.c index 2deb4c01539e..7683926a1b6f 100644 --- a/drivers/usb/net/pegasus.c +++ b/drivers/usb/net/pegasus.c | |||
@@ -318,6 +318,8 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) | |||
318 | set_register(pegasus, PhyCtrl, (indx | PHY_READ)); | 318 | set_register(pegasus, PhyCtrl, (indx | PHY_READ)); |
319 | for (i = 0; i < REG_TIMEOUT; i++) { | 319 | for (i = 0; i < REG_TIMEOUT; i++) { |
320 | ret = get_registers(pegasus, PhyCtrl, 1, data); | 320 | ret = get_registers(pegasus, PhyCtrl, 1, data); |
321 | if (ret == -ESHUTDOWN) | ||
322 | goto fail; | ||
321 | if (data[0] & PHY_DONE) | 323 | if (data[0] & PHY_DONE) |
322 | break; | 324 | break; |
323 | } | 325 | } |
@@ -326,6 +328,7 @@ static int read_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 * regd) | |||
326 | *regd = le16_to_cpu(regdi); | 328 | *regd = le16_to_cpu(regdi); |
327 | return ret; | 329 | return ret; |
328 | } | 330 | } |
331 | fail: | ||
329 | if (netif_msg_drv(pegasus)) | 332 | if (netif_msg_drv(pegasus)) |
330 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); | 333 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); |
331 | 334 | ||
@@ -354,12 +357,15 @@ static int write_mii_word(pegasus_t * pegasus, __u8 phy, __u8 indx, __u16 regd) | |||
354 | set_register(pegasus, PhyCtrl, (indx | PHY_WRITE)); | 357 | set_register(pegasus, PhyCtrl, (indx | PHY_WRITE)); |
355 | for (i = 0; i < REG_TIMEOUT; i++) { | 358 | for (i = 0; i < REG_TIMEOUT; i++) { |
356 | ret = get_registers(pegasus, PhyCtrl, 1, data); | 359 | ret = get_registers(pegasus, PhyCtrl, 1, data); |
360 | if (ret == -ESHUTDOWN) | ||
361 | goto fail; | ||
357 | if (data[0] & PHY_DONE) | 362 | if (data[0] & PHY_DONE) |
358 | break; | 363 | break; |
359 | } | 364 | } |
360 | if (i < REG_TIMEOUT) | 365 | if (i < REG_TIMEOUT) |
361 | return ret; | 366 | return ret; |
362 | 367 | ||
368 | fail: | ||
363 | if (netif_msg_drv(pegasus)) | 369 | if (netif_msg_drv(pegasus)) |
364 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); | 370 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); |
365 | return -ETIMEDOUT; | 371 | return -ETIMEDOUT; |
@@ -387,6 +393,8 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata) | |||
387 | ret = get_registers(pegasus, EpromCtrl, 1, &tmp); | 393 | ret = get_registers(pegasus, EpromCtrl, 1, &tmp); |
388 | if (tmp & EPROM_DONE) | 394 | if (tmp & EPROM_DONE) |
389 | break; | 395 | break; |
396 | if (ret == -ESHUTDOWN) | ||
397 | goto fail; | ||
390 | } | 398 | } |
391 | if (i < REG_TIMEOUT) { | 399 | if (i < REG_TIMEOUT) { |
392 | ret = get_registers(pegasus, EpromData, 2, &retdatai); | 400 | ret = get_registers(pegasus, EpromData, 2, &retdatai); |
@@ -394,6 +402,7 @@ static int read_eprom_word(pegasus_t * pegasus, __u8 index, __u16 * retdata) | |||
394 | return ret; | 402 | return ret; |
395 | } | 403 | } |
396 | 404 | ||
405 | fail: | ||
397 | if (netif_msg_drv(pegasus)) | 406 | if (netif_msg_drv(pegasus)) |
398 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); | 407 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); |
399 | return -ETIMEDOUT; | 408 | return -ETIMEDOUT; |
@@ -433,12 +442,15 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data) | |||
433 | 442 | ||
434 | for (i = 0; i < REG_TIMEOUT; i++) { | 443 | for (i = 0; i < REG_TIMEOUT; i++) { |
435 | ret = get_registers(pegasus, EpromCtrl, 1, &tmp); | 444 | ret = get_registers(pegasus, EpromCtrl, 1, &tmp); |
445 | if (ret == -ESHUTDOWN) | ||
446 | goto fail; | ||
436 | if (tmp & EPROM_DONE) | 447 | if (tmp & EPROM_DONE) |
437 | break; | 448 | break; |
438 | } | 449 | } |
439 | disable_eprom_write(pegasus); | 450 | disable_eprom_write(pegasus); |
440 | if (i < REG_TIMEOUT) | 451 | if (i < REG_TIMEOUT) |
441 | return ret; | 452 | return ret; |
453 | fail: | ||
442 | if (netif_msg_drv(pegasus)) | 454 | if (netif_msg_drv(pegasus)) |
443 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); | 455 | dev_warn(&pegasus->intf->dev, "fail %s\n", __FUNCTION__); |
444 | return -ETIMEDOUT; | 456 | return -ETIMEDOUT; |
@@ -1378,9 +1390,8 @@ static int pegasus_suspend (struct usb_interface *intf, pm_message_t message) | |||
1378 | struct pegasus *pegasus = usb_get_intfdata(intf); | 1390 | struct pegasus *pegasus = usb_get_intfdata(intf); |
1379 | 1391 | ||
1380 | netif_device_detach (pegasus->net); | 1392 | netif_device_detach (pegasus->net); |
1393 | cancel_delayed_work(&pegasus->carrier_check); | ||
1381 | if (netif_running(pegasus->net)) { | 1394 | if (netif_running(pegasus->net)) { |
1382 | cancel_delayed_work(&pegasus->carrier_check); | ||
1383 | |||
1384 | usb_kill_urb(pegasus->rx_urb); | 1395 | usb_kill_urb(pegasus->rx_urb); |
1385 | usb_kill_urb(pegasus->intr_urb); | 1396 | usb_kill_urb(pegasus->intr_urb); |
1386 | } | 1397 | } |
@@ -1400,10 +1411,9 @@ static int pegasus_resume (struct usb_interface *intf) | |||
1400 | pegasus->intr_urb->status = 0; | 1411 | pegasus->intr_urb->status = 0; |
1401 | pegasus->intr_urb->actual_length = 0; | 1412 | pegasus->intr_urb->actual_length = 0; |
1402 | intr_callback(pegasus->intr_urb, NULL); | 1413 | intr_callback(pegasus->intr_urb, NULL); |
1403 | |||
1404 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, | ||
1405 | CARRIER_CHECK_DELAY); | ||
1406 | } | 1414 | } |
1415 | queue_delayed_work(pegasus_workqueue, &pegasus->carrier_check, | ||
1416 | CARRIER_CHECK_DELAY); | ||
1407 | return 0; | 1417 | return 0; |
1408 | } | 1418 | } |
1409 | 1419 | ||
diff --git a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig index f96b73f54bf1..5c60be521561 100644 --- a/drivers/usb/serial/Kconfig +++ b/drivers/usb/serial/Kconfig | |||
@@ -71,6 +71,16 @@ config USB_SERIAL_ANYDATA | |||
71 | To compile this driver as a module, choose M here: the | 71 | To compile this driver as a module, choose M here: the |
72 | module will be called anydata. | 72 | module will be called anydata. |
73 | 73 | ||
74 | config USB_SERIAL_ARK3116 | ||
75 | tristate "USB ARK Micro 3116 USB Serial Driver (EXPERIMENTAL)" | ||
76 | depends on USB_SERIAL && EXPERIMENTAL | ||
77 | help | ||
78 | Say Y here if you want to use a ARK Micro 3116 USB to Serial | ||
79 | device. | ||
80 | |||
81 | To compile this driver as a module, choose M here: the | ||
82 | module will be called ark3116 | ||
83 | |||
74 | config USB_SERIAL_BELKIN | 84 | config USB_SERIAL_BELKIN |
75 | tristate "USB Belkin and Peracom Single Port Serial Driver" | 85 | tristate "USB Belkin and Peracom Single Port Serial Driver" |
76 | depends on USB_SERIAL | 86 | depends on USB_SERIAL |
diff --git a/drivers/usb/serial/Makefile b/drivers/usb/serial/Makefile index 93c21245b1af..5a0960fc9d3e 100644 --- a/drivers/usb/serial/Makefile +++ b/drivers/usb/serial/Makefile | |||
@@ -13,6 +13,7 @@ usbserial-objs := usb-serial.o generic.o bus.o $(usbserial-obj-y) | |||
13 | 13 | ||
14 | obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o | 14 | obj-$(CONFIG_USB_SERIAL_AIRPRIME) += airprime.o |
15 | obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o | 15 | obj-$(CONFIG_USB_SERIAL_ANYDATA) += anydata.o |
16 | obj-$(CONFIG_USB_SERIAL_ARK3116) += ark3116.o | ||
16 | obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o | 17 | obj-$(CONFIG_USB_SERIAL_BELKIN) += belkin_sa.o |
17 | obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o | 18 | obj-$(CONFIG_USB_SERIAL_CP2101) += cp2101.o |
18 | obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o | 19 | obj-$(CONFIG_USB_SERIAL_CYBERJACK) += cyberjack.o |
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index dbf1f063098c..694b205f9b73 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c | |||
@@ -18,6 +18,7 @@ | |||
18 | static struct usb_device_id id_table [] = { | 18 | static struct usb_device_id id_table [] = { |
19 | { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */ | 19 | { USB_DEVICE(0xf3d, 0x0112) }, /* AirPrime CDMA Wireless PC Card */ |
20 | { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ | 20 | { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ |
21 | { USB_DEVICE(0x1199, 0x0112) }, /* Sierra Wireless Aircard 580 */ | ||
21 | { }, | 22 | { }, |
22 | }; | 23 | }; |
23 | MODULE_DEVICE_TABLE(usb, id_table); | 24 | MODULE_DEVICE_TABLE(usb, id_table); |
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c new file mode 100644 index 000000000000..8dec796222a0 --- /dev/null +++ b/drivers/usb/serial/ark3116.c | |||
@@ -0,0 +1,465 @@ | |||
1 | /* | ||
2 | * ark3116 | ||
3 | * - implements a driver for the arkmicro ark3116 chipset (vendor=0x6547, | ||
4 | * productid=0x0232) (used in a datacable called KQ-U8A) | ||
5 | * | ||
6 | * - based on code by krisfx -> thanks !! | ||
7 | * (see http://www.linuxquestions.org/questions/showthread.php?p=2184457#post2184457) | ||
8 | * | ||
9 | * - based on logs created by usbsnoopy | ||
10 | * | ||
11 | * Author : Simon Schulz [ark3116_driver<AT>auctionant.de] | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or modify it | ||
14 | * under the terms of the GNU General Public License as published by the | ||
15 | * Free Software Foundation; either version 2 of the License, or (at your | ||
16 | * option) any later version. | ||
17 | */ | ||
18 | |||
19 | #include <linux/kernel.h> | ||
20 | #include <linux/init.h> | ||
21 | #include <linux/tty.h> | ||
22 | #include <linux/module.h> | ||
23 | #include <linux/usb.h> | ||
24 | #include "usb-serial.h" | ||
25 | |||
26 | |||
27 | static int debug; | ||
28 | |||
29 | static struct usb_device_id id_table [] = { | ||
30 | { USB_DEVICE(0x6547, 0x0232) }, | ||
31 | { }, | ||
32 | }; | ||
33 | MODULE_DEVICE_TABLE(usb, id_table); | ||
34 | |||
35 | struct ark3116_private { | ||
36 | spinlock_t lock; | ||
37 | u8 termios_initialized; | ||
38 | }; | ||
39 | |||
40 | static inline void ARK3116_SND(struct usb_serial *serial, int seq, | ||
41 | __u8 request, __u8 requesttype, | ||
42 | __u16 value, __u16 index) | ||
43 | { | ||
44 | int result; | ||
45 | result = usb_control_msg(serial->dev, | ||
46 | usb_sndctrlpipe(serial->dev,0), | ||
47 | request, requesttype, value, index, | ||
48 | NULL,0x00, 1000); | ||
49 | dbg("%03d > ok",seq); | ||
50 | } | ||
51 | |||
52 | static inline void ARK3116_RCV(struct usb_serial *serial, int seq, | ||
53 | __u8 request, __u8 requesttype, | ||
54 | __u16 value, __u16 index, __u8 expected, | ||
55 | char *buf) | ||
56 | { | ||
57 | int result; | ||
58 | result = usb_control_msg(serial->dev, | ||
59 | usb_rcvctrlpipe(serial->dev,0), | ||
60 | request, requesttype, value, index, | ||
61 | buf, 0x0000001, 1000); | ||
62 | if (result) | ||
63 | dbg("%03d < %d bytes [0x%02X]",seq, result, buf[0]); | ||
64 | else | ||
65 | dbg("%03d < 0 bytes", seq); | ||
66 | } | ||
67 | |||
68 | |||
69 | static inline void ARK3116_RCV_QUIET(struct usb_serial *serial, | ||
70 | __u8 request, __u8 requesttype, | ||
71 | __u16 value, __u16 index, char *buf) | ||
72 | { | ||
73 | usb_control_msg(serial->dev, | ||
74 | usb_rcvctrlpipe(serial->dev,0), | ||
75 | request, requesttype, value, index, | ||
76 | buf, 0x0000001, 1000); | ||
77 | } | ||
78 | |||
79 | |||
80 | static int ark3116_attach(struct usb_serial *serial) | ||
81 | { | ||
82 | char *buf; | ||
83 | struct ark3116_private *priv; | ||
84 | int i; | ||
85 | |||
86 | for (i = 0; i < serial->num_ports; ++i) { | ||
87 | priv = kmalloc (sizeof (struct ark3116_private), GFP_KERNEL); | ||
88 | if (!priv) | ||
89 | goto cleanup; | ||
90 | memset (priv, 0x00, sizeof (struct ark3116_private)); | ||
91 | spin_lock_init(&priv->lock); | ||
92 | |||
93 | usb_set_serial_port_data(serial->port[i], priv); | ||
94 | } | ||
95 | |||
96 | buf = kmalloc(1, GFP_KERNEL); | ||
97 | if (!buf) { | ||
98 | dbg("error kmalloc -> out of mem ?"); | ||
99 | goto cleanup; | ||
100 | } | ||
101 | |||
102 | /* 3 */ | ||
103 | ARK3116_SND(serial, 3,0xFE,0x40,0x0008,0x0002); | ||
104 | ARK3116_SND(serial, 4,0xFE,0x40,0x0008,0x0001); | ||
105 | ARK3116_SND(serial, 5,0xFE,0x40,0x0000,0x0008); | ||
106 | ARK3116_SND(serial, 6,0xFE,0x40,0x0000,0x000B); | ||
107 | |||
108 | /* <-- seq7 */ | ||
109 | ARK3116_RCV(serial, 7,0xFE,0xC0,0x0000,0x0003, 0x00, buf); | ||
110 | ARK3116_SND(serial, 8,0xFE,0x40,0x0080,0x0003); | ||
111 | ARK3116_SND(serial, 9,0xFE,0x40,0x001A,0x0000); | ||
112 | ARK3116_SND(serial,10,0xFE,0x40,0x0000,0x0001); | ||
113 | ARK3116_SND(serial,11,0xFE,0x40,0x0000,0x0003); | ||
114 | |||
115 | /* <-- seq12 */ | ||
116 | ARK3116_RCV(serial,12,0xFE,0xC0,0x0000,0x0004, 0x00, buf); | ||
117 | ARK3116_SND(serial,13,0xFE,0x40,0x0000,0x0004); | ||
118 | |||
119 | /* 14 */ | ||
120 | ARK3116_RCV(serial,14,0xFE,0xC0,0x0000,0x0004, 0x00, buf); | ||
121 | ARK3116_SND(serial,15,0xFE,0x40,0x0000,0x0004); | ||
122 | |||
123 | /* 16 */ | ||
124 | ARK3116_RCV(serial,16,0xFE,0xC0,0x0000,0x0004, 0x00, buf); | ||
125 | /* --> seq17 */ | ||
126 | ARK3116_SND(serial,17,0xFE,0x40,0x0001,0x0004); | ||
127 | |||
128 | /* <-- seq18 */ | ||
129 | ARK3116_RCV(serial,18,0xFE,0xC0,0x0000,0x0004, 0x01, buf); | ||
130 | |||
131 | /* --> seq19 */ | ||
132 | ARK3116_SND(serial,19,0xFE,0x40,0x0003,0x0004); | ||
133 | |||
134 | |||
135 | /* <-- seq20 */ | ||
136 | /* seems like serial port status info (RTS, CTS,...) */ | ||
137 | /* returns modem control line status ?! */ | ||
138 | ARK3116_RCV(serial,20,0xFE,0xC0,0x0000,0x0006, 0xFF, buf); | ||
139 | |||
140 | /* set 9600 baud & do some init ?! */ | ||
141 | ARK3116_SND(serial,147,0xFE,0x40,0x0083,0x0003); | ||
142 | ARK3116_SND(serial,148,0xFE,0x40,0x0038,0x0000); | ||
143 | ARK3116_SND(serial,149,0xFE,0x40,0x0001,0x0001); | ||
144 | ARK3116_SND(serial,150,0xFE,0x40,0x0003,0x0003); | ||
145 | ARK3116_RCV(serial,151,0xFE,0xC0,0x0000,0x0004,0x03, buf); | ||
146 | ARK3116_SND(serial,152,0xFE,0x40,0x0000,0x0003); | ||
147 | ARK3116_RCV(serial,153,0xFE,0xC0,0x0000,0x0003,0x00, buf); | ||
148 | ARK3116_SND(serial,154,0xFE,0x40,0x0003,0x0003); | ||
149 | |||
150 | kfree(buf); | ||
151 | return(0); | ||
152 | |||
153 | cleanup: | ||
154 | for (--i; i>=0; --i) | ||
155 | usb_set_serial_port_data(serial->port[i], NULL); | ||
156 | return -ENOMEM; | ||
157 | } | ||
158 | |||
159 | static void ark3116_set_termios(struct usb_serial_port *port, | ||
160 | struct termios *old_termios) | ||
161 | { | ||
162 | struct usb_serial *serial = port->serial; | ||
163 | struct ark3116_private *priv = usb_get_serial_port_data(port); | ||
164 | unsigned int cflag = port->tty->termios->c_cflag; | ||
165 | unsigned long flags; | ||
166 | int baud; | ||
167 | int ark3116_baud; | ||
168 | char *buf; | ||
169 | char config; | ||
170 | |||
171 | config = 0; | ||
172 | |||
173 | dbg("%s - port %d", __FUNCTION__, port->number); | ||
174 | |||
175 | if ((!port->tty) || (!port->tty->termios)) { | ||
176 | dbg("%s - no tty structures", __FUNCTION__); | ||
177 | return; | ||
178 | } | ||
179 | |||
180 | spin_lock_irqsave(&priv->lock, flags); | ||
181 | if (!priv->termios_initialized) { | ||
182 | *(port->tty->termios) = tty_std_termios; | ||
183 | port->tty->termios->c_cflag = B9600 | CS8 | CREAD | HUPCL | CLOCAL; | ||
184 | priv->termios_initialized = 1; | ||
185 | } | ||
186 | spin_unlock_irqrestore(&priv->lock, flags); | ||
187 | |||
188 | cflag = port->tty->termios->c_cflag; | ||
189 | |||
190 | /* check that they really want us to change something: */ | ||
191 | if (old_termios) { | ||
192 | if ((cflag == old_termios->c_cflag) && | ||
193 | (RELEVANT_IFLAG(port->tty->termios->c_iflag) == | ||
194 | RELEVANT_IFLAG(old_termios->c_iflag))) { | ||
195 | dbg("%s - nothing to change...", __FUNCTION__); | ||
196 | return; | ||
197 | } | ||
198 | } | ||
199 | |||
200 | buf = kmalloc(1, GFP_KERNEL); | ||
201 | if (!buf) { | ||
202 | dbg("error kmalloc"); | ||
203 | return; | ||
204 | } | ||
205 | |||
206 | /* set data bit count (8/7/6/5) */ | ||
207 | if (cflag & CSIZE){ | ||
208 | switch (cflag & CSIZE){ | ||
209 | case CS5: | ||
210 | config |= 0x00; | ||
211 | dbg("setting CS5"); | ||
212 | break; | ||
213 | case CS6: | ||
214 | config |= 0x01; | ||
215 | dbg("setting CS6"); | ||
216 | break; | ||
217 | case CS7: | ||
218 | config |= 0x02; | ||
219 | dbg("setting CS7"); | ||
220 | break; | ||
221 | default: | ||
222 | err ("CSIZE was set but not CS5-CS8, using CS8!"); | ||
223 | case CS8: | ||
224 | config |= 0x03; | ||
225 | dbg("setting CS8"); | ||
226 | break; | ||
227 | } | ||
228 | } | ||
229 | |||
230 | /* set parity (NONE,EVEN,ODD) */ | ||
231 | if (cflag & PARENB){ | ||
232 | if (cflag & PARODD) { | ||
233 | config |= 0x08; | ||
234 | dbg("setting parity to ODD"); | ||
235 | } else { | ||
236 | config |= 0x18; | ||
237 | dbg("setting parity to EVEN"); | ||
238 | } | ||
239 | } else { | ||
240 | dbg("setting parity to NONE"); | ||
241 | } | ||
242 | |||
243 | /* SET STOPBIT (1/2) */ | ||
244 | if (cflag & CSTOPB) { | ||
245 | config |= 0x04; | ||
246 | dbg ("setting 2 stop bits"); | ||
247 | } else { | ||
248 | dbg ("setting 1 stop bit"); | ||
249 | } | ||
250 | |||
251 | |||
252 | /* set baudrate: */ | ||
253 | baud = 0; | ||
254 | switch (cflag & CBAUD){ | ||
255 | case B0: | ||
256 | err("can't set 0baud, using 9600 instead"); | ||
257 | break; | ||
258 | case B75: baud = 75; break; | ||
259 | case B150: baud = 150; break; | ||
260 | case B300: baud = 300; break; | ||
261 | case B600: baud = 600; break; | ||
262 | case B1200: baud = 1200; break; | ||
263 | case B1800: baud = 1800; break; | ||
264 | case B2400: baud = 2400; break; | ||
265 | case B4800: baud = 4800; break; | ||
266 | case B9600: baud = 9600; break; | ||
267 | case B19200: baud = 19200; break; | ||
268 | case B38400: baud = 38400; break; | ||
269 | case B57600: baud = 57600; break; | ||
270 | case B115200: baud = 115200; break; | ||
271 | case B230400: baud = 230400; break; | ||
272 | case B460800: baud = 460800; break; | ||
273 | default: | ||
274 | dbg("does not support the baudrate requested (fix it)"); | ||
275 | break; | ||
276 | } | ||
277 | |||
278 | /* set 9600 as default (if given baudrate is invalid for example) */ | ||
279 | if (baud == 0) | ||
280 | baud = 9600; | ||
281 | |||
282 | /* | ||
283 | * found by try'n'error, be careful, maybe there are other options | ||
284 | * for multiplicator etc! | ||
285 | */ | ||
286 | if (baud == 460800) | ||
287 | /* strange, for 460800 the formula is wrong | ||
288 | * (dont use round(), then 9600baud is wrong) */ | ||
289 | ark3116_baud = 7; | ||
290 | else | ||
291 | ark3116_baud = 3000000 / baud; | ||
292 | |||
293 | /* ? */ | ||
294 | ARK3116_RCV(serial,0,0xFE,0xC0,0x0000,0x0003, 0x03, buf); | ||
295 | /* offset = buf[0]; */ | ||
296 | /* offset = 0x03; */ | ||
297 | /* dbg("using 0x%04X as target for 0x0003:",0x0080+offset); */ | ||
298 | |||
299 | |||
300 | /* set baudrate */ | ||
301 | dbg("setting baudrate to %d (->reg=%d)",baud,ark3116_baud); | ||
302 | ARK3116_SND(serial,147,0xFE,0x40,0x0083,0x0003); | ||
303 | ARK3116_SND(serial,148,0xFE,0x40,(ark3116_baud & 0x00FF) ,0x0000); | ||
304 | ARK3116_SND(serial,149,0xFE,0x40,(ark3116_baud & 0xFF00)>>8,0x0001); | ||
305 | ARK3116_SND(serial,150,0xFE,0x40,0x0003,0x0003); | ||
306 | |||
307 | /* ? */ | ||
308 | ARK3116_RCV(serial,151,0xFE,0xC0,0x0000,0x0004,0x03, buf); | ||
309 | ARK3116_SND(serial,152,0xFE,0x40,0x0000,0x0003); | ||
310 | |||
311 | /* set data bit count, stop bit count & parity: */ | ||
312 | dbg("updating bit count, stop bit or parity (cfg=0x%02X)", config); | ||
313 | ARK3116_RCV(serial,153,0xFE,0xC0,0x0000,0x0003,0x00, buf); | ||
314 | ARK3116_SND(serial,154,0xFE,0x40,config,0x0003); | ||
315 | |||
316 | if (cflag & CRTSCTS) | ||
317 | dbg("CRTSCTS not supported by chipset ?!"); | ||
318 | |||
319 | /* TEST ARK3116_SND(154,0xFE,0x40,0xFFFF, 0x0006); */ | ||
320 | |||
321 | kfree(buf); | ||
322 | return; | ||
323 | } | ||
324 | |||
325 | static int ark3116_open(struct usb_serial_port *port, struct file *filp) | ||
326 | { | ||
327 | struct termios tmp_termios; | ||
328 | struct usb_serial *serial = port->serial; | ||
329 | char *buf; | ||
330 | int result = 0; | ||
331 | |||
332 | dbg("%s - port %d", __FUNCTION__, port->number); | ||
333 | |||
334 | buf = kmalloc(1, GFP_KERNEL); | ||
335 | if (!buf) { | ||
336 | dbg("error kmalloc -> out of mem ?"); | ||
337 | return -ENOMEM; | ||
338 | } | ||
339 | |||
340 | result = usb_serial_generic_open(port, filp); | ||
341 | if (result) | ||
342 | return result; | ||
343 | |||
344 | /* open */ | ||
345 | ARK3116_RCV(serial,111,0xFE,0xC0,0x0000,0x0003, 0x02, buf); | ||
346 | |||
347 | ARK3116_SND(serial,112,0xFE,0x40,0x0082,0x0003); | ||
348 | ARK3116_SND(serial,113,0xFE,0x40,0x001A,0x0000); | ||
349 | ARK3116_SND(serial,114,0xFE,0x40,0x0000,0x0001); | ||
350 | ARK3116_SND(serial,115,0xFE,0x40,0x0002,0x0003); | ||
351 | |||
352 | ARK3116_RCV(serial,116,0xFE,0xC0,0x0000,0x0004, 0x03, buf); | ||
353 | ARK3116_SND(serial,117,0xFE,0x40,0x0002,0x0004); | ||
354 | |||
355 | ARK3116_RCV(serial,118,0xFE,0xC0,0x0000,0x0004, 0x02, buf); | ||
356 | ARK3116_SND(serial,119,0xFE,0x40,0x0000,0x0004); | ||
357 | |||
358 | ARK3116_RCV(serial,120,0xFE,0xC0,0x0000,0x0004, 0x00, buf); | ||
359 | |||
360 | ARK3116_SND(serial,121,0xFE,0x40,0x0001,0x0004); | ||
361 | |||
362 | ARK3116_RCV(serial,122,0xFE,0xC0,0x0000,0x0004, 0x01, buf); | ||
363 | |||
364 | ARK3116_SND(serial,123,0xFE,0x40,0x0003,0x0004); | ||
365 | |||
366 | /* returns different values (control lines ?!) */ | ||
367 | ARK3116_RCV(serial,124,0xFE,0xC0,0x0000,0x0006, 0xFF, buf); | ||
368 | |||
369 | /* initialise termios: */ | ||
370 | if (port->tty) | ||
371 | ark3116_set_termios(port, &tmp_termios); | ||
372 | |||
373 | kfree(buf); | ||
374 | |||
375 | return result; | ||
376 | |||
377 | } | ||
378 | |||
379 | static int ark3116_ioctl(struct usb_serial_port *port, struct file *file, | ||
380 | unsigned int cmd, unsigned long arg) | ||
381 | { | ||
382 | dbg("ioctl not supported yet..."); | ||
383 | return -ENOIOCTLCMD; | ||
384 | } | ||
385 | |||
386 | static int ark3116_tiocmget(struct usb_serial_port *port, struct file *file) | ||
387 | { | ||
388 | struct usb_serial *serial = port->serial; | ||
389 | char *buf; | ||
390 | char temp; | ||
391 | |||
392 | /* seems like serial port status info (RTS, CTS,...) is stored | ||
393 | * in reg(?) 0x0006 | ||
394 | * pcb connection point 11 = GND -> sets bit4 of response | ||
395 | * pcb connection point 7 = GND -> sets bit6 of response | ||
396 | */ | ||
397 | |||
398 | buf = kmalloc(1, GFP_KERNEL); | ||
399 | if (!buf) { | ||
400 | dbg("error kmalloc"); | ||
401 | return -ENOMEM; | ||
402 | } | ||
403 | |||
404 | /* read register: */ | ||
405 | ARK3116_RCV_QUIET(serial,0xFE,0xC0,0x0000,0x0006,buf); | ||
406 | temp = buf[0]; | ||
407 | kfree(buf); | ||
408 | |||
409 | /* i do not really know if bit4=CTS and bit6=DSR... was just a | ||
410 | * quick guess !! | ||
411 | */ | ||
412 | return (temp & (1<<4) ? TIOCM_CTS : 0) | | ||
413 | (temp & (1<<6) ? TIOCM_DSR : 0); | ||
414 | } | ||
415 | |||
416 | static struct usb_driver ark3116_driver = { | ||
417 | .name = "ark3116", | ||
418 | .probe = usb_serial_probe, | ||
419 | .disconnect = usb_serial_disconnect, | ||
420 | .id_table = id_table, | ||
421 | }; | ||
422 | |||
423 | static struct usb_serial_driver ark3116_device = { | ||
424 | .driver = { | ||
425 | .owner = THIS_MODULE, | ||
426 | .name = "ark3116", | ||
427 | }, | ||
428 | .id_table = id_table, | ||
429 | .num_interrupt_in = 1, | ||
430 | .num_bulk_in = 1, | ||
431 | .num_bulk_out = 1, | ||
432 | .num_ports = 1, | ||
433 | .attach = ark3116_attach, | ||
434 | .set_termios = ark3116_set_termios, | ||
435 | .ioctl = ark3116_ioctl, | ||
436 | .tiocmget = ark3116_tiocmget, | ||
437 | .open = ark3116_open, | ||
438 | }; | ||
439 | |||
440 | static int __init ark3116_init(void) | ||
441 | { | ||
442 | int retval; | ||
443 | |||
444 | retval = usb_serial_register(&ark3116_device); | ||
445 | if (retval) | ||
446 | return retval; | ||
447 | retval = usb_register(&ark3116_driver); | ||
448 | if (retval) | ||
449 | usb_serial_deregister(&ark3116_device); | ||
450 | return retval; | ||
451 | } | ||
452 | |||
453 | static void __exit ark3116_exit(void) | ||
454 | { | ||
455 | usb_deregister(&ark3116_driver); | ||
456 | usb_serial_deregister(&ark3116_device); | ||
457 | } | ||
458 | |||
459 | module_init(ark3116_init); | ||
460 | module_exit(ark3116_exit); | ||
461 | MODULE_LICENSE("GPL"); | ||
462 | |||
463 | module_param(debug, bool, S_IRUGO | S_IWUSR); | ||
464 | MODULE_PARM_DESC(debug, "Debug enabled or not"); | ||
465 | |||
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index 82151207d814..986d7622273d 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -307,6 +307,7 @@ static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = { | |||
307 | 307 | ||
308 | 308 | ||
309 | static struct usb_device_id id_table_combined [] = { | 309 | static struct usb_device_id id_table_combined [] = { |
310 | { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) }, | ||
310 | { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, | 311 | { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, |
311 | { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, | 312 | { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) }, |
312 | { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, | 313 | { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, |
@@ -498,6 +499,7 @@ static struct usb_device_id id_table_combined [] = { | |||
498 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, | 499 | { USB_DEVICE(FTDI_VID, FTDI_ASK_RDR400_PID) }, |
499 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, | 500 | { USB_DEVICE(ICOM_ID1_VID, ICOM_ID1_PID) }, |
500 | { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, | 501 | { USB_DEVICE(PAPOUCH_VID, PAPOUCH_TMU_PID) }, |
502 | { USB_DEVICE(FTDI_VID, FTDI_ACG_HFDUAL_PID) }, | ||
501 | { }, /* Optional parameter entry */ | 503 | { }, /* Optional parameter entry */ |
502 | { } /* Terminating entry */ | 504 | { } /* Terminating entry */ |
503 | }; | 505 | }; |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 2c55a5ea9c99..d69a917e768f 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -32,6 +32,10 @@ | |||
32 | #define FTDI_NF_RIC_PID 0x0001 /* Product Id */ | 32 | #define FTDI_NF_RIC_PID 0x0001 /* Product Id */ |
33 | 33 | ||
34 | 34 | ||
35 | /* ACT Solutions HomePro ZWave interface (http://www.act-solutions.com/HomePro.htm) */ | ||
36 | #define FTDI_ACTZWAVE_PID 0xF2D0 | ||
37 | |||
38 | |||
35 | /* www.irtrans.de device */ | 39 | /* www.irtrans.de device */ |
36 | #define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ | 40 | #define FTDI_IRTRANS_PID 0xFC60 /* Product Id */ |
37 | 41 | ||
@@ -426,6 +430,11 @@ | |||
426 | #define PAPOUCH_VID 0x5050 /* Vendor ID */ | 430 | #define PAPOUCH_VID 0x5050 /* Vendor ID */ |
427 | #define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */ | 431 | #define PAPOUCH_TMU_PID 0x0400 /* TMU USB Thermometer */ |
428 | 432 | ||
433 | /* | ||
434 | * ACG Identification Technologies GmbH products (http://www.acg.de/). | ||
435 | * Submitted by anton -at- goto10 -dot- org. | ||
436 | */ | ||
437 | #define FTDI_ACG_HFDUAL_PID 0xDD20 /* HF Dual ISO Reader (RFID) */ | ||
429 | 438 | ||
430 | /* Commands */ | 439 | /* Commands */ |
431 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 440 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
diff --git a/drivers/usb/serial/generic.c b/drivers/usb/serial/generic.c index 476cda107f4f..c62cc2876519 100644 --- a/drivers/usb/serial/generic.c +++ b/drivers/usb/serial/generic.c | |||
@@ -138,6 +138,7 @@ int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp) | |||
138 | 138 | ||
139 | return result; | 139 | return result; |
140 | } | 140 | } |
141 | EXPORT_SYMBOL_GPL(usb_serial_generic_open); | ||
141 | 142 | ||
142 | static void generic_cleanup (struct usb_serial_port *port) | 143 | static void generic_cleanup (struct usb_serial_port *port) |
143 | { | 144 | { |
diff --git a/drivers/usb/serial/omninet.c b/drivers/usb/serial/omninet.c index 4d40704dea2c..238033a87092 100644 --- a/drivers/usb/serial/omninet.c +++ b/drivers/usb/serial/omninet.c | |||
@@ -257,14 +257,14 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf | |||
257 | return (0); | 257 | return (0); |
258 | } | 258 | } |
259 | 259 | ||
260 | spin_lock(&port->lock); | 260 | spin_lock(&wport->lock); |
261 | if (port->write_urb_busy) { | 261 | if (wport->write_urb_busy) { |
262 | spin_unlock(&port->lock); | 262 | spin_unlock(&wport->lock); |
263 | dbg("%s - already writing", __FUNCTION__); | 263 | dbg("%s - already writing", __FUNCTION__); |
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
266 | port->write_urb_busy = 1; | 266 | wport->write_urb_busy = 1; |
267 | spin_unlock(&port->lock); | 267 | spin_unlock(&wport->lock); |
268 | 268 | ||
269 | count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count; | 269 | count = (count > OMNINET_BULKOUTSIZE) ? OMNINET_BULKOUTSIZE : count; |
270 | 270 | ||
@@ -283,7 +283,7 @@ static int omninet_write (struct usb_serial_port *port, const unsigned char *buf | |||
283 | wport->write_urb->dev = serial->dev; | 283 | wport->write_urb->dev = serial->dev; |
284 | result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); | 284 | result = usb_submit_urb(wport->write_urb, GFP_ATOMIC); |
285 | if (result) { | 285 | if (result) { |
286 | port->write_urb_busy = 0; | 286 | wport->write_urb_busy = 0; |
287 | err("%s - failed submitting write urb, error %d", __FUNCTION__, result); | 287 | err("%s - failed submitting write urb, error %d", __FUNCTION__, result); |
288 | } else | 288 | } else |
289 | result = count; | 289 | result = count; |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 071f86a59c08..9c36f0ece20f 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -189,11 +189,15 @@ static int serial_open (struct tty_struct *tty, struct file * filp) | |||
189 | 189 | ||
190 | portNumber = tty->index - serial->minor; | 190 | portNumber = tty->index - serial->minor; |
191 | port = serial->port[portNumber]; | 191 | port = serial->port[portNumber]; |
192 | if (!port) | 192 | if (!port) { |
193 | return -ENODEV; | 193 | retval = -ENODEV; |
194 | goto bailout_kref_put; | ||
195 | } | ||
194 | 196 | ||
195 | if (mutex_lock_interruptible(&port->mutex)) | 197 | if (mutex_lock_interruptible(&port->mutex)) { |
196 | return -ERESTARTSYS; | 198 | retval = -ERESTARTSYS; |
199 | goto bailout_kref_put; | ||
200 | } | ||
197 | 201 | ||
198 | ++port->open_count; | 202 | ++port->open_count; |
199 | 203 | ||
@@ -209,7 +213,7 @@ static int serial_open (struct tty_struct *tty, struct file * filp) | |||
209 | * safe because we are called with BKL held */ | 213 | * safe because we are called with BKL held */ |
210 | if (!try_module_get(serial->type->driver.owner)) { | 214 | if (!try_module_get(serial->type->driver.owner)) { |
211 | retval = -ENODEV; | 215 | retval = -ENODEV; |
212 | goto bailout_kref_put; | 216 | goto bailout_mutex_unlock; |
213 | } | 217 | } |
214 | 218 | ||
215 | /* only call the device specific open if this | 219 | /* only call the device specific open if this |
@@ -224,10 +228,11 @@ static int serial_open (struct tty_struct *tty, struct file * filp) | |||
224 | 228 | ||
225 | bailout_module_put: | 229 | bailout_module_put: |
226 | module_put(serial->type->driver.owner); | 230 | module_put(serial->type->driver.owner); |
227 | bailout_kref_put: | 231 | bailout_mutex_unlock: |
228 | kref_put(&serial->kref, destroy_serial); | ||
229 | port->open_count = 0; | 232 | port->open_count = 0; |
230 | mutex_unlock(&port->mutex); | 233 | mutex_unlock(&port->mutex); |
234 | bailout_kref_put: | ||
235 | kref_put(&serial->kref, destroy_serial); | ||
231 | return retval; | 236 | return retval; |
232 | } | 237 | } |
233 | 238 | ||
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 334b1db1bd7c..27597c576eff 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -29,12 +29,15 @@ static ssize_t backlight_show_power(struct class_device *cdev, char *buf) | |||
29 | 29 | ||
30 | static ssize_t backlight_store_power(struct class_device *cdev, const char *buf, size_t count) | 30 | static ssize_t backlight_store_power(struct class_device *cdev, const char *buf, size_t count) |
31 | { | 31 | { |
32 | int rc = -ENXIO, power; | 32 | int rc = -ENXIO; |
33 | char *endp; | 33 | char *endp; |
34 | struct backlight_device *bd = to_backlight_device(cdev); | 34 | struct backlight_device *bd = to_backlight_device(cdev); |
35 | int power = simple_strtoul(buf, &endp, 0); | ||
36 | size_t size = endp - buf; | ||
35 | 37 | ||
36 | power = simple_strtoul(buf, &endp, 0); | 38 | if (*endp && isspace(*endp)) |
37 | if (*endp && !isspace(*endp)) | 39 | size++; |
40 | if (size != count) | ||
38 | return -EINVAL; | 41 | return -EINVAL; |
39 | 42 | ||
40 | down(&bd->sem); | 43 | down(&bd->sem); |
@@ -65,12 +68,15 @@ static ssize_t backlight_show_brightness(struct class_device *cdev, char *buf) | |||
65 | 68 | ||
66 | static ssize_t backlight_store_brightness(struct class_device *cdev, const char *buf, size_t count) | 69 | static ssize_t backlight_store_brightness(struct class_device *cdev, const char *buf, size_t count) |
67 | { | 70 | { |
68 | int rc = -ENXIO, brightness; | 71 | int rc = -ENXIO; |
69 | char *endp; | 72 | char *endp; |
70 | struct backlight_device *bd = to_backlight_device(cdev); | 73 | struct backlight_device *bd = to_backlight_device(cdev); |
74 | int brightness = simple_strtoul(buf, &endp, 0); | ||
75 | size_t size = endp - buf; | ||
71 | 76 | ||
72 | brightness = simple_strtoul(buf, &endp, 0); | 77 | if (*endp && isspace(*endp)) |
73 | if (*endp && !isspace(*endp)) | 78 | size++; |
79 | if (size != count) | ||
74 | return -EINVAL; | 80 | return -EINVAL; |
75 | 81 | ||
76 | down(&bd->sem); | 82 | down(&bd->sem); |
diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 86908a60c630..bc8ab005a3fb 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c | |||
@@ -31,12 +31,15 @@ static ssize_t lcd_show_power(struct class_device *cdev, char *buf) | |||
31 | 31 | ||
32 | static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_t count) | 32 | static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_t count) |
33 | { | 33 | { |
34 | int rc, power; | 34 | int rc = -ENXIO; |
35 | char *endp; | 35 | char *endp; |
36 | struct lcd_device *ld = to_lcd_device(cdev); | 36 | struct lcd_device *ld = to_lcd_device(cdev); |
37 | int power = simple_strtoul(buf, &endp, 0); | ||
38 | size_t size = endp - buf; | ||
37 | 39 | ||
38 | power = simple_strtoul(buf, &endp, 0); | 40 | if (*endp && isspace(*endp)) |
39 | if (*endp && !isspace(*endp)) | 41 | size++; |
42 | if (size != count) | ||
40 | return -EINVAL; | 43 | return -EINVAL; |
41 | 44 | ||
42 | down(&ld->sem); | 45 | down(&ld->sem); |
@@ -44,8 +47,7 @@ static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_ | |||
44 | pr_debug("lcd: set power to %d\n", power); | 47 | pr_debug("lcd: set power to %d\n", power); |
45 | ld->props->set_power(ld, power); | 48 | ld->props->set_power(ld, power); |
46 | rc = count; | 49 | rc = count; |
47 | } else | 50 | } |
48 | rc = -ENXIO; | ||
49 | up(&ld->sem); | 51 | up(&ld->sem); |
50 | 52 | ||
51 | return rc; | 53 | return rc; |
@@ -53,14 +55,12 @@ static ssize_t lcd_store_power(struct class_device *cdev, const char *buf, size_ | |||
53 | 55 | ||
54 | static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf) | 56 | static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf) |
55 | { | 57 | { |
56 | int rc; | 58 | int rc = -ENXIO; |
57 | struct lcd_device *ld = to_lcd_device(cdev); | 59 | struct lcd_device *ld = to_lcd_device(cdev); |
58 | 60 | ||
59 | down(&ld->sem); | 61 | down(&ld->sem); |
60 | if (likely(ld->props && ld->props->get_contrast)) | 62 | if (likely(ld->props && ld->props->get_contrast)) |
61 | rc = sprintf(buf, "%d\n", ld->props->get_contrast(ld)); | 63 | rc = sprintf(buf, "%d\n", ld->props->get_contrast(ld)); |
62 | else | ||
63 | rc = -ENXIO; | ||
64 | up(&ld->sem); | 64 | up(&ld->sem); |
65 | 65 | ||
66 | return rc; | 66 | return rc; |
@@ -68,12 +68,15 @@ static ssize_t lcd_show_contrast(struct class_device *cdev, char *buf) | |||
68 | 68 | ||
69 | static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, size_t count) | 69 | static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, size_t count) |
70 | { | 70 | { |
71 | int rc, contrast; | 71 | int rc = -ENXIO; |
72 | char *endp; | 72 | char *endp; |
73 | struct lcd_device *ld = to_lcd_device(cdev); | 73 | struct lcd_device *ld = to_lcd_device(cdev); |
74 | int contrast = simple_strtoul(buf, &endp, 0); | ||
75 | size_t size = endp - buf; | ||
74 | 76 | ||
75 | contrast = simple_strtoul(buf, &endp, 0); | 77 | if (*endp && isspace(*endp)) |
76 | if (*endp && !isspace(*endp)) | 78 | size++; |
79 | if (size != count) | ||
77 | return -EINVAL; | 80 | return -EINVAL; |
78 | 81 | ||
79 | down(&ld->sem); | 82 | down(&ld->sem); |
@@ -81,8 +84,7 @@ static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, si | |||
81 | pr_debug("lcd: set contrast to %d\n", contrast); | 84 | pr_debug("lcd: set contrast to %d\n", contrast); |
82 | ld->props->set_contrast(ld, contrast); | 85 | ld->props->set_contrast(ld, contrast); |
83 | rc = count; | 86 | rc = count; |
84 | } else | 87 | } |
85 | rc = -ENXIO; | ||
86 | up(&ld->sem); | 88 | up(&ld->sem); |
87 | 89 | ||
88 | return rc; | 90 | return rc; |
@@ -90,14 +92,12 @@ static ssize_t lcd_store_contrast(struct class_device *cdev, const char *buf, si | |||
90 | 92 | ||
91 | static ssize_t lcd_show_max_contrast(struct class_device *cdev, char *buf) | 93 | static ssize_t lcd_show_max_contrast(struct class_device *cdev, char *buf) |
92 | { | 94 | { |
93 | int rc; | 95 | int rc = -ENXIO; |
94 | struct lcd_device *ld = to_lcd_device(cdev); | 96 | struct lcd_device *ld = to_lcd_device(cdev); |
95 | 97 | ||
96 | down(&ld->sem); | 98 | down(&ld->sem); |
97 | if (likely(ld->props)) | 99 | if (likely(ld->props)) |
98 | rc = sprintf(buf, "%d\n", ld->props->max_contrast); | 100 | rc = sprintf(buf, "%d\n", ld->props->max_contrast); |
99 | else | ||
100 | rc = -ENXIO; | ||
101 | up(&ld->sem); | 101 | up(&ld->sem); |
102 | 102 | ||
103 | return rc; | 103 | return rc; |
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c index 788297e9d59e..44aa2ffff973 100644 --- a/drivers/video/i810/i810_main.c +++ b/drivers/video/i810/i810_main.c | |||
@@ -76,8 +76,8 @@ | |||
76 | * | 76 | * |
77 | * Experiment with v_offset to find out which works best for you. | 77 | * Experiment with v_offset to find out which works best for you. |
78 | */ | 78 | */ |
79 | static u32 v_offset_default __initdata; /* For 32 MiB Aper size, 8 should be the default */ | 79 | static u32 v_offset_default __devinitdata; /* For 32 MiB Aper size, 8 should be the default */ |
80 | static u32 voffset __initdata = 0; | 80 | static u32 voffset __devinitdata; |
81 | 81 | ||
82 | static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor); | 82 | static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor); |
83 | static int __devinit i810fb_init_pci (struct pci_dev *dev, | 83 | static int __devinit i810fb_init_pci (struct pci_dev *dev, |
diff --git a/drivers/video/logo/Makefile b/drivers/video/logo/Makefile index 4ef5cd19609d..b985dfad6c63 100644 --- a/drivers/video/logo/Makefile +++ b/drivers/video/logo/Makefile | |||
@@ -34,7 +34,7 @@ extra-y += $(call logo-cfiles,_clut224,ppm) | |||
34 | extra-y += $(call logo-cfiles,_gray256,pgm) | 34 | extra-y += $(call logo-cfiles,_gray256,pgm) |
35 | 35 | ||
36 | # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." | 36 | # Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..." |
37 | quiet_cmd_logo = LOGO $@ | 37 | quiet_cmd_logo = LOGO $@ |
38 | cmd_logo = scripts/pnmtologo \ | 38 | cmd_logo = scripts/pnmtologo \ |
39 | -t $(patsubst $*_%,%,$(notdir $(basename $<))) \ | 39 | -t $(patsubst $*_%,%,$(notdir $(basename $<))) \ |
40 | -n $(notdir $(basename $<)) -o $@ $< | 40 | -n $(notdir $(basename $<)) -o $@ $< |
diff --git a/drivers/video/matrox/g450_pll.c b/drivers/video/matrox/g450_pll.c index 8073a73f6f35..440272ad10e7 100644 --- a/drivers/video/matrox/g450_pll.c +++ b/drivers/video/matrox/g450_pll.c | |||
@@ -316,14 +316,24 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll, | |||
316 | case M_PIXEL_PLL_B: | 316 | case M_PIXEL_PLL_B: |
317 | case M_PIXEL_PLL_C: | 317 | case M_PIXEL_PLL_C: |
318 | { | 318 | { |
319 | u_int8_t tmp; | 319 | u_int8_t tmp, xpwrctrl; |
320 | unsigned long flags; | 320 | unsigned long flags; |
321 | 321 | ||
322 | matroxfb_DAC_lock_irqsave(flags); | 322 | matroxfb_DAC_lock_irqsave(flags); |
323 | |||
324 | xpwrctrl = matroxfb_DAC_in(PMINFO M1064_XPWRCTRL); | ||
325 | matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl & ~M1064_XPWRCTRL_PANELPDN); | ||
326 | mga_outb(M_SEQ_INDEX, M_SEQ1); | ||
327 | mga_outb(M_SEQ_DATA, mga_inb(M_SEQ_DATA) | M_SEQ1_SCROFF); | ||
323 | tmp = matroxfb_DAC_in(PMINFO M1064_XPIXCLKCTRL); | 328 | tmp = matroxfb_DAC_in(PMINFO M1064_XPIXCLKCTRL); |
329 | tmp |= M1064_XPIXCLKCTRL_DIS; | ||
324 | if (!(tmp & M1064_XPIXCLKCTRL_PLL_UP)) { | 330 | if (!(tmp & M1064_XPIXCLKCTRL_PLL_UP)) { |
325 | matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp | M1064_XPIXCLKCTRL_PLL_UP); | 331 | tmp |= M1064_XPIXCLKCTRL_PLL_UP; |
326 | } | 332 | } |
333 | matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp); | ||
334 | matroxfb_DAC_out(PMINFO M1064_XDVICLKCTRL, 0); | ||
335 | matroxfb_DAC_out(PMINFO M1064_XPWRCTRL, xpwrctrl); | ||
336 | |||
327 | matroxfb_DAC_unlock_irqrestore(flags); | 337 | matroxfb_DAC_unlock_irqrestore(flags); |
328 | } | 338 | } |
329 | { | 339 | { |
@@ -418,6 +428,15 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll, | |||
418 | frequency to higher - with <= lowest wins, while | 428 | frequency to higher - with <= lowest wins, while |
419 | with < highest one wins */ | 429 | with < highest one wins */ |
420 | if (delta <= deltaarray[idx-1]) { | 430 | if (delta <= deltaarray[idx-1]) { |
431 | /* all else being equal except VCO, | ||
432 | * choose VCO not near (within 1/16th or so) VCOmin | ||
433 | * (freqs near VCOmin aren't as stable) | ||
434 | */ | ||
435 | if (delta == deltaarray[idx-1] | ||
436 | && vco != g450_mnp2vco(PMINFO mnparray[idx-1]) | ||
437 | && vco < (pi->vcomin * 17 / 16)) { | ||
438 | break; | ||
439 | } | ||
421 | mnparray[idx] = mnparray[idx-1]; | 440 | mnparray[idx] = mnparray[idx-1]; |
422 | deltaarray[idx] = deltaarray[idx-1]; | 441 | deltaarray[idx] = deltaarray[idx-1]; |
423 | } else { | 442 | } else { |
diff --git a/drivers/video/matrox/matroxfb_DAC1064.h b/drivers/video/matrox/matroxfb_DAC1064.h index 2e7238aa2432..56513a5d220b 100644 --- a/drivers/video/matrox/matroxfb_DAC1064.h +++ b/drivers/video/matrox/matroxfb_DAC1064.h | |||
@@ -40,6 +40,7 @@ void DAC1064_global_restore(WPMINFO2); | |||
40 | #define M1064_XCURCOL1RED 0x0C | 40 | #define M1064_XCURCOL1RED 0x0C |
41 | #define M1064_XCURCOL1GREEN 0x0D | 41 | #define M1064_XCURCOL1GREEN 0x0D |
42 | #define M1064_XCURCOL1BLUE 0x0E | 42 | #define M1064_XCURCOL1BLUE 0x0E |
43 | #define M1064_XDVICLKCTRL 0x0F | ||
43 | #define M1064_XCURCOL2RED 0x10 | 44 | #define M1064_XCURCOL2RED 0x10 |
44 | #define M1064_XCURCOL2GREEN 0x11 | 45 | #define M1064_XCURCOL2GREEN 0x11 |
45 | #define M1064_XCURCOL2BLUE 0x12 | 46 | #define M1064_XCURCOL2BLUE 0x12 |
@@ -144,6 +145,7 @@ void DAC1064_global_restore(WPMINFO2); | |||
144 | #define M1064_XVIDPLLN 0x8F | 145 | #define M1064_XVIDPLLN 0x8F |
145 | 146 | ||
146 | #define M1064_XPWRCTRL 0xA0 | 147 | #define M1064_XPWRCTRL 0xA0 |
148 | #define M1064_XPWRCTRL_PANELPDN 0x04 | ||
147 | 149 | ||
148 | #define M1064_XPANMODE 0xA2 | 150 | #define M1064_XPANMODE 0xA2 |
149 | 151 | ||
diff --git a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h index 3a3e1804c56a..b71737178d0d 100644 --- a/drivers/video/matrox/matroxfb_base.h +++ b/drivers/video/matrox/matroxfb_base.h | |||
@@ -672,6 +672,8 @@ void matroxfb_unregister_driver(struct matroxfb_driver* drv); | |||
672 | 672 | ||
673 | #define M_SEQ_INDEX 0x1FC4 | 673 | #define M_SEQ_INDEX 0x1FC4 |
674 | #define M_SEQ_DATA 0x1FC5 | 674 | #define M_SEQ_DATA 0x1FC5 |
675 | #define M_SEQ1 0x01 | ||
676 | #define M_SEQ1_SCROFF 0x20 | ||
675 | 677 | ||
676 | #define M_MISC_REG_READ 0x1FCC | 678 | #define M_MISC_REG_READ 0x1FCC |
677 | 679 | ||
diff --git a/fs/9p/fcall.c b/fs/9p/fcall.c index 71742ba150c4..6f2617820a4e 100644 --- a/fs/9p/fcall.c +++ b/fs/9p/fcall.c | |||
@@ -98,23 +98,20 @@ v9fs_t_attach(struct v9fs_session_info *v9ses, char *uname, char *aname, | |||
98 | static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc, | 98 | static void v9fs_t_clunk_cb(void *a, struct v9fs_fcall *tc, |
99 | struct v9fs_fcall *rc, int err) | 99 | struct v9fs_fcall *rc, int err) |
100 | { | 100 | { |
101 | int fid; | 101 | int fid, id; |
102 | struct v9fs_session_info *v9ses; | 102 | struct v9fs_session_info *v9ses; |
103 | 103 | ||
104 | if (err) | 104 | id = 0; |
105 | return; | ||
106 | |||
107 | fid = tc->params.tclunk.fid; | 105 | fid = tc->params.tclunk.fid; |
108 | kfree(tc); | 106 | if (rc) |
109 | 107 | id = rc->id; | |
110 | if (!rc) | ||
111 | return; | ||
112 | |||
113 | v9ses = a; | ||
114 | if (rc->id == RCLUNK) | ||
115 | v9fs_put_idpool(fid, &v9ses->fidpool); | ||
116 | 108 | ||
109 | kfree(tc); | ||
117 | kfree(rc); | 110 | kfree(rc); |
111 | if (id == RCLUNK) { | ||
112 | v9ses = a; | ||
113 | v9fs_put_idpool(fid, &v9ses->fidpool); | ||
114 | } | ||
118 | } | 115 | } |
119 | 116 | ||
120 | /** | 117 | /** |
diff --git a/fs/9p/mux.c b/fs/9p/mux.c index 3e5b124a7212..f4407eb276c7 100644 --- a/fs/9p/mux.c +++ b/fs/9p/mux.c | |||
@@ -50,15 +50,23 @@ enum { | |||
50 | Wpending = 8, /* can write */ | 50 | Wpending = 8, /* can write */ |
51 | }; | 51 | }; |
52 | 52 | ||
53 | enum { | ||
54 | None, | ||
55 | Flushing, | ||
56 | Flushed, | ||
57 | }; | ||
58 | |||
53 | struct v9fs_mux_poll_task; | 59 | struct v9fs_mux_poll_task; |
54 | 60 | ||
55 | struct v9fs_req { | 61 | struct v9fs_req { |
62 | spinlock_t lock; | ||
56 | int tag; | 63 | int tag; |
57 | struct v9fs_fcall *tcall; | 64 | struct v9fs_fcall *tcall; |
58 | struct v9fs_fcall *rcall; | 65 | struct v9fs_fcall *rcall; |
59 | int err; | 66 | int err; |
60 | v9fs_mux_req_callback cb; | 67 | v9fs_mux_req_callback cb; |
61 | void *cba; | 68 | void *cba; |
69 | int flush; | ||
62 | struct list_head req_list; | 70 | struct list_head req_list; |
63 | }; | 71 | }; |
64 | 72 | ||
@@ -96,8 +104,8 @@ struct v9fs_mux_poll_task { | |||
96 | 104 | ||
97 | struct v9fs_mux_rpc { | 105 | struct v9fs_mux_rpc { |
98 | struct v9fs_mux_data *m; | 106 | struct v9fs_mux_data *m; |
99 | struct v9fs_req *req; | ||
100 | int err; | 107 | int err; |
108 | struct v9fs_fcall *tcall; | ||
101 | struct v9fs_fcall *rcall; | 109 | struct v9fs_fcall *rcall; |
102 | wait_queue_head_t wqueue; | 110 | wait_queue_head_t wqueue; |
103 | }; | 111 | }; |
@@ -524,10 +532,9 @@ again: | |||
524 | 532 | ||
525 | static void process_request(struct v9fs_mux_data *m, struct v9fs_req *req) | 533 | static void process_request(struct v9fs_mux_data *m, struct v9fs_req *req) |
526 | { | 534 | { |
527 | int ecode, tag; | 535 | int ecode; |
528 | struct v9fs_str *ename; | 536 | struct v9fs_str *ename; |
529 | 537 | ||
530 | tag = req->tag; | ||
531 | if (!req->err && req->rcall->id == RERROR) { | 538 | if (!req->err && req->rcall->id == RERROR) { |
532 | ecode = req->rcall->params.rerror.errno; | 539 | ecode = req->rcall->params.rerror.errno; |
533 | ename = &req->rcall->params.rerror.error; | 540 | ename = &req->rcall->params.rerror.error; |
@@ -553,23 +560,6 @@ static void process_request(struct v9fs_mux_data *m, struct v9fs_req *req) | |||
553 | if (!req->err) | 560 | if (!req->err) |
554 | req->err = -EIO; | 561 | req->err = -EIO; |
555 | } | 562 | } |
556 | |||
557 | if (req->err == ERREQFLUSH) | ||
558 | return; | ||
559 | |||
560 | if (req->cb) { | ||
561 | dprintk(DEBUG_MUX, "calling callback tcall %p rcall %p\n", | ||
562 | req->tcall, req->rcall); | ||
563 | |||
564 | (*req->cb) (req->cba, req->tcall, req->rcall, req->err); | ||
565 | req->cb = NULL; | ||
566 | } else | ||
567 | kfree(req->rcall); | ||
568 | |||
569 | v9fs_mux_put_tag(m, tag); | ||
570 | |||
571 | wake_up(&m->equeue); | ||
572 | kfree(req); | ||
573 | } | 563 | } |
574 | 564 | ||
575 | /** | 565 | /** |
@@ -669,17 +659,26 @@ static void v9fs_read_work(void *a) | |||
669 | list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) { | 659 | list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) { |
670 | if (rreq->tag == rcall->tag) { | 660 | if (rreq->tag == rcall->tag) { |
671 | req = rreq; | 661 | req = rreq; |
672 | req->rcall = rcall; | 662 | if (req->flush != Flushing) |
673 | list_del(&req->req_list); | 663 | list_del(&req->req_list); |
674 | spin_unlock(&m->lock); | ||
675 | process_request(m, req); | ||
676 | break; | 664 | break; |
677 | } | 665 | } |
678 | |||
679 | } | 666 | } |
667 | spin_unlock(&m->lock); | ||
680 | 668 | ||
681 | if (!req) { | 669 | if (req) { |
682 | spin_unlock(&m->lock); | 670 | req->rcall = rcall; |
671 | process_request(m, req); | ||
672 | |||
673 | if (req->flush != Flushing) { | ||
674 | if (req->cb) | ||
675 | (*req->cb) (req, req->cba); | ||
676 | else | ||
677 | kfree(req->rcall); | ||
678 | |||
679 | wake_up(&m->equeue); | ||
680 | } | ||
681 | } else { | ||
683 | if (err >= 0 && rcall->id != RFLUSH) | 682 | if (err >= 0 && rcall->id != RFLUSH) |
684 | dprintk(DEBUG_ERROR, | 683 | dprintk(DEBUG_ERROR, |
685 | "unexpected response mux %p id %d tag %d\n", | 684 | "unexpected response mux %p id %d tag %d\n", |
@@ -746,7 +745,6 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m, | |||
746 | return ERR_PTR(-ENOMEM); | 745 | return ERR_PTR(-ENOMEM); |
747 | 746 | ||
748 | v9fs_set_tag(tc, n); | 747 | v9fs_set_tag(tc, n); |
749 | |||
750 | if ((v9fs_debug_level&DEBUG_FCALL) == DEBUG_FCALL) { | 748 | if ((v9fs_debug_level&DEBUG_FCALL) == DEBUG_FCALL) { |
751 | char buf[150]; | 749 | char buf[150]; |
752 | 750 | ||
@@ -754,12 +752,14 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m, | |||
754 | printk(KERN_NOTICE "<<< %p %s\n", m, buf); | 752 | printk(KERN_NOTICE "<<< %p %s\n", m, buf); |
755 | } | 753 | } |
756 | 754 | ||
755 | spin_lock_init(&req->lock); | ||
757 | req->tag = n; | 756 | req->tag = n; |
758 | req->tcall = tc; | 757 | req->tcall = tc; |
759 | req->rcall = NULL; | 758 | req->rcall = NULL; |
760 | req->err = 0; | 759 | req->err = 0; |
761 | req->cb = cb; | 760 | req->cb = cb; |
762 | req->cba = cba; | 761 | req->cba = cba; |
762 | req->flush = None; | ||
763 | 763 | ||
764 | spin_lock(&m->lock); | 764 | spin_lock(&m->lock); |
765 | list_add_tail(&req->req_list, &m->unsent_req_list); | 765 | list_add_tail(&req->req_list, &m->unsent_req_list); |
@@ -776,72 +776,108 @@ static struct v9fs_req *v9fs_send_request(struct v9fs_mux_data *m, | |||
776 | return req; | 776 | return req; |
777 | } | 777 | } |
778 | 778 | ||
779 | static void v9fs_mux_flush_cb(void *a, struct v9fs_fcall *tc, | 779 | static void v9fs_mux_free_request(struct v9fs_mux_data *m, struct v9fs_req *req) |
780 | struct v9fs_fcall *rc, int err) | 780 | { |
781 | v9fs_mux_put_tag(m, req->tag); | ||
782 | kfree(req); | ||
783 | } | ||
784 | |||
785 | static void v9fs_mux_flush_cb(struct v9fs_req *freq, void *a) | ||
781 | { | 786 | { |
782 | v9fs_mux_req_callback cb; | 787 | v9fs_mux_req_callback cb; |
783 | int tag; | 788 | int tag; |
784 | struct v9fs_mux_data *m; | 789 | struct v9fs_mux_data *m; |
785 | struct v9fs_req *req, *rptr; | 790 | struct v9fs_req *req, *rreq, *rptr; |
786 | 791 | ||
787 | m = a; | 792 | m = a; |
788 | dprintk(DEBUG_MUX, "mux %p tc %p rc %p err %d oldtag %d\n", m, tc, | 793 | dprintk(DEBUG_MUX, "mux %p tc %p rc %p err %d oldtag %d\n", m, |
789 | rc, err, tc->params.tflush.oldtag); | 794 | freq->tcall, freq->rcall, freq->err, |
795 | freq->tcall->params.tflush.oldtag); | ||
790 | 796 | ||
791 | spin_lock(&m->lock); | 797 | spin_lock(&m->lock); |
792 | cb = NULL; | 798 | cb = NULL; |
793 | tag = tc->params.tflush.oldtag; | 799 | tag = freq->tcall->params.tflush.oldtag; |
794 | list_for_each_entry_safe(req, rptr, &m->req_list, req_list) { | 800 | req = NULL; |
795 | if (req->tag == tag) { | 801 | list_for_each_entry_safe(rreq, rptr, &m->req_list, req_list) { |
802 | if (rreq->tag == tag) { | ||
803 | req = rreq; | ||
796 | list_del(&req->req_list); | 804 | list_del(&req->req_list); |
797 | if (req->cb) { | ||
798 | cb = req->cb; | ||
799 | req->cb = NULL; | ||
800 | spin_unlock(&m->lock); | ||
801 | (*cb) (req->cba, req->tcall, req->rcall, | ||
802 | req->err); | ||
803 | } | ||
804 | kfree(req); | ||
805 | wake_up(&m->equeue); | ||
806 | break; | 805 | break; |
807 | } | 806 | } |
808 | } | 807 | } |
808 | spin_unlock(&m->lock); | ||
809 | 809 | ||
810 | if (!cb) | 810 | if (req) { |
811 | spin_unlock(&m->lock); | 811 | spin_lock(&req->lock); |
812 | req->flush = Flushed; | ||
813 | spin_unlock(&req->lock); | ||
814 | |||
815 | if (req->cb) | ||
816 | (*req->cb) (req, req->cba); | ||
817 | else | ||
818 | kfree(req->rcall); | ||
819 | |||
820 | wake_up(&m->equeue); | ||
821 | } | ||
812 | 822 | ||
813 | v9fs_mux_put_tag(m, tag); | 823 | kfree(freq->tcall); |
814 | kfree(tc); | 824 | kfree(freq->rcall); |
815 | kfree(rc); | 825 | v9fs_mux_free_request(m, freq); |
816 | } | 826 | } |
817 | 827 | ||
818 | static void | 828 | static int |
819 | v9fs_mux_flush_request(struct v9fs_mux_data *m, struct v9fs_req *req) | 829 | v9fs_mux_flush_request(struct v9fs_mux_data *m, struct v9fs_req *req) |
820 | { | 830 | { |
821 | struct v9fs_fcall *fc; | 831 | struct v9fs_fcall *fc; |
832 | struct v9fs_req *rreq, *rptr; | ||
822 | 833 | ||
823 | dprintk(DEBUG_MUX, "mux %p req %p tag %d\n", m, req, req->tag); | 834 | dprintk(DEBUG_MUX, "mux %p req %p tag %d\n", m, req, req->tag); |
824 | 835 | ||
836 | /* if a response was received for a request, do nothing */ | ||
837 | spin_lock(&req->lock); | ||
838 | if (req->rcall || req->err) { | ||
839 | spin_unlock(&req->lock); | ||
840 | dprintk(DEBUG_MUX, "mux %p req %p response already received\n", m, req); | ||
841 | return 0; | ||
842 | } | ||
843 | |||
844 | req->flush = Flushing; | ||
845 | spin_unlock(&req->lock); | ||
846 | |||
847 | spin_lock(&m->lock); | ||
848 | /* if the request is not sent yet, just remove it from the list */ | ||
849 | list_for_each_entry_safe(rreq, rptr, &m->unsent_req_list, req_list) { | ||
850 | if (rreq->tag == req->tag) { | ||
851 | dprintk(DEBUG_MUX, "mux %p req %p request is not sent yet\n", m, req); | ||
852 | list_del(&rreq->req_list); | ||
853 | req->flush = Flushed; | ||
854 | spin_unlock(&m->lock); | ||
855 | if (req->cb) | ||
856 | (*req->cb) (req, req->cba); | ||
857 | return 0; | ||
858 | } | ||
859 | } | ||
860 | spin_unlock(&m->lock); | ||
861 | |||
862 | clear_thread_flag(TIF_SIGPENDING); | ||
825 | fc = v9fs_create_tflush(req->tag); | 863 | fc = v9fs_create_tflush(req->tag); |
826 | v9fs_send_request(m, fc, v9fs_mux_flush_cb, m); | 864 | v9fs_send_request(m, fc, v9fs_mux_flush_cb, m); |
865 | return 1; | ||
827 | } | 866 | } |
828 | 867 | ||
829 | static void | 868 | static void |
830 | v9fs_mux_rpc_cb(void *a, struct v9fs_fcall *tc, struct v9fs_fcall *rc, int err) | 869 | v9fs_mux_rpc_cb(struct v9fs_req *req, void *a) |
831 | { | 870 | { |
832 | struct v9fs_mux_rpc *r; | 871 | struct v9fs_mux_rpc *r; |
833 | 872 | ||
834 | if (err == ERREQFLUSH) { | 873 | dprintk(DEBUG_MUX, "req %p r %p\n", req, a); |
835 | kfree(rc); | ||
836 | dprintk(DEBUG_MUX, "err req flush\n"); | ||
837 | return; | ||
838 | } | ||
839 | |||
840 | r = a; | 874 | r = a; |
841 | dprintk(DEBUG_MUX, "mux %p req %p tc %p rc %p err %d\n", r->m, r->req, | 875 | r->rcall = req->rcall; |
842 | tc, rc, err); | 876 | r->err = req->err; |
843 | r->rcall = rc; | 877 | |
844 | r->err = err; | 878 | if (req->flush!=None && !req->err) |
879 | r->err = -ERESTARTSYS; | ||
880 | |||
845 | wake_up(&r->wqueue); | 881 | wake_up(&r->wqueue); |
846 | } | 882 | } |
847 | 883 | ||
@@ -856,12 +892,13 @@ int | |||
856 | v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, | 892 | v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, |
857 | struct v9fs_fcall **rc) | 893 | struct v9fs_fcall **rc) |
858 | { | 894 | { |
859 | int err; | 895 | int err, sigpending; |
860 | unsigned long flags; | 896 | unsigned long flags; |
861 | struct v9fs_req *req; | 897 | struct v9fs_req *req; |
862 | struct v9fs_mux_rpc r; | 898 | struct v9fs_mux_rpc r; |
863 | 899 | ||
864 | r.err = 0; | 900 | r.err = 0; |
901 | r.tcall = tc; | ||
865 | r.rcall = NULL; | 902 | r.rcall = NULL; |
866 | r.m = m; | 903 | r.m = m; |
867 | init_waitqueue_head(&r.wqueue); | 904 | init_waitqueue_head(&r.wqueue); |
@@ -869,48 +906,50 @@ v9fs_mux_rpc(struct v9fs_mux_data *m, struct v9fs_fcall *tc, | |||
869 | if (rc) | 906 | if (rc) |
870 | *rc = NULL; | 907 | *rc = NULL; |
871 | 908 | ||
909 | sigpending = 0; | ||
910 | if (signal_pending(current)) { | ||
911 | sigpending = 1; | ||
912 | clear_thread_flag(TIF_SIGPENDING); | ||
913 | } | ||
914 | |||
872 | req = v9fs_send_request(m, tc, v9fs_mux_rpc_cb, &r); | 915 | req = v9fs_send_request(m, tc, v9fs_mux_rpc_cb, &r); |
873 | if (IS_ERR(req)) { | 916 | if (IS_ERR(req)) { |
874 | err = PTR_ERR(req); | 917 | err = PTR_ERR(req); |
875 | dprintk(DEBUG_MUX, "error %d\n", err); | 918 | dprintk(DEBUG_MUX, "error %d\n", err); |
876 | return PTR_ERR(req); | 919 | return err; |
877 | } | 920 | } |
878 | 921 | ||
879 | r.req = req; | ||
880 | dprintk(DEBUG_MUX, "mux %p tc %p tag %d rpc %p req %p\n", m, tc, | ||
881 | req->tag, &r, req); | ||
882 | err = wait_event_interruptible(r.wqueue, r.rcall != NULL || r.err < 0); | 922 | err = wait_event_interruptible(r.wqueue, r.rcall != NULL || r.err < 0); |
883 | if (r.err < 0) | 923 | if (r.err < 0) |
884 | err = r.err; | 924 | err = r.err; |
885 | 925 | ||
886 | if (err == -ERESTARTSYS && m->trans->status == Connected && m->err == 0) { | 926 | if (err == -ERESTARTSYS && m->trans->status == Connected && m->err == 0) { |
887 | spin_lock(&m->lock); | 927 | if (v9fs_mux_flush_request(m, req)) { |
888 | req->tcall = NULL; | 928 | /* wait until we get response of the flush message */ |
889 | req->err = ERREQFLUSH; | 929 | do { |
890 | spin_unlock(&m->lock); | 930 | clear_thread_flag(TIF_SIGPENDING); |
931 | err = wait_event_interruptible(r.wqueue, | ||
932 | r.rcall || r.err); | ||
933 | } while (!r.rcall && !r.err && err==-ERESTARTSYS && | ||
934 | m->trans->status==Connected && !m->err); | ||
935 | } | ||
936 | sigpending = 1; | ||
937 | } | ||
891 | 938 | ||
892 | clear_thread_flag(TIF_SIGPENDING); | 939 | if (sigpending) { |
893 | v9fs_mux_flush_request(m, req); | ||
894 | spin_lock_irqsave(¤t->sighand->siglock, flags); | 940 | spin_lock_irqsave(¤t->sighand->siglock, flags); |
895 | recalc_sigpending(); | 941 | recalc_sigpending(); |
896 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); | 942 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); |
897 | } | 943 | } |
898 | 944 | ||
899 | if (!err) { | 945 | if (rc) |
900 | if (r.rcall) | 946 | *rc = r.rcall; |
901 | dprintk(DEBUG_MUX, "got response id %d tag %d\n", | 947 | else |
902 | r.rcall->id, r.rcall->tag); | ||
903 | |||
904 | if (rc) | ||
905 | *rc = r.rcall; | ||
906 | else | ||
907 | kfree(r.rcall); | ||
908 | } else { | ||
909 | kfree(r.rcall); | 948 | kfree(r.rcall); |
910 | dprintk(DEBUG_MUX, "got error %d\n", err); | 949 | |
911 | if (err > 0) | 950 | v9fs_mux_free_request(m, req); |
912 | err = -EIO; | 951 | if (err > 0) |
913 | } | 952 | err = -EIO; |
914 | 953 | ||
915 | return err; | 954 | return err; |
916 | } | 955 | } |
@@ -951,12 +990,15 @@ void v9fs_mux_cancel(struct v9fs_mux_data *m, int err) | |||
951 | struct v9fs_req *req, *rtmp; | 990 | struct v9fs_req *req, *rtmp; |
952 | LIST_HEAD(cancel_list); | 991 | LIST_HEAD(cancel_list); |
953 | 992 | ||
954 | dprintk(DEBUG_MUX, "mux %p err %d\n", m, err); | 993 | dprintk(DEBUG_ERROR, "mux %p err %d\n", m, err); |
955 | m->err = err; | 994 | m->err = err; |
956 | spin_lock(&m->lock); | 995 | spin_lock(&m->lock); |
957 | list_for_each_entry_safe(req, rtmp, &m->req_list, req_list) { | 996 | list_for_each_entry_safe(req, rtmp, &m->req_list, req_list) { |
958 | list_move(&req->req_list, &cancel_list); | 997 | list_move(&req->req_list, &cancel_list); |
959 | } | 998 | } |
999 | list_for_each_entry_safe(req, rtmp, &m->unsent_req_list, req_list) { | ||
1000 | list_move(&req->req_list, &cancel_list); | ||
1001 | } | ||
960 | spin_unlock(&m->lock); | 1002 | spin_unlock(&m->lock); |
961 | 1003 | ||
962 | list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) { | 1004 | list_for_each_entry_safe(req, rtmp, &cancel_list, req_list) { |
@@ -965,11 +1007,9 @@ void v9fs_mux_cancel(struct v9fs_mux_data *m, int err) | |||
965 | req->err = err; | 1007 | req->err = err; |
966 | 1008 | ||
967 | if (req->cb) | 1009 | if (req->cb) |
968 | (*req->cb) (req->cba, req->tcall, req->rcall, req->err); | 1010 | (*req->cb) (req, req->cba); |
969 | else | 1011 | else |
970 | kfree(req->rcall); | 1012 | kfree(req->rcall); |
971 | |||
972 | kfree(req); | ||
973 | } | 1013 | } |
974 | 1014 | ||
975 | wake_up(&m->equeue); | 1015 | wake_up(&m->equeue); |
diff --git a/fs/9p/mux.h b/fs/9p/mux.h index e90bfd32ea42..fb10c50186a1 100644 --- a/fs/9p/mux.h +++ b/fs/9p/mux.h | |||
@@ -24,6 +24,7 @@ | |||
24 | */ | 24 | */ |
25 | 25 | ||
26 | struct v9fs_mux_data; | 26 | struct v9fs_mux_data; |
27 | struct v9fs_req; | ||
27 | 28 | ||
28 | /** | 29 | /** |
29 | * v9fs_mux_req_callback - callback function that is called when the | 30 | * v9fs_mux_req_callback - callback function that is called when the |
@@ -36,8 +37,7 @@ struct v9fs_mux_data; | |||
36 | * @rc - response call | 37 | * @rc - response call |
37 | * @err - error code (non-zero if error occured) | 38 | * @err - error code (non-zero if error occured) |
38 | */ | 39 | */ |
39 | typedef void (*v9fs_mux_req_callback)(void *a, struct v9fs_fcall *tc, | 40 | typedef void (*v9fs_mux_req_callback)(struct v9fs_req *req, void *a); |
40 | struct v9fs_fcall *rc, int err); | ||
41 | 41 | ||
42 | int v9fs_mux_global_init(void); | 42 | int v9fs_mux_global_init(void); |
43 | void v9fs_mux_global_exit(void); | 43 | void v9fs_mux_global_exit(void); |
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index 083dcfcd158e..1a8e46084f0e 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -72,11 +72,17 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
72 | return -ENOSPC; | 72 | return -ENOSPC; |
73 | } | 73 | } |
74 | 74 | ||
75 | err = v9fs_t_walk(v9ses, vfid->fid, fid, NULL, NULL); | 75 | err = v9fs_t_walk(v9ses, vfid->fid, fid, NULL, &fcall); |
76 | if (err < 0) { | 76 | if (err < 0) { |
77 | dprintk(DEBUG_ERROR, "rewalk didn't work\n"); | 77 | dprintk(DEBUG_ERROR, "rewalk didn't work\n"); |
78 | goto put_fid; | 78 | if (fcall && fcall->id == RWALK) |
79 | goto clunk_fid; | ||
80 | else { | ||
81 | v9fs_put_idpool(fid, &v9ses->fidpool); | ||
82 | goto free_fcall; | ||
83 | } | ||
79 | } | 84 | } |
85 | kfree(fcall); | ||
80 | 86 | ||
81 | /* TODO: do special things for O_EXCL, O_NOFOLLOW, O_SYNC */ | 87 | /* TODO: do special things for O_EXCL, O_NOFOLLOW, O_SYNC */ |
82 | /* translate open mode appropriately */ | 88 | /* translate open mode appropriately */ |
@@ -109,8 +115,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
109 | clunk_fid: | 115 | clunk_fid: |
110 | v9fs_t_clunk(v9ses, fid); | 116 | v9fs_t_clunk(v9ses, fid); |
111 | 117 | ||
112 | put_fid: | 118 | free_fcall: |
113 | v9fs_put_idpool(fid, &v9ses->fidpool); | ||
114 | kfree(fcall); | 119 | kfree(fcall); |
115 | 120 | ||
116 | return err; | 121 | return err; |
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index 133db366d306..2cb87ba4b1c1 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c | |||
@@ -270,7 +270,10 @@ v9fs_create(struct v9fs_session_info *v9ses, u32 pfid, char *name, u32 perm, | |||
270 | err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); | 270 | err = v9fs_t_walk(v9ses, pfid, fid, NULL, &fcall); |
271 | if (err < 0) { | 271 | if (err < 0) { |
272 | PRINT_FCALL_ERROR("clone error", fcall); | 272 | PRINT_FCALL_ERROR("clone error", fcall); |
273 | goto put_fid; | 273 | if (fcall && fcall->id == RWALK) |
274 | goto clunk_fid; | ||
275 | else | ||
276 | goto put_fid; | ||
274 | } | 277 | } |
275 | kfree(fcall); | 278 | kfree(fcall); |
276 | 279 | ||
@@ -322,6 +325,9 @@ v9fs_clone_walk(struct v9fs_session_info *v9ses, u32 fid, struct dentry *dentry) | |||
322 | &fcall); | 325 | &fcall); |
323 | 326 | ||
324 | if (err < 0) { | 327 | if (err < 0) { |
328 | if (fcall && fcall->id == RWALK) | ||
329 | goto clunk_fid; | ||
330 | |||
325 | PRINT_FCALL_ERROR("walk error", fcall); | 331 | PRINT_FCALL_ERROR("walk error", fcall); |
326 | v9fs_put_idpool(nfid, &v9ses->fidpool); | 332 | v9fs_put_idpool(nfid, &v9ses->fidpool); |
327 | goto error; | 333 | goto error; |
@@ -640,19 +646,26 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry, | |||
640 | } | 646 | } |
641 | 647 | ||
642 | result = v9fs_t_walk(v9ses, dirfidnum, newfid, | 648 | result = v9fs_t_walk(v9ses, dirfidnum, newfid, |
643 | (char *)dentry->d_name.name, NULL); | 649 | (char *)dentry->d_name.name, &fcall); |
650 | |||
644 | if (result < 0) { | 651 | if (result < 0) { |
645 | v9fs_put_idpool(newfid, &v9ses->fidpool); | 652 | if (fcall && fcall->id == RWALK) |
653 | v9fs_t_clunk(v9ses, newfid); | ||
654 | else | ||
655 | v9fs_put_idpool(newfid, &v9ses->fidpool); | ||
656 | |||
646 | if (result == -ENOENT) { | 657 | if (result == -ENOENT) { |
647 | d_add(dentry, NULL); | 658 | d_add(dentry, NULL); |
648 | dprintk(DEBUG_VFS, | 659 | dprintk(DEBUG_VFS, |
649 | "Return negative dentry %p count %d\n", | 660 | "Return negative dentry %p count %d\n", |
650 | dentry, atomic_read(&dentry->d_count)); | 661 | dentry, atomic_read(&dentry->d_count)); |
662 | kfree(fcall); | ||
651 | return NULL; | 663 | return NULL; |
652 | } | 664 | } |
653 | dprintk(DEBUG_ERROR, "walk error:%d\n", result); | 665 | dprintk(DEBUG_ERROR, "walk error:%d\n", result); |
654 | goto FreeFcall; | 666 | goto FreeFcall; |
655 | } | 667 | } |
668 | kfree(fcall); | ||
656 | 669 | ||
657 | result = v9fs_t_stat(v9ses, newfid, &fcall); | 670 | result = v9fs_t_stat(v9ses, newfid, &fcall); |
658 | if (result < 0) { | 671 | if (result < 0) { |
diff --git a/fs/Makefile b/fs/Makefile index 83bf478e786b..078d3d1191a5 100644 --- a/fs/Makefile +++ b/fs/Makefile | |||
@@ -45,6 +45,7 @@ obj-$(CONFIG_DNOTIFY) += dnotify.o | |||
45 | obj-$(CONFIG_PROC_FS) += proc/ | 45 | obj-$(CONFIG_PROC_FS) += proc/ |
46 | obj-y += partitions/ | 46 | obj-y += partitions/ |
47 | obj-$(CONFIG_SYSFS) += sysfs/ | 47 | obj-$(CONFIG_SYSFS) += sysfs/ |
48 | obj-$(CONFIG_CONFIGFS_FS) += configfs/ | ||
48 | obj-y += devpts/ | 49 | obj-y += devpts/ |
49 | 50 | ||
50 | obj-$(CONFIG_PROFILING) += dcookies.o | 51 | obj-$(CONFIG_PROFILING) += dcookies.o |
@@ -100,5 +101,4 @@ obj-$(CONFIG_BEFS_FS) += befs/ | |||
100 | obj-$(CONFIG_HOSTFS) += hostfs/ | 101 | obj-$(CONFIG_HOSTFS) += hostfs/ |
101 | obj-$(CONFIG_HPPFS) += hppfs/ | 102 | obj-$(CONFIG_HPPFS) += hppfs/ |
102 | obj-$(CONFIG_DEBUG_FS) += debugfs/ | 103 | obj-$(CONFIG_DEBUG_FS) += debugfs/ |
103 | obj-$(CONFIG_CONFIGFS_FS) += configfs/ | ||
104 | obj-$(CONFIG_OCFS2_FS) += ocfs2/ | 104 | obj-$(CONFIG_OCFS2_FS) += ocfs2/ |
diff --git a/fs/autofs4/autofs_i.h b/fs/autofs4/autofs_i.h index 57c4903614e5..d6603d02304c 100644 --- a/fs/autofs4/autofs_i.h +++ b/fs/autofs4/autofs_i.h | |||
@@ -74,8 +74,8 @@ struct autofs_wait_queue { | |||
74 | struct autofs_wait_queue *next; | 74 | struct autofs_wait_queue *next; |
75 | autofs_wqt_t wait_queue_token; | 75 | autofs_wqt_t wait_queue_token; |
76 | /* We use the following to see what we are waiting for */ | 76 | /* We use the following to see what we are waiting for */ |
77 | int hash; | 77 | unsigned int hash; |
78 | int len; | 78 | unsigned int len; |
79 | char *name; | 79 | char *name; |
80 | u32 dev; | 80 | u32 dev; |
81 | u64 ino; | 81 | u64 ino; |
@@ -85,7 +85,6 @@ struct autofs_wait_queue { | |||
85 | pid_t tgid; | 85 | pid_t tgid; |
86 | /* This is for status reporting upon return */ | 86 | /* This is for status reporting upon return */ |
87 | int status; | 87 | int status; |
88 | atomic_t notify; | ||
89 | atomic_t wait_ctr; | 88 | atomic_t wait_ctr; |
90 | }; | 89 | }; |
91 | 90 | ||
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 84e030c8ddd0..5100f984783f 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -327,6 +327,7 @@ static int try_to_fill_dentry(struct dentry *dentry, int flags) | |||
327 | static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) | 327 | static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) |
328 | { | 328 | { |
329 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); | 329 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); |
330 | struct autofs_info *ino = autofs4_dentry_ino(dentry); | ||
330 | int oz_mode = autofs4_oz_mode(sbi); | 331 | int oz_mode = autofs4_oz_mode(sbi); |
331 | unsigned int lookup_type; | 332 | unsigned int lookup_type; |
332 | int status; | 333 | int status; |
@@ -340,13 +341,8 @@ static void *autofs4_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
340 | if (oz_mode || !lookup_type) | 341 | if (oz_mode || !lookup_type) |
341 | goto done; | 342 | goto done; |
342 | 343 | ||
343 | /* | 344 | /* If an expire request is pending wait for it. */ |
344 | * If a request is pending wait for it. | 345 | if (ino && (ino->flags & AUTOFS_INF_EXPIRING)) { |
345 | * If it's a mount then it won't be expired till at least | ||
346 | * a liitle later and if it's an expire then we might need | ||
347 | * to mount it again. | ||
348 | */ | ||
349 | if (autofs4_ispending(dentry)) { | ||
350 | DPRINTK("waiting for active request %p name=%.*s", | 346 | DPRINTK("waiting for active request %p name=%.*s", |
351 | dentry, dentry->d_name.len, dentry->d_name.name); | 347 | dentry, dentry->d_name.len, dentry->d_name.name); |
352 | 348 | ||
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 142ab6aa2aa1..ce103e7b0bc3 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c | |||
@@ -189,14 +189,30 @@ static int autofs4_getpath(struct autofs_sb_info *sbi, | |||
189 | return len; | 189 | return len; |
190 | } | 190 | } |
191 | 191 | ||
192 | static struct autofs_wait_queue * | ||
193 | autofs4_find_wait(struct autofs_sb_info *sbi, | ||
194 | char *name, unsigned int hash, unsigned int len) | ||
195 | { | ||
196 | struct autofs_wait_queue *wq; | ||
197 | |||
198 | for (wq = sbi->queues; wq; wq = wq->next) { | ||
199 | if (wq->hash == hash && | ||
200 | wq->len == len && | ||
201 | wq->name && !memcmp(wq->name, name, len)) | ||
202 | break; | ||
203 | } | ||
204 | return wq; | ||
205 | } | ||
206 | |||
192 | int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, | 207 | int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, |
193 | enum autofs_notify notify) | 208 | enum autofs_notify notify) |
194 | { | 209 | { |
210 | struct autofs_info *ino; | ||
195 | struct autofs_wait_queue *wq; | 211 | struct autofs_wait_queue *wq; |
196 | char *name; | 212 | char *name; |
197 | unsigned int len = 0; | 213 | unsigned int len = 0; |
198 | unsigned int hash = 0; | 214 | unsigned int hash = 0; |
199 | int status; | 215 | int status, type; |
200 | 216 | ||
201 | /* In catatonic mode, we don't wait for nobody */ | 217 | /* In catatonic mode, we don't wait for nobody */ |
202 | if (sbi->catatonic) | 218 | if (sbi->catatonic) |
@@ -223,21 +239,41 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, | |||
223 | return -EINTR; | 239 | return -EINTR; |
224 | } | 240 | } |
225 | 241 | ||
226 | for (wq = sbi->queues ; wq ; wq = wq->next) { | 242 | wq = autofs4_find_wait(sbi, name, hash, len); |
227 | if (wq->hash == dentry->d_name.hash && | 243 | ino = autofs4_dentry_ino(dentry); |
228 | wq->len == len && | 244 | if (!wq && ino && notify == NFY_NONE) { |
229 | wq->name && !memcmp(wq->name, name, len)) | 245 | /* |
230 | break; | 246 | * Either we've betean the pending expire to post it's |
231 | } | 247 | * wait or it finished while we waited on the mutex. |
248 | * So we need to wait till either, the wait appears | ||
249 | * or the expire finishes. | ||
250 | */ | ||
251 | |||
252 | while (ino->flags & AUTOFS_INF_EXPIRING) { | ||
253 | mutex_unlock(&sbi->wq_mutex); | ||
254 | schedule_timeout_interruptible(HZ/10); | ||
255 | if (mutex_lock_interruptible(&sbi->wq_mutex)) { | ||
256 | kfree(name); | ||
257 | return -EINTR; | ||
258 | } | ||
259 | wq = autofs4_find_wait(sbi, name, hash, len); | ||
260 | if (wq) | ||
261 | break; | ||
262 | } | ||
232 | 263 | ||
233 | if (!wq) { | 264 | /* |
234 | /* Can't wait for an expire if there's no mount */ | 265 | * Not ideal but the status has already gone. Of the two |
235 | if (notify == NFY_NONE && !d_mountpoint(dentry)) { | 266 | * cases where we wait on NFY_NONE neither depend on the |
267 | * return status of the wait. | ||
268 | */ | ||
269 | if (!wq) { | ||
236 | kfree(name); | 270 | kfree(name); |
237 | mutex_unlock(&sbi->wq_mutex); | 271 | mutex_unlock(&sbi->wq_mutex); |
238 | return -ENOENT; | 272 | return 0; |
239 | } | 273 | } |
274 | } | ||
240 | 275 | ||
276 | if (!wq) { | ||
241 | /* Create a new wait queue */ | 277 | /* Create a new wait queue */ |
242 | wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL); | 278 | wq = kmalloc(sizeof(struct autofs_wait_queue),GFP_KERNEL); |
243 | if (!wq) { | 279 | if (!wq) { |
@@ -263,20 +299,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, | |||
263 | wq->tgid = current->tgid; | 299 | wq->tgid = current->tgid; |
264 | wq->status = -EINTR; /* Status return if interrupted */ | 300 | wq->status = -EINTR; /* Status return if interrupted */ |
265 | atomic_set(&wq->wait_ctr, 2); | 301 | atomic_set(&wq->wait_ctr, 2); |
266 | atomic_set(&wq->notify, 1); | ||
267 | mutex_unlock(&sbi->wq_mutex); | ||
268 | } else { | ||
269 | atomic_inc(&wq->wait_ctr); | ||
270 | mutex_unlock(&sbi->wq_mutex); | 302 | mutex_unlock(&sbi->wq_mutex); |
271 | kfree(name); | ||
272 | DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d", | ||
273 | (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify); | ||
274 | } | ||
275 | |||
276 | if (notify != NFY_NONE && atomic_read(&wq->notify)) { | ||
277 | int type; | ||
278 | |||
279 | atomic_dec(&wq->notify); | ||
280 | 303 | ||
281 | if (sbi->version < 5) { | 304 | if (sbi->version < 5) { |
282 | if (notify == NFY_MOUNT) | 305 | if (notify == NFY_MOUNT) |
@@ -299,6 +322,12 @@ int autofs4_wait(struct autofs_sb_info *sbi, struct dentry *dentry, | |||
299 | 322 | ||
300 | /* autofs4_notify_daemon() may block */ | 323 | /* autofs4_notify_daemon() may block */ |
301 | autofs4_notify_daemon(sbi, wq, type); | 324 | autofs4_notify_daemon(sbi, wq, type); |
325 | } else { | ||
326 | atomic_inc(&wq->wait_ctr); | ||
327 | mutex_unlock(&sbi->wq_mutex); | ||
328 | kfree(name); | ||
329 | DPRINTK("existing wait id = 0x%08lx, name = %.*s, nfy=%d", | ||
330 | (unsigned long) wq->wait_queue_token, wq->len, wq->name, notify); | ||
302 | } | 331 | } |
303 | 332 | ||
304 | /* wq->name is NULL if and only if the lock is already released */ | 333 | /* wq->name is NULL if and only if the lock is already released */ |
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 69f44dcdb0b4..b1c902e319c1 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c | |||
@@ -428,7 +428,6 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
428 | loff_t fpos; | 428 | loff_t fpos; |
429 | unsigned long start_code, end_code; | 429 | unsigned long start_code, end_code; |
430 | int ret; | 430 | int ret; |
431 | int exec_fileno; | ||
432 | 431 | ||
433 | hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ | 432 | hdr = ((struct flat_hdr *) bprm->buf); /* exec-header */ |
434 | inode = bprm->file->f_dentry->d_inode; | 433 | inode = bprm->file->f_dentry->d_inode; |
@@ -502,21 +501,12 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
502 | goto err; | 501 | goto err; |
503 | } | 502 | } |
504 | 503 | ||
505 | /* check file descriptor */ | ||
506 | exec_fileno = get_unused_fd(); | ||
507 | if (exec_fileno < 0) { | ||
508 | ret = -EMFILE; | ||
509 | goto err; | ||
510 | } | ||
511 | get_file(bprm->file); | ||
512 | fd_install(exec_fileno, bprm->file); | ||
513 | |||
514 | /* Flush all traces of the currently running executable */ | 504 | /* Flush all traces of the currently running executable */ |
515 | if (id == 0) { | 505 | if (id == 0) { |
516 | result = flush_old_exec(bprm); | 506 | result = flush_old_exec(bprm); |
517 | if (result) { | 507 | if (result) { |
518 | ret = result; | 508 | ret = result; |
519 | goto err_close; | 509 | goto err; |
520 | } | 510 | } |
521 | 511 | ||
522 | /* OK, This is the point of no return */ | 512 | /* OK, This is the point of no return */ |
@@ -548,7 +538,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
548 | textpos = (unsigned long) -ENOMEM; | 538 | textpos = (unsigned long) -ENOMEM; |
549 | printk("Unable to mmap process text, errno %d\n", (int)-textpos); | 539 | printk("Unable to mmap process text, errno %d\n", (int)-textpos); |
550 | ret = textpos; | 540 | ret = textpos; |
551 | goto err_close; | 541 | goto err; |
552 | } | 542 | } |
553 | 543 | ||
554 | down_write(¤t->mm->mmap_sem); | 544 | down_write(¤t->mm->mmap_sem); |
@@ -564,7 +554,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
564 | (int)-datapos); | 554 | (int)-datapos); |
565 | do_munmap(current->mm, textpos, text_len); | 555 | do_munmap(current->mm, textpos, text_len); |
566 | ret = realdatastart; | 556 | ret = realdatastart; |
567 | goto err_close; | 557 | goto err; |
568 | } | 558 | } |
569 | datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long); | 559 | datapos = realdatastart + MAX_SHARED_LIBS * sizeof(unsigned long); |
570 | 560 | ||
@@ -587,7 +577,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
587 | do_munmap(current->mm, textpos, text_len); | 577 | do_munmap(current->mm, textpos, text_len); |
588 | do_munmap(current->mm, realdatastart, data_len + extra); | 578 | do_munmap(current->mm, realdatastart, data_len + extra); |
589 | ret = result; | 579 | ret = result; |
590 | goto err_close; | 580 | goto err; |
591 | } | 581 | } |
592 | 582 | ||
593 | reloc = (unsigned long *) (datapos+(ntohl(hdr->reloc_start)-text_len)); | 583 | reloc = (unsigned long *) (datapos+(ntohl(hdr->reloc_start)-text_len)); |
@@ -606,7 +596,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
606 | printk("Unable to allocate RAM for process text/data, errno %d\n", | 596 | printk("Unable to allocate RAM for process text/data, errno %d\n", |
607 | (int)-textpos); | 597 | (int)-textpos); |
608 | ret = textpos; | 598 | ret = textpos; |
609 | goto err_close; | 599 | goto err; |
610 | } | 600 | } |
611 | 601 | ||
612 | realdatastart = textpos + ntohl(hdr->data_start); | 602 | realdatastart = textpos + ntohl(hdr->data_start); |
@@ -652,7 +642,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
652 | do_munmap(current->mm, textpos, text_len + data_len + extra + | 642 | do_munmap(current->mm, textpos, text_len + data_len + extra + |
653 | MAX_SHARED_LIBS * sizeof(unsigned long)); | 643 | MAX_SHARED_LIBS * sizeof(unsigned long)); |
654 | ret = result; | 644 | ret = result; |
655 | goto err_close; | 645 | goto err; |
656 | } | 646 | } |
657 | } | 647 | } |
658 | 648 | ||
@@ -717,7 +707,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
717 | addr = calc_reloc(*rp, libinfo, id, 0); | 707 | addr = calc_reloc(*rp, libinfo, id, 0); |
718 | if (addr == RELOC_FAILED) { | 708 | if (addr == RELOC_FAILED) { |
719 | ret = -ENOEXEC; | 709 | ret = -ENOEXEC; |
720 | goto err_close; | 710 | goto err; |
721 | } | 711 | } |
722 | *rp = addr; | 712 | *rp = addr; |
723 | } | 713 | } |
@@ -747,7 +737,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
747 | rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); | 737 | rp = (unsigned long *) calc_reloc(addr, libinfo, id, 1); |
748 | if (rp == (unsigned long *)RELOC_FAILED) { | 738 | if (rp == (unsigned long *)RELOC_FAILED) { |
749 | ret = -ENOEXEC; | 739 | ret = -ENOEXEC; |
750 | goto err_close; | 740 | goto err; |
751 | } | 741 | } |
752 | 742 | ||
753 | /* Get the pointer's value. */ | 743 | /* Get the pointer's value. */ |
@@ -762,7 +752,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
762 | addr = calc_reloc(addr, libinfo, id, 0); | 752 | addr = calc_reloc(addr, libinfo, id, 0); |
763 | if (addr == RELOC_FAILED) { | 753 | if (addr == RELOC_FAILED) { |
764 | ret = -ENOEXEC; | 754 | ret = -ENOEXEC; |
765 | goto err_close; | 755 | goto err; |
766 | } | 756 | } |
767 | 757 | ||
768 | /* Write back the relocated pointer. */ | 758 | /* Write back the relocated pointer. */ |
@@ -783,8 +773,6 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
783 | stack_len); | 773 | stack_len); |
784 | 774 | ||
785 | return 0; | 775 | return 0; |
786 | err_close: | ||
787 | sys_close(exec_fileno); | ||
788 | err: | 776 | err: |
789 | return ret; | 777 | return ret; |
790 | } | 778 | } |
@@ -1116,6 +1116,9 @@ struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, int first_sectors) | |||
1116 | bp->bio1.bi_io_vec = &bp->bv1; | 1116 | bp->bio1.bi_io_vec = &bp->bv1; |
1117 | bp->bio2.bi_io_vec = &bp->bv2; | 1117 | bp->bio2.bi_io_vec = &bp->bv2; |
1118 | 1118 | ||
1119 | bp->bio1.bi_max_vecs = 1; | ||
1120 | bp->bio2.bi_max_vecs = 1; | ||
1121 | |||
1119 | bp->bio1.bi_end_io = bio_pair_end_1; | 1122 | bp->bio1.bi_end_io = bio_pair_end_1; |
1120 | bp->bio2.bi_end_io = bio_pair_end_2; | 1123 | bp->bio2.bi_end_io = bio_pair_end_2; |
1121 | 1124 | ||
diff --git a/fs/compat.c b/fs/compat.c index 970888aad843..b1f64786a613 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1913,7 +1913,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds, | |||
1913 | } | 1913 | } |
1914 | 1914 | ||
1915 | if (sigmask) { | 1915 | if (sigmask) { |
1916 | if (sigsetsize |= sizeof(compat_sigset_t)) | 1916 | if (sigsetsize != sizeof(compat_sigset_t)) |
1917 | return -EINVAL; | 1917 | return -EINVAL; |
1918 | if (copy_from_user(&ss32, sigmask, sizeof(ss32))) | 1918 | if (copy_from_user(&ss32, sigmask, sizeof(ss32))) |
1919 | return -EFAULT; | 1919 | return -EFAULT; |
@@ -2030,109 +2030,115 @@ union compat_nfsctl_res { | |||
2030 | struct knfsd_fh cr32_getfs; | 2030 | struct knfsd_fh cr32_getfs; |
2031 | }; | 2031 | }; |
2032 | 2032 | ||
2033 | static int compat_nfs_svc_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) | 2033 | static int compat_nfs_svc_trans(struct nfsctl_arg *karg, |
2034 | struct compat_nfsctl_arg __user *arg) | ||
2034 | { | 2035 | { |
2035 | int err; | 2036 | if (!access_ok(VERIFY_READ, &arg->ca32_svc, sizeof(arg->ca32_svc)) || |
2036 | 2037 | get_user(karg->ca_version, &arg->ca32_version) || | |
2037 | err = access_ok(VERIFY_READ, &arg->ca32_svc, sizeof(arg->ca32_svc)); | 2038 | __get_user(karg->ca_svc.svc_port, &arg->ca32_svc.svc32_port) || |
2038 | err |= get_user(karg->ca_version, &arg->ca32_version); | 2039 | __get_user(karg->ca_svc.svc_nthreads, |
2039 | err |= __get_user(karg->ca_svc.svc_port, &arg->ca32_svc.svc32_port); | 2040 | &arg->ca32_svc.svc32_nthreads)) |
2040 | err |= __get_user(karg->ca_svc.svc_nthreads, &arg->ca32_svc.svc32_nthreads); | 2041 | return -EFAULT; |
2041 | return (err) ? -EFAULT : 0; | 2042 | return 0; |
2042 | } | 2043 | } |
2043 | 2044 | ||
2044 | static int compat_nfs_clnt_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) | 2045 | static int compat_nfs_clnt_trans(struct nfsctl_arg *karg, |
2045 | { | 2046 | struct compat_nfsctl_arg __user *arg) |
2046 | int err; | 2047 | { |
2047 | 2048 | if (!access_ok(VERIFY_READ, &arg->ca32_client, | |
2048 | err = access_ok(VERIFY_READ, &arg->ca32_client, sizeof(arg->ca32_client)); | 2049 | sizeof(arg->ca32_client)) || |
2049 | err |= get_user(karg->ca_version, &arg->ca32_version); | 2050 | get_user(karg->ca_version, &arg->ca32_version) || |
2050 | err |= __copy_from_user(&karg->ca_client.cl_ident[0], | 2051 | __copy_from_user(&karg->ca_client.cl_ident[0], |
2051 | &arg->ca32_client.cl32_ident[0], | 2052 | &arg->ca32_client.cl32_ident[0], |
2052 | NFSCLNT_IDMAX); | 2053 | NFSCLNT_IDMAX) || |
2053 | err |= __get_user(karg->ca_client.cl_naddr, &arg->ca32_client.cl32_naddr); | 2054 | __get_user(karg->ca_client.cl_naddr, |
2054 | err |= __copy_from_user(&karg->ca_client.cl_addrlist[0], | 2055 | &arg->ca32_client.cl32_naddr) || |
2055 | &arg->ca32_client.cl32_addrlist[0], | 2056 | __copy_from_user(&karg->ca_client.cl_addrlist[0], |
2056 | (sizeof(struct in_addr) * NFSCLNT_ADDRMAX)); | 2057 | &arg->ca32_client.cl32_addrlist[0], |
2057 | err |= __get_user(karg->ca_client.cl_fhkeytype, | 2058 | (sizeof(struct in_addr) * NFSCLNT_ADDRMAX)) || |
2058 | &arg->ca32_client.cl32_fhkeytype); | 2059 | __get_user(karg->ca_client.cl_fhkeytype, |
2059 | err |= __get_user(karg->ca_client.cl_fhkeylen, | 2060 | &arg->ca32_client.cl32_fhkeytype) || |
2060 | &arg->ca32_client.cl32_fhkeylen); | 2061 | __get_user(karg->ca_client.cl_fhkeylen, |
2061 | err |= __copy_from_user(&karg->ca_client.cl_fhkey[0], | 2062 | &arg->ca32_client.cl32_fhkeylen) || |
2062 | &arg->ca32_client.cl32_fhkey[0], | 2063 | __copy_from_user(&karg->ca_client.cl_fhkey[0], |
2063 | NFSCLNT_KEYMAX); | 2064 | &arg->ca32_client.cl32_fhkey[0], |
2065 | NFSCLNT_KEYMAX)) | ||
2066 | return -EFAULT; | ||
2064 | 2067 | ||
2065 | return (err) ? -EFAULT : 0; | 2068 | return 0; |
2066 | } | 2069 | } |
2067 | 2070 | ||
2068 | static int compat_nfs_exp_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) | 2071 | static int compat_nfs_exp_trans(struct nfsctl_arg *karg, |
2069 | { | 2072 | struct compat_nfsctl_arg __user *arg) |
2070 | int err; | 2073 | { |
2071 | 2074 | if (!access_ok(VERIFY_READ, &arg->ca32_export, | |
2072 | err = access_ok(VERIFY_READ, &arg->ca32_export, sizeof(arg->ca32_export)); | 2075 | sizeof(arg->ca32_export)) || |
2073 | err |= get_user(karg->ca_version, &arg->ca32_version); | 2076 | get_user(karg->ca_version, &arg->ca32_version) || |
2074 | err |= __copy_from_user(&karg->ca_export.ex_client[0], | 2077 | __copy_from_user(&karg->ca_export.ex_client[0], |
2075 | &arg->ca32_export.ex32_client[0], | 2078 | &arg->ca32_export.ex32_client[0], |
2076 | NFSCLNT_IDMAX); | 2079 | NFSCLNT_IDMAX) || |
2077 | err |= __copy_from_user(&karg->ca_export.ex_path[0], | 2080 | __copy_from_user(&karg->ca_export.ex_path[0], |
2078 | &arg->ca32_export.ex32_path[0], | 2081 | &arg->ca32_export.ex32_path[0], |
2079 | NFS_MAXPATHLEN); | 2082 | NFS_MAXPATHLEN) || |
2080 | err |= __get_user(karg->ca_export.ex_dev, | 2083 | __get_user(karg->ca_export.ex_dev, |
2081 | &arg->ca32_export.ex32_dev); | 2084 | &arg->ca32_export.ex32_dev) || |
2082 | err |= __get_user(karg->ca_export.ex_ino, | 2085 | __get_user(karg->ca_export.ex_ino, |
2083 | &arg->ca32_export.ex32_ino); | 2086 | &arg->ca32_export.ex32_ino) || |
2084 | err |= __get_user(karg->ca_export.ex_flags, | 2087 | __get_user(karg->ca_export.ex_flags, |
2085 | &arg->ca32_export.ex32_flags); | 2088 | &arg->ca32_export.ex32_flags) || |
2086 | err |= __get_user(karg->ca_export.ex_anon_uid, | 2089 | __get_user(karg->ca_export.ex_anon_uid, |
2087 | &arg->ca32_export.ex32_anon_uid); | 2090 | &arg->ca32_export.ex32_anon_uid) || |
2088 | err |= __get_user(karg->ca_export.ex_anon_gid, | 2091 | __get_user(karg->ca_export.ex_anon_gid, |
2089 | &arg->ca32_export.ex32_anon_gid); | 2092 | &arg->ca32_export.ex32_anon_gid)) |
2093 | return -EFAULT; | ||
2090 | SET_UID(karg->ca_export.ex_anon_uid, karg->ca_export.ex_anon_uid); | 2094 | SET_UID(karg->ca_export.ex_anon_uid, karg->ca_export.ex_anon_uid); |
2091 | SET_GID(karg->ca_export.ex_anon_gid, karg->ca_export.ex_anon_gid); | 2095 | SET_GID(karg->ca_export.ex_anon_gid, karg->ca_export.ex_anon_gid); |
2092 | 2096 | ||
2093 | return (err) ? -EFAULT : 0; | 2097 | return 0; |
2094 | } | 2098 | } |
2095 | 2099 | ||
2096 | static int compat_nfs_getfd_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) | 2100 | static int compat_nfs_getfd_trans(struct nfsctl_arg *karg, |
2097 | { | 2101 | struct compat_nfsctl_arg __user *arg) |
2098 | int err; | 2102 | { |
2099 | 2103 | if (!access_ok(VERIFY_READ, &arg->ca32_getfd, | |
2100 | err = access_ok(VERIFY_READ, &arg->ca32_getfd, sizeof(arg->ca32_getfd)); | 2104 | sizeof(arg->ca32_getfd)) || |
2101 | err |= get_user(karg->ca_version, &arg->ca32_version); | 2105 | get_user(karg->ca_version, &arg->ca32_version) || |
2102 | err |= __copy_from_user(&karg->ca_getfd.gd_addr, | 2106 | __copy_from_user(&karg->ca_getfd.gd_addr, |
2103 | &arg->ca32_getfd.gd32_addr, | 2107 | &arg->ca32_getfd.gd32_addr, |
2104 | (sizeof(struct sockaddr))); | 2108 | (sizeof(struct sockaddr))) || |
2105 | err |= __copy_from_user(&karg->ca_getfd.gd_path, | 2109 | __copy_from_user(&karg->ca_getfd.gd_path, |
2106 | &arg->ca32_getfd.gd32_path, | 2110 | &arg->ca32_getfd.gd32_path, |
2107 | (NFS_MAXPATHLEN+1)); | 2111 | (NFS_MAXPATHLEN+1)) || |
2108 | err |= __get_user(karg->ca_getfd.gd_version, | 2112 | __get_user(karg->ca_getfd.gd_version, |
2109 | &arg->ca32_getfd.gd32_version); | 2113 | &arg->ca32_getfd.gd32_version)) |
2114 | return -EFAULT; | ||
2110 | 2115 | ||
2111 | return (err) ? -EFAULT : 0; | 2116 | return 0; |
2112 | } | 2117 | } |
2113 | 2118 | ||
2114 | static int compat_nfs_getfs_trans(struct nfsctl_arg *karg, struct compat_nfsctl_arg __user *arg) | 2119 | static int compat_nfs_getfs_trans(struct nfsctl_arg *karg, |
2120 | struct compat_nfsctl_arg __user *arg) | ||
2115 | { | 2121 | { |
2116 | int err; | 2122 | if (!access_ok(VERIFY_READ,&arg->ca32_getfs,sizeof(arg->ca32_getfs)) || |
2117 | 2123 | get_user(karg->ca_version, &arg->ca32_version) || | |
2118 | err = access_ok(VERIFY_READ, &arg->ca32_getfs, sizeof(arg->ca32_getfs)); | 2124 | __copy_from_user(&karg->ca_getfs.gd_addr, |
2119 | err |= get_user(karg->ca_version, &arg->ca32_version); | 2125 | &arg->ca32_getfs.gd32_addr, |
2120 | err |= __copy_from_user(&karg->ca_getfs.gd_addr, | 2126 | (sizeof(struct sockaddr))) || |
2121 | &arg->ca32_getfs.gd32_addr, | 2127 | __copy_from_user(&karg->ca_getfs.gd_path, |
2122 | (sizeof(struct sockaddr))); | 2128 | &arg->ca32_getfs.gd32_path, |
2123 | err |= __copy_from_user(&karg->ca_getfs.gd_path, | 2129 | (NFS_MAXPATHLEN+1)) || |
2124 | &arg->ca32_getfs.gd32_path, | 2130 | __get_user(karg->ca_getfs.gd_maxlen, |
2125 | (NFS_MAXPATHLEN+1)); | 2131 | &arg->ca32_getfs.gd32_maxlen)) |
2126 | err |= __get_user(karg->ca_getfs.gd_maxlen, | 2132 | return -EFAULT; |
2127 | &arg->ca32_getfs.gd32_maxlen); | ||
2128 | 2133 | ||
2129 | return (err) ? -EFAULT : 0; | 2134 | return 0; |
2130 | } | 2135 | } |
2131 | 2136 | ||
2132 | /* This really doesn't need translations, we are only passing | 2137 | /* This really doesn't need translations, we are only passing |
2133 | * back a union which contains opaque nfs file handle data. | 2138 | * back a union which contains opaque nfs file handle data. |
2134 | */ | 2139 | */ |
2135 | static int compat_nfs_getfh_res_trans(union nfsctl_res *kres, union compat_nfsctl_res __user *res) | 2140 | static int compat_nfs_getfh_res_trans(union nfsctl_res *kres, |
2141 | union compat_nfsctl_res __user *res) | ||
2136 | { | 2142 | { |
2137 | int err; | 2143 | int err; |
2138 | 2144 | ||
@@ -2141,8 +2147,9 @@ static int compat_nfs_getfh_res_trans(union nfsctl_res *kres, union compat_nfsct | |||
2141 | return (err) ? -EFAULT : 0; | 2147 | return (err) ? -EFAULT : 0; |
2142 | } | 2148 | } |
2143 | 2149 | ||
2144 | asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *arg, | 2150 | asmlinkage long compat_sys_nfsservctl(int cmd, |
2145 | union compat_nfsctl_res __user *res) | 2151 | struct compat_nfsctl_arg __user *arg, |
2152 | union compat_nfsctl_res __user *res) | ||
2146 | { | 2153 | { |
2147 | struct nfsctl_arg *karg; | 2154 | struct nfsctl_arg *karg; |
2148 | union nfsctl_res *kres; | 2155 | union nfsctl_res *kres; |
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 5638c8f9362f..5f952187fc53 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -505,13 +505,15 @@ static int populate_groups(struct config_group *group) | |||
505 | int i; | 505 | int i; |
506 | 506 | ||
507 | if (group->default_groups) { | 507 | if (group->default_groups) { |
508 | /* FYI, we're faking mkdir here | 508 | /* |
509 | * FYI, we're faking mkdir here | ||
509 | * I'm not sure we need this semaphore, as we're called | 510 | * I'm not sure we need this semaphore, as we're called |
510 | * from our parent's mkdir. That holds our parent's | 511 | * from our parent's mkdir. That holds our parent's |
511 | * i_mutex, so afaik lookup cannot continue through our | 512 | * i_mutex, so afaik lookup cannot continue through our |
512 | * parent to find us, let alone mess with our tree. | 513 | * parent to find us, let alone mess with our tree. |
513 | * That said, taking our i_mutex is closer to mkdir | 514 | * That said, taking our i_mutex is closer to mkdir |
514 | * emulation, and shouldn't hurt. */ | 515 | * emulation, and shouldn't hurt. |
516 | */ | ||
515 | mutex_lock(&dentry->d_inode->i_mutex); | 517 | mutex_lock(&dentry->d_inode->i_mutex); |
516 | 518 | ||
517 | for (i = 0; group->default_groups[i]; i++) { | 519 | for (i = 0; group->default_groups[i]; i++) { |
@@ -546,20 +548,34 @@ static void unlink_obj(struct config_item *item) | |||
546 | 548 | ||
547 | item->ci_group = NULL; | 549 | item->ci_group = NULL; |
548 | item->ci_parent = NULL; | 550 | item->ci_parent = NULL; |
551 | |||
552 | /* Drop the reference for ci_entry */ | ||
549 | config_item_put(item); | 553 | config_item_put(item); |
550 | 554 | ||
555 | /* Drop the reference for ci_parent */ | ||
551 | config_group_put(group); | 556 | config_group_put(group); |
552 | } | 557 | } |
553 | } | 558 | } |
554 | 559 | ||
555 | static void link_obj(struct config_item *parent_item, struct config_item *item) | 560 | static void link_obj(struct config_item *parent_item, struct config_item *item) |
556 | { | 561 | { |
557 | /* Parent seems redundant with group, but it makes certain | 562 | /* |
558 | * traversals much nicer. */ | 563 | * Parent seems redundant with group, but it makes certain |
564 | * traversals much nicer. | ||
565 | */ | ||
559 | item->ci_parent = parent_item; | 566 | item->ci_parent = parent_item; |
567 | |||
568 | /* | ||
569 | * We hold a reference on the parent for the child's ci_parent | ||
570 | * link. | ||
571 | */ | ||
560 | item->ci_group = config_group_get(to_config_group(parent_item)); | 572 | item->ci_group = config_group_get(to_config_group(parent_item)); |
561 | list_add_tail(&item->ci_entry, &item->ci_group->cg_children); | 573 | list_add_tail(&item->ci_entry, &item->ci_group->cg_children); |
562 | 574 | ||
575 | /* | ||
576 | * We hold a reference on the child for ci_entry on the parent's | ||
577 | * cg_children | ||
578 | */ | ||
563 | config_item_get(item); | 579 | config_item_get(item); |
564 | } | 580 | } |
565 | 581 | ||
@@ -684,6 +700,10 @@ static void client_drop_item(struct config_item *parent_item, | |||
684 | type = parent_item->ci_type; | 700 | type = parent_item->ci_type; |
685 | BUG_ON(!type); | 701 | BUG_ON(!type); |
686 | 702 | ||
703 | /* | ||
704 | * If ->drop_item() exists, it is responsible for the | ||
705 | * config_item_put(). | ||
706 | */ | ||
687 | if (type->ct_group_ops && type->ct_group_ops->drop_item) | 707 | if (type->ct_group_ops && type->ct_group_ops->drop_item) |
688 | type->ct_group_ops->drop_item(to_config_group(parent_item), | 708 | type->ct_group_ops->drop_item(to_config_group(parent_item), |
689 | item); | 709 | item); |
@@ -694,23 +714,28 @@ static void client_drop_item(struct config_item *parent_item, | |||
694 | 714 | ||
695 | static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | 715 | static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) |
696 | { | 716 | { |
697 | int ret; | 717 | int ret, module_got = 0; |
698 | struct config_group *group; | 718 | struct config_group *group; |
699 | struct config_item *item; | 719 | struct config_item *item; |
700 | struct config_item *parent_item; | 720 | struct config_item *parent_item; |
701 | struct configfs_subsystem *subsys; | 721 | struct configfs_subsystem *subsys; |
702 | struct configfs_dirent *sd; | 722 | struct configfs_dirent *sd; |
703 | struct config_item_type *type; | 723 | struct config_item_type *type; |
704 | struct module *owner; | 724 | struct module *owner = NULL; |
705 | char *name; | 725 | char *name; |
706 | 726 | ||
707 | if (dentry->d_parent == configfs_sb->s_root) | 727 | if (dentry->d_parent == configfs_sb->s_root) { |
708 | return -EPERM; | 728 | ret = -EPERM; |
729 | goto out; | ||
730 | } | ||
709 | 731 | ||
710 | sd = dentry->d_parent->d_fsdata; | 732 | sd = dentry->d_parent->d_fsdata; |
711 | if (!(sd->s_type & CONFIGFS_USET_DIR)) | 733 | if (!(sd->s_type & CONFIGFS_USET_DIR)) { |
712 | return -EPERM; | 734 | ret = -EPERM; |
735 | goto out; | ||
736 | } | ||
713 | 737 | ||
738 | /* Get a working ref for the duration of this function */ | ||
714 | parent_item = configfs_get_config_item(dentry->d_parent); | 739 | parent_item = configfs_get_config_item(dentry->d_parent); |
715 | type = parent_item->ci_type; | 740 | type = parent_item->ci_type; |
716 | subsys = to_config_group(parent_item)->cg_subsys; | 741 | subsys = to_config_group(parent_item)->cg_subsys; |
@@ -719,15 +744,16 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
719 | if (!type || !type->ct_group_ops || | 744 | if (!type || !type->ct_group_ops || |
720 | (!type->ct_group_ops->make_group && | 745 | (!type->ct_group_ops->make_group && |
721 | !type->ct_group_ops->make_item)) { | 746 | !type->ct_group_ops->make_item)) { |
722 | config_item_put(parent_item); | 747 | ret = -EPERM; /* Lack-of-mkdir returns -EPERM */ |
723 | return -EPERM; /* What lack-of-mkdir returns */ | 748 | goto out_put; |
724 | } | 749 | } |
725 | 750 | ||
726 | name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL); | 751 | name = kmalloc(dentry->d_name.len + 1, GFP_KERNEL); |
727 | if (!name) { | 752 | if (!name) { |
728 | config_item_put(parent_item); | 753 | ret = -ENOMEM; |
729 | return -ENOMEM; | 754 | goto out_put; |
730 | } | 755 | } |
756 | |||
731 | snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name); | 757 | snprintf(name, dentry->d_name.len + 1, "%s", dentry->d_name.name); |
732 | 758 | ||
733 | down(&subsys->su_sem); | 759 | down(&subsys->su_sem); |
@@ -748,40 +774,67 @@ static int configfs_mkdir(struct inode *dir, struct dentry *dentry, int mode) | |||
748 | 774 | ||
749 | kfree(name); | 775 | kfree(name); |
750 | if (!item) { | 776 | if (!item) { |
751 | config_item_put(parent_item); | 777 | /* |
752 | return -ENOMEM; | 778 | * If item == NULL, then link_obj() was never called. |
779 | * There are no extra references to clean up. | ||
780 | */ | ||
781 | ret = -ENOMEM; | ||
782 | goto out_put; | ||
753 | } | 783 | } |
754 | 784 | ||
755 | ret = -EINVAL; | 785 | /* |
786 | * link_obj() has been called (via link_group() for groups). | ||
787 | * From here on out, errors must clean that up. | ||
788 | */ | ||
789 | |||
756 | type = item->ci_type; | 790 | type = item->ci_type; |
757 | if (type) { | 791 | if (!type) { |
758 | owner = type->ct_owner; | 792 | ret = -EINVAL; |
759 | if (try_module_get(owner)) { | 793 | goto out_unlink; |
760 | if (group) { | 794 | } |
761 | ret = configfs_attach_group(parent_item, | ||
762 | item, | ||
763 | dentry); | ||
764 | } else { | ||
765 | ret = configfs_attach_item(parent_item, | ||
766 | item, | ||
767 | dentry); | ||
768 | } | ||
769 | 795 | ||
770 | if (ret) { | 796 | owner = type->ct_owner; |
771 | down(&subsys->su_sem); | 797 | if (!try_module_get(owner)) { |
772 | if (group) | 798 | ret = -EINVAL; |
773 | unlink_group(group); | 799 | goto out_unlink; |
774 | else | 800 | } |
775 | unlink_obj(item); | ||
776 | client_drop_item(parent_item, item); | ||
777 | up(&subsys->su_sem); | ||
778 | 801 | ||
779 | config_item_put(parent_item); | 802 | /* |
780 | module_put(owner); | 803 | * I hate doing it this way, but if there is |
781 | } | 804 | * an error, module_put() probably should |
782 | } | 805 | * happen after any cleanup. |
806 | */ | ||
807 | module_got = 1; | ||
808 | |||
809 | if (group) | ||
810 | ret = configfs_attach_group(parent_item, item, dentry); | ||
811 | else | ||
812 | ret = configfs_attach_item(parent_item, item, dentry); | ||
813 | |||
814 | out_unlink: | ||
815 | if (ret) { | ||
816 | /* Tear down everything we built up */ | ||
817 | down(&subsys->su_sem); | ||
818 | if (group) | ||
819 | unlink_group(group); | ||
820 | else | ||
821 | unlink_obj(item); | ||
822 | client_drop_item(parent_item, item); | ||
823 | up(&subsys->su_sem); | ||
824 | |||
825 | if (module_got) | ||
826 | module_put(owner); | ||
783 | } | 827 | } |
784 | 828 | ||
829 | out_put: | ||
830 | /* | ||
831 | * link_obj()/link_group() took a reference from child->parent, | ||
832 | * so the parent is safely pinned. We can drop our working | ||
833 | * reference. | ||
834 | */ | ||
835 | config_item_put(parent_item); | ||
836 | |||
837 | out: | ||
785 | return ret; | 838 | return ret; |
786 | } | 839 | } |
787 | 840 | ||
@@ -801,6 +854,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
801 | if (sd->s_type & CONFIGFS_USET_DEFAULT) | 854 | if (sd->s_type & CONFIGFS_USET_DEFAULT) |
802 | return -EPERM; | 855 | return -EPERM; |
803 | 856 | ||
857 | /* Get a working ref until we have the child */ | ||
804 | parent_item = configfs_get_config_item(dentry->d_parent); | 858 | parent_item = configfs_get_config_item(dentry->d_parent); |
805 | subsys = to_config_group(parent_item)->cg_subsys; | 859 | subsys = to_config_group(parent_item)->cg_subsys; |
806 | BUG_ON(!subsys); | 860 | BUG_ON(!subsys); |
@@ -817,6 +871,7 @@ static int configfs_rmdir(struct inode *dir, struct dentry *dentry) | |||
817 | return ret; | 871 | return ret; |
818 | } | 872 | } |
819 | 873 | ||
874 | /* Get a working ref for the duration of this function */ | ||
820 | item = configfs_get_config_item(dentry); | 875 | item = configfs_get_config_item(dentry); |
821 | 876 | ||
822 | /* Drop reference from above, item already holds one. */ | 877 | /* Drop reference from above, item already holds one. */ |
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index b06b54f1bbbb..4c39009350f3 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
@@ -102,7 +102,7 @@ find_exported_dentry(struct super_block *sb, void *obj, void *parent, | |||
102 | if (acceptable(context, result)) | 102 | if (acceptable(context, result)) |
103 | return result; | 103 | return result; |
104 | if (S_ISDIR(result->d_inode->i_mode)) { | 104 | if (S_ISDIR(result->d_inode->i_mode)) { |
105 | /* there is no other dentry, so fail */ | 105 | err = -EACCES; |
106 | goto err_result; | 106 | goto err_result; |
107 | } | 107 | } |
108 | 108 | ||
diff --git a/fs/inotify.c b/fs/inotify.c index 1f50302849c5..732ec4bd5774 100644 --- a/fs/inotify.c +++ b/fs/inotify.c | |||
@@ -848,7 +848,11 @@ static int inotify_release(struct inode *ignored, struct file *file) | |||
848 | inode = watch->inode; | 848 | inode = watch->inode; |
849 | mutex_lock(&inode->inotify_mutex); | 849 | mutex_lock(&inode->inotify_mutex); |
850 | mutex_lock(&dev->mutex); | 850 | mutex_lock(&dev->mutex); |
851 | remove_watch_no_event(watch, dev); | 851 | |
852 | /* make sure we didn't race with another list removal */ | ||
853 | if (likely(idr_find(&dev->idr, watch->wd))) | ||
854 | remove_watch_no_event(watch, dev); | ||
855 | |||
852 | mutex_unlock(&dev->mutex); | 856 | mutex_unlock(&dev->mutex); |
853 | mutex_unlock(&inode->inotify_mutex); | 857 | mutex_unlock(&inode->inotify_mutex); |
854 | put_inotify_watch(watch); | 858 | put_inotify_watch(watch); |
@@ -890,8 +894,7 @@ static int inotify_ignore(struct inotify_device *dev, s32 wd) | |||
890 | mutex_lock(&dev->mutex); | 894 | mutex_lock(&dev->mutex); |
891 | 895 | ||
892 | /* make sure that we did not race */ | 896 | /* make sure that we did not race */ |
893 | watch = idr_find(&dev->idr, wd); | 897 | if (likely(idr_find(&dev->idr, wd) == watch)) |
894 | if (likely(watch)) | ||
895 | remove_watch(watch, dev); | 898 | remove_watch(watch, dev); |
896 | 899 | ||
897 | mutex_unlock(&dev->mutex); | 900 | mutex_unlock(&dev->mutex); |
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index d4d0c41490cd..1d46677afd17 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c | |||
@@ -438,7 +438,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info | |||
438 | if (c->mtd->point) { | 438 | if (c->mtd->point) { |
439 | err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer); | 439 | err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer); |
440 | if (!err && retlen < tn->csize) { | 440 | if (!err && retlen < tn->csize) { |
441 | JFFS2_WARNING("MTD point returned len too short: %u instead of %u.\n", retlen, tn->csize); | 441 | JFFS2_WARNING("MTD point returned len too short: %zu " |
442 | "instead of %u.\n", retlen, tn->csize); | ||
442 | c->mtd->unpoint(c->mtd, buffer, ofs, len); | 443 | c->mtd->unpoint(c->mtd, buffer, ofs, len); |
443 | } else if (err) | 444 | } else if (err) |
444 | JFFS2_WARNING("MTD point failed: error code %d.\n", err); | 445 | JFFS2_WARNING("MTD point failed: error code %d.\n", err); |
@@ -461,7 +462,8 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info | |||
461 | } | 462 | } |
462 | 463 | ||
463 | if (retlen != len) { | 464 | if (retlen != len) { |
464 | JFFS2_ERROR("short read at %#08x: %d instead of %d.\n", ofs, retlen, len); | 465 | JFFS2_ERROR("short read at %#08x: %zd instead of %d.\n", |
466 | ofs, retlen, len); | ||
465 | err = -EIO; | 467 | err = -EIO; |
466 | goto free_out; | 468 | goto free_out; |
467 | } | 469 | } |
diff --git a/fs/locks.c b/fs/locks.c index efad798824dc..6f99c0a6f836 100644 --- a/fs/locks.c +++ b/fs/locks.c | |||
@@ -446,15 +446,14 @@ static struct lock_manager_operations lease_manager_ops = { | |||
446 | */ | 446 | */ |
447 | static int lease_init(struct file *filp, int type, struct file_lock *fl) | 447 | static int lease_init(struct file *filp, int type, struct file_lock *fl) |
448 | { | 448 | { |
449 | if (assign_type(fl, type) != 0) | ||
450 | return -EINVAL; | ||
451 | |||
449 | fl->fl_owner = current->files; | 452 | fl->fl_owner = current->files; |
450 | fl->fl_pid = current->tgid; | 453 | fl->fl_pid = current->tgid; |
451 | 454 | ||
452 | fl->fl_file = filp; | 455 | fl->fl_file = filp; |
453 | fl->fl_flags = FL_LEASE; | 456 | fl->fl_flags = FL_LEASE; |
454 | if (assign_type(fl, type) != 0) { | ||
455 | locks_free_lock(fl); | ||
456 | return -EINVAL; | ||
457 | } | ||
458 | fl->fl_start = 0; | 457 | fl->fl_start = 0; |
459 | fl->fl_end = OFFSET_MAX; | 458 | fl->fl_end = OFFSET_MAX; |
460 | fl->fl_ops = NULL; | 459 | fl->fl_ops = NULL; |
@@ -466,16 +465,19 @@ static int lease_init(struct file *filp, int type, struct file_lock *fl) | |||
466 | static int lease_alloc(struct file *filp, int type, struct file_lock **flp) | 465 | static int lease_alloc(struct file *filp, int type, struct file_lock **flp) |
467 | { | 466 | { |
468 | struct file_lock *fl = locks_alloc_lock(); | 467 | struct file_lock *fl = locks_alloc_lock(); |
469 | int error; | 468 | int error = -ENOMEM; |
470 | 469 | ||
471 | if (fl == NULL) | 470 | if (fl == NULL) |
472 | return -ENOMEM; | 471 | goto out; |
473 | 472 | ||
474 | error = lease_init(filp, type, fl); | 473 | error = lease_init(filp, type, fl); |
475 | if (error) | 474 | if (error) { |
476 | return error; | 475 | locks_free_lock(fl); |
476 | fl = NULL; | ||
477 | } | ||
478 | out: | ||
477 | *flp = fl; | 479 | *flp = fl; |
478 | return 0; | 480 | return error; |
479 | } | 481 | } |
480 | 482 | ||
481 | /* Check if two locks overlap each other. | 483 | /* Check if two locks overlap each other. |
@@ -1372,6 +1374,7 @@ static int __setlease(struct file *filp, long arg, struct file_lock **flp) | |||
1372 | goto out; | 1374 | goto out; |
1373 | 1375 | ||
1374 | if (my_before != NULL) { | 1376 | if (my_before != NULL) { |
1377 | *flp = *my_before; | ||
1375 | error = lease->fl_lmops->fl_change(my_before, arg); | 1378 | error = lease->fl_lmops->fl_change(my_before, arg); |
1376 | goto out; | 1379 | goto out; |
1377 | } | 1380 | } |
diff --git a/fs/namespace.c b/fs/namespace.c index 2c5f1f80bdc2..bf478addb852 100644 --- a/fs/namespace.c +++ b/fs/namespace.c | |||
@@ -899,13 +899,11 @@ static int do_change_type(struct nameidata *nd, int flag) | |||
899 | /* | 899 | /* |
900 | * do loopback mount. | 900 | * do loopback mount. |
901 | */ | 901 | */ |
902 | static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags, int mnt_flags) | 902 | static int do_loopback(struct nameidata *nd, char *old_name, int recurse) |
903 | { | 903 | { |
904 | struct nameidata old_nd; | 904 | struct nameidata old_nd; |
905 | struct vfsmount *mnt = NULL; | 905 | struct vfsmount *mnt = NULL; |
906 | int recurse = flags & MS_REC; | ||
907 | int err = mount_is_safe(nd); | 906 | int err = mount_is_safe(nd); |
908 | |||
909 | if (err) | 907 | if (err) |
910 | return err; | 908 | return err; |
911 | if (!old_name || !*old_name) | 909 | if (!old_name || !*old_name) |
@@ -939,7 +937,6 @@ static int do_loopback(struct nameidata *nd, char *old_name, unsigned long flags | |||
939 | spin_unlock(&vfsmount_lock); | 937 | spin_unlock(&vfsmount_lock); |
940 | release_mounts(&umount_list); | 938 | release_mounts(&umount_list); |
941 | } | 939 | } |
942 | mnt->mnt_flags = mnt_flags; | ||
943 | 940 | ||
944 | out: | 941 | out: |
945 | up_write(&namespace_sem); | 942 | up_write(&namespace_sem); |
@@ -1353,7 +1350,7 @@ long do_mount(char *dev_name, char *dir_name, char *type_page, | |||
1353 | retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, | 1350 | retval = do_remount(&nd, flags & ~MS_REMOUNT, mnt_flags, |
1354 | data_page); | 1351 | data_page); |
1355 | else if (flags & MS_BIND) | 1352 | else if (flags & MS_BIND) |
1356 | retval = do_loopback(&nd, dev_name, flags, mnt_flags); | 1353 | retval = do_loopback(&nd, dev_name, flags & MS_REC); |
1357 | else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) | 1354 | else if (flags & (MS_SHARED | MS_PRIVATE | MS_SLAVE | MS_UNBINDABLE)) |
1358 | retval = do_change_type(&nd, flags); | 1355 | retval = do_change_type(&nd, flags); |
1359 | else if (flags & MS_MOVE) | 1356 | else if (flags & MS_MOVE) |
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 4e0578121d9a..3eec30000f3f 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -1066,9 +1066,11 @@ exp_pseudoroot(struct auth_domain *clp, struct svc_fh *fhp, | |||
1066 | rv = nfserr_perm; | 1066 | rv = nfserr_perm; |
1067 | else if (IS_ERR(exp)) | 1067 | else if (IS_ERR(exp)) |
1068 | rv = nfserrno(PTR_ERR(exp)); | 1068 | rv = nfserrno(PTR_ERR(exp)); |
1069 | else | 1069 | else { |
1070 | rv = fh_compose(fhp, exp, | 1070 | rv = fh_compose(fhp, exp, |
1071 | fsid_key->ek_dentry, NULL); | 1071 | fsid_key->ek_dentry, NULL); |
1072 | exp_put(exp); | ||
1073 | } | ||
1072 | cache_put(&fsid_key->h, &svc_expkey_cache); | 1074 | cache_put(&fsid_key->h, &svc_expkey_cache); |
1073 | return rv; | 1075 | return rv; |
1074 | } | 1076 | } |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index 6aa92d0e6876..1d65f13f458c 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1922,11 +1922,10 @@ nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl) | |||
1922 | value = kmalloc(size, GFP_KERNEL); | 1922 | value = kmalloc(size, GFP_KERNEL); |
1923 | if (!value) | 1923 | if (!value) |
1924 | return -ENOMEM; | 1924 | return -ENOMEM; |
1925 | size = posix_acl_to_xattr(acl, value, size); | 1925 | error = posix_acl_to_xattr(acl, value, size); |
1926 | if (size < 0) { | 1926 | if (error < 0) |
1927 | error = size; | ||
1928 | goto getout; | 1927 | goto getout; |
1929 | } | 1928 | size = error; |
1930 | } else | 1929 | } else |
1931 | size = 0; | 1930 | size = 0; |
1932 | 1931 | ||
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 0d858d0b25be..47152bf9a7f2 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -276,13 +276,29 @@ static int ocfs2_writepage(struct page *page, struct writeback_control *wbc) | |||
276 | return ret; | 276 | return ret; |
277 | } | 277 | } |
278 | 278 | ||
279 | /* This can also be called from ocfs2_write_zero_page() which has done | ||
280 | * it's own cluster locking. */ | ||
281 | int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page, | ||
282 | unsigned from, unsigned to) | ||
283 | { | ||
284 | int ret; | ||
285 | |||
286 | down_read(&OCFS2_I(inode)->ip_alloc_sem); | ||
287 | |||
288 | ret = block_prepare_write(page, from, to, ocfs2_get_block); | ||
289 | |||
290 | up_read(&OCFS2_I(inode)->ip_alloc_sem); | ||
291 | |||
292 | return ret; | ||
293 | } | ||
294 | |||
279 | /* | 295 | /* |
280 | * ocfs2_prepare_write() can be an outer-most ocfs2 call when it is called | 296 | * ocfs2_prepare_write() can be an outer-most ocfs2 call when it is called |
281 | * from loopback. It must be able to perform its own locking around | 297 | * from loopback. It must be able to perform its own locking around |
282 | * ocfs2_get_block(). | 298 | * ocfs2_get_block(). |
283 | */ | 299 | */ |
284 | int ocfs2_prepare_write(struct file *file, struct page *page, | 300 | static int ocfs2_prepare_write(struct file *file, struct page *page, |
285 | unsigned from, unsigned to) | 301 | unsigned from, unsigned to) |
286 | { | 302 | { |
287 | struct inode *inode = page->mapping->host; | 303 | struct inode *inode = page->mapping->host; |
288 | int ret; | 304 | int ret; |
@@ -295,11 +311,7 @@ int ocfs2_prepare_write(struct file *file, struct page *page, | |||
295 | goto out; | 311 | goto out; |
296 | } | 312 | } |
297 | 313 | ||
298 | down_read(&OCFS2_I(inode)->ip_alloc_sem); | 314 | ret = ocfs2_prepare_write_nolock(inode, page, from, to); |
299 | |||
300 | ret = block_prepare_write(page, from, to, ocfs2_get_block); | ||
301 | |||
302 | up_read(&OCFS2_I(inode)->ip_alloc_sem); | ||
303 | 315 | ||
304 | ocfs2_meta_unlock(inode, 0); | 316 | ocfs2_meta_unlock(inode, 0); |
305 | out: | 317 | out: |
@@ -625,11 +637,31 @@ static ssize_t ocfs2_direct_IO(int rw, | |||
625 | int ret; | 637 | int ret; |
626 | 638 | ||
627 | mlog_entry_void(); | 639 | mlog_entry_void(); |
640 | |||
641 | /* | ||
642 | * We get PR data locks even for O_DIRECT. This allows | ||
643 | * concurrent O_DIRECT I/O but doesn't let O_DIRECT with | ||
644 | * extending and buffered zeroing writes race. If they did | ||
645 | * race then the buffered zeroing could be written back after | ||
646 | * the O_DIRECT I/O. It's one thing to tell people not to mix | ||
647 | * buffered and O_DIRECT writes, but expecting them to | ||
648 | * understand that file extension is also an implicit buffered | ||
649 | * write is too much. By getting the PR we force writeback of | ||
650 | * the buffered zeroing before proceeding. | ||
651 | */ | ||
652 | ret = ocfs2_data_lock(inode, 0); | ||
653 | if (ret < 0) { | ||
654 | mlog_errno(ret); | ||
655 | goto out; | ||
656 | } | ||
657 | ocfs2_data_unlock(inode, 0); | ||
658 | |||
628 | ret = blockdev_direct_IO_no_locking(rw, iocb, inode, | 659 | ret = blockdev_direct_IO_no_locking(rw, iocb, inode, |
629 | inode->i_sb->s_bdev, iov, offset, | 660 | inode->i_sb->s_bdev, iov, offset, |
630 | nr_segs, | 661 | nr_segs, |
631 | ocfs2_direct_IO_get_blocks, | 662 | ocfs2_direct_IO_get_blocks, |
632 | ocfs2_dio_end_io); | 663 | ocfs2_dio_end_io); |
664 | out: | ||
633 | mlog_exit(ret); | 665 | mlog_exit(ret); |
634 | return ret; | 666 | return ret; |
635 | } | 667 | } |
diff --git a/fs/ocfs2/aops.h b/fs/ocfs2/aops.h index d40456d509a0..e88c3f0b8fa9 100644 --- a/fs/ocfs2/aops.h +++ b/fs/ocfs2/aops.h | |||
@@ -22,8 +22,8 @@ | |||
22 | #ifndef OCFS2_AOPS_H | 22 | #ifndef OCFS2_AOPS_H |
23 | #define OCFS2_AOPS_H | 23 | #define OCFS2_AOPS_H |
24 | 24 | ||
25 | int ocfs2_prepare_write(struct file *file, struct page *page, | 25 | int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page, |
26 | unsigned from, unsigned to); | 26 | unsigned from, unsigned to); |
27 | 27 | ||
28 | struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode, | 28 | struct ocfs2_journal_handle *ocfs2_start_walk_page_trans(struct inode *inode, |
29 | struct page *page, | 29 | struct page *page, |
diff --git a/fs/ocfs2/extent_map.c b/fs/ocfs2/extent_map.c index 4601fc256f11..1a5c69071df6 100644 --- a/fs/ocfs2/extent_map.c +++ b/fs/ocfs2/extent_map.c | |||
@@ -569,7 +569,7 @@ static int ocfs2_extent_map_insert(struct inode *inode, | |||
569 | 569 | ||
570 | ret = -ENOMEM; | 570 | ret = -ENOMEM; |
571 | ctxt.new_ent = kmem_cache_alloc(ocfs2_em_ent_cachep, | 571 | ctxt.new_ent = kmem_cache_alloc(ocfs2_em_ent_cachep, |
572 | GFP_KERNEL); | 572 | GFP_NOFS); |
573 | if (!ctxt.new_ent) { | 573 | if (!ctxt.new_ent) { |
574 | mlog_errno(ret); | 574 | mlog_errno(ret); |
575 | return ret; | 575 | return ret; |
@@ -583,14 +583,14 @@ static int ocfs2_extent_map_insert(struct inode *inode, | |||
583 | if (ctxt.need_left && !ctxt.left_ent) { | 583 | if (ctxt.need_left && !ctxt.left_ent) { |
584 | ctxt.left_ent = | 584 | ctxt.left_ent = |
585 | kmem_cache_alloc(ocfs2_em_ent_cachep, | 585 | kmem_cache_alloc(ocfs2_em_ent_cachep, |
586 | GFP_KERNEL); | 586 | GFP_NOFS); |
587 | if (!ctxt.left_ent) | 587 | if (!ctxt.left_ent) |
588 | break; | 588 | break; |
589 | } | 589 | } |
590 | if (ctxt.need_right && !ctxt.right_ent) { | 590 | if (ctxt.need_right && !ctxt.right_ent) { |
591 | ctxt.right_ent = | 591 | ctxt.right_ent = |
592 | kmem_cache_alloc(ocfs2_em_ent_cachep, | 592 | kmem_cache_alloc(ocfs2_em_ent_cachep, |
593 | GFP_KERNEL); | 593 | GFP_NOFS); |
594 | if (!ctxt.right_ent) | 594 | if (!ctxt.right_ent) |
595 | break; | 595 | break; |
596 | } | 596 | } |
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 581eb451a41a..a9559c874530 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -613,7 +613,8 @@ leave: | |||
613 | 613 | ||
614 | /* Some parts of this taken from generic_cont_expand, which turned out | 614 | /* Some parts of this taken from generic_cont_expand, which turned out |
615 | * to be too fragile to do exactly what we need without us having to | 615 | * to be too fragile to do exactly what we need without us having to |
616 | * worry about recursive locking in ->commit_write(). */ | 616 | * worry about recursive locking in ->prepare_write() and |
617 | * ->commit_write(). */ | ||
617 | static int ocfs2_write_zero_page(struct inode *inode, | 618 | static int ocfs2_write_zero_page(struct inode *inode, |
618 | u64 size) | 619 | u64 size) |
619 | { | 620 | { |
@@ -641,7 +642,7 @@ static int ocfs2_write_zero_page(struct inode *inode, | |||
641 | goto out; | 642 | goto out; |
642 | } | 643 | } |
643 | 644 | ||
644 | ret = ocfs2_prepare_write(NULL, page, offset, offset); | 645 | ret = ocfs2_prepare_write_nolock(inode, page, offset, offset); |
645 | if (ret < 0) { | 646 | if (ret < 0) { |
646 | mlog_errno(ret); | 647 | mlog_errno(ret); |
647 | goto out_unlock; | 648 | goto out_unlock; |
@@ -695,13 +696,26 @@ out: | |||
695 | return ret; | 696 | return ret; |
696 | } | 697 | } |
697 | 698 | ||
699 | /* | ||
700 | * A tail_to_skip value > 0 indicates that we're being called from | ||
701 | * ocfs2_file_aio_write(). This has the following implications: | ||
702 | * | ||
703 | * - we don't want to update i_size | ||
704 | * - di_bh will be NULL, which is fine because it's only used in the | ||
705 | * case where we want to update i_size. | ||
706 | * - ocfs2_zero_extend() will then only be filling the hole created | ||
707 | * between i_size and the start of the write. | ||
708 | */ | ||
698 | static int ocfs2_extend_file(struct inode *inode, | 709 | static int ocfs2_extend_file(struct inode *inode, |
699 | struct buffer_head *di_bh, | 710 | struct buffer_head *di_bh, |
700 | u64 new_i_size) | 711 | u64 new_i_size, |
712 | size_t tail_to_skip) | ||
701 | { | 713 | { |
702 | int ret = 0; | 714 | int ret = 0; |
703 | u32 clusters_to_add; | 715 | u32 clusters_to_add; |
704 | 716 | ||
717 | BUG_ON(!tail_to_skip && !di_bh); | ||
718 | |||
705 | /* setattr sometimes calls us like this. */ | 719 | /* setattr sometimes calls us like this. */ |
706 | if (new_i_size == 0) | 720 | if (new_i_size == 0) |
707 | goto out; | 721 | goto out; |
@@ -714,27 +728,44 @@ static int ocfs2_extend_file(struct inode *inode, | |||
714 | OCFS2_I(inode)->ip_clusters; | 728 | OCFS2_I(inode)->ip_clusters; |
715 | 729 | ||
716 | if (clusters_to_add) { | 730 | if (clusters_to_add) { |
717 | ret = ocfs2_extend_allocation(inode, clusters_to_add); | 731 | /* |
732 | * protect the pages that ocfs2_zero_extend is going to | ||
733 | * be pulling into the page cache.. we do this before the | ||
734 | * metadata extend so that we don't get into the situation | ||
735 | * where we've extended the metadata but can't get the data | ||
736 | * lock to zero. | ||
737 | */ | ||
738 | ret = ocfs2_data_lock(inode, 1); | ||
718 | if (ret < 0) { | 739 | if (ret < 0) { |
719 | mlog_errno(ret); | 740 | mlog_errno(ret); |
720 | goto out; | 741 | goto out; |
721 | } | 742 | } |
722 | 743 | ||
723 | ret = ocfs2_zero_extend(inode, new_i_size); | 744 | ret = ocfs2_extend_allocation(inode, clusters_to_add); |
724 | if (ret < 0) { | 745 | if (ret < 0) { |
725 | mlog_errno(ret); | 746 | mlog_errno(ret); |
726 | goto out; | 747 | goto out_unlock; |
727 | } | 748 | } |
728 | } | ||
729 | 749 | ||
730 | /* No allocation required, we just use this helper to | 750 | ret = ocfs2_zero_extend(inode, (u64)new_i_size - tail_to_skip); |
731 | * do a trivial update of i_size. */ | 751 | if (ret < 0) { |
732 | ret = ocfs2_simple_size_update(inode, di_bh, new_i_size); | 752 | mlog_errno(ret); |
733 | if (ret < 0) { | 753 | goto out_unlock; |
734 | mlog_errno(ret); | 754 | } |
735 | goto out; | 755 | } |
756 | |||
757 | if (!tail_to_skip) { | ||
758 | /* We're being called from ocfs2_setattr() which wants | ||
759 | * us to update i_size */ | ||
760 | ret = ocfs2_simple_size_update(inode, di_bh, new_i_size); | ||
761 | if (ret < 0) | ||
762 | mlog_errno(ret); | ||
736 | } | 763 | } |
737 | 764 | ||
765 | out_unlock: | ||
766 | if (clusters_to_add) /* this is the only case in which we lock */ | ||
767 | ocfs2_data_unlock(inode, 1); | ||
768 | |||
738 | out: | 769 | out: |
739 | return ret; | 770 | return ret; |
740 | } | 771 | } |
@@ -793,7 +824,7 @@ int ocfs2_setattr(struct dentry *dentry, struct iattr *attr) | |||
793 | if (i_size_read(inode) > attr->ia_size) | 824 | if (i_size_read(inode) > attr->ia_size) |
794 | status = ocfs2_truncate_file(inode, bh, attr->ia_size); | 825 | status = ocfs2_truncate_file(inode, bh, attr->ia_size); |
795 | else | 826 | else |
796 | status = ocfs2_extend_file(inode, bh, attr->ia_size); | 827 | status = ocfs2_extend_file(inode, bh, attr->ia_size, 0); |
797 | if (status < 0) { | 828 | if (status < 0) { |
798 | if (status != -ENOSPC) | 829 | if (status != -ENOSPC) |
799 | mlog_errno(status); | 830 | mlog_errno(status); |
@@ -1049,21 +1080,12 @@ static ssize_t ocfs2_file_aio_write(struct kiocb *iocb, | |||
1049 | if (!clusters) | 1080 | if (!clusters) |
1050 | break; | 1081 | break; |
1051 | 1082 | ||
1052 | ret = ocfs2_extend_allocation(inode, clusters); | 1083 | ret = ocfs2_extend_file(inode, NULL, newsize, count); |
1053 | if (ret < 0) { | 1084 | if (ret < 0) { |
1054 | if (ret != -ENOSPC) | 1085 | if (ret != -ENOSPC) |
1055 | mlog_errno(ret); | 1086 | mlog_errno(ret); |
1056 | goto out; | 1087 | goto out; |
1057 | } | 1088 | } |
1058 | |||
1059 | /* Fill any holes which would've been created by this | ||
1060 | * write. If we're O_APPEND, this will wind up | ||
1061 | * (correctly) being a noop. */ | ||
1062 | ret = ocfs2_zero_extend(inode, (u64) newsize - count); | ||
1063 | if (ret < 0) { | ||
1064 | mlog_errno(ret); | ||
1065 | goto out; | ||
1066 | } | ||
1067 | break; | 1089 | break; |
1068 | } | 1090 | } |
1069 | 1091 | ||
@@ -1146,6 +1168,22 @@ static ssize_t ocfs2_file_aio_read(struct kiocb *iocb, | |||
1146 | ocfs2_iocb_set_rw_locked(iocb); | 1168 | ocfs2_iocb_set_rw_locked(iocb); |
1147 | } | 1169 | } |
1148 | 1170 | ||
1171 | /* | ||
1172 | * We're fine letting folks race truncates and extending | ||
1173 | * writes with read across the cluster, just like they can | ||
1174 | * locally. Hence no rw_lock during read. | ||
1175 | * | ||
1176 | * Take and drop the meta data lock to update inode fields | ||
1177 | * like i_size. This allows the checks down below | ||
1178 | * generic_file_aio_read() a chance of actually working. | ||
1179 | */ | ||
1180 | ret = ocfs2_meta_lock(inode, NULL, NULL, 0); | ||
1181 | if (ret < 0) { | ||
1182 | mlog_errno(ret); | ||
1183 | goto bail; | ||
1184 | } | ||
1185 | ocfs2_meta_unlock(inode, 0); | ||
1186 | |||
1149 | ret = generic_file_aio_read(iocb, buf, count, iocb->ki_pos); | 1187 | ret = generic_file_aio_read(iocb, buf, count, iocb->ki_pos); |
1150 | if (ret == -EINVAL) | 1188 | if (ret == -EINVAL) |
1151 | mlog(ML_ERROR, "generic_file_aio_read returned -EINVAL\n"); | 1189 | mlog(ML_ERROR, "generic_file_aio_read returned -EINVAL\n"); |
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 6a610ae53583..eebc3cfa6be8 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c | |||
@@ -117,7 +117,7 @@ struct ocfs2_journal_handle *ocfs2_alloc_handle(struct ocfs2_super *osb) | |||
117 | { | 117 | { |
118 | struct ocfs2_journal_handle *retval = NULL; | 118 | struct ocfs2_journal_handle *retval = NULL; |
119 | 119 | ||
120 | retval = kcalloc(1, sizeof(*retval), GFP_KERNEL); | 120 | retval = kcalloc(1, sizeof(*retval), GFP_NOFS); |
121 | if (!retval) { | 121 | if (!retval) { |
122 | mlog(ML_ERROR, "Failed to allocate memory for journal " | 122 | mlog(ML_ERROR, "Failed to allocate memory for journal " |
123 | "handle!\n"); | 123 | "handle!\n"); |
@@ -870,9 +870,11 @@ static int ocfs2_force_read_journal(struct inode *inode) | |||
870 | if (p_blocks > CONCURRENT_JOURNAL_FILL) | 870 | if (p_blocks > CONCURRENT_JOURNAL_FILL) |
871 | p_blocks = CONCURRENT_JOURNAL_FILL; | 871 | p_blocks = CONCURRENT_JOURNAL_FILL; |
872 | 872 | ||
873 | /* We are reading journal data which should not | ||
874 | * be put in the uptodate cache */ | ||
873 | status = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), | 875 | status = ocfs2_read_blocks(OCFS2_SB(inode->i_sb), |
874 | p_blkno, p_blocks, bhs, 0, | 876 | p_blkno, p_blocks, bhs, 0, |
875 | inode); | 877 | NULL); |
876 | if (status < 0) { | 878 | if (status < 0) { |
877 | mlog_errno(status); | 879 | mlog_errno(status); |
878 | goto bail; | 880 | goto bail; |
@@ -982,7 +984,7 @@ static void ocfs2_queue_recovery_completion(struct ocfs2_journal *journal, | |||
982 | { | 984 | { |
983 | struct ocfs2_la_recovery_item *item; | 985 | struct ocfs2_la_recovery_item *item; |
984 | 986 | ||
985 | item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_KERNEL); | 987 | item = kmalloc(sizeof(struct ocfs2_la_recovery_item), GFP_NOFS); |
986 | if (!item) { | 988 | if (!item) { |
987 | /* Though we wish to avoid it, we are in fact safe in | 989 | /* Though we wish to avoid it, we are in fact safe in |
988 | * skipping local alloc cleanup as fsck.ocfs2 is more | 990 | * skipping local alloc cleanup as fsck.ocfs2 is more |
diff --git a/fs/ocfs2/uptodate.c b/fs/ocfs2/uptodate.c index 04a684dfdd96..b8a00a793326 100644 --- a/fs/ocfs2/uptodate.c +++ b/fs/ocfs2/uptodate.c | |||
@@ -337,7 +337,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi, | |||
337 | (unsigned long long)oi->ip_blkno, | 337 | (unsigned long long)oi->ip_blkno, |
338 | (unsigned long long)block, expand_tree); | 338 | (unsigned long long)block, expand_tree); |
339 | 339 | ||
340 | new = kmem_cache_alloc(ocfs2_uptodate_cachep, GFP_KERNEL); | 340 | new = kmem_cache_alloc(ocfs2_uptodate_cachep, GFP_NOFS); |
341 | if (!new) { | 341 | if (!new) { |
342 | mlog_errno(-ENOMEM); | 342 | mlog_errno(-ENOMEM); |
343 | return; | 343 | return; |
@@ -349,7 +349,7 @@ static void __ocfs2_set_buffer_uptodate(struct ocfs2_inode_info *oi, | |||
349 | * has no way of tracking that. */ | 349 | * has no way of tracking that. */ |
350 | for(i = 0; i < OCFS2_INODE_MAX_CACHE_ARRAY; i++) { | 350 | for(i = 0; i < OCFS2_INODE_MAX_CACHE_ARRAY; i++) { |
351 | tree[i] = kmem_cache_alloc(ocfs2_uptodate_cachep, | 351 | tree[i] = kmem_cache_alloc(ocfs2_uptodate_cachep, |
352 | GFP_KERNEL); | 352 | GFP_NOFS); |
353 | if (!tree[i]) { | 353 | if (!tree[i]) { |
354 | mlog_errno(-ENOMEM); | 354 | mlog_errno(-ENOMEM); |
355 | goto out_free; | 355 | goto out_free; |
diff --git a/fs/ocfs2/vote.c b/fs/ocfs2/vote.c index 53049a204197..ee42765a8553 100644 --- a/fs/ocfs2/vote.c +++ b/fs/ocfs2/vote.c | |||
@@ -586,7 +586,7 @@ static struct ocfs2_net_wait_ctxt *ocfs2_new_net_wait_ctxt(unsigned int response | |||
586 | { | 586 | { |
587 | struct ocfs2_net_wait_ctxt *w; | 587 | struct ocfs2_net_wait_ctxt *w; |
588 | 588 | ||
589 | w = kcalloc(1, sizeof(*w), GFP_KERNEL); | 589 | w = kcalloc(1, sizeof(*w), GFP_NOFS); |
590 | if (!w) { | 590 | if (!w) { |
591 | mlog_errno(-ENOMEM); | 591 | mlog_errno(-ENOMEM); |
592 | goto bail; | 592 | goto bail; |
@@ -749,7 +749,7 @@ static struct ocfs2_vote_msg * ocfs2_new_vote_request(struct ocfs2_super *osb, | |||
749 | 749 | ||
750 | BUG_ON(!ocfs2_is_valid_vote_request(type)); | 750 | BUG_ON(!ocfs2_is_valid_vote_request(type)); |
751 | 751 | ||
752 | request = kcalloc(1, sizeof(*request), GFP_KERNEL); | 752 | request = kcalloc(1, sizeof(*request), GFP_NOFS); |
753 | if (!request) { | 753 | if (!request) { |
754 | mlog_errno(-ENOMEM); | 754 | mlog_errno(-ENOMEM); |
755 | } else { | 755 | } else { |
@@ -1129,7 +1129,7 @@ static int ocfs2_handle_vote_message(struct o2net_msg *msg, | |||
1129 | struct ocfs2_super *osb = data; | 1129 | struct ocfs2_super *osb = data; |
1130 | struct ocfs2_vote_work *work; | 1130 | struct ocfs2_vote_work *work; |
1131 | 1131 | ||
1132 | work = kmalloc(sizeof(struct ocfs2_vote_work), GFP_KERNEL); | 1132 | work = kmalloc(sizeof(struct ocfs2_vote_work), GFP_NOFS); |
1133 | if (!work) { | 1133 | if (!work) { |
1134 | status = -ENOMEM; | 1134 | status = -ENOMEM; |
1135 | mlog_errno(status); | 1135 | mlog_errno(status); |
@@ -1124,7 +1124,6 @@ asmlinkage long sys_openat(int dfd, const char __user *filename, int flags, | |||
1124 | prevent_tail_call(ret); | 1124 | prevent_tail_call(ret); |
1125 | return ret; | 1125 | return ret; |
1126 | } | 1126 | } |
1127 | EXPORT_SYMBOL_GPL(sys_openat); | ||
1128 | 1127 | ||
1129 | #ifndef __alpha__ | 1128 | #ifndef __alpha__ |
1130 | 1129 | ||
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index 45ae7dd3c650..7ef1f094de91 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -533,6 +533,7 @@ void del_gendisk(struct gendisk *disk) | |||
533 | 533 | ||
534 | devfs_remove_disk(disk); | 534 | devfs_remove_disk(disk); |
535 | 535 | ||
536 | kobject_uevent(&disk->kobj, KOBJ_REMOVE); | ||
536 | if (disk->holder_dir) | 537 | if (disk->holder_dir) |
537 | kobject_unregister(disk->holder_dir); | 538 | kobject_unregister(disk->holder_dir); |
538 | if (disk->slave_dir) | 539 | if (disk->slave_dir) |
@@ -545,7 +546,7 @@ void del_gendisk(struct gendisk *disk) | |||
545 | kfree(disk_name); | 546 | kfree(disk_name); |
546 | } | 547 | } |
547 | put_device(disk->driverfs_dev); | 548 | put_device(disk->driverfs_dev); |
549 | disk->driverfs_dev = NULL; | ||
548 | } | 550 | } |
549 | kobject_uevent(&disk->kobj, KOBJ_REMOVE); | ||
550 | kobject_del(&disk->kobj); | 551 | kobject_del(&disk->kobj); |
551 | } | 552 | } |
diff --git a/fs/smbfs/dir.c b/fs/smbfs/dir.c index 34c7a11d91f0..70d9c5a37f5a 100644 --- a/fs/smbfs/dir.c +++ b/fs/smbfs/dir.c | |||
@@ -434,6 +434,11 @@ smb_lookup(struct inode *dir, struct dentry *dentry, struct nameidata *nd) | |||
434 | if (dentry->d_name.len > SMB_MAXNAMELEN) | 434 | if (dentry->d_name.len > SMB_MAXNAMELEN) |
435 | goto out; | 435 | goto out; |
436 | 436 | ||
437 | /* Do not allow lookup of names with backslashes in */ | ||
438 | error = -EINVAL; | ||
439 | if (memchr(dentry->d_name.name, '\\', dentry->d_name.len)) | ||
440 | goto out; | ||
441 | |||
437 | lock_kernel(); | 442 | lock_kernel(); |
438 | error = smb_proc_getattr(dentry, &finfo); | 443 | error = smb_proc_getattr(dentry, &finfo); |
439 | #ifdef SMBFS_PARANOIA | 444 | #ifdef SMBFS_PARANOIA |
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c index c71c375863cc..c71dd2760d32 100644 --- a/fs/smbfs/request.c +++ b/fs/smbfs/request.c | |||
@@ -339,9 +339,11 @@ int smb_add_request(struct smb_request *req) | |||
339 | /* | 339 | /* |
340 | * On timeout or on interrupt we want to try and remove the | 340 | * On timeout or on interrupt we want to try and remove the |
341 | * request from the recvq/xmitq. | 341 | * request from the recvq/xmitq. |
342 | * First check if the request is still part of a queue. (May | ||
343 | * have been removed by some error condition) | ||
342 | */ | 344 | */ |
343 | smb_lock_server(server); | 345 | smb_lock_server(server); |
344 | if (!(req->rq_flags & SMB_REQ_RECEIVED)) { | 346 | if (!list_empty(&req->rq_queue)) { |
345 | list_del_init(&req->rq_queue); | 347 | list_del_init(&req->rq_queue); |
346 | smb_rput(req); | 348 | smb_rput(req); |
347 | } | 349 | } |
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 64ee07db0d5e..8558226281c4 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
@@ -1942,8 +1942,10 @@ xfs_alloc_fix_freelist( | |||
1942 | /* | 1942 | /* |
1943 | * Allocate as many blocks as possible at once. | 1943 | * Allocate as many blocks as possible at once. |
1944 | */ | 1944 | */ |
1945 | if ((error = xfs_alloc_ag_vextent(&targs))) | 1945 | if ((error = xfs_alloc_ag_vextent(&targs))) { |
1946 | xfs_trans_brelse(tp, agflbp); | ||
1946 | return error; | 1947 | return error; |
1948 | } | ||
1947 | /* | 1949 | /* |
1948 | * Stop if we run out. Won't happen if callers are obeying | 1950 | * Stop if we run out. Won't happen if callers are obeying |
1949 | * the restrictions correctly. Can happen for free calls | 1951 | * the restrictions correctly. Can happen for free calls |
@@ -1960,6 +1962,7 @@ xfs_alloc_fix_freelist( | |||
1960 | return error; | 1962 | return error; |
1961 | } | 1963 | } |
1962 | } | 1964 | } |
1965 | xfs_trans_brelse(tp, agflbp); | ||
1963 | args->agbp = agbp; | 1966 | args->agbp = agbp; |
1964 | return 0; | 1967 | return 0; |
1965 | } | 1968 | } |
diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index 81a05cfd77d2..1f148762eb28 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c | |||
@@ -316,6 +316,18 @@ xfs_rename( | |||
316 | } | 316 | } |
317 | } | 317 | } |
318 | 318 | ||
319 | /* | ||
320 | * If we are using project inheritance, we only allow renames | ||
321 | * into our tree when the project IDs are the same; else the | ||
322 | * tree quota mechanism would be circumvented. | ||
323 | */ | ||
324 | if (unlikely((target_dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && | ||
325 | (target_dp->i_d.di_projid != src_ip->i_d.di_projid))) { | ||
326 | error = XFS_ERROR(EXDEV); | ||
327 | xfs_rename_unlock4(inodes, XFS_ILOCK_SHARED); | ||
328 | goto rele_return; | ||
329 | } | ||
330 | |||
319 | new_parent = (src_dp != target_dp); | 331 | new_parent = (src_dp != target_dp); |
320 | src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR); | 332 | src_is_directory = ((src_ip->i_d.di_mode & S_IFMT) == S_IFDIR); |
321 | 333 | ||
diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index f0e09ca14139..36ea1b2094f2 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c | |||
@@ -669,31 +669,22 @@ xfs_mntupdate( | |||
669 | xfs_mount_t *mp = XFS_BHVTOM(bdp); | 669 | xfs_mount_t *mp = XFS_BHVTOM(bdp); |
670 | int error; | 670 | int error; |
671 | 671 | ||
672 | if (args->flags & XFSMNT_BARRIER) | 672 | if (!(*flags & MS_RDONLY)) { /* rw/ro -> rw */ |
673 | mp->m_flags |= XFS_MOUNT_BARRIER; | 673 | if (vfsp->vfs_flag & VFS_RDONLY) |
674 | else | 674 | vfsp->vfs_flag &= ~VFS_RDONLY; |
675 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | 675 | if (args->flags & XFSMNT_BARRIER) { |
676 | 676 | mp->m_flags |= XFS_MOUNT_BARRIER; | |
677 | if ((vfsp->vfs_flag & VFS_RDONLY) && | ||
678 | !(*flags & MS_RDONLY)) { | ||
679 | vfsp->vfs_flag &= ~VFS_RDONLY; | ||
680 | |||
681 | if (args->flags & XFSMNT_BARRIER) | ||
682 | xfs_mountfs_check_barriers(mp); | 677 | xfs_mountfs_check_barriers(mp); |
683 | } | 678 | } else { |
684 | 679 | mp->m_flags &= ~XFS_MOUNT_BARRIER; | |
685 | if (!(vfsp->vfs_flag & VFS_RDONLY) && | 680 | } |
686 | (*flags & MS_RDONLY)) { | 681 | } else if (!(vfsp->vfs_flag & VFS_RDONLY)) { /* rw -> ro */ |
687 | VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); | 682 | VFS_SYNC(vfsp, SYNC_FSDATA|SYNC_BDFLUSH|SYNC_ATTR, NULL, error); |
688 | |||
689 | xfs_quiesce_fs(mp); | 683 | xfs_quiesce_fs(mp); |
690 | |||
691 | /* Ok now write out an unmount record */ | ||
692 | xfs_log_unmount_write(mp); | 684 | xfs_log_unmount_write(mp); |
693 | xfs_unmountfs_writesb(mp); | 685 | xfs_unmountfs_writesb(mp); |
694 | vfsp->vfs_flag |= VFS_RDONLY; | 686 | vfsp->vfs_flag |= VFS_RDONLY; |
695 | } | 687 | } |
696 | |||
697 | return 0; | 688 | return 0; |
698 | } | 689 | } |
699 | 690 | ||
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index fa71b305ba5c..7027ae68ee38 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -2663,7 +2663,7 @@ xfs_link( | |||
2663 | */ | 2663 | */ |
2664 | if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && | 2664 | if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && |
2665 | (tdp->i_d.di_projid != sip->i_d.di_projid))) { | 2665 | (tdp->i_d.di_projid != sip->i_d.di_projid))) { |
2666 | error = XFS_ERROR(EPERM); | 2666 | error = XFS_ERROR(EXDEV); |
2667 | goto error_return; | 2667 | goto error_return; |
2668 | } | 2668 | } |
2669 | 2669 | ||
diff --git a/include/asm-arm/arch-aaec2000/debug-macro.S b/include/asm-arm/arch-aaec2000/debug-macro.S index e4f1fa539a74..7b1fce021d8a 100644 --- a/include/asm-arm/arch-aaec2000/debug-macro.S +++ b/include/asm-arm/arch-aaec2000/debug-macro.S | |||
@@ -9,6 +9,7 @@ | |||
9 | * published by the Free Software Foundation. | 9 | * published by the Free Software Foundation. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include "hardware.h" | ||
12 | .macro addruart,rx | 13 | .macro addruart,rx |
13 | mrc p15, 0, \rx, c1, c0 | 14 | mrc p15, 0, \rx, c1, c0 |
14 | tst \rx, #1 @ MMU enabled? | 15 | tst \rx, #1 @ MMU enabled? |
diff --git a/include/asm-arm/arch-aaec2000/entry-macro.S b/include/asm-arm/arch-aaec2000/entry-macro.S index df31313ab07e..1eb3503bd16e 100644 --- a/include/asm-arm/arch-aaec2000/entry-macro.S +++ b/include/asm-arm/arch-aaec2000/entry-macro.S | |||
@@ -10,6 +10,7 @@ | |||
10 | * published by the Free Software Foundation. | 10 | * published by the Free Software Foundation. |
11 | * | 11 | * |
12 | */ | 12 | */ |
13 | #include <asm/arch/irqs.h> | ||
13 | 14 | ||
14 | .macro disable_fiq | 15 | .macro disable_fiq |
15 | .endm | 16 | .endm |
diff --git a/include/asm-arm/arch-imx/debug-macro.S b/include/asm-arm/arch-imx/debug-macro.S index 83f552f7bcc1..c611871643a2 100644 --- a/include/asm-arm/arch-imx/debug-macro.S +++ b/include/asm-arm/arch-imx/debug-macro.S | |||
@@ -16,7 +16,7 @@ | |||
16 | tst \rx, #1 @ MMU enabled? | 16 | tst \rx, #1 @ MMU enabled? |
17 | moveq \rx, #0x00000000 @ physical | 17 | moveq \rx, #0x00000000 @ physical |
18 | movne \rx, #0xe0000000 @ virtual | 18 | movne \rx, #0xe0000000 @ virtual |
19 | orr \rx, \rx, #0x00200000 | 19 | orreq \rx, \rx, #0x00200000 @ physical |
20 | orr \rx, \rx, #0x00006000 @ UART1 offset | 20 | orr \rx, \rx, #0x00006000 @ UART1 offset |
21 | .endm | 21 | .endm |
22 | 22 | ||
diff --git a/include/asm-arm/arch-pxa/pxa2xx_spi.h b/include/asm-arm/arch-pxa/pxa2xx_spi.h new file mode 100644 index 000000000000..915590c391c8 --- /dev/null +++ b/include/asm-arm/arch-pxa/pxa2xx_spi.h | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs | ||
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 as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef PXA2XX_SPI_H_ | ||
20 | #define PXA2XX_SPI_H_ | ||
21 | |||
22 | #define PXA2XX_CS_ASSERT (0x01) | ||
23 | #define PXA2XX_CS_DEASSERT (0x02) | ||
24 | |||
25 | #if defined(CONFIG_PXA25x) | ||
26 | #define CLOCK_SPEED_HZ 3686400 | ||
27 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/2/(x+1))<<8)&0x0000ff00) | ||
28 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
29 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
30 | #define SSP_TIMEOUT_SCALE (2712) | ||
31 | #elif defined(CONFIG_PXA27x) | ||
32 | #define CLOCK_SPEED_HZ 13000000 | ||
33 | #define SSP1_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
34 | #define SSP2_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
35 | #define SSP3_SerClkDiv(x) (((CLOCK_SPEED_HZ/(x+1))<<8)&0x000fff00) | ||
36 | #define SSP_TIMEOUT_SCALE (769) | ||
37 | #endif | ||
38 | |||
39 | #define SSP_TIMEOUT(x) ((x*10000)/SSP_TIMEOUT_SCALE) | ||
40 | #define SSP1_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(1))))) | ||
41 | #define SSP2_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(2))))) | ||
42 | #define SSP3_VIRT ((void *)(io_p2v(__PREG(SSCR0_P(3))))) | ||
43 | |||
44 | enum pxa_ssp_type { | ||
45 | SSP_UNDEFINED = 0, | ||
46 | PXA25x_SSP, /* pxa 210, 250, 255, 26x */ | ||
47 | PXA25x_NSSP, /* pxa 255, 26x (including ASSP) */ | ||
48 | PXA27x_SSP, | ||
49 | }; | ||
50 | |||
51 | /* device.platform_data for SSP controller devices */ | ||
52 | struct pxa2xx_spi_master { | ||
53 | enum pxa_ssp_type ssp_type; | ||
54 | u32 clock_enable; | ||
55 | u16 num_chipselect; | ||
56 | u8 enable_dma; | ||
57 | }; | ||
58 | |||
59 | /* spi_board_info.controller_data for SPI slave devices, | ||
60 | * copied to spi_device.platform_data ... mostly for dma tuning | ||
61 | */ | ||
62 | struct pxa2xx_spi_chip { | ||
63 | u8 tx_threshold; | ||
64 | u8 rx_threshold; | ||
65 | u8 dma_burst_size; | ||
66 | u32 timeout_microsecs; | ||
67 | u8 enable_loopback; | ||
68 | void (*cs_control)(u32 command); | ||
69 | }; | ||
70 | |||
71 | #endif /*PXA2XX_SPI_H_*/ | ||
diff --git a/include/asm-arm/arch-s3c2410/spi-gpio.h b/include/asm-arm/arch-s3c2410/spi-gpio.h new file mode 100644 index 000000000000..258c00bca270 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/spi-gpio.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/spi.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - SPI Controller platfrom_device info | ||
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 | #ifndef __ASM_ARCH_SPIGPIO_H | ||
14 | #define __ASM_ARCH_SPIGPIO_H __FILE__ | ||
15 | |||
16 | struct s3c2410_spigpio_info; | ||
17 | struct spi_board_info; | ||
18 | |||
19 | struct s3c2410_spigpio_info { | ||
20 | unsigned long pin_clk; | ||
21 | unsigned long pin_mosi; | ||
22 | unsigned long pin_miso; | ||
23 | |||
24 | unsigned long board_size; | ||
25 | struct spi_board_info *board_info; | ||
26 | |||
27 | void (*chip_select)(struct s3c2410_spigpio_info *spi, int cs); | ||
28 | }; | ||
29 | |||
30 | |||
31 | #endif /* __ASM_ARCH_SPIGPIO_H */ | ||
diff --git a/include/asm-arm/arch-s3c2410/spi.h b/include/asm-arm/arch-s3c2410/spi.h new file mode 100644 index 000000000000..4029a1a1ab40 --- /dev/null +++ b/include/asm-arm/arch-s3c2410/spi.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /* linux/include/asm-arm/arch-s3c2410/spi.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * | ||
6 | * S3C2410 - SPI Controller platform_device info | ||
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 | #ifndef __ASM_ARCH_SPI_H | ||
14 | #define __ASM_ARCH_SPI_H __FILE__ | ||
15 | |||
16 | struct s3c2410_spi_info; | ||
17 | struct spi_board_info; | ||
18 | |||
19 | struct s3c2410_spi_info { | ||
20 | unsigned long pin_cs; /* simple gpio cs */ | ||
21 | |||
22 | unsigned long board_size; | ||
23 | struct spi_board_info *board_info; | ||
24 | |||
25 | void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol); | ||
26 | }; | ||
27 | |||
28 | |||
29 | #endif /* __ASM_ARCH_SPI_H */ | ||
diff --git a/include/asm-arm/procinfo.h b/include/asm-arm/procinfo.h index a9c75b2c314f..842526055225 100644 --- a/include/asm-arm/procinfo.h +++ b/include/asm-arm/procinfo.h | |||
@@ -45,8 +45,6 @@ extern unsigned int elf_hwcap; | |||
45 | 45 | ||
46 | #endif /* __ASSEMBLY__ */ | 46 | #endif /* __ASSEMBLY__ */ |
47 | 47 | ||
48 | #define PROC_INFO_SZ 48 | ||
49 | |||
50 | #define HWCAP_SWP 1 | 48 | #define HWCAP_SWP 1 |
51 | #define HWCAP_HALF 2 | 49 | #define HWCAP_HALF 2 |
52 | #define HWCAP_THUMB 4 | 50 | #define HWCAP_THUMB 4 |
diff --git a/include/asm-arm/spinlock.h b/include/asm-arm/spinlock.h index 43ad4e55878c..406ca97a8ab2 100644 --- a/include/asm-arm/spinlock.h +++ b/include/asm-arm/spinlock.h | |||
@@ -142,6 +142,9 @@ static inline void __raw_write_unlock(raw_rwlock_t *rw) | |||
142 | : "cc"); | 142 | : "cc"); |
143 | } | 143 | } |
144 | 144 | ||
145 | /* write_can_lock - would write_trylock() succeed? */ | ||
146 | #define __raw_write_can_lock(x) ((x)->lock == 0x80000000) | ||
147 | |||
145 | /* | 148 | /* |
146 | * Read locks are a bit more hairy: | 149 | * Read locks are a bit more hairy: |
147 | * - Exclusively load the lock value. | 150 | * - Exclusively load the lock value. |
@@ -198,4 +201,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw) | |||
198 | 201 | ||
199 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) | 202 | #define __raw_read_trylock(lock) generic__raw_read_trylock(lock) |
200 | 203 | ||
204 | /* read_can_lock - would read_trylock() succeed? */ | ||
205 | #define __raw_read_can_lock(x) ((x)->lock < 0x80000000) | ||
206 | |||
201 | #endif /* __ASM_SPINLOCK_H */ | 207 | #endif /* __ASM_SPINLOCK_H */ |
diff --git a/include/asm-i386/io_apic.h b/include/asm-i386/io_apic.h index 7d3e82d4b69d..5092e819b8a2 100644 --- a/include/asm-i386/io_apic.h +++ b/include/asm-i386/io_apic.h | |||
@@ -199,6 +199,7 @@ extern int io_apic_get_unique_id (int ioapic, int apic_id); | |||
199 | extern int io_apic_get_version (int ioapic); | 199 | extern int io_apic_get_version (int ioapic); |
200 | extern int io_apic_get_redir_entries (int ioapic); | 200 | extern int io_apic_get_redir_entries (int ioapic); |
201 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); | 201 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level, int active_high_low); |
202 | extern int timer_uses_ioapic_pin_0; | ||
202 | #endif /* CONFIG_ACPI */ | 203 | #endif /* CONFIG_ACPI */ |
203 | 204 | ||
204 | extern int (*ioapic_renumber_irq)(int ioapic, int irq); | 205 | extern int (*ioapic_renumber_irq)(int ioapic, int irq); |
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h index 90921e162793..6cc517e212a9 100644 --- a/include/asm-ia64/bitops.h +++ b/include/asm-ia64/bitops.h | |||
@@ -11,7 +11,6 @@ | |||
11 | 11 | ||
12 | #include <linux/compiler.h> | 12 | #include <linux/compiler.h> |
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <asm/bitops.h> | ||
15 | #include <asm/intrinsics.h> | 14 | #include <asm/intrinsics.h> |
16 | 15 | ||
17 | /** | 16 | /** |
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 9e2c9e1c1239..eb66eae6616f 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -321,10 +321,12 @@ | |||
321 | #define __NR_readlinkat 296 | 321 | #define __NR_readlinkat 296 |
322 | #define __NR_fchmodat 297 | 322 | #define __NR_fchmodat 297 |
323 | #define __NR_faccessat 298 | 323 | #define __NR_faccessat 298 |
324 | #define __NR_get_robust_list 299 | ||
325 | #define __NR_set_robust_list 300 | ||
324 | 326 | ||
325 | #ifdef __KERNEL__ | 327 | #ifdef __KERNEL__ |
326 | 328 | ||
327 | #define __NR_syscalls 299 | 329 | #define __NR_syscalls 301 |
328 | 330 | ||
329 | #define __NR__exit __NR_exit | 331 | #define __NR__exit __NR_exit |
330 | #define NR_syscalls __NR_syscalls | 332 | #define NR_syscalls __NR_syscalls |
diff --git a/include/asm-ppc/page.h b/include/asm-ppc/page.h index 352faa4b0d4b..0b19af82507f 100644 --- a/include/asm-ppc/page.h +++ b/include/asm-ppc/page.h | |||
@@ -18,6 +18,7 @@ | |||
18 | /* This must match what is in arch/ppc/Makefile */ | 18 | /* This must match what is in arch/ppc/Makefile */ |
19 | #define PAGE_OFFSET CONFIG_KERNEL_START | 19 | #define PAGE_OFFSET CONFIG_KERNEL_START |
20 | #define KERNELBASE PAGE_OFFSET | 20 | #define KERNELBASE PAGE_OFFSET |
21 | #define is_kernel_addr(x) ((x) >= PAGE_OFFSET) | ||
21 | 22 | ||
22 | #ifndef __ASSEMBLY__ | 23 | #ifndef __ASSEMBLY__ |
23 | 24 | ||
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index 40efbe84221d..e21443d3ea1d 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -296,8 +296,14 @@ | |||
296 | #define __NR_pselect6 301 | 296 | #define __NR_pselect6 301 |
297 | #define __NR_ppoll 302 | 297 | #define __NR_ppoll 302 |
298 | #define __NR_unshare 303 | 298 | #define __NR_unshare 303 |
299 | #define __NR_set_robust_list 304 | ||
300 | #define __NR_get_robust_list 305 | ||
301 | #define __NR_splice 306 | ||
302 | #define __NR_sync_file_range 307 | ||
303 | #define __NR_tee 308 | ||
304 | #define __NR_vmsplice 309 | ||
299 | 305 | ||
300 | #define NR_syscalls 304 | 306 | #define NR_syscalls 310 |
301 | 307 | ||
302 | /* | 308 | /* |
303 | * There are some system calls that are not present on 64 bit, some | 309 | * There are some system calls that are not present on 64 bit, some |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index 5489c5a3c777..2553762465ca 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -316,12 +316,14 @@ | |||
316 | #define __NR_pselect6 297 | 316 | #define __NR_pselect6 297 |
317 | #define __NR_ppoll 298 | 317 | #define __NR_ppoll 298 |
318 | #define __NR_unshare 299 | 318 | #define __NR_unshare 299 |
319 | #define __NR_set_robust_list 300 | ||
320 | #define __NR_get_robust_list 301 | ||
319 | 321 | ||
320 | #ifdef __KERNEL__ | 322 | #ifdef __KERNEL__ |
321 | /* WARNING: You MAY NOT add syscall numbers larger than 299, since | 323 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since |
322 | * all of the syscall tables in the Sparc kernel are | 324 | * all of the syscall tables in the Sparc kernel are |
323 | * sized to have 299 entries (starting at zero). Therefore | 325 | * sized to have 301 entries (starting at zero). Therefore |
324 | * find a free slot in the 0-299 range. | 326 | * find a free slot in the 0-301 range. |
325 | */ | 327 | */ |
326 | 328 | ||
327 | #define _syscall0(type,name) \ | 329 | #define _syscall0(type,name) \ |
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index c902a96d1d48..3c2b5bc8650b 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -3,7 +3,146 @@ | |||
3 | 3 | ||
4 | 4 | ||
5 | #ifdef CONFIG_PCI | 5 | #ifdef CONFIG_PCI |
6 | #include <asm-generic/dma-mapping.h> | 6 | |
7 | /* we implement the API below in terms of the existing PCI one, | ||
8 | * so include it */ | ||
9 | #include <linux/pci.h> | ||
10 | /* need struct page definitions */ | ||
11 | #include <linux/mm.h> | ||
12 | |||
13 | static inline int | ||
14 | dma_supported(struct device *dev, u64 mask) | ||
15 | { | ||
16 | BUG_ON(dev->bus != &pci_bus_type); | ||
17 | |||
18 | return pci_dma_supported(to_pci_dev(dev), mask); | ||
19 | } | ||
20 | |||
21 | static inline int | ||
22 | dma_set_mask(struct device *dev, u64 dma_mask) | ||
23 | { | ||
24 | BUG_ON(dev->bus != &pci_bus_type); | ||
25 | |||
26 | return pci_set_dma_mask(to_pci_dev(dev), dma_mask); | ||
27 | } | ||
28 | |||
29 | static inline void * | ||
30 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | ||
31 | gfp_t flag) | ||
32 | { | ||
33 | BUG_ON(dev->bus != &pci_bus_type); | ||
34 | |||
35 | return pci_iommu_ops->alloc_consistent(to_pci_dev(dev), size, dma_handle, flag); | ||
36 | } | ||
37 | |||
38 | static inline void | ||
39 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | ||
40 | dma_addr_t dma_handle) | ||
41 | { | ||
42 | BUG_ON(dev->bus != &pci_bus_type); | ||
43 | |||
44 | pci_free_consistent(to_pci_dev(dev), size, cpu_addr, dma_handle); | ||
45 | } | ||
46 | |||
47 | static inline dma_addr_t | ||
48 | dma_map_single(struct device *dev, void *cpu_addr, size_t size, | ||
49 | enum dma_data_direction direction) | ||
50 | { | ||
51 | BUG_ON(dev->bus != &pci_bus_type); | ||
52 | |||
53 | return pci_map_single(to_pci_dev(dev), cpu_addr, size, (int)direction); | ||
54 | } | ||
55 | |||
56 | static inline void | ||
57 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
58 | enum dma_data_direction direction) | ||
59 | { | ||
60 | BUG_ON(dev->bus != &pci_bus_type); | ||
61 | |||
62 | pci_unmap_single(to_pci_dev(dev), dma_addr, size, (int)direction); | ||
63 | } | ||
64 | |||
65 | static inline dma_addr_t | ||
66 | dma_map_page(struct device *dev, struct page *page, | ||
67 | unsigned long offset, size_t size, | ||
68 | enum dma_data_direction direction) | ||
69 | { | ||
70 | BUG_ON(dev->bus != &pci_bus_type); | ||
71 | |||
72 | return pci_map_page(to_pci_dev(dev), page, offset, size, (int)direction); | ||
73 | } | ||
74 | |||
75 | static inline void | ||
76 | dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size, | ||
77 | enum dma_data_direction direction) | ||
78 | { | ||
79 | BUG_ON(dev->bus != &pci_bus_type); | ||
80 | |||
81 | pci_unmap_page(to_pci_dev(dev), dma_address, size, (int)direction); | ||
82 | } | ||
83 | |||
84 | static inline int | ||
85 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
86 | enum dma_data_direction direction) | ||
87 | { | ||
88 | BUG_ON(dev->bus != &pci_bus_type); | ||
89 | |||
90 | return pci_map_sg(to_pci_dev(dev), sg, nents, (int)direction); | ||
91 | } | ||
92 | |||
93 | static inline void | ||
94 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nhwentries, | ||
95 | enum dma_data_direction direction) | ||
96 | { | ||
97 | BUG_ON(dev->bus != &pci_bus_type); | ||
98 | |||
99 | pci_unmap_sg(to_pci_dev(dev), sg, nhwentries, (int)direction); | ||
100 | } | ||
101 | |||
102 | static inline void | ||
103 | dma_sync_single_for_cpu(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
104 | enum dma_data_direction direction) | ||
105 | { | ||
106 | BUG_ON(dev->bus != &pci_bus_type); | ||
107 | |||
108 | pci_dma_sync_single_for_cpu(to_pci_dev(dev), dma_handle, | ||
109 | size, (int)direction); | ||
110 | } | ||
111 | |||
112 | static inline void | ||
113 | dma_sync_single_for_device(struct device *dev, dma_addr_t dma_handle, size_t size, | ||
114 | enum dma_data_direction direction) | ||
115 | { | ||
116 | BUG_ON(dev->bus != &pci_bus_type); | ||
117 | |||
118 | pci_dma_sync_single_for_device(to_pci_dev(dev), dma_handle, | ||
119 | size, (int)direction); | ||
120 | } | ||
121 | |||
122 | static inline void | ||
123 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, | ||
124 | enum dma_data_direction direction) | ||
125 | { | ||
126 | BUG_ON(dev->bus != &pci_bus_type); | ||
127 | |||
128 | pci_dma_sync_sg_for_cpu(to_pci_dev(dev), sg, nelems, (int)direction); | ||
129 | } | ||
130 | |||
131 | static inline void | ||
132 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nelems, | ||
133 | enum dma_data_direction direction) | ||
134 | { | ||
135 | BUG_ON(dev->bus != &pci_bus_type); | ||
136 | |||
137 | pci_dma_sync_sg_for_device(to_pci_dev(dev), sg, nelems, (int)direction); | ||
138 | } | ||
139 | |||
140 | static inline int | ||
141 | dma_mapping_error(dma_addr_t dma_addr) | ||
142 | { | ||
143 | return pci_dma_mapping_error(dma_addr); | ||
144 | } | ||
145 | |||
7 | #else | 146 | #else |
8 | 147 | ||
9 | struct device; | 148 | struct device; |
diff --git a/include/asm-sparc64/pci.h b/include/asm-sparc64/pci.h index 7c5a589ea437..e1ea67bc32f2 100644 --- a/include/asm-sparc64/pci.h +++ b/include/asm-sparc64/pci.h | |||
@@ -42,7 +42,7 @@ static inline void pcibios_penalize_isa_irq(int irq, int active) | |||
42 | struct pci_dev; | 42 | struct pci_dev; |
43 | 43 | ||
44 | struct pci_iommu_ops { | 44 | struct pci_iommu_ops { |
45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *); | 45 | void *(*alloc_consistent)(struct pci_dev *, size_t, dma_addr_t *, gfp_t); |
46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); | 46 | void (*free_consistent)(struct pci_dev *, size_t, void *, dma_addr_t); |
47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); | 47 | dma_addr_t (*map_single)(struct pci_dev *, void *, size_t, int); |
48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); | 48 | void (*unmap_single)(struct pci_dev *, dma_addr_t, size_t, int); |
@@ -59,7 +59,7 @@ extern struct pci_iommu_ops *pci_iommu_ops; | |||
59 | */ | 59 | */ |
60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) | 60 | static inline void *pci_alloc_consistent(struct pci_dev *hwdev, size_t size, dma_addr_t *dma_handle) |
61 | { | 61 | { |
62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle); | 62 | return pci_iommu_ops->alloc_consistent(hwdev, size, dma_handle, GFP_ATOMIC); |
63 | } | 63 | } |
64 | 64 | ||
65 | /* Free and unmap a consistent DMA buffer. | 65 | /* Free and unmap a consistent DMA buffer. |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index a73b7ce1a042..badc73fdcb97 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -318,12 +318,14 @@ | |||
318 | #define __NR_pselect6 297 | 318 | #define __NR_pselect6 297 |
319 | #define __NR_ppoll 298 | 319 | #define __NR_ppoll 298 |
320 | #define __NR_unshare 299 | 320 | #define __NR_unshare 299 |
321 | #define __NR_set_robust_list 300 | ||
322 | #define __NR_get_robust_list 301 | ||
321 | 323 | ||
322 | #ifdef __KERNEL__ | 324 | #ifdef __KERNEL__ |
323 | /* WARNING: You MAY NOT add syscall numbers larger than 299, since | 325 | /* WARNING: You MAY NOT add syscall numbers larger than 301, since |
324 | * all of the syscall tables in the Sparc kernel are | 326 | * all of the syscall tables in the Sparc kernel are |
325 | * sized to have 299 entries (starting at zero). Therefore | 327 | * sized to have 301 entries (starting at zero). Therefore |
326 | * find a free slot in the 0-299 range. | 328 | * find a free slot in the 0-301 range. |
327 | */ | 329 | */ |
328 | 330 | ||
329 | #define _syscall0(type,name) \ | 331 | #define _syscall0(type,name) \ |
diff --git a/include/asm-x86_64/e820.h b/include/asm-x86_64/e820.h index 93b51df51687..670a3388e70a 100644 --- a/include/asm-x86_64/e820.h +++ b/include/asm-x86_64/e820.h | |||
@@ -59,6 +59,8 @@ extern void __init parse_memopt(char *p, char **end); | |||
59 | extern void __init parse_memmapopt(char *p, char **end); | 59 | extern void __init parse_memmapopt(char *p, char **end); |
60 | 60 | ||
61 | extern struct e820map e820; | 61 | extern struct e820map e820; |
62 | |||
63 | extern unsigned ebda_addr, ebda_size; | ||
62 | #endif/*!__ASSEMBLY__*/ | 64 | #endif/*!__ASSEMBLY__*/ |
63 | 65 | ||
64 | #endif/*__E820_HEADER*/ | 66 | #endif/*__E820_HEADER*/ |
diff --git a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h index d71badbd260a..fb7a0909a174 100644 --- a/include/asm-x86_64/io_apic.h +++ b/include/asm-x86_64/io_apic.h | |||
@@ -204,6 +204,7 @@ extern int skip_ioapic_setup; | |||
204 | extern int io_apic_get_version (int ioapic); | 204 | extern int io_apic_get_version (int ioapic); |
205 | extern int io_apic_get_redir_entries (int ioapic); | 205 | extern int io_apic_get_redir_entries (int ioapic); |
206 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); | 206 | extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); |
207 | extern int timer_uses_ioapic_pin_0; | ||
207 | #endif | 208 | #endif |
208 | 209 | ||
209 | extern int sis_apic_bug; /* dummy */ | 210 | extern int sis_apic_bug; /* dummy */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 9943f51cd809..b2e5da2b637b 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -199,6 +199,7 @@ extern int class_device_create_file(struct class_device *, | |||
199 | * @node: for internal use by the driver core only. | 199 | * @node: for internal use by the driver core only. |
200 | * @kobj: for internal use by the driver core only. | 200 | * @kobj: for internal use by the driver core only. |
201 | * @devt_attr: for internal use by the driver core only. | 201 | * @devt_attr: for internal use by the driver core only. |
202 | * @groups: optional additional groups to be created | ||
202 | * @dev: if set, a symlink to the struct device is created in the sysfs | 203 | * @dev: if set, a symlink to the struct device is created in the sysfs |
203 | * directory for this struct class device. | 204 | * directory for this struct class device. |
204 | * @class_data: pointer to whatever you want to store here for this struct | 205 | * @class_data: pointer to whatever you want to store here for this struct |
@@ -227,6 +228,7 @@ struct class_device { | |||
227 | struct device * dev; /* not necessary, but nice to have */ | 228 | struct device * dev; /* not necessary, but nice to have */ |
228 | void * class_data; /* class-specific data */ | 229 | void * class_data; /* class-specific data */ |
229 | struct class_device *parent; /* parent of this child device, if there is one */ | 230 | struct class_device *parent; /* parent of this child device, if there is one */ |
231 | struct attribute_group ** groups; /* optional groups */ | ||
230 | 232 | ||
231 | void (*release)(struct class_device *dev); | 233 | void (*release)(struct class_device *dev); |
232 | int (*uevent)(struct class_device *dev, char **envp, | 234 | int (*uevent)(struct class_device *dev, char **envp, |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index ff61817082fa..635690cf3e3d 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -14,6 +14,7 @@ enum dma_data_direction { | |||
14 | }; | 14 | }; |
15 | 15 | ||
16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL | 16 | #define DMA_64BIT_MASK 0xffffffffffffffffULL |
17 | #define DMA_48BIT_MASK 0x0000ffffffffffffULL | ||
17 | #define DMA_40BIT_MASK 0x000000ffffffffffULL | 18 | #define DMA_40BIT_MASK 0x000000ffffffffffULL |
18 | #define DMA_39BIT_MASK 0x0000007fffffffffULL | 19 | #define DMA_39BIT_MASK 0x0000007fffffffffULL |
19 | #define DMA_32BIT_MASK 0x00000000ffffffffULL | 20 | #define DMA_32BIT_MASK 0x00000000ffffffffULL |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 2d716080be4a..33d8f2087b6e 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -19,5 +19,4 @@ int request_firmware_nowait( | |||
19 | void (*cont)(const struct firmware *fw, void *context)); | 19 | void (*cont)(const struct firmware *fw, void *context)); |
20 | 20 | ||
21 | void release_firmware(const struct firmware *fw); | 21 | void release_firmware(const struct firmware *fw); |
22 | void register_firmware(const char *name, const u8 *data, size_t size); | ||
23 | #endif | 22 | #endif |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 75a236c268fc..ecc8c2c3d8ca 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -212,6 +212,10 @@ extern int dir_notify_enable; | |||
212 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 212 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
213 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 213 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
214 | 214 | ||
215 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | ||
216 | #define SYNC_FILE_RANGE_WRITE 2 | ||
217 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | ||
218 | |||
215 | #ifdef __KERNEL__ | 219 | #ifdef __KERNEL__ |
216 | 220 | ||
217 | #include <linux/linkage.h> | 221 | #include <linux/linkage.h> |
@@ -757,9 +761,6 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
757 | extern int fcntl_getlease(struct file *filp); | 761 | extern int fcntl_getlease(struct file *filp); |
758 | 762 | ||
759 | /* fs/sync.c */ | 763 | /* fs/sync.c */ |
760 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | ||
761 | #define SYNC_FILE_RANGE_WRITE 2 | ||
762 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | ||
763 | extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, | 764 | extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, |
764 | unsigned int flags); | 765 | unsigned int flags); |
765 | 766 | ||
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index a3a0e078f79d..16fbe59edeb1 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -110,5 +110,16 @@ struct fsl_usb2_platform_data { | |||
110 | #define FSL_USB2_PORT0_ENABLED 0x00000001 | 110 | #define FSL_USB2_PORT0_ENABLED 0x00000001 |
111 | #define FSL_USB2_PORT1_ENABLED 0x00000002 | 111 | #define FSL_USB2_PORT1_ENABLED 0x00000002 |
112 | 112 | ||
113 | struct fsl_spi_platform_data { | ||
114 | u32 initial_spmode; /* initial SPMODE value */ | ||
115 | u16 bus_num; | ||
116 | |||
117 | /* board specific information */ | ||
118 | u16 max_chipselect; | ||
119 | void (*activate_cs)(u8 cs, u8 polarity); | ||
120 | void (*deactivate_cs)(u8 cs, u8 polarity); | ||
121 | u32 sysclk; | ||
122 | }; | ||
123 | |||
113 | #endif /* _FSL_DEVICE_H_ */ | 124 | #endif /* _FSL_DEVICE_H_ */ |
114 | #endif /* __KERNEL__ */ | 125 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e1bd0842f6a1..f4fc576ed4c4 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -124,6 +124,7 @@ extern int get_option(char **str, int *pint); | |||
124 | extern char *get_options(const char *str, int nints, int *ints); | 124 | extern char *get_options(const char *str, int nints, int *ints); |
125 | extern unsigned long long memparse(char *ptr, char **retptr); | 125 | extern unsigned long long memparse(char *ptr, char **retptr); |
126 | 126 | ||
127 | extern int core_kernel_text(unsigned long addr); | ||
127 | extern int __kernel_text_address(unsigned long addr); | 128 | extern int __kernel_text_address(unsigned long addr); |
128 | extern int kernel_text_address(unsigned long addr); | 129 | extern int kernel_text_address(unsigned long addr); |
129 | extern int session_of_pgrp(int pgrp); | 130 | extern int session_of_pgrp(int pgrp); |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index bdc556d88498..03a14a30c46a 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -69,6 +69,7 @@ struct mmc_data { | |||
69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | 69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ |
70 | unsigned int timeout_clks; /* data timeout (in clocks) */ | 70 | unsigned int timeout_clks; /* data timeout (in clocks) */ |
71 | unsigned int blksz_bits; /* data block size */ | 71 | unsigned int blksz_bits; /* data block size */ |
72 | unsigned int blksz; /* data block size */ | ||
72 | unsigned int blocks; /* number of blocks */ | 73 | unsigned int blocks; /* number of blocks */ |
73 | unsigned int error; /* data error */ | 74 | unsigned int error; /* data error */ |
74 | unsigned int flags; | 75 | unsigned int flags; |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6be91fb2deb1..230180c3eb61 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #else | 21 | #else |
22 | #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER | 22 | #define MAX_ORDER CONFIG_FORCE_MAX_ZONEORDER |
23 | #endif | 23 | #endif |
24 | #define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) | ||
24 | 25 | ||
25 | struct free_area { | 26 | struct free_area { |
26 | struct list_head free_list; | 27 | struct list_head free_list; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5128dd7634cb..cebe677e153b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -432,8 +432,7 @@ struct net_device | |||
432 | 432 | ||
433 | /* register/unregister state machine */ | 433 | /* register/unregister state machine */ |
434 | enum { NETREG_UNINITIALIZED=0, | 434 | enum { NETREG_UNINITIALIZED=0, |
435 | NETREG_REGISTERING, /* called register_netdevice */ | 435 | NETREG_REGISTERED, /* completed register_netdevice */ |
436 | NETREG_REGISTERED, /* completed register todo */ | ||
437 | NETREG_UNREGISTERING, /* called unregister_netdevice */ | 436 | NETREG_UNREGISTERING, /* called unregister_netdevice */ |
438 | NETREG_UNREGISTERED, /* completed unregister todo */ | 437 | NETREG_UNREGISTERED, /* completed unregister todo */ |
439 | NETREG_RELEASED, /* called free_netdev */ | 438 | NETREG_RELEASED, /* called free_netdev */ |
@@ -505,6 +504,8 @@ struct net_device | |||
505 | 504 | ||
506 | /* class/net/name entry */ | 505 | /* class/net/name entry */ |
507 | struct class_device class_dev; | 506 | struct class_device class_dev; |
507 | /* space for optional statistics and wireless sysfs groups */ | ||
508 | struct attribute_group *sysfs_groups[3]; | ||
508 | }; | 509 | }; |
509 | 510 | ||
510 | #define NETDEV_ALIGN 32 | 511 | #define NETDEV_ALIGN 32 |
@@ -828,21 +829,19 @@ static inline void netif_rx_schedule(struct net_device *dev) | |||
828 | __netif_rx_schedule(dev); | 829 | __netif_rx_schedule(dev); |
829 | } | 830 | } |
830 | 831 | ||
831 | 832 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). | |
832 | static inline void __netif_rx_reschedule(struct net_device *dev, int undo) | 833 | * Do not inline this? |
833 | { | 834 | */ |
834 | dev->quota += undo; | ||
835 | list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); | ||
836 | __raise_softirq_irqoff(NET_RX_SOFTIRQ); | ||
837 | } | ||
838 | |||
839 | /* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */ | ||
840 | static inline int netif_rx_reschedule(struct net_device *dev, int undo) | 835 | static inline int netif_rx_reschedule(struct net_device *dev, int undo) |
841 | { | 836 | { |
842 | if (netif_rx_schedule_prep(dev)) { | 837 | if (netif_rx_schedule_prep(dev)) { |
843 | unsigned long flags; | 838 | unsigned long flags; |
839 | |||
840 | dev->quota += undo; | ||
841 | |||
844 | local_irq_save(flags); | 842 | local_irq_save(flags); |
845 | __netif_rx_reschedule(dev, undo); | 843 | list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list); |
844 | __raise_softirq_irqoff(NET_RX_SOFTIRQ); | ||
846 | local_irq_restore(flags); | 845 | local_irq_restore(flags); |
847 | return 1; | 846 | return 1; |
848 | } | 847 | } |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 5673008b61e1..970284f571a6 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -132,6 +132,7 @@ static inline void rcu_bh_qsctr_inc(int cpu) | |||
132 | } | 132 | } |
133 | 133 | ||
134 | extern int rcu_pending(int cpu); | 134 | extern int rcu_pending(int cpu); |
135 | extern int rcu_needs_cpu(int cpu); | ||
135 | 136 | ||
136 | /** | 137 | /** |
137 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 138 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index fcfb783bef41..94b9286cf6bd 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -253,6 +253,7 @@ struct uart_port { | |||
253 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) | 253 | #define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) |
254 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) | 254 | #define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) |
255 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) | 255 | #define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) |
256 | #define UPF_DEAD ((__force upf_t) (1 << 30)) | ||
256 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) | 257 | #define UPF_IOREMAP ((__force upf_t) (1 << 31)) |
257 | 258 | ||
258 | #define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) | 259 | #define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) |
diff --git a/include/linux/slab.h b/include/linux/slab.h index a7d7f131b5da..9dc93163e065 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -149,6 +149,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
149 | 149 | ||
150 | extern void kfree(const void *); | 150 | extern void kfree(const void *); |
151 | extern unsigned int ksize(const void *); | 151 | extern unsigned int ksize(const void *); |
152 | extern int slab_is_available(void); | ||
152 | 153 | ||
153 | #ifdef CONFIG_NUMA | 154 | #ifdef CONFIG_NUMA |
154 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); | 155 | extern void *kmem_cache_alloc_node(kmem_cache_t *, gfp_t flags, int node); |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index b05f1463a267..e928c0dcc297 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -31,18 +31,23 @@ extern struct bus_type spi_bus_type; | |||
31 | * @master: SPI controller used with the device. | 31 | * @master: SPI controller used with the device. |
32 | * @max_speed_hz: Maximum clock rate to be used with this chip | 32 | * @max_speed_hz: Maximum clock rate to be used with this chip |
33 | * (on this board); may be changed by the device's driver. | 33 | * (on this board); may be changed by the device's driver. |
34 | * The spi_transfer.speed_hz can override this for each transfer. | ||
34 | * @chip-select: Chipselect, distinguishing chips handled by "master". | 35 | * @chip-select: Chipselect, distinguishing chips handled by "master". |
35 | * @mode: The spi mode defines how data is clocked out and in. | 36 | * @mode: The spi mode defines how data is clocked out and in. |
36 | * This may be changed by the device's driver. | 37 | * This may be changed by the device's driver. |
38 | * The "active low" default for chipselect mode can be overridden, | ||
39 | * as can the "MSB first" default for each word in a transfer. | ||
37 | * @bits_per_word: Data transfers involve one or more words; word sizes | 40 | * @bits_per_word: Data transfers involve one or more words; word sizes |
38 | * like eight or 12 bits are common. In-memory wordsizes are | 41 | * like eight or 12 bits are common. In-memory wordsizes are |
39 | * powers of two bytes (e.g. 20 bit samples use 32 bits). | 42 | * powers of two bytes (e.g. 20 bit samples use 32 bits). |
40 | * This may be changed by the device's driver. | 43 | * This may be changed by the device's driver, or left at the |
44 | * default (0) indicating protocol words are eight bit bytes. | ||
45 | * The spi_transfer.bits_per_word can override this for each transfer. | ||
41 | * @irq: Negative, or the number passed to request_irq() to receive | 46 | * @irq: Negative, or the number passed to request_irq() to receive |
42 | * interrupts from this device. | 47 | * interrupts from this device. |
43 | * @controller_state: Controller's runtime state | 48 | * @controller_state: Controller's runtime state |
44 | * @controller_data: Board-specific definitions for controller, such as | 49 | * @controller_data: Board-specific definitions for controller, such as |
45 | * FIFO initialization parameters; from board_info.controller_data | 50 | * FIFO initialization parameters; from board_info.controller_data |
46 | * | 51 | * |
47 | * An spi_device is used to interchange data between an SPI slave | 52 | * An spi_device is used to interchange data between an SPI slave |
48 | * (usually a discrete chip) and CPU memory. | 53 | * (usually a discrete chip) and CPU memory. |
@@ -65,6 +70,7 @@ struct spi_device { | |||
65 | #define SPI_MODE_2 (SPI_CPOL|0) | 70 | #define SPI_MODE_2 (SPI_CPOL|0) |
66 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) | 71 | #define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) |
67 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ | 72 | #define SPI_CS_HIGH 0x04 /* chipselect active high? */ |
73 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ | ||
68 | u8 bits_per_word; | 74 | u8 bits_per_word; |
69 | int irq; | 75 | int irq; |
70 | void *controller_state; | 76 | void *controller_state; |
@@ -73,7 +79,6 @@ struct spi_device { | |||
73 | 79 | ||
74 | // likely need more hooks for more protocol options affecting how | 80 | // likely need more hooks for more protocol options affecting how |
75 | // the controller talks to each chip, like: | 81 | // the controller talks to each chip, like: |
76 | // - bit order (default is wordwise msb-first) | ||
77 | // - memory packing (12 bit samples into low bits, others zeroed) | 82 | // - memory packing (12 bit samples into low bits, others zeroed) |
78 | // - priority | 83 | // - priority |
79 | // - drop chipselect after each word | 84 | // - drop chipselect after each word |
@@ -143,13 +148,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
143 | * struct spi_master - interface to SPI master controller | 148 | * struct spi_master - interface to SPI master controller |
144 | * @cdev: class interface to this driver | 149 | * @cdev: class interface to this driver |
145 | * @bus_num: board-specific (and often SOC-specific) identifier for a | 150 | * @bus_num: board-specific (and often SOC-specific) identifier for a |
146 | * given SPI controller. | 151 | * given SPI controller. |
147 | * @num_chipselect: chipselects are used to distinguish individual | 152 | * @num_chipselect: chipselects are used to distinguish individual |
148 | * SPI slaves, and are numbered from zero to num_chipselects. | 153 | * SPI slaves, and are numbered from zero to num_chipselects. |
149 | * each slave has a chipselect signal, but it's common that not | 154 | * each slave has a chipselect signal, but it's common that not |
150 | * every chipselect is connected to a slave. | 155 | * every chipselect is connected to a slave. |
151 | * @setup: updates the device mode and clocking records used by a | 156 | * @setup: updates the device mode and clocking records used by a |
152 | * device's SPI controller; protocol code may call this. | 157 | * device's SPI controller; protocol code may call this. |
153 | * @transfer: adds a message to the controller's transfer queue. | 158 | * @transfer: adds a message to the controller's transfer queue. |
154 | * @cleanup: frees controller-specific state | 159 | * @cleanup: frees controller-specific state |
155 | * | 160 | * |
@@ -167,13 +172,13 @@ static inline void spi_unregister_driver(struct spi_driver *sdrv) | |||
167 | struct spi_master { | 172 | struct spi_master { |
168 | struct class_device cdev; | 173 | struct class_device cdev; |
169 | 174 | ||
170 | /* other than zero (== assign one dynamically), bus_num is fully | 175 | /* other than negative (== assign one dynamically), bus_num is fully |
171 | * board-specific. usually that simplifies to being SOC-specific. | 176 | * board-specific. usually that simplifies to being SOC-specific. |
172 | * example: one SOC has three SPI controllers, numbered 1..3, | 177 | * example: one SOC has three SPI controllers, numbered 0..2, |
173 | * and one board's schematics might show it using SPI-2. software | 178 | * and one board's schematics might show it using SPI-2. software |
174 | * would normally use bus_num=2 for that controller. | 179 | * would normally use bus_num=2 for that controller. |
175 | */ | 180 | */ |
176 | u16 bus_num; | 181 | s16 bus_num; |
177 | 182 | ||
178 | /* chipselects will be integral to many controllers; some others | 183 | /* chipselects will be integral to many controllers; some others |
179 | * might use board-specific GPIOs. | 184 | * might use board-specific GPIOs. |
@@ -268,10 +273,14 @@ extern struct spi_master *spi_busnum_to_master(u16 busnum); | |||
268 | * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped | 273 | * @tx_dma: DMA address of tx_buf, if spi_message.is_dma_mapped |
269 | * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped | 274 | * @rx_dma: DMA address of rx_buf, if spi_message.is_dma_mapped |
270 | * @len: size of rx and tx buffers (in bytes) | 275 | * @len: size of rx and tx buffers (in bytes) |
276 | * @speed_hz: Select a speed other then the device default for this | ||
277 | * transfer. If 0 the default (from spi_device) is used. | ||
278 | * @bits_per_word: select a bits_per_word other then the device default | ||
279 | * for this transfer. If 0 the default (from spi_device) is used. | ||
271 | * @cs_change: affects chipselect after this transfer completes | 280 | * @cs_change: affects chipselect after this transfer completes |
272 | * @delay_usecs: microseconds to delay after this transfer before | 281 | * @delay_usecs: microseconds to delay after this transfer before |
273 | * (optionally) changing the chipselect status, then starting | 282 | * (optionally) changing the chipselect status, then starting |
274 | * the next transfer or completing this spi_message. | 283 | * the next transfer or completing this spi_message. |
275 | * @transfer_list: transfers are sequenced through spi_message.transfers | 284 | * @transfer_list: transfers are sequenced through spi_message.transfers |
276 | * | 285 | * |
277 | * SPI transfers always write the same number of bytes as they read. | 286 | * SPI transfers always write the same number of bytes as they read. |
@@ -322,7 +331,9 @@ struct spi_transfer { | |||
322 | dma_addr_t rx_dma; | 331 | dma_addr_t rx_dma; |
323 | 332 | ||
324 | unsigned cs_change:1; | 333 | unsigned cs_change:1; |
334 | u8 bits_per_word; | ||
325 | u16 delay_usecs; | 335 | u16 delay_usecs; |
336 | u32 speed_hz; | ||
326 | 337 | ||
327 | struct list_head transfer_list; | 338 | struct list_head transfer_list; |
328 | }; | 339 | }; |
@@ -356,7 +367,7 @@ struct spi_transfer { | |||
356 | * and its transfers, ignore them until its completion callback. | 367 | * and its transfers, ignore them until its completion callback. |
357 | */ | 368 | */ |
358 | struct spi_message { | 369 | struct spi_message { |
359 | struct list_head transfers; | 370 | struct list_head transfers; |
360 | 371 | ||
361 | struct spi_device *spi; | 372 | struct spi_device *spi; |
362 | 373 | ||
@@ -374,7 +385,7 @@ struct spi_message { | |||
374 | */ | 385 | */ |
375 | 386 | ||
376 | /* completion is reported through a callback */ | 387 | /* completion is reported through a callback */ |
377 | void (*complete)(void *context); | 388 | void (*complete)(void *context); |
378 | void *context; | 389 | void *context; |
379 | unsigned actual_length; | 390 | unsigned actual_length; |
380 | int status; | 391 | int status; |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index c961fe9bf3eb..16ce178f54d7 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -30,6 +30,12 @@ struct spi_bitbang { | |||
30 | 30 | ||
31 | struct spi_master *master; | 31 | struct spi_master *master; |
32 | 32 | ||
33 | /* setup_transfer() changes clock and/or wordsize to match settings | ||
34 | * for this transfer; zeroes restore defaults from spi_device. | ||
35 | */ | ||
36 | int (*setup_transfer)(struct spi_device *spi, | ||
37 | struct spi_transfer *t); | ||
38 | |||
33 | void (*chipselect)(struct spi_device *spi, int is_on); | 39 | void (*chipselect)(struct spi_device *spi, int is_on); |
34 | #define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ | 40 | #define BITBANG_CS_ACTIVE 1 /* normally nCS, active low */ |
35 | #define BITBANG_CS_INACTIVE 0 | 41 | #define BITBANG_CS_INACTIVE 0 |
@@ -51,6 +57,8 @@ struct spi_bitbang { | |||
51 | extern int spi_bitbang_setup(struct spi_device *spi); | 57 | extern int spi_bitbang_setup(struct spi_device *spi); |
52 | extern void spi_bitbang_cleanup(const struct spi_device *spi); | 58 | extern void spi_bitbang_cleanup(const struct spi_device *spi); |
53 | extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); | 59 | extern int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m); |
60 | extern int spi_bitbang_setup_transfer(struct spi_device *spi, | ||
61 | struct spi_transfer *t); | ||
54 | 62 | ||
55 | /* start or stop queue processing */ | 63 | /* start or stop queue processing */ |
56 | extern int spi_bitbang_start(struct spi_bitbang *spi); | 64 | extern int spi_bitbang_start(struct spi_bitbang *spi); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index e24fa9b69cbf..aca9bfae208f 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -295,7 +295,7 @@ static inline void disable_swap_token(void) | |||
295 | #define read_swap_cache_async(swp,vma,addr) NULL | 295 | #define read_swap_cache_async(swp,vma,addr) NULL |
296 | #define lookup_swap_cache(swp) NULL | 296 | #define lookup_swap_cache(swp) NULL |
297 | #define valid_swaphandles(swp, off) 0 | 297 | #define valid_swaphandles(swp, off) 0 |
298 | #define can_share_swap_page(p) 0 | 298 | #define can_share_swap_page(p) (page_mapcount(p) == 1) |
299 | #define move_to_swap_cache(p, swp) 1 | 299 | #define move_to_swap_cache(p, swp) 1 |
300 | #define move_from_swap_cache(p, i, m) 1 | 300 | #define move_from_swap_cache(p, i, m) 1 |
301 | #define __delete_from_swap_cache(p) /*NOTHING*/ | 301 | #define __delete_from_swap_cache(p) /*NOTHING*/ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 70c64dbe4b8a..bd67a4413df7 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -52,6 +52,7 @@ struct utimbuf; | |||
52 | struct mq_attr; | 52 | struct mq_attr; |
53 | struct compat_stat; | 53 | struct compat_stat; |
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | ||
55 | 56 | ||
56 | #include <linux/types.h> | 57 | #include <linux/types.h> |
57 | #include <linux/aio_abi.h> | 58 | #include <linux/aio_abi.h> |
@@ -580,5 +581,10 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags); | |||
580 | 581 | ||
581 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, | 582 | asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, |
582 | unsigned int flags); | 583 | unsigned int flags); |
584 | asmlinkage long sys_get_robust_list(int pid, | ||
585 | struct robust_list_head __user **head_ptr, | ||
586 | size_t __user *len_ptr); | ||
587 | asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | ||
588 | size_t len); | ||
583 | 589 | ||
584 | #endif | 590 | #endif |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d7670ec1ec1e..ad7fa9c86c10 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1141,8 +1141,13 @@ extern char *v4l2_type_names[]; | |||
1141 | /* Compatibility layer interface -- v4l1-compat module */ | 1141 | /* Compatibility layer interface -- v4l1-compat module */ |
1142 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, | 1142 | typedef int (*v4l2_kioctl)(struct inode *inode, struct file *file, |
1143 | unsigned int cmd, void *arg); | 1143 | unsigned int cmd, void *arg); |
1144 | |||
1145 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | ||
1144 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, | 1146 | int v4l_compat_translate_ioctl(struct inode *inode, struct file *file, |
1145 | int cmd, void *arg, v4l2_kioctl driver_ioctl); | 1147 | int cmd, void *arg, v4l2_kioctl driver_ioctl); |
1148 | #else | ||
1149 | #define v4l_compat_translate_ioctl(inode,file,cmd,arg,ioctl) -EINVAL | ||
1150 | #endif | ||
1146 | 1151 | ||
1147 | /* 32 Bits compatibility layer for 64 bits processors */ | 1152 | /* 32 Bits compatibility layer for 64 bits processors */ |
1148 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, | 1153 | extern long v4l_compat_ioctl32(struct file *file, unsigned int cmd, |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index 4725ff861c57..d5926bfb1fc9 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -955,11 +955,13 @@ enum ieee80211_state { | |||
955 | 955 | ||
956 | #define IEEE80211_24GHZ_MIN_CHANNEL 1 | 956 | #define IEEE80211_24GHZ_MIN_CHANNEL 1 |
957 | #define IEEE80211_24GHZ_MAX_CHANNEL 14 | 957 | #define IEEE80211_24GHZ_MAX_CHANNEL 14 |
958 | #define IEEE80211_24GHZ_CHANNELS 14 | 958 | #define IEEE80211_24GHZ_CHANNELS (IEEE80211_24GHZ_MAX_CHANNEL - \ |
959 | IEEE80211_24GHZ_MIN_CHANNEL + 1) | ||
959 | 960 | ||
960 | #define IEEE80211_52GHZ_MIN_CHANNEL 34 | 961 | #define IEEE80211_52GHZ_MIN_CHANNEL 34 |
961 | #define IEEE80211_52GHZ_MAX_CHANNEL 165 | 962 | #define IEEE80211_52GHZ_MAX_CHANNEL 165 |
962 | #define IEEE80211_52GHZ_CHANNELS 131 | 963 | #define IEEE80211_52GHZ_CHANNELS (IEEE80211_52GHZ_MAX_CHANNEL - \ |
964 | IEEE80211_52GHZ_MIN_CHANNEL + 1) | ||
963 | 965 | ||
964 | enum { | 966 | enum { |
965 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), | 967 | IEEE80211_CH_PASSIVE_ONLY = (1 << 0), |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index b1ebfbae397f..052ed596a4e4 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -204,7 +204,8 @@ struct ieee80211softmac_device { | |||
204 | 204 | ||
205 | /* couple of flags */ | 205 | /* couple of flags */ |
206 | u8 scanning:1, /* protects scanning from being done multiple times at once */ | 206 | u8 scanning:1, /* protects scanning from being done multiple times at once */ |
207 | associated:1; | 207 | associated:1, |
208 | running:1; | ||
208 | 209 | ||
209 | struct ieee80211softmac_scaninfo *scaninfo; | 210 | struct ieee80211softmac_scaninfo *scaninfo; |
210 | struct ieee80211softmac_assoc_info associnfo; | 211 | struct ieee80211softmac_assoc_info associnfo; |
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h index 0d8e9fa416f3..11ecfa58a648 100644 --- a/include/net/irda/irlmp.h +++ b/include/net/irda/irlmp.h | |||
@@ -111,7 +111,7 @@ struct lsap_cb { | |||
111 | 111 | ||
112 | struct timer_list watchdog_timer; | 112 | struct timer_list watchdog_timer; |
113 | 113 | ||
114 | IRLMP_STATE lsap_state; /* Connection state */ | 114 | LSAP_STATE lsap_state; /* Connection state */ |
115 | notify_t notify; /* Indication/Confirm entry points */ | 115 | notify_t notify; /* Indication/Confirm entry points */ |
116 | struct qos_info qos; /* QoS for this connection */ | 116 | struct qos_info qos; /* QoS for this connection */ |
117 | 117 | ||
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index b0666d66293f..4901ee446879 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -211,6 +211,7 @@ struct neigh_table | |||
211 | #define NEIGH_UPDATE_F_ADMIN 0x80000000 | 211 | #define NEIGH_UPDATE_F_ADMIN 0x80000000 |
212 | 212 | ||
213 | extern void neigh_table_init(struct neigh_table *tbl); | 213 | extern void neigh_table_init(struct neigh_table *tbl); |
214 | extern void neigh_table_init_no_netlink(struct neigh_table *tbl); | ||
214 | extern int neigh_table_clear(struct neigh_table *tbl); | 215 | extern int neigh_table_clear(struct neigh_table *tbl); |
215 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, | 216 | extern struct neighbour * neigh_lookup(struct neigh_table *tbl, |
216 | const void *pkey, | 217 | const void *pkey, |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 34a1a09e5aef..807d6f1ef4b5 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -99,6 +99,7 @@ typedef enum { | |||
99 | SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */ | 99 | SCTP_CMD_DEL_NON_PRIMARY, /* Removes non-primary peer transports. */ |
100 | SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */ | 100 | SCTP_CMD_T3_RTX_TIMERS_STOP, /* Stops T3-rtx pending timers */ |
101 | SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */ | 101 | SCTP_CMD_FORCE_PRIM_RETRAN, /* Forces retrans. over primary path. */ |
102 | SCTP_CMD_SET_SK_ERR, /* Set sk_err */ | ||
102 | SCTP_CMD_LAST | 103 | SCTP_CMD_LAST |
103 | } sctp_verb_t; | 104 | } sctp_verb_t; |
104 | 105 | ||
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 9c30fa55051e..a9663b49ea54 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -460,12 +460,12 @@ static inline int sctp_frag_point(const struct sctp_sock *sp, int pmtu) | |||
460 | * there is room for a param header too. | 460 | * there is room for a param header too. |
461 | */ | 461 | */ |
462 | #define sctp_walk_params(pos, chunk, member)\ | 462 | #define sctp_walk_params(pos, chunk, member)\ |
463 | _sctp_walk_params((pos), (chunk), WORD_ROUND(ntohs((chunk)->chunk_hdr.length)), member) | 463 | _sctp_walk_params((pos), (chunk), ntohs((chunk)->chunk_hdr.length), member) |
464 | 464 | ||
465 | #define _sctp_walk_params(pos, chunk, end, member)\ | 465 | #define _sctp_walk_params(pos, chunk, end, member)\ |
466 | for (pos.v = chunk->member;\ | 466 | for (pos.v = chunk->member;\ |
467 | pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ | 467 | pos.v <= (void *)chunk + end - sizeof(sctp_paramhdr_t) &&\ |
468 | pos.v <= (void *)chunk + end - WORD_ROUND(ntohs(pos.p->length)) &&\ | 468 | pos.v <= (void *)chunk + end - ntohs(pos.p->length) &&\ |
469 | ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ | 469 | ntohs(pos.p->length) >= sizeof(sctp_paramhdr_t);\ |
470 | pos.v += WORD_ROUND(ntohs(pos.p->length))) | 470 | pos.v += WORD_ROUND(ntohs(pos.p->length))) |
471 | 471 | ||
@@ -476,7 +476,7 @@ _sctp_walk_errors((err), (chunk_hdr), ntohs((chunk_hdr)->length)) | |||
476 | for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ | 476 | for (err = (sctp_errhdr_t *)((void *)chunk_hdr + \ |
477 | sizeof(sctp_chunkhdr_t));\ | 477 | sizeof(sctp_chunkhdr_t));\ |
478 | (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\ | 478 | (void *)err <= (void *)chunk_hdr + end - sizeof(sctp_errhdr_t) &&\ |
479 | (void *)err <= (void *)chunk_hdr + end - WORD_ROUND(ntohs(err->length)) &&\ | 479 | (void *)err <= (void *)chunk_hdr + end - ntohs(err->length) &&\ |
480 | ntohs(err->length) >= sizeof(sctp_errhdr_t); \ | 480 | ntohs(err->length) >= sizeof(sctp_errhdr_t); \ |
481 | err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) | 481 | err = (sctp_errhdr_t *)((void *)err + WORD_ROUND(ntohs(err->length)))) |
482 | 482 | ||
diff --git a/include/scsi/srp.h b/include/scsi/srp.h index 6c2681dc5b46..637f77eccf0c 100644 --- a/include/scsi/srp.h +++ b/include/scsi/srp.h | |||
@@ -95,14 +95,15 @@ struct srp_direct_buf { | |||
95 | 95 | ||
96 | /* | 96 | /* |
97 | * We need the packed attribute because the SRP spec puts the list of | 97 | * We need the packed attribute because the SRP spec puts the list of |
98 | * descriptors at an offset of 20, which is not aligned to the size | 98 | * descriptors at an offset of 20, which is not aligned to the size of |
99 | * of struct srp_direct_buf. | 99 | * struct srp_direct_buf. The whole structure must be packed to avoid |
100 | * having the 20-byte structure padded to 24 bytes on 64-bit architectures. | ||
100 | */ | 101 | */ |
101 | struct srp_indirect_buf { | 102 | struct srp_indirect_buf { |
102 | struct srp_direct_buf table_desc; | 103 | struct srp_direct_buf table_desc; |
103 | __be32 len; | 104 | __be32 len; |
104 | struct srp_direct_buf desc_list[0] __attribute__((packed)); | 105 | struct srp_direct_buf desc_list[0]; |
105 | }; | 106 | } __attribute__((packed)); |
106 | 107 | ||
107 | enum { | 108 | enum { |
108 | SRP_MULTICHAN_SINGLE = 0, | 109 | SRP_MULTICHAN_SINGLE = 0, |
@@ -122,6 +123,11 @@ struct srp_login_req { | |||
122 | u8 target_port_id[16]; | 123 | u8 target_port_id[16]; |
123 | }; | 124 | }; |
124 | 125 | ||
126 | /* | ||
127 | * The SRP spec defines the size of the LOGIN_RSP structure to be 52 | ||
128 | * bytes, so it needs to be packed to avoid having it padded to 56 | ||
129 | * bytes on 64-bit architectures. | ||
130 | */ | ||
125 | struct srp_login_rsp { | 131 | struct srp_login_rsp { |
126 | u8 opcode; | 132 | u8 opcode; |
127 | u8 reserved1[3]; | 133 | u8 reserved1[3]; |
@@ -132,7 +138,7 @@ struct srp_login_rsp { | |||
132 | __be16 buf_fmt; | 138 | __be16 buf_fmt; |
133 | u8 rsp_flags; | 139 | u8 rsp_flags; |
134 | u8 reserved2[25]; | 140 | u8 reserved2[25]; |
135 | }; | 141 | } __attribute__((packed)); |
136 | 142 | ||
137 | struct srp_login_rej { | 143 | struct srp_login_rej { |
138 | u8 opcode; | 144 | u8 opcode; |
@@ -207,6 +213,11 @@ enum { | |||
207 | SRP_RSP_FLAG_DIUNDER = 1 << 5 | 213 | SRP_RSP_FLAG_DIUNDER = 1 << 5 |
208 | }; | 214 | }; |
209 | 215 | ||
216 | /* | ||
217 | * The SRP spec defines the size of the RSP structure to be 36 bytes, | ||
218 | * so it needs to be packed to avoid having it padded to 40 bytes on | ||
219 | * 64-bit architectures. | ||
220 | */ | ||
210 | struct srp_rsp { | 221 | struct srp_rsp { |
211 | u8 opcode; | 222 | u8 opcode; |
212 | u8 sol_not; | 223 | u8 sol_not; |
@@ -221,6 +232,6 @@ struct srp_rsp { | |||
221 | __be32 sense_data_len; | 232 | __be32 sense_data_len; |
222 | __be32 resp_data_len; | 233 | __be32 resp_data_len; |
223 | u8 data[0]; | 234 | u8 data[0]; |
224 | }; | 235 | } __attribute__((packed)); |
225 | 236 | ||
226 | #endif /* SCSI_SRP_H */ | 237 | #endif /* SCSI_SRP_H */ |
diff --git a/init/do_mounts.c b/init/do_mounts.c index adb7cad3e6ee..f4b7b9d278cd 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -310,6 +310,11 @@ retry: | |||
310 | 310 | ||
311 | panic("VFS: Unable to mount root fs on %s", b); | 311 | panic("VFS: Unable to mount root fs on %s", b); |
312 | } | 312 | } |
313 | |||
314 | printk("No filesystem could mount root, tried: "); | ||
315 | for (p = fs_names; *p; p += strlen(p)+1) | ||
316 | printk(" %s", p); | ||
317 | printk("\n"); | ||
313 | panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV, b)); | 318 | panic("VFS: Unable to mount root fs on %s", __bdevname(ROOT_DEV, b)); |
314 | out: | 319 | out: |
315 | putname(fs_names); | 320 | putname(fs_names); |
diff --git a/init/initramfs.c b/init/initramfs.c index 679d870d991b..f81cfa40a719 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -26,10 +26,12 @@ static void __init free(void *where) | |||
26 | 26 | ||
27 | /* link hash */ | 27 | /* link hash */ |
28 | 28 | ||
29 | #define N_ALIGN(len) ((((len) + 1) & ~3) + 2) | ||
30 | |||
29 | static __initdata struct hash { | 31 | static __initdata struct hash { |
30 | int ino, minor, major; | 32 | int ino, minor, major; |
31 | struct hash *next; | 33 | struct hash *next; |
32 | char *name; | 34 | char name[N_ALIGN(PATH_MAX)]; |
33 | } *head[32]; | 35 | } *head[32]; |
34 | 36 | ||
35 | static inline int hash(int major, int minor, int ino) | 37 | static inline int hash(int major, int minor, int ino) |
@@ -57,7 +59,7 @@ static char __init *find_link(int major, int minor, int ino, char *name) | |||
57 | q->ino = ino; | 59 | q->ino = ino; |
58 | q->minor = minor; | 60 | q->minor = minor; |
59 | q->major = major; | 61 | q->major = major; |
60 | q->name = name; | 62 | strcpy(q->name, name); |
61 | q->next = NULL; | 63 | q->next = NULL; |
62 | *p = q; | 64 | *p = q; |
63 | return NULL; | 65 | return NULL; |
@@ -133,8 +135,6 @@ static inline void eat(unsigned n) | |||
133 | count -= n; | 135 | count -= n; |
134 | } | 136 | } |
135 | 137 | ||
136 | #define N_ALIGN(len) ((((len) + 1) & ~3) + 2) | ||
137 | |||
138 | static __initdata char *collected; | 138 | static __initdata char *collected; |
139 | static __initdata int remains; | 139 | static __initdata int remains; |
140 | static __initdata char *collect; | 140 | static __initdata char *collect; |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index 72248d1b9e3f..ab81fdd4572b 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -2231,19 +2231,25 @@ static const struct cpuset *nearest_exclusive_ancestor(const struct cpuset *cs) | |||
2231 | * So only GFP_KERNEL allocations, if all nodes in the cpuset are | 2231 | * So only GFP_KERNEL allocations, if all nodes in the cpuset are |
2232 | * short of memory, might require taking the callback_mutex mutex. | 2232 | * short of memory, might require taking the callback_mutex mutex. |
2233 | * | 2233 | * |
2234 | * The first loop over the zonelist in mm/page_alloc.c:__alloc_pages() | 2234 | * The first call here from mm/page_alloc:get_page_from_freelist() |
2235 | * calls here with __GFP_HARDWALL always set in gfp_mask, enforcing | 2235 | * has __GFP_HARDWALL set in gfp_mask, enforcing hardwall cpusets, so |
2236 | * hardwall cpusets - no allocation on a node outside the cpuset is | 2236 | * no allocation on a node outside the cpuset is allowed (unless in |
2237 | * allowed (unless in interrupt, of course). | 2237 | * interrupt, of course). |
2238 | * | 2238 | * |
2239 | * The second loop doesn't even call here for GFP_ATOMIC requests | 2239 | * The second pass through get_page_from_freelist() doesn't even call |
2240 | * (if the __alloc_pages() local variable 'wait' is set). That check | 2240 | * here for GFP_ATOMIC calls. For those calls, the __alloc_pages() |
2241 | * and the checks below have the combined affect in the second loop of | 2241 | * variable 'wait' is not set, and the bit ALLOC_CPUSET is not set |
2242 | * the __alloc_pages() routine that: | 2242 | * in alloc_flags. That logic and the checks below have the combined |
2243 | * affect that: | ||
2243 | * in_interrupt - any node ok (current task context irrelevant) | 2244 | * in_interrupt - any node ok (current task context irrelevant) |
2244 | * GFP_ATOMIC - any node ok | 2245 | * GFP_ATOMIC - any node ok |
2245 | * GFP_KERNEL - any node in enclosing mem_exclusive cpuset ok | 2246 | * GFP_KERNEL - any node in enclosing mem_exclusive cpuset ok |
2246 | * GFP_USER - only nodes in current tasks mems allowed ok. | 2247 | * GFP_USER - only nodes in current tasks mems allowed ok. |
2248 | * | ||
2249 | * Rule: | ||
2250 | * Don't call cpuset_zone_allowed() if you can't sleep, unless you | ||
2251 | * pass in the __GFP_HARDWALL flag set in gfp_flag, which disables | ||
2252 | * the code that might scan up ancestor cpusets and sleep. | ||
2247 | **/ | 2253 | **/ |
2248 | 2254 | ||
2249 | int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) | 2255 | int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) |
@@ -2255,6 +2261,7 @@ int __cpuset_zone_allowed(struct zone *z, gfp_t gfp_mask) | |||
2255 | if (in_interrupt()) | 2261 | if (in_interrupt()) |
2256 | return 1; | 2262 | return 1; |
2257 | node = z->zone_pgdat->node_id; | 2263 | node = z->zone_pgdat->node_id; |
2264 | might_sleep_if(!(gfp_mask & __GFP_HARDWALL)); | ||
2258 | if (node_isset(node, current->mems_allowed)) | 2265 | if (node_isset(node, current->mems_allowed)) |
2259 | return 1; | 2266 | return 1; |
2260 | if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ | 2267 | if (gfp_mask & __GFP_HARDWALL) /* If hardwall request, stop here */ |
diff --git a/kernel/extable.c b/kernel/extable.c index 7501b531ceed..7fe262855317 100644 --- a/kernel/extable.c +++ b/kernel/extable.c | |||
@@ -40,7 +40,7 @@ const struct exception_table_entry *search_exception_tables(unsigned long addr) | |||
40 | return e; | 40 | return e; |
41 | } | 41 | } |
42 | 42 | ||
43 | static int core_kernel_text(unsigned long addr) | 43 | int core_kernel_text(unsigned long addr) |
44 | { | 44 | { |
45 | if (addr >= (unsigned long)_stext && | 45 | if (addr >= (unsigned long)_stext && |
46 | addr <= (unsigned long)_etext) | 46 | addr <= (unsigned long)_etext) |
diff --git a/kernel/module.c b/kernel/module.c index d24deb0dbbc9..bbe04862e1b0 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -705,14 +705,14 @@ EXPORT_SYMBOL(__symbol_put); | |||
705 | 705 | ||
706 | void symbol_put_addr(void *addr) | 706 | void symbol_put_addr(void *addr) |
707 | { | 707 | { |
708 | unsigned long flags; | 708 | struct module *modaddr; |
709 | 709 | ||
710 | spin_lock_irqsave(&modlist_lock, flags); | 710 | if (core_kernel_text((unsigned long)addr)) |
711 | if (!kernel_text_address((unsigned long)addr)) | 711 | return; |
712 | BUG(); | ||
713 | 712 | ||
714 | module_put(module_text_address((unsigned long)addr)); | 713 | if (!(modaddr = module_text_address((unsigned long)addr))) |
715 | spin_unlock_irqrestore(&modlist_lock, flags); | 714 | BUG(); |
715 | module_put(modaddr); | ||
716 | } | 716 | } |
717 | EXPORT_SYMBOL_GPL(symbol_put_addr); | 717 | EXPORT_SYMBOL_GPL(symbol_put_addr); |
718 | 718 | ||
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 4e0f0ec003f7..921c22ad16e4 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
@@ -148,12 +148,34 @@ int ptrace_may_attach(struct task_struct *task) | |||
148 | int ptrace_attach(struct task_struct *task) | 148 | int ptrace_attach(struct task_struct *task) |
149 | { | 149 | { |
150 | int retval; | 150 | int retval; |
151 | task_lock(task); | 151 | |
152 | retval = -EPERM; | 152 | retval = -EPERM; |
153 | if (task->pid <= 1) | 153 | if (task->pid <= 1) |
154 | goto bad; | 154 | goto out; |
155 | if (task->tgid == current->tgid) | 155 | if (task->tgid == current->tgid) |
156 | goto bad; | 156 | goto out; |
157 | |||
158 | repeat: | ||
159 | /* | ||
160 | * Nasty, nasty. | ||
161 | * | ||
162 | * We want to hold both the task-lock and the | ||
163 | * tasklist_lock for writing at the same time. | ||
164 | * But that's against the rules (tasklist_lock | ||
165 | * is taken for reading by interrupts on other | ||
166 | * cpu's that may have task_lock). | ||
167 | */ | ||
168 | task_lock(task); | ||
169 | local_irq_disable(); | ||
170 | if (!write_trylock(&tasklist_lock)) { | ||
171 | local_irq_enable(); | ||
172 | task_unlock(task); | ||
173 | do { | ||
174 | cpu_relax(); | ||
175 | } while (!write_can_lock(&tasklist_lock)); | ||
176 | goto repeat; | ||
177 | } | ||
178 | |||
157 | /* the same process cannot be attached many times */ | 179 | /* the same process cannot be attached many times */ |
158 | if (task->ptrace & PT_PTRACED) | 180 | if (task->ptrace & PT_PTRACED) |
159 | goto bad; | 181 | goto bad; |
@@ -166,17 +188,15 @@ int ptrace_attach(struct task_struct *task) | |||
166 | ? PT_ATTACHED : 0); | 188 | ? PT_ATTACHED : 0); |
167 | if (capable(CAP_SYS_PTRACE)) | 189 | if (capable(CAP_SYS_PTRACE)) |
168 | task->ptrace |= PT_PTRACE_CAP; | 190 | task->ptrace |= PT_PTRACE_CAP; |
169 | task_unlock(task); | ||
170 | 191 | ||
171 | write_lock_irq(&tasklist_lock); | ||
172 | __ptrace_link(task, current); | 192 | __ptrace_link(task, current); |
173 | write_unlock_irq(&tasklist_lock); | ||
174 | 193 | ||
175 | force_sig_specific(SIGSTOP, task); | 194 | force_sig_specific(SIGSTOP, task); |
176 | return 0; | ||
177 | 195 | ||
178 | bad: | 196 | bad: |
197 | write_unlock_irq(&tasklist_lock); | ||
179 | task_unlock(task); | 198 | task_unlock(task); |
199 | out: | ||
180 | return retval; | 200 | return retval; |
181 | } | 201 | } |
182 | 202 | ||
@@ -417,21 +437,22 @@ int ptrace_request(struct task_struct *child, long request, | |||
417 | */ | 437 | */ |
418 | int ptrace_traceme(void) | 438 | int ptrace_traceme(void) |
419 | { | 439 | { |
420 | int ret; | 440 | int ret = -EPERM; |
421 | 441 | ||
422 | /* | 442 | /* |
423 | * Are we already being traced? | 443 | * Are we already being traced? |
424 | */ | 444 | */ |
425 | if (current->ptrace & PT_PTRACED) | 445 | task_lock(current); |
426 | return -EPERM; | 446 | if (!(current->ptrace & PT_PTRACED)) { |
427 | ret = security_ptrace(current->parent, current); | 447 | ret = security_ptrace(current->parent, current); |
428 | if (ret) | 448 | /* |
429 | return -EPERM; | 449 | * Set the ptrace bit in the process ptrace flags. |
430 | /* | 450 | */ |
431 | * Set the ptrace bit in the process ptrace flags. | 451 | if (!ret) |
432 | */ | 452 | current->ptrace |= PT_PTRACED; |
433 | current->ptrace |= PT_PTRACED; | 453 | } |
434 | return 0; | 454 | task_unlock(current); |
455 | return ret; | ||
435 | } | 456 | } |
436 | 457 | ||
437 | /** | 458 | /** |
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 6d32ff26f948..2058f88c7bbb 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -479,12 +479,31 @@ static int __rcu_pending(struct rcu_ctrlblk *rcp, struct rcu_data *rdp) | |||
479 | return 0; | 479 | return 0; |
480 | } | 480 | } |
481 | 481 | ||
482 | /* | ||
483 | * Check to see if there is any immediate RCU-related work to be done | ||
484 | * by the current CPU, returning 1 if so. This function is part of the | ||
485 | * RCU implementation; it is -not- an exported member of the RCU API. | ||
486 | */ | ||
482 | int rcu_pending(int cpu) | 487 | int rcu_pending(int cpu) |
483 | { | 488 | { |
484 | return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || | 489 | return __rcu_pending(&rcu_ctrlblk, &per_cpu(rcu_data, cpu)) || |
485 | __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); | 490 | __rcu_pending(&rcu_bh_ctrlblk, &per_cpu(rcu_bh_data, cpu)); |
486 | } | 491 | } |
487 | 492 | ||
493 | /* | ||
494 | * Check to see if any future RCU-related work will need to be done | ||
495 | * by the current CPU, even if none need be done immediately, returning | ||
496 | * 1 if so. This function is part of the RCU implementation; it is -not- | ||
497 | * an exported member of the RCU API. | ||
498 | */ | ||
499 | int rcu_needs_cpu(int cpu) | ||
500 | { | ||
501 | struct rcu_data *rdp = &per_cpu(rcu_data, cpu); | ||
502 | struct rcu_data *rdp_bh = &per_cpu(rcu_bh_data, cpu); | ||
503 | |||
504 | return (!!rdp->curlist || !!rdp_bh->curlist || rcu_pending(cpu)); | ||
505 | } | ||
506 | |||
488 | void rcu_check_callbacks(int cpu, int user) | 507 | void rcu_check_callbacks(int cpu, int user) |
489 | { | 508 | { |
490 | if (user || | 509 | if (user || |
diff --git a/kernel/sched.c b/kernel/sched.c index 4c64f85698ae..c13f1bd2df7d 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -665,55 +665,13 @@ static int effective_prio(task_t *p) | |||
665 | } | 665 | } |
666 | 666 | ||
667 | /* | 667 | /* |
668 | * We place interactive tasks back into the active array, if possible. | ||
669 | * | ||
670 | * To guarantee that this does not starve expired tasks we ignore the | ||
671 | * interactivity of a task if the first expired task had to wait more | ||
672 | * than a 'reasonable' amount of time. This deadline timeout is | ||
673 | * load-dependent, as the frequency of array switched decreases with | ||
674 | * increasing number of running tasks. We also ignore the interactivity | ||
675 | * if a better static_prio task has expired, and switch periodically | ||
676 | * regardless, to ensure that highly interactive tasks do not starve | ||
677 | * the less fortunate for unreasonably long periods. | ||
678 | */ | ||
679 | static inline int expired_starving(runqueue_t *rq) | ||
680 | { | ||
681 | int limit; | ||
682 | |||
683 | /* | ||
684 | * Arrays were recently switched, all is well | ||
685 | */ | ||
686 | if (!rq->expired_timestamp) | ||
687 | return 0; | ||
688 | |||
689 | limit = STARVATION_LIMIT * rq->nr_running; | ||
690 | |||
691 | /* | ||
692 | * It's time to switch arrays | ||
693 | */ | ||
694 | if (jiffies - rq->expired_timestamp >= limit) | ||
695 | return 1; | ||
696 | |||
697 | /* | ||
698 | * There's a better selection in the expired array | ||
699 | */ | ||
700 | if (rq->curr->static_prio > rq->best_expired_prio) | ||
701 | return 1; | ||
702 | |||
703 | /* | ||
704 | * All is well | ||
705 | */ | ||
706 | return 0; | ||
707 | } | ||
708 | |||
709 | /* | ||
710 | * __activate_task - move a task to the runqueue. | 668 | * __activate_task - move a task to the runqueue. |
711 | */ | 669 | */ |
712 | static void __activate_task(task_t *p, runqueue_t *rq) | 670 | static void __activate_task(task_t *p, runqueue_t *rq) |
713 | { | 671 | { |
714 | prio_array_t *target = rq->active; | 672 | prio_array_t *target = rq->active; |
715 | 673 | ||
716 | if (unlikely(batch_task(p) || (expired_starving(rq) && !rt_task(p)))) | 674 | if (batch_task(p)) |
717 | target = rq->expired; | 675 | target = rq->expired; |
718 | enqueue_task(p, target); | 676 | enqueue_task(p, target); |
719 | rq->nr_running++; | 677 | rq->nr_running++; |
@@ -2532,6 +2490,22 @@ unsigned long long current_sched_time(const task_t *tsk) | |||
2532 | } | 2490 | } |
2533 | 2491 | ||
2534 | /* | 2492 | /* |
2493 | * We place interactive tasks back into the active array, if possible. | ||
2494 | * | ||
2495 | * To guarantee that this does not starve expired tasks we ignore the | ||
2496 | * interactivity of a task if the first expired task had to wait more | ||
2497 | * than a 'reasonable' amount of time. This deadline timeout is | ||
2498 | * load-dependent, as the frequency of array switched decreases with | ||
2499 | * increasing number of running tasks. We also ignore the interactivity | ||
2500 | * if a better static_prio task has expired: | ||
2501 | */ | ||
2502 | #define EXPIRED_STARVING(rq) \ | ||
2503 | ((STARVATION_LIMIT && ((rq)->expired_timestamp && \ | ||
2504 | (jiffies - (rq)->expired_timestamp >= \ | ||
2505 | STARVATION_LIMIT * ((rq)->nr_running) + 1))) || \ | ||
2506 | ((rq)->curr->static_prio > (rq)->best_expired_prio)) | ||
2507 | |||
2508 | /* | ||
2535 | * Account user cpu time to a process. | 2509 | * Account user cpu time to a process. |
2536 | * @p: the process that the cpu time gets accounted to | 2510 | * @p: the process that the cpu time gets accounted to |
2537 | * @hardirq_offset: the offset to subtract from hardirq_count() | 2511 | * @hardirq_offset: the offset to subtract from hardirq_count() |
@@ -2666,7 +2640,7 @@ void scheduler_tick(void) | |||
2666 | 2640 | ||
2667 | if (!rq->expired_timestamp) | 2641 | if (!rq->expired_timestamp) |
2668 | rq->expired_timestamp = jiffies; | 2642 | rq->expired_timestamp = jiffies; |
2669 | if (!TASK_INTERACTIVE(p) || expired_starving(rq)) { | 2643 | if (!TASK_INTERACTIVE(p) || EXPIRED_STARVING(rq)) { |
2670 | enqueue_task(p, rq->expired); | 2644 | enqueue_task(p, rq->expired); |
2671 | if (p->static_prio < rq->best_expired_prio) | 2645 | if (p->static_prio < rq->best_expired_prio) |
2672 | rq->best_expired_prio = p->static_prio; | 2646 | rq->best_expired_prio = p->static_prio; |
diff --git a/kernel/timer.c b/kernel/timer.c index 67eaf0f54096..9e49deed468c 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -541,6 +541,22 @@ found: | |||
541 | } | 541 | } |
542 | spin_unlock(&base->lock); | 542 | spin_unlock(&base->lock); |
543 | 543 | ||
544 | /* | ||
545 | * It can happen that other CPUs service timer IRQs and increment | ||
546 | * jiffies, but we have not yet got a local timer tick to process | ||
547 | * the timer wheels. In that case, the expiry time can be before | ||
548 | * jiffies, but since the high-resolution timer here is relative to | ||
549 | * jiffies, the default expression when high-resolution timers are | ||
550 | * not active, | ||
551 | * | ||
552 | * time_before(MAX_JIFFY_OFFSET + jiffies, expires) | ||
553 | * | ||
554 | * would falsely evaluate to true. If that is the case, just | ||
555 | * return jiffies so that we can immediately fire the local timer | ||
556 | */ | ||
557 | if (time_before(expires, jiffies)) | ||
558 | return jiffies; | ||
559 | |||
544 | if (time_before(hr_expires, expires)) | 560 | if (time_before(hr_expires, expires)) |
545 | return hr_expires; | 561 | return hr_expires; |
546 | 562 | ||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 6ecc180beb71..ccb0c1fdf1b5 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -189,7 +189,7 @@ config FRAME_POINTER | |||
189 | config UNWIND_INFO | 189 | config UNWIND_INFO |
190 | bool "Compile the kernel with frame unwind information" | 190 | bool "Compile the kernel with frame unwind information" |
191 | depends on !IA64 | 191 | depends on !IA64 |
192 | depends on !MODULES || !(MIPS || PARISC || PPC || SUPERH || SPARC64 || V850) | 192 | depends on !MODULES || !(MIPS || PARISC || PPC || SUPERH || V850) |
193 | help | 193 | help |
194 | If you say Y here the resulting kernel image will be slightly larger | 194 | If you say Y here the resulting kernel image will be slightly larger |
195 | but not slower, and it will give very useful debugging information. | 195 | but not slower, and it will give very useful debugging information. |
diff --git a/lib/kobject.c b/lib/kobject.c index b46350c27837..687ab418d292 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -198,14 +198,14 @@ int kobject_add(struct kobject * kobj) | |||
198 | 198 | ||
199 | /* be noisy on error issues */ | 199 | /* be noisy on error issues */ |
200 | if (error == -EEXIST) | 200 | if (error == -EEXIST) |
201 | printk("kobject_add failed for %s with -EEXIST, " | 201 | pr_debug("kobject_add failed for %s with -EEXIST, " |
202 | "don't try to register things with the " | 202 | "don't try to register things with the " |
203 | "same name in the same directory.\n", | 203 | "same name in the same directory.\n", |
204 | kobject_name(kobj)); | 204 | kobject_name(kobj)); |
205 | else | 205 | else |
206 | printk("kobject_add failed for %s (%d)\n", | 206 | pr_debug("kobject_add failed for %s (%d)\n", |
207 | kobject_name(kobj), error); | 207 | kobject_name(kobj), error); |
208 | dump_stack(); | 208 | /* dump_stack(); */ |
209 | } | 209 | } |
210 | 210 | ||
211 | return error; | 211 | return error; |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index ea77c999047e..253a450c400d 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/mempolicy.h> | 39 | #include <linux/mempolicy.h> |
40 | 40 | ||
41 | #include <asm/tlbflush.h> | 41 | #include <asm/tlbflush.h> |
42 | #include <asm/div64.h> | ||
42 | #include "internal.h" | 43 | #include "internal.h" |
43 | 44 | ||
44 | /* | 45 | /* |
@@ -950,7 +951,7 @@ restart: | |||
950 | goto got_pg; | 951 | goto got_pg; |
951 | 952 | ||
952 | do { | 953 | do { |
953 | if (cpuset_zone_allowed(*z, gfp_mask)) | 954 | if (cpuset_zone_allowed(*z, gfp_mask|__GFP_HARDWALL)) |
954 | wakeup_kswapd(*z, order); | 955 | wakeup_kswapd(*z, order); |
955 | } while (*(++z)); | 956 | } while (*(++z)); |
956 | 957 | ||
@@ -969,7 +970,8 @@ restart: | |||
969 | alloc_flags |= ALLOC_HARDER; | 970 | alloc_flags |= ALLOC_HARDER; |
970 | if (gfp_mask & __GFP_HIGH) | 971 | if (gfp_mask & __GFP_HIGH) |
971 | alloc_flags |= ALLOC_HIGH; | 972 | alloc_flags |= ALLOC_HIGH; |
972 | alloc_flags |= ALLOC_CPUSET; | 973 | if (wait) |
974 | alloc_flags |= ALLOC_CPUSET; | ||
973 | 975 | ||
974 | /* | 976 | /* |
975 | * Go through the zonelist again. Let __GFP_HIGH and allocations | 977 | * Go through the zonelist again. Let __GFP_HIGH and allocations |
@@ -2123,14 +2125,22 @@ static void __init alloc_node_mem_map(struct pglist_data *pgdat) | |||
2123 | #ifdef CONFIG_FLAT_NODE_MEM_MAP | 2125 | #ifdef CONFIG_FLAT_NODE_MEM_MAP |
2124 | /* ia64 gets its own node_mem_map, before this, without bootmem */ | 2126 | /* ia64 gets its own node_mem_map, before this, without bootmem */ |
2125 | if (!pgdat->node_mem_map) { | 2127 | if (!pgdat->node_mem_map) { |
2126 | unsigned long size; | 2128 | unsigned long size, start, end; |
2127 | struct page *map; | 2129 | struct page *map; |
2128 | 2130 | ||
2129 | size = (pgdat->node_spanned_pages + 1) * sizeof(struct page); | 2131 | /* |
2132 | * The zone's endpoints aren't required to be MAX_ORDER | ||
2133 | * aligned but the node_mem_map endpoints must be in order | ||
2134 | * for the buddy allocator to function correctly. | ||
2135 | */ | ||
2136 | start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); | ||
2137 | end = pgdat->node_start_pfn + pgdat->node_spanned_pages; | ||
2138 | end = ALIGN(end, MAX_ORDER_NR_PAGES); | ||
2139 | size = (end - start) * sizeof(struct page); | ||
2130 | map = alloc_remap(pgdat->node_id, size); | 2140 | map = alloc_remap(pgdat->node_id, size); |
2131 | if (!map) | 2141 | if (!map) |
2132 | map = alloc_bootmem_node(pgdat, size); | 2142 | map = alloc_bootmem_node(pgdat, size); |
2133 | pgdat->node_mem_map = map; | 2143 | pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); |
2134 | } | 2144 | } |
2135 | #ifdef CONFIG_FLATMEM | 2145 | #ifdef CONFIG_FLATMEM |
2136 | /* | 2146 | /* |
@@ -2566,9 +2576,11 @@ void setup_per_zone_pages_min(void) | |||
2566 | } | 2576 | } |
2567 | 2577 | ||
2568 | for_each_zone(zone) { | 2578 | for_each_zone(zone) { |
2569 | unsigned long tmp; | 2579 | u64 tmp; |
2580 | |||
2570 | spin_lock_irqsave(&zone->lru_lock, flags); | 2581 | spin_lock_irqsave(&zone->lru_lock, flags); |
2571 | tmp = (pages_min * zone->present_pages) / lowmem_pages; | 2582 | tmp = (u64)pages_min * zone->present_pages; |
2583 | do_div(tmp, lowmem_pages); | ||
2572 | if (is_highmem(zone)) { | 2584 | if (is_highmem(zone)) { |
2573 | /* | 2585 | /* |
2574 | * __GFP_HIGH and PF_MEMALLOC allocations usually don't | 2586 | * __GFP_HIGH and PF_MEMALLOC allocations usually don't |
@@ -2595,8 +2607,8 @@ void setup_per_zone_pages_min(void) | |||
2595 | zone->pages_min = tmp; | 2607 | zone->pages_min = tmp; |
2596 | } | 2608 | } |
2597 | 2609 | ||
2598 | zone->pages_low = zone->pages_min + tmp / 4; | 2610 | zone->pages_low = zone->pages_min + (tmp >> 2); |
2599 | zone->pages_high = zone->pages_min + tmp / 2; | 2611 | zone->pages_high = zone->pages_min + (tmp >> 1); |
2600 | spin_unlock_irqrestore(&zone->lru_lock, flags); | 2612 | spin_unlock_irqrestore(&zone->lru_lock, flags); |
2601 | } | 2613 | } |
2602 | 2614 | ||
@@ -700,6 +700,14 @@ static enum { | |||
700 | FULL | 700 | FULL |
701 | } g_cpucache_up; | 701 | } g_cpucache_up; |
702 | 702 | ||
703 | /* | ||
704 | * used by boot code to determine if it can use slab based allocator | ||
705 | */ | ||
706 | int slab_is_available(void) | ||
707 | { | ||
708 | return g_cpucache_up == FULL; | ||
709 | } | ||
710 | |||
703 | static DEFINE_PER_CPU(struct work_struct, reap_work); | 711 | static DEFINE_PER_CPU(struct work_struct, reap_work); |
704 | 712 | ||
705 | static void free_block(struct kmem_cache *cachep, void **objpp, int len, | 713 | static void free_block(struct kmem_cache *cachep, void **objpp, int len, |
@@ -2192,11 +2200,14 @@ static void drain_cpu_caches(struct kmem_cache *cachep) | |||
2192 | check_irq_on(); | 2200 | check_irq_on(); |
2193 | for_each_online_node(node) { | 2201 | for_each_online_node(node) { |
2194 | l3 = cachep->nodelists[node]; | 2202 | l3 = cachep->nodelists[node]; |
2195 | if (l3) { | 2203 | if (l3 && l3->alien) |
2204 | drain_alien_cache(cachep, l3->alien); | ||
2205 | } | ||
2206 | |||
2207 | for_each_online_node(node) { | ||
2208 | l3 = cachep->nodelists[node]; | ||
2209 | if (l3) | ||
2196 | drain_array(cachep, l3, l3->shared, 1, node); | 2210 | drain_array(cachep, l3, l3->shared, 1, node); |
2197 | if (l3->alien) | ||
2198 | drain_alien_cache(cachep, l3->alien); | ||
2199 | } | ||
2200 | } | 2211 | } |
2201 | } | 2212 | } |
2202 | 2213 | ||
diff --git a/mm/sparse.c b/mm/sparse.c index d7c32de99ee8..100040c0dfb6 100644 --- a/mm/sparse.c +++ b/mm/sparse.c | |||
@@ -32,7 +32,7 @@ static struct mem_section *sparse_index_alloc(int nid) | |||
32 | unsigned long array_size = SECTIONS_PER_ROOT * | 32 | unsigned long array_size = SECTIONS_PER_ROOT * |
33 | sizeof(struct mem_section); | 33 | sizeof(struct mem_section); |
34 | 34 | ||
35 | if (system_state == SYSTEM_RUNNING) | 35 | if (slab_is_available()) |
36 | section = kmalloc_node(array_size, GFP_KERNEL, nid); | 36 | section = kmalloc_node(array_size, GFP_KERNEL, nid); |
37 | else | 37 | else |
38 | section = alloc_bootmem_node(NODE_DATA(nid), array_size); | 38 | section = alloc_bootmem_node(NODE_DATA(nid), array_size); |
@@ -87,11 +87,8 @@ int __section_nr(struct mem_section* ms) | |||
87 | unsigned long root_nr; | 87 | unsigned long root_nr; |
88 | struct mem_section* root; | 88 | struct mem_section* root; |
89 | 89 | ||
90 | for (root_nr = 0; | 90 | for (root_nr = 0; root_nr < NR_SECTION_ROOTS; root_nr++) { |
91 | root_nr < NR_MEM_SECTIONS; | 91 | root = __nr_to_section(root_nr * SECTIONS_PER_ROOT); |
92 | root_nr += SECTIONS_PER_ROOT) { | ||
93 | root = __nr_to_section(root_nr); | ||
94 | |||
95 | if (!root) | 92 | if (!root) |
96 | continue; | 93 | continue; |
97 | 94 | ||
diff --git a/net/802/tr.c b/net/802/tr.c index afd8385c0c9c..e9dc803f2fe0 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -643,6 +643,5 @@ static int __init rif_init(void) | |||
643 | 643 | ||
644 | module_init(rif_init); | 644 | module_init(rif_init); |
645 | 645 | ||
646 | EXPORT_SYMBOL(tr_source_route); | ||
647 | EXPORT_SYMBOL(tr_type_trans); | 646 | EXPORT_SYMBOL(tr_type_trans); |
648 | EXPORT_SYMBOL(alloc_trdev); | 647 | EXPORT_SYMBOL(alloc_trdev); |
diff --git a/net/atm/clip.c b/net/atm/clip.c index 1a786bfaa416..72d852982664 100644 --- a/net/atm/clip.c +++ b/net/atm/clip.c | |||
@@ -963,7 +963,7 @@ static struct file_operations arp_seq_fops = { | |||
963 | static int __init atm_clip_init(void) | 963 | static int __init atm_clip_init(void) |
964 | { | 964 | { |
965 | struct proc_dir_entry *p; | 965 | struct proc_dir_entry *p; |
966 | neigh_table_init(&clip_tbl); | 966 | neigh_table_init_no_netlink(&clip_tbl); |
967 | 967 | ||
968 | clip_tbl_hook = &clip_tbl; | 968 | clip_tbl_hook = &clip_tbl; |
969 | register_atm_ioctl(&clip_ioctl_ops); | 969 | register_atm_ioctl(&clip_ioctl_ops); |
diff --git a/net/bridge/br.c b/net/bridge/br.c index 22d806cf40ca..12da21afb9ca 100644 --- a/net/bridge/br.c +++ b/net/bridge/br.c | |||
@@ -55,7 +55,7 @@ static int __init br_init(void) | |||
55 | 55 | ||
56 | static void __exit br_deinit(void) | 56 | static void __exit br_deinit(void) |
57 | { | 57 | { |
58 | llc_sap_close(br_stp_sap); | 58 | rcu_assign_pointer(br_stp_sap->rcv_func, NULL); |
59 | 59 | ||
60 | #ifdef CONFIG_BRIDGE_NETFILTER | 60 | #ifdef CONFIG_BRIDGE_NETFILTER |
61 | br_netfilter_fini(); | 61 | br_netfilter_fini(); |
@@ -67,6 +67,7 @@ static void __exit br_deinit(void) | |||
67 | 67 | ||
68 | synchronize_net(); | 68 | synchronize_net(); |
69 | 69 | ||
70 | llc_sap_put(br_stp_sap); | ||
70 | br_fdb_get_hook = NULL; | 71 | br_fdb_get_hook = NULL; |
71 | br_fdb_put_hook = NULL; | 72 | br_fdb_put_hook = NULL; |
72 | 73 | ||
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 59eef42d4a42..ad1c7af65ec8 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -308,26 +308,19 @@ int br_add_bridge(const char *name) | |||
308 | if (ret) | 308 | if (ret) |
309 | goto err2; | 309 | goto err2; |
310 | 310 | ||
311 | /* network device kobject is not setup until | ||
312 | * after rtnl_unlock does it's hotplug magic. | ||
313 | * so hold reference to avoid race. | ||
314 | */ | ||
315 | dev_hold(dev); | ||
316 | rtnl_unlock(); | ||
317 | |||
318 | ret = br_sysfs_addbr(dev); | 311 | ret = br_sysfs_addbr(dev); |
319 | dev_put(dev); | 312 | if (ret) |
320 | 313 | goto err3; | |
321 | if (ret) | 314 | rtnl_unlock(); |
322 | unregister_netdev(dev); | 315 | return 0; |
323 | out: | ||
324 | return ret; | ||
325 | 316 | ||
317 | err3: | ||
318 | unregister_netdev(dev); | ||
326 | err2: | 319 | err2: |
327 | free_netdev(dev); | 320 | free_netdev(dev); |
328 | err1: | 321 | err1: |
329 | rtnl_unlock(); | 322 | rtnl_unlock(); |
330 | goto out; | 323 | return ret; |
331 | } | 324 | } |
332 | 325 | ||
333 | int br_del_bridge(const char *name) | 326 | int br_del_bridge(const char *name) |
diff --git a/net/bridge/netfilter/ebt_log.c b/net/bridge/netfilter/ebt_log.c index d159c92cca84..466ed3440b74 100644 --- a/net/bridge/netfilter/ebt_log.c +++ b/net/bridge/netfilter/ebt_log.c | |||
@@ -168,7 +168,7 @@ static void ebt_log(const struct sk_buff *skb, unsigned int hooknr, | |||
168 | 168 | ||
169 | if (info->bitmask & EBT_LOG_NFLOG) | 169 | if (info->bitmask & EBT_LOG_NFLOG) |
170 | nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, | 170 | nf_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, |
171 | info->prefix); | 171 | "%s", info->prefix); |
172 | else | 172 | else |
173 | ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, | 173 | ebt_log_packet(PF_BRIDGE, hooknr, skb, in, out, &li, |
174 | info->prefix); | 174 | info->prefix); |
diff --git a/net/core/dev.c b/net/core/dev.c index 3bad1afc89fa..2dce673a039b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -193,7 +193,7 @@ static inline struct hlist_head *dev_index_hash(int ifindex) | |||
193 | * Our notifier list | 193 | * Our notifier list |
194 | */ | 194 | */ |
195 | 195 | ||
196 | static BLOCKING_NOTIFIER_HEAD(netdev_chain); | 196 | static RAW_NOTIFIER_HEAD(netdev_chain); |
197 | 197 | ||
198 | /* | 198 | /* |
199 | * Device drivers call our routines to queue packets here. We empty the | 199 | * Device drivers call our routines to queue packets here. We empty the |
@@ -736,7 +736,7 @@ int dev_change_name(struct net_device *dev, char *newname) | |||
736 | if (!err) { | 736 | if (!err) { |
737 | hlist_del(&dev->name_hlist); | 737 | hlist_del(&dev->name_hlist); |
738 | hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); | 738 | hlist_add_head(&dev->name_hlist, dev_name_hash(dev->name)); |
739 | blocking_notifier_call_chain(&netdev_chain, | 739 | raw_notifier_call_chain(&netdev_chain, |
740 | NETDEV_CHANGENAME, dev); | 740 | NETDEV_CHANGENAME, dev); |
741 | } | 741 | } |
742 | 742 | ||
@@ -751,7 +751,7 @@ int dev_change_name(struct net_device *dev, char *newname) | |||
751 | */ | 751 | */ |
752 | void netdev_features_change(struct net_device *dev) | 752 | void netdev_features_change(struct net_device *dev) |
753 | { | 753 | { |
754 | blocking_notifier_call_chain(&netdev_chain, NETDEV_FEAT_CHANGE, dev); | 754 | raw_notifier_call_chain(&netdev_chain, NETDEV_FEAT_CHANGE, dev); |
755 | } | 755 | } |
756 | EXPORT_SYMBOL(netdev_features_change); | 756 | EXPORT_SYMBOL(netdev_features_change); |
757 | 757 | ||
@@ -766,7 +766,7 @@ EXPORT_SYMBOL(netdev_features_change); | |||
766 | void netdev_state_change(struct net_device *dev) | 766 | void netdev_state_change(struct net_device *dev) |
767 | { | 767 | { |
768 | if (dev->flags & IFF_UP) { | 768 | if (dev->flags & IFF_UP) { |
769 | blocking_notifier_call_chain(&netdev_chain, | 769 | raw_notifier_call_chain(&netdev_chain, |
770 | NETDEV_CHANGE, dev); | 770 | NETDEV_CHANGE, dev); |
771 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0); | 771 | rtmsg_ifinfo(RTM_NEWLINK, dev, 0); |
772 | } | 772 | } |
@@ -864,7 +864,7 @@ int dev_open(struct net_device *dev) | |||
864 | /* | 864 | /* |
865 | * ... and announce new interface. | 865 | * ... and announce new interface. |
866 | */ | 866 | */ |
867 | blocking_notifier_call_chain(&netdev_chain, NETDEV_UP, dev); | 867 | raw_notifier_call_chain(&netdev_chain, NETDEV_UP, dev); |
868 | } | 868 | } |
869 | return ret; | 869 | return ret; |
870 | } | 870 | } |
@@ -887,7 +887,7 @@ int dev_close(struct net_device *dev) | |||
887 | * Tell people we are going down, so that they can | 887 | * Tell people we are going down, so that they can |
888 | * prepare to death, when device is still operating. | 888 | * prepare to death, when device is still operating. |
889 | */ | 889 | */ |
890 | blocking_notifier_call_chain(&netdev_chain, NETDEV_GOING_DOWN, dev); | 890 | raw_notifier_call_chain(&netdev_chain, NETDEV_GOING_DOWN, dev); |
891 | 891 | ||
892 | dev_deactivate(dev); | 892 | dev_deactivate(dev); |
893 | 893 | ||
@@ -924,7 +924,7 @@ int dev_close(struct net_device *dev) | |||
924 | /* | 924 | /* |
925 | * Tell people we are down | 925 | * Tell people we are down |
926 | */ | 926 | */ |
927 | blocking_notifier_call_chain(&netdev_chain, NETDEV_DOWN, dev); | 927 | raw_notifier_call_chain(&netdev_chain, NETDEV_DOWN, dev); |
928 | 928 | ||
929 | return 0; | 929 | return 0; |
930 | } | 930 | } |
@@ -955,7 +955,7 @@ int register_netdevice_notifier(struct notifier_block *nb) | |||
955 | int err; | 955 | int err; |
956 | 956 | ||
957 | rtnl_lock(); | 957 | rtnl_lock(); |
958 | err = blocking_notifier_chain_register(&netdev_chain, nb); | 958 | err = raw_notifier_chain_register(&netdev_chain, nb); |
959 | if (!err) { | 959 | if (!err) { |
960 | for (dev = dev_base; dev; dev = dev->next) { | 960 | for (dev = dev_base; dev; dev = dev->next) { |
961 | nb->notifier_call(nb, NETDEV_REGISTER, dev); | 961 | nb->notifier_call(nb, NETDEV_REGISTER, dev); |
@@ -983,7 +983,7 @@ int unregister_netdevice_notifier(struct notifier_block *nb) | |||
983 | int err; | 983 | int err; |
984 | 984 | ||
985 | rtnl_lock(); | 985 | rtnl_lock(); |
986 | err = blocking_notifier_chain_unregister(&netdev_chain, nb); | 986 | err = raw_notifier_chain_unregister(&netdev_chain, nb); |
987 | rtnl_unlock(); | 987 | rtnl_unlock(); |
988 | return err; | 988 | return err; |
989 | } | 989 | } |
@@ -994,12 +994,12 @@ int unregister_netdevice_notifier(struct notifier_block *nb) | |||
994 | * @v: pointer passed unmodified to notifier function | 994 | * @v: pointer passed unmodified to notifier function |
995 | * | 995 | * |
996 | * Call all network notifier blocks. Parameters and return value | 996 | * Call all network notifier blocks. Parameters and return value |
997 | * are as for blocking_notifier_call_chain(). | 997 | * are as for raw_notifier_call_chain(). |
998 | */ | 998 | */ |
999 | 999 | ||
1000 | int call_netdevice_notifiers(unsigned long val, void *v) | 1000 | int call_netdevice_notifiers(unsigned long val, void *v) |
1001 | { | 1001 | { |
1002 | return blocking_notifier_call_chain(&netdev_chain, val, v); | 1002 | return raw_notifier_call_chain(&netdev_chain, val, v); |
1003 | } | 1003 | } |
1004 | 1004 | ||
1005 | /* When > 0 there are consumers of rx skb time stamps */ | 1005 | /* When > 0 there are consumers of rx skb time stamps */ |
@@ -2308,7 +2308,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags) | |||
2308 | if (dev->flags & IFF_UP && | 2308 | if (dev->flags & IFF_UP && |
2309 | ((old_flags ^ dev->flags) &~ (IFF_UP | IFF_PROMISC | IFF_ALLMULTI | | 2309 | ((old_flags ^ dev->flags) &~ (IFF_UP | IFF_PROMISC | IFF_ALLMULTI | |
2310 | IFF_VOLATILE))) | 2310 | IFF_VOLATILE))) |
2311 | blocking_notifier_call_chain(&netdev_chain, | 2311 | raw_notifier_call_chain(&netdev_chain, |
2312 | NETDEV_CHANGE, dev); | 2312 | NETDEV_CHANGE, dev); |
2313 | 2313 | ||
2314 | if ((flags ^ dev->gflags) & IFF_PROMISC) { | 2314 | if ((flags ^ dev->gflags) & IFF_PROMISC) { |
@@ -2353,7 +2353,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu) | |||
2353 | else | 2353 | else |
2354 | dev->mtu = new_mtu; | 2354 | dev->mtu = new_mtu; |
2355 | if (!err && dev->flags & IFF_UP) | 2355 | if (!err && dev->flags & IFF_UP) |
2356 | blocking_notifier_call_chain(&netdev_chain, | 2356 | raw_notifier_call_chain(&netdev_chain, |
2357 | NETDEV_CHANGEMTU, dev); | 2357 | NETDEV_CHANGEMTU, dev); |
2358 | return err; | 2358 | return err; |
2359 | } | 2359 | } |
@@ -2370,7 +2370,7 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa) | |||
2370 | return -ENODEV; | 2370 | return -ENODEV; |
2371 | err = dev->set_mac_address(dev, sa); | 2371 | err = dev->set_mac_address(dev, sa); |
2372 | if (!err) | 2372 | if (!err) |
2373 | blocking_notifier_call_chain(&netdev_chain, | 2373 | raw_notifier_call_chain(&netdev_chain, |
2374 | NETDEV_CHANGEADDR, dev); | 2374 | NETDEV_CHANGEADDR, dev); |
2375 | return err; | 2375 | return err; |
2376 | } | 2376 | } |
@@ -2427,7 +2427,7 @@ static int dev_ifsioc(struct ifreq *ifr, unsigned int cmd) | |||
2427 | return -EINVAL; | 2427 | return -EINVAL; |
2428 | memcpy(dev->broadcast, ifr->ifr_hwaddr.sa_data, | 2428 | memcpy(dev->broadcast, ifr->ifr_hwaddr.sa_data, |
2429 | min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); | 2429 | min(sizeof ifr->ifr_hwaddr.sa_data, (size_t) dev->addr_len)); |
2430 | blocking_notifier_call_chain(&netdev_chain, | 2430 | raw_notifier_call_chain(&netdev_chain, |
2431 | NETDEV_CHANGEADDR, dev); | 2431 | NETDEV_CHANGEADDR, dev); |
2432 | return 0; | 2432 | return 0; |
2433 | 2433 | ||
@@ -2777,6 +2777,8 @@ int register_netdevice(struct net_device *dev) | |||
2777 | BUG_ON(dev_boot_phase); | 2777 | BUG_ON(dev_boot_phase); |
2778 | ASSERT_RTNL(); | 2778 | ASSERT_RTNL(); |
2779 | 2779 | ||
2780 | might_sleep(); | ||
2781 | |||
2780 | /* When net_device's are persistent, this will be fatal. */ | 2782 | /* When net_device's are persistent, this will be fatal. */ |
2781 | BUG_ON(dev->reg_state != NETREG_UNINITIALIZED); | 2783 | BUG_ON(dev->reg_state != NETREG_UNINITIALIZED); |
2782 | 2784 | ||
@@ -2863,6 +2865,11 @@ int register_netdevice(struct net_device *dev) | |||
2863 | if (!dev->rebuild_header) | 2865 | if (!dev->rebuild_header) |
2864 | dev->rebuild_header = default_rebuild_header; | 2866 | dev->rebuild_header = default_rebuild_header; |
2865 | 2867 | ||
2868 | ret = netdev_register_sysfs(dev); | ||
2869 | if (ret) | ||
2870 | goto out_err; | ||
2871 | dev->reg_state = NETREG_REGISTERED; | ||
2872 | |||
2866 | /* | 2873 | /* |
2867 | * Default initial state at registry is that the | 2874 | * Default initial state at registry is that the |
2868 | * device is present. | 2875 | * device is present. |
@@ -2878,14 +2885,11 @@ int register_netdevice(struct net_device *dev) | |||
2878 | hlist_add_head(&dev->name_hlist, head); | 2885 | hlist_add_head(&dev->name_hlist, head); |
2879 | hlist_add_head(&dev->index_hlist, dev_index_hash(dev->ifindex)); | 2886 | hlist_add_head(&dev->index_hlist, dev_index_hash(dev->ifindex)); |
2880 | dev_hold(dev); | 2887 | dev_hold(dev); |
2881 | dev->reg_state = NETREG_REGISTERING; | ||
2882 | write_unlock_bh(&dev_base_lock); | 2888 | write_unlock_bh(&dev_base_lock); |
2883 | 2889 | ||
2884 | /* Notify protocols, that a new device appeared. */ | 2890 | /* Notify protocols, that a new device appeared. */ |
2885 | blocking_notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev); | 2891 | raw_notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev); |
2886 | 2892 | ||
2887 | /* Finish registration after unlock */ | ||
2888 | net_set_todo(dev); | ||
2889 | ret = 0; | 2893 | ret = 0; |
2890 | 2894 | ||
2891 | out: | 2895 | out: |
@@ -2961,7 +2965,7 @@ static void netdev_wait_allrefs(struct net_device *dev) | |||
2961 | rtnl_lock(); | 2965 | rtnl_lock(); |
2962 | 2966 | ||
2963 | /* Rebroadcast unregister notification */ | 2967 | /* Rebroadcast unregister notification */ |
2964 | blocking_notifier_call_chain(&netdev_chain, | 2968 | raw_notifier_call_chain(&netdev_chain, |
2965 | NETDEV_UNREGISTER, dev); | 2969 | NETDEV_UNREGISTER, dev); |
2966 | 2970 | ||
2967 | if (test_bit(__LINK_STATE_LINKWATCH_PENDING, | 2971 | if (test_bit(__LINK_STATE_LINKWATCH_PENDING, |
@@ -3008,7 +3012,7 @@ static void netdev_wait_allrefs(struct net_device *dev) | |||
3008 | * | 3012 | * |
3009 | * We are invoked by rtnl_unlock() after it drops the semaphore. | 3013 | * We are invoked by rtnl_unlock() after it drops the semaphore. |
3010 | * This allows us to deal with problems: | 3014 | * This allows us to deal with problems: |
3011 | * 1) We can create/delete sysfs objects which invoke hotplug | 3015 | * 1) We can delete sysfs objects which invoke hotplug |
3012 | * without deadlocking with linkwatch via keventd. | 3016 | * without deadlocking with linkwatch via keventd. |
3013 | * 2) Since we run with the RTNL semaphore not held, we can sleep | 3017 | * 2) Since we run with the RTNL semaphore not held, we can sleep |
3014 | * safely in order to wait for the netdev refcnt to drop to zero. | 3018 | * safely in order to wait for the netdev refcnt to drop to zero. |
@@ -3017,8 +3021,6 @@ static DEFINE_MUTEX(net_todo_run_mutex); | |||
3017 | void netdev_run_todo(void) | 3021 | void netdev_run_todo(void) |
3018 | { | 3022 | { |
3019 | struct list_head list = LIST_HEAD_INIT(list); | 3023 | struct list_head list = LIST_HEAD_INIT(list); |
3020 | int err; | ||
3021 | |||
3022 | 3024 | ||
3023 | /* Need to guard against multiple cpu's getting out of order. */ | 3025 | /* Need to guard against multiple cpu's getting out of order. */ |
3024 | mutex_lock(&net_todo_run_mutex); | 3026 | mutex_lock(&net_todo_run_mutex); |
@@ -3041,40 +3043,29 @@ void netdev_run_todo(void) | |||
3041 | = list_entry(list.next, struct net_device, todo_list); | 3043 | = list_entry(list.next, struct net_device, todo_list); |
3042 | list_del(&dev->todo_list); | 3044 | list_del(&dev->todo_list); |
3043 | 3045 | ||
3044 | switch(dev->reg_state) { | 3046 | if (unlikely(dev->reg_state != NETREG_UNREGISTERING)) { |
3045 | case NETREG_REGISTERING: | 3047 | printk(KERN_ERR "network todo '%s' but state %d\n", |
3046 | dev->reg_state = NETREG_REGISTERED; | 3048 | dev->name, dev->reg_state); |
3047 | err = netdev_register_sysfs(dev); | 3049 | dump_stack(); |
3048 | if (err) | 3050 | continue; |
3049 | printk(KERN_ERR "%s: failed sysfs registration (%d)\n", | 3051 | } |
3050 | dev->name, err); | ||
3051 | break; | ||
3052 | |||
3053 | case NETREG_UNREGISTERING: | ||
3054 | netdev_unregister_sysfs(dev); | ||
3055 | dev->reg_state = NETREG_UNREGISTERED; | ||
3056 | |||
3057 | netdev_wait_allrefs(dev); | ||
3058 | 3052 | ||
3059 | /* paranoia */ | 3053 | netdev_unregister_sysfs(dev); |
3060 | BUG_ON(atomic_read(&dev->refcnt)); | 3054 | dev->reg_state = NETREG_UNREGISTERED; |
3061 | BUG_TRAP(!dev->ip_ptr); | ||
3062 | BUG_TRAP(!dev->ip6_ptr); | ||
3063 | BUG_TRAP(!dev->dn_ptr); | ||
3064 | 3055 | ||
3056 | netdev_wait_allrefs(dev); | ||
3065 | 3057 | ||
3066 | /* It must be the very last action, | 3058 | /* paranoia */ |
3067 | * after this 'dev' may point to freed up memory. | 3059 | BUG_ON(atomic_read(&dev->refcnt)); |
3068 | */ | 3060 | BUG_TRAP(!dev->ip_ptr); |
3069 | if (dev->destructor) | 3061 | BUG_TRAP(!dev->ip6_ptr); |
3070 | dev->destructor(dev); | 3062 | BUG_TRAP(!dev->dn_ptr); |
3071 | break; | ||
3072 | 3063 | ||
3073 | default: | 3064 | /* It must be the very last action, |
3074 | printk(KERN_ERR "network todo '%s' but state %d\n", | 3065 | * after this 'dev' may point to freed up memory. |
3075 | dev->name, dev->reg_state); | 3066 | */ |
3076 | break; | 3067 | if (dev->destructor) |
3077 | } | 3068 | dev->destructor(dev); |
3078 | } | 3069 | } |
3079 | 3070 | ||
3080 | out: | 3071 | out: |
@@ -3216,7 +3207,7 @@ int unregister_netdevice(struct net_device *dev) | |||
3216 | /* Notify protocols, that we are about to destroy | 3207 | /* Notify protocols, that we are about to destroy |
3217 | this device. They should clean all the things. | 3208 | this device. They should clean all the things. |
3218 | */ | 3209 | */ |
3219 | blocking_notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); | 3210 | raw_notifier_call_chain(&netdev_chain, NETDEV_UNREGISTER, dev); |
3220 | 3211 | ||
3221 | /* | 3212 | /* |
3222 | * Flush the multicast chain | 3213 | * Flush the multicast chain |
diff --git a/net/core/link_watch.c b/net/core/link_watch.c index 341de44c7ed1..646937cc2d84 100644 --- a/net/core/link_watch.c +++ b/net/core/link_watch.c | |||
@@ -170,13 +170,13 @@ void linkwatch_fire_event(struct net_device *dev) | |||
170 | spin_unlock_irqrestore(&lweventlist_lock, flags); | 170 | spin_unlock_irqrestore(&lweventlist_lock, flags); |
171 | 171 | ||
172 | if (!test_and_set_bit(LW_RUNNING, &linkwatch_flags)) { | 172 | if (!test_and_set_bit(LW_RUNNING, &linkwatch_flags)) { |
173 | unsigned long thisevent = jiffies; | 173 | unsigned long delay = linkwatch_nextevent - jiffies; |
174 | 174 | ||
175 | if (thisevent >= linkwatch_nextevent) { | 175 | /* If we wrap around we'll delay it by at most HZ. */ |
176 | if (!delay || delay > HZ) | ||
176 | schedule_work(&linkwatch_work); | 177 | schedule_work(&linkwatch_work); |
177 | } else { | 178 | else |
178 | schedule_delayed_work(&linkwatch_work, linkwatch_nextevent - thisevent); | 179 | schedule_delayed_work(&linkwatch_work, delay); |
179 | } | ||
180 | } | 180 | } |
181 | } | 181 | } |
182 | } | 182 | } |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 4cf878efdb49..50a8c73caf97 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -1326,8 +1326,7 @@ void neigh_parms_destroy(struct neigh_parms *parms) | |||
1326 | kfree(parms); | 1326 | kfree(parms); |
1327 | } | 1327 | } |
1328 | 1328 | ||
1329 | 1329 | void neigh_table_init_no_netlink(struct neigh_table *tbl) | |
1330 | void neigh_table_init(struct neigh_table *tbl) | ||
1331 | { | 1330 | { |
1332 | unsigned long now = jiffies; | 1331 | unsigned long now = jiffies; |
1333 | unsigned long phsize; | 1332 | unsigned long phsize; |
@@ -1383,10 +1382,27 @@ void neigh_table_init(struct neigh_table *tbl) | |||
1383 | 1382 | ||
1384 | tbl->last_flush = now; | 1383 | tbl->last_flush = now; |
1385 | tbl->last_rand = now + tbl->parms.reachable_time * 20; | 1384 | tbl->last_rand = now + tbl->parms.reachable_time * 20; |
1385 | } | ||
1386 | |||
1387 | void neigh_table_init(struct neigh_table *tbl) | ||
1388 | { | ||
1389 | struct neigh_table *tmp; | ||
1390 | |||
1391 | neigh_table_init_no_netlink(tbl); | ||
1386 | write_lock(&neigh_tbl_lock); | 1392 | write_lock(&neigh_tbl_lock); |
1393 | for (tmp = neigh_tables; tmp; tmp = tmp->next) { | ||
1394 | if (tmp->family == tbl->family) | ||
1395 | break; | ||
1396 | } | ||
1387 | tbl->next = neigh_tables; | 1397 | tbl->next = neigh_tables; |
1388 | neigh_tables = tbl; | 1398 | neigh_tables = tbl; |
1389 | write_unlock(&neigh_tbl_lock); | 1399 | write_unlock(&neigh_tbl_lock); |
1400 | |||
1401 | if (unlikely(tmp)) { | ||
1402 | printk(KERN_ERR "NEIGH: Registering multiple tables for " | ||
1403 | "family %d\n", tbl->family); | ||
1404 | dump_stack(); | ||
1405 | } | ||
1390 | } | 1406 | } |
1391 | 1407 | ||
1392 | int neigh_table_clear(struct neigh_table *tbl) | 1408 | int neigh_table_clear(struct neigh_table *tbl) |
@@ -2657,6 +2673,7 @@ EXPORT_SYMBOL(neigh_rand_reach_time); | |||
2657 | EXPORT_SYMBOL(neigh_resolve_output); | 2673 | EXPORT_SYMBOL(neigh_resolve_output); |
2658 | EXPORT_SYMBOL(neigh_table_clear); | 2674 | EXPORT_SYMBOL(neigh_table_clear); |
2659 | EXPORT_SYMBOL(neigh_table_init); | 2675 | EXPORT_SYMBOL(neigh_table_init); |
2676 | EXPORT_SYMBOL(neigh_table_init_no_netlink); | ||
2660 | EXPORT_SYMBOL(neigh_update); | 2677 | EXPORT_SYMBOL(neigh_update); |
2661 | EXPORT_SYMBOL(neigh_update_hhs); | 2678 | EXPORT_SYMBOL(neigh_update_hhs); |
2662 | EXPORT_SYMBOL(pneigh_enqueue); | 2679 | EXPORT_SYMBOL(pneigh_enqueue); |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index c12990c9c603..47a6fceb6771 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -29,7 +29,7 @@ static const char fmt_ulong[] = "%lu\n"; | |||
29 | 29 | ||
30 | static inline int dev_isalive(const struct net_device *dev) | 30 | static inline int dev_isalive(const struct net_device *dev) |
31 | { | 31 | { |
32 | return dev->reg_state == NETREG_REGISTERED; | 32 | return dev->reg_state <= NETREG_REGISTERED; |
33 | } | 33 | } |
34 | 34 | ||
35 | /* use same locking rules as GIF* ioctl's */ | 35 | /* use same locking rules as GIF* ioctl's */ |
@@ -445,58 +445,33 @@ static struct class net_class = { | |||
445 | 445 | ||
446 | void netdev_unregister_sysfs(struct net_device * net) | 446 | void netdev_unregister_sysfs(struct net_device * net) |
447 | { | 447 | { |
448 | struct class_device * class_dev = &(net->class_dev); | 448 | class_device_del(&(net->class_dev)); |
449 | |||
450 | if (net->get_stats) | ||
451 | sysfs_remove_group(&class_dev->kobj, &netstat_group); | ||
452 | |||
453 | #ifdef WIRELESS_EXT | ||
454 | if (net->get_wireless_stats || (net->wireless_handlers && | ||
455 | net->wireless_handlers->get_wireless_stats)) | ||
456 | sysfs_remove_group(&class_dev->kobj, &wireless_group); | ||
457 | #endif | ||
458 | class_device_del(class_dev); | ||
459 | |||
460 | } | 449 | } |
461 | 450 | ||
462 | /* Create sysfs entries for network device. */ | 451 | /* Create sysfs entries for network device. */ |
463 | int netdev_register_sysfs(struct net_device *net) | 452 | int netdev_register_sysfs(struct net_device *net) |
464 | { | 453 | { |
465 | struct class_device *class_dev = &(net->class_dev); | 454 | struct class_device *class_dev = &(net->class_dev); |
466 | int ret; | 455 | struct attribute_group **groups = net->sysfs_groups; |
467 | 456 | ||
457 | class_device_initialize(class_dev); | ||
468 | class_dev->class = &net_class; | 458 | class_dev->class = &net_class; |
469 | class_dev->class_data = net; | 459 | class_dev->class_data = net; |
460 | class_dev->groups = groups; | ||
470 | 461 | ||
462 | BUILD_BUG_ON(BUS_ID_SIZE < IFNAMSIZ); | ||
471 | strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE); | 463 | strlcpy(class_dev->class_id, net->name, BUS_ID_SIZE); |
472 | if ((ret = class_device_register(class_dev))) | ||
473 | goto out; | ||
474 | 464 | ||
475 | if (net->get_stats && | 465 | if (net->get_stats) |
476 | (ret = sysfs_create_group(&class_dev->kobj, &netstat_group))) | 466 | *groups++ = &netstat_group; |
477 | goto out_unreg; | ||
478 | 467 | ||
479 | #ifdef WIRELESS_EXT | 468 | #ifdef WIRELESS_EXT |
480 | if (net->get_wireless_stats || (net->wireless_handlers && | 469 | if (net->get_wireless_stats |
481 | net->wireless_handlers->get_wireless_stats)) { | 470 | || (net->wireless_handlers && net->wireless_handlers->get_wireless_stats)) |
482 | ret = sysfs_create_group(&class_dev->kobj, &wireless_group); | 471 | *groups++ = &wireless_group; |
483 | if (ret) | ||
484 | goto out_cleanup; | ||
485 | } | ||
486 | return 0; | ||
487 | out_cleanup: | ||
488 | if (net->get_stats) | ||
489 | sysfs_remove_group(&class_dev->kobj, &netstat_group); | ||
490 | #else | ||
491 | return 0; | ||
492 | #endif | 472 | #endif |
493 | 473 | ||
494 | out_unreg: | 474 | return class_device_add(class_dev); |
495 | printk(KERN_WARNING "%s: sysfs attribute registration failed %d\n", | ||
496 | net->name, ret); | ||
497 | class_device_unregister(class_dev); | ||
498 | out: | ||
499 | return ret; | ||
500 | } | 475 | } |
501 | 476 | ||
502 | int netdev_sysfs_init(void) | 477 | int netdev_sysfs_init(void) |
diff --git a/net/ieee80211/softmac/ieee80211softmac_assoc.c b/net/ieee80211/softmac/ieee80211softmac_assoc.c index fb79ce7d6439..57ea9f6f465c 100644 --- a/net/ieee80211/softmac/ieee80211softmac_assoc.c +++ b/net/ieee80211/softmac/ieee80211softmac_assoc.c | |||
@@ -51,11 +51,12 @@ ieee80211softmac_assoc(struct ieee80211softmac_device *mac, struct ieee80211soft | |||
51 | spin_lock_irqsave(&mac->lock, flags); | 51 | spin_lock_irqsave(&mac->lock, flags); |
52 | mac->associnfo.associating = 1; | 52 | mac->associnfo.associating = 1; |
53 | mac->associated = 0; /* just to make sure */ | 53 | mac->associated = 0; /* just to make sure */ |
54 | spin_unlock_irqrestore(&mac->lock, flags); | ||
55 | 54 | ||
56 | /* Set a timer for timeout */ | 55 | /* Set a timer for timeout */ |
57 | /* FIXME: make timeout configurable */ | 56 | /* FIXME: make timeout configurable */ |
58 | schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ); | 57 | if (likely(mac->running)) |
58 | schedule_delayed_work(&mac->associnfo.timeout, 5 * HZ); | ||
59 | spin_unlock_irqrestore(&mac->lock, flags); | ||
59 | } | 60 | } |
60 | 61 | ||
61 | void | 62 | void |
@@ -319,6 +320,9 @@ ieee80211softmac_handle_assoc_response(struct net_device * dev, | |||
319 | u16 status = le16_to_cpup(&resp->status); | 320 | u16 status = le16_to_cpup(&resp->status); |
320 | struct ieee80211softmac_network *network = NULL; | 321 | struct ieee80211softmac_network *network = NULL; |
321 | unsigned long flags; | 322 | unsigned long flags; |
323 | |||
324 | if (unlikely(!mac->running)) | ||
325 | return -ENODEV; | ||
322 | 326 | ||
323 | spin_lock_irqsave(&mac->lock, flags); | 327 | spin_lock_irqsave(&mac->lock, flags); |
324 | 328 | ||
@@ -377,10 +381,16 @@ ieee80211softmac_handle_disassoc(struct net_device * dev, | |||
377 | { | 381 | { |
378 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 382 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
379 | unsigned long flags; | 383 | unsigned long flags; |
384 | |||
385 | if (unlikely(!mac->running)) | ||
386 | return -ENODEV; | ||
387 | |||
380 | if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN)) | 388 | if (memcmp(disassoc->header.addr2, mac->associnfo.bssid, ETH_ALEN)) |
381 | return 0; | 389 | return 0; |
390 | |||
382 | if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN)) | 391 | if (memcmp(disassoc->header.addr1, mac->dev->dev_addr, ETH_ALEN)) |
383 | return 0; | 392 | return 0; |
393 | |||
384 | dprintk(KERN_INFO PFX "got disassoc frame\n"); | 394 | dprintk(KERN_INFO PFX "got disassoc frame\n"); |
385 | netif_carrier_off(dev); | 395 | netif_carrier_off(dev); |
386 | spin_lock_irqsave(&mac->lock, flags); | 396 | spin_lock_irqsave(&mac->lock, flags); |
@@ -400,6 +410,9 @@ ieee80211softmac_handle_reassoc_req(struct net_device * dev, | |||
400 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 410 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
401 | struct ieee80211softmac_network *network; | 411 | struct ieee80211softmac_network *network; |
402 | 412 | ||
413 | if (unlikely(!mac->running)) | ||
414 | return -ENODEV; | ||
415 | |||
403 | network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3); | 416 | network = ieee80211softmac_get_network_by_bssid(mac, resp->header.addr3); |
404 | if (!network) { | 417 | if (!network) { |
405 | dprintkl(KERN_INFO PFX "reassoc request from unknown network\n"); | 418 | dprintkl(KERN_INFO PFX "reassoc request from unknown network\n"); |
diff --git a/net/ieee80211/softmac/ieee80211softmac_auth.c b/net/ieee80211/softmac/ieee80211softmac_auth.c index 9a0eac6c61eb..06e332624665 100644 --- a/net/ieee80211/softmac/ieee80211softmac_auth.c +++ b/net/ieee80211/softmac/ieee80211softmac_auth.c | |||
@@ -86,6 +86,11 @@ ieee80211softmac_auth_queue(void *data) | |||
86 | 86 | ||
87 | /* Lock and set flags */ | 87 | /* Lock and set flags */ |
88 | spin_lock_irqsave(&mac->lock, flags); | 88 | spin_lock_irqsave(&mac->lock, flags); |
89 | if (unlikely(!mac->running)) { | ||
90 | /* Prevent reschedule on workqueue flush */ | ||
91 | spin_unlock_irqrestore(&mac->lock, flags); | ||
92 | return; | ||
93 | } | ||
89 | net->authenticated = 0; | 94 | net->authenticated = 0; |
90 | net->authenticating = 1; | 95 | net->authenticating = 1; |
91 | /* add a timeout call so we eventually give up waiting for an auth reply */ | 96 | /* add a timeout call so we eventually give up waiting for an auth reply */ |
@@ -124,6 +129,9 @@ ieee80211softmac_auth_resp(struct net_device *dev, struct ieee80211_auth *auth) | |||
124 | unsigned long flags; | 129 | unsigned long flags; |
125 | u8 * data; | 130 | u8 * data; |
126 | 131 | ||
132 | if (unlikely(!mac->running)) | ||
133 | return -ENODEV; | ||
134 | |||
127 | /* Find correct auth queue item */ | 135 | /* Find correct auth queue item */ |
128 | spin_lock_irqsave(&mac->lock, flags); | 136 | spin_lock_irqsave(&mac->lock, flags); |
129 | list_for_each(list_ptr, &mac->auth_queue) { | 137 | list_for_each(list_ptr, &mac->auth_queue) { |
@@ -298,8 +306,6 @@ ieee80211softmac_deauth_from_net(struct ieee80211softmac_device *mac, | |||
298 | 306 | ||
299 | /* can't transmit data right now... */ | 307 | /* can't transmit data right now... */ |
300 | netif_carrier_off(mac->dev); | 308 | netif_carrier_off(mac->dev); |
301 | /* let's try to re-associate */ | ||
302 | schedule_work(&mac->associnfo.work); | ||
303 | spin_unlock_irqrestore(&mac->lock, flags); | 309 | spin_unlock_irqrestore(&mac->lock, flags); |
304 | } | 310 | } |
305 | 311 | ||
@@ -338,6 +344,9 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de | |||
338 | struct ieee80211softmac_network *net = NULL; | 344 | struct ieee80211softmac_network *net = NULL; |
339 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); | 345 | struct ieee80211softmac_device *mac = ieee80211_priv(dev); |
340 | 346 | ||
347 | if (unlikely(!mac->running)) | ||
348 | return -ENODEV; | ||
349 | |||
341 | if (!deauth) { | 350 | if (!deauth) { |
342 | dprintk("deauth without deauth packet. eek!\n"); | 351 | dprintk("deauth without deauth packet. eek!\n"); |
343 | return 0; | 352 | return 0; |
@@ -360,5 +369,8 @@ ieee80211softmac_deauth_resp(struct net_device *dev, struct ieee80211_deauth *de | |||
360 | } | 369 | } |
361 | 370 | ||
362 | ieee80211softmac_deauth_from_net(mac, net); | 371 | ieee80211softmac_deauth_from_net(mac, net); |
372 | |||
373 | /* let's try to re-associate */ | ||
374 | schedule_work(&mac->associnfo.work); | ||
363 | return 0; | 375 | return 0; |
364 | } | 376 | } |
diff --git a/net/ieee80211/softmac/ieee80211softmac_module.c b/net/ieee80211/softmac/ieee80211softmac_module.c index be83bdc1644a..6252be2c0db9 100644 --- a/net/ieee80211/softmac/ieee80211softmac_module.c +++ b/net/ieee80211/softmac/ieee80211softmac_module.c | |||
@@ -89,6 +89,8 @@ ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm) | |||
89 | ieee80211softmac_wait_for_scan(sm); | 89 | ieee80211softmac_wait_for_scan(sm); |
90 | 90 | ||
91 | spin_lock_irqsave(&sm->lock, flags); | 91 | spin_lock_irqsave(&sm->lock, flags); |
92 | sm->running = 0; | ||
93 | |||
92 | /* Free all pending assoc work items */ | 94 | /* Free all pending assoc work items */ |
93 | cancel_delayed_work(&sm->associnfo.work); | 95 | cancel_delayed_work(&sm->associnfo.work); |
94 | 96 | ||
@@ -204,6 +206,8 @@ void ieee80211softmac_start(struct net_device *dev) | |||
204 | assert(0); | 206 | assert(0); |
205 | if (mac->txrates_change) | 207 | if (mac->txrates_change) |
206 | mac->txrates_change(dev, change, &oldrates); | 208 | mac->txrates_change(dev, change, &oldrates); |
209 | |||
210 | mac->running = 1; | ||
207 | } | 211 | } |
208 | EXPORT_SYMBOL_GPL(ieee80211softmac_start); | 212 | EXPORT_SYMBOL_GPL(ieee80211softmac_start); |
209 | 213 | ||
diff --git a/net/ieee80211/softmac/ieee80211softmac_scan.c b/net/ieee80211/softmac/ieee80211softmac_scan.c index 2b9e7edfa3ce..d31cf77498c4 100644 --- a/net/ieee80211/softmac/ieee80211softmac_scan.c +++ b/net/ieee80211/softmac/ieee80211softmac_scan.c | |||
@@ -115,7 +115,15 @@ void ieee80211softmac_scan(void *d) | |||
115 | // TODO: is this if correct, or should we do this only if scanning from assoc request? | 115 | // TODO: is this if correct, or should we do this only if scanning from assoc request? |
116 | if (sm->associnfo.req_essid.len) | 116 | if (sm->associnfo.req_essid.len) |
117 | ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0); | 117 | ieee80211softmac_send_mgt_frame(sm, &sm->associnfo.req_essid, IEEE80211_STYPE_PROBE_REQ, 0); |
118 | |||
119 | spin_lock_irqsave(&sm->lock, flags); | ||
120 | if (unlikely(!sm->running)) { | ||
121 | /* Prevent reschedule on workqueue flush */ | ||
122 | spin_unlock_irqrestore(&sm->lock, flags); | ||
123 | break; | ||
124 | } | ||
118 | schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY); | 125 | schedule_delayed_work(&si->softmac_scan, IEEE80211SOFTMAC_PROBE_DELAY); |
126 | spin_unlock_irqrestore(&sm->lock, flags); | ||
119 | return; | 127 | return; |
120 | } else { | 128 | } else { |
121 | dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel); | 129 | dprintk(PFX "Not probing Channel %d (not allowed here)\n", si->channels[current_channel_idx].channel); |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index 18d7fad474d7..c9026dbf4c93 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -337,7 +337,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb) | |||
337 | * Initialise the virtual path cache for the packet. It describes | 337 | * Initialise the virtual path cache for the packet. It describes |
338 | * how the packet travels inside Linux networking. | 338 | * how the packet travels inside Linux networking. |
339 | */ | 339 | */ |
340 | if (likely(skb->dst == NULL)) { | 340 | if (skb->dst == NULL) { |
341 | int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, | 341 | int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, |
342 | skb->dev); | 342 | skb->dev); |
343 | if (unlikely(err)) { | 343 | if (unlikely(err)) { |
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c index 9bebad07bf2e..cbcae6544622 100644 --- a/net/ipv4/ip_options.c +++ b/net/ipv4/ip_options.c | |||
@@ -209,7 +209,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb) | |||
209 | 209 | ||
210 | void ip_options_fragment(struct sk_buff * skb) | 210 | void ip_options_fragment(struct sk_buff * skb) |
211 | { | 211 | { |
212 | unsigned char * optptr = skb->nh.raw; | 212 | unsigned char * optptr = skb->nh.raw + sizeof(struct iphdr); |
213 | struct ip_options * opt = &(IPCB(skb)->opt); | 213 | struct ip_options * opt = &(IPCB(skb)->opt); |
214 | int l = opt->optlen; | 214 | int l = opt->optlen; |
215 | int optlen; | 215 | int optlen; |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index cd810f41af1a..95278b22b669 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
@@ -210,7 +210,7 @@ static void ipcomp4_err(struct sk_buff *skb, u32 info) | |||
210 | skb->h.icmph->code != ICMP_FRAG_NEEDED) | 210 | skb->h.icmph->code != ICMP_FRAG_NEEDED) |
211 | return; | 211 | return; |
212 | 212 | ||
213 | spi = ntohl(ntohs(ipch->cpi)); | 213 | spi = htonl(ntohs(ipch->cpi)); |
214 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, | 214 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, |
215 | spi, IPPROTO_COMP, AF_INET); | 215 | spi, IPPROTO_COMP, AF_INET); |
216 | if (!x) | 216 | if (!x) |
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c index c2d92f99a2b8..d0d19192026d 100644 --- a/net/ipv4/netfilter/arp_tables.c +++ b/net/ipv4/netfilter/arp_tables.c | |||
@@ -948,7 +948,7 @@ static int do_add_counters(void __user *user, unsigned int len) | |||
948 | 948 | ||
949 | write_lock_bh(&t->lock); | 949 | write_lock_bh(&t->lock); |
950 | private = t->private; | 950 | private = t->private; |
951 | if (private->number != paddc->num_counters) { | 951 | if (private->number != tmp.num_counters) { |
952 | ret = -EINVAL; | 952 | ret = -EINVAL; |
953 | goto unlock_up_free; | 953 | goto unlock_up_free; |
954 | } | 954 | } |
diff --git a/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c b/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c index 355a53a5b6cd..26dfecadb335 100644 --- a/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c +++ b/net/ipv4/netfilter/ip_conntrack_helper_h323_asn1.c | |||
@@ -528,14 +528,15 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) | |||
528 | 528 | ||
529 | /* Decode */ | 529 | /* Decode */ |
530 | if ((err = (Decoders[son->type]) (bs, son, base, | 530 | if ((err = (Decoders[son->type]) (bs, son, base, |
531 | level + 1)) > | 531 | level + 1)) < |
532 | H323_ERROR_STOP) | 532 | H323_ERROR_NONE) |
533 | return err; | 533 | return err; |
534 | 534 | ||
535 | bs->cur = beg + len; | 535 | bs->cur = beg + len; |
536 | bs->bit = 0; | 536 | bs->bit = 0; |
537 | } else if ((err = (Decoders[son->type]) (bs, son, base, | 537 | } else if ((err = (Decoders[son->type]) (bs, son, base, |
538 | level + 1))) | 538 | level + 1)) < |
539 | H323_ERROR_NONE) | ||
539 | return err; | 540 | return err; |
540 | } | 541 | } |
541 | 542 | ||
@@ -554,7 +555,7 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) | |||
554 | 555 | ||
555 | /* Decode the extension components */ | 556 | /* Decode the extension components */ |
556 | for (opt = 0; opt < bmp2_len; opt++, i++, son++) { | 557 | for (opt = 0; opt < bmp2_len; opt++, i++, son++) { |
557 | if (son->attr & STOP) { | 558 | if (i < f->ub && son->attr & STOP) { |
558 | PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ", | 559 | PRINT("%*.s%s\n", (level + 1) * TAB_SIZE, " ", |
559 | son->name); | 560 | son->name); |
560 | return H323_ERROR_STOP; | 561 | return H323_ERROR_STOP; |
@@ -584,8 +585,8 @@ int decode_seq(bitstr_t * bs, field_t * f, char *base, int level) | |||
584 | beg = bs->cur; | 585 | beg = bs->cur; |
585 | 586 | ||
586 | if ((err = (Decoders[son->type]) (bs, son, base, | 587 | if ((err = (Decoders[son->type]) (bs, son, base, |
587 | level + 1)) > | 588 | level + 1)) < |
588 | H323_ERROR_STOP) | 589 | H323_ERROR_NONE) |
589 | return err; | 590 | return err; |
590 | 591 | ||
591 | bs->cur = beg + len; | 592 | bs->cur = beg + len; |
@@ -660,18 +661,20 @@ int decode_seqof(bitstr_t * bs, field_t * f, char *base, int level) | |||
660 | i < | 661 | i < |
661 | effective_count ? | 662 | effective_count ? |
662 | base : NULL, | 663 | base : NULL, |
663 | level + 1)) > | 664 | level + 1)) < |
664 | H323_ERROR_STOP) | 665 | H323_ERROR_NONE) |
665 | return err; | 666 | return err; |
666 | 667 | ||
667 | bs->cur = beg + len; | 668 | bs->cur = beg + len; |
668 | bs->bit = 0; | 669 | bs->bit = 0; |
669 | } else | 670 | } else |
670 | if ((err = (Decoders[son->type]) (bs, son, | 671 | if ((err = (Decoders[son->type]) (bs, son, |
671 | i < effective_count ? | 672 | i < |
672 | base : NULL, | 673 | effective_count ? |
673 | level + 1))) | 674 | base : NULL, |
674 | return err; | 675 | level + 1)) < |
676 | H323_ERROR_NONE) | ||
677 | return err; | ||
675 | 678 | ||
676 | if (base) | 679 | if (base) |
677 | base += son->offset; | 680 | base += son->offset; |
@@ -735,13 +738,14 @@ int decode_choice(bitstr_t * bs, field_t * f, char *base, int level) | |||
735 | } | 738 | } |
736 | beg = bs->cur; | 739 | beg = bs->cur; |
737 | 740 | ||
738 | if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) > | 741 | if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) < |
739 | H323_ERROR_STOP) | 742 | H323_ERROR_NONE) |
740 | return err; | 743 | return err; |
741 | 744 | ||
742 | bs->cur = beg + len; | 745 | bs->cur = beg + len; |
743 | bs->bit = 0; | 746 | bs->bit = 0; |
744 | } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1))) | 747 | } else if ((err = (Decoders[son->type]) (bs, son, base, level + 1)) < |
748 | H323_ERROR_NONE) | ||
745 | return err; | 749 | return err; |
746 | 750 | ||
747 | return H323_ERROR_NONE; | 751 | return H323_ERROR_NONE; |
diff --git a/net/ipv4/netfilter/ip_nat_proto_gre.c b/net/ipv4/netfilter/ip_nat_proto_gre.c index 6c4899d8046a..96ceabaec402 100644 --- a/net/ipv4/netfilter/ip_nat_proto_gre.c +++ b/net/ipv4/netfilter/ip_nat_proto_gre.c | |||
@@ -49,15 +49,15 @@ gre_in_range(const struct ip_conntrack_tuple *tuple, | |||
49 | const union ip_conntrack_manip_proto *min, | 49 | const union ip_conntrack_manip_proto *min, |
50 | const union ip_conntrack_manip_proto *max) | 50 | const union ip_conntrack_manip_proto *max) |
51 | { | 51 | { |
52 | u_int32_t key; | 52 | __be16 key; |
53 | 53 | ||
54 | if (maniptype == IP_NAT_MANIP_SRC) | 54 | if (maniptype == IP_NAT_MANIP_SRC) |
55 | key = tuple->src.u.gre.key; | 55 | key = tuple->src.u.gre.key; |
56 | else | 56 | else |
57 | key = tuple->dst.u.gre.key; | 57 | key = tuple->dst.u.gre.key; |
58 | 58 | ||
59 | return ntohl(key) >= ntohl(min->gre.key) | 59 | return ntohs(key) >= ntohs(min->gre.key) |
60 | && ntohl(key) <= ntohl(max->gre.key); | 60 | && ntohs(key) <= ntohs(max->gre.key); |
61 | } | 61 | } |
62 | 62 | ||
63 | /* generate unique tuple ... */ | 63 | /* generate unique tuple ... */ |
@@ -81,14 +81,14 @@ gre_unique_tuple(struct ip_conntrack_tuple *tuple, | |||
81 | min = 1; | 81 | min = 1; |
82 | range_size = 0xffff; | 82 | range_size = 0xffff; |
83 | } else { | 83 | } else { |
84 | min = ntohl(range->min.gre.key); | 84 | min = ntohs(range->min.gre.key); |
85 | range_size = ntohl(range->max.gre.key) - min + 1; | 85 | range_size = ntohs(range->max.gre.key) - min + 1; |
86 | } | 86 | } |
87 | 87 | ||
88 | DEBUGP("min = %u, range_size = %u\n", min, range_size); | 88 | DEBUGP("min = %u, range_size = %u\n", min, range_size); |
89 | 89 | ||
90 | for (i = 0; i < range_size; i++, key++) { | 90 | for (i = 0; i < range_size; i++, key++) { |
91 | *keyptr = htonl(min + key % range_size); | 91 | *keyptr = htons(min + key % range_size); |
92 | if (!ip_nat_used_tuple(tuple, conntrack)) | 92 | if (!ip_nat_used_tuple(tuple, conntrack)) |
93 | return 1; | 93 | return 1; |
94 | } | 94 | } |
diff --git a/net/ipv4/netfilter/ip_nat_snmp_basic.c b/net/ipv4/netfilter/ip_nat_snmp_basic.c index c62253845538..c33244263b90 100644 --- a/net/ipv4/netfilter/ip_nat_snmp_basic.c +++ b/net/ipv4/netfilter/ip_nat_snmp_basic.c | |||
@@ -768,6 +768,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
768 | len *= sizeof(unsigned long); | 768 | len *= sizeof(unsigned long); |
769 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); | 769 | *obj = kmalloc(sizeof(struct snmp_object) + len, GFP_ATOMIC); |
770 | if (*obj == NULL) { | 770 | if (*obj == NULL) { |
771 | kfree(lp); | ||
771 | kfree(id); | 772 | kfree(id); |
772 | if (net_ratelimit()) | 773 | if (net_ratelimit()) |
773 | printk("OOM in bsalg (%d)\n", __LINE__); | 774 | printk("OOM in bsalg (%d)\n", __LINE__); |
@@ -1003,12 +1004,12 @@ static unsigned char snmp_trap_decode(struct asn1_ctx *ctx, | |||
1003 | 1004 | ||
1004 | return 1; | 1005 | return 1; |
1005 | 1006 | ||
1007 | err_addr_free: | ||
1008 | kfree((unsigned long *)trap->ip_address); | ||
1009 | |||
1006 | err_id_free: | 1010 | err_id_free: |
1007 | kfree(trap->id); | 1011 | kfree(trap->id); |
1008 | 1012 | ||
1009 | err_addr_free: | ||
1010 | kfree((unsigned long *)trap->ip_address); | ||
1011 | |||
1012 | return 0; | 1013 | return 0; |
1013 | } | 1014 | } |
1014 | 1015 | ||
@@ -1126,11 +1127,10 @@ static int snmp_parse_mangle(unsigned char *msg, | |||
1126 | struct snmp_v1_trap trap; | 1127 | struct snmp_v1_trap trap; |
1127 | unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check); | 1128 | unsigned char ret = snmp_trap_decode(&ctx, &trap, map, check); |
1128 | 1129 | ||
1129 | /* Discard trap allocations regardless */ | 1130 | if (ret) { |
1130 | kfree(trap.id); | 1131 | kfree(trap.id); |
1131 | kfree((unsigned long *)trap.ip_address); | 1132 | kfree((unsigned long *)trap.ip_address); |
1132 | 1133 | } else | |
1133 | if (!ret) | ||
1134 | return ret; | 1134 | return ret; |
1135 | 1135 | ||
1136 | } else { | 1136 | } else { |
diff --git a/net/ipv4/netfilter/ipt_LOG.c b/net/ipv4/netfilter/ipt_LOG.c index 39fd4c2a2386..b98f7b08b084 100644 --- a/net/ipv4/netfilter/ipt_LOG.c +++ b/net/ipv4/netfilter/ipt_LOG.c | |||
@@ -428,7 +428,7 @@ ipt_log_target(struct sk_buff **pskb, | |||
428 | 428 | ||
429 | if (loginfo->logflags & IPT_LOG_NFLOG) | 429 | if (loginfo->logflags & IPT_LOG_NFLOG) |
430 | nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, | 430 | nf_log_packet(PF_INET, hooknum, *pskb, in, out, &li, |
431 | loginfo->prefix); | 431 | "%s", loginfo->prefix); |
432 | else | 432 | else |
433 | ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li, | 433 | ipt_log_packet(PF_INET, hooknum, *pskb, in, out, &li, |
434 | loginfo->prefix); | 434 | loginfo->prefix); |
diff --git a/net/ipv4/netfilter/ipt_recent.c b/net/ipv4/netfilter/ipt_recent.c index 143843285702..b847ee409efb 100644 --- a/net/ipv4/netfilter/ipt_recent.c +++ b/net/ipv4/netfilter/ipt_recent.c | |||
@@ -821,6 +821,7 @@ checkentry(const char *tablename, | |||
821 | /* Create our proc 'status' entry. */ | 821 | /* Create our proc 'status' entry. */ |
822 | curr_table->status_proc = create_proc_entry(curr_table->name, ip_list_perms, proc_net_ipt_recent); | 822 | curr_table->status_proc = create_proc_entry(curr_table->name, ip_list_perms, proc_net_ipt_recent); |
823 | if (!curr_table->status_proc) { | 823 | if (!curr_table->status_proc) { |
824 | vfree(hold); | ||
824 | printk(KERN_INFO RECENT_NAME ": checkentry: unable to allocate for /proc entry.\n"); | 825 | printk(KERN_INFO RECENT_NAME ": checkentry: unable to allocate for /proc entry.\n"); |
825 | /* Destroy the created table */ | 826 | /* Destroy the created table */ |
826 | spin_lock_bh(&recent_lock); | 827 | spin_lock_bh(&recent_lock); |
@@ -845,7 +846,6 @@ checkentry(const char *tablename, | |||
845 | spin_unlock_bh(&recent_lock); | 846 | spin_unlock_bh(&recent_lock); |
846 | vfree(curr_table->time_info); | 847 | vfree(curr_table->time_info); |
847 | vfree(curr_table->hash_table); | 848 | vfree(curr_table->hash_table); |
848 | vfree(hold); | ||
849 | vfree(curr_table->table); | 849 | vfree(curr_table->table); |
850 | vfree(curr_table); | 850 | vfree(curr_table); |
851 | return 0; | 851 | return 0; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 9f0cca4c4fae..4a538bc1683d 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1662,6 +1662,8 @@ static void tcp_update_scoreboard(struct sock *sk, struct tcp_sock *tp) | |||
1662 | if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { | 1662 | if (!(TCP_SKB_CB(skb)->sacked&TCPCB_TAGBITS)) { |
1663 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; | 1663 | TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; |
1664 | tp->lost_out += tcp_skb_pcount(skb); | 1664 | tp->lost_out += tcp_skb_pcount(skb); |
1665 | if (IsReno(tp)) | ||
1666 | tcp_remove_reno_sacks(sk, tp, tcp_skb_pcount(skb) + 1); | ||
1665 | 1667 | ||
1666 | /* clear xmit_retrans hint */ | 1668 | /* clear xmit_retrans hint */ |
1667 | if (tp->retransmit_skb_hint && | 1669 | if (tp->retransmit_skb_hint && |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index f285bbf296e2..8604c747bca5 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
@@ -221,7 +221,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl) | |||
221 | if (pskb_may_pull(skb, xprth + 4 - skb->data)) { | 221 | if (pskb_may_pull(skb, xprth + 4 - skb->data)) { |
222 | u16 *ipcomp_hdr = (u16 *)xprth; | 222 | u16 *ipcomp_hdr = (u16 *)xprth; |
223 | 223 | ||
224 | fl->fl_ipsec_spi = ntohl(ntohs(ipcomp_hdr[1])); | 224 | fl->fl_ipsec_spi = htonl(ntohs(ipcomp_hdr[1])); |
225 | } | 225 | } |
226 | break; | 226 | break; |
227 | default: | 227 | default: |
diff --git a/net/ipv6/inet6_connection_sock.c b/net/ipv6/inet6_connection_sock.c index f8f3a37a1494..eb2865d5ae28 100644 --- a/net/ipv6/inet6_connection_sock.c +++ b/net/ipv6/inet6_connection_sock.c | |||
@@ -173,6 +173,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok) | |||
173 | 173 | ||
174 | if (err) { | 174 | if (err) { |
175 | sk->sk_err_soft = -err; | 175 | sk->sk_err_soft = -err; |
176 | kfree_skb(skb); | ||
176 | return err; | 177 | return err; |
177 | } | 178 | } |
178 | 179 | ||
@@ -181,6 +182,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok) | |||
181 | 182 | ||
182 | if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { | 183 | if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) { |
183 | sk->sk_route_caps = 0; | 184 | sk->sk_route_caps = 0; |
185 | kfree_skb(skb); | ||
184 | return err; | 186 | return err; |
185 | } | 187 | } |
186 | 188 | ||
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 05eb67def39f..48636436028a 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -208,7 +208,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
208 | if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) | 208 | if (type != ICMPV6_DEST_UNREACH && type != ICMPV6_PKT_TOOBIG) |
209 | return; | 209 | return; |
210 | 210 | ||
211 | spi = ntohl(ntohs(ipcomph->cpi)); | 211 | spi = htonl(ntohs(ipcomph->cpi)); |
212 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); | 212 | x = xfrm_state_lookup((xfrm_address_t *)&iph->daddr, spi, IPPROTO_COMP, AF_INET6); |
213 | if (!x) | 213 | if (!x) |
214 | return; | 214 | return; |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 0a673038344f..2e72f89a7019 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -1103,7 +1103,7 @@ do_add_counters(void __user *user, unsigned int len) | |||
1103 | 1103 | ||
1104 | write_lock_bh(&t->lock); | 1104 | write_lock_bh(&t->lock); |
1105 | private = t->private; | 1105 | private = t->private; |
1106 | if (private->number != paddc->num_counters) { | 1106 | if (private->number != tmp.num_counters) { |
1107 | ret = -EINVAL; | 1107 | ret = -EINVAL; |
1108 | goto unlock_up_free; | 1108 | goto unlock_up_free; |
1109 | } | 1109 | } |
diff --git a/net/ipv6/netfilter/ip6t_LOG.c b/net/ipv6/netfilter/ip6t_LOG.c index a96c0de14b00..73c6300109d6 100644 --- a/net/ipv6/netfilter/ip6t_LOG.c +++ b/net/ipv6/netfilter/ip6t_LOG.c | |||
@@ -439,7 +439,7 @@ ip6t_log_target(struct sk_buff **pskb, | |||
439 | 439 | ||
440 | if (loginfo->logflags & IP6T_LOG_NFLOG) | 440 | if (loginfo->logflags & IP6T_LOG_NFLOG) |
441 | nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, | 441 | nf_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, |
442 | loginfo->prefix); | 442 | "%s", loginfo->prefix); |
443 | else | 443 | else |
444 | ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, | 444 | ip6t_log_packet(PF_INET6, hooknum, *pskb, in, out, &li, |
445 | loginfo->prefix); | 445 | loginfo->prefix); |
diff --git a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c index 94dbdb8b458d..4f6b84c8f4ab 100644 --- a/net/ipv6/netfilter/ip6t_eui64.c +++ b/net/ipv6/netfilter/ip6t_eui64.c | |||
@@ -40,7 +40,7 @@ match(const struct sk_buff *skb, | |||
40 | 40 | ||
41 | memset(eui64, 0, sizeof(eui64)); | 41 | memset(eui64, 0, sizeof(eui64)); |
42 | 42 | ||
43 | if (eth_hdr(skb)->h_proto == ntohs(ETH_P_IPV6)) { | 43 | if (eth_hdr(skb)->h_proto == htons(ETH_P_IPV6)) { |
44 | if (skb->nh.ipv6h->version == 0x6) { | 44 | if (skb->nh.ipv6h->version == 0x6) { |
45 | memcpy(eui64, eth_hdr(skb)->h_source, 3); | 45 | memcpy(eui64, eth_hdr(skb)->h_source, 3); |
46 | memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3); | 46 | memcpy(eui64 + 5, eth_hdr(skb)->h_source + 3, 3); |
diff --git a/net/ipx/af_ipx.c b/net/ipx/af_ipx.c index 2dbf134d5266..811d998725bc 100644 --- a/net/ipx/af_ipx.c +++ b/net/ipx/af_ipx.c | |||
@@ -944,9 +944,9 @@ out: | |||
944 | return rc; | 944 | return rc; |
945 | } | 945 | } |
946 | 946 | ||
947 | static int ipx_map_frame_type(unsigned char type) | 947 | static __be16 ipx_map_frame_type(unsigned char type) |
948 | { | 948 | { |
949 | int rc = 0; | 949 | __be16 rc = 0; |
950 | 950 | ||
951 | switch (type) { | 951 | switch (type) { |
952 | case IPX_FRAME_ETHERII: rc = htons(ETH_P_IPX); break; | 952 | case IPX_FRAME_ETHERII: rc = htons(ETH_P_IPX); break; |
diff --git a/net/ipx/ipx_route.c b/net/ipx/ipx_route.c index 67774448efd9..a394c6fe19a2 100644 --- a/net/ipx/ipx_route.c +++ b/net/ipx/ipx_route.c | |||
@@ -119,7 +119,7 @@ out: | |||
119 | return rc; | 119 | return rc; |
120 | } | 120 | } |
121 | 121 | ||
122 | static int ipxrtr_delete(long net) | 122 | static int ipxrtr_delete(__u32 net) |
123 | { | 123 | { |
124 | struct ipx_route *r, *tmp; | 124 | struct ipx_route *r, *tmp; |
125 | int rc; | 125 | int rc; |
diff --git a/net/irda/iriap.c b/net/irda/iriap.c index 254f90746900..2d2e2b1919f4 100644 --- a/net/irda/iriap.c +++ b/net/irda/iriap.c | |||
@@ -544,7 +544,8 @@ static void iriap_getvaluebyclass_response(struct iriap_cb *self, | |||
544 | { | 544 | { |
545 | struct sk_buff *tx_skb; | 545 | struct sk_buff *tx_skb; |
546 | int n; | 546 | int n; |
547 | __u32 tmp_be32, tmp_be16; | 547 | __u32 tmp_be32; |
548 | __be16 tmp_be16; | ||
548 | __u8 *fp; | 549 | __u8 *fp; |
549 | 550 | ||
550 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); | 551 | IRDA_DEBUG(4, "%s()\n", __FUNCTION__); |
diff --git a/net/irda/irias_object.c b/net/irda/irias_object.c index c6d169fbdceb..82e665c79991 100644 --- a/net/irda/irias_object.c +++ b/net/irda/irias_object.c | |||
@@ -257,7 +257,6 @@ struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name) | |||
257 | /* Unsafe (locking), attrib might change */ | 257 | /* Unsafe (locking), attrib might change */ |
258 | return attrib; | 258 | return attrib; |
259 | } | 259 | } |
260 | EXPORT_SYMBOL(irias_find_attrib); | ||
261 | 260 | ||
262 | /* | 261 | /* |
263 | * Function irias_add_attribute (obj, attrib) | 262 | * Function irias_add_attribute (obj, attrib) |
@@ -484,7 +483,6 @@ struct ias_value *irias_new_string_value(char *string) | |||
484 | 483 | ||
485 | return value; | 484 | return value; |
486 | } | 485 | } |
487 | EXPORT_SYMBOL(irias_new_string_value); | ||
488 | 486 | ||
489 | /* | 487 | /* |
490 | * Function irias_new_octseq_value (octets, len) | 488 | * Function irias_new_octseq_value (octets, len) |
@@ -519,7 +517,6 @@ struct ias_value *irias_new_octseq_value(__u8 *octseq , int len) | |||
519 | memcpy(value->t.oct_seq, octseq , len); | 517 | memcpy(value->t.oct_seq, octseq , len); |
520 | return value; | 518 | return value; |
521 | } | 519 | } |
522 | EXPORT_SYMBOL(irias_new_octseq_value); | ||
523 | 520 | ||
524 | struct ias_value *irias_new_missing_value(void) | 521 | struct ias_value *irias_new_missing_value(void) |
525 | { | 522 | { |
diff --git a/net/netfilter/nfnetlink_log.c b/net/netfilter/nfnetlink_log.c index c60273cad778..61cdda4e5d3b 100644 --- a/net/netfilter/nfnetlink_log.c +++ b/net/netfilter/nfnetlink_log.c | |||
@@ -321,7 +321,7 @@ static int | |||
321 | nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags) | 321 | nfulnl_set_flags(struct nfulnl_instance *inst, u_int16_t flags) |
322 | { | 322 | { |
323 | spin_lock_bh(&inst->lock); | 323 | spin_lock_bh(&inst->lock); |
324 | inst->flags = ntohs(flags); | 324 | inst->flags = flags; |
325 | spin_unlock_bh(&inst->lock); | 325 | spin_unlock_bh(&inst->lock); |
326 | 326 | ||
327 | return 0; | 327 | return 0; |
@@ -902,7 +902,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb, | |||
902 | if (nfula[NFULA_CFG_FLAGS-1]) { | 902 | if (nfula[NFULA_CFG_FLAGS-1]) { |
903 | u_int16_t flags = | 903 | u_int16_t flags = |
904 | *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]); | 904 | *(u_int16_t *)NFA_DATA(nfula[NFULA_CFG_FLAGS-1]); |
905 | nfulnl_set_flags(inst, ntohl(flags)); | 905 | nfulnl_set_flags(inst, ntohs(flags)); |
906 | } | 906 | } |
907 | 907 | ||
908 | out_put: | 908 | out_put: |
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 31eb83717c26..138ea92ed268 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -193,8 +193,10 @@ static void dev_watchdog(unsigned long arg) | |||
193 | netif_running(dev) && | 193 | netif_running(dev) && |
194 | netif_carrier_ok(dev)) { | 194 | netif_carrier_ok(dev)) { |
195 | if (netif_queue_stopped(dev) && | 195 | if (netif_queue_stopped(dev) && |
196 | (jiffies - dev->trans_start) > dev->watchdog_timeo) { | 196 | time_after(jiffies, dev->trans_start + dev->watchdog_timeo)) { |
197 | printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", dev->name); | 197 | |
198 | printk(KERN_INFO "NETDEV WATCHDOG: %s: transmit timed out\n", | ||
199 | dev->name); | ||
198 | dev->tx_timeout(dev); | 200 | dev->tx_timeout(dev); |
199 | } | 201 | } |
200 | if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) | 202 | if (!mod_timer(&dev->watchdog_timer, jiffies + dev->watchdog_timeo)) |
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 91132f6871d7..f1c7bd29f2cd 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -974,10 +974,10 @@ hfsc_adjust_levels(struct hfsc_class *cl) | |||
974 | do { | 974 | do { |
975 | level = 0; | 975 | level = 0; |
976 | list_for_each_entry(p, &cl->children, siblings) { | 976 | list_for_each_entry(p, &cl->children, siblings) { |
977 | if (p->level > level) | 977 | if (p->level >= level) |
978 | level = p->level; | 978 | level = p->level + 1; |
979 | } | 979 | } |
980 | cl->level = level + 1; | 980 | cl->level = level; |
981 | } while ((cl = cl->cl_parent) != NULL); | 981 | } while ((cl = cl->cl_parent) != NULL); |
982 | } | 982 | } |
983 | 983 | ||
diff --git a/net/sctp/input.c b/net/sctp/input.c index d117ebc75cf8..1662f9cc869e 100644 --- a/net/sctp/input.c +++ b/net/sctp/input.c | |||
@@ -73,6 +73,8 @@ static struct sctp_association *__sctp_lookup_association( | |||
73 | const union sctp_addr *peer, | 73 | const union sctp_addr *peer, |
74 | struct sctp_transport **pt); | 74 | struct sctp_transport **pt); |
75 | 75 | ||
76 | static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb); | ||
77 | |||
76 | 78 | ||
77 | /* Calculate the SCTP checksum of an SCTP packet. */ | 79 | /* Calculate the SCTP checksum of an SCTP packet. */ |
78 | static inline int sctp_rcv_checksum(struct sk_buff *skb) | 80 | static inline int sctp_rcv_checksum(struct sk_buff *skb) |
@@ -186,7 +188,6 @@ int sctp_rcv(struct sk_buff *skb) | |||
186 | */ | 188 | */ |
187 | if (sk->sk_bound_dev_if && (sk->sk_bound_dev_if != af->skb_iif(skb))) | 189 | if (sk->sk_bound_dev_if && (sk->sk_bound_dev_if != af->skb_iif(skb))) |
188 | { | 190 | { |
189 | sock_put(sk); | ||
190 | if (asoc) { | 191 | if (asoc) { |
191 | sctp_association_put(asoc); | 192 | sctp_association_put(asoc); |
192 | asoc = NULL; | 193 | asoc = NULL; |
@@ -197,7 +198,6 @@ int sctp_rcv(struct sk_buff *skb) | |||
197 | sk = sctp_get_ctl_sock(); | 198 | sk = sctp_get_ctl_sock(); |
198 | ep = sctp_sk(sk)->ep; | 199 | ep = sctp_sk(sk)->ep; |
199 | sctp_endpoint_hold(ep); | 200 | sctp_endpoint_hold(ep); |
200 | sock_hold(sk); | ||
201 | rcvr = &ep->base; | 201 | rcvr = &ep->base; |
202 | } | 202 | } |
203 | 203 | ||
@@ -253,25 +253,18 @@ int sctp_rcv(struct sk_buff *skb) | |||
253 | */ | 253 | */ |
254 | sctp_bh_lock_sock(sk); | 254 | sctp_bh_lock_sock(sk); |
255 | 255 | ||
256 | /* It is possible that the association could have moved to a different | ||
257 | * socket if it is peeled off. If so, update the sk. | ||
258 | */ | ||
259 | if (sk != rcvr->sk) { | ||
260 | sctp_bh_lock_sock(rcvr->sk); | ||
261 | sctp_bh_unlock_sock(sk); | ||
262 | sk = rcvr->sk; | ||
263 | } | ||
264 | |||
265 | if (sock_owned_by_user(sk)) | 256 | if (sock_owned_by_user(sk)) |
266 | sk_add_backlog(sk, skb); | 257 | sctp_add_backlog(sk, skb); |
267 | else | 258 | else |
268 | sctp_backlog_rcv(sk, skb); | 259 | sctp_inq_push(&chunk->rcvr->inqueue, chunk); |
269 | 260 | ||
270 | /* Release the sock and the sock ref we took in the lookup calls. | ||
271 | * The asoc/ep ref will be released in sctp_backlog_rcv. | ||
272 | */ | ||
273 | sctp_bh_unlock_sock(sk); | 261 | sctp_bh_unlock_sock(sk); |
274 | sock_put(sk); | 262 | |
263 | /* Release the asoc/ep ref we took in the lookup calls. */ | ||
264 | if (asoc) | ||
265 | sctp_association_put(asoc); | ||
266 | else | ||
267 | sctp_endpoint_put(ep); | ||
275 | 268 | ||
276 | return 0; | 269 | return 0; |
277 | 270 | ||
@@ -280,8 +273,7 @@ discard_it: | |||
280 | return 0; | 273 | return 0; |
281 | 274 | ||
282 | discard_release: | 275 | discard_release: |
283 | /* Release any structures we may be holding. */ | 276 | /* Release the asoc/ep ref we took in the lookup calls. */ |
284 | sock_put(sk); | ||
285 | if (asoc) | 277 | if (asoc) |
286 | sctp_association_put(asoc); | 278 | sctp_association_put(asoc); |
287 | else | 279 | else |
@@ -290,56 +282,87 @@ discard_release: | |||
290 | goto discard_it; | 282 | goto discard_it; |
291 | } | 283 | } |
292 | 284 | ||
293 | /* Handle second half of inbound skb processing. If the sock was busy, | 285 | /* Process the backlog queue of the socket. Every skb on |
294 | * we may have need to delay processing until later when the sock is | 286 | * the backlog holds a ref on an association or endpoint. |
295 | * released (on the backlog). If not busy, we call this routine | 287 | * We hold this ref throughout the state machine to make |
296 | * directly from the bottom half. | 288 | * sure that the structure we need is still around. |
297 | */ | 289 | */ |
298 | int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) | 290 | int sctp_backlog_rcv(struct sock *sk, struct sk_buff *skb) |
299 | { | 291 | { |
300 | struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; | 292 | struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; |
301 | struct sctp_inq *inqueue = NULL; | 293 | struct sctp_inq *inqueue = &chunk->rcvr->inqueue; |
302 | struct sctp_ep_common *rcvr = NULL; | 294 | struct sctp_ep_common *rcvr = NULL; |
295 | int backloged = 0; | ||
303 | 296 | ||
304 | rcvr = chunk->rcvr; | 297 | rcvr = chunk->rcvr; |
305 | 298 | ||
306 | BUG_TRAP(rcvr->sk == sk); | 299 | /* If the rcvr is dead then the association or endpoint |
307 | 300 | * has been deleted and we can safely drop the chunk | |
308 | if (rcvr->dead) { | 301 | * and refs that we are holding. |
309 | sctp_chunk_free(chunk); | 302 | */ |
310 | } else { | 303 | if (rcvr->dead) { |
311 | inqueue = &chunk->rcvr->inqueue; | 304 | sctp_chunk_free(chunk); |
312 | sctp_inq_push(inqueue, chunk); | 305 | goto done; |
313 | } | 306 | } |
314 | 307 | ||
315 | /* Release the asoc/ep ref we took in the lookup calls in sctp_rcv. */ | 308 | if (unlikely(rcvr->sk != sk)) { |
316 | if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) | 309 | /* In this case, the association moved from one socket to |
317 | sctp_association_put(sctp_assoc(rcvr)); | 310 | * another. We are currently sitting on the backlog of the |
318 | else | 311 | * old socket, so we need to move. |
319 | sctp_endpoint_put(sctp_ep(rcvr)); | 312 | * However, since we are here in the process context we |
320 | 313 | * need to take make sure that the user doesn't own | |
314 | * the new socket when we process the packet. | ||
315 | * If the new socket is user-owned, queue the chunk to the | ||
316 | * backlog of the new socket without dropping any refs. | ||
317 | * Otherwise, we can safely push the chunk on the inqueue. | ||
318 | */ | ||
319 | |||
320 | sk = rcvr->sk; | ||
321 | sctp_bh_lock_sock(sk); | ||
322 | |||
323 | if (sock_owned_by_user(sk)) { | ||
324 | sk_add_backlog(sk, skb); | ||
325 | backloged = 1; | ||
326 | } else | ||
327 | sctp_inq_push(inqueue, chunk); | ||
328 | |||
329 | sctp_bh_unlock_sock(sk); | ||
330 | |||
331 | /* If the chunk was backloged again, don't drop refs */ | ||
332 | if (backloged) | ||
333 | return 0; | ||
334 | } else { | ||
335 | sctp_inq_push(inqueue, chunk); | ||
336 | } | ||
337 | |||
338 | done: | ||
339 | /* Release the refs we took in sctp_add_backlog */ | ||
340 | if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) | ||
341 | sctp_association_put(sctp_assoc(rcvr)); | ||
342 | else if (SCTP_EP_TYPE_SOCKET == rcvr->type) | ||
343 | sctp_endpoint_put(sctp_ep(rcvr)); | ||
344 | else | ||
345 | BUG(); | ||
346 | |||
321 | return 0; | 347 | return 0; |
322 | } | 348 | } |
323 | 349 | ||
324 | void sctp_backlog_migrate(struct sctp_association *assoc, | 350 | static void sctp_add_backlog(struct sock *sk, struct sk_buff *skb) |
325 | struct sock *oldsk, struct sock *newsk) | ||
326 | { | 351 | { |
327 | struct sk_buff *skb; | 352 | struct sctp_chunk *chunk = SCTP_INPUT_CB(skb)->chunk; |
328 | struct sctp_chunk *chunk; | 353 | struct sctp_ep_common *rcvr = chunk->rcvr; |
329 | 354 | ||
330 | skb = oldsk->sk_backlog.head; | 355 | /* Hold the assoc/ep while hanging on the backlog queue. |
331 | oldsk->sk_backlog.head = oldsk->sk_backlog.tail = NULL; | 356 | * This way, we know structures we need will not disappear from us |
332 | while (skb != NULL) { | 357 | */ |
333 | struct sk_buff *next = skb->next; | 358 | if (SCTP_EP_TYPE_ASSOCIATION == rcvr->type) |
334 | 359 | sctp_association_hold(sctp_assoc(rcvr)); | |
335 | chunk = SCTP_INPUT_CB(skb)->chunk; | 360 | else if (SCTP_EP_TYPE_SOCKET == rcvr->type) |
336 | skb->next = NULL; | 361 | sctp_endpoint_hold(sctp_ep(rcvr)); |
337 | if (&assoc->base == chunk->rcvr) | 362 | else |
338 | sk_add_backlog(newsk, skb); | 363 | BUG(); |
339 | else | 364 | |
340 | sk_add_backlog(oldsk, skb); | 365 | sk_add_backlog(sk, skb); |
341 | skb = next; | ||
342 | } | ||
343 | } | 366 | } |
344 | 367 | ||
345 | /* Handle icmp frag needed error. */ | 368 | /* Handle icmp frag needed error. */ |
@@ -412,7 +435,7 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, | |||
412 | union sctp_addr daddr; | 435 | union sctp_addr daddr; |
413 | struct sctp_af *af; | 436 | struct sctp_af *af; |
414 | struct sock *sk = NULL; | 437 | struct sock *sk = NULL; |
415 | struct sctp_association *asoc = NULL; | 438 | struct sctp_association *asoc; |
416 | struct sctp_transport *transport = NULL; | 439 | struct sctp_transport *transport = NULL; |
417 | 440 | ||
418 | *app = NULL; *tpp = NULL; | 441 | *app = NULL; *tpp = NULL; |
@@ -453,7 +476,6 @@ struct sock *sctp_err_lookup(int family, struct sk_buff *skb, | |||
453 | return sk; | 476 | return sk; |
454 | 477 | ||
455 | out: | 478 | out: |
456 | sock_put(sk); | ||
457 | if (asoc) | 479 | if (asoc) |
458 | sctp_association_put(asoc); | 480 | sctp_association_put(asoc); |
459 | return NULL; | 481 | return NULL; |
@@ -463,7 +485,6 @@ out: | |||
463 | void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) | 485 | void sctp_err_finish(struct sock *sk, struct sctp_association *asoc) |
464 | { | 486 | { |
465 | sctp_bh_unlock_sock(sk); | 487 | sctp_bh_unlock_sock(sk); |
466 | sock_put(sk); | ||
467 | if (asoc) | 488 | if (asoc) |
468 | sctp_association_put(asoc); | 489 | sctp_association_put(asoc); |
469 | } | 490 | } |
@@ -490,7 +511,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info) | |||
490 | int type = skb->h.icmph->type; | 511 | int type = skb->h.icmph->type; |
491 | int code = skb->h.icmph->code; | 512 | int code = skb->h.icmph->code; |
492 | struct sock *sk; | 513 | struct sock *sk; |
493 | struct sctp_association *asoc; | 514 | struct sctp_association *asoc = NULL; |
494 | struct sctp_transport *transport; | 515 | struct sctp_transport *transport; |
495 | struct inet_sock *inet; | 516 | struct inet_sock *inet; |
496 | char *saveip, *savesctp; | 517 | char *saveip, *savesctp; |
@@ -716,7 +737,6 @@ static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *l | |||
716 | 737 | ||
717 | hit: | 738 | hit: |
718 | sctp_endpoint_hold(ep); | 739 | sctp_endpoint_hold(ep); |
719 | sock_hold(epb->sk); | ||
720 | read_unlock(&head->lock); | 740 | read_unlock(&head->lock); |
721 | return ep; | 741 | return ep; |
722 | } | 742 | } |
@@ -818,7 +838,6 @@ static struct sctp_association *__sctp_lookup_association( | |||
818 | hit: | 838 | hit: |
819 | *pt = transport; | 839 | *pt = transport; |
820 | sctp_association_hold(asoc); | 840 | sctp_association_hold(asoc); |
821 | sock_hold(epb->sk); | ||
822 | read_unlock(&head->lock); | 841 | read_unlock(&head->lock); |
823 | return asoc; | 842 | return asoc; |
824 | } | 843 | } |
@@ -846,7 +865,6 @@ int sctp_has_association(const union sctp_addr *laddr, | |||
846 | struct sctp_transport *transport; | 865 | struct sctp_transport *transport; |
847 | 866 | ||
848 | if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) { | 867 | if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) { |
849 | sock_put(asoc->base.sk); | ||
850 | sctp_association_put(asoc); | 868 | sctp_association_put(asoc); |
851 | return 1; | 869 | return 1; |
852 | } | 870 | } |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 8d1dc24bab4c..c5beb2ad7ef7 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -498,10 +498,6 @@ static void sctp_cmd_assoc_failed(sctp_cmd_seq_t *commands, | |||
498 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 498 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, |
499 | SCTP_STATE(SCTP_STATE_CLOSED)); | 499 | SCTP_STATE(SCTP_STATE_CLOSED)); |
500 | 500 | ||
501 | /* Set sk_err to ECONNRESET on a 1-1 style socket. */ | ||
502 | if (!sctp_style(asoc->base.sk, UDP)) | ||
503 | asoc->base.sk->sk_err = ECONNRESET; | ||
504 | |||
505 | /* SEND_FAILED sent later when cleaning up the association. */ | 501 | /* SEND_FAILED sent later when cleaning up the association. */ |
506 | asoc->outqueue.error = error; | 502 | asoc->outqueue.error = error; |
507 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); | 503 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); |
@@ -838,6 +834,15 @@ static void sctp_cmd_del_non_primary(struct sctp_association *asoc) | |||
838 | return; | 834 | return; |
839 | } | 835 | } |
840 | 836 | ||
837 | /* Helper function to set sk_err on a 1-1 style socket. */ | ||
838 | static void sctp_cmd_set_sk_err(struct sctp_association *asoc, int error) | ||
839 | { | ||
840 | struct sock *sk = asoc->base.sk; | ||
841 | |||
842 | if (!sctp_style(sk, UDP)) | ||
843 | sk->sk_err = error; | ||
844 | } | ||
845 | |||
841 | /* These three macros allow us to pull the debugging code out of the | 846 | /* These three macros allow us to pull the debugging code out of the |
842 | * main flow of sctp_do_sm() to keep attention focused on the real | 847 | * main flow of sctp_do_sm() to keep attention focused on the real |
843 | * functionality there. | 848 | * functionality there. |
@@ -1458,6 +1463,9 @@ static int sctp_cmd_interpreter(sctp_event_t event_type, | |||
1458 | local_cork = 0; | 1463 | local_cork = 0; |
1459 | asoc->peer.retran_path = t; | 1464 | asoc->peer.retran_path = t; |
1460 | break; | 1465 | break; |
1466 | case SCTP_CMD_SET_SK_ERR: | ||
1467 | sctp_cmd_set_sk_err(asoc, cmd->obj.error); | ||
1468 | break; | ||
1461 | default: | 1469 | default: |
1462 | printk(KERN_WARNING "Impossible command: %u, %p\n", | 1470 | printk(KERN_WARNING "Impossible command: %u, %p\n", |
1463 | cmd->verb, cmd->obj.ptr); | 1471 | cmd->verb, cmd->obj.ptr); |
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 8cdba51ec076..8bc279219a72 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -93,7 +93,7 @@ static sctp_disposition_t sctp_sf_shut_8_4_5(const struct sctp_endpoint *ep, | |||
93 | static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk); | 93 | static struct sctp_sackhdr *sctp_sm_pull_sack(struct sctp_chunk *chunk); |
94 | 94 | ||
95 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, | 95 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, |
96 | __u16 error, | 96 | __u16 error, int sk_err, |
97 | const struct sctp_association *asoc, | 97 | const struct sctp_association *asoc, |
98 | struct sctp_transport *transport); | 98 | struct sctp_transport *transport); |
99 | 99 | ||
@@ -448,7 +448,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
448 | __u32 init_tag; | 448 | __u32 init_tag; |
449 | struct sctp_chunk *err_chunk; | 449 | struct sctp_chunk *err_chunk; |
450 | struct sctp_packet *packet; | 450 | struct sctp_packet *packet; |
451 | sctp_disposition_t ret; | 451 | __u16 error; |
452 | 452 | ||
453 | if (!sctp_vtag_verify(chunk, asoc)) | 453 | if (!sctp_vtag_verify(chunk, asoc)) |
454 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 454 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
@@ -480,11 +480,9 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
480 | goto nomem; | 480 | goto nomem; |
481 | 481 | ||
482 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); | 482 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); |
483 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 483 | return sctp_stop_t1_and_abort(commands, SCTP_ERROR_INV_PARAM, |
484 | SCTP_STATE(SCTP_STATE_CLOSED)); | 484 | ECONNREFUSED, asoc, |
485 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 485 | chunk->transport); |
486 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, SCTP_NULL()); | ||
487 | return SCTP_DISPOSITION_DELETE_TCB; | ||
488 | } | 486 | } |
489 | 487 | ||
490 | /* Verify the INIT chunk before processing it. */ | 488 | /* Verify the INIT chunk before processing it. */ |
@@ -511,27 +509,16 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(const struct sctp_endpoint *ep, | |||
511 | sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, | 509 | sctp_add_cmd_sf(commands, SCTP_CMD_SEND_PKT, |
512 | SCTP_PACKET(packet)); | 510 | SCTP_PACKET(packet)); |
513 | SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); | 511 | SCTP_INC_STATS(SCTP_MIB_OUTCTRLCHUNKS); |
514 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 512 | error = SCTP_ERROR_INV_PARAM; |
515 | SCTP_STATE(SCTP_STATE_CLOSED)); | ||
516 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, | ||
517 | SCTP_NULL()); | ||
518 | return SCTP_DISPOSITION_CONSUME; | ||
519 | } else { | 513 | } else { |
520 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | 514 | error = SCTP_ERROR_NO_RESOURCE; |
521 | SCTP_STATE(SCTP_STATE_CLOSED)); | ||
522 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, | ||
523 | SCTP_NULL()); | ||
524 | return SCTP_DISPOSITION_NOMEM; | ||
525 | } | 515 | } |
526 | } else { | 516 | } else { |
527 | ret = sctp_sf_tabort_8_4_8(ep, asoc, type, arg, | 517 | sctp_sf_tabort_8_4_8(ep, asoc, type, arg, commands); |
528 | commands); | 518 | error = SCTP_ERROR_INV_PARAM; |
529 | sctp_add_cmd_sf(commands, SCTP_CMD_NEW_STATE, | ||
530 | SCTP_STATE(SCTP_STATE_CLOSED)); | ||
531 | sctp_add_cmd_sf(commands, SCTP_CMD_DELETE_TCB, | ||
532 | SCTP_NULL()); | ||
533 | return ret; | ||
534 | } | 519 | } |
520 | return sctp_stop_t1_and_abort(commands, error, ECONNREFUSED, | ||
521 | asoc, chunk->transport); | ||
535 | } | 522 | } |
536 | 523 | ||
537 | /* Tag the variable length parameters. Note that we never | 524 | /* Tag the variable length parameters. Note that we never |
@@ -886,6 +873,8 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, | |||
886 | struct sctp_transport *transport = (struct sctp_transport *) arg; | 873 | struct sctp_transport *transport = (struct sctp_transport *) arg; |
887 | 874 | ||
888 | if (asoc->overall_error_count >= asoc->max_retrans) { | 875 | if (asoc->overall_error_count >= asoc->max_retrans) { |
876 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
877 | SCTP_ERROR(ETIMEDOUT)); | ||
889 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ | 878 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ |
890 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 879 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
891 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 880 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
@@ -1030,6 +1019,12 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, | |||
1030 | commands); | 1019 | commands); |
1031 | 1020 | ||
1032 | hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; | 1021 | hbinfo = (sctp_sender_hb_info_t *) chunk->skb->data; |
1022 | /* Make sure that the length of the parameter is what we expect */ | ||
1023 | if (ntohs(hbinfo->param_hdr.length) != | ||
1024 | sizeof(sctp_sender_hb_info_t)) { | ||
1025 | return SCTP_DISPOSITION_DISCARD; | ||
1026 | } | ||
1027 | |||
1033 | from_addr = hbinfo->daddr; | 1028 | from_addr = hbinfo->daddr; |
1034 | link = sctp_assoc_lookup_paddr(asoc, &from_addr); | 1029 | link = sctp_assoc_lookup_paddr(asoc, &from_addr); |
1035 | 1030 | ||
@@ -2126,6 +2121,8 @@ static sctp_disposition_t sctp_sf_do_5_2_6_stale(const struct sctp_endpoint *ep, | |||
2126 | int attempts = asoc->init_err_counter + 1; | 2121 | int attempts = asoc->init_err_counter + 1; |
2127 | 2122 | ||
2128 | if (attempts > asoc->max_init_attempts) { | 2123 | if (attempts > asoc->max_init_attempts) { |
2124 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
2125 | SCTP_ERROR(ETIMEDOUT)); | ||
2129 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 2126 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
2130 | SCTP_U32(SCTP_ERROR_STALE_COOKIE)); | 2127 | SCTP_U32(SCTP_ERROR_STALE_COOKIE)); |
2131 | return SCTP_DISPOSITION_DELETE_TCB; | 2128 | return SCTP_DISPOSITION_DELETE_TCB; |
@@ -2262,6 +2259,7 @@ sctp_disposition_t sctp_sf_do_9_1_abort(const struct sctp_endpoint *ep, | |||
2262 | if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr)) | 2259 | if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr)) |
2263 | error = ((sctp_errhdr_t *)chunk->skb->data)->cause; | 2260 | error = ((sctp_errhdr_t *)chunk->skb->data)->cause; |
2264 | 2261 | ||
2262 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ECONNRESET)); | ||
2265 | /* ASSOC_FAILED will DELETE_TCB. */ | 2263 | /* ASSOC_FAILED will DELETE_TCB. */ |
2266 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error)); | 2264 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, SCTP_U32(error)); |
2267 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 2265 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
@@ -2306,7 +2304,8 @@ sctp_disposition_t sctp_sf_cookie_wait_abort(const struct sctp_endpoint *ep, | |||
2306 | if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr)) | 2304 | if (len >= sizeof(struct sctp_chunkhdr) + sizeof(struct sctp_errhdr)) |
2307 | error = ((sctp_errhdr_t *)chunk->skb->data)->cause; | 2305 | error = ((sctp_errhdr_t *)chunk->skb->data)->cause; |
2308 | 2306 | ||
2309 | return sctp_stop_t1_and_abort(commands, error, asoc, chunk->transport); | 2307 | return sctp_stop_t1_and_abort(commands, error, ECONNREFUSED, asoc, |
2308 | chunk->transport); | ||
2310 | } | 2309 | } |
2311 | 2310 | ||
2312 | /* | 2311 | /* |
@@ -2318,7 +2317,8 @@ sctp_disposition_t sctp_sf_cookie_wait_icmp_abort(const struct sctp_endpoint *ep | |||
2318 | void *arg, | 2317 | void *arg, |
2319 | sctp_cmd_seq_t *commands) | 2318 | sctp_cmd_seq_t *commands) |
2320 | { | 2319 | { |
2321 | return sctp_stop_t1_and_abort(commands, SCTP_ERROR_NO_ERROR, asoc, | 2320 | return sctp_stop_t1_and_abort(commands, SCTP_ERROR_NO_ERROR, |
2321 | ENOPROTOOPT, asoc, | ||
2322 | (struct sctp_transport *)arg); | 2322 | (struct sctp_transport *)arg); |
2323 | } | 2323 | } |
2324 | 2324 | ||
@@ -2343,7 +2343,7 @@ sctp_disposition_t sctp_sf_cookie_echoed_abort(const struct sctp_endpoint *ep, | |||
2343 | * This is common code called by several sctp_sf_*_abort() functions above. | 2343 | * This is common code called by several sctp_sf_*_abort() functions above. |
2344 | */ | 2344 | */ |
2345 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, | 2345 | static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, |
2346 | __u16 error, | 2346 | __u16 error, int sk_err, |
2347 | const struct sctp_association *asoc, | 2347 | const struct sctp_association *asoc, |
2348 | struct sctp_transport *transport) | 2348 | struct sctp_transport *transport) |
2349 | { | 2349 | { |
@@ -2353,6 +2353,7 @@ static sctp_disposition_t sctp_stop_t1_and_abort(sctp_cmd_seq_t *commands, | |||
2353 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 2353 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
2354 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 2354 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
2355 | SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); | 2355 | SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); |
2356 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(sk_err)); | ||
2356 | /* CMD_INIT_FAILED will DELETE_TCB. */ | 2357 | /* CMD_INIT_FAILED will DELETE_TCB. */ |
2357 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 2358 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
2358 | SCTP_U32(error)); | 2359 | SCTP_U32(error)); |
@@ -3336,6 +3337,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, | |||
3336 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 3337 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
3337 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); | 3338 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); |
3338 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); | 3339 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); |
3340 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
3341 | SCTP_ERROR(ECONNABORTED)); | ||
3339 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3342 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
3340 | SCTP_U32(SCTP_ERROR_ASCONF_ACK)); | 3343 | SCTP_U32(SCTP_ERROR_ASCONF_ACK)); |
3341 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 3344 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
@@ -3362,6 +3365,8 @@ sctp_disposition_t sctp_sf_do_asconf_ack(const struct sctp_endpoint *ep, | |||
3362 | * processing the rest of the chunks in the packet. | 3365 | * processing the rest of the chunks in the packet. |
3363 | */ | 3366 | */ |
3364 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); | 3367 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); |
3368 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
3369 | SCTP_ERROR(ECONNABORTED)); | ||
3365 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3370 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
3366 | SCTP_U32(SCTP_ERROR_ASCONF_ACK)); | 3371 | SCTP_U32(SCTP_ERROR_ASCONF_ACK)); |
3367 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 3372 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
@@ -3714,9 +3719,13 @@ static sctp_disposition_t sctp_sf_violation_chunklen( | |||
3714 | if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { | 3719 | if (asoc->state <= SCTP_STATE_COOKIE_ECHOED) { |
3715 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 3720 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
3716 | SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); | 3721 | SCTP_TO(SCTP_EVENT_TIMEOUT_T1_INIT)); |
3722 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
3723 | SCTP_ERROR(ECONNREFUSED)); | ||
3717 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 3724 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
3718 | SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); | 3725 | SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); |
3719 | } else { | 3726 | } else { |
3727 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
3728 | SCTP_ERROR(ECONNABORTED)); | ||
3720 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 3729 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
3721 | SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); | 3730 | SCTP_U32(SCTP_ERROR_PROTO_VIOLATION)); |
3722 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); | 3731 | SCTP_DEC_STATS(SCTP_MIB_CURRESTAB); |
@@ -4034,6 +4043,8 @@ sctp_disposition_t sctp_sf_do_9_1_prm_abort( | |||
4034 | * TCB. This is a departure from our typical NOMEM handling. | 4043 | * TCB. This is a departure from our typical NOMEM handling. |
4035 | */ | 4044 | */ |
4036 | 4045 | ||
4046 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4047 | SCTP_ERROR(ECONNABORTED)); | ||
4037 | /* Delete the established association. */ | 4048 | /* Delete the established association. */ |
4038 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4049 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4039 | SCTP_U32(SCTP_ERROR_USER_ABORT)); | 4050 | SCTP_U32(SCTP_ERROR_USER_ABORT)); |
@@ -4175,6 +4186,8 @@ sctp_disposition_t sctp_sf_cookie_wait_prm_abort( | |||
4175 | * TCB. This is a departure from our typical NOMEM handling. | 4186 | * TCB. This is a departure from our typical NOMEM handling. |
4176 | */ | 4187 | */ |
4177 | 4188 | ||
4189 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4190 | SCTP_ERROR(ECONNREFUSED)); | ||
4178 | /* Delete the established association. */ | 4191 | /* Delete the established association. */ |
4179 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 4192 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
4180 | SCTP_U32(SCTP_ERROR_USER_ABORT)); | 4193 | SCTP_U32(SCTP_ERROR_USER_ABORT)); |
@@ -4543,6 +4556,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep, | |||
4543 | struct sctp_transport *transport = arg; | 4556 | struct sctp_transport *transport = arg; |
4544 | 4557 | ||
4545 | if (asoc->overall_error_count >= asoc->max_retrans) { | 4558 | if (asoc->overall_error_count >= asoc->max_retrans) { |
4559 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4560 | SCTP_ERROR(ETIMEDOUT)); | ||
4546 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ | 4561 | /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ |
4547 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4562 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4548 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4563 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
@@ -4662,6 +4677,8 @@ sctp_disposition_t sctp_sf_t1_init_timer_expire(const struct sctp_endpoint *ep, | |||
4662 | SCTP_DEBUG_PRINTK("Giving up on INIT, attempts: %d" | 4677 | SCTP_DEBUG_PRINTK("Giving up on INIT, attempts: %d" |
4663 | " max_init_attempts: %d\n", | 4678 | " max_init_attempts: %d\n", |
4664 | attempts, asoc->max_init_attempts); | 4679 | attempts, asoc->max_init_attempts); |
4680 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4681 | SCTP_ERROR(ETIMEDOUT)); | ||
4665 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 4682 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
4666 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4683 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
4667 | return SCTP_DISPOSITION_DELETE_TCB; | 4684 | return SCTP_DISPOSITION_DELETE_TCB; |
@@ -4711,6 +4728,8 @@ sctp_disposition_t sctp_sf_t1_cookie_timer_expire(const struct sctp_endpoint *ep | |||
4711 | 4728 | ||
4712 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); | 4729 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl)); |
4713 | } else { | 4730 | } else { |
4731 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4732 | SCTP_ERROR(ETIMEDOUT)); | ||
4714 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, | 4733 | sctp_add_cmd_sf(commands, SCTP_CMD_INIT_FAILED, |
4715 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4734 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
4716 | return SCTP_DISPOSITION_DELETE_TCB; | 4735 | return SCTP_DISPOSITION_DELETE_TCB; |
@@ -4742,6 +4761,8 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep, | |||
4742 | 4761 | ||
4743 | SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); | 4762 | SCTP_DEBUG_PRINTK("Timer T2 expired.\n"); |
4744 | if (asoc->overall_error_count >= asoc->max_retrans) { | 4763 | if (asoc->overall_error_count >= asoc->max_retrans) { |
4764 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4765 | SCTP_ERROR(ETIMEDOUT)); | ||
4745 | /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ | 4766 | /* Note: CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */ |
4746 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4767 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4747 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4768 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
@@ -4817,6 +4838,8 @@ sctp_disposition_t sctp_sf_t4_timer_expire( | |||
4817 | if (asoc->overall_error_count >= asoc->max_retrans) { | 4838 | if (asoc->overall_error_count >= asoc->max_retrans) { |
4818 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, | 4839 | sctp_add_cmd_sf(commands, SCTP_CMD_TIMER_STOP, |
4819 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); | 4840 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); |
4841 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4842 | SCTP_ERROR(ETIMEDOUT)); | ||
4820 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4843 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4821 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4844 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
4822 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 4845 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
@@ -4870,6 +4893,8 @@ sctp_disposition_t sctp_sf_t5_timer_expire(const struct sctp_endpoint *ep, | |||
4870 | goto nomem; | 4893 | goto nomem; |
4871 | 4894 | ||
4872 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); | 4895 | sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); |
4896 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
4897 | SCTP_ERROR(ETIMEDOUT)); | ||
4873 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 4898 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
4874 | SCTP_U32(SCTP_ERROR_NO_ERROR)); | 4899 | SCTP_U32(SCTP_ERROR_NO_ERROR)); |
4875 | 4900 | ||
@@ -5309,6 +5334,8 @@ static int sctp_eat_data(const struct sctp_association *asoc, | |||
5309 | * processing the rest of the chunks in the packet. | 5334 | * processing the rest of the chunks in the packet. |
5310 | */ | 5335 | */ |
5311 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); | 5336 | sctp_add_cmd_sf(commands, SCTP_CMD_DISCARD_PACKET,SCTP_NULL()); |
5337 | sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, | ||
5338 | SCTP_ERROR(ECONNABORTED)); | ||
5312 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, | 5339 | sctp_add_cmd_sf(commands, SCTP_CMD_ASSOC_FAILED, |
5313 | SCTP_U32(SCTP_ERROR_NO_DATA)); | 5340 | SCTP_U32(SCTP_ERROR_NO_DATA)); |
5314 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); | 5341 | SCTP_INC_STATS(SCTP_MIB_ABORTEDS); |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index b6e4b89539b3..174d4d35e951 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1057,6 +1057,7 @@ static int __sctp_connect(struct sock* sk, | |||
1057 | inet_sk(sk)->dport = htons(asoc->peer.port); | 1057 | inet_sk(sk)->dport = htons(asoc->peer.port); |
1058 | af = sctp_get_af_specific(to.sa.sa_family); | 1058 | af = sctp_get_af_specific(to.sa.sa_family); |
1059 | af->to_sk_daddr(&to, sk); | 1059 | af->to_sk_daddr(&to, sk); |
1060 | sk->sk_err = 0; | ||
1060 | 1061 | ||
1061 | timeo = sock_sndtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK); | 1062 | timeo = sock_sndtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK); |
1062 | err = sctp_wait_for_connect(asoc, &timeo); | 1063 | err = sctp_wait_for_connect(asoc, &timeo); |
@@ -1228,7 +1229,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) | |||
1228 | 1229 | ||
1229 | ep = sctp_sk(sk)->ep; | 1230 | ep = sctp_sk(sk)->ep; |
1230 | 1231 | ||
1231 | /* Walk all associations on a socket, not on an endpoint. */ | 1232 | /* Walk all associations on an endpoint. */ |
1232 | list_for_each_safe(pos, temp, &ep->asocs) { | 1233 | list_for_each_safe(pos, temp, &ep->asocs) { |
1233 | asoc = list_entry(pos, struct sctp_association, asocs); | 1234 | asoc = list_entry(pos, struct sctp_association, asocs); |
1234 | 1235 | ||
@@ -1241,13 +1242,13 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) | |||
1241 | if (sctp_state(asoc, CLOSED)) { | 1242 | if (sctp_state(asoc, CLOSED)) { |
1242 | sctp_unhash_established(asoc); | 1243 | sctp_unhash_established(asoc); |
1243 | sctp_association_free(asoc); | 1244 | sctp_association_free(asoc); |
1245 | continue; | ||
1246 | } | ||
1247 | } | ||
1244 | 1248 | ||
1245 | } else if (sock_flag(sk, SOCK_LINGER) && | 1249 | if (sock_flag(sk, SOCK_LINGER) && !sk->sk_lingertime) |
1246 | !sk->sk_lingertime) | 1250 | sctp_primitive_ABORT(asoc, NULL); |
1247 | sctp_primitive_ABORT(asoc, NULL); | 1251 | else |
1248 | else | ||
1249 | sctp_primitive_SHUTDOWN(asoc, NULL); | ||
1250 | } else | ||
1251 | sctp_primitive_SHUTDOWN(asoc, NULL); | 1252 | sctp_primitive_SHUTDOWN(asoc, NULL); |
1252 | } | 1253 | } |
1253 | 1254 | ||
@@ -5317,6 +5318,7 @@ static int sctp_wait_for_sndbuf(struct sctp_association *asoc, long *timeo_p, | |||
5317 | */ | 5318 | */ |
5318 | sctp_release_sock(sk); | 5319 | sctp_release_sock(sk); |
5319 | current_timeo = schedule_timeout(current_timeo); | 5320 | current_timeo = schedule_timeout(current_timeo); |
5321 | BUG_ON(sk != asoc->base.sk); | ||
5320 | sctp_lock_sock(sk); | 5322 | sctp_lock_sock(sk); |
5321 | 5323 | ||
5322 | *timeo_p = current_timeo; | 5324 | *timeo_p = current_timeo; |
@@ -5604,12 +5606,14 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
5604 | */ | 5606 | */ |
5605 | newsp->type = type; | 5607 | newsp->type = type; |
5606 | 5608 | ||
5607 | spin_lock_bh(&oldsk->sk_lock.slock); | 5609 | /* Mark the new socket "in-use" by the user so that any packets |
5608 | /* Migrate the backlog from oldsk to newsk. */ | 5610 | * that may arrive on the association after we've moved it are |
5609 | sctp_backlog_migrate(assoc, oldsk, newsk); | 5611 | * queued to the backlog. This prevents a potential race between |
5610 | /* Migrate the association to the new socket. */ | 5612 | * backlog processing on the old socket and new-packet processing |
5613 | * on the new socket. | ||
5614 | */ | ||
5615 | sctp_lock_sock(newsk); | ||
5611 | sctp_assoc_migrate(assoc, newsk); | 5616 | sctp_assoc_migrate(assoc, newsk); |
5612 | spin_unlock_bh(&oldsk->sk_lock.slock); | ||
5613 | 5617 | ||
5614 | /* If the association on the newsk is already closed before accept() | 5618 | /* If the association on the newsk is already closed before accept() |
5615 | * is called, set RCV_SHUTDOWN flag. | 5619 | * is called, set RCV_SHUTDOWN flag. |
@@ -5618,6 +5622,7 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
5618 | newsk->sk_shutdown |= RCV_SHUTDOWN; | 5622 | newsk->sk_shutdown |= RCV_SHUTDOWN; |
5619 | 5623 | ||
5620 | newsk->sk_state = SCTP_SS_ESTABLISHED; | 5624 | newsk->sk_state = SCTP_SS_ESTABLISHED; |
5625 | sctp_release_sock(newsk); | ||
5621 | } | 5626 | } |
5622 | 5627 | ||
5623 | /* This proto struct describes the ULP interface for SCTP. */ | 5628 | /* This proto struct describes the ULP interface for SCTP. */ |
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index 3ac4193a78ed..7026b0866b7b 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c | |||
@@ -159,6 +159,7 @@ struct cache_head *sunrpc_cache_update(struct cache_detail *detail, | |||
159 | detail->update(tmp, new); | 159 | detail->update(tmp, new); |
160 | tmp->next = *head; | 160 | tmp->next = *head; |
161 | *head = tmp; | 161 | *head = tmp; |
162 | detail->entries++; | ||
162 | cache_get(tmp); | 163 | cache_get(tmp); |
163 | is_new = cache_fresh_locked(tmp, new->expiry_time); | 164 | is_new = cache_fresh_locked(tmp, new->expiry_time); |
164 | cache_fresh_locked(old, 0); | 165 | cache_fresh_locked(old, 0); |
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index b54971059f16..891a6090cc09 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
@@ -62,7 +62,7 @@ int xfrm_parse_spi(struct sk_buff *skb, u8 nexthdr, u32 *spi, u32 *seq) | |||
62 | case IPPROTO_COMP: | 62 | case IPPROTO_COMP: |
63 | if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) | 63 | if (!pskb_may_pull(skb, sizeof(struct ip_comp_hdr))) |
64 | return -EINVAL; | 64 | return -EINVAL; |
65 | *spi = ntohl(ntohs(*(u16*)(skb->h.raw + 2))); | 65 | *spi = htonl(ntohs(*(u16*)(skb->h.raw + 2))); |
66 | *seq = 0; | 66 | *seq = 0; |
67 | return 0; | 67 | return 0; |
68 | default: | 68 | default: |
diff --git a/scripts/gen_initramfs_list.sh b/scripts/gen_initramfs_list.sh index 56b3bed1108f..331c079f029b 100644 --- a/scripts/gen_initramfs_list.sh +++ b/scripts/gen_initramfs_list.sh | |||
@@ -200,7 +200,11 @@ input_file() { | |||
200 | print_mtime "$1" >> ${output} | 200 | print_mtime "$1" >> ${output} |
201 | cat "$1" >> ${output} | 201 | cat "$1" >> ${output} |
202 | else | 202 | else |
203 | grep ^file "$1" | cut -d ' ' -f 3 | 203 | cat "$1" | while read type dir file perm ; do |
204 | if [ "$type" == "file" ]; then | ||
205 | echo "$file \\"; | ||
206 | fi | ||
207 | done | ||
204 | fi | 208 | fi |
205 | elif [ -d "$1" ]; then | 209 | elif [ -d "$1" ]; then |
206 | dir_filelist "$1" | 210 | dir_filelist "$1" |
diff --git a/scripts/mkmakefile b/scripts/mkmakefile index a22cbedd3b3e..7f9d544f9b6c 100644 --- a/scripts/mkmakefile +++ b/scripts/mkmakefile | |||
@@ -10,7 +10,10 @@ | |||
10 | # $4 - patchlevel | 10 | # $4 - patchlevel |
11 | 11 | ||
12 | 12 | ||
13 | cat << EOF | 13 | test ! -r $2/Makefile -o -O $2/Makefile || exit 0 |
14 | echo " GEN $2/Makefile" | ||
15 | |||
16 | cat << EOF > $2/Makefile | ||
14 | # Automatically generated by $0: don't edit | 17 | # Automatically generated by $0: don't edit |
15 | 18 | ||
16 | VERSION = $3 | 19 | VERSION = $3 |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index cd00e9f07589..d0f86ed43f7a 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -487,14 +487,14 @@ static int strrcmp(const char *s, const char *sub) | |||
487 | * atsym =__param* | 487 | * atsym =__param* |
488 | * | 488 | * |
489 | * Pattern 2: | 489 | * Pattern 2: |
490 | * Many drivers utilise a *_driver container with references to | 490 | * Many drivers utilise a *driver container with references to |
491 | * add, remove, probe functions etc. | 491 | * add, remove, probe functions etc. |
492 | * These functions may often be marked __init and we do not want to | 492 | * These functions may often be marked __init and we do not want to |
493 | * warn here. | 493 | * warn here. |
494 | * the pattern is identified by: | 494 | * the pattern is identified by: |
495 | * tosec = .init.text | .exit.text | .init.data | 495 | * tosec = .init.text | .exit.text | .init.data |
496 | * fromsec = .data | 496 | * fromsec = .data |
497 | * atsym = *_driver, *_template, *_sht, *_ops, *_probe, *probe_one | 497 | * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one |
498 | **/ | 498 | **/ |
499 | static int secref_whitelist(const char *tosec, const char *fromsec, | 499 | static int secref_whitelist(const char *tosec, const char *fromsec, |
500 | const char *atsym) | 500 | const char *atsym) |
@@ -502,7 +502,7 @@ static int secref_whitelist(const char *tosec, const char *fromsec, | |||
502 | int f1 = 1, f2 = 1; | 502 | int f1 = 1, f2 = 1; |
503 | const char **s; | 503 | const char **s; |
504 | const char *pat2sym[] = { | 504 | const char *pat2sym[] = { |
505 | "_driver", | 505 | "driver", |
506 | "_template", /* scsi uses *_template a lot */ | 506 | "_template", /* scsi uses *_template a lot */ |
507 | "_sht", /* scsi also used *_sht to some extent */ | 507 | "_sht", /* scsi also used *_sht to some extent */ |
508 | "_ops", | 508 | "_ops", |
@@ -697,29 +697,79 @@ static void check_sec_ref(struct module *mod, const char *modname, | |||
697 | 697 | ||
698 | /* Walk through all sections */ | 698 | /* Walk through all sections */ |
699 | for (i = 0; i < hdr->e_shnum; i++) { | 699 | for (i = 0; i < hdr->e_shnum; i++) { |
700 | Elf_Rela *rela; | 700 | const char *name = secstrings + sechdrs[i].sh_name; |
701 | Elf_Rela *start = (void *)hdr + sechdrs[i].sh_offset; | 701 | const char *secname; |
702 | Elf_Rela *stop = (void*)start + sechdrs[i].sh_size; | 702 | Elf_Rela r; |
703 | const char *name = secstrings + sechdrs[i].sh_name + | 703 | unsigned int r_sym; |
704 | strlen(".rela"); | ||
705 | /* We want to process only relocation sections and not .init */ | 704 | /* We want to process only relocation sections and not .init */ |
706 | if (section_ref_ok(name) || (sechdrs[i].sh_type != SHT_RELA)) | 705 | if (sechdrs[i].sh_type == SHT_RELA) { |
707 | continue; | 706 | Elf_Rela *rela; |
707 | Elf_Rela *start = (void *)hdr + sechdrs[i].sh_offset; | ||
708 | Elf_Rela *stop = (void*)start + sechdrs[i].sh_size; | ||
709 | name += strlen(".rela"); | ||
710 | if (section_ref_ok(name)) | ||
711 | continue; | ||
708 | 712 | ||
709 | for (rela = start; rela < stop; rela++) { | 713 | for (rela = start; rela < stop; rela++) { |
710 | Elf_Rela r; | 714 | r.r_offset = TO_NATIVE(rela->r_offset); |
711 | const char *secname; | 715 | #if KERNEL_ELFCLASS == ELFCLASS64 |
712 | r.r_offset = TO_NATIVE(rela->r_offset); | 716 | if (hdr->e_machine == EM_MIPS) { |
713 | r.r_info = TO_NATIVE(rela->r_info); | 717 | r_sym = ELF64_MIPS_R_SYM(rela->r_info); |
714 | r.r_addend = TO_NATIVE(rela->r_addend); | 718 | r_sym = TO_NATIVE(r_sym); |
715 | sym = elf->symtab_start + ELF_R_SYM(r.r_info); | 719 | } else { |
716 | /* Skip special sections */ | 720 | r.r_info = TO_NATIVE(rela->r_info); |
717 | if (sym->st_shndx >= SHN_LORESERVE) | 721 | r_sym = ELF_R_SYM(r.r_info); |
722 | } | ||
723 | #else | ||
724 | r.r_info = TO_NATIVE(rela->r_info); | ||
725 | r_sym = ELF_R_SYM(r.r_info); | ||
726 | #endif | ||
727 | r.r_addend = TO_NATIVE(rela->r_addend); | ||
728 | sym = elf->symtab_start + r_sym; | ||
729 | /* Skip special sections */ | ||
730 | if (sym->st_shndx >= SHN_LORESERVE) | ||
731 | continue; | ||
732 | |||
733 | secname = secstrings + | ||
734 | sechdrs[sym->st_shndx].sh_name; | ||
735 | if (section(secname)) | ||
736 | warn_sec_mismatch(modname, name, | ||
737 | elf, sym, r); | ||
738 | } | ||
739 | } else if (sechdrs[i].sh_type == SHT_REL) { | ||
740 | Elf_Rel *rel; | ||
741 | Elf_Rel *start = (void *)hdr + sechdrs[i].sh_offset; | ||
742 | Elf_Rel *stop = (void*)start + sechdrs[i].sh_size; | ||
743 | name += strlen(".rel"); | ||
744 | if (section_ref_ok(name)) | ||
718 | continue; | 745 | continue; |
719 | 746 | ||
720 | secname = secstrings + sechdrs[sym->st_shndx].sh_name; | 747 | for (rel = start; rel < stop; rel++) { |
721 | if (section(secname)) | 748 | r.r_offset = TO_NATIVE(rel->r_offset); |
722 | warn_sec_mismatch(modname, name, elf, sym, r); | 749 | #if KERNEL_ELFCLASS == ELFCLASS64 |
750 | if (hdr->e_machine == EM_MIPS) { | ||
751 | r_sym = ELF64_MIPS_R_SYM(rel->r_info); | ||
752 | r_sym = TO_NATIVE(r_sym); | ||
753 | } else { | ||
754 | r.r_info = TO_NATIVE(rel->r_info); | ||
755 | r_sym = ELF_R_SYM(r.r_info); | ||
756 | } | ||
757 | #else | ||
758 | r.r_info = TO_NATIVE(rel->r_info); | ||
759 | r_sym = ELF_R_SYM(r.r_info); | ||
760 | #endif | ||
761 | r.r_addend = 0; | ||
762 | sym = elf->symtab_start + r_sym; | ||
763 | /* Skip special sections */ | ||
764 | if (sym->st_shndx >= SHN_LORESERVE) | ||
765 | continue; | ||
766 | |||
767 | secname = secstrings + | ||
768 | sechdrs[sym->st_shndx].sh_name; | ||
769 | if (section(secname)) | ||
770 | warn_sec_mismatch(modname, name, | ||
771 | elf, sym, r); | ||
772 | } | ||
723 | } | 773 | } |
724 | } | 774 | } |
725 | } | 775 | } |
diff --git a/scripts/mod/modpost.h b/scripts/mod/modpost.h index b14255c72a37..861d866fcd83 100644 --- a/scripts/mod/modpost.h +++ b/scripts/mod/modpost.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define ELF_ST_BIND ELF32_ST_BIND | 21 | #define ELF_ST_BIND ELF32_ST_BIND |
22 | #define ELF_ST_TYPE ELF32_ST_TYPE | 22 | #define ELF_ST_TYPE ELF32_ST_TYPE |
23 | 23 | ||
24 | #define Elf_Rel Elf32_Rel | ||
24 | #define Elf_Rela Elf32_Rela | 25 | #define Elf_Rela Elf32_Rela |
25 | #define ELF_R_SYM ELF32_R_SYM | 26 | #define ELF_R_SYM ELF32_R_SYM |
26 | #define ELF_R_TYPE ELF32_R_TYPE | 27 | #define ELF_R_TYPE ELF32_R_TYPE |
@@ -34,11 +35,31 @@ | |||
34 | #define ELF_ST_BIND ELF64_ST_BIND | 35 | #define ELF_ST_BIND ELF64_ST_BIND |
35 | #define ELF_ST_TYPE ELF64_ST_TYPE | 36 | #define ELF_ST_TYPE ELF64_ST_TYPE |
36 | 37 | ||
38 | #define Elf_Rel Elf64_Rel | ||
37 | #define Elf_Rela Elf64_Rela | 39 | #define Elf_Rela Elf64_Rela |
38 | #define ELF_R_SYM ELF64_R_SYM | 40 | #define ELF_R_SYM ELF64_R_SYM |
39 | #define ELF_R_TYPE ELF64_R_TYPE | 41 | #define ELF_R_TYPE ELF64_R_TYPE |
40 | #endif | 42 | #endif |
41 | 43 | ||
44 | /* The 64-bit MIPS ELF ABI uses an unusual reloc format. */ | ||
45 | typedef struct | ||
46 | { | ||
47 | Elf32_Word r_sym; /* Symbol index */ | ||
48 | unsigned char r_ssym; /* Special symbol for 2nd relocation */ | ||
49 | unsigned char r_type3; /* 3rd relocation type */ | ||
50 | unsigned char r_type2; /* 2nd relocation type */ | ||
51 | unsigned char r_type1; /* 1st relocation type */ | ||
52 | } _Elf64_Mips_R_Info; | ||
53 | |||
54 | typedef union | ||
55 | { | ||
56 | Elf64_Xword r_info_number; | ||
57 | _Elf64_Mips_R_Info r_info_fields; | ||
58 | } _Elf64_Mips_R_Info_union; | ||
59 | |||
60 | #define ELF64_MIPS_R_SYM(i) \ | ||
61 | ((__extension__ (_Elf64_Mips_R_Info_union)(i)).r_info_fields.r_sym) | ||
62 | |||
42 | #if KERNEL_ELFDATA != HOST_ELFDATA | 63 | #if KERNEL_ELFDATA != HOST_ELFDATA |
43 | 64 | ||
44 | static inline void __endian(const void *src, void *dest, unsigned int size) | 65 | static inline void __endian(const void *src, void *dest, unsigned int size) |
@@ -48,8 +69,6 @@ static inline void __endian(const void *src, void *dest, unsigned int size) | |||
48 | ((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1]; | 69 | ((unsigned char*)dest)[i] = ((unsigned char*)src)[size - i-1]; |
49 | } | 70 | } |
50 | 71 | ||
51 | |||
52 | |||
53 | #define TO_NATIVE(x) \ | 72 | #define TO_NATIVE(x) \ |
54 | ({ \ | 73 | ({ \ |
55 | typeof(x) __x; \ | 74 | typeof(x) __x; \ |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index d987048d3f33..21dad415b896 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -3231,7 +3231,7 @@ static int selinux_socket_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) | |||
3231 | goto out; | 3231 | goto out; |
3232 | 3232 | ||
3233 | /* Handle mapped IPv4 packets arriving via IPv6 sockets */ | 3233 | /* Handle mapped IPv4 packets arriving via IPv6 sockets */ |
3234 | if (family == PF_INET6 && skb->protocol == ntohs(ETH_P_IP)) | 3234 | if (family == PF_INET6 && skb->protocol == htons(ETH_P_IP)) |
3235 | family = PF_INET; | 3235 | family = PF_INET; |
3236 | 3236 | ||
3237 | read_lock_bh(&sk->sk_callback_lock); | 3237 | read_lock_bh(&sk->sk_callback_lock); |
diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index 7177e98df7f3..c284dbb8b8c0 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c | |||
@@ -594,6 +594,10 @@ int security_sid_to_context(u32 sid, char **scontext, u32 *scontext_len) | |||
594 | 594 | ||
595 | *scontext_len = strlen(initial_sid_to_string[sid]) + 1; | 595 | *scontext_len = strlen(initial_sid_to_string[sid]) + 1; |
596 | scontextp = kmalloc(*scontext_len,GFP_ATOMIC); | 596 | scontextp = kmalloc(*scontext_len,GFP_ATOMIC); |
597 | if (!scontextp) { | ||
598 | rc = -ENOMEM; | ||
599 | goto out; | ||
600 | } | ||
597 | strcpy(scontextp, initial_sid_to_string[sid]); | 601 | strcpy(scontextp, initial_sid_to_string[sid]); |
598 | *scontext = scontextp; | 602 | *scontext = scontextp; |
599 | goto out; | 603 | goto out; |
diff --git a/sound/drivers/mpu401/mpu401.c b/sound/drivers/mpu401/mpu401.c index da7ef26995c3..77b06009735d 100644 --- a/sound/drivers/mpu401/mpu401.c +++ b/sound/drivers/mpu401/mpu401.c | |||
@@ -151,7 +151,7 @@ static struct pnp_device_id snd_mpu401_pnpids[] = { | |||
151 | 151 | ||
152 | MODULE_DEVICE_TABLE(pnp, snd_mpu401_pnpids); | 152 | MODULE_DEVICE_TABLE(pnp, snd_mpu401_pnpids); |
153 | 153 | ||
154 | static int __init snd_mpu401_pnp(int dev, struct pnp_dev *device, | 154 | static int __devinit snd_mpu401_pnp(int dev, struct pnp_dev *device, |
155 | const struct pnp_device_id *id) | 155 | const struct pnp_device_id *id) |
156 | { | 156 | { |
157 | if (!pnp_port_valid(device, 0) || | 157 | if (!pnp_port_valid(device, 0) || |
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index a36ec1daa5cb..e6945db8ed1b 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c | |||
@@ -85,6 +85,8 @@ | |||
85 | #include <linux/pnp.h> | 85 | #include <linux/pnp.h> |
86 | #include <linux/isapnp.h> | 86 | #include <linux/isapnp.h> |
87 | #include <linux/moduleparam.h> | 87 | #include <linux/moduleparam.h> |
88 | #include <linux/delay.h> | ||
89 | |||
88 | #include <asm/io.h> | 90 | #include <asm/io.h> |
89 | #include <asm/dma.h> | 91 | #include <asm/dma.h> |
90 | #include <sound/core.h> | 92 | #include <sound/core.h> |
diff --git a/sound/oss/ad1848.c b/sound/oss/ad1848.c index 49796be955f3..e04fa49b0dc8 100644 --- a/sound/oss/ad1848.c +++ b/sound/oss/ad1848.c | |||
@@ -2026,7 +2026,8 @@ int ad1848_init (char *name, struct resource *ports, int irq, int dma_playback, | |||
2026 | if (irq > 0) | 2026 | if (irq > 0) |
2027 | { | 2027 | { |
2028 | devc->dev_no = my_dev; | 2028 | devc->dev_no = my_dev; |
2029 | if (request_irq(devc->irq, adintr, 0, devc->name, (void *)my_dev) < 0) | 2029 | if (request_irq(devc->irq, adintr, 0, devc->name, |
2030 | (void *)(long)my_dev) < 0) | ||
2030 | { | 2031 | { |
2031 | printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n"); | 2032 | printk(KERN_WARNING "ad1848: Unable to allocate IRQ\n"); |
2032 | /* Don't free it either then.. */ | 2033 | /* Don't free it either then.. */ |
@@ -2175,7 +2176,7 @@ void ad1848_unload(int io_base, int irq, int dma_playback, int dma_capture, int | |||
2175 | if (!share_dma) | 2176 | if (!share_dma) |
2176 | { | 2177 | { |
2177 | if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */ | 2178 | if (devc->irq > 0) /* There is no point in freeing irq, if it wasn't allocated */ |
2178 | free_irq(devc->irq, (void *)devc->dev_no); | 2179 | free_irq(devc->irq, (void *)(long)devc->dev_no); |
2179 | 2180 | ||
2180 | sound_free_dma(dma_playback); | 2181 | sound_free_dma(dma_playback); |
2181 | 2182 | ||
@@ -2204,7 +2205,7 @@ irqreturn_t adintr(int irq, void *dev_id, struct pt_regs *dummy) | |||
2204 | unsigned char c930_stat = 0; | 2205 | unsigned char c930_stat = 0; |
2205 | int cnt = 0; | 2206 | int cnt = 0; |
2206 | 2207 | ||
2207 | dev = (int)dev_id; | 2208 | dev = (long)dev_id; |
2208 | devc = (ad1848_info *) audio_devs[dev]->devc; | 2209 | devc = (ad1848_info *) audio_devs[dev]->devc; |
2209 | 2210 | ||
2210 | interrupt_again: /* Jump back here if int status doesn't reset */ | 2211 | interrupt_again: /* Jump back here if int status doesn't reset */ |
@@ -2900,7 +2901,8 @@ static struct pnp_dev *activate_dev(char *devname, char *resname, struct pnp_dev | |||
2900 | return(dev); | 2901 | return(dev); |
2901 | } | 2902 | } |
2902 | 2903 | ||
2903 | static struct pnp_dev *ad1848_init_generic(struct pnp_card *bus, struct address_info *hw_config, int slot) | 2904 | static struct pnp_dev __init *ad1848_init_generic(struct pnp_card *bus, |
2905 | struct address_info *hw_config, int slot) | ||
2904 | { | 2906 | { |
2905 | 2907 | ||
2906 | /* Configure Audio device */ | 2908 | /* Configure Audio device */ |
diff --git a/sound/oss/nm256_audio.c b/sound/oss/nm256_audio.c index 7de079b202f2..6e662ac009ae 100644 --- a/sound/oss/nm256_audio.c +++ b/sound/oss/nm256_audio.c | |||
@@ -960,7 +960,7 @@ static struct ac97_mixer_value_list mixer_defaults[] = { | |||
960 | 960 | ||
961 | 961 | ||
962 | /* Installs the AC97 mixer into CARD. */ | 962 | /* Installs the AC97 mixer into CARD. */ |
963 | static int __init | 963 | static int __devinit |
964 | nm256_install_mixer (struct nm256_info *card) | 964 | nm256_install_mixer (struct nm256_info *card) |
965 | { | 965 | { |
966 | int mixer; | 966 | int mixer; |
@@ -995,7 +995,7 @@ nm256_install_mixer (struct nm256_info *card) | |||
995 | * RAM. | 995 | * RAM. |
996 | */ | 996 | */ |
997 | 997 | ||
998 | static void __init | 998 | static void __devinit |
999 | nm256_peek_for_sig (struct nm256_info *card) | 999 | nm256_peek_for_sig (struct nm256_info *card) |
1000 | { | 1000 | { |
1001 | u32 port1offset | 1001 | u32 port1offset |
@@ -1056,7 +1056,7 @@ nm256_install(struct pci_dev *pcidev, enum nm256rev rev, char *verstr) | |||
1056 | card->playing = 0; | 1056 | card->playing = 0; |
1057 | card->recording = 0; | 1057 | card->recording = 0; |
1058 | card->rev = rev; | 1058 | card->rev = rev; |
1059 | spin_lock_init(&card->lock); | 1059 | spin_lock_init(&card->lock); |
1060 | 1060 | ||
1061 | /* Init the memory port info. */ | 1061 | /* Init the memory port info. */ |
1062 | for (x = 0; x < 2; x++) { | 1062 | for (x = 0; x < 2; x++) { |