From: Greg Kroah-Hartman Date: Mon, 25 Jan 2010 20:37:39 +0000 (-0800) Subject: more .32 patches X-Git-Tag: v2.6.32.7~20 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b5ce36d3ed4c931c03a95e4619c28dbd58ae1404;p=thirdparty%2Fkernel%2Fstable-queue.git more .32 patches --- diff --git a/queue-2.6.32/alsa-ice1724-patch-for-suspend-resume-for-esi-juli.patch b/queue-2.6.32/alsa-ice1724-patch-for-suspend-resume-for-esi-juli.patch new file mode 100644 index 00000000000..cc00ae27be6 --- /dev/null +++ b/queue-2.6.32/alsa-ice1724-patch-for-suspend-resume-for-esi-juli.patch @@ -0,0 +1,70 @@ +From 50d40f187f9182ee8caa1b83f80a0e11e2226baa Mon Sep 17 00:00:00 2001 +From: Aleksey Kunitskiy +Date: Sat, 14 Nov 2009 15:18:54 +0200 +Subject: ALSA: ice1724 - Patch for suspend/resume for ESI Juli@ + +From: Aleksey Kunitskiy + +commit 50d40f187f9182ee8caa1b83f80a0e11e2226baa upstream. + +Add proper suspend/resume code for Juli@ cards. Based on ice1724 +suspend/resume work of Igor Chernyshev. +Fixes bug https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4413 +Tested on linux-2.6.31.6 + +Signed-off-by: Aleksey Kunitskiy +Signed-off-by: Takashi Iwai +Signed-off-by: Greg Kroah-Hartman + +--- + sound/pci/ice1712/juli.c | 32 ++++++++++++++++++++++++++++++++ + 1 file changed, 32 insertions(+) + +--- a/sound/pci/ice1712/juli.c ++++ b/sound/pci/ice1712/juli.c +@@ -504,6 +504,31 @@ static int __devinit juli_add_controls(s + } + + /* ++ * suspend/resume ++ * */ ++ ++#ifdef CONFIG_PM ++static int juli_resume(struct snd_ice1712 *ice) ++{ ++ struct snd_akm4xxx *ak = ice->akm; ++ struct juli_spec *spec = ice->spec; ++ /* akm4358 un-reset, un-mute */ ++ snd_akm4xxx_reset(ak, 0); ++ /* reinit ak4114 */ ++ snd_ak4114_reinit(spec->ak4114); ++ return 0; ++} ++ ++static int juli_suspend(struct snd_ice1712 *ice) ++{ ++ struct snd_akm4xxx *ak = ice->akm; ++ /* akm4358 reset and soft-mute */ ++ snd_akm4xxx_reset(ak, 1); ++ return 0; ++} ++#endif ++ ++/* + * initialize the chip + */ + +@@ -646,6 +671,13 @@ static int __devinit juli_init(struct sn + ice->set_spdif_clock = juli_set_spdif_clock; + + ice->spdif.ops.open = juli_spdif_in_open; ++ ++#ifdef CONFIG_PM ++ ice->pm_resume = juli_resume; ++ ice->pm_suspend = juli_suspend; ++ ice->pm_suspend_enabled = 1; ++#endif ++ + return 0; + } + diff --git a/queue-2.6.32/partitions-read-whole-sector-with-efi-gpt-header.patch b/queue-2.6.32/partitions-read-whole-sector-with-efi-gpt-header.patch new file mode 100644 index 00000000000..7389c760fe9 --- /dev/null +++ b/queue-2.6.32/partitions-read-whole-sector-with-efi-gpt-header.patch @@ -0,0 +1,76 @@ +From 87038c2d5bda2418fda8b1456a0ae81cc3ff5bd8 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 23 Nov 2009 09:29:58 +0100 +Subject: partitions: read whole sector with EFI GPT header + +From: Karel Zak + +commit 87038c2d5bda2418fda8b1456a0ae81cc3ff5bd8 upstream. + +The size of EFI GPT header is not static, but whole sector is +allocated for the header. The HeaderSize field must be greater +than 92 (= sizeof(struct gpt_header) and must be less than or +equal to the logical block size. + +It means we have to read whole sector with the header, because the +header crc32 checksum is calculated according to HeaderSize. + +For more details see UEFI standard (version 2.3, May 2009): + - 5.3.1 GUID Format overview, page 93 + - Table 13. GUID Partition Table Header, page 96 + +Signed-off-by: Karel Zak +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + fs/partitions/efi.c | 7 ++++--- + fs/partitions/efi.h | 8 ++++++-- + 2 files changed, 10 insertions(+), 5 deletions(-) + +--- a/fs/partitions/efi.c ++++ b/fs/partitions/efi.c +@@ -257,15 +257,16 @@ static gpt_header * + alloc_read_gpt_header(struct block_device *bdev, u64 lba) + { + gpt_header *gpt; ++ unsigned ssz = bdev_logical_block_size(bdev); ++ + if (!bdev) + return NULL; + +- gpt = kzalloc(sizeof (gpt_header), GFP_KERNEL); ++ gpt = kzalloc(ssz, GFP_KERNEL); + if (!gpt) + return NULL; + +- if (read_lba(bdev, lba, (u8 *) gpt, +- sizeof (gpt_header)) < sizeof (gpt_header)) { ++ if (read_lba(bdev, lba, (u8 *) gpt, ssz) < ssz) { + kfree(gpt); + gpt=NULL; + return NULL; +--- a/fs/partitions/efi.h ++++ b/fs/partitions/efi.h +@@ -37,7 +37,6 @@ + #define EFI_PMBR_OSTYPE_EFI 0xEF + #define EFI_PMBR_OSTYPE_EFI_GPT 0xEE + +-#define GPT_BLOCK_SIZE 512 + #define GPT_HEADER_SIGNATURE 0x5452415020494645ULL + #define GPT_HEADER_REVISION_V1 0x00010000 + #define GPT_PRIMARY_PARTITION_TABLE_LBA 1 +@@ -79,7 +78,12 @@ typedef struct _gpt_header { + __le32 num_partition_entries; + __le32 sizeof_partition_entry; + __le32 partition_entry_array_crc32; +- u8 reserved2[GPT_BLOCK_SIZE - 92]; ++ ++ /* The rest of the logical block is reserved by UEFI and must be zero. ++ * EFI standard handles this by: ++ * ++ * uint8_t reserved2[ BlockSize - 92 ]; ++ */ + } __attribute__ ((packed)) gpt_header; + + typedef struct _gpt_entry_attributes { diff --git a/queue-2.6.32/partitions-use-sector-size-for-efi-gpt.patch b/queue-2.6.32/partitions-use-sector-size-for-efi-gpt.patch new file mode 100644 index 00000000000..6e541f3ae7b --- /dev/null +++ b/queue-2.6.32/partitions-use-sector-size-for-efi-gpt.patch @@ -0,0 +1,127 @@ +From 7d13af3279985f554784a45cc961f706dbcdbdd1 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 23 Nov 2009 09:29:13 +0100 +Subject: partitions: use sector size for EFI GPT + +From: Karel Zak + +commit 7d13af3279985f554784a45cc961f706dbcdbdd1 upstream. + +Currently, kernel uses strictly 512-byte sectors for EFI GPT parsing. +That's wrong. + +UEFI standard (version 2.3, May 2009, 5.3.1 GUID Format overview, page +95) defines that LBA is always based on the logical block size. It +means bdev_logical_block_size() (aka BLKSSZGET) for Linux. + +This patch removes static sector size from EFI GPT parser. + +The problem is reproducible with the latest GNU Parted: + + # modprobe scsi_debug dev_size_mb=50 sector_size=4096 + + # ./parted /dev/sdb print + Model: Linux scsi_debug (scsi) + Disk /dev/sdb: 52.4MB + Sector size (logical/physical): 4096B/4096B + Partition Table: gpt + + Number Start End Size File system Name Flags + 1 24.6kB 3002kB 2978kB primary + 2 3002kB 6001kB 2998kB primary + 3 6001kB 9003kB 3002kB primary + + # blockdev --rereadpt /dev/sdb + # dmesg | tail -1 + sdb: unknown partition table <---- !!! + +with this patch: + + # blockdev --rereadpt /dev/sdb + # dmesg | tail -1 + sdb: sdb1 sdb2 sdb3 + +Signed-off-by: Karel Zak +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + fs/partitions/efi.c | 23 +++++++++++++++-------- + 1 file changed, 15 insertions(+), 8 deletions(-) + +--- a/fs/partitions/efi.c ++++ b/fs/partitions/efi.c +@@ -1,7 +1,9 @@ + /************************************************************ + * EFI GUID Partition Table handling +- * Per Intel EFI Specification v1.02 +- * http://developer.intel.com/technology/efi/efi.htm ++ * ++ * http://www.uefi.org/specs/ ++ * http://www.intel.com/technology/efi/ ++ * + * efi.[ch] by Matt Domsch + * Copyright 2000,2001,2002,2004 Dell Inc. + * +@@ -92,6 +94,7 @@ + * + ************************************************************/ + #include ++#include + #include "check.h" + #include "efi.h" + +@@ -141,7 +144,8 @@ last_lba(struct block_device *bdev) + { + if (!bdev || !bdev->bd_inode) + return 0; +- return (bdev->bd_inode->i_size >> 9) - 1ULL; ++ return div_u64(bdev->bd_inode->i_size, ++ bdev_logical_block_size(bdev)) - 1ULL; + } + + static inline int +@@ -188,6 +192,7 @@ static size_t + read_lba(struct block_device *bdev, u64 lba, u8 * buffer, size_t count) + { + size_t totalreadcount = 0; ++ sector_t n = lba * (bdev_logical_block_size(bdev) / 512); + + if (!bdev || !buffer || lba > last_lba(bdev)) + return 0; +@@ -195,7 +200,7 @@ read_lba(struct block_device *bdev, u64 + while (count) { + int copied = 512; + Sector sect; +- unsigned char *data = read_dev_sector(bdev, lba++, §); ++ unsigned char *data = read_dev_sector(bdev, n++, §); + if (!data) + break; + if (copied > count) +@@ -602,6 +607,7 @@ efi_partition(struct parsed_partitions * + gpt_header *gpt = NULL; + gpt_entry *ptes = NULL; + u32 i; ++ unsigned ssz = bdev_logical_block_size(bdev) / 512; + + if (!find_valid_gpt(bdev, &gpt, &ptes) || !gpt || !ptes) { + kfree(gpt); +@@ -612,13 +618,14 @@ efi_partition(struct parsed_partitions * + pr_debug("GUID Partition Table is valid! Yea!\n"); + + for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) { ++ u64 start = le64_to_cpu(ptes[i].starting_lba); ++ u64 size = le64_to_cpu(ptes[i].ending_lba) - ++ le64_to_cpu(ptes[i].starting_lba) + 1ULL; ++ + if (!is_pte_valid(&ptes[i], last_lba(bdev))) + continue; + +- put_partition(state, i+1, le64_to_cpu(ptes[i].starting_lba), +- (le64_to_cpu(ptes[i].ending_lba) - +- le64_to_cpu(ptes[i].starting_lba) + +- 1ULL)); ++ put_partition(state, i+1, start * ssz, size * ssz); + + /* If this is a RAID volume, tell md */ + if (!efi_guidcmp(ptes[i].partition_type_guid, diff --git a/queue-2.6.32/series b/queue-2.6.32/series index 19897f829cc..d1a44fab8cb 100644 --- a/queue-2.6.32/series +++ b/queue-2.6.32/series @@ -21,3 +21,6 @@ atl1e-disable-netif_f_tso6-for-hardware-limit.patch v4l-dvb-13680a-docbook-media-copy-images-after-building-html.patch v4l-dvb-13680b-docbook-media-create-links-for-included-sources.patch netfilter-xtables-fix-conntrack-match-v1-ipt-save-output.patch +partitions-read-whole-sector-with-efi-gpt-header.patch +partitions-use-sector-size-for-efi-gpt.patch +alsa-ice1724-patch-for-suspend-resume-for-esi-juli.patch