diff options
41 files changed, 508 insertions, 196 deletions
diff --git a/Documentation/DocBook/libata.tmpl b/Documentation/DocBook/libata.tmpl index ba9975771503..ff3e5bec1c24 100644 --- a/Documentation/DocBook/libata.tmpl +++ b/Documentation/DocBook/libata.tmpl | |||
| @@ -107,10 +107,6 @@ void (*dev_config) (struct ata_port *, struct ata_device *); | |||
| 107 | issue of SET FEATURES - XFER MODE, and prior to operation. | 107 | issue of SET FEATURES - XFER MODE, and prior to operation. |
| 108 | </para> | 108 | </para> |
| 109 | <para> | 109 | <para> |
| 110 | Called by ata_device_add() after ata_dev_identify() determines | ||
| 111 | a device is present. | ||
| 112 | </para> | ||
| 113 | <para> | ||
| 114 | This entry may be specified as NULL in ata_port_operations. | 110 | This entry may be specified as NULL in ata_port_operations. |
| 115 | </para> | 111 | </para> |
| 116 | 112 | ||
| @@ -154,8 +150,8 @@ unsigned int (*mode_filter) (struct ata_port *, struct ata_device *, unsigned in | |||
| 154 | 150 | ||
| 155 | <sect2><title>Taskfile read/write</title> | 151 | <sect2><title>Taskfile read/write</title> |
| 156 | <programlisting> | 152 | <programlisting> |
| 157 | void (*tf_load) (struct ata_port *ap, struct ata_taskfile *tf); | 153 | void (*sff_tf_load) (struct ata_port *ap, struct ata_taskfile *tf); |
| 158 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | 154 | void (*sff_tf_read) (struct ata_port *ap, struct ata_taskfile *tf); |
| 159 | </programlisting> | 155 | </programlisting> |
| 160 | 156 | ||
| 161 | <para> | 157 | <para> |
| @@ -164,36 +160,35 @@ void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | |||
| 164 | hardware registers / DMA buffers, to obtain the current set of | 160 | hardware registers / DMA buffers, to obtain the current set of |
| 165 | taskfile register values. | 161 | taskfile register values. |
| 166 | Most drivers for taskfile-based hardware (PIO or MMIO) use | 162 | Most drivers for taskfile-based hardware (PIO or MMIO) use |
| 167 | ata_tf_load() and ata_tf_read() for these hooks. | 163 | ata_sff_tf_load() and ata_sff_tf_read() for these hooks. |
| 168 | </para> | 164 | </para> |
| 169 | 165 | ||
| 170 | </sect2> | 166 | </sect2> |
| 171 | 167 | ||
| 172 | <sect2><title>PIO data read/write</title> | 168 | <sect2><title>PIO data read/write</title> |
| 173 | <programlisting> | 169 | <programlisting> |
| 174 | void (*data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); | 170 | void (*sff_data_xfer) (struct ata_device *, unsigned char *, unsigned int, int); |
| 175 | </programlisting> | 171 | </programlisting> |
| 176 | 172 | ||
| 177 | <para> | 173 | <para> |
| 178 | All bmdma-style drivers must implement this hook. This is the low-level | 174 | All bmdma-style drivers must implement this hook. This is the low-level |
| 179 | operation that actually copies the data bytes during a PIO data | 175 | operation that actually copies the data bytes during a PIO data |
| 180 | transfer. | 176 | transfer. |
| 181 | Typically the driver | 177 | Typically the driver will choose one of ata_sff_data_xfer_noirq(), |
| 182 | will choose one of ata_pio_data_xfer_noirq(), ata_pio_data_xfer(), or | 178 | ata_sff_data_xfer(), or ata_sff_data_xfer32(). |
| 183 | ata_mmio_data_xfer(). | ||
| 184 | </para> | 179 | </para> |
| 185 | 180 | ||
| 186 | </sect2> | 181 | </sect2> |
| 187 | 182 | ||
| 188 | <sect2><title>ATA command execute</title> | 183 | <sect2><title>ATA command execute</title> |
| 189 | <programlisting> | 184 | <programlisting> |
| 190 | void (*exec_command)(struct ata_port *ap, struct ata_taskfile *tf); | 185 | void (*sff_exec_command)(struct ata_port *ap, struct ata_taskfile *tf); |
| 191 | </programlisting> | 186 | </programlisting> |
| 192 | 187 | ||
| 193 | <para> | 188 | <para> |
| 194 | causes an ATA command, previously loaded with | 189 | causes an ATA command, previously loaded with |
| 195 | ->tf_load(), to be initiated in hardware. | 190 | ->tf_load(), to be initiated in hardware. |
| 196 | Most drivers for taskfile-based hardware use ata_exec_command() | 191 | Most drivers for taskfile-based hardware use ata_sff_exec_command() |
| 197 | for this hook. | 192 | for this hook. |
| 198 | </para> | 193 | </para> |
| 199 | 194 | ||
| @@ -218,8 +213,8 @@ command. | |||
| 218 | 213 | ||
| 219 | <sect2><title>Read specific ATA shadow registers</title> | 214 | <sect2><title>Read specific ATA shadow registers</title> |
| 220 | <programlisting> | 215 | <programlisting> |
| 221 | u8 (*check_status)(struct ata_port *ap); | 216 | u8 (*sff_check_status)(struct ata_port *ap); |
| 222 | u8 (*check_altstatus)(struct ata_port *ap); | 217 | u8 (*sff_check_altstatus)(struct ata_port *ap); |
| 223 | </programlisting> | 218 | </programlisting> |
| 224 | 219 | ||
| 225 | <para> | 220 | <para> |
| @@ -227,20 +222,14 @@ u8 (*check_altstatus)(struct ata_port *ap); | |||
| 227 | hardware. On some hardware, reading the Status register has | 222 | hardware. On some hardware, reading the Status register has |
| 228 | the side effect of clearing the interrupt condition. | 223 | the side effect of clearing the interrupt condition. |
| 229 | Most drivers for taskfile-based hardware use | 224 | Most drivers for taskfile-based hardware use |
| 230 | ata_check_status() for this hook. | 225 | ata_sff_check_status() for this hook. |
| 231 | </para> | ||
| 232 | <para> | ||
| 233 | Note that because this is called from ata_device_add(), at | ||
| 234 | least a dummy function that clears device interrupts must be | ||
| 235 | provided for all drivers, even if the controller doesn't | ||
| 236 | actually have a taskfile status register. | ||
| 237 | </para> | 226 | </para> |
| 238 | 227 | ||
| 239 | </sect2> | 228 | </sect2> |
| 240 | 229 | ||
| 241 | <sect2><title>Select ATA device on bus</title> | 230 | <sect2><title>Select ATA device on bus</title> |
| 242 | <programlisting> | 231 | <programlisting> |
| 243 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 232 | void (*sff_dev_select)(struct ata_port *ap, unsigned int device); |
| 244 | </programlisting> | 233 | </programlisting> |
| 245 | 234 | ||
| 246 | <para> | 235 | <para> |
| @@ -251,9 +240,7 @@ void (*dev_select)(struct ata_port *ap, unsigned int device); | |||
| 251 | </para> | 240 | </para> |
| 252 | <para> | 241 | <para> |
| 253 | Most drivers for taskfile-based hardware use | 242 | Most drivers for taskfile-based hardware use |
| 254 | ata_std_dev_select() for this hook. Controllers which do not | 243 | ata_sff_dev_select() for this hook. |
| 255 | support second drives on a port (such as SATA contollers) will | ||
| 256 | use ata_noop_dev_select(). | ||
| 257 | </para> | 244 | </para> |
| 258 | 245 | ||
| 259 | </sect2> | 246 | </sect2> |
| @@ -441,13 +428,13 @@ void (*irq_clear) (struct ata_port *); | |||
| 441 | to struct ata_host_set. | 428 | to struct ata_host_set. |
| 442 | </para> | 429 | </para> |
| 443 | <para> | 430 | <para> |
| 444 | Most legacy IDE drivers use ata_interrupt() for the | 431 | Most legacy IDE drivers use ata_sff_interrupt() for the |
| 445 | irq_handler hook, which scans all ports in the host_set, | 432 | irq_handler hook, which scans all ports in the host_set, |
| 446 | determines which queued command was active (if any), and calls | 433 | determines which queued command was active (if any), and calls |
| 447 | ata_host_intr(ap,qc). | 434 | ata_sff_host_intr(ap,qc). |
| 448 | </para> | 435 | </para> |
| 449 | <para> | 436 | <para> |
| 450 | Most legacy IDE drivers use ata_bmdma_irq_clear() for the | 437 | Most legacy IDE drivers use ata_sff_irq_clear() for the |
| 451 | irq_clear() hook, which simply clears the interrupt and error | 438 | irq_clear() hook, which simply clears the interrupt and error |
| 452 | flags in the DMA status register. | 439 | flags in the DMA status register. |
| 453 | </para> | 440 | </para> |
| @@ -496,10 +483,6 @@ void (*host_stop) (struct ata_host_set *host_set); | |||
| 496 | data from port at this time. | 483 | data from port at this time. |
| 497 | </para> | 484 | </para> |
| 498 | <para> | 485 | <para> |
| 499 | Many drivers use ata_port_stop() as this hook, which frees the | ||
| 500 | PRD table. | ||
| 501 | </para> | ||
| 502 | <para> | ||
| 503 | ->host_stop() is called after all ->port_stop() calls | 486 | ->host_stop() is called after all ->port_stop() calls |
| 504 | have completed. The hook must finalize hardware shutdown, release DMA | 487 | have completed. The hook must finalize hardware shutdown, release DMA |
| 505 | and other resources, etc. | 488 | and other resources, etc. |
diff --git a/Documentation/input/elantech.txt b/Documentation/input/elantech.txt index a10c3b6ba7c4..56941ae1f5db 100644 --- a/Documentation/input/elantech.txt +++ b/Documentation/input/elantech.txt | |||
| @@ -333,14 +333,14 @@ byte 0: | |||
| 333 | byte 1: | 333 | byte 1: |
| 334 | 334 | ||
| 335 | bit 7 6 5 4 3 2 1 0 | 335 | bit 7 6 5 4 3 2 1 0 |
| 336 | x15 x14 x13 x12 x11 x10 x9 x8 | 336 | . . . . . x10 x9 x8 |
| 337 | 337 | ||
| 338 | byte 2: | 338 | byte 2: |
| 339 | 339 | ||
| 340 | bit 7 6 5 4 3 2 1 0 | 340 | bit 7 6 5 4 3 2 1 0 |
| 341 | x7 x6 x5 x4 x4 x2 x1 x0 | 341 | x7 x6 x5 x4 x4 x2 x1 x0 |
| 342 | 342 | ||
| 343 | x15..x0 = absolute x value (horizontal) | 343 | x10..x0 = absolute x value (horizontal) |
| 344 | 344 | ||
| 345 | byte 3: | 345 | byte 3: |
| 346 | 346 | ||
| @@ -350,14 +350,14 @@ byte 3: | |||
| 350 | byte 4: | 350 | byte 4: |
| 351 | 351 | ||
| 352 | bit 7 6 5 4 3 2 1 0 | 352 | bit 7 6 5 4 3 2 1 0 |
| 353 | y15 y14 y13 y12 y11 y10 y8 y8 | 353 | . . . . . . y9 y8 |
| 354 | 354 | ||
| 355 | byte 5: | 355 | byte 5: |
| 356 | 356 | ||
| 357 | bit 7 6 5 4 3 2 1 0 | 357 | bit 7 6 5 4 3 2 1 0 |
| 358 | y7 y6 y5 y4 y3 y2 y1 y0 | 358 | y7 y6 y5 y4 y3 y2 y1 y0 |
| 359 | 359 | ||
| 360 | y15..y0 = absolute y value (vertical) | 360 | y9..y0 = absolute y value (vertical) |
| 361 | 361 | ||
| 362 | 362 | ||
| 363 | 4.2.2 Two finger touch | 363 | 4.2.2 Two finger touch |
diff --git a/crypto/async_tx/async_raid6_recov.c b/crypto/async_tx/async_raid6_recov.c index 943f2abac9b4..ce038d861eb9 100644 --- a/crypto/async_tx/async_raid6_recov.c +++ b/crypto/async_tx/async_raid6_recov.c | |||
| @@ -324,6 +324,7 @@ struct dma_async_tx_descriptor * | |||
| 324 | async_raid6_2data_recov(int disks, size_t bytes, int faila, int failb, | 324 | async_raid6_2data_recov(int disks, size_t bytes, int faila, int failb, |
| 325 | struct page **blocks, struct async_submit_ctl *submit) | 325 | struct page **blocks, struct async_submit_ctl *submit) |
| 326 | { | 326 | { |
| 327 | void *scribble = submit->scribble; | ||
| 327 | int non_zero_srcs, i; | 328 | int non_zero_srcs, i; |
| 328 | 329 | ||
| 329 | BUG_ON(faila == failb); | 330 | BUG_ON(faila == failb); |
| @@ -332,11 +333,13 @@ async_raid6_2data_recov(int disks, size_t bytes, int faila, int failb, | |||
| 332 | 333 | ||
| 333 | pr_debug("%s: disks: %d len: %zu\n", __func__, disks, bytes); | 334 | pr_debug("%s: disks: %d len: %zu\n", __func__, disks, bytes); |
| 334 | 335 | ||
| 335 | /* we need to preserve the contents of 'blocks' for the async | 336 | /* if a dma resource is not available or a scribble buffer is not |
| 336 | * case, so punt to synchronous if a scribble buffer is not available | 337 | * available punt to the synchronous path. In the 'dma not |
| 338 | * available' case be sure to use the scribble buffer to | ||
| 339 | * preserve the content of 'blocks' as the caller intended. | ||
| 337 | */ | 340 | */ |
| 338 | if (!submit->scribble) { | 341 | if (!async_dma_find_channel(DMA_PQ) || !scribble) { |
| 339 | void **ptrs = (void **) blocks; | 342 | void **ptrs = scribble ? scribble : (void **) blocks; |
| 340 | 343 | ||
| 341 | async_tx_quiesce(&submit->depend_tx); | 344 | async_tx_quiesce(&submit->depend_tx); |
| 342 | for (i = 0; i < disks; i++) | 345 | for (i = 0; i < disks; i++) |
| @@ -406,11 +409,13 @@ async_raid6_datap_recov(int disks, size_t bytes, int faila, | |||
| 406 | 409 | ||
| 407 | pr_debug("%s: disks: %d len: %zu\n", __func__, disks, bytes); | 410 | pr_debug("%s: disks: %d len: %zu\n", __func__, disks, bytes); |
| 408 | 411 | ||
| 409 | /* we need to preserve the contents of 'blocks' for the async | 412 | /* if a dma resource is not available or a scribble buffer is not |
| 410 | * case, so punt to synchronous if a scribble buffer is not available | 413 | * available punt to the synchronous path. In the 'dma not |
| 414 | * available' case be sure to use the scribble buffer to | ||
| 415 | * preserve the content of 'blocks' as the caller intended. | ||
| 411 | */ | 416 | */ |
| 412 | if (!scribble) { | 417 | if (!async_dma_find_channel(DMA_PQ) || !scribble) { |
| 413 | void **ptrs = (void **) blocks; | 418 | void **ptrs = scribble ? scribble : (void **) blocks; |
| 414 | 419 | ||
| 415 | async_tx_quiesce(&submit->depend_tx); | 420 | async_tx_quiesce(&submit->depend_tx); |
| 416 | for (i = 0; i < disks; i++) | 421 | for (i = 0; i < disks; i++) |
diff --git a/drivers/ata/pata_pcmcia.c b/drivers/ata/pata_pcmcia.c index 4164dd244dd0..d94b8f0bd743 100644 --- a/drivers/ata/pata_pcmcia.c +++ b/drivers/ata/pata_pcmcia.c | |||
| @@ -424,7 +424,7 @@ static struct pcmcia_device_id pcmcia_devices[] = { | |||
| 424 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), | 424 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), |
| 425 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), | 425 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), |
| 426 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), | 426 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), |
| 427 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17), | 427 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x55d5bffb), |
| 428 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), | 428 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), |
| 429 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), | 429 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), |
| 430 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), | 430 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), |
| @@ -446,7 +446,7 @@ static struct pcmcia_device_id pcmcia_devices[] = { | |||
| 446 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), | 446 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), |
| 447 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), | 447 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), |
| 448 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), | 448 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), |
| 449 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d), | 449 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x7558f133), |
| 450 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), | 450 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), |
| 451 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), | 451 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), |
| 452 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), | 452 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), |
diff --git a/drivers/ide/ide-cs.c b/drivers/ide/ide-cs.c index defce2877eef..b85450865ff0 100644 --- a/drivers/ide/ide-cs.c +++ b/drivers/ide/ide-cs.c | |||
| @@ -409,7 +409,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 409 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), | 409 | PCMCIA_DEVICE_PROD_ID12("Hyperstone", "Model1", 0x3d5b9ef5, 0xca6ab420), |
| 410 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), | 410 | PCMCIA_DEVICE_PROD_ID12("IBM", "microdrive", 0xb569a6e5, 0xa6d76178), |
| 411 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), | 411 | PCMCIA_DEVICE_PROD_ID12("IBM", "IBM17JSSFP20", 0xb569a6e5, 0xf2508753), |
| 412 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x3e520e17), | 412 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 1GB", 0x2e6d1829, 0x55d5bffb), |
| 413 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), | 413 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF CARD 4GB", 0x2e6d1829, 0x531e7d10), |
| 414 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), | 414 | PCMCIA_DEVICE_PROD_ID12("KINGSTON", "CF8GB", 0x2e6d1829, 0xacbe682e), |
| 415 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), | 415 | PCMCIA_DEVICE_PROD_ID12("IO DATA", "CBIDE2 ", 0x547e66dc, 0x8671043b), |
| @@ -431,7 +431,7 @@ static struct pcmcia_device_id ide_ids[] = { | |||
| 431 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), | 431 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS1GCF80", 0x709b1bf1, 0x2a54d4b1), |
| 432 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), | 432 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS2GCF120", 0x709b1bf1, 0x969aa4f2), |
| 433 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), | 433 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF120", 0x709b1bf1, 0xf54a91c8), |
| 434 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x9351e59d), | 434 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS4GCF133", 0x709b1bf1, 0x7558f133), |
| 435 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), | 435 | PCMCIA_DEVICE_PROD_ID12("TRANSCEND", "TS8GCF133", 0x709b1bf1, 0xb2f89b47), |
| 436 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), | 436 | PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), |
| 437 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), | 437 | PCMCIA_DEVICE_PROD_ID12("WEIDA", "TWTTI", 0xcc7cf69c, 0x212bb918), |
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index c52bec4d0530..423e0e6031ab 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
| @@ -929,6 +929,24 @@ static const struct input_device_id joydev_ids[] = { | |||
| 929 | .evbit = { BIT_MASK(EV_ABS) }, | 929 | .evbit = { BIT_MASK(EV_ABS) }, |
| 930 | .absbit = { BIT_MASK(ABS_THROTTLE) }, | 930 | .absbit = { BIT_MASK(ABS_THROTTLE) }, |
| 931 | }, | 931 | }, |
| 932 | { | ||
| 933 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
| 934 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 935 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 936 | .keybit = {[BIT_WORD(BTN_JOYSTICK)] = BIT_MASK(BTN_JOYSTICK) }, | ||
| 937 | }, | ||
| 938 | { | ||
| 939 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
| 940 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 941 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 942 | .keybit = { [BIT_WORD(BTN_GAMEPAD)] = BIT_MASK(BTN_GAMEPAD) }, | ||
| 943 | }, | ||
| 944 | { | ||
| 945 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
| 946 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
| 947 | .evbit = { BIT_MASK(EV_KEY) }, | ||
| 948 | .keybit = { [BIT_WORD(BTN_TRIGGER_HAPPY)] = BIT_MASK(BTN_TRIGGER_HAPPY) }, | ||
| 949 | }, | ||
| 932 | { } /* Terminating entry */ | 950 | { } /* Terminating entry */ |
| 933 | }; | 951 | }; |
| 934 | 952 | ||
diff --git a/drivers/input/misc/ati_remote.c b/drivers/input/misc/ati_remote.c index 614b65d78fe9..e8bbc619f6df 100644 --- a/drivers/input/misc/ati_remote.c +++ b/drivers/input/misc/ati_remote.c | |||
| @@ -98,10 +98,12 @@ | |||
| 98 | * Module and Version Information, Module Parameters | 98 | * Module and Version Information, Module Parameters |
| 99 | */ | 99 | */ |
| 100 | 100 | ||
| 101 | #define ATI_REMOTE_VENDOR_ID 0x0bc7 | 101 | #define ATI_REMOTE_VENDOR_ID 0x0bc7 |
| 102 | #define ATI_REMOTE_PRODUCT_ID 0x004 | 102 | #define LOLA_REMOTE_PRODUCT_ID 0x0002 |
| 103 | #define LOLA_REMOTE_PRODUCT_ID 0x002 | 103 | #define LOLA2_REMOTE_PRODUCT_ID 0x0003 |
| 104 | #define MEDION_REMOTE_PRODUCT_ID 0x006 | 104 | #define ATI_REMOTE_PRODUCT_ID 0x0004 |
| 105 | #define NVIDIA_REMOTE_PRODUCT_ID 0x0005 | ||
| 106 | #define MEDION_REMOTE_PRODUCT_ID 0x0006 | ||
| 105 | 107 | ||
| 106 | #define DRIVER_VERSION "2.2.1" | 108 | #define DRIVER_VERSION "2.2.1" |
| 107 | #define DRIVER_AUTHOR "Torrey Hoffman <thoffman@arnor.net>" | 109 | #define DRIVER_AUTHOR "Torrey Hoffman <thoffman@arnor.net>" |
| @@ -142,8 +144,10 @@ MODULE_PARM_DESC(repeat_delay, "Delay before sending repeats, default = 500 msec | |||
| 142 | #define err(format, arg...) printk(KERN_ERR format , ## arg) | 144 | #define err(format, arg...) printk(KERN_ERR format , ## arg) |
| 143 | 145 | ||
| 144 | static struct usb_device_id ati_remote_table[] = { | 146 | static struct usb_device_id ati_remote_table[] = { |
| 145 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID) }, | ||
| 146 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID) }, | 147 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA_REMOTE_PRODUCT_ID) }, |
| 148 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, LOLA2_REMOTE_PRODUCT_ID) }, | ||
| 149 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, ATI_REMOTE_PRODUCT_ID) }, | ||
| 150 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, NVIDIA_REMOTE_PRODUCT_ID) }, | ||
| 147 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID) }, | 151 | { USB_DEVICE(ATI_REMOTE_VENDOR_ID, MEDION_REMOTE_PRODUCT_ID) }, |
| 148 | {} /* Terminating entry */ | 152 | {} /* Terminating entry */ |
| 149 | }; | 153 | }; |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 0d22cb9ce42e..99d58764ef03 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
| @@ -64,7 +64,6 @@ static const struct alps_model_info alps_model_data[] = { | |||
| 64 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, | 64 | { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, |
| 65 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, | 65 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, |
| 66 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ | 66 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ |
| 67 | { { 0x73, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, /* HP Pavilion dm3 */ | ||
| 68 | { { 0x52, 0x01, 0x14 }, 0xff, 0xff, | 67 | { { 0x52, 0x01, 0x14 }, 0xff, 0xff, |
| 69 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ | 68 | ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ |
| 70 | }; | 69 | }; |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index a138b5da79f9..0520c2e19927 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
| @@ -25,6 +25,10 @@ | |||
| 25 | printk(KERN_DEBUG format, ##arg); \ | 25 | printk(KERN_DEBUG format, ##arg); \ |
| 26 | } while (0) | 26 | } while (0) |
| 27 | 27 | ||
| 28 | static bool force_elantech; | ||
| 29 | module_param_named(force_elantech, force_elantech, bool, 0644); | ||
| 30 | MODULE_PARM_DESC(force_elantech, "Force the Elantech PS/2 protocol extension to be used, 1 = enabled, 0 = disabled (default)."); | ||
| 31 | |||
| 28 | /* | 32 | /* |
| 29 | * Send a Synaptics style sliced query command | 33 | * Send a Synaptics style sliced query command |
| 30 | */ | 34 | */ |
| @@ -182,13 +186,17 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
| 182 | static int old_fingers; | 186 | static int old_fingers; |
| 183 | 187 | ||
| 184 | if (etd->fw_version_maj == 0x01) { | 188 | if (etd->fw_version_maj == 0x01) { |
| 185 | /* byte 0: D U p1 p2 1 p3 R L | 189 | /* |
| 186 | byte 1: f 0 th tw x9 x8 y9 y8 */ | 190 | * byte 0: D U p1 p2 1 p3 R L |
| 191 | * byte 1: f 0 th tw x9 x8 y9 y8 | ||
| 192 | */ | ||
| 187 | fingers = ((packet[1] & 0x80) >> 7) + | 193 | fingers = ((packet[1] & 0x80) >> 7) + |
| 188 | ((packet[1] & 0x30) >> 4); | 194 | ((packet[1] & 0x30) >> 4); |
| 189 | } else { | 195 | } else { |
| 190 | /* byte 0: n1 n0 p2 p1 1 p3 R L | 196 | /* |
| 191 | byte 1: 0 0 0 0 x9 x8 y9 y8 */ | 197 | * byte 0: n1 n0 p2 p1 1 p3 R L |
| 198 | * byte 1: 0 0 0 0 x9 x8 y9 y8 | ||
| 199 | */ | ||
| 192 | fingers = (packet[0] & 0xc0) >> 6; | 200 | fingers = (packet[0] & 0xc0) >> 6; |
| 193 | } | 201 | } |
| 194 | 202 | ||
| @@ -202,13 +210,15 @@ static void elantech_report_absolute_v1(struct psmouse *psmouse) | |||
| 202 | 210 | ||
| 203 | input_report_key(dev, BTN_TOUCH, fingers != 0); | 211 | input_report_key(dev, BTN_TOUCH, fingers != 0); |
| 204 | 212 | ||
| 205 | /* byte 2: x7 x6 x5 x4 x3 x2 x1 x0 | 213 | /* |
| 206 | byte 3: y7 y6 y5 y4 y3 y2 y1 y0 */ | 214 | * byte 2: x7 x6 x5 x4 x3 x2 x1 x0 |
| 215 | * byte 3: y7 y6 y5 y4 y3 y2 y1 y0 | ||
| 216 | */ | ||
| 207 | if (fingers) { | 217 | if (fingers) { |
| 208 | input_report_abs(dev, ABS_X, | 218 | input_report_abs(dev, ABS_X, |
| 209 | ((packet[1] & 0x0c) << 6) | packet[2]); | 219 | ((packet[1] & 0x0c) << 6) | packet[2]); |
| 210 | input_report_abs(dev, ABS_Y, ETP_YMAX_V1 - | 220 | input_report_abs(dev, ABS_Y, |
| 211 | (((packet[1] & 0x03) << 8) | packet[3])); | 221 | ETP_YMAX_V1 - (((packet[1] & 0x03) << 8) | packet[3])); |
| 212 | } | 222 | } |
| 213 | 223 | ||
| 214 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); | 224 | input_report_key(dev, BTN_TOOL_FINGER, fingers == 1); |
| @@ -247,34 +257,47 @@ static void elantech_report_absolute_v2(struct psmouse *psmouse) | |||
| 247 | 257 | ||
| 248 | switch (fingers) { | 258 | switch (fingers) { |
| 249 | case 1: | 259 | case 1: |
| 250 | /* byte 1: x15 x14 x13 x12 x11 x10 x9 x8 | 260 | /* |
| 251 | byte 2: x7 x6 x5 x4 x4 x2 x1 x0 */ | 261 | * byte 1: . . . . . x10 x9 x8 |
| 252 | input_report_abs(dev, ABS_X, (packet[1] << 8) | packet[2]); | 262 | * byte 2: x7 x6 x5 x4 x4 x2 x1 x0 |
| 253 | /* byte 4: y15 y14 y13 y12 y11 y10 y8 y8 | 263 | */ |
| 254 | byte 5: y7 y6 y5 y4 y3 y2 y1 y0 */ | 264 | input_report_abs(dev, ABS_X, |
| 255 | input_report_abs(dev, ABS_Y, ETP_YMAX_V2 - | 265 | ((packet[1] & 0x07) << 8) | packet[2]); |
| 256 | ((packet[4] << 8) | packet[5])); | 266 | /* |
| 267 | * byte 4: . . . . . . y9 y8 | ||
| 268 | * byte 5: y7 y6 y5 y4 y3 y2 y1 y0 | ||
| 269 | */ | ||
| 270 | input_report_abs(dev, ABS_Y, | ||
| 271 | ETP_YMAX_V2 - (((packet[4] & 0x03) << 8) | packet[5])); | ||
| 257 | break; | 272 | break; |
| 258 | 273 | ||
| 259 | case 2: | 274 | case 2: |
| 260 | /* The coordinate of each finger is reported separately with | 275 | /* |
| 261 | a lower resolution for two finger touches */ | 276 | * The coordinate of each finger is reported separately |
| 262 | /* byte 0: . . ay8 ax8 . . . . | 277 | * with a lower resolution for two finger touches: |
| 263 | byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 */ | 278 | * byte 0: . . ay8 ax8 . . . . |
| 279 | * byte 1: ax7 ax6 ax5 ax4 ax3 ax2 ax1 ax0 | ||
| 280 | */ | ||
| 264 | x1 = ((packet[0] & 0x10) << 4) | packet[1]; | 281 | x1 = ((packet[0] & 0x10) << 4) | packet[1]; |
| 265 | /* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */ | 282 | /* byte 2: ay7 ay6 ay5 ay4 ay3 ay2 ay1 ay0 */ |
| 266 | y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]); | 283 | y1 = ETP_2FT_YMAX - (((packet[0] & 0x20) << 3) | packet[2]); |
| 267 | /* byte 3: . . by8 bx8 . . . . | 284 | /* |
| 268 | byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 */ | 285 | * byte 3: . . by8 bx8 . . . . |
| 286 | * byte 4: bx7 bx6 bx5 bx4 bx3 bx2 bx1 bx0 | ||
| 287 | */ | ||
| 269 | x2 = ((packet[3] & 0x10) << 4) | packet[4]; | 288 | x2 = ((packet[3] & 0x10) << 4) | packet[4]; |
| 270 | /* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */ | 289 | /* byte 5: by7 by8 by5 by4 by3 by2 by1 by0 */ |
| 271 | y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]); | 290 | y2 = ETP_2FT_YMAX - (((packet[3] & 0x20) << 3) | packet[5]); |
| 272 | /* For compatibility with the X Synaptics driver scale up one | 291 | /* |
| 273 | coordinate and report as ordinary mouse movent */ | 292 | * For compatibility with the X Synaptics driver scale up |
| 293 | * one coordinate and report as ordinary mouse movent | ||
| 294 | */ | ||
| 274 | input_report_abs(dev, ABS_X, x1 << 2); | 295 | input_report_abs(dev, ABS_X, x1 << 2); |
| 275 | input_report_abs(dev, ABS_Y, y1 << 2); | 296 | input_report_abs(dev, ABS_Y, y1 << 2); |
| 276 | /* For compatibility with the proprietary X Elantech driver | 297 | /* |
| 277 | report both coordinates as hat coordinates */ | 298 | * For compatibility with the proprietary X Elantech driver |
| 299 | * report both coordinates as hat coordinates | ||
| 300 | */ | ||
| 278 | input_report_abs(dev, ABS_HAT0X, x1); | 301 | input_report_abs(dev, ABS_HAT0X, x1); |
| 279 | input_report_abs(dev, ABS_HAT0Y, y1); | 302 | input_report_abs(dev, ABS_HAT0Y, y1); |
| 280 | input_report_abs(dev, ABS_HAT1X, x2); | 303 | input_report_abs(dev, ABS_HAT1X, x2); |
| @@ -596,8 +619,12 @@ int elantech_detect(struct psmouse *psmouse, bool set_properties) | |||
| 596 | param[0], param[1], param[2]); | 619 | param[0], param[1], param[2]); |
| 597 | 620 | ||
| 598 | if (param[0] == 0 || param[1] != 0) { | 621 | if (param[0] == 0 || param[1] != 0) { |
| 599 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); | 622 | if (!force_elantech) { |
| 600 | return -1; | 623 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); |
| 624 | return -1; | ||
| 625 | } | ||
| 626 | |||
| 627 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Enabling anyway due to force_elantech.\n"); | ||
| 601 | } | 628 | } |
| 602 | 629 | ||
| 603 | if (set_properties) { | 630 | if (set_properties) { |
| @@ -666,7 +693,8 @@ int elantech_init(struct psmouse *psmouse) | |||
| 666 | * Assume every version greater than this is new EeePC style | 693 | * Assume every version greater than this is new EeePC style |
| 667 | * hardware with 6 byte packets | 694 | * hardware with 6 byte packets |
| 668 | */ | 695 | */ |
| 669 | if (etd->fw_version_maj >= 0x02 && etd->fw_version_min >= 0x30) { | 696 | if ((etd->fw_version_maj == 0x02 && etd->fw_version_min >= 0x30) || |
| 697 | etd->fw_version_maj > 0x02) { | ||
| 670 | etd->hw_version = 2; | 698 | etd->hw_version = 2; |
| 671 | /* For now show extra debug information */ | 699 | /* For now show extra debug information */ |
| 672 | etd->debug = 1; | 700 | etd->debug = 1; |
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index d8c0c8d6992c..cbc807264940 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
| @@ -110,6 +110,7 @@ static struct workqueue_struct *kpsmoused_wq; | |||
| 110 | struct psmouse_protocol { | 110 | struct psmouse_protocol { |
| 111 | enum psmouse_type type; | 111 | enum psmouse_type type; |
| 112 | bool maxproto; | 112 | bool maxproto; |
| 113 | bool ignore_parity; /* Protocol should ignore parity errors from KBC */ | ||
| 113 | const char *name; | 114 | const char *name; |
| 114 | const char *alias; | 115 | const char *alias; |
| 115 | int (*detect)(struct psmouse *, bool); | 116 | int (*detect)(struct psmouse *, bool); |
| @@ -288,7 +289,9 @@ static irqreturn_t psmouse_interrupt(struct serio *serio, | |||
| 288 | if (psmouse->state == PSMOUSE_IGNORE) | 289 | if (psmouse->state == PSMOUSE_IGNORE) |
| 289 | goto out; | 290 | goto out; |
| 290 | 291 | ||
| 291 | if (flags & (SERIO_PARITY|SERIO_TIMEOUT)) { | 292 | if (unlikely((flags & SERIO_TIMEOUT) || |
| 293 | ((flags & SERIO_PARITY) && !psmouse->ignore_parity))) { | ||
| 294 | |||
| 292 | if (psmouse->state == PSMOUSE_ACTIVATED) | 295 | if (psmouse->state == PSMOUSE_ACTIVATED) |
| 293 | printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n", | 296 | printk(KERN_WARNING "psmouse.c: bad data from KBC -%s%s\n", |
| 294 | flags & SERIO_TIMEOUT ? " timeout" : "", | 297 | flags & SERIO_TIMEOUT ? " timeout" : "", |
| @@ -759,6 +762,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
| 759 | .name = "PS/2", | 762 | .name = "PS/2", |
| 760 | .alias = "bare", | 763 | .alias = "bare", |
| 761 | .maxproto = true, | 764 | .maxproto = true, |
| 765 | .ignore_parity = true, | ||
| 762 | .detect = ps2bare_detect, | 766 | .detect = ps2bare_detect, |
| 763 | }, | 767 | }, |
| 764 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP | 768 | #ifdef CONFIG_MOUSE_PS2_LOGIPS2PP |
| @@ -786,6 +790,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
| 786 | .name = "ImPS/2", | 790 | .name = "ImPS/2", |
| 787 | .alias = "imps", | 791 | .alias = "imps", |
| 788 | .maxproto = true, | 792 | .maxproto = true, |
| 793 | .ignore_parity = true, | ||
| 789 | .detect = intellimouse_detect, | 794 | .detect = intellimouse_detect, |
| 790 | }, | 795 | }, |
| 791 | { | 796 | { |
| @@ -793,6 +798,7 @@ static const struct psmouse_protocol psmouse_protocols[] = { | |||
| 793 | .name = "ImExPS/2", | 798 | .name = "ImExPS/2", |
| 794 | .alias = "exps", | 799 | .alias = "exps", |
| 795 | .maxproto = true, | 800 | .maxproto = true, |
| 801 | .ignore_parity = true, | ||
| 796 | .detect = im_explorer_detect, | 802 | .detect = im_explorer_detect, |
| 797 | }, | 803 | }, |
| 798 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS | 804 | #ifdef CONFIG_MOUSE_PS2_SYNAPTICS |
| @@ -1222,6 +1228,7 @@ static void psmouse_disconnect(struct serio *serio) | |||
| 1222 | static int psmouse_switch_protocol(struct psmouse *psmouse, | 1228 | static int psmouse_switch_protocol(struct psmouse *psmouse, |
| 1223 | const struct psmouse_protocol *proto) | 1229 | const struct psmouse_protocol *proto) |
| 1224 | { | 1230 | { |
| 1231 | const struct psmouse_protocol *selected_proto; | ||
| 1225 | struct input_dev *input_dev = psmouse->dev; | 1232 | struct input_dev *input_dev = psmouse->dev; |
| 1226 | 1233 | ||
| 1227 | input_dev->dev.parent = &psmouse->ps2dev.serio->dev; | 1234 | input_dev->dev.parent = &psmouse->ps2dev.serio->dev; |
| @@ -1245,9 +1252,14 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, | |||
| 1245 | return -1; | 1252 | return -1; |
| 1246 | 1253 | ||
| 1247 | psmouse->type = proto->type; | 1254 | psmouse->type = proto->type; |
| 1248 | } else | 1255 | selected_proto = proto; |
| 1256 | } else { | ||
| 1249 | psmouse->type = psmouse_extensions(psmouse, | 1257 | psmouse->type = psmouse_extensions(psmouse, |
| 1250 | psmouse_max_proto, true); | 1258 | psmouse_max_proto, true); |
| 1259 | selected_proto = psmouse_protocol_by_type(psmouse->type); | ||
| 1260 | } | ||
| 1261 | |||
| 1262 | psmouse->ignore_parity = selected_proto->ignore_parity; | ||
| 1251 | 1263 | ||
| 1252 | /* | 1264 | /* |
| 1253 | * If mouse's packet size is 3 there is no point in polling the | 1265 | * If mouse's packet size is 3 there is no point in polling the |
| @@ -1267,7 +1279,7 @@ static int psmouse_switch_protocol(struct psmouse *psmouse, | |||
| 1267 | psmouse->resync_time = 0; | 1279 | psmouse->resync_time = 0; |
| 1268 | 1280 | ||
| 1269 | snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s", | 1281 | snprintf(psmouse->devname, sizeof(psmouse->devname), "%s %s %s", |
| 1270 | psmouse_protocol_by_type(psmouse->type)->name, psmouse->vendor, psmouse->name); | 1282 | selected_proto->name, psmouse->vendor, psmouse->name); |
| 1271 | 1283 | ||
| 1272 | input_dev->name = psmouse->devname; | 1284 | input_dev->name = psmouse->devname; |
| 1273 | input_dev->phys = psmouse->phys; | 1285 | input_dev->phys = psmouse->phys; |
diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h index e053bdd137ff..593e910bfc7a 100644 --- a/drivers/input/mouse/psmouse.h +++ b/drivers/input/mouse/psmouse.h | |||
| @@ -47,6 +47,7 @@ struct psmouse { | |||
| 47 | unsigned char pktcnt; | 47 | unsigned char pktcnt; |
| 48 | unsigned char pktsize; | 48 | unsigned char pktsize; |
| 49 | unsigned char type; | 49 | unsigned char type; |
| 50 | bool ignore_parity; | ||
| 50 | bool acks_disable_command; | 51 | bool acks_disable_command; |
| 51 | unsigned int model; | 52 | unsigned int model; |
| 52 | unsigned long last; | 53 | unsigned long last; |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 026df6010161..ebd7a99efeae 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
| @@ -137,7 +137,8 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
| 137 | if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap)) | 137 | if (synaptics_send_cmd(psmouse, SYN_QUE_CAPABILITIES, cap)) |
| 138 | return -1; | 138 | return -1; |
| 139 | priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | 139 | priv->capabilities = (cap[0] << 16) | (cap[1] << 8) | cap[2]; |
| 140 | priv->ext_cap = 0; | 140 | priv->ext_cap = priv->ext_cap_0c = 0; |
| 141 | |||
| 141 | if (!SYN_CAP_VALID(priv->capabilities)) | 142 | if (!SYN_CAP_VALID(priv->capabilities)) |
| 142 | return -1; | 143 | return -1; |
| 143 | 144 | ||
| @@ -150,7 +151,7 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
| 150 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) { | 151 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 1) { |
| 151 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) { | 152 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB, cap)) { |
| 152 | printk(KERN_ERR "Synaptics claims to have extended capabilities," | 153 | printk(KERN_ERR "Synaptics claims to have extended capabilities," |
| 153 | " but I'm not able to read them."); | 154 | " but I'm not able to read them.\n"); |
| 154 | } else { | 155 | } else { |
| 155 | priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | 156 | priv->ext_cap = (cap[0] << 16) | (cap[1] << 8) | cap[2]; |
| 156 | 157 | ||
| @@ -162,6 +163,16 @@ static int synaptics_capability(struct psmouse *psmouse) | |||
| 162 | priv->ext_cap &= 0xff0fff; | 163 | priv->ext_cap &= 0xff0fff; |
| 163 | } | 164 | } |
| 164 | } | 165 | } |
| 166 | |||
| 167 | if (SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 4) { | ||
| 168 | if (synaptics_send_cmd(psmouse, SYN_QUE_EXT_CAPAB_0C, cap)) { | ||
| 169 | printk(KERN_ERR "Synaptics claims to have extended capability 0x0c," | ||
| 170 | " but I'm not able to read it.\n"); | ||
| 171 | } else { | ||
| 172 | priv->ext_cap_0c = (cap[0] << 16) | (cap[1] << 8) | cap[2]; | ||
| 173 | } | ||
| 174 | } | ||
| 175 | |||
| 165 | return 0; | 176 | return 0; |
| 166 | } | 177 | } |
| 167 | 178 | ||
| @@ -348,7 +359,15 @@ static void synaptics_parse_hw_state(unsigned char buf[], struct synaptics_data | |||
| 348 | hw->left = (buf[0] & 0x01) ? 1 : 0; | 359 | hw->left = (buf[0] & 0x01) ? 1 : 0; |
| 349 | hw->right = (buf[0] & 0x02) ? 1 : 0; | 360 | hw->right = (buf[0] & 0x02) ? 1 : 0; |
| 350 | 361 | ||
| 351 | if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { | 362 | if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { |
| 363 | /* | ||
| 364 | * Clickpad's button is transmitted as middle button, | ||
| 365 | * however, since it is primary button, we will report | ||
| 366 | * it as BTN_LEFT. | ||
| 367 | */ | ||
| 368 | hw->left = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0; | ||
| 369 | |||
| 370 | } else if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities)) { | ||
| 352 | hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0; | 371 | hw->middle = ((buf[0] ^ buf[3]) & 0x01) ? 1 : 0; |
| 353 | if (hw->w == 2) | 372 | if (hw->w == 2) |
| 354 | hw->scroll = (signed char)(buf[1]); | 373 | hw->scroll = (signed char)(buf[1]); |
| @@ -593,6 +612,12 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) | |||
| 593 | 612 | ||
| 594 | dev->absres[ABS_X] = priv->x_res; | 613 | dev->absres[ABS_X] = priv->x_res; |
| 595 | dev->absres[ABS_Y] = priv->y_res; | 614 | dev->absres[ABS_Y] = priv->y_res; |
| 615 | |||
| 616 | if (SYN_CAP_CLICKPAD(priv->ext_cap_0c)) { | ||
| 617 | /* Clickpads report only left button */ | ||
| 618 | __clear_bit(BTN_RIGHT, dev->keybit); | ||
| 619 | __clear_bit(BTN_MIDDLE, dev->keybit); | ||
| 620 | } | ||
| 596 | } | 621 | } |
| 597 | 622 | ||
| 598 | static void synaptics_disconnect(struct psmouse *psmouse) | 623 | static void synaptics_disconnect(struct psmouse *psmouse) |
| @@ -697,10 +722,10 @@ int synaptics_init(struct psmouse *psmouse) | |||
| 697 | 722 | ||
| 698 | priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; | 723 | priv->pkt_type = SYN_MODEL_NEWABS(priv->model_id) ? SYN_NEWABS : SYN_OLDABS; |
| 699 | 724 | ||
| 700 | printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx\n", | 725 | printk(KERN_INFO "Synaptics Touchpad, model: %ld, fw: %ld.%ld, id: %#lx, caps: %#lx/%#lx/%#lx\n", |
| 701 | SYN_ID_MODEL(priv->identity), | 726 | SYN_ID_MODEL(priv->identity), |
| 702 | SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), | 727 | SYN_ID_MAJOR(priv->identity), SYN_ID_MINOR(priv->identity), |
| 703 | priv->model_id, priv->capabilities, priv->ext_cap); | 728 | priv->model_id, priv->capabilities, priv->ext_cap, priv->ext_cap_0c); |
| 704 | 729 | ||
| 705 | set_input_params(psmouse->dev, priv); | 730 | set_input_params(psmouse->dev, priv); |
| 706 | 731 | ||
diff --git a/drivers/input/mouse/synaptics.h b/drivers/input/mouse/synaptics.h index f0f40a331dc8..ae37c5d162a4 100644 --- a/drivers/input/mouse/synaptics.h +++ b/drivers/input/mouse/synaptics.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 | 18 | #define SYN_QUE_SERIAL_NUMBER_SUFFIX 0x07 |
| 19 | #define SYN_QUE_RESOLUTION 0x08 | 19 | #define SYN_QUE_RESOLUTION 0x08 |
| 20 | #define SYN_QUE_EXT_CAPAB 0x09 | 20 | #define SYN_QUE_EXT_CAPAB 0x09 |
| 21 | #define SYN_QUE_EXT_CAPAB_0C 0x0c | ||
| 21 | 22 | ||
| 22 | /* synatics modes */ | 23 | /* synatics modes */ |
| 23 | #define SYN_BIT_ABSOLUTE_MODE (1 << 7) | 24 | #define SYN_BIT_ABSOLUTE_MODE (1 << 7) |
| @@ -48,6 +49,8 @@ | |||
| 48 | #define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47) | 49 | #define SYN_CAP_VALID(c) ((((c) & 0x00ff00) >> 8) == 0x47) |
| 49 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) | 50 | #define SYN_EXT_CAP_REQUESTS(c) (((c) & 0x700000) >> 20) |
| 50 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) | 51 | #define SYN_CAP_MULTI_BUTTON_NO(ec) (((ec) & 0x00f000) >> 12) |
| 52 | #define SYN_CAP_PRODUCT_ID(ec) (((ec) & 0xff0000) >> 16) | ||
| 53 | #define SYN_CAP_CLICKPAD(ex0c) ((ex0c) & 0x100100) | ||
| 51 | 54 | ||
| 52 | /* synaptics modes query bits */ | 55 | /* synaptics modes query bits */ |
| 53 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) | 56 | #define SYN_MODE_ABSOLUTE(m) ((m) & (1 << 7)) |
| @@ -96,6 +99,7 @@ struct synaptics_data { | |||
| 96 | unsigned long int model_id; /* Model-ID */ | 99 | unsigned long int model_id; /* Model-ID */ |
| 97 | unsigned long int capabilities; /* Capabilities */ | 100 | unsigned long int capabilities; /* Capabilities */ |
| 98 | unsigned long int ext_cap; /* Extended Capabilities */ | 101 | unsigned long int ext_cap; /* Extended Capabilities */ |
| 102 | unsigned long int ext_cap_0c; /* Ext Caps from 0x0c query */ | ||
| 99 | unsigned long int identity; /* Identification */ | 103 | unsigned long int identity; /* Identification */ |
| 100 | int x_res; /* X resolution in units/mm */ | 104 | int x_res; /* X resolution in units/mm */ |
| 101 | int y_res; /* Y resolution in units/mm */ | 105 | int y_res; /* Y resolution in units/mm */ |
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c index 204b8a1a601c..75f8b73010fa 100644 --- a/drivers/input/touchscreen/eeti_ts.c +++ b/drivers/input/touchscreen/eeti_ts.c | |||
| @@ -124,14 +124,25 @@ static irqreturn_t eeti_ts_isr(int irq, void *dev_id) | |||
| 124 | return IRQ_HANDLED; | 124 | return IRQ_HANDLED; |
| 125 | } | 125 | } |
| 126 | 126 | ||
| 127 | static int eeti_ts_open(struct input_dev *dev) | 127 | static void eeti_ts_start(struct eeti_ts_priv *priv) |
| 128 | { | 128 | { |
| 129 | struct eeti_ts_priv *priv = input_get_drvdata(dev); | ||
| 130 | |||
| 131 | enable_irq(priv->irq); | 129 | enable_irq(priv->irq); |
| 132 | 130 | ||
| 133 | /* Read the events once to arm the IRQ */ | 131 | /* Read the events once to arm the IRQ */ |
| 134 | eeti_ts_read(&priv->work); | 132 | eeti_ts_read(&priv->work); |
| 133 | } | ||
| 134 | |||
| 135 | static void eeti_ts_stop(struct eeti_ts_priv *priv) | ||
| 136 | { | ||
| 137 | disable_irq(priv->irq); | ||
| 138 | cancel_work_sync(&priv->work); | ||
| 139 | } | ||
| 140 | |||
| 141 | static int eeti_ts_open(struct input_dev *dev) | ||
| 142 | { | ||
| 143 | struct eeti_ts_priv *priv = input_get_drvdata(dev); | ||
| 144 | |||
| 145 | eeti_ts_start(priv); | ||
| 135 | 146 | ||
| 136 | return 0; | 147 | return 0; |
| 137 | } | 148 | } |
| @@ -140,8 +151,7 @@ static void eeti_ts_close(struct input_dev *dev) | |||
| 140 | { | 151 | { |
| 141 | struct eeti_ts_priv *priv = input_get_drvdata(dev); | 152 | struct eeti_ts_priv *priv = input_get_drvdata(dev); |
| 142 | 153 | ||
| 143 | disable_irq(priv->irq); | 154 | eeti_ts_stop(priv); |
| 144 | cancel_work_sync(&priv->work); | ||
| 145 | } | 155 | } |
| 146 | 156 | ||
| 147 | static int __devinit eeti_ts_probe(struct i2c_client *client, | 157 | static int __devinit eeti_ts_probe(struct i2c_client *client, |
| @@ -153,10 +163,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, | |||
| 153 | unsigned int irq_flags; | 163 | unsigned int irq_flags; |
| 154 | int err = -ENOMEM; | 164 | int err = -ENOMEM; |
| 155 | 165 | ||
| 156 | /* In contrast to what's described in the datasheet, there seems | 166 | /* |
| 167 | * In contrast to what's described in the datasheet, there seems | ||
| 157 | * to be no way of probing the presence of that device using I2C | 168 | * to be no way of probing the presence of that device using I2C |
| 158 | * commands. So we need to blindly believe it is there, and wait | 169 | * commands. So we need to blindly believe it is there, and wait |
| 159 | * for interrupts to occur. */ | 170 | * for interrupts to occur. |
| 171 | */ | ||
| 160 | 172 | ||
| 161 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 173 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
| 162 | if (!priv) { | 174 | if (!priv) { |
| @@ -212,9 +224,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client, | |||
| 212 | goto err2; | 224 | goto err2; |
| 213 | } | 225 | } |
| 214 | 226 | ||
| 215 | /* Disable the irq for now. It will be enabled once the input device | 227 | /* |
| 216 | * is opened. */ | 228 | * Disable the device for now. It will be enabled once the |
| 217 | disable_irq(priv->irq); | 229 | * input device is opened. |
| 230 | */ | ||
| 231 | eeti_ts_stop(priv); | ||
| 218 | 232 | ||
| 219 | device_init_wakeup(&client->dev, 0); | 233 | device_init_wakeup(&client->dev, 0); |
| 220 | return 0; | 234 | return 0; |
| @@ -235,6 +249,12 @@ static int __devexit eeti_ts_remove(struct i2c_client *client) | |||
| 235 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 249 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
| 236 | 250 | ||
| 237 | free_irq(priv->irq, priv); | 251 | free_irq(priv->irq, priv); |
| 252 | /* | ||
| 253 | * eeti_ts_stop() leaves IRQ disabled. We need to re-enable it | ||
| 254 | * so that device still works if we reload the driver. | ||
| 255 | */ | ||
| 256 | enable_irq(priv->irq); | ||
| 257 | |||
| 238 | input_unregister_device(priv->input); | 258 | input_unregister_device(priv->input); |
| 239 | i2c_set_clientdata(client, NULL); | 259 | i2c_set_clientdata(client, NULL); |
| 240 | kfree(priv); | 260 | kfree(priv); |
| @@ -246,6 +266,14 @@ static int __devexit eeti_ts_remove(struct i2c_client *client) | |||
| 246 | static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) | 266 | static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) |
| 247 | { | 267 | { |
| 248 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 268 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
| 269 | struct input_dev *input_dev = priv->input; | ||
| 270 | |||
| 271 | mutex_lock(&input_dev->mutex); | ||
| 272 | |||
| 273 | if (input_dev->users) | ||
| 274 | eeti_ts_stop(priv); | ||
| 275 | |||
| 276 | mutex_unlock(&input_dev->mutex); | ||
| 249 | 277 | ||
| 250 | if (device_may_wakeup(&client->dev)) | 278 | if (device_may_wakeup(&client->dev)) |
| 251 | enable_irq_wake(priv->irq); | 279 | enable_irq_wake(priv->irq); |
| @@ -256,10 +284,18 @@ static int eeti_ts_suspend(struct i2c_client *client, pm_message_t mesg) | |||
| 256 | static int eeti_ts_resume(struct i2c_client *client) | 284 | static int eeti_ts_resume(struct i2c_client *client) |
| 257 | { | 285 | { |
| 258 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); | 286 | struct eeti_ts_priv *priv = i2c_get_clientdata(client); |
| 287 | struct input_dev *input_dev = priv->input; | ||
| 259 | 288 | ||
| 260 | if (device_may_wakeup(&client->dev)) | 289 | if (device_may_wakeup(&client->dev)) |
| 261 | disable_irq_wake(priv->irq); | 290 | disable_irq_wake(priv->irq); |
| 262 | 291 | ||
| 292 | mutex_lock(&input_dev->mutex); | ||
| 293 | |||
| 294 | if (input_dev->users) | ||
| 295 | eeti_ts_start(priv); | ||
| 296 | |||
| 297 | mutex_unlock(&input_dev->mutex); | ||
| 298 | |||
| 263 | return 0; | 299 | return 0; |
| 264 | } | 300 | } |
| 265 | #else | 301 | #else |
diff --git a/drivers/mtd/internal.h b/drivers/mtd/internal.h deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/drivers/mtd/internal.h +++ /dev/null | |||
diff --git a/drivers/mtd/mtdbdi.c b/drivers/mtd/mtdbdi.c deleted file mode 100644 index e69de29bb2d1..000000000000 --- a/drivers/mtd/mtdbdi.c +++ /dev/null | |||
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index 6995169d285a..cd17d09f385c 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
| @@ -311,11 +311,6 @@ err: | |||
| 311 | processed++; | 311 | processed++; |
| 312 | } | 312 | } |
| 313 | 313 | ||
| 314 | if (processed) { | ||
| 315 | wrw(ep, REG_RXDENQ, processed); | ||
| 316 | wrw(ep, REG_RXSTSENQ, processed); | ||
| 317 | } | ||
| 318 | |||
| 319 | return processed; | 314 | return processed; |
| 320 | } | 315 | } |
| 321 | 316 | ||
| @@ -350,6 +345,11 @@ poll_some_more: | |||
| 350 | goto poll_some_more; | 345 | goto poll_some_more; |
| 351 | } | 346 | } |
| 352 | 347 | ||
| 348 | if (rx) { | ||
| 349 | wrw(ep, REG_RXDENQ, rx); | ||
| 350 | wrw(ep, REG_RXSTSENQ, rx); | ||
| 351 | } | ||
| 352 | |||
| 353 | return rx; | 353 | return rx; |
| 354 | } | 354 | } |
| 355 | 355 | ||
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index fb8fc7d1b50d..dbf81788bb40 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
| @@ -4633,6 +4633,9 @@ static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state) | |||
| 4633 | reg16 &= ~state; | 4633 | reg16 &= ~state; |
| 4634 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); | 4634 | pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16); |
| 4635 | 4635 | ||
| 4636 | if (!pdev->bus->self) | ||
| 4637 | return; | ||
| 4638 | |||
| 4636 | pos = pci_pcie_cap(pdev->bus->self); | 4639 | pos = pci_pcie_cap(pdev->bus->self); |
| 4637 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); | 4640 | pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, ®16); |
| 4638 | reg16 &= ~state; | 4641 | reg16 &= ~state; |
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 9f98c1c4a344..9b4e8f797a7a 100644 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c | |||
| @@ -1653,7 +1653,7 @@ fec_set_mac_address(struct net_device *dev, void *p) | |||
| 1653 | (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24), | 1653 | (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24), |
| 1654 | fep->hwp + FEC_ADDR_LOW); | 1654 | fep->hwp + FEC_ADDR_LOW); |
| 1655 | writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24), | 1655 | writel((dev->dev_addr[5] << 16) | (dev->dev_addr[4] << 24), |
| 1656 | fep + FEC_ADDR_HIGH); | 1656 | fep->hwp + FEC_ADDR_HIGH); |
| 1657 | return 0; | 1657 | return 0; |
| 1658 | } | 1658 | } |
| 1659 | 1659 | ||
diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig index fc5938ba3d78..a527e37728cd 100644 --- a/drivers/net/phy/Kconfig +++ b/drivers/net/phy/Kconfig | |||
| @@ -88,6 +88,11 @@ config LSI_ET1011C_PHY | |||
| 88 | ---help--- | 88 | ---help--- |
| 89 | Supports the LSI ET1011C PHY. | 89 | Supports the LSI ET1011C PHY. |
| 90 | 90 | ||
| 91 | config MICREL_PHY | ||
| 92 | tristate "Driver for Micrel PHYs" | ||
| 93 | ---help--- | ||
| 94 | Supports the KSZ9021, VSC8201, KS8001 PHYs. | ||
| 95 | |||
| 91 | config FIXED_PHY | 96 | config FIXED_PHY |
| 92 | bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" | 97 | bool "Driver for MDIO Bus/PHY emulation with fixed speed/link PHYs" |
| 93 | depends on PHYLIB=y | 98 | depends on PHYLIB=y |
diff --git a/drivers/net/phy/Makefile b/drivers/net/phy/Makefile index 1342585af381..13bebab65d02 100644 --- a/drivers/net/phy/Makefile +++ b/drivers/net/phy/Makefile | |||
| @@ -20,4 +20,5 @@ obj-$(CONFIG_MDIO_BITBANG) += mdio-bitbang.o | |||
| 20 | obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o | 20 | obj-$(CONFIG_MDIO_GPIO) += mdio-gpio.o |
| 21 | obj-$(CONFIG_NATIONAL_PHY) += national.o | 21 | obj-$(CONFIG_NATIONAL_PHY) += national.o |
| 22 | obj-$(CONFIG_STE10XP) += ste10Xp.o | 22 | obj-$(CONFIG_STE10XP) += ste10Xp.o |
| 23 | obj-$(CONFIG_MICREL_PHY) += micrel.o | ||
| 23 | obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o | 24 | obj-$(CONFIG_MDIO_OCTEON) += mdio-octeon.o |
diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c new file mode 100644 index 000000000000..0cd80e4d71d9 --- /dev/null +++ b/drivers/net/phy/micrel.c | |||
| @@ -0,0 +1,104 @@ | |||
| 1 | /* | ||
| 2 | * drivers/net/phy/micrel.c | ||
| 3 | * | ||
| 4 | * Driver for Micrel PHYs | ||
| 5 | * | ||
| 6 | * Author: David J. Choi | ||
| 7 | * | ||
| 8 | * Copyright (c) 2010 Micrel, Inc. | ||
| 9 | * | ||
| 10 | * This program is free software; you can redistribute it and/or modify it | ||
| 11 | * under the terms of the GNU General Public License as published by the | ||
| 12 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 13 | * option) any later version. | ||
| 14 | * | ||
| 15 | * Support : ksz9021 , vsc8201, ks8001 | ||
| 16 | */ | ||
| 17 | |||
| 18 | #include <linux/kernel.h> | ||
| 19 | #include <linux/module.h> | ||
| 20 | #include <linux/phy.h> | ||
| 21 | |||
| 22 | #define PHY_ID_KSZ9021 0x00221611 | ||
| 23 | #define PHY_ID_VSC8201 0x000FC413 | ||
| 24 | #define PHY_ID_KS8001 0x0022161A | ||
| 25 | |||
| 26 | |||
| 27 | static int kszphy_config_init(struct phy_device *phydev) | ||
| 28 | { | ||
| 29 | return 0; | ||
| 30 | } | ||
| 31 | |||
| 32 | |||
| 33 | static struct phy_driver ks8001_driver = { | ||
| 34 | .phy_id = PHY_ID_KS8001, | ||
| 35 | .phy_id_mask = 0x00fffff0, | ||
| 36 | .features = PHY_BASIC_FEATURES, | ||
| 37 | .flags = PHY_POLL, | ||
| 38 | .config_init = kszphy_config_init, | ||
| 39 | .config_aneg = genphy_config_aneg, | ||
| 40 | .read_status = genphy_read_status, | ||
| 41 | .driver = { .owner = THIS_MODULE,}, | ||
| 42 | }; | ||
| 43 | |||
| 44 | static struct phy_driver vsc8201_driver = { | ||
| 45 | .phy_id = PHY_ID_VSC8201, | ||
| 46 | .name = "Micrel VSC8201", | ||
| 47 | .phy_id_mask = 0x00fffff0, | ||
| 48 | .features = PHY_BASIC_FEATURES, | ||
| 49 | .flags = PHY_POLL, | ||
| 50 | .config_init = kszphy_config_init, | ||
| 51 | .config_aneg = genphy_config_aneg, | ||
| 52 | .read_status = genphy_read_status, | ||
| 53 | .driver = { .owner = THIS_MODULE,}, | ||
| 54 | }; | ||
| 55 | |||
| 56 | static struct phy_driver ksz9021_driver = { | ||
| 57 | .phy_id = PHY_ID_KSZ9021, | ||
| 58 | .phy_id_mask = 0x000fff10, | ||
| 59 | .name = "Micrel KSZ9021 Gigabit PHY", | ||
| 60 | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause, | ||
| 61 | .flags = PHY_POLL, | ||
| 62 | .config_init = kszphy_config_init, | ||
| 63 | .config_aneg = genphy_config_aneg, | ||
| 64 | .read_status = genphy_read_status, | ||
| 65 | .driver = { .owner = THIS_MODULE, }, | ||
| 66 | }; | ||
| 67 | |||
| 68 | static int __init ksphy_init(void) | ||
| 69 | { | ||
| 70 | int ret; | ||
| 71 | |||
| 72 | ret = phy_driver_register(&ks8001_driver); | ||
| 73 | if (ret) | ||
| 74 | goto err1; | ||
| 75 | ret = phy_driver_register(&vsc8201_driver); | ||
| 76 | if (ret) | ||
| 77 | goto err2; | ||
| 78 | |||
| 79 | ret = phy_driver_register(&ksz9021_driver); | ||
| 80 | if (ret) | ||
| 81 | goto err3; | ||
| 82 | return 0; | ||
| 83 | |||
| 84 | err3: | ||
| 85 | phy_driver_unregister(&vsc8201_driver); | ||
| 86 | err2: | ||
| 87 | phy_driver_unregister(&ks8001_driver); | ||
| 88 | err1: | ||
| 89 | return ret; | ||
| 90 | } | ||
| 91 | |||
| 92 | static void __exit ksphy_exit(void) | ||
| 93 | { | ||
| 94 | phy_driver_unregister(&ks8001_driver); | ||
| 95 | phy_driver_unregister(&vsc8201_driver); | ||
| 96 | phy_driver_unregister(&ksz9021_driver); | ||
| 97 | } | ||
| 98 | |||
| 99 | module_init(ksphy_init); | ||
| 100 | module_exit(ksphy_exit); | ||
| 101 | |||
| 102 | MODULE_DESCRIPTION("Micrel PHY driver"); | ||
| 103 | MODULE_AUTHOR("David J. Choi"); | ||
| 104 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 6e281bc825e5..8518a2e58e53 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
| @@ -405,6 +405,7 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
| 405 | DECLARE_WAITQUEUE(wait, current); | 405 | DECLARE_WAITQUEUE(wait, current); |
| 406 | ssize_t ret; | 406 | ssize_t ret; |
| 407 | struct sk_buff *skb = NULL; | 407 | struct sk_buff *skb = NULL; |
| 408 | struct iovec iov; | ||
| 408 | 409 | ||
| 409 | ret = count; | 410 | ret = count; |
| 410 | 411 | ||
| @@ -448,7 +449,9 @@ static ssize_t ppp_read(struct file *file, char __user *buf, | |||
| 448 | if (skb->len > count) | 449 | if (skb->len > count) |
| 449 | goto outf; | 450 | goto outf; |
| 450 | ret = -EFAULT; | 451 | ret = -EFAULT; |
| 451 | if (copy_to_user(buf, skb->data, skb->len)) | 452 | iov.iov_base = buf; |
| 453 | iov.iov_len = count; | ||
| 454 | if (skb_copy_datagram_iovec(skb, 0, &iov, skb->len)) | ||
| 452 | goto outf; | 455 | goto outf; |
| 453 | ret = skb->len; | 456 | ret = skb->len; |
| 454 | 457 | ||
| @@ -1567,13 +1570,22 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 1567 | struct channel *pch = chan->ppp; | 1570 | struct channel *pch = chan->ppp; |
| 1568 | int proto; | 1571 | int proto; |
| 1569 | 1572 | ||
| 1570 | if (!pch || skb->len == 0) { | 1573 | if (!pch) { |
| 1571 | kfree_skb(skb); | 1574 | kfree_skb(skb); |
| 1572 | return; | 1575 | return; |
| 1573 | } | 1576 | } |
| 1574 | 1577 | ||
| 1575 | proto = PPP_PROTO(skb); | ||
| 1576 | read_lock_bh(&pch->upl); | 1578 | read_lock_bh(&pch->upl); |
| 1579 | if (!pskb_may_pull(skb, 2)) { | ||
| 1580 | kfree_skb(skb); | ||
| 1581 | if (pch->ppp) { | ||
| 1582 | ++pch->ppp->dev->stats.rx_length_errors; | ||
| 1583 | ppp_receive_error(pch->ppp); | ||
| 1584 | } | ||
| 1585 | goto done; | ||
| 1586 | } | ||
| 1587 | |||
| 1588 | proto = PPP_PROTO(skb); | ||
| 1577 | if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) { | 1589 | if (!pch->ppp || proto >= 0xc000 || proto == PPP_CCPFRAG) { |
| 1578 | /* put it on the channel queue */ | 1590 | /* put it on the channel queue */ |
| 1579 | skb_queue_tail(&pch->file.rq, skb); | 1591 | skb_queue_tail(&pch->file.rq, skb); |
| @@ -1585,6 +1597,8 @@ ppp_input(struct ppp_channel *chan, struct sk_buff *skb) | |||
| 1585 | } else { | 1597 | } else { |
| 1586 | ppp_do_recv(pch->ppp, skb, pch); | 1598 | ppp_do_recv(pch->ppp, skb, pch); |
| 1587 | } | 1599 | } |
| 1600 | |||
| 1601 | done: | ||
| 1588 | read_unlock_bh(&pch->upl); | 1602 | read_unlock_bh(&pch->upl); |
| 1589 | } | 1603 | } |
| 1590 | 1604 | ||
| @@ -1617,7 +1631,8 @@ ppp_input_error(struct ppp_channel *chan, int code) | |||
| 1617 | static void | 1631 | static void |
| 1618 | ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | 1632 | ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) |
| 1619 | { | 1633 | { |
| 1620 | if (pskb_may_pull(skb, 2)) { | 1634 | /* note: a 0-length skb is used as an error indication */ |
| 1635 | if (skb->len > 0) { | ||
| 1621 | #ifdef CONFIG_PPP_MULTILINK | 1636 | #ifdef CONFIG_PPP_MULTILINK |
| 1622 | /* XXX do channel-level decompression here */ | 1637 | /* XXX do channel-level decompression here */ |
| 1623 | if (PPP_PROTO(skb) == PPP_MP) | 1638 | if (PPP_PROTO(skb) == PPP_MP) |
| @@ -1625,15 +1640,10 @@ ppp_receive_frame(struct ppp *ppp, struct sk_buff *skb, struct channel *pch) | |||
| 1625 | else | 1640 | else |
| 1626 | #endif /* CONFIG_PPP_MULTILINK */ | 1641 | #endif /* CONFIG_PPP_MULTILINK */ |
| 1627 | ppp_receive_nonmp_frame(ppp, skb); | 1642 | ppp_receive_nonmp_frame(ppp, skb); |
| 1628 | return; | 1643 | } else { |
| 1644 | kfree_skb(skb); | ||
| 1645 | ppp_receive_error(ppp); | ||
| 1629 | } | 1646 | } |
| 1630 | |||
| 1631 | if (skb->len > 0) | ||
| 1632 | /* note: a 0-length skb is used as an error indication */ | ||
| 1633 | ++ppp->dev->stats.rx_length_errors; | ||
| 1634 | |||
| 1635 | kfree_skb(skb); | ||
| 1636 | ppp_receive_error(ppp); | ||
| 1637 | } | 1647 | } |
| 1638 | 1648 | ||
| 1639 | static void | 1649 | static void |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 4748c21eb72e..dd8106ff35aa 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
| @@ -1042,14 +1042,14 @@ static void rtl8169_vlan_rx_register(struct net_device *dev, | |||
| 1042 | } | 1042 | } |
| 1043 | 1043 | ||
| 1044 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, | 1044 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, |
| 1045 | struct sk_buff *skb) | 1045 | struct sk_buff *skb, int polling) |
| 1046 | { | 1046 | { |
| 1047 | u32 opts2 = le32_to_cpu(desc->opts2); | 1047 | u32 opts2 = le32_to_cpu(desc->opts2); |
| 1048 | struct vlan_group *vlgrp = tp->vlgrp; | 1048 | struct vlan_group *vlgrp = tp->vlgrp; |
| 1049 | int ret; | 1049 | int ret; |
| 1050 | 1050 | ||
| 1051 | if (vlgrp && (opts2 & RxVlanTag)) { | 1051 | if (vlgrp && (opts2 & RxVlanTag)) { |
| 1052 | vlan_hwaccel_receive_skb(skb, vlgrp, swab16(opts2 & 0xffff)); | 1052 | __vlan_hwaccel_rx(skb, vlgrp, swab16(opts2 & 0xffff), polling); |
| 1053 | ret = 0; | 1053 | ret = 0; |
| 1054 | } else | 1054 | } else |
| 1055 | ret = -1; | 1055 | ret = -1; |
| @@ -1066,7 +1066,7 @@ static inline u32 rtl8169_tx_vlan_tag(struct rtl8169_private *tp, | |||
| 1066 | } | 1066 | } |
| 1067 | 1067 | ||
| 1068 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, | 1068 | static int rtl8169_rx_vlan_skb(struct rtl8169_private *tp, struct RxDesc *desc, |
| 1069 | struct sk_buff *skb) | 1069 | struct sk_buff *skb, int polling) |
| 1070 | { | 1070 | { |
| 1071 | return -1; | 1071 | return -1; |
| 1072 | } | 1072 | } |
| @@ -4445,12 +4445,20 @@ out: | |||
| 4445 | return done; | 4445 | return done; |
| 4446 | } | 4446 | } |
| 4447 | 4447 | ||
| 4448 | /* | ||
| 4449 | * Warning : rtl8169_rx_interrupt() might be called : | ||
| 4450 | * 1) from NAPI (softirq) context | ||
| 4451 | * (polling = 1 : we should call netif_receive_skb()) | ||
| 4452 | * 2) from process context (rtl8169_reset_task()) | ||
| 4453 | * (polling = 0 : we must call netif_rx() instead) | ||
| 4454 | */ | ||
| 4448 | static int rtl8169_rx_interrupt(struct net_device *dev, | 4455 | static int rtl8169_rx_interrupt(struct net_device *dev, |
| 4449 | struct rtl8169_private *tp, | 4456 | struct rtl8169_private *tp, |
| 4450 | void __iomem *ioaddr, u32 budget) | 4457 | void __iomem *ioaddr, u32 budget) |
| 4451 | { | 4458 | { |
| 4452 | unsigned int cur_rx, rx_left; | 4459 | unsigned int cur_rx, rx_left; |
| 4453 | unsigned int delta, count; | 4460 | unsigned int delta, count; |
| 4461 | int polling = (budget != ~(u32)0) ? 1 : 0; | ||
| 4454 | 4462 | ||
| 4455 | cur_rx = tp->cur_rx; | 4463 | cur_rx = tp->cur_rx; |
| 4456 | rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; | 4464 | rx_left = NUM_RX_DESC + tp->dirty_rx - cur_rx; |
| @@ -4512,8 +4520,12 @@ static int rtl8169_rx_interrupt(struct net_device *dev, | |||
| 4512 | skb_put(skb, pkt_size); | 4520 | skb_put(skb, pkt_size); |
| 4513 | skb->protocol = eth_type_trans(skb, dev); | 4521 | skb->protocol = eth_type_trans(skb, dev); |
| 4514 | 4522 | ||
| 4515 | if (rtl8169_rx_vlan_skb(tp, desc, skb) < 0) | 4523 | if (rtl8169_rx_vlan_skb(tp, desc, skb, polling) < 0) { |
| 4516 | netif_receive_skb(skb); | 4524 | if (likely(polling)) |
| 4525 | netif_receive_skb(skb); | ||
| 4526 | else | ||
| 4527 | netif_rx(skb); | ||
| 4528 | } | ||
| 4517 | 4529 | ||
| 4518 | dev->stats.rx_bytes += pkt_size; | 4530 | dev->stats.rx_bytes += pkt_size; |
| 4519 | dev->stats.rx_packets++; | 4531 | dev->stats.rx_packets++; |
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c index 9944e5d662c0..04efc0c1bda9 100644 --- a/drivers/net/sb1250-mac.c +++ b/drivers/net/sb1250-mac.c | |||
| @@ -2353,17 +2353,36 @@ static int sbmac_init(struct platform_device *pldev, long long base) | |||
| 2353 | 2353 | ||
| 2354 | sc->mii_bus = mdiobus_alloc(); | 2354 | sc->mii_bus = mdiobus_alloc(); |
| 2355 | if (sc->mii_bus == NULL) { | 2355 | if (sc->mii_bus == NULL) { |
| 2356 | sbmac_uninitctx(sc); | 2356 | err = -ENOMEM; |
| 2357 | return -ENOMEM; | 2357 | goto uninit_ctx; |
| 2358 | } | 2358 | } |
| 2359 | 2359 | ||
| 2360 | sc->mii_bus->name = sbmac_mdio_string; | ||
| 2361 | snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); | ||
| 2362 | sc->mii_bus->priv = sc; | ||
| 2363 | sc->mii_bus->read = sbmac_mii_read; | ||
| 2364 | sc->mii_bus->write = sbmac_mii_write; | ||
| 2365 | sc->mii_bus->irq = sc->phy_irq; | ||
| 2366 | for (i = 0; i < PHY_MAX_ADDR; ++i) | ||
| 2367 | sc->mii_bus->irq[i] = SBMAC_PHY_INT; | ||
| 2368 | |||
| 2369 | sc->mii_bus->parent = &pldev->dev; | ||
| 2370 | /* | ||
| 2371 | * Probe PHY address | ||
| 2372 | */ | ||
| 2373 | err = mdiobus_register(sc->mii_bus); | ||
| 2374 | if (err) { | ||
| 2375 | printk(KERN_ERR "%s: unable to register MDIO bus\n", | ||
| 2376 | dev->name); | ||
| 2377 | goto free_mdio; | ||
| 2378 | } | ||
| 2379 | dev_set_drvdata(&pldev->dev, sc->mii_bus); | ||
| 2380 | |||
| 2360 | err = register_netdev(dev); | 2381 | err = register_netdev(dev); |
| 2361 | if (err) { | 2382 | if (err) { |
| 2362 | printk(KERN_ERR "%s.%d: unable to register netdev\n", | 2383 | printk(KERN_ERR "%s.%d: unable to register netdev\n", |
| 2363 | sbmac_string, idx); | 2384 | sbmac_string, idx); |
| 2364 | mdiobus_free(sc->mii_bus); | 2385 | goto unreg_mdio; |
| 2365 | sbmac_uninitctx(sc); | ||
| 2366 | return err; | ||
| 2367 | } | 2386 | } |
| 2368 | 2387 | ||
| 2369 | pr_info("%s.%d: registered as %s\n", sbmac_string, idx, dev->name); | 2388 | pr_info("%s.%d: registered as %s\n", sbmac_string, idx, dev->name); |
| @@ -2379,19 +2398,15 @@ static int sbmac_init(struct platform_device *pldev, long long base) | |||
| 2379 | pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n", | 2398 | pr_info("%s: SiByte Ethernet at 0x%08Lx, address: %pM\n", |
| 2380 | dev->name, base, eaddr); | 2399 | dev->name, base, eaddr); |
| 2381 | 2400 | ||
| 2382 | sc->mii_bus->name = sbmac_mdio_string; | ||
| 2383 | snprintf(sc->mii_bus->id, MII_BUS_ID_SIZE, "%x", idx); | ||
| 2384 | sc->mii_bus->priv = sc; | ||
| 2385 | sc->mii_bus->read = sbmac_mii_read; | ||
| 2386 | sc->mii_bus->write = sbmac_mii_write; | ||
| 2387 | sc->mii_bus->irq = sc->phy_irq; | ||
| 2388 | for (i = 0; i < PHY_MAX_ADDR; ++i) | ||
| 2389 | sc->mii_bus->irq[i] = SBMAC_PHY_INT; | ||
| 2390 | |||
| 2391 | sc->mii_bus->parent = &pldev->dev; | ||
| 2392 | dev_set_drvdata(&pldev->dev, sc->mii_bus); | ||
| 2393 | |||
| 2394 | return 0; | 2401 | return 0; |
| 2402 | unreg_mdio: | ||
| 2403 | mdiobus_unregister(sc->mii_bus); | ||
| 2404 | dev_set_drvdata(&pldev->dev, NULL); | ||
| 2405 | free_mdio: | ||
| 2406 | mdiobus_free(sc->mii_bus); | ||
| 2407 | uninit_ctx: | ||
| 2408 | sbmac_uninitctx(sc); | ||
| 2409 | return err; | ||
| 2395 | } | 2410 | } |
| 2396 | 2411 | ||
| 2397 | 2412 | ||
| @@ -2417,16 +2432,6 @@ static int sbmac_open(struct net_device *dev) | |||
| 2417 | goto out_err; | 2432 | goto out_err; |
| 2418 | } | 2433 | } |
| 2419 | 2434 | ||
| 2420 | /* | ||
| 2421 | * Probe PHY address | ||
| 2422 | */ | ||
| 2423 | err = mdiobus_register(sc->mii_bus); | ||
| 2424 | if (err) { | ||
| 2425 | printk(KERN_ERR "%s: unable to register MDIO bus\n", | ||
| 2426 | dev->name); | ||
| 2427 | goto out_unirq; | ||
| 2428 | } | ||
| 2429 | |||
| 2430 | sc->sbm_speed = sbmac_speed_none; | 2435 | sc->sbm_speed = sbmac_speed_none; |
| 2431 | sc->sbm_duplex = sbmac_duplex_none; | 2436 | sc->sbm_duplex = sbmac_duplex_none; |
| 2432 | sc->sbm_fc = sbmac_fc_none; | 2437 | sc->sbm_fc = sbmac_fc_none; |
| @@ -2457,11 +2462,7 @@ static int sbmac_open(struct net_device *dev) | |||
| 2457 | return 0; | 2462 | return 0; |
| 2458 | 2463 | ||
| 2459 | out_unregister: | 2464 | out_unregister: |
| 2460 | mdiobus_unregister(sc->mii_bus); | ||
| 2461 | |||
| 2462 | out_unirq: | ||
| 2463 | free_irq(dev->irq, dev); | 2465 | free_irq(dev->irq, dev); |
| 2464 | |||
| 2465 | out_err: | 2466 | out_err: |
| 2466 | return err; | 2467 | return err; |
| 2467 | } | 2468 | } |
| @@ -2650,9 +2651,6 @@ static int sbmac_close(struct net_device *dev) | |||
| 2650 | 2651 | ||
| 2651 | phy_disconnect(sc->phy_dev); | 2652 | phy_disconnect(sc->phy_dev); |
| 2652 | sc->phy_dev = NULL; | 2653 | sc->phy_dev = NULL; |
| 2653 | |||
| 2654 | mdiobus_unregister(sc->mii_bus); | ||
| 2655 | |||
| 2656 | free_irq(dev->irq, dev); | 2654 | free_irq(dev->irq, dev); |
| 2657 | 2655 | ||
| 2658 | sbdma_emptyring(&(sc->sbm_txdma)); | 2656 | sbdma_emptyring(&(sc->sbm_txdma)); |
| @@ -2760,6 +2758,7 @@ static int __exit sbmac_remove(struct platform_device *pldev) | |||
| 2760 | 2758 | ||
| 2761 | unregister_netdev(dev); | 2759 | unregister_netdev(dev); |
| 2762 | sbmac_uninitctx(sc); | 2760 | sbmac_uninitctx(sc); |
| 2761 | mdiobus_unregister(sc->mii_bus); | ||
| 2763 | mdiobus_free(sc->mii_bus); | 2762 | mdiobus_free(sc->mii_bus); |
| 2764 | iounmap(sc->sbm_base); | 2763 | iounmap(sc->sbm_base); |
| 2765 | free_netdev(dev); | 2764 | free_netdev(dev); |
diff --git a/drivers/net/usb/Kconfig b/drivers/net/usb/Kconfig index 5d58abc224f4..d7b7018a1de1 100644 --- a/drivers/net/usb/Kconfig +++ b/drivers/net/usb/Kconfig | |||
| @@ -400,7 +400,6 @@ config USB_IPHETH | |||
| 400 | config USB_SIERRA_NET | 400 | config USB_SIERRA_NET |
| 401 | tristate "USB-to-WWAN Driver for Sierra Wireless modems" | 401 | tristate "USB-to-WWAN Driver for Sierra Wireless modems" |
| 402 | depends on USB_USBNET | 402 | depends on USB_USBNET |
| 403 | default y | ||
| 404 | help | 403 | help |
| 405 | Choose this option if you have a Sierra Wireless USB-to-WWAN device. | 404 | Choose this option if you have a Sierra Wireless USB-to-WWAN device. |
| 406 | 405 | ||
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 04b281002a76..5dfed9297b22 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
| @@ -240,7 +240,7 @@ static int dm_write_shared_word(struct usbnet *dev, int phy, u8 reg, __le16 valu | |||
| 240 | goto out; | 240 | goto out; |
| 241 | 241 | ||
| 242 | dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg); | 242 | dm_write_reg(dev, DM_SHARED_ADDR, phy ? (reg | 0x40) : reg); |
| 243 | dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1c : 0x14); | 243 | dm_write_reg(dev, DM_SHARED_CTRL, phy ? 0x1a : 0x12); |
| 244 | 244 | ||
| 245 | for (i = 0; i < DM_TIMEOUT; i++) { | 245 | for (i = 0; i < DM_TIMEOUT; i++) { |
| 246 | u8 tmp; | 246 | u8 tmp; |
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c index a44f9e0ea098..f1942d69a0d5 100644 --- a/drivers/net/usb/sierra_net.c +++ b/drivers/net/usb/sierra_net.c | |||
| @@ -789,6 +789,9 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf) | |||
| 789 | /* prepare sync message from template */ | 789 | /* prepare sync message from template */ |
| 790 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); | 790 | memcpy(priv->sync_msg, sync_tmplate, sizeof(priv->sync_msg)); |
| 791 | 791 | ||
| 792 | /* initiate the sync sequence */ | ||
| 793 | sierra_net_dosync(dev); | ||
| 794 | |||
| 792 | return 0; | 795 | return 0; |
| 793 | } | 796 | } |
| 794 | 797 | ||
diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index 269fda362836..c24067f1a0cb 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c | |||
| @@ -246,7 +246,7 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, | |||
| 246 | u32 idx, i; | 246 | u32 idx, i; |
| 247 | 247 | ||
| 248 | i = (*index) % ring_limit; | 248 | i = (*index) % ring_limit; |
| 249 | (*index) = idx = le32_to_cpu(ring_control->device_idx[1]); | 249 | (*index) = idx = le32_to_cpu(ring_control->device_idx[ring_index]); |
| 250 | idx %= ring_limit; | 250 | idx %= ring_limit; |
| 251 | 251 | ||
| 252 | while (i != idx) { | 252 | while (i != idx) { |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index ff3017744711..597f8e27aaf6 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
| @@ -778,6 +778,7 @@ int sctp_user_addto_chunk(struct sctp_chunk *chunk, int off, int len, | |||
| 778 | struct iovec *data); | 778 | struct iovec *data); |
| 779 | void sctp_chunk_free(struct sctp_chunk *); | 779 | void sctp_chunk_free(struct sctp_chunk *); |
| 780 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); | 780 | void *sctp_addto_chunk(struct sctp_chunk *, int len, const void *data); |
| 781 | void *sctp_addto_chunk_fixed(struct sctp_chunk *, int len, const void *data); | ||
| 781 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, | 782 | struct sctp_chunk *sctp_chunkify(struct sk_buff *, |
| 782 | const struct sctp_association *, | 783 | const struct sctp_association *, |
| 783 | struct sock *); | 784 | struct sock *); |
diff --git a/include/net/sock.h b/include/net/sock.h index b4603cd54fcd..1ad6435f252e 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -74,7 +74,7 @@ | |||
| 74 | printk(KERN_DEBUG msg); } while (0) | 74 | printk(KERN_DEBUG msg); } while (0) |
| 75 | #else | 75 | #else |
| 76 | /* Validate arguments and do nothing */ | 76 | /* Validate arguments and do nothing */ |
| 77 | static void inline int __attribute__ ((format (printf, 2, 3))) | 77 | static inline void __attribute__ ((format (printf, 2, 3))) |
| 78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) | 78 | SOCK_DEBUG(struct sock *sk, const char *msg, ...) |
| 79 | { | 79 | { |
| 80 | } | 80 | } |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index dee48658805c..5bfb213984b2 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
| @@ -774,7 +774,7 @@ void flush_delayed_work(struct delayed_work *dwork) | |||
| 774 | { | 774 | { |
| 775 | if (del_timer_sync(&dwork->timer)) { | 775 | if (del_timer_sync(&dwork->timer)) { |
| 776 | struct cpu_workqueue_struct *cwq; | 776 | struct cpu_workqueue_struct *cwq; |
| 777 | cwq = wq_per_cpu(keventd_wq, get_cpu()); | 777 | cwq = wq_per_cpu(get_wq_data(&dwork->work)->wq, get_cpu()); |
| 778 | __queue_work(cwq, &dwork->work); | 778 | __queue_work(cwq, &dwork->work); |
| 779 | put_cpu(); | 779 | put_cpu(); |
| 780 | } | 780 | } |
| @@ -2153,7 +2153,7 @@ static int init_kmem_cache_nodes(struct kmem_cache *s, gfp_t gfpflags) | |||
| 2153 | int local_node; | 2153 | int local_node; |
| 2154 | 2154 | ||
| 2155 | if (slab_state >= UP && (s < kmalloc_caches || | 2155 | if (slab_state >= UP && (s < kmalloc_caches || |
| 2156 | s > kmalloc_caches + KMALLOC_CACHES)) | 2156 | s >= kmalloc_caches + KMALLOC_CACHES)) |
| 2157 | local_node = page_to_nid(virt_to_page(s)); | 2157 | local_node = page_to_nid(virt_to_page(s)); |
| 2158 | else | 2158 | else |
| 2159 | local_node = 0; | 2159 | local_node = 0; |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index 3192aa02ba5d..3f9e86b15e0d 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -200,7 +200,7 @@ lookup_protocol: | |||
| 200 | 200 | ||
| 201 | inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); | 201 | inet_sk(sk)->pinet6 = np = inet6_sk_generic(sk); |
| 202 | np->hop_limit = -1; | 202 | np->hop_limit = -1; |
| 203 | np->mcast_hops = -1; | 203 | np->mcast_hops = IPV6_DEFAULT_MCASTHOPS; |
| 204 | np->mc_loop = 1; | 204 | np->mc_loop = 1; |
| 205 | np->pmtudisc = IPV6_PMTUDISC_WANT; | 205 | np->pmtudisc = IPV6_PMTUDISC_WANT; |
| 206 | np->ipv6only = net->ipv6.sysctl.bindv6only; | 206 | np->ipv6only = net->ipv6.sysctl.bindv6only; |
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 0fd5b4c88358..30c1767186b8 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c | |||
| @@ -108,7 +108,7 @@ static const struct sctp_paramhdr prsctp_param = { | |||
| 108 | cpu_to_be16(sizeof(struct sctp_paramhdr)), | 108 | cpu_to_be16(sizeof(struct sctp_paramhdr)), |
| 109 | }; | 109 | }; |
| 110 | 110 | ||
| 111 | /* A helper to initialize to initialize an op error inside a | 111 | /* A helper to initialize an op error inside a |
| 112 | * provided chunk, as most cause codes will be embedded inside an | 112 | * provided chunk, as most cause codes will be embedded inside an |
| 113 | * abort chunk. | 113 | * abort chunk. |
| 114 | */ | 114 | */ |
| @@ -125,6 +125,29 @@ void sctp_init_cause(struct sctp_chunk *chunk, __be16 cause_code, | |||
| 125 | chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); | 125 | chunk->subh.err_hdr = sctp_addto_chunk(chunk, sizeof(sctp_errhdr_t), &err); |
| 126 | } | 126 | } |
| 127 | 127 | ||
| 128 | /* A helper to initialize an op error inside a | ||
| 129 | * provided chunk, as most cause codes will be embedded inside an | ||
| 130 | * abort chunk. Differs from sctp_init_cause in that it won't oops | ||
| 131 | * if there isn't enough space in the op error chunk | ||
| 132 | */ | ||
| 133 | int sctp_init_cause_fixed(struct sctp_chunk *chunk, __be16 cause_code, | ||
| 134 | size_t paylen) | ||
| 135 | { | ||
| 136 | sctp_errhdr_t err; | ||
| 137 | __u16 len; | ||
| 138 | |||
| 139 | /* Cause code constants are now defined in network order. */ | ||
| 140 | err.cause = cause_code; | ||
| 141 | len = sizeof(sctp_errhdr_t) + paylen; | ||
| 142 | err.length = htons(len); | ||
| 143 | |||
| 144 | if (skb_tailroom(chunk->skb) > len) | ||
| 145 | return -ENOSPC; | ||
| 146 | chunk->subh.err_hdr = sctp_addto_chunk_fixed(chunk, | ||
| 147 | sizeof(sctp_errhdr_t), | ||
| 148 | &err); | ||
| 149 | return 0; | ||
| 150 | } | ||
| 128 | /* 3.3.2 Initiation (INIT) (1) | 151 | /* 3.3.2 Initiation (INIT) (1) |
| 129 | * | 152 | * |
| 130 | * This chunk is used to initiate a SCTP association between two | 153 | * This chunk is used to initiate a SCTP association between two |
| @@ -1132,6 +1155,24 @@ nodata: | |||
| 1132 | return retval; | 1155 | return retval; |
| 1133 | } | 1156 | } |
| 1134 | 1157 | ||
| 1158 | /* Create an Operation Error chunk of a fixed size, | ||
| 1159 | * specifically, max(asoc->pathmtu, SCTP_DEFAULT_MAXSEGMENT) | ||
| 1160 | * This is a helper function to allocate an error chunk for | ||
| 1161 | * for those invalid parameter codes in which we may not want | ||
| 1162 | * to report all the errors, if the incomming chunk is large | ||
| 1163 | */ | ||
| 1164 | static inline struct sctp_chunk *sctp_make_op_error_fixed( | ||
| 1165 | const struct sctp_association *asoc, | ||
| 1166 | const struct sctp_chunk *chunk) | ||
| 1167 | { | ||
| 1168 | size_t size = asoc ? asoc->pathmtu : 0; | ||
| 1169 | |||
| 1170 | if (!size) | ||
| 1171 | size = SCTP_DEFAULT_MAXSEGMENT; | ||
| 1172 | |||
| 1173 | return sctp_make_op_error_space(asoc, chunk, size); | ||
| 1174 | } | ||
| 1175 | |||
| 1135 | /* Create an Operation Error chunk. */ | 1176 | /* Create an Operation Error chunk. */ |
| 1136 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, | 1177 | struct sctp_chunk *sctp_make_op_error(const struct sctp_association *asoc, |
| 1137 | const struct sctp_chunk *chunk, | 1178 | const struct sctp_chunk *chunk, |
| @@ -1374,6 +1415,18 @@ void *sctp_addto_chunk(struct sctp_chunk *chunk, int len, const void *data) | |||
| 1374 | return target; | 1415 | return target; |
| 1375 | } | 1416 | } |
| 1376 | 1417 | ||
| 1418 | /* Append bytes to the end of a chunk. Returns NULL if there isn't sufficient | ||
| 1419 | * space in the chunk | ||
| 1420 | */ | ||
| 1421 | void *sctp_addto_chunk_fixed(struct sctp_chunk *chunk, | ||
| 1422 | int len, const void *data) | ||
| 1423 | { | ||
| 1424 | if (skb_tailroom(chunk->skb) > len) | ||
| 1425 | return sctp_addto_chunk(chunk, len, data); | ||
| 1426 | else | ||
| 1427 | return NULL; | ||
| 1428 | } | ||
| 1429 | |||
| 1377 | /* Append bytes from user space to the end of a chunk. Will panic if | 1430 | /* Append bytes from user space to the end of a chunk. Will panic if |
| 1378 | * chunk is not big enough. | 1431 | * chunk is not big enough. |
| 1379 | * Returns a kernel err value. | 1432 | * Returns a kernel err value. |
| @@ -1977,13 +2030,12 @@ static sctp_ierror_t sctp_process_unk_param(const struct sctp_association *asoc, | |||
| 1977 | * returning multiple unknown parameters. | 2030 | * returning multiple unknown parameters. |
| 1978 | */ | 2031 | */ |
| 1979 | if (NULL == *errp) | 2032 | if (NULL == *errp) |
| 1980 | *errp = sctp_make_op_error_space(asoc, chunk, | 2033 | *errp = sctp_make_op_error_fixed(asoc, chunk); |
| 1981 | ntohs(chunk->chunk_hdr->length)); | ||
| 1982 | 2034 | ||
| 1983 | if (*errp) { | 2035 | if (*errp) { |
| 1984 | sctp_init_cause(*errp, SCTP_ERROR_UNKNOWN_PARAM, | 2036 | sctp_init_cause_fixed(*errp, SCTP_ERROR_UNKNOWN_PARAM, |
| 1985 | WORD_ROUND(ntohs(param.p->length))); | 2037 | WORD_ROUND(ntohs(param.p->length))); |
| 1986 | sctp_addto_chunk(*errp, | 2038 | sctp_addto_chunk_fixed(*errp, |
| 1987 | WORD_ROUND(ntohs(param.p->length)), | 2039 | WORD_ROUND(ntohs(param.p->length)), |
| 1988 | param.v); | 2040 | param.v); |
| 1989 | } else { | 2041 | } else { |
diff --git a/security/keys/keyring.c b/security/keys/keyring.c index 29de5ee3457b..3f425a65906f 100644 --- a/security/keys/keyring.c +++ b/security/keys/keyring.c | |||
| @@ -20,6 +20,11 @@ | |||
| 20 | #include <linux/uaccess.h> | 20 | #include <linux/uaccess.h> |
| 21 | #include "internal.h" | 21 | #include "internal.h" |
| 22 | 22 | ||
| 23 | #define rcu_dereference_locked_keyring(keyring) \ | ||
| 24 | (rcu_dereference_protected( \ | ||
| 25 | (keyring)->payload.subscriptions, \ | ||
| 26 | rwsem_is_locked((struct rw_semaphore *)&(keyring)->sem))) | ||
| 27 | |||
| 23 | /* | 28 | /* |
| 24 | * when plumbing the depths of the key tree, this sets a hard limit set on how | 29 | * when plumbing the depths of the key tree, this sets a hard limit set on how |
| 25 | * deep we're willing to go | 30 | * deep we're willing to go |
| @@ -199,8 +204,7 @@ static long keyring_read(const struct key *keyring, | |||
| 199 | int loop, ret; | 204 | int loop, ret; |
| 200 | 205 | ||
| 201 | ret = 0; | 206 | ret = 0; |
| 202 | klist = keyring->payload.subscriptions; | 207 | klist = rcu_dereference_locked_keyring(keyring); |
| 203 | |||
| 204 | if (klist) { | 208 | if (klist) { |
| 205 | /* calculate how much data we could return */ | 209 | /* calculate how much data we could return */ |
| 206 | qty = klist->nkeys * sizeof(key_serial_t); | 210 | qty = klist->nkeys * sizeof(key_serial_t); |
| @@ -524,9 +528,8 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check) | |||
| 524 | struct key *keyring; | 528 | struct key *keyring; |
| 525 | int bucket; | 529 | int bucket; |
| 526 | 530 | ||
| 527 | keyring = ERR_PTR(-EINVAL); | ||
| 528 | if (!name) | 531 | if (!name) |
| 529 | goto error; | 532 | return ERR_PTR(-EINVAL); |
| 530 | 533 | ||
| 531 | bucket = keyring_hash(name); | 534 | bucket = keyring_hash(name); |
| 532 | 535 | ||
| @@ -553,17 +556,18 @@ struct key *find_keyring_by_name(const char *name, bool skip_perm_check) | |||
| 553 | KEY_SEARCH) < 0) | 556 | KEY_SEARCH) < 0) |
| 554 | continue; | 557 | continue; |
| 555 | 558 | ||
| 556 | /* we've got a match */ | 559 | /* we've got a match but we might end up racing with |
| 557 | atomic_inc(&keyring->usage); | 560 | * key_cleanup() if the keyring is currently 'dead' |
| 558 | read_unlock(&keyring_name_lock); | 561 | * (ie. it has a zero usage count) */ |
| 559 | goto error; | 562 | if (!atomic_inc_not_zero(&keyring->usage)) |
| 563 | continue; | ||
| 564 | goto out; | ||
| 560 | } | 565 | } |
| 561 | } | 566 | } |
| 562 | 567 | ||
| 563 | read_unlock(&keyring_name_lock); | ||
| 564 | keyring = ERR_PTR(-ENOKEY); | 568 | keyring = ERR_PTR(-ENOKEY); |
| 565 | 569 | out: | |
| 566 | error: | 570 | read_unlock(&keyring_name_lock); |
| 567 | return keyring; | 571 | return keyring; |
| 568 | 572 | ||
| 569 | } /* end find_keyring_by_name() */ | 573 | } /* end find_keyring_by_name() */ |
| @@ -719,8 +723,7 @@ int __key_link(struct key *keyring, struct key *key) | |||
| 719 | } | 723 | } |
| 720 | 724 | ||
| 721 | /* see if there's a matching key we can displace */ | 725 | /* see if there's a matching key we can displace */ |
| 722 | klist = keyring->payload.subscriptions; | 726 | klist = rcu_dereference_locked_keyring(keyring); |
| 723 | |||
| 724 | if (klist && klist->nkeys > 0) { | 727 | if (klist && klist->nkeys > 0) { |
| 725 | struct key_type *type = key->type; | 728 | struct key_type *type = key->type; |
| 726 | 729 | ||
| @@ -764,8 +767,6 @@ int __key_link(struct key *keyring, struct key *key) | |||
| 764 | if (ret < 0) | 767 | if (ret < 0) |
| 765 | goto error2; | 768 | goto error2; |
| 766 | 769 | ||
| 767 | klist = keyring->payload.subscriptions; | ||
| 768 | |||
| 769 | if (klist && klist->nkeys < klist->maxkeys) { | 770 | if (klist && klist->nkeys < klist->maxkeys) { |
| 770 | /* there's sufficient slack space to add directly */ | 771 | /* there's sufficient slack space to add directly */ |
| 771 | atomic_inc(&key->usage); | 772 | atomic_inc(&key->usage); |
| @@ -867,7 +868,7 @@ int key_unlink(struct key *keyring, struct key *key) | |||
| 867 | 868 | ||
| 868 | down_write(&keyring->sem); | 869 | down_write(&keyring->sem); |
| 869 | 870 | ||
| 870 | klist = keyring->payload.subscriptions; | 871 | klist = rcu_dereference_locked_keyring(keyring); |
| 871 | if (klist) { | 872 | if (klist) { |
| 872 | /* search the keyring for the key */ | 873 | /* search the keyring for the key */ |
| 873 | for (loop = 0; loop < klist->nkeys; loop++) | 874 | for (loop = 0; loop < klist->nkeys; loop++) |
| @@ -958,7 +959,7 @@ int keyring_clear(struct key *keyring) | |||
| 958 | /* detach the pointer block with the locks held */ | 959 | /* detach the pointer block with the locks held */ |
| 959 | down_write(&keyring->sem); | 960 | down_write(&keyring->sem); |
| 960 | 961 | ||
| 961 | klist = keyring->payload.subscriptions; | 962 | klist = rcu_dereference_locked_keyring(keyring); |
| 962 | if (klist) { | 963 | if (klist) { |
| 963 | /* adjust the quota */ | 964 | /* adjust the quota */ |
| 964 | key_payload_reserve(keyring, | 965 | key_payload_reserve(keyring, |
| @@ -990,7 +991,9 @@ EXPORT_SYMBOL(keyring_clear); | |||
| 990 | */ | 991 | */ |
| 991 | static void keyring_revoke(struct key *keyring) | 992 | static void keyring_revoke(struct key *keyring) |
| 992 | { | 993 | { |
| 993 | struct keyring_list *klist = keyring->payload.subscriptions; | 994 | struct keyring_list *klist; |
| 995 | |||
| 996 | klist = rcu_dereference_locked_keyring(keyring); | ||
| 994 | 997 | ||
| 995 | /* adjust the quota */ | 998 | /* adjust the quota */ |
| 996 | key_payload_reserve(keyring, 0); | 999 | key_payload_reserve(keyring, 0); |
| @@ -1024,7 +1027,7 @@ void keyring_gc(struct key *keyring, time_t limit) | |||
| 1024 | 1027 | ||
| 1025 | down_write(&keyring->sem); | 1028 | down_write(&keyring->sem); |
| 1026 | 1029 | ||
| 1027 | klist = keyring->payload.subscriptions; | 1030 | klist = rcu_dereference_locked_keyring(keyring); |
| 1028 | if (!klist) | 1031 | if (!klist) |
| 1029 | goto no_klist; | 1032 | goto no_klist; |
| 1030 | 1033 | ||
diff --git a/security/keys/request_key.c b/security/keys/request_key.c index 1bc38587adc4..ac49c8aacbf0 100644 --- a/security/keys/request_key.c +++ b/security/keys/request_key.c | |||
| @@ -94,7 +94,7 @@ static int call_sbin_request_key(struct key_construction *cons, | |||
| 94 | } | 94 | } |
| 95 | 95 | ||
| 96 | /* attach the auth key to the session keyring */ | 96 | /* attach the auth key to the session keyring */ |
| 97 | ret = __key_link(keyring, authkey); | 97 | ret = key_link(keyring, authkey); |
| 98 | if (ret < 0) | 98 | if (ret < 0) |
| 99 | goto error_link; | 99 | goto error_link; |
| 100 | 100 | ||
diff --git a/sound/core/timer.c b/sound/core/timer.c index 73943651caed..5040c7b862fe 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
| @@ -1160,6 +1160,7 @@ static void snd_timer_user_ccallback(struct snd_timer_instance *timeri, | |||
| 1160 | { | 1160 | { |
| 1161 | struct snd_timer_user *tu = timeri->callback_data; | 1161 | struct snd_timer_user *tu = timeri->callback_data; |
| 1162 | struct snd_timer_tread r1; | 1162 | struct snd_timer_tread r1; |
| 1163 | unsigned long flags; | ||
| 1163 | 1164 | ||
| 1164 | if (event >= SNDRV_TIMER_EVENT_START && | 1165 | if (event >= SNDRV_TIMER_EVENT_START && |
| 1165 | event <= SNDRV_TIMER_EVENT_PAUSE) | 1166 | event <= SNDRV_TIMER_EVENT_PAUSE) |
| @@ -1169,9 +1170,9 @@ static void snd_timer_user_ccallback(struct snd_timer_instance *timeri, | |||
| 1169 | r1.event = event; | 1170 | r1.event = event; |
| 1170 | r1.tstamp = *tstamp; | 1171 | r1.tstamp = *tstamp; |
| 1171 | r1.val = resolution; | 1172 | r1.val = resolution; |
| 1172 | spin_lock(&tu->qlock); | 1173 | spin_lock_irqsave(&tu->qlock, flags); |
| 1173 | snd_timer_user_append_to_tqueue(tu, &r1); | 1174 | snd_timer_user_append_to_tqueue(tu, &r1); |
| 1174 | spin_unlock(&tu->qlock); | 1175 | spin_unlock_irqrestore(&tu->qlock, flags); |
| 1175 | kill_fasync(&tu->fasync, SIGIO, POLL_IN); | 1176 | kill_fasync(&tu->fasync, SIGIO, POLL_IN); |
| 1176 | wake_up(&tu->qchange_sleep); | 1177 | wake_up(&tu->qchange_sleep); |
| 1177 | } | 1178 | } |
diff --git a/sound/isa/sb/es968.c b/sound/isa/sb/es968.c index cafc3a7316a8..ff18286fef9d 100644 --- a/sound/isa/sb/es968.c +++ b/sound/isa/sb/es968.c | |||
| @@ -93,7 +93,7 @@ static int __devinit snd_card_es968_pnp(int dev, struct snd_card_es968 *acard, | |||
| 93 | return err; | 93 | return err; |
| 94 | } | 94 | } |
| 95 | port[dev] = pnp_port_start(pdev, 0); | 95 | port[dev] = pnp_port_start(pdev, 0); |
| 96 | dma8[dev] = pnp_dma(pdev, 1); | 96 | dma8[dev] = pnp_dma(pdev, 0); |
| 97 | irq[dev] = pnp_irq(pdev, 0); | 97 | irq[dev] = pnp_irq(pdev, 0); |
| 98 | 98 | ||
| 99 | return 0; | 99 | return 0; |
diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c index 7de782a5b8f4..350ee8ac4153 100644 --- a/sound/pci/hda/patch_cirrus.c +++ b/sound/pci/hda/patch_cirrus.c | |||
| @@ -766,7 +766,7 @@ static int build_input(struct hda_codec *codec) | |||
| 766 | for (n = 0; n < AUTO_PIN_LAST; n++) { | 766 | for (n = 0; n < AUTO_PIN_LAST; n++) { |
| 767 | if (!spec->adc_nid[n]) | 767 | if (!spec->adc_nid[n]) |
| 768 | continue; | 768 | continue; |
| 769 | err = snd_hda_add_nid(codec, kctl, 0, spec->adc_nid[i]); | 769 | err = snd_hda_add_nid(codec, kctl, 0, spec->adc_nid[n]); |
| 770 | if (err < 0) | 770 | if (err < 0) |
| 771 | return err; | 771 | return err; |
| 772 | } | 772 | } |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 61682e1d09da..56e52071c769 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
| @@ -1195,9 +1195,10 @@ static int patch_cxt5045(struct hda_codec *codec) | |||
| 1195 | 1195 | ||
| 1196 | switch (codec->subsystem_id >> 16) { | 1196 | switch (codec->subsystem_id >> 16) { |
| 1197 | case 0x103c: | 1197 | case 0x103c: |
| 1198 | case 0x1631: | ||
| 1198 | case 0x1734: | 1199 | case 0x1734: |
| 1199 | /* HP & Fujitsu-Siemens laptops have really bad sound over 0dB | 1200 | /* HP, Packard Bell, & Fujitsu-Siemens laptops have really bad |
| 1200 | * on NID 0x17. Fix max PCM level to 0 dB | 1201 | * sound over 0dB on NID 0x17. Fix max PCM level to 0 dB |
| 1201 | * (originally it has 0x2b steps with 0dB offset 0x14) | 1202 | * (originally it has 0x2b steps with 0dB offset 0x14) |
| 1202 | */ | 1203 | */ |
| 1203 | snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT, | 1204 | snd_hda_override_amp_caps(codec, 0x17, HDA_INPUT, |
| @@ -2842,6 +2843,9 @@ static struct snd_pci_quirk cxt5066_cfg_tbl[] = { | |||
| 2842 | CXT5066_DELL_LAPTOP), | 2843 | CXT5066_DELL_LAPTOP), |
| 2843 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), | 2844 | SND_PCI_QUIRK(0x152d, 0x0833, "OLPC XO-1.5", CXT5066_OLPC_XO_1_5), |
| 2844 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), | 2845 | SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTO), |
| 2846 | SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD), | ||
| 2847 | SND_PCI_QUIRK(0x1179, 0xff50, "Toshiba Satellite P500-PSPGSC-01800T", CXT5066_OLPC_XO_1_5), | ||
| 2848 | SND_PCI_QUIRK(0x1179, 0xffe0, "Toshiba Satellite Pro T130-15F", CXT5066_OLPC_XO_1_5), | ||
| 2845 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD), | 2849 | SND_PCI_QUIRK(0x17aa, 0x3a0d, "ideapad", CXT5066_IDEAPAD), |
| 2846 | {} | 2850 | {} |
| 2847 | }; | 2851 | }; |
