]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Add backlog of patches to queue:
authorChris Wright <chrisw@osdl.org>
Sat, 9 Jul 2005 01:45:02 +0000 (18:45 -0700)
committerChris Wright <chrisw@osdl.org>
Sat, 9 Jul 2005 01:45:02 +0000 (18:45 -0700)
queue/ppc32-stop-misusing-ntps-time_offset-value.patch
queue/tpm-init-fixes.patch
queue/acpi-pci-irq-fix-fix.patch
queue/smp-fix-for-6pack.patch
queue/shaper-driver-lock-fix.patch

queue/acpi-pci-irq-fix-fix.patch [new file with mode: 0644]
queue/ppc32-stop-misusing-ntps-time_offset-value.patch [new file with mode: 0644]
queue/series
queue/shaper-driver-lock-fix.patch [new file with mode: 0644]
queue/smp-fix-for-6pack.patch [new file with mode: 0644]
queue/tpm-init-fixes.patch [new file with mode: 0644]

diff --git a/queue/acpi-pci-irq-fix-fix.patch b/queue/acpi-pci-irq-fix-fix.patch
new file mode 100644 (file)
index 0000000..aca84e9
--- /dev/null
@@ -0,0 +1,31 @@
+From stable-bounces@linux.kernel.org  Mon Jul  4 00:29:19 2005
+From: Alexander Nyberg <alexn@telia.com>
+To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
+Date: Mon, 04 Jul 2005 09:28:35 +0200
+Cc: torvalds@osdl.org, stable@kernel.org
+Subject: If ACPI doesn't find an irq listed, don't accept 0 as a valid PCI irq.
+
+If ACPI doesn't find an irq listed, don't accept 0 as a valid PCI irq.
+That zero just means that nothing else found any irq information either.
+
+Fixes http://bugme.osdl.org/show_bug.cgi?id=4824
+
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ drivers/acpi/pci_irq.c |    2 +-
+ 1 files changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux-2.6.12.y/drivers/acpi/pci_irq.c
+===================================================================
+--- linux-2.6.12.y.orig/drivers/acpi/pci_irq.c
++++ linux-2.6.12.y/drivers/acpi/pci_irq.c
+@@ -433,7 +433,7 @@ acpi_pci_irq_enable (
+               printk(KERN_WARNING PREFIX "PCI Interrupt %s[%c]: no GSI",
+                       pci_name(dev), ('A' + pin));
+               /* Interrupt Line values above 0xF are forbidden */
+-              if (dev->irq >= 0 && (dev->irq <= 0xF)) {
++              if (dev->irq > 0 && (dev->irq <= 0xF)) {
+                       printk(" - using IRQ %d\n", dev->irq);
+                       acpi_register_gsi(dev->irq, ACPI_LEVEL_SENSITIVE, ACPI_ACTIVE_LOW);
+                       return_VALUE(0);
diff --git a/queue/ppc32-stop-misusing-ntps-time_offset-value.patch b/queue/ppc32-stop-misusing-ntps-time_offset-value.patch
new file mode 100644 (file)
index 0000000..31046e8
--- /dev/null
@@ -0,0 +1,73 @@
+From stable-bounces@linux.kernel.org  Fri Jul  1 15:24:20 2005
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+To: Greg KH <greg@kroah.com>
+Cc: akpm@osdl.org, johnstul@us.ibm.com, benh@kernel.crashing.org, trini@kernel.crashing.org
+Date: Fri, 01 Jul 2005 15:08:54 +1000
+Subject: [PATCH] ppc32: stop misusing ntps time_offset value
+
+From: john stultz <johnstul@us.ibm.com>
+
+As part of my timeofday rework, I've been looking at the NTP code and I
+noticed that the PPC architecture is apparently misusing the NTP's
+time_offset (it is a terrible name!) value as some form of timezone offset.
+
+This could cause problems when time_offset changed by the NTP code.  This
+patch changes the PPC code so it uses a more clear local variable:
+timezone_offset.
+
+Signed-off-by: John Stultz <johnstul@us.ibm.com>
+Acked-by: Tom Rini <trini@kernel.crashing.org>
+Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Andrew Morton <akpm@osdl.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ arch/ppc/kernel/time.c |   13 ++++++++-----
+ 1 files changed, 8 insertions(+), 5 deletions(-)
+
+Index: linux-2.6.12.y/arch/ppc/kernel/time.c
+===================================================================
+--- linux-2.6.12.y.orig/arch/ppc/kernel/time.c
++++ linux-2.6.12.y/arch/ppc/kernel/time.c
+@@ -89,6 +89,9 @@ unsigned long tb_to_ns_scale;
+ extern unsigned long wall_jiffies;
++/* used for timezone offset */
++static long timezone_offset;
++
+ DEFINE_SPINLOCK(rtc_lock);
+ EXPORT_SYMBOL(rtc_lock);
+@@ -170,7 +173,7 @@ void timer_interrupt(struct pt_regs * re
+                    xtime.tv_sec - last_rtc_update >= 659 &&
+                    abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ &&
+                    jiffies - wall_jiffies == 1) {
+-                      if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0)
++                      if (ppc_md.set_rtc_time(xtime.tv_sec+1 + timezone_offset) == 0)
+                               last_rtc_update = xtime.tv_sec+1;
+                       else
+                               /* Try again one minute later */
+@@ -286,7 +289,7 @@ void __init time_init(void)
+       unsigned old_stamp, stamp, elapsed;
+         if (ppc_md.time_init != NULL)
+-                time_offset = ppc_md.time_init();
++                timezone_offset = ppc_md.time_init();
+       if (__USE_RTC()) {
+               /* 601 processor: dec counts down by 128 every 128ns */
+@@ -331,10 +334,10 @@ void __init time_init(void)
+       set_dec(tb_ticks_per_jiffy);
+       /* If platform provided a timezone (pmac), we correct the time */
+-        if (time_offset) {
+-              sys_tz.tz_minuteswest = -time_offset / 60;
++        if (timezone_offset) {
++              sys_tz.tz_minuteswest = -timezone_offset / 60;
+               sys_tz.tz_dsttime = 0;
+-              xtime.tv_sec -= time_offset;
++              xtime.tv_sec -= timezone_offset;
+         }
+         set_normalized_timespec(&wall_to_monotonic,
+                                 -xtime.tv_sec, -xtime.tv_nsec);
index 6ad77622bec517585a24ce21080daa2f72555ffd..2330176c5c984e1874c9707ea25e6666daa474d6 100644 (file)
@@ -1,3 +1,8 @@
 netfilter-connection-tracking.patch
 unregister_chrdev_region-semaphore-fix.patch
 trivial-v4l-cx88-video-hue-offset-fix.patch
+ppc32-stop-misusing-ntps-time_offset-value.patch
+tpm-init-fixes.patch
+acpi-pci-irq-fix-fix.patch
+smp-fix-for-6pack.patch
+shaper-driver-lock-fix.patch
diff --git a/queue/shaper-driver-lock-fix.patch b/queue/shaper-driver-lock-fix.patch
new file mode 100644 (file)
index 0000000..7382e61
--- /dev/null
@@ -0,0 +1,117 @@
+From stable-bounces@linux.kernel.org  Tue Jul  5 15:21:38 2005
+Date: Tue, 05 Jul 2005 15:07:44 -0700 (PDT)
+To: stable@kernel.org
+From: "David S. Miller" <davem@davemloft.net>
+Subject: [PATCH][SHAPER] fix Shaper driver lossage in 2.6.12
+
+[SHAPER]: Switch to spinlocks.
+
+Dave, you were right and the sleeping locks in shaper were
+broken. Markus Kanet noticed this and also tested the patch below that
+switches locking to spinlocks.
+
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+diff --git a/drivers/net/shaper.c b/drivers/net/shaper.c
+--- a/drivers/net/shaper.c
++++ b/drivers/net/shaper.c
+@@ -135,10 +135,8 @@ static int shaper_start_xmit(struct sk_b
+ {
+       struct shaper *shaper = dev->priv;
+       struct sk_buff *ptr;
+-   
+-      if (down_trylock(&shaper->sem))
+-              return -1;
+-
++  
++      spin_lock(&shaper->lock);
+       ptr=shaper->sendq.prev;
+       
+       /*
+@@ -232,7 +230,7 @@ static int shaper_start_xmit(struct sk_b
+                 shaper->stats.collisions++;
+       }
+       shaper_kick(shaper);
+-      up(&shaper->sem);
++      spin_unlock(&shaper->lock);
+       return 0;
+ }
+@@ -271,11 +269,9 @@ static void shaper_timer(unsigned long d
+ {
+       struct shaper *shaper = (struct shaper *)data;
+-      if (!down_trylock(&shaper->sem)) {
+-              shaper_kick(shaper);
+-              up(&shaper->sem);
+-      } else
+-              mod_timer(&shaper->timer, jiffies);
++      spin_lock(&shaper->lock);
++      shaper_kick(shaper);
++      spin_unlock(&shaper->lock);
+ }
+ /*
+@@ -332,21 +328,6 @@ static void shaper_kick(struct shaper *s
+ /*
+- *    Flush the shaper queues on a closedown
+- */
+- 
+-static void shaper_flush(struct shaper *shaper)
+-{
+-      struct sk_buff *skb;
+-
+-      down(&shaper->sem);
+-      while((skb=skb_dequeue(&shaper->sendq))!=NULL)
+-              dev_kfree_skb(skb);
+-      shaper_kick(shaper);
+-      up(&shaper->sem);
+-}
+-
+-/*
+  *    Bring the interface up. We just disallow this until a 
+  *    bind.
+  */
+@@ -375,7 +356,15 @@ static int shaper_open(struct net_device
+ static int shaper_close(struct net_device *dev)
+ {
+       struct shaper *shaper=dev->priv;
+-      shaper_flush(shaper);
++      struct sk_buff *skb;
++
++      while ((skb = skb_dequeue(&shaper->sendq)) != NULL)
++              dev_kfree_skb(skb);
++
++      spin_lock_bh(&shaper->lock);
++      shaper_kick(shaper);
++      spin_unlock_bh(&shaper->lock);
++
+       del_timer_sync(&shaper->timer);
+       return 0;
+ }
+@@ -576,6 +565,7 @@ static void shaper_init_priv(struct net_
+       init_timer(&sh->timer);
+       sh->timer.function=shaper_timer;
+       sh->timer.data=(unsigned long)sh;
++      spin_lock_init(&sh->lock);
+ }
+ /*
+diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
+--- a/include/linux/if_shaper.h
++++ b/include/linux/if_shaper.h
+@@ -23,7 +23,7 @@ struct shaper
+       __u32 shapeclock;
+       unsigned long recovery; /* Time we can next clock a packet out on
+                                  an empty queue */
+-      struct semaphore sem;
++      spinlock_t lock;
+         struct net_device_stats stats;
+       struct net_device *dev;
+       int  (*hard_start_xmit) (struct sk_buff *skb,
+
diff --git a/queue/smp-fix-for-6pack.patch b/queue/smp-fix-for-6pack.patch
new file mode 100644 (file)
index 0000000..49817dc
--- /dev/null
@@ -0,0 +1,31 @@
+From stable-bounces@linux.kernel.org  Tue Jul  5 01:17:29 2005
+Date: Mon, 4 Jul 2005 18:30:42 +0100
+From: Ralf Baechle <ralf@linux-mips.org>
+To: Jeff Garzik <jgarzik@pobox.com>, stable@kernel.org
+Cc: linux-hams@vger.kernel.org, Marc Schneider <macke@macke.org>
+Subject: [PATCH] SMP fix for 6pack driver
+
+Drivers really only work well in SMP if they actually can be selected.
+This is a leftover from the time when the 6pack drive only used to be
+a bitrotten variant of the slip driver.
+
+Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ drivers/net/hamradio/Kconfig |    2 +-
+ 1 files changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux-2.6.12.y/drivers/net/hamradio/Kconfig
+===================================================================
+--- linux-2.6.12.y.orig/drivers/net/hamradio/Kconfig
++++ linux-2.6.12.y/drivers/net/hamradio/Kconfig
+@@ -17,7 +17,7 @@ config MKISS
+ config 6PACK
+       tristate "Serial port 6PACK driver"
+-      depends on AX25 && BROKEN_ON_SMP
++      depends on AX25
+       ---help---
+         6pack is a transmission protocol for the data exchange between your
+         PC and your TNC (the Terminal Node Controller acts as a kind of
diff --git a/queue/tpm-init-fixes.patch b/queue/tpm-init-fixes.patch
new file mode 100644 (file)
index 0000000..d36b5e8
--- /dev/null
@@ -0,0 +1,232 @@
+From kjhall@us.ibm.com  Wed Jun 29 07:32:39 2005
+Subject: [PATCH] tpm breaks 8139cp
+From: Kylene Jo Hall <kjhall@us.ibm.com>
+To: Pierre Ossman <drzeus-list@drzeus.cx>
+Cc: Chris Wright <chrisw@osdl.org>, Bjorn Helgaas <bjorn.helgaas@hp.com>,
+        LKML <linux-kernel@vger.kernel.org>, jgarzik@pobox.com,
+        tpmdd-devel@lists.sourceforge.net
+Date: Wed, 29 Jun 2005 09:32:28 -0500
+
+A problem was reported that the tpm driver was interfereing with
+networking on the 8139 chipset.  The tpm driver was using a hard coded
+the memory address instead of the value the BIOS was putting the chip
+at.  This was in the tpm_lpc_bus_init function.  That function can be
+replaced with querying the value at Vendor specific locations.  This
+patch replaces all calls to tpm_lpc_bus_init and the hardcoding of the
+base address with a lookup of the address at the correct vendor
+location.
+
+Signed-off-by: Kylene Hall <kjhall@us.ibm.com>
+Signed-off-by: Chris Wright <chrisw@osdl.org>
+---
+
+ drivers/char/tpm/tpm.c       |   76 -------------------------------------------
+ drivers/char/tpm/tpm.h       |    2 -
+ drivers/char/tpm/tpm_atmel.c |   16 +++++----
+ drivers/char/tpm/tpm_nsc.c   |   16 +++++----
+ 4 files changed, 20 insertions(+), 90 deletions(-)
+
+Index: linux-2.6.12.y/drivers/char/tpm/tpm_atmel.c
+===================================================================
+--- linux-2.6.12.y.orig/drivers/char/tpm/tpm_atmel.c
++++ linux-2.6.12.y/drivers/char/tpm/tpm_atmel.c
+@@ -22,7 +22,10 @@
+ #include "tpm.h"
+ /* Atmel definitions */
+-#define       TPM_ATML_BASE                   0x400
++enum tpm_atmel_addr {
++      TPM_ATMEL_BASE_ADDR_LO = 0x08,
++      TPM_ATMEL_BASE_ADDR_HI = 0x09
++};
+ /* write status bits */
+ #define       ATML_STATUS_ABORT               0x01
+@@ -127,7 +130,6 @@ static struct tpm_vendor_specific tpm_at
+       .cancel = tpm_atml_cancel,
+       .req_complete_mask = ATML_STATUS_BUSY | ATML_STATUS_DATA_AVAIL,
+       .req_complete_val = ATML_STATUS_DATA_AVAIL,
+-      .base = TPM_ATML_BASE,
+       .miscdev = { .fops = &atmel_ops, },
+ };
+@@ -136,14 +138,16 @@ static int __devinit tpm_atml_init(struc
+ {
+       u8 version[4];
+       int rc = 0;
++      int lo, hi;
+       if (pci_enable_device(pci_dev))
+               return -EIO;
+-      if (tpm_lpc_bus_init(pci_dev, TPM_ATML_BASE)) {
+-              rc = -ENODEV;
+-              goto out_err;
+-      }
++      lo = tpm_read_index( TPM_ATMEL_BASE_ADDR_LO );
++      hi = tpm_read_index( TPM_ATMEL_BASE_ADDR_HI );
++
++      tpm_atmel.base = (hi<<8)|lo;
++      dev_dbg( &pci_dev->dev, "Operating with base: 0x%x\n", tpm_atmel.base);
+       /* verify that it is an Atmel part */
+       if (tpm_read_index(4) != 'A' || tpm_read_index(5) != 'T'
+Index: linux-2.6.12.y/drivers/char/tpm/tpm.c
+===================================================================
+--- linux-2.6.12.y.orig/drivers/char/tpm/tpm.c
++++ linux-2.6.12.y/drivers/char/tpm/tpm.c
+@@ -32,12 +32,6 @@
+ #define       TPM_BUFSIZE                     2048
+-/* PCI configuration addresses */
+-#define       PCI_GEN_PMCON_1                 0xA0
+-#define       PCI_GEN1_DEC                    0xE4
+-#define       PCI_LPC_EN                      0xE6
+-#define       PCI_GEN2_DEC                    0xEC
+-
+ static LIST_HEAD(tpm_chip_list);
+ static DEFINE_SPINLOCK(driver_lock);
+ static int dev_mask[32];
+@@ -61,72 +55,6 @@ void tpm_time_expired(unsigned long ptr)
+ EXPORT_SYMBOL_GPL(tpm_time_expired);
+ /*
+- * Initialize the LPC bus and enable the TPM ports
+- */
+-int tpm_lpc_bus_init(struct pci_dev *pci_dev, u16 base)
+-{
+-      u32 lpcenable, tmp;
+-      int is_lpcm = 0;
+-
+-      switch (pci_dev->vendor) {
+-      case PCI_VENDOR_ID_INTEL:
+-              switch (pci_dev->device) {
+-              case PCI_DEVICE_ID_INTEL_82801CA_12:
+-              case PCI_DEVICE_ID_INTEL_82801DB_12:
+-                      is_lpcm = 1;
+-                      break;
+-              }
+-              /* init ICH (enable LPC) */
+-              pci_read_config_dword(pci_dev, PCI_GEN1_DEC, &lpcenable);
+-              lpcenable |= 0x20000000;
+-              pci_write_config_dword(pci_dev, PCI_GEN1_DEC, lpcenable);
+-
+-              if (is_lpcm) {
+-                      pci_read_config_dword(pci_dev, PCI_GEN1_DEC,
+-                                            &lpcenable);
+-                      if ((lpcenable & 0x20000000) == 0) {
+-                              dev_err(&pci_dev->dev,
+-                                      "cannot enable LPC\n");
+-                              return -ENODEV;
+-                      }
+-              }
+-
+-              /* initialize TPM registers */
+-              pci_read_config_dword(pci_dev, PCI_GEN2_DEC, &tmp);
+-
+-              if (!is_lpcm)
+-                      tmp = (tmp & 0xFFFF0000) | (base & 0xFFF0);
+-              else
+-                      tmp =
+-                          (tmp & 0xFFFF0000) | (base & 0xFFF0) |
+-                          0x00000001;
+-
+-              pci_write_config_dword(pci_dev, PCI_GEN2_DEC, tmp);
+-
+-              if (is_lpcm) {
+-                      pci_read_config_dword(pci_dev, PCI_GEN_PMCON_1,
+-                                            &tmp);
+-                      tmp |= 0x00000004;      /* enable CLKRUN */
+-                      pci_write_config_dword(pci_dev, PCI_GEN_PMCON_1,
+-                                             tmp);
+-              }
+-              tpm_write_index(0x0D, 0x55);    /* unlock 4F */
+-              tpm_write_index(0x0A, 0x00);    /* int disable */
+-              tpm_write_index(0x08, base);    /* base addr lo */
+-              tpm_write_index(0x09, (base & 0xFF00) >> 8);    /* base addr hi */
+-              tpm_write_index(0x0D, 0xAA);    /* lock 4F */
+-              break;
+-      case PCI_VENDOR_ID_AMD:
+-              /* nothing yet */
+-              break;
+-      }
+-
+-      return 0;
+-}
+-
+-EXPORT_SYMBOL_GPL(tpm_lpc_bus_init);
+-
+-/*
+  * Internal kernel interface to transmit TPM commands
+  */
+ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
+@@ -590,10 +518,6 @@ int tpm_pm_resume(struct pci_dev *pci_de
+       if (chip == NULL)
+               return -ENODEV;
+-      spin_lock(&driver_lock);
+-      tpm_lpc_bus_init(pci_dev, chip->vendor->base);
+-      spin_unlock(&driver_lock);
+-
+       return 0;
+ }
+Index: linux-2.6.12.y/drivers/char/tpm/tpm.h
+===================================================================
+--- linux-2.6.12.y.orig/drivers/char/tpm/tpm.h
++++ linux-2.6.12.y/drivers/char/tpm/tpm.h
+@@ -79,8 +79,6 @@ static inline void tpm_write_index(int i
+ }
+ extern void tpm_time_expired(unsigned long);
+-extern int tpm_lpc_bus_init(struct pci_dev *, u16);
+-
+ extern int tpm_register_hardware(struct pci_dev *,
+                                struct tpm_vendor_specific *);
+ extern int tpm_open(struct inode *, struct file *);
+Index: linux-2.6.12.y/drivers/char/tpm/tpm_nsc.c
+===================================================================
+--- linux-2.6.12.y.orig/drivers/char/tpm/tpm_nsc.c
++++ linux-2.6.12.y/drivers/char/tpm/tpm_nsc.c
+@@ -24,6 +24,10 @@
+ /* National definitions */
+ #define       TPM_NSC_BASE                    0x360
+ #define       TPM_NSC_IRQ                     0x07
++#define       TPM_NSC_BASE0_HI                0x60
++#define       TPM_NSC_BASE0_LO                0x61
++#define       TPM_NSC_BASE1_HI                0x62
++#define       TPM_NSC_BASE1_LO                0x63
+ #define       NSC_LDN_INDEX                   0x07
+ #define       NSC_SID_INDEX                   0x20
+@@ -234,7 +238,6 @@ static struct tpm_vendor_specific tpm_ns
+       .cancel = tpm_nsc_cancel,
+       .req_complete_mask = NSC_STATUS_OBF,
+       .req_complete_val = NSC_STATUS_OBF,
+-      .base = TPM_NSC_BASE,
+       .miscdev = { .fops = &nsc_ops, },
+       
+ };
+@@ -243,15 +246,16 @@ static int __devinit tpm_nsc_init(struct
+                                 const struct pci_device_id *pci_id)
+ {
+       int rc = 0;
++      int lo, hi;
++
++      hi = tpm_read_index(TPM_NSC_BASE0_HI);
++      lo = tpm_read_index(TPM_NSC_BASE0_LO);
++
++      tpm_nsc.base = (hi<<8) | lo;
+       if (pci_enable_device(pci_dev))
+               return -EIO;
+-      if (tpm_lpc_bus_init(pci_dev, TPM_NSC_BASE)) {
+-              rc = -ENODEV;
+-              goto out_err;
+-      }
+-
+       /* verify that it is a National part (SID) */
+       if (tpm_read_index(NSC_SID_INDEX) != 0xEF) {
+               rc = -ENODEV;