/[linux-patches]/genpatches-2.6/trunk/2.6.28/1001_linux-2.6.28.2.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.28/1001_linux-2.6.28.2.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1487 - (show annotations) (download)
Sun Jan 25 15:38:04 2009 UTC (5 years, 6 months ago) by mpagano
File size: 67093 byte(s)
Linux patch 2.6.28.2 and the removal of redundant and uncessary patches.
1 diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt
2 index 394d7d3..bef6550 100644
3 --- a/Documentation/sound/alsa/ALSA-Configuration.txt
4 +++ b/Documentation/sound/alsa/ALSA-Configuration.txt
5 @@ -979,9 +979,10 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed.
6 6stack 6-jack, separate surrounds (default)
7 3stack 3-stack, shared surrounds
8 laptop 2-channel only (FSC V2060, Samsung M50)
9 - laptop-eapd 2-channel with EAPD (Samsung R65, ASUS A6J)
10 + laptop-eapd 2-channel with EAPD (ASUS A6J)
11 laptop-automute 2-channel with EAPD and HP-automute (Lenovo N100)
12 ultra 2-channel with EAPD (Samsung Ultra tablet PC)
13 + samsung 2-channel with EAPD (Samsung R65)
14
15 AD1988/AD1988B/AD1989A/AD1989B
16 6stack 6-jack
17 diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
18 index 6bd91ed..0429d3e 100644
19 --- a/arch/ia64/Kconfig
20 +++ b/arch/ia64/Kconfig
21 @@ -17,6 +17,7 @@ config IA64
22 select ACPI if (!IA64_HP_SIM)
23 select PM if (!IA64_HP_SIM)
24 select ARCH_SUPPORTS_MSI
25 + select HAVE_UNSTABLE_SCHED_CLOCK
26 select HAVE_IDE
27 select HAVE_OPROFILE
28 select HAVE_KPROBES
29 diff --git a/arch/powerpc/mm/slice.c b/arch/powerpc/mm/slice.c
30 index db44e02..ba51948 100644
31 --- a/arch/powerpc/mm/slice.c
32 +++ b/arch/powerpc/mm/slice.c
33 @@ -710,9 +710,18 @@ int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
34 unsigned long len)
35 {
36 struct slice_mask mask, available;
37 + unsigned int psize = mm->context.user_psize;
38
39 mask = slice_range_to_mask(addr, len);
40 - available = slice_mask_for_size(mm, mm->context.user_psize);
41 + available = slice_mask_for_size(mm, psize);
42 +#ifdef CONFIG_PPC_64K_PAGES
43 + /* We need to account for 4k slices too */
44 + if (psize == MMU_PAGE_64K) {
45 + struct slice_mask compat_mask;
46 + compat_mask = slice_mask_for_size(mm, MMU_PAGE_4K);
47 + or_mask(available, compat_mask);
48 + }
49 +#endif
50
51 #if 0 /* too verbose */
52 slice_dbg("is_hugepage_only_range(mm=%p, addr=%lx, len=%lx)\n",
53 diff --git a/drivers/firmware/dell_rbu.c b/drivers/firmware/dell_rbu.c
54 index 13946eb..b4704e1 100644
55 --- a/drivers/firmware/dell_rbu.c
56 +++ b/drivers/firmware/dell_rbu.c
57 @@ -576,7 +576,7 @@ static ssize_t read_rbu_image_type(struct kobject *kobj,
58 {
59 int size = 0;
60 if (!pos)
61 - size = sprintf(buffer, "%s\n", image_type);
62 + size = scnprintf(buffer, count, "%s\n", image_type);
63 return size;
64 }
65
66 @@ -648,7 +648,7 @@ static ssize_t read_rbu_packet_size(struct kobject *kobj,
67 int size = 0;
68 if (!pos) {
69 spin_lock(&rbu_data.lock);
70 - size = sprintf(buffer, "%lu\n", rbu_data.packetsize);
71 + size = scnprintf(buffer, count, "%lu\n", rbu_data.packetsize);
72 spin_unlock(&rbu_data.lock);
73 }
74 return size;
75 diff --git a/drivers/hwmon/abituguru3.c b/drivers/hwmon/abituguru3.c
76 index 70bb854..fcf74eb 100644
77 --- a/drivers/hwmon/abituguru3.c
78 +++ b/drivers/hwmon/abituguru3.c
79 @@ -1153,7 +1153,7 @@ static int __init abituguru3_dmi_detect(void)
80
81 static inline int abituguru3_dmi_detect(void)
82 {
83 - return -ENODEV;
84 + return 1;
85 }
86
87 #endif /* CONFIG_DMI */
88 diff --git a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c
89 index b4882cc..d32c1ee 100644
90 --- a/drivers/misc/sgi-xp/xpc_sn2.c
91 +++ b/drivers/misc/sgi-xp/xpc_sn2.c
92 @@ -904,7 +904,7 @@ xpc_update_partition_info_sn2(struct xpc_partition *part, u8 remote_rp_version,
93 dev_dbg(xpc_part, " remote_vars_pa = 0x%016lx\n",
94 part_sn2->remote_vars_pa);
95
96 - part->last_heartbeat = remote_vars->heartbeat;
97 + part->last_heartbeat = remote_vars->heartbeat - 1;
98 dev_dbg(xpc_part, " last_heartbeat = 0x%016lx\n",
99 part->last_heartbeat);
100
101 diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
102 index b5d6b9a..b427978 100644
103 --- a/drivers/net/irda/irda-usb.c
104 +++ b/drivers/net/irda/irda-usb.c
105 @@ -1075,7 +1075,7 @@ static int stir421x_patch_device(struct irda_usb_cb *self)
106 {
107 unsigned int i;
108 int ret;
109 - char stir421x_fw_name[11];
110 + char stir421x_fw_name[12];
111 const struct firmware *fw;
112 const unsigned char *fw_version_ptr; /* pointer to version string */
113 unsigned long fw_version = 0;
114 diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
115 index 34fe7ef..9934dbc 100644
116 --- a/drivers/net/r6040.c
117 +++ b/drivers/net/r6040.c
118 @@ -49,8 +49,8 @@
119 #include <asm/processor.h>
120
121 #define DRV_NAME "r6040"
122 -#define DRV_VERSION "0.18"
123 -#define DRV_RELDATE "13Jul2008"
124 +#define DRV_VERSION "0.19"
125 +#define DRV_RELDATE "18Dec2008"
126
127 /* PHY CHIP Address */
128 #define PHY1_ADDR 1 /* For MAC1 */
129 @@ -214,7 +214,7 @@ static int r6040_phy_read(void __iomem *ioaddr, int phy_addr, int reg)
130 /* Wait for the read bit to be cleared */
131 while (limit--) {
132 cmd = ioread16(ioaddr + MMDIO);
133 - if (cmd & MDIO_READ)
134 + if (!(cmd & MDIO_READ))
135 break;
136 }
137
138 @@ -233,7 +233,7 @@ static void r6040_phy_write(void __iomem *ioaddr, int phy_addr, int reg, u16 val
139 /* Wait for the write bit to be cleared */
140 while (limit--) {
141 cmd = ioread16(ioaddr + MMDIO);
142 - if (cmd & MDIO_WRITE)
143 + if (!(cmd & MDIO_WRITE))
144 break;
145 }
146 }
147 @@ -681,8 +681,10 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
148 struct net_device *dev = dev_id;
149 struct r6040_private *lp = netdev_priv(dev);
150 void __iomem *ioaddr = lp->base;
151 - u16 status;
152 + u16 misr, status;
153
154 + /* Save MIER */
155 + misr = ioread16(ioaddr + MIER);
156 /* Mask off RDC MAC interrupt */
157 iowrite16(MSK_INT, ioaddr + MIER);
158 /* Read MISR status and clear */
159 @@ -702,7 +704,7 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
160 dev->stats.rx_fifo_errors++;
161
162 /* Mask off RX interrupt */
163 - iowrite16(ioread16(ioaddr + MIER) & ~RX_INTS, ioaddr + MIER);
164 + misr &= ~RX_INTS;
165 netif_rx_schedule(dev, &lp->napi);
166 }
167
168 @@ -710,6 +712,9 @@ static irqreturn_t r6040_interrupt(int irq, void *dev_id)
169 if (status & TX_INTS)
170 r6040_tx(dev);
171
172 + /* Restore RDC MAC interrupt */
173 + iowrite16(misr, ioaddr + MIER);
174 +
175 return IRQ_HANDLED;
176 }
177
178 diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c
179 index 75d749b..8a2e32d 100644
180 --- a/drivers/net/wireless/p54/p54usb.c
181 +++ b/drivers/net/wireless/p54/p54usb.c
182 @@ -54,6 +54,7 @@ static struct usb_device_id p54u_table[] __devinitdata = {
183 {USB_DEVICE(0x050d, 0x7050)}, /* Belkin F5D7050 ver 1000 */
184 {USB_DEVICE(0x0572, 0x2000)}, /* Cohiba Proto board */
185 {USB_DEVICE(0x0572, 0x2002)}, /* Cohiba Proto board */
186 + {USB_DEVICE(0x06b9, 0x0121)}, /* Thomson SpeedTouch 121g */
187 {USB_DEVICE(0x0707, 0xee13)}, /* SMC 2862W-G version 2 */
188 {USB_DEVICE(0x083a, 0x4521)}, /* Siemens Gigaset USB Adapter 54 version 2 */
189 {USB_DEVICE(0x0846, 0x4240)}, /* Netgear WG111 (v2) */
190 @@ -214,6 +215,8 @@ static void p54u_tx_3887(struct ieee80211_hw *dev, struct p54_control_hdr *data,
191 usb_fill_bulk_urb(data_urb, priv->udev,
192 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), data, len,
193 free_on_tx ? p54u_tx_free_cb : p54u_tx_cb, dev);
194 + addr_urb->transfer_flags |= URB_ZERO_PACKET;
195 + data_urb->transfer_flags |= URB_ZERO_PACKET;
196
197 usb_submit_urb(addr_urb, GFP_ATOMIC);
198 usb_submit_urb(data_urb, GFP_ATOMIC);
199 @@ -251,6 +254,7 @@ static void p54u_tx_lm87(struct ieee80211_hw *dev,
200 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), hdr,
201 len + sizeof(*hdr), free_on_tx ? p54u_tx_free_cb : p54u_tx_cb,
202 dev);
203 + data_urb->transfer_flags |= URB_ZERO_PACKET;
204
205 usb_submit_urb(data_urb, GFP_ATOMIC);
206 }
207 @@ -293,11 +297,13 @@ static void p54u_tx_net2280(struct ieee80211_hw *dev, struct p54_control_hdr *da
208 usb_fill_bulk_urb(int_urb, priv->udev,
209 usb_sndbulkpipe(priv->udev, P54U_PIPE_DEV), reg, sizeof(*reg),
210 p54u_tx_free_cb, dev);
211 + int_urb->transfer_flags |= URB_ZERO_PACKET;
212 usb_submit_urb(int_urb, GFP_ATOMIC);
213
214 usb_fill_bulk_urb(data_urb, priv->udev,
215 usb_sndbulkpipe(priv->udev, P54U_PIPE_DATA), hdr, len + sizeof(*hdr),
216 free_on_tx ? p54u_tx_free_cb : p54u_tx_cb, dev);
217 + data_urb->transfer_flags |= URB_ZERO_PACKET;
218 usb_submit_urb(data_urb, GFP_ATOMIC);
219 }
220
221 diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
222 index 934f8e0..42cfa05 100644
223 --- a/drivers/net/wireless/rt2x00/rt73usb.c
224 +++ b/drivers/net/wireless/rt2x00/rt73usb.c
225 @@ -2434,6 +2434,7 @@ static struct usb_device_id rt73usb_device_table[] = {
226 /* Linksys */
227 { USB_DEVICE(0x13b1, 0x0020), USB_DEVICE_DATA(&rt73usb_ops) },
228 { USB_DEVICE(0x13b1, 0x0023), USB_DEVICE_DATA(&rt73usb_ops) },
229 + { USB_DEVICE(0x13b1, 0x0028), USB_DEVICE_DATA(&rt73usb_ops) },
230 /* MSI */
231 { USB_DEVICE(0x0db0, 0x6877), USB_DEVICE_DATA(&rt73usb_ops) },
232 { USB_DEVICE(0x0db0, 0x6874), USB_DEVICE_DATA(&rt73usb_ops) },
233 diff --git a/drivers/pci/pcie/aspm.c b/drivers/pci/pcie/aspm.c
234 index 9aad608..503f082 100644
235 --- a/drivers/pci/pcie/aspm.c
236 +++ b/drivers/pci/pcie/aspm.c
237 @@ -33,6 +33,11 @@ struct endpoint_state {
238 struct pcie_link_state {
239 struct list_head sibiling;
240 struct pci_dev *pdev;
241 + bool downstream_has_switch;
242 +
243 + struct pcie_link_state *parent;
244 + struct list_head children;
245 + struct list_head link;
246
247 /* ASPM state */
248 unsigned int support_state;
249 @@ -125,7 +130,7 @@ static void pcie_set_clock_pm(struct pci_dev *pdev, int enable)
250 link_state->clk_pm_enabled = !!enable;
251 }
252
253 -static void pcie_check_clock_pm(struct pci_dev *pdev)
254 +static void pcie_check_clock_pm(struct pci_dev *pdev, int blacklist)
255 {
256 int pos;
257 u32 reg32;
258 @@ -149,10 +154,26 @@ static void pcie_check_clock_pm(struct pci_dev *pdev)
259 if (!(reg16 & PCI_EXP_LNKCTL_CLKREQ_EN))
260 enabled = 0;
261 }
262 - link_state->clk_pm_capable = capable;
263 link_state->clk_pm_enabled = enabled;
264 link_state->bios_clk_state = enabled;
265 - pcie_set_clock_pm(pdev, policy_to_clkpm_state(pdev));
266 + if (!blacklist) {
267 + link_state->clk_pm_capable = capable;
268 + pcie_set_clock_pm(pdev, policy_to_clkpm_state(pdev));
269 + } else {
270 + link_state->clk_pm_capable = 0;
271 + pcie_set_clock_pm(pdev, 0);
272 + }
273 +}
274 +
275 +static bool pcie_aspm_downstream_has_switch(struct pci_dev *pdev)
276 +{
277 + struct pci_dev *child_dev;
278 +
279 + list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
280 + if (child_dev->pcie_type == PCI_EXP_TYPE_UPSTREAM)
281 + return true;
282 + }
283 + return false;
284 }
285
286 /*
287 @@ -419,9 +440,9 @@ static unsigned int pcie_aspm_check_state(struct pci_dev *pdev,
288 {
289 struct pci_dev *child_dev;
290
291 - /* If no child, disable the link */
292 + /* If no child, ignore the link */
293 if (list_empty(&pdev->subordinate->devices))
294 - return 0;
295 + return state;
296 list_for_each_entry(child_dev, &pdev->subordinate->devices, bus_list) {
297 if (child_dev->pcie_type == PCI_EXP_TYPE_PCI_BRIDGE) {
298 /*
299 @@ -462,6 +483,9 @@ static void __pcie_aspm_config_link(struct pci_dev *pdev, unsigned int state)
300 int valid = 1;
301 struct pcie_link_state *link_state = pdev->link_state;
302
303 + /* If no child, disable the link */
304 + if (list_empty(&pdev->subordinate->devices))
305 + state = 0;
306 /*
307 * if the downstream component has pci bridge function, don't do ASPM
308 * now
309 @@ -493,20 +517,52 @@ static void __pcie_aspm_config_link(struct pci_dev *pdev, unsigned int state)
310 link_state->enabled_state = state;
311 }
312
313 +static struct pcie_link_state *get_root_port_link(struct pcie_link_state *link)
314 +{
315 + struct pcie_link_state *root_port_link = link;
316 + while (root_port_link->parent)
317 + root_port_link = root_port_link->parent;
318 + return root_port_link;
319 +}
320 +
321 +/* check the whole hierarchy, and configure each link in the hierarchy */
322 static void __pcie_aspm_configure_link_state(struct pci_dev *pdev,
323 unsigned int state)
324 {
325 struct pcie_link_state *link_state = pdev->link_state;
326 + struct pcie_link_state *root_port_link = get_root_port_link(link_state);
327 + struct pcie_link_state *leaf;
328
329 - if (link_state->support_state == 0)
330 - return;
331 state &= PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1;
332
333 - /* state 0 means disabling aspm */
334 - state = pcie_aspm_check_state(pdev, state);
335 + /* check all links who have specific root port link */
336 + list_for_each_entry(leaf, &link_list, sibiling) {
337 + if (!list_empty(&leaf->children) ||
338 + get_root_port_link(leaf) != root_port_link)
339 + continue;
340 + state = pcie_aspm_check_state(leaf->pdev, state);
341 + }
342 + /* check root port link too in case it hasn't children */
343 + state = pcie_aspm_check_state(root_port_link->pdev, state);
344 +
345 if (link_state->enabled_state == state)
346 return;
347 - __pcie_aspm_config_link(pdev, state);
348 +
349 + /*
350 + * we must change the hierarchy. See comments in
351 + * __pcie_aspm_config_link for the order
352 + **/
353 + if (state & PCIE_LINK_STATE_L1) {
354 + list_for_each_entry(leaf, &link_list, sibiling) {
355 + if (get_root_port_link(leaf) == root_port_link)
356 + __pcie_aspm_config_link(leaf->pdev, state);
357 + }
358 + } else {
359 + list_for_each_entry_reverse(leaf, &link_list, sibiling) {
360 + if (get_root_port_link(leaf) == root_port_link)
361 + __pcie_aspm_config_link(leaf->pdev, state);
362 + }
363 + }
364 }
365
366 /*
367 @@ -570,6 +626,7 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
368 unsigned int state;
369 struct pcie_link_state *link_state;
370 int error = 0;
371 + int blacklist;
372
373 if (aspm_disabled || !pdev->is_pcie || pdev->link_state)
374 return;
375 @@ -580,29 +637,58 @@ void pcie_aspm_init_link_state(struct pci_dev *pdev)
376 if (list_empty(&pdev->subordinate->devices))
377 goto out;
378
379 - if (pcie_aspm_sanity_check(pdev))
380 - goto out;
381 + blacklist = !!pcie_aspm_sanity_check(pdev);
382
383 mutex_lock(&aspm_lock);
384
385 link_state = kzalloc(sizeof(*link_state), GFP_KERNEL);
386 if (!link_state)
387 goto unlock_out;
388 - pdev->link_state = link_state;
389
390 - pcie_aspm_configure_common_clock(pdev);
391 + link_state->downstream_has_switch = pcie_aspm_downstream_has_switch(pdev);
392 + INIT_LIST_HEAD(&link_state->children);
393 + INIT_LIST_HEAD(&link_state->link);
394 + if (pdev->bus->self) {/* this is a switch */
395 + struct pcie_link_state *parent_link_state;
396
397 - pcie_aspm_cap_init(pdev);
398 + parent_link_state = pdev->bus->parent->self->link_state;
399 + if (!parent_link_state) {
400 + kfree(link_state);
401 + goto unlock_out;
402 + }
403 + list_add(&link_state->link, &parent_link_state->children);
404 + link_state->parent = parent_link_state;
405 + }
406
407 - /* config link state to avoid BIOS error */
408 - state = pcie_aspm_check_state(pdev, policy_to_aspm_state(pdev));
409 - __pcie_aspm_config_link(pdev, state);
410 + pdev->link_state = link_state;
411
412 - pcie_check_clock_pm(pdev);
413 + if (!blacklist) {
414 + pcie_aspm_configure_common_clock(pdev);
415 + pcie_aspm_cap_init(pdev);
416 + } else {
417 + link_state->enabled_state = PCIE_LINK_STATE_L0S|PCIE_LINK_STATE_L1;
418 + link_state->bios_aspm_state = 0;
419 + /* Set support state to 0, so we will disable ASPM later */
420 + link_state->support_state = 0;
421 + }
422
423 link_state->pdev = pdev;
424 list_add(&link_state->sibiling, &link_list);
425
426 + if (link_state->downstream_has_switch) {
427 + /*
428 + * If link has switch, delay the link config. The leaf link
429 + * initialization will config the whole hierarchy. but we must
430 + * make sure BIOS doesn't set unsupported link state
431 + **/
432 + state = pcie_aspm_check_state(pdev, link_state->bios_aspm_state);
433 + __pcie_aspm_config_link(pdev, state);
434 + } else
435 + __pcie_aspm_configure_link_state(pdev,
436 + policy_to_aspm_state(pdev));
437 +
438 + pcie_check_clock_pm(pdev, blacklist);
439 +
440 unlock_out:
441 if (error)
442 free_link_state(pdev);
443 @@ -635,6 +721,7 @@ void pcie_aspm_exit_link_state(struct pci_dev *pdev)
444 /* All functions are removed, so just disable ASPM for the link */
445 __pcie_aspm_config_one_dev(parent, 0);
446 list_del(&link_state->sibiling);
447 + list_del(&link_state->link);
448 /* Clock PM is for endpoint device */
449
450 free_link_state(parent);
451 diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
452 index 8c08130..7c3710e 100644
453 --- a/drivers/usb/core/driver.c
454 +++ b/drivers/usb/core/driver.c
455 @@ -279,9 +279,12 @@ static int usb_unbind_interface(struct device *dev)
456 * altsetting means creating new endpoint device entries).
457 * When either of these happens, defer the Set-Interface.
458 */
459 - if (intf->cur_altsetting->desc.bAlternateSetting == 0)
460 - ; /* Already in altsetting 0 so skip Set-Interface */
461 - else if (!error && intf->dev.power.status == DPM_ON)
462 + if (intf->cur_altsetting->desc.bAlternateSetting == 0) {
463 + /* Already in altsetting 0 so skip Set-Interface.
464 + * Just re-enable it without affecting the endpoint toggles.
465 + */
466 + usb_enable_interface(udev, intf, false);
467 + } else if (!error && intf->dev.power.status == DPM_ON)
468 usb_set_interface(udev, intf->altsetting[0].
469 desc.bInterfaceNumber, 0);
470 else
471 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
472 index b19cbfc..81eea42 100644
473 --- a/drivers/usb/core/hub.c
474 +++ b/drivers/usb/core/hub.c
475 @@ -2385,7 +2385,7 @@ void usb_ep0_reinit(struct usb_device *udev)
476 {
477 usb_disable_endpoint(udev, 0 + USB_DIR_IN);
478 usb_disable_endpoint(udev, 0 + USB_DIR_OUT);
479 - usb_enable_endpoint(udev, &udev->ep0);
480 + usb_enable_endpoint(udev, &udev->ep0, true);
481 }
482 EXPORT_SYMBOL_GPL(usb_ep0_reinit);
483
484 diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
485 index 6d1048f..bdcfe92 100644
486 --- a/drivers/usb/core/message.c
487 +++ b/drivers/usb/core/message.c
488 @@ -1113,22 +1113,26 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
489 * usb_enable_endpoint - Enable an endpoint for USB communications
490 * @dev: the device whose interface is being enabled
491 * @ep: the endpoint
492 + * @reset_toggle: flag to set the endpoint's toggle back to 0
493 *
494 - * Resets the endpoint toggle, and sets dev->ep_{in,out} pointers.
495 + * Resets the endpoint toggle if asked, and sets dev->ep_{in,out} pointers.
496 * For control endpoints, both the input and output sides are handled.
497 */
498 -void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep)
499 +void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep,
500 + bool reset_toggle)
501 {
502 int epnum = usb_endpoint_num(&ep->desc);
503 int is_out = usb_endpoint_dir_out(&ep->desc);
504 int is_control = usb_endpoint_xfer_control(&ep->desc);
505
506 if (is_out || is_control) {
507 - usb_settoggle(dev, epnum, 1, 0);
508 + if (reset_toggle)
509 + usb_settoggle(dev, epnum, 1, 0);
510 dev->ep_out[epnum] = ep;
511 }
512 if (!is_out || is_control) {
513 - usb_settoggle(dev, epnum, 0, 0);
514 + if (reset_toggle)
515 + usb_settoggle(dev, epnum, 0, 0);
516 dev->ep_in[epnum] = ep;
517 }
518 ep->enabled = 1;
519 @@ -1138,17 +1142,18 @@ void usb_enable_endpoint(struct usb_device *dev, struct usb_host_endpoint *ep)
520 * usb_enable_interface - Enable all the endpoints for an interface
521 * @dev: the device whose interface is being enabled
522 * @intf: pointer to the interface descriptor
523 + * @reset_toggles: flag to set the endpoints' toggles back to 0
524 *
525 * Enables all the endpoints for the interface's current altsetting.
526 */
527 -static void usb_enable_interface(struct usb_device *dev,
528 - struct usb_interface *intf)
529 +void usb_enable_interface(struct usb_device *dev,
530 + struct usb_interface *intf, bool reset_toggles)
531 {
532 struct usb_host_interface *alt = intf->cur_altsetting;
533 int i;
534
535 for (i = 0; i < alt->desc.bNumEndpoints; ++i)
536 - usb_enable_endpoint(dev, &alt->endpoint[i]);
537 + usb_enable_endpoint(dev, &alt->endpoint[i], reset_toggles);
538 }
539
540 /**
541 @@ -1271,7 +1276,7 @@ int usb_set_interface(struct usb_device *dev, int interface, int alternate)
542 * during the SETUP stage - hence EP0 toggles are "don't care" here.
543 * (Likewise, EP0 never "halts" on well designed devices.)
544 */
545 - usb_enable_interface(dev, iface);
546 + usb_enable_interface(dev, iface, true);
547 if (device_is_registered(&iface->dev))
548 usb_create_sysfs_intf_files(iface);
549
550 @@ -1346,7 +1351,7 @@ int usb_reset_configuration(struct usb_device *dev)
551 alt = &intf->altsetting[0];
552
553 intf->cur_altsetting = alt;
554 - usb_enable_interface(dev, intf);
555 + usb_enable_interface(dev, intf, true);
556 if (device_is_registered(&intf->dev))
557 usb_create_sysfs_intf_files(intf);
558 }
559 @@ -1604,7 +1609,7 @@ free_interfaces:
560 alt = &intf->altsetting[0];
561
562 intf->cur_altsetting = alt;
563 - usb_enable_interface(dev, intf);
564 + usb_enable_interface(dev, intf, true);
565 intf->dev.parent = &dev->dev;
566 intf->dev.driver = NULL;
567 intf->dev.bus = &usb_bus_type;
568 diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
569 index be1fa07..956bf1e 100644
570 --- a/drivers/usb/core/usb.c
571 +++ b/drivers/usb/core/usb.c
572 @@ -362,7 +362,7 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
573 dev->ep0.desc.bLength = USB_DT_ENDPOINT_SIZE;
574 dev->ep0.desc.bDescriptorType = USB_DT_ENDPOINT;
575 /* ep0 maxpacket comes later, from device descriptor */
576 - usb_enable_endpoint(dev, &dev->ep0);
577 + usb_enable_endpoint(dev, &dev->ep0, true);
578 dev->can_submit = 1;
579
580 /* Save readable and stable topology id, distinguishing devices
581 diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
582 index 9a1a45a..1d450e9 100644
583 --- a/drivers/usb/core/usb.h
584 +++ b/drivers/usb/core/usb.h
585 @@ -10,7 +10,9 @@ extern int usb_create_ep_files(struct device *parent,
586 extern void usb_remove_ep_files(struct usb_host_endpoint *endpoint);
587
588 extern void usb_enable_endpoint(struct usb_device *dev,
589 - struct usb_host_endpoint *ep);
590 + struct usb_host_endpoint *ep, bool reset_toggle);
591 +extern void usb_enable_interface(struct usb_device *dev,
592 + struct usb_interface *intf, bool reset_toggles);
593 extern void usb_disable_endpoint(struct usb_device *dev, unsigned int epaddr);
594 extern void usb_disable_interface(struct usb_device *dev,
595 struct usb_interface *intf);
596 diff --git a/drivers/usb/storage/libusual.c b/drivers/usb/storage/libusual.c
597 index d617e8a..f970b27 100644
598 --- a/drivers/usb/storage/libusual.c
599 +++ b/drivers/usb/storage/libusual.c
600 @@ -46,6 +46,12 @@ static int usu_probe_thread(void *arg);
601 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \
602 .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
603
604 +#define COMPLIANT_DEV(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax, \
605 + vendorName, productName, useProtocol, useTransport, \
606 + initFunction, flags) \
607 +{ USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin, bcdDeviceMax), \
608 + .driver_info = (flags) }
609 +
610 #define USUAL_DEV(useProto, useTrans, useType) \
611 { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
612 .driver_info = ((useType)<<24) }
613 @@ -57,6 +63,7 @@ struct usb_device_id storage_usb_ids [] = {
614
615 #undef USUAL_DEV
616 #undef UNUSUAL_DEV
617 +#undef COMPLIANT_DEV
618
619 MODULE_DEVICE_TABLE(usb, storage_usb_ids);
620 EXPORT_SYMBOL_GPL(storage_usb_ids);
621 diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
622 index 09779f6..620c2b5 100644
623 --- a/drivers/usb/storage/scsiglue.c
624 +++ b/drivers/usb/storage/scsiglue.c
625 @@ -59,6 +59,13 @@
626 #include "transport.h"
627 #include "protocol.h"
628
629 +/* Vendor IDs for companies that seem to include the READ CAPACITY bug
630 + * in all their devices
631 + */
632 +#define VENDOR_ID_NOKIA 0x0421
633 +#define VENDOR_ID_NIKON 0x04b0
634 +#define VENDOR_ID_MOTOROLA 0x22b8
635 +
636 /***********************************************************************
637 * Host functions
638 ***********************************************************************/
639 @@ -134,6 +141,22 @@ static int slave_configure(struct scsi_device *sdev)
640 * settings can't be overridden via the scsi devinfo mechanism. */
641 if (sdev->type == TYPE_DISK) {
642
643 + /* Some vendors seem to put the READ CAPACITY bug into
644 + * all their devices -- primarily makers of cell phones
645 + * and digital cameras. Since these devices always use
646 + * flash media and can be expected to have an even number
647 + * of sectors, we will always enable the CAPACITY_HEURISTICS
648 + * flag unless told otherwise. */
649 + switch (le16_to_cpu(us->pusb_dev->descriptor.idVendor)) {
650 + case VENDOR_ID_NOKIA:
651 + case VENDOR_ID_NIKON:
652 + case VENDOR_ID_MOTOROLA:
653 + if (!(us->fflags & (US_FL_FIX_CAPACITY |
654 + US_FL_CAPACITY_OK)))
655 + us->fflags |= US_FL_CAPACITY_HEURISTICS;
656 + break;
657 + }
658 +
659 /* Disk-type devices use MODE SENSE(6) if the protocol
660 * (SubClass) is Transparent SCSI, otherwise they use
661 * MODE SENSE(10). */
662 @@ -196,6 +219,14 @@ static int slave_configure(struct scsi_device *sdev)
663 * sector in a larger then 1 sector read, since the performance
664 * impact is negible we set this flag for all USB disks */
665 sdev->last_sector_bug = 1;
666 +
667 + /* Enable last-sector hacks for single-target devices using
668 + * the Bulk-only transport, unless we already know the
669 + * capacity will be decremented or is correct. */
670 + if (!(us->fflags & (US_FL_FIX_CAPACITY | US_FL_CAPACITY_OK |
671 + US_FL_SCM_MULT_TARG)) &&
672 + us->protocol == US_PR_BULK)
673 + us->use_last_sector_hacks = 1;
674 } else {
675
676 /* Non-disk-type devices don't need to blacklist any pages
677 diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
678 index 79108d5..95de764 100644
679 --- a/drivers/usb/storage/transport.c
680 +++ b/drivers/usb/storage/transport.c
681 @@ -57,6 +57,9 @@
682 #include "scsiglue.h"
683 #include "debug.h"
684
685 +#include <linux/blkdev.h>
686 +#include "../../scsi/sd.h"
687 +
688
689 /***********************************************************************
690 * Data transfer routines
691 @@ -511,6 +514,80 @@ int usb_stor_bulk_transfer_sg(struct us_data* us, unsigned int pipe,
692 * Transport routines
693 ***********************************************************************/
694
695 +/* There are so many devices that report the capacity incorrectly,
696 + * this routine was written to counteract some of the resulting
697 + * problems.
698 + */
699 +static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)
700 +{
701 + struct gendisk *disk;
702 + struct scsi_disk *sdkp;
703 + u32 sector;
704 +
705 + /* To Report "Medium Error: Record Not Found */
706 + static unsigned char record_not_found[18] = {
707 + [0] = 0x70, /* current error */
708 + [2] = MEDIUM_ERROR, /* = 0x03 */
709 + [7] = 0x0a, /* additional length */
710 + [12] = 0x14 /* Record Not Found */
711 + };
712 +
713 + /* If last-sector problems can't occur, whether because the
714 + * capacity was already decremented or because the device is
715 + * known to report the correct capacity, then we don't need
716 + * to do anything.
717 + */
718 + if (!us->use_last_sector_hacks)
719 + return;
720 +
721 + /* Was this command a READ(10) or a WRITE(10)? */
722 + if (srb->cmnd[0] != READ_10 && srb->cmnd[0] != WRITE_10)
723 + goto done;
724 +
725 + /* Did this command access the last sector? */
726 + sector = (srb->cmnd[2] << 24) | (srb->cmnd[3] << 16) |
727 + (srb->cmnd[4] << 8) | (srb->cmnd[5]);
728 + disk = srb->request->rq_disk;
729 + if (!disk)
730 + goto done;
731 + sdkp = scsi_disk(disk);
732 + if (!sdkp)
733 + goto done;
734 + if (sector + 1 != sdkp->capacity)
735 + goto done;
736 +
737 + if (srb->result == SAM_STAT_GOOD && scsi_get_resid(srb) == 0) {
738 +
739 + /* The command succeeded. We know this device doesn't
740 + * have the last-sector bug, so stop checking it.
741 + */
742 + us->use_last_sector_hacks = 0;
743 +
744 + } else {
745 + /* The command failed. Allow up to 3 retries in case this
746 + * is some normal sort of failure. After that, assume the
747 + * capacity is wrong and we're trying to access the sector
748 + * beyond the end. Replace the result code and sense data
749 + * with values that will cause the SCSI core to fail the
750 + * command immediately, instead of going into an infinite
751 + * (or even just a very long) retry loop.
752 + */
753 + if (++us->last_sector_retries < 3)
754 + return;
755 + srb->result = SAM_STAT_CHECK_CONDITION;
756 + memcpy(srb->sense_buffer, record_not_found,
757 + sizeof(record_not_found));
758 + }
759 +
760 + done:
761 + /* Don't reset the retry counter for TEST UNIT READY commands,
762 + * because they get issued after device resets which might be
763 + * caused by a failed last-sector access.
764 + */
765 + if (srb->cmnd[0] != TEST_UNIT_READY)
766 + us->last_sector_retries = 0;
767 +}
768 +
769 /* Invoke the transport and basic error-handling/recovery methods
770 *
771 * This is used by the protocol layers to actually send the message to
772 @@ -544,6 +621,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
773 /* if the transport provided its own sense data, don't auto-sense */
774 if (result == USB_STOR_TRANSPORT_NO_SENSE) {
775 srb->result = SAM_STAT_CHECK_CONDITION;
776 + last_sector_hacks(us, srb);
777 return;
778 }
779
780 @@ -667,6 +745,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
781 scsi_bufflen(srb) - scsi_get_resid(srb) < srb->underflow)
782 srb->result = (DID_ERROR << 16) | (SUGGEST_RETRY << 24);
783
784 + last_sector_hacks(us, srb);
785 return;
786
787 /* Error and abort processing: try to resynchronize with the device
788 @@ -694,6 +773,7 @@ void usb_stor_invoke_transport(struct scsi_cmnd *srb, struct us_data *us)
789 us->transport_reset(us);
790 }
791 clear_bit(US_FLIDX_RESETTING, &us->dflags);
792 + last_sector_hacks(us, srb);
793 }
794
795 /* Stop the current URB transfer */
796 diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
797 index a078540..ce7f746 100644
798 --- a/drivers/usb/storage/unusual_devs.h
799 +++ b/drivers/usb/storage/unusual_devs.h
800 @@ -27,7 +27,8 @@
801
802 /* IMPORTANT NOTE: This file must be included in another file which does
803 * the following thing for it to work:
804 - * The macro UNUSUAL_DEV() must be defined before this file is included
805 + * The UNUSUAL_DEV, COMPLIANT_DEV, and USUAL_DEV macros must be defined
806 + * before this file is included.
807 */
808
809 /* If you edit this file, please try to keep it sorted first by VendorID,
810 @@ -46,6 +47,12 @@
811 * <usb-storage@lists.one-eyed-alien.net>
812 */
813
814 +/* Note: If you add an entry only in order to set the CAPACITY_OK flag,
815 + * use the COMPLIANT_DEV macro instead of UNUSUAL_DEV. This is
816 + * because such entries mark devices which actually work correctly,
817 + * as opposed to devices that do something strangely or wrongly.
818 + */
819 +
820 /* patch submitted by Vivian Bregier <Vivian.Bregier@imag.fr>
821 */
822 UNUSUAL_DEV( 0x03eb, 0x2002, 0x0100, 0x0100,
823 @@ -160,34 +167,6 @@ UNUSUAL_DEV( 0x0421, 0x0019, 0x0592, 0x0592,
824 US_SC_DEVICE, US_PR_DEVICE, NULL,
825 US_FL_MAX_SECTORS_64 ),
826
827 -/* Reported by Filip Joelsson <filip@blueturtle.nu> */
828 -UNUSUAL_DEV( 0x0421, 0x005d, 0x0001, 0x0600,
829 - "Nokia",
830 - "Nokia 3110c",
831 - US_SC_DEVICE, US_PR_DEVICE, NULL,
832 - US_FL_FIX_CAPACITY ),
833 -
834 -/* Reported by Ozan Sener <themgzzy@gmail.com> */
835 -UNUSUAL_DEV( 0x0421, 0x0060, 0x0551, 0x0551,
836 - "Nokia",
837 - "3500c",
838 - US_SC_DEVICE, US_PR_DEVICE, NULL,
839 - US_FL_FIX_CAPACITY ),
840 -
841 -/* Reported by CSECSY Laszlo <boobaa@frugalware.org> */
842 -UNUSUAL_DEV( 0x0421, 0x0063, 0x0001, 0x0601,
843 - "Nokia",
844 - "Nokia 3109c",
845 - US_SC_DEVICE, US_PR_DEVICE, NULL,
846 - US_FL_FIX_CAPACITY ),
847 -
848 -/* Patch for Nokia 5310 capacity */
849 -UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0701,
850 - "Nokia",
851 - "5310",
852 - US_SC_DEVICE, US_PR_DEVICE, NULL,
853 - US_FL_FIX_CAPACITY ),
854 -
855 /* Reported by Mario Rettig <mariorettig@web.de> */
856 UNUSUAL_DEV( 0x0421, 0x042e, 0x0100, 0x0100,
857 "Nokia",
858 @@ -253,42 +232,6 @@ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370,
859 US_SC_DEVICE, US_PR_DEVICE, NULL,
860 US_FL_MAX_SECTORS_64 ),
861
862 -/* Reported by Cedric Godin <cedric@belbone.be> */
863 -UNUSUAL_DEV( 0x0421, 0x04b9, 0x0500, 0x0551,
864 - "Nokia",
865 - "5300",
866 - US_SC_DEVICE, US_PR_DEVICE, NULL,
867 - US_FL_FIX_CAPACITY ),
868 -
869 -/* Reported by Paulo Fessel <pfessel@gmail.com> */
870 -UNUSUAL_DEV( 0x0421, 0x04bd, 0x0000, 0x9999,
871 - "Nokia",
872 - "5200",
873 - US_SC_DEVICE, US_PR_DEVICE, NULL,
874 - US_FL_FIX_CAPACITY ),
875 -
876 -/* Reported by Richard Nauber <RichardNauber@web.de> */
877 -UNUSUAL_DEV( 0x0421, 0x04fa, 0x0550, 0x0660,
878 - "Nokia",
879 - "6300",
880 - US_SC_DEVICE, US_PR_DEVICE, NULL,
881 - US_FL_FIX_CAPACITY ),
882 -
883 -/* Patch for Nokia 5310 capacity */
884 -UNUSUAL_DEV( 0x0421, 0x006a, 0x0000, 0x0591,
885 - "Nokia",
886 - "5310",
887 - US_SC_DEVICE, US_PR_DEVICE, NULL,
888 - US_FL_FIX_CAPACITY ),
889 -
890 -/* Submitted by Ricky Wong Yung Fei <evilbladewarrior@gmail.com> */
891 -/* Nokia 7610 Supernova - Too many sectors reported in usb storage mode */
892 -UNUSUAL_DEV( 0x0421, 0x00f5, 0x0000, 0x0470,
893 - "Nokia",
894 - "7610 Supernova",
895 - US_SC_DEVICE, US_PR_DEVICE, NULL,
896 - US_FL_FIX_CAPACITY ),
897 -
898 /* Reported by Olaf Hering <olh@suse.de> from novell bug #105878 */
899 UNUSUAL_DEV( 0x0424, 0x0fdc, 0x0210, 0x0210,
900 "SMSC",
901 @@ -403,83 +346,6 @@ UNUSUAL_DEV( 0x04b0, 0x0301, 0x0010, 0x0010,
902 US_SC_DEVICE, US_PR_DEVICE,NULL,
903 US_FL_NOT_LOCKABLE ),
904
905 -/* Reported by Stefan de Konink <skinkie@xs4all.nl> */
906 -UNUSUAL_DEV( 0x04b0, 0x0401, 0x0200, 0x0200,
907 - "NIKON",
908 - "NIKON DSC D100",
909 - US_SC_DEVICE, US_PR_DEVICE, NULL,
910 - US_FL_FIX_CAPACITY),
911 -
912 -/* Reported by Tobias Kunze Briseno <t-linux@fictive.com> */
913 -UNUSUAL_DEV( 0x04b0, 0x0403, 0x0200, 0x0200,
914 - "NIKON",
915 - "NIKON DSC D2H",
916 - US_SC_DEVICE, US_PR_DEVICE, NULL,
917 - US_FL_FIX_CAPACITY),
918 -
919 -/* Reported by Milinevsky Dmitry <niam.niam@gmail.com> */
920 -UNUSUAL_DEV( 0x04b0, 0x0409, 0x0100, 0x0100,
921 - "NIKON",
922 - "NIKON DSC D50",
923 - US_SC_DEVICE, US_PR_DEVICE, NULL,
924 - US_FL_FIX_CAPACITY),
925 -
926 -/* Reported by Andreas Bockhold <andreas@bockionline.de> */
927 -UNUSUAL_DEV( 0x04b0, 0x0405, 0x0100, 0x0100,
928 - "NIKON",
929 - "NIKON DSC D70",
930 - US_SC_DEVICE, US_PR_DEVICE, NULL,
931 - US_FL_FIX_CAPACITY),
932 -
933 -/* Reported by Jamie Kitson <jamie@staberinde.fsnet.co.uk> */
934 -UNUSUAL_DEV( 0x04b0, 0x040d, 0x0100, 0x0100,
935 - "NIKON",
936 - "NIKON DSC D70s",
937 - US_SC_DEVICE, US_PR_DEVICE, NULL,
938 - US_FL_FIX_CAPACITY),
939 -
940 -/* Reported by Graber and Mike Pagano <mpagano-kernel@mpagano.com> */
941 -UNUSUAL_DEV( 0x04b0, 0x040f, 0x0100, 0x0200,
942 - "NIKON",
943 - "NIKON DSC D200",
944 - US_SC_DEVICE, US_PR_DEVICE, NULL,
945 - US_FL_FIX_CAPACITY),
946 -
947 -/* Reported by Emil Larsson <emil@swip.net> */
948 -UNUSUAL_DEV( 0x04b0, 0x0411, 0x0100, 0x0111,
949 - "NIKON",
950 - "NIKON DSC D80",
951 - US_SC_DEVICE, US_PR_DEVICE, NULL,
952 - US_FL_FIX_CAPACITY),
953 -
954 -/* Reported by Ortwin Glueck <odi@odi.ch> */
955 -UNUSUAL_DEV( 0x04b0, 0x0413, 0x0110, 0x0111,
956 - "NIKON",
957 - "NIKON DSC D40",
958 - US_SC_DEVICE, US_PR_DEVICE, NULL,
959 - US_FL_FIX_CAPACITY),
960 -
961 -/* Reported by Paul Check <paul@openstreet.com> */
962 -UNUSUAL_DEV( 0x04b0, 0x0415, 0x0100, 0x0100,
963 - "NIKON",
964 - "NIKON DSC D2Xs",
965 - US_SC_DEVICE, US_PR_DEVICE, NULL,
966 - US_FL_FIX_CAPACITY),
967 -
968 -/* Reported by Shan Destromp (shansan@gmail.com) */
969 -UNUSUAL_DEV( 0x04b0, 0x0417, 0x0100, 0x0100,
970 - "NIKON",
971 - "NIKON DSC D40X",
972 - US_SC_DEVICE, US_PR_DEVICE, NULL,
973 - US_FL_FIX_CAPACITY),
974 -
975 -/* Reported by paul ready <lxtwin@homecall.co.uk> */
976 -UNUSUAL_DEV( 0x04b0, 0x0419, 0x0100, 0x0200,
977 - "NIKON",
978 - "NIKON DSC D300",
979 - US_SC_DEVICE, US_PR_DEVICE, NULL,
980 - US_FL_FIX_CAPACITY),
981 -
982 /* Reported by Doug Maxey (dwm@austin.ibm.com) */
983 UNUSUAL_DEV( 0x04b3, 0x4001, 0x0110, 0x0110,
984 "IBM",
985 @@ -692,6 +558,13 @@ UNUSUAL_DEV( 0x0525, 0xa140, 0x0100, 0x0100,
986 US_SC_8070, US_PR_DEVICE, NULL,
987 US_FL_FIX_INQUIRY ),
988
989 +/* Added by Alan Stern <stern@rowland.harvard.edu> */
990 +COMPLIANT_DEV(0x0525, 0xa4a5, 0x0000, 0x9999,
991 + "Linux",
992 + "File-backed Storage Gadget",
993 + US_SC_DEVICE, US_PR_DEVICE, NULL,
994 + US_FL_CAPACITY_OK ),
995 +
996 /* Yakumo Mega Image 37
997 * Submitted by Stephan Fuhrmann <atomenergie@t-online.de> */
998 UNUSUAL_DEV( 0x052b, 0x1801, 0x0100, 0x0100,
999 @@ -2107,27 +1980,6 @@ UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001,
1000 US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ),
1001
1002 /*
1003 - * Patch by Pete Zaitcev <zaitcev@redhat.com>
1004 - * Report by Mark Patton. Red Hat bz#208928.
1005 - * Added support for rev 0x0002 (Motorola ROKR W5)
1006 - * by Javier Smaldone <javier@smaldone.com.ar>
1007 - */
1008 -UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0002,
1009 - "Motorola",
1010 - "RAZR V3i/ROKR W5",
1011 - US_SC_DEVICE, US_PR_DEVICE, NULL,
1012 - US_FL_FIX_CAPACITY),
1013 -
1014 -/*
1015 - * Patch by Jost Diederichs <jost@qdusa.com>
1016 - */
1017 -UNUSUAL_DEV(0x22b8, 0x6410, 0x0001, 0x9999,
1018 - "Motorola Inc.",
1019 - "Motorola Phone (RAZRV3xx)",
1020 - US_SC_DEVICE, US_PR_DEVICE, NULL,
1021 - US_FL_FIX_CAPACITY),
1022 -
1023 -/*
1024 * Patch by Constantin Baranov <const@tltsu.ru>
1025 * Report by Andreas Koenecke.
1026 * Motorola ROKR Z6.
1027 diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
1028 index 27016fd..ceb8ac3 100644
1029 --- a/drivers/usb/storage/usb.c
1030 +++ b/drivers/usb/storage/usb.c
1031 @@ -126,6 +126,8 @@ MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device");
1032 { USB_DEVICE_VER(id_vendor, id_product, bcdDeviceMin,bcdDeviceMax), \
1033 .driver_info = (flags)|(USB_US_TYPE_STOR<<24) }
1034
1035 +#define COMPLIANT_DEV UNUSUAL_DEV
1036 +
1037 #define USUAL_DEV(useProto, useTrans, useType) \
1038 { USB_INTERFACE_INFO(USB_CLASS_MASS_STORAGE, useProto, useTrans), \
1039 .driver_info = (USB_US_TYPE_STOR<<24) }
1040 @@ -134,6 +136,7 @@ static struct usb_device_id storage_usb_ids [] = {
1041
1042 # include "unusual_devs.h"
1043 #undef UNUSUAL_DEV
1044 +#undef COMPLIANT_DEV
1045 #undef USUAL_DEV
1046 /* Terminating entry */
1047 { }
1048 @@ -164,6 +167,8 @@ MODULE_DEVICE_TABLE (usb, storage_usb_ids);
1049 .initFunction = init_function, \
1050 }
1051
1052 +#define COMPLIANT_DEV UNUSUAL_DEV
1053 +
1054 #define USUAL_DEV(use_protocol, use_transport, use_type) \
1055 { \
1056 .useProtocol = use_protocol, \
1057 @@ -173,6 +178,7 @@ MODULE_DEVICE_TABLE (usb, storage_usb_ids);
1058 static struct us_unusual_dev us_unusual_dev_list[] = {
1059 # include "unusual_devs.h"
1060 # undef UNUSUAL_DEV
1061 +# undef COMPLIANT_DEV
1062 # undef USUAL_DEV
1063
1064 /* Terminating entry */
1065 diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
1066 index a4ad73b..2e995c9 100644
1067 --- a/drivers/usb/storage/usb.h
1068 +++ b/drivers/usb/storage/usb.h
1069 @@ -155,6 +155,10 @@ struct us_data {
1070 #ifdef CONFIG_PM
1071 pm_hook suspend_resume_hook;
1072 #endif
1073 +
1074 + /* hacks for READ CAPACITY bug handling */
1075 + int use_last_sector_hacks;
1076 + int last_sector_retries;
1077 };
1078
1079 /* Convert between us_data and the corresponding Scsi_Host */
1080 diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
1081 index d0ff0b8..e5eaa62 100644
1082 --- a/fs/fs-writeback.c
1083 +++ b/fs/fs-writeback.c
1084 @@ -421,9 +421,6 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
1085 * If we're a pdlfush thread, then implement pdflush collision avoidance
1086 * against the entire list.
1087 *
1088 - * WB_SYNC_HOLD is a hack for sys_sync(): reattach the inode to sb->s_dirty so
1089 - * that it can be located for waiting on in __writeback_single_inode().
1090 - *
1091 * If `bdi' is non-zero then we're being asked to writeback a specific queue.
1092 * This function assumes that the blockdev superblock's inodes are backed by
1093 * a variety of queues, so all inodes are searched. For other superblocks,
1094 @@ -443,6 +440,7 @@ void generic_sync_sb_inodes(struct super_block *sb,
1095 struct writeback_control *wbc)
1096 {
1097 const unsigned long start = jiffies; /* livelock avoidance */
1098 + int sync = wbc->sync_mode == WB_SYNC_ALL;
1099
1100 spin_lock(&inode_lock);
1101 if (!wbc->for_kupdate || list_empty(&sb->s_io))
1102 @@ -499,10 +497,6 @@ void generic_sync_sb_inodes(struct super_block *sb,
1103 __iget(inode);
1104 pages_skipped = wbc->pages_skipped;
1105 __writeback_single_inode(inode, wbc);
1106 - if (wbc->sync_mode == WB_SYNC_HOLD) {
1107 - inode->dirtied_when = jiffies;
1108 - list_move(&inode->i_list, &sb->s_dirty);
1109 - }
1110 if (current_is_pdflush())
1111 writeback_release(bdi);
1112 if (wbc->pages_skipped != pages_skipped) {
1113 @@ -523,7 +517,49 @@ void generic_sync_sb_inodes(struct super_block *sb,
1114 if (!list_empty(&sb->s_more_io))
1115 wbc->more_io = 1;
1116 }
1117 - spin_unlock(&inode_lock);
1118 +
1119 + if (sync) {
1120 + struct inode *inode, *old_inode = NULL;
1121 +
1122 + /*
1123 + * Data integrity sync. Must wait for all pages under writeback,
1124 + * because there may have been pages dirtied before our sync
1125 + * call, but which had writeout started before we write it out.
1126 + * In which case, the inode may not be on the dirty list, but
1127 + * we still have to wait for that writeout.
1128 + */
1129 + list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
1130 + struct address_space *mapping;
1131 +
1132 + if (inode->i_state & (I_FREEING|I_WILL_FREE))
1133 + continue;
1134 + mapping = inode->i_mapping;
1135 + if (mapping->nrpages == 0)
1136 + continue;
1137 + __iget(inode);
1138 + spin_unlock(&inode_lock);
1139 + /*
1140 + * We hold a reference to 'inode' so it couldn't have
1141 + * been removed from s_inodes list while we dropped the
1142 + * inode_lock. We cannot iput the inode now as we can
1143 + * be holding the last reference and we cannot iput it
1144 + * under inode_lock. So we keep the reference and iput
1145 + * it later.
1146 + */
1147 + iput(old_inode);
1148 + old_inode = inode;
1149 +
1150 + filemap_fdatawait(mapping);
1151 +
1152 + cond_resched();
1153 +
1154 + spin_lock(&inode_lock);
1155 + }
1156 + spin_unlock(&inode_lock);
1157 + iput(old_inode);
1158 + } else
1159 + spin_unlock(&inode_lock);
1160 +
1161 return; /* Leave any unwritten inodes on s_io */
1162 }
1163 EXPORT_SYMBOL_GPL(generic_sync_sb_inodes);
1164 @@ -588,8 +624,7 @@ restart:
1165
1166 /*
1167 * writeback and wait upon the filesystem's dirty inodes. The caller will
1168 - * do this in two passes - one to write, and one to wait. WB_SYNC_HOLD is
1169 - * used to park the written inodes on sb->s_dirty for the wait pass.
1170 + * do this in two passes - one to write, and one to wait.
1171 *
1172 * A finite limit is set on the number of pages which will be written.
1173 * To prevent infinite livelock of sys_sync().
1174 @@ -600,30 +635,21 @@ restart:
1175 void sync_inodes_sb(struct super_block *sb, int wait)
1176 {
1177 struct writeback_control wbc = {
1178 - .sync_mode = wait ? WB_SYNC_ALL : WB_SYNC_HOLD,
1179 + .sync_mode = wait ? WB_SYNC_ALL : WB_SYNC_NONE,
1180 .range_start = 0,
1181 .range_end = LLONG_MAX,
1182 };
1183 - unsigned long nr_dirty = global_page_state(NR_FILE_DIRTY);
1184 - unsigned long nr_unstable = global_page_state(NR_UNSTABLE_NFS);
1185
1186 - wbc.nr_to_write = nr_dirty + nr_unstable +
1187 - (inodes_stat.nr_inodes - inodes_stat.nr_unused) +
1188 - nr_dirty + nr_unstable;
1189 - wbc.nr_to_write += wbc.nr_to_write / 2; /* Bit more for luck */
1190 - sync_sb_inodes(sb, &wbc);
1191 -}
1192 + if (!wait) {
1193 + unsigned long nr_dirty = global_page_state(NR_FILE_DIRTY);
1194 + unsigned long nr_unstable = global_page_state(NR_UNSTABLE_NFS);
1195
1196 -/*
1197 - * Rather lame livelock avoidance.
1198 - */
1199 -static void set_sb_syncing(int val)
1200 -{
1201 - struct super_block *sb;
1202 - spin_lock(&sb_lock);
1203 - list_for_each_entry_reverse(sb, &super_blocks, s_list)
1204 - sb->s_syncing = val;
1205 - spin_unlock(&sb_lock);
1206 + wbc.nr_to_write = nr_dirty + nr_unstable +
1207 + (inodes_stat.nr_inodes - inodes_stat.nr_unused);
1208 + } else
1209 + wbc.nr_to_write = LONG_MAX; /* doesn't actually matter */
1210 +
1211 + sync_sb_inodes(sb, &wbc);
1212 }
1213
1214 /**
1215 @@ -652,9 +678,6 @@ static void __sync_inodes(int wait)
1216 spin_lock(&sb_lock);
1217 restart:
1218 list_for_each_entry(sb, &super_blocks, s_list) {
1219 - if (sb->s_syncing)
1220 - continue;
1221 - sb->s_syncing = 1;
1222 sb->s_count++;
1223 spin_unlock(&sb_lock);
1224 down_read(&sb->s_umount);
1225 @@ -672,13 +695,10 @@ restart:
1226
1227 void sync_inodes(int wait)
1228 {
1229 - set_sb_syncing(0);
1230 __sync_inodes(0);
1231
1232 - if (wait) {
1233 - set_sb_syncing(0);
1234 + if (wait)
1235 __sync_inodes(1);
1236 - }
1237 }
1238
1239 /**
1240 diff --git a/fs/sync.c b/fs/sync.c
1241 index 6cc8cb4..9e5f60d 100644
1242 --- a/fs/sync.c
1243 +++ b/fs/sync.c
1244 @@ -287,7 +287,7 @@ int do_sync_mapping_range(struct address_space *mapping, loff_t offset,
1245
1246 if (flags & SYNC_FILE_RANGE_WRITE) {
1247 ret = __filemap_fdatawrite_range(mapping, offset, endbyte,
1248 - WB_SYNC_NONE);
1249 + WB_SYNC_ALL);
1250 if (ret < 0)
1251 goto out;
1252 }
1253 diff --git a/include/linux/fs.h b/include/linux/fs.h
1254 index efeff3d..4b91924 100644
1255 --- a/include/linux/fs.h
1256 +++ b/include/linux/fs.h
1257 @@ -1124,7 +1124,6 @@ struct super_block {
1258 struct rw_semaphore s_umount;
1259 struct mutex s_lock;
1260 int s_count;
1261 - int s_syncing;
1262 int s_need_sync_fs;
1263 atomic_t s_active;
1264 #ifdef CONFIG_SECURITY
1265 diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
1266 index d9a3bbe..bd414ec 100644
1267 --- a/include/linux/usb_usual.h
1268 +++ b/include/linux/usb_usual.h
1269 @@ -52,8 +52,9 @@
1270 US_FLAG(MAX_SECTORS_MIN,0x00002000) \
1271 /* Sets max_sectors to arch min */ \
1272 US_FLAG(BULK_IGNORE_TAG,0x00004000) \
1273 - /* Ignore tag mismatch in bulk operations */
1274 -
1275 + /* Ignore tag mismatch in bulk operations */ \
1276 + US_FLAG(CAPACITY_OK, 0x00010000) \
1277 + /* READ CAPACITY response is correct */
1278
1279 #define US_FLAG(name, value) US_FL_##name = value ,
1280 enum { US_DO_ALL_FLAGS };
1281 diff --git a/include/linux/writeback.h b/include/linux/writeback.h
1282 index e585657..b93ab38 100644
1283 --- a/include/linux/writeback.h
1284 +++ b/include/linux/writeback.h
1285 @@ -30,7 +30,6 @@ static inline int task_is_pdflush(struct task_struct *task)
1286 enum writeback_sync_modes {
1287 WB_SYNC_NONE, /* Don't wait on anything */
1288 WB_SYNC_ALL, /* Wait on every mapping */
1289 - WB_SYNC_HOLD, /* Hold the inode on sb_dirty for sys_sync() */
1290 };
1291
1292 /*
1293 diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
1294 index 98345e4..06a68c4 100644
1295 --- a/kernel/sched_fair.c
1296 +++ b/kernel/sched_fair.c
1297 @@ -283,7 +283,7 @@ static void update_min_vruntime(struct cfs_rq *cfs_rq)
1298 struct sched_entity,
1299 run_node);
1300
1301 - if (vruntime == cfs_rq->min_vruntime)
1302 + if (!cfs_rq->curr)
1303 vruntime = se->vruntime;
1304 else
1305 vruntime = min_vruntime(vruntime, se->vruntime);
1306 diff --git a/lib/idr.c b/lib/idr.c
1307 index 1c4f928..21154ae 100644
1308 --- a/lib/idr.c
1309 +++ b/lib/idr.c
1310 @@ -121,7 +121,7 @@ int idr_pre_get(struct idr *idp, gfp_t gfp_mask)
1311 {
1312 while (idp->id_free_cnt < IDR_FREE_MAX) {
1313 struct idr_layer *new;
1314 - new = kmem_cache_alloc(idr_layer_cache, gfp_mask);
1315 + new = kmem_cache_zalloc(idr_layer_cache, gfp_mask);
1316 if (new == NULL)
1317 return (0);
1318 move_to_free_list(idp, new);
1319 @@ -623,16 +623,10 @@ void *idr_replace(struct idr *idp, void *ptr, int id)
1320 }
1321 EXPORT_SYMBOL(idr_replace);
1322
1323 -static void idr_cache_ctor(void *idr_layer)
1324 -{
1325 - memset(idr_layer, 0, sizeof(struct idr_layer));
1326 -}
1327 -
1328 void __init idr_init_cache(void)
1329 {
1330 idr_layer_cache = kmem_cache_create("idr_layer_cache",
1331 - sizeof(struct idr_layer), 0, SLAB_PANIC,
1332 - idr_cache_ctor);
1333 + sizeof(struct idr_layer), 0, SLAB_PANIC, NULL);
1334 }
1335
1336 /**
1337 diff --git a/mm/filemap.c b/mm/filemap.c
1338 index f65417c..6f62ef9 100644
1339 --- a/mm/filemap.c
1340 +++ b/mm/filemap.c
1341 @@ -210,7 +210,7 @@ int __filemap_fdatawrite_range(struct address_space *mapping, loff_t start,
1342 int ret;
1343 struct writeback_control wbc = {
1344 .sync_mode = sync_mode,
1345 - .nr_to_write = mapping->nrpages * 2,
1346 + .nr_to_write = LONG_MAX,
1347 .range_start = start,
1348 .range_end = end,
1349 };
1350 @@ -1317,7 +1317,8 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
1351 goto out; /* skip atime */
1352 size = i_size_read(inode);
1353 if (pos < size) {
1354 - retval = filemap_write_and_wait(mapping);
1355 + retval = filemap_write_and_wait_range(mapping, pos,
1356 + pos + iov_length(iov, nr_segs) - 1);
1357 if (!retval) {
1358 retval = mapping->a_ops->direct_IO(READ, iocb,
1359 iov, pos, nr_segs);
1360 @@ -2067,18 +2068,10 @@ generic_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
1361 if (count != ocount)
1362 *nr_segs = iov_shorten((struct iovec *)iov, *nr_segs, count);
1363
1364 - /*
1365 - * Unmap all mmappings of the file up-front.
1366 - *
1367 - * This will cause any pte dirty bits to be propagated into the
1368 - * pageframes for the subsequent filemap_write_and_wait().
1369 - */
1370 write_len = iov_length(iov, *nr_segs);
1371 end = (pos + write_len - 1) >> PAGE_CACHE_SHIFT;
1372 - if (mapping_mapped(mapping))
1373 - unmap_mapping_range(mapping, pos, write_len, 0);
1374
1375 - written = filemap_write_and_wait(mapping);
1376 + written = filemap_write_and_wait_range(mapping, pos, pos + write_len - 1);
1377 if (written)
1378 goto out;
1379
1380 @@ -2298,7 +2291,8 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov,
1381 * the file data here, to try to honour O_DIRECT expectations.
1382 */
1383 if (unlikely(file->f_flags & O_DIRECT) && written)
1384 - status = filemap_write_and_wait(mapping);
1385 + status = filemap_write_and_wait_range(mapping,
1386 + pos, pos + written - 1);
1387
1388 return written ? written : status;
1389 }
1390 diff --git a/mm/page-writeback.c b/mm/page-writeback.c
1391 index 2970e35..08d2b96 100644
1392 --- a/mm/page-writeback.c
1393 +++ b/mm/page-writeback.c
1394 @@ -868,9 +868,11 @@ int write_cache_pages(struct address_space *mapping,
1395 int done = 0;
1396 struct pagevec pvec;
1397 int nr_pages;
1398 + pgoff_t uninitialized_var(writeback_index);
1399 pgoff_t index;
1400 pgoff_t end; /* Inclusive */
1401 - int scanned = 0;
1402 + pgoff_t done_index;
1403 + int cycled;
1404 int range_whole = 0;
1405 long nr_to_write = wbc->nr_to_write;
1406
1407 @@ -881,83 +883,134 @@ int write_cache_pages(struct address_space *mapping,
1408
1409 pagevec_init(&pvec, 0);
1410 if (wbc->range_cyclic) {
1411 - index = mapping->writeback_index; /* Start from prev offset */
1412 + writeback_index = mapping->writeback_index; /* prev offset */
1413 + index = writeback_index;
1414 + if (index == 0)
1415 + cycled = 1;
1416 + else
1417 + cycled = 0;
1418 end = -1;
1419 } else {
1420 index = wbc->range_start >> PAGE_CACHE_SHIFT;
1421 end = wbc->range_end >> PAGE_CACHE_SHIFT;
1422 if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX)
1423 range_whole = 1;
1424 - scanned = 1;
1425 + cycled = 1; /* ignore range_cyclic tests */
1426 }
1427 retry:
1428 - while (!done && (index <= end) &&
1429 - (nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
1430 - PAGECACHE_TAG_DIRTY,
1431 - min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1))) {
1432 - unsigned i;
1433 + done_index = index;
1434 + while (!done && (index <= end)) {
1435 + int i;
1436 +
1437 + nr_pages = pagevec_lookup_tag(&pvec, mapping, &index,
1438 + PAGECACHE_TAG_DIRTY,
1439 + min(end - index, (pgoff_t)PAGEVEC_SIZE-1) + 1);
1440 + if (nr_pages == 0)
1441 + break;
1442
1443 - scanned = 1;
1444 for (i = 0; i < nr_pages; i++) {
1445 struct page *page = pvec.pages[i];
1446
1447 /*
1448 - * At this point we hold neither mapping->tree_lock nor
1449 - * lock on the page itself: the page may be truncated or
1450 - * invalidated (changing page->mapping to NULL), or even
1451 - * swizzled back from swapper_space to tmpfs file
1452 - * mapping
1453 + * At this point, the page may be truncated or
1454 + * invalidated (changing page->mapping to NULL), or
1455 + * even swizzled back from swapper_space to tmpfs file
1456 + * mapping. However, page->index will not change
1457 + * because we have a reference on the page.
1458 */
1459 + if (page->index > end) {
1460 + /*
1461 + * can't be range_cyclic (1st pass) because
1462 + * end == -1 in that case.
1463 + */
1464 + done = 1;
1465 + break;
1466 + }
1467 +
1468 + done_index = page->index + 1;
1469 +
1470 lock_page(page);
1471
1472 + /*
1473 + * Page truncated or invalidated. We can freely skip it
1474 + * then, even for data integrity operations: the page
1475 + * has disappeared concurrently, so there could be no
1476 + * real expectation of this data interity operation
1477 + * even if there is now a new, dirty page at the same
1478 + * pagecache address.
1479 + */
1480 if (unlikely(page->mapping != mapping)) {
1481 +continue_unlock:
1482 unlock_page(page);
1483 continue;
1484 }
1485
1486 - if (!wbc->range_cyclic && page->index > end) {
1487 - done = 1;
1488 - unlock_page(page);
1489 - continue;
1490 + if (!PageDirty(page)) {
1491 + /* someone wrote it for us */
1492 + goto continue_unlock;
1493 }
1494
1495 - if (wbc->sync_mode != WB_SYNC_NONE)
1496 - wait_on_page_writeback(page);
1497 -
1498 - if (PageWriteback(page) ||
1499 - !clear_page_dirty_for_io(page)) {
1500 - unlock_page(page);
1501 - continue;
1502 + if (PageWriteback(page)) {
1503 + if (wbc->sync_mode != WB_SYNC_NONE)
1504 + wait_on_page_writeback(page);
1505 + else
1506 + goto continue_unlock;
1507 }
1508
1509 - ret = (*writepage)(page, wbc, data);
1510 + BUG_ON(PageWriteback(page));
1511 + if (!clear_page_dirty_for_io(page))
1512 + goto continue_unlock;
1513
1514 - if (unlikely(ret == AOP_WRITEPAGE_ACTIVATE)) {
1515 - unlock_page(page);
1516 - ret = 0;
1517 + ret = (*writepage)(page, wbc, data);
1518 + if (unlikely(ret)) {
1519 + if (ret == AOP_WRITEPAGE_ACTIVATE) {
1520 + unlock_page(page);
1521 + ret = 0;
1522 + } else {
1523 + /*
1524 + * done_index is set past this page,
1525 + * so media errors will not choke
1526 + * background writeout for the entire
1527 + * file. This has consequences for
1528 + * range_cyclic semantics (ie. it may
1529 + * not be suitable for data integrity
1530 + * writeout).
1531 + */
1532 + done = 1;
1533 + break;
1534 + }
1535 + }
1536 +
1537 + if (wbc->sync_mode == WB_SYNC_NONE) {
1538 + wbc->nr_to_write--;
1539 + if (wbc->nr_to_write <= 0) {
1540 + done = 1;
1541 + break;
1542 + }
1543 }
1544 - if (ret || (--nr_to_write <= 0))
1545 - done = 1;
1546 if (wbc->nonblocking && bdi_write_congested(bdi)) {
1547 wbc->encountered_congestion = 1;
1548 done = 1;
1549 + break;
1550 }
1551 }
1552 pagevec_release(&pvec);
1553 cond_resched();
1554 }
1555 - if (!scanned && !done) {
1556 + if (!cycled) {
1557 /*
1558 + * range_cyclic:
1559 * We hit the last page and there is more work to be done: wrap
1560 * back to the start of the file
1561 */
1562 - scanned = 1;
1563 + cycled = 1;
1564 index = 0;
1565 + end = writeback_index - 1;
1566 goto retry;
1567 }
1568 if (!wbc->no_nrwrite_index_update) {
1569 if (wbc->range_cyclic || (range_whole && nr_to_write > 0))
1570 - mapping->writeback_index = index;
1571 + mapping->writeback_index = done_index;
1572 wbc->nr_to_write = nr_to_write;
1573 }
1574
1575 diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c
1576 index 0fa208e..05f198d 100644
1577 --- a/net/bridge/netfilter/ebtables.c
1578 +++ b/net/bridge/netfilter/ebtables.c
1579 @@ -80,7 +80,7 @@ static inline int ebt_do_match (struct ebt_entry_match *m,
1580 {
1581 par->match = m->u.match;
1582 par->matchinfo = m->data;
1583 - return m->u.match->match(skb, par);
1584 + return m->u.match->match(skb, par) ? EBT_MATCH : EBT_NOMATCH;
1585 }
1586
1587 static inline int ebt_dev_check(char *entry, const struct net_device *device)
1588 diff --git a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
1589 index 4e88792..625707a 100644
1590 --- a/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
1591 +++ b/net/ipv4/netfilter/nf_conntrack_proto_icmp.c
1592 @@ -20,7 +20,7 @@
1593 #include <net/netfilter/nf_conntrack_core.h>
1594 #include <net/netfilter/nf_log.h>
1595
1596 -static unsigned long nf_ct_icmp_timeout __read_mostly = 30*HZ;
1597 +static unsigned int nf_ct_icmp_timeout __read_mostly = 30*HZ;
1598
1599 static bool icmp_pkt_to_tuple(const struct sk_buff *skb, unsigned int dataoff,
1600 struct nf_conntrack_tuple *tuple)
1601 diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
1602 index c5aca0b..9e31f91 100644
1603 --- a/net/ipv4/tcp.c
1604 +++ b/net/ipv4/tcp.c
1605 @@ -578,10 +578,6 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
1606 else if (!ret) {
1607 if (spliced)
1608 break;
1609 - if (flags & SPLICE_F_NONBLOCK) {
1610 - ret = -EAGAIN;
1611 - break;
1612 - }
1613 if (sock_flag(sk, SOCK_DONE))
1614 break;
1615 if (sk->sk_err) {
1616 @@ -599,6 +595,10 @@ ssize_t tcp_splice_read(struct socket *sock, loff_t *ppos,
1617 ret = -ENOTCONN;
1618 break;
1619 }
1620 + if (flags & SPLICE_F_NONBLOCK) {
1621 + ret = -EAGAIN;
1622 + break;
1623 + }
1624 if (!timeo) {
1625 ret = -EAGAIN;
1626 break;
1627 diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
1628 index 29c7c99..52ee1dc 100644
1629 --- a/net/ipv6/ip6_fib.c
1630 +++ b/net/ipv6/ip6_fib.c
1631 @@ -298,6 +298,10 @@ static void fib6_dump_end(struct netlink_callback *cb)
1632 struct fib6_walker_t *w = (void*)cb->args[2];
1633
1634 if (w) {
1635 + if (cb->args[4]) {
1636 + cb->args[4] = 0;
1637 + fib6_walker_unlink(w);
1638 + }
1639 cb->args[2] = 0;
1640 kfree(w);
1641 }
1642 @@ -330,15 +334,12 @@ static int fib6_dump_table(struct fib6_table *table, struct sk_buff *skb,
1643 read_lock_bh(&table->tb6_lock);
1644 res = fib6_walk_continue(w);
1645 read_unlock_bh(&table->tb6_lock);
1646 - if (res != 0) {
1647 - if (res < 0)
1648 - fib6_walker_unlink(w);
1649 - goto end;
1650 + if (res <= 0) {
1651 + fib6_walker_unlink(w);
1652 + cb->args[4] = 0;
1653 }
1654 - fib6_walker_unlink(w);
1655 - cb->args[4] = 0;
1656 }
1657 -end:
1658 +
1659 return res;
1660 }
1661
1662 diff --git a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
1663 index 0572617..7cd13e5 100644
1664 --- a/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
1665 +++ b/net/ipv6/netfilter/nf_conntrack_proto_icmpv6.c
1666 @@ -26,7 +26,7 @@
1667 #include <net/netfilter/ipv6/nf_conntrack_icmpv6.h>
1668 #include <net/netfilter/nf_log.h>
1669
1670 -static unsigned long nf_ct_icmpv6_timeout __read_mostly = 30*HZ;
1671 +static unsigned int nf_ct_icmpv6_timeout __read_mostly = 30*HZ;
1672
1673 static bool icmpv6_pkt_to_tuple(const struct sk_buff *skb,
1674 unsigned int dataoff,
1675 diff --git a/net/netfilter/x_tables.c b/net/netfilter/x_tables.c
1676 index 89837a4..bfbf521 100644
1677 --- a/net/netfilter/x_tables.c
1678 +++ b/net/netfilter/x_tables.c
1679 @@ -273,6 +273,10 @@ static int match_revfn(u8 af, const char *name, u8 revision, int *bestp)
1680 have_rev = 1;
1681 }
1682 }
1683 +
1684 + if (af != NFPROTO_UNSPEC && !have_rev)
1685 + return match_revfn(NFPROTO_UNSPEC, name, revision, bestp);
1686 +
1687 return have_rev;
1688 }
1689
1690 @@ -289,6 +293,10 @@ static int target_revfn(u8 af, const char *name, u8 revision, int *bestp)
1691 have_rev = 1;
1692 }
1693 }
1694 +
1695 + if (af != NFPROTO_UNSPEC && !have_rev)
1696 + return target_revfn(NFPROTO_UNSPEC, name, revision, bestp);
1697 +
1698 return have_rev;
1699 }
1700
1701 diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
1702 index 246f906..ea51fcd 100644
1703 --- a/net/sched/cls_u32.c
1704 +++ b/net/sched/cls_u32.c
1705 @@ -637,8 +637,9 @@ static int u32_change(struct tcf_proto *tp, unsigned long base, u32 handle,
1706 break;
1707
1708 n->next = *ins;
1709 - wmb();
1710 + tcf_tree_lock(tp);
1711 *ins = n;
1712 + tcf_tree_unlock(tp);
1713
1714 *arg = (unsigned long)n;
1715 return 0;
1716 diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
1717 index d14f020..d2943a4 100644
1718 --- a/net/sched/sch_htb.c
1719 +++ b/net/sched/sch_htb.c
1720 @@ -924,6 +924,7 @@ static struct sk_buff *htb_dequeue(struct Qdisc *sch)
1721 }
1722 }
1723 sch->qstats.overlimits++;
1724 + qdisc_watchdog_cancel(&q->watchdog);
1725 qdisc_watchdog_schedule(&q->watchdog, next_event);
1726 fin:
1727 return skb;
1728 diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
1729 index a6a0ea7..679fcde 100644
1730 --- a/net/sctp/sm_statefuns.c
1731 +++ b/net/sctp/sm_statefuns.c
1732 @@ -3691,6 +3691,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,
1733 {
1734 struct sctp_chunk *chunk = arg;
1735 struct sctp_fwdtsn_hdr *fwdtsn_hdr;
1736 + struct sctp_fwdtsn_skip *skip;
1737 __u16 len;
1738 __u32 tsn;
1739
1740 @@ -3720,6 +3721,12 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,
1741 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
1742 goto discard_noforce;
1743
1744 + /* Silently discard the chunk if stream-id is not valid */
1745 + sctp_walk_fwdtsn(skip, chunk) {
1746 + if (ntohs(skip->stream) >= asoc->c.sinit_max_instreams)
1747 + goto discard_noforce;
1748 + }
1749 +
1750 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn));
1751 if (len > sizeof(struct sctp_fwdtsn_hdr))
1752 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN,
1753 @@ -3751,6 +3758,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
1754 {
1755 struct sctp_chunk *chunk = arg;
1756 struct sctp_fwdtsn_hdr *fwdtsn_hdr;
1757 + struct sctp_fwdtsn_skip *skip;
1758 __u16 len;
1759 __u32 tsn;
1760
1761 @@ -3780,6 +3788,12 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(
1762 if (sctp_tsnmap_check(&asoc->peer.tsn_map, tsn) < 0)
1763 goto gen_shutdown;
1764
1765 + /* Silently discard the chunk if stream-id is not valid */
1766 + sctp_walk_fwdtsn(skip, chunk) {
1767 + if (ntohs(skip->stream) >= asoc->c.sinit_max_instreams)
1768 + goto gen_shutdown;
1769 + }
1770 +
1771 sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn));
1772 if (len > sizeof(struct sctp_fwdtsn_hdr))
1773 sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN,
1774 diff --git a/security/keys/keyctl.c b/security/keys/keyctl.c
1775 index 9b4e0e9..3c0f421 100644
1776 --- a/security/keys/keyctl.c
1777 +++ b/security/keys/keyctl.c
1778 @@ -270,6 +270,7 @@ long keyctl_join_session_keyring(const char __user *_name)
1779
1780 /* join the session */
1781 ret = join_session_keyring(name);
1782 + kfree(name);
1783
1784 error:
1785 return ret;
1786 diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c
1787 index 2dc976d..87bade3 100644
1788 --- a/sound/pci/hda/patch_analog.c
1789 +++ b/sound/pci/hda/patch_analog.c
1790 @@ -629,6 +629,36 @@ static struct snd_kcontrol_new ad1986a_laptop_eapd_mixers[] = {
1791 HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
1792 HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
1793 HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
1794 + HDA_CODEC_VOLUME("Internal Mic Playback Volume", 0x17, 0, HDA_OUTPUT),
1795 + HDA_CODEC_MUTE("Internal Mic Playback Switch", 0x17, 0, HDA_OUTPUT),
1796 + HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
1797 + HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
1798 + HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
1799 + HDA_CODEC_VOLUME("Capture Volume", 0x12, 0x0, HDA_OUTPUT),
1800 + HDA_CODEC_MUTE("Capture Switch", 0x12, 0x0, HDA_OUTPUT),
1801 + {
1802 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1803 + .name = "Capture Source",
1804 + .info = ad198x_mux_enum_info,
1805 + .get = ad198x_mux_enum_get,
1806 + .put = ad198x_mux_enum_put,
1807 + },
1808 + {
1809 + .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
1810 + .name = "External Amplifier",
1811 + .info = ad198x_eapd_info,
1812 + .get = ad198x_eapd_get,
1813 + .put = ad198x_eapd_put,
1814 + .private_value = 0x1b | (1 << 8), /* port-D, inversed */
1815 + },
1816 + { } /* end */
1817 +};
1818 +
1819 +static struct snd_kcontrol_new ad1986a_samsung_mixers[] = {
1820 + HDA_BIND_VOL("Master Playback Volume", &ad1986a_laptop_master_vol),
1821 + HDA_BIND_SW("Master Playback Switch", &ad1986a_laptop_master_sw),
1822 + HDA_CODEC_VOLUME("PCM Playback Volume", 0x03, 0x0, HDA_OUTPUT),
1823 + HDA_CODEC_MUTE("PCM Playback Switch", 0x03, 0x0, HDA_OUTPUT),
1824 HDA_CODEC_VOLUME("Mic Playback Volume", 0x13, 0x0, HDA_OUTPUT),
1825 HDA_CODEC_MUTE("Mic Playback Switch", 0x13, 0x0, HDA_OUTPUT),
1826 HDA_CODEC_VOLUME("Mic Boost", 0x0f, 0x0, HDA_OUTPUT),
1827 @@ -917,6 +947,7 @@ enum {
1828 AD1986A_LAPTOP_EAPD,
1829 AD1986A_LAPTOP_AUTOMUTE,
1830 AD1986A_ULTRA,
1831 + AD1986A_SAMSUNG,
1832 AD1986A_MODELS
1833 };
1834
1835 @@ -927,6 +958,7 @@ static const char *ad1986a_models[AD1986A_MODELS] = {
1836 [AD1986A_LAPTOP_EAPD] = "laptop-eapd",
1837 [AD1986A_LAPTOP_AUTOMUTE] = "laptop-automute",
1838 [AD1986A_ULTRA] = "ultra",
1839 + [AD1986A_SAMSUNG] = "samsung",
1840 };
1841
1842 static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
1843 @@ -949,9 +981,9 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = {
1844 SND_PCI_QUIRK(0x1179, 0xff40, "Toshiba", AD1986A_LAPTOP_EAPD),
1845 SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK),
1846 SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP),
1847 - SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD),
1848 - SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD),
1849 - SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD),
1850 + SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_SAMSUNG),
1851 + SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_SAMSUNG),
1852 + SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_SAMSUNG),
1853 SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA),
1854 SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK),
1855 SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP),
1856 @@ -1033,6 +1065,17 @@ static int patch_ad1986a(struct hda_codec *codec)
1857 break;
1858 case AD1986A_LAPTOP_EAPD:
1859 spec->mixers[0] = ad1986a_laptop_eapd_mixers;
1860 + spec->num_init_verbs = 2;
1861 + spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1862 + spec->multiout.max_channels = 2;
1863 + spec->multiout.num_dacs = 1;
1864 + spec->multiout.dac_nids = ad1986a_laptop_dac_nids;
1865 + if (!is_jack_available(codec, 0x25))
1866 + spec->multiout.dig_out_nid = 0;
1867 + spec->input_mux = &ad1986a_laptop_eapd_capture_source;
1868 + break;
1869 + case AD1986A_SAMSUNG:
1870 + spec->mixers[0] = ad1986a_samsung_mixers;
1871 spec->num_init_verbs = 3;
1872 spec->init_verbs[1] = ad1986a_eapd_init_verbs;
1873 spec->init_verbs[2] = ad1986a_automic_verbs;
1874 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1875 index a378c01..befb699 100644
1876 --- a/sound/pci/hda/patch_realtek.c
1877 +++ b/sound/pci/hda/patch_realtek.c
1878 @@ -10473,6 +10473,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = {
1879 SND_PCI_QUIRK(0x10cf, 0x142d, "Fujitsu Lifebook E8410", ALC262_FUJITSU),
1880 SND_PCI_QUIRK(0x144d, 0xc032, "Samsung Q1 Ultra", ALC262_ULTRA),
1881 SND_PCI_QUIRK(0x144d, 0xc039, "Samsung Q1U EL", ALC262_ULTRA),
1882 + SND_PCI_QUIRK(0x144d, 0xc510, "Samsung Q45", ALC262_HIPPO),
1883 SND_PCI_QUIRK(0x17aa, 0x384e, "Lenovo 3000 y410", ALC262_LENOVO_3000),
1884 SND_PCI_QUIRK(0x17ff, 0x0560, "Benq ED8", ALC262_BENQ_ED8),
1885 SND_PCI_QUIRK(0x17ff, 0x058d, "Benq T31-16", ALC262_BENQ_T31),
1886 diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
1887 index 24ff2b8..8b204b8 100644
1888 --- a/sound/pci/hda/patch_sigmatel.c
1889 +++ b/sound/pci/hda/patch_sigmatel.c
1890 @@ -89,6 +89,7 @@ enum {
1891 STAC_DELL_M4_2,
1892 STAC_DELL_M4_3,
1893 STAC_HP_M4,
1894 + STAC_HP_DV5,
1895 STAC_92HD71BXX_MODELS
1896 };
1897
1898 @@ -1702,6 +1703,7 @@ static unsigned int *stac92hd71bxx_brd_tbl[STAC_92HD71BXX_MODELS] = {
1899 [STAC_DELL_M4_2] = dell_m4_2_pin_configs,
1900 [STAC_DELL_M4_3] = dell_m4_3_pin_configs,
1901 [STAC_HP_M4] = NULL,
1902 + [STAC_HP_DV5] = NULL,
1903 };
1904
1905 static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1906 @@ -1710,6 +1712,7 @@ static const char *stac92hd71bxx_models[STAC_92HD71BXX_MODELS] = {
1907 [STAC_DELL_M4_2] = "dell-m4-2",
1908 [STAC_DELL_M4_3] = "dell-m4-3",
1909 [STAC_HP_M4] = "hp-m4",
1910 + [STAC_HP_DV5] = "hp-dv5",
1911 };
1912
1913 static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1914 @@ -1722,6 +1725,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = {
1915 "HP dv7", STAC_HP_M4),
1916 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x30fc,
1917 "HP dv7", STAC_HP_M4),
1918 + SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3603,
1919 + "HP dv5", STAC_HP_DV5),
1920 SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x361a,
1921 "unknown HP", STAC_HP_M4),
1922 SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233,
1923 @@ -3980,8 +3985,19 @@ static void stac92xx_hp_detect(struct hda_codec *codec, unsigned int res)
1924 continue;
1925 if (presence)
1926 stac92xx_set_pinctl(codec, cfg->hp_pins[i], val);
1927 +#if 0 /* FIXME */
1928 +/* Resetting the pinctl like below may lead to (a sort of) regressions
1929 + * on some devices since they use the HP pin actually for line/speaker
1930 + * outs although the default pin config shows a different pin (that is
1931 + * wrong and useless).
1932 + *
1933 + * So, it's basically a problem of default pin configs, likely a BIOS issue.
1934 + * But, disabling the code below just works around it, and I'm too tired of
1935 + * bug reports with such devices...
1936 + */
1937 else
1938 stac92xx_reset_pinctl(codec, cfg->hp_pins[i], val);
1939 +#endif /* FIXME */
1940 }
1941 }
1942
1943 diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
1944 index 98c6a8c..e9e829e 100644
1945 --- a/sound/pci/oxygen/virtuoso.c
1946 +++ b/sound/pci/oxygen/virtuoso.c
1947 @@ -26,7 +26,7 @@
1948 * SPI 0 -> 1st PCM1796 (front)
1949 * SPI 1 -> 2nd PCM1796 (surround)
1950 * SPI 2 -> 3rd PCM1796 (center/LFE)
1951 - * SPI 4 -> 4th PCM1796 (back)
1952 + * SPI 4 -> 4th PCM1796 (back) and EEPROM self-destruct (do not use!)
1953 *
1954 * GPIO 2 -> M0 of CS5381
1955 * GPIO 3 -> M1 of CS5381
1956 @@ -207,6 +207,12 @@ static void xonar_gpio_changed(struct oxygen *chip);
1957 static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
1958 u8 reg, u8 value)
1959 {
1960 + /*
1961 + * We don't want to do writes on SPI 4 because the EEPROM, which shares
1962 + * the same pin, might get confused and broken. We'd better take care
1963 + * that the driver works with the default register values ...
1964 + */
1965 +#if 0
1966 /* maps ALSA channel pair number to SPI output */
1967 static const u8 codec_map[4] = {
1968 0, 1, 2, 4
1969 @@ -217,6 +223,7 @@ static inline void pcm1796_write_spi(struct oxygen *chip, unsigned int codec,
1970 (codec_map[codec] << OXYGEN_SPI_CODEC_SHIFT) |
1971 OXYGEN_SPI_CEN_LATCH_CLOCK_HI,
1972 (reg << 8) | value);
1973 +#endif
1974 }
1975
1976 static inline void pcm1796_write_i2c(struct oxygen *chip, unsigned int codec,
1977 @@ -750,6 +757,9 @@ static const DECLARE_TLV_DB_SCALE(cs4362a_db_scale, -12700, 100, 0);
1978
1979 static int xonar_d2_control_filter(struct snd_kcontrol_new *template)
1980 {
1981 + if (!strncmp(template->name, "Master Playback ", 16))
1982 + /* disable volume/mute because they would require SPI writes */
1983 + return 1;
1984 if (!strncmp(template->name, "CD Capture ", 11))
1985 /* CD in is actually connected to the video in pin */
1986 template->private_value ^= AC97_CD ^ AC97_VIDEO;
1987 @@ -840,9 +850,8 @@ static const struct oxygen_model model_xonar_d2 = {
1988 .dac_volume_min = 0x0f,
1989 .dac_volume_max = 0xff,
1990 .misc_flags = OXYGEN_MISC_MIDI,
1991 - .function_flags = OXYGEN_FUNCTION_SPI |
1992 - OXYGEN_FUNCTION_ENABLE_SPI_4_5,
1993 - .dac_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
1994 + .function_flags = OXYGEN_FUNCTION_SPI,
1995 + .dac_i2s_format = OXYGEN_I2S_FORMAT_I2S,
1996 .adc_i2s_format = OXYGEN_I2S_FORMAT_LJUST,
1997 };
1998

  ViewVC Help
Powered by ViewVC 1.1.20