sl82c105: rework PIO support (take 2)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e93df705af1992dbf5956a8c80fcb9987bc595c0
Commit: e93df705af1992dbf5956a8c80fcb9987bc595c0
Parent: 62ea6d80211ecc88ef516927ecebf64cb505be3f
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:49 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:49 2007 +0200

sl82c105: rework PIO support (take 2)

Get rid of the 'pio_speed' member of 'ide_drive_t' that was only used by 
this
driver by storing the PIO mode timings in the 'drive_data' instead -- this
allows us to greatly  simplify the process of reloading of the chip's 
timing
register and do it right in sl82c150_dma_off_quietly() and to get rid of two
extra arguments to config_for_pio() -- which got renamed to 
sl82c105_tune_pio()
and now returns a PIO mode selected, with ide_config_drive_speed() call 
moved
into the tuneproc() method, now called sl82c105_tune_drive() with the code 
to
set drive's 'io_32bit' and 'unmask' flags in its turn moved to its proper 
place
in the init_hwif() method.
Also, while at it, rename get_timing_sl82c105() into get_pio_timings() and 
get
rid of the code in it clamping cycle counts to 32 which was both incorrect 
and
never executed anyway...

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/sl82c105.c |   99 ++--
 include/linux/ide.h|1 -
 2 files changed, 41 insertions(+), 59 deletions(-)

diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 3a8a76f..ee6dd45 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -11,6 +11,8 @@
  * Merge in Russell's HW workarounds, fix various problems
  * with the timing registers setup.
  *  -- Benjamin Herrenschmidt (01/11/03) [EMAIL PROTECTED]
+ *
+ * Copyright (C) 2006-2007 MontaVista Software, Inc. [EMAIL PROTECTED]
  */
 
 #include linux/types.h
@@ -47,25 +49,19 @@
 #define CTRL_P0EN   (1  0)
 
 /*
- * Convert a PIO mode and cycle time to the required on/off
- * times for the interface.  This has protection against run-away
- * timings.
+ * Convert a PIO mode and cycle time to the required on/off times
+ * for the interface.  This has protection against runaway timings.
  */
-static unsigned int get_timing_sl82c105(ide_pio_data_t *p)
+static unsigned int get_pio_timings(ide_pio_data_t *p)
 {
-   unsigned int cmd_on;
-   unsigned int cmd_off;
+   unsigned int cmd_on, cmd_off;
 
-   cmd_on = (ide_pio_timings[p-pio_mode].active_time + 29) / 30;
+   cmd_on  = (ide_pio_timings[p-pio_mode].active_time + 29) / 30;
cmd_off = (p-cycle_time - 30 * cmd_on + 29) / 30;
 
-   if (cmd_on  32)
-   cmd_on = 32;
if (cmd_on == 0)
cmd_on = 1;
 
-   if (cmd_off  32)
-   cmd_off = 32;
if (cmd_off == 0)
cmd_off = 1;
 
@@ -73,44 +69,34 @@ static unsigned int get_timing_sl82c105(ide_pio_data_t *p)
 }
 
 /*
- * Configure the drive and chipset for PIO
+ * Configure the chipset for PIO mode.
  */
-static void config_for_pio(ide_drive_t *drive, int pio, int report, int 
chipset_only)
+static u8 sl82c105_tune_pio(ide_drive_t *drive, u8 pio)
 {
-   ide_hwif_t *hwif = HWIF(drive);
-   struct pci_dev *dev = hwif-pci_dev;
+   struct pci_dev *dev = HWIF(drive)-pci_dev;
+   int reg = 0x44 + drive-dn * 4;
ide_pio_data_t p;
-   u16 drv_ctrl = 0x909;
-   unsigned int xfer_mode, reg;
+   u16 drv_ctrl;
 
-   DBG((config_for_pio(drive:%s, pio:%d, report:%d, chipset_only:%d)\n,
-   drive-name, pio, report, chipset_only));
-   
-   reg = (hwif-channel ? 0x4c : 0x44) + (drive-select.b.unit ? 4 : 0);
+   DBG((sl82c105_tune_pio(drive:%s, pio:%u)\n, drive-name, pio));
 
pio = ide_get_best_pio_mode(drive, pio, 5, p);
 
-   xfer_mode = XFER_PIO_0 + pio;
+   drive-drive_data = drv_ctrl = get_pio_timings(p);
 
-   if (chipset_only || ide_config_drive_speed(drive, xfer_mode) == 0) {
-   drv_ctrl = get_timing_sl82c105(p);
-   drive-pio_speed = xfer_mode;
-   } else
-   drive-pio_speed = XFER_PIO_0;
-
-   if (drive-using_dma == 0) {
+   if (!drive-using_dma) {
/*
 * If we are actually using MW DMA, then we can not
 * reprogram the interface drive control register.
 */
-   pci_write_config_word(dev, reg, drv_ctrl);
-   pci_read_config_word(dev, reg, drv_ctrl);
-
-   if (report) {
-   printk(%s: selected %s (%dns) (%04X)\n, drive-name,
-  ide_xfer_verbose(xfer_mode), p.cycle_time, 
drv_ctrl);
-   }
+   

sl82c105: DMA support code cleanup (take 4)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=688a87d145e04f6761c63e7f2e19fd9b3e4ca060
Commit: 688a87d145e04f6761c63e7f2e19fd9b3e4ca060
Parent: e93df705af1992dbf5956a8c80fcb9987bc595c0
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:49 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:49 2007 +0200

sl82c105: DMA support code cleanup (take 4)

Fold the now equivalent code in the ide_dma_check() method into a mere call 
to
ide_use_dma().  Make config_for_dma() return non-zero if DMA mode has been 
set
and call it from the ide_dma_check() method instead of ide_dma_on().
Defer writing the DMA timings to the chip registers until DMA is really 
turned
on (and do not enable IORDY for DMA).
Remove unneeded code from the init_hwif() method, improve its overall looks.
Rename the dma_start(), ide_dma_check(), and ide_dma_lostirq() methods, and
also use more proper hwif-dma_command, fix printk() and comment in the 
latter
one as well.  While at it, cleanup style in several places.

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/sl82c105.c |  148 +--
 1 files changed, 59 insertions(+), 89 deletions(-)

diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index ee6dd45..fe3b4b9 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -100,59 +100,28 @@ static u8 sl82c105_tune_pio(ide_drive_t *drive, u8 pio)
 }
 
 /*
- * Configure the drive and the chipset for DMA
+ * Configure the drive for DMA.
+ * We'll program the chipset only when DMA is actually turned on.
  */
-static int config_for_dma (ide_drive_t *drive)
+static int config_for_dma(ide_drive_t *drive)
 {
-   ide_hwif_t *hwif = HWIF(drive);
-   struct pci_dev *dev = hwif-pci_dev;
-   unsigned int reg;
-
DBG((config_for_dma(drive:%s)\n, drive-name));
 
-   reg = (hwif-channel ? 0x4c : 0x44) + (drive-select.b.unit ? 4 : 0);
-
if (ide_config_drive_speed(drive, XFER_MW_DMA_2) != 0)
-   return 1;
+   return 0;
 
-   pci_write_config_word(dev, reg, 0x0240);
-
-   return 0;
+   return ide_dma_enable(drive);
 }
 
 /*
- * Check to see if the drive and
- * chipset is capable of DMA mode
+ * Check to see if the drive and chipset are capable of DMA mode.
  */
-
-static int sl82c105_check_drive (ide_drive_t *drive)
+static int sl82c105_ide_dma_check(ide_drive_t *drive)
 {
-   ide_hwif_t *hwif= HWIF(drive);
-
-   DBG((sl82c105_check_drive(drive:%s)\n, drive-name));
-
-   do {
-   struct hd_driveid *id = drive-id;
+   DBG((sl82c105_ide_dma_check(drive:%s)\n, drive-name));
 
-   if (!drive-autodma)
-   break;
-
-   if (!id || !(id-capability  1))
-   break;
-
-   /* Consult the list of known bad drives */
-   if (__ide_dma_bad_drive(drive))
-   break;
-
-   if (id-field_valid  2) {
-   if ((id-dma_mword  hwif-mwdma_mask) ||
-   (id-dma_1word  hwif-swdma_mask))
-   return 0;
-   }
-
-   if (__ide_dma_good_drive(drive)  id-eide_dma_time  150)
-   return 0;
-   } while (0);
+   if (ide_use_dma(drive)  config_for_dma(drive))
+   return 0;
 
return -1;
 }
@@ -181,14 +150,14 @@ static inline void sl82c105_reset_host(struct pci_dev 
*dev)
  * This function is called when the IDE timer expires, the drive
  * indicates that it is READY, and we were waiting for DMA to complete.
  */
-static int sl82c105_ide_dma_lost_irq(ide_drive_t *drive)
+static int sl82c105_ide_dma_lostirq(ide_drive_t *drive)
 {
-   ide_hwif_t *hwif = HWIF(drive);
-   struct pci_dev *dev = hwif-pci_dev;
-   u32 val, mask = hwif-channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA;
-   unsigned long dma_base = hwif-dma_base;
+   ide_hwif_t *hwif= HWIF(drive);
+   struct pci_dev *dev = hwif-pci_dev;
+   u32 val, mask   = hwif-channel ? CTRL_IDE_IRQB : CTRL_IDE_IRQA;
+   u8 dma_cmd;
 
-   printk(sl82c105: lost IRQ: resetting host\n);
+   printk(sl82c105: lost IRQ, resetting host\n);
 
/*
 * Check the raw interrupt from the drive.
@@ -201,15 +170,15 @@ static int sl82c105_ide_dma_lost_irq(ide_drive_t *drive)
 * Was DMA enabled?  If so, disable it - we're resetting the
 * host.  The IDE layer will be handling the drive for us.
 */
-   val = inb(dma_base);
-   if (val  1) {
-   outb(val  ~1, dma_base);
+   dma_cmd = inb(hwif-dma_command);
+   if (dma_cmd  1) {
+   outb(dma_cmd  ~1, hwif-dma_command);
 

cmd64x: fix multiword and remove single-word DMA support

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=60e7a82f1acb76af05d81e93ca0f65fdd52c23c2
Commit: 60e7a82f1acb76af05d81e93ca0f65fdd52c23c2
Parent: 688a87d145e04f6761c63e7f2e19fd9b3e4ca060
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:49 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:49 2007 +0200

cmd64x: fix multiword and remove single-word DMA support

Fix the multiword DMA and drop the single-word DMA support (which nobody 
will
miss, I think).  In order to do it, a number of changes was necessary:

- rename program_drive_counts() to program_cycle_times(), pass to it cycle's
  total/active times instead of the clock counts, and convert them into the
  active/recovery clocks there instead of cmd64x_tune_pio() -- this causes
  quantize_timing() to also move;

- contrarywise, move all the code handling the address setup timing into
  cmd64x_tune_pio(), so that setting MWDMA mode wouldn't change address 
setup;

- remove from the speedproc() method the  bogus code pretending to set the 
DMA
  timings by twiddling bits in the BMIDE status register, handle setting 
MWDMA
  by just calling program_cycle_times(); while at it, improve the style of 
that
  whole switch statement;

- stop fiddling with the DMA capable bits in the speedproc() method -- they 
do
  not enable DMA, and are properly dealt with by the dma_host_{on,off} 
methods;

- don't set hwif-swdma_mask in the init_hwif() method anymore.

In addition to those changes, do the following:

- in cmd64x_tune_pio(), when writing to ARTTIM23 register preserve the 
interrupt
  status bit, eliminate local_irq_{save|restore}() around this code as 
there's
  *no* actual race with the interrupt handler, and move cmdprintk() to a 
more
  fitting place -- after ide_get_best_pio_mode() call;

- make {arttim|drwtim}_regs arrays single-dimensional, indexed with 
drive-dn;

- rename {setup|recovery}_counts[] into more fitting 
{setup|recovery}_values[];

- in  the speedproc() method, get rid of the duplicate reads/writes from/to 
the
  UDIDETCRx registers and of the extra variable used to store the transfer 
mode
  value after filtering,  use another method of determining master/slave 
drive,
  and cleanup useless parens;

- beautify cmdprintk() output here and there.

While at it, remove meaningless comment about the driver being used only on
UltraSPARC and long non-relevant RCS tag. :-)

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/cmd64x.c |  248 ++
 1 files changed, 117 insertions(+), 131 deletions(-)

diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 561197f..336d02f 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,10 +1,7 @@
-/* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16
- *
- * linux/drivers/ide/pci/cmd64x.c  Version 1.42Feb 8, 2007
+/*
+ * linux/drivers/ide/pci/cmd64x.c  Version 1.43Mar 10, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
- *   Note, this driver is not used at all on other systems because
- *   there the BIOS has done all of the following already.
  *   Due to massive hardware bugs, UltraDMA is only supported
  *   on the 646U2 and not on the 646U.
  *
@@ -195,116 +192,103 @@ static u8 quantize_timing(int timing, int quant)
 }
 
 /*
- * This routine writes the prepared setup/active/recovery counts
- * for a drive into the cmd646 chipset registers to active them.
+ * This routine calculates active/recovery counts and then writes them into
+ * the chipset registers.
  */
-static void program_drive_counts (ide_drive_t *drive, int setup_count, int 
active_count, int recovery_count)
+static void program_cycle_times (ide_drive_t *drive, int cycle_time, int 
active_time)
 {
-   unsigned long flags;
-   struct pci_dev *dev = HWIF(drive)-pci_dev;
-   ide_drive_t *drives = HWIF(drive)-drives;
-   u8 temp_b;
-   static const u8 setup_counts[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0};
-   static const u8 recovery_counts[] =
+   struct pci_dev *dev = HWIF(drive)-pci_dev;
+   int clock_time  = 1000 / system_bus_clock();
+   u8  cycle_count, active_count, recovery_count, drwtim;
+   static const u8 recovery_values[] =
{15, 15, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 0};
-   static const u8 arttim_regs[2][2] = {
-   { ARTTIM0, ARTTIM1 },
-   { ARTTIM23, ARTTIM23 }
-   };
-   static const u8 drwtim_regs[2][2] = {
-   { DRWTIM0, DRWTIM1 

cmd64x: interrupt status fixes (take 2)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e51e2528d589c13f0e51dfa671c310021d003e21
Commit: e51e2528d589c13f0e51dfa671c310021d003e21
Parent: 60e7a82f1acb76af05d81e93ca0f65fdd52c23c2
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:49 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:49 2007 +0200

cmd64x: interrupt status fixes (take 2)

The driver's ide_dma_test_irq() method was reading the MRDMODE register 
even on
PCI0643/6 where it was write-only -- fix this by always reading the 
backward-
compatible interrupt bits, renaming dma_alt_stat to irq_stat as the 
interrupt
status bits are not coupled to DMA.
In addition, wrong interrupt bit was tested/cleared for the primary channel 
--
it's bit 2 in all the chip specs and the driver used bit 1... :-/

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/cmd64x.c |   24 
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 336d02f..f165bf1 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cmd64x.c  Version 1.43Mar 10, 2007
+ * linux/drivers/ide/pci/cmd64x.c  Version 1.44Mar 12, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *   Due to massive hardware bugs, UltraDMA is only supported
@@ -36,7 +36,7 @@
  * CMD64x specific registers definition.
  */
 #define CFR0x50
-#define   CFR_INTR_CH0 0x02
+#define   CFR_INTR_CH0 0x04
 #define CNTRL  0x51
 #define  CNTRL_DIS_RA0 0x40
 #define   CNTRL_DIS_RA10x80
@@ -488,19 +488,19 @@ static int cmd64x_ide_dma_end (ide_drive_t *drive)
 
 static int cmd64x_ide_dma_test_irq (ide_drive_t *drive)
 {
-   ide_hwif_t *hwif= HWIF(drive);
-   struct pci_dev *dev = hwif-pci_dev;
-u8 dma_alt_stat = 0, mask  = (hwif-channel) ? MRDMODE_INTR_CH1 :
-   MRDMODE_INTR_CH0;
-   u8 dma_stat = inb(hwif-dma_status);
+   ide_hwif_t *hwif= HWIF(drive);
+   struct pci_dev *dev = hwif-pci_dev;
+   u8 irq_reg  = hwif-channel ? ARTTIM23 : CFR;
+   u8 irq_stat = 0, mask   = hwif-channel ? ARTTIM23_INTR_CH1 : 
CFR_INTR_CH0;
+   u8 dma_stat = inb(hwif-dma_status);
+
+   (void) pci_read_config_byte(dev, irq_reg, irq_stat);
 
-   (void) pci_read_config_byte(dev, MRDMODE, dma_alt_stat);
 #ifdef DEBUG
-   printk(%s: dma_stat: 0x%02x dma_alt_stat: 
-   0x%02x mask: 0x%02x\n, drive-name,
-   dma_stat, dma_alt_stat, mask);
+   printk(%s: dma_stat: 0x%02x irq_stat: 0x%02x mask: 0x%02x\n,
+  drive-name, dma_stat, irq_stat, mask);
 #endif
-   if (!(dma_alt_stat  mask))
+   if (!(irq_stat  mask))
return 0;
 
/* return 1 if INTR asserted */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cmd64x: add/fix enablebits (take 2)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7accbffdb8163a59c7bdd3e4eb9a391198979522
Commit: 7accbffdb8163a59c7bdd3e4eb9a391198979522
Parent: e51e2528d589c13f0e51dfa671c310021d003e21
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:49 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:49 2007 +0200

cmd64x: add/fix enablebits (take 2)

The IDE core looks at the wrong bit when checking if the secondary channel 
is
enabled on PCI0646 -- CNTRL register bit 7 is read-ahead disable, bit 3 is 
the
correct one.
Starting with PCI0646U chip, the primary channel can also be 
enabled/disabled --
so, add 'enablebits' initializers to each 'ide_pci_device_t' structure, 
handling
the original PCI0646 via adding the init_setup() method and clearing the 
'reg'
field there if necessary...

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/cmd64x.c |   39 ---
 1 files changed, 36 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index f165bf1..63fd929 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cmd64x.c  Version 1.44Mar 12, 2007
+ * linux/drivers/ide/pci/cmd64x.c  Version 1.45Mar 14, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *   Due to massive hardware bugs, UltraDMA is only supported
@@ -684,42 +684,75 @@ static void __devinit init_hwif_cmd64x(ide_hwif_t *hwif)
hwif-drives[1].autodma = hwif-autodma;
 }
 
+static int __devinit init_setup_cmd64x(struct pci_dev *dev, ide_pci_device_t 
*d)
+{
+   return ide_setup_pci_device(dev, d);
+}
+
+static int __devinit init_setup_cmd646(struct pci_dev *dev, ide_pci_device_t 
*d)
+{
+   u8 rev = 0;
+
+   /*
+* The original PCI0646 didn't have the primary channel enable bit,
+* it appeared starting with PCI0646U (i.e. revision ID 3).
+*/
+   pci_read_config_byte(dev, PCI_REVISION_ID, rev);
+   if (rev  3)
+   d-enablebits[0].reg = 0;
+
+   return ide_setup_pci_device(dev, d);
+}
+
 static ide_pci_device_t cmd64x_chipsets[] __devinitdata = {
{   /* 0 */
.name   = CMD643,
+   .init_setup = init_setup_cmd64x,
.init_chipset   = init_chipset_cmd64x,
.init_hwif  = init_hwif_cmd64x,
.channels   = 2,
.autodma= AUTODMA,
+   .enablebits = {{0x00,0x00,0x00}, {0x51,0x08,0x08}},
.bootable   = ON_BOARD,
},{ /* 1 */
.name   = CMD646,
+   .init_setup = init_setup_cmd646,
.init_chipset   = init_chipset_cmd64x,
.init_hwif  = init_hwif_cmd64x,
.channels   = 2,
.autodma= AUTODMA,
-   .enablebits = {{0x00,0x00,0x00}, {0x51,0x80,0x80}},
+   .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
.bootable   = ON_BOARD,
},{ /* 2 */
.name   = CMD648,
+   .init_setup = init_setup_cmd64x,
.init_chipset   = init_chipset_cmd64x,
.init_hwif  = init_hwif_cmd64x,
.channels   = 2,
.autodma= AUTODMA,
+   .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
.bootable   = ON_BOARD,
},{ /* 3 */
.name   = CMD649,
+   .init_setup = init_setup_cmd64x,
.init_chipset   = init_chipset_cmd64x,
.init_hwif  = init_hwif_cmd64x,
.channels   = 2,
.autodma= AUTODMA,
+   .enablebits = {{0x51,0x04,0x04}, {0x51,0x08,0x08}},
.bootable   = ON_BOARD,
}
 };
 
+/*
+ * We may have to modify enablebits for PCI0646, so we'd better pass
+ * a local copy of the ide_pci_device_t structure down the call chain...
+ */
 static int __devinit cmd64x_init_one(struct pci_dev *dev, const struct 
pci_device_id *id)
 {
-   return ide_setup_pci_device(dev, cmd64x_chipsets[id-driver_data]);
+   ide_pci_device_t d = cmd64x_chipsets[id-driver_data];
+
+   return d.init_setup(dev, d);
 }
 
 static struct pci_device_id cmd64x_pci_tbl[] = {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cmd64x: procfs code fixes/cleanups (take 2)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5826b318aa02e81575c352ca26f00773c999795b
Commit: 5826b318aa02e81575c352ca26f00773c999795b
Parent: 7accbffdb8163a59c7bdd3e4eb9a391198979522
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:50 2007 +0200

cmd64x: procfs code fixes/cleanups (take 2)

Fix several issues with the driver's procfs output:

- when testing if channel is enabled, the code looks at the simplex bits, 
not
  at the real enable bits -- add #define for the primary channel enable bit;

- UltraDMA modes 0, 1, 3 for slave drive reported incorrectly due to using 
the
  master drive's clock cycle resolution bit.

While at it, also perform the following cleanups:

- don't print extra newline before the first controller's dump;

- correct the chipset names (from CMDxxx to PCI-xxx)

- don't read from the registers which aren't used for dump;

- better align the table column sizes;

- rework UltraDMA mode dump code;

- remove PIO mode dump code that has never been finished;

- remove the duplicate interrupt status (the MRDMODE register bits mirror 
those
  those in the CFR and ARTTIM23 registers) and fold the dump into single 
line;

- correct the style of the ?: operators...

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/cmd64x.c |  129 +++--
 1 files changed, 55 insertions(+), 74 deletions(-)

diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 63fd929..24acddf 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cmd64x.c  Version 1.45Mar 14, 2007
+ * linux/drivers/ide/pci/cmd64x.c  Version 1.46Mar 16, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *   Due to massive hardware bugs, UltraDMA is only supported
@@ -38,9 +38,10 @@
 #define CFR0x50
 #define   CFR_INTR_CH0 0x04
 #define CNTRL  0x51
-#define  CNTRL_DIS_RA0 0x40
-#define   CNTRL_DIS_RA10x80
-#define  CNTRL_ENA_2ND 0x08
+#define   CNTRL_ENA_1ST0x04
+#define   CNTRL_ENA_2ND0x08
+#define   CNTRL_DIS_RA00x40
+#define   CNTRL_DIS_RA10x80
 
 #defineCMDTIM  0x52
 #defineARTTIM0 0x53
@@ -87,86 +88,67 @@ static int n_cmd_devs;
 static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index)
 {
char *p = buf;
-
-   u8 reg53 = 0, reg54 = 0, reg55 = 0, reg56 = 0;  /* primary */
-   u8 reg57 = 0, reg58 = 0, reg5b; /* secondary */
u8 reg72 = 0, reg73 = 0;/* primary */
u8 reg7a = 0, reg7b = 0;/* secondary */
-   u8 reg50 = 0, reg71 = 0;/* extra */
+   u8 reg50 = 1, reg51 = 1, reg57 = 0, reg71 = 0;  /* extra */
+   u8 rev = 0;
 
p += sprintf(p, \nController: %d\n, index);
-   p += sprintf(p, CMD%x Chipset.\n, dev-device);
+   p += sprintf(p, PCI-%x Chipset.\n, dev-device);
+
(void) pci_read_config_byte(dev, CFR,   reg50);
-   (void) pci_read_config_byte(dev, ARTTIM0,   reg53);
-   (void) pci_read_config_byte(dev, DRWTIM0,   reg54);
-   (void) pci_read_config_byte(dev, ARTTIM1,   reg55);
-   (void) pci_read_config_byte(dev, DRWTIM1,   reg56);
-   (void) pci_read_config_byte(dev, ARTTIM2,   reg57);
-   (void) pci_read_config_byte(dev, DRWTIM2,   reg58);
-   (void) pci_read_config_byte(dev, DRWTIM3,   reg5b);
+   (void) pci_read_config_byte(dev, CNTRL, reg51);
+   (void) pci_read_config_byte(dev, ARTTIM23,  reg57);
(void) pci_read_config_byte(dev, MRDMODE,   reg71);
(void) pci_read_config_byte(dev, BMIDESR0,  reg72);
(void) pci_read_config_byte(dev, UDIDETCR0, reg73);
(void) pci_read_config_byte(dev, BMIDESR1,  reg7a);
(void) pci_read_config_byte(dev, UDIDETCR1, reg7b);
 
-   p += sprintf(p, --- Primary Channel 
-    Secondary Channel 
-   -\n);
-   p += sprintf(p, %sabled   
- %sabled\n,
-   (reg720x80)?dis: en,
-   (reg7a0x80)?dis: en);
-   p += sprintf(p, --- drive0 
-   - drive1  drive0 
-   -- drive1 --\n);
-   p += sprintf(p, DMA enabled:%s  %s
-%s   %s\n,
-   

cmd64x: use interrupt status from MRDMODE register (take 2)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=66602c83dcb6a5d82772d88ae7a32cd4a1213528
Commit: 66602c83dcb6a5d82772d88ae7a32cd4a1213528
Parent: 5826b318aa02e81575c352ca26f00773c999795b
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:50 2007 +0200

cmd64x: use interrupt status from MRDMODE register (take 2)

Fold the parts of the ide_dma_end() methods identical to __ide_dma_end() 
into a
mere call to it.
Start using faster versions of the ide_dma_end() and ide_dma_test_irq() 
methods
for the PCI0646U and newer chips that have the duplicate interrupt status 
bits
in the I/O mapped MRDMODE register, determing what methods to use at the 
driver
load time. Do some cleanup/renaming in the old ide_dma_test_irq() method 
too.

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/cmd64x.c |  117 +++---
 1 files changed, 69 insertions(+), 48 deletions(-)

diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 24acddf..77f51ab 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cmd64x.c  Version 1.46Mar 16, 2007
+ * linux/drivers/ide/pci/cmd64x.c  Version 1.47Mar 19, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *   Due to massive hardware bugs, UltraDMA is only supported
@@ -425,67 +425,80 @@ static int cmd64x_config_drive_for_dma (ide_drive_t 
*drive)
return -1;
 }
 
-static int cmd64x_alt_dma_status (struct pci_dev *dev)
+static int cmd648_ide_dma_end (ide_drive_t *drive)
 {
-   switch(dev-device) {
-   case PCI_DEVICE_ID_CMD_648:
-   case PCI_DEVICE_ID_CMD_649:
-   return 1;
-   default:
-   break;
-   }
-   return 0;
+   ide_hwif_t *hwif= HWIF(drive);
+   int err = __ide_dma_end(drive);
+   u8  irq_mask= hwif-channel ? MRDMODE_INTR_CH1 :
+ MRDMODE_INTR_CH0;
+   u8  mrdmode = inb(hwif-dma_master + 0x01);
+
+   /* clear the interrupt bit */
+   outb(mrdmode | irq_mask, hwif-dma_master + 0x01);
+
+   return err;
 }
 
 static int cmd64x_ide_dma_end (ide_drive_t *drive)
 {
-   u8 dma_stat = 0, dma_cmd = 0;
ide_hwif_t *hwif= HWIF(drive);
struct pci_dev *dev = hwif-pci_dev;
+   int irq_reg = hwif-channel ? ARTTIM23 : CFR;
+   u8  irq_mask= hwif-channel ? ARTTIM23_INTR_CH1 :
+ CFR_INTR_CH0;
+   u8  irq_stat= 0;
+   int err = __ide_dma_end(drive);
 
-   drive-waiting_for_dma = 0;
-   /* read DMA command state */
-   dma_cmd = inb(hwif-dma_command);
-   /* stop DMA */
-   outb(dma_cmd  ~1, hwif-dma_command);
-   /* get DMA status */
-   dma_stat = inb(hwif-dma_status);
-   /* clear the INTR  ERROR bits */
-   outb(dma_stat | 6, hwif-dma_status);
-   if (cmd64x_alt_dma_status(dev)) {
-   u8 dma_intr = 0;
-   u8 dma_mask = (hwif-channel) ? ARTTIM23_INTR_CH1 :
-   CFR_INTR_CH0;
-   u8 dma_reg  = (hwif-channel) ? ARTTIM2 : CFR;
-   (void) pci_read_config_byte(dev, dma_reg, dma_intr);
-   /* clear the INTR bit */
-   (void) pci_write_config_byte(dev, dma_reg, dma_intr|dma_mask);
-   }
-   /* purge DMA mappings */
-   ide_destroy_dmatable(drive);
-   /* verify good DMA status */
-   return (dma_stat  7) != 4;
+   (void) pci_read_config_byte(dev, irq_reg, irq_stat);
+   /* clear the interrupt bit */
+   (void) pci_write_config_byte(dev, irq_reg, irq_stat | irq_mask);
+
+   return err;
+}
+
+static int cmd648_ide_dma_test_irq (ide_drive_t *drive)
+{
+   ide_hwif_t *hwif= HWIF(drive);
+   u8 irq_mask = hwif-channel ? MRDMODE_INTR_CH1 :
+ MRDMODE_INTR_CH0;
+   u8 dma_stat = inb(hwif-dma_status);
+   u8 mrdmode  = inb(hwif-dma_master + 0x01);
+
+#ifdef DEBUG
+   printk(%s: dma_stat: 0x%02x mrdmode: 0x%02x irq_mask: 0x%02x\n,
+  drive-name, dma_stat, mrdmode, irq_mask);
+#endif
+   if (!(mrdmode  irq_mask))
+   return 0;
+
+   /* return 1 if INTR asserted */
+   if (dma_stat  4)
+   return 1;
+
+   return 0;
 }
 
 static int cmd64x_ide_dma_test_irq (ide_drive_t *drive)
 {
ide_hwif_t *hwif= 

aec62xx: fix PIO/DMA setup issues

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=826a1b6502d0d1d67fc41043fc831e90f2ef5835
Commit: 826a1b6502d0d1d67fc41043fc831e90f2ef5835
Parent: 66602c83dcb6a5d82772d88ae7a32cd4a1213528
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:50 2007 +0200

aec62xx: fix PIO/DMA setup issues

Teach the driver's tuneproc() method to do PIO auto-runing properly since it
treated 5 instead of 255 as auto-tune request, and also passed the mode 
limit
of PIO5 to ide_get_best_pio_mode() despite supporting up to PIO4 only.

While at it, also:

- remove the driver's wrong claim about supporting SWDMA modes;

- stop hooking ide_dma_timeout() method as the handler clearly doesn't fit 
for
  the task...

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/aec62xx.c |   22 ++
 1 files changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c
index 990eafe..73bdf64 100644
--- a/drivers/ide/pci/aec62xx.c
+++ b/drivers/ide/pci/aec62xx.c
@@ -1,7 +1,8 @@
 /*
- * linux/drivers/ide/pci/aec62xx.c Version 0.11March 27, 2002
+ * linux/drivers/ide/pci/aec62xx.c Version 0.21Apr 21, 2007
  *
  * Copyright (C) 1999-2002 Andre Hedrick [EMAIL PROTECTED]
+ * Copyright (C) 2007  MontaVista Software, Inc. [EMAIL PROTECTED]
  *
  */
 
@@ -193,18 +194,8 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 
 static void aec62xx_tune_drive (ide_drive_t *drive, u8 pio)
 {
-   u8 speed = 0;
-   u8 new_pio = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, 5, NULL);
-
-   switch(pio) {
-   case 5: speed = new_pio; break;
-   case 4: speed = XFER_PIO_4; break;
-   case 3: speed = XFER_PIO_3; break;
-   case 2: speed = XFER_PIO_2; break;
-   case 1: speed = XFER_PIO_1; break;
-   default:speed = XFER_PIO_0; break;
-   }
-   (void) aec62xx_tune_chipset(drive, speed);
+   pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
+   (void) aec62xx_tune_chipset(drive, pio + XFER_PIO_0);
 }
 
 static int aec62xx_config_drive_xfer_rate (ide_drive_t *drive)
@@ -213,7 +204,7 @@ static int aec62xx_config_drive_xfer_rate (ide_drive_t 
*drive)
return 0;
 
if (ide_use_fast_pio(drive))
-   aec62xx_tune_drive(drive, 5);
+   aec62xx_tune_drive(drive, 255);
 
return -1;
 }
@@ -288,11 +279,10 @@ static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif)
 
hwif-ultra_mask = 0x7f;
hwif-mwdma_mask = 0x07;
-   hwif-swdma_mask = 0x07;
 
hwif-ide_dma_check = aec62xx_config_drive_xfer_rate;
hwif-ide_dma_lostirq   = aec62xx_irq_timeout;
-   hwif-ide_dma_timeout   = aec62xx_irq_timeout;
+
if (!noautodma)
hwif-autodma = 1;
hwif-drives[0].autodma = hwif-autodma;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


alim15x3: PIO fallback fix

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=072cdcbb7af8a0e1894f9caa6d46d027bbe7f647
Commit: 072cdcbb7af8a0e1894f9caa6d46d027bbe7f647
Parent: 826a1b6502d0d1d67fc41043fc831e90f2ef5835
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:50 2007 +0200

alim15x3: PIO fallback fix

If DMA tuning fails always set the best PIO mode.

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/alim15x3.c |7 +++
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c
index 83e0aa6..946a127 100644
--- a/drivers/ide/pci/alim15x3.c
+++ b/drivers/ide/pci/alim15x3.c
@@ -534,7 +534,7 @@ static int ali15x3_config_drive_for_dma(ide_drive_t *drive)
struct hd_driveid *id   = drive-id;
 
if ((m5229_revision=0x20)  (drive-media!=ide_disk))
-   goto no_dma_set;
+   goto ata_pio;
 
drive-init_speed = 0;
 
@@ -555,20 +555,19 @@ try_dma_modes:
(id-dma_1word  hwif-swdma_mask)) {
/* Force if Capable regular DMA modes */
if (!config_chipset_for_dma(drive))
-   goto no_dma_set;
+   goto ata_pio;
}
} else if (__ide_dma_good_drive(drive) 
   (id-eide_dma_time  150)) {
/* Consult the list of known good drives */
if (!config_chipset_for_dma(drive))
-   goto no_dma_set;
+   goto ata_pio;
} else {
goto ata_pio;
}
} else {
 ata_pio:
hwif-tuneproc(drive, 255);
-no_dma_set:
return -1;
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


pdc202xx_new: enable DMA for all ATAPI devices

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=247b03f8dc4c01659030889f7fb4574013974ac6
Commit: 247b03f8dc4c01659030889f7fb4574013974ac6
Parent: 072cdcbb7af8a0e1894f9caa6d46d027bbe7f647
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:50 2007 +0200

pdc202xx_new: enable DMA for all ATAPI devices

There is no reason to limit DMA to ide_cdrom type devices.

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/pdc202xx_new.c |3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/pci/pdc202xx_new.c b/drivers/ide/pci/pdc202xx_new.c
index ace9892..2da5cbb 100644
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -255,9 +255,6 @@ static int config_chipset_for_dma(ide_drive_t *drive)
printk(KERN_WARNING %s reduced to Ultra33 mode.\n, 
drive-name);
}
 
-   if (drive-media != ide_disk  drive-media != ide_cdrom)
-   return 0;
-
if (id-capability  4) {
/*
 * Set IORDY_EN  PREFETCH_EN (this seems to have
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


it821x: PIO mode setup fixes

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0e9b4e535fec7e2a189952670937adfbe2826b63
Commit: 0e9b4e535fec7e2a189952670937adfbe2826b63
Parent: 247b03f8dc4c01659030889f7fb4574013974ac6
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:50 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:50 2007 +0200

it821x: PIO mode setup fixes

* limit max PIO mode to PIO4, this driver doesn't support PIO5 and attempt
  to setup PIO5 by it821x_tuneproc() could result in incorrect PIO timings
  + incorrect base clock being set for controller in the passthrough mode

* move code limiting max PIO according to the pair device capabilities from
  config_it821x_chipset_for_pio() to it821x_tuneproc() so the check is also
  applied for mode change requests coming through -tuneproc and -speedproc
  interfaces

* set device speed in it821x_tuneproc()

* in it821x_tune_chipset() call it821x_tuneproc() also if the controller is
  in the smart mode (so the check for pair device max PIO is done)

* rename it821x_tuneproc() to it821x_tune_pio(), then add it821x_tuneproc()
  wrapper which does the max PIO mode check;  it worked by the pure luck
  previously, pio[4] and pio_want[4] arrays were used with index == 255
  so random PIO timings and base clock were set for the controller in the
  passthrough mode, thankfully PIO timings and base clock were corrected
  later by config_it821x_chipset_for_pio() call (but it was not called for
  PIO-only devices during resume and for user requested PIO autotuning)

* remove config_it821x_chipset_for_pio() call from config_chipset_for_dma()
  as the driver sets -autotune to 1 and -tuneproc does the proper job now

* convert the last user of config_it821x_chipset_for_pio() to use
  it821x_tuneproc(drive, 255) and remove no longer needed function

While at it:

* fix few comments

* bump driver version

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/it821x.c |  126 +-
 1 files changed, 58 insertions(+), 68 deletions(-)

diff --git a/drivers/ide/pci/it821x.c b/drivers/ide/pci/it821x.c
index a132767..4e12548 100644
--- a/drivers/ide/pci/it821x.c
+++ b/drivers/ide/pci/it821x.c
@@ -1,8 +1,9 @@
 
 /*
- * linux/drivers/ide/pci/it821x.c  Version 0.09December 2004
+ * linux/drivers/ide/pci/it821x.c  Version 0.10Mar 10 2007
  *
  * Copyright (C) 2004  Red Hat [EMAIL PROTECTED]
+ * Copyright (C) 2007  Bartlomiej Zolnierkiewicz
  *
  *  May be copied or modified under the terms of the GNU General Public License
  *  Based in part on the ITE vendor provided SCSI driver.
@@ -104,6 +105,7 @@ static int it8212_noraid;
 /**
  * it821x_program  -   program the PIO/MWDMA registers
  * @drive: drive to tune
+ * @timing: timing info
  *
  * Program the PIO/MWDMA timing for this channel according to the
  * current clock.
@@ -127,6 +129,7 @@ static void it821x_program(ide_drive_t *drive, u16 timing)
 /**
  * it821x_program_udma -   program the UDMA registers
  * @drive: drive to tune
+ * @timing: timing info
  *
  * Program the UDMA timing for this drive according to the
  * current clock.
@@ -153,10 +156,9 @@ static void it821x_program_udma(ide_drive_t *drive, u16 
timing)
}
 }
 
-
 /**
  * it821x_clock_strategy
- * @hwif: hardware interface
+ * @drive: drive to set up
  *
  * Select between the 50 and 66Mhz base clocks to get the best
  * results for this interface.
@@ -182,8 +184,11 @@ static void it821x_clock_strategy(ide_drive_t *drive)
altclock = itdev-want[0][1];
}
 
-   /* Master doesn't care does the slave ? */
-   if(clock == ATA_ANY)
+   /*
+* if both clocks can be used for the mode with the higher priority
+* use the clock needed by the mode with the lower priority
+*/
+   if (clock == ATA_ANY)
clock = altclock;
 
/* Nobody cares - keep the same clock */
@@ -240,37 +245,56 @@ static u8 it821x_ratemask (ide_drive_t *drive)
 }
 
 /**
- * it821x_tuneproc -   tune a drive
+ * it821x_tunepio  -   tune a drive
  * @drive: drive to tune
- * @mode_wanted: the target operating mode
- *
- * Load the timing settings for this device mode into the
- * controller. By the time we are called the mode has been
- * modified as neccessary to handle the absence of seperate
- * master/slave timers for MWDMA/PIO.
+ * @pio: the desired PIO mode
  *
- * This code is only used in pass through mode.
+ * Try to tune the drive/host to the desired PIO mode taking into
+ * the consideration the maximum PIO mode 

siimage: fix wrong -swdma_mask

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8e60d3762f32c9573a449950717a3de12dfebbe3
Commit: 8e60d3762f32c9573a449950717a3de12dfebbe3
Parent: 0e9b4e535fec7e2a189952670937adfbe2826b63
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:51 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:51 2007 +0200

siimage: fix wrong -swdma_mask

This driver doesn't support SWDMA so use the correct -swdma_mask.

While at it:

* no need to call config_chipset_for_pio() in config_chipset_for_dma(),
  if DMA is not available config_chipset_for_pio() will be called
  by siimage_config_drive_for_dma() and if DMA is available
  config_siimage_chipset_for_pio() will be called by siimage_tune_chipset()

* remove needless config_chipset_for_pio() wrapper

* bump driver version

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/siimage.c |   12 ++--
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 71eccdf..c0188de 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/siimage.c Version 1.11Jan 27, 2007
+ * linux/drivers/ide/pci/siimage.c Version 1.12Mar 10 2007
  *
  * Copyright (C) 2001-2002 Andre Hedrick [EMAIL PROTECTED]
  * Copyright (C) 2003  Red Hat [EMAIL PROTECTED]
@@ -287,11 +287,6 @@ static void config_siimage_chipset_for_pio (ide_drive_t 
*drive, byte set_speed)
(void) ide_config_drive_speed(drive, speed);
 }
 
-static void config_chipset_for_pio (ide_drive_t *drive, byte set_speed)
-{
-   config_siimage_chipset_for_pio(drive, set_speed);
-}
-
 /**
  * siimage_tune_chipset-   set controller timings
  * @drive: Drive to set up
@@ -396,8 +391,6 @@ static int config_chipset_for_dma (ide_drive_t *drive)
 {
u8 speed= ide_dma_speed(drive, siimage_ratemask(drive));
 
-   config_chipset_for_pio(drive, !speed);
-
if (!speed)
return 0;
 
@@ -423,7 +416,7 @@ static int siimage_config_drive_for_dma (ide_drive_t *drive)
return 0;
 
if (ide_use_fast_pio(drive))
-   config_chipset_for_pio(drive, 1);
+   config_siimage_chipset_for_pio(drive, 1);
 
return -1;
 }
@@ -1015,7 +1008,6 @@ static void __devinit init_hwif_siimage(ide_hwif_t *hwif)
 
hwif-ultra_mask = 0x7f;
hwif-mwdma_mask = 0x07;
-   hwif-swdma_mask = 0x07;
 
if (!is_sata(hwif))
hwif-atapi_dma = 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide-cris: fix -speedproc and wrong -swdma_mask

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55e4dee32916a569112f33a511adab4bd72cc4a2
Commit: 55e4dee32916a569112f33a511adab4bd72cc4a2
Parent: 8e60d3762f32c9573a449950717a3de12dfebbe3
Author: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:51 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:51 2007 +0200

ide-cris: fix -speedproc and wrong -swdma_mask

* fix -speedproc to set the drive speed

* this driver doesn't support SWDMA so use the correct -swdma_mask

* BUG() if an unsupported mode is passed to -speedproc

Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/cris/ide-cris.c |9 -
 1 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 556455f..5e8efc8 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -730,7 +730,7 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed)
 
if (speed = XFER_PIO_0  speed = XFER_PIO_4) {
tune_cris_ide(drive, speed - XFER_PIO_0);
-   return 0;
+   return ide_config_drive_speed(drive, speed);
}
 
switch(speed)
@@ -760,7 +760,8 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed)
hold = ATA_DMA2_HOLD;
break;
default:
-   return 0;
+   BUG();
+   break;
}
 
if (speed = XFER_UDMA_0)
@@ -768,7 +769,7 @@ static int speed_cris_ide(ide_drive_t *drive, u8 speed)
else
cris_ide_set_speed(TYPE_DMA, 0, strobe, hold);
 
-   return 0;
+   return ide_config_drive_speed(drive, speed);
 }
 
 void __init
@@ -821,7 +822,6 @@ init_e100_ide (void)
hwif-udma_four = 0;
hwif-ultra_mask = cris_ultra_mask;
hwif-mwdma_mask = 0x07; /* Multiword DMA 0-2 */
-   hwif-swdma_mask = 0x07; /* Singleword DMA 0-2 */
hwif-autodma = 1;
hwif-drives[0].autodma = 1;
hwif-drives[1].autodma = 1;
@@ -1010,7 +1010,6 @@ static int cris_config_drive_for_dma (ide_drive_t *drive)
return 0;
 
speed_cris_ide(drive, speed);
-   ide_config_drive_speed(drive, speed);
 
return ide_dma_enable(drive);
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hpt366: don't check enablebits for HPT36x

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fdb0d72be4decaade6cedb5012ddd679a4817b5f
Commit: fdb0d72be4decaade6cedb5012ddd679a4817b5f
Parent: 55e4dee32916a569112f33a511adab4bd72cc4a2
Author: Sergei Shtylyov [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:51 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:51 2007 +0200

hpt366: don't check enablebits for HPT36x

HPT36x chip don't seem to have the channel enable bits, so prevent the IDE 
core
from checking them...

Signed-off-by: Sergei Shtylyov [EMAIL PROTECTED]
Cc: Michal Kepien [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/pci/hpt366.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index ab6fa27..cf9d344 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/hpt366.c  Version 1.02Apr 18, 2007
+ * linux/drivers/ide/pci/hpt366.c  Version 1.03May 4, 2007
  *
  * Copyright (C) 1999-2003 Andre Hedrick [EMAIL PROTECTED]
  * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -1527,7 +1527,12 @@ static int __devinit init_setup_hpt366(struct pci_dev 
*dev, ide_pci_device_t *d)
if (rev  2)
goto init_single;
 
+   /*
+* HPT36x chips are single channel and
+* do not seem to have the channel enable bit...
+*/
d-channels = 1;
+   d-enablebits[0].reg = 0;
 
if ((dev2 = pci_get_slot(dev-bus, dev-devfn + 1)) != NULL) {
u8  pin1 = 0, pin2 = 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ide-cs: recognize 2GB CompactFlash from Transcend

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aa12b2842aba8cc367a2e1ddb5c6ae4fd8ddb1da
Commit: aa12b2842aba8cc367a2e1ddb5c6ae4fd8ddb1da
Parent: fdb0d72be4decaade6cedb5012ddd679a4817b5f
Author: Fabrice Aeschbacher [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:03:51 2007 +0200
Committer:  Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
CommitDate: Sat May 5 22:03:51 2007 +0200

ide-cs: recognize 2GB CompactFlash from Transcend

Without the following patch, the kernel does not automatically detect
2GB CompactFlash cards from Transcend.

Signed-off-by: Fabrice Aeschbacher [EMAIL PROTECTED]
Cc: Dominik Brodowski [EMAIL PROTECTED]
Acked-by: Peter Stuge [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Bartlomiej Zolnierkiewicz [EMAIL PROTECTED]
---
 drivers/ide/legacy/ide-cs.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index b08c37c..c6522a6 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -401,6 +401,7 @@ static struct pcmcia_device_id ide_ids[] = {
PCMCIA_DEVICE_PROD_ID12(TOSHIBA, MK2001MPL, 0xb4585a1a, 0x3489e003),
PCMCIA_DEVICE_PROD_ID1(TRANSCEND512M   , 0xd0909443),
PCMCIA_DEVICE_PROD_ID12(TRANSCEND, TS1GCF80, 0x709b1bf1, 
0x2a54d4b1),
+   PCMCIA_DEVICE_PROD_ID12(TRANSCEND, TS2GCF120, 0x709b1bf1, 
0x969aa4f2),
PCMCIA_DEVICE_PROD_ID12(TRANSCEND, TS4GCF120, 0x709b1bf1, 
0xf54a91c8),
PCMCIA_DEVICE_PROD_ID12(WIT, IDE16, 0x244e5994, 0x3e232852),
PCMCIA_DEVICE_PROD_ID12(WEIDA, TWTTI, 0xcc7cf69c, 0x212bb918),
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[VOYAGER] add smp_call_function_single

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0293ca814b74e20e77cf719074ee15372204fc55
Commit: 0293ca814b74e20e77cf719074ee15372204fc55
Parent: de46c33745f5e2ad594c72f2cf5f490861b16ce1
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Mon Apr 30 11:24:05 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Apr 30 11:24:05 2007 -0500

[VOYAGER] add smp_call_function_single

This apparently has msr users now, so add it to the voyager HAL

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 arch/i386/mach-voyager/voyager_smp.c |   57 ++
 1 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/arch/i386/mach-voyager/voyager_smp.c 
b/arch/i386/mach-voyager/voyager_smp.c
index 74aeedf..a126bae 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -1082,20 +1082,11 @@ smp_call_function_interrupt(void)
}
 }
 
-/* Call this function on all CPUs using the function_interrupt above 
-func The function to run. This must be fast and non-blocking.
-info An arbitrary pointer to pass to the function.
-retry If true, keep retrying until ready.
-wait If true, wait until function has completed on other CPUs.
-[RETURNS] 0 on success, else a negative status code. Does not return until
-remote CPUs are nearly ready to execute func or are or have executed.
-*/
-int
-smp_call_function (void (*func) (void *info), void *info, int retry,
-  int wait)
+static int
+__smp_call_function_mask (void (*func) (void *info), void *info, int retry,
+ int wait, __u32 mask)
 {
struct call_data_struct data;
-   __u32 mask = cpus_addr(cpu_online_map)[0];
 
mask = ~(1smp_processor_id());
 
@@ -1116,7 +1107,7 @@ smp_call_function (void (*func) (void *info), void *info, 
int retry,
call_data = data;
wmb();
/* Send a message to all other CPUs and wait for them to respond */
-   send_CPI_allbutself(VIC_CALL_FUNCTION_CPI);
+   send_CPI(mask, VIC_CALL_FUNCTION_CPI);
 
/* Wait for response */
while (data.started)
@@ -1130,8 +1121,48 @@ smp_call_function (void (*func) (void *info), void 
*info, int retry,
 
return 0;
 }
+
+/* Call this function on all CPUs using the function_interrupt above
+func The function to run. This must be fast and non-blocking.
+info An arbitrary pointer to pass to the function.
+retry If true, keep retrying until ready.
+wait If true, wait until function has completed on other CPUs.
+[RETURNS] 0 on success, else a negative status code. Does not return until
+remote CPUs are nearly ready to execute func or are or have executed.
+*/
+int
+smp_call_function(void (*func) (void *info), void *info, int retry,
+  int wait)
+{
+   __u32 mask = cpus_addr(cpu_online_map)[0];
+
+   return __smp_call_function_mask(func, info, retry, wait, mask);
+}
 EXPORT_SYMBOL(smp_call_function);
 
+/*
+ * smp_call_function_single - Run a function on another CPU
+ * @func: The function to run. This must be fast and non-blocking.
+ * @info: An arbitrary pointer to pass to the function.
+ * @nonatomic: Currently unused.
+ * @wait: If true, wait until function has completed on other CPUs.
+ *
+ * Retrurns 0 on success, else a negative status code.
+ *
+ * Does not return until the remote CPU is nearly ready to execute func
+ * or is or has executed.
+ */
+
+int
+smp_call_function_single(int cpu, void (*func) (void *info), void *info,
+int nonatomic, int wait)
+{
+   __u32 mask = 1  cpu;
+
+   return __smp_call_function_mask(func, info, nonatomic, wait, mask);
+}
+EXPORT_SYMBOL(smp_call_function_single);
+
 /* Sorry about the name.  In an APIC based system, the APICs
  * themselves are programmed to send a timer interrupt.  This is used
  * by linux to reschedule the processor.  Voyager doesn't have this,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[VOYAGER] clockevents: correct boot cpu is zero assumption

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2feae2158a96aa5e02ca2e630896e6f553c36dc0
Commit: 2feae2158a96aa5e02ca2e630896e6f553c36dc0
Parent: 0293ca814b74e20e77cf719074ee15372204fc55
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Mon Apr 30 11:27:25 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue May 1 10:06:42 2007 -0500

[VOYAGER] clockevents: correct boot cpu is zero assumption

This isn't true for voyager, so alter setup_pit_timer() to initialise
the cpumask from the current processor id (which should be the boot
processor) rather than defaulting to zero.

Acked-by: Thomas Gleixner [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 arch/i386/kernel/i8253.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/i386/kernel/i8253.c b/arch/i386/kernel/i8253.c
index 10cef5c..f8a3c40 100644
--- a/arch/i386/kernel/i8253.c
+++ b/arch/i386/kernel/i8253.c
@@ -110,7 +110,7 @@ void __init setup_pit_timer(void)
 * Start pit with the boot cpu mask and make it global after the
 * IO_APIC has been initialized.
 */
-   pit_clockevent.cpumask = cpumask_of_cpu(0);
+   pit_clockevent.cpumask = cpumask_of_cpu(smp_processor_id());
pit_clockevent.mult = div_sc(CLOCK_TICK_RATE, NSEC_PER_SEC, 32);
pit_clockevent.max_delta_ns =
clockevent_delta2ns(0x7FFF, pit_clockevent);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[VOYAGER] clockevents driver: bring voyager in to line

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9f483519be82420e308b9a90a96a9c62f28032ae
Commit: 9f483519be82420e308b9a90a96a9c62f28032ae
Parent: 2feae2158a96aa5e02ca2e630896e6f553c36dc0
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Mon Apr 30 11:30:10 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue May 1 10:07:20 2007 -0500

[VOYAGER] clockevents driver: bring voyager in to line

The irq0 timer interrupt should be initiallised identically with
mach-default.

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 arch/i386/mach-voyager/setup.c |8 +++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/arch/i386/mach-voyager/setup.c b/arch/i386/mach-voyager/setup.c
index cfa16c1..447bb10 100644
--- a/arch/i386/mach-voyager/setup.c
+++ b/arch/i386/mach-voyager/setup.c
@@ -40,10 +40,16 @@ void __init trap_init_hook(void)
 {
 }
 
-static struct irqaction irq0  = { timer_interrupt, IRQF_DISABLED, 
CPU_MASK_NONE, timer, NULL, NULL};
+static struct irqaction irq0  = {
+   .handler = timer_interrupt,
+   .flags = IRQF_DISABLED | IRQF_NOBALANCING,
+   .mask = CPU_MASK_NONE,
+   .name = timer
+};
 
 void __init time_init_hook(void)
 {
+   irq0.mask = cpumask_of_cpu(safe_smp_processor_id());
setup_irq(0, irq0);
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[VOYAGER] Convert the monitor thread to use the kthread API

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f3402a4e52fc1bdfc386a7f512e6e384cd69ecad
Commit: f3402a4e52fc1bdfc386a7f512e6e384cd69ecad
Parent: 9f483519be82420e308b9a90a96a9c62f28032ae
Author: Christoph Hellwig [EMAIL PROTECTED]
AuthorDate: Sun Apr 22 20:30:43 2007 +0100
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue May 1 10:09:29 2007 -0500

[VOYAGER] Convert the monitor thread to use the kthread API

full kthread conversion on the voyager power switch handling thread.

Signed-off-by: Christoph Hellwig [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 arch/i386/mach-voyager/voyager_cat.c|4 +-
 arch/i386/mach-voyager/voyager_thread.c |   69 +-
 include/asm-i386/voyager.h  |6 +--
 3 files changed, 24 insertions(+), 55 deletions(-)

diff --git a/arch/i386/mach-voyager/voyager_cat.c 
b/arch/i386/mach-voyager/voyager_cat.c
index 943a947..26a2d4c 100644
--- a/arch/i386/mach-voyager/voyager_cat.c
+++ b/arch/i386/mach-voyager/voyager_cat.c
@@ -,7 +,7 @@ voyager_cat_do_common_interrupt(void)
printk(KERN_ERR Voyager front panel switch 
turned off\n);
voyager_status.switch_off = 1;
voyager_status.request_from_kernel = 1;
-   up(kvoyagerd_sem);
+   wake_up_process(voyager_thread);
}
/* Tell the hardware we're taking care of the
 * shutdown, otherwise it will power the box off
@@ -1157,7 +1157,7 @@ voyager_cat_do_common_interrupt(void)
outb(VOYAGER_CAT_END, CAT_CMD);
voyager_status.power_fail = 1;
voyager_status.request_from_kernel = 1;
-   up(kvoyagerd_sem);
+   wake_up_process(voyager_thread);
}


diff --git a/arch/i386/mach-voyager/voyager_thread.c 
b/arch/i386/mach-voyager/voyager_thread.c
index f398873..fdc1d92 100644
--- a/arch/i386/mach-voyager/voyager_thread.c
+++ b/arch/i386/mach-voyager/voyager_thread.c
@@ -24,33 +24,16 @@
 #include linux/kmod.h
 #include linux/completion.h
 #include linux/sched.h
+#include linux/kthread.h
 #include asm/desc.h
 #include asm/voyager.h
 #include asm/vic.h
 #include asm/mtrr.h
 #include asm/msr.h
 
-#define THREAD_NAME kvoyagerd
 
-/* external variables */
-int kvoyagerd_running = 0;
-DECLARE_MUTEX_LOCKED(kvoyagerd_sem);
-
-static int thread(void *);
-
-static __u8 set_timeout = 0;
-
-/* Start the machine monitor thread.  Return 1 if OK, 0 if fail */
-static int __init
-voyager_thread_start(void)
-{
-   if(kernel_thread(thread, NULL, CLONE_KERNEL)  0) {
-   /* This is serious, but not fatal */
-   printk(KERN_ERR Voyager: Failed to create system monitor 
thread!!!\n);
-   return 1;
-   }
-   return 0;
-}
+struct task_struct *voyager_thread;
+static __u8 set_timeout;
 
 static int
 execute(const char *string)
@@ -110,31 +93,15 @@ check_continuing_condition(void)
}
 }
 
-static void
-wakeup(unsigned long unused)
-{
-   up(kvoyagerd_sem);
-}
-
 static int
 thread(void *unused)
 {
-   struct timer_list wakeup_timer;
-
-   kvoyagerd_running = 1;
-
-   daemonize(THREAD_NAME);
-
-   set_timeout = 0;
-
-   init_timer(wakeup_timer);
-
-   sigfillset(current-blocked);
-
printk(KERN_NOTICE Voyager starting monitor thread\n);
 
-   for(;;) {
-   down_interruptible(kvoyagerd_sem);
+   for (;;) {
+   set_current_state(TASK_INTERRUPTIBLE);
+   schedule_timeout(set_timeout ? HZ : MAX_SCHEDULE_TIMEOUT);
+
VDEBUG((Voyager Daemon awoken\n));
if(voyager_status.request_from_kernel == 0) {
/* probably awoken from timeout */
@@ -143,20 +110,26 @@ thread(void *unused)
check_from_kernel();
voyager_status.request_from_kernel = 0;
}
-   if(set_timeout) {
-   del_timer(wakeup_timer);
-   wakeup_timer.expires = HZ + jiffies;
-   wakeup_timer.function = wakeup;
-   add_timer(wakeup_timer);
-   }
}
 }
 
+static int __init
+voyager_thread_start(void)
+{
+   voyager_thread = kthread_run(thread, NULL, kvoyagerd);
+   if (IS_ERR(voyager_thread)) {
+   printk(KERN_ERR Voyager: Failed to create system monitor 
thread.\n);
+   return PTR_ERR(voyager_thread);
+   }
+   return 0;
+}
+
+
 static void __exit
 voyager_thread_stop(void)
 {
-   /* FIXME: do nothing at the moment */
+   kthread_stop(voyager_thread);
 }
 
 module_init(voyager_thread_start);

[VOYAGER] Use modern techniques to setup and teardown low identiy mappings.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d0e59a34116f5ee48efc9a397fb09aaedc3b2f0
Commit: 9d0e59a34116f5ee48efc9a397fb09aaedc3b2f0
Parent: f3402a4e52fc1bdfc386a7f512e6e384cd69ecad
Author: Eric W. Biederman [EMAIL PROTECTED]
AuthorDate: Mon Apr 30 09:57:40 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue May 1 10:11:32 2007 -0500

[VOYAGER] Use modern techniques to setup and teardown low identiy mappings.

This is a trivial and hopefully obviously correct patch to setup
and teardown the identity mappings the way the rest of arch/i386
does.

My new page table setup code will break some assumptions below so
this is my attempt to keep voyager working.

Signed-off-by: Eric W. Biederman [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 arch/i386/mach-voyager/voyager_smp.c |   38 +
 1 files changed, 6 insertions(+), 32 deletions(-)

diff --git a/arch/i386/mach-voyager/voyager_smp.c 
b/arch/i386/mach-voyager/voyager_smp.c
index a126bae..535fb9e 100644
--- a/arch/i386/mach-voyager/voyager_smp.c
+++ b/arch/i386/mach-voyager/voyager_smp.c
@@ -536,15 +536,6 @@ do_boot_cpu(__u8 cpu)
 ~( voyager_extended_vic_processors
  voyager_allowed_boot_processors);
 
-   /* For the 486, we can't use the 4Mb page table trick, so
-* must map a region of memory */
-#ifdef CONFIG_M486
-   int i;
-   unsigned long *page_table_copies = (unsigned long *)
-   __get_free_page(GFP_KERNEL);
-#endif
-   pgd_t orig_swapper_pg_dir0;
-
/* This is an area in head.S which was used to set up the
 * initial kernel stack.  We need to alter this to give the
 * booting CPU a new stack (taken from its idle process) */
@@ -595,24 +586,11 @@ do_boot_cpu(__u8 cpu)
VDEBUG((VOYAGER SMP: Booting CPU%d at 0x%lx[%x:%x], stack %p\n, cpu, 
(unsigned long)hijack_source.val, hijack_source.idt.Segment,
hijack_source.idt.Offset, stack_start.esp));
-   /* set the original swapper_pg_dir[0] to map 0 to 4Mb transparently
-* (so that the booting CPU can find start_32 */
-   orig_swapper_pg_dir0 = swapper_pg_dir[0];
-#ifdef CONFIG_M486
-   if(page_table_copies == NULL)
-   panic(No free memory for 486 page tables\n);
-   for(i = 0; i  PAGE_SIZE/sizeof(unsigned long); i++)
-   page_table_copies[i] = (i * PAGE_SIZE) 
-   | _PAGE_RW | _PAGE_USER | _PAGE_PRESENT;
-
-   ((unsigned long *)swapper_pg_dir)[0] = 
-   ((virt_to_phys(page_table_copies))  PAGE_MASK)
-   | _PAGE_RW | _PAGE_USER | _PAGE_PRESENT;
-#else
-   ((unsigned long *)swapper_pg_dir)[0] = 
-   (virt_to_phys(pg0)  PAGE_MASK)
-   | _PAGE_RW | _PAGE_USER | _PAGE_PRESENT;
-#endif
+
+   /* init lowmem identity mapping */
+   clone_pgd_range(swapper_pg_dir, swapper_pg_dir + USER_PGD_PTRS,
+   min_t(unsigned long, KERNEL_PGD_PTRS, USER_PGD_PTRS));
+   flush_tlb_all();
 
if(quad_boot) {
printk(CPU %d: non extended Quad boot\n, cpu);
@@ -655,11 +633,7 @@ do_boot_cpu(__u8 cpu)
udelay(100);
}
/* reset the page table */
-   swapper_pg_dir[0] = orig_swapper_pg_dir0;
-   local_flush_tlb();
-#ifdef CONFIG_M486
-   free_page((unsigned long)page_table_copies);
-#endif
+   zap_low_mappings();
  
if (cpu_booted_map) {
VDEBUG((CPU%d: Booted successfully, back in CPU %d\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] zfcp: fix likely/unlikely usage

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=862794fa3fd4c8a44ee22582418736c93e0d3c3a
Commit: 862794fa3fd4c8a44ee22582418736c93e0d3c3a
Parent: be521466feb3bb1cd89de82a2b1d080e9ebd3cb6
Author: Heiko Carstens [EMAIL PROTECTED]
AuthorDate: Wed Feb 21 09:28:00 2007 +0100
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:12:36 2007 -0500

[SCSI] zfcp: fix likely/unlikely usage

zfcp_fsf_protstatus_eval() takes always the 'wrong' branch.

Likely Profiling Results
 -
[+- ] Type | # True | # False | Function:[EMAIL PROTECTED]
+unlikely  |   11042|0  zfcp_fsf_protstatus_eval()

Acked-by: Swen Schillig [EMAIL PROTECTED]
Signed-off-by: Heiko Carstens [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/s390/scsi/zfcp_fsf.c |   10 ++
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index ef16f7c..4c0a59a 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -299,9 +299,10 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
}
 
/* log additional information provided by FSF (if any) */
-   if (unlikely(qtcb-header.log_length)) {
+   if (likely(qtcb-header.log_length)) {
/* do not trust them ;-) */
-   if (qtcb-header.log_start  sizeof(struct fsf_qtcb)) {
+   if (unlikely(qtcb-header.log_start 
+sizeof(struct fsf_qtcb))) {
ZFCP_LOG_NORMAL
(bug: ULP (FSF logging) log data starts 
 beyond end of packet header. Ignored. 
@@ -310,8 +311,9 @@ zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *fsf_req)
 sizeof(struct fsf_qtcb));
goto forget_log;
}
-   if ((size_t) (qtcb-header.log_start + qtcb-header.log_length)
-sizeof(struct fsf_qtcb)) {
+   if (unlikely((size_t) (qtcb-header.log_start +
+  qtcb-header.log_length) 
+sizeof(struct fsf_qtcb))) {
ZFCP_LOG_NORMAL(bug: ULP (FSF logging) log data ends 
beyond end of packet header. Ignored. 
(start=%i, length=%i, size=%li)\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] constants.c: cleanup, verbose result printing

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=684b7fe976554d12e6266d7280c87a0f3feff02e
Commit: 684b7fe976554d12e6266d7280c87a0f3feff02e
Parent: 862794fa3fd4c8a44ee22582418736c93e0d3c3a
Author: Martin K. Petersen [EMAIL PROTECTED]
AuthorDate: Tue Feb 27 22:39:44 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:14:02 2007 -0500

[SCSI] constants.c: cleanup, verbose result printing

Clean up constants.c and make result printing more user friendly:

 - Refactor the command and sense functions so that the actual
   formatting can be called from the various helper functions with the
   correct prefix.

 - Replace scsi_print_hostbyte() and scsi_print_driverbyte() with
   scsi_print_result() which is verbose when CONFIG_SCSI_CONSTANTS is
   on.

Signed-off-by: Martin K. Petersen [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/constants.c |  267 +-
 include/scsi/scsi_dbg.h  |   10 +-
 2 files changed, 151 insertions(+), 126 deletions(-)

diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 61f6024..6114875 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -202,31 +202,29 @@ static const char * get_sa_name(const struct 
value_name_pair * arr,
 }
 
 /* attempt to guess cdb length if cdb_len==0 . No trailing linefeed. */
-static void print_opcode_name(unsigned char * cdbp, int cdb_len,
- int start_of_line)
+static void print_opcode_name(unsigned char * cdbp, int cdb_len)
 {
int sa, len, cdb0;
const char * name;
-   const char * leadin = start_of_line ? KERN_INFO : ;
 
cdb0 = cdbp[0];
switch(cdb0) {
case VARIABLE_LENGTH_CMD:
len = cdbp[7] + 8;
if (len  10) {
-   printk(%sshort variable length command, 
-  len=%d ext_len=%d, leadin, len, cdb_len);
+   printk(short variable length command, 
+  len=%d ext_len=%d, len, cdb_len);
break;
}
sa = (cdbp[8]  8) + cdbp[9];
name = get_sa_name(maint_in_arr, MAINT_IN_SZ, sa);
if (name) {
-   printk(%s%s, leadin, name);
+   printk(%s, name);
if ((cdb_len  0)  (len != cdb_len))
printk(, in_cdb_len=%d, ext_len=%d,
   len, cdb_len);
} else {
-   printk(%scdb[0]=0x%x, sa=0x%x, leadin, cdb0, sa);
+   printk(cdb[0]=0x%x, sa=0x%x, cdb0, sa);
if ((cdb_len  0)  (len != cdb_len))
printk(, in_cdb_len=%d, ext_len=%d,
   len, cdb_len);
@@ -236,83 +234,80 @@ static void print_opcode_name(unsigned char * cdbp, int 
cdb_len,
sa = cdbp[1]  0x1f;
name = get_sa_name(maint_in_arr, MAINT_IN_SZ, sa);
if (name)
-   printk(%s%s, leadin, name);
+   printk(%s, name);
else
-   printk(%scdb[0]=0x%x, sa=0x%x, leadin, cdb0, sa);
+   printk(cdb[0]=0x%x, sa=0x%x, cdb0, sa);
break;
case MAINTENANCE_OUT:
sa = cdbp[1]  0x1f;
name = get_sa_name(maint_out_arr, MAINT_OUT_SZ, sa);
if (name)
-   printk(%s%s, leadin, name);
+   printk(%s, name);
else
-   printk(%scdb[0]=0x%x, sa=0x%x, leadin, cdb0, sa);
+   printk(cdb[0]=0x%x, sa=0x%x, cdb0, sa);
break;
case SERVICE_ACTION_IN_12:
sa = cdbp[1]  0x1f;
name = get_sa_name(serv_in12_arr, SERV_IN12_SZ, sa);
if (name)
-   printk(%s%s, leadin, name);
+   printk(%s, name);
else
-   printk(%scdb[0]=0x%x, sa=0x%x, leadin, cdb0, sa);
+   printk(cdb[0]=0x%x, sa=0x%x, cdb0, sa);
break;
case SERVICE_ACTION_OUT_12:
sa = cdbp[1]  0x1f;
name = get_sa_name(serv_out12_arr, SERV_OUT12_SZ, sa);
if (name)
-   printk(%s%s, leadin, name);
+   printk(%s, name);
else
-   printk(%scdb[0]=0x%x, sa=0x%x, leadin, cdb0, sa);
+   printk(cdb[0]=0x%x, sa=0x%x, cdb0, sa);
break;
case SERVICE_ACTION_IN_16:
sa = cdbp[1]  0x1f;
name = get_sa_name(serv_in16_arr, SERV_IN16_SZ, sa);
if 

[SCSI] Make error printing more verbose

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a4d04a4cd9881e89fdc62107b6b57053438f2b30
Commit: a4d04a4cd9881e89fdc62107b6b57053438f2b30
Parent: 684b7fe976554d12e6266d7280c87a0f3feff02e
Author: Martin K. Petersen [EMAIL PROTECTED]
AuthorDate: Tue Feb 27 22:40:27 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:17:49 2007 -0500

[SCSI] Make error printing more verbose

This patch enhances SCSI error printing by:

 - Making use of scsi_print_result() in the completion functions.

 - Having scmd_printk() output the disk name (when applicable).

Signed-off-by: Martin K. Petersen [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi.c|   47 +++
 drivers/scsi/scsi_lib.c|4 +--
 include/scsi/scsi_device.h |8 +-
 3 files changed, 24 insertions(+), 35 deletions(-)

diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 1c89ee3..4c1e313 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -344,7 +344,6 @@ void scsi_destroy_command_freelist(struct Scsi_Host *shost)
 void scsi_log_send(struct scsi_cmnd *cmd)
 {
unsigned int level;
-   struct scsi_device *sdev;
 
/*
 * If ML QUEUE log level is greater than or equal to:
@@ -361,22 +360,17 @@ void scsi_log_send(struct scsi_cmnd *cmd)
level = SCSI_LOG_LEVEL(SCSI_LOG_MLQUEUE_SHIFT,
   SCSI_LOG_MLQUEUE_BITS);
if (level  1) {
-   sdev = cmd-device;
-   sdev_printk(KERN_INFO, sdev, send );
+   scmd_printk(KERN_INFO, cmd, Send: );
if (level  2)
printk(0x%p , cmd);
-   /*
-* spaces to match disposition and cmd-result
-* output in scsi_log_completion.
-*/
-   printk( );
+   printk(\n);
scsi_print_command(cmd);
if (level  3) {
printk(KERN_INFO buffer = 0x%p, bufflen = %d,
done = 0x%p, queuecommand 0x%p\n,
cmd-request_buffer, 
cmd-request_bufflen,
cmd-done,
-   sdev-host-hostt-queuecommand);
+   cmd-device-host-hostt-queuecommand);
 
}
}
@@ -386,7 +380,6 @@ void scsi_log_send(struct scsi_cmnd *cmd)
 void scsi_log_completion(struct scsi_cmnd *cmd, int disposition)
 {
unsigned int level;
-   struct scsi_device *sdev;
 
/*
 * If ML COMPLETE log level is greater than or equal to:
@@ -405,8 +398,7 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int 
disposition)
   SCSI_LOG_MLCOMPLETE_BITS);
if (((level  0)  (cmd-result || disposition != SUCCESS)) ||
(level  1)) {
-   sdev = cmd-device;
-   sdev_printk(KERN_INFO, sdev, done );
+   scmd_printk(KERN_INFO, cmd, Done: );
if (level  2)
printk(0x%p , cmd);
/*
@@ -415,40 +407,35 @@ void scsi_log_completion(struct scsi_cmnd *cmd, int 
disposition)
 */
switch (disposition) {
case SUCCESS:
-   printk(SUCCESS);
+   printk(SUCCESS\n);
break;
case NEEDS_RETRY:
-   printk(RETRY  );
+   printk(RETRY\n);
break;
case ADD_TO_MLQUEUE:
-   printk(MLQUEUE);
+   printk(MLQUEUE\n);
break;
case FAILED:
-   printk(FAILED );
+   printk(FAILED\n);
break;
case TIMEOUT_ERROR:
/* 
 * If called via scsi_times_out.
 */
-   printk(TIMEOUT);
+   printk(TIMEOUT\n);
break;
default:
-   printk(UNKNOWN);
+   printk(UNKNOWN\n);
}
-   printk( %8x , cmd-result);
+   scsi_print_result(cmd);

[SCSI] sd: make printing use a common prefix

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e73aec8247032ee730b5f38edf48922c4f72522e
Commit: e73aec8247032ee730b5f38edf48922c4f72522e
Parent: a4d04a4cd9881e89fdc62107b6b57053438f2b30
Author: Martin K. Petersen [EMAIL PROTECTED]
AuthorDate: Tue Feb 27 22:40:55 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:20:17 2007 -0500

[SCSI] sd: make printing use a common prefix

Make SCSI disk printing more consistent:

 - Define sd_printk(), sd_print_sense_hdr() and sd_print_result()

 - Move relevant header bits into sd.h

 - Remove all the legacy disk_name passing and use scsi_disk pointers
   where possible

 - Switch printk() lines to the new sd_ functions so that output is
   consistent

Signed-off-by: Martin K. Petersen [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/sd.c |  253 -
 include/scsi/sd.h |   70 +++
 2 files changed, 165 insertions(+), 158 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 5a8f55f..b5562b8 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -58,16 +58,10 @@
 #include scsi/scsi_host.h
 #include scsi/scsi_ioctl.h
 #include scsi/scsicam.h
+#include scsi/sd.h
 
 #include scsi_logging.h
 
-/*
- * More than enough for everybody ;)  The huge number of majors
- * is a leftover from 16bit dev_t days, we don't really need that
- * much numberspace.
- */
-#define SD_MAJORS  16
-
 MODULE_AUTHOR(Eric Youngdale);
 MODULE_DESCRIPTION(SCSI disk (sd) driver);
 MODULE_LICENSE(GPL);
@@ -89,45 +83,6 @@ MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK13_MAJOR);
 MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK14_MAJOR);
 MODULE_ALIAS_BLOCKDEV_MAJOR(SCSI_DISK15_MAJOR);
 
-/*
- * This is limited by the naming scheme enforced in sd_probe,
- * add another character to it if you really need more disks.
- */
-#define SD_MAX_DISKS   (((26 * 26) + 26 + 1) * 26)
-
-/*
- * Time out in seconds for disks and Magneto-opticals (which are slower).
- */
-#define SD_TIMEOUT (30 * HZ)
-#define SD_MOD_TIMEOUT (75 * HZ)
-
-/*
- * Number of allowed retries
- */
-#define SD_MAX_RETRIES 5
-#define SD_PASSTHROUGH_RETRIES 1
-
-/*
- * Size of the initial data buffer for mode and read capacity data
- */
-#define SD_BUF_SIZE512
-
-struct scsi_disk {
-   struct scsi_driver *driver; /* always sd_template */
-   struct scsi_device *device;
-   struct class_device cdev;
-   struct gendisk  *disk;
-   unsigned intopeners;/* protected by BKL for now, yuck */
-   sector_tcapacity;   /* size in 512-byte sectors */
-   u32 index;
-   u8  media_present;
-   u8  write_prot;
-   unsignedWCE : 1;/* state of disk WCE bit */
-   unsignedRCD : 1;/* state of disk RCD bit, unused */
-   unsignedDPOFUA : 1; /* state of disk DPOFUA bit */
-};
-#define to_scsi_disk(obj) container_of(obj,struct scsi_disk,cdev)
-
 static DEFINE_IDR(sd_index_idr);
 static DEFINE_SPINLOCK(sd_index_lock);
 
@@ -136,20 +91,6 @@ static DEFINE_SPINLOCK(sd_index_lock);
  * object after last put) */
 static DEFINE_MUTEX(sd_ref_mutex);
 
-static int sd_revalidate_disk(struct gendisk *disk);
-static void sd_rw_intr(struct scsi_cmnd * SCpnt);
-
-static int sd_probe(struct device *);
-static int sd_remove(struct device *);
-static void sd_shutdown(struct device *dev);
-static void sd_rescan(struct device *);
-static int sd_init_command(struct scsi_cmnd *);
-static int sd_issue_flush(struct device *, sector_t *);
-static void sd_prepare_flush(request_queue_t *, struct request *);
-static void sd_read_capacity(struct scsi_disk *sdkp, char *diskname,
-unsigned char *buffer);
-static void scsi_disk_release(struct class_device *cdev);
-
 static const char *sd_cache_types[] = {
write through, none, write back,
write back, no read (daft)
@@ -199,7 +140,7 @@ static ssize_t sd_store_cache_type(struct class_device 
*cdev, const char *buf,
if (scsi_mode_select(sdp, 1, sp, 8, buffer_data, len, SD_TIMEOUT,
 SD_MAX_RETRIES, data, sshdr)) {
if (scsi_sense_valid(sshdr))
-   scsi_print_sense_hdr(sdkp-disk-disk_name, sshdr);
+   sd_print_sense_hdr(sdkp, sshdr);
return -EINVAL;
}
sd_revalidate_disk(sdkp-disk);
@@ -407,7 +348,8 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
 */
if (sdp-sector_size == 1024) {
if ((block  1) || (rq-nr_sectors  1)) {
-   printk(KERN_ERR sd: Bad block number requested);
+   scmd_printk(KERN_ERR, SCpnt,
+   Bad block number requested\n);
  

[SCSI] sd: convert logging to new printk helpers

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fa0d34be06213e02a4df29a9d34ca915728a8434
Commit: fa0d34be06213e02a4df29a9d34ca915728a8434
Parent: e73aec8247032ee730b5f38edf48922c4f72522e
Author: Martin K. Petersen [EMAIL PROTECTED]
AuthorDate: Tue Feb 27 22:41:19 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:20:55 2007 -0500

[SCSI] sd: convert logging to new printk helpers

Convert the sd.c SCSI logging calls to scmd_printk()/sd_printk()
instead of plain printk().

Signed-off-by: Martin K. Petersen [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/sd.c |   50 +-
 1 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index b5562b8..30a4aa0 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -312,15 +312,19 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
unsigned int this_count = SCpnt-request_bufflen  9;
unsigned int timeout = sdp-timeout;
 
-   SCSI_LOG_HLQUEUE(1, printk(sd_init_command: disk=%s, block=%llu, 
-   count=%d\n, disk-disk_name,
-(unsigned long long)block, this_count));
+   SCSI_LOG_HLQUEUE(1, scmd_printk(KERN_INFO, SCpnt,
+   sd_init_command: block=%llu, 
+   count=%d\n,
+   (unsigned long long)block,
+   this_count));
 
if (!sdp || !scsi_device_online(sdp) ||
block + rq-nr_sectors  get_capacity(disk)) {
-   SCSI_LOG_HLQUEUE(2, printk(Finishing %ld sectors\n, 
-rq-nr_sectors));
-   SCSI_LOG_HLQUEUE(2, printk(Retry with 0x%p\n, SCpnt));
+   SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
+   Finishing %ld sectors\n,
+   rq-nr_sectors));
+   SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
+   Retry with 0x%p\n, SCpnt));
return 0;
}
 
@@ -332,8 +336,8 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
/* printk(SCSI disk has been changed. Prohibiting further 
I/O.\n); */
return 0;
}
-   SCSI_LOG_HLQUEUE(2, printk(%s : block=%llu\n,
-  disk-disk_name, (unsigned long long)block));
+   SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt, block=%llu\n,
+   (unsigned long long)block));
 
/*
 * If we have a 1K hardware sectorsize, prevent access to single
@@ -390,9 +394,11 @@ static int sd_init_command(struct scsi_cmnd * SCpnt)
return 0;
}
 
-   SCSI_LOG_HLQUEUE(2, printk(%s : %s %d/%ld 512 byte blocks.\n, 
-   disk-disk_name, (rq_data_dir(rq) == WRITE) ? 
-   writing : reading, this_count, rq-nr_sectors));
+   SCSI_LOG_HLQUEUE(2, scmd_printk(KERN_INFO, SCpnt,
+   %s %d/%ld 512 byte blocks.\n,
+   (rq_data_dir(rq) == WRITE) ?
+   writing : reading, this_count,
+   rq-nr_sectors));
 
SCpnt-cmnd[1] = 0;

@@ -494,7 +500,7 @@ static int sd_open(struct inode *inode, struct file *filp)
return -ENXIO;
 
 
-   SCSI_LOG_HLQUEUE(3, printk(sd_open: disk=%s\n, disk-disk_name));
+   SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, sd_open\n));
 
sdev = sdkp-device;
 
@@ -564,7 +570,7 @@ static int sd_release(struct inode *inode, struct file 
*filp)
struct scsi_disk *sdkp = scsi_disk(disk);
struct scsi_device *sdev = sdkp-device;
 
-   SCSI_LOG_HLQUEUE(3, printk(sd_release: disk=%s\n, disk-disk_name));
+   SCSI_LOG_HLQUEUE(3, sdkp_printk(KERN_INFO, sdkp, sd_release\n));
 
if (!--sdkp-openers  sdev-removable) {
if (scsi_block_when_processing_errors(sdev))
@@ -677,8 +683,7 @@ static int sd_media_changed(struct gendisk *disk)
struct scsi_device *sdp = sdkp-device;
int retval;
 
-   SCSI_LOG_HLQUEUE(3, printk(sd_media_changed: disk=%s\n,
-   disk-disk_name));
+   SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, sd_media_changed\n));
 
if (!sdp-removable)
return 0;
@@ -871,12 +876,14 @@ static void sd_rw_intr(struct scsi_cmnd * SCpnt)
sense_deferred = scsi_sense_is_deferred(sshdr);
}
 #ifdef CONFIG_SCSI_LOGGING
-   SCSI_LOG_HLCOMPLETE(1, printk(sd_rw_intr: %s: res=0x%x\n, 
-   SCpnt-request-rq_disk-disk_name, result));

[SCSI] constants.c: Update ASC list and make it const

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=62d42a62770dd66da2d3df693e70f4e5fae1716a
Commit: 62d42a62770dd66da2d3df693e70f4e5fae1716a
Parent: fa0d34be06213e02a4df29a9d34ca915728a8434
Author: Martin K. Petersen [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 12:37:06 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:21:25 2007 -0500

[SCSI] constants.c: Update ASC list and make it const

Add missing additional sense code and provide pointer to upstream
reference (from Doug Gilbert).

Add missing const (from Michael Tokarev).

Signed-off-by: Martin K. Petersen [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/constants.c |7 ++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/constants.c b/drivers/scsi/constants.c
index 6114875..2a458d6 100644
--- a/drivers/scsi/constants.c
+++ b/drivers/scsi/constants.c
@@ -404,7 +404,11 @@ struct error_info {
const char * text;
 };
 
-static struct error_info additional[] =
+/*
+ * The canonical list of T10 Additional Sense Codes is available at:
+ * http://www.t10.org/lists/asc-num.txt
+ */
+static const struct error_info additional[] =
 {
{0x, No additional sense information},
{0x0001, Filemark detected},
@@ -708,6 +712,7 @@ static struct error_info additional[] =
 
{0x2F00, Commands cleared by another initiator},
{0x2F01, Commands cleared by power loss notification},
+   {0x2F02, Commands cleared by device server},
 
{0x3000, Incompatible medium installed},
{0x3001, Cannot read medium - unknown format},
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] libiscsi: flush work before freeing connection

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=779ea1207b6a43943faa44f41be7311263315604
Commit: 779ea1207b6a43943faa44f41be7311263315604
Parent: 62d42a62770dd66da2d3df693e70f4e5fae1716a
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 17:32:15 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:24:12 2007 -0500

[SCSI] libiscsi: flush work before freeing connection

It's possible that we call iscsi_xmitworker after iscsi_conn_release
which causes a oops. This patch flushes the workqueue.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/libiscsi.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 7c75771..6346a91 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1597,6 +1597,9 @@ void iscsi_conn_teardown(struct iscsi_cls_conn *cls_conn)
wake_up(conn-ehwait);
}
 
+   /* flush queued up work because we free the connection below */
+   scsi_flush_work(session-host);
+
spin_lock_bh(session-lock);
kfree(conn-data);
kfree(conn-persistent_address);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] libiscsi: clear mtask

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05db888a46866fd4eae643792c162e1a5c1a8612
Commit: 05db888a46866fd4eae643792c162e1a5c1a8612
Parent: 779ea1207b6a43943faa44f41be7311263315604
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 17:32:16 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:26:05 2007 -0500

[SCSI] libiscsi: clear mtask

Consolidate the mtask clearing code.

Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/libiscsi.c |   19 ---
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 6346a91..0ad484f 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -577,7 +577,7 @@ void iscsi_conn_failure(struct iscsi_conn *conn, enum 
iscsi_err err)
 }
 EXPORT_SYMBOL_GPL(iscsi_conn_failure);
 
-static int iscsi_xmit_imm_task(struct iscsi_conn *conn)
+static int iscsi_xmit_mtask(struct iscsi_conn *conn)
 {
struct iscsi_hdr *hdr = conn-mtask-hdr;
int rc, was_logout = 0;
@@ -591,6 +591,9 @@ static int iscsi_xmit_imm_task(struct iscsi_conn *conn)
if (rc)
return rc;
 
+   /* done with this in-progress mtask */
+   conn-mtask = NULL;
+
if (was_logout) {
set_bit(ISCSI_SUSPEND_BIT, conn-suspend_tx);
return -ENODATA;
@@ -643,11 +646,9 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
conn-ctask = NULL;
}
if (conn-mtask) {
-   rc = iscsi_xmit_imm_task(conn);
+   rc = iscsi_xmit_mtask(conn);
if (rc)
goto again;
-   /* done with this in-progress mtask */
-   conn-mtask = NULL;
}
 
/* process immediate first */
@@ -658,12 +659,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
list_add_tail(conn-mtask-running,
  conn-mgmt_run_list);
spin_unlock_bh(conn-session-lock);
-   rc = iscsi_xmit_imm_task(conn);
+   rc = iscsi_xmit_mtask(conn);
if (rc)
goto again;
}
-   /* done with this mtask */
-   conn-mtask = NULL;
}
 
/* process command queue */
@@ -701,12 +700,10 @@ static int iscsi_data_xmit(struct iscsi_conn *conn)
list_add_tail(conn-mtask-running,
  conn-mgmt_run_list);
spin_unlock_bh(conn-session-lock);
-   rc = tt-xmit_mgmt_task(conn, conn-mtask);
-   if (rc)
+   rc = iscsi_xmit_mtask(conn);
+   if (rc)
goto again;
}
-   /* done with this mtask */
-   conn-mtask = NULL;
}
 
return -ENODATA;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] iscsi: rename DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bf32ed33e97ac7905fa5a2bf49a634c2eaf62457
Commit: bf32ed33e97ac7905fa5a2bf49a634c2eaf62457
Parent: 05db888a46866fd4eae643792c162e1a5c1a8612
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 17:32:17 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:26:50 2007 -0500

[SCSI] iscsi: rename DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH

This patch renames DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH to avoid
confusion with the drivers default values 
(DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH
is the iscsi RFC specific default).

Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/infiniband/ulp/iser/iser_initiator.c |2 +-
 drivers/scsi/iscsi_tcp.c |6 +++---
 drivers/scsi/libiscsi.c  |2 +-
 include/scsi/iscsi_proto.h   |   12 +++-
 4 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/drivers/infiniband/ulp/iser/iser_initiator.c 
b/drivers/infiniband/ulp/iser/iser_initiator.c
index 89e3728..3261bb3 100644
--- a/drivers/infiniband/ulp/iser/iser_initiator.c
+++ b/drivers/infiniband/ulp/iser/iser_initiator.c
@@ -201,7 +201,7 @@ static int iser_post_receive_control(struct iscsi_conn 
*conn)
 * what's common for both schemes is that the connection is not started
 */
if (conn-c_stage != ISCSI_CONN_STARTED)
-   rx_data_size = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
+   rx_data_size = ISCSI_DEF_MAX_RECV_SEG_LEN;
else /* FIXME till user space sets conn-max_recv_dlength correctly */
rx_data_size = 128;
 
diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 8f55e14..6fd0845 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -527,12 +527,12 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *conn)
 * than 8K, but there are no targets that currently do this.
 * For now we fail until we find a vendor that needs it
 */
-   if (DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH 
+   if (ISCSI_DEF_MAX_RECV_SEG_LEN 
tcp_conn-in.datalen) {
printk(KERN_ERR iscsi_tcp: received buffer of len %u 
  but conn buffer is only %u (opcode %0x)\n,
  tcp_conn-in.datalen,
- DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH, opcode);
+ ISCSI_DEF_MAX_RECV_SEG_LEN, opcode);
rc = ISCSI_ERR_PROTO;
break;
}
@@ -1762,7 +1762,7 @@ iscsi_tcp_conn_create(struct iscsi_cls_session 
*cls_session, uint32_t conn_idx)
 * due to strange issues with iser these are not set
 * in iscsi_conn_setup
 */
-   conn-max_recv_dlength = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
+   conn-max_recv_dlength = ISCSI_DEF_MAX_RECV_SEG_LEN;
 
tcp_conn = kzalloc(sizeof(*tcp_conn), GFP_KERNEL);
if (!tcp_conn)
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 0ad484f..04707d6 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -1520,7 +1520,7 @@ iscsi_conn_setup(struct iscsi_cls_session *cls_session, 
uint32_t conn_idx)
}
spin_unlock_bh(session-lock);
 
-   data = kmalloc(DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH, GFP_KERNEL);
+   data = kmalloc(ISCSI_DEF_MAX_RECV_SEG_LEN, GFP_KERNEL);
if (!data)
goto login_mtask_data_alloc_fail;
conn-login_mtask-data = conn-data = data;
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index 4a44278..8d1e4e8 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -588,7 +588,17 @@ struct iscsi_reject {
 #define VALUE_MAXLEN   255
 #define TARGET_NAME_MAXLEN VALUE_MAXLEN
 
-#define DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH   8192
+#define ISCSI_DEF_MAX_RECV_SEG_LEN 8192
+#define ISCSI_MIN_MAX_RECV_SEG_LEN 512
+#define ISCSI_MAX_MAX_RECV_SEG_LEN 16777215
+
+#define ISCSI_DEF_FIRST_BURST_LEN  65536
+#define ISCSI_MIN_FIRST_BURST_LEN  512
+#define ISCSI_MAX_FIRST_BURST_LEN  16777215
+
+#define ISCSI_DEF_MAX_BURST_LEN262144
+#define ISCSI_MIN_MAX_BURST_LEN512
+#define ISCSI_MAX_MAX_BURST_LEN16777215
 
 /* RFC 3720 End */
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] libiscsi: use get_unaligned

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8eb00539d92187ade7e4cc24a1a36ab248ee8639
Commit: 8eb00539d92187ade7e4cc24a1a36ab248ee8639
Parent: 41be14442213b6dbeea3cba2ed18a2923666278c
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 17:32:19 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:28:09 2007 -0500

[SCSI] libiscsi: use get_unaligned

Dave Miller meantioned that the data buffer in a past
sense fixup patch was not gauranteed to be aligned
properly for ia64. This patch has libiscsi use get_unalinged
to make sure. There are a couple more places in the
digest handling we may need to do this, but we are in the middle
of fixing that code for big endien systems so just the sense
access is fixed here.

Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/libiscsi.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c
index 04707d6..3f5b9b4 100644
--- a/drivers/scsi/libiscsi.c
+++ b/drivers/scsi/libiscsi.c
@@ -25,6 +25,7 @@
 #include linux/mutex.h
 #include linux/kfifo.h
 #include linux/delay.h
+#include asm/unaligned.h
 #include net/tcp.h
 #include scsi/scsi_cmnd.h
 #include scsi/scsi_device.h
@@ -269,14 +270,14 @@ invalid_datalen:
goto out;
}
 
-   senselen = be16_to_cpu(*(__be16 *)data);
+   senselen = be16_to_cpu(get_unaligned((__be16 *) data));
if (datalen  senselen)
goto invalid_datalen;
 
memcpy(sc-sense_buffer, data + 2,
   min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
debug_scsi(copied %d bytes of sense\n,
-  min(senselen, SCSI_SENSE_BUFFERSIZE));
+  min_t(uint16_t, senselen, SCSI_SENSE_BUFFERSIZE));
}
 
if (sc-sc_data_direction == DMA_TO_DEVICE)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] iscsi_tcp: increase max_sectors

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8231f0eddbe425cc3b54f2d723bb03531925272e
Commit: 8231f0eddbe425cc3b54f2d723bb03531925272e
Parent: 8eb00539d92187ade7e4cc24a1a36ab248ee8639
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 17:32:20 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:28:49 2007 -0500

[SCSI] iscsi_tcp: increase max_sectors

For a while now, the block layer has seperated max sectors
and max hw sectors. Software iscsi has no limit so this patch
increases max hw sectors, so we can support large pass through
commands.

Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/iscsi_tcp.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 6fd0845..861cb9b 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -2138,6 +2138,7 @@ static struct scsi_host_template iscsi_sht = {
.change_queue_depth = iscsi_change_queue_depth,
.can_queue  = ISCSI_XMIT_CMDS_MAX - 1,
.sg_tablesize   = ISCSI_SG_TABLESIZE,
+   .max_sectors= 0x,
.cmd_per_lun= ISCSI_DEF_CMD_PER_LUN,
.eh_abort_handler   = iscsi_eh_abort,
.eh_host_reset_handler  = iscsi_eh_host_reset,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] iscsi_tcp: print useful error message when iscsi crc23c allocation fails

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f238418b6d41cdfc85f2f399848429ff6fbfbd0
Commit: 0f238418b6d41cdfc85f2f399848429ff6fbfbd0
Parent: 8231f0eddbe425cc3b54f2d723bb03531925272e
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Wed Feb 28 17:32:21 2007 -0600
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:30:11 2007 -0500

[SCSI] iscsi_tcp: print useful error message when iscsi crc23c allocation 
fails

People do not read the README and seem to like to
unselect the crc32c module even though iscsi_tcp selects
it for them. This patch spits a error that tells the user
that they really do need the module. Hopefully, we will
get fewer people asking about this now.

Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/iscsi_tcp.c |   14 --
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/iscsi_tcp.c b/drivers/scsi/iscsi_tcp.c
index 861cb9b..c9a3abf 100644
--- a/drivers/scsi/iscsi_tcp.c
+++ b/drivers/scsi/iscsi_tcp.c
@@ -1777,14 +1777,24 @@ iscsi_tcp_conn_create(struct iscsi_cls_session 
*cls_session, uint32_t conn_idx)
tcp_conn-tx_hash.tfm = crypto_alloc_hash(crc32c, 0,
  CRYPTO_ALG_ASYNC);
tcp_conn-tx_hash.flags = 0;
-   if (IS_ERR(tcp_conn-tx_hash.tfm))
+   if (IS_ERR(tcp_conn-tx_hash.tfm)) {
+   printk(KERN_ERR Could not create connection due to crc32c 
+  loading error %ld. Make sure the crc32c module is 
+  built as a module or into the kernel\n,
+   PTR_ERR(tcp_conn-tx_hash.tfm));
goto free_tcp_conn;
+   }
 
tcp_conn-rx_hash.tfm = crypto_alloc_hash(crc32c, 0,
  CRYPTO_ALG_ASYNC);
tcp_conn-rx_hash.flags = 0;
-   if (IS_ERR(tcp_conn-rx_hash.tfm))
+   if (IS_ERR(tcp_conn-rx_hash.tfm)) {
+   printk(KERN_ERR Could not create connection due to crc32c 
+  loading error %ld. Make sure the crc32c module is 
+  built as a module or into the kernel\n,
+   PTR_ERR(tcp_conn-rx_hash.tfm));
goto free_tx_tfm;
+   }
 
return cls_conn;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] tgt: rm bio hacks in scsi tgt

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=181011e04a2a32f8d5df212254239ac9a3c8ab5e
Commit: 181011e04a2a32f8d5df212254239ac9a3c8ab5e
Parent: 0f238418b6d41cdfc85f2f399848429ff6fbfbd0
Author: Mike Christie [EMAIL PROTECTED]
AuthorDate: Sat Mar 3 09:55:54 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:31:33 2007 -0500

[SCSI] tgt: rm bio hacks in scsi tgt

scsi tgt breaks up a command into multple scatterlists
if we cannot fit all the data in one. This was because
the block rq helpers did not support large requests and
because we can get a command of any old size so it is
hard to preallocate pages for scatterlist large enough
(we cannot really preallocate pages with the bio map
user path). In 2.6.20, we added large request support to
the block layer helper, blk_rq_map_user. And at LSF,
we talked about increasing SCSI_MAX_PHYS_SEGMENTS for
scsi tgt if we want to support really really :) large
(greater than 256 * PAGE_SIZE in the worst mapping case)
requests.

The only target currently implemented does not even support
the multiple scatterlists stuff and only supports smaller
requests, so this patch just coverts scsi tgt to use
blk_rq_map_user.

Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_tgt_lib.c |  133 +++
 include/scsi/scsi_cmnd.h|3 -
 2 files changed, 34 insertions(+), 102 deletions(-)

diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index d402aff..47c29a9 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -28,7 +28,6 @@
 #include scsi/scsi_device.h
 #include scsi/scsi_host.h
 #include scsi/scsi_tgt.h
-#include ../drivers/md/dm-bio-list.h
 
 #include scsi_tgt_priv.h
 
@@ -42,9 +41,8 @@ static struct kmem_cache *scsi_tgt_cmd_cache;
 struct scsi_tgt_cmd {
/* TODO replace work with James b's code */
struct work_struct work;
-   /* TODO replace the lists with a large bio */
-   struct bio_list xfer_done_list;
-   struct bio_list xfer_list;
+   /* TODO fix limits of some drivers */
+   struct bio *bio;
 
struct list_head hash_list;
struct request *rq;
@@ -93,7 +91,12 @@ struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host 
*shost,
if (!tcmd)
goto put_dev;
 
-   rq = blk_get_request(shost-uspace_req_q, write, gfp_mask);
+   /*
+* The blk helpers are used to the READ/WRITE requests
+* transfering data from a initiator point of view. Since
+* we are in target mode we want the opposite.
+*/
+   rq = blk_get_request(shost-uspace_req_q, !write, gfp_mask);
if (!rq)
goto free_tcmd;
 
@@ -111,8 +114,6 @@ struct scsi_cmnd *scsi_host_get_command(struct Scsi_Host 
*shost,
rq-cmd_flags |= REQ_TYPE_BLOCK_PC;
rq-end_io_data = tcmd;
 
-   bio_list_init(tcmd-xfer_list);
-   bio_list_init(tcmd-xfer_done_list);
tcmd-rq = rq;
 
return cmd;
@@ -157,22 +158,6 @@ void scsi_host_put_command(struct Scsi_Host *shost, struct 
scsi_cmnd *cmd)
 }
 EXPORT_SYMBOL_GPL(scsi_host_put_command);
 
-static void scsi_unmap_user_pages(struct scsi_tgt_cmd *tcmd)
-{
-   struct bio *bio;
-
-   /* must call bio_endio in case bio was bounced */
-   while ((bio = bio_list_pop(tcmd-xfer_done_list))) {
-   bio_endio(bio, bio-bi_size, 0);
-   bio_unmap_user(bio);
-   }
-
-   while ((bio = bio_list_pop(tcmd-xfer_list))) {
-   bio_endio(bio, bio-bi_size, 0);
-   bio_unmap_user(bio);
-   }
-}
-
 static void cmd_hashlist_del(struct scsi_cmnd *cmd)
 {
struct request_queue *q = cmd-request-q;
@@ -185,6 +170,11 @@ static void cmd_hashlist_del(struct scsi_cmnd *cmd)
spin_unlock_irqrestore(qdata-cmd_hash_lock, flags);
 }
 
+static void scsi_unmap_user_pages(struct scsi_tgt_cmd *tcmd)
+{
+   blk_rq_unmap_user(tcmd-bio);
+}
+
 static void scsi_tgt_cmd_destroy(struct work_struct *work)
 {
struct scsi_tgt_cmd *tcmd =
@@ -193,16 +183,6 @@ static void scsi_tgt_cmd_destroy(struct work_struct *work)
 
dprintk(cmd %p %d %lu\n, cmd, cmd-sc_data_direction,
rq_data_dir(cmd-request));
-   /*
-* We fix rq-cmd_flags here since when we told bio_map_user
-* to write vm for WRITE commands, blk_rq_bio_prep set
-* rq_data_dir the flags to READ.
-*/
-   if (cmd-sc_data_direction == DMA_TO_DEVICE)
-   cmd-request-cmd_flags |= REQ_RW;
-   else
-   cmd-request-cmd_flags = ~REQ_RW;
-
scsi_unmap_user_pages(tcmd);
scsi_host_put_command(scsi_tgt_cmd_to_host(cmd), cmd);
 }
@@ -215,6 +195,7 @@ static 

[SCSI] tgt: fix sesnse buffer problems

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bc7e380a6a4c94f79a49c36bdb28062a750b3c2b
Commit: bc7e380a6a4c94f79a49c36bdb28062a750b3c2b
Parent: 181011e04a2a32f8d5df212254239ac9a3c8ab5e
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Sat Mar 3 09:55:54 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:39:27 2007 -0500

[SCSI] tgt: fix sesnse buffer problems

This patch simplify the way to notify LLDs of the command completion
and addresses the following sense buffer problems:

- can't handle both data and sense.
- forces user-space to use aligned sense buffer

tgt copies sense_data from userspace to cmnd-sense_buffer (if
necessary), maps user-space pages (if necessary) and then calls
host-transfer_response (host-transfer_data is removed).

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ibmvscsi/ibmvstgt.c |   21 ++-
 drivers/scsi/scsi_tgt_if.c   |6 +-
 drivers/scsi/scsi_tgt_lib.c  |  120 +++--
 drivers/scsi/scsi_tgt_priv.h |5 +-
 include/scsi/scsi_host.h |   19 ++-
 include/scsi/scsi_tgt_if.h   |6 +-
 6 files changed, 44 insertions(+), 133 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index 4368ca0..a7fbd10 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -273,23 +273,9 @@ static int ibmvstgt_rdma(struct scsi_cmnd *sc, struct 
scatterlist *sg, int nsg,
rest -= mlen;
}
 out:
-
return 0;
 }
 
-static int ibmvstgt_transfer_data(struct scsi_cmnd *sc,
- void (*done)(struct scsi_cmnd *))
-{
-   struct iu_entry *iue = (struct iu_entry *) sc-SCp.ptr;
-   int err;
-
-   err = srp_transfer_data(sc, vio_iu(iue)-srp.cmd, ibmvstgt_rdma, 1, 1);
-
-   done(sc);
-
-   return err;
-}
-
 static int ibmvstgt_cmd_done(struct scsi_cmnd *sc,
 void (*done)(struct scsi_cmnd *))
 {
@@ -297,7 +283,11 @@ static int ibmvstgt_cmd_done(struct scsi_cmnd *sc,
struct iu_entry *iue = (struct iu_entry *) sc-SCp.ptr;
struct srp_target *target = iue-target;
 
-   dprintk(%p %p %x\n, iue, target, vio_iu(iue)-srp.cmd.cdb[0]);
+   dprintk(%p %p %x %u\n, iue, target, vio_iu(iue)-srp.cmd.cdb[0],
+   cmd-usg_sg);
+
+   if (sc-use_sg)
+   srp_transfer_data(sc, vio_iu(iue)-srp.cmd, ibmvstgt_rdma, 1, 
1);
 
spin_lock_irqsave(target-lock, flags);
list_del(iue-ilist);
@@ -794,7 +784,6 @@ static struct scsi_host_template ibmvstgt_sht = {
.use_clustering = DISABLE_CLUSTERING,
.max_sectors= DEFAULT_MAX_SECTORS,
.transfer_response  = ibmvstgt_cmd_done,
-   .transfer_data  = ibmvstgt_transfer_data,
.eh_abort_handler   = ibmvstgt_eh_abort_handler,
.tsk_mgmt_response  = ibmvstgt_tsk_mgmt_response,
.shost_attrs= ibmvstgt_attrs,
diff --git a/drivers/scsi/scsi_tgt_if.c b/drivers/scsi/scsi_tgt_if.c
index 0e08817..ca22ddf 100644
--- a/drivers/scsi/scsi_tgt_if.c
+++ b/drivers/scsi/scsi_tgt_if.c
@@ -179,10 +179,12 @@ static int event_recv_msg(struct tgt_event *ev)
switch (ev-hdr.type) {
case TGT_UEVENT_CMD_RSP:
err = scsi_tgt_kspace_exec(ev-p.cmd_rsp.host_no,
-  ev-p.cmd_rsp.tag,
   ev-p.cmd_rsp.result,
-  ev-p.cmd_rsp.len,
+  ev-p.cmd_rsp.tag,
   ev-p.cmd_rsp.uaddr,
+  ev-p.cmd_rsp.len,
+  ev-p.cmd_rsp.sense_uaddr,
+  ev-p.cmd_rsp.sense_len,
   ev-p.cmd_rsp.rw);
break;
case TGT_UEVENT_TSK_MGMT_RSP:
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index 47c29a9..dc8781a 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -47,9 +47,6 @@ struct scsi_tgt_cmd {
struct list_head hash_list;
struct request *rq;
u64 tag;
-
-   void *buffer;
-   unsigned bufflen;
 };
 
 #define TGT_HASH_ORDER 4
@@ -330,10 +327,14 @@ static void scsi_tgt_cmd_done(struct scsi_cmnd *cmd)
dprintk(cmd %p %lu\n, cmd, rq_data_dir(cmd-request));
 
scsi_tgt_uspace_send_status(cmd, tcmd-tag);
+
+   if (cmd-request_buffer)
+   scsi_free_sgtable(cmd-request_buffer, cmd-sglist_len);
+
queue_work(scsi_tgtd, tcmd-work);
 }
 
-static int __scsi_tgt_transfer_response(struct 

[SCSI] tgt: fix scsi command leak

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e8f8248cbadcd8cb1b737fc57a01bccca4fb7aec
Commit: e8f8248cbadcd8cb1b737fc57a01bccca4fb7aec
Parent: bc7e380a6a4c94f79a49c36bdb28062a750b3c2b
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Sat Mar 3 09:55:55 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 11:39:39 2007 -0500

[SCSI] tgt: fix scsi command leak

The failure to map user-space pages leads to scsi command leak. It can
happens mostly because of user-space daemon bugs (or OOM). This patch
makes tgt just notify a LLD of the failure with sense when
blk_rq_map_user() fails.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_tgt_lib.c |   23 ---
 1 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index dc8781a..c05dff9 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -459,6 +459,16 @@ static struct request *tgt_cmd_hash_lookup(struct 
request_queue *q, u64 tag)
return rq;
 }
 
+static void scsi_tgt_build_sense(unsigned char *sense_buffer, unsigned char 
key,
+unsigned char asc, unsigned char asq)
+{
+   sense_buffer[0] = 0x70;
+   sense_buffer[2] = key;
+   sense_buffer[7] = 0xa;
+   sense_buffer[12] = asc;
+   sense_buffer[13] = asq;
+}
+
 int scsi_tgt_kspace_exec(int host_no, int result, u64 tag,
 unsigned long uaddr, u32 len, unsigned long 
sense_uaddr,
 u32 sense_len, u8 rw)
@@ -514,9 +524,16 @@ int scsi_tgt_kspace_exec(int host_no, int result, u64 tag,
if (len) {
err = scsi_map_user_pages(rq-end_io_data, cmd, uaddr, len, rw);
if (err) {
-   eprintk(%p %d\n, cmd, err);
-   err = -EAGAIN;
-   goto done;
+   /*
+* user-space daemon bugs or OOM
+* TODO: we can do better for OOM.
+*/
+   eprintk(cmd %p ret %d uaddr %lx len %d rw %d\n,
+   cmd, err, uaddr, len, rw);
+   cmd-result = SAM_STAT_CHECK_CONDITION;
+   memset(cmd-sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
+   scsi_tgt_build_sense(cmd-sense_buffer,
+HARDWARE_ERROR, 0, 0);
}
}
err = scsi_tgt_transfer_response(cmd);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] sd: typo fix: sdkp_printk should be sd_printk

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=56937f7b78d3e495a9f557775f3c3ea1d50ca7b3
Commit: 56937f7b78d3e495a9f557775f3c3ea1d50ca7b3
Parent: 38891cb6b0de3f5986e6a7688c5ae17c18b000a9
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Sun Mar 11 12:25:33 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Mar 11 12:25:33 2007 -0500

[SCSI] sd: typo fix: sdkp_printk should be sd_printk

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/sd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 30a4aa0..12e18bb 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -570,7 +570,7 @@ static int sd_release(struct inode *inode, struct file 
*filp)
struct scsi_disk *sdkp = scsi_disk(disk);
struct scsi_device *sdev = sdkp-device;
 
-   SCSI_LOG_HLQUEUE(3, sdkp_printk(KERN_INFO, sdkp, sd_release\n));
+   SCSI_LOG_HLQUEUE(3, sd_printk(KERN_INFO, sdkp, sd_release\n));
 
if (!--sdkp-openers  sdev-removable) {
if (scsi_block_when_processing_errors(sdev))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] fusion: kernel-doc warning fixes

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1544d67738c864245b8a061fb72093daeea8d4f1
Commit: 1544d67738c864245b8a061fb72093daeea8d4f1
Parent: 56937f7b78d3e495a9f557775f3c3ea1d50ca7b3
Author: Randy Dunlap [EMAIL PROTECTED]
AuthorDate: Tue Feb 20 11:17:03 2007 -0800
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:47:23 2007 -0500

[SCSI] fusion: kernel-doc warning fixes

Fix kernel-doc warnings in fusion driver code.

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
Acked-by: Moore, Eric [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/message/fusion/mptbase.c  |   22 +++---
 drivers/message/fusion/mptscsih.c |   15 ++-
 drivers/message/fusion/mptspi.c   |   11 +--
 3 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 083acfd..0a2d7db 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -4739,12 +4739,8 @@ mpt_readScsiDevicePageHeaders(MPT_ADAPTER *ioc, int 
portnum)
 }
 
 /**
- * mpt_inactive_raid_list_free
- *
- * This clears this link list.
- *
- * @ioc - pointer to per adapter structure
- *
+ * mpt_inactive_raid_list_free - This clears this link list.
+ * @ioc : pointer to per adapter structure
  **/
 static void
 mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
@@ -4764,15 +4760,11 @@ mpt_inactive_raid_list_free(MPT_ADAPTER *ioc)
 }
 
 /**
- * mpt_inactive_raid_volumes
- *
- * This sets up link list of phy_disk_nums for devices belonging in an 
inactive volume
- *
- * @ioc - pointer to per adapter structure
- * @channel - volume channel
- * @id - volume target id
- *
+ * mpt_inactive_raid_volumes - sets up link list of phy_disk_nums for devices 
belonging in an inactive volume
  *
+ * @ioc : pointer to per adapter structure
+ * @channel : volume channel
+ * @id : volume target id
  **/
 static void
 mpt_inactive_raid_volumes(MPT_ADAPTER *ioc, u8 channel, u8 id)
@@ -6663,7 +6655,7 @@ union loginfo_type {
 /**
  * mpt_iocstatus_info_config - IOCSTATUS information for config pages
  * @ioc: Pointer to MPT_ADAPTER structure
- * ioc_status: U32 IOCStatus word from IOC
+ * @ioc_status: U32 IOCStatus word from IOC
  * @mf: Pointer to MPT request frame
  *
  * Refer to lsi/mpi.h.
diff --git a/drivers/message/fusion/mptscsih.c 
b/drivers/message/fusion/mptscsih.c
index 2a3e9e6..eef00ed 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1537,21 +1537,23 @@ mptscsih_freeChainBuffers(MPT_ADAPTER *ioc, int req_idx)
 /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
 /**
  * mptscsih_TMHandler - Generic handler for SCSI Task Management.
- * Fall through to mpt_HardResetHandler if: not operational, too many
- * failed TM requests or handshake failure.
- *
- * @ioc: Pointer to MPT_ADAPTER structure
+ * @hd: Pointer to MPT SCSI HOST structure
  * @type: Task Management type
+ * @channel: channel number for task management
  * @id: Logical Target ID for reset (if appropriate)
  * @lun: Logical Unit for reset (if appropriate)
  * @ctx2abort: Context for the task to be aborted (if appropriate)
+ * @timeout: timeout for task management control
+ *
+ * Fall through to mpt_HardResetHandler if: not operational, too many
+ * failed TM requests or handshake failure.
  *
  * Remark: Currently invoked from a non-interrupt thread (_bh).
  *
  * Remark: With old EH code, at most 1 SCSI TaskMgmt function per IOC
  * will be active.
  *
- * Returns 0 for SUCCESS, or FAILED.
+ * Returns 0 for SUCCESS, or %FAILED.
  **/
 int
 mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, int lun, int 
ctx2abort, ulong timeout)
@@ -1650,9 +1652,11 @@ mptscsih_TMHandler(MPT_SCSI_HOST *hd, u8 type, u8 
channel, u8 id, int lun, int c
  * mptscsih_IssueTaskMgmt - Generic send Task Management function.
  * @hd: Pointer to MPT_SCSI_HOST structure
  * @type: Task Management type
+ * @channel: channel number for task management
  * @id: Logical Target ID for reset (if appropriate)
  * @lun: Logical Unit for reset (if appropriate)
  * @ctx2abort: Context for the task to be aborted (if appropriate)
+ * @timeout: timeout for task management control
  *
  * Remark: _HardResetHandler can be invoked from an interrupt thread 
(timer)
  * or a non-interrupt thread.  In the former, must not call schedule().
@@ -2022,6 +2026,7 @@ mptscsih_tm_pending_wait(MPT_SCSI_HOST * hd)
 /**
  * mptscsih_tm_wait_for_completion - wait for completion of TM task
  * @hd: Pointer to MPT host structure.
+ * @timeout: timeout value
  *
  * Returns {SUCCESS,FAILED}.
  */
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index 

[SCSI] make scsi_wait_scan always modular

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=840c2835a1c867281d27158378a9d34f593a7664
Commit: 840c2835a1c867281d27158378a9d34f593a7664
Parent: 1544d67738c864245b8a061fb72093daeea8d4f1
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Sun Mar 11 14:16:43 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:48:23 2007 -0500

[SCSI] make scsi_wait_scan always modular

Currently scsi_wait_scan is only built modular if SCSI is modular.
However, it's perfectly possible for a built in SCSI still to have
modular drivers and thus need scsi_wait_scan as a module.  Therefore,
scsi_wait_scan should always be built as a module (unless the kernel
doesn't support modules).

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/Kconfig  |6 ++
 drivers/scsi/Makefile |2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index 4cd280e..f3bc0f4 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -241,6 +241,12 @@ config SCSI_SCAN_ASYNC
  You can override this choice by specifying scsi_mod.scan=sync
  or async on the kernel's command line.
 
+config SCSI_WAIT_SCAN
+   tristate
+   default m
+   depends on SCSI
+   depends on MODULES
+
 menu SCSI Transports
depends on SCSI
 
diff --git a/drivers/scsi/Makefile b/drivers/scsi/Makefile
index 79ecf4e..41c7883 100644
--- a/drivers/scsi/Makefile
+++ b/drivers/scsi/Makefile
@@ -145,7 +145,7 @@ obj-$(CONFIG_CHR_DEV_SCH)   += ch.o
 # This goes last, so that real scsi devices probe earlier
 obj-$(CONFIG_SCSI_DEBUG)   += scsi_debug.o
 
-obj-$(CONFIG_SCSI) += scsi_wait_scan.o
+obj-$(CONFIG_SCSI_WAIT_SCAN)   += scsi_wait_scan.o
 
 scsi_mod-y += scsi.o hosts.o scsi_ioctl.o constants.o \
   scsicam.o scsi_error.o scsi_lib.o \
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: fix RSCN handling on big-endian systems

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b889d531b635da66ce2704a47febfed68173d9db
Commit: b889d531b635da66ce2704a47febfed68173d9db
Parent: 840c2835a1c867281d27158378a9d34f593a7664
Author: Malahal Naineni [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 10:41:26 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:49:40 2007 -0500

[SCSI] qla2xxx: fix RSCN handling on big-endian systems

qla2xxx driver fails to handle RSCN events affecting area or domain due
to an endian issue on big endian systems.  This fixes the port_id_t
structure on big endian systems.

Signed-off-by: Malahal Naineni [EMAIL PROTECTED]
Acked-by: Seokmann Ju [EMAIL PROTECTED]
Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_def.h |   13 -
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 05f4f2a..e8948b6 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1478,14 +1478,17 @@ typedef union {
uint32_t b24 : 24;
 
struct {
-   uint8_t d_id[3];
-   uint8_t rsvd_1;
-   } r;
-
-   struct {
+#ifdef __BIG_ENDIAN
+   uint8_t domain;
+   uint8_t area;
+   uint8_t al_pa;
+#elif __LITTLE_ENDIAN
uint8_t al_pa;
uint8_t area;
uint8_t domain;
+#else
+#error __BIG_ENDIAN or __LITTLE_ENDIAN must be defined!
+#endif
uint8_t rsvd_1;
} b;
 } port_id_t;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: Add scan_[start|finish]() callbacks for ISP24xx HBAs.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed6770863945e6695f403c7b951395dab298c392
Commit: ed6770863945e6695f403c7b951395dab298c392
Parent: b889d531b635da66ce2704a47febfed68173d9db
Author: Andrew Vasquez [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 10:41:27 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:50:05 2007 -0500

[SCSI] qla2xxx: Add scan_[start|finish]() callbacks for ISP24xx HBAs.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_os.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 68f5d24..f67ef38 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -157,6 +157,8 @@ static struct scsi_host_template qla24xx_driver_template = {
 
.slave_alloc= qla2xxx_slave_alloc,
.slave_destroy  = qla2xxx_slave_destroy,
+   .scan_finished  = qla2xxx_scan_finished,
+   .scan_start = qla2xxx_scan_start,
.change_queue_depth = qla2x00_change_queue_depth,
.change_queue_type  = qla2x00_change_queue_type,
.this_id= -1,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: Add cond_resched() calls during HBA flash manipulation.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=40a2e34a94c336b716f631b2952d233e1ba76e3c
Commit: 40a2e34a94c336b716f631b2952d233e1ba76e3c
Parent: ed6770863945e6695f403c7b951395dab298c392
Author: Andrew Vasquez [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 10:41:28 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:50:30 2007 -0500

[SCSI] qla2xxx: Add cond_resched() calls during HBA flash manipulation.

We're observing soft lockups during HBA FLASH retrieval and
update.  Add cond_resched() each time around the tight-loops
during flash read()s/write()s.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_sup.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index ff1dd41..362d041 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -466,6 +466,7 @@ qla24xx_read_flash_dword(scsi_qla_host_t *ha, uint32_t addr)
udelay(10);
else
rval = QLA_FUNCTION_TIMEOUT;
+   cond_resched();
}
 
/* TODO: What happens if we time out? */
@@ -508,6 +509,7 @@ qla24xx_write_flash_dword(scsi_qla_host_t *ha, uint32_t 
addr, uint32_t data)
udelay(10);
else
rval = QLA_FUNCTION_TIMEOUT;
+   cond_resched();
}
return rval;
 }
@@ -1255,6 +1257,7 @@ qla2x00_poll_flash(scsi_qla_host_t *ha, uint32_t addr, 
uint8_t poll_data,
}
udelay(10);
barrier();
+   cond_resched();
}
return status;
 }
@@ -1403,6 +1406,7 @@ qla2x00_read_flash_data(scsi_qla_host_t *ha, uint8_t 
*tmp_buf, uint32_t saddr,
if (saddr % 100)
udelay(10);
*tmp_buf = data;
+   cond_resched();
}
 }
 
@@ -1689,6 +1693,7 @@ update_flash:
rval = QLA_FUNCTION_FAILED;
break;
}
+   cond_resched();
}
} while (0);
qla2x00_flash_disable(ha);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: Drop acquisition of hardware_lock during flash manipulations.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fecf97882a8f1e9b52627c30322232c18060aa2c
Commit: fecf97882a8f1e9b52627c30322232c18060aa2c
Parent: 40a2e34a94c336b716f631b2952d233e1ba76e3c
Author: Andrew Vasquez [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 10:41:29 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:50:50 2007 -0500

[SCSI] qla2xxx: Drop acquisition of hardware_lock during flash 
manipulations.

There's no need given, I/O has been quiesced, RISC
interrupts have been disabled, and finally the RISC has been
paused.  Flash manipulation on ISP21xx, ISP22xx, and ISP23xx
parts requires the RISC to go through a full reset to
recover.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_sup.c |6 --
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 362d041..206bda0 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -1453,7 +1453,6 @@ uint8_t *
 qla2x00_read_optrom_data(struct scsi_qla_host *ha, uint8_t *buf,
 uint32_t offset, uint32_t length)
 {
-   unsigned long flags;
uint32_t addr, midpoint;
uint8_t *data;
struct device_reg_2xxx __iomem *reg = ha-iobase-isp;
@@ -1462,7 +1461,6 @@ qla2x00_read_optrom_data(struct scsi_qla_host *ha, 
uint8_t *buf,
qla2x00_suspend_hba(ha);
 
/* Go with read. */
-   spin_lock_irqsave(ha-hardware_lock, flags);
midpoint = ha-optrom_size / 2;
 
qla2x00_flash_enable(ha);
@@ -1477,7 +1475,6 @@ qla2x00_read_optrom_data(struct scsi_qla_host *ha, 
uint8_t *buf,
*data = qla2x00_read_flash_byte(ha, addr);
}
qla2x00_flash_disable(ha);
-   spin_unlock_irqrestore(ha-hardware_lock, flags);
 
/* Resume HBA. */
qla2x00_resume_hba(ha);
@@ -1491,7 +1488,6 @@ qla2x00_write_optrom_data(struct scsi_qla_host *ha, 
uint8_t *buf,
 {
 
int rval;
-   unsigned long flags;
uint8_t man_id, flash_id, sec_number, data;
uint16_t wd;
uint32_t addr, liter, sec_mask, rest_addr;
@@ -1504,7 +1500,6 @@ qla2x00_write_optrom_data(struct scsi_qla_host *ha, 
uint8_t *buf,
sec_number = 0;
 
/* Reset ISP chip. */
-   spin_lock_irqsave(ha-hardware_lock, flags);
WRT_REG_WORD(reg-ctrl_status, CSR_ISP_SOFT_RESET);
pci_read_config_word(ha-pdev, PCI_COMMAND, wd);
 
@@ -1697,7 +1692,6 @@ update_flash:
}
} while (0);
qla2x00_flash_disable(ha);
-   spin_unlock_irqrestore(ha-hardware_lock, flags);
 
/* Resume HBA. */
qla2x00_resume_hba(ha);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: Allow the extended-error-logging flag to be dynamic.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=27d940352840bb7a55c351b5b5d6e042fcaf8d47
Commit: 27d940352840bb7a55c351b5b5d6e042fcaf8d47
Parent: fecf97882a8f1e9b52627c30322232c18060aa2c
Author: Andrew Vasquez [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 10:41:30 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:51:20 2007 -0500

[SCSI] qla2xxx: Allow the extended-error-logging flag to be dynamic.

The module parameter, ql2xextended_error_logging, can now be
set dynamically by writing to the following sysfs entry:

/sys/module/qla2xxx/parameters/ql2xextended_error_logging

This alleviates the need for the driver to be unloaded and
reloaded in order to enable logging.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_os.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index f67ef38..b6c96a8 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -62,7 +62,7 @@ MODULE_PARM_DESC(ql2xallocfwdump,
vary by ISP type.  Default is 1 - allocate memory.);
 
 int ql2xextended_error_logging;
-module_param(ql2xextended_error_logging, int, S_IRUGO|S_IRUSR);
+module_param(ql2xextended_error_logging, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(ql2xextended_error_logging,
Option to enable extended error logging, 
Default is 0 - no logging. 1 - log errors.);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: Update version number to 8.01.07-k6.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=457620b47a5398e779584fc3c470683fbb3d1c8d
Commit: 457620b47a5398e779584fc3c470683fbb3d1c8d
Parent: 27d940352840bb7a55c351b5b5d6e042fcaf8d47
Author: Andrew Vasquez [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 10:41:31 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:51:36 2007 -0500

[SCSI] qla2xxx: Update version number to 8.01.07-k6.

Signed-off-by: Andrew Vasquez [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_version.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_version.h 
b/drivers/scsi/qla2xxx/qla_version.h
index 61347ae..dc85495 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
 /*
  * Driver version
  */
-#define QLA2XXX_VERSION  8.01.07-k5
+#define QLA2XXX_VERSION  8.01.07-k6
 
 #define QLA_DRIVER_MAJOR_VER   8
 #define QLA_DRIVER_MINOR_VER   1
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] fc_transport: update potential link speeds

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3d2350a8420dbf9d48f5f8a0fb72117bfcbc1b0
Commit: c3d2350a8420dbf9d48f5f8a0fb72117bfcbc1b0
Parent: 457620b47a5398e779584fc3c470683fbb3d1c8d
Author: James Smart [EMAIL PROTECTED]
AuthorDate: Mon Mar 12 14:16:35 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:52:04 2007 -0500

[SCSI] fc_transport: update potential link speeds

This patch updates the FC transport for all speeds identified in
SM-HBA.  Note: it does not sync the bit definitions, as that is
actually insulated from user-space via the sysfs text string. (I could
do it, but it does introduce a potential binary-incompatibility).

Signed-off-by: James Smart [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_transport_fc.c |2 ++
 include/scsi/scsi_transport_fc.h |2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c
index 58afdb4..14c4f06 100644
--- a/drivers/scsi/scsi_transport_fc.c
+++ b/drivers/scsi/scsi_transport_fc.c
@@ -200,6 +200,8 @@ static const struct {
{ FC_PORTSPEED_2GBIT,   2 Gbit },
{ FC_PORTSPEED_4GBIT,   4 Gbit },
{ FC_PORTSPEED_10GBIT,  10 Gbit },
+   { FC_PORTSPEED_8GBIT,   8 Gbit },
+   { FC_PORTSPEED_16GBIT,  16 Gbit },
{ FC_PORTSPEED_NOT_NEGOTIATED,  Not Negotiated },
 };
 fc_bitfield_name_search(port_speed, fc_port_speed_names)
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h
index 798f7c7..1e79730 100644
--- a/include/scsi/scsi_transport_fc.h
+++ b/include/scsi/scsi_transport_fc.h
@@ -108,6 +108,8 @@ enum fc_port_state {
 #define FC_PORTSPEED_2GBIT 2
 #define FC_PORTSPEED_4GBIT 4
 #define FC_PORTSPEED_10GBIT8
+#define FC_PORTSPEED_8GBIT 0x10
+#define FC_PORTSPEED_16GBIT0x20
 #define FC_PORTSPEED_NOT_NEGOTIATED(1  15) /* Speed not established */
 
 /*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] tgt: remove the code to build sense

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a52decafbe3fdca5e8430d4f58ffcec1f4a6302c
Commit: a52decafbe3fdca5e8430d4f58ffcec1f4a6302c
Parent: c3d2350a8420dbf9d48f5f8a0fb72117bfcbc1b0
Author: FUJITA Tomonori [EMAIL PROTECTED]
AuthorDate: Tue Mar 13 10:07:15 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:52:59 2007 -0500

[SCSI] tgt: remove the code to build sense

tgt notifies a LLD of the failure with sense when it hits the
user-space daemon bugs. However, tgt doesn't know anything about SCSI
devices that initiators talks to. So it's impossible to send proper
sense buffer (format and contents).

This patch changes tgt not to notify a LLD of the failure with bogus
sense. Instead, tgt just re-queues the failure command to the internal
list so that it will be freed cleanly later on when the scsi_host is
removed.

Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: Mike Christie [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_tgt_lib.c |   27 +--
 1 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index c05dff9..2570f48 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -459,16 +459,6 @@ static struct request *tgt_cmd_hash_lookup(struct 
request_queue *q, u64 tag)
return rq;
 }
 
-static void scsi_tgt_build_sense(unsigned char *sense_buffer, unsigned char 
key,
-unsigned char asc, unsigned char asq)
-{
-   sense_buffer[0] = 0x70;
-   sense_buffer[2] = key;
-   sense_buffer[7] = 0xa;
-   sense_buffer[12] = asc;
-   sense_buffer[13] = asq;
-}
-
 int scsi_tgt_kspace_exec(int host_no, int result, u64 tag,
 unsigned long uaddr, u32 len, unsigned long 
sense_uaddr,
 u32 sense_len, u8 rw)
@@ -528,12 +518,21 @@ int scsi_tgt_kspace_exec(int host_no, int result, u64 tag,
 * user-space daemon bugs or OOM
 * TODO: we can do better for OOM.
 */
+   struct scsi_tgt_queuedata *qdata;
+   struct list_head *head;
+   unsigned long flags;
+
eprintk(cmd %p ret %d uaddr %lx len %d rw %d\n,
cmd, err, uaddr, len, rw);
-   cmd-result = SAM_STAT_CHECK_CONDITION;
-   memset(cmd-sense_buffer, 0, SCSI_SENSE_BUFFERSIZE);
-   scsi_tgt_build_sense(cmd-sense_buffer,
-HARDWARE_ERROR, 0, 0);
+
+   qdata = shost-uspace_req_q-queuedata;
+   head = qdata-cmd_hash[cmd_hashfn(tcmd-tag)];
+
+   spin_lock_irqsave(qdata-cmd_hash_lock, flags);
+   list_add(tcmd-hash_list, head);
+   spin_unlock_irqrestore(qdata-cmd_hash_lock, flags);
+
+   goto done;
}
}
err = scsi_tgt_transfer_response(cmd);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] set resid in scsi_io_completion() even for check condition

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b22f687dd28a7a8886b918294b4d558ef175c07d
Commit: b22f687dd28a7a8886b918294b4d558ef175c07d
Parent: a52decafbe3fdca5e8430d4f58ffcec1f4a6302c
Author: Pete Wyckoff [EMAIL PROTECTED]
AuthorDate: Tue Mar 13 16:53:28 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:53:51 2007 -0500

[SCSI] set resid in scsi_io_completion() even for check condition

Some targets can return both valid data and sense information.
Always update the request data_len from the SCSI command residual.
Callers should interpret sense data to determine what parts of the
data are valid in case of a CHECK CONDITION status.

Signed-off-by: Pete Wyckoff [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_lib.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 5f95570..be8e655 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -848,8 +848,8 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int 
good_bytes)
memcpy(req-sense, cmd-sense_buffer,  len);
req-sense_len = len;
}
-   } else
-   req-data_len = cmd-resid;
+   }
+   req-data_len = cmd-resid;
}
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: add restart adapter platform function

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8418852d11f0bbaeebeedd4243560d8fdc85410d
Commit: 8418852d11f0bbaeebeedd4243560d8fdc85410d
Parent: b22f687dd28a7a8886b918294b4d558ef175c07d
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 10:26:05 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:54:11 2007 -0500

[SCSI] aacraid: add restart adapter platform function

Received from Mark Salyzyn,

This patch updates the adapter restart function to deal with some
adapters that have specific IOP reset needs. Since the code for
restarting the adapter was in two places, changed over to utilizing a
platform function in one place.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aacraid.h |4 
 drivers/scsi/aacraid/commsup.c |   13 +
 drivers/scsi/aacraid/rx.c  |   39 ++-
 3 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 39ecd0d..7e25c0b 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -497,6 +497,7 @@ struct adapter_ops
void (*adapter_enable_int)(struct aac_dev *dev);
int  (*adapter_sync_cmd)(struct aac_dev *dev, u32 command, u32 p1, u32 
p2, u32 p3, u32 p4, u32 p5, u32 p6, u32 *status, u32 *r1, u32 *r2, u32 *r3, u32 
*r4);
int  (*adapter_check_health)(struct aac_dev *dev);
+   int  (*adapter_restart)(struct aac_dev *dev, int bled);
/* Transport operations */
int  (*adapter_ioremap)(struct aac_dev * dev, u32 size);
irqreturn_t (*adapter_intr)(int irq, void *dev_id);
@@ -1060,6 +1061,9 @@ struct aac_dev
 #define aac_adapter_check_health(dev) \
(dev)-a_ops.adapter_check_health(dev)
 
+#define aac_adapter_restart(dev,bled) \
+   (dev)-a_ops.adapter_restart(dev,bled)
+
 #define aac_adapter_ioremap(dev, size) \
(dev)-a_ops.adapter_ioremap(dev, size)
 
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 1b97f60..55bf6f3 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -1035,7 +1035,6 @@ static void aac_handle_aif(struct aac_dev * dev, struct 
fib * fibptr)
 static int _aac_reset_adapter(struct aac_dev *aac)
 {
int index, quirks;
-   u32 ret;
int retval;
struct Scsi_Host *host;
struct scsi_device *dev;
@@ -1059,20 +1058,10 @@ static int _aac_reset_adapter(struct aac_dev *aac)
 *  If a positive health, means in a known DEAD PANIC
 * state and the adapter could be reset to `try again'.
 */
-   retval = aac_adapter_check_health(aac);
-   if (retval == 0)
-   retval = aac_adapter_sync_cmd(aac, IOP_RESET_ALWAYS,
- 0, 0, 0, 0, 0, 0, ret, NULL, NULL, NULL, NULL);
-   if (retval)
-   retval = aac_adapter_sync_cmd(aac, IOP_RESET,
- 0, 0, 0, 0, 0, 0, ret, NULL, NULL, NULL, NULL);
+   retval = aac_adapter_restart(aac, aac_adapter_check_health(aac));
 
if (retval)
goto out;
-   if (ret != 0x0001) {
-   retval = -ENODEV;
-   goto out;
-   }
 
/*
 *  Loop through the fibs, close the synchronous FIBS
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index d242e26..00e3cba 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -460,22 +460,31 @@ static int aac_rx_ioremap(struct aac_dev * dev, u32 size)
return 0;
 }
 
-static int aac_rx_restart_adapter(struct aac_dev *dev)
+static int aac_rx_restart_adapter(struct aac_dev *dev, int bled)
 {
u32 var;
 
-   printk(KERN_ERR %s%d: adapter kernel panic'd.\n,
-   dev-name, dev-id);
-
-   if (aac_rx_check_health(dev) = 0)
-   return 1;
-   if (rx_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0,
-   var, NULL, NULL, NULL, NULL))
-   return 1;
+   if (bled)
+   printk(KERN_ERR %s%d: adapter kernel panic'd %x.\n,
+   dev-name, dev-id, bled);
+   else
+   bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS,
+ 0, 0, 0, 0, 0, 0, var, NULL, NULL, NULL, NULL);
+   if (bled)
+   bled = aac_adapter_sync_cmd(dev, IOP_RESET,
+ 0, 0, 0, 0, 0, 0, var, NULL, NULL, NULL, NULL);
+
+   if (bled)
+   return -EINVAL;
+   if (var == 0x3803000F) { /* USE_OTHER_METHOD */
+   rx_writel(dev, MUnit.reserved2, 3);
+   msleep(5000); /* Delay 5 seconds */
+   var = 0x0001;
+   }
if (var != 0x0001)
-return 1;
+   return -EINVAL;
if (rx_readl(dev, 

[SCSI] aacraid: Fix struct element name issue

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a8166a52968216ae079a5530ac3269147de2ef31
Commit: a8166a52968216ae079a5530ac3269147de2ef31
Parent: 8418852d11f0bbaeebeedd4243560d8fdc85410d
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 10:26:22 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:54:25 2007 -0500

[SCSI] aacraid: Fix struct element name issue

Received from Mark Salyzyn,

This patch is to resolve a namespace issue that will result from a patch
expected in the future that adds a new interface; rationalized as
correcting a long term issue where hw_fib, instead of hw_fib_va, refers
to the virtual address space and hw_fib_pa refers to the physical
address space. A small fragment of this patch also cleans up an unused
variable that was close to the patch fragments.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aacraid.h  |4 +-
 drivers/scsi/aacraid/commctrl.c |   16 ++--
 drivers/scsi/aacraid/commsup.c  |   54 ++-
 drivers/scsi/aacraid/dpcsup.c   |8 +++---
 drivers/scsi/aacraid/rx.c   |4 +-
 5 files changed, 41 insertions(+), 45 deletions(-)

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 7e25c0b..9ca594b 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -834,7 +834,7 @@ struct fib {
 */
struct list_headfiblink;
void*data;
-   struct hw_fib   *hw_fib;/* Actual shared object 
*/
+   struct hw_fib   *hw_fib_va; /* Actual shared object 
*/
dma_addr_t  hw_fib_pa;  /* physical address of 
hw_fib*/
 };
 
@@ -1821,7 +1821,7 @@ int aac_fib_send(u16 command, struct fib * context, 
unsigned long size, int prio
 int aac_consumer_get(struct aac_dev * dev, struct aac_queue * q, struct 
aac_entry **entry);
 void aac_consumer_free(struct aac_dev * dev, struct aac_queue * q, u32 qnum);
 int aac_fib_complete(struct fib * context);
-#define fib_data(fibctx) ((void *)(fibctx)-hw_fib-data)
+#define fib_data(fibctx) ((void *)(fibctx)-hw_fib_va-data)
 struct aac_dev *aac_init_adapter(struct aac_dev *dev);
 int aac_get_config_status(struct aac_dev *dev, int commit_flag);
 int aac_get_containers(struct aac_dev *dev);
diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index e21070f..83d5680 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -69,7 +69,7 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user 
*arg)
return -ENOMEM;
}

-   kfib = fibptr-hw_fib;
+   kfib = fibptr-hw_fib_va;
/*
 *  First copy in the header so that we can check the size field.
 */
@@ -91,9 +91,9 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user 
*arg)
goto cleanup;
}
/* Highjack the hw_fib */
-   hw_fib = fibptr-hw_fib;
+   hw_fib = fibptr-hw_fib_va;
hw_fib_pa = fibptr-hw_fib_pa;
-   fibptr-hw_fib = kfib = pci_alloc_consistent(dev-pdev, size, 
fibptr-hw_fib_pa);
+   fibptr-hw_fib_va = kfib = pci_alloc_consistent(dev-pdev, 
size, fibptr-hw_fib_pa);
memset(((char *)kfib) + dev-max_fib_size, 0, size - 
dev-max_fib_size);
memcpy(kfib, hw_fib, dev-max_fib_size);
}
@@ -137,7 +137,7 @@ cleanup:
if (hw_fib) {
pci_free_consistent(dev-pdev, size, kfib, fibptr-hw_fib_pa);
fibptr-hw_fib_pa = hw_fib_pa;
-   fibptr-hw_fib = hw_fib;
+   fibptr-hw_fib_va = hw_fib;
}
if (retval != -EINTR)
aac_fib_free(fibptr);
@@ -282,15 +282,15 @@ return_fib:
fib = list_entry(entry, struct fib, fiblink);
fibctx-count--;
spin_unlock_irqrestore(dev-fib_lock, flags);
-   if (copy_to_user(f.fib, fib-hw_fib, sizeof(struct hw_fib))) {
-   kfree(fib-hw_fib);
+   if (copy_to_user(f.fib, fib-hw_fib_va, sizeof(struct hw_fib))) 
{
+   kfree(fib-hw_fib_va);
kfree(fib);
return -EFAULT;
}   
/*
 *  Free the space occupied by this copy of the fib.
 */
-   kfree(fib-hw_fib);
+   kfree(fib-hw_fib_va);
kfree(fib);
status = 0;
} else {
@@ -340,7 +340,7 @@ int aac_close_fib_context(struct aac_dev * dev, struct 
aac_fib_context * fibctx)
/*
 *  Free the space occupied by 

[SCSI] aacraid: Fix blocking issue with container probing function (cast update)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fe76df4235986cfacc2d3b71cef7c42bc1a6dd6c
Commit: fe76df4235986cfacc2d3b71cef7c42bc1a6dd6c
Parent: a8166a52968216ae079a5530ac3269147de2ef31
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 12:55:07 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:54:49 2007 -0500

[SCSI] aacraid: Fix blocking issue with container probing function (cast 
update)

Received from Mark Salyzyn,

The aac_probe_container call blocks. This is an issue because it is called 
on
occasion in the context of the queuecommand handler. Once in a blue moon 
this
has resulted in a kernel panic sleeping during interrupt; or problems with 
some
embedded system versions of the kernel that depend on queuecommand to not
block. This ugly patch rewrites the aac_probe_container call into a new 
routine
_aac_probe_container that is an asynchronous state machine to complete the
series of operations. The legacy blocking aac_probe_container call used in
other areas of the driver (during initialization scanning for all targets 
and
in the separate hot-add/remove [aacraid] thread) merely issues
_aac_probe_container and then simple spins calling schedule() waiting for
completion.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aachba.c |  311 ++---
 1 files changed, 169 insertions(+), 142 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index d789e61..1610f06 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -258,13 +258,10 @@ int aac_get_containers(struct aac_dev *dev)
u32 index; 
int status = 0;
struct fib * fibptr;
-   unsigned instance;
struct aac_get_container_count *dinfo;
struct aac_get_container_count_resp *dresp;
int maximum_num_containers = MAXIMUM_NUM_CONTAINERS;
 
-   instance = dev-scsi_host_ptr-unique_id;
-
if (!(fibptr = aac_fib_alloc(dev)))
return -ENOMEM;
 
@@ -284,88 +281,35 @@ int aac_get_containers(struct aac_dev *dev)
maximum_num_containers = 
le32_to_cpu(dresp-ContainerSwitchEntries);
aac_fib_complete(fibptr);
}
+   aac_fib_free(fibptr);
 
if (maximum_num_containers  MAXIMUM_NUM_CONTAINERS)
maximum_num_containers = MAXIMUM_NUM_CONTAINERS;
-   fsa_dev_ptr = kmalloc(
- sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL);
-   if (!fsa_dev_ptr) {
-   aac_fib_free(fibptr);
+   fsa_dev_ptr =  kmalloc(sizeof(*fsa_dev_ptr) * maximum_num_containers,
+   GFP_KERNEL);
+   if (!fsa_dev_ptr)
return -ENOMEM;
-   }
memset(fsa_dev_ptr, 0, sizeof(*fsa_dev_ptr) * maximum_num_containers);
 
dev-fsa_dev = fsa_dev_ptr;
dev-maximum_num_containers = maximum_num_containers;
 
-   for (index = 0; index  dev-maximum_num_containers; index++) {
-   struct aac_query_mount *dinfo;
-   struct aac_mount *dresp;
-
+   for (index = 0; index  dev-maximum_num_containers; ) {
fsa_dev_ptr[index].devname[0] = '\0';
 
-   aac_fib_init(fibptr);
-   dinfo = (struct aac_query_mount *) fib_data(fibptr);
-
-   dinfo-command = cpu_to_le32(VM_NameServe);
-   dinfo-count = cpu_to_le32(index);
-   dinfo-type = cpu_to_le32(FT_FILESYS);
+   status = aac_probe_container(dev, index);
 
-   status = aac_fib_send(ContainerCommand,
-   fibptr,
-   sizeof (struct aac_query_mount),
-   FsaNormal,
-   1, 1,
-   NULL, NULL);
-   if (status  0 ) {
+   if (status  0) {
printk(KERN_WARNING aac_get_containers: SendFIB 
failed.\n);
break;
}
-   dresp = (struct aac_mount *)fib_data(fibptr);
-
-   if ((le32_to_cpu(dresp-status) == ST_OK) 
-   (le32_to_cpu(dresp-mnt[0].vol) == CT_NONE)) {
-   dinfo-command = cpu_to_le32(VM_NameServe64);
-   dinfo-count = cpu_to_le32(index);
-   dinfo-type = cpu_to_le32(FT_FILESYS);
 
-   if (aac_fib_send(ContainerCommand,
-   fibptr,
-   sizeof(struct aac_query_mount),
-   FsaNormal,
-   1, 1,
-   NULL, NULL)  0)
-   continue;
- 

[SCSI] aacraid: Fix ioctl handling when adapter resets

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33bb3b296207ff4f9e3b8dddb623e645ee1b8809
Commit: 33bb3b296207ff4f9e3b8dddb623e645ee1b8809
Parent: fe76df4235986cfacc2d3b71cef7c42bc1a6dd6c
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 10:27:21 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:55:05 2007 -0500

[SCSI] aacraid: Fix ioctl handling when adapter resets

Received from Mark Salyzyn,

Outstanding ioctl calls still have some problems with aborting cleanly
in the face of a reset iop recovery action should the adapter ever enter
into a Firmware Assert (BlinkLED) condition. The enclosed patch resolves
some uncovered flawed handling.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/commctrl.c |7 +++
 drivers/scsi/aacraid/commsup.c  |   20 
 2 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 83d5680..3a8e7ca 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -64,6 +64,9 @@ static int ioctl_send_fib(struct aac_dev * dev, void __user 
*arg)
unsigned size;
int retval;
 
+   if (dev-in_reset) {
+   return -EBUSY;
+   }
fibptr = aac_fib_alloc(dev);
if(fibptr == NULL) {
return -ENOMEM;
@@ -469,6 +472,10 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
int i;
 
 
+   if (dev-in_reset) {
+   dprintk((KERN_DEBUGaacraid: send raw srb -EBUSY\n));
+   return -EBUSY;
+   }
if (!capable(CAP_SYS_ADMIN)){
dprintk((KERN_DEBUGaacraid: No permission to send raw 
srb\n)); 
return -EPERM;
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index e67ff13..c933df3 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -513,15 +513,15 @@ int aac_fib_send(u16 command, struct fib *fibptr, 
unsigned long size,
}
udelay(5);
}
-   } else if (down_interruptible(fibptr-event_wait)) {
-   spin_lock_irqsave(fibptr-event_lock, flags);
-   if (fibptr-done == 0) {
-   fibptr-done = 2; /* Tell interrupt we aborted 
*/
-   spin_unlock_irqrestore(fibptr-event_lock, 
flags);
-   return -EINTR;
-   }
+   } else
+   (void)down_interruptible(fibptr-event_wait);
+   spin_lock_irqsave(fibptr-event_lock, flags);
+   if (fibptr-done == 0) {
+   fibptr-done = 2; /* Tell interrupt we aborted */
spin_unlock_irqrestore(fibptr-event_lock, flags);
+   return -EINTR;
}
+   spin_unlock_irqrestore(fibptr-event_lock, flags);
BUG_ON(fibptr-done == 0);

if((fibptr-flags  FIB_CONTEXT_FLAG_TIMED_OUT)){
@@ -1062,7 +1062,7 @@ static int _aac_reset_adapter(struct aac_dev *aac)
/*
 *  Loop through the fibs, close the synchronous FIBS
 */
-   for (index = 0; index  (aac-scsi_host_ptr-can_queue + 
AAC_NUM_MGT_FIB); index++) {
+   for (retval = 1, index = 0; index  (aac-scsi_host_ptr-can_queue + 
AAC_NUM_MGT_FIB); index++) {
struct fib *fib = aac-fibs[index];
if (!(fib-hw_fib_va-header.XferState  
cpu_to_le32(NoResponseExpected | Async)) 
  (fib-hw_fib_va-header.XferState  
cpu_to_le32(ResponseExpected))) {
@@ -1071,8 +1071,12 @@ static int _aac_reset_adapter(struct aac_dev *aac)
up(fib-event_wait);
spin_unlock_irqrestore(fib-event_lock, flagv);
schedule();
+   retval = 0;
}
}
+   /* Give some extra time for ioctls to complete. */
+   if (retval == 0)
+   ssleep(2);
index = aac-cardtype;
 
/*
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: remove un-needed references to container id (cid)

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e7c349c91db3a9f9ac6cd74a693c4093c7d4571
Commit: 9e7c349c91db3a9f9ac6cd74a693c4093c7d4571
Parent: 33bb3b296207ff4f9e3b8dddb623e645ee1b8809
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 10:26:55 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:55:18 2007 -0500

[SCSI] aacraid: remove un-needed references to container id (cid)

Received from Mark Salyzyn,

This little patch removes the ',cid)' container identification argument
from some of the functions. The argument is used in some cases as merely
a debug helper and thus not used, and in others, the value can be
quickly acquired from the scsi command in their single solitary use in
the procedure rather than wasting resources on passing the argument in
from above.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aachba.c |   34 +-
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 1610f06..3d21d7d 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -375,7 +375,7 @@ static void get_container_name_callback(void *context, 
struct fib * fibptr)
 /**
  * aac_get_container_name  -   get container name, none blocking.
  */
-static int aac_get_container_name(struct scsi_cmnd * scsicmd, int cid)
+static int aac_get_container_name(struct scsi_cmnd * scsicmd)
 {
int status;
struct aac_get_name *dinfo;
@@ -392,7 +392,7 @@ static int aac_get_container_name(struct scsi_cmnd * 
scsicmd, int cid)
 
dinfo-command = cpu_to_le32(VM_ContainerConfig);
dinfo-type = cpu_to_le32(CT_READ_NAME);
-   dinfo-cid = cpu_to_le32(cid);
+   dinfo-cid = cpu_to_le32(scmd_id(scsicmd));
dinfo-count = cpu_to_le32(sizeof(((struct aac_get_name_resp 
*)NULL)-data));
 
status = aac_fib_send(ContainerCommand,
@@ -1361,7 +1361,7 @@ static void io_callback(void *context, struct fib * 
fibptr)
scsicmd-scsi_done(scsicmd);
 }
 
-static int aac_read(struct scsi_cmnd * scsicmd, int cid)
+static int aac_read(struct scsi_cmnd * scsicmd)
 {
u64 lba;
u32 count;
@@ -1375,7 +1375,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
 */
switch (scsicmd-cmnd[0]) {
case READ_6:
-   dprintk((KERN_DEBUG aachba: received a read(6) command on id 
%d.\n, cid));
+   dprintk((KERN_DEBUG aachba: received a read(6) command on id 
%d.\n, scmd_id(scsicmd)));
 
lba = ((scsicmd-cmnd[1]  0x1F)  16) | 
(scsicmd-cmnd[2]  8) | scsicmd-cmnd[3];
@@ -1385,7 +1385,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
count = 256;
break;
case READ_16:
-   dprintk((KERN_DEBUG aachba: received a read(16) command on id 
%d.\n, cid));
+   dprintk((KERN_DEBUG aachba: received a read(16) command on id 
%d.\n, scmd_id(scsicmd)));
 
lba =   ((u64)scsicmd-cmnd[2]  56) |
((u64)scsicmd-cmnd[3]  48) |
@@ -1399,7 +1399,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
(scsicmd-cmnd[12]  8) | scsicmd-cmnd[13];
break;
case READ_12:
-   dprintk((KERN_DEBUG aachba: received a read(12) command on id 
%d.\n, cid));
+   dprintk((KERN_DEBUG aachba: received a read(12) command on id 
%d.\n, scmd_id(scsicmd)));
 
lba = ((u64)scsicmd-cmnd[2]  24) | 
(scsicmd-cmnd[3]  16) |
@@ -1409,7 +1409,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
(scsicmd-cmnd[8]  8) | scsicmd-cmnd[9];
break;
default:
-   dprintk((KERN_DEBUG aachba: received a read(10) command on id 
%d.\n, cid));
+   dprintk((KERN_DEBUG aachba: received a read(10) command on id 
%d.\n, scmd_id(scsicmd)));
 
lba = ((u64)scsicmd-cmnd[2]  24) | 
(scsicmd-cmnd[3]  16) | 
@@ -1449,7 +1449,7 @@ static int aac_read(struct scsi_cmnd * scsicmd, int cid)
return 0;
 }
 
-static int aac_write(struct scsi_cmnd * scsicmd, int cid)
+static int aac_write(struct scsi_cmnd * scsicmd)
 {
u64 lba;
u32 count;
@@ -1468,7 +1468,7 @@ static int aac_write(struct scsi_cmnd * scsicmd, int cid)
if (count == 0)
count = 256;
} else if (scsicmd-cmnd[0] == WRITE_16) { /* 16 byte command */
-   dprintk((KERN_DEBUG aachba: received a write(16) command on id 
%d.\n, cid));
+   dprintk((KERN_DEBUG aachba: received a write(16) command on id 
%d.\n, scmd_id(scsicmd)));
 
   

[SCSI] aacraid: fix srb ioctl for 64 bits

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f2b1a06ad46209c6e631e3099138d1fa3f14d3a8
Commit: f2b1a06ad46209c6e631e3099138d1fa3f14d3a8
Parent: 9e7c349c91db3a9f9ac6cd74a693c4093c7d4571
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 10:27:32 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:55:40 2007 -0500

[SCSI] aacraid: fix srb ioctl for 64 bits

Received from Mark Salyzyn,

The raw srb ioctl is supposed to be able to take packets with 32 and 64 bit
virtual address SG elements, it did not handle the frames with 64 bit SG
elements well when communicating with 64 bit DMA capable adapters, and it 
did
not handle the 32 bit limited DMA adapters at all.  The enclosed patch now
handles all four quadrants (32 bit / 64 bit SG elements in SRB requests + 32
bit or 64 bit DMA capable adapters)

This fix is required before Java based management applications in a 64 bit 
user
space can submit raw srb requests to the array physical components via the
ioctl mechanism, the allocated user memory pool on 64 bit machines under 
this
environment forced the management software's hands to submit 64 bit user 
space
virtual address SG elements in via the ioctl.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/commctrl.c |  259 +++---
 1 files changed, 157 insertions(+), 102 deletions(-)

diff --git a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
index 3a8e7ca..987e35e 100644
--- a/drivers/scsi/aacraid/commctrl.c
+++ b/drivers/scsi/aacraid/commctrl.c
@@ -5,7 +5,7 @@
  * based on the old aacraid driver that is..
  * Adaptec aacraid device driver for Linux.
  *
- * Copyright (c) 2000 Adaptec, Inc. ([EMAIL PROTECTED])
+ * Copyright (c) 2000-2007 Adaptec, Inc. ([EMAIL PROTECTED])
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -468,7 +468,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
void *sg_list[32];
u32   sg_indx = 0;
u32 byte_count = 0;
-   u32 actual_fibsize = 0;
+   u32 actual_fibsize64, actual_fibsize = 0;
int i;
 
 
@@ -481,7 +481,7 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
return -EPERM;
}
/*
-*  Allocate and initialize a Fib then setup a BlockWrite command
+*  Allocate and initialize a Fib then setup a SRB command
 */
if (!(srbfib = aac_fib_alloc(dev))) {
return -ENOMEM;
@@ -548,129 +548,183 @@ static int aac_send_raw_srb(struct aac_dev* dev, void 
__user * arg)
rcode = -EINVAL;
goto cleanup;
}
-   if (dev-dac_support == 1) {
+   actual_fibsize = sizeof(struct aac_srb) - sizeof(struct sgentry) +
+   ((user_srbcmd-sg.count  0xff) * sizeof(struct sgentry));
+   actual_fibsize64 = actual_fibsize + (user_srbcmd-sg.count  0xff) *
+ (sizeof(struct sgentry64) - sizeof(struct sgentry));
+   /* User made a mistake - should not continue */
+   if ((actual_fibsize != fibsize)  (actual_fibsize64 != fibsize)) {
+   dprintk((KERN_DEBUGaacraid: Bad Size specified in 
+ Raw SRB command calculated fibsize=%lu;%lu 
+ user_srbcmd-sg.count=%d aac_srb=%lu sgentry=%lu;%lu 
+ issued fibsize=%d\n,
+ actual_fibsize, actual_fibsize64, user_srbcmd-sg.count,
+ sizeof(struct aac_srb), sizeof(struct sgentry),
+ sizeof(struct sgentry64), fibsize));
+   rcode = -EINVAL;
+   goto cleanup;
+   }
+   if ((data_dir == DMA_NONE)  user_srbcmd-sg.count) {
+   dprintk((KERN_DEBUGaacraid: SG with no direction specified in 
Raw SRB command\n));
+   rcode = -EINVAL;
+   goto cleanup;
+   }
+   byte_count = 0;
+   if (dev-adapter_info.options  AAC_OPT_SGMAP_HOST64) {
struct user_sgmap64* upsg = (struct 
user_sgmap64*)user_srbcmd-sg;
struct sgmap64* psg = (struct sgmap64*)srbcmd-sg;
-   struct user_sgmap* usg;
-   byte_count = 0;
 
/*
 * This should also catch if user used the 32 bit sgmap
 */
-   actual_fibsize = sizeof(struct aac_srb) - 
-   sizeof(struct sgentry) +
-   ((upsg-count  0xff) * 
-   sizeof(struct sgentry));
-   if(actual_fibsize != fibsize){ // User made a mistake - should 
not continue
-   dprintk((KERN_DEBUGaacraid: Bad Size specified in Raw 
SRB command\n));
-   rcode 

[SCSI] aacraid: Improved error handling

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03d4433721880bf1972c924b168e4e1dd3c59d53
Commit: 03d4433721880bf1972c924b168e4e1dd3c59d53
Parent: f2b1a06ad46209c6e631e3099138d1fa3f14d3a8
Author: Mark Haverkamp [EMAIL PROTECTED]
AuthorDate: Thu Mar 15 10:27:45 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:56:03 2007 -0500

[SCSI] aacraid: Improved error handling

Received from Mark Salyzyn,

This set of fixes improve error handling stability of the driver. A popular
manifestation of the problems is an NULL pointer reference in the interrupt
handler when referencing portions of the scsi command context, or in the
scsi_done handling when an offlined device is referenced.

The aacraid driver currently does not get notification of orphaned command
completions due to devices going offline. The driver also fails to handle 
the
commands that are finished by the error handler, and thus can complete again
later at the hands of the adapter causing situations of completion of an
invalid scsi command context. Test Unit Ready calls abort assuming that the
abort was successful, but are not, and thus when the interrupt from the 
adapter
occurs, they reference invalid command contexts. We add in a TIMED_OUT flag 
to
inform the aacraid FIB context that the interrupt service should merely 
release
the driver resources and not complete the command up. We take advantage of 
this
with the abort handler as well for select abortable commands. And we detect 
and
react if a command that can not be aborted is currently still outstanding to
the controller when reissued by the retry mechanism.

Signed-off-by: Mark Haverkamp [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aachba.c  |   51 ++--
 drivers/scsi/aacraid/aacraid.h |1 -
 drivers/scsi/aacraid/commsup.c |   23 +-
 drivers/scsi/aacraid/dpcsup.c  |   24 ---
 drivers/scsi/aacraid/linit.c   |   64 +--
 5 files changed, 130 insertions(+), 33 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 3d21d7d..0c4e27e 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -5,7 +5,7 @@
  * based on the old aacraid driver that is..
  * Adaptec aacraid device driver for Linux.
  *
- * Copyright (c) 2000 Adaptec, Inc. ([EMAIL PROTECTED])
+ * Copyright (c) 2000-2007 Adaptec, Inc. ([EMAIL PROTECTED])
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -172,6 +172,30 @@ MODULE_PARM_DESC(acbsize, Request a specific adapter 
control block (FIB) size.
 int expose_physicals = -1;
 module_param(expose_physicals, int, S_IRUGO|S_IWUSR);
 MODULE_PARM_DESC(expose_physicals, Expose physical components of the arrays. 
-1=protect 0=off, 1=on);
+
+
+static inline int aac_valid_context(struct scsi_cmnd *scsicmd,
+   struct fib *fibptr) {
+   struct scsi_device *device;
+
+   if (unlikely(!scsicmd || !scsicmd-scsi_done )) {
+   dprintk((KERN_WARNING aac_valid_context: scsi command 
corrupt\n))
+;
+aac_fib_complete(fibptr);
+aac_fib_free(fibptr);
+return 0;
+}
+   scsicmd-SCp.phase = AAC_OWNER_MIDLEVEL;
+   device = scsicmd-device;
+   if (unlikely(!device || !scsi_device_online(device))) {
+   dprintk((KERN_WARNING aac_valid_context: scsi device 
corrupt\n));
+   aac_fib_complete(fibptr);
+   aac_fib_free(fibptr);
+   return 0;
+   }
+   return 1;
+}
+
 /**
  * aac_get_config_status   -   check the adapter configuration
  * @common: adapter to query
@@ -342,6 +366,9 @@ static void get_container_name_callback(void *context, 
struct fib * fibptr)
scsicmd = (struct scsi_cmnd *) context;
scsicmd-SCp.phase = AAC_OWNER_MIDLEVEL;
 
+   if (!aac_valid_context(scsicmd, fibptr))
+   return;
+
dprintk((KERN_DEBUG get_container_name_callback[cpu %d]: t = %ld.\n, 
smp_processor_id(), jiffies));
BUG_ON(fibptr == NULL);
 
@@ -431,9 +458,14 @@ static int aac_probe_container_callback2(struct scsi_cmnd 
* scsicmd)
 
 static int _aac_probe_container2(void * context, struct fib * fibptr)
 {
-   struct scsi_cmnd * scsicmd = (struct scsi_cmnd *)context;
-   struct fsa_dev_info *fsa_dev_ptr = ((struct aac_dev 
*)(scsicmd-device-host-hostdata))-fsa_dev;
+   struct fsa_dev_info *fsa_dev_ptr;
int (*callback)(struct scsi_cmnd *);
+   struct scsi_cmnd * scsicmd = (struct scsi_cmnd *)context;
+
+   if (!aac_valid_context(scsicmd, fibptr))
+   return 0;
+
+   fsa_dev_ptr = ((struct aac_dev 

[SCSI] expose eh_timed_out to the host template

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6c5f8ce1fb7e8925d957f754a9513911399791b9
Commit: 6c5f8ce1fb7e8925d957f754a9513911399791b9
Parent: 03d4433721880bf1972c924b168e4e1dd3c59d53
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Fri Mar 16 17:44:41 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 10:56:49 2007 -0500

[SCSI] expose eh_timed_out to the host template

It looks like megaraid_sas at least needs this to throttle its commands
as they begin to time out.  The code keeps the existing transport
template use of eh_timed_out (and allows the transport to override the
host if they both have this callback).

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_error.c |   11 ++-
 include/scsi/scsi_host.h  |   13 +
 2 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index b8edcf5..7a1a1bb 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -184,10 +184,19 @@ int scsi_delete_timer(struct scsi_cmnd *scmd)
  **/
 void scsi_times_out(struct scsi_cmnd *scmd)
 {
+   enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
+
scsi_log_completion(scmd, TIMEOUT_ERROR);
 
if (scmd-device-host-transportt-eh_timed_out)
-   switch (scmd-device-host-transportt-eh_timed_out(scmd)) {
+   eh_timed_out = scmd-device-host-transportt-eh_timed_out;
+   else if (scmd-device-host-hostt-eh_timed_out)
+   eh_timed_out = scmd-device-host-hostt-eh_timed_out;
+   else
+   eh_timed_out = NULL;
+
+   if (eh_timed_out)
+   switch (eh_timed_out(scmd)) {
case EH_HANDLED:
__scsi_done(scmd);
return;
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 965b6b8..68f461b 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -326,6 +326,19 @@ struct scsi_host_template {
int (*proc_info)(struct Scsi_Host *, char *, char **, off_t, int, int);
 
/*
+* This is an optional routine that allows the transport to become
+* involved when a scsi io timer fires. The return value tells the
+* timer routine how to finish the io timeout handling:
+* EH_HANDLED:  I fixed the error, please complete the command
+* EH_RESET_TIMER:  I need more time, reset the timer and
+*  begin counting again
+* EH_NOT_HANDLED   Begin normal error recovery
+*
+* Status: OPTIONAL
+*/
+   enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
+
+   /*
 * suspend support
 */
int (*resume)(struct scsi_device *);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] eata_pio: Remove FALSE/TRUE defines

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f9279f23913045c810eeb4ab03c694c46231f75
Commit: 5f9279f23913045c810eeb4ab03c694c46231f75
Parent: 6c5f8ce1fb7e8925d957f754a9513911399791b9
Author: Richard Knutsson [EMAIL PROTECTED]
AuthorDate: Sun Mar 18 00:58:23 2007 +0100
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 11:27:03 2007 -0500

[SCSI] eata_pio: Remove FALSE/TRUE defines

eata_generic.h is only included by eata_pio.c and it only uses
FALSE/TRUE in comments.

Signed-off-by: Richard Knutsson [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/eata_generic.h |7 ---
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/drivers/scsi/eata_generic.h b/drivers/scsi/eata_generic.h
index 635c148..5016af5 100644
--- a/drivers/scsi/eata_generic.h
+++ b/drivers/scsi/eata_generic.h
@@ -18,13 +18,6 @@
  * Misc. definitions*
  */
 
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
 #define R_LIMIT 0x2
 
 #define MAXISA4
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] fusion: remove unnecessary code in mptscsih_resume()

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a1f9ce056a1875b6c8633f370df4fb169b925b16
Commit: a1f9ce056a1875b6c8633f370df4fb169b925b16
Parent: 5f9279f23913045c810eeb4ab03c694c46231f75
Author: Horms [EMAIL PROTECTED]
AuthorDate: Fri Mar 16 16:05:22 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 11:28:40 2007 -0500

[SCSI] fusion: remove unnecessary code in mptscsih_resume()

It seems that most of the code in mptscsih_resume() doesn't
do anything. This patch removes that code.

Signed-off-by: Simon Horman [EMAIL PROTECTED]
Acked-by: Moore, Eric [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/message/fusion/mptscsih.c |   12 
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/drivers/message/fusion/mptscsih.c 
b/drivers/message/fusion/mptscsih.c
index eef00ed..10927e3 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1188,19 +1188,7 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t 
state)
 int
 mptscsih_resume(struct pci_dev *pdev)
 {
-   MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
-   struct Scsi_Host*host = ioc-sh;
-   MPT_SCSI_HOST   *hd;
-
mpt_resume(pdev);
-
-   if(!host)
-   return 0;
-
-   hd = (MPT_SCSI_HOST *)host-hostdata;
-   if(!hd)
-   return 0;
-
return 0;
 }
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] fusion: honour return value of pci_enable_device() in mpt_resume()

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b364fd5081b02fa8a966a29eea2da628913fd4b8
Commit: b364fd5081b02fa8a966a29eea2da628913fd4b8
Parent: a1f9ce056a1875b6c8633f370df4fb169b925b16
Author: Horms [EMAIL PROTECTED]
AuthorDate: Mon Mar 19 15:06:44 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 11:30:31 2007 -0500

[SCSI] fusion: honour return value of pci_enable_device() in mpt_resume()

Honour the return value of pci_enable_device(), which
seems to be a desirable thing to do:

  2.6.20-rc4
  gcc (GCC) 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)

CC [M]  drivers/message/fusion/mptbase.o
drivers/message/fusion/mptbase.c: In function `mpt_resume':
drivers/message/fusion/mptbase.c:1541: warning: ignoring return value
of `pci_enable_device', declared with attribute warn_unused_result

It also in turn has mptscsih_resume() honour the return value of
mpt_resume()

I'm not sure about the handling of the other potential error cases
in mpt_resume(), of which there appear to be many. But this does
seem to be a good start.

Signed-off-by: Simon Horman [EMAIL PROTECTED]
Acked-by: Moore, Eric [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/message/fusion/mptbase.c  |5 -
 drivers/message/fusion/mptscsih.c |3 +--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c
index 0a2d7db..97471af 100644
--- a/drivers/message/fusion/mptbase.c
+++ b/drivers/message/fusion/mptbase.c
@@ -1531,6 +1531,7 @@ mpt_resume(struct pci_dev *pdev)
MPT_ADAPTER *ioc = pci_get_drvdata(pdev);
u32 device_state = pdev-current_state;
int recovery_state;
+   int err;
 
printk(MYIOC_s_INFO_FMT
pci-resume: pdev=0x%p, slot=%s, Previous operating state [D%d]\n,
@@ -1538,7 +1539,9 @@ mpt_resume(struct pci_dev *pdev)
 
pci_set_power_state(pdev, 0);
pci_restore_state(pdev);
-   pci_enable_device(pdev);
+   err = pci_enable_device(pdev);
+   if (err)
+   return err;
 
/* enable interrupts */
CHIPREG_WRITE32(ioc-chip-IntMask, MPI_HIM_DIM);
diff --git a/drivers/message/fusion/mptscsih.c 
b/drivers/message/fusion/mptscsih.c
index 10927e3..537fcc2 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1188,8 +1188,7 @@ mptscsih_suspend(struct pci_dev *pdev, pm_message_t state)
 int
 mptscsih_resume(struct pci_dev *pdev)
 {
-   mpt_resume(pdev);
-   return 0;
+   return mpt_resume(pdev);
 }
 
 #endif
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] sd: fix return value of sd_sync_cache()

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3721050afc6cb6ddf6de0f782e2054ebcc225e9b
Commit: 3721050afc6cb6ddf6de0f782e2054ebcc225e9b
Parent: ad8c31bb69d60c0c6bc6431bccdf67e5a96c0d31
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 00:07:18 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 11:33:32 2007 -0500

[SCSI] sd: fix return value of sd_sync_cache()

sd_sync_cache() should return -errno on error, fix it.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/sd.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 12e18bb..3dda77c 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -766,7 +766,9 @@ static int sd_sync_cache(struct scsi_disk *sdkp)
sd_print_sense_hdr(sdkp, sshdr);
}
 
-   return res;
+   if (res)
+   return -EIO;
+   return 0;
 }
 
 static int sd_issue_flush(struct device *dev, sector_t *error_sector)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] sd: implement START/STOP management

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c3c94c5a2fb43a654e777f509d5032b0db8ed09f
Commit: c3c94c5a2fb43a654e777f509d5032b0db8ed09f
Parent: 3721050afc6cb6ddf6de0f782e2054ebcc225e9b
Author: Tejun Heo [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 00:13:59 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 12:06:20 2007 -0500

[SCSI] sd: implement START/STOP management

Implement SBC START/STOP management.  sdev-mange_start_stop is added.
When it's set to one, sd STOPs the device on suspend and shutdown and
STARTs it on resume.  sdev-manage_start_stop defaults is in sdev
instead of scsi_disk cdev to allow -slave_config() override the
default configuration but is exported under scsi_disk sysfs node as
sdev-allow_restart is.

When manage_start_stop is zero (the default value), this patch doesn't
introduce any behavior change.

Signed-off-by: Tejun Heo [EMAIL PROTECTED]

Rejections fixed and
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_sysfs.c  |   31 --
 drivers/scsi/sd.c  |  101 
 include/scsi/scsi_device.h |1 +
 include/scsi/sd.h  |2 +
 4 files changed, 131 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index c275dca..96db51c 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -278,6 +278,7 @@ static int scsi_bus_match(struct device *dev, struct 
device_driver *gendrv)
 
 static int scsi_bus_suspend(struct device * dev, pm_message_t state)
 {
+   struct device_driver *drv = dev-driver;
struct scsi_device *sdev = to_scsi_device(dev);
struct scsi_host_template *sht = sdev-host-hostt;
int err;
@@ -286,23 +287,45 @@ static int scsi_bus_suspend(struct device * dev, 
pm_message_t state)
if (err)
return err;
 
-   if (sht-suspend)
+   /* call HLD suspend first */
+   if (drv  drv-suspend) {
+   err = drv-suspend(dev, state);
+   if (err)
+   return err;
+   }
+
+   /* then, call host suspend */
+   if (sht-suspend) {
err = sht-suspend(sdev, state);
+   if (err) {
+   if (drv  drv-resume)
+   drv-resume(dev);
+   return err;
+   }
+   }
 
-   return err;
+   return 0;
 }
 
 static int scsi_bus_resume(struct device * dev)
 {
+   struct device_driver *drv = dev-driver;
struct scsi_device *sdev = to_scsi_device(dev);
struct scsi_host_template *sht = sdev-host-hostt;
-   int err = 0;
+   int err = 0, err2 = 0;
 
+   /* call host resume first */
if (sht-resume)
err = sht-resume(sdev);
 
+   /* then, call HLD resume */
+   if (drv  drv-resume)
+   err2 = drv-resume(dev);
+
scsi_device_resume(sdev);
-   return err;
+
+   /* favor LLD failure */
+   return err ? err : err2;;
 }
 
 struct bus_type scsi_bus_type = {
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3dda77c..49a94ae 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -147,6 +147,20 @@ static ssize_t sd_store_cache_type(struct class_device 
*cdev, const char *buf,
return count;
 }
 
+static ssize_t sd_store_manage_start_stop(struct class_device *cdev,
+ const char *buf, size_t count)
+{
+   struct scsi_disk *sdkp = to_scsi_disk(cdev);
+   struct scsi_device *sdp = sdkp-device;
+
+   if (!capable(CAP_SYS_ADMIN))
+   return -EACCES;
+
+   sdp-manage_start_stop = simple_strtoul(buf, NULL, 10);
+
+   return count;
+}
+
 static ssize_t sd_store_allow_restart(struct class_device *cdev, const char 
*buf,
  size_t count)
 {
@@ -179,6 +193,14 @@ static ssize_t sd_show_fua(struct class_device *cdev, char 
*buf)
return snprintf(buf, 20, %u\n, sdkp-DPOFUA);
 }
 
+static ssize_t sd_show_manage_start_stop(struct class_device *cdev, char *buf)
+{
+   struct scsi_disk *sdkp = to_scsi_disk(cdev);
+   struct scsi_device *sdp = sdkp-device;
+
+   return snprintf(buf, 20, %u\n, sdp-manage_start_stop);
+}
+
 static ssize_t sd_show_allow_restart(struct class_device *cdev, char *buf)
 {
struct scsi_disk *sdkp = to_scsi_disk(cdev);
@@ -192,6 +214,8 @@ static struct class_device_attribute sd_disk_attrs[] = {
__ATTR(FUA, S_IRUGO, sd_show_fua, NULL),
__ATTR(allow_restart, S_IRUGO|S_IWUSR, sd_show_allow_restart,
   sd_store_allow_restart),
+   __ATTR(manage_start_stop, S_IRUGO|S_IWUSR, sd_show_manage_start_stop,
+  sd_store_manage_start_stop),
__ATTR_NULL,
 };
 
@@ -208,6 +232,8 @@ static struct scsi_driver sd_template = {
   

[SCSI] sd: fix up start/stop messages for new sd_printk() API

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc5d2c8c64804564617a7be71c73a075a426d1c6
Commit: cc5d2c8c64804564617a7be71c73a075a426d1c6
Parent: c3c94c5a2fb43a654e777f509d5032b0db8ed09f
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Tue Mar 20 12:26:03 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Mar 20 12:44:52 2007 -0500

[SCSI] sd: fix up start/stop messages for new sd_printk() API

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/sd.c |   38 --
 1 files changed, 16 insertions(+), 22 deletions(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 49a94ae..b044dcf 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -1733,10 +1733,11 @@ static void scsi_disk_release(struct class_device *cdev)
kfree(sdkp);
 }
 
-static int sd_start_stop_device(struct scsi_device *sdp, int start)
+static int sd_start_stop_device(struct scsi_disk *sdkp, int start)
 {
unsigned char cmd[6] = { START_STOP };  /* START_VALID */
struct scsi_sense_hdr sshdr;
+   struct scsi_device *sdp = sdkp-device;
int res;
 
if (start)
@@ -1748,12 +1749,10 @@ static int sd_start_stop_device(struct scsi_device 
*sdp, int start)
res = scsi_execute_req(sdp, cmd, DMA_NONE, NULL, 0, sshdr,
   SD_TIMEOUT, SD_MAX_RETRIES);
if (res) {
-   printk(KERN_WARNING FAILED\n  status = %x, message = %02x, 
-  host = %d, driver = %02x\n  ,
-  status_byte(res), msg_byte(res),
-  host_byte(res), driver_byte(res));
+   sd_printk(KERN_WARNING, sdkp, START_STOP FAILED\n);
+   sd_print_result(sdkp, res);
if (driver_byte(res)  DRIVER_SENSE)
-   scsi_print_sense_hdr(sd, sshdr);
+   sd_print_sense_hdr(sdkp, sshdr);
}
 
return res;
@@ -1766,7 +1765,6 @@ static int sd_start_stop_device(struct scsi_device *sdp, 
int start)
  */
 static void sd_shutdown(struct device *dev)
 {
-   struct scsi_device *sdp = to_scsi_device(dev);
struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
 
if (!sdkp)
@@ -1777,10 +1775,9 @@ static void sd_shutdown(struct device *dev)
sd_sync_cache(sdkp);
}
 
-   if (system_state != SYSTEM_RESTART  sdp-manage_start_stop) {
-   printk(KERN_NOTICE Stopping disk %s: \n,
-  sdkp-disk-disk_name);
-   sd_start_stop_device(sdp, 0);
+   if (system_state != SYSTEM_RESTART  sdkp-device-manage_start_stop) {
+   sd_printk(KERN_NOTICE, sdkp, Stopping disk\n);
+   sd_start_stop_device(sdkp, 0);
}
 
scsi_disk_put(sdkp);
@@ -1788,7 +1785,6 @@ static void sd_shutdown(struct device *dev)
 
 static int sd_suspend(struct device *dev, pm_message_t mesg)
 {
-   struct scsi_device *sdp = to_scsi_device(dev);
struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
int ret;
 
@@ -1796,17 +1792,16 @@ static int sd_suspend(struct device *dev, pm_message_t 
mesg)
return 0;   /* this can happen */
 
if (sdkp-WCE) {
-   printk(KERN_NOTICE Synchronizing SCSI cache for disk %s: \n,
-   sdkp-disk-disk_name);
+   sd_printk(KERN_NOTICE, sdkp, Synchronizing SCSI cache\n);
ret = sd_sync_cache(sdkp);
if (ret)
return ret;
}
 
-   if (mesg.event == PM_EVENT_SUSPEND  sdp-manage_start_stop) {
-   printk(KERN_NOTICE Stopping disk %s: \n,
-  sdkp-disk-disk_name);
-   ret = sd_start_stop_device(sdp, 0);
+   if (mesg.event == PM_EVENT_SUSPEND 
+   sdkp-device-manage_start_stop) {
+   sd_printk(KERN_NOTICE, sdkp, Stopping disk\n);
+   ret = sd_start_stop_device(sdkp, 0);
if (ret)
return ret;
}
@@ -1816,15 +1811,14 @@ static int sd_suspend(struct device *dev, pm_message_t 
mesg)
 
 static int sd_resume(struct device *dev)
 {
-   struct scsi_device *sdp = to_scsi_device(dev);
struct scsi_disk *sdkp = scsi_disk_get_from_dev(dev);
 
-   if (!sdp-manage_start_stop)
+   if (!sdkp-device-manage_start_stop)
return 0;
 
-   printk(KERN_NOTICE Starting disk %s: \n, sdkp-disk-disk_name);
+   sd_printk(KERN_NOTICE, sdkp, Starting disk\n);
 
-   return sd_start_stop_device(sdp, 1);
+   return sd_start_stop_device(sdkp, 1);
 }
 
 /**
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] fix scsi_wait_scan build problem

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0272bf7271eb6895b081c3df34c3ebe50cb769b7
Commit: 0272bf7271eb6895b081c3df34c3ebe50cb769b7
Parent: cc5d2c8c64804564617a7be71c73a075a426d1c6
Author: James Bottomley [EMAIL PROTECTED]
AuthorDate: Tue Mar 20 14:44:04 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Wed Mar 21 08:15:41 2007 -0600

[SCSI] fix scsi_wait_scan build problem

The #ifdef MODULE around the export of scsi_complete_async_scans()
which is the API the scsi_wait_scan module uses is incorrect and
causes the symbol to be undefined in certain circumstances leading to
a build failure.  Remove the defines.

Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/scsi_scan.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 0949145..a67f315 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -181,10 +181,8 @@ int scsi_complete_async_scans(void)
return 0;
 }
 
-#ifdef MODULE
 /* Only exported for the benefit of scsi_wait_scan */
 EXPORT_SYMBOL_GPL(scsi_complete_async_scans);
-#endif
 
 /**
  * scsi_unlock_floptical - unlock device via a special MODE SENSE command
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: check buffer address in aac_internal_transfer

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20235f35221472f1a127a5d5414f11091eb0a845
Commit: 20235f35221472f1a127a5d5414f11091eb0a845
Parent: 0272bf7271eb6895b081c3df34c3ebe50cb769b7
Author: Salyzyn, Mark [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 13:22:56 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Wed Mar 21 11:45:15 2007 -0600

[SCSI] aacraid: check buffer address in aac_internal_transfer

Captured a panic on an older kernel where an application issuing
commands via sg was sending requests that lacked a request_buffer, thus
the buffer pointer used in aac_internal_transer was NULL. The
application was fixed closing the issue, but felt it was advised to
immunize the driver against the eventuality.

Signed-off-by: Mark Salyzyn [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aachba.c |5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 0c4e27e..f9deab6 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -350,8 +350,9 @@ static void aac_internal_transfer(struct scsi_cmnd 
*scsicmd, void *data, unsigne
buf = scsicmd-request_buffer;
transfer_len = min(scsicmd-request_bufflen, len + offset);
}
-
-   memcpy(buf + offset, data, transfer_len - offset);
+   transfer_len -= offset;
+   if (buf  transfer_len)
+   memcpy(buf + offset, data, transfer_len);
 
if (scsicmd-use_sg) 
kunmap_atomic(buf - sg-offset, KM_IRQ0);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: cleanup and version stamp driver

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=802ae2f05b646c1e5f9e33cfe4c80cfa1452a0e3
Commit: 802ae2f05b646c1e5f9e33cfe4c80cfa1452a0e3
Parent: 20235f35221472f1a127a5d5414f11091eb0a845
Author: Salyzyn, Mark [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 13:49:47 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Wed Mar 21 12:03:52 2007 -0600

[SCSI] aacraid: cleanup and version stamp driver

There is some residual cleanup of the last series of patches and the
need to bump the revision number to draw the line in the sand.

The cmd-SCp.phase is set in the aac_valid_context routine, then set
again to the same value following it's return. The cmd-scsi_done is set
twice in the aac_queuecommand routine. Free up the scsidev FILO in
aac_probe_container as it is not needed further down the function in any
case. Improve the efficiency of the abort handler kernel print
parameters. Bump revision number of driver to approximate the equivalent
in the Adaptec supplied version.

Signed-off-by: Mark Salyzyn [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aachba.c  |6 +-
 drivers/scsi/aacraid/aacraid.h |4 ++--
 drivers/scsi/aacraid/linit.c   |7 +++
 3 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index f9deab6..fc16fe0 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -365,7 +365,6 @@ static void get_container_name_callback(void *context, 
struct fib * fibptr)
struct scsi_cmnd * scsicmd;
 
scsicmd = (struct scsi_cmnd *) context;
-   scsicmd-SCp.phase = AAC_OWNER_MIDLEVEL;
 
if (!aac_valid_context(scsicmd, fibptr))
return;
@@ -629,9 +628,9 @@ int aac_probe_container(struct aac_dev *dev, int cid)
if (_aac_probe_container(scsicmd, aac_probe_container_callback1) == 0)
while (scsicmd-device == scsidev)
schedule();
+   kfree(scsidev);
status = scsicmd-SCp.Status;
kfree(scsicmd);
-   kfree(scsidev);
return status;
 }
 
@@ -1321,7 +1320,6 @@ static void io_callback(void *context, struct fib * 
fibptr)
u32 cid;
 
scsicmd = (struct scsi_cmnd *) context;
-   scsicmd-SCp.phase = AAC_OWNER_MIDLEVEL;
 
if (!aac_valid_context(scsicmd, fibptr))
return;
@@ -1571,7 +1569,6 @@ static void synchronize_callback(void *context, struct 
fib *fibptr)
struct scsi_cmnd *cmd;
 
cmd = context;
-   cmd-SCp.phase = AAC_OWNER_MIDLEVEL;
 
if (!aac_valid_context(cmd, fibptr))
return;
@@ -2127,7 +2124,6 @@ static void aac_srb_callback(void *context, struct fib * 
fibptr)
struct scsi_cmnd *scsicmd;
 
scsicmd = (struct scsi_cmnd *) context;
-   scsicmd-SCp.phase = AAC_OWNER_MIDLEVEL;
 
if (!aac_valid_context(scsicmd, fibptr))
return;
diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 2c0994b..1771851 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -12,8 +12,8 @@
  
**/
 
 #ifndef AAC_DRIVER_BUILD
-# define AAC_DRIVER_BUILD 2423
-# define AAC_DRIVER_BRANCH -mh3
+# define AAC_DRIVER_BUILD 2437
+# define AAC_DRIVER_BRANCH -mh4
 #endif
 #define MAXIMUM_NUM_CONTAINERS 32
 
diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 3cf3f64..a5950c1 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -260,7 +260,6 @@ static int aac_queuecommand(struct scsi_cmnd *cmd, void 
(*done)(struct scsi_cmnd
(cmd-SCp.phase == AAC_OWNER_FIRMWARE))
return 0; /* Already owned by Adapter */
}
-   cmd-scsi_done = done;
cmd-SCp.phase = AAC_OWNER_LOWLEVEL;
return (aac_scsi_cmd(cmd) ? FAILED : 0);
 } 
@@ -461,15 +460,15 @@ static int aac_ioctl(struct scsi_device *sdev, int cmd, 
void __user * arg)
 
 static int aac_eh_abort(struct scsi_cmnd* cmd)
 {
-   struct Scsi_Host * host = cmd-device-host;
+   struct scsi_device * dev = cmd-device;
+   struct Scsi_Host * host = dev-host;
struct aac_dev * aac = (struct aac_dev *)host-hostdata;
int count;
int ret = FAILED;
 
printk(KERN_ERR %s: Host adapter abort request (%d,%d,%d,%d)\n,
AAC_DRIVERNAME,
-   cmd-device-host-host_no, sdev_channel(cmd-device),
-   sdev_id(cmd-device), cmd-device-lun);
+   host-host_no, sdev_channel(dev), sdev_id(dev), dev-lun);
switch (cmd-cmnd[0]) {
case SERVICE_ACTION_IN:
if (!(aac-raw_io_interface) ||
-
To unsubscribe from this list: send the line unsubscribe git-commits-head 

[SCSI] lpfc: fix oops when parsing dodgy VPD

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=07da60c1f45a6a5f563429e88e8c94c82f9132eb
Commit: 07da60c1f45a6a5f563429e88e8c94c82f9132eb
Parent: 802ae2f05b646c1e5f9e33cfe4c80cfa1452a0e3
Author: Anton Blanchard [EMAIL PROTECTED]
AuthorDate: Wed Mar 21 08:41:47 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:02:00 2007 -0500

[SCSI] lpfc: fix oops when parsing dodgy VPD

We have seen two cases where VPD on an emulex card has been incorrect
and we end up walking off the end of memory. It looks like someone made
an update (increased the length of a string) without increasing the
Length field. Then we do:

Length -= (3+i);

And since Length is unsigned it becomes very large and we loop forever
in the encapsulating:

while (Length  0) {

If we make Length signed then we fall out of the loop and proceed on.

Its important to note we have only seen this in the lab and it may be
the only two cases of this in existence, but since the rest of the code
has been written to be resilient against bad VPD we may as well fix this
too.

Signed-off-by: Anton Blanchard [EMAIL PROTECTED]
Acked-by: James Smart [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/lpfc/lpfc_init.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 9d014e5..09a9c8a 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -671,7 +671,7 @@ static int
 lpfc_parse_vpd(struct lpfc_hba * phba, uint8_t * vpd, int len)
 {
uint8_t lenlo, lenhi;
-   uint32_t Length;
+   int Length;
int i, j;
int finished = 0;
int index = 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] qla2xxx: fix for byteswap in fc_host fabric_name

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1196ae025ba4a36eb9e6baab57ba903d36139ff2
Commit: 1196ae025ba4a36eb9e6baab57ba903d36139ff2
Parent: 07da60c1f45a6a5f563429e88e8c94c82f9132eb
Author: Richard Lary [EMAIL PROTECTED]
AuthorDate: Thu Mar 22 10:53:19 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:03:00 2007 -0500

[SCSI] qla2xxx: fix for byteswap in fc_host fabric_name

This patch fixes byte swap issue in qla2xxx driver
to fix corrupted fabric_name passed to
/sys/class/fc_host/host*/fabric_name.

Signed-off-by: Richard Lary [EMAIL PROTECTED]
Acked-by: Seokmann Ju [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/qla2xxx/qla_mbx.c |   16 
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 83376f6..71e32a2 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -1280,14 +1280,14 @@ qla2x00_get_port_name(scsi_qla_host_t *ha, uint16_t 
loop_id, uint8_t *name,
} else {
if (name != NULL) {
/* This function returns name in big endian. */
-   name[0] = LSB(mcp-mb[2]);
-   name[1] = MSB(mcp-mb[2]);
-   name[2] = LSB(mcp-mb[3]);
-   name[3] = MSB(mcp-mb[3]);
-   name[4] = LSB(mcp-mb[6]);
-   name[5] = MSB(mcp-mb[6]);
-   name[6] = LSB(mcp-mb[7]);
-   name[7] = MSB(mcp-mb[7]);
+   name[0] = MSB(mcp-mb[2]);
+   name[1] = LSB(mcp-mb[2]);
+   name[2] = MSB(mcp-mb[3]);
+   name[3] = LSB(mcp-mb[3]);
+   name[4] = MSB(mcp-mb[6]);
+   name[5] = LSB(mcp-mb[6]);
+   name[6] = MSB(mcp-mb[7]);
+   name[7] = LSB(mcp-mb[7]);
}
 
DEBUG11(printk(qla2x00_get_port_name(%ld): done.\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: Add likely() and unlikely()

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=912d4e8851389eee5c289ce0a7953e9067198232
Commit: 912d4e8851389eee5c289ce0a7953e9067198232
Parent: 1196ae025ba4a36eb9e6baab57ba903d36139ff2
Author: Salyzyn, Mark [EMAIL PROTECTED]
AuthorDate: Mon Mar 26 09:21:14 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:04:02 2007 -0500

[SCSI] aacraid: Add likely() and unlikely()

Add some likely() and unlikely() compiler hints in some of the aacraid
hardware interface layers. There should be no operational side effects
resulting from this patch and the changes should be mostly benign on x86
platforms.

Signed-off-by: Mark Salyzyn [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/commsup.c |6 +---
 drivers/scsi/aacraid/rx.c  |   50 ++-
 2 files changed, 25 insertions(+), 31 deletions(-)

diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index a23d7e5..5824a75 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -519,11 +519,9 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned 
long size,
spin_unlock_irqrestore(fibptr-event_lock, flags);
BUG_ON(fibptr-done == 0);

-   if((fibptr-flags  FIB_CONTEXT_FLAG_TIMED_OUT)){
+   if(unlikely(fibptr-flags  FIB_CONTEXT_FLAG_TIMED_OUT))
return -ETIMEDOUT;
-   } else {
-   return 0;
-   }
+   return 0;
}
/*
 *  If the user does not want a response than return success 
otherwise
diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 6f8a194..391d475 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -5,7 +5,7 @@
  * based on the old aacraid driver that is..
  * Adaptec aacraid device driver for Linux.
  *
- * Copyright (c) 2000 Adaptec, Inc. ([EMAIL PROTECTED])
+ * Copyright (c) 2000-2007 Adaptec, Inc. ([EMAIL PROTECTED])
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -57,25 +57,25 @@ static irqreturn_t aac_rx_intr_producer(int irq, void 
*dev_id)
 *  been enabled.
 *  Check to see if this is our interrupt.  If it isn't just return
 */
-   if (intstat  ~(dev-OIMR)) {
+   if (likely(intstat  ~(dev-OIMR))) {
bellbits = rx_readl(dev, OutboundDoorbellReg);
-   if (bellbits  DoorBellPrintfReady) {
+   if (unlikely(bellbits  DoorBellPrintfReady)) {
aac_printf(dev, readl (dev-IndexRegs-Mailbox[5]));
rx_writel(dev, MUnit.ODR,DoorBellPrintfReady);
rx_writel(dev, InboundDoorbellReg,DoorBellPrintfDone);
}
-   else if (bellbits  DoorBellAdapterNormCmdReady) {
+   else if (unlikely(bellbits  DoorBellAdapterNormCmdReady)) {
rx_writel(dev, MUnit.ODR, DoorBellAdapterNormCmdReady);

aac_command_normal(dev-queues-queue[HostNormCmdQueue]);
}
-   else if (bellbits  DoorBellAdapterNormRespReady) {
+   else if (likely(bellbits  DoorBellAdapterNormRespReady)) {
rx_writel(dev, MUnit.ODR,DoorBellAdapterNormRespReady);

aac_response_normal(dev-queues-queue[HostNormRespQueue]);
}
-   else if (bellbits  DoorBellAdapterNormCmdNotFull) {
+   else if (unlikely(bellbits  DoorBellAdapterNormCmdNotFull)) {
rx_writel(dev, MUnit.ODR, 
DoorBellAdapterNormCmdNotFull);
}
-   else if (bellbits  DoorBellAdapterNormRespNotFull) {
+   else if (unlikely(bellbits  DoorBellAdapterNormRespNotFull)) {
rx_writel(dev, MUnit.ODR, 
DoorBellAdapterNormCmdNotFull);
rx_writel(dev, MUnit.ODR, 
DoorBellAdapterNormRespNotFull);
}
@@ -88,11 +88,11 @@ static irqreturn_t aac_rx_intr_message(int irq, void 
*dev_id)
 {
struct aac_dev *dev = dev_id;
u32 Index = rx_readl(dev, MUnit.OutboundQueue);
-   if (Index == 0xL)
+   if (unlikely(Index == 0xL))
Index = rx_readl(dev, MUnit.OutboundQueue);
-   if (Index != 0xL) {
+   if (likely(Index != 0xL)) {
do {
-   if (aac_intr_normal(dev, Index)) {
+   if (unlikely(aac_intr_normal(dev, Index))) {
rx_writel(dev, MUnit.OutboundQueue, Index);
rx_writel(dev, MUnit.ODR, 
DoorBellAdapterNormRespReady);
  

[SCSI] pcmcia: allow drivers to be built non-modular

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=023ae6199938fc79a51d2616903b44b07fe338b6
Commit: 023ae6199938fc79a51d2616903b44b07fe338b6
Parent: 912d4e8851389eee5c289ce0a7953e9067198232
Author: Robert P. J. Day [EMAIL PROTECTED]
AuthorDate: Mon Mar 26 16:06:45 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:07:14 2007 -0500

[SCSI] pcmcia: allow drivers to be built non-modular

Remove the Kconfig requirement that the PCMCIA SCSI drivers be built
only as modules, and allow them to be built into the kernel.

Signed-off-by: Robert P. J. Day [EMAIL PROTECTED]
Acked-by: Dominik Brodowski [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/pcmcia/Kconfig |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/pcmcia/Kconfig b/drivers/scsi/pcmcia/Kconfig
index eac8e17..7dd787f 100644
--- a/drivers/scsi/pcmcia/Kconfig
+++ b/drivers/scsi/pcmcia/Kconfig
@@ -3,11 +3,11 @@
 #
 
 menu PCMCIA SCSI adapter support
-   depends on SCSI!=n  PCMCIA!=n  MODULES
+   depends on SCSI!=n  PCMCIA!=n
 
 config PCMCIA_AHA152X
tristate Adaptec AHA152X PCMCIA support
-   depends on m  !64BIT
+   depends on !64BIT
select SCSI_SPI_ATTRS
help
  Say Y here if you intend to attach this type of PCMCIA SCSI host
@@ -18,7 +18,6 @@ config PCMCIA_AHA152X
 
 config PCMCIA_FDOMAIN
tristate Future Domain PCMCIA support
-   depends on m
help
  Say Y here if you intend to attach this type of PCMCIA SCSI host
  adapter to your computer.
@@ -28,7 +27,7 @@ config PCMCIA_FDOMAIN
 
 config PCMCIA_NINJA_SCSI
tristate NinjaSCSI-3 / NinjaSCSI-32Bi (16bit) PCMCIA support
-   depends on m  !64BIT
+   depends on !64BIT
help
  If you intend to attach this type of PCMCIA SCSI host adapter to
  your computer, say Y here and read
@@ -62,7 +61,6 @@ config PCMCIA_NINJA_SCSI
 
 config PCMCIA_QLOGIC
tristate Qlogic PCMCIA support
-   depends on m
help
  Say Y here if you intend to attach this type of PCMCIA SCSI host
  adapter to your computer.
@@ -72,7 +70,6 @@ config PCMCIA_QLOGIC
 
 config PCMCIA_SYM53C500
tristate Symbios 53c500 PCMCIA support
-   depends on m
help
  Say Y here if you have a New Media Bus Toaster or other PCMCIA
  SCSI adapter based on the Symbios 53c500 controller.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] dpt: whitespace cleanup

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0d06b281a1001ed40cace820d99eeb7d4453adb7
Commit: 0d06b281a1001ed40cace820d99eeb7d4453adb7
Parent: 023ae6199938fc79a51d2616903b44b07fe338b6
Author: Henne [EMAIL PROTECTED]
AuthorDate: Mon Mar 26 21:59:28 2007 -0800
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:10:04 2007 -0500

[SCSI] dpt: whitespace cleanup

Remove some trailing whitespaces and some replace whitespaces with tabs.

Signed-off-by: Henrik Kretzschmar [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Acked-by: Salyzyn, Mark [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/dpt/dpti_i2o.h   |   48 
 drivers/scsi/dpt/dpti_ioctl.h |2 +-
 drivers/scsi/dpt/dptsig.h |4 +-
 3 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/scsi/dpt/dpti_i2o.h b/drivers/scsi/dpt/dpti_i2o.h
index 5a49216..100b49b 100644
--- a/drivers/scsi/dpt/dpti_i2o.h
+++ b/drivers/scsi/dpt/dpti_i2o.h
@@ -31,7 +31,7 @@
  * Tunable parameters first
  */
 
-/* How many different OSM's are we allowing */ 
+/* How many different OSM's are we allowing */
 #define MAX_I2O_MODULES64
 
 #define I2O_EVT_CAPABILITY_OTHER   0x01
@@ -63,7 +63,7 @@ struct i2o_message
u16 size;
u32 target_tid:12;
u32 init_tid:12;
-   u32 function:8; 
+   u32 function:8;
u32 initiator_context;
/* List follows */
 };
@@ -77,7 +77,7 @@ struct i2o_device
 
char dev_name[8];   /* linux /dev name if available */
i2o_lct_entry lct_data;/* Device LCT information */
-   u32 flags;  
+   u32 flags;
struct proc_dir_entry* proc_entry;  /* /proc dir */
struct adpt_device *owner;
struct _adpt_hba *controller;   /* Controlling IOP */
@@ -86,7 +86,7 @@ struct i2o_device
 /*
  * Each I2O controller has one of these objects
  */
- 
+
 struct i2o_controller
 {
char name[16];
@@ -111,9 +111,9 @@ struct i2o_sys_tbl_entry
u32 iop_id:12;
u32 reserved2:20;
u16 seg_num:12;
-   u16 i2o_version:4;
-   u8  iop_state;
-   u8  msg_type;
+   u16 i2o_version:4;
+   u8  iop_state;
+   u8  msg_type;
u16 frame_size;
u16 reserved3;
u32 last_changed;
@@ -124,14 +124,14 @@ struct i2o_sys_tbl_entry
 
 struct i2o_sys_tbl
 {
-   u8  num_entries;
-   u8  version;
-   u16 reserved1;
+   u8  num_entries;
+   u8  version;
+   u16 reserved1;
u32 change_ind;
u32 reserved2;
u32 reserved3;
struct i2o_sys_tbl_entry iops[0];
-}; 
+};
 
 /*
  * I2O classes / subclasses
@@ -146,7 +146,7 @@ struct i2o_sys_tbl
 /*  Class code names
  *  (from v1.5 Table 6-1 Class Code Assignments.)
  */
- 
+
 #defineI2O_CLASS_EXECUTIVE 0x000
 #defineI2O_CLASS_DDM   0x001
 #defineI2O_CLASS_RANDOM_BLOCK_STORAGE  0x010
@@ -166,7 +166,7 @@ struct i2o_sys_tbl
 
 /*  Rest of 0x092 - 0x09f reserved for peer-to-peer classes
  */
- 
+
 #defineI2O_CLASS_MATCH_ANYCLASS0x
 
 /*  Subclasses
@@ -175,7 +175,7 @@ struct i2o_sys_tbl
 #defineI2O_SUBCLASS_i960   0x001
 #defineI2O_SUBCLASS_HDM0x020
 #defineI2O_SUBCLASS_ISM0x021
- 
+
 /* Operation functions */
 
 #define I2O_PARAMS_FIELD_GET   0x0001
@@ -219,7 +219,7 @@ struct i2o_sys_tbl
 /*
  * Messaging API values
  */
- 
+
 #defineI2O_CMD_ADAPTER_ASSIGN  0xB3
 #defineI2O_CMD_ADAPTER_READ0xB2
 #defineI2O_CMD_ADAPTER_RELEASE 0xB5
@@ -284,16 +284,16 @@ struct i2o_sys_tbl
 #define I2O_PRIVATE_MSG0xFF
 
 /*
- * Init Outbound Q status 
+ * Init Outbound Q status
  */
- 
+
 #define I2O_CMD_OUTBOUND_INIT_IN_PROGRESS  0x01
 #define I2O_CMD_OUTBOUND_INIT_REJECTED 0x02
 #define I2O_CMD_OUTBOUND_INIT_FAILED   0x03
 #define I2O_CMD_OUTBOUND_INIT_COMPLETE 0x04
 
 /*
- * I2O Get Status State values 
+ * I2O Get Status State values
  */
 
 #defineADAPTER_STATE_INITIALIZING  0x01
@@ -303,7 +303,7 @@ struct i2o_sys_tbl
 #defineADAPTER_STATE_OPERATIONAL   0x08
 #defineADAPTER_STATE_FAILED0x10
 #defineADAPTER_STATE_FAULTED   0x11
-   
+
 /* I2O API function return values */
 
 #define I2O_RTN_NO_ERROR   0
@@ -321,9 +321,9 @@ struct i2o_sys_tbl
 
 /* Reply message status defines for all messages */
 
-#define I2O_REPLY_STATUS_SUCCESS  

[SCSI] ibmvscsi: allow for dynamic adjustment of server request_limit

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a897ff2a6386ac4368ba41db18b626afd903f9d8
Commit: a897ff2a6386ac4368ba41db18b626afd903f9d8
Parent: a45c863f02c808107172b4b2975e1130c7da66d6
Author: Robert Jennings [EMAIL PROTECTED]
AuthorDate: Wed Mar 28 12:45:46 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:36:39 2007 -0500

[SCSI] ibmvscsi: allow for dynamic adjustment of server request_limit

The request limit calculations used previously on the client failed to
mirror the state of the server.  Additionally, when a value  3 was provided
there could be problems setting can_queue and handling abort and reset
commands.

Signed-off-by: Robert Jennings [EMAIL PROTECTED]
Signed-off-by: Santiago Leon [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ibmvscsi/ibmvscsi.c |   58 +-
 drivers/scsi/ibmvscsi/ibmvscsi.h |2 +
 2 files changed, 40 insertions(+), 20 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index fbc1d5c..383f594 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -85,7 +85,7 @@
 static int max_id = 64;
 static int max_channel = 3;
 static int init_timeout = 5;
-static int max_requests = 50;
+static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT;
 
 #define IBMVSCSI_VERSION 1.5.8
 
@@ -538,7 +538,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct 
*evt_struct,
int request_status;
int rc;
 
-   /* If we have exhausted our request limit, just fail this request.
+   /* If we have exhausted our request limit, just fail this request,
+* unless it is for a reset or abort.
 * Note that there are rare cases involving driver generated requests 
 * (such as task management requests) that the mid layer may think we
 * can handle more requests (can_queue) when we actually can't
@@ -551,9 +552,30 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct 
*evt_struct,
 */
if (request_status  -1)
goto send_error;
-   /* Otherwise, if we have run out of requests */
-   else if (request_status  0)
-   goto send_busy;
+   /* Otherwise, we may have run out of requests. */
+   /* Abort and reset calls should make it through.
+* Nothing except abort and reset should use the last two
+* slots unless we had two or less to begin with.
+*/
+   else if (request_status  2 
+evt_struct-iu.srp.cmd.opcode != SRP_TSK_MGMT) {
+   /* In the case that we have less than two requests
+* available, check the server limit as a combination
+* of the request limit and the number of requests
+* in-flight (the size of the send list).  If the
+* server limit is greater than 2, return busy so
+* that the last two are reserved for reset and abort.
+*/
+   int server_limit = request_status;
+   struct srp_event_struct *tmp_evt;
+
+   list_for_each_entry(tmp_evt, hostdata-sent, list) {
+   server_limit++;
+   }
+
+   if (server_limit  2)
+   goto send_busy;
+   }
}
 
/* Copy the IU into the transfer area */
@@ -572,6 +594,7 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct 
*evt_struct,
 
printk(KERN_ERR ibmvscsi: send error %d\n,
   rc);
+   atomic_inc(hostdata-request_limit);
goto send_error;
}
 
@@ -581,7 +604,8 @@ static int ibmvscsi_send_srp_event(struct srp_event_struct 
*evt_struct,
unmap_cmd_data(evt_struct-iu.srp.cmd, evt_struct, hostdata-dev);
 
free_event_struct(hostdata-pool, evt_struct);
-   return SCSI_MLQUEUE_HOST_BUSY;
+   atomic_inc(hostdata-request_limit);
+   return SCSI_MLQUEUE_HOST_BUSY;
 
  send_error:
unmap_cmd_data(evt_struct-iu.srp.cmd, evt_struct, hostdata-dev);
@@ -831,23 +855,16 @@ static void login_rsp(struct srp_event_struct *evt_struct)
 
printk(KERN_INFO ibmvscsi: SRP_LOGIN succeeded\n);
 
-   if (evt_struct-xfer_iu-srp.login_rsp.req_lim_delta 
-   (max_requests - 2))
-   evt_struct-xfer_iu-srp.login_rsp.req_lim_delta =
-   max_requests - 2;
+   if (evt_struct-xfer_iu-srp.login_rsp.req_lim_delta  0)
+   printk(KERN_ERR ibmvscsi: Invalid request_limit.\n);
 
-   /* Now we know what the real request-limit is */
+   /* Now we 

[SCSI] ibmvscsi: add slave_configure to allow device restart

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0979c84b4affaf924a894380dd0069638b64de03
Commit: 0979c84b4affaf924a894380dd0069638b64de03
Parent: a897ff2a6386ac4368ba41db18b626afd903f9d8
Author: Robert Jennings [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:30:40 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 10:37:02 2007 -0500

[SCSI] ibmvscsi: add slave_configure to allow device restart

Fixed the kernel-doc comment for ibmvscsi_slave_configure.  Thanks to
Randy Dunlap for pointing this out.

Adding a slave_configure function for the driver. Now the disks can be
restarted by the scsi mid-layer when the are disconnected and reconnected.

Signed-off-by: Robert Jennings [EMAIL PROTECTED]
Signed-off-by: Santiago Leon [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ibmvscsi/ibmvscsi.c |   22 ++
 1 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index 383f594..b10eefe 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -1354,6 +1354,27 @@ static int ibmvscsi_do_host_config(struct 
ibmvscsi_host_data *hostdata,
return rc;
 }
 
+/**
+ * ibmvscsi_slave_configure: Set the allow_restart flag for each disk.
+ * @sdev:  struct scsi_device device to configure
+ *
+ * Enable allow_restart for a device if it is a disk.  Adjust the
+ * queue_depth here also as is required by the documentation for
+ * struct scsi_host_template.
+ */
+static int ibmvscsi_slave_configure(struct scsi_device *sdev)
+{
+   struct Scsi_Host *shost = sdev-host;
+   unsigned long lock_flags = 0;
+
+   spin_lock_irqsave(shost-host_lock, lock_flags);
+   if (sdev-type == TYPE_DISK)
+   sdev-allow_restart = 1;
+   scsi_adjust_queue_depth(sdev, 0, shost-cmd_per_lun);
+   spin_unlock_irqrestore(shost-host_lock, lock_flags);
+   return 0;
+}
+
 /* 
  * sysfs attributes
  */
@@ -1499,6 +1520,7 @@ static struct scsi_host_template driver_template = {
.queuecommand = ibmvscsi_queuecommand,
.eh_abort_handler = ibmvscsi_eh_abort_handler,
.eh_device_reset_handler = ibmvscsi_eh_device_reset_handler,
+   .slave_configure = ibmvscsi_slave_configure,
.cmd_per_lun = 16,
.can_queue = IBMVSCSI_MAX_REQUESTS_DEFAULT,
.this_id = -1,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Make adapter operational timeout be per adapter type

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5469cb5bdef76dbe18865fff30975f0694fff2c2
Commit: 5469cb5bdef76dbe18865fff30975f0694fff2c2
Parent: 0979c84b4affaf924a894380dd0069638b64de03
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:42:40 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:15:26 2007 -0500

[SCSI] ipr: Make adapter operational timeout be per adapter type

Some ipr adapters may take longer than others to come operational.
This patch makes this timeout different for different adapters,
while still preserving the module parameter which can be used
to globally override the default.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |   29 +
 drivers/scsi/ipr.h |5 +
 2 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 95045e3..ba17ac5 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -89,7 +89,7 @@ static unsigned int ipr_log_level = IPR_DEFAULT_LOG_LEVEL;
 static unsigned int ipr_max_speed = 1;
 static int ipr_testmode = 0;
 static unsigned int ipr_fastfail = 0;
-static unsigned int ipr_transop_timeout = IPR_OPERATIONAL_TIMEOUT;
+static unsigned int ipr_transop_timeout = 0;
 static unsigned int ipr_enable_cache = 1;
 static unsigned int ipr_debug = 0;
 static int ipr_auto_create = 1;
@@ -6187,7 +6187,7 @@ static int ipr_reset_enable_ioa(struct ipr_cmnd *ipr_cmd)
dev_info(ioa_cfg-pdev-dev, Initializing IOA.\n);
 
ipr_cmd-timer.data = (unsigned long) ipr_cmd;
-   ipr_cmd-timer.expires = jiffies + (ipr_transop_timeout * HZ);
+   ipr_cmd-timer.expires = jiffies + (ioa_cfg-transop_timeout * HZ);
ipr_cmd-timer.function = (void (*)(unsigned long))ipr_oper_timeout;
ipr_cmd-done = ipr_reset_ioa_job;
add_timer(ipr_cmd-timer);
@@ -7232,6 +7232,13 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev,
goto out_scsi_host_put;
}
 
+   if (ipr_transop_timeout)
+   ioa_cfg-transop_timeout = ipr_transop_timeout;
+   else if (dev_id-driver_data  IPR_USE_LONG_TRANSOP_TIMEOUT)
+   ioa_cfg-transop_timeout = IPR_LONG_OPERATIONAL_TIMEOUT;
+   else
+   ioa_cfg-transop_timeout = IPR_OPERATIONAL_TIMEOUT;
+
ipr_regs_pci = pci_resource_start(pdev, 0);
 
rc = pci_request_regions(pdev, IPR_NAME);
@@ -7539,29 +7546,35 @@ static struct pci_device_id ipr_pci_table[] 
__devinitdata = {
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571A, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE,
-   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B, 0, 0, 0 },
+   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575B, 0, 0,
+   IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
  PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 },
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
  PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 },
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN,
- PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0, 0 },
+ PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0,
+ IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
  PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572A, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
  PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572B, 0, 0, 0 },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN,
- PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0, 0 },
+ PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0,
+ IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E,
- PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, 0, 0, 0 },
+ PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, 0, 0,
+ IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_2780, 0, 0, 0 },
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571E, 0, 0, 0 },
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
-   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F, 0, 0, 0 },
+   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_571F, 0, 0,
+   IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
-   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, 0, 0, 0 },
+   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, 0, 0,
+   IPR_USE_LONG_TRANSOP_TIMEOUT },
{ }
 };
 

[SCSI] ipr: Remove auto RAID create module parameter

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7d2267bb9d94aabfa316a13d04b0bce2fb51ff83
Commit: 7d2267bb9d94aabfa316a13d04b0bce2fb51ff83
Parent: 5469cb5bdef76dbe18865fff30975f0694fff2c2
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:42:47 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:15:45 2007 -0500

[SCSI] ipr: Remove auto RAID create module parameter

Remove the auto RAID 0 array creation module parameter, since
support for this function has been removed from the firmware.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |5 -
 1 files changed, 0 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index ba17ac5..6bd64d4 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -92,7 +92,6 @@ static unsigned int ipr_fastfail = 0;
 static unsigned int ipr_transop_timeout = 0;
 static unsigned int ipr_enable_cache = 1;
 static unsigned int ipr_debug = 0;
-static int ipr_auto_create = 1;
 static DEFINE_SPINLOCK(ipr_driver_lock);
 
 /* This table describes the differences between DMA controller chips */
@@ -159,8 +158,6 @@ module_param_named(enable_cache, ipr_enable_cache, int, 0);
 MODULE_PARM_DESC(enable_cache, Enable adapter's non-volatile write cache 
(default: 1));
 module_param_named(debug, ipr_debug, int, 0);
 MODULE_PARM_DESC(debug, Enable device driver debugging logging. Set to 1 to 
enable. (default: 0));
-module_param_named(auto_create, ipr_auto_create, int, 0);
-MODULE_PARM_DESC(auto_create, Auto-create single device RAID 0 arrays when 
initialized (default: 1));
 MODULE_LICENSE(GPL);
 MODULE_VERSION(IPR_DRIVER_VERSION);
 
@@ -7116,8 +7113,6 @@ static void __devinit ipr_init_ioa_cfg(struct ipr_ioa_cfg 
*ioa_cfg,
ioa_cfg-pdev = pdev;
ioa_cfg-log_level = ipr_log_level;
ioa_cfg-doorbell = IPR_DOORBELL;
-   if (!ipr_auto_create)
-   ioa_cfg-doorbell |= IPR_RUNTIME_RESET;
sprintf(ioa_cfg-eye_catcher, IPR_EYECATCHER);
sprintf(ioa_cfg-trace_start, IPR_TRACE_START_LABEL);
sprintf(ioa_cfg-ipr_free_label, IPR_FREEQ_LABEL);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Add new PCI-E IDs to device table

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=185eb31cc242f415800a1a06dca522d27c269279
Commit: 185eb31cc242f415800a1a06dca522d27c269279
Parent: 7d2267bb9d94aabfa316a13d04b0bce2fb51ff83
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:42:53 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:16:14 2007 -0500

[SCSI] ipr: Add new PCI-E IDs to device table

Adds support for some new PCI-E ipr adapters.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |   10 ++
 drivers/scsi/ipr.h |5 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 6bd64d4..4fd6a3d 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -7558,6 +7558,13 @@ static struct pci_device_id ipr_pci_table[] 
__devinitdata = {
  PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575C, 0, 0,
  IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E,
+ PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_574E, 0, 0, 0 },
+   { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E,
+ PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_575D, 0, 0,
+ IPR_USE_LONG_TRANSOP_TIMEOUT },
+   { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E,
+ PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B3, 0, 0, 0 },
+   { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E,
  PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_57B7, 0, 0,
  IPR_USE_LONG_TRANSOP_TIMEOUT },
{ PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE,
@@ -7570,6 +7577,9 @@ static struct pci_device_id ipr_pci_table[] __devinitdata 
= {
{ PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP,
PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_572F, 0, 0,
IPR_USE_LONG_TRANSOP_TIMEOUT },
+   { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SCAMP_E,
+   PCI_VENDOR_ID_IBM, IPR_SUBS_DEV_ID_574D, 0, 0,
+   IPR_USE_LONG_TRANSOP_TIMEOUT },
{ }
 };
 MODULE_DEVICE_TABLE(pci, ipr_pci_table);
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index c83ccbb..4d06888 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -55,6 +55,7 @@
 #define IPR_NUM_BASE_CMD_BLKS  100
 
 #define PCI_DEVICE_ID_IBM_OBSIDIAN_E   0x0339
+#define PCI_DEVICE_ID_IBM_SCAMP_E  0x034A
 
 #define IPR_SUBS_DEV_ID_2780   0x0264
 #define IPR_SUBS_DEV_ID_5702   0x0266
@@ -69,8 +70,12 @@
 #define IPR_SUBS_DEV_ID_572A   0x02C1
 #define IPR_SUBS_DEV_ID_572B   0x02C2
 #define IPR_SUBS_DEV_ID_572F   0x02C3
+#define IPR_SUBS_DEV_ID_574D   0x030B
+#define IPR_SUBS_DEV_ID_574E   0x030A
 #define IPR_SUBS_DEV_ID_575B   0x030D
 #define IPR_SUBS_DEV_ID_575C   0x0338
+#define IPR_SUBS_DEV_ID_575D   0x033E
+#define IPR_SUBS_DEV_ID_57B3   0x033A
 #define IPR_SUBS_DEV_ID_57B7   0x0360
 #define IPR_SUBS_DEV_ID_57B8   0x02C2
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Enable logging of debug error data for all devices

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cc9bd5d4256ecc1b6e0448febb4be29db1a91256
Commit: cc9bd5d4256ecc1b6e0448febb4be29db1a91256
Parent: 185eb31cc242f415800a1a06dca522d27c269279
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:01 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:16:34 2007 -0500

[SCSI] ipr: Enable logging of debug error data for all devices

The ipr driver has a sysfs attribute which can be used to
adjust the logging level of the driver for error events.
The error response data for commands can be dumped by
increasing the logging level of the ipr driver. This
currently only works for JBOD passthrough devices.
This patch enables this function for all devices, including
RAID devices, to aid in debugging problems.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |9 ++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 4fd6a3d..5b6ffe1 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4473,6 +4473,9 @@ static void ipr_dump_ioasa(struct ipr_ioa_cfg *ioa_cfg,
if (ioasa-ilid != 0)
return;
 
+   if (!ipr_is_gscsi(res))
+   return;
+
if (ipr_error_table[error_index].log_ioasa == 0)
return;
}
@@ -4632,11 +4635,11 @@ static void ipr_erp_start(struct ipr_ioa_cfg *ioa_cfg,
return;
}
 
-   if (ipr_is_gscsi(res))
-   ipr_dump_ioasa(ioa_cfg, ipr_cmd, res);
-   else
+   if (!ipr_is_gscsi(res))
ipr_gen_sense(ipr_cmd);
 
+   ipr_dump_ioasa(ioa_cfg, ipr_cmd, res);
+
switch (ioasc  IPR_IOASC_IOASC_MASK) {
case IPR_IOASC_ABORTED_CMD_TERM_BY_HOST:
if (ipr_is_naca_model(res))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Log error for SAS dual path switch

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0692dd4d7e90ce5cf1241731c6e80118402e3b4
Commit: b0692dd4d7e90ce5cf1241731c6e80118402e3b4
Parent: cc9bd5d4256ecc1b6e0448febb4be29db1a91256
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:09 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:16:58 2007 -0500

[SCSI] ipr: Log error for SAS dual path switch

For ipr SAS adapters that support dual pathing, this
patch modifies ipr to log an error when a path fails.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 5b6ffe1..44ce9f5 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -4453,12 +4453,13 @@ static void ipr_dump_ioasa(struct ipr_ioa_cfg *ioa_cfg,
 {
int i;
u16 data_len;
-   u32 ioasc;
+   u32 ioasc, fd_ioasc;
struct ipr_ioasa *ioasa = ipr_cmd-ioasa;
__be32 *ioasa_data = (__be32 *)ioasa;
int error_index;
 
ioasc = be32_to_cpu(ioasa-ioasc)  IPR_IOASC_IOASC_MASK;
+   fd_ioasc = be32_to_cpu(ioasa-fd_ioasc)  IPR_IOASC_IOASC_MASK;
 
if (0 == ioasc)
return;
@@ -4466,7 +4467,10 @@ static void ipr_dump_ioasa(struct ipr_ioa_cfg *ioa_cfg,
if (ioa_cfg-log_level  IPR_DEFAULT_LOG_LEVEL)
return;
 
-   error_index = ipr_get_error(ioasc);
+   if (ioasc == IPR_IOASC_BUS_WAS_RESET  fd_ioasc)
+   error_index = ipr_get_error(fd_ioasc);
+   else
+   error_index = ipr_get_error(ioasc);
 
if (ioa_cfg-log_level  IPR_MAX_LOG_LEVEL) {
/* Don't log an error if the IOA already logged one */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Fix for oops following SATA request sense

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=24d6f2b50bd34d0da540a9e6f71c4b6ab25f4b93
Commit: 24d6f2b50bd34d0da540a9e6f71c4b6ab25f4b93
Parent: b0692dd4d7e90ce5cf1241731c6e80118402e3b4
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:17 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:17:22 2007 -0500

[SCSI] ipr: Fix for oops following SATA request sense

This patch fixes a problem discovered on a system with some
bad SATA devices attached. If a command to a SATAPI device
times out and the device gets reset as part of error recovery,
its possible that ipr will set err_mask to indicate a device
error has occurred. If this happens, a request sense will get
issued by libata. Since scsi core thinks this scsi command is
now completed, because the device reset handler completed successfully,
scsi core will free the associated scsi command, which may
cause an oops when that request sense is completed later
by ipr. This patch ensures that any commands that get aborted
as a result of a device reset set err_mask appropriately so
that the request sense does not get sent.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 44ce9f5..fc1171c 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3846,6 +3846,8 @@ static int __ipr_eh_dev_reset(struct scsi_cmnd * scsi_cmd)
if (ipr_cmd-ioarcb.res_handle == res-cfgte.res_handle) {
if (ipr_cmd-scsi_cmd)
ipr_cmd-done = ipr_scsi_eh_done;
+   if (ipr_cmd-qc)
+   ipr_cmd-done = ipr_sata_eh_done;
if (ipr_cmd-qc  !(ipr_cmd-qc-flags  
ATA_QCFLAG_FAILED)) {
ipr_cmd-qc-err_mask |= AC_ERR_TIMEOUT;
ipr_cmd-qc-flags |= ATA_QCFLAG_FAILED;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: PCI unblock config access fix

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a9aedb098437655b7b78d66e0e28405830cbdbef
Commit: a9aedb098437655b7b78d66e0e28405830cbdbef
Parent: 24d6f2b50bd34d0da540a9e6f71c4b6ab25f4b93
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:23 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:17:42 2007 -0500

[SCSI] ipr: PCI unblock config access fix

Fix to make sure user config accesses get re-enabled if the
PCI config write to start BIST fails.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index fc1171c..b502c83 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6390,6 +6390,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd)
rc = pci_write_config_byte(ioa_cfg-pdev, PCI_BIST, PCI_BIST_START);
 
if (rc != PCIBIOS_SUCCESSFUL) {
+   pci_unblock_user_cfg_access(ipr_cmd-ioa_cfg-pdev);
ipr_cmd-ioasa.ioasc = cpu_to_be32(IPR_IOASC_PCI_ACCESS_ERROR);
rc = IPR_RC_JOB_CONTINUE;
} else {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Improve async error logging level control

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=933916f365f9ef1268c058bfaba2d4dcf26e4fd0
Commit: 933916f365f9ef1268c058bfaba2d4dcf26e4fd0
Parent: a9aedb098437655b7b78d66e0e28405830cbdbef
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:30 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:18:11 2007 -0500

[SCSI] ipr: Improve async error logging level control

Add the ability to control how much error data gets logged
on a per error basis.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |  192 ++--
 1 files changed, 96 insertions(+), 96 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index b502c83..e1d24dd 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -164,7 +164,7 @@ MODULE_VERSION(IPR_DRIVER_VERSION);
 /*  A constant array of IOASCs/URCs/Error Messages */
 static const
 struct ipr_error_table_t ipr_error_table[] = {
-   {0x, 1, 1,
+   {0x, 1, IPR_DEFAULT_LOG_LEVEL,
8155: An unknown error was received},
{0x0033, 0, 0,
Soft underlength error},
@@ -172,37 +172,37 @@ struct ipr_error_table_t ipr_error_table[] = {
Command to be cancelled not found},
{0x00808000, 0, 0,
Qualified success},
-   {0x0108, 1, 1,
+   {0x0108, 1, IPR_DEFAULT_LOG_LEVEL,
FFFE: Soft device bus error recovered by the IOA},
-   {0x01088100, 0, 1,
+   {0x01088100, 0, IPR_DEFAULT_LOG_LEVEL,
4101: Soft device bus fabric error},
-   {0x01170600, 0, 1,
+   {0x01170600, 0, IPR_DEFAULT_LOG_LEVEL,
FFF9: Device sector reassign successful},
-   {0x01170900, 0, 1,
+   {0x01170900, 0, IPR_DEFAULT_LOG_LEVEL,
FFF7: Media error recovered by device rewrite procedures},
-   {0x01180200, 0, 1,
+   {0x01180200, 0, IPR_DEFAULT_LOG_LEVEL,
7001: IOA sector reassignment successful},
-   {0x01180500, 0, 1,
+   {0x01180500, 0, IPR_DEFAULT_LOG_LEVEL,
FFF9: Soft media error. Sector reassignment recommended},
-   {0x01180600, 0, 1,
+   {0x01180600, 0, IPR_DEFAULT_LOG_LEVEL,
FFF7: Media error recovered by IOA rewrite procedures},
-   {0x01418000, 0, 1,
+   {0x01418000, 0, IPR_DEFAULT_LOG_LEVEL,
FF3D: Soft PCI bus error recovered by the IOA},
-   {0x0144, 1, 1,
+   {0x0144, 1, IPR_DEFAULT_LOG_LEVEL,
FFF6: Device hardware error recovered by the IOA},
-   {0x01448100, 0, 1,
+   {0x01448100, 0, IPR_DEFAULT_LOG_LEVEL,
FFF6: Device hardware error recovered by the device},
-   {0x01448200, 1, 1,
+   {0x01448200, 1, IPR_DEFAULT_LOG_LEVEL,
FF3D: Soft IOA error recovered by the IOA},
-   {0x01448300, 0, 1,
+   {0x01448300, 0, IPR_DEFAULT_LOG_LEVEL,
FFFA: Undefined device response recovered by the IOA},
-   {0x014A, 1, 1,
+   {0x014A, 1, IPR_DEFAULT_LOG_LEVEL,
FFF6: Device bus error, message or command phase},
-   {0x014A8000, 0, 1,
+   {0x014A8000, 0, IPR_DEFAULT_LOG_LEVEL,
FFFE: Task Management Function failed},
-   {0x015D, 0, 1,
+   {0x015D, 0, IPR_DEFAULT_LOG_LEVEL,
FFF6: Failure prediction threshold exceeded},
-   {0x015D9200, 0, 1,
+   {0x015D9200, 0, IPR_DEFAULT_LOG_LEVEL,
8009: Impending cache battery pack failure},
{0x02040400, 0, 0,
34FF: Disk device format in progress},
@@ -212,85 +212,85 @@ struct ipr_error_table_t ipr_error_table[] = {
No ready, IOA shutdown},
{0x025A, 0, 0,
Not ready, IOA has been shutdown},
-   {0x02670100, 0, 1,
+   {0x02670100, 0, IPR_DEFAULT_LOG_LEVEL,
3020: Storage subsystem configuration error},
{0x03110B00, 0, 0,
FFF5: Medium error, data unreadable, recommend reassign},
{0x03110C00, 0, 0,
7000: Medium error, data unreadable, do not reassign},
-   {0x0331, 0, 1,
+   {0x0331, 0, IPR_DEFAULT_LOG_LEVEL,
FFF3: Disk media format bad},
-   {0x0405, 0, 1,
+   {0x0405, 0, IPR_DEFAULT_LOG_LEVEL,
3002: Addressed device failed to respond to selection},
-   {0x0408, 1, 1,
+   {0x0408, 1, IPR_DEFAULT_LOG_LEVEL,
3100: Device bus error},
-   {0x04080100, 0, 1,
+   {0x04080100, 0, IPR_DEFAULT_LOG_LEVEL,
3109: IOA timed out a device command},
{0x04088000, 0, 0,
3120: SCSI bus is not operational},
-   {0x04088100, 0, 1,
+   {0x04088100, 0, IPR_DEFAULT_LOG_LEVEL,
4100: Hard device bus fabric error},
-   {0x04118000, 0, 1,
+   {0x04118000, 0, IPR_DEFAULT_LOG_LEVEL,
9000: IOA reserved area data check},
-   {0x04118100, 0, 1,
+   {0x04118100, 0, IPR_DEFAULT_LOG_LEVEL,
9001: IOA reserved 

[SCSI] ipr: Return better qc_issue errors

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0feeed823af05ca556087a89fdcf644f156f73b8
Commit: 0feeed823af05ca556087a89fdcf644f156f73b8
Parent: e435340c4b583b4472dad1178029b8e3e7dafd0b
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:43 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:18:56 2007 -0500

[SCSI] ipr: Return better qc_issue errors

If qc_issue fails for some reason, return a better error
to libata.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 0251fd7..aa1fb72 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -5128,7 +5128,7 @@ static unsigned int ipr_qc_issue(struct ata_queued_cmd 
*qc)
struct ipr_ioarcb_ata_regs *regs;
 
if (unlikely(!ioa_cfg-allow_cmds || ioa_cfg-ioa_is_dead))
-   return -EIO;
+   return AC_ERR_SYSTEM;
 
ipr_cmd = ipr_get_free_ipr_cmnd(ioa_cfg);
ioarcb = ipr_cmd-ioarcb;
@@ -5173,7 +5173,7 @@ static unsigned int ipr_qc_issue(struct ata_queued_cmd 
*qc)
 
default:
WARN_ON(1);
-   return -1;
+   return AC_ERR_INVALID;
}
 
mb();
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] ipr: Faster sg list fetch

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=51b1c7e19e18e84a44277951dd5c4c4617330baa
Commit: 51b1c7e19e18e84a44277951dd5c4c4617330baa
Parent: 0feeed823af05ca556087a89fdcf644f156f73b8
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:50 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:19:12 2007 -0500

[SCSI] ipr: Faster sg list fetch

Improve overall command performance by embedding the scatterlist
in the command block used by the adapter. This decreases
the overall number of DMAs required for a single command.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |   28 +++-
 drivers/scsi/ipr.h |   31 ---
 2 files changed, 39 insertions(+), 20 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index aa1fb72..5cf1002 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -480,12 +480,16 @@ static void ipr_reinit_ipr_cmnd(struct ipr_cmnd *ipr_cmd)
 {
struct ipr_ioarcb *ioarcb = ipr_cmd-ioarcb;
struct ipr_ioasa *ioasa = ipr_cmd-ioasa;
+   dma_addr_t dma_addr = be32_to_cpu(ioarcb-ioarcb_host_pci_addr);
 
memset(ioarcb-cmd_pkt, 0, sizeof(struct ipr_cmd_pkt));
ioarcb-write_data_transfer_length = 0;
ioarcb-read_data_transfer_length = 0;
ioarcb-write_ioadl_len = 0;
ioarcb-read_ioadl_len = 0;
+   ioarcb-write_ioadl_addr =
+   cpu_to_be32(dma_addr + offsetof(struct ipr_cmnd, ioadl));
+   ioarcb-read_ioadl_addr = ioarcb-write_ioadl_addr;
ioasa-ioasc = 0;
ioasa-residual_data_len = 0;
ioasa-u.gata.status = 0;
@@ -4230,6 +4234,14 @@ static int ipr_build_ioadl(struct ipr_ioa_cfg *ioa_cfg,
 
sglist = scsi_cmd-request_buffer;
 
+   if (ipr_cmd-dma_use_sg = 
ARRAY_SIZE(ioarcb-add_data.u.ioadl)) {
+   ioadl = ioarcb-add_data.u.ioadl;
+   ioarcb-write_ioadl_addr =
+   
cpu_to_be32(be32_to_cpu(ioarcb-ioarcb_host_pci_addr) +
+   offsetof(struct ipr_ioarcb, 
add_data));
+   ioarcb-read_ioadl_addr = ioarcb-write_ioadl_addr;
+   }
+
for (i = 0; i  ipr_cmd-dma_use_sg; i++) {
ioadl[i].flags_and_data_len =
cpu_to_be32(ioadl_flags | 
sg_dma_len(sglist[i]));
@@ -4260,6 +4272,11 @@ static int ipr_build_ioadl(struct ipr_ioa_cfg *ioa_cfg,
 
scsi_cmd-sc_data_direction);
 
if (likely(!pci_dma_mapping_error(ipr_cmd-dma_handle))) {
+   ioadl = ioarcb-add_data.u.ioadl;
+   ioarcb-write_ioadl_addr =
+   
cpu_to_be32(be32_to_cpu(ioarcb-ioarcb_host_pci_addr) +
+   offsetof(struct ipr_ioarcb, 
add_data));
+   ioarcb-read_ioadl_addr = ioarcb-write_ioadl_addr;
ipr_cmd-dma_use_sg = 1;
ioadl[0].flags_and_data_len =
cpu_to_be32(ioadl_flags | length | 
IPR_IOADL_FLAGS_LAST);
@@ -4346,11 +4363,9 @@ static void ipr_erp_done(struct ipr_cmnd *ipr_cmd)
  **/
 static void ipr_reinit_ipr_cmnd_for_erp(struct ipr_cmnd *ipr_cmd)
 {
-   struct ipr_ioarcb *ioarcb;
-   struct ipr_ioasa *ioasa;
-
-   ioarcb = ipr_cmd-ioarcb;
-   ioasa = ipr_cmd-ioasa;
+   struct ipr_ioarcb *ioarcb = ipr_cmd-ioarcb;
+   struct ipr_ioasa *ioasa = ipr_cmd-ioasa;
+   dma_addr_t dma_addr = be32_to_cpu(ioarcb-ioarcb_host_pci_addr);
 
memset(ioarcb-cmd_pkt, 0, sizeof(struct ipr_cmd_pkt));
ioarcb-write_data_transfer_length = 0;
@@ -4359,6 +4374,9 @@ static void ipr_reinit_ipr_cmnd_for_erp(struct ipr_cmnd 
*ipr_cmd)
ioarcb-read_ioadl_len = 0;
ioasa-ioasc = 0;
ioasa-residual_data_len = 0;
+   ioarcb-write_ioadl_addr =
+   cpu_to_be32(dma_addr + offsetof(struct ipr_cmnd, ioadl));
+   ioarcb-read_ioadl_addr = ioarcb-write_ioadl_addr;
 }
 
 /**
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 4d06888..50e14f5 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -422,9 +422,25 @@ struct ipr_ioarcb_ata_regs {
u8 ctl;
 }__attribute__ ((packed, aligned(4)));
 
+struct ipr_ioadl_desc {
+   __be32 flags_and_data_len;
+#define IPR_IOADL_FLAGS_MASK   0xff00
+#define IPR_IOADL_GET_FLAGS(x) (be32_to_cpu(x)  IPR_IOADL_FLAGS_MASK)
+#define IPR_IOADL_DATA_LEN_MASK0x00ff
+#define IPR_IOADL_GET_DATA_LEN(x) (be32_to_cpu(x)  IPR_IOADL_DATA_LEN_MASK)
+#define IPR_IOADL_FLAGS_READ   0x4800
+#define IPR_IOADL_FLAGS_READ_LAST  0x4900
+#define IPR_IOADL_FLAGS_WRITE 

[SCSI] ipr: Driver version to 2.3.2

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aa2e07b4c2addaa4ad4bd7a6ee205565e83c2a14
Commit: aa2e07b4c2addaa4ad4bd7a6ee205565e83c2a14
Parent: 51b1c7e19e18e84a44277951dd5c4c4617330baa
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:57 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:19:39 2007 -0500

[SCSI] ipr: Driver version to 2.3.2

Bump driver version.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index 50e14f5..bc53d7c 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -37,8 +37,8 @@
 /*
  * Literals
  */
-#define IPR_DRIVER_VERSION 2.3.1
-#define IPR_DRIVER_DATE (January 23, 2007)
+#define IPR_DRIVER_VERSION 2.3.2
+#define IPR_DRIVER_DATE (March 23, 2007)
 
 /*
  * IPR_MAX_CMD_PER_LUN: This defines the maximum number of outstanding
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: [Fastboot] Panics for AACRAID driver during 'insmod' for kexec test.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=18a6598f2d3bb7275dadba77df5f06bc996a77d4
Commit: 18a6598f2d3bb7275dadba77df5f06bc996a77d4
Parent: aa2e07b4c2addaa4ad4bd7a6ee205565e83c2a14
Author: Salyzyn, Mark [EMAIL PROTECTED]
AuthorDate: Fri Mar 30 10:30:48 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 12:44:57 2007 -0500

[SCSI] aacraid: [Fastboot] Panics for AACRAID driver during 'insmod' for 
kexec test.

Attached is the patch I feel will address this issue. As an added
'perk' I have also added the code to detect if the controller was
previously initialized for interrupted operations by ANY operating
system should the reset_devices kernel parameter not be set and we are
dealing with a naïve kexec without the addition of this kernel
parameter. The reset handler is also improved. Related to reset
operations, but not pertinent specifically to this issue, I have also
altered the handling somewhat so that we reset the adapter if we feel
it is taking too long (three minutes) to start up.

We have not unit tested the reset_devices flag propagation to this
driver code, nor have we unit tested the check for the interrupted
operations under the conditions of a naively issued kexec. We are
submitting this modified driver to our Q/A department for integration
testing in our current programs. I would appreciate an ACK to this
patch should it resolve the issue described in this thread...

Signed-off-by: Mark Salyzyn [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/rx.c |   36 
 1 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/drivers/scsi/aacraid/rx.c b/drivers/scsi/aacraid/rx.c
index 3e23aa6..0c71315 100644
--- a/drivers/scsi/aacraid/rx.c
+++ b/drivers/scsi/aacraid/rx.c
@@ -467,16 +467,19 @@ static int aac_rx_restart_adapter(struct aac_dev *dev, 
int bled)
if (bled)
printk(KERN_ERR %s%d: adapter kernel panic'd %x.\n,
dev-name, dev-id, bled);
-   else
+   else {
bled = aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS,
  0, 0, 0, 0, 0, 0, var, NULL, NULL, NULL, NULL);
-   if (bled)
+   if (!bled  (var != 0x0001))
+   bled = -EINVAL;
+   }
+   if (bled  (bled != -ETIMEDOUT))
bled = aac_adapter_sync_cmd(dev, IOP_RESET,
  0, 0, 0, 0, 0, 0, var, NULL, NULL, NULL, NULL);
 
-   if (bled)
+   if (bled  (bled != -ETIMEDOUT))
return -EINVAL;
-   if (var == 0x3803000F) { /* USE_OTHER_METHOD */
+   if (bled || (var == 0x3803000F)) { /* USE_OTHER_METHOD */
rx_writel(dev, MUnit.reserved2, 3);
msleep(5000); /* Delay 5 seconds */
var = 0x0001;
@@ -526,6 +529,7 @@ int _aac_rx_init(struct aac_dev *dev)
 {
unsigned long start;
unsigned long status;
+   int restart = 0;
int instance = dev-id;
const char * name = dev-name;
 
@@ -534,15 +538,19 @@ int _aac_rx_init(struct aac_dev *dev)
goto error_iounmap;
}
 
+   /* Failure to reset here is an option ... */
+   dev-OIMR = status = rx_readb (dev, MUnit.OIMR);
+   if status  0xff) != 0xff) || reset_devices) 
+ !aac_rx_restart_adapter(dev, 0))
+   ++restart;
/*
 *  Check to see if the board panic'd while booting.
 */
status = rx_readl(dev, MUnit.OMRx[0]);
if (status  KERNEL_PANIC) {
-   if ((status = aac_rx_check_health(dev)) = 0)
-   goto error_iounmap;
-   if (aac_rx_restart_adapter(dev, status))
+   if (aac_rx_restart_adapter(dev, aac_rx_check_health(dev)))
goto error_iounmap;
+   ++restart;
}
/*
 *  Check to see if the board failed any self tests.
@@ -565,11 +573,23 @@ int _aac_rx_init(struct aac_dev *dev)
 */
while (!((status = rx_readl(dev, MUnit.OMRx[0]))  
KERNEL_UP_AND_RUNNING))
{
-   if(time_after(jiffies, start+startup_timeout*HZ)) {
+   if ((restart 
+ (status  (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC))) ||
+ time_after(jiffies, start+HZ*startup_timeout)) {
printk(KERN_ERR %s%d: adapter kernel failed to start, 
init status = %lx.\n, 
dev-name, instance, status);
goto error_iounmap;
}
+   if (!restart 
+ ((status  (KERNEL_PANIC|SELF_TEST_FAILED|MONITOR_PANIC)) ||
+ time_after(jiffies, start + HZ *
+ ((startup_timeout  60)
+   ? (startup_timeout - 60)
+  

[SCSI] ipr: Disrupt device error

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e435340c4b583b4472dad1178029b8e3e7dafd0b
Commit: e435340c4b583b4472dad1178029b8e3e7dafd0b
Parent: 933916f365f9ef1268c058bfaba2d4dcf26e4fd0
Author: Brian King [EMAIL PROTECTED]
AuthorDate: Thu Mar 29 12:43:37 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Sun Apr 1 11:18:37 2007 -0500

[SCSI] ipr: Disrupt device error

Add entry in ipr error translation table for an error
received when a device is forced into the failed state
by the user.

Signed-off-by: Brian King [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ipr.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index e1d24dd..0251fd7 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -360,6 +360,8 @@ struct ipr_error_table_t ipr_error_table[] = {
9072: Link not operational transition},
{0x066B8200, 0, IPR_DEFAULT_LOG_LEVEL,
9032: Array exposed but still protected},
+   {0x066B8300, 0, IPR_DEFAULT_LOG_LEVEL + 1,
+   70DD: Device forced failed by disrupt device command},
{0x066B9100, 0, IPR_DEFAULT_LOG_LEVEL,
4061: Multipath redundancy level got better},
{0x066B9200, 0, IPR_DEFAULT_LOG_LEVEL,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: Correct SMC products in aacraid.txt

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=144ff8bf0d84a81806bfb5979b0a6b176b1fcace
Commit: 144ff8bf0d84a81806bfb5979b0a6b176b1fcace
Parent: ed773e66480fdcd06732eb2aa39362599dcd67fa
Author: Salyzyn, Mark [EMAIL PROTECTED]
AuthorDate: Wed Apr 4 15:49:54 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Apr 17 18:01:45 2007 -0400

[SCSI] aacraid: Correct SMC products in aacraid.txt

Correct a spelling mistake for the SMC product names (replace 'B' with
'R') in the Documentation/scsi/aacraid.txt file. This is a follow-up to
a documentation patch '[PATCH] aacraid: Add SMC and SUN products to
README' submitted and accepted to scsi-misc-2.6 on March 27 2007.

Signed-off-by: Mark Salyzyn [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 Documentation/scsi/aacraid.txt |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/scsi/aacraid.txt b/Documentation/scsi/aacraid.txt
index bddc641..2368e7e 100644
--- a/Documentation/scsi/aacraid.txt
+++ b/Documentation/scsi/aacraid.txt
@@ -38,10 +38,10 @@ Supported Cards/Chipsets
9005:0286:9005:02ac Adaptec 1800 (Typhoon44)
9005:0285:9005:02b5 Adaptec 5445 (Voodoo44)
9005:0285:15d9:02b5 SMC AOC-USAS-S4i
-   9005:0285:15d9:02c9 SMC AOC-USAS-S4iB
+   9005:0285:15d9:02c9 SMC AOC-USAS-S4iR
9005:0285:9005:02b6 Adaptec 5805 (Voodoo80)
9005:0285:15d9:02b6 SMC AOC-USAS-S8i
-   9005:0285:15d9:02ca SMC AOC-USAS-S8iB
+   9005:0285:15d9:02ca SMC AOC-USAS-S8iR
9005:0285:9005:02b7 Adaptec 5085 (Voodoo08)
9005:0285:9005:02bb Adaptec 3405 (Marauder40LP)
9005:0285:9005:02bc Adaptec 3805 (Marauder80LP)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] aacraid: fix aacraid not finding device

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4def7fa11208f779f22e6ba7344370b0220d3350
Commit: 4def7fa11208f779f22e6ba7344370b0220d3350
Parent: 144ff8bf0d84a81806bfb5979b0a6b176b1fcace
Author: Salyzyn, Mark [EMAIL PROTECTED]
AuthorDate: Fri Apr 13 08:35:25 2007 -0400
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Apr 17 18:02:22 2007 -0400

[SCSI] aacraid: fix aacraid not finding device

Thanks for the help from Steve Fox and Duane Cox investigating this
issue, I'd like to report that we found the problem. The issue is with
the patch Steve Fox isolated below, by not accommodating older adapters
properly and issuing a command they do not support when retrieving
storage parameters about the arrays. This simple patch resolves the
problem (and more accurately mimics the logic of the original code
before the patch).

Signed-off-by: Mark Salyzyn [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/aacraid/aachba.c |3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 31ac9f5..1e82c69 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -503,8 +503,7 @@ static int _aac_probe_container1(void * context, struct fib 
* fibptr)
dresp = (struct aac_mount *) fib_data(fibptr);
dresp-mnt[0].capacityhigh = 0;
if ((le32_to_cpu(dresp-status) != ST_OK) ||
-   ((le32_to_cpu(dresp-mnt[0].vol) != CT_NONE) 
-(le32_to_cpu(dresp-mnt[0].state) == FSCS_HIDDEN)))
+   (le32_to_cpu(dresp-mnt[0].vol) != CT_NONE))
return _aac_probe_container2(context, fibptr);
scsicmd = (struct scsi_cmnd *) context;
scsicmd-SCp.phase = AAC_OWNER_MIDLEVEL;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SCSI] tgt: fix rdma transfer bugs

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ad1331a792f9f253bef362de9b6872c6b8f88c0c
Commit: ad1331a792f9f253bef362de9b6872c6b8f88c0c
Parent: 4def7fa11208f779f22e6ba7344370b0220d3350
Author: Bastian Blank [EMAIL PROTECTED]
AuthorDate: Sat Apr 7 18:10:00 2007 +0900
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Apr 17 18:03:31 2007 -0400

[SCSI] tgt: fix rdma transfer bugs

- ibmstgt hits the max rdma transfer size (128k).
- libsrp returns a rdma transfer error properly.

Signed-off-by: Bastian Blank [EMAIL PROTECTED]
Signed-off-by: FUJITA Tomonori [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/ibmvscsi/ibmvstgt.c |   18 +-
 drivers/scsi/libsrp.c|   12 ++--
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/drivers/scsi/ibmvscsi/ibmvstgt.c b/drivers/scsi/ibmvscsi/ibmvstgt.c
index a7fbd10..84363c1 100644
--- a/drivers/scsi/ibmvscsi/ibmvstgt.c
+++ b/drivers/scsi/ibmvscsi/ibmvstgt.c
@@ -35,7 +35,7 @@
 #include ibmvscsi.h
 
 #defineINITIAL_SRP_LIMIT   16
-#defineDEFAULT_MAX_SECTORS 512
+#defineDEFAULT_MAX_SECTORS 256
 
 #defineTGT_NAMEibmvstgt
 
@@ -248,8 +248,8 @@ static int ibmvstgt_rdma(struct scsi_cmnd *sc, struct 
scatterlist *sg, int nsg,
  md[i].va + mdone);
 
if (err != H_SUCCESS) {
-   eprintk(rdma error %d %d\n, dir, slen);
-   goto out;
+   eprintk(rdma error %d %d %ld\n, dir, slen, 
err);
+   return -EIO;
}
 
mlen -= slen;
@@ -265,14 +265,13 @@ static int ibmvstgt_rdma(struct scsi_cmnd *sc, struct 
scatterlist *sg, int nsg,
if (sidx  nsg) {
eprintk(out of sg %p %d %d\n,
iue, sidx, nsg);
-   goto out;
+   return -EIO;
}
}
};
 
rest -= mlen;
}
-out:
return 0;
 }
 
@@ -282,18 +281,19 @@ static int ibmvstgt_cmd_done(struct scsi_cmnd *sc,
unsigned long flags;
struct iu_entry *iue = (struct iu_entry *) sc-SCp.ptr;
struct srp_target *target = iue-target;
+   int err = 0;
 
dprintk(%p %p %x %u\n, iue, target, vio_iu(iue)-srp.cmd.cdb[0],
cmd-usg_sg);
 
if (sc-use_sg)
-   srp_transfer_data(sc, vio_iu(iue)-srp.cmd, ibmvstgt_rdma, 1, 
1);
+   err = srp_transfer_data(sc, vio_iu(iue)-srp.cmd, 
ibmvstgt_rdma, 1, 1);
 
spin_lock_irqsave(target-lock, flags);
list_del(iue-ilist);
spin_unlock_irqrestore(target-lock, flags);
 
-   if (sc-result != SAM_STAT_GOOD) {
+   if (err|| sc-result != SAM_STAT_GOOD) {
eprintk(operation failed %p %d %x\n,
iue, sc-result, vio_iu(iue)-srp.cmd.cdb[0]);
send_rsp(iue, sc, HARDWARE_ERROR, 0x00);
@@ -493,7 +493,8 @@ static void process_iu(struct viosrp_crq *crq, struct 
srp_target *target)
 {
struct vio_port *vport = target_to_port(target);
struct iu_entry *iue;
-   long err, done;
+   long err;
+   int done = 1;
 
iue = srp_iu_get(target);
if (!iue) {
@@ -508,7 +509,6 @@ static void process_iu(struct viosrp_crq *crq, struct 
srp_target *target)
 
if (err != H_SUCCESS) {
eprintk(%ld transferring data error %p\n, err, iue);
-   done = 1;
goto out;
}
 
diff --git a/drivers/scsi/libsrp.c b/drivers/scsi/libsrp.c
index 89403b0..37a0f4d 100644
--- a/drivers/scsi/libsrp.c
+++ b/drivers/scsi/libsrp.c
@@ -225,8 +225,7 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct 
srp_cmd *cmd,
struct srp_direct_buf *md = NULL;
struct scatterlist dummy, *sg = NULL;
dma_addr_t token = 0;
-   long err;
-   unsigned int done = 0;
+   int err = 0;
int nmd, nsg = 0, len;
 
if (dma_map || ext_desc) {
@@ -258,8 +257,8 @@ static int srp_indirect_data(struct scsi_cmnd *sc, struct 
srp_cmd *cmd,
sg_dma_address(dummy) = token;
err = rdma_io(sc, dummy, 1, id-table_desc, 1, DMA_TO_DEVICE,
  id-table_desc.len);
-   if (err  0) {
-   eprintk(Error copying indirect table %ld\n, err);
+   if (err) {
+   eprintk(Error copying indirect table %d\n, err);
goto free_mem;
}
} else {
@@ -272,6 +271,7 @@ rdma:
nsg = dma_map_sg(iue-target-dev, sg, 

[SCSI] BusLogic: stop using check_region

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1079a2d251f24a7d9e7576217f5f738bc4218337
Commit: 1079a2d251f24a7d9e7576217f5f738bc4218337
Parent: ad1331a792f9f253bef362de9b6872c6b8f88c0c
Author: Zachary Amsden [EMAIL PROTECTED]
AuthorDate: Tue Apr 10 08:53:08 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Apr 17 18:04:20 2007 -0400

[SCSI] BusLogic: stop using check_region

I got so sick of seing the check_region warnings from BusLogic.c I actually
fixed it properly.  Never use check region, reserve it before the probe
with request region instead and check the error result; free region if
setup fails.  Should be functionally identical to the original except for
fixing the potential race.

Signed-off-by: Zachary Amsden [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/scsi/BusLogic.c |   73 +++
 1 files changed, 48 insertions(+), 25 deletions(-)

diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c
index e874b89..96f4cab 100644
--- a/drivers/scsi/BusLogic.c
+++ b/drivers/scsi/BusLogic.c
@@ -579,17 +579,17 @@ static void __init 
BusLogic_InitializeProbeInfoListISA(struct BusLogic_HostAdapt
/*
   Append the list of standard BusLogic MultiMaster ISA I/O Addresses.
 */
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe330 : check_region(0x330, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (!BusLogic_ProbeOptions.LimitedProbeISA || 
BusLogic_ProbeOptions.Probe330)
BusLogic_AppendProbeAddressISA(0x330);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe334 : check_region(0x334, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (!BusLogic_ProbeOptions.LimitedProbeISA || 
BusLogic_ProbeOptions.Probe334)
BusLogic_AppendProbeAddressISA(0x334);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe230 : check_region(0x230, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (!BusLogic_ProbeOptions.LimitedProbeISA || 
BusLogic_ProbeOptions.Probe230)
BusLogic_AppendProbeAddressISA(0x230);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe234 : check_region(0x234, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (!BusLogic_ProbeOptions.LimitedProbeISA || 
BusLogic_ProbeOptions.Probe234)
BusLogic_AppendProbeAddressISA(0x234);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe130 : check_region(0x130, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (!BusLogic_ProbeOptions.LimitedProbeISA || 
BusLogic_ProbeOptions.Probe130)
BusLogic_AppendProbeAddressISA(0x130);
-   if (BusLogic_ProbeOptions.LimitedProbeISA ? 
BusLogic_ProbeOptions.Probe134 : check_region(0x134, 
BusLogic_MultiMasterAddressCount) == 0)
+   if (!BusLogic_ProbeOptions.LimitedProbeISA || 
BusLogic_ProbeOptions.Probe134)
BusLogic_AppendProbeAddressISA(0x134);
 }
 
@@ -795,7 +795,9 @@ static int __init 
BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd
   host adapters are probed.
 */
if (!BusLogic_ProbeOptions.NoProbeISA)
-   if (PrimaryProbeInfo-IO_Address == 0  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe330 : 
check_region(0x330, BusLogic_MultiMasterAddressCount) == 0)) {
+   if (PrimaryProbeInfo-IO_Address == 0 
+   (!BusLogic_ProbeOptions.LimitedProbeISA ||
+BusLogic_ProbeOptions.Probe330)) {
PrimaryProbeInfo-HostAdapterType = 
BusLogic_MultiMaster;
PrimaryProbeInfo-HostAdapterBusType = BusLogic_ISA_Bus;
PrimaryProbeInfo-IO_Address = 0x330;
@@ -805,15 +807,25 @@ static int __init 
BusLogic_InitializeMultiMasterProbeInfo(struct BusLogic_HostAd
   omitting the Primary I/O Address which has already been handled.
 */
if (!BusLogic_ProbeOptions.NoProbeISA) {
-   if (!StandardAddressSeen[1]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe334 : 
check_region(0x334, BusLogic_MultiMasterAddressCount) == 0))
+   if (!StandardAddressSeen[1] 
+   (!BusLogic_ProbeOptions.LimitedProbeISA ||
+BusLogic_ProbeOptions.Probe334))
BusLogic_AppendProbeAddressISA(0x334);
-   if (!StandardAddressSeen[2]  
(BusLogic_ProbeOptions.LimitedProbeISA ? BusLogic_ProbeOptions.Probe230 : 
check_region(0x230, BusLogic_MultiMasterAddressCount) == 0))
+   if (!StandardAddressSeen[2] 
+   (!BusLogic_ProbeOptions.LimitedProbeISA ||
+ 

[SCSI] sg: cap reserved_size values at max_sectors

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=44ec95425c1d9dce6e4638c29e4362cfb44814e7
Commit: 44ec95425c1d9dce6e4638c29e4362cfb44814e7
Parent: 1079a2d251f24a7d9e7576217f5f738bc4218337
Author: Alan Stern [EMAIL PROTECTED]
AuthorDate: Tue Feb 20 11:01:57 2007 -0500
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Tue Apr 17 18:09:56 2007 -0400

[SCSI] sg: cap reserved_size values at max_sectors

This patch (as857) modifies the SG_GET_RESERVED_SIZE and
SG_SET_RESERVED_SIZE ioctls in the sg driver, capping the values at
the device's request_queue's max_sectors value.  This will permit
cdrecord to obtain a legal value for the maximum transfer length,
fixing Bugzilla #7026.

The patch also caps the initial reserved_size value.  There's no
reason to have a reserved buffer larger than max_sectors, since it
would be impossible to use the extra space.

The corresponding ioctls in the block layer are modified similarly,
and the initial value for the reserved_size is set as large as
possible.  This will effectively make it default to max_sectors.
Note that the actual value is meaningless anyway, since block devices
don't have a reserved buffer.

Finally, the BLKSECTGET ioctl is added to sg, so that there will be a
uniform way for users to determine the actual max_sectors value for
any raw SCSI transport.

Signed-off-by: Alan Stern [EMAIL PROTECTED]
Acked-by: Jens Axboe [EMAIL PROTECTED]
Acked-by: Douglas Gilbert [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 block/ll_rw_blk.c  |2 ++
 block/scsi_ioctl.c |4 +++-
 drivers/scsi/sg.c  |   13 +++--
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 38c293b..cf8752a 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -1925,6 +1925,8 @@ blk_init_queue_node(request_fn_proc *rfn, spinlock_t 
*lock, int node_id)
blk_queue_max_hw_segments(q, MAX_HW_SEGMENTS);
blk_queue_max_phys_segments(q, MAX_PHYS_SEGMENTS);
 
+   q-sg_reserved_size = INT_MAX;
+
/*
 * all done
 */
diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
index 65c6a3c..e83f1db 100644
--- a/block/scsi_ioctl.c
+++ b/block/scsi_ioctl.c
@@ -78,7 +78,9 @@ static int sg_set_timeout(request_queue_t *q, int __user *p)
 
 static int sg_get_reserved_size(request_queue_t *q, int __user *p)
 {
-   return put_user(q-sg_reserved_size, p);
+   unsigned val = min(q-sg_reserved_size, q-max_sectors  9);
+
+   return put_user(val, p);
 }
 
 static int sg_set_reserved_size(request_queue_t *q, int __user *p)
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 81e3bc7..570977c 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -917,6 +917,8 @@ sg_ioctl(struct inode *inode, struct file *filp,
return result;
 if (val  0)
 return -EINVAL;
+   val = min_t(int, val,
+   sdp-device-request_queue-max_sectors * 512);
if (val != sfp-reserve.bufflen) {
if (sg_res_in_use(sfp) || sfp-mmap_called)
return -EBUSY;
@@ -925,7 +927,8 @@ sg_ioctl(struct inode *inode, struct file *filp,
}
return 0;
case SG_GET_RESERVED_SIZE:
-   val = (int) sfp-reserve.bufflen;
+   val = min_t(int, sfp-reserve.bufflen,
+   sdp-device-request_queue-max_sectors * 512);
return put_user(val, ip);
case SG_SET_COMMAND_Q:
result = get_user(val, ip);
@@ -1061,6 +1064,9 @@ sg_ioctl(struct inode *inode, struct file *filp,
if (sdp-detached)
return -ENODEV;
return scsi_ioctl(sdp-device, cmd_in, p);
+   case BLKSECTGET:
+   return put_user(sdp-device-request_queue-max_sectors * 512,
+   ip);
default:
if (read_only)
return -EPERM;  /* don't know so take safe approach */
@@ -2339,6 +2345,7 @@ sg_add_sfp(Sg_device * sdp, int dev)
 {
Sg_fd *sfp;
unsigned long iflags;
+   int bufflen;
 
sfp = kzalloc(sizeof(*sfp), GFP_ATOMIC | __GFP_NOWARN);
if (!sfp)
@@ -2369,7 +2376,9 @@ sg_add_sfp(Sg_device * sdp, int dev)
if (unlikely(sg_big_buff != def_reserved_size))
sg_big_buff = def_reserved_size;
 
-   sg_build_reserve(sfp, sg_big_buff);
+   bufflen = min_t(int, sg_big_buff,
+   sdp-device-request_queue-max_sectors * 512);
+   sg_build_reserve(sfp, bufflen);
SCSI_LOG_TIMEOUT(3, printk(sg_add_sfp:   bufflen=%d, k_use_sg=%d\n,
   sfp-reserve.bufflen, sfp-reserve.k_use_sg));
return sfp;

[SCSI] fusion: fix domain validation loops

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7297824581755593535fc97d2c8b6c47e2dc2db6
Commit: 7297824581755593535fc97d2c8b6c47e2dc2db6
Parent: 4e08df3f91837656c36712f559d5ce8d80852760
Author: Eric Moore [EMAIL PROTECTED]
AuthorDate: Wed Feb 7 16:51:40 2007 -0700
Committer:  James Bottomley [EMAIL PROTECTED]
CommitDate: Mon Apr 30 10:22:00 2007 -0500

[SCSI] fusion: fix domain validation loops

After host reset, the device are programmed to default asyn narrow nego.
We need to reprogram the parameter back to previous values.  If the host
reset is called as a result of spi_dv_device() commands timing out, its
possible to get into an infinite loop of dv to host reset.  This will
prevent that case, as we merely program old values.  If host reset is
called outside context of domain validation, then we can  call
spi_dv_device.

Signed-off-by: Eric Moore [EMAIL PROTECTED]
Signed-off-by: James Bottomley [EMAIL PROTECTED]
---
 drivers/message/fusion/mptbase.h |1 +
 drivers/message/fusion/mptspi.c  |   23 +--
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index e3a3927..d25d3be 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -994,6 +994,7 @@ typedef struct _MPT_SCSI_HOST {
int   scandv_wait_done;
long  last_queue_full;
u16   tm_iocstatus;
+   u16   spi_pending;
struct list_head  target_reset_list;
 } MPT_SCSI_HOST;
 
diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c
index b08416f..d75f7ff 100644
--- a/drivers/message/fusion/mptspi.c
+++ b/drivers/message/fusion/mptspi.c
@@ -676,7 +676,9 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd,
return;
}
 
+   hd-spi_pending |= (1  sdev-id);
spi_dv_device(sdev);
+   hd-spi_pending = ~(1  sdev-id);
 
if (sdev-channel == 1 
mptscsih_quiesce_raid(hd, 0, vtarget-channel, vtarget-id)  0)
@@ -1202,11 +1204,27 @@ mptspi_dv_renegotiate_work(struct work_struct *work)
container_of(work, struct work_queue_wrapper, work);
struct _MPT_SCSI_HOST *hd = wqw-hd;
struct scsi_device *sdev;
+   struct scsi_target *starget;
+   struct _CONFIG_PAGE_SCSI_DEVICE_1 pg1;
+   u32 nego;
 
kfree(wqw);
 
-   shost_for_each_device(sdev, hd-ioc-sh)
-   mptspi_dv_device(hd, sdev);
+   if (hd-spi_pending) {
+   shost_for_each_device(sdev, hd-ioc-sh) {
+   if  (hd-spi_pending  (1  sdev-id))
+   continue;
+   starget = scsi_target(sdev);
+   nego = mptspi_getRP(starget);
+   pg1.RequestedParameters = cpu_to_le32(nego);
+   pg1.Reserved = 0;
+   pg1.Configuration = 0;
+   mptspi_write_spi_device_pg1(starget, pg1);
+   }
+   } else {
+   shost_for_each_device(sdev, hd-ioc-sh)
+   mptspi_dv_device(hd, sdev);
+   }
 }
 
 static void
@@ -1452,6 +1470,7 @@ mptspi_probe(struct pci_dev *pdev, const struct 
pci_device_id *id)
init_waitqueue_head(hd-scandv_waitq);
hd-scandv_wait_done = 0;
hd-last_queue_full = 0;
+   hd-spi_pending = 0;
 
/* Some versions of the firmware don't support page 0; without
 * that we can't get the parameters */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[AF_IUCV]: Compile fix - adopt to skbuff changes.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=af7cd373b01ccb8191dc16c77fff4cf2b11def50
Commit: af7cd373b01ccb8191dc16c77fff4cf2b11def50
Parent: 62ea6d80211ecc88ef516927ecebf64cb505be3f
Author: Heiko Carstens [EMAIL PROTECTED]
AuthorDate: Sat May 5 11:41:18 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 11:41:18 2007 -0700

[AF_IUCV]: Compile fix - adopt to skbuff changes.

From: Heiko Carstens [EMAIL PROTECTED]

  CC [M]  net/iucv/af_iucv.o
net/iucv/af_iucv.c: In function `iucv_fragment_skb':
net/iucv/af_iucv.c:984: error: structure has no member named `h'
net/iucv/af_iucv.c:985: error: structure has no member named `nh'
net/iucv/af_iucv.c:988: error: incompatible type for argument 1 of
`skb_queue_tail'

Signed-off-by: Heiko Carstens [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 net/iucv/af_iucv.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 2f13738..d9e9ddb 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -961,7 +961,7 @@ static void iucv_callback_connack(struct iucv_path *path, 
u8 ipuser[16])
 }
 
 static int iucv_fragment_skb(struct sock *sk, struct sk_buff *skb, int len,
-struct sk_buff_head fragmented_skb_q)
+struct sk_buff_head *fragmented_skb_q)
 {
int dataleft, size, copied = 0;
struct sk_buff *nskb;
@@ -981,8 +981,8 @@ static int iucv_fragment_skb(struct sock *sk, struct 
sk_buff *skb, int len,
copied += size;
dataleft -= size;
 
-   nskb-h.raw = nskb-data;
-   nskb-nh.raw = nskb-data;
+   skb_reset_transport_header(nskb);
+   skb_reset_network_header(nskb);
nskb-len = size;
 
skb_queue_tail(fragmented_skb_q, nskb);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Fix TSO bugs.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c13e3713857d5ea572cd67f3d5749100b1963ad2
Commit: c13e3713857d5ea572cd67f3d5749100b1963ad2
Parent: 64a327a7029d3860ddf6a024816afa9e6673eb57
Author: Matt Carlson [EMAIL PROTECTED]
AuthorDate: Sat May 5 11:50:04 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 11:50:04 2007 -0700

[TG3]: Fix TSO bugs.

1. Remove the check for skb-len greater than MTU when doing TSO.
When the destination has a smaller MSS than the source, a TSO packet
may be smaller than the MTU and we still need to process it as a TSO
packet.

2. On 5705A3 devices with TSO enabled, the DMA engine can hang due to a
hardware bug.  This patch avoids the hanging condition by reducing the
DMA burst size.

Signed-off-by: Matt Carlson [EMAIL PROTECTED]
Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |9 +++--
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 9488f49..b8141be 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -3895,8 +3895,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct 
net_device *dev)
entry = tp-tx_prod;
base_flags = 0;
mss = 0;
-   if (skb-len  (tp-dev-mtu + ETH_HLEN) 
-   (mss = skb_shinfo(skb)-gso_size) != 0) {
+   if ((mss = skb_shinfo(skb)-gso_size) != 0) {
int tcp_opt_len, ip_tcp_len;
 
if (skb_header_cloned(skb) 
@@ -4053,8 +4052,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, 
struct net_device *dev)
if (skb-ip_summed == CHECKSUM_PARTIAL)
base_flags |= TXD_FLAG_TCPUDP_CSUM;
mss = 0;
-   if (skb-len  (tp-dev-mtu + ETH_HLEN) 
-   (mss = skb_shinfo(skb)-gso_size) != 0) {
+   if ((mss = skb_shinfo(skb)-gso_size) != 0) {
struct iphdr *iph;
int tcp_opt_len, ip_tcp_len, hdr_len;
 
@@ -6346,8 +6344,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 tp-pci_chip_rev_id != CHIPREV_ID_5705_A0) ||
(GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5750)) {
if (tp-tg3_flags2  TG3_FLG2_TSO_CAPABLE 
-   (tp-pci_chip_rev_id == CHIPREV_ID_5705_A1 ||
-tp-pci_chip_rev_id == CHIPREV_ID_5705_A2)) {
+   GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5705) {
rdmac_mode |= RDMAC_MODE_FIFO_SIZE_128;
} else if (!(tr32(TG3PCI_PCISTATE)  PCISTATE_BUS_SPEED_HIGH) 
   !(tp-tg3_flags2  TG3_FLG2_IS_5788)) {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Improve NVRAM sizing.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=989a9d239c5b9ae6053aed6e3819304930baf27d
Commit: 989a9d239c5b9ae6053aed6e3819304930baf27d
Parent: c13e3713857d5ea572cd67f3d5749100b1963ad2
Author: Matt Carlson [EMAIL PROTECTED]
AuthorDate: Sat May 5 11:51:05 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 11:51:05 2007 -0700

[TG3]: Improve NVRAM sizing.

This patch changes the NVRAM sizing procedure so that the driver can
take advantage of devices with 1:1 NVRAM strapping configurations.  This
is useful in cases where the traditional NVRAM sizing method fails.  In
the event that the flash size cannot be determined, the largest known
NVRAM size is used.  The patch also removes support for 5755 NVRAM
devices that are not supported by Broadcom and adds explicit sizing for
this device.

Signed-off-by: Matt Carlson [EMAIL PROTECTED]
Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   39 +++
 1 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index b8141be..c01bd86 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -9286,7 +9286,7 @@ static void __devinit tg3_get_nvram_size(struct tg3 *tp)
return;
}
}
-   tp-nvram_size = 0x2;
+   tp-nvram_size = 0x8;
 }
 
 static void __devinit tg3_get_nvram_info(struct tg3 *tp)
@@ -9405,33 +9405,31 @@ static void __devinit tg3_get_5752_nvram_info(struct 
tg3 *tp)
 
 static void __devinit tg3_get_5755_nvram_info(struct tg3 *tp)
 {
-   u32 nvcfg1;
+   u32 nvcfg1, protect = 0;
 
nvcfg1 = tr32(NVRAM_CFG1);
 
/* NVRAM protection for TPM */
-   if (nvcfg1  (1  27))
+   if (nvcfg1  (1  27)) {
tp-tg3_flags2 |= TG3_FLG2_PROTECTED_NVRAM;
+   protect = 1;
+   }
 
-   switch (nvcfg1  NVRAM_CFG1_5752VENDOR_MASK) {
-   case FLASH_5755VENDOR_ATMEL_EEPROM_64KHZ:
-   case FLASH_5755VENDOR_ATMEL_EEPROM_376KHZ:
-   tp-nvram_jedecnum = JEDEC_ATMEL;
-   tp-tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
-   tp-nvram_pagesize = ATMEL_AT24C512_CHIP_SIZE;
-
-   nvcfg1 = ~NVRAM_CFG1_COMPAT_BYPASS;
-   tw32(NVRAM_CFG1, nvcfg1);
-   break;
-   case FLASH_5752VENDOR_ATMEL_FLASH_BUFFERED:
+   nvcfg1 = NVRAM_CFG1_5752VENDOR_MASK;
+   switch (nvcfg1) {
case FLASH_5755VENDOR_ATMEL_FLASH_1:
case FLASH_5755VENDOR_ATMEL_FLASH_2:
case FLASH_5755VENDOR_ATMEL_FLASH_3:
-   case FLASH_5755VENDOR_ATMEL_FLASH_4:
tp-nvram_jedecnum = JEDEC_ATMEL;
tp-tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
tp-tg3_flags2 |= TG3_FLG2_FLASH;
tp-nvram_pagesize = 264;
+   if (nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_1)
+   tp-nvram_size = (protect ? 0x3e200 : 0x8);
+   else if (nvcfg1 == FLASH_5755VENDOR_ATMEL_FLASH_2)
+   tp-nvram_size = (protect ? 0x1f200 : 0x4);
+   else
+   tp-nvram_size = (protect ? 0x1f200 : 0x2);
break;
case FLASH_5752VENDOR_ST_M45PE10:
case FLASH_5752VENDOR_ST_M45PE20:
@@ -9440,6 +9438,12 @@ static void __devinit tg3_get_5755_nvram_info(struct tg3 
*tp)
tp-tg3_flags |= TG3_FLAG_NVRAM_BUFFERED;
tp-tg3_flags2 |= TG3_FLG2_FLASH;
tp-nvram_pagesize = 256;
+   if (nvcfg1 == FLASH_5752VENDOR_ST_M45PE10)
+   tp-nvram_size = (protect ? 0x1 : 0x2);
+   else if (nvcfg1 == FLASH_5752VENDOR_ST_M45PE20)
+   tp-nvram_size = (protect ? 0x1 : 0x4);
+   else
+   tp-nvram_size = (protect ? 0x2 : 0x8);
break;
}
 }
@@ -9515,6 +9519,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
}
tg3_enable_nvram_access(tp);
 
+   tp-nvram_size = 0;
+
if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5752)
tg3_get_5752_nvram_info(tp);
else if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5755)
@@ -9526,7 +9532,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
else
tg3_get_nvram_info(tp);
 
-   tg3_get_nvram_size(tp);
+   if (tp-nvram_size == 0)
+   

[TG3]: Remove reset during MAC address changes.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=986e0aeb9ae09127b401c3baa66f15b7a31f354c
Commit: 986e0aeb9ae09127b401c3baa66f15b7a31f354c
Parent: a85feb8cfc53c08b6f0d770f930ca9cc6885f414
Author: Michael Chan [EMAIL PROTECTED]
AuthorDate: Sat May 5 12:10:20 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 12:10:20 2007 -0700

[TG3]: Remove reset during MAC address changes.

The reset was added a while back so that ASF could re-init whatever
MAC address it wanted to use after the MAC address was changed.
Instead of resetting, we can just keep MAC address 1 unchanged during
MAC address changes if MAC address 1 is different from MAC address 0.

This fixes 2 problems:

1. Bonding calls set_mac_address in contexts that cannot sleep.
It no longer sleeps with the chip reset removed.

2. When ASF shares the same MAC address as the NIC, it needs to
always do that even when the MAC address is changed.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   35 ++-
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index e829262..3211218 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -5934,7 +5934,7 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
 
 
 /* tp-lock is held. */
-static void __tg3_set_mac_addr(struct tg3 *tp)
+static void __tg3_set_mac_addr(struct tg3 *tp, int skip_mac_1)
 {
u32 addr_high, addr_low;
int i;
@@ -5946,6 +5946,8 @@ static void __tg3_set_mac_addr(struct tg3 *tp)
(tp-dev-dev_addr[4]   8) |
(tp-dev-dev_addr[5]   0));
for (i = 0; i  4; i++) {
+   if (i == 1  skip_mac_1)
+   continue;
tw32(MAC_ADDR_0_HIGH + (i * 8), addr_high);
tw32(MAC_ADDR_0_LOW + (i * 8), addr_low);
}
@@ -5972,7 +5974,7 @@ static int tg3_set_mac_addr(struct net_device *dev, void 
*p)
 {
struct tg3 *tp = netdev_priv(dev);
struct sockaddr *addr = p;
-   int err = 0;
+   int err = 0, skip_mac_1 = 0;
 
if (!is_valid_ether_addr(addr-sa_data))
return -EINVAL;
@@ -5983,22 +5985,21 @@ static int tg3_set_mac_addr(struct net_device *dev, 
void *p)
return 0;
 
if (tp-tg3_flags  TG3_FLAG_ENABLE_ASF) {
-   /* Reset chip so that ASF can re-init any MAC addresses it
-* needs.
-*/
-   tg3_netif_stop(tp);
-   tg3_full_lock(tp, 1);
+   u32 addr0_high, addr0_low, addr1_high, addr1_low;
 
-   tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
-   err = tg3_restart_hw(tp, 0);
-   if (!err)
-   tg3_netif_start(tp);
-   tg3_full_unlock(tp);
-   } else {
-   spin_lock_bh(tp-lock);
-   __tg3_set_mac_addr(tp);
-   spin_unlock_bh(tp-lock);
+   addr0_high = tr32(MAC_ADDR_0_HIGH);
+   addr0_low = tr32(MAC_ADDR_0_LOW);
+   addr1_high = tr32(MAC_ADDR_1_HIGH);
+   addr1_low = tr32(MAC_ADDR_1_LOW);
+
+   /* Skip MAC addr 1 if ASF is using it. */
+   if ((addr0_high != addr1_high || addr0_low != addr1_low) 
+   !(addr1_high == 0  addr1_low == 0))
+   skip_mac_1 = 1;
}
+   spin_lock_bh(tp-lock);
+   __tg3_set_mac_addr(tp, skip_mac_1);
+   spin_unlock_bh(tp-lock);
 
return err;
 }
@@ -6315,7 +6316,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 tp-rx_jumbo_ptr);
 
/* Initialize MAC address and backoff seed. */
-   __tg3_set_mac_addr(tp);
+   __tg3_set_mac_addr(tp, 0);
 
/* MTU + ethernet header + FCS + optional VLAN tag */
tw32(MAC_RX_MTU_SIZE, tp-dev-mtu + ETH_HLEN + 8);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Eliminate the TG3_FLAG_GOT_SERDES_FLOWCTL flag.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5cf64b8a739439f0d6748babb1ccb6bcad7c
Commit: 5cf64b8a739439f0d6748babb1ccb6bcad7c
Parent: 986e0aeb9ae09127b401c3baa66f15b7a31f354c
Author: Michael Chan [EMAIL PROTECTED]
AuthorDate: Sat May 5 12:11:21 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 12:11:21 2007 -0700

[TG3]: Eliminate the TG3_FLAG_GOT_SERDES_FLOWCTL flag.

This flag does not do anything useful.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   10 ++
 drivers/net/tg3.h |1 -
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 3211218..ff157b7 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -2595,10 +2595,8 @@ static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 
mac_status)
 {
int current_link_up = 0;
 
-   if (!(mac_status  MAC_STATUS_PCS_SYNCED)) {
-   tp-tg3_flags = ~TG3_FLAG_GOT_SERDES_FLOWCTL;
+   if (!(mac_status  MAC_STATUS_PCS_SYNCED))
goto out;
-   }
 
if (tp-link_config.autoneg == AUTONEG_ENABLE) {
u32 flags;
@@ -2616,7 +2614,6 @@ static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 
mac_status)
 
tg3_setup_flow_control(tp, local_adv, remote_adv);
 
-   tp-tg3_flags |= TG3_FLAG_GOT_SERDES_FLOWCTL;
current_link_up = 1;
}
for (i = 0; i  30; i++) {
@@ -2639,7 +2636,6 @@ static int tg3_setup_fiber_by_hand(struct tg3 *tp, u32 
mac_status)
} else {
/* Forcing 1000FD link up. */
current_link_up = 1;
-   tp-tg3_flags |= TG3_FLAG_GOT_SERDES_FLOWCTL;
 
tw32_f(MAC_MODE, (tp-mac_mode | MAC_MODE_SEND_CONFIGS));
udelay(40);
@@ -7400,9 +7396,7 @@ static int tg3_close(struct net_device *dev)
 
tg3_halt(tp, RESET_KIND_SHUTDOWN, 1);
tg3_free_rings(tp);
-   tp-tg3_flags =
-   ~(TG3_FLAG_INIT_COMPLETE |
- TG3_FLAG_GOT_SERDES_FLOWCTL);
+   tp-tg3_flags = ~TG3_FLAG_INIT_COMPLETE;
 
tg3_full_unlock(tp);
 
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index f76e310..dd04a46 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -,7 +,6 @@ struct tg3 {
 #define TG3_FLAG_IN_RESET_TASK 0x0400
 #define TG3_FLAG_40BIT_DMA_BUG 0x0800
 #define TG3_FLAG_BROKEN_CHECKSUMS  0x1000
-#define TG3_FLAG_GOT_SERDES_FLOWCTL0x2000
 #define TG3_FLAG_CHIP_RESETTING0x4000
 #define TG3_FLAG_INIT_COMPLETE 0x8000
u32 tg3_flags2;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Eliminate the TG3_FLAG_5701_REG_WRITE_BUG flag.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=98efd8a6be79550767f5a9be6f3db8e7e9b747da
Commit: 98efd8a6be79550767f5a9be6f3db8e7e9b747da
Parent: 5cf64b8a739439f0d6748babb1ccb6bcad7c
Author: Matt Carlson [EMAIL PROTECTED]
AuthorDate: Sat May 5 12:47:25 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 12:47:25 2007 -0700

[TG3]: Eliminate the TG3_FLAG_5701_REG_WRITE_BUG flag.

This patch removes the use of the TG3_FLAG_5701_REG_WRITE_BUG flag.
It's logic is only used to set a function pointer and thus the
logic can be collapsed and the flag removed.

[ Comment tidy by Christoph Hellwig. -DaveM ]

Signed-off-by: Matt Carlson [EMAIL PROTECTED]
Signed-off-by: Michael Chan [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   24 
 drivers/net/tg3.h |1 -
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index ff157b7..4154e12 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -10673,17 +10673,6 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (GET_CHIP_REV(tp-pci_chip_rev_id) == CHIPREV_5700_BX)
tp-tg3_flags |= TG3_FLAG_TXD_MBOX_HWBUG;
 
-   /* Back to back register writes can cause problems on this chip,
-* the workaround is to read back all reg writes except those to
-* mailbox regs.  See tg3_write_indirect_reg32().
-*
-* PCI Express 5750_A0 rev chips need this workaround too.
-*/
-   if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5701 ||
-   ((tp-tg3_flags2  TG3_FLG2_PCI_EXPRESS) 
-tp-pci_chip_rev_id == CHIPREV_ID_5750_A0))
-   tp-tg3_flags |= TG3_FLAG_5701_REG_WRITE_BUG;
-
if ((pci_state_reg  PCISTATE_BUS_SPEED_HIGH) != 0)
tp-tg3_flags |= TG3_FLAG_PCI_HIGH_SPEED;
if ((pci_state_reg  PCISTATE_BUS_32BIT) != 0)
@@ -10707,8 +10696,19 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
/* Various workaround register access methods */
if (tp-tg3_flags  TG3_FLAG_PCIX_TARGET_HWBUG)
tp-write32 = tg3_write_indirect_reg32;
-   else if (tp-tg3_flags  TG3_FLAG_5701_REG_WRITE_BUG)
+   else if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5701 ||
+((tp-tg3_flags2  TG3_FLG2_PCI_EXPRESS) 
+ tp-pci_chip_rev_id == CHIPREV_ID_5750_A0)) {
+   /*
+* Back to back register writes can cause problems on these
+* chips, the workaround is to read back all reg writes
+* except those to mailbox regs.
+*
+* See tg3_write_indirect_reg32().
+*/
tp-write32 = tg3_write_flush_reg32;
+   }
+
 
if ((tp-tg3_flags  TG3_FLAG_TXD_MBOX_HWBUG) ||
(tp-tg3_flags  TG3_FLAG_MBOX_WRITE_REORDER)) {
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index dd04a46..c52acb0 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2199,7 +2199,6 @@ struct tg3 {
 #define TG3_FLAG_USE_LINKCHG_REG   0x0008
 #define TG3_FLAG_USE_MI_INTERRUPT  0x0010
 #define TG3_FLAG_ENABLE_ASF0x0020
-#define TG3_FLAG_5701_REG_WRITE_BUG0x0040
 #define TG3_FLAG_POLL_SERDES   0x0080
 #define TG3_FLAG_MBOX_WRITE_REORDER0x0100
 #define TG3_FLAG_PCIX_TARGET_HWBUG 0x0200
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[TG3]: Add TG3_FLAG_SUPPORT_MSI flag.

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7544b0972c1fc1a0e6c54baa1f44c81019743daa
Commit: 7544b0972c1fc1a0e6c54baa1f44c81019743daa
Parent: 98efd8a6be79550767f5a9be6f3db8e7e9b747da
Author: Michael Chan [EMAIL PROTECTED]
AuthorDate: Sat May 5 13:08:32 2007 -0700
Committer:  David S. Miller [EMAIL PROTECTED]
CommitDate: Sat May 5 13:08:32 2007 -0700

[TG3]: Add TG3_FLAG_SUPPORT_MSI flag.

And fix up the code to always allow MSI on 5714 A2.

Call tg3_find_peer() earlier because we need that information before
we can determine whether we can set TG3_FLAG_SUPPORT_MSI or not.

Signed-off-by: Michael Chan [EMAIL PROTECTED]
Signed-off-by: David S. Miller [EMAIL PROTECTED]
---
 drivers/net/tg3.c |   24 +++-
 drivers/net/tg3.h |2 ++
 2 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 4154e12..59d6e74 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -7033,11 +7033,7 @@ static int tg3_open(struct net_device *dev)
if (err)
return err;
 
-   if ((tp-tg3_flags2  TG3_FLG2_5750_PLUS) 
-   (GET_CHIP_REV(tp-pci_chip_rev_id) != CHIPREV_5750_AX) 
-   (GET_CHIP_REV(tp-pci_chip_rev_id) != CHIPREV_5750_BX) 
-   !((GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5714) 
- (tp-pdev_peer == tp-pdev))) {
+   if (tp-tg3_flags  TG3_FLAG_SUPPORT_MSI) {
/* All MSI supporting chips should support tagged
 * status.  Assert that this is the case.
 */
@@ -10404,6 +10400,8 @@ static void __devinit tg3_read_fw_ver(struct tg3 *tp)
}
 }
 
+static struct pci_dev * __devinit tg3_find_peer(struct tg3 *);
+
 static int __devinit tg3_get_invariants(struct tg3 *tp)
 {
static struct pci_device_id write_reorder_chipsets[] = {
@@ -10559,6 +10557,10 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp-pci_hdr_type = (cacheline_sz_reg  16)  0xff;
tp-pci_bist = (cacheline_sz_reg  24)  0xff;
 
+   if ((GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5704) ||
+   (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5714))
+   tp-pdev_peer = tg3_find_peer(tp);
+
if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5750 ||
GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5752 ||
GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5755 ||
@@ -10572,6 +10574,14 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
tp-tg3_flags2 |= TG3_FLG2_5705_PLUS;
 
if (tp-tg3_flags2  TG3_FLG2_5750_PLUS) {
+   tp-tg3_flags |= TG3_FLAG_SUPPORT_MSI;
+   if (GET_CHIP_REV(tp-pci_chip_rev_id) == CHIPREV_5750_AX ||
+   GET_CHIP_REV(tp-pci_chip_rev_id) == CHIPREV_5750_BX ||
+   (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5714 
+tp-pci_chip_rev_id = CHIPREV_ID_5714_A2 
+tp-pdev_peer == tp-pdev))
+   tp-tg3_flags = ~TG3_FLAG_SUPPORT_MSI;
+
if (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5755 ||
GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5787 ||
GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5906) {
@@ -11897,10 +11907,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
tp-rx_pending = 63;
}
 
-   if ((GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5704) ||
-   (GET_ASIC_REV(tp-pci_chip_rev_id) == ASIC_REV_5714))
-   tp-pdev_peer = tg3_find_peer(tp);
-
err = tg3_get_device_address(tp);
if (err) {
printk(KERN_ERR PFX Could not obtain valid ethernet address, 
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c52acb0..dcdfc08 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -131,6 +131,7 @@
 #define  CHIPREV_ID_5752_A0_HW  0x5000
 #define  CHIPREV_ID_5752_A0 0x6000
 #define  CHIPREV_ID_5752_A1 0x6001
+#define  CHIPREV_ID_5714_A2 0x9002
 #define  CHIPREV_ID_5906_A1 0xc001
 #define  GET_ASIC_REV(CHIP_REV_ID) ((CHIP_REV_ID)  12)
 #define   ASIC_REV_5700 0x07
@@ -2221,6 +,7 @@ struct tg3 {
 #define TG3_FLAG_IN_RESET_TASK 0x0400
 #define TG3_FLAG_40BIT_DMA_BUG 0x0800
 #define TG3_FLAG_BROKEN_CHECKSUMS  0x1000
+#define TG3_FLAG_SUPPORT_MSI   0x2000
 #define TG3_FLAG_CHIP_RESETTING0x4000
 #define TG3_FLAG_INIT_COMPLETE 0x8000
u32 tg3_flags2;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix nfsroot build

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=989485c190cc6a64e5a21d98ef2d752df1db8c27
Commit: 989485c190cc6a64e5a21d98ef2d752df1db8c27
Parent: 68762f3d8e7ea644fae1f490f9850ebf462548bd
Author: Ralf Baechle [EMAIL PROTECTED]
AuthorDate: Sat May 5 22:05:11 2007 +0100
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat May 5 14:15:32 2007 -0700

Fix nfsroot build

  CC  fs/nfs/nfsroot.o
fs/nfs/nfsroot.c:131: error: tokens causes a section type conflict
make[2]: *** [fs/nfs/nfsroot.o] Error 1

This is due to mixing const and non-const content in the same section
which halfway recent gccs absolutely hate.  Fixed by dropping the const.

Signed-off-by: Ralf Baechle [EMAIL PROTECTED]
Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 include/linux/parser.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/parser.h b/include/linux/parser.h
index 86676f6..26b2bdf 100644
--- a/include/linux/parser.h
+++ b/include/linux/parser.h
@@ -14,7 +14,7 @@ struct match_token {
const char *pattern;
 };
 
-typedef const struct match_token match_table_t[];
+typedef struct match_token match_table_t[];
 
 /* Maximum number of arguments that match_token will find in a pattern */
 enum {MAX_OPT_ARGS = 3};
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Fix compile of tmscsim SCSI driver

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=886a0768affe9a32f18c45f8e1393bca9ece5392
Commit: 886a0768affe9a32f18c45f8e1393bca9ece5392
Parent: 989485c190cc6a64e5a21d98ef2d752df1db8c27
Author: Linus Torvalds [EMAIL PROTECTED]
AuthorDate: Sat May 5 14:23:40 2007 -0700
Committer:  Linus Torvalds [EMAIL PROTECTED]
CommitDate: Sat May 5 14:23:40 2007 -0700

Fix compile of tmscsim SCSI driver

It still used the long-deprecated pci_module_init() interface, rather
than the proper pci_register_driver() one.

[ I don't have the hardware, and I doubt many do, but the fix is
  trivial and obvious, and can't be worse than not compiling ]

Signed-off-by: Linus Torvalds [EMAIL PROTECTED]
---
 drivers/scsi/tmscsim.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/tmscsim.c b/drivers/scsi/tmscsim.c
index a583e89..3158949 100644
--- a/drivers/scsi/tmscsim.c
+++ b/drivers/scsi/tmscsim.c
@@ -2680,7 +2680,7 @@ static int __init dc390_module_init(void)
printk (KERN_INFO DC390: Using safe settings.\n);
}
 
-   return pci_module_init(dc390_driver);
+   return pci_register_driver(dc390_driver);
 }
 
 static void __exit dc390_module_exit(void)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] x86-64: Update defconfig

2007-05-05 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2ca8c1a1269630473840835d1585adf2582b7c0b
Commit: 2ca8c1a1269630473840835d1585adf2582b7c0b
Parent: dc87c3985e9b442c60994308a96f887579addc39
Author: Andi Kleen [EMAIL PROTECTED]
AuthorDate: Wed May 2 19:27:04 2007 +0200
Committer:  Andi Kleen [EMAIL PROTECTED]
CommitDate: Wed May 2 19:27:04 2007 +0200

[PATCH] x86-64: Update defconfig

Signed-off-by: Andi Kleen [EMAIL PROTECTED]
---
 arch/x86_64/defconfig |  183 +
 1 files changed, 49 insertions(+), 134 deletions(-)

diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig
index b263788..941a7e3 100644
--- a/arch/x86_64/defconfig
+++ b/arch/x86_64/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
-# Linux kernel version: 2.6.21-rc3
-# Wed Mar  7 15:29:47 2007
+# Linux kernel version: 2.6.21-git3
+# Tue May  1 07:30:48 2007
 #
 CONFIG_X86_64=y
 CONFIG_64BIT=y
@@ -118,11 +118,11 @@ CONFIG_X86_PC=y
 # CONFIG_X86_VSMP is not set
 # CONFIG_MK8 is not set
 # CONFIG_MPSC is not set
-# CONFIG_MCORE2 is not set
-CONFIG_GENERIC_CPU=y
-CONFIG_X86_L1_CACHE_BYTES=128
-CONFIG_X86_L1_CACHE_SHIFT=7
-CONFIG_X86_INTERNODE_CACHE_BYTES=128
+CONFIG_MCORE2=y
+# CONFIG_GENERIC_CPU is not set
+CONFIG_X86_L1_CACHE_BYTES=64
+CONFIG_X86_L1_CACHE_SHIFT=6
+CONFIG_X86_INTERNODE_CACHE_BYTES=64
 CONFIG_X86_TSC=y
 CONFIG_X86_GOOD_APIC=y
 # CONFIG_MICROCODE is not set
@@ -174,6 +174,7 @@ CONFIG_X86_MCE_INTEL=y
 CONFIG_X86_MCE_AMD=y
 # CONFIG_KEXEC is not set
 # CONFIG_CRASH_DUMP is not set
+# CONFIG_RELOCATABLE is not set
 CONFIG_PHYSICAL_START=0x20
 CONFIG_SECCOMP=y
 # CONFIG_CC_STACKPROTECTOR is not set
@@ -182,7 +183,6 @@ CONFIG_HZ_250=y
 # CONFIG_HZ_300 is not set
 # CONFIG_HZ_1000 is not set
 CONFIG_HZ=250
-# CONFIG_REORDER is not set
 CONFIG_K8_NB=y
 CONFIG_GENERIC_HARDIRQS=y
 CONFIG_GENERIC_IRQ_PROBE=y
@@ -218,7 +218,6 @@ CONFIG_ACPI_HOTPLUG_CPU=y
 CONFIG_ACPI_THERMAL=y
 CONFIG_ACPI_NUMA=y
 # CONFIG_ACPI_ASUS is not set
-# CONFIG_ACPI_IBM is not set
 # CONFIG_ACPI_TOSHIBA is not set
 CONFIG_ACPI_BLACKLIST_YEAR=0
 # CONFIG_ACPI_DEBUG is not set
@@ -243,7 +242,7 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
 # CONFIG_CPU_FREQ_GOV_POWERSAVE is not set
 CONFIG_CPU_FREQ_GOV_USERSPACE=y
 CONFIG_CPU_FREQ_GOV_ONDEMAND=y
-# CONFIG_CPU_FREQ_GOV_CONSERVATIVE is not set
+CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y
 
 #
 # CPUFreq processor drivers
@@ -299,7 +298,6 @@ CONFIG_NET=y
 #
 # Networking options
 #
-# CONFIG_NETDEBUG is not set
 CONFIG_PACKET=y
 # CONFIG_PACKET_MMAP is not set
 CONFIG_UNIX=y
@@ -334,6 +332,7 @@ CONFIG_DEFAULT_TCP_CONG=cubic
 CONFIG_IPV6=y
 # CONFIG_IPV6_PRIVACY is not set
 # CONFIG_IPV6_ROUTER_PREF is not set
+# CONFIG_IPV6_OPTIMISTIC_DAD is not set
 # CONFIG_INET6_AH is not set
 # CONFIG_INET6_ESP is not set
 # CONFIG_INET6_IPCOMP is not set
@@ -389,6 +388,13 @@ CONFIG_IPV6_SIT=y
 # CONFIG_HAMRADIO is not set
 # CONFIG_IRDA is not set
 # CONFIG_BT is not set
+# CONFIG_AF_RXRPC is not set
+
+#
+# Wireless
+#
+# CONFIG_CFG80211 is not set
+# CONFIG_WIRELESS_EXT is not set
 # CONFIG_IEEE80211 is not set
 
 #
@@ -409,10 +415,6 @@ CONFIG_FW_LOADER=y
 # Connector - unified userspace - kernelspace linker
 #
 # CONFIG_CONNECTOR is not set
-
-#
-# Memory Technology Devices (MTD)
-#
 # CONFIG_MTD is not set
 
 #
@@ -459,6 +461,7 @@ CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024
 # CONFIG_SGI_IOC4 is not set
 # CONFIG_TIFM_CORE is not set
 # CONFIG_SONY_LAPTOP is not set
+# CONFIG_THINKPAD_ACPI is not set
 
 #
 # ATA/ATAPI/MFM/RLL support
@@ -494,7 +497,6 @@ CONFIG_BLK_DEV_IDEPCI=y
 # CONFIG_BLK_DEV_RZ1000 is not set
 CONFIG_BLK_DEV_IDEDMA_PCI=y
 # CONFIG_BLK_DEV_IDEDMA_FORCED is not set
-CONFIG_IDEDMA_PCI_AUTO=y
 # CONFIG_IDEDMA_ONLYDISK is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_BLK_DEV_ALI15X3 is not set
@@ -525,7 +527,6 @@ CONFIG_BLK_DEV_PDC202XX_NEW=y
 # CONFIG_IDE_ARM is not set
 CONFIG_BLK_DEV_IDEDMA=y
 # CONFIG_IDEDMA_IVB is not set
-CONFIG_IDEDMA_AUTO=y
 # CONFIG_BLK_DEV_HD is not set
 
 #
@@ -584,11 +585,9 @@ CONFIG_AIC79XX_DEBUG_MASK=0
 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set
 # CONFIG_SCSI_AIC94XX is not set
 # CONFIG_SCSI_ARCMSR is not set
-CONFIG_MEGARAID_NEWGEN=y
-CONFIG_MEGARAID_MM=y
-CONFIG_MEGARAID_MAILBOX=y
+# CONFIG_MEGARAID_NEWGEN is not set
 # CONFIG_MEGARAID_LEGACY is not set
-CONFIG_MEGARAID_SAS=y
+# CONFIG_MEGARAID_SAS is not set
 # CONFIG_SCSI_HPTIOP is not set
 # CONFIG_SCSI_BUSLOGIC is not set
 # CONFIG_SCSI_DMX3191D is not set
@@ -608,6 +607,7 @@ CONFIG_MEGARAID_SAS=y
 # CONFIG_SCSI_DC395x is not set
 # CONFIG_SCSI_DC390T is not set
 # CONFIG_SCSI_DEBUG is not set
+# CONFIG_SCSI_ESP_CORE is not set
 # CONFIG_SCSI_SRP is not set
 
 #
@@ -636,6 +636,7 @@ CONFIG_SATA_ACPI=y
 # CONFIG_PATA_AMD is not set
 # CONFIG_PATA_ARTOP is not set
 # CONFIG_PATA_ATIIXP is not set
+# CONFIG_PATA_CMD640_PCI is not set
 # CONFIG_PATA_CMD64X is not set
 # CONFIG_PATA_CS5520 is not set

  1   2   3   4   >