From 8cbf2169aa99fbe6c93ee0f4e23364c282e8a98c Mon Sep 17 00:00:00 2001 From: Greg KH Date: Thu, 12 May 2005 10:34:10 -0700 Subject: [PATCH] added a bunch of patches forwarded by Daniel Drake --- queue/3c59x-d3-fix.patch | 52 +++++++++++++ queue/fix-lpar-iommu-on-p630.patch | 102 +++++++++++++++++++++++++ queue/fix-matroxfb-on-big-endian.patch | 74 ++++++++++++++++++ queue/ide-dma-fix.patch | 40 ++++++++++ queue/rose-minor-security-fix.patch | 26 +++++++ 5 files changed, 294 insertions(+) create mode 100644 queue/3c59x-d3-fix.patch create mode 100644 queue/fix-lpar-iommu-on-p630.patch create mode 100644 queue/fix-matroxfb-on-big-endian.patch create mode 100644 queue/ide-dma-fix.patch create mode 100644 queue/rose-minor-security-fix.patch diff --git a/queue/3c59x-d3-fix.patch b/queue/3c59x-d3-fix.patch new file mode 100644 index 00000000000..cf9921a7db3 --- /dev/null +++ b/queue/3c59x-d3-fix.patch @@ -0,0 +1,52 @@ +[PATCH] 3c59x: only put the device into D3 when we're actually using WOL + +During a warm boot the device is in D3 and has troubles coming out of it. + +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds + +--- +commit 3c8fad1829cc33e903500b41d989fa50ab196378 +tree 1e958eebf19fb59b67e51d6bb51303fbee2b84e9 +parent 1922163c8dfe717c089bdcc18ade4a65350a09c8 +author Daniel Ritz Thu, 05 May 2005 16:15:44 -0700 +committer Linus Torvalds Thu, 05 May 2005 16:36:40 -0700 + + drivers/net/3c59x.c | 9 ++++++--- + 1 files changed, 6 insertions(+), 3 deletions(-) + +Index: drivers/net/3c59x.c +=================================================================== +--- be95a8f0df16e71f41dce26e8e530a900a4173a2/drivers/net/3c59x.c (mode:100644) ++++ 1e958eebf19fb59b67e51d6bb51303fbee2b84e9/drivers/net/3c59x.c (mode:100644) +@@ -1581,7 +1581,8 @@ + + if (VORTEX_PCI(vp)) { + pci_set_power_state(VORTEX_PCI(vp), PCI_D0); /* Go active */ +- pci_restore_state(VORTEX_PCI(vp)); ++ if (vp->pm_state_valid) ++ pci_restore_state(VORTEX_PCI(vp)); + pci_enable_device(VORTEX_PCI(vp)); + } + +@@ -2741,6 +2742,7 @@ + outl(0, ioaddr + DownListPtr); + + if (final_down && VORTEX_PCI(vp)) { ++ vp->pm_state_valid = 1; + pci_save_state(VORTEX_PCI(vp)); + acpi_set_WOL(dev); + } +@@ -3243,9 +3245,10 @@ + outw(RxEnable, ioaddr + EL3_CMD); + + pci_enable_wake(VORTEX_PCI(vp), 0, 1); ++ ++ /* Change the power state to D3; RxEnable doesn't take effect. */ ++ pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); + } +- /* Change the power state to D3; RxEnable doesn't take effect. */ +- pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); + } + + diff --git a/queue/fix-lpar-iommu-on-p630.patch b/queue/fix-lpar-iommu-on-p630.patch new file mode 100644 index 00000000000..bdbb9e16738 --- /dev/null +++ b/queue/fix-lpar-iommu-on-p630.patch @@ -0,0 +1,102 @@ +From foo@baz Tue Apr 9 12:12:43 2002 +To: Greg KH +Date: 28 Mar 2005 19:27:06 -08:00 +From: olof@austin.ibm.com +Cc: dsd@gentoo.org +Subject: [PATCH] PPC64: Fix LPAR IOMMU setup code for p630 + +Here's a fix to deal with p630 systems in LPAR mode. They're to date the +only system that in some cases might lack a dma-window property for the +bus, but contain an overriding property in the device node for the specific +adapter/slot. This makes the device setup code a bit more complex since it +needs to do some of the things that the bus setup code has already done. + +Signed-off-by: Olof Johansson +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds + +diff -Nru a/arch/ppc64/kernel/pSeries_iommu.c b/arch/ppc64/kernel/pSeries_iommu.c +--- a/arch/ppc64/kernel/pSeries_iommu.c 2005-05-12 09:31:21 -07:00 ++++ b/arch/ppc64/kernel/pSeries_iommu.c 2005-05-12 09:31:21 -07:00 +@@ -402,6 +402,8 @@ + struct device_node *dn, *pdn; + unsigned int *dma_window = NULL; + ++ DBG("iommu_bus_setup_pSeriesLP, bus %p, bus->self %p\n", bus, bus->self); ++ + dn = pci_bus_to_OF_node(bus); + + /* Find nearest ibm,dma-window, walking up the device tree */ +@@ -478,6 +480,56 @@ + .notifier_call = iommu_reconfig_notifier, + }; + ++static void iommu_dev_setup_pSeriesLP(struct pci_dev *dev) ++{ ++ struct device_node *pdn, *dn; ++ struct iommu_table *tbl; ++ int *dma_window = NULL; ++ ++ DBG("iommu_dev_setup_pSeriesLP, dev %p (%s)\n", dev, dev->pretty_name); ++ ++ /* dev setup for LPAR is a little tricky, since the device tree might ++ * contain the dma-window properties per-device and not neccesarily ++ * for the bus. So we need to search upwards in the tree until we ++ * either hit a dma-window property, OR find a parent with a table ++ * already allocated. ++ */ ++ dn = pci_device_to_OF_node(dev); ++ ++ for (pdn = dn; pdn && !pdn->iommu_table; pdn = pdn->parent) { ++ dma_window = (unsigned int *)get_property(pdn, "ibm,dma-window", NULL); ++ if (dma_window) ++ break; ++ } ++ ++ /* Check for parent == NULL so we don't try to setup the empty EADS ++ * slots on POWER4 machines. ++ */ ++ if (dma_window == NULL || pdn->parent == NULL) { ++ /* Fall back to regular (non-LPAR) dev setup */ ++ DBG("No dma window for device, falling back to regular setup\n"); ++ iommu_dev_setup_pSeries(dev); ++ return; ++ } else { ++ DBG("Found DMA window, allocating table\n"); ++ } ++ ++ if (!pdn->iommu_table) { ++ /* iommu_table_setparms_lpar needs bussubno. */ ++ pdn->bussubno = pdn->phb->bus->number; ++ ++ tbl = (struct iommu_table *)kmalloc(sizeof(struct iommu_table), ++ GFP_KERNEL); ++ ++ iommu_table_setparms_lpar(pdn->phb, pdn, tbl, dma_window); ++ ++ pdn->iommu_table = iommu_init_table(tbl); ++ } ++ ++ if (pdn != dn) ++ dn->iommu_table = pdn->iommu_table; ++} ++ + static void iommu_bus_setup_null(struct pci_bus *b) { } + static void iommu_dev_setup_null(struct pci_dev *d) { } + +@@ -502,13 +554,14 @@ + ppc_md.tce_free = tce_free_pSeriesLP; + } + ppc_md.iommu_bus_setup = iommu_bus_setup_pSeriesLP; ++ ppc_md.iommu_dev_setup = iommu_dev_setup_pSeriesLP; + } else { + ppc_md.tce_build = tce_build_pSeries; + ppc_md.tce_free = tce_free_pSeries; + ppc_md.iommu_bus_setup = iommu_bus_setup_pSeries; ++ ppc_md.iommu_dev_setup = iommu_dev_setup_pSeries; + } + +- ppc_md.iommu_dev_setup = iommu_dev_setup_pSeries; + + pSeries_reconfig_notifier_register(&iommu_reconfig_nb); + diff --git a/queue/fix-matroxfb-on-big-endian.patch b/queue/fix-matroxfb-on-big-endian.patch new file mode 100644 index 00000000000..85c654a17e2 --- /dev/null +++ b/queue/fix-matroxfb-on-big-endian.patch @@ -0,0 +1,74 @@ +From foo@baz Tue Apr 9 12:12:43 2002 +To: Greg KH +Date: 31 Mar 2005 08:48:52 -08:00 +From: vandrove@vc.cvut.cz +Cc: dsd@gentoo.org +Subject: [PATCH] Fix matroxfb on big-endian hardware + +There was too much/too few byteswapping done by driver and hardware in +matroxfb on big endian hardware. Change fixes mirrored/split/corrupted +letters seen on screen when using accelerated matroxfb mode. + +Patch was tested on Mips (by Peter) and x86-64 (by Petr). + +Signed-off-by: Peter 'p2' De Schrijver +Signed-off-by: Petr Vandrovec +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds + +diff -Nru a/drivers/video/matrox/matroxfb_accel.c b/drivers/video/matrox/matroxfb_accel.c +--- a/drivers/video/matrox/matroxfb_accel.c 2005-05-12 09:26:38 -07:00 ++++ b/drivers/video/matrox/matroxfb_accel.c 2005-05-12 09:26:38 -07:00 +@@ -438,13 +438,21 @@ + } else if (step == 1) { + /* Special case for 1..8bit widths */ + while (height--) { +- mga_writel(mmio, 0, *chardata); ++#if defined(__BIG_ENDIAN) ++ fb_writel((*chardata) << 24, mmio.vaddr); ++#else ++ fb_writel(*chardata, mmio.vaddr); ++#endif + chardata++; + } + } else if (step == 2) { + /* Special case for 9..15bit widths */ + while (height--) { +- mga_writel(mmio, 0, *(u_int16_t*)chardata); ++#if defined(__BIG_ENDIAN) ++ fb_writel((*(u_int16_t*)chardata) << 16, mmio.vaddr); ++#else ++ fb_writel(*(u_int16_t*)chardata, mmio.vaddr); ++#endif + chardata += 2; + } + } else { +@@ -454,7 +462,7 @@ + + for (i = 0; i < step; i += 4) { + /* Hope that there are at least three readable bytes beyond the end of bitmap */ +- mga_writel(mmio, 0, get_unaligned((u_int32_t*)(chardata + i))); ++ fb_writel(get_unaligned((u_int32_t*)(chardata + i)),mmio.vaddr); + } + chardata += step; + } +diff -Nru a/drivers/video/matrox/matroxfb_base.h b/drivers/video/matrox/matroxfb_base.h +--- a/drivers/video/matrox/matroxfb_base.h 2005-05-12 09:26:38 -07:00 ++++ b/drivers/video/matrox/matroxfb_base.h 2005-05-12 09:26:38 -07:00 +@@ -170,14 +170,14 @@ + + if ((unsigned long)src & 3) { + while (len >= 4) { +- writel(get_unaligned((u32 *)src), addr); ++ fb_writel(get_unaligned((u32 *)src), addr); + addr++; + len -= 4; + src += 4; + } + } else { + while (len >= 4) { +- writel(*(u32 *)src, addr); ++ fb_writel(*(u32 *)src, addr); + addr++; + len -= 4; + src += 4; diff --git a/queue/ide-dma-fix.patch b/queue/ide-dma-fix.patch new file mode 100644 index 00000000000..95b13973f48 --- /dev/null +++ b/queue/ide-dma-fix.patch @@ -0,0 +1,40 @@ +From stable-bounces@linux.kernel.org Thu May 12 04:34:43 2005 +Date: Thu, 12 May 2005 12:31:27 +0100 +From: Daniel Drake +To: stable@kernel.org +Cc: +Subject: [stable] [PATCH] ide-disk: Fix LBA8 DMA + +This is from Gentoo's 2.6.11 patchset. A problem was introduced in 2.6.10 +where some users could not enable DMA on their disks (particularly ALi15x3 +users). This was a small mistake with the no_lba48_dma flag. + +I can't find the exact commit but this is definately included in 2.6.12-rc4. + + +From: Bartlomiej Zolnierkiewicz +Signed-off-by: Greg Kroah-Hartman + + +diff -urNpX dontdiff linux-2.6.11-gentoo-r8/drivers/ide/ide-disk.c linux-dsd/drivers/ide/ide-disk.c +--- linux-2.6.11-gentoo-r8/drivers/ide/ide-disk.c 2005-03-02 07:38:07.000000000 +0000 ++++ linux-dsd/drivers/ide/ide-disk.c 2005-05-09 01:29:49.000000000 +0100 +@@ -133,6 +133,8 @@ static ide_startstop_t __ide_do_rw_disk( + if (hwif->no_lba48_dma && lba48 && dma) { + if (block + rq->nr_sectors > 1ULL << 28) + dma = 0; ++ else ++ lba48 = 0; + } + + if (!dma) { +@@ -146,7 +148,7 @@ static ide_startstop_t __ide_do_rw_disk( + /* FIXME: SELECT_MASK(drive, 0) ? */ + + if (drive->select.b.lba) { +- if (drive->addressing == 1) { ++ if (lba48) { + task_ioreg_t tasklets[10]; + + pr_debug("%s: LBA=0x%012llx\n", drive->name, block); + diff --git a/queue/rose-minor-security-fix.patch b/queue/rose-minor-security-fix.patch new file mode 100644 index 00000000000..8d0ac1640fb --- /dev/null +++ b/queue/rose-minor-security-fix.patch @@ -0,0 +1,26 @@ +From foo@baz Tue Apr 9 12:12:43 2002 +To: Greg KH +Date: 10 Mar 2005 19:47:08 -08:00 +From: ralf@linux-mips.org +Cc: dsd@gentoo.org, davem@davemloft.net +Subject: [ROSE]: Fix minor security hole + +ROSE wasn't verifying the ndigis argument of a new route resulting in a +minor security hole. + +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +diff -Nru a/net/rose/rose_route.c b/net/rose/rose_route.c +--- a/net/rose/rose_route.c 2005-05-12 09:20:45 -07:00 ++++ b/net/rose/rose_route.c 2005-05-12 09:20:45 -07:00 +@@ -727,7 +727,8 @@ + } + if (rose_route.mask > 10) /* Mask can't be more than 10 digits */ + return -EINVAL; +- ++ if (rose_route.ndigis > 8) /* No more than 8 digipeats */ ++ return -EINVAL; + err = rose_add_node(&rose_route, dev); + dev_put(dev); + return err; -- 2.47.3