Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 87197
b: refs/heads/master
c: 299601c
h: refs/heads/master
i:
  87195: 49013b6
v: v3
  • Loading branch information
Linus Torvalds committed Mar 12, 2008
1 parent fe1ab22 commit 6baa51b
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 107 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69e634f1e27c8e5b954ea4be2d05dd744cabc0bc
refs/heads/master: 299601cfc0aabbabf82fca50652b7290cce7eb00
4 changes: 3 additions & 1 deletion trunk/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,9 @@ static struct kobject *base_probe(dev_t devt, int *part, void *data)

static int __init genhd_device_init(void)
{
class_register(&block_class);
int error = class_register(&block_class);
if (unlikely(error))
return error;
bdev_map = kobj_map_init(base_probe, &block_class_lock);
blk_dev_init();

Expand Down
100 changes: 65 additions & 35 deletions trunk/drivers/pnp/quirks.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
#include <linux/slab.h>
#include <linux/pnp.h>
#include <linux/io.h>
#include <linux/dmi.h>
#include <linux/kallsyms.h>
#include "base.h"

Expand Down Expand Up @@ -109,42 +108,73 @@ static void quirk_sb16audio_resources(struct pnp_dev *dev)
"pnp: SB audio device quirk - increasing port range\n");
}

static void quirk_supermicro_h8dce_system(struct pnp_dev *dev)

#include <linux/pci.h>

static void quirk_system_pci_resources(struct pnp_dev *dev)
{
int i;
static struct dmi_system_id supermicro_h8dce[] = {
{
.ident = "Supermicro H8DCE",
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Supermicro"),
DMI_MATCH(DMI_PRODUCT_NAME, "H8DCE"),
},
},
{ }
};

if (!dmi_check_system(supermicro_h8dce))
return;
struct pci_dev *pdev = NULL;
resource_size_t pnp_start, pnp_end, pci_start, pci_end;
int i, j;

/*
* On the Supermicro H8DCE, there's a system device with resources
* that overlap BAR 6 of the built-in SATA PCI adapter. If the PNP
* system device claims them, the sata_nv driver won't be able to.
* More details at:
* https://bugzilla.redhat.com/show_bug.cgi?id=280641
* https://bugzilla.redhat.com/show_bug.cgi?id=313491
* http://lkml.org/lkml/2008/1/9/449
* http://thread.gmane.org/gmane.linux.acpi.devel/27312
* Some BIOSes have PNP motherboard devices with resources that
* partially overlap PCI BARs. The PNP system driver claims these
* motherboard resources, which prevents the normal PCI driver from
* requesting them later.
*
* This patch disables the PNP resources that conflict with PCI BARs
* so they won't be claimed by the PNP system driver.
*/
for (i = 0; i < PNP_MAX_MEM; i++) {
if (pnp_mem_valid(dev, i) && pnp_mem_len(dev, i) &&
(pnp_mem_start(dev, i) & 0xdfef0000) == 0xdfef0000) {
dev_warn(&dev->dev, "disabling 0x%llx-0x%llx to prevent"
" conflict with sata_nv PCI device\n",
(unsigned long long) pnp_mem_start(dev, i),
(unsigned long long) (pnp_mem_start(dev, i) +
pnp_mem_len(dev, i) - 1));
pnp_mem_flags(dev, i) = 0;
for_each_pci_dev(pdev) {
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
if (!(pci_resource_flags(pdev, i) & IORESOURCE_MEM) ||
pci_resource_len(pdev, i) == 0)
continue;

pci_start = pci_resource_start(pdev, i);
pci_end = pci_resource_end(pdev, i);
for (j = 0; j < PNP_MAX_MEM; j++) {
if (!pnp_mem_valid(dev, j) ||
pnp_mem_len(dev, j) == 0)
continue;

pnp_start = pnp_mem_start(dev, j);
pnp_end = pnp_mem_end(dev, j);

/*
* If the PNP region doesn't overlap the PCI
* region at all, there's no problem.
*/
if (pnp_end < pci_start || pnp_start > pci_end)
continue;

/*
* If the PNP region completely encloses (or is
* at least as large as) the PCI region, that's
* also OK. For example, this happens when the
* PNP device describes a bridge with PCI
* behind it.
*/
if (pnp_start <= pci_start &&
pnp_end >= pci_end)
continue;

/*
* Otherwise, the PNP region overlaps *part* of
* the PCI region, and that might prevent a PCI
* driver from requesting its resources.
*/
dev_warn(&dev->dev, "mem resource "
"(0x%llx-0x%llx) overlaps %s BAR %d "
"(0x%llx-0x%llx), disabling\n",
(unsigned long long) pnp_start,
(unsigned long long) pnp_end,
pci_name(pdev), i,
(unsigned long long) pci_start,
(unsigned long long) pci_end);
pnp_mem_flags(dev, j) = 0;
}
}
}
}
Expand All @@ -169,8 +199,8 @@ static struct pnp_fixup pnp_fixups[] = {
{"CTL0043", quirk_sb16audio_resources},
{"CTL0044", quirk_sb16audio_resources},
{"CTL0045", quirk_sb16audio_resources},
{"PNP0c01", quirk_supermicro_h8dce_system},
{"PNP0c02", quirk_supermicro_h8dce_system},
{"PNP0c01", quirk_system_pci_resources},
{"PNP0c02", quirk_system_pci_resources},
{""}
};

Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ unifdef-y += futex.h
unifdef-y += fs.h
unifdef-y += gameport.h
unifdef-y += generic_serial.h
unifdef-y += genhd.h
unifdef-y += gfs2_ondisk.h
unifdef-y += hayesesp.h
unifdef-y += hdlcdrv.h
Expand Down
30 changes: 3 additions & 27 deletions trunk/include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,6 @@ enum {
UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */
};

#ifndef __KERNEL__

struct partition {
unsigned char boot_ind; /* 0x80 - active */
unsigned char head; /* starting head */
unsigned char sector; /* starting sector */
unsigned char cyl; /* starting cylinder */
unsigned char sys_ind; /* What partition type */
unsigned char end_head; /* end head */
unsigned char end_sector; /* end sector */
unsigned char end_cyl; /* end cylinder */
unsigned int start_sect; /* starting sector counting from 0 */
unsigned int nr_sects; /* nr of sectors in partition */
} __attribute__((packed));

#endif

#ifdef __KERNEL__
#include <linux/major.h>
#include <linux/device.h>
#include <linux/smp.h>
Expand Down Expand Up @@ -228,7 +210,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) {
sizeof(struct disk_stats));
}

#else
#else /* !CONFIG_SMP */
#define __disk_stat_add(gendiskp, field, addnd) \
(gendiskp->dkstats.field += addnd)
#define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field)
Expand Down Expand Up @@ -256,7 +238,7 @@ static inline void part_stat_set_all(struct hd_struct *part, int value)
memset(&part->dkstats, value, sizeof(struct disk_stats));
}

#endif
#endif /* CONFIG_SMP */

#define disk_stat_add(gendiskp, field, addnd) \
do { \
Expand Down Expand Up @@ -395,8 +377,6 @@ static inline void set_capacity(struct gendisk *disk, sector_t size)
disk->capacity = size;
}

#endif /* __KERNEL__ */

#ifdef CONFIG_SOLARIS_X86_PARTITION

#define SOLARIS_X86_NUMSLICE 16
Expand Down Expand Up @@ -540,8 +520,6 @@ struct unixware_disklabel {
# define MINIX_NR_SUBPARTITIONS 4
#endif /* CONFIG_MINIX_SUBPARTITION */

#ifdef __KERNEL__

#define ADDPART_FLAG_NONE 0
#define ADDPART_FLAG_RAID 1
#define ADDPART_FLAG_WHOLEDISK 2
Expand Down Expand Up @@ -570,8 +548,6 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index)
return bdget(MKDEV(disk->major, disk->first_minor) + index);
}

#endif

#else /* CONFIG_BLOCK */

static inline void printk_all_partitions(void) { }
Expand All @@ -584,4 +560,4 @@ static inline dev_t blk_lookup_devt(const char *name)

#endif /* CONFIG_BLOCK */

#endif
#endif /* _LINUX_GENHD_H */
13 changes: 10 additions & 3 deletions trunk/include/linux/mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,22 @@ static inline int get_page_unless_zero(struct page *page)
struct page *vmalloc_to_page(const void *addr);
unsigned long vmalloc_to_pfn(const void *addr);

#ifdef CONFIG_MMU
/* Determine if an address is within the vmalloc range */
/*
* Determine if an address is within the vmalloc range
*
* On nommu, vmalloc/vfree wrap through kmalloc/kfree directly, so there
* is no special casing required.
*/
static inline int is_vmalloc_addr(const void *x)
{
#ifdef CONFIG_MMU
unsigned long addr = (unsigned long)x;

return addr >= VMALLOC_START && addr < VMALLOC_END;
}
#else
return 0;
#endif
}

static inline struct page *compound_head(struct page *page)
{
Expand Down
2 changes: 1 addition & 1 deletion trunk/net/sunrpc/xprtrdma/svc_rdma_sendto.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static int send_write(struct svcxprt_rdma *xprt, struct svc_rqst *rqstp,
struct svc_rdma_op_ctxt *ctxt;
int ret = 0;

BUG_ON(sge_count >= 32);
BUG_ON(sge_count > RPCSVC_MAXPAGES);
dprintk("svcrdma: RDMA_WRITE rmr=%x, to=%llx, xdr_off=%d, "
"write_len=%d, xdr_sge=%p, sge_count=%d\n",
rmr, (unsigned long long)to, xdr_off,
Expand Down
Loading

0 comments on commit 6baa51b

Please sign in to comment.