From 6ddcd3b0201a7ad72294347636d2b4028ddbd95d Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 15 May 2007 03:28:15 +0900 Subject: libata: during revalidation, check n_sectors after device is configured Device might be resized during ata_dev_configure() due to HPA or (later) ACPI _GTF. Currently it's worked around by caching n_sectors before turning off HPA. The cached original size is overwritten if the device is reconfigured without being hardreset - which always happens after configuring trasnfer mode. If the device gets hardreset for some reason after that, revalidation fails with -ENODEV. This patch makes size checking more robust by moving n_sectors check from ata_dev_reread_id() to ata_dev_revalidate() after the device is fully configured. No matter what happens during configuration, a device must have the same n_sectors after fully configured to be treated as the same device. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- include/linux/libata.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/libata.h b/include/linux/libata.h index 27d93627957..b38a0f9bc9f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -431,7 +431,6 @@ struct ata_device { struct scsi_device *sdev; /* attached SCSI device */ /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ u64 n_sectors; /* size of device, if ATA */ - u64 n_sectors_boot; /* size of ATA device at startup */ unsigned int class; /* ATA_DEV_xxx */ u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ u8 pio_mode; -- cgit v1.2.3 From 3cadbcc09891b8544203f211dac13f9cc4e6832a Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 15 May 2007 03:28:15 +0900 Subject: libata-acpi: add ATA_FLAG_ACPI_SATA port flag Whether a controller needs IDE or SATA ACPI hierarchy is determined by the programming interface of the controller not by whether the controller is SATA or PATA, or it supports slave device or not. This patch adds ATA_FLAG_ACPI_SATA port flags which tells libata-acpi that the port needs SATA ACPI nodes, and sets the flag for ahci and sata_sil24. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- include/linux/libata.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/libata.h b/include/linux/libata.h index b38a0f9bc9f..9b2122db30f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -173,6 +173,7 @@ enum { ATA_FLAG_SETXFER_POLLING= (1 << 14), /* use polling for SETXFER */ ATA_FLAG_IGN_SIMPLEX = (1 << 15), /* ignore SIMPLEX */ ATA_FLAG_NO_IORDY = (1 << 16), /* controller lacks iordy */ + ATA_FLAG_ACPI_SATA = (1 << 17), /* need native SATA ACPI layout */ /* The following flag belongs to ap->pflags but is kept in * ap->flags because it's referenced in many LLDs and will be -- cgit v1.2.3 From 13b8d09f5de0aaa3153bbccc98baf247387823dc Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Tue, 15 May 2007 12:29:22 +0200 Subject: libata: track spindown status and skip spindown_compat if possible Our assumption that most distros issue STANDBYNOW seems wrong. The upstream sysvinit and thus many distros including gentoo and opensuse don't take any action for libata disks on spindown. We can skip compat handling for these distros so that they don't need to update anything to take advantage of kernel-side shutdown. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- include/linux/libata.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/libata.h b/include/linux/libata.h index 9b2122db30f..666592ef0b2 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -140,6 +140,7 @@ enum { ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */ + ATA_DFLAG_SPUNDOWN = (1 << 10), /* XXX: for spindown_compat */ ATA_DFLAG_INIT_MASK = (1 << 16) - 1, ATA_DFLAG_DETACH = (1 << 16), -- cgit v1.2.3 From 1abd727ed7abf5c19e7d1760671475cbecbccb0e Mon Sep 17 00:00:00 2001 From: Christoph Lameter Date: Tue, 15 May 2007 23:57:03 -0700 Subject: SLUB: It is legit to allocate a slab of the maximum permitted size Sorry I screwed up the comparison. It is only an error if we attempt to allocate a slab larger than the maximum allowed size. Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/slub_def.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index fd6627e2d11..c6c1f4a120e 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h @@ -88,7 +88,7 @@ static inline int kmalloc_index(int size) */ WARN_ON_ONCE(size == 0); - if (size >= (1 << KMALLOC_SHIFT_HIGH)) + if (size > (1 << KMALLOC_SHIFT_HIGH)) return -1; if (size > 64 && size <= 96) -- cgit v1.2.3