summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@linux.intel.com>2010-06-28 14:34:08 -0700
committerH. Peter Anvin <hpa@linux.intel.com>2010-06-28 14:34:08 -0700
commitc126c28095caf13d164b21f4c7cb25a44af859b0 (patch)
tree148cf83f13be84440a7c45eae5cfcd36acb59d61 /core
parentae505cf1c6d9350ddd8c038c998715939605f195 (diff)
downloadsyslinux-c126c28095caf13d164b21f4c7cb25a44af859b0.tar.gz
diskio: hard-code CD-ROM sectors to 2048 bytes
At least the ThinkPad T22 and T23 will incorrectly report a sector size of 512 bytes for El Torito CD-ROMs. Ignore the reported sector size for El Torito boots. Reported-by: Helmut Hullen <hullen@t-online.de> Tested-by: Peter Zijlstra <peterz@infradead.org> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'core')
-rw-r--r--core/fs/diskio.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/core/fs/diskio.c b/core/fs/diskio.c
index b832868f..1625bdb2 100644
--- a/core/fs/diskio.c
+++ b/core/fs/diskio.c
@@ -278,7 +278,18 @@ struct disk *disk_init(uint8_t devno, bool cdrom, sector_t part_start,
if (edd_params.len < sizeof edd_params)
memset((char *)&edd_params + edd_params.len, 0,
sizeof edd_params - edd_params.len);
- if (edd_params.sector_size >= 512 &&
+
+ /*
+ * Note: filter impossible sector sizes. Some BIOSes
+ * are known to report incorrect sector size information
+ * (usually 512 rather than 2048) for CD-ROMs, so at least
+ * for now ignore the reported sector size if booted via
+ * El Torito.
+ *
+ * Known affected systems: ThinkPad T22, T23.
+ */
+ if (!cdrom &&
+ edd_params.sector_size >= 512 &&
is_power_of_2(edd_params.sector_size))
sector_size = edd_params.sector_size;
}