diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/ata.h | 15 | ||||
| -rw-r--r-- | include/linux/fb.h | 15 | ||||
| -rw-r--r-- | include/linux/kernel.h | 3 | ||||
| -rw-r--r-- | include/linux/libata.h | 19 | ||||
| -rw-r--r-- | include/linux/sched.h | 1 | ||||
| -rw-r--r-- | include/linux/wait.h | 11 |
6 files changed, 48 insertions, 16 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index a53318b8cbd0..08a86d5cdf1b 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -731,12 +731,17 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
| 731 | 731 | ||
| 732 | static inline int ata_id_is_cfa(const u16 *id) | 732 | static inline int ata_id_is_cfa(const u16 *id) |
| 733 | { | 733 | { |
| 734 | if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */ | 734 | if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */ |
| 735 | return 1; | 735 | return 1; |
| 736 | /* Could be CF hiding as standard ATA */ | 736 | /* |
| 737 | if (ata_id_major_version(id) >= 3 && | 737 | * CF specs don't require specific value in the word 0 anymore and yet |
| 738 | id[ATA_ID_COMMAND_SET_1] != 0xFFFF && | 738 | * they forbid to report the ATA version in the word 80 and require the |
| 739 | (id[ATA_ID_COMMAND_SET_1] & (1 << 2))) | 739 | * CFA feature set support to be indicated in the word 83 in this case. |
| 740 | * Unfortunately, some cards only follow either of this requirements, | ||
| 741 | * and while those that don't indicate CFA feature support need some | ||
| 742 | * sort of quirk list, it seems impractical for the ones that do... | ||
| 743 | */ | ||
| 744 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC004) == 0x4004) | ||
| 740 | return 1; | 745 | return 1; |
| 741 | return 0; | 746 | return 0; |
| 742 | } | 747 | } |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 818fe21257e8..31527e17076b 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
| @@ -960,6 +960,21 @@ extern struct fb_info *registered_fb[FB_MAX]; | |||
| 960 | extern int num_registered_fb; | 960 | extern int num_registered_fb; |
| 961 | extern struct class *fb_class; | 961 | extern struct class *fb_class; |
| 962 | 962 | ||
| 963 | static inline int lock_fb_info(struct fb_info *info) | ||
| 964 | { | ||
| 965 | mutex_lock(&info->lock); | ||
| 966 | if (!info->fbops) { | ||
| 967 | mutex_unlock(&info->lock); | ||
| 968 | return 0; | ||
| 969 | } | ||
| 970 | return 1; | ||
| 971 | } | ||
| 972 | |||
| 973 | static inline void unlock_fb_info(struct fb_info *info) | ||
| 974 | { | ||
| 975 | mutex_unlock(&info->lock); | ||
| 976 | } | ||
| 977 | |||
| 963 | static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, | 978 | static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, |
| 964 | u8 *src, u32 s_pitch, u32 height) | 979 | u8 *src, u32 s_pitch, u32 height) |
| 965 | { | 980 | { |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 343df9ef2412..7fa371898e3e 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -480,7 +480,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
| 480 | /* | 480 | /* |
| 481 | * swap - swap value of @a and @b | 481 | * swap - swap value of @a and @b |
| 482 | */ | 482 | */ |
| 483 | #define swap(a, b) ({ typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; }) | 483 | #define swap(a, b) \ |
| 484 | do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) | ||
| 484 | 485 | ||
| 485 | /** | 486 | /** |
| 486 | * container_of - cast a member of a structure out to the containing structure | 487 | * container_of - cast a member of a structure out to the containing structure |
diff --git a/include/linux/libata.h b/include/linux/libata.h index bca3ba25f52a..5d87bc09a1f5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -380,6 +380,7 @@ enum { | |||
| 380 | ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands | 380 | ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands |
| 381 | not multiple of 16 bytes */ | 381 | not multiple of 16 bytes */ |
| 382 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firwmare update warning */ | 382 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firwmare update warning */ |
| 383 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ | ||
| 383 | 384 | ||
| 384 | /* DMA mask for user DMA control: User visible values; DO NOT | 385 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 385 | renumber */ | 386 | renumber */ |
| @@ -580,7 +581,7 @@ struct ata_device { | |||
| 580 | acpi_handle acpi_handle; | 581 | acpi_handle acpi_handle; |
| 581 | union acpi_object *gtf_cache; | 582 | union acpi_object *gtf_cache; |
| 582 | #endif | 583 | #endif |
| 583 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 584 | /* n_sector is CLEAR_BEGIN, read comment above CLEAR_BEGIN */ |
| 584 | u64 n_sectors; /* size of device, if ATA */ | 585 | u64 n_sectors; /* size of device, if ATA */ |
| 585 | unsigned int class; /* ATA_DEV_xxx */ | 586 | unsigned int class; /* ATA_DEV_xxx */ |
| 586 | unsigned long unpark_deadline; | 587 | unsigned long unpark_deadline; |
| @@ -605,20 +606,22 @@ struct ata_device { | |||
| 605 | u16 heads; /* Number of heads */ | 606 | u16 heads; /* Number of heads */ |
| 606 | u16 sectors; /* Number of sectors per track */ | 607 | u16 sectors; /* Number of sectors per track */ |
| 607 | 608 | ||
| 608 | /* error history */ | ||
| 609 | int spdn_cnt; | ||
| 610 | struct ata_ering ering; | ||
| 611 | |||
| 612 | union { | 609 | union { |
| 613 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 610 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ |
| 614 | u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ | 611 | u32 gscr[SATA_PMP_GSCR_DWORDS]; /* PMP GSCR block */ |
| 615 | }; | 612 | }; |
| 613 | |||
| 614 | /* error history */ | ||
| 615 | int spdn_cnt; | ||
| 616 | /* ering is CLEAR_END, read comment above CLEAR_END */ | ||
| 617 | struct ata_ering ering; | ||
| 616 | }; | 618 | }; |
| 617 | 619 | ||
| 618 | /* Offset into struct ata_device. Fields above it are maintained | 620 | /* Fields between ATA_DEVICE_CLEAR_BEGIN and ATA_DEVICE_CLEAR_END are |
| 619 | * acress device init. Fields below are zeroed. | 621 | * cleared to zero on ata_dev_init(). |
| 620 | */ | 622 | */ |
| 621 | #define ATA_DEVICE_CLEAR_OFFSET offsetof(struct ata_device, n_sectors) | 623 | #define ATA_DEVICE_CLEAR_BEGIN offsetof(struct ata_device, n_sectors) |
| 624 | #define ATA_DEVICE_CLEAR_END offsetof(struct ata_device, ering) | ||
| 622 | 625 | ||
| 623 | struct ata_eh_info { | 626 | struct ata_eh_info { |
| 624 | struct ata_device *dev; /* offending device */ | 627 | struct ata_device *dev; /* offending device */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5a7c76388731..2127e959e0f4 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -443,6 +443,7 @@ struct pacct_struct { | |||
| 443 | * @utime: time spent in user mode, in &cputime_t units | 443 | * @utime: time spent in user mode, in &cputime_t units |
| 444 | * @stime: time spent in kernel mode, in &cputime_t units | 444 | * @stime: time spent in kernel mode, in &cputime_t units |
| 445 | * @sum_exec_runtime: total time spent on the CPU, in nanoseconds | 445 | * @sum_exec_runtime: total time spent on the CPU, in nanoseconds |
| 446 | * @lock: lock for fields in this struct | ||
| 446 | * | 447 | * |
| 447 | * This structure groups together three kinds of CPU time that are | 448 | * This structure groups together three kinds of CPU time that are |
| 448 | * tracked for threads and thread groups. Most things considering | 449 | * tracked for threads and thread groups. Most things considering |
diff --git a/include/linux/wait.h b/include/linux/wait.h index ef609f842fac..a210ede73b56 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -132,6 +132,8 @@ static inline void __remove_wait_queue(wait_queue_head_t *head, | |||
| 132 | list_del(&old->task_list); | 132 | list_del(&old->task_list); |
| 133 | } | 133 | } |
| 134 | 134 | ||
| 135 | void __wake_up_common(wait_queue_head_t *q, unsigned int mode, | ||
| 136 | int nr_exclusive, int sync, void *key); | ||
| 135 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); | 137 | void __wake_up(wait_queue_head_t *q, unsigned int mode, int nr, void *key); |
| 136 | extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode); | 138 | extern void __wake_up_locked(wait_queue_head_t *q, unsigned int mode); |
| 137 | extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); | 139 | extern void __wake_up_sync(wait_queue_head_t *q, unsigned int mode, int nr); |
| @@ -333,16 +335,19 @@ do { \ | |||
| 333 | for (;;) { \ | 335 | for (;;) { \ |
| 334 | prepare_to_wait_exclusive(&wq, &__wait, \ | 336 | prepare_to_wait_exclusive(&wq, &__wait, \ |
| 335 | TASK_INTERRUPTIBLE); \ | 337 | TASK_INTERRUPTIBLE); \ |
| 336 | if (condition) \ | 338 | if (condition) { \ |
| 339 | finish_wait(&wq, &__wait); \ | ||
| 337 | break; \ | 340 | break; \ |
| 341 | } \ | ||
| 338 | if (!signal_pending(current)) { \ | 342 | if (!signal_pending(current)) { \ |
| 339 | schedule(); \ | 343 | schedule(); \ |
| 340 | continue; \ | 344 | continue; \ |
| 341 | } \ | 345 | } \ |
| 342 | ret = -ERESTARTSYS; \ | 346 | ret = -ERESTARTSYS; \ |
| 347 | abort_exclusive_wait(&wq, &__wait, \ | ||
| 348 | TASK_INTERRUPTIBLE, NULL); \ | ||
| 343 | break; \ | 349 | break; \ |
| 344 | } \ | 350 | } \ |
| 345 | finish_wait(&wq, &__wait); \ | ||
| 346 | } while (0) | 351 | } while (0) |
| 347 | 352 | ||
| 348 | #define wait_event_interruptible_exclusive(wq, condition) \ | 353 | #define wait_event_interruptible_exclusive(wq, condition) \ |
| @@ -431,6 +436,8 @@ extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, | |||
| 431 | void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); | 436 | void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); |
| 432 | void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); | 437 | void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); |
| 433 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); | 438 | void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); |
| 439 | void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, | ||
| 440 | unsigned int mode, void *key); | ||
| 434 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 441 | int autoremove_wake_function(wait_queue_t *wait, unsigned mode, int sync, void *key); |
| 435 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | 442 | int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); |
| 436 | 443 | ||
