]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
.25 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Aug 2008 18:03:32 +0000 (11:03 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 18 Aug 2008 18:03:32 +0000 (11:03 -0700)
queue-2.6.25/qla2xxx-add-dev_loss_tmo_callbk-terminate_rport_io-callback-support.patch [new file with mode: 0644]
queue-2.6.25/qla2xxx-set-an-rport-s-dev_loss_tmo-value-in-a-consistent-manner.patch [new file with mode: 0644]
queue-2.6.25/series
queue-2.6.25/x86-fix-setup-code-crashes-on-my-old-486-box.patch [new file with mode: 0644]
queue-2.6.25/x86-fix-spin_is_contended.patch [new file with mode: 0644]

diff --git a/queue-2.6.25/qla2xxx-add-dev_loss_tmo_callbk-terminate_rport_io-callback-support.patch b/queue-2.6.25/qla2xxx-add-dev_loss_tmo_callbk-terminate_rport_io-callback-support.patch
new file mode 100644 (file)
index 0000000..f1a37c8
--- /dev/null
@@ -0,0 +1,249 @@
+From andrew.vasquez@qlogic.com  Mon Aug 18 10:33:06 2008
+From: Seokmann Ju <seokmann.ju@qlogic.com>
+Date: Thu, 14 Aug 2008 09:37:34 -0700
+Subject: qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
+To: stable@kernel.org
+Message-ID: <20080814163734.GC75223@plap4-2.qlogic.org>
+
+From: Seokmann Ju <seokmann.ju@qlogic.com>
+
+[ Upstream commit 5f3a9a207f1fccde476dd31b4c63ead2967d934f ]
+
+Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
+Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
+Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/qla2xxx/qla_attr.c |   31 +++++++++++++++++++++++
+ drivers/scsi/qla2xxx/qla_def.h  |    1 
+ drivers/scsi/qla2xxx/qla_gbl.h  |    2 +
+ drivers/scsi/qla2xxx/qla_init.c |   16 +++---------
+ drivers/scsi/qla2xxx/qla_os.c   |   53 ++++++++++++++++++++++++++++++----------
+ 5 files changed, 78 insertions(+), 25 deletions(-)
+
+--- a/drivers/scsi/qla2xxx/qla_attr.c
++++ b/drivers/scsi/qla2xxx/qla_attr.c
+@@ -969,6 +969,33 @@ qla2x00_set_rport_loss_tmo(struct fc_rpo
+       rport->dev_loss_tmo = ha->port_down_retry_count + 5;
+ }
++static void
++qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
++{
++      struct Scsi_Host *host = rport_to_shost(rport);
++      fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
++
++      qla2x00_abort_fcport_cmds(fcport);
++
++      /*
++       * Transport has effectively 'deleted' the rport, clear
++       * all local references.
++       */
++      spin_lock_irq(host->host_lock);
++      fcport->rport = NULL;
++      *((fc_port_t **)rport->dd_data) = NULL;
++      spin_unlock_irq(host->host_lock);
++}
++
++static void
++qla2x00_terminate_rport_io(struct fc_rport *rport)
++{
++      fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
++
++      qla2x00_abort_fcport_cmds(fcport);
++      scsi_target_unblock(&rport->dev);
++}
++
+ static int
+ qla2x00_issue_lip(struct Scsi_Host *shost)
+ {
+@@ -1227,6 +1254,8 @@ struct fc_function_template qla2xxx_tran
+       .show_rport_dev_loss_tmo = 1,
+       .issue_fc_host_lip = qla2x00_issue_lip,
++      .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk,
++      .terminate_rport_io = qla2x00_terminate_rport_io,
+       .get_fc_host_stats = qla2x00_get_fc_host_stats,
+       .vport_create = qla24xx_vport_create,
+@@ -1270,6 +1299,8 @@ struct fc_function_template qla2xxx_tran
+       .show_rport_dev_loss_tmo = 1,
+       .issue_fc_host_lip = qla2x00_issue_lip,
++      .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk,
++      .terminate_rport_io = qla2x00_terminate_rport_io,
+       .get_fc_host_stats = qla2x00_get_fc_host_stats,
+ };
+--- a/drivers/scsi/qla2xxx/qla_def.h
++++ b/drivers/scsi/qla2xxx/qla_def.h
+@@ -1548,7 +1548,6 @@ typedef struct fc_port {
+       int login_retry;
+       atomic_t port_down_timer;
+-      spinlock_t rport_lock;
+       struct fc_rport *rport, *drport;
+       u32 supported_classes;
+--- a/drivers/scsi/qla2xxx/qla_gbl.h
++++ b/drivers/scsi/qla2xxx/qla_gbl.h
+@@ -68,6 +68,8 @@ extern int num_hosts;
+ extern int qla2x00_loop_reset(scsi_qla_host_t *);
+ extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
++extern void qla2x00_abort_fcport_cmds(fc_port_t *);
++
+ /*
+  * Global Functions in qla_mid.c source file.
+  */
+--- a/drivers/scsi/qla2xxx/qla_init.c
++++ b/drivers/scsi/qla2xxx/qla_init.c
+@@ -1827,12 +1827,11 @@ qla2x00_rport_del(void *data)
+ {
+       fc_port_t *fcport = data;
+       struct fc_rport *rport;
+-      unsigned long flags;
+-      spin_lock_irqsave(&fcport->rport_lock, flags);
++      spin_lock_irq(fcport->ha->host->host_lock);
+       rport = fcport->drport;
+       fcport->drport = NULL;
+-      spin_unlock_irqrestore(&fcport->rport_lock, flags);
++      spin_unlock_irq(fcport->ha->host->host_lock);
+       if (rport)
+               fc_remote_port_delete(rport);
+ }
+@@ -1861,7 +1860,6 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha
+       atomic_set(&fcport->state, FCS_UNCONFIGURED);
+       fcport->flags = FCF_RLC_SUPPORT;
+       fcport->supported_classes = FC_COS_UNSPECIFIED;
+-      spin_lock_init(&fcport->rport_lock);
+       return fcport;
+ }
+@@ -2220,28 +2218,24 @@ qla2x00_reg_remote_port(scsi_qla_host_t 
+ {
+       struct fc_rport_identifiers rport_ids;
+       struct fc_rport *rport;
+-      unsigned long flags;
+       if (fcport->drport)
+               qla2x00_rport_del(fcport);
+-      if (fcport->rport)
+-              return;
+       rport_ids.node_name = wwn_to_u64(fcport->node_name);
+       rport_ids.port_name = wwn_to_u64(fcport->port_name);
+       rport_ids.port_id = fcport->d_id.b.domain << 16 |
+           fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
+       rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
+-      rport = fc_remote_port_add(ha->host, 0, &rport_ids);
++      fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids);
+       if (!rport) {
+               qla_printk(KERN_WARNING, ha,
+                   "Unable to allocate fc remote port!\n");
+               return;
+       }
+-      spin_lock_irqsave(&fcport->rport_lock, flags);
+-      fcport->rport = rport;
++      spin_lock_irq(fcport->ha->host->host_lock);
+       *((fc_port_t **)rport->dd_data) = fcport;
+-      spin_unlock_irqrestore(&fcport->rport_lock, flags);
++      spin_unlock_irq(fcport->ha->host->host_lock);
+       rport->supported_classes = fcport->supported_classes;
+--- a/drivers/scsi/qla2xxx/qla_os.c
++++ b/drivers/scsi/qla2xxx/qla_os.c
+@@ -386,7 +386,7 @@ qla2x00_queuecommand(struct scsi_cmnd *c
+       }
+       /* Close window on fcport/rport state-transitioning. */
+-      if (!*(fc_port_t **)rport->dd_data) {
++      if (fcport->drport) {
+               cmd->result = DID_IMM_RETRY << 16;
+               goto qc_fail_command;
+       }
+@@ -453,7 +453,7 @@ qla24xx_queuecommand(struct scsi_cmnd *c
+       }
+       /* Close window on fcport/rport state-transitioning. */
+-      if (!*(fc_port_t **)rport->dd_data) {
++      if (fcport->drport) {
+               cmd->result = DID_IMM_RETRY << 16;
+               goto qc24_fail_command;
+       }
+@@ -617,6 +617,40 @@ qla2x00_wait_for_loop_ready(scsi_qla_hos
+       return (return_status);
+ }
++void
++qla2x00_abort_fcport_cmds(fc_port_t *fcport)
++{
++      int cnt;
++      unsigned long flags;
++      srb_t *sp;
++      scsi_qla_host_t *ha = fcport->ha;
++      scsi_qla_host_t *pha = to_qla_parent(ha);
++
++      spin_lock_irqsave(&pha->hardware_lock, flags);
++      for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
++              sp = pha->outstanding_cmds[cnt];
++              if (!sp)
++                      continue;
++              if (sp->fcport != fcport)
++                      continue;
++
++              spin_unlock_irqrestore(&pha->hardware_lock, flags);
++              if (ha->isp_ops->abort_command(ha, sp)) {
++                      DEBUG2(qla_printk(KERN_WARNING, ha,
++                          "Abort failed --  %lx\n", sp->cmd->serial_number));
++              } else {
++                      if (qla2x00_eh_wait_on_command(ha, sp->cmd) !=
++                          QLA_SUCCESS)
++                              DEBUG2(qla_printk(KERN_WARNING, ha,
++                                  "Abort failed while waiting --  %lx\n",
++                                  sp->cmd->serial_number));
++
++              }
++              spin_lock_irqsave(&pha->hardware_lock, flags);
++      }
++      spin_unlock_irqrestore(&pha->hardware_lock, flags);
++}
++
+ static void
+ qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
+ {
+@@ -1883,7 +1917,6 @@ static inline void
+ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
+     int defer)
+ {
+-      unsigned long flags;
+       struct fc_rport *rport;
+       if (!fcport->rport)
+@@ -1891,19 +1924,13 @@ qla2x00_schedule_rport_del(struct scsi_q
+       rport = fcport->rport;
+       if (defer) {
+-              spin_lock_irqsave(&fcport->rport_lock, flags);
++              spin_lock_irq(ha->host->host_lock);
+               fcport->drport = rport;
+-              fcport->rport = NULL;
+-              *(fc_port_t **)rport->dd_data = NULL;
+-              spin_unlock_irqrestore(&fcport->rport_lock, flags);
++              spin_unlock_irq(ha->host->host_lock);
+               set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
+-      } else {
+-              spin_lock_irqsave(&fcport->rport_lock, flags);
+-              fcport->rport = NULL;
+-              *(fc_port_t **)rport->dd_data = NULL;
+-              spin_unlock_irqrestore(&fcport->rport_lock, flags);
++              qla2xxx_wake_dpc(ha);
++      } else
+               fc_remote_port_delete(rport);
+-      }
+ }
+ /*
diff --git a/queue-2.6.25/qla2xxx-set-an-rport-s-dev_loss_tmo-value-in-a-consistent-manner.patch b/queue-2.6.25/qla2xxx-set-an-rport-s-dev_loss_tmo-value-in-a-consistent-manner.patch
new file mode 100644 (file)
index 0000000..0f3be79
--- /dev/null
@@ -0,0 +1,83 @@
+From andrew.vasquez@qlogic.com  Mon Aug 18 10:34:07 2008
+From: Andrew Vasquez <andrew.vasquez@qlogic.com>
+Date: Thu, 14 Aug 2008 09:39:35 -0700
+Subject: qla2xxx: Set an rport's dev_loss_tmo value in a consistent manner.
+To: stable@kernel.org
+Message-ID: <20080814163935.GD75223@plap4-2.qlogic.org>
+
+From: Andrew Vasquez <andrew.vasquez@qlogic.com>
+
+[ Upstream commit 85821c906cf3563a00a3d98fa380a2581a7a5ff1 ]
+
+As there's no point in adding a fixed-fudge value (originally 5
+seconds), honor the user settings only.  We also remove the
+driver's dead-callback get_rport_dev_loss_tmo function
+(qla2x00_get_rport_loss_tmo()).
+
+Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
+Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/scsi/qla2xxx/qla_attr.c |   20 ++------------------
+ drivers/scsi/qla2xxx/qla_os.c   |    2 +-
+ 2 files changed, 3 insertions(+), 19 deletions(-)
+
+--- a/drivers/scsi/qla2xxx/qla_attr.c
++++ b/drivers/scsi/qla2xxx/qla_attr.c
+@@ -947,26 +947,12 @@ qla2x00_get_starget_port_id(struct scsi_
+ }
+ static void
+-qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
+-{
+-      struct Scsi_Host *host = rport_to_shost(rport);
+-      scsi_qla_host_t *ha = shost_priv(host);
+-
+-      rport->dev_loss_tmo = ha->port_down_retry_count + 5;
+-}
+-
+-static void
+ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
+ {
+-      struct Scsi_Host *host = rport_to_shost(rport);
+-      scsi_qla_host_t *ha = shost_priv(host);
+-
+       if (timeout)
+-              ha->port_down_retry_count = timeout;
++              rport->dev_loss_tmo = timeout;
+       else
+-              ha->port_down_retry_count = 1;
+-
+-      rport->dev_loss_tmo = ha->port_down_retry_count + 5;
++              rport->dev_loss_tmo = 1;
+ }
+ static void
+@@ -1249,7 +1235,6 @@ struct fc_function_template qla2xxx_tran
+       .get_starget_port_id  = qla2x00_get_starget_port_id,
+       .show_starget_port_id = 1,
+-      .get_rport_dev_loss_tmo = qla2x00_get_rport_loss_tmo,
+       .set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo,
+       .show_rport_dev_loss_tmo = 1,
+@@ -1294,7 +1279,6 @@ struct fc_function_template qla2xxx_tran
+       .get_starget_port_id  = qla2x00_get_starget_port_id,
+       .show_starget_port_id = 1,
+-      .get_rport_dev_loss_tmo = qla2x00_get_rport_loss_tmo,
+       .set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo,
+       .show_rport_dev_loss_tmo = 1,
+--- a/drivers/scsi/qla2xxx/qla_os.c
++++ b/drivers/scsi/qla2xxx/qla_os.c
+@@ -1194,7 +1194,7 @@ qla2xxx_slave_configure(struct scsi_devi
+       else
+               scsi_deactivate_tcq(sdev, ha->max_q_depth);
+-      rport->dev_loss_tmo = ha->port_down_retry_count + 5;
++      rport->dev_loss_tmo = ha->port_down_retry_count;
+       return 0;
+ }
index dfb25b922258300780eef958611edfea596aaef7..fee3f58bb3f84318a4f10c4e9a97fa267dcce826 100644 (file)
@@ -43,3 +43,7 @@ r8169-avoid-thrashing-pci-conf-space-above-rtl_giga_mac_ver_06.patch
 netfilter-nf_nat_snmp_basic-fix-a-range-check-in-nat-for-snmp.patch
 i2c-fix-null-pointer-dereference-in-i2c_new_probed_device.patch
 cifs-fix-compiler-warning-on-64-bit.patch
+x86-fix-spin_is_contended.patch
+x86-fix-setup-code-crashes-on-my-old-486-box.patch
+qla2xxx-add-dev_loss_tmo_callbk-terminate_rport_io-callback-support.patch
+qla2xxx-set-an-rport-s-dev_loss_tmo-value-in-a-consistent-manner.patch
diff --git a/queue-2.6.25/x86-fix-setup-code-crashes-on-my-old-486-box.patch b/queue-2.6.25/x86-fix-setup-code-crashes-on-my-old-486-box.patch
new file mode 100644 (file)
index 0000000..e21f135
--- /dev/null
@@ -0,0 +1,101 @@
+From jejb@kernel.org  Mon Aug 18 10:27:40 2008
+From: Joerg Roedel <joro@8bytes.org>
+Date: Sun, 17 Aug 2008 00:25:07 GMT
+Subject: x86: fix setup code crashes on my old 486 box
+To: jejb@kernel.org, stable@kernel.org
+Message-ID: <200808170025.m7H0P7Ho026184@hera.kernel.org>
+
+From: Joerg Roedel <joro@8bytes.org>
+
+commit 7b27718bdb1b70166383dec91391df5534d449ee upstream
+
+yesterday I tried to reactivate my old 486 box and wanted to install a
+current Linux with latest kernel on it. But it turned out that the
+latest kernel does not boot because the machine crashes early in the
+setup code.
+
+After some debugging it turned out that the problem is the query_ist()
+function. If this interrupt with that function is called the machine
+simply locks up. It looks like a BIOS bug. Looking for a workaround for
+this problem I wrote the attached patch. It checks for the CPUID
+instruction and if it is not implemented it does not call the speedstep
+BIOS function. As far as I know speedstep should be available since some
+Pentium earliest.
+
+Alan Cox observed that it's available since the Pentium II, so cpuid
+levels 4 and 5 can be excluded altogether.
+
+H. Peter Anvin cleaned up the code some more:
+
+> Right in concept, but I dislike the implementation (duplication of the
+> CPU detect code we already have).  Could you try this patch and see if
+> it works for you?
+
+which, with a small modification to fix a build error with it the
+resulting kernel boots on my machine.
+
+Signed-off-by: Joerg Roedel <joro@8bytes.org>
+Signed-off-by: "H. Peter Anvin" <hpa@zytor.com>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/boot/boot.h     |    8 ++++++++
+ arch/x86/boot/cpucheck.c |    8 +-------
+ arch/x86/boot/main.c     |    4 ++++
+ 3 files changed, 13 insertions(+), 7 deletions(-)
+
+--- a/arch/x86/boot/boot.h
++++ b/arch/x86/boot/boot.h
+@@ -27,6 +27,8 @@
+ #include <asm/boot.h>
+ #include <asm/setup.h>
++#define NCAPINTS   8
++
+ /* Useful macros */
+ #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
+@@ -244,6 +246,12 @@ int cmdline_find_option(const char *opti
+ int cmdline_find_option_bool(const char *option);
+ /* cpu.c, cpucheck.c */
++struct cpu_features {
++      int level;              /* Family, or 64 for x86-64 */
++      int model;
++      u32 flags[NCAPINTS];
++};
++extern struct cpu_features cpu;
+ int check_cpu(int *cpu_level_ptr, int *req_level_ptr, u32 **err_flags_ptr);
+ int validate_cpu(void);
+--- a/arch/x86/boot/cpucheck.c
++++ b/arch/x86/boot/cpucheck.c
+@@ -32,13 +32,7 @@
+ #include <asm/required-features.h>
+ #include <asm/msr-index.h>
+-struct cpu_features {
+-      int level;              /* Family, or 64 for x86-64 */
+-      int model;
+-      u32 flags[NCAPINTS];
+-};
+-
+-static struct cpu_features cpu;
++struct cpu_features cpu;
+ static u32 cpu_vendor[3];
+ static u32 err_flags[NCAPINTS];
+--- a/arch/x86/boot/main.c
++++ b/arch/x86/boot/main.c
+@@ -75,6 +75,10 @@ static void keyboard_set_repeat(void)
+  */
+ static void query_ist(void)
+ {
++      /* Some 486 BIOSes apparently crash on this call */
++      if (cpu.level < 6)
++              return;
++
+       asm("int $0x15"
+           : "=a" (boot_params.ist_info.signature),
+             "=b" (boot_params.ist_info.command),
diff --git a/queue-2.6.25/x86-fix-spin_is_contended.patch b/queue-2.6.25/x86-fix-spin_is_contended.patch
new file mode 100644 (file)
index 0000000..9633099
--- /dev/null
@@ -0,0 +1,43 @@
+From jejb@kernel.org  Mon Aug 18 10:26:52 2008
+From: Jan Beulich <jbeulich@novell.com>
+Date: Sun, 17 Aug 2008 00:25:05 GMT
+Subject: x86: fix spin_is_contended()
+To: jejb@kernel.org, stable@kernel.org
+Message-ID: <200808170025.m7H0P5Gq026121@hera.kernel.org>
+
+From: Jan Beulich <jbeulich@novell.com>
+
+commit 7bc069c6bc4ede519a7116be1b9e149a1dbf787a upstream
+
+The masked difference is what needs to be compared against 1, rather
+than the difference of masked values (which can be negative).
+
+Signed-off-by: Jan Beulich <jbeulich@novell.com>
+Acked-by: Nick Piggin <npiggin@suse.de>
+Signed-off-by: Ingo Molnar <mingo@elte.hu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ include/asm-x86/spinlock.h |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/include/asm-x86/spinlock.h
++++ b/include/asm-x86/spinlock.h
+@@ -75,7 +75,7 @@ static inline int __raw_spin_is_contende
+ {
+       int tmp = *(volatile signed int *)(&(lock)->slock);
+-      return (((tmp >> 8) & 0xff) - (tmp & 0xff)) > 1;
++      return (((tmp >> 8) - tmp) & 0xff) > 1;
+ }
+ static inline void __raw_spin_lock(raw_spinlock_t *lock)
+@@ -141,7 +141,7 @@ static inline int __raw_spin_is_contende
+ {
+       int tmp = *(volatile signed int *)(&(lock)->slock);
+-      return (((tmp >> 16) & 0xffff) - (tmp & 0xffff)) > 1;
++      return (((tmp >> 16) - tmp) & 0xffff) > 1;
+ }
+ static inline void __raw_spin_lock(raw_spinlock_t *lock)