[S390] single-step cleanup

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ac30be461084f30ad6e22c6b91347e880ed41aa
Commit: 0ac30be461084f30ad6e22c6b91347e880ed41aa
Parent: ea29ee16e6ea908c830e70516d440828fd9129a8
Author: Roland McGrath <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:22 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:27 2008 +0100

[S390] single-step cleanup

Signed-off-by: Roland McGrath <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/ptrace.c |   15 ++-
 arch/s390/kernel/signal.c |   20 +---
 include/asm-s390/ptrace.h |8 
 3 files changed, 27 insertions(+), 16 deletions(-)

diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index 1d81bf9..6e036ba 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -86,13 +86,13 @@ FixPerRegisters(struct task_struct *task)
per_info->control_regs.bits.storage_alt_space_ctl = 0;
 }
 
-static void set_single_step(struct task_struct *task)
+void user_enable_single_step(struct task_struct *task)
 {
task->thread.per_info.single_step = 1;
FixPerRegisters(task);
 }
 
-static void clear_single_step(struct task_struct *task)
+void user_disable_single_step(struct task_struct *task)
 {
task->thread.per_info.single_step = 0;
FixPerRegisters(task);
@@ -107,7 +107,7 @@ void
 ptrace_disable(struct task_struct *child)
 {
/* make sure the single step bit is not set. */
-   clear_single_step(child);
+   user_disable_single_step(child);
 }
 
 #ifndef CONFIG_64BIT
@@ -651,7 +651,7 @@ do_ptrace(struct task_struct *child, long request, long 
addr, long data)
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data;
/* make sure the single step bit is not set. */
-   clear_single_step(child);
+   user_disable_single_step(child);
wake_up_process(child);
return 0;
 
@@ -665,7 +665,7 @@ do_ptrace(struct task_struct *child, long request, long 
addr, long data)
return 0;
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
-   clear_single_step(child);
+   user_disable_single_step(child);
wake_up_process(child);
return 0;
 
@@ -675,10 +675,7 @@ do_ptrace(struct task_struct *child, long request, long 
addr, long data)
return -EIO;
clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
child->exit_code = data;
-   if (data)
-   set_tsk_thread_flag(child, TIF_SINGLE_STEP);
-   else
-   set_single_step(child);
+   user_enable_single_step(child);
/* give it a chance to run. */
wake_up_process(child);
return 0;
diff --git a/arch/s390/kernel/signal.c b/arch/s390/kernel/signal.c
index d264671..4449bf3 100644
--- a/arch/s390/kernel/signal.c
+++ b/arch/s390/kernel/signal.c
@@ -471,6 +471,7 @@ void do_signal(struct pt_regs *regs)
 
if (signr > 0) {
/* Whee!  Actually deliver the signal.  */
+   int ret;
 #ifdef CONFIG_COMPAT
if (test_thread_flag(TIF_31BIT)) {
extern int handle_signal32(unsigned long sig,
@@ -478,15 +479,12 @@ void do_signal(struct pt_regs *regs)
   siginfo_t *info,
   sigset_t *oldset,
   struct pt_regs *regs);
-   if (handle_signal32(
-   signr, &ka, &info, oldset, regs) == 0) {
-   if (test_thread_flag(TIF_RESTORE_SIGMASK))
-   clear_thread_flag(TIF_RESTORE_SIGMASK);
-   }
-   return;
+   ret = handle_signal32(signr, &ka, &info, oldset, regs);
}
+   else
 #endif
-   if (handle_signal(signr, &ka, &info, oldset, regs) == 0) {
+   ret = handle_signal(signr, &ka, &info, oldset, regs);
+   if (!ret) {
/*
 * A signal was successfully delivered; the saved
 * sigmask will have been stored in the signal frame,
@@ -495,6 +493,14 @@ void do_signal(struct pt_regs *regs)
 */
if (test_thread_flag(TIF_RESTORE_SIGMASK))
clear_thread_flag(TIF_RESTORE_SIGMASK);
+
+   /*
+* If we would have taken a single-step trap
+

sl82c105: program DMA/PIO timings in ->dma_start/->ide_dma_end

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6ae8b1efcc83103f2e323c9486f56a8671ca1880
Commit: 6ae8b1efcc83103f2e323c9486f56a8671ca1880
Parent: 9b73e76f3cf63379dcf45fcd4f112f5812418d0a
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:12:58 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:12:58 2008 +0100

sl82c105: program DMA/PIO timings in ->dma_start/->ide_dma_end

* Program DMA timings in sl82c105_dma_start() (->dma_start method)
  before starting DMA transfer.

* Add sl82c105_dma_end() (->ide_dma_end method) to switch back to
  PIO timings when DMA transfer is complete.

* In sl82c105_set_pio_mode() program timings regardless of ->using_dma
  setting and in sl82c105_set_dma_mode() only cache the new timings.

* Remove no longer needed sl82c105_{ide_dma_on,off_quietly}().

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sl82c105.c |   55 
 1 files changed, 15 insertions(+), 40 deletions(-)

diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index 069f104..a854134 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -13,6 +13,7 @@
  *  -- Benjamin Herrenschmidt (01/11/03) [EMAIL PROTECTED]
  *
  * Copyright (C) 2006-2007 MontaVista Software, Inc. <[EMAIL PROTECTED]>
+ * Copyright (C)  2007 Bartlomiej Zolnierkiewicz
  */
 
 #include 
@@ -90,14 +91,8 @@ static void sl82c105_set_pio_mode(ide_drive_t *drive, const 
u8 pio)
drive->drive_data &= 0x;
drive->drive_data |= drv_ctrl;
 
-   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);
-   }
+   pci_write_config_word(dev, reg,  drv_ctrl);
+   pci_read_config_word (dev, reg, &drv_ctrl);
 
printk(KERN_DEBUG "%s: selected %s (%dns) (%04X)\n", drive->name,
  ide_xfer_verbose(pio + XFER_PIO_0),
@@ -123,17 +118,6 @@ static void sl82c105_set_dma_mode(ide_drive_t *drive, 
const u8 speed)
 */
drive->drive_data &= 0x;
drive->drive_data |= (unsigned long)drv_ctrl << 16;
-
-   /*
-* If we are already using DMA, we just reprogram
-* the drive control register.
-*/
-   if (drive->using_dma) {
-   struct pci_dev *dev = HWIF(drive)->pci_dev;
-   int reg = 0x44 + drive->dn * 4;
-
-   pci_write_config_word(dev, reg, drv_ctrl);
-   }
 }
 
 /*
@@ -201,6 +185,11 @@ static void sl82c105_dma_start(ide_drive_t *drive)
 {
ide_hwif_t *hwif= HWIF(drive);
struct pci_dev *dev = hwif->pci_dev;
+   int reg = 0x44 + drive->dn * 4;
+
+   DBG(("%s(drive:%s)\n", __FUNCTION__, drive->name));
+
+   pci_write_config_word(dev, reg, drive->drive_data >> 16);
 
sl82c105_reset_host(dev);
ide_dma_start(drive);
@@ -214,32 +203,19 @@ static void sl82c105_dma_timeout(ide_drive_t *drive)
ide_dma_timeout(drive);
 }
 
-static int sl82c105_ide_dma_on(ide_drive_t *drive)
-{
-   struct pci_dev *dev = HWIF(drive)->pci_dev;
-   int rc, reg = 0x44 + drive->dn * 4;
-
-   DBG(("sl82c105_ide_dma_on(drive:%s)\n", drive->name));
-
-   rc = __ide_dma_on(drive);
-   if (rc == 0) {
-   pci_write_config_word(dev, reg, drive->drive_data >> 16);
-
-   printk(KERN_INFO "%s: DMA enabled\n", drive->name);
-   }
-   return rc;
-}
-
-static void sl82c105_dma_off_quietly(ide_drive_t *drive)
+static int sl82c105_dma_end(ide_drive_t *drive)
 {
struct pci_dev *dev = HWIF(drive)->pci_dev;
int reg = 0x44 + drive->dn * 4;
+   int ret;
+
+   DBG(("%s(drive:%s)\n", __FUNCTION__, drive->name));
 
-   DBG(("sl82c105_dma_off_quietly(drive:%s)\n", drive->name));
+   ret = __ide_dma_end(drive);
 
pci_write_config_word(dev, reg, drive->drive_data);
 
-   ide_dma_off_quietly(drive);
+   return ret;
 }
 
 /*
@@ -369,10 +345,9 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
 
hwif->mwdma_mask = ATA_MWDMA2;
 
-   hwif->ide_dma_on= &sl82c105_ide_dma_on;
-   hwif->dma_off_quietly   = &sl82c105_dma_off_quietly;
hwif->dma_lost_irq  = &sl82c105_dma_lost_irq;
hwif->dma_start = &sl82c105_dma_start;
+   hwif->ide_dma_end   = &sl82c105_dma_end;
hwif->dma_timeout   = &sl82c105_dma_timeout;
 
i

sl82c105: remove no longer needed ->selectproc method

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=08590556d65b2611c5821bc532ca30db776e6044
Commit: 08590556d65b2611c5821bc532ca30db776e6044
Parent: 6ae8b1efcc83103f2e323c9486f56a8671ca1880
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:12:59 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:12:59 2008 +0100

sl82c105: remove no longer needed ->selectproc method

* Program register 0x40 in sl82c105_resetproc().

* Remove no longer needed sl82c105_selectproc() and pci_set_drvdata() calls.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sl82c105.c |   34 +++---
 1 files changed, 3 insertions(+), 31 deletions(-)

diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c
index a854134..c7a125b 100644
--- a/drivers/ide/pci/sl82c105.c
+++ b/drivers/ide/pci/sl82c105.c
@@ -219,35 +219,8 @@ static int sl82c105_dma_end(ide_drive_t *drive)
 }
 
 /*
- * Ok, that is nasty, but we must make sure the DMA timings
- * won't be used for a PIO access. The solution here is
- * to make sure the 16 bits mode is diabled on the channel
- * when DMA is enabled, thus causing the chip to use PIO0
- * timings for those operations.
- */
-static void sl82c105_selectproc(ide_drive_t *drive)
-{
-   ide_hwif_t *hwif= HWIF(drive);
-   struct pci_dev *dev = hwif->pci_dev;
-   u32 val, old, mask;
-
-   //DBG(("sl82c105_selectproc(drive:%s)\n", drive->name));
-
-   mask = hwif->channel ? CTRL_P1F16 : CTRL_P0F16;
-   old = val = (u32)pci_get_drvdata(dev);
-   if (drive->using_dma)
-   val &= ~mask;
-   else
-   val |= mask;
-   if (old != val) {
-   pci_write_config_dword(dev, 0x40, val); 
-   pci_set_drvdata(dev, (void *)val);
-   }
-}
-
-/*
  * ATA reset will clear the 16 bits mode in the control
- * register, we need to update our cache
+ * register, we need to reprogram it
  */
 static void sl82c105_resetproc(ide_drive_t *drive)
 {
@@ -257,7 +230,8 @@ static void sl82c105_resetproc(ide_drive_t *drive)
DBG(("sl82c105_resetproc(drive:%s)\n", drive->name));
 
pci_read_config_dword(dev, 0x40, &val);
-   pci_set_drvdata(dev, (void *)val);
+   val |= (CTRL_P1F16 | CTRL_P0F16);
+   pci_write_config_dword(dev, 0x40, val);
 }
 
 /*
@@ -310,7 +284,6 @@ static unsigned int __devinit init_chipset_sl82c105(struct 
pci_dev *dev, const c
pci_read_config_dword(dev, 0x40, &val);
val |= CTRL_P0EN | CTRL_P0F16 | CTRL_P1F16;
pci_write_config_dword(dev, 0x40, val);
-   pci_set_drvdata(dev, (void *)val);
 
return dev->irq;
 }
@@ -326,7 +299,6 @@ static void __devinit init_hwif_sl82c105(ide_hwif_t *hwif)
 
hwif->set_pio_mode  = &sl82c105_set_pio_mode;
hwif->set_dma_mode  = &sl82c105_set_dma_mode;
-   hwif->selectproc= &sl82c105_selectproc;
hwif->resetproc = &sl82c105_resetproc;
 
if (!hwif->dma_base)
-
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


serverworks: cleanup ->set_dma_mode method

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7b971df185807ceb358471e16ce8754ccfcc7de9
Commit: 7b971df185807ceb358471e16ce8754ccfcc7de9
Parent: 08590556d65b2611c5821bc532ca30db776e6044
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:12:59 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:12:59 2008 +0100

serverworks: cleanup ->set_dma_mode method

IDE core guarantees that ->set_dma_mode will be called only
for DMA modes set in SWDMA/MWDMA/UDMA masks.

There should be no functionality changes caused by this patch.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/serverworks.c |   25 ++---
 1 files changed, 6 insertions(+), 19 deletions(-)

diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c
index e9bd269..877c09b 100644
--- a/drivers/ide/pci/serverworks.c
+++ b/drivers/ide/pci/serverworks.c
@@ -164,25 +164,12 @@ static void svwks_set_dma_mode(ide_drive_t *drive, const 
u8 speed)
ultra_timing&= ~(0x0F << (4*unit));
ultra_enable&= ~(0x01 << drive->dn);
 
-   switch(speed) {
-   case XFER_MW_DMA_2:
-   case XFER_MW_DMA_1:
-   case XFER_MW_DMA_0:
-   dma_timing |= dma_modes[speed - XFER_MW_DMA_0];
-   break;
-
-   case XFER_UDMA_5:
-   case XFER_UDMA_4:
-   case XFER_UDMA_3:
-   case XFER_UDMA_2:
-   case XFER_UDMA_1:
-   case XFER_UDMA_0:
-   dma_timing   |= dma_modes[2];
-   ultra_timing |= ((udma_modes[speed - XFER_UDMA_0]) << 
(4*unit));
-   ultra_enable |= (0x01 << drive->dn);
-   default:
-   break;
-   }
+   if (speed >= XFER_UDMA_0) {
+   dma_timing   |= dma_modes[2];
+   ultra_timing |= (udma_modes[speed - XFER_UDMA_0] << (4 * unit));
+   ultra_enable |= (0x01 << drive->dn);
+   } else if (speed >= XFER_MW_DMA_0)
+   dma_timing   |= dma_modes[speed - XFER_MW_DMA_0];
 
pci_write_config_byte(dev, drive_pci2[drive->dn], dma_timing);
pci_write_config_byte(dev, (0x56|hwif->channel), ultra_timing);
-
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-disk: add idedisk_set_doorlock() helper

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=29ec683f019608ca0cb6cf69011426ecb5daa69e
Commit: 29ec683f019608ca0cb6cf69011426ecb5daa69e
Parent: 7b971df185807ceb358471e16ce8754ccfcc7de9
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:12:59 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:12:59 2008 +0100

ide-disk: add idedisk_set_doorlock() helper

There should be no functionality changes caused by this patch.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-disk.c |   23 +--
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index d8fdd86..364dc57 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -975,6 +975,17 @@ static ide_driver_t idedisk_driver = {
 #endif
 };
 
+static int idedisk_set_doorlock(ide_drive_t *drive, int on)
+{
+   ide_task_t task;
+
+   memset(&task, 0, sizeof(task));
+   task.tf.command = on ? WIN_DOORLOCK : WIN_DOORUNLOCK;
+   task.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+
+   return ide_no_data_taskfile(drive, &task);
+}
+
 static int idedisk_open(struct inode *inode, struct file *filp)
 {
struct gendisk *disk = inode->i_bdev->bd_disk;
@@ -989,17 +1000,13 @@ static int idedisk_open(struct inode *inode, struct file 
*filp)
idkp->openers++;
 
if (drive->removable && idkp->openers == 1) {
-   ide_task_t args;
-   memset(&args, 0, sizeof(ide_task_t));
-   args.tf.command = WIN_DOORLOCK;
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
check_disk_change(inode->i_bdev);
/*
 * Ignore the return code from door_lock,
 * since the open() has already succeeded,
 * and the door_lock is irrelevant at this point.
 */
-   if (drive->doorlocking && ide_no_data_taskfile(drive, &args))
+   if (drive->doorlocking && idedisk_set_doorlock(drive, 1))
drive->doorlocking = 0;
}
return 0;
@@ -1015,11 +1022,7 @@ static int idedisk_release(struct inode *inode, struct 
file *filp)
ide_cacheflush_p(drive);
 
if (drive->removable && idkp->openers == 1) {
-   ide_task_t args;
-   memset(&args, 0, sizeof(ide_task_t));
-   args.tf.command = WIN_DOORUNLOCK;
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
-   if (drive->doorlocking && ide_no_data_taskfile(drive, &args))
+   if (drive->doorlocking && idedisk_set_doorlock(drive, 0))
drive->doorlocking = 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: (hopefully) fix VDMA for CS5520

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aea5d375600f132537adf45942c0fbdcd25eb995
Commit: aea5d375600f132537adf45942c0fbdcd25eb995
Parent: 29ec683f019608ca0cb6cf69011426ecb5daa69e
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:12:59 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:12:59 2008 +0100

ide: (hopefully) fix VDMA for CS5520

* Set the correct hwif->dma_base for the second channel in
  ide_get_or_set_dma_base().

* Remove DMA enable code from cs5520_set_pio_mode(), this can
  be handled by the generic ->dma_host_on method now.

* Add VDMA check to ide_config_drive_speed().

* drive->using_dma was never enabled since cs5520 host driver's
  ->ide_dma_on method overrided the generic ->ide_dma_on (so
  __ide_dma_on() was never called, drive->using_dma was never set
  and VDMA was never used since it depends on drive->using_dma).

  Fix it by using ->dma_host_on method instead of ->ide_dma_on
  (also add matching ->dma_host_off method).

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-iops.c   |2 +-
 drivers/ide/pci/cs5520.c |   29 +
 drivers/ide/setup-pci.c  |   10 +++---
 3 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index c97c071..e3e5e39 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -799,7 +799,7 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
 
  skip:
 #ifdef CONFIG_BLK_DEV_IDEDMA
-   if (speed >= XFER_SW_DMA_0)
+   if (speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA))
hwif->dma_host_on(drive);
else if (hwif->ide_dma_on)  /* check if host supports DMA */
hwif->dma_off_quietly(drive);
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index d1a91bc..78058ca 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -71,7 +71,6 @@ static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 
pio)
ide_hwif_t *hwif = HWIF(drive);
struct pci_dev *pdev = hwif->pci_dev;
int controller = drive->dn > 1 ? 1 : 0;
-   u8 reg;
 
/* FIXME: if DMA = 1 do we need to set the DMA bit here ? */
 
@@ -91,11 +90,6 @@ static void cs5520_set_pio_mode(ide_drive_t *drive, const u8 
pio)
pci_write_config_byte(pdev, 0x66 + 4*controller + (drive->dn&1),
(cs5520_pio_clocks[pio].recovery << 4) |
(cs5520_pio_clocks[pio].assert));
-   
-   /* Set the DMA enable/disable flag */
-   reg = inb(hwif->dma_base + 0x02 + 8*controller);
-   reg |= 1<<((drive->dn&1)+5);
-   outb(reg, hwif->dma_base + 0x02 + 8*controller);
 }
 
 static void cs5520_set_dma_mode(ide_drive_t *drive, const u8 speed)
@@ -109,13 +103,23 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const 
u8 speed)
  * We wrap the DMA activate to set the vdma flag. This is needed
  * so that the IDE DMA layer issues PIO not DMA commands over the
  * DMA channel
+ *
+ * ATAPI is harder so disable it for now using IDE_HFLAG_NO_ATAPI_DMA
  */
- 
-static int cs5520_dma_on(ide_drive_t *drive)
+
+static void cs5520_dma_host_on(ide_drive_t *drive)
 {
-   /* ATAPI is harder so leave it for now */
-   drive->vdma = 1;
-   return 0;
+   if (drive->using_dma)
+   drive->vdma = 1;
+
+   ide_dma_host_on(drive);
+}
+
+static void cs5520_dma_host_off(ide_drive_t *drive)
+{
+   drive->vdma = 0;
+
+   ide_dma_host_off(drive);
 }
 
 static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
@@ -126,7 +130,8 @@ static void __devinit init_hwif_cs5520(ide_hwif_t *hwif)
if (hwif->dma_base == 0)
return;
 
-   hwif->ide_dma_on = &cs5520_dma_on;
+   hwif->dma_host_on  = &cs5520_dma_host_on;
+   hwif->dma_host_off = &cs5520_dma_host_off;
 }
 
 #define DECLARE_CS_DEV(name_str)   \
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index d2cd5a3..bbfdf7e 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -165,13 +165,17 @@ static unsigned long ide_get_or_set_dma_base(const struct 
ide_port_info *d, ide_
 
dma_base = pci_resource_start(dev, baridx);
 
-   if (dma_base == 0)
+   if (dma_base == 0) {
printk(KERN_ERR "%s: DMA base is invalid\n", d->name);
+   return 0;
+   }
}
 
-   if ((d->host_flags & IDE_HFLAG_CS5520) == 0 && dma_base) {
+   if (hwif->channel)
+   dma_base += 8;
+
+   if ((d->host_flags & IDE_HFLAG_CS5520) == 0) {
u8 simplex_stat = 0;
-   dma_base += hwif-

cy82c693: correct DMA modes clipping

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a530201afed5074dac69b29c519a1df59da97945
Commit: a530201afed5074dac69b29c519a1df59da97945
Parent: aea5d375600f132537adf45942c0fbdcd25eb995
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:00 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:00 2008 +0100

cy82c693: correct DMA modes clipping

* Mask device DMA masks by ATA_{S,M}WDMA2 in cy82c693_ide_dma_on().

* Remove clipping of DMA modes by id->tDMA in cy82c693_dma_enable():
  - id->tDMA may not be defined on newer devices
  - id->vendor6/id->tDMA word is in LE endianness
(cy82c693 seems to be Alpha specific though)

* Bump driver version.

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

diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index 1cd4e9c..e7466f2 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cy82c693.cVersion 0.42Oct 23, 2007
+ * linux/drivers/ide/pci/cy82c693.cVersion 0.43Nov 7, 2007
  *
  *  Copyright (C) 1998-2000 Andreas S. Krebs ([EMAIL PROTECTED]), Maintainer
  *  Copyright (C) 1998-2002 Andre Hedrick <[EMAIL PROTECTED]>, Integrator
@@ -182,10 +182,7 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int 
mode, int single)
 
if (mode>2) /* make sure we set a valid mode */
mode = 2;
-  
-   if (mode > drive->id->tDMA)  /* to be absolutly sure we have a valid 
mode */
-   mode = drive->id->tDMA;
-   
+
index = (HWIF(drive)->channel==0) ? CY82_INDEX_CHANNEL0 : 
CY82_INDEX_CHANNEL1;
 
 #if CY82C693_DEBUG_LOGS
@@ -250,7 +247,10 @@ static int cy82c693_ide_dma_on (ide_drive_t *drive)
 
mmode = id->dma_mword & (id->dma_mword >> 8);
smode = id->dma_1word & (id->dma_1word >> 8);
- 
+
+   mmode &= ATA_MWDMA2;
+   smode &= ATA_SWDMA2;
+
if (mmode != 0) {
/* enable multi */
cy82c693_dma_enable(drive, (mmode >> 1), 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


cy82c693: add ->set_dma_mode method

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8704de8f296fcf6a4b2ff6bfd9a63974ad909b3e
Commit: 8704de8f296fcf6a4b2ff6bfd9a63974ad909b3e
Parent: a530201afed5074dac69b29c519a1df59da97945
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:00 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:00 2008 +0100

cy82c693: add ->set_dma_mode method

* Fix SWDMA/MWDMA masks in cy82c693_chipset.

* Add IDE_HFLAG_CY82C693 host flag and use it in ide_tune_dma() to
  check whether the DMA should be enabled even if ide_max_dma_mode()
  fails.

* Convert cy82c693_dma_enable() to become cy82c693_set_dma_mode()
  and remove no longer needed cy82c693_ide_dma_on().  Then set
  IDE_HFLAG_CY82C693 instead of IDE_HFLAG_TRUST_BIOS_FOR_DMA in
  cy82c693_chipset.

* Bump driver version.

As a result of this patch cy82c693 driver will configure and use DMA on
all SWDMA0-2 and MWDMA0-2 capable ATA devices instead of relying on BIOS.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c  |   15 +++---
 drivers/ide/pci/cy82c693.c |   64 +++
 include/linux/ide.h|2 +
 3 files changed, 24 insertions(+), 57 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 18c78ad..9d6dabb 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -755,6 +755,7 @@ EXPORT_SYMBOL_GPL(ide_find_dma_mode);
 
 static int ide_tune_dma(ide_drive_t *drive)
 {
+   ide_hwif_t *hwif = drive->hwif;
u8 speed;
 
if (noautodma || drive->nodma || (drive->id->capability & 1) == 0)
@@ -767,15 +768,21 @@ static int ide_tune_dma(ide_drive_t *drive)
if (ide_id_dma_bug(drive))
return 0;
 
-   if (drive->hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
+   if (hwif->host_flags & IDE_HFLAG_TRUST_BIOS_FOR_DMA)
return config_drive_for_dma(drive);
 
speed = ide_max_dma_mode(drive);
 
-   if (!speed)
-   return 0;
+   if (!speed) {
+/* is this really correct/needed? */
+   if ((hwif->host_flags & IDE_HFLAG_CY82C693) &&
+   ide_dma_good_drive(drive))
+   return 1;
+   else
+   return 0;
+   }
 
-   if (drive->hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
+   if (hwif->host_flags & IDE_HFLAG_NO_SET_MODE)
return 0;
 
if (ide_set_dma_mode(drive, speed))
diff --git a/drivers/ide/pci/cy82c693.c b/drivers/ide/pci/cy82c693.c
index e7466f2..3ec4c65 100644
--- a/drivers/ide/pci/cy82c693.c
+++ b/drivers/ide/pci/cy82c693.c
@@ -1,5 +1,5 @@
 /*
- * linux/drivers/ide/pci/cy82c693.cVersion 0.43Nov 7, 2007
+ * linux/drivers/ide/pci/cy82c693.cVersion 0.44Nov 8, 2007
  *
  *  Copyright (C) 1998-2000 Andreas S. Krebs ([EMAIL PROTECTED]), Maintainer
  *  Copyright (C) 1998-2002 Andre Hedrick <[EMAIL PROTECTED]>, Integrator
@@ -176,14 +176,12 @@ static void compute_clocks (u8 pio, pio_clocks_t *p_pclk)
  * set DMA mode a specific channel for CY82C693
  */
 
-static void cy82c693_dma_enable (ide_drive_t *drive, int mode, int single)
+static void cy82c693_set_dma_mode(ide_drive_t *drive, const u8 mode)
 {
-   u8 index = 0, data = 0;
+   ide_hwif_t *hwif = drive->hwif;
+   u8 single = (mode & 0x10) >> 4, index = 0, data = 0;
 
-   if (mode>2) /* make sure we set a valid mode */
-   mode = 2;
-
-   index = (HWIF(drive)->channel==0) ? CY82_INDEX_CHANNEL0 : 
CY82_INDEX_CHANNEL1;
+   index = hwif->channel ? CY82_INDEX_CHANNEL1 : CY82_INDEX_CHANNEL0;
 
 #if CY82C693_DEBUG_LOGS
/* for debug let's show the previous values */
@@ -196,7 +194,7 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int 
mode, int single)
(data&0x3), ((data>>2)&1));
 #endif /* CY82C693_DEBUG_LOGS */
 
-   data = (u8)mode|(u8)(single<<2);
+   data = (mode & 3) | (single << 2);
 
outb(index, CY82_INDEX_PORT);
outb(data, CY82_DATA_PORT);
@@ -204,7 +202,7 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int 
mode, int single)
 #if CY82C693_DEBUG_INFO
printk(KERN_INFO "%s (ch=%d, dev=%d): set DMA mode to %d (single=%d)\n",
drive->name, HWIF(drive)->channel, drive->select.b.unit,
-   mode, single);
+   mode & 3, single);
 #endif /* CY82C693_DEBUG_INFO */
 
/* 
@@ -227,42 +225,6 @@ static void cy82c693_dma_enable (ide_drive_t *drive, int 
mode, int single)
 #endif /* CY82C693_DEBUG_INFO */
 }
 
-/* 
- * used to set DMA mode for CY82C693 (single and multi modes)
- */
-static int cy82c693_ide_dma_on (ide_drive_t *drive)
-{
-   struct hd_driveid *id = drive->id;
-
-#if CY82C693_DEBUG_INFO
-   printk (

sgiioc4: add ide_toggle_bounce() calls

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e5efba33289574a08674f7613eb0513bcb44d085
Commit: e5efba33289574a08674f7613eb0513bcb44d085
Parent: 8704de8f296fcf6a4b2ff6bfd9a63974ad909b3e
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:00 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:00 2008 +0100

sgiioc4: add ide_toggle_bounce() calls

Add ide_toggle_bounce() call to ->ide_dma_on/->dma_off_quietly
methods so they match generic __ide_dma_on()/ide_dma_off_quietly().

Tested on Altix by Jeremy.

Acked-by: Jeremy Higdon <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sgiioc4.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 7e9dade..fea56d3 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -281,6 +281,7 @@ static int
 sgiioc4_ide_dma_on(ide_drive_t * drive)
 {
drive->using_dma = 1;
+   ide_toggle_bounce(drive, 1);
 
return 0;
 }
@@ -288,6 +289,7 @@ sgiioc4_ide_dma_on(ide_drive_t * drive)
 static void sgiioc4_dma_off_quietly(ide_drive_t *drive)
 {
drive->using_dma = 0;
+   ide_toggle_bounce(drive, 0);
 
drive->hwif->dma_host_off(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


icside: add ide_toggle_bounce() calls

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c58096941284ceaea504b2f8c4d146f0f7c86b49
Commit: c58096941284ceaea504b2f8c4d146f0f7c86b49
Parent: e5efba33289574a08674f7613eb0513bcb44d085
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:00 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:00 2008 +0100

icside: add ide_toggle_bounce() calls

Add ide_toggle_bounce() call to ->ide_dma_on/->dma_off_quietly
methods so they match generic __ide_dma_on()/ide_dma_off_quietly().

Since there is no PCI device there should be no functionality
changes caused by this patch.

Cc: Russell King <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/icside.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 673402f..d70442a 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -294,6 +294,7 @@ static void icside_dma_host_off(ide_drive_t *drive)
 static void icside_dma_off_quietly(ide_drive_t *drive)
 {
drive->using_dma = 0;
+   ide_toggle_bounce(drive, 0);
 }
 
 static void icside_dma_host_on(ide_drive_t *drive)
@@ -303,6 +304,7 @@ static void icside_dma_host_on(ide_drive_t *drive)
 static int icside_dma_on(ide_drive_t *drive)
 {
drive->using_dma = 1;
+   ide_toggle_bounce(drive, 1);
 
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


au1xxx-ide: add ide_toggle_bounce() calls

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=378f577f7f75aa18a0eeafb044a491dcd5aeaa3d
Commit: 378f577f7f75aa18a0eeafb044a491dcd5aeaa3d
Parent: c58096941284ceaea504b2f8c4d146f0f7c86b49
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:01 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:01 2008 +0100

au1xxx-ide: add ide_toggle_bounce() calls

Add ide_toggle_bounce() call to ->ide_dma_on/->dma_off_quietly
methods so they match generic __ide_dma_on()/ide_dma_off_quietly().

Since there is no PCI device there should be no functionality
changes caused by this patch.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/mips/au1xxx-ide.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index a4d0d4c..4fc0328 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -402,6 +402,7 @@ static void auide_dma_host_on(ide_drive_t *drive)
 static int auide_dma_on(ide_drive_t *drive)
 {
drive->using_dma = 1;
+   ide_toggle_bounce(drive, 1);
 
return 0;
 }
@@ -413,6 +414,7 @@ static void auide_dma_host_off(ide_drive_t *drive)
 static void auide_dma_off_quietly(ide_drive_t *drive)
 {
drive->using_dma = 0;
+   ide_toggle_bounce(drive, 0);
 }
 
 static void auide_dma_lost_irq(ide_drive_t *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


ide: remove ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a546e046d562bcd389149591fa5a534c8f832ca
Commit: 4a546e046d562bcd389149591fa5a534c8f832ca
Parent: 378f577f7f75aa18a0eeafb044a491dcd5aeaa3d
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:01 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:01 2008 +0100

ide: remove ->ide_dma_on and ->dma_off_quietly methods from ide_hwif_t

* Make ide_dma_off_quietly() and __ide_dma_on() always available.

* Drop "__" prefix from __ide_dma_on().

* Check for presence of ->dma_host_on instead of ->ide_dma_on.

* Convert all users of ->ide_dma_on and ->dma_off_quietly methods
  to use ide_dma_on() and ide_dma_off_quietly() instead.

* Remove no longer needed ->ide_dma_on and ->dma_off_quietly methods
  from ide_hwif_t.

* Make ide_dma_on() void.

There should be no functionality changes caused by this patch.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/icside.c  |   16 
 drivers/ide/ide-dma.c |   27 ---
 drivers/ide/ide-io.c  |8 
 drivers/ide/ide-iops.c|   10 +-
 drivers/ide/ide-probe.c   |2 +-
 drivers/ide/ide.c |4 +---
 drivers/ide/mips/au1xxx-ide.c |   16 
 drivers/ide/pci/sc1200.c  |2 +-
 drivers/ide/pci/sgiioc4.c |   19 ---
 drivers/ide/ppc/pmac.c|2 --
 include/linux/ide.h   |8 
 11 files changed, 28 insertions(+), 86 deletions(-)

diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index d70442a..3a8402b 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -291,24 +291,10 @@ static void icside_dma_host_off(ide_drive_t *drive)
 {
 }
 
-static void icside_dma_off_quietly(ide_drive_t *drive)
-{
-   drive->using_dma = 0;
-   ide_toggle_bounce(drive, 0);
-}
-
 static void icside_dma_host_on(ide_drive_t *drive)
 {
 }
 
-static int icside_dma_on(ide_drive_t *drive)
-{
-   drive->using_dma = 1;
-   ide_toggle_bounce(drive, 1);
-
-   return 0;
-}
-
 static int icside_dma_end(ide_drive_t *drive)
 {
ide_hwif_t *hwif = HWIF(drive);
@@ -425,9 +411,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
hwif->set_dma_mode  = icside_set_dma_mode;
 
hwif->dma_host_off  = icside_dma_host_off;
-   hwif->dma_off_quietly   = icside_dma_off_quietly;
hwif->dma_host_on   = icside_dma_host_on;
-   hwif->ide_dma_on= icside_dma_on;
hwif->dma_setup = icside_dma_setup;
hwif->dma_exec_cmd  = icside_dma_exec_cmd;
hwif->dma_start = icside_dma_start;
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 9d6dabb..edd0018 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -425,6 +425,7 @@ void ide_dma_host_off(ide_drive_t *drive)
 }
 
 EXPORT_SYMBOL(ide_dma_host_off);
+#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 /**
  * ide_dma_off_quietly -   Generic DMA kill
@@ -442,7 +443,6 @@ void ide_dma_off_quietly(ide_drive_t *drive)
 }
 
 EXPORT_SYMBOL(ide_dma_off_quietly);
-#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
 
 /**
  * ide_dma_off -   disable DMA on a device
@@ -455,7 +455,7 @@ EXPORT_SYMBOL(ide_dma_off_quietly);
 void ide_dma_off(ide_drive_t *drive)
 {
printk(KERN_INFO "%s: DMA disabled\n", drive->name);
-   drive->hwif->dma_off_quietly(drive);
+   ide_dma_off_quietly(drive);
 }
 
 EXPORT_SYMBOL(ide_dma_off);
@@ -481,26 +481,26 @@ void ide_dma_host_on(ide_drive_t *drive)
 }
 
 EXPORT_SYMBOL(ide_dma_host_on);
+#endif
 
 /**
- * __ide_dma_on-   Enable DMA on a device
+ * ide_dma_on  -   Enable DMA on a device
  * @drive: drive to enable DMA on
  *
  * Enable IDE DMA for a device on this IDE controller.
  */
- 
-int __ide_dma_on (ide_drive_t *drive)
+
+void ide_dma_on(ide_drive_t *drive)
 {
drive->using_dma = 1;
ide_toggle_bounce(drive, 1);
 
drive->hwif->dma_host_on(drive);
-
-   return 0;
 }
 
-EXPORT_SYMBOL(__ide_dma_on);
+EXPORT_SYMBOL(ide_dma_on);
 
+#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 /**
  * ide_dma_setup   -   begin a DMA phase
  * @drive: target device
@@ -827,7 +827,6 @@ err_out:
 
 int ide_set_dma(ide_drive_t *drive)
 {
-   ide_hwif_t *hwif = drive->hwif;
int rc;
 
/*
@@ -836,13 +835,15 @@ int ide_set_dma(ide_drive_t *drive)
 * things, if not checked and cleared.
 *   PARANOIA!!!
 */
-   hwif->dma_off_quietly(drive);
+   ide_dma_off_quietly(drive);
 
rc = ide_dma_check(drive);
if (rc)
return rc;
 
-   return hwif->ide_dma_on(drive);
+ 

ide-cris: fix DMA methods

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=07a085ebd35ba0d4e2d88b9044563661dbca2471
Commit: 07a085ebd35ba0d4e2d88b9044563661dbca2471
Parent: 4a546e046d562bcd389149591fa5a534c8f832ca
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:01 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:01 2008 +0100

ide-cris: fix DMA methods

* Rename cris_dma_{on,off}() to cris_dma_host_{on,off}().

* Remove no longer needed ->dma_off_quietly
  (IDE core has the needed code now).

* Make cris_dma_host_on() void.

I left fixing ide-cris after "kill dma_on/dma_off_quietly() methods"
patch because:

* Currently this driver is broken: cris_dma_on() (returns 'int')
  is assigned to hwif->dma_host_on (returns 'void') so the driver
  won't build.

* ->ide_dma_on method was missing so the driver OOPS-es on attempt
  to enable DMA.

* drive->using_dma was never set/cleared so DMA wouldn't be used anyway.

Unfortunately it seems that ide-cris stays broken even after this patch:

* V10:  needs fixing
  - ide_init_default_hwifs() should be removed
(IDE core no longer uses it)
  - same for ide_init_hwif_ports() and ide_default_{irq,io_base}()
(they shouldn't be needed for ide-cris host driver)

* V32: I'm unable to find a place which defines ETRAX_ARCH_V32

but I'm leaving fixing this to CRIS gurus. :)

Cc: Mikael Starvik <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/cris/ide-cris.c |   18 +++---
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index 325e608..b0cd032 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -673,9 +673,12 @@ static void cris_ide_input_data (ide_drive_t *drive, void 
*, unsigned int);
 static void cris_ide_output_data (ide_drive_t *drive, void *, unsigned int);
 static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int);
 static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int);
-static int cris_dma_on (ide_drive_t *drive);
 
-static void cris_dma_off(ide_drive_t *drive)
+static void cris_dma_host_off(ide_drive_t *drive)
+{
+}
+
+static void cris_dma_host_on(ide_drive_t *drive)
 {
 }
 
@@ -799,9 +802,8 @@ init_e100_ide (void)
hwif->OUTBSYNC = &cris_ide_outbsync;
hwif->INB = &cris_ide_inb;
hwif->INW = &cris_ide_inw;
-   hwif->dma_host_off = &cris_dma_off;
-   hwif->dma_host_on = &cris_dma_on;
-   hwif->dma_off_quietly = &cris_dma_off;
+   hwif->dma_host_off = &cris_dma_host_off;
+   hwif->dma_host_on = &cris_dma_host_on;
hwif->cbl = ATA_CBL_PATA40;
hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
hwif->pio_mask = ATA_PIO4,
@@ -823,12 +825,6 @@ init_e100_ide (void)
cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0);
 }
 
-static int cris_dma_on (ide_drive_t *drive)
-{
-   return 0;
-}
-
-
 static cris_dma_descr_type mydescr __attribute__ ((__aligned__(16)));
 
 /*
-
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


atiixp: remove ->dma_host_on and ->dma_host_off methods

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ae60e34dd737ed3bef64b08130478393d9c4e8a
Commit: 8ae60e34dd737ed3bef64b08130478393d9c4e8a
Parent: 07a085ebd35ba0d4e2d88b9044563661dbca2471
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:02 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:02 2008 +0100

atiixp: remove ->dma_host_on and ->dma_host_off methods

* Enable/disable UDMA in atiixp_set_dma_mode().

* Remove no longer needed atiixp_dma_host_{on,off}() and save_mdma_mode[].

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/atiixp.c |   71 +++--
 1 files changed, 18 insertions(+), 53 deletions(-)

diff --git a/drivers/ide/pci/atiixp.c b/drivers/ide/pci/atiixp.c
index 5ae2656..4918719 100644
--- a/drivers/ide/pci/atiixp.c
+++ b/drivers/ide/pci/atiixp.c
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/ide/pci/atiixp.c Version 0.03Aug 3 2007
+ *  linux/drivers/ide/pci/atiixp.c Version 0.05Nov 9 2007
  *
  *  Copyright (C) 2003 ATI Inc. <[EMAIL PROTECTED]>
  *  Copyright (C) 2004,2007 Bartlomiej Zolnierkiewicz
@@ -43,47 +43,8 @@ static atiixp_ide_timing mdma_timing[] = {
{ 0x02, 0x00 },
 };
 
-static int save_mdma_mode[4];
-
 static DEFINE_SPINLOCK(atiixp_lock);
 
-static void atiixp_dma_host_on(ide_drive_t *drive)
-{
-   struct pci_dev *dev = drive->hwif->pci_dev;
-   unsigned long flags;
-   u16 tmp16;
-
-   spin_lock_irqsave(&atiixp_lock, flags);
-
-   pci_read_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, &tmp16);
-   if (save_mdma_mode[drive->dn])
-   tmp16 &= ~(1 << drive->dn);
-   else
-   tmp16 |= (1 << drive->dn);
-   pci_write_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, tmp16);
-
-   spin_unlock_irqrestore(&atiixp_lock, flags);
-
-   ide_dma_host_on(drive);
-}
-
-static void atiixp_dma_host_off(ide_drive_t *drive)
-{
-   struct pci_dev *dev = drive->hwif->pci_dev;
-   unsigned long flags;
-   u16 tmp16;
-
-   spin_lock_irqsave(&atiixp_lock, flags);
-
-   pci_read_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, &tmp16);
-   tmp16 &= ~(1 << drive->dn);
-   pci_write_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, tmp16);
-
-   spin_unlock_irqrestore(&atiixp_lock, flags);
-
-   ide_dma_host_off(drive);
-}
-
 /**
  * atiixp_set_pio_mode -   set host controller for PIO mode
  * @drive: drive
@@ -132,26 +93,33 @@ static void atiixp_set_dma_mode(ide_drive_t *drive, const 
u8 speed)
int timing_shift = (drive->dn & 2) ? 16 : 0 + (drive->dn & 1) ? 0 : 8;
u32 tmp32;
u16 tmp16;
+   u16 udma_ctl = 0;
 
spin_lock_irqsave(&atiixp_lock, flags);
 
-   save_mdma_mode[drive->dn] = 0;
+   pci_read_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, &udma_ctl);
+
if (speed >= XFER_UDMA_0) {
pci_read_config_word(dev, ATIIXP_IDE_UDMA_MODE, &tmp16);
tmp16 &= ~(0x07 << (drive->dn * 4));
tmp16 |= ((speed & 0x07) << (drive->dn * 4));
pci_write_config_word(dev, ATIIXP_IDE_UDMA_MODE, tmp16);
-   } else {
-   if ((speed >= XFER_MW_DMA_0) && (speed <= XFER_MW_DMA_2)) {
-   save_mdma_mode[drive->dn] = speed;
-   pci_read_config_dword(dev, ATIIXP_IDE_MDMA_TIMING, 
&tmp32);
-   tmp32 &= ~(0xff << timing_shift);
-   tmp32 |= (mdma_timing[speed & 0x03].recover_width << 
timing_shift) |
-   (mdma_timing[speed & 0x03].command_width << 
(timing_shift + 4));
-   pci_write_config_dword(dev, ATIIXP_IDE_MDMA_TIMING, 
tmp32);
-   }
+
+   udma_ctl |= (1 << drive->dn);
+   } else if (speed >= XFER_MW_DMA_0) {
+   u8 i = speed & 0x03;
+
+   pci_read_config_dword(dev, ATIIXP_IDE_MDMA_TIMING, &tmp32);
+   tmp32 &= ~(0xff << timing_shift);
+   tmp32 |= (mdma_timing[i].recover_width << timing_shift) |
+(mdma_timing[i].command_width << (timing_shift + 4));
+   pci_write_config_dword(dev, ATIIXP_IDE_MDMA_TIMING, tmp32);
+
+   udma_ctl &= ~(1 << drive->dn);
}
 
+   pci_write_config_word(dev, ATIIXP_IDE_UDMA_CONTROL, udma_ctl);
+
spin_unlock_irqrestore(&atiixp_lock, flags);
 }
 
@@ -181,9 +149,6 @@ static void __devinit init_hwif_atiixp(ide_hwif_t *hwif)
hwif->cbl = ATA_CBL_PATA80;
else
hwif->cbl = ATA_CBL_PATA40;
-
-   hwif->dma_host_on = &atiixp_dma_host_on;
-   hwif->dma_host_off = &atiixp_dma_host_off;
 }
 
 static const struct ide_port_info atiixp_pci_info[] __devinitdata = {
-
To unsubscribe from this list: send the line "unsubscribe

ide: move drive->using_dma check to callers of ->dma_host_on method

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f37aaf9edeba3f4ae10d22aefc09c06af9ea39b6
Commit: f37aaf9edeba3f4ae10d22aefc09c06af9ea39b6
Parent: 8ae60e34dd737ed3bef64b08130478393d9c4e8a
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:02 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:02 2008 +0100

ide: move drive->using_dma check to callers of ->dma_host_on method

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c|2 +-
 drivers/ide/ide-iops.c   |3 ++-
 drivers/ide/pci/cs5520.c |3 +--
 drivers/ide/pci/sc1200.c |2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index edd0018..780911e 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -471,7 +471,7 @@ EXPORT_SYMBOL(ide_dma_off);
 
 void ide_dma_host_on(ide_drive_t *drive)
 {
-   if (drive->using_dma) {
+   if (1) {
ide_hwif_t *hwif= HWIF(drive);
u8 unit = (drive->select.b.unit & 0x01);
u8 dma_stat = hwif->INB(hwif->dma_status);
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 76cb5f2..e30f67e 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -799,7 +799,8 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
 
  skip:
 #ifdef CONFIG_BLK_DEV_IDEDMA
-   if (speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA))
+   if ((speed >= XFER_SW_DMA_0 || (hwif->host_flags & IDE_HFLAG_VDMA)) &&
+   drive->using_dma)
hwif->dma_host_on(drive);
else if (hwif->dma_host_on) /* check if host supports DMA */
ide_dma_off_quietly(drive);
diff --git a/drivers/ide/pci/cs5520.c b/drivers/ide/pci/cs5520.c
index 78058ca..2bd52af 100644
--- a/drivers/ide/pci/cs5520.c
+++ b/drivers/ide/pci/cs5520.c
@@ -109,8 +109,7 @@ static void cs5520_set_dma_mode(ide_drive_t *drive, const 
u8 speed)
 
 static void cs5520_dma_host_on(ide_drive_t *drive)
 {
-   if (drive->using_dma)
-   drive->vdma = 1;
+   drive->vdma = 1;
 
ide_dma_host_on(drive);
 }
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 8a94c3e..9303dfe 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -221,7 +221,7 @@ static void sc1200_set_pio_mode(ide_drive_t *drive, const 
u8 pio)
if (mode != -1) {
printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
ide_dma_off_quietly(drive);
-   if (ide_set_dma_mode(drive, mode) == 0)
+   if (ide_set_dma_mode(drive, mode) == 0 && drive->using_dma)
hwif->dma_host_on(drive);
return;
}
-
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: merge ->dma_host_{on,off} methods into ->dma_host_set method

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15ce926ada545cb078711bd9a18c083c93fa01d7
Commit: 15ce926ada545cb078711bd9a18c083c93fa01d7
Parent: f37aaf9edeba3f4ae10d22aefc09c06af9ea39b6
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:03 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:03 2008 +0100

ide: merge ->dma_host_{on,off} methods into ->dma_host_set method

Merge ->dma_host_{on,off} methods into ->dma_host_set method
which takes 'int on' argument.

There should be no functionality changes caused by this patch.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/icside.c  |9 +-
 drivers/ide/cris/ide-cris.c   |9 +-
 drivers/ide/ide-dma.c |   50 
 drivers/ide/ide-io.c  |2 +-
 drivers/ide/ide-iops.c|8 +++---
 drivers/ide/ide-probe.c   |2 +-
 drivers/ide/ide.c |5 +--
 drivers/ide/mips/au1xxx-ide.c |9 +-
 drivers/ide/pci/cs5520.c  |   17 +++--
 drivers/ide/pci/sc1200.c  |2 +-
 drivers/ide/pci/sgiioc4.c |   12 +++--
 drivers/ide/pci/trm290.c  |9 +-
 drivers/ide/ppc/pmac.c|9 +-
 include/linux/ide.h   |6 +---
 14 files changed, 44 insertions(+), 105 deletions(-)

diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 3a8402b..8a5c720 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -287,11 +287,7 @@ static void icside_set_dma_mode(ide_drive_t *drive, const 
u8 xfer_mode)
ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);
 }
 
-static void icside_dma_host_off(ide_drive_t *drive)
-{
-}
-
-static void icside_dma_host_on(ide_drive_t *drive)
+static void icside_dma_host_set(ide_drive_t *drive, int on)
 {
 }
 
@@ -410,8 +406,7 @@ static void icside_dma_init(ide_hwif_t *hwif)
hwif->dmatable_dma  = 0;
hwif->set_dma_mode  = icside_set_dma_mode;
 
-   hwif->dma_host_off  = icside_dma_host_off;
-   hwif->dma_host_on   = icside_dma_host_on;
+   hwif->dma_host_set  = icside_dma_host_set;
hwif->dma_setup = icside_dma_setup;
hwif->dma_exec_cmd  = icside_dma_exec_cmd;
hwif->dma_start = icside_dma_start;
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index b0cd032..dcebc02 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -674,11 +674,7 @@ static void cris_ide_output_data (ide_drive_t *drive, void 
*, unsigned int);
 static void cris_atapi_input_bytes(ide_drive_t *drive, void *, unsigned int);
 static void cris_atapi_output_bytes(ide_drive_t *drive, void *, unsigned int);
 
-static void cris_dma_host_off(ide_drive_t *drive)
-{
-}
-
-static void cris_dma_host_on(ide_drive_t *drive)
+static void cris_dma_host_set(ide_drive_t *drive, int on)
 {
 }
 
@@ -792,6 +788,7 @@ init_e100_ide (void)
hwif->ata_output_data = &cris_ide_output_data;
hwif->atapi_input_bytes = &cris_atapi_input_bytes;
hwif->atapi_output_bytes = &cris_atapi_output_bytes;
+   hwif->dma_host_set = &cris_dma_host_set;
hwif->ide_dma_end = &cris_dma_end;
hwif->dma_setup = &cris_dma_setup;
hwif->dma_exec_cmd = &cris_dma_exec_cmd;
@@ -802,8 +799,6 @@ init_e100_ide (void)
hwif->OUTBSYNC = &cris_ide_outbsync;
hwif->INB = &cris_ide_inb;
hwif->INW = &cris_ide_inw;
-   hwif->dma_host_off = &cris_dma_host_off;
-   hwif->dma_host_on = &cris_dma_host_on;
hwif->cbl = ATA_CBL_PATA40;
hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA;
hwif->pio_mask = ATA_PIO4,
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 780911e..c9648b1 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -408,23 +408,28 @@ static int dma_timer_expiry (ide_drive_t *drive)
 }
 
 /**
- * ide_dma_host_off-   Generic DMA kill
+ * ide_dma_host_set-   Enable/disable DMA on a host
  * @drive: drive to control
  *
- * Perform the generic IDE controller DMA off operation. This
- * works for most IDE bus mastering controllers
+ * Enable/disable DMA on an IDE controller following generic
+ * bus-mastering IDE controller behaviour.
  */
 
-void ide_dma_host_off(ide_drive_t *drive)
+void ide_dma_host_set(ide_drive_t *drive, int on)
 {
ide_hwif_t *hwif= HWIF(drive);
u8 unit = (drive->select.b.unit & 0x01);
u8 dma_stat = hwif->INB(hwif->dma_status);
 
-   hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status);
+   i

ide: dump taskfile HOB registers in ide_tf_load() (if DEBUG is defined)

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6dd9b8376adbee95ddc321cc83c7f641577e01f6
Commit: 6dd9b8376adbee95ddc321cc83c7f641577e01f6
Parent: 15ce926ada545cb078711bd9a18c083c93fa01d7
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:03 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:03 2008 +0100

ide: dump taskfile HOB registers in ide_tf_load() (if DEBUG is defined)

* Dump taskfile HOB registers in ide_tf_load() (if DEBUG is defined).

* Remove no longer needed DEBUG code from __ide_do_rw_disk().

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-disk.c |7 +--
 drivers/ide/ide-taskfile.c |4 
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 364dc57..c1fb75c 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -219,12 +219,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t 
*drive, struct request *rq,
tf->lbal   = (u8) block;
tf->lbam   = (u8)(block >>  8);
tf->lbah   = (u8)(block >> 16);
-#ifdef DEBUG
-   printk("%s: 0x%02x%02x 0x%02x%02x%02x%02x%02x%02x\n",
-   drive->name, tf->hob_nsect, tf->nsect,
-   tf->hob_lbah, tf->hob_lbam, tf->hob_lbal,
-   tf->lbah, tf->lbam, tf->lbal);
-#endif
+
task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
} else {
tf->nsect  = nsectors & 0xff;
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 2d63ea9..063e0eb 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -77,6 +77,10 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
"lbam 0x%02x lbah 0x%02x dev 0x%02x cmd 0x%02x\n",
drive->name, tf->feature, tf->nsect, tf->lbal,
tf->lbam, tf->lbah, tf->device, tf->command);
+   printk("%s: hob: nsect 0x%02x lbal 0x%02x "
+   "lbam 0x%02x lbah 0x%02x\n",
+   drive->name, tf->hob_nsect, tf->hob_lbal,
+   tf->hob_lbam, tf->hob_lbah);
 #endif
 
if (IDE_CONTROL_REG)
-
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: merge ->fixup and ->quirkproc methods

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f01393e48c44e30f7c9a36c8b98a07b0232580fe
Commit: f01393e48c44e30f7c9a36c8b98a07b0232580fe
Parent: 6dd9b8376adbee95ddc321cc83c7f641577e01f6
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:03 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:03 2008 +0100

ide: merge ->fixup and ->quirkproc methods

* Assign drive->quirk_list in ->quirkproc implementations:
  - hpt366.c::hpt3xx_quirkproc()
  - pdc202xx_new.c::pdcnew_quirkproc()
  - pdc202xx_old.c::pdc202xx_quirkproc()

* Make ->quirkproc void.

* Move calling ->quirkproc from do_identify() to probe_hwif().

* Convert it821x_fixups() to it821x_quirkproc() in it821x.c.

* Convert siimage_fixup() to sil_quirkproc() in siimage.c, also remove
  no longer needed drive->present check from is_dev_seagate_sata().

* Convert ide_undecoded_slave() to accept 'drive' instead of 'hwif'
  as an argument.  Then convert ide_register_hw() to accept 'quirkproc'
  argument instead of 'fixup' one.

* Remove no longer needed ->fixup method.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c|   20 ++--
 drivers/ide/ide.c  |8 +++-
 drivers/ide/pci/hpt366.c   |   11 +++
 drivers/ide/pci/it821x.c   |   37 -
 drivers/ide/pci/pdc202xx_new.c |   11 +++
 drivers/ide/pci/pdc202xx_old.c |   11 +++
 drivers/ide/pci/siimage.c  |   15 +++
 drivers/ide/setup-pci.c|2 --
 include/linux/ide.h|   10 --
 9 files changed, 57 insertions(+), 68 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index fa95e79..c446e34 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -235,9 +235,6 @@ static inline void do_identify (ide_drive_t *drive, u8 cmd)
drive->media = ide_disk;
printk("%s DISK drive\n", (id->config == 0x848a) ? "CFA" : "ATA" );
 
-   if (hwif->quirkproc)
-   drive->quirk_list = hwif->quirkproc(drive);
-
return;
 
 err_misc:
@@ -676,19 +673,18 @@ out:
 
 /**
  * ide_undecoded_slave -   look for bad CF adapters
- * @hwif: interface
+ * @drive1: drive
  *
  * Analyse the drives on the interface and attempt to decide if we
  * have the same drive viewed twice. This occurs with crap CF adapters
  * and PCMCIA sometimes.
  */
 
-void ide_undecoded_slave(ide_hwif_t *hwif)
+void ide_undecoded_slave(ide_drive_t *drive1)
 {
-   ide_drive_t *drive0 = &hwif->drives[0];
-   ide_drive_t *drive1 = &hwif->drives[1];
+   ide_drive_t *drive0 = &drive1->hwif->drives[0];
 
-   if (drive0->present == 0 || drive1->present == 0)
+   if ((drive1->dn & 1) == 0 || drive0->present == 0)
return;
 
/* If the models don't match they are not the same product */
@@ -817,8 +813,12 @@ static void probe_hwif(ide_hwif_t *hwif)
return;
}
 
-   if (hwif->fixup)
-   hwif->fixup(hwif);
+   for (unit = 0; unit < MAX_DRIVES; unit++) {
+   ide_drive_t *drive = &hwif->drives[unit];
+
+   if (drive->present && hwif->quirkproc)
+   hwif->quirkproc(drive);
+   }
 
for (unit = 0; unit < MAX_DRIVES; ++unit) {
ide_drive_t *drive = &hwif->drives[unit];
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 7819fbd..0d7328e 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -414,8 +414,6 @@ static void ide_hwif_restore(ide_hwif_t *hwif, ide_hwif_t 
*tmp_hwif)
hwif->cds   = tmp_hwif->cds;
 #endif
 
-   hwif->fixup = tmp_hwif->fixup;
-
hwif->set_pio_mode  = tmp_hwif->set_pio_mode;
hwif->set_dma_mode  = tmp_hwif->set_dma_mode;
hwif->mdma_filter   = tmp_hwif->mdma_filter;
@@ -680,7 +678,7 @@ void ide_setup_ports (  hw_regs_t *hw,
 /**
  * ide_register_hw -   register IDE interface
  * @hw: hardware registers
- * @fixup: fixup function
+ * @quirkproc: quirkproc function
  * @initializing: set while initializing built-in drivers
  * @hwifp: pointer to returned hwif
  *
@@ -690,7 +688,7 @@ void ide_setup_ports (  hw_regs_t *hw,
  * Returns -1 on error.
  */
 
-int ide_register_hw(hw_regs_t *hw, void (*fixup)(ide_hwif_t *),
+int ide_register_hw(hw_regs_t *hw, void (*quirkproc)(ide_drive_t *),
int initializing, ide_hwif_t **hwifp)
 {
int index, retry = 1;
@@ -726,7 +724,7 @@ found:
memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));
hwif->irq = 

ide: don't try to unregister interfaces if 'initializing' in ide_register_hw()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=795d74b51a853e1f5f2c81baf836a3866f08
Commit: 795d74b51a853e1f5f2c81baf836a3866f08
Parent: f01393e48c44e30f7c9a36c8b98a07b0232580fe
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:03 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:03 2008 +0100

ide: don't try to unregister interfaces if 'initializing' in 
ide_register_hw()

Host drivers using ide_register_hw() and 'initializing == 1':

* ide-pnp
  - depends on ISA

* ide_arm
  - ARM arch specific
  - initialized before all other host drivers

* ide-cris
  - CRIS arch specific => IDE_ARCH_OBSOLETE_INIT is not defined
  - broken

* ide-h8300
  - H8300 arch specific => IDE_ARCH_OBSOLETE_INIT is not defined, no PCI

* buddha/q40/gayle/macide/falconide
  - M68K arch specific => IDE_ARCH_OBSOLETE_INIT is not defined, no PCI

Since the only host drivers which probe interfaces before the above ones 
are:

* ali14xx/dtc2278/ht6560b/qd65xx/umc8672
  - depend on ISA
  - require IDE_ARCH_OBSOLETE_INIT=y to work

* PCI ones
  - depend on PCI

don't try to unregister interfaces if 'initializing == 1' in 
ide_register_hw()
(it is possible that built-in host drivers will claim all IDE interfaces but
later ide-pnp host driver will try to unregister them - this change fixes 
it).

Also skip hwif->hold check if 'initializing == 1' since it is set only by:

* pmac
  - PPC && PMAC specific => no ISA

* au1xxx-ide
  - MIPS && SOC_AU1200 specific => no ISA

and use ide_find_port() helper to find free ide_hwifs[] slot.

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

diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 0d7328e..8ef521f 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -694,6 +694,15 @@ int ide_register_hw(hw_regs_t *hw, void 
(*quirkproc)(ide_drive_t *),
int index, retry = 1;
ide_hwif_t *hwif;
 
+   if (initializing) {
+   hwif = ide_find_port(hw->io_ports[IDE_DATA_OFFSET]);
+   if (hwif) {
+   index = hwif->index;
+   goto found;
+   }
+   return -1;
+   }
+
do {
for (index = 0; index < MAX_HWIFS; ++index) {
hwif = &ide_hwifs[index];
@@ -704,8 +713,7 @@ int ide_register_hw(hw_regs_t *hw, void 
(*quirkproc)(ide_drive_t *),
hwif = &ide_hwifs[index];
if (hwif->hold)
continue;
-   if ((!hwif->present && !hwif->mate && !initializing) ||
-   (!hwif->io_ports[IDE_DATA_OFFSET] && initializing))
+   if (!hwif->present && hwif->mate == NULL)
goto found;
}
for (index = 0; index < MAX_HWIFS; index++)
-
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: kill probe_hwif_init()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ba6560aa45fc498125b07130784ec5ca8a6922a6
Commit: ba6560aa45fc498125b07130784ec5ca8a6922a6
Parent: 795d74b51a853e1f5f2c81baf836a3866f08
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:04 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:04 2008 +0100

ide: kill probe_hwif_init()

There should be no functionality changes caused by this patch.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |   38 +-
 1 files changed, 17 insertions(+), 21 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index c446e34..bfcc807 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -848,25 +848,6 @@ static void probe_hwif(ide_hwif_t *hwif)
}
 }
 
-static int hwif_init(ide_hwif_t *hwif);
-static void hwif_register_devices(ide_hwif_t *hwif);
-
-static int probe_hwif_init(ide_hwif_t *hwif)
-{
-   probe_hwif(hwif);
-
-   if (!hwif_init(hwif)) {
-   printk(KERN_INFO "%s: failed to initialize IDE interface\n",
-hwif->name);
-   return -1;
-   }
-
-   if (hwif->present)
-   hwif_register_devices(hwif);
-
-   return 0;
-}
-
 #if MAX_HWIFS > 1
 /*
  * save_match() is used to simplify logic in init_irq() below.
@@ -1394,11 +1375,26 @@ EXPORT_SYMBOL_GPL(ideprobe_init);
 
 int ide_device_add(u8 idx[4])
 {
+   ide_hwif_t *hwif;
int i, rc = 0;
 
for (i = 0; i < 4; i++) {
-   if (idx[i] != 0xff)
-   rc |= probe_hwif_init(&ide_hwifs[idx[i]]);
+   if (idx[i] == 0xff)
+   continue;
+
+   hwif = &ide_hwifs[idx[i]];
+
+   probe_hwif(hwif);
+
+   if (hwif_init(hwif) == 0) {
+   printk(KERN_INFO "%s: failed to initialize IDE "
+"interface\n", hwif->name);
+   rc = -1;
+   continue;
+   }
+
+   if (hwif->present)
+   hwif_register_devices(hwif);
}
 
for (i = 0; i < 4; i++) {
-
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: fix probing for hosts with serialized or IRQ sharing interfaces

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2e13093a834ddbbf92701d477e69c9018959a82c
Commit: 2e13093a834ddbbf92701d477e69c9018959a82c
Parent: ba6560aa45fc498125b07130784ec5ca8a6922a6
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:04 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:04 2008 +0100

ide: fix probing for hosts with serialized or IRQ sharing interfaces

After hwif_register_devices() IDE devices are ready to be used so
the way in which ide_device_add() works currently is racy for hosts
with serialized / IRQ sharing interfaces.

Fix ide_device_add() by looping over interfaces for probe_hwif(),
hwif_init() and hwif_register_devices() operations.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |   16 ++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index bfcc807..817564f 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1382,9 +1382,14 @@ int ide_device_add(u8 idx[4])
if (idx[i] == 0xff)
continue;
 
-   hwif = &ide_hwifs[idx[i]];
+   probe_hwif(&ide_hwifs[idx[i]]);
+   }
 
-   probe_hwif(hwif);
+   for (i = 0; i < 4; i++) {
+   if (idx[i] == 0xff)
+   continue;
+
+   hwif = &ide_hwifs[idx[i]];
 
if (hwif_init(hwif) == 0) {
printk(KERN_INFO "%s: failed to initialize IDE "
@@ -1392,6 +1397,13 @@ int ide_device_add(u8 idx[4])
rc = -1;
continue;
}
+   }
+
+   for (i = 0; i < 4; i++) {
+   if (idx[i] == 0xff)
+   continue;
+
+   hwif = &ide_hwifs[idx[i]];
 
if (hwif->present)
hwif_register_devices(hwif);
-
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


rapide: set hwif->chipset

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23d8e72c3a813f2121878120bc49de2cd390119b
Commit: 23d8e72c3a813f2121878120bc49de2cd390119b
Parent: 2e13093a834ddbbf92701d477e69c9018959a82c
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:04 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:04 2008 +0100

rapide: set hwif->chipset

hwif->chipset should be set if the hwif is claimed by host driver.

Cc: Russell King <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/rapide.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 0775a3a..c709d37 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -55,6 +55,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id 
*id)
 
hwif = rapide_locate_hwif(base, base + 0x818, 1 << 6, ec->irq);
if (hwif) {
+   hwif->chipset = ide_generic;
hwif->hwif_data = base;
hwif->gendev.parent = &ec->dev;
hwif->noprobe = 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


swarm: set hwif->chipset

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aae73b4ed721912dbd4909ae5f618080c64594de
Commit: aae73b4ed721912dbd4909ae5f618080c64594de
Parent: 23d8e72c3a813f2121878120bc49de2cd390119b
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:04 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:04 2008 +0100

swarm: set hwif->chipset

hwif->chipset should be set if the hwif is claimed by host driver.

Cc: Maciej W. Rozycki <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/mips/swarm.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index 521edd4..8b3959d 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -117,6 +117,7 @@ static int __devinit swarm_ide_probe(struct device *dev)
default_hwif_mmiops(hwif);
/* Prevent resource map manipulation.  */
hwif->mmio = 1;
+   hwif->chipset = ide_generic;
hwif->noprobe = 0;
 
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++)
-
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: add hwif->chipset fixup to ide_device_add()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=71518342bfdfbe508ee325ab5e20984ba2da7de2
Commit: 71518342bfdfbe508ee325ab5e20984ba2da7de2
Parent: aae73b4ed721912dbd4909ae5f618080c64594de
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:04 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:04 2008 +0100

ide: add hwif->chipset fixup to ide_device_add()

Add hwif->chipset fixup identical to the one in ideprobe_init()
to ide_device_add().

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 817564f..a7a1cd8 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1405,8 +1405,12 @@ int ide_device_add(u8 idx[4])
 
hwif = &ide_hwifs[idx[i]];
 
-   if (hwif->present)
+   if (hwif->present) {
+   if (hwif->chipset == ide_unknown ||
+   hwif->chipset == ide_forced)
+   hwif->chipset = ide_generic;
hwif_register_devices(hwif);
+   }
}
 
for (i = 0; i < 4; i++) {
-
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: remove ideprobe_init()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=151575e4644f917d3a9f83c777ac3543284954f8
Commit: 151575e4644f917d3a9f83c777ac3543284954f8
Parent: 71518342bfdfbe508ee325ab5e20984ba2da7de2
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:05 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:05 2008 +0100

ide: remove ideprobe_init()

* Rename ide_device_add() to ide_device_add_all() and make it accept
  'u8 idx[MAX_HWIFS]' instead of 'u8 idx[4]' as an argument.

* Add ide_device_add() wrapper for ide_device_add_all().

* Convert ide_generic_init() to use ide_device_add_all().

* Remove no longer needed ideprobe_init().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-generic.c |8 +-
 drivers/ide/ide-probe.c   |   54 +---
 include/linux/ide.h   |3 +-
 3 files changed, 24 insertions(+), 41 deletions(-)

diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index 0f72b98..bb30c29 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -14,10 +14,16 @@
 
 static int __init ide_generic_init(void)
 {
+   u8 idx[MAX_HWIFS];
+   int i;
+
if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
ide_get_lock(NULL, NULL); /* for atari only */
 
-   (void)ideprobe_init();
+   for (i = 0; i < MAX_HWIFS; i++)
+   idx[i] = ide_hwifs[i].present ? 0xff : i;
+
+   ide_device_add_all(idx);
 
if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
ide_release_lock(); /* for atari only */
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index a7a1cd8..1af94ac 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1340,52 +1340,19 @@ static void hwif_register_devices(ide_hwif_t *hwif)
}
 }
 
-int ideprobe_init (void)
-{
-   unsigned int index;
-   int probe[MAX_HWIFS];
-
-   memset(probe, 0, MAX_HWIFS * sizeof(int));
-   for (index = 0; index < MAX_HWIFS; ++index)
-   probe[index] = !ide_hwifs[index].present;
-
-   for (index = 0; index < MAX_HWIFS; ++index)
-   if (probe[index])
-   probe_hwif(&ide_hwifs[index]);
-   for (index = 0; index < MAX_HWIFS; ++index)
-   if (probe[index])
-   hwif_init(&ide_hwifs[index]);
-   for (index = 0; index < MAX_HWIFS; ++index) {
-   if (probe[index]) {
-   ide_hwif_t *hwif = &ide_hwifs[index];
-   if (!hwif->present)
-   continue;
-   if (hwif->chipset == ide_unknown || hwif->chipset == 
ide_forced)
-   hwif->chipset = ide_generic;
-   hwif_register_devices(hwif);
-   }
-   }
-   for (index = 0; index < MAX_HWIFS; ++index)
-   if (probe[index])
-   ide_proc_register_port(&ide_hwifs[index]);
-   return 0;
-}
-
-EXPORT_SYMBOL_GPL(ideprobe_init);
-
-int ide_device_add(u8 idx[4])
+int ide_device_add_all(u8 idx[MAX_HWIFS])
 {
ide_hwif_t *hwif;
int i, rc = 0;
 
-   for (i = 0; i < 4; i++) {
+   for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
 
probe_hwif(&ide_hwifs[idx[i]]);
}
 
-   for (i = 0; i < 4; i++) {
+   for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
 
@@ -1399,7 +1366,7 @@ int ide_device_add(u8 idx[4])
}
}
 
-   for (i = 0; i < 4; i++) {
+   for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] == 0xff)
continue;
 
@@ -1413,12 +1380,23 @@ int ide_device_add(u8 idx[4])
}
}
 
-   for (i = 0; i < 4; i++) {
+   for (i = 0; i < MAX_HWIFS; i++) {
if (idx[i] != 0xff)
ide_proc_register_port(&ide_hwifs[idx[i]]);
}
 
return rc;
 }
+EXPORT_SYMBOL_GPL(ide_device_add_all);
+
+int ide_device_add(u8 idx[4])
+{
+   u8 idx_all[MAX_HWIFS];
+   int i;
 
+   for (i = 0; i < MAX_HWIFS; i++)
+   idx_all[i] = (i < 4) ? idx[i] : 0xff;
+
+   return ide_device_add_all(idx_all);
+}
 EXPORT_SYMBOL_GPL(ide_device_add);
diff --git a/include/linux/ide.h b/include/linux/ide.h
index dd50a5c..d7c0f9a 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1011,8 +1011,6 @@ extern void do_ide_request(struct request_queue *);
 
 void ide_init_disk(struct gendisk *, ide_drive_t *);
 
-extern int ideprobe_init(void);
-
 #ifdef CONFIG_IDEPCI_PCIBUS_ORDER
 extern void ide_scan_pcibus(int scan_direction) __init;
 

ide: Fix build break caused by "ide: remove ideprobe_init()"

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0d5bc27ce995adaafbc114b92fa76815025c94e
Commit: b0d5bc27ce995adaafbc114b92fa76815025c94e
Parent: 151575e4644f917d3a9f83c777ac3543284954f8
Author: Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:05 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:05 2008 +0100

ide: Fix build break caused by "ide: remove ideprobe_init()"

Fix build break of powerpc holly_defconfig:

In file included from arch/powerpc/platforms/embedded6xx/holly.c:24:
include/linux/ide.h:1206: error: 'CONFIG_IDE_MAX_HWIFS' undeclared here 
(not in a function)

There's no need to have a sized array in the prototype, might as well
turn it into a pointer.

It could probably be argued that large parts of the include file can be
covered under #ifdef CONFIG_IDE, but that's a larger undertaking.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Cc: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |2 +-
 include/linux/ide.h |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 1af94ac..18e9b82 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -1340,7 +1340,7 @@ static void hwif_register_devices(ide_hwif_t *hwif)
}
 }
 
-int ide_device_add_all(u8 idx[MAX_HWIFS])
+int ide_device_add_all(u8 *idx)
 {
ide_hwif_t *hwif;
int i, rc = 0;
diff --git a/include/linux/ide.h b/include/linux/ide.h
index d7c0f9a..ce9b16f 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1201,7 +1201,7 @@ void ide_unregister_region(struct gendisk *);
 
 void ide_undecoded_slave(ide_drive_t *);
 
-int ide_device_add_all(u8 idx[MAX_HWIFS]);
+int ide_device_add_all(u8 *idx);
 int ide_device_add(u8 idx[4]);
 
 static inline void *ide_get_hwifdata (ide_hwif_t * hwif)
-
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


sgiioc4: always init hwif->io_ports

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f8e8483f667d79739007b25f0e59a540fb9fa51
Commit: 8f8e8483f667d79739007b25f0e59a540fb9fa51
Parent: b0d5bc27ce995adaafbc114b92fa76815025c94e
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:05 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:05 2008 +0100

sgiioc4: always init hwif->io_ports

'if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base)' is always true.

Cc: Jeremy Higdon <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/sgiioc4.c |   15 ++-
 1 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 9fb35c5..b188efc 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -593,6 +593,7 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
ide_hwif_t *hwif;
int h;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+   hw_regs_t hw;
 
/*
 * Find an empty HWIF; if none available, return -ENOMEM.
@@ -632,15 +633,11 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
return -ENOMEM;
}
 
-   if (hwif->io_ports[IDE_DATA_OFFSET] != cmd_base) {
-   hw_regs_t hw;
-
-   /* Initialize the IO registers */
-   memset(&hw, 0, sizeof(hw));
-   sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport);
-   memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
-   hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
-   }
+   /* Initialize the IO registers */
+   memset(&hw, 0, sizeof(hw));
+   sgiioc4_init_hwif_ports(&hw, cmd_base, ctl, irqport);
+   memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
+   hwif->noprobe = 0;
 
hwif->irq = dev->irq;
hwif->chipset = ide_pci;
-
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: add ide_init_port_hw() helper

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=57c802e84f9c759c3d1794a9dbe81bc10444df62
Commit: 57c802e84f9c759c3d1794a9dbe81bc10444df62
Parent: 8f8e8483f667d79739007b25f0e59a540fb9fa51
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:05 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:05 2008 +0100

ide: add ide_init_port_hw() helper

* Add ide_init_port_hw() helper.

* rapide.c: convert rapide_locate_hwif() to rapide_setup_ports()
  and use ide_init_port_hw().

* ide_platform.c: convert plat_ide_locate_hwif() to plat_ide_setup_ports()
  and use ide_init_port_hw().

* sgiioc4.c: use ide_init_port_hw().

* pmac.c: add 'hw_regs_t *hw' argument to pmac_ide_setup_device(),
  setup 'hw' in pmac_ide_{macio,pci}_attach() and use ide_init_port_hw()
  in pmac_ide_setup_device().

This patch is a preparation for the future changes in the IDE probing code.

There should be no functionality changes caused by this patch.

Cc: Russell King <[EMAIL PROTECTED]>
Cc: Anton Vorontsov <[EMAIL PROTECTED]>
Cc: Jeremy Higdon <[EMAIL PROTECTED]>
Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/rapide.c  |   34 +++---
 drivers/ide/ide.c |   19 +
 drivers/ide/legacy/ide_platform.c |   55 +++--
 drivers/ide/pci/sgiioc4.c |9 +++---
 drivers/ide/ppc/pmac.c|   29 ---
 include/linux/ide.h   |1 +
 6 files changed, 81 insertions(+), 66 deletions(-)

diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index c709d37..0267467 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -13,26 +13,18 @@
 
 #include 
 
-static ide_hwif_t *
-rapide_locate_hwif(void __iomem *base, void __iomem *ctrl, unsigned int sz, 
int irq)
+static void rapide_setup_ports(hw_regs_t *hw, void __iomem *base,
+  void __iomem *ctrl, unsigned int sz, int irq)
 {
unsigned long port = (unsigned long)base;
-   ide_hwif_t *hwif = ide_find_port(port);
int i;
 
-   if (hwif == NULL)
-   goto out;
-
for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
-   hwif->io_ports[i] = port;
+   hw->io_ports[i] = port;
port += sz;
}
-   hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
-   hwif->irq = irq;
-   hwif->mmio = 1;
-   default_hwif_mmiops(hwif);
-out:
-   return hwif;
+   hw->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)ctrl;
+   hw->irq = irq;
 }
 
 static int __devinit
@@ -42,6 +34,7 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id 
*id)
void __iomem *base;
int ret;
u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+   hw_regs_t hw;
 
ret = ecard_request_resources(ec);
if (ret)
@@ -53,12 +46,19 @@ rapide_probe(struct expansion_card *ec, const struct 
ecard_id *id)
goto release;
}
 
-   hwif = rapide_locate_hwif(base, base + 0x818, 1 << 6, ec->irq);
+   hwif = ide_find_port((unsigned long)base);
if (hwif) {
-   hwif->chipset = ide_generic;
+   memset(&hw, 0, sizeof(hw));
+   rapide_setup_ports(&hw, base, base + 0x818, 1 << 6, ec->irq);
+   hw.chipset = ide_generic;
+   hw.dev = &ec->dev;
+
+   ide_init_port_hw(hwif, &hw);
+
+   hwif->mmio = 1;
+   default_hwif_mmiops(hwif);
+
hwif->hwif_data = base;
-   hwif->gendev.parent = &ec->dev;
-   hwif->noprobe = 0;
 
idx[0] = hwif->index;
 
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 8ef521f..98bd45e 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -675,6 +675,17 @@ void ide_setup_ports ( hw_regs_t *hw,
  */
 }
 
+void ide_init_port_hw(ide_hwif_t *hwif, hw_regs_t *hw)
+{
+   memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));
+   hwif->irq = hw->irq;
+   hwif->noprobe = 0;
+   hwif->chipset = hw->chipset;
+   hwif->gendev.parent = hw->dev;
+   hwif->ack_intr = hw->ack_intr;
+}
+EXPORT_SYMBOL_GPL(ide_init_port_hw);
+
 /**
  * ide_register_hw -   register IDE interface
  * @hw: hardware registers
@@ -729,13 +740,9 @@ found:
}
if (hwif->present)
return -1;
-   memcpy(hwif->io_ports, hw->io_ports, sizeof(hwif->io_ports));
-   hwif->irq = hw->irq;
-   hwif->noprobe = 0;
+
+   ide_init_port_hw(hwif, hw);
hwif->quirkproc = quirkproc;
-   hwif->chipset = hw->chipset;
-   hw

ide: drop 'initializing' argument from ide_register_hw()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cbb010c180294a5242a7681555c28737d9dd26ab
Commit: cbb010c180294a5242a7681555c28737d9dd26ab
Parent: 57c802e84f9c759c3d1794a9dbe81bc10444df62
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:06 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:06 2008 +0100

ide: drop 'initializing' argument from ide_register_hw()

* Rename init_hwif_data() to ide_init_port_data() and export it.

* For all users of ide_register_hw() with 'initializing' argument set
  hwif->present and hwif->hold are always zero so convert these host
  drivers to use ide_find_port()+ide_init_port_data()+ide_init_port_hw()
  instead (also no need for init_hwif_default() call since the setup
  done by it gets over-ridden by ide_init_port_hw() call).

* Drop 'initializing' argument from ide_register_hw().

Cc: Geert Uytterhoeven <[EMAIL PROTECTED]>
Cc: Roman Zippel <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/bast-ide.c |2 +-
 drivers/ide/arm/ide_arm.c  |8 +++-
 drivers/ide/cris/ide-cris.c|4 +++-
 drivers/ide/h8300/ide-h8300.c  |   11 +++
 drivers/ide/ide-pnp.c  |   11 +++
 drivers/ide/ide.c  |   33 +++--
 drivers/ide/legacy/buddha.c|   11 ---
 drivers/ide/legacy/falconide.c |   14 +-
 drivers/ide/legacy/gayle.c |   10 +++---
 drivers/ide/legacy/ide-cs.c|2 +-
 drivers/ide/legacy/macide.c|   29 ++---
 drivers/ide/legacy/q40ide.c|   10 ++
 drivers/ide/pci/delkin_cb.c|2 +-
 drivers/macintosh/mediabay.c   |3 ++-
 include/linux/ide.h|3 ++-
 15 files changed, 86 insertions(+), 67 deletions(-)

diff --git a/drivers/ide/arm/bast-ide.c b/drivers/ide/arm/bast-ide.c
index 48db616..45bf9c8 100644
--- a/drivers/ide/arm/bast-ide.c
+++ b/drivers/ide/arm/bast-ide.c
@@ -45,7 +45,7 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
hw.irq = irq;
 
-   ide_register_hw(&hw, NULL, 0, hwif);
+   ide_register_hw(&hw, NULL, hwif);
 
return 0;
 }
diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index 8957cba..1a03a2a 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -26,10 +26,16 @@
 
 void __init ide_arm_init(void)
 {
+   ide_hwif_t *hwif;
hw_regs_t hw;
 
memset(&hw, 0, sizeof(hw));
ide_std_init_ports(&hw, IDE_ARM_IO, IDE_ARM_IO + 0x206);
hw.irq = IDE_ARM_IRQ;
-   ide_register_hw(&hw, NULL, 1, NULL);
+
+   hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+   if (hwif) {
+   ide_init_port_data(hwif, hwif->index);
+   ide_init_port_hw(hwif, &hw);
+   }
 }
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c
index dcebc02..7e33e2b 100644
--- a/drivers/ide/cris/ide-cris.c
+++ b/drivers/ide/cris/ide-cris.c
@@ -777,9 +777,11 @@ init_e100_ide (void)
ide_offsets,
0, 0, cris_ide_ack_intr,
ide_default_irq(0));
-   ide_register_hw(&hw, NULL, 1, &hwif);
+   hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
if (hwif == NULL)
continue;
+   ide_init_port_data(hwif, hwif->index);
+   ide_init_port_hw(hwif, &hw);
hwif->mmio = 1;
hwif->chipset = ide_etrax100;
hwif->set_pio_mode = &cris_set_pio_mode;
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index 4a49b5c..57d0d4c 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -88,7 +88,7 @@ void __init h8300_ide_init(void)
 {
hw_regs_t hw;
ide_hwif_t *hwif;
-   int idx;
+   int index;
 
if (!request_region(CONFIG_H8300_IDE_BASE, H8300_IDE_GAP*8, 
"ide-h8300"))
goto out_busy;
@@ -100,14 +100,17 @@ void __init h8300_ide_init(void)
hw_setup(&hw);
 
/* register if */
-   idx = ide_register_hw(&hw, NULL, 1, &hwif);
-   if (idx == -1) {
+   hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+   if (hwif == NULL) {
printk(KERN_ERR "ide-h8300: IDE I/F register failed\n");
return;
}
 
+   index = hwif->index;
+   ide_init_port_data(hwif, index);
+   ide_init_port_hw(hwif, &hw);
hwif_setup(hwif);
-   printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", idx);
+   printk(KERN_INFO "ide%d: H8/300 generic IDE interface\n", index);
retur

ide: move ide_arm_init() call from init_ide_data() to ide_init()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=944000921d41c5aacfda6515ad3a0bbde52f8fa3
Commit: 944000921d41c5aacfda6515ad3a0bbde52f8fa3
Parent: cbb010c180294a5242a7681555c28737d9dd26ab
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:06 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:06 2008 +0100

ide: move ide_arm_init() call from init_ide_data() to ide_init()

* Remove ide_init_port_data() call from ide_arm_init() and move
  ide_arm_init() call from init_ide_data() to ide_init().

This patch is a preparation for the future changes (and as a side-effect
makes obsolete "idex=io[,ctl[,irq]]" kernel parameters work for ide_arm).

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/ide_arm.c |1 -
 drivers/ide/ide.c |6 +++---
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/arm/ide_arm.c b/drivers/ide/arm/ide_arm.c
index 1a03a2a..21ba6ac 100644
--- a/drivers/ide/arm/ide_arm.c
+++ b/drivers/ide/arm/ide_arm.c
@@ -35,7 +35,6 @@ void __init ide_arm_init(void)
 
hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
if (hwif) {
-   ide_init_port_data(hwif, hwif->index);
ide_init_port_hw(hwif, &hw);
}
 }
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 3ec220b..77af743 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -218,9 +218,6 @@ static void __init init_ide_data (void)
ide_init_default_irq(hwif->io_ports[IDE_DATA_OFFSET]);
 #endif
}
-#ifdef CONFIG_IDE_ARM
-   ide_arm_init();
-#endif
 }
 
 /**
@@ -1774,6 +1771,9 @@ static int __init ide_init(void)
 
proc_ide_create();
 
+#ifdef CONFIG_IDE_ARM
+   ide_arm_init();
+#endif
 #ifdef CONFIG_BLK_DEV_ALI14XX
if (probe_ali14xx)
(void)ali14xx_init();
-
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


cmd640: fix dependency on IDE_GENERIC

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ac87e41116c229fc1efaac0d17fdbfb2185e4629
Commit: ac87e41116c229fc1efaac0d17fdbfb2185e4629
Parent: 944000921d41c5aacfda6515ad3a0bbde52f8fa3
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:06 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:06 2008 +0100

cmd640: fix dependency on IDE_GENERIC

Make BLK_DEV_CMD640 select IDE_GENERIC.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index ee01e27..2a584b3 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -327,6 +327,7 @@ config BLK_DEV_PLATFORM
 config BLK_DEV_CMD640
bool "CMD640 chipset bugfix/support"
depends on X86
+   select IDE_GENERIC
---help---
  The CMD-Technologies CMD640 IDE chip is used on many common 486 and
  Pentium motherboards, usually in combination with a "Neptune" or
-
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: move CONFIG_IDEPCI_PCIBUS_ORDER code to ide-scan-pci.c

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ac59226ca95889ad620b0e63c0f700679fee5dd
Commit: 9ac59226ca95889ad620b0e63c0f700679fee5dd
Parent: c99c92c58757985096e2d195dc1631246d99d686
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:09 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:09 2008 +0100

ide: move CONFIG_IDEPCI_PCIBUS_ORDER code to ide-scan-pci.c

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-scan-pci.c |  110 
 drivers/ide/setup-pci.c|  103 -
 2 files changed, 110 insertions(+), 103 deletions(-)

diff --git a/drivers/ide/ide-scan-pci.c b/drivers/ide/ide-scan-pci.c
index 23015d8..7ffa332 100644
--- a/drivers/ide/ide-scan-pci.c
+++ b/drivers/ide/ide-scan-pci.c
@@ -1,8 +1,118 @@
+/*
+ * support for probing IDE PCI devices in the PCI bus order
+ *
+ * Copyright (c) 1998-2000  Andre Hedrick <[EMAIL PROTECTED]>
+ * Copyright (c) 1995-1998  Mark Lord
+ *
+ * May be copied or modified under the terms of the GNU General Public License
+ */
+
 #include 
 #include 
 #include 
 #include 
 
+/*
+ * Module interfaces
+ */
+
+static int pre_init = 1;   /* Before first ordered IDE scan */
+static LIST_HEAD(ide_pci_drivers);
+
+/*
+ * __ide_pci_register_driver   -   attach IDE driver
+ * @driver: pci driver
+ * @module: owner module of the driver
+ *
+ * Registers a driver with the IDE layer. The IDE layer arranges that
+ * boot time setup is done in the expected device order and then
+ * hands the controllers off to the core PCI code to do the rest of
+ * the work.
+ *
+ * Returns are the same as for pci_register_driver
+ */
+
+int __ide_pci_register_driver(struct pci_driver *driver, struct module *module,
+ const char *mod_name)
+{
+   if (!pre_init)
+   return __pci_register_driver(driver, module, mod_name);
+   driver->driver.owner = module;
+   list_add_tail(&driver->node, &ide_pci_drivers);
+   return 0;
+}
+EXPORT_SYMBOL_GPL(__ide_pci_register_driver);
+
+/**
+ * ide_scan_pcidev -   find an IDE driver for a device
+ * @dev: PCI device to check
+ *
+ * Look for an IDE driver to handle the device we are considering.
+ * This is only used during boot up to get the ordering correct. After
+ * boot up the pci layer takes over the job.
+ */
+
+static int __init ide_scan_pcidev(struct pci_dev *dev)
+{
+   struct list_head *l;
+   struct pci_driver *d;
+
+   list_for_each(l, &ide_pci_drivers) {
+   d = list_entry(l, struct pci_driver, node);
+   if (d->id_table) {
+   const struct pci_device_id *id =
+   pci_match_id(d->id_table, dev);
+
+   if (id != NULL && d->probe(dev, id) >= 0) {
+   dev->driver = d;
+   pci_dev_get(dev);
+   return 1;
+   }
+   }
+   }
+   return 0;
+}
+
+/**
+ * ide_scan_pcibus -   perform the initial IDE driver scan
+ *
+ * Perform the initial bus rather than driver ordered scan of the
+ * PCI drivers. After this all IDE pci handling becomes standard
+ * module ordering not traditionally ordered.
+ */
+
+int __init ide_scan_pcibus(void)
+{
+   struct pci_dev *dev = NULL;
+   struct pci_driver *d;
+   struct list_head *l, *n;
+
+   pre_init = 0;
+   if (!ide_scan_direction)
+   while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)))
+   ide_scan_pcidev(dev);
+   else
+   while ((dev = pci_get_device_reverse(PCI_ANY_ID, PCI_ANY_ID,
+dev)))
+   ide_scan_pcidev(dev);
+
+   /*
+*  Hand the drivers over to the PCI layer now we
+*  are post init.
+*/
+
+   list_for_each_safe(l, n, &ide_pci_drivers) {
+   list_del(l);
+   d = list_entry(l, struct pci_driver, node);
+   if (__pci_register_driver(d, d->driver.owner,
+ d->driver.mod_name))
+   printk(KERN_ERR "%s: failed to register %s driver\n",
+   __FUNCTION__, d->driver.mod_name);
+   }
+
+   return 0;
+}
+
 static int __init ide_scan_pci(void)
 {
return ide_scan_pcibus();
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index be9ae5a..676c66e 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -698,106 +698,3 @@ out:
 }
 
 EXPORT_SYMBOL_GPL(ide_setup_pci_devices);
-
-#ifdef CONFIG_IDEPCI_PCIBUS_ORDER
-/*
- * Module i

ide: make CONFIG_IDEPCI_PCIBUS_ORDER visible and deprecate it

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce71ed9ba8b558d54c213d372a6cf8b302fa1fa4
Commit: ce71ed9ba8b558d54c213d372a6cf8b302fa1fa4
Parent: 9ac59226ca95889ad620b0e63c0f700679fee5dd
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:09 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:09 2008 +0100

ide: make CONFIG_IDEPCI_PCIBUS_ORDER visible and deprecate it

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig |   14 +-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index e92128a..64df55e 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -374,7 +374,19 @@ config BLK_DEV_IDEPCI
bool
 
 config IDEPCI_PCIBUS_ORDER
-   def_bool BLK_DEV_IDE=y && BLK_DEV_IDEPCI
+   bool "Probe IDE PCI devices in the PCI bus order (DEPRECATED)"
+   depends on BLK_DEV_IDE=y && BLK_DEV_IDEPCI
+   default y
+   help
+ Probe IDE PCI devices in the order in which they appear on the
+ PCI bus (i.e. 00:1f.1 PCI device before 02:01.0 PCI device)
+ instead of the order in which IDE PCI host drivers are loaded.
+
+ Please note that this method of assuring stable naming of
+ IDE devices is unreliable and use other means for achieving
+ it (i.e. udev).
+
+ If in doubt, say N.
 
 # TODO: split it on per host driver config options (or module parameters)
 config BLK_DEV_OFFBOARD
-
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: add ide_busy_sleep() helper

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a5015cc9d7051ce8e706ef48276d8484aac0c4b
Commit: 3a5015cc9d7051ce8e706ef48276d8484aac0c4b
Parent: ce71ed9ba8b558d54c213d372a6cf8b302fa1fa4
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:09 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:09 2008 +0100

ide: add ide_busy_sleep() helper

Add ide_busy_sleep() helper and use it in do_probe(),
enable_nest() and probe_hwif().

As a nice side-effect this fixes a minor bug in do_probe()
(the code was reading status register without any delay).

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-probe.c |   43 +--
 1 files changed, 21 insertions(+), 22 deletions(-)

diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 9d9f1c6..edf650b 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -382,6 +382,20 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd)
return retval;
 }
 
+static int ide_busy_sleep(ide_hwif_t *hwif)
+{
+   unsigned long timeout = jiffies + WAIT_WORSTCASE;
+   u8 stat;
+
+   do {
+   msleep(50);
+   stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
+   if ((stat & BUSY_STAT) == 0)
+   return 0;
+   } while (time_before(jiffies, timeout));
+
+   return 1;
+}
 
 /**
  * do_probe-   probe an IDE device
@@ -450,7 +464,6 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
if ((rc == 1 && cmd == WIN_PIDENTIFY) &&
((drive->autotune == IDE_TUNE_DEFAULT) ||
(drive->autotune == IDE_TUNE_AUTO))) {
-   unsigned long timeout;
printk("%s: no response (status = 0x%02x), "
"resetting drive\n", drive->name,
hwif->INB(IDE_STATUS_REG));
@@ -458,10 +471,7 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
hwif->OUTB(drive->select.all, IDE_SELECT_REG);
msleep(50);
hwif->OUTB(WIN_SRST, IDE_COMMAND_REG);
-   timeout = jiffies;
-   while (((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) &&
-  time_before(jiffies, timeout + WAIT_WORSTCASE))
-   msleep(50);
+   (void)ide_busy_sleep(hwif);
rc = try_to_identify(drive, cmd);
}
if (rc == 1)
@@ -489,20 +499,16 @@ static int do_probe (ide_drive_t *drive, u8 cmd)
 static void enable_nest (ide_drive_t *drive)
 {
ide_hwif_t *hwif = HWIF(drive);
-   unsigned long timeout;
 
printk("%s: enabling %s -- ", hwif->name, drive->id->model);
SELECT_DRIVE(drive);
msleep(50);
hwif->OUTB(EXABYTE_ENABLE_NEST, IDE_COMMAND_REG);
-   timeout = jiffies + WAIT_WORSTCASE;
-   do {
-   if (time_after(jiffies, timeout)) {
-   printk("failed (timeout)\n");
-   return;
-   }
-   msleep(50);
-   } while ((hwif->INB(IDE_STATUS_REG)) & BUSY_STAT);
+
+   if (ide_busy_sleep(hwif)) {
+   printk(KERN_CONT "failed (timeout)\n");
+   return;
+   }
 
msleep(50);
 
@@ -783,18 +789,11 @@ static void probe_hwif(ide_hwif_t *hwif)
}
}
if (hwif->io_ports[IDE_CONTROL_OFFSET] && hwif->reset) {
-   unsigned long timeout = jiffies + WAIT_WORSTCASE;
-   u8 stat;
-
printk(KERN_WARNING "%s: reset\n", hwif->name);
hwif->OUTB(12, hwif->io_ports[IDE_CONTROL_OFFSET]);
udelay(10);
hwif->OUTB(8, hwif->io_ports[IDE_CONTROL_OFFSET]);
-   do {
-   msleep(50);
-   stat = hwif->INB(hwif->io_ports[IDE_STATUS_OFFSET]);
-   } while ((stat & BUSY_STAT) && time_after(timeout, jiffies));
-
+   (void)ide_busy_sleep(hwif);
}
local_irq_restore(flags);
/*
-
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: remove broken disk byte-swapping support

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9e47be0c97f7357b80e91dc0632e9cce2eb025e0
Commit: 9e47be0c97f7357b80e91dc0632e9cce2eb025e0
Parent: 3a5015cc9d7051ce8e706ef48276d8484aac0c4b
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:09 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:09 2008 +0100

ide: remove broken disk byte-swapping support

Remove broken disk byte-swapping support:
- it can cause a data corruption on SMP (or if using PREEMPT on UP)
- all data coming from disk are byte-swapped by taskfile_*_data() which
  results in incorrect identify data being reported by /proc/ide/ and IOCTLs
- "hdx=bswap/byteswap" kernel parameter has been broken on m68k host drivers
  (including Atari/Q40 ones) since 2.5.x days (because of 'hwif' zero-ing)
- byte-swapping is limited to PIO transfers (for working with TiVo disks on
  x86 machines using user-space solutions or dm-byteswap should result in
  much better performance because DMA can be used)

For previous discussions please see:

http://www.ussg.iu.edu/hypermail/linux/kernel/0201.0/0768.html
http://lkml.org/lkml/2004/2/28/111

[ I have dm-byteswap device mapper target if somebody is interested
  (patch is for 2.6.4 though but I'll dust it off if needed). ]

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 Documentation/ide.txt  |4 
 drivers/ide/ide-disk.c |1 -
 drivers/ide/ide-taskfile.c |   32 ++--
 drivers/ide/ide.c  |6 +-
 include/linux/ide.h|1 -
 5 files changed, 3 insertions(+), 41 deletions(-)

diff --git a/Documentation/ide.txt b/Documentation/ide.txt
index b29ccb4..94e2e3b 100644
--- a/Documentation/ide.txt
+++ b/Documentation/ide.txt
@@ -244,10 +244,6 @@ Summary of ide driver parameters for kernel command line
 
  "hdx=nodma"   : disallow DMA
 
- "hdx=swapdata": when the drive is a disk, byte swap all data
-
- "hdx=bswap"   : same as above..
-
  "hdx=scsi": the return of the ide-scsi flag, this is useful for
  allowing ide-floppy, ide-tape, and ide-cdrom|writers
  to use ide-scsi emulation on a device specific option.
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index c1fb75c..041be43 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -761,7 +761,6 @@ static void idedisk_add_settings(ide_drive_t *drive)
ide_add_setting(drive,  "bios_head",SETTING_RW, TYPE_BYTE,  
0,  255,1,  1,  &drive->bios_head,  NULL);
ide_add_setting(drive,  "bios_sect",SETTING_RW, TYPE_BYTE,  
0,  63, 1,  1,  &drive->bios_sect,  NULL);
ide_add_setting(drive,  "address",  SETTING_RW, TYPE_BYTE,  
0,  2,  1,  1,  &drive->addressing, 
set_lba_addressing);
-   ide_add_setting(drive,  "bswap",SETTING_READ,   TYPE_BYTE,  
0,  1,  1,  1,  &drive->bswap,  NULL);
ide_add_setting(drive,  "multcount",SETTING_RW, TYPE_BYTE,  
0,  id->max_multsect,   1,  1,  &drive->mult_count, 
set_multcount);
ide_add_setting(drive,  "nowerr",   SETTING_RW, TYPE_BYTE,  
0,  1,  1,  1,  &drive->nowerr, 
set_nowerr);
ide_add_setting(drive,  "lun",  SETTING_RW, TYPE_INT,   
0,  7,  1,  1,  &drive->lun,NULL);
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index c58edc8..3ecafab 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -35,34 +35,6 @@
 #include 
 #include 
 
-static void ata_bswap_data (void *buffer, int wcount)
-{
-   u16 *p = buffer;
-
-   while (wcount--) {
-   *p = *p << 8 | *p >> 8; p++;
-   *p = *p << 8 | *p >> 8; p++;
-   }
-}
-
-static void taskfile_input_data(ide_drive_t *drive, void *buffer, u32 wcount)
-{
-   HWIF(drive)->ata_input_data(drive, buffer, wcount);
-   if (drive->bswap)
-   ata_bswap_data(buffer, wcount);
-}
-
-static void taskfile_output_data(ide_drive_t *drive, void *buffer, u32 wcount)
-{
-   if (drive->bswap) {
-   ata_bswap_data(buffer, wcount);
-   HWIF(drive)->ata_output_data(drive, buffer, wcount);
-   ata_bswap_data(buffer, wcount);
-   } else {
-   HWIF(drive)->ata_output_data(drive, buffer, wcount);
-   }
-}
-
 void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
 {
ide_hwif_t *hwif = drive->hwif;
@@ -352,9 +324,9 @

[CIFS] DFS build fixes

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=366781c19635d861f43ff5e03388a3873ec912d9
Commit: 366781c19635d861f43ff5e03388a3873ec912d9
Parent: 6d5ae0deb1641bf615eafd8fef64218e10cb2fd0
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 10:12:41 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 10:12:41 2008 +

[CIFS] DFS build fixes

Also includes a few minor changes suggested by Christoph

Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/cifs_dfs_ref.c |   14 --
 fs/cifs/cifsglob.h |   41 -
 fs/cifs/cifsproto.h|4 ++--
 fs/cifs/connect.c  |   12 
 fs/cifs/dns_resolve.c  |5 +++--
 fs/cifs/link.c |   16 
 6 files changed, 61 insertions(+), 31 deletions(-)

diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 15e31f8..413ee23 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -3,8 +3,9 @@
  *   traversal via DFS junction point
  *
  *   Copyright (c) 2007 Igor Mammedov
+ *   Copyright (C) International Business Machines  Corp., 2008
  *   Author(s): Igor Mammedov ([EMAIL PROTECTED])
- *
+ * Steve French ([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 the Free Software Foundation; either version
@@ -107,8 +108,9 @@ static char *cifs_get_share_name(const char *node_name)
  * Returns: pointer to new mount options or ERR_PTR.
  * Caller is responcible for freeing retunrned value if it is not error.
  */
-char *compose_mount_options(const char *sb_mountdata, const char *ref_unc,
-   char **devname)
+static char *compose_mount_options(const char *sb_mountdata,
+  const char *ref_unc,
+  char **devname)
 {
int rc;
char *mountdata;
@@ -188,13 +190,13 @@ compose_mount_options_out:
 }
 
 
-struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent,
+static struct vfsmount *cifs_dfs_do_refmount(const struct vfsmount *mnt_parent,
struct dentry *dentry, char *ref_unc)
 {
struct cifs_sb_info *cifs_sb;
struct vfsmount *mnt;
char *mountdata;
-   char *devname;
+   char *devname = NULL;
 
cifs_sb = CIFS_SB(dentry->d_inode->i_sb);
mountdata = compose_mount_options(cifs_sb->mountdata,
@@ -278,7 +280,7 @@ static int add_mount_helper(struct vfsmount *newmnt, struct 
nameidata *nd,
return err;
 }
 
-void dump_referral(const struct dfs_info3_param *ref)
+static void dump_referral(const struct dfs_info3_param *ref)
 {
cFYI(1, ("DFS: ref path: %s", ref->path_name));
cFYI(1, ("DFS: node path: %s", ref->node_name));
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 1fde219..5d32d8d 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/cifsglob.h
  *
- *   Copyright (C) International Business Machines  Corp., 2002,2007
+ *   Copyright (C) International Business Machines  Corp., 2002,2008
  *   Author(s): Steve French ([EMAIL PROTECTED])
  *  Jeremy Allison ([EMAIL PROTECTED])
  *
@@ -70,14 +70,6 @@
 #endif
 
 /*
- * This information is kept on every Server we know about.
- *
- * Some things to note:
- *
- */
-#define SERVER_NAME_LEN_WITH_NULL  (SERVER_NAME_LENGTH + 1)
-
-/*
  * CIFS vfs client Status information (based on what we know.)
  */
 
@@ -460,6 +452,37 @@ struct dir_notify_req {
struct file *pfile;
 };
 
+struct dfs_info3_param {
+   int flags; /* DFSREF_REFERRAL_SERVER, DFSREF_STORAGE_SERVER*/
+   int PathConsumed;
+   int server_type;
+   int ref_flag;
+   char *path_name;
+   char *node_name;
+};
+
+static inline void free_dfs_info_param(struct dfs_info3_param *param)
+{
+   if (param) {
+   kfree(param->path_name);
+   kfree(param->node_name);
+   kfree(param);
+   }
+}
+
+static inline void free_dfs_info_array(struct dfs_info3_param *param,
+  int number_of_items)
+{
+   int i;
+   if ((number_of_items == 0) || (param == NULL))
+   return;
+   for (i = 0; i < number_of_items; i++) {
+   kfree(param[i].path_name);
+   kfree(param[i].node_name);
+   }
+   kfree(param);
+}
+
 #define   MID_FREE 0
 #define   MID_REQUEST_ALLOCATED 1
 #define   MID_REQUEST_SUBMITTED 2
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index aaaf748..2f09f56 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -1,7 +1,7 @@
 /*
  *   fs/cifs/cifsproto.h
  *
- *   Copyright (c) International Business Machines  Corp., 2002,2007
+ *   Copyright (c) International Business Machines  Corp., 2002,2008
 

[CIFS] DFS support: provide shrinkable mounts

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6d5ae0deb1641bf615eafd8fef64218e10cb2fd0
Commit: 6d5ae0deb1641bf615eafd8fef64218e10cb2fd0
Parent: ed2b91701d97047fa9970645e43d5e551e261adb
Author: Igor Mammedov <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 25 03:28:31 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Fri Jan 25 03:28:31 2008 +

[CIFS] DFS support: provide shrinkable mounts

Signed-off-by: Igor Mammedov <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/Makefile   |2 +-
 fs/cifs/cifs_dfs_ref.c |  375 
 fs/cifs/cifsfs.c   |4 +
 fs/cifs/cifsfs.h   |4 +
 fs/cifs/cifsproto.h|3 +
 5 files changed, 387 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index 09898b8..6ba43fb 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -10,4 +10,4 @@ cifs-y := cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o 
file.o inode.o \
 
 cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
 
-cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o
+cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
new file mode 100644
index 000..15e31f8
--- /dev/null
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -0,0 +1,375 @@
+/*
+ *   Contains the CIFS DFS referral mounting routines used for handling
+ *   traversal via DFS junction point
+ *
+ *   Copyright (c) 2007 Igor Mammedov
+ *   Author(s): Igor Mammedov ([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 the Free Software Foundation; either version
+ *   2 of the License, or (at your option) any later version.
+ */
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include "cifsglob.h"
+#include "cifsproto.h"
+#include "cifsfs.h"
+#include "dns_resolve.h"
+#include "cifs_debug.h"
+
+LIST_HEAD(cifs_dfs_automount_list);
+
+/*
+ * DFS functions
+*/
+
+void dfs_shrink_umount_helper(struct vfsmount *vfsmnt)
+{
+   mark_mounts_for_expiry(&cifs_dfs_automount_list);
+   mark_mounts_for_expiry(&cifs_dfs_automount_list);
+   shrink_submounts(vfsmnt, &cifs_dfs_automount_list);
+}
+
+/**
+ * cifs_get_share_name -   extracts share name from UNC
+ * @node_name: pointer to UNC string
+ *
+ * Extracts sharename form full UNC.
+ * i.e. strips from UNC trailing path that is not part of share
+ * name and fixup missing '\' in the begining of DFS node refferal
+ * if neccessary.
+ * Returns pointer to share name on success or NULL on error.
+ * Caller is responsible for freeing returned string.
+ */
+static char *cifs_get_share_name(const char *node_name)
+{
+   int len;
+   char *UNC;
+   char *pSep;
+
+   len = strlen(node_name);
+   UNC = kmalloc(len+2 /*for term null and additional \ if it's missed */,
+GFP_KERNEL);
+   if (!UNC)
+   return NULL;
+
+   /* get share name and server name */
+   if (node_name[1] != '\\') {
+   UNC[0] = '\\';
+   strncpy(UNC+1, node_name, len);
+   len++;
+   UNC[len] = 0;
+   } else {
+   strncpy(UNC, node_name, len);
+   UNC[len] = 0;
+   }
+
+   /* find server name end */
+   pSep = memchr(UNC+2, '\\', len-2);
+   if (!pSep) {
+   cERROR(1, ("%s: no server name end in node name: %s",
+   __FUNCTION__, node_name));
+   kfree(UNC);
+   return NULL;
+   }
+
+   /* find sharename end */
+   pSep++;
+   pSep = memchr(UNC+(pSep-UNC), '\\', len-(pSep-UNC));
+   if (!pSep) {
+   cERROR(1, ("%s:2 cant find share name in node name: %s",
+   __FUNCTION__, node_name));
+   kfree(UNC);
+   return NULL;
+   }
+   /* trim path up to sharename end
+*  * now we have share name in UNC */
+   *pSep = 0;
+
+   return UNC;
+}
+
+
+/**
+ * compose_mount_options   -   creates mount options for refferral
+ * @sb_mountdata:  parent/root DFS mount options (template)
+ * @ref_unc:   refferral server UNC
+ * @devname:   pointer for saving device name
+ *
+ * creates mount options for submount based on template options sb_mountdata
+ * and replacing unc,ip,prefixpath options with ones we've got form ref_unc.
+ *
+ * Returns: pointer to new mount options or ERR_PTR.
+ * Caller is responcible for freeing retunrned value if it is not error.
+ */
+char *compose_mount_options(const char *sb_mountdata, const char *ref_unc,
+   char **devname)
+{
+   int rc;
+   char *mountdata;
+   int md_len;
+   char *tkn_e;
+   char *srvIP = NULL;
+   char sep = ',';
+   int off, nof

[CIFS] Forgot to add two new files from previous commit

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=197c183f3526dc08aa52ca97ec66c268442d4b84
Commit: 197c183f3526dc08aa52ca97ec66c268442d4b84
Parent: 6103335de8afa5d780dcd512abe85c696af7b040
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 10 17:10:23 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Thu Jan 10 17:10:23 2008 +

[CIFS] Forgot to add two new files from previous commit

Thanks to Igor for noticing this.
CC: Igor Mammedov <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/dns_resolve.c |  123 +
 fs/cifs/dns_resolve.h |   32 +
 2 files changed, 155 insertions(+), 0 deletions(-)

diff --git a/fs/cifs/dns_resolve.c b/fs/cifs/dns_resolve.c
new file mode 100644
index 000..777a086
--- /dev/null
+++ b/fs/cifs/dns_resolve.c
@@ -0,0 +1,123 @@
+/*
+ *  fs/cifs/dns_resolve.c
+ *
+ *   Copyright (c) 2007 Igor Mammedov
+ *   Author(s): Igor Mammedov ([EMAIL PROTECTED])
+ *  Steve French ([EMAIL PROTECTED])
+ *
+ *   Contains the CIFS DFS upcall routines used for hostname to
+ *   IP address translation.
+ *
+ *   This library is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU Lesser General Public License as published
+ *   by the Free Software Foundation; either version 2.1 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This library is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+ *   the GNU Lesser General Public License for more details.
+ *
+ *   You should have received a copy of the GNU Lesser General Public License
+ *   along with this library; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include 
+#include "dns_resolve.h"
+#include "cifsglob.h"
+#include "cifsproto.h"
+#include "cifs_debug.h"
+
+static int dns_resolver_instantiate(struct key *key, const void *data,
+   size_t datalen)
+{
+   int rc = 0;
+   char *ip;
+
+   ip = kmalloc(datalen+1, GFP_KERNEL);
+   if (!ip)
+   return -ENOMEM;
+
+   memcpy(ip, data, datalen);
+   ip[datalen] = '\0';
+
+   rcu_assign_pointer(key->payload.data, ip);
+
+   return rc;
+}
+
+struct key_type key_type_dns_resolver = {
+   .name= "dns_resolver",
+   .def_datalen = sizeof(struct in_addr),
+   .describe= user_describe,
+   .instantiate = dns_resolver_instantiate,
+   .match   = user_match,
+};
+
+
+/* Resolves server name to ip address.
+ * input:
+ * unc - server UNC
+ * output:
+ * *ip_addr - pointer to server ip, caller responcible for freeing it.
+ * return 0 on success
+ */
+int
+dns_resolve_server_name_to_ip(const char *unc, char **ip_addr) {
+   int rc = -EAGAIN;
+   struct key *rkey;
+   char *name;
+   int len;
+
+   if ((!ip_addr) || (!unc))
+   return -EINVAL;
+
+   /* search for server name delimiter */
+   len = strlen(unc);
+   if (len < 3) {
+   cFYI(1, ("%s: unc is too short: %s", __FUNCTION__, unc));
+   return -EINVAL;
+   }
+   len -= 2;
+   name = memchr(unc+2, '\\', len);
+   if (!name) {
+   cFYI(1, ("%s: probably server name is whole unc: %s",
+   __FUNCTION__, unc));
+   } else {
+   len = (name - unc) - 2/* leading // */;
+   }
+
+   name = kmalloc(len+1, GFP_KERNEL);
+   if (!name) {
+   rc = -ENOMEM;
+   return rc;
+   }
+   memcpy(name, unc+2, len);
+   name[len] = 0;
+
+   rkey = request_key(&key_type_dns_resolver, name, "");
+   if (!IS_ERR(rkey)) {
+   len = strlen(rkey->payload.data);
+   *ip_addr = kmalloc(len+1, GFP_KERNEL);
+   if (*ip_addr) {
+   memcpy(*ip_addr, rkey->payload.data, len);
+   (*ip_addr)[len] = '\0';
+   cFYI(1, ("%s: resolved: %s to %s", __FUNCTION__,
+   rkey->description,
+   *ip_addr
+   ));
+   rc = 0;
+   } else {
+   rc = -ENOMEM;
+   }
+   key_put(rkey);
+   } else {
+   cERROR(1, ("%s: unable to resolve: %s", __FUNCTION__, name));
+   }
+
+   kfree(name);
+   return rc;
+}
+
+
diff --git a/fs/cifs/dns_resolve.h b/fs/cifs/dns_resolve.h
new file mode 100644
index 000..073fdc3
--- /dev/null
+++ b/fs/cifs/dns_resolve.h
@@ -0,0 +1,32 @@
+/*
+ *   fs/cifs/dns_resolve.h -- DNS Resolver upcall management for CIFS DFS
+ *

[CIFS] DNS name resolution helper upcall for cifs

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6103335de8afa5d780dcd512abe85c696af7b040
Commit: 6103335de8afa5d780dcd512abe85c696af7b040
Parent: f6d09982197c4163c70f6af0cf15bb78674105c0
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 9 16:21:36 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Wed Jan 9 16:21:36 2008 +

[CIFS] DNS name resolution helper upcall for cifs

Adds additional option CIFS_DFS_UPCALL to fs/Kconfig for enabling
DFS support.  Resolved IP address is saved as a string in the
key payload.

Igor has a series of related patches that will follow which finish up
CIFS DFS support

Acked-by: Igor Mammedov <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/Kconfig   |   39 ++-
 fs/cifs/Makefile |2 ++
 fs/cifs/cifsfs.c |   15 ++-
 3 files changed, 42 insertions(+), 14 deletions(-)

diff --git a/fs/Kconfig b/fs/Kconfig
index 487236c..18cd221 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -1905,13 +1905,15 @@ config CIFS
  file servers such as Windows 2000 (including Windows 2003, NT 4  
  and Windows XP) as well by Samba (which provides excellent CIFS
  server support for Linux and many other operating systems). Limited
- support for OS/2 and Windows ME and similar servers is provided as 
well.
-
- The intent of the cifs module is to provide an advanced
- network file system client for mounting to CIFS compliant servers,
- including support for dfs (hierarchical name space), secure per-user
- session establishment, safe distributed caching (oplock), optional
- packet signing, Unicode and other internationalization improvements. 
+ support for OS/2 and Windows ME and similar servers is provided as
+ well.
+
+ The cifs module provides an advanced network file system
+ client for mounting to CIFS compliant servers.  It includes
+ support for DFS (hierarchical name space), secure per-user
+ session establishment via Kerberos or NTLM or NTLMv2,
+ safe distributed caching (oplock), optional packet
+ signing, Unicode and other internationalization improvements.
  If you need to mount to Samba or Windows from this machine, say Y.
 
 config CIFS_STATS
@@ -1943,7 +1945,8 @@ config CIFS_WEAK_PW_HASH
  (since 1997) support stronger NTLM (and even NTLMv2 and Kerberos)
  security mechanisms. These hash the password more securely
  than the mechanisms used in the older LANMAN version of the
-  SMB protocol needed to establish sessions with old SMB servers.
+ SMB protocol but LANMAN based authentication is needed to
+ establish sessions with some old SMB servers.
 
  Enabling this option allows the cifs module to mount to older
  LANMAN based servers such as OS/2 and Windows 95, but such
@@ -1951,8 +1954,8 @@ config CIFS_WEAK_PW_HASH
  security mechanisms if you are on a public network.  Unless you
  have a need to access old SMB servers (and are on a private 
  network) you probably want to say N.  Even if this support
- is enabled in the kernel build, they will not be used
- automatically. At runtime LANMAN mounts are disabled but
+ is enabled in the kernel build, LANMAN authentication will not be
+ used automatically. At runtime LANMAN mounts are disabled but
  can be set to required (or optional) either in
  /proc/fs/cifs (see fs/cifs/README for more detail) or via an
  option on the mount command. This support is disabled by 
@@ -2018,12 +2021,22 @@ config CIFS_UPCALL
  depends on CIFS_EXPERIMENTAL
  depends on KEYS
  help
-   Enables an upcall mechanism for CIFS which will be used to contact
-   userspace helper utilities to provide SPNEGO packaged Kerberos
-   tickets which are needed to mount to certain secure servers
+   Enables an upcall mechanism for CIFS which accesses
+   userspace helper utilities to provide SPNEGO packaged (RFC 4178)
+   Kerberos tickets which are needed to mount to certain secure servers
(for which more secure Kerberos authentication is required). If
unsure, say N.
 
+config CIFS_DFS_UPCALL
+ bool "DFS feature support (EXPERIMENTAL)"
+ depends on CIFS_EXPERIMENTAL
+ depends on KEYS
+ help
+   Enables an upcall mechanism for CIFS which contacts userspace
+   helper utilities to provide server name resolution (host names to
+   IP addresses) which is needed for implicit mounts of DFS junction
+   points. If unsure, say N.
+
 config NCP_FS
tristate "NCP file system support (to mount NetWare volumes)"

[CIFS] fix checkpatch warnings in fs/cifs/inode.c

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f6d09982197c4163c70f6af0cf15bb78674105c0
Commit: f6d09982197c4163c70f6af0cf15bb78674105c0
Parent: 88e7d705c4bdb729f02173583628ccbf49dba945
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Tue Jan 8 23:18:22 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Tue Jan 8 23:18:22 2008 +

[CIFS] fix checkpatch warnings in fs/cifs/inode.c

Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/README  |   28 +---
 fs/cifs/TODO|   14 ++
 fs/cifs/inode.c |   14 --
 3 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/fs/cifs/README b/fs/cifs/README
index bf11329..c623e2f 100644
--- a/fs/cifs/README
+++ b/fs/cifs/README
@@ -56,7 +56,8 @@ the CIFS VFS web site) copy it to the same directory in which 
mount.smbfs and
 similar files reside (usually /sbin).  Although the helper software is not  
 required, mount.cifs is recommended.  Eventually the Samba 3.0 utility program 
 "net" may also be helpful since it may someday provide easier mount syntax for
-users who are used to Windows e.g.  net use  
+users who are used to Windows e.g.
+   net use  
 Note that running the Winbind pam/nss module (logon service) on all of your
 Linux clients is useful in mapping Uids and Gids consistently across the
 domain to the proper network user.  The mount.cifs mount helper can be
@@ -248,7 +249,7 @@ A partial list of the supported mount options follows:
the CIFS session.
   password The user password.  If the mount helper is
installed, the user will be prompted for password
-   if it is not supplied.
+   if not supplied.
   ip   The ip address of the target server
   unc  The target server Universal Network Name (export) to 
mount.  
@@ -283,7 +284,7 @@ A partial list of the supported mount options follows:
can be enabled by specifying file_mode and dir_mode on 
the client.  Note that the mount.cifs helper must be
at version 1.10 or higher to support specifying the uid
-   (or gid) in non-numberic form.
+   (or gid) in non-numeric form.
   gid  Set the default gid for inodes (similar to above).
   file_mode If CIFS Unix extensions are not supported by the server
this overrides the default mode for file inodes.
@@ -417,9 +418,10 @@ A partial list of the supported mount options follows:
   acl  Allow setfacl and getfacl to manage posix ACLs if server
supports them.  (default)
   noaclDo not allow setfacl and getfacl calls on this mount
-  user_xattrAllow getting and setting user xattrs as OS/2 EAs (extended
-   attributes) to the server (default) e.g. via setfattr 
-   and getfattr utilities. 
+  user_xattrAllow getting and setting user xattrs (those attributes whose
+   name begins with "user." or "os2.") as OS/2 EAs (extended
+   attributes) to the server.  This allows support of the
+   setfattr and getfattr utilities. (default)
   nouser_xattr  Do not allow getfattr/setfattr to get/set/list xattrs 
   mapchars  Translate six of the seven reserved characters (not backslash)
*?<>|:
@@ -434,6 +436,7 @@ A partial list of the supported mount options follows:
  nomapchars Do not translate any of these seven characters (default).
  nocase Request case insensitive path name matching (case
sensitive is the default if the server suports it).
+   (mount option "ignorecase" is identical to "nocase")
  posixpaths If CIFS Unix extensions are supported, attempt to
negotiate posix path name support which allows certain
characters forbidden in typical CIFS filenames, without
@@ -485,6 +488,9 @@ A partial list of the supported mount options follows:
ntlmv2i Use NTLMv2 password hashing with packet signing
lanman  (if configured in kernel config) use older
lanman hash
+hard   Retry file operations if server is not responding
+soft   Limit retries to unresponsive servers (usually only
+   one retry) before returning an error.  (default)
 
 The mount.cifs mount helper also accepts a few mount options before -o
 including:
@@ -535,8 +541,8 @@ SecurityFlags   Flags which control security 
negotiation and
must use NTLM   0x02002
may use NTLMv2  0x4
must use NTLMv2 0x04004
-   may use Kerberos security (not implemented yet) 0x8
-

[CIFS] hold ses sem on tcp session reconnect during mount

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=88e7d705c4bdb729f02173583628ccbf49dba945
Commit: 88e7d705c4bdb729f02173583628ccbf49dba945
Parent: 97837582bc1e191d2792af74c1f3762ed01243b9
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Thu Jan 3 17:37:09 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Thu Jan 3 17:37:09 2008 +

[CIFS] hold ses sem on tcp session reconnect during mount

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/connect.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 658f58b..db3746c 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1966,13 +1966,13 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info 
*cifs_sb,
pSesInfo = existingCifsSes;
cFYI(1, ("Existing smb sess found (status=%d)",
pSesInfo->status));
+   down(&pSesInfo->sesSem);
if (pSesInfo->status == CifsNeedReconnect) {
cFYI(1, ("Session needs reconnect"));
-   down(&pSesInfo->sesSem);
rc = cifs_setup_session(xid, pSesInfo,
cifs_sb->local_nls);
-   up(&pSesInfo->sesSem);
}
+   up(&pSesInfo->sesSem);
} else if (!rc) {
cFYI(1, ("Existing smb sess not found"));
pSesInfo = sesInfoAlloc();
@@ -3522,7 +3522,7 @@ cifs_umount(struct super_block *sb, struct cifs_sb_info 
*cifs_sb)
sesInfoFree(ses);
 
FreeXid(xid);
-   return rc;  /* BB check if we should always return zero here */
+   return rc;
 }
 
 int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
-
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


[CIFS] Allow setting mode via cifs acl

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=97837582bc1e191d2792af74c1f3762ed01243b9
Commit: 97837582bc1e191d2792af74c1f3762ed01243b9
Parent: 28c5a02a11f70bb1fd8dd3b633206e2db3220308
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 31 07:47:21 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Dec 31 07:47:21 2007 +

[CIFS] Allow setting mode via cifs acl

Requires cifsacl mount flag to be on and CIFS_EXPERIMENTAL enabled

CC: Shirish Pargaonkar <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/CHANGES |2 +
 fs/cifs/cifsacl.c   |  240 +--
 fs/cifs/cifspdu.h   |3 +
 fs/cifs/cifsproto.h |4 +-
 fs/cifs/cifssmb.c   |   65 ++
 fs/cifs/inode.c |   14 ++-
 6 files changed, 315 insertions(+), 13 deletions(-)

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 0c77876..edd2483 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -5,6 +5,8 @@ Enable experimental Kerberos support.  Return writebehind 
errors on flush
 and sync so that events like out of disk space get reported properly on
 cached files. Fix setxattr failure to certain Samba versions. Fix mount
 of second share to disconnected server session (autoreconnect on this).
+Add ability to modify cifs acls for handling chmod (when mounted with
+cifsacl flag).
 
 Version 1.51
 
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index c312adc..a7035bd 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -129,6 +129,54 @@ int compare_sids(const struct cifs_sid *ctsid, const 
struct cifs_sid *cwsid)
return (1); /* sids compare/match */
 }
 
+
+/* copy ntsd, owner sid, and group sid from a security descriptor to another */
+static void copy_sec_desc(const struct cifs_ntsd *pntsd,
+   struct cifs_ntsd *pnntsd, __u32 sidsoffset)
+{
+   int i;
+
+   struct cifs_sid *owner_sid_ptr, *group_sid_ptr;
+   struct cifs_sid *nowner_sid_ptr, *ngroup_sid_ptr;
+
+   /* copy security descriptor control portion */
+   pnntsd->revision = pntsd->revision;
+   pnntsd->type = pntsd->type;
+   pnntsd->dacloffset = cpu_to_le32(sizeof(struct cifs_ntsd));
+   pnntsd->sacloffset = 0;
+   pnntsd->osidoffset = cpu_to_le32(sidsoffset);
+   pnntsd->gsidoffset = cpu_to_le32(sidsoffset + sizeof(struct cifs_sid));
+
+   /* copy owner sid */
+   owner_sid_ptr = (struct cifs_sid *)((char *)pntsd +
+   le32_to_cpu(pntsd->osidoffset));
+   nowner_sid_ptr = (struct cifs_sid *)((char *)pnntsd + sidsoffset);
+
+   nowner_sid_ptr->revision = owner_sid_ptr->revision;
+   nowner_sid_ptr->num_subauth = owner_sid_ptr->num_subauth;
+   for (i = 0; i < 6; i++)
+   nowner_sid_ptr->authority[i] = owner_sid_ptr->authority[i];
+   for (i = 0; i < 5; i++)
+   nowner_sid_ptr->sub_auth[i] = owner_sid_ptr->sub_auth[i];
+
+   /* copy group sid */
+   group_sid_ptr = (struct cifs_sid *)((char *)pntsd +
+   le32_to_cpu(pntsd->gsidoffset));
+   ngroup_sid_ptr = (struct cifs_sid *)((char *)pnntsd + sidsoffset +
+   sizeof(struct cifs_sid));
+
+   ngroup_sid_ptr->revision = group_sid_ptr->revision;
+   ngroup_sid_ptr->num_subauth = group_sid_ptr->num_subauth;
+   for (i = 0; i < 6; i++)
+   ngroup_sid_ptr->authority[i] = group_sid_ptr->authority[i];
+   for (i = 0; i < 5; i++)
+   ngroup_sid_ptr->sub_auth[i] =
+   cpu_to_le32(group_sid_ptr->sub_auth[i]);
+
+   return;
+}
+
+
 /*
change posix mode to reflect permissions
pmode is the existing mode (we only want to overwrite part of this
@@ -220,6 +268,33 @@ static void mode_to_access_flags(umode_t mode, umode_t 
bits_to_use,
return;
 }
 
+static __le16 fill_ace_for_sid(struct cifs_ace *pntace,
+   const struct cifs_sid *psid, __u64 nmode, umode_t bits)
+{
+   int i;
+   __u16 size = 0;
+   __u32 access_req = 0;
+
+   pntace->type = ACCESS_ALLOWED;
+   pntace->flags = 0x0;
+   mode_to_access_flags(nmode, bits, &access_req);
+   if (!access_req)
+   access_req = SET_MINIMUM_RIGHTS;
+   pntace->access_req = cpu_to_le32(access_req);
+
+   pntace->sid.revision = psid->revision;
+   pntace->sid.num_subauth = psid->num_subauth;
+   for (i = 0; i < 6; i++)
+   pntace->sid.authority[i] = psid->authority[i];
+   for (i = 0; i < psid->num_subauth; i++)
+   pntace->sid.sub_auth[i] = psid->sub_auth[i];
+
+   size = 1 + 1 + 2 + 4 + 1 + 1 + 6 + (psid->num_subauth * 4);
+   pntace->size = cpu_to_le16(size);
+
+   return (size);
+}
+
 
 #ifdef CONFIG_CIFS_DEBUG2
 static void dump_ace(struct cifs_ace *pace, char *end

[CIFS] fix unicode string alignment in SPNEGO setup

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28c5a02a11f70bb1fd8dd3b633206e2db3220308
Commit: 28c5a02a11f70bb1fd8dd3b633206e2db3220308
Parent: bb5a9a04d4cab4b13d63ac5cd3e1fb35f9583607
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 31 04:56:21 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Dec 31 04:56:21 2007 +

[CIFS]  fix unicode string alignment in SPNEGO setup

Unicode strings need to be word aligned, but the code that handles that
is currently not taking the length of the SPNEGO blob into account. Fix
it to do so.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/sess.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index ce698d5..d2153ab 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -542,7 +542,7 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, 
int first_time,
 
if (ses->capabilities & CAP_UNICODE) {
/* unicode strings must be word aligned */
-   if (iov[0].iov_len % 2) {
+   if ((iov[0].iov_len + iov[1].iov_len) % 2) {
*bcc_ptr = 0;
bcc_ptr++;
}
-
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


[CIFS] redo existing session setup if needed in cifs_mount

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d9a8852c365fb7f8db0f8364210138985f457b8
Commit: 1d9a8852c365fb7f8db0f8364210138985f457b8
Parent: 05b3de63da2abe804f5dbe0174298bf48949079f
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 31 01:37:11 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Dec 31 01:37:11 2007 +

[CIFS] redo existing session setup if needed in cifs_mount

When cifs_mount finds an existing SMB session that it can use for a new
mount, it does not check to see whether that session is in need of being
reconnected. An easy way to reproduce:

1) mount //server/share1
2) watch /proc/fs/cifs/DebugData for the share to go DISCONNECTED
3) mount //server/share2 with same creds as in step 1.

The second mount will fail because CIFSTCon returned -EAGAIN. If you do
an operation in share1 and then reattempt the mount it will work (since
the session is reestablished).

The following patch fixes this by having cifs_mount check the status
of the session when it picks an existing session and calling
cifs_setup_session on it again if it's in need of reconnection.

Thanks to Wojciech Pilorz for the initial bug report.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/CHANGES   |3 ++-
 fs/cifs/connect.c |   10 +-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index 13d788f..0c77876 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -3,7 +3,8 @@ Version 1.52
 Fix oops on second mount to server when null auth is used.
 Enable experimental Kerberos support.  Return writebehind errors on flush
 and sync so that events like out of disk space get reported properly on
-cached files. Fix setxattr failure to certain Samba versions.
+cached files. Fix setxattr failure to certain Samba versions. Fix mount
+of second share to disconnected server session (autoreconnect on this).
 
 Version 1.51
 
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index fd9147c..658f58b 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1964,7 +1964,15 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info 
*cifs_sb,
 
if (existingCifsSes) {
pSesInfo = existingCifsSes;
-   cFYI(1, ("Existing smb sess found"));
+   cFYI(1, ("Existing smb sess found (status=%d)",
+   pSesInfo->status));
+   if (pSesInfo->status == CifsNeedReconnect) {
+   cFYI(1, ("Session needs reconnect"));
+   down(&pSesInfo->sesSem);
+   rc = cifs_setup_session(xid, pSesInfo,
+   cifs_sb->local_nls);
+   up(&pSesInfo->sesSem);
+   }
} else if (!rc) {
cFYI(1, ("Existing smb sess not found"));
pSesInfo = sesInfoAlloc();
-
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


[CIFS] fix SetEA failure to some Samba versions

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dae5dbdbd786798ad2249e54df1156d524da30aa
Commit: dae5dbdbd786798ad2249e54df1156d524da30aa
Parent: e697789d64f8748cb219d7f5c413c512953802cc
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Sun Dec 30 23:49:57 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Sun Dec 30 23:49:57 2007 +

[CIFS] fix SetEA failure to some Samba versions

Thanks to Oleg Gvozdev for noticing the problem.

CC: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/CHANGES   |2 +-
 fs/cifs/cifssmb.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/CHANGES b/fs/cifs/CHANGES
index a609599..13d788f 100644
--- a/fs/cifs/CHANGES
+++ b/fs/cifs/CHANGES
@@ -3,7 +3,7 @@ Version 1.52
 Fix oops on second mount to server when null auth is used.
 Enable experimental Kerberos support.  Return writebehind errors on flush
 and sync so that events like out of disk space get reported properly on
-cached files.
+cached files. Fix setxattr failure to certain Samba versions.
 
 Version 1.51
 
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 9e8a6be..618542b 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -5499,7 +5499,7 @@ SetEARetry:
else
name_len = strnlen(ea_name, 255);
 
-   count = sizeof(*parm_data) + ea_value_len + name_len + 1;
+   count = sizeof(*parm_data) + ea_value_len + name_len;
pSMB->MaxParameterCount = cpu_to_le16(2);
pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB size from 
sess */
pSMB->MaxSetupCount = 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: remove REQ_TYPE_ATA_CMD

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7267c3377443322588cddaf457cf106839a60463
Commit: 7267c3377443322588cddaf457cf106839a60463
Parent: 5a9e77af970f14a94482a6d4dca5c48efb70deb2
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:13 2008 +0100

ide: remove REQ_TYPE_ATA_CMD

Based on the earlier work by Tejun Heo.

All users are gone so we can finally remove it.

Cc: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c   |   98 ++--
 drivers/ide/ide-lib.c  |   25 +++-
 include/linux/blkdev.h |1 -
 3 files changed, 11 insertions(+), 113 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index cad057d..6f8f544 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -354,7 +354,6 @@ void ide_tf_read(ide_drive_t *drive, ide_task_t *task)
  
 void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
 {
-   ide_hwif_t *hwif = HWIF(drive);
unsigned long flags;
struct request *rq;
 
@@ -362,19 +361,7 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 
err)
rq = HWGROUP(drive)->rq;
spin_unlock_irqrestore(&ide_lock, flags);
 
-   if (rq->cmd_type == REQ_TYPE_ATA_CMD) {
-   u8 *args = (u8 *) rq->buffer;
-   if (rq->errors == 0)
-   rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
-
-   if (args) {
-   args[0] = stat;
-   args[1] = err;
-   /* be sure we're looking at the low order bits */
-   hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
-   args[2] = hwif->INB(IDE_NSECTOR_REG);
-   }
-   } else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
+   if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *args = (ide_task_t *) rq->special;
if (rq->errors == 0)
rq->errors = !OK_STAT(stat,READY_STAT,BAD_STAT);
@@ -624,48 +611,6 @@ ide_startstop_t ide_abort(ide_drive_t *drive, const char 
*msg)
return __ide_abort(drive, rq);
 }
 
-/**
- * drive_cmd_intr  -   drive command completion interrupt
- * @drive: drive the completion interrupt occurred on
- *
- * drive_cmd_intr() is invoked on completion of a special DRIVE_CMD.
- * We do any necessary data reading and then wait for the drive to
- * go non busy. At that point we may read the error data and complete
- * the request
- */
- 
-static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
-{
-   struct request *rq = HWGROUP(drive)->rq;
-   ide_hwif_t *hwif = HWIF(drive);
-   u8 *args = (u8 *)rq->buffer, pio_in = (args && args[3]) ? 1 : 0, stat;
-
-   if (pio_in) {
-   u8 io_32bit = drive->io_32bit;
-   stat = hwif->INB(IDE_STATUS_REG);
-   if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
-   if (stat & (ERR_STAT | DRQ_STAT))
-   return ide_error(drive, __FUNCTION__, stat);
-   ide_set_handler(drive, &drive_cmd_intr, WAIT_WORSTCASE,
-   NULL);
-   return ide_started;
-   }
-   drive->io_32bit = 0;
-   hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
-   drive->io_32bit = io_32bit;
-   stat = wait_drive_not_busy(drive);
-   } else {
-   local_irq_enable_in_hardirq();
-   stat = hwif->INB(IDE_STATUS_REG);
-   }
-
-   if (!OK_STAT(stat, (pio_in ? 0 : READY_STAT), BAD_STAT))
-   return ide_error(drive, __FUNCTION__, stat);
-   /* calls ide_end_drive_cmd */
-   ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG));
-   return ide_stopped;
-}
-
 static void ide_tf_set_specify_cmd(ide_drive_t *drive, struct ide_taskfile *tf)
 {
tf->nsect   = drive->sect;
@@ -851,16 +796,9 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t 
*drive,
struct request *rq)
 {
ide_hwif_t *hwif = HWIF(drive);
-   u8 *args = rq->buffer;
-   ide_task_t ltask;
-   struct ide_taskfile *tf = cmd_type == REQ_TYPE_ATA_TASKFILE) {
-   ide_task_t *task = rq->special;
- 
-   if (task == NULL)
-   goto done;
+   ide_task_t *task = rq->special;
 
+   if (task) {
hwif->data_phase = task->data_phase;
 
switch (hwif->data_phase) {
@@ -877,33 +815,6 @@ static ide_startstop_t execute_drive_cmd (ide_drive_t 
*drive,
return do_rw_taskfile(driv

ide: check BUSY and ERROR status bits before reading data in drive_cmd_intr()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d977e43d8ae758434e603cf2455d955f71c77c4
Commit: 4d977e43d8ae758434e603cf2455d955f71c77c4
Parent: 18a056feccabdfa9764016a615121b194828bc72
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:12 2008 +0100

ide: check BUSY and ERROR status bits before reading data in 
drive_cmd_intr()

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index dc6af24..ce8ab10 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -643,8 +643,13 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
if (pio_in) {
u8 io_32bit = drive->io_32bit;
stat = hwif->INB(IDE_STATUS_REG);
-   if ((stat & DRQ_STAT) == 0)
-   goto out;
+   if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
+   if (stat & (ERR_STAT | DRQ_STAT))
+   return ide_error(drive, __FUNCTION__, stat);
+   ide_set_handler(drive, &drive_cmd_intr, WAIT_WORSTCASE,
+   NULL);
+   return ide_started;
+   }
drive->io_32bit = 0;
hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
drive->io_32bit = io_32bit;
@@ -653,7 +658,7 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
local_irq_enable_in_hardirq();
stat = hwif->INB(IDE_STATUS_REG);
}
-out:
+
if (!OK_STAT(stat, READY_STAT, BAD_STAT))
return ide_error(drive, "drive_cmd", stat);
/* calls ide_end_drive_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


ide: don't enable local IRQs for PIO-in in driver_cmd_intr() (take 2)

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=18a056feccabdfa9764016a615121b194828bc72
Commit: 18a056feccabdfa9764016a615121b194828bc72
Parent: 852738f39258deafb3d89c187cb1a4050820d555
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:12 2008 +0100

ide: don't enable local IRQs for PIO-in in driver_cmd_intr() (take 2)

Don't enable local IRQs for PIO-in protocol in driver_cmd_intr().

While at it:

* Remove redundant rq->cmd_type check.

* Read status register after enabling local IRQs for no-data protocol.

v2:
* Re-add DRQ=1 check lost in v1 (noticed by Sergei).

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |   15 +--
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 8c98904..dc6af24 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -638,19 +638,22 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
 {
struct request *rq = HWGROUP(drive)->rq;
ide_hwif_t *hwif = HWIF(drive);
-   u8 *args = (u8 *) rq->buffer;
-   u8 stat = hwif->INB(IDE_STATUS_REG);
+   u8 *args = (u8 *)rq->buffer, pio_in = (args && args[3]) ? 1 : 0, stat;
 
-   local_irq_enable_in_hardirq();
-   if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
-   (stat & DRQ_STAT) && args && args[3]) {
+   if (pio_in) {
u8 io_32bit = drive->io_32bit;
+   stat = hwif->INB(IDE_STATUS_REG);
+   if ((stat & DRQ_STAT) == 0)
+   goto out;
drive->io_32bit = 0;
hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
drive->io_32bit = io_32bit;
stat = wait_drive_not_busy(drive);
+   } else {
+   local_irq_enable_in_hardirq();
+   stat = hwif->INB(IDE_STATUS_REG);
}
-
+out:
if (!OK_STAT(stat, READY_STAT, BAD_STAT))
return ide_error(drive, "drive_cmd", stat);
/* calls ide_end_drive_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


ide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILE

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=852738f39258deafb3d89c187cb1a4050820d555
Commit: 852738f39258deafb3d89c187cb1a4050820d555
Parent: 145b75e9aedbe36c55e45da8564dcd0814bdd89e
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:12 2008 +0100

ide: convert "empty" REQ_TYPE_ATA_CMD requests to use REQ_TYPE_ATA_TASKFILE

Based on the previous work by Tejun Heo.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-disk.c |4 +++-
 drivers/ide/ide-taskfile.c |2 +-
 drivers/ide/ide.c  |2 +-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 027bf43..717e114 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -620,8 +620,10 @@ static int set_multcount(ide_drive_t *drive, int arg)
 
if (drive->special.b.set_multmode)
return -EBUSY;
+
ide_init_drive_cmd (&rq);
-   rq.cmd_type = REQ_TYPE_ATA_CMD;
+   rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
+
drive->mult_req = arg;
drive->special.b.set_multmode = 1;
(void) ide_do_drive_cmd (drive, &rq, ide_wait);
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index b8c7e81..9404650 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -781,7 +781,7 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, 
unsigned long arg)
struct request rq;
 
ide_init_drive_cmd(&rq);
-   rq.cmd_type = REQ_TYPE_ATA_CMD;
+   rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
 
return ide_do_drive_cmd(drive, &rq, ide_wait);
}
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 446b128..97894ab 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -880,7 +880,7 @@ int set_pio_mode(ide_drive_t *drive, int arg)
return -EBUSY;
 
ide_init_drive_cmd(&rq);
-   rq.cmd_type = REQ_TYPE_ATA_CMD;
+   rq.cmd_type = REQ_TYPE_ATA_TASKFILE;
 
drive->tune_req = (u8) arg;
drive->special.b.set_tune = 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: initialize rq->cmd_type in ide_init_drive_cmd() callers

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=145b75e9aedbe36c55e45da8564dcd0814bdd89e
Commit: 145b75e9aedbe36c55e45da8564dcd0814bdd89e
Parent: 2624565caacedd740fce7803fe2c162842aa5df4
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:11 2008 +0100

ide: initialize rq->cmd_type in ide_init_drive_cmd() callers

* Initialize rq->cmd_type in ide_wait_cmd(), ide_cmd_ioctl() and
  set_pio_mode() (other callers were aleady over-riding rq->cmd_type).

* Remove no longer needed rq->cmd_type setup from ide_init_drive_cmd().

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c   |1 -
 drivers/ide/ide-taskfile.c |4 
 drivers/ide/ide.c  |3 +++
 3 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 513a568..8c98904 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -1672,7 +1672,6 @@ irqreturn_t ide_intr (int irq, void *dev_id)
 void ide_init_drive_cmd (struct request *rq)
 {
memset(rq, 0, sizeof(*rq));
-   rq->cmd_type = REQ_TYPE_ATA_CMD;
rq->ref_count = 1;
 }
 
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index b559bec..b8c7e81 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -759,6 +759,7 @@ int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 
feature, u8 sectors,
buf = buffer;
memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors);
ide_init_drive_cmd(&rq);
+   rq.cmd_type = REQ_TYPE_ATA_CMD;
rq.buffer = buf;
*buf++ = cmd;
*buf++ = nsect;
@@ -778,7 +779,10 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, 
unsigned long arg)
 
if (NULL == (void *) arg) {
struct request rq;
+
ide_init_drive_cmd(&rq);
+   rq.cmd_type = REQ_TYPE_ATA_CMD;
+
return ide_do_drive_cmd(drive, &rq, ide_wait);
}
 
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index 52115ef..446b128 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -878,7 +878,10 @@ int set_pio_mode(ide_drive_t *drive, int arg)
 
if (drive->special.b.set_tune)
return -EBUSY;
+
ide_init_drive_cmd(&rq);
+   rq.cmd_type = REQ_TYPE_ATA_CMD;
+
drive->tune_req = (u8) arg;
drive->special.b.set_tune = 1;
(void) ide_do_drive_cmd(drive, &rq, ide_wait);
-
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: use wait_drive_not_busy() in drive_cmd_intr() (take 2)

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2624565caacedd740fce7803fe2c162842aa5df4
Commit: 2624565caacedd740fce7803fe2c162842aa5df4
Parent: 4906f3b4cddc3e4d62955ed386598561f95602c0
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:11 2008 +0100

ide: use wait_drive_not_busy() in drive_cmd_intr() (take 2)

Use wait_drive_not_busy() in drive_cmd_intr().

v2:
* Fix wait_drive_not_busy() comment (noticed by Sergei).

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c   |4 +---
 drivers/ide/ide-taskfile.c |5 ++---
 include/linux/ide.h|2 ++
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 0f3e2f4..513a568 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -640,7 +640,6 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
ide_hwif_t *hwif = HWIF(drive);
u8 *args = (u8 *) rq->buffer;
u8 stat = hwif->INB(IDE_STATUS_REG);
-   int retries = 10;
 
local_irq_enable_in_hardirq();
if (rq->cmd_type == REQ_TYPE_ATA_CMD &&
@@ -649,8 +648,7 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
drive->io_32bit = 0;
hwif->ata_input_data(drive, &args[4], args[3] * SECTOR_WORDS);
drive->io_32bit = io_32bit;
-   while (((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT) && 
retries--)
-   udelay(100);
+   stat = wait_drive_not_busy(drive);
}
 
if (!OK_STAT(stat, READY_STAT, BAD_STAT))
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index c34836c..b559bec 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -260,7 +260,7 @@ static ide_startstop_t task_no_data_intr(ide_drive_t *drive)
return ide_stopped;
 }
 
-static u8 wait_drive_not_busy(ide_drive_t *drive)
+u8 wait_drive_not_busy(ide_drive_t *drive)
 {
ide_hwif_t *hwif = HWIF(drive);
int retries;
@@ -268,8 +268,7 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
 
/*
 * Last sector was transfered, wait until drive is ready.
-* This can take up to 10 usec, but we will wait max 1 ms
-* (drive_cmd_intr() waits that long).
+* This can take up to 10 usec, but we will wait max 1 ms.
 */
for (retries = 0; retries < 100; retries++) {
if ((stat = hwif->INB(IDE_STATUS_REG)) & BUSY_STAT)
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 7615a62..c889a6e 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -994,6 +994,8 @@ ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
 
 void task_end_request(ide_drive_t *, struct request *, u8);
 
+u8 wait_drive_not_busy(ide_drive_t *);
+
 int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
 int ide_no_data_taskfile(ide_drive_t *, ide_task_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


ide: kill DATA_READY define

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4906f3b4cddc3e4d62955ed386598561f95602c0
Commit: 4906f3b4cddc3e4d62955ed386598561f95602c0
Parent: 4d7a984bdcbdda69fc6b2a4a655415140270aa7b
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:11 2008 +0100

ide: kill DATA_READY define

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-taskfile.c |4 ++--
 include/linux/ide.h|1 -
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 17c2c04..c34836c 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -436,7 +436,7 @@ static ide_startstop_t task_in_intr(ide_drive_t *drive)
u8 stat = hwif->INB(IDE_STATUS_REG);
 
/* new way for dealing with premature shared PCI interrupts */
-   if (!OK_STAT(stat, DATA_READY, BAD_R_STAT)) {
+   if (!OK_STAT(stat, DRQ_STAT, BAD_R_STAT)) {
if (stat & (ERR_STAT | DRQ_STAT))
return task_error(drive, rq, __FUNCTION__, stat);
/* No data yet, so wait for another IRQ. */
@@ -493,7 +493,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t 
*drive, struct request *rq)
 {
ide_startstop_t startstop;
 
-   if (ide_wait_stat(&startstop, drive, DATA_READY,
+   if (ide_wait_stat(&startstop, drive, DRQ_STAT,
  drive->bad_wstat, WAIT_DRQ)) {
printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
drive->name,
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 6192564..7615a62 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -107,7 +107,6 @@ typedef unsigned char   byte;   /* used everywhere */
 #define BAD_W_STAT (BAD_R_STAT  | WRERR_STAT)
 #define BAD_STAT   (BAD_R_STAT  | DRQ_STAT)
 #define DRIVE_READY(READY_STAT  | SEEK_STAT)
-#define DATA_READY (DRQ_STAT)
 
 #define BAD_CRC(ABRT_ERR| ICRC_ERR)
 
-
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: remove needless ->cursg clearing from task_end_request()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=03c3c70ee541c91250e2bff57211d403cb0b7055
Commit: 03c3c70ee541c91250e2bff57211d403cb0b7055
Parent: 657cc1a8f6cd6a9e2974cba3af9fccd8c25e06ad
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:11 2008 +0100

ide: remove needless ->cursg clearing from task_end_request()

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-taskfile.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 1f664ea..b25d10b 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -410,8 +410,6 @@ static ide_startstop_t task_error(ide_drive_t *drive, 
struct request *rq,
 
 static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
 {
-   HWIF(drive)->cursg = NULL;
-
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
ide_task_t *task = rq->special;
 
-
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: set IDE_TFLAG_IN_* flags before queuing/executing command

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=657cc1a8f6cd6a9e2974cba3af9fccd8c25e06ad
Commit: 657cc1a8f6cd6a9e2974cba3af9fccd8c25e06ad
Parent: 3687221f28058c40e2c57a286decd0caeac67382
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:10 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:10 2008 +0100

ide: set IDE_TFLAG_IN_* flags before queuing/executing command

* Add IDE_TFLAG_{HOB,TF,DEVICE} defines.

* Set IDE_TFLAG_IN_* flags in {do_rw,ide_no_data,ide_raw}_taskfile() users.

* Remove no longer needed ->tf_flags setup from ide_end_drive_cmd().

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-acpi.c |2 +-
 drivers/ide/ide-disk.c |   24 
 drivers/ide/ide-io.c   |8 ++--
 drivers/ide/ide-taskfile.c |9 +
 include/linux/ide.h|6 ++
 5 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/drivers/ide/ide-acpi.c b/drivers/ide/ide-acpi.c
index e0bb0cf..e888fc3 100644
--- a/drivers/ide/ide-acpi.c
+++ b/drivers/ide/ide-acpi.c
@@ -386,7 +386,7 @@ static int taskfile_load_raw(ide_drive_t *drive,
 
/* convert gtf to IDE Taskfile */
memcpy(&args.tf_array[7], >f->tfa, 7);
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+   args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
 
if (ide_noacpitfs) {
DEBPRINT("_GTF execution disabled\n");
diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
index 041be43..027bf43 100644
--- a/drivers/ide/ide-disk.c
+++ b/drivers/ide/ide-disk.c
@@ -201,7 +201,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, 
struct request *rq,
 
memset(&task, 0, sizeof(task));
task.tf_flags = IDE_TFLAG_NO_SELECT_MASK;  /* FIXME? */
-   task.tf_flags |= (IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE);
+   task.tf_flags |= (IDE_TFLAG_TF | IDE_TFLAG_DEVICE);
 
if (drive->select.b.lba) {
if (lba48) {
@@ -220,7 +220,7 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, 
struct request *rq,
tf->lbam   = (u8)(block >>  8);
tf->lbah   = (u8)(block >> 16);
 
-   task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
+   task.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB);
} else {
tf->nsect  = nsectors & 0xff;
tf->lbal   = block;
@@ -314,9 +314,9 @@ static u64 idedisk_read_native_max_address(ide_drive_t 
*drive, int lba48)
else
tf->command = WIN_READ_NATIVE_MAX;
tf->device  = ATA_LBA;
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+   args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
if (lba48)
-   args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
+   args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB);
/* submit command request */
ide_no_data_taskfile(drive, &args);
 
@@ -353,9 +353,9 @@ static u64 idedisk_set_max_address(ide_drive_t *drive, u64 
addr_req, int lba48)
tf->command  = WIN_SET_MAX;
}
tf->device |= ATA_LBA;
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+   args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
if (lba48)
-   args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_OUT_HOB);
+   args.tf_flags |= (IDE_TFLAG_LBA48 | IDE_TFLAG_HOB);
/* submit command request */
ide_no_data_taskfile(drive, &args);
/* if OK, compute maximum address value */
@@ -495,7 +495,7 @@ static int smart_enable(ide_drive_t *drive)
tf->lbam= SMART_LCYL_PASS;
tf->lbah= SMART_HCYL_PASS;
tf->command = WIN_SMART;
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+   args.tf_flags = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
return ide_no_data_taskfile(drive, &args);
 }
 
@@ -510,7 +510,7 @@ static int get_smart_data(ide_drive_t *drive, u8 *buf, u8 
sub_cmd)
tf->lbam= SMART_LCYL_PASS;
tf->lbah= SMART_HCYL_PASS;
tf->command = WIN_SMART;
-   args.tf_flags   = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+   args.tf_flags   = IDE_TFLAG_TF | IDE_TFLAG_DEVICE;
args.data_phase = TASKFILE_IN;
(void) smart_enable(drive);
return ide_raw_taskfile(drive, &args, buf, 1);
@@ -689,7 +689,7 @@ static int write_cache(ide_drive_t *drive, int arg)
args.tf.feature = arg ?
SETFEATURES_EN_WCACHE : SETFEATURES_DIS_WCACHE;
args.tf.command = WIN_SETFEATURES;
-   args.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_OUT_DEVICE;
+   ar

ide: fix final status check in task_in_intr()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=73d7de0c818639cf74a32ce3b13a33021414749c
Commit: 73d7de0c818639cf74a32ce3b13a33021414749c
Parent: 49c746ee6cc791202172483277a249c12ba437d8
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:10 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:10 2008 +0100

ide: fix final status check in task_in_intr()

Check for DRQ bit being cleared on the final status check.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-taskfile.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index b72a9ae..bc3d8ae 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -454,7 +454,7 @@ static ide_startstop_t task_in_intr(ide_drive_t *drive)
/* If it was the last datablock check status and finish transfer. */
if (!hwif->nleft) {
stat = wait_drive_not_busy(drive);
-   if (!OK_STAT(stat, 0, BAD_R_STAT))
+   if (!OK_STAT(stat, 0, BAD_STAT))
return task_error(drive, rq, __FUNCTION__, stat);
task_end_request(drive, rq, stat);
return ide_stopped;
-
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: print banner message once per controller in m68k host drivers

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c99c92c58757985096e2d195dc1631246d99d686
Commit: c99c92c58757985096e2d195dc1631246d99d686
Parent: 81ca691981da718727281238b435dcf1528d2fda
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:09 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:09 2008 +0100

ide: print banner message once per controller in m68k host drivers

* Print banner message once per controller in m68k host drivers.

* Change printk() level to KERN_INFO in buddha, falconide and gayle.

* Add banner message to q40ide.

This is basically a preparation for the future IDE layer changes.

Cc: Geert Uytterhoeven <[EMAIL PROTECTED]>
Cc: Roman Zippel <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/legacy/buddha.c|   19 +--
 drivers/ide/legacy/falconide.c |4 ++--
 drivers/ide/legacy/gayle.c |   18 +++---
 drivers/ide/legacy/macide.c|   14 ++
 drivers/ide/legacy/q40ide.c|2 ++
 5 files changed, 22 insertions(+), 35 deletions(-)

diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index e97766a..74d28e0 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -112,6 +112,7 @@ typedef enum BuddhaType_Enum {
 BOARD_BUDDHA, BOARD_CATWEASEL, BOARD_XSURF
 } BuddhaType;
 
+static const char *buddha_board_name[] = { "Buddha", "Catweasel", "X-Surf" };
 
 /*
  *  Check and acknowledge the interrupt status
@@ -197,7 +198,10 @@ fail_base2:
/* X-Surf doesn't have this.  IRQs are always on */
if (type != BOARD_XSURF)
z_writeb(0, buddha_board+BUDDHA_IRQ_MR);
-   
+
+   printk(KERN_INFO "ide: %s IDE controller\n",
+buddha_board_name[type]);
+
for(i=0;immio = 1;
-   printk("ide%d: ", index);
-   switch(type) {
-   case BOARD_BUDDHA:
-   printk("Buddha");
-   break;
-   case BOARD_CATWEASEL:
-   printk("Catweasel");
-   break;
-   case BOARD_XSURF:
-   printk("X-Surf");
-   break;
-   }
-   printk(" IDE interface\n");
 
idx[i] = index;
}
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index dec2ef9..2860956 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -67,6 +67,8 @@ static int __init falconide_init(void)
 if (MACH_IS_ATARI && ATARIHW_PRESENT(IDE)) {
hw_regs_t hw;
 
+   printk(KERN_INFO "ide: Falcon IDE controller\n");
+
ide_setup_ports(&hw, ATA_HD_BASE, falconide_offsets,
0, 0, NULL,
 // falconide_iops,
@@ -80,8 +82,6 @@ static int __init falconide_init(void)
ide_init_port_data(hwif, index);
ide_init_port_hw(hwif, &hw);
 
-   printk("ide%d: Falcon IDE interface\n", index);
-
ide_device_add(idx);
}
 }
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index e21ef75..492fa04 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -129,6 +129,13 @@ static int __init gayle_init(void)
 return -ENODEV;
 
 found:
+   printk(KERN_INFO "ide: Gayle IDE controller (A%d style%s)\n",
+a4000 ? 4000 : 1200,
+#ifdef CONFIG_BLK_DEV_IDEDOUBLER
+ide_doubler ? ", IDE doubler" :
+#endif
+"");
+
 for (i = 0; i < GAYLE_NUM_PROBE_HWIFS; i++) {
unsigned long base, ctrlport, irqport;
ide_ack_intr_t *ack_intr;
@@ -173,17 +180,6 @@ found:
ide_init_port_hw(hwif, &hw);
 
hwif->mmio = 1;
-   switch (i) {
-   case 0:
-   printk("ide%d: Gayle IDE interface (A%d style)\n", index,
-  a4000 ? 4000 : 1200);
-   break;
-#ifdef CONFIG_BLK_DEV_IDEDOUBLER
-   case 1:
-   printk("ide%d: IDE doubler\n", index);
-   break;
-#endif /* CONFIG_BLK_DEV_IDEDOUBLER */
-   }
 
idx[i] = index;
} else
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 6b3e960..782d4c7 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -77,6 +77,9 @@ int macide_ack_intr(ide_hwif_t* hwif)
 

ide: add ide_set_irq() inline helper

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=81ca691981da718727281238b435dcf1528d2fda
Commit: 81ca691981da718727281238b435dcf1528d2fda
Parent: 4f52a32994f9e05fb8ae1a9ba3f20cd0b55145b7
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:08 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:08 2008 +0100

ide: add ide_set_irq() inline helper

There should be no functionality changes caused by this patch.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c   |9 +++--
 drivers/ide/ide-iops.c |   10 --
 drivers/ide/ide-probe.c|   12 
 drivers/ide/ide-taskfile.c |3 +--
 include/linux/ide.h|5 +
 5 files changed, 17 insertions(+), 22 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index e37b09c..5b213dc 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -939,8 +939,7 @@ static void ide_check_pm_state(ide_drive_t *drive, struct 
request *rq)
if (rc)
printk(KERN_WARNING "%s: bus not ready on wakeup\n", 
drive->name);
SELECT_DRIVE(drive);
-   if (IDE_CONTROL_REG)
-   HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
+   ide_set_irq(drive, 1);
rc = ide_wait_not_busy(HWIF(drive), 10);
if (rc)
printk(KERN_WARNING "%s: drive not ready on wakeup\n", 
drive->name);
@@ -1213,15 +1212,13 @@ static void ide_do_request (ide_hwgroup_t *hwgroup, int 
masked_irq)
}
again:
hwif = HWIF(drive);
-   if (hwgroup->hwif->sharing_irq &&
-   hwif != hwgroup->hwif &&
-   hwif->io_ports[IDE_CONTROL_OFFSET]) {
+   if (hwgroup->hwif->sharing_irq && hwif != hwgroup->hwif) {
/*
 * set nIEN for previous hwif, drives in the
 * quirk_list may not like intr setups/cleanups
 */
if (drive->quirk_list != 1)
-   hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG);
+   ide_set_irq(drive, 0);
}
hwgroup->hwif = hwif;
hwgroup->drive = drive;
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index 595a5ce..a26c9ca 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -688,8 +688,7 @@ int ide_driveid_update(ide_drive_t *drive)
 */
 
SELECT_MASK(drive, 1);
-   if (IDE_CONTROL_REG)
-   hwif->OUTB(drive->ctl,IDE_CONTROL_REG);
+   ide_set_irq(drive, 1);
msleep(50);
hwif->OUTB(WIN_IDENTIFY, IDE_COMMAND_REG);
timeout = jiffies + WAIT_WORSTCASE;
@@ -772,13 +771,12 @@ int ide_config_drive_speed(ide_drive_t *drive, u8 speed)
SELECT_DRIVE(drive);
SELECT_MASK(drive, 0);
udelay(1);
-   if (IDE_CONTROL_REG)
-   hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG);
+   ide_set_irq(drive, 0);
hwif->OUTB(speed, IDE_NSECTOR_REG);
hwif->OUTB(SETFEATURES_XFER, IDE_FEATURE_REG);
hwif->OUTBSYNC(drive, WIN_SETFEATURES, IDE_COMMAND_REG);
-   if ((IDE_CONTROL_REG) && (drive->quirk_list == 2))
-   hwif->OUTB(drive->ctl, IDE_CONTROL_REG);
+   if (drive->quirk_list == 2)
+   ide_set_irq(drive, 1);
 
error = __ide_wait_stat(drive, drive->ready_stat,
BUSY_STAT|DRQ_STAT|ERR_STAT,
diff --git a/drivers/ide/ide-probe.c b/drivers/ide/ide-probe.c
index 18e9b82..9d9f1c6 100644
--- a/drivers/ide/ide-probe.c
+++ b/drivers/ide/ide-probe.c
@@ -350,22 +350,19 @@ static int try_to_identify (ide_drive_t *drive, u8 cmd)
 * the irq handler isn't expecting.
 */
if (IDE_CONTROL_REG) {
-   u8 ctl = drive->ctl | 2;
if (!hwif->irq) {
autoprobe = 1;
cookie = probe_irq_on();
-   /* enable device irq */
-   ctl &= ~2;
}
-   hwif->OUTB(ctl, IDE_CONTROL_REG);
+   ide_set_irq(drive, autoprobe);
}
 
retval = actual_try_to_identify(drive, cmd);
 
if (autoprobe) {
int irq;
-   /* mask device irq */
-   hwif->OUTB(drive->ctl|2, IDE_CONTROL_REG);
+
+   ide_set_irq(drive, 0);
/* clear drive IRQ */
(void) hwif->INB(IDE_STATUS_REG);
udelay(5);
@@ -653,8 +650,7 @@ static int wait_hwif_ready(ide_hwif_t *hwif)
/* Ignore disks that we will not probe for later. */
if (!drive->noprobe || drive->present) {
SELECT_DRIV

ide-pmac: use custom hwif->sg_max_nents only if DMA support is enabled

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4f52a32994f9e05fb8ae1a9ba3f20cd0b55145b7
Commit: 4f52a32994f9e05fb8ae1a9ba3f20cd0b55145b7
Parent: ce635f605e52a0d47aea5313ba406ada20e6028a
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:08 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:08 2008 +0100

ide-pmac: use custom hwif->sg_max_nents only if DMA support is enabled

Move setting hwif->sg_max_nents from pmac_ide_setup_device()
to pmac_ide_setup_dma().

Acked-by: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ppc/pmac.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index cd51474..736d12c 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -1133,8 +1133,6 @@ pmac_ide_setup_device(pmac_ide_hwif_t *pmif, ide_hwif_t 
*hwif, hw_regs_t *hw)
hwif->noprobe = 0;
 #endif /* CONFIG_PMAC_MEDIABAY */
 
-   hwif->sg_max_nents = MAX_DCMDS;
-
 #ifdef CONFIG_BLK_DEV_IDEDMA_PMAC
/* has a DBDMA controller channel */
if (pmif->dma_regs)
@@ -1751,6 +1749,8 @@ pmac_ide_setup_dma(pmac_ide_hwif_t *pmif, ide_hwif_t 
*hwif)
return;
}
 
+   hwif->sg_max_nents = MAX_DCMDS;
+
hwif->dma_host_set = &pmac_ide_dma_host_set;
hwif->dma_setup = &pmac_ide_dma_setup;
hwif->dma_exec_cmd = &pmac_ide_dma_exec_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


rapide: remove write-only hwif->hwif_data

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ce635f605e52a0d47aea5313ba406ada20e6028a
Commit: ce635f605e52a0d47aea5313ba406ada20e6028a
Parent: 79127c37aa5d959c9ace40a869386f712b55ac6d
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:08 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:08 2008 +0100

rapide: remove write-only hwif->hwif_data

Cc: Russell King <[EMAIL PROTECTED]>
Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/rapide.c |2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 0267467..e6b56d1 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -58,8 +58,6 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id 
*id)
hwif->mmio = 1;
default_hwif_mmiops(hwif);
 
-   hwif->hwif_data = base;
-
idx[0] = hwif->index;
 
ide_device_add(idx);
-
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


au1xxx-ide: use ide_init_port_hw()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aa79a2faa01ded0a6a4929dd37c059bef4890838
Commit: aa79a2faa01ded0a6a4929dd37c059bef4890838
Parent: a42bcc0f2fc380fac81a7ac525a70bbef44bb042
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:08 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:08 2008 +0100

au1xxx-ide: use ide_init_port_hw()

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/mips/au1xxx-ide.c |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index e1f5356..2d3e511 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -625,12 +625,13 @@ static int au_ide_probe(struct device *dev)
/* FIXME:  This might possibly break PCMCIA IDE devices */
 
hwif= &ide_hwifs[pdev->id];
-   hwif->irq   = ahwif->irq;
-   hwif->chipset   = ide_au1xxx;
 
memset(&hw, 0, sizeof(hw));
auide_setup_ports(&hw, ahwif);
-   memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
+   hw.irq = ahwif->irq;
+   hw.chipset = ide_au1xxx;
+
+   ide_init_port_hw(hwif, &hw);
 
hwif->ultra_mask= 0x0;  /* Disable Ultra DMA */
 #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA
@@ -644,7 +645,6 @@ static int au_ide_probe(struct device *dev)
hwif->pio_mask = ATA_PIO4;
hwif->host_flags = IDE_HFLAG_POST_SET_MODE;
 
-   hwif->noprobe = 0;
hwif->drives[0].unmask  = 1;
hwif->drives[1].unmask  = 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


au1xxx-ide: au_ide_probe() fixes

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a42bcc0f2fc380fac81a7ac525a70bbef44bb042
Commit: a42bcc0f2fc380fac81a7ac525a70bbef44bb042
Parent: ade2daf9c6e57845fe83a24e0a9fa1c03c6e91b1
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:07 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:07 2008 +0100

au1xxx-ide: au_ide_probe() fixes

* hwif->hold is always set in au_ide_probe() (few lines earlier),
  no need to set it again

* hwif->{channel,select_data,config_data} should be always zero

* autotune PIO also if CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA is defined

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/mips/au1xxx-ide.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c
index 27abff6..e1f5356 100644
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -677,15 +677,14 @@ static int au_ide_probe(struct device *dev)
hwif->dma_setup = &auide_dma_setup;
hwif->ide_dma_test_irq  = &auide_dma_test_irq;
hwif->dma_lost_irq  = &auide_dma_lost_irq;
-#else /* !CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */
+#endif
hwif->channel   = 0;
-   hwif->hold  = 1;
hwif->select_data   = 0;/* no chipset-specific code */
hwif->config_data   = 0;/* no chipset-specific code */
 
hwif->drives[0].autotune= 1;/* 1=autotune, 2=noautotune, 
0=default */
hwif->drives[1].autotune= 1;
-#endif
+
hwif->drives[0].no_io_32bit = 1;
hwif->drives[1].no_io_32bit = 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


[S390] replace lock_cpu_hotplug with get_online_cpus

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9d40d2e3955185b69c264583d080eb3defcb05a0
Commit: 9d40d2e3955185b69c264583d080eb3defcb05a0
Parent: 361f494d4e62ee5f7a971bf34945deeb69392159
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:31 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:33 2008 +0100

[S390] replace lock_cpu_hotplug with get_online_cpus

Git commit 86ef5c9a8edd78e6bf92879f32329d89b2d55b5a forgot a few
lock_cpu_hotplug/unlock_cpu_hotplug pairs in arch/s390/kernel/smp.c

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/smp.c |   12 ++--
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index f66db71..aa37fa1 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -568,9 +568,9 @@ static void __init smp_detect_cpus(void)
 out:
kfree(info);
printk(KERN_INFO "CPUs: %d configured, %d standby\n", c_cpus, s_cpus);
-   lock_cpu_hotplug();
+   get_online_cpus();
smp_rescan_cpus();
-   unlock_cpu_hotplug();
+   put_online_cpus();
 }
 
 /*
@@ -872,7 +872,7 @@ static ssize_t cpu_configure_store(struct sys_device *dev, 
const char *buf,
return -EINVAL;
 
mutex_lock(&smp_cpu_state_mutex);
-   lock_cpu_hotplug();
+   get_online_cpus();
rc = -EBUSY;
if (cpu_online(cpu))
goto out;
@@ -896,7 +896,7 @@ static ssize_t cpu_configure_store(struct sys_device *dev, 
const char *buf,
break;
}
 out:
-   unlock_cpu_hotplug();
+   put_online_cpus();
mutex_unlock(&smp_cpu_state_mutex);
return rc ? rc : count;
 }
@@ -1044,7 +1044,7 @@ static ssize_t rescan_store(struct sys_device *dev, const 
char *buf,
int rc;
 
mutex_lock(&smp_cpu_state_mutex);
-   lock_cpu_hotplug();
+   get_online_cpus();
newcpus = cpu_present_map;
rc = smp_rescan_cpus();
if (rc)
@@ -1057,7 +1057,7 @@ static ssize_t rescan_store(struct sys_device *dev, const 
char *buf,
}
rc = 0;
 out:
-   unlock_cpu_hotplug();
+   put_online_cpus();
mutex_unlock(&smp_cpu_state_mutex);
return rc ? rc : count;
 }
-
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


[S390] usage of s390dbf: shrink number of debug areas to use.

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=361f494d4e62ee5f7a971bf34945deeb69392159
Commit: 361f494d4e62ee5f7a971bf34945deeb69392159
Parent: 5c81cdbeff72e7fc2eb62ee5dc26197e54f9a06c
Author: Peter Tiedemann <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:30 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:33 2008 +0100

[S390] usage of s390dbf: shrink number of debug areas to use.

Signed-off-by: Peter Tiedemann <[EMAIL PROTECTED]>
---
 drivers/s390/block/dasd.c |4 ++--
 drivers/s390/cio/cio.c|6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 99268b9..1db15f3 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -214,7 +214,7 @@ static int dasd_state_known_to_basic(struct dasd_device 
*device)
return rc;
}
/* register 'device' debug area, used for all DBF_DEV_XXX calls */
-   device->debug_area = debug_register(device->cdev->dev.bus_id, 1, 2,
+   device->debug_area = debug_register(device->cdev->dev.bus_id, 1, 1,
8 * sizeof(long));
debug_register_view(device->debug_area, &debug_sprintf_view);
debug_set_level(device->debug_area, DBF_WARNING);
@@ -2435,7 +2435,7 @@ static int __init dasd_init(void)
init_waitqueue_head(&dasd_flush_wq);
 
/* register 'common' DASD debug area, used for all DBF_XXX calls */
-   dasd_debug_area = debug_register("dasd", 1, 2, 8 * sizeof(long));
+   dasd_debug_area = debug_register("dasd", 1, 1, 8 * sizeof(long));
if (dasd_debug_area == NULL) {
rc = -ENOMEM;
goto failed;
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
index 11f632f..60590a1 100644
--- a/drivers/s390/cio/cio.c
+++ b/drivers/s390/cio/cio.c
@@ -64,17 +64,17 @@ __setup ("cio_msg=", cio_setup);
  */
 static int __init cio_debug_init(void)
 {
-   cio_debug_msg_id = debug_register("cio_msg", 16, 4, 16 * sizeof(long));
+   cio_debug_msg_id = debug_register("cio_msg", 16, 1, 16 * sizeof(long));
if (!cio_debug_msg_id)
goto out_unregister;
debug_register_view(cio_debug_msg_id, &debug_sprintf_view);
debug_set_level(cio_debug_msg_id, 2);
-   cio_debug_trace_id = debug_register("cio_trace", 16, 4, 16);
+   cio_debug_trace_id = debug_register("cio_trace", 16, 1, 16);
if (!cio_debug_trace_id)
goto out_unregister;
debug_register_view(cio_debug_trace_id, &debug_hex_ascii_view);
debug_set_level(cio_debug_trace_id, 2);
-   cio_debug_crw_id = debug_register("cio_crw", 16, 4, 16 * sizeof(long));
+   cio_debug_crw_id = debug_register("cio_crw", 16, 1, 16 * sizeof(long));
if (!cio_debug_crw_id)
goto out_unregister;
debug_register_view(cio_debug_crw_id, &debug_sprintf_view);
-
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


[S390] constify function pointer tables.

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5c81cdbeff72e7fc2eb62ee5dc26197e54f9a06c
Commit: 5c81cdbeff72e7fc2eb62ee5dc26197e54f9a06c
Parent: 894cdde26b538c77b9943bc72f0570abf6e58e37
Author: Jan Engelhardt <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:29 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:32 2008 +0100

[S390] constify function pointer tables.

Signed-off-by: Jan Engelhardt <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/crypto/prng.c|2 +-
 arch/s390/kernel/setup.c   |2 +-
 drivers/s390/block/dasd_proc.c |2 +-
 drivers/s390/char/tape_proc.c  |2 +-
 drivers/s390/char/vmur.c   |2 +-
 drivers/s390/char/zcore.c  |2 +-
 drivers/s390/cio/blacklist.c   |2 +-
 drivers/s390/net/qeth_proc.c   |4 ++--
 8 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/s390/crypto/prng.c b/arch/s390/crypto/prng.c
index 23ed094..0cfefdd 100644
--- a/arch/s390/crypto/prng.c
+++ b/arch/s390/crypto/prng.c
@@ -146,7 +146,7 @@ static ssize_t prng_read(struct file *file, char __user 
*ubuf, size_t nbytes,
return ret;
 }
 
-static struct file_operations prng_fops = {
+static const struct file_operations prng_fops = {
.owner  = THIS_MODULE,
.open   = &prng_open,
.release= NULL,
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
index fcebf64..766c783 100644
--- a/arch/s390/kernel/setup.c
+++ b/arch/s390/kernel/setup.c
@@ -917,7 +917,7 @@ static void *c_next(struct seq_file *m, void *v, loff_t 
*pos)
 static void c_stop(struct seq_file *m, void *v)
 {
 }
-struct seq_operations cpuinfo_op = {
+const struct seq_operations cpuinfo_op = {
.start  = c_start,
.next   = c_next,
.stop   = c_stop,
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c
index 0584a7d..28a86f0 100644
--- a/drivers/s390/block/dasd_proc.c
+++ b/drivers/s390/block/dasd_proc.c
@@ -142,7 +142,7 @@ static void dasd_devices_stop(struct seq_file *m, void *v)
 {
 }
 
-static struct seq_operations dasd_devices_seq_ops = {
+static const struct seq_operations dasd_devices_seq_ops = {
.start  = dasd_devices_start,
.next   = dasd_devices_next,
.stop   = dasd_devices_stop,
diff --git a/drivers/s390/char/tape_proc.c b/drivers/s390/char/tape_proc.c
index cea49f0..c9b96d5 100644
--- a/drivers/s390/char/tape_proc.c
+++ b/drivers/s390/char/tape_proc.c
@@ -97,7 +97,7 @@ static void tape_proc_stop(struct seq_file *m, void *v)
 {
 }
 
-static struct seq_operations tape_proc_seq = {
+static const struct seq_operations tape_proc_seq = {
.start  = tape_proc_start,
.next   = tape_proc_next,
.stop   = tape_proc_stop,
diff --git a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
index d70a6e6..7689b50 100644
--- a/drivers/s390/char/vmur.c
+++ b/drivers/s390/char/vmur.c
@@ -759,7 +759,7 @@ static loff_t ur_llseek(struct file *file, loff_t offset, 
int whence)
return newpos;
 }
 
-static struct file_operations ur_fops = {
+static const struct file_operations ur_fops = {
.owner   = THIS_MODULE,
.open= ur_open,
.release = ur_release,
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c
index 7073daf..f523501 100644
--- a/drivers/s390/char/zcore.c
+++ b/drivers/s390/char/zcore.c
@@ -470,7 +470,7 @@ static loff_t zcore_lseek(struct file *file, loff_t offset, 
int orig)
return rc;
 }
 
-static struct file_operations zcore_fops = {
+static const struct file_operations zcore_fops = {
.owner  = THIS_MODULE,
.llseek = zcore_lseek,
.read   = zcore_read,
diff --git a/drivers/s390/cio/blacklist.c b/drivers/s390/cio/blacklist.c
index bd5f16f..e8597ec 100644
--- a/drivers/s390/cio/blacklist.c
+++ b/drivers/s390/cio/blacklist.c
@@ -348,7 +348,7 @@ cio_ignore_write(struct file *file, const char __user 
*user_buf,
return user_len;
 }
 
-static struct seq_operations cio_ignore_proc_seq_ops = {
+static const struct seq_operations cio_ignore_proc_seq_ops = {
.start = cio_ignore_proc_seq_start,
.stop  = cio_ignore_proc_seq_stop,
.next  = cio_ignore_proc_seq_next,
diff --git a/drivers/s390/net/qeth_proc.c b/drivers/s390/net/qeth_proc.c
index f1ff165..46ecd03 100644
--- a/drivers/s390/net/qeth_proc.c
+++ b/drivers/s390/net/qeth_proc.c
@@ -146,7 +146,7 @@ qeth_procfile_seq_show(struct seq_file *s, void *it)
return 0;
 }
 
-static struct seq_operations qeth_procfile_seq_ops = {
+static const struct seq_operations qeth_procfile_seq_ops = {
.start = qeth_procfile_seq_start,
.stop  = qeth_procfile_seq_stop,
.next  = qeth_procfile_seq_next,
@@ -264,7 +264,7 @@ qeth_perf_procfile_seq_show(struct seq_file *s, void

[S390] do local_irq_restore while spinning in spin_lock_irqsave.

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=894cdde26b538c77b9943bc72f0570abf6e58e37
Commit: 894cdde26b538c77b9943bc72f0570abf6e58e37
Parent: dab5209cd878c146d9f6923f061d1c2725ff210f
Author: Hisashi Hifumi <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:28 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:31 2008 +0100

[S390] do local_irq_restore while spinning in spin_lock_irqsave.

In s390's spin_lock_irqsave, interrupts remain disabled while
spinning. In other architectures like x86 and powerpc, interrupts are
re-enabled while spinning if IRQ is not masked before spin_lock_irqsave
is called.

The following patch re-enables interrupts through local_irq_restore
while spinning for a lock acquisition.
This can improve system response.

[EMAIL PROTECTED]: removed saving of pc]

Signed-off-by: Hisashi Hifumi <[EMAIL PROTECTED]>
Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/lib/spinlock.c|   23 +++
 include/asm-s390/spinlock.h |   13 -
 2 files changed, 35 insertions(+), 1 deletions(-)

diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index 59c56c3..e41f400 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -59,6 +59,29 @@ void _raw_spin_lock_wait(raw_spinlock_t *lp)
 }
 EXPORT_SYMBOL(_raw_spin_lock_wait);
 
+void _raw_spin_lock_wait_flags(raw_spinlock_t *lp, unsigned long flags)
+{
+   int count = spin_retry;
+   unsigned int cpu = ~smp_processor_id();
+
+   local_irq_restore(flags);
+   while (1) {
+   if (count-- <= 0) {
+   unsigned int owner = lp->owner_cpu;
+   if (owner != 0)
+   _raw_yield_cpu(~owner);
+   count = spin_retry;
+   }
+   if (__raw_spin_is_locked(lp))
+   continue;
+   local_irq_disable();
+   if (_raw_compare_and_swap(&lp->owner_cpu, 0, cpu) == 0)
+   return;
+   local_irq_restore(flags);
+   }
+}
+EXPORT_SYMBOL(_raw_spin_lock_wait_flags);
+
 int _raw_spin_trylock_retry(raw_spinlock_t *lp)
 {
unsigned int cpu = ~smp_processor_id();
diff --git a/include/asm-s390/spinlock.h b/include/asm-s390/spinlock.h
index c1d6e7e..df84ae9 100644
--- a/include/asm-s390/spinlock.h
+++ b/include/asm-s390/spinlock.h
@@ -53,12 +53,12 @@ _raw_compare_and_swap(volatile unsigned int *lock,
  */
 
 #define __raw_spin_is_locked(x) ((x)->owner_cpu != 0)
-#define __raw_spin_lock_flags(lock, flags) __raw_spin_lock(lock)
 #define __raw_spin_unlock_wait(lock) \
do { while (__raw_spin_is_locked(lock)) \
 _raw_spin_relax(lock); } while (0)
 
 extern void _raw_spin_lock_wait(raw_spinlock_t *);
+extern void _raw_spin_lock_wait_flags(raw_spinlock_t *, unsigned long flags);
 extern int _raw_spin_trylock_retry(raw_spinlock_t *);
 extern void _raw_spin_relax(raw_spinlock_t *lock);
 
@@ -72,6 +72,17 @@ static inline void __raw_spin_lock(raw_spinlock_t *lp)
_raw_spin_lock_wait(lp);
 }
 
+static inline void __raw_spin_lock_flags(raw_spinlock_t *lp,
+unsigned long flags)
+{
+   int old;
+
+   old = _raw_compare_and_swap(&lp->owner_cpu, 0, ~smp_processor_id());
+   if (likely(old == 0))
+   return;
+   _raw_spin_lock_wait_flags(lp, flags);
+}
+
 static inline int __raw_spin_trylock(raw_spinlock_t *lp)
 {
int old;
-
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


[S390] dasd: fix loop in request expiration handling

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7dc1da9ffae5a344f7115d019e2be069d3e1bb8d
Commit: 7dc1da9ffae5a344f7115d019e2be069d3e1bb8d
Parent: 028fed8233b669e03def295a4e632b1b933720f9
Author: Stefan Haberland <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:26 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:30 2008 +0100

[S390] dasd: fix loop in request expiration handling

Add time to the 'expires' value to avoid a loop caused by the cqr
termination function

Signed-off-by: Stefan Haberland <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 drivers/s390/block/dasd.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index db9193d..99268b9 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1197,12 +1197,13 @@ static void __dasd_device_check_expire(struct 
dasd_device *device)
(time_after_eq(jiffies, cqr->expires + cqr->starttime))) {
if (device->discipline->term_IO(cqr) != 0) {
/* Hmpf, try again in 5 sec */
-   dasd_device_set_timer(device, 5*HZ);
DEV_MESSAGE(KERN_ERR, device,
"internal error - timeout (%is) expired "
"for cqr %p, termination failed, "
"retrying in 5s",
(cqr->expires/HZ), cqr);
+   cqr->expires += 5*HZ;
+   dasd_device_set_timer(device, 5*HZ);
} else {
DEV_MESSAGE(KERN_ERR, device,
"internal error - timeout (%is) expired "
-
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


[S390] Remove TOPDIR from Makefile

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=53360fb19672e9ca94d769694a18f46f6e0612a9
Commit: 53360fb19672e9ca94d769694a18f46f6e0612a9
Parent: 8e09f21574ea3028d5629e5de759e0b196c690c5
Author: WANG Cong <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:24 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:29 2008 +0100

[S390] Remove TOPDIR from Makefile

This patch removes TOPDIR from arch/s390/kernel/Makefile.

Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: WANG Cong <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/Makefile |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/arch/s390/kernel/Makefile b/arch/s390/kernel/Makefile
index 56cb710..b3b650a 100644
--- a/arch/s390/kernel/Makefile
+++ b/arch/s390/kernel/Makefile
@@ -31,7 +31,3 @@ S390_KEXEC_OBJS := machine_kexec.o crash.o
 S390_KEXEC_OBJS += $(if $(CONFIG_64BIT),relocate_kernel64.o,relocate_kernel.o)
 obj-$(CONFIG_KEXEC) += $(S390_KEXEC_OBJS)
 
-#
-# This is just to get the dependencies...
-#
-binfmt_elf32.o:$(TOPDIR)/fs/binfmt_elf.c
-
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


[S390] Unused field / extern declaration in processor.h

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=028fed8233b669e03def295a4e632b1b933720f9
Commit: 028fed8233b669e03def295a4e632b1b933720f9
Parent: 53360fb19672e9ca94d769694a18f46f6e0612a9
Author: Martin Schwidefsky <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:25 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:29 2008 +0100

[S390] Unused field / extern declaration in processor.h

Remove extern declaration of non-existent last_task_used_math and
remove unused field error_code from the thread_struct.

Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 include/asm-s390/processor.h |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h
index 21d40a1..c86b982 100644
--- a/include/asm-s390/processor.h
+++ b/include/asm-s390/processor.h
@@ -59,9 +59,6 @@ extern void s390_adjust_jiffies(void);
 extern void print_cpu_info(struct cpuinfo_S390 *);
 extern int get_cpu_capability(unsigned int *);
 
-/* Lazy FPU handling on uni-processor */
-extern struct task_struct *last_task_used_math;
-
 /*
  * User space process size: 2GB for 31 bit, 4TB for 64 bit.
  */
@@ -95,7 +92,6 @@ struct thread_struct {
 unsigned long ksp;  /* kernel stack pointer */
mm_segment_t mm_segment;
 unsigned long prot_addr;/* address of protection-excep. */
-unsigned int error_code;/* error-code of last prog-excep.   */
 unsigned int trap_no;
 per_struct per_info;
/* Used to give failing instruction back to user for ieee exceptions */
-
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


[S390] add smp_call_function_mask

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=dab5209cd878c146d9f6923f061d1c2725ff210f
Commit: dab5209cd878c146d9f6923f061d1c2725ff210f
Parent: 7dc1da9ffae5a344f7115d019e2be069d3e1bb8d
Author: Carsten Otte <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 14:11:27 2008 +0100
Committer:  Martin Schwidefsky <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 14:11:31 2008 +0100

[S390] add smp_call_function_mask

This patch adds the s390 variant for smp_call_function_mask(). The
implementation is pretty straight forward using the wrapper
__smp_call_function_map() which already takes a cpumask_t argument.

Signed-off-by: Carsten Otte <[EMAIL PROTECTED]>
Signed-off-by: Martin Schwidefsky <[EMAIL PROTECTED]>
---
 arch/s390/kernel/smp.c |   27 +++
 include/asm-s390/smp.h |2 ++
 2 files changed, 29 insertions(+), 0 deletions(-)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 040406d..f66db71 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -210,6 +210,33 @@ int smp_call_function_single(int cpu, void (*func) (void 
*info), void *info,
 }
 EXPORT_SYMBOL(smp_call_function_single);
 
+/**
+ * smp_call_function_mask(): Run a function on a set of other CPUs.
+ * @mask: The set of cpus to run on.  Must not include the current cpu.
+ * @func: The function to run. This must be fast and non-blocking.
+ * @info: An arbitrary pointer to pass to the function.
+ * @wait: If true, wait (atomically) until function has completed on other 
CPUs.
+ *
+ * Returns 0 on success, else a negative status code.
+ *
+ * If @wait is true, then returns once @func has returned; otherwise
+ * it returns just before the target cpu calls @func.
+ *
+ * You must not call this function with disabled interrupts or from a
+ * hardware interrupt handler or from a bottom half handler.
+ */
+int
+smp_call_function_mask(cpumask_t mask,
+   void (*func)(void *), void *info,
+   int wait)
+{
+   preempt_disable();
+   __smp_call_function_map(func, info, 0, wait, mask);
+   preempt_enable();
+   return 0;
+}
+EXPORT_SYMBOL(smp_call_function_mask);
+
 void smp_send_stop(void)
 {
int cpu, rc;
diff --git a/include/asm-s390/smp.h b/include/asm-s390/smp.h
index 218454b..c7b7432 100644
--- a/include/asm-s390/smp.h
+++ b/include/asm-s390/smp.h
@@ -90,6 +90,8 @@ extern void __cpu_die (unsigned int cpu);
 extern void cpu_die (void) __attribute__ ((noreturn));
 extern int __cpu_up (unsigned int cpu);
 
+extern int smp_call_function_mask(cpumask_t mask, void (*func)(void *),
+   void *info, int wait);
 #endif
 
 #ifndef CONFIG_SMP
-
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: fix host drivers depending on ide_generic to probe for interfaces (take 2)

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8ac4ce742c66100931b6f2d7a36b0df08bc721fe
Commit: 8ac4ce742c66100931b6f2d7a36b0df08bc721fe
Parent: ac87e41116c229fc1efaac0d17fdbfb2185e4629
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:06 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:06 2008 +0100

ide: fix host drivers depending on ide_generic to probe for interfaces 
(take 2)

* Add mpc8xx_ide_probe() to mpc8xx.c and call it from probe_for_hwifs().

* Convert ide_arm, ide-cris, ide-h8300, ide-pnp, buddha, falconide, gayle,
  macide, q40ide, cmd640 and mpc8xx host drivers to use ide_device_add().

  This removes dependency on ide_generic for these drivers so update
  ide/Kconfig accordingly.

v2:
* ide_arm build fix (s/ide_device_idx/ide_device_add/)
  (Thanks to Christoph Lameter <[EMAIL PROTECTED]> for reporting the 
problem).

Cc: Mikael Starvik <[EMAIL PROTECTED]>
Cc: Geert Uytterhoeven <[EMAIL PROTECTED]>
Cc: Roman Zippel <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig|   11 ---
 drivers/ide/arm/ide_arm.c  |4 
 drivers/ide/cris/ide-cris.c|9 ++---
 drivers/ide/h8300/ide-h8300.c  |6 ++
 drivers/ide/ide-pnp.c  |4 
 drivers/ide/ide.c  |4 
 drivers/ide/legacy/buddha.c|   10 --
 drivers/ide/legacy/falconide.c |3 +++
 drivers/ide/legacy/gayle.c |5 +
 drivers/ide/legacy/macide.c|3 +++
 drivers/ide/legacy/q40ide.c|5 +
 drivers/ide/pci/cmd640.c   |8 
 drivers/ide/ppc/mpc8xx.c   |   14 ++
 13 files changed, 70 insertions(+), 16 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index 2a584b3..7c419e8 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -327,7 +327,6 @@ config BLK_DEV_PLATFORM
 config BLK_DEV_CMD640
bool "CMD640 chipset bugfix/support"
depends on X86
-   select IDE_GENERIC
---help---
  The CMD-Technologies CMD640 IDE chip is used on many common 486 and
  Pentium motherboards, usually in combination with a "Neptune" or
@@ -362,7 +361,6 @@ config BLK_DEV_CMD640_ENHANCED
 config BLK_DEV_IDEPNP
bool "PNP EIDE support"
depends on PNP
-   select IDE_GENERIC
help
  If you have a PnP (Plug and Play) compatible EIDE card and
  would like the kernel to automatically detect and activate
@@ -845,7 +843,6 @@ config BLK_DEV_IDE_AU1XXX_SEQTS_PER_RQ
 
 config IDE_ARM
def_bool ARM && (ARCH_CLPS7500 || ARCH_RPC || ARCH_SHARK)
-   select IDE_GENERIC
 
 config BLK_DEV_IDE_ICSIDE
tristate "ICS IDE interface support"
@@ -880,7 +877,6 @@ config ETRAX_IDE
bool "ETRAX IDE support"
depends on CRIS && BROKEN
select BLK_DEV_IDEDMA
-   select IDE_GENERIC
help
  Enables the ETRAX IDE driver.
 
@@ -914,7 +910,6 @@ endchoice
 config IDE_H8300
bool "H8300 IDE support"
depends on H8300
-   select IDE_GENERIC
default y
help
  Enables the H8300 IDE driver.
@@ -922,7 +917,6 @@ config IDE_H8300
 config BLK_DEV_GAYLE
bool "Amiga Gayle IDE interface support"
depends on AMIGA
-   select IDE_GENERIC
help
  This is the IDE driver for the Amiga Gayle IDE interface. It supports
  both the `A1200 style' and `A4000 style' of the Gayle IDE interface,
@@ -954,7 +948,6 @@ config BLK_DEV_IDEDOUBLER
 config BLK_DEV_BUDDHA
bool "Buddha/Catweasel/X-Surf IDE interface support (EXPERIMENTAL)"
depends on ZORRO && EXPERIMENTAL
-   select IDE_GENERIC
help
  This is the IDE driver for the IDE interfaces on the Buddha, 
  Catweasel and X-Surf expansion boards.  It supports up to two 
interfaces 
@@ -967,7 +960,6 @@ config BLK_DEV_BUDDHA
 config BLK_DEV_FALCON_IDE
bool "Falcon IDE interface support"
depends on ATARI
-   select IDE_GENERIC
help
  This is the IDE driver for the builtin IDE interface on the Atari
  Falcon. Say Y if you have a Falcon and want to use IDE devices (hard
@@ -977,7 +969,6 @@ config BLK_DEV_FALCON_IDE
 config BLK_DEV_MAC_IDE
bool "Macintosh Quadra/Powerbook IDE interface support"
depends on MAC
-   select IDE_GENERIC
help
  This is the IDE driver for the builtin IDE interface on some m68k
  Macintosh models. It supports both the `Quadra style' (used in
@@ -991,7 +982,6 @@ config BLK_DEV_MAC_IDE
 config BLK_DEV_Q40IDE
bool "Q40/Q60 IDE interface support"
depends on Q40
-   select IDE_GENERIC
help
  Enable the on-board IDE controller in the Q40/Q60.  This should
  nor

ide: make remaining built-in only IDE host drivers modular (take 2)

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ade2daf9c6e57845fe83a24e0a9fa1c03c6e91b1
Commit: ade2daf9c6e57845fe83a24e0a9fa1c03c6e91b1
Parent: 8ac4ce742c66100931b6f2d7a36b0df08bc721fe
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:07 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:07 2008 +0100

ide: make remaining built-in only IDE host drivers modular (take 2)

* Make remaining built-in only IDE host drivers modular, add ide-scan-pci.c
  file for probing PCI host drivers registered with IDE core (special case
  for built-in IDE and CONFIG_IDEPCI_PCIBUS_ORDER=y) and then take care of
  the ordering in which all IDE host drivers are probed when IDE is built-in
  during link time.

* Move probing of gayle, falconide, macide, q40ide and buddha (m68k arch
  specific) host drivers, before PCI ones (no PCI on m68k), ide-cris (cris
  arch specific), cmd640 (x86 arch specific) and pmac (ppc arch specific).

* Move probing of ide-cris (cris arch specific) host driver before cmd640
  (x86 arch specific).

* Move probing of mpc8xx (ppc specific) host driver before ide-pnp (depends
  on ISA and none of ppc platform that use mpc8xx supports ISA) and 
ide-h8300
  (h8300 arch specific).

* Add "probe_vlb" kernel parameter to cmd640 host driver and update
  Documentation/ide.txt accordingly.

* Make IDE_ARM config option visible so it can also be disabled if needed.

* Remove bogus comment from ide.c while at it.

v2:
* Fix two issues spotted by Sergei:
  - replace ENOMEM error value by ENOENT in ide-h8300 host driver
  - fix MODULE_PARM_DESC() in cmd640 host driver

Cc: Sergei Shtylyov <[EMAIL PROTECTED]>
Cc: Mikael Starvik <[EMAIL PROTECTED]>
Cc: Geert Uytterhoeven <[EMAIL PROTECTED]>
Cc: Roman Zippel <[EMAIL PROTECTED]>
Cc: Benjamin Herrenschmidt <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 Documentation/ide.txt  |9 ++-
 drivers/ide/Kconfig|   26 
 drivers/ide/Makefile   |   58 ++---
 drivers/ide/arm/Makefile   |4 +
 drivers/ide/arm/ide_arm.c  |6 ++-
 drivers/ide/cris/Makefile  |2 +-
 drivers/ide/cris/ide-cris.c|7 ++-
 drivers/ide/h8300/Makefile |2 +
 drivers/ide/h8300/ide-h8300.c  |   10 ++-
 drivers/ide/ide-pnp.c  |9 ++-
 drivers/ide/ide-scan-pci.c |   11 
 drivers/ide/ide.c  |  131 +---
 drivers/ide/legacy/Makefile|   19 --
 drivers/ide/legacy/ali14xx.c   |5 +-
 drivers/ide/legacy/buddha.c|6 ++-
 drivers/ide/legacy/dtc2278.c   |5 +-
 drivers/ide/legacy/falconide.c |7 ++-
 drivers/ide/legacy/gayle.c |   10 ++-
 drivers/ide/legacy/ht6560b.c   |5 +-
 drivers/ide/legacy/macide.c|8 ++-
 drivers/ide/legacy/q40ide.c|7 ++-
 drivers/ide/legacy/qd65xx.c|5 +-
 drivers/ide/legacy/umc8672.c   |5 +-
 drivers/ide/pci/Makefile   |4 +
 drivers/ide/pci/cmd640.c   |8 ++-
 drivers/ide/ppc/Makefile   |3 +
 drivers/ide/ppc/mpc8xx.c   |6 ++-
 drivers/ide/ppc/pmac.c |2 +
 drivers/ide/setup-pci.c|9 ++-
 include/linux/ide.h|3 +-
 30 files changed, 171 insertions(+), 221 deletions(-)

diff --git a/Documentation/ide.txt b/Documentation/ide.txt
index 1d50f23..b29ccb4 100644
--- a/Documentation/ide.txt
+++ b/Documentation/ide.txt
@@ -30,7 +30,7 @@
 ***
 ***  The CMD640 is also used on some Vesa Local Bus (VLB) cards, and is *NOT*
 ***  automatically detected by Linux.  For safe, reliable operation with such
-***  interfaces, one *MUST* use the "ide0=cmd640_vlb" kernel option.
+***  interfaces, one *MUST* use the "cmd640.probe_vlb" kernel option.
 ***
 ***  Use of the "serialize" option is no longer necessary.
 
@@ -292,9 +292,6 @@ The following are valid ONLY on ide0, which usually 
corresponds
 to the first ATA interface found on the particular host, and the defaults for
 the base,ctl ports must not be altered.
 
- "ide0=cmd640_vlb" : *REQUIRED* for VLB cards with the CMD640 chip
- (not for PCI -- automatically detected)
-
  "ide=doubler" : probe/support IDE doublers on Amiga
 
 There may be more options than shown -- use the source, Luke!
@@ -310,6 +307,10 @@ i.e. to enable probing for ALI M14xx chipsets (ali14xx 
host driver) use:
 * "probe" module parameter when ali14xx driver is compiled as module
   ("modprobe ali14xx probe")
 
+Also for legacy CMD640 host driver (cmd640) you need to use "probe_vlb"
+kernel paremeter to enable probing for VLB version of the chipset (PCI ones
+are detected automatically).
+
 
=

ide: always use ide_std_init_ports() in setup-pci.c

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6828fc9a919b06723599192300053ddf6f638c95
Commit: 6828fc9a919b06723599192300053ddf6f638c95
Parent: aa79a2faa01ded0a6a4929dd37c059bef4890838
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:08 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:08 2008 +0100

ide: always use ide_std_init_ports() in setup-pci.c

* ide_init_hwif_ports() call in setup-pci.c::ide_hwif_configure()
  doesn't depend on the default cotrol register offset, default IRQ
  or ppc_ide_md.ide_init_hwif implementations so ide_std_init_ports()
  can always be used.

* Since 'base' is always non-zero and thus hwif->io_ports[IDE_DATA_OFFSET]
  is also non-zero always clear hwif->noprobe.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/setup-pci.c |6 +-
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index 63ef8aa..caa4a6a 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -390,13 +390,9 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, 
const struct ide_port
hw_regs_t hw;
 
memset(&hw, 0, sizeof(hw));
-#ifndef CONFIG_IDE_ARCH_OBSOLETE_INIT
ide_std_init_ports(&hw, base, ctl | 2);
-#else
-   ide_init_hwif_ports(&hw, base, ctl | 2, NULL);
-#endif
memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
-   hwif->noprobe = !hwif->io_ports[IDE_DATA_OFFSET];
+   hwif->noprobe = 0;
}
hwif->chipset = d->chipset ? d->chipset : ide_pci;
hwif->pci_dev = dev;
-
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: use ide_init_port_hw() in setup-pci.c

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79127c37aa5d959c9ace40a869386f712b55ac6d
Commit: 79127c37aa5d959c9ace40a869386f712b55ac6d
Parent: 6828fc9a919b06723599192300053ddf6f638c95
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:08 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:08 2008 +0100

ide: use ide_init_port_hw() in setup-pci.c

* Move setting hwif->gendev.parent from ide_pci_setup_ports()
  to ide_hwif_configure().

* Always set hwif->io_ports in ide_hwif_configure().

* Use ide_init_port_hw() in ide_hwif_configure().

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/setup-pci.c |   33 +
 1 files changed, 17 insertions(+), 16 deletions(-)

diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index caa4a6a..be9ae5a 100644
--- a/drivers/ide/setup-pci.c
+++ b/drivers/ide/setup-pci.c
@@ -363,6 +363,8 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev *dev, 
const struct ide_port
unsigned long ctl = 0, base = 0;
ide_hwif_t *hwif;
u8 bootable = (d->host_flags & IDE_HFLAG_BOOTABLE) ? 1 : 0;
+   u8 oldnoprobe = 0;
+   struct hw_regs_s hw;
 
if ((d->host_flags & IDE_HFLAG_ISA_PORTS) == 0) {
/*  Possibly we should fail if these checks report true */
@@ -385,22 +387,25 @@ static ide_hwif_t *ide_hwif_configure(struct pci_dev 
*dev, const struct ide_port
}
if ((hwif = ide_match_hwif(base, bootable, d->name)) == NULL)
return NULL;/* no room in ide_hwifs[] */
-   if (hwif->io_ports[IDE_DATA_OFFSET] != base ||
-   hwif->io_ports[IDE_CONTROL_OFFSET] != (ctl | 2)) {
-   hw_regs_t hw;
-
-   memset(&hw, 0, sizeof(hw));
-   ide_std_init_ports(&hw, base, ctl | 2);
-   memcpy(hwif->io_ports, hw.io_ports, sizeof(hwif->io_ports));
-   hwif->noprobe = 0;
-   }
-   hwif->chipset = d->chipset ? d->chipset : ide_pci;
+
+   memset(&hw, 0, sizeof(hw));
+   hw.irq = hwif->irq ? hwif->irq : irq;
+   hw.dev = &dev->dev;
+   hw.chipset = d->chipset ? d->chipset : ide_pci;
+   ide_std_init_ports(&hw, base, ctl | 2);
+
+   if (hwif->io_ports[IDE_DATA_OFFSET] == base &&
+   hwif->io_ports[IDE_CONTROL_OFFSET] == (ctl | 2))
+   oldnoprobe = hwif->noprobe;
+
+   ide_init_port_hw(hwif, &hw);
+
+   hwif->noprobe = oldnoprobe;
+
hwif->pci_dev = dev;
hwif->cds = d;
hwif->channel = port;
 
-   if (!hwif->irq)
-   hwif->irq = irq;
if (mate) {
hwif->mate = mate;
mate->mate = hwif;
@@ -535,12 +540,8 @@ void ide_pci_setup_ports(struct pci_dev *dev, const struct 
ide_port_info *d, int
if ((hwif = ide_hwif_configure(dev, d, mate, port, pciirq)) == 
NULL)
continue;
 
-   /* setup proper ancestral information */
-   hwif->gendev.parent = &dev->dev;
-
*(idx + port) = hwif->index;
 
-   
if (d->init_iops)
d->init_iops(hwif);
 
-
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: remove /proc/ide/cmd64x

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=63c4467805c9b23231d8bc9b61305b2013f9fea2
Commit: 63c4467805c9b23231d8bc9b61305b2013f9fea2
Parent: 9e47be0c97f7357b80e91dc0632e9cce2eb025e0
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:09 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:09 2008 +0100

cmd64x: remove /proc/ide/cmd64x

This belongs to user-space (and only if really needed).

   textdata bss dec hex filename
   3874 180  284082 ff2 drivers/ide/pci/cmd64x.o.before
   2231 180   02411 96b drivers/ide/pci/cmd64x.o.after

Additionaly to being bloat the code reported incorrect UDMA modes for
the reserved values of UDIDETCR0/1 registers.

Also while at it remove unused CNTRL_DIS_RA0/1 defines.

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

diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 0b1e947..cd4eb9d 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.52Dec 24, 2007
+ * linux/drivers/ide/pci/cmd64x.c  Version 1.53Dec 24, 2007
  *
  * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines.
  *   Due to massive hardware bugs, UltraDMA is only supported
@@ -22,8 +22,6 @@
 
 #include 
 
-#define DISPLAY_CMD64X_TIMINGS
-
 #define CMD_DEBUG 0
 
 #if CMD_DEBUG
@@ -37,11 +35,6 @@
  */
 #define CFR0x50
 #define   CFR_INTR_CH0 0x04
-#define CNTRL  0x51
-#define   CNTRL_ENA_1ST0x04
-#define   CNTRL_ENA_2ND0x08
-#define   CNTRL_DIS_RA00x40
-#define   CNTRL_DIS_RA10x80
 
 #defineCMDTIM  0x52
 #defineARTTIM0 0x53
@@ -60,108 +53,13 @@
 #define MRDMODE0x71
 #define   MRDMODE_INTR_CH0 0x04
 #define   MRDMODE_INTR_CH1 0x08
-#define   MRDMODE_BLK_CH0  0x10
-#define   MRDMODE_BLK_CH1  0x20
-#define BMIDESR0   0x72
 #define UDIDETCR0  0x73
 #define DTPR0  0x74
 #define BMIDECR1   0x78
 #define BMIDECSR   0x79
-#define BMIDESR1   0x7A
 #define UDIDETCR1  0x7B
 #define DTPR1  0x7C
 
-#if defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_IDE_PROC_FS)
-#include 
-#include 
-
-static u8 cmd64x_proc = 0;
-
-#define CMD_MAX_DEVS   5
-
-static struct pci_dev *cmd_devs[CMD_MAX_DEVS];
-static int n_cmd_devs;
-
-static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index)
-{
-   char *p = buf;
-   u8 reg72 = 0, reg73 = 0;/* primary */
-   u8 reg7a = 0, reg7b = 0;/* secondary */
-   u8 reg50 = 1, reg51 = 1, reg57 = 0, reg71 = 0;  /* extra */
-
-   p += sprintf(p, "\nController: %d\n", index);
-   p += sprintf(p, "PCI-%x Chipset.\n", dev->device);
-
-   (void) pci_read_config_byte(dev, CFR,   ®50);
-   (void) pci_read_config_byte(dev, CNTRL, ®51);
-   (void) pci_read_config_byte(dev, ARTTIM23,  ®57);
-   (void) pci_read_config_byte(dev, MRDMODE,   ®71);
-   (void) pci_read_config_byte(dev, BMIDESR0,  ®72);
-   (void) pci_read_config_byte(dev, UDIDETCR0, ®73);
-   (void) pci_read_config_byte(dev, BMIDESR1,  ®7a);
-   (void) pci_read_config_byte(dev, UDIDETCR1, ®7b);
-
-   /* PCI0643/6 originally didn't have the primary channel enable bit */
-   if ((dev->device == PCI_DEVICE_ID_CMD_643) ||
-   (dev->device == PCI_DEVICE_ID_CMD_646 && dev->revision < 3))
-   reg51 |= CNTRL_ENA_1ST;
-
-   p += sprintf(p, " Primary Channel "
-   " Secondary Channel \n");
-   p += sprintf(p, " %s %s\n",
-(reg51 & CNTRL_ENA_1ST) ? "enabled " : "disabled",
-(reg51 & CNTRL_ENA_2ND) ? "enabled " : "disabled");
-   p += sprintf(p, " drive0 - drive1 "
-   " drive0 - drive1 --\n");
-   p += sprintf(p, "DMA enabled: %s  %s"
-   " %s  %s\n",
-   (reg72 & 0x20) ? "yes" : "no ", (reg72 & 0x40) ? "yes" : "no ",
-   (reg7a & 0x20) ? "yes" : "no ", (reg7a & 0x40) ? "yes" : "no ");
-   p += sprintf(p, "UltraDMA mode:   %s (%c)  %s (%c)",
-   ( reg73 & 0x01) ? " on" : "off",
-   ((reg73 & 0x30) == 0x30) ? ((reg73 & 0x04) ? '3' : '0') :
-   ((reg73 & 0x30) == 0x20) ? ((reg73 & 0x04) ? '3' : '1') :
-

ide: fix ->io_32bit race in ide_taskfile_ioctl()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=35cf2b94d0ecb7034cfa05dd725721538bbb83fc
Commit: 35cf2b94d0ecb7034cfa05dd725721538bbb83fc
Parent: 63c4467805c9b23231d8bc9b61305b2013f9fea2
Author: Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:10 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:10 2008 +0100

ide: fix ->io_32bit race in ide_taskfile_ioctl()

In ide_taskfile_ioctl(), there was a race condition involving
drive->io_32bit.  It was cleared and restored during ioctl
requests but there was no synchronization with other requests.
So, other requests could execute with the altered ->io_32bit
setting or updated drive->io_32bit could be overwritten by
ide_taskfile_ioctl().

This patch adds IDE_TFLAG_IO_16BIT flag to indicate to
ide_pio_datablock() that 16-bit I/O is needed regardless of
drive->io_32bit settting.

Bart:
- ported it over recent IDE changes

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-taskfile.c |   17 -
 include/linux/ide.h|2 ++
 2 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 3ecafab..b72a9ae 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -346,9 +346,18 @@ static void ide_pio_multi(ide_drive_t *drive, unsigned int 
write)
 static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,
 unsigned int write)
 {
+   u8 saved_io_32bit = drive->io_32bit;
+
if (rq->bio)/* fs request */
rq->errors = 0;
 
+   if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
+   ide_task_t *task = rq->special;
+
+   if (task->tf_flags & IDE_TFLAG_IO_16BIT)
+   drive->io_32bit = 0;
+   }
+
touch_softlockup_watchdog();
 
switch (drive->hwif->data_phase) {
@@ -360,6 +369,8 @@ static void ide_pio_datablock(ide_drive_t *drive, struct 
request *rq,
ide_pio_sector(drive, write);
break;
}
+
+   drive->io_32bit = saved_io_32bit;
 }
 
 static ide_startstop_t task_error(ide_drive_t *drive, struct request *rq,
@@ -555,7 +566,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int 
cmd, unsigned long arg)
unsigned int taskin = 0;
unsigned int taskout= 0;
u16 nsect   = 0;
-   u8 io_32bit = drive->io_32bit;
char __user *buf = (char __user *)arg;
 
 // printk("IDE Taskfile ...\n");
@@ -608,7 +618,7 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int 
cmd, unsigned long arg)
 
args.data_phase = req_task->data_phase;
 
-   args.tf_flags = IDE_TFLAG_OUT_DEVICE;
+   args.tf_flags = IDE_TFLAG_IO_16BIT | IDE_TFLAG_OUT_DEVICE;
if (drive->addressing == 1)
args.tf_flags |= IDE_TFLAG_LBA48;
 
@@ -646,7 +656,6 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int 
cmd, unsigned long arg)
if (req_task->in_flags.b.data)
args.tf_flags |= IDE_TFLAG_IN_DATA;
 
-   drive->io_32bit = 0;
switch(req_task->data_phase) {
case TASKFILE_MULTI_OUT:
if (!drive->mult_count) {
@@ -742,8 +751,6 @@ abort:
 
 // printk("IDE Taskfile ioctl ended. rc = %i\n", err);
 
-   drive->io_32bit = io_32bit;
-
return err;
 }
 #endif
diff --git a/include/linux/ide.h b/include/linux/ide.h
index f94cf03..c1a8b8b 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -931,6 +931,8 @@ enum {
IDE_TFLAG_IN_TF = IDE_TFLAG_IN_NSECT |
  IDE_TFLAG_IN_LBA,
IDE_TFLAG_IN_DEVICE = (1 << 29),
+   /* force 16-bit I/O operations */
+   IDE_TFLAG_IO_16BIT  = (1 << 30),
 };
 
 struct ide_taskfile {
-
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: clear HOB bit for REQ_TYPE_ATA_CMD requests in ide_end_drive_cmd()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49c746ee6cc791202172483277a249c12ba437d8
Commit: 49c746ee6cc791202172483277a249c12ba437d8
Parent: 35cf2b94d0ecb7034cfa05dd725721538bbb83fc
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:10 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:10 2008 +0100

ide: clear HOB bit for REQ_TYPE_ATA_CMD requests in ide_end_drive_cmd()

ide_dump_status() may set HOB bit before ide_end_drive_cmd() is called.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 5b213dc..f01b103 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -370,6 +370,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
if (args) {
args[0] = stat;
args[1] = err;
+   /* be sure we're looking at the low order bits */
+   hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
args[2] = hwif->INB(IDE_NSECTOR_REG);
}
} else if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-
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-tape: fix handling of non-special requests in ->end_request method

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3687221f28058c40e2c57a286decd0caeac67382
Commit: 3687221f28058c40e2c57a286decd0caeac67382
Parent: 73d7de0c818639cf74a32ce3b13a33021414749c
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:10 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:10 2008 +0100

ide-tape: fix handling of non-special requests in ->end_request method

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-tape.c |5 +
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 3cbca3f..d71a584 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -1690,6 +1690,11 @@ static int idetape_end_request(ide_drive_t *drive, int 
uptodate, int nr_sects)
if (error)
tape->failed_pc = NULL;
 
+   if (!blk_special_request(rq)) {
+   ide_end_request(drive, uptodate, nr_sects);
+   return 0;
+   }
+
spin_lock_irqsave(&tape->spinlock, flags);
 
/* The request was a pipelined data transfer request */
-
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: use rq->nr_sectors in task_end_request()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=79f21b84d94c02b941818df282b61f2a5a028722
Commit: 79f21b84d94c02b941818df282b61f2a5a028722
Parent: 03c3c70ee541c91250e2bff57211d403cb0b7055
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:11 2008 +0100

ide: use rq->nr_sectors in task_end_request()

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-taskfile.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index b25d10b..3bbb438 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -424,9 +424,9 @@ static void task_end_request(ide_drive_t *drive, struct 
request *rq, u8 stat)
ide_driver_t *drv;
 
drv = *(ide_driver_t **)rq->rq_disk->private_data;;
-   drv->end_request(drive, 1, rq->hard_nr_sectors);
+   drv->end_request(drive, 1, rq->nr_sectors);
} else
-   ide_end_request(drive, 1, rq->hard_nr_sectors);
+   ide_end_request(drive, 1, rq->nr_sectors);
 }
 
 /*
-
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: task_end_request() fix

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4d7a984bdcbdda69fc6b2a4a655415140270aa7b
Commit: 4d7a984bdcbdda69fc6b2a4a655415140270aa7b
Parent: 79f21b84d94c02b941818df282b61f2a5a028722
Author: Tejun Heo <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:11 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:11 2008 +0100

ide: task_end_request() fix

task_end_request() modified to always call ide_end_drive_cmd()
for taskfile requests.  Previously, ide_end_drive_cmd() was
called only when IDE_TFLAG_FLAGGED was set.  Also,
ide_dma_intr() is modified to use task_end_request().

Enables TASKFILE ioctls to get valid register outputs on
successful completion.

Bart:
- ported it over recent IDE changes

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-dma.c  |8 +---
 drivers/ide/ide-taskfile.c |   11 ---
 include/linux/ide.h|2 ++
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index c9648b1..5bf3203 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -153,13 +153,7 @@ ide_startstop_t ide_dma_intr (ide_drive_t *drive)
if (!dma_stat) {
struct request *rq = HWGROUP(drive)->rq;
 
-   if (rq->rq_disk) {
-   ide_driver_t *drv;
-
-   drv = *(ide_driver_t 
**)rq->rq_disk->private_data;
-   drv->end_request(drive, 1, rq->nr_sectors);
-   } else
-   ide_end_request(drive, 1, rq->nr_sectors);
+   task_end_request(drive, rq, stat);
return ide_stopped;
}
printk(KERN_ERR "%s: dma_intr: bad DMA status (dma_stat=%x)\n", 
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 3bbb438..17c2c04 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -408,16 +408,13 @@ static ide_startstop_t task_error(ide_drive_t *drive, 
struct request *rq,
return ide_error(drive, s, stat);
 }
 
-static void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
+void task_end_request(ide_drive_t *drive, struct request *rq, u8 stat)
 {
if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
-   ide_task_t *task = rq->special;
+   u8 err = drive->hwif->INB(IDE_ERROR_REG);
 
-   if (task->tf_flags & IDE_TFLAG_FLAGGED) {
-   u8 err = drive->hwif->INB(IDE_ERROR_REG);
-   ide_end_drive_cmd(drive, stat, err);
-   return;
-   }
+   ide_end_drive_cmd(drive, stat, err);
+   return;
}
 
if (rq->rq_disk) {
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 02493db..6192564 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -993,6 +993,8 @@ void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8);
 
 ide_startstop_t do_rw_taskfile(ide_drive_t *, ide_task_t *);
 
+void task_end_request(ide_drive_t *, struct request *, u8);
+
 int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16);
 int ide_no_data_taskfile(ide_drive_t *, ide_task_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


ide: fix final status check in drive_cmd_intr()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0455fcc821e87d362f2047922c59c0f378a122b5
Commit: 0455fcc821e87d362f2047922c59c0f378a122b5
Parent: 4d977e43d8ae758434e603cf2455d955f71c77c4
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:12 2008 +0100

ide: fix final status check in drive_cmd_intr()

Don't check for READY_STAT bit being set for PIO-in protocol (makes the
final status check in drive_cmd_intr() match the one in task_in_intr()).

Also fix function name reported by ide_error() call while at it.

Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index ce8ab10..cad057d 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -659,8 +659,8 @@ static ide_startstop_t drive_cmd_intr (ide_drive_t *drive)
stat = hwif->INB(IDE_STATUS_REG);
}
 
-   if (!OK_STAT(stat, READY_STAT, BAD_STAT))
-   return ide_error(drive, "drive_cmd", stat);
+   if (!OK_STAT(stat, (pio_in ? 0 : READY_STAT), BAD_STAT))
+   return ide_error(drive, __FUNCTION__, stat);
/* calls ide_end_drive_cmd */
ide_end_drive_cmd(drive, stat, hwif->INB(IDE_ERROR_REG));
return ide_stopped;
-
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: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=34f5d5ae35240a11846875d76eb935875ab0c366
Commit: 34f5d5ae35240a11846875d76eb935875ab0c366
Parent: 0455fcc821e87d362f2047922c59c0f378a122b5
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:12 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:12 2008 +0100

ide: switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests

Based on the earlier work by Tejun Heo.

Switch set_xfer_rate() to use REQ_TYPE_ATA_TASKFILE requests
and make ide_wait_cmd() static.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-proc.c |   12 +---
 drivers/ide/ide-taskfile.c |3 ++-
 include/linux/ide.h|8 
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/drivers/ide/ide-proc.c b/drivers/ide/ide-proc.c
index a4007d3..aa663e7 100644
--- a/drivers/ide/ide-proc.c
+++ b/drivers/ide/ide-proc.c
@@ -346,14 +346,20 @@ static int ide_write_setting(ide_drive_t *drive, 
ide_settings_t *setting, int va
 
 static int set_xfer_rate (ide_drive_t *drive, int arg)
 {
+   ide_task_t task;
int err;
 
if (arg < 0 || arg > 70)
return -EINVAL;
 
-   err = ide_wait_cmd(drive,
-   WIN_SETFEATURES, (u8) arg,
-   SETFEATURES_XFER, 0, NULL);
+   memset(&task, 0, sizeof(task));
+   task.tf.command = WIN_SETFEATURES;
+   task.tf.feature = SETFEATURES_XFER;
+   task.tf.nsect   = (u8)arg;
+   task.tf_flags = IDE_TFLAG_OUT_FEATURE | IDE_TFLAG_OUT_NSECT |
+   IDE_TFLAG_IN_NSECT;
+
+   err = ide_no_data_taskfile(drive, &task);
 
if (!err && arg) {
ide_set_xfer_rate(drive, (u8) arg);
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 9404650..a1796cf 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -750,7 +750,8 @@ abort:
 }
 #endif
 
-int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 
sectors, u8 *buf)
+static int ide_wait_cmd(ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature,
+   u8 sectors, u8 *buf)
 {
struct request rq;
u8 buffer[4];
diff --git a/include/linux/ide.h b/include/linux/ide.h
index c889a6e..27cb39d 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -870,14 +870,6 @@ extern int ide_do_drive_cmd(ide_drive_t *, struct request 
*, ide_action_t);
 
 extern void ide_end_drive_cmd(ide_drive_t *, u8, u8);
 
-/*
- * Issue ATA command and wait for completion.
- * Use for implementing commands in kernel
- *
- *  (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors, u8 *buf)
- */
-extern int ide_wait_cmd(ide_drive_t *, u8, u8, u8, u8, u8 *);
-
 enum {
IDE_TFLAG_LBA48 = (1 << 0),
IDE_TFLAG_NO_SELECT_MASK= (1 << 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: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requests

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a9e77af970f14a94482a6d4dca5c48efb70deb2
Commit: 5a9e77af970f14a94482a6d4dca5c48efb70deb2
Parent: 34f5d5ae35240a11846875d76eb935875ab0c366
Author: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Sat Jan 26 20:13:13 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Sat Jan 26 20:13:13 2008 +0100

ide: switch ide_cmd_ioctl() to use REQ_TYPE_ATA_TASKFILE requests

Based on the earlier work by Tejun Heo.

There should be no functionality changes caused by this patch.

Cc: Tejun Heo <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-iops.c |4 +-
 drivers/ide/ide-taskfile.c |   63 +--
 2 files changed, 33 insertions(+), 34 deletions(-)

diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index a26c9ca..e2a7e95 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -619,7 +619,7 @@ no_80w:
 int ide_ata66_check (ide_drive_t *drive, ide_task_t *args)
 {
if (args->tf.command == WIN_SETFEATURES &&
-   args->tf.lbal > XFER_UDMA_2 &&
+   args->tf.nsect > XFER_UDMA_2 &&
args->tf.feature == SETFEATURES_XFER) {
if (eighty_ninty_three(drive) == 0) {
printk(KERN_WARNING "%s: UDMA speeds >UDMA33 cannot "
@@ -639,7 +639,7 @@ int ide_ata66_check (ide_drive_t *drive, ide_task_t *args)
 int set_transfer (ide_drive_t *drive, ide_task_t *args)
 {
if (args->tf.command == WIN_SETFEATURES &&
-   args->tf.lbal >= XFER_SW_DMA_0 &&
+   args->tf.nsect >= XFER_SW_DMA_0 &&
args->tf.feature == SETFEATURES_XFER &&
(drive->id->dma_ultra ||
 drive->id->dma_mword ||
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index a1796cf..5eb6fa1 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -750,31 +750,11 @@ abort:
 }
 #endif
 
-static int ide_wait_cmd(ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature,
-   u8 sectors, u8 *buf)
-{
-   struct request rq;
-   u8 buffer[4];
-
-   if (!buf)
-   buf = buffer;
-   memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors);
-   ide_init_drive_cmd(&rq);
-   rq.cmd_type = REQ_TYPE_ATA_CMD;
-   rq.buffer = buf;
-   *buf++ = cmd;
-   *buf++ = nsect;
-   *buf++ = feature;
-   *buf++ = sectors;
-   return ide_do_drive_cmd(drive, &rq, ide_wait);
-}
-
 int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 {
-   int err = 0;
-   u8 args[4], *argbuf = args;
-   u8 xfer_rate = 0;
-   int argsize = 4;
+   u8 *buf = NULL;
+   int bufsize = 0, err = 0;
+   u8 args[4], xfer_rate = 0;
ide_task_t tfargs;
struct ide_taskfile *tf = &tfargs.tf;
 
@@ -792,23 +772,39 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, 
unsigned long arg)
 
memset(&tfargs, 0, sizeof(ide_task_t));
tf->feature = args[2];
-   tf->nsect   = args[3];
-   tf->lbal= args[1];
+   if (args[0] == WIN_SMART) {
+   tf->nsect = args[3];
+   tf->lbal  = args[1];
+   tf->lbam  = 0x4f;
+   tf->lbah  = 0xc2;
+   tfargs.tf_flags = IDE_TFLAG_OUT_TF | IDE_TFLAG_IN_NSECT;
+   } else {
+   tf->nsect = args[1];
+   tfargs.tf_flags = IDE_TFLAG_OUT_FEATURE |
+ IDE_TFLAG_OUT_NSECT | IDE_TFLAG_IN_NSECT;
+   }
tf->command = args[0];
+   tfargs.data_phase = args[3] ? TASKFILE_IN : TASKFILE_NO_DATA;
 
if (args[3]) {
-   argsize = 4 + (SECTOR_WORDS * 4 * args[3]);
-   argbuf = kzalloc(argsize, GFP_KERNEL);
-   if (argbuf == NULL)
+   tfargs.tf_flags |= IDE_TFLAG_IO_16BIT;
+   bufsize = SECTOR_WORDS * 4 * args[3];
+   buf = kzalloc(bufsize, GFP_KERNEL);
+   if (buf == NULL)
return -ENOMEM;
}
+
if (set_transfer(drive, &tfargs)) {
xfer_rate = args[1];
if (ide_ata66_check(drive, &tfargs))
goto abort;
}
 
-   err = ide_wait_cmd(drive, args[0], args[1], args[2], args[3], argbuf);
+   err = ide_raw_taskfile(drive, &tfargs, buf, args[3]);
+
+   args[0] = tf->status;
+   args[1] = tf->error;
+   args[2] = tf->nsect;
 
if (!err && xfer_rate) {
/* active-retuning-calls future */
@@ -816,10 +812,13 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, 
unsigned long arg)
ide_driveid_update(drive);
}
 abort:
-   if (copy_to_user((void __user *)arg, argbuf, argsize))
+   if (copy_to_user((void __user *)arg, &args, 4))
err = -

[CIFS] Only dump SPNEGO key if CONFIG_CIFS_DEBUG2 is set

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05b3de63da2abe804f5dbe0174298bf48949079f
Commit: 05b3de63da2abe804f5dbe0174298bf48949079f
Parent: dae5dbdbd786798ad2249e54df1156d524da30aa
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 31 00:51:45 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Dec 31 00:51:45 2007 +

[CIFS] Only dump SPNEGO key if CONFIG_CIFS_DEBUG2 is set

The SPNEGO key data is not terribly interesting except in certain
debugging situations. Only dump it to the ring buffer if needed.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/cifs_spnego.c |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifs_spnego.c b/fs/cifs/cifs_spnego.c
index 1529d2b..d543acc 100644
--- a/fs/cifs/cifs_spnego.c
+++ b/fs/cifs/cifs_spnego.c
@@ -122,11 +122,13 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)
cFYI(1, ("key description = %s", description));
spnego_key = request_key(&cifs_spnego_key_type, description, "");
 
+#ifdef CONFIG_CIFS_DEBUG2
if (cifsFYI && !IS_ERR(spnego_key)) {
struct cifs_spnego_msg *msg = spnego_key->payload.data;
-   cifs_dump_mem("SPNEGO reply blob:", msg->data,
-   msg->secblob_len + msg->sesskey_len);
+   cifs_dump_mem("SPNEGO reply blob:", msg->data, min(1024,
+   msg->secblob_len + msg->sesskey_len));
}
+#endif /* CONFIG_CIFS_DEBUG2 */
 
 out:
kfree(description);
-
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


[CIFS] use krb5 session key from first SMB session after a NegProt

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1a67570c76402b36695cd0725e28649ee8fe830d
Commit: 1a67570c76402b36695cd0725e28649ee8fe830d
Parent: 1d9a8852c365fb7f8db0f8364210138985f457b8
Author: Jeff Layton <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 31 04:03:02 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Dec 31 04:03:02 2007 +

[CIFS]  use krb5 session key from first SMB session after a NegProt

Currently, any new kerberos SMB session overwrites the server's session
key. The session key should only be set by the first SMB session set up
on the socket.

Signed-off-by: Jeff Layton <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/sess.c |8 +---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index d0cb469..ce698d5 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -528,9 +528,11 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, 
int first_time,
rc = -EOVERFLOW;
goto ssetup_exit;
}
-   ses->server->mac_signing_key.len = msg->sesskey_len;
-   memcpy(ses->server->mac_signing_key.data.krb5, msg->data,
-   msg->sesskey_len);
+   if (first_time) {
+   ses->server->mac_signing_key.len = msg->sesskey_len;
+   memcpy(ses->server->mac_signing_key.data.krb5,
+   msg->data, msg->sesskey_len);
+   }
pSMB->req.hdr.Flags2 |= SMBFLG2_EXT_SEC;
capabilities |= CAP_EXTENDED_SECURITY;
pSMB->req.Capabilities = cpu_to_le32(capabilities);
-
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


[CIFS] cifs_partialpagewrite() cleanup

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bb5a9a04d4cab4b13d63ac5cd3e1fb35f9583607
Commit: bb5a9a04d4cab4b13d63ac5cd3e1fb35f9583607
Parent: 1a67570c76402b36695cd0725e28649ee8fe830d
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Mon Dec 31 04:21:29 2007 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Mon Dec 31 04:21:29 2007 +

[CIFS] cifs_partialpagewrite() cleanup

rc cannot be -EBADF now and condition is always true

Signed-off-by: Vasily Averin <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/file.c |8 +++-
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index dd26e27..5f7c374 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1179,12 +1179,10 @@ static int cifs_partialpagewrite(struct page *page, 
unsigned from, unsigned to)
atomic_dec(&open_file->wrtPending);
/* Does mm or vfs already set times? */
inode->i_atime = inode->i_mtime = current_fs_time(inode->i_sb);
-   if ((bytes_written > 0) && (offset)) {
+   if ((bytes_written > 0) && (offset))
rc = 0;
-   } else if (bytes_written < 0) {
-   if (rc != -EBADF)
-   rc = bytes_written;
-   }
+   else if (bytes_written < 0)
+   rc = bytes_written;
} else {
cFYI(1, ("No writeable filehandles for inode"));
rc = -EIO;
-
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


[CIFS] DFS support patchset: Added mountdata

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e6ab15827eec0bc421f7ccf0223de321c708
Commit: e6ab15827eec0bc421f7ccf0223de321c708
Parent: 197c183f3526dc08aa52ca97ec66c268442d4b84
Author: Igor Mammedov <[EMAIL PROTECTED]>
AuthorDate: Fri Jan 11 01:49:48 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Fri Jan 11 01:49:48 2008 +

[CIFS] DFS support patchset: Added mountdata

Also cifs_fs_type was made not static for ussage in dfs code.

Signed-off-by: Igor Mammedov <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/cifs_fs_sb.h |5 -
 fs/cifs/cifsfs.c |   37 -
 fs/cifs/cifsfs.h |1 +
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/fs/cifs/cifs_fs_sb.h b/fs/cifs/cifs_fs_sb.h
index 34af556..8ad2330 100644
--- a/fs/cifs/cifs_fs_sb.h
+++ b/fs/cifs/cifs_fs_sb.h
@@ -43,6 +43,9 @@ struct cifs_sb_info {
mode_t  mnt_dir_mode;
int mnt_cifs_flags;
int prepathlen;
-   char   *prepath;
+   char   *prepath; /* relative path under the share to mount to */
+#ifdef CONFIG_CIFS_DFS_UPCALL
+   char   *mountdata; /* mount options received at mount time */
+#endif
 };
 #endif /* _CIFS_FS_SB_H */
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 000b4a5..93e1078 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -97,6 +97,9 @@ cifs_read_super(struct super_block *sb, void *data,
 {
struct inode *inode;
struct cifs_sb_info *cifs_sb;
+#ifdef CONFIG_CIFS_DFS_UPCALL
+   int len;
+#endif
int rc = 0;
 
/* BB should we make this contingent on mount parm? */
@@ -106,6 +109,25 @@ cifs_read_super(struct super_block *sb, void *data,
if (cifs_sb == NULL)
return -ENOMEM;
 
+#ifdef CONFIG_CIFS_DFS_UPCALL
+   /* copy mount params to sb for use in submounts */
+   /* BB: should we move this after the mount so we
+* do not have to do the copy on failed mounts?
+* BB: May be it is better to do simple copy before
+* complex operation (mount), and in case of fail
+* just exit instead of doing mount and attempting
+* undo it if this copy fails?*/
+   len = strlen(data);
+   cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
+   if (cifs_sb->mountdata == NULL) {
+   kfree(sb->s_fs_info);
+   sb->s_fs_info = NULL;
+   return -ENOMEM;
+   }
+   strncpy(cifs_sb->mountdata, data, len + 1);
+   cifs_sb->mountdata[len] = '\0';
+#endif
+
rc = cifs_mount(sb, cifs_sb, data, devname);
 
if (rc) {
@@ -155,6 +177,12 @@ out_no_root:
 
 out_mount_failed:
if (cifs_sb) {
+#ifdef CONFIG_CIFS_DFS_UPCALL
+   if (cifs_sb->mountdata) {
+   kfree(cifs_sb->mountdata);
+   cifs_sb->mountdata = NULL;
+   }
+#endif
if (cifs_sb->local_nls)
unload_nls(cifs_sb->local_nls);
kfree(cifs_sb);
@@ -178,6 +206,13 @@ cifs_put_super(struct super_block *sb)
if (rc) {
cERROR(1, ("cifs_umount failed with return code %d", rc));
}
+#ifdef CONFIG_CIFS_DFS_UPCALL
+   if (cifs_sb->mountdata) {
+   kfree(cifs_sb->mountdata);
+   cifs_sb->mountdata = NULL;
+   }
+#endif
+
unload_nls(cifs_sb->local_nls);
kfree(cifs_sb);
return;
@@ -553,7 +588,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, 
int origin)
return remote_llseek(file, offset, origin);
 }
 
-static struct file_system_type cifs_fs_type = {
+struct file_system_type cifs_fs_type = {
.owner = THIS_MODULE,
.name = "cifs",
.get_sb = cifs_get_sb,
diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h
index 2a21dc6..2e68126 100644
--- a/fs/cifs/cifsfs.h
+++ b/fs/cifs/cifsfs.h
@@ -32,6 +32,7 @@
 #define TRUE 1
 #endif
 
+extern struct file_system_type cifs_fs_type;
 extern const struct address_space_operations cifs_addr_ops;
 extern const struct address_space_operations cifs_addr_ops_smallbuf;
 
-
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


[CIFS] Do not log path names in lookup errors

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ed2b91701d97047fa9970645e43d5e551e261adb
Commit: ed2b91701d97047fa9970645e43d5e551e261adb
Parent: e6ab15827eec0bc421f7ccf0223de321c708
Author: Steve French <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 20 00:30:29 2008 +
Committer:  Steve French <[EMAIL PROTECTED]>
CommitDate: Sun Jan 20 00:30:29 2008 +

[CIFS] Do not log path names in lookup errors

Andi Kleen noticed that we were logging access denied errors (which is
noisy in the dmesg log, and not needed to be logged) and that we were
logging path names on that an other errors (e.g. EIO) which we should
not be doing.

CC: Andi Kleen <[EMAIL PROTECTED]>
Signed-off-by: Steve French <[EMAIL PROTECTED]>
---
 fs/cifs/dir.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index 37dc97a..699ec11 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -517,12 +517,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry 
*direntry,
d_add(direntry, NULL);
/*  if it was once a directory (but how can we tell?) we could do
shrink_dcache_parent(direntry); */
-   } else {
-   cERROR(1, ("Error 0x%x on cifs_get_inode_info in lookup of %s",
-  rc, full_path));
-   /* BB special case check for Access Denied - watch security
-   exposure of returning dir info implicitly via different rc
-   if file exists or not but no access BB */
+   } else if (rc != -EACCES) {
+   cERROR(1, ("Unexpected lookup error %d", rc));
+   /* We special case check for Access Denied - since that
+   is a common return code */
}
 
kfree(full_path);
-
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


printk: revert ktime_get() timestamps

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=326e96b92306b7af24a3608ec01156cba17a3fc1
Commit: 326e96b92306b7af24a3608ec01156cba17a3fc1
Parent: ef3f2de2b5496f721b12f21a157e19eac816394b
Author: Ingo Molnar <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 08:03:54 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 08:03:54 2008 +0100

printk: revert ktime_get() timestamps

revert 19ef9309273d26cb005cb23e6a370353dca91099.

Kevin Winchester reported a lockup during X startup an bisected
it to this commit.

Reported-by: Kevin Winchester <[EMAIL PROTECTED]>
Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 kernel/printk.c |4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/kernel/printk.c b/kernel/printk.c
index 423a8c7..3b7c968 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -702,9 +702,7 @@ asmlinkage int vprintk(const char *fmt, va_list args)
loglev_char = default_message_loglevel
+ '0';
}
-   t = 0;
-   if (system_state != SYSTEM_BOOTING)
-   t = ktime_to_ns(ktime_get());
+   t = cpu_clock(printk_cpu);
nanosec_rem = do_div(t, 10);
tlen = sprintf(tbuf,
"<%c>[%5lu.%06lu] ",
-
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


i2c-pasemi: use i2c_add_numbered_adapter()

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ccf60d8571f0e606b5dacf213696b7a57fe2d890
Commit: ccf60d8571f0e606b5dacf213696b7a57fe2d890
Parent: 541b6a7a69fadda82f313bd2176e7756db2b5b43
Author: Olof Johansson <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:44 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:44 2008 +0100

i2c-pasemi: use i2c_add_numbered_adapter()

Use numbered adapter registration to always have the same hardware bus
show up at the same number.

PWRficient 1682M has three buses, they are all on the same PCI device but
different functions. So do the simple thing and register them based on
function number. Future products, if having a different number of busses,
are expected to have similar behaviour w.r.t. device/function layout.

Signed-off-by: Olof Johansson <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-pasemi.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pasemi.c b/drivers/i2c/busses/i2c-pasemi.c
index ca18e0b..1603c81 100644
--- a/drivers/i2c/busses/i2c-pasemi.c
+++ b/drivers/i2c/busses/i2c-pasemi.c
@@ -368,6 +368,7 @@ static int __devinit pasemi_smb_probe(struct pci_dev *dev,
smbus->adapter.class = I2C_CLASS_HWMON;
smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus;
+   smbus->adapter.nr = PCI_FUNC(dev->devfn);
 
/* set up the sysfs linkage to our parent device */
smbus->adapter.dev.parent = &dev->dev;
@@ -375,7 +376,7 @@ static int __devinit pasemi_smb_probe(struct pci_dev *dev,
reg_write(smbus, REG_CTL, (CTL_MTR | CTL_MRR |
  (CLK_100K_DIV & CTL_CLK_M)));
 
-   error = i2c_add_adapter(&smbus->adapter);
+   error = i2c_add_numbered_adapter(&smbus->adapter);
if (error)
goto out_release_region;
 
-
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


i2c-nforce2: The nForce2 can do block transactions

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=541b6a7a69fadda82f313bd2176e7756db2b5b43
Commit: 541b6a7a69fadda82f313bd2176e7756db2b5b43
Parent: 326e96b92306b7af24a3608ec01156cba17a3fc1
Author: Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:44 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:44 2008 +0100

i2c-nforce2: The nForce2 can do block transactions

My guess is that all the chips supported by this driver support block
transactions and reset, but for now we play it safe and only list the
ones for which this was actually tested.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Cc: Oleg Ryjkov <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-nforce2.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/busses/i2c-nforce2.c b/drivers/i2c/busses/i2c-nforce2.c
index 1bf590c..3dac920 100644
--- a/drivers/i2c/busses/i2c-nforce2.c
+++ b/drivers/i2c/busses/i2c-nforce2.c
@@ -351,6 +351,7 @@ static int __devinit nforce2_probe(struct pci_dev *dev, 
const struct pci_device_
pci_set_drvdata(dev, smbuses);
 
switch(dev->device) {
+   case PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS:
case PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SMBUS:
case PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SMBUS:
smbuses[0].blockops = 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


i2c-ibm_iic: Whitespace cleanup

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=217bcec4425cdc8fb90ce688eb4d5b5140713046
Commit: 217bcec4425cdc8fb90ce688eb4d5b5140713046
Parent: ccf60d8571f0e606b5dacf213696b7a57fe2d890
Author: Stefan Roese <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:45 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:45 2008 +0100

i2c-ibm_iic: Whitespace cleanup

Signed-off-by: Stefan Roese <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-ibm_iic.c |  190 +++---
 drivers/i2c/busses/i2c-ibm_iic.h |8 +-
 2 files changed, 99 insertions(+), 99 deletions(-)

diff --git a/drivers/i2c/busses/i2c-ibm_iic.c b/drivers/i2c/busses/i2c-ibm_iic.c
index 9b43ff7..d0cf39b 100644
--- a/drivers/i2c/busses/i2c-ibm_iic.c
+++ b/drivers/i2c/busses/i2c-ibm_iic.c
@@ -6,7 +6,7 @@
  * Copyright (c) 2003, 2004 Zultys Technologies.
  * Eugene Surovegin <[EMAIL PROTECTED]> or <[EMAIL PROTECTED]>
  *
- * Based on original work by 
+ * Based on original work by
  * Ian DaSilva  <[EMAIL PROTECTED]>
  *  Armin Kuster <[EMAIL PROTECTED]>
  * Matt Porter  <[EMAIL PROTECTED]>
@@ -86,8 +86,8 @@ static void dump_iic_regs(const char* header, struct 
ibm_iic_private* dev)
   KERN_DEBUG "  sts  = 0x%02x, extsts = 0x%02x\n"
   KERN_DEBUG "  clkdiv   = 0x%02x, xfrcnt = 0x%02x\n"
   KERN_DEBUG "  xtcntlss = 0x%02x, directcntl = 0x%02x\n",
-   in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts), 
-   in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt), 
+   in_8(&iic->cntl), in_8(&iic->mdcntl), in_8(&iic->sts),
+   in_8(&iic->extsts), in_8(&iic->clkdiv), in_8(&iic->xfrcnt),
in_8(&iic->xtcntlss), in_8(&iic->directcntl));
 }
 #  define DUMP_REGS(h,dev) dump_iic_regs((h),(dev))
@@ -125,7 +125,7 @@ static inline void iic_interrupt_mode(struct 
ibm_iic_private* dev, int enable)
 {
out_8(&dev->vaddr->intmsk, enable ? INTRMSK_EIMTC : 0);
 }
- 
+
 /*
  * Initialize IIC interface.
  */
@@ -134,7 +134,7 @@ static void iic_dev_init(struct ibm_iic_private* dev)
volatile struct iic_regs __iomem *iic = dev->vaddr;
 
DBG("%d: init\n", dev->idx);
-   
+
/* Clear master address */
out_8(&iic->lmadr, 0);
out_8(&iic->hmadr, 0);
@@ -160,7 +160,7 @@ static void iic_dev_init(struct ibm_iic_private* dev)
 
/* Clear control register */
out_8(&iic->cntl, 0);
-   
+
/* Enable interrupts if possible */
iic_interrupt_mode(dev, dev->irq >= 0);
 
@@ -171,7 +171,7 @@ static void iic_dev_init(struct ibm_iic_private* dev)
DUMP_REGS("iic_init", dev);
 }
 
-/* 
+/*
  * Reset IIC interface
  */
 static void iic_dev_reset(struct ibm_iic_private* dev)
@@ -179,42 +179,42 @@ static void iic_dev_reset(struct ibm_iic_private* dev)
volatile struct iic_regs __iomem *iic = dev->vaddr;
int i;
u8 dc;
-   
+
DBG("%d: soft reset\n", dev->idx);
DUMP_REGS("reset", dev);
-   
+
/* Place chip in the reset state */
out_8(&iic->xtcntlss, XTCNTLSS_SRST);
-   
+
/* Check if bus is free */
-   dc = in_8(&iic->directcntl);
+   dc = in_8(&iic->directcntl);
if (!DIRCTNL_FREE(dc)){
DBG("%d: trying to regain bus control\n", dev->idx);
-   
+
/* Try to set bus free state */
-   out_8(&iic->directcntl, DIRCNTL_SDAC | DIRCNTL_SCC);
-   
+   out_8(&iic->directcntl, DIRCNTL_SDAC | DIRCNTL_SCC);
+
/* Wait until we regain bus control */
for (i = 0; i < 100; ++i){
dc = in_8(&iic->directcntl);
if (DIRCTNL_FREE(dc))
break;
-   
+
/* Toggle SCL line */
dc ^= DIRCNTL_SCC;
out_8(&iic->directcntl, dc);
udelay(10);
dc ^= DIRCNTL_SCC;
out_8(&iic->directcntl, dc);
-   
+
/* be nice */
cond_resched();
}
}
-   
+
/* Remove reset */
out_8(&iic->xtcntlss, 0);
-   
+
/* Reinitialize interface */
iic_dev_init(dev);
 }
@@ -324,14 +324,14 @@ static irqreturn_t iic_handler(int irq, void *dev_id)
 {
struct ibm_iic_private* dev = (struct ibm_iic_private*)dev_id;
volatile struct iic_regs __iomem *iic = dev->vaddr;
-   
-   DBG2("%d: irq handler, STS = 0x%02x, EXTSTS = 0x%02x\n", 
+
+   DBG2("%d: irq handler, STS = 0x%02x, EXTSTS = 0x%02x\n",
 dev->idx, in_8(&iic->sts), in_8(&iic->extsts));
-   
+
/* Acknowledge IRQ and wakeup iic

i2c: Add support for the PCF8575 chip

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5864ae03ca982fb60bedeebfd67562db37c1ee6a
Commit: 5864ae03ca982fb60bedeebfd67562db37c1ee6a
Parent: 217bcec4425cdc8fb90ce688eb4d5b5140713046
Author: Bart Van Assche <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:45 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:45 2008 +0100

i2c: Add support for the PCF8575 chip

Signed-off-by: Bart Van Assche <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 Documentation/i2c/chips/pcf8575 |   72 +
 drivers/i2c/chips/Kconfig   |   16 +++-
 drivers/i2c/chips/Makefile  |1 +
 drivers/i2c/chips/pcf8575.c |  214 +++
 4 files changed, 302 insertions(+), 1 deletions(-)

diff --git a/Documentation/i2c/chips/pcf8575 b/Documentation/i2c/chips/pcf8575
new file mode 100644
index 000..25f5698
--- /dev/null
+++ b/Documentation/i2c/chips/pcf8575
@@ -0,0 +1,72 @@
+About the PCF8575 chip and the pcf8575 kernel driver
+
+
+The PCF8575 chip is produced by the following manufacturers:
+
+  * Philips NXP
+
http://www.nxp.com/#/pip/cb=[type=product,path=50807/41735/41850,final=PCF8575_3]|pip=[pip=PCF8575_3][0]
+
+  * Texas Instruments
+http://focus.ti.com/docs/prod/folders/print/pcf8575.html
+
+
+Some vendors sell small PCB's with the PCF8575 mounted on it. You can connect
+such a board to a Linux host via e.g. an USB to I2C interface. Examples of
+PCB boards with a PCF8575:
+
+  * SFE Breakout Board for PCF8575 I2C Expander by RobotShop
+
http://www.robotshop.ca/home/products/robot-parts/electronics/adapters-converters/sfe-pcf8575-i2c-expander-board.html
+
+  * Breakout Board for PCF8575 I2C Expander by Spark Fun Electronics
+http://www.sparkfun.com/commerce/product_info.php?products_id=8130
+
+
+Description
+---
+The PCF8575 chip is a 16-bit I/O expander for the I2C bus. Up to eight of
+these chips can be connected to the same I2C bus. You can find this
+chip on some custom designed hardware, but you won't find it on PC
+motherboards.
+
+The PCF8575 chip consists of a 16-bit quasi-bidirectional port and an I2C-bus
+interface. Each of the sixteen I/O's can be independently used as an input or
+an output. To set up an I/O pin as an input, you have to write a 1 to the
+corresponding output.
+
+For more information please see the datasheet.
+
+
+Detection
+-
+
+There is no method known to detect whether a chip on a given I2C address is
+a PCF8575 or whether it is any other I2C device. So there are two alternatives
+to let the driver find the installed PCF8575 devices:
+- Load this driver after any other I2C driver for I2C devices with addresses
+  in the range 0x20 .. 0x27.
+- Pass the I2C bus and address of the installed PCF8575 devices explicitly to
+  the driver at load time via the probe=... or force=... parameters.
+
+/sys interface
+--
+
+For each address on which a PCF8575 chip was found or forced the following
+files will be created under /sys:
+* /sys/bus/i2c/devices/-/read
+* /sys/bus/i2c/devices/-/write
+where bus is the I2C bus number (0, 1, ...) and address is the four-digit
+hexadecimal representation of the 7-bit I2C address of the PCF8575
+(0020 .. 0027).
+
+The read file is read-only. Reading it will trigger an I2C read and will hence
+report the current input state for the pins configured as inputs, and the
+current output value for the pins configured as outputs.
+
+The write file is read-write. Writing a value to it will configure all pins
+as output for which the corresponding bit is zero. Reading the write file will
+return the value last written, or -EAGAIN if no value has yet been written to
+the write file.
+
+On module initialization the configuration of the chip is not changed -- the
+chip is left in the state it was already configured in through either power-up
+or through previous I2C write actions.
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 2e1c24f..17702b3 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -57,7 +57,7 @@ config SENSORS_PCF8574
default n
help
  If you say yes here you get support for Philips PCF8574 and 
- PCF8574A chips.
+ PCF8574A chips. These chips are 8-bit I/O expanders for the I2C bus.
 
  This driver can also be built as a module.  If so, the module
  will be called pcf8574.
@@ -65,6 +65,20 @@ config SENSORS_PCF8574
  These devices are hard to detect and rarely found on mainstream
  hardware.  If unsure, say N.
 
+config PCF8575
+   tristate "Philips PCF8575"
+   default n
+   help
+ If you say yes here you get support for Philips PCF8575 chip.
+ This chip is a 16-bit I/O expander for the I2C bus.  Several other
+ chip manufacturers sell equiva

i2c-stub: Mention the existence of an helper script

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b3af547e197fa3ca648d148dd8d36befe989e5a0
Commit: b3af547e197fa3ca648d148dd8d36befe989e5a0
Parent: 1b3e5baa8850947b2cc15f323783ddb04dc4bffa
Author: Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:45 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:45 2008 +0100

i2c-stub: Mention the existence of an helper script

There's a new script named i2c-stub-from-dump that can be very helpful
when working with the i2c-stub driver.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 Documentation/i2c/i2c-stub |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub
index 89e69ad..41889c0 100644
--- a/Documentation/i2c/i2c-stub
+++ b/Documentation/i2c/i2c-stub
@@ -25,6 +25,9 @@ The typical use-case is like this:
3. load the target sensors chip driver module
4. observe its behavior in the kernel log
 
+There's a script named i2c-stub-from-dump in the i2c-tools package which
+can load register values automatically from a chip dump.
+
 PARAMETERS:
 
 int chip_addr[10]:
-
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


i2c-stub: Use a single array for byte and word operations

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=569be443e3c1329fc6725988004f5d8a32fe3be5
Commit: 569be443e3c1329fc6725988004f5d8a32fe3be5
Parent: b3af547e197fa3ca648d148dd8d36befe989e5a0
Author: Jean Delvare <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:45 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:45 2008 +0100

i2c-stub: Use a single array for byte and word operations

This mimics the behavior of actual SMBus chips better.

Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
Cc: Mark M. Hoffman <[EMAIL PROTECTED]>
---
 Documentation/i2c/i2c-stub|3 ---
 drivers/i2c/busses/i2c-stub.c |   15 ---
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/Documentation/i2c/i2c-stub b/Documentation/i2c/i2c-stub
index 41889c0..0d8be1c 100644
--- a/Documentation/i2c/i2c-stub
+++ b/Documentation/i2c/i2c-stub
@@ -35,9 +35,6 @@ int chip_addr[10]:
 
 CAVEATS:
 
-There are independent arrays for byte/data and word/data commands.  Depending
-on if/how a target driver mixes them, you'll need to be careful.
-
 If your target driver polls some byte or word waiting for it to change, the
 stub could lock it up.  Use i2cset to unlock it.
 
diff --git a/drivers/i2c/busses/i2c-stub.c b/drivers/i2c/busses/i2c-stub.c
index 84df29d..c2a9f8c 100644
--- a/drivers/i2c/busses/i2c-stub.c
+++ b/drivers/i2c/busses/i2c-stub.c
@@ -1,8 +1,8 @@
 /*
-i2c-stub.c - Part of lm_sensors, Linux kernel modules for hardware
-  monitoring
+i2c-stub.c - I2C/SMBus chip emulator
 
 Copyright (c) 2004 Mark M. Hoffman <[EMAIL PROTECTED]>
+Copyright (C) 2007 Jean Delvare <[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
@@ -37,8 +37,8 @@ MODULE_PARM_DESC(chip_addr,
 
 struct stub_chip {
u8 pointer;
-   u8 bytes[256];
-   u16 words[256];
+   u16 words[256]; /* Byte operations use the LSB as per SMBus
+  specification */
 };
 
 static struct stub_chip *stub_chips;
@@ -75,7 +75,7 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, 
unsigned short flags,
"wrote 0x%02x.\n",
addr, command);
} else {
-   data->byte = chip->bytes[chip->pointer++];
+   data->byte = chip->words[chip->pointer++] & 0xff;
dev_dbg(&adap->dev, "smbus byte - addr 0x%02x, "
"read  0x%02x.\n",
addr, data->byte);
@@ -86,12 +86,13 @@ static s32 stub_xfer(struct i2c_adapter * adap, u16 addr, 
unsigned short flags,
 
case I2C_SMBUS_BYTE_DATA:
if (read_write == I2C_SMBUS_WRITE) {
-   chip->bytes[command] = data->byte;
+   chip->words[command] &= 0xff00;
+   chip->words[command] |= data->byte;
dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, "
"wrote 0x%02x at 0x%02x.\n",
addr, data->byte, command);
} else {
-   data->byte = chip->bytes[command];
+   data->byte = chip->words[command] & 0xff;
dev_dbg(&adap->dev, "smbus byte data - addr 0x%02x, "
"read  0x%02x at 0x%02x.\n",
addr, data->byte, 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


i2c/tsl2550: Add power management added

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1b3e5baa8850947b2cc15f323783ddb04dc4bffa
Commit: 1b3e5baa8850947b2cc15f323783ddb04dc4bffa
Parent: 5864ae03ca982fb60bedeebfd67562db37c1ee6a
Author: Rodolfo Giometti <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:45 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:45 2008 +0100

i2c/tsl2550: Add power management added

Signed-off-by: Rodolfo Giometti <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/chips/tsl2550.c |   21 +
 1 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c
index 3de4b19..a10fd27 100644
--- a/drivers/i2c/chips/tsl2550.c
+++ b/drivers/i2c/chips/tsl2550.c
@@ -432,11 +432,32 @@ static int __devexit tsl2550_remove(struct i2c_client 
*client)
return 0;
 }
 
+#ifdef CONFIG_PM
+
+static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+   return tsl2550_set_power_state(client, 0);
+}
+
+static int tsl2550_resume(struct i2c_client *client)
+{
+   return tsl2550_set_power_state(client, 1);
+}
+
+#else
+
+#define tsl2550_suspendNULL
+#define tsl2550_resume NULL
+
+#endif /* CONFIG_PM */
+
 static struct i2c_driver tsl2550_driver = {
.driver = {
.name   = TSL2550_DRV_NAME,
.owner  = THIS_MODULE,
},
+   .suspend = tsl2550_suspend,
+   .resume = tsl2550_resume,
.probe  = tsl2550_probe,
.remove = __devexit_p(tsl2550_remove),
 };
-
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


i2c: the scheduled I2C RTC driver removal

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=eee87d3196c9a7ac3422f4298e2250ca68d791c1
Commit: eee87d3196c9a7ac3422f4298e2250ca68d791c1
Parent: 569be443e3c1329fc6725988004f5d8a32fe3be5
Author: Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:45 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:45 2008 +0100

i2c: the scheduled I2C RTC driver removal

This patch contains the scheduled removal of legacy I2C RTC drivers with
replacement drivers.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 Documentation/feature-removal-schedule.txt |7 -
 arch/ppc/platforms/83xx/mpc834x_sys.c  |   20 --
 arch/ppc/platforms/85xx/tqm85xx.c  |   21 --
 arch/ppc/platforms/katana.c|   21 --
 drivers/i2c/chips/Kconfig  |   38 ---
 drivers/i2c/chips/Makefile |3 -
 drivers/i2c/chips/ds1337.c |  410 ---
 drivers/i2c/chips/ds1374.c |  267 --
 drivers/i2c/chips/m41t00.c |  413 
 include/linux/i2c-id.h |2 -
 include/linux/m41t00.h |   50 
 11 files changed, 0 insertions(+), 1252 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt 
b/Documentation/feature-removal-schedule.txt
index 9b8291f..2cd16de 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -266,13 +266,6 @@ Who:  Tejun Heo <[EMAIL PROTECTED]>
 
 ---
 
-What:  Legacy RTC drivers (under drivers/i2c/chips)
-When:  November 2007
-Why:   Obsolete. We have a RTC subsystem with better drivers.
-Who:   Jean Delvare <[EMAIL PROTECTED]>
-

-
 What:  iptables SAME target
 When:  1.1. 2008
 Files: net/ipv4/netfilter/ipt_SAME.c, include/linux/netfilter_ipv4/ipt_SAME.h
diff --git a/arch/ppc/platforms/83xx/mpc834x_sys.c 
b/arch/ppc/platforms/83xx/mpc834x_sys.c
index b84f8df..cb0a749 100644
--- a/arch/ppc/platforms/83xx/mpc834x_sys.c
+++ b/arch/ppc/platforms/83xx/mpc834x_sys.c
@@ -224,26 +224,6 @@ mpc834x_sys_init_IRQ(void)
ipic_set_default_priority();
 }
 
-#if defined(CONFIG_I2C_MPC) && defined(CONFIG_SENSORS_DS1374)
-extern ulong   ds1374_get_rtc_time(void);
-extern int ds1374_set_rtc_time(ulong);
-
-static int __init
-mpc834x_rtc_hookup(void)
-{
-   struct timespec tv;
-
-   ppc_md.get_rtc_time = ds1374_get_rtc_time;
-   ppc_md.set_rtc_time = ds1374_set_rtc_time;
-
-   tv.tv_nsec = 0;
-   tv.tv_sec = (ppc_md.get_rtc_time)();
-   do_settimeofday(&tv);
-
-   return 0;
-}
-late_initcall(mpc834x_rtc_hookup);
-#endif
 static __inline__ void
 mpc834x_sys_set_bat(void)
 {
diff --git a/arch/ppc/platforms/85xx/tqm85xx.c 
b/arch/ppc/platforms/85xx/tqm85xx.c
index 4ee2bd1..27ce389 100644
--- a/arch/ppc/platforms/85xx/tqm85xx.c
+++ b/arch/ppc/platforms/85xx/tqm85xx.c
@@ -258,27 +258,6 @@ int tqm85xx_show_cpuinfo(struct seq_file *m)
return 0;
 }
 
-#if defined(CONFIG_I2C) && defined(CONFIG_SENSORS_DS1337)
-extern ulong ds1337_get_rtc_time(void);
-extern int ds1337_set_rtc_time(unsigned long nowtime);
-
-static int __init
-tqm85xx_rtc_hookup(void)
-{
-   struct timespec tv;
-
-ppc_md.set_rtc_time = ds1337_set_rtc_time;
-ppc_md.get_rtc_time = ds1337_get_rtc_time;
-
-   tv.tv_nsec = 0;
-   tv.tv_sec = (ppc_md.get_rtc_time)();
-   do_settimeofday(&tv);
-
-   return 0;
-}
-late_initcall(tqm85xx_rtc_hookup);
-#endif
-
 #ifdef CONFIG_PCI
 /*
  * interrupt routing
diff --git a/arch/ppc/platforms/katana.c b/arch/ppc/platforms/katana.c
index 52f63e6..fe6e88c 100644
--- a/arch/ppc/platforms/katana.c
+++ b/arch/ppc/platforms/katana.c
@@ -838,27 +838,6 @@ katana_find_end_of_memory(void)
return bdp->bi_memsize;
 }
 
-#if defined(CONFIG_I2C_MV64XXX) && defined(CONFIG_SENSORS_M41T00)
-extern ulong   m41t00_get_rtc_time(void);
-extern int m41t00_set_rtc_time(ulong);
-
-static int __init
-katana_rtc_hookup(void)
-{
-   struct timespec tv;
-
-   ppc_md.get_rtc_time = m41t00_get_rtc_time;
-   ppc_md.set_rtc_time = m41t00_set_rtc_time;
-
-   tv.tv_nsec = 0;
-   tv.tv_sec = (ppc_md.get_rtc_time)();
-   do_settimeofday(&tv);
-
-   return 0;
-}
-late_initcall(katana_rtc_hookup);
-#endif
-
 #if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(CONFIG_SERIAL_MPSC_CONSOLE)
 static void __init
 katana_map_io(void)
diff --git a/drivers/i2c/chips/Kconfig b/drivers/i2c/chips/Kconfig
index 17702b3..fe3008e 100644
--- a/drivers/i2c/chips/Kconfig
+++ b/drivers/i2c/chips/Kconfig
@@ -4,32 +4,6 @@
 
 menu "Miscellaneous I2C Chip support"
 
-config SENSORS_DS1337
-   tristate "Dallas DS1337 and DS1339 Real Time Clock (DEPRECATED)"
-   depends on EXPERIMENTAL
-   help
-   

ixp4xx-i2c-gpio

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a4a2387717ec57ec2a9154beb281e09c19fc26e
Commit: 5a4a2387717ec57ec2a9154beb281e09c19fc26e
Parent: eee87d3196c9a7ac3422f4298e2250ca68d791c1
Author: Michael-Luke Jones <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:46 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:46 2008 +0100

ixp4xx-i2c-gpio

Migrate all ixp4xx devices to the bitbanging I2C bus driver utilizing
the arch-neutral GPIO API (linux/i2c-gpio.h).

Tested by the nslu2-linux and openwrt projects in public firmware releases.

Signed-off-by: Michael-Luke Jones <[EMAIL PROTECTED]>
Acked-by: Rod Whitby <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 arch/arm/mach-ixp4xx/avila-setup.c   |   14 +++---
 arch/arm/mach-ixp4xx/dsmg600-setup.c |   13 -
 arch/arm/mach-ixp4xx/ixdp425-setup.c |   14 +++---
 arch/arm/mach-ixp4xx/nas100d-setup.c |   14 --
 arch/arm/mach-ixp4xx/nslu2-setup.c   |   14 --
 5 files changed, 38 insertions(+), 31 deletions(-)

diff --git a/arch/arm/mach-ixp4xx/avila-setup.c 
b/arch/arm/mach-ixp4xx/avila-setup.c
index d59b8dc..e38f45f 100644
--- a/arch/arm/mach-ixp4xx/avila-setup.c
+++ b/arch/arm/mach-ixp4xx/avila-setup.c
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -47,18 +48,17 @@ static struct platform_device avila_flash = {
.resource   = &avila_flash_resource,
 };
 
-static struct ixp4xx_i2c_pins avila_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data avila_i2c_gpio_data = {
.sda_pin= AVILA_SDA_PIN,
.scl_pin= AVILA_SCL_PIN,
 };
 
-static struct platform_device avila_i2c_controller = {
-   .name   = "IXP4XX-I2C",
+static struct platform_device avila_i2c_gpio = {
+   .name   = "i2c-gpio",
.id = 0,
-   .dev= {
-   .platform_data = &avila_i2c_gpio_pins,
+   .dev = {
+   .platform_data  = &avila_i2c_gpio_data,
},
-   .num_resources  = 0
 };
 
 static struct resource avila_uart_resources[] = {
@@ -133,7 +133,7 @@ static struct platform_device avila_pata = {
 };
 
 static struct platform_device *avila_devices[] __initdata = {
-   &avila_i2c_controller,
+   &avila_i2c_gpio,
&avila_flash,
&avila_uart
 };
diff --git a/arch/arm/mach-ixp4xx/dsmg600-setup.c 
b/arch/arm/mach-ixp4xx/dsmg600-setup.c
index 1e75e10..c473d40 100644
--- a/arch/arm/mach-ixp4xx/dsmg600-setup.c
+++ b/arch/arm/mach-ixp4xx/dsmg600-setup.c
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -37,15 +38,17 @@ static struct platform_device dsmg600_flash = {
.resource   = &dsmg600_flash_resource,
 };
 
-static struct ixp4xx_i2c_pins dsmg600_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data dsmg600_i2c_gpio_data = {
.sda_pin= DSMG600_SDA_PIN,
.scl_pin= DSMG600_SCL_PIN,
 };
 
-static struct platform_device dsmg600_i2c_controller = {
-   .name   = "IXP4XX-I2C",
+static struct platform_device dsmg600_i2c_gpio = {
+   .name   = "i2c-gpio",
.id = 0,
-   .dev.platform_data  = &dsmg600_i2c_gpio_pins,
+   .dev = {
+   .platform_data  = &dsmg600_i2c_gpio_data,
+   },
 };
 
 #ifdef CONFIG_LEDS_CLASS
@@ -116,7 +119,7 @@ static struct platform_device dsmg600_uart = {
 };
 
 static struct platform_device *dsmg600_devices[] __initdata = {
-   &dsmg600_i2c_controller,
+   &dsmg600_i2c_gpio,
&dsmg600_flash,
 };
 
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c 
b/arch/arm/mach-ixp4xx/ixdp425-setup.c
index d5008d8..e89070d 100644
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -15,6 +15,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -120,18 +121,17 @@ static struct platform_device ixdp425_flash_nand = {
 };
 #endif /* CONFIG_MTD_NAND_PLATFORM */
 
-static struct ixp4xx_i2c_pins ixdp425_i2c_gpio_pins = {
+static struct i2c_gpio_platform_data ixdp425_i2c_gpio_data = {
.sda_pin= IXDP425_SDA_PIN,
.scl_pin= IXDP425_SCL_PIN,
 };
 
-static struct platform_device ixdp425_i2c_controller = {
-   .name   = "IXP4XX-I2C",
+static struct platform_device ixdp425_i2c_gpio = {
+   .name   = "i2c-gpio",
.id = 0,
-   .dev= {
-   .platform_data = &ixdp425_i2c_gpio_pins,
+   .dev = {
+   .platform_data  = &ixdp425_i2c_gpio_data,
},
-   .num_resources  = 0
 };
 
 static struct resource ixdp425_uart_resources[] = {
@@ -178,7 +178,7 @@ static struct platform_device ixdp425_uart = {
 };
 
 static struct platfor

i2c: some overdue driver removal

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e8b99251be8b6f992baa88e3a6ba3c4ae01660b
Commit: 7e8b99251be8b6f992baa88e3a6ba3c4ae01660b
Parent: 5a4a2387717ec57ec2a9154beb281e09c19fc26e
Author: Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:46 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:46 2008 +0100

i2c: some overdue driver removal

This patch contains the overdue removal of three I2C drivers.

[JD: In fact only i2c-ixp4xx can be removed at the moment, the other two
platforms don't implement the generic GPIO layer yet.]

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 Documentation/feature-removal-schedule.txt |8 --
 drivers/i2c/busses/Kconfig |   14 --
 drivers/i2c/busses/Makefile|1 -
 drivers/i2c/busses/i2c-ixp4xx.c|  178 
 include/asm-arm/arch-ixp4xx/platform.h |   11 --
 include/linux/i2c-id.h |1 -
 6 files changed, 0 insertions(+), 213 deletions(-)

diff --git a/Documentation/feature-removal-schedule.txt 
b/Documentation/feature-removal-schedule.txt
index 2cd16de..fb51d38 100644
--- a/Documentation/feature-removal-schedule.txt
+++ b/Documentation/feature-removal-schedule.txt
@@ -225,14 +225,6 @@ Who:   Len Brown <[EMAIL PROTECTED]>
 
 ---
 
-What:  i2c-ixp2000, i2c-ixp4xx and scx200_i2c drivers
-When:  September 2007
-Why:   Obsolete. The new i2c-gpio driver replaces all hardware-specific
-   I2C-over-GPIO drivers.
-Who:   Jean Delvare <[EMAIL PROTECTED]>
-

-
 What:  'time' kernel boot parameter
 When:  January 2008
 Why:   replaced by 'printk.time=' so that printk timestamps can be
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig
index c466c6c..2cef92a 100644
--- a/drivers/i2c/busses/Kconfig
+++ b/drivers/i2c/busses/Kconfig
@@ -259,20 +259,6 @@ config I2C_IOP3XX
  This driver can also be built as a module.  If so, the module
  will be called i2c-iop3xx.
 
-config I2C_IXP4XX
-   tristate "IXP4xx GPIO-Based I2C Interface (DEPRECATED)"
-   depends on ARCH_IXP4XX
-   select I2C_ALGOBIT
-   help
- Say Y here if you have an Intel IXP4xx(420,421,422,425) based 
- system and are using GPIO lines for an I2C bus.
-
- This support is also available as a module. If so, the module
- will be called i2c-ixp4xx.
-
- This driver is deprecated and will be dropped soon. Use i2c-gpio
- instead.
-
 config I2C_IXP2000
tristate "IXP2000 GPIO-Based I2C Interface (DEPRECATED)"
depends on ARCH_IXP2000
diff --git a/drivers/i2c/busses/Makefile b/drivers/i2c/busses/Makefile
index 81d43c2..ea7068f 100644
--- a/drivers/i2c/busses/Makefile
+++ b/drivers/i2c/busses/Makefile
@@ -20,7 +20,6 @@ obj-$(CONFIG_I2C_I810)+= i2c-i810.o
 obj-$(CONFIG_I2C_IBM_IIC)  += i2c-ibm_iic.o
 obj-$(CONFIG_I2C_IOP3XX)   += i2c-iop3xx.o
 obj-$(CONFIG_I2C_IXP2000)  += i2c-ixp2000.o
-obj-$(CONFIG_I2C_IXP4XX)   += i2c-ixp4xx.o
 obj-$(CONFIG_I2C_POWERMAC) += i2c-powermac.o
 obj-$(CONFIG_I2C_MPC)  += i2c-mpc.o
 obj-$(CONFIG_I2C_MV64XXX)  += i2c-mv64xxx.o
diff --git a/drivers/i2c/busses/i2c-ixp4xx.c b/drivers/i2c/busses/i2c-ixp4xx.c
deleted file mode 100644
index 069ed7f..000
--- a/drivers/i2c/busses/i2c-ixp4xx.c
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * drivers/i2c/busses/i2c-ixp4xx.c
- *
- * Intel's IXP4xx XScale NPU chipsets (IXP420, 421, 422, 425) do not have
- * an on board I2C controller but provide 16 GPIO pins that are often
- * used to create an I2C bus. This driver provides an i2c_adapter 
- * interface that plugs in under algo_bit and drives the GPIO pins
- * as instructed by the alogorithm driver.
- *
- * Author: Deepak Saxena <[EMAIL PROTECTED]>
- *
- * Copyright (c) 2003-2004 MontaVista Software Inc.
- *
- * This file is licensed under the terms of the GNU General Public 
- * License version 2. This program is licensed "as is" without any 
- * warranty of any kind, whether express or implied.
- *
- * NOTE: Since different platforms will use different GPIO pins for
- *   I2C, this driver uses an IXP4xx-specific platform_data
- *   pointer to pass the GPIO numbers to the driver. This 
- *   allows us to support all the different IXP4xx platforms
- *   w/o having to put #ifdefs in this driver.
- *
- *   See arch/arm/mach-ixp4xx/ixdp425.c for an example of building a 
- *   device list and filling in the ixp4xx_i2c_pins data structure 
- *   that is passed as the platform_data to this driver.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include   /* Pick up IXP4xx-specific bits */
-
-static inline int ixp4xx_scl_pin(void *data)
-{
-   return ((struct ixp4xx

i2c-pxa: Remove hardcoded #ifdef and use cpu_is_pxa27x

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=59d70df025473931c500d6d60510798e4bfa3279
Commit: 59d70df025473931c500d6d60510798e4bfa3279
Parent: 7e8b99251be8b6f992baa88e3a6ba3c4ae01660b
Author: eric miao <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:46 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:46 2008 +0100

i2c-pxa: Remove hardcoded #ifdef and use cpu_is_pxa27x

remove #ifdef CONFIG_PXA27x .. #endif and use cpu_is_pxa() macros
so that a single binary can support PXA25x/PXA27x/PXA3xx at run-time.

Signed-off-by: eric miao <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/busses/i2c-pxa.c |   58 +-
 1 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 6426a61..da3ecf5 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -840,6 +840,32 @@ static const struct i2c_algorithm i2c_pxa_algorithm = {
.functionality  = i2c_pxa_functionality,
 };
 
+static void i2c_pxa_enable(struct platform_device *dev)
+{
+   if (cpu_is_pxa27x()) {
+   switch (dev->id) {
+   case 0:
+   pxa_gpio_mode(GPIO117_I2CSCL_MD);
+   pxa_gpio_mode(GPIO118_I2CSDA_MD);
+   break;
+   case 1:
+   local_irq_disable();
+   PCFR |= PCFR_PI2CEN;
+   local_irq_enable();
+   break;
+   }
+   }
+}
+
+static void i2c_pxa_disable(struct platform_device *dev)
+{
+   if (cpu_is_pxa27x() && dev->id == 1) {
+   local_irq_disable();
+   PCFR &= ~PCFR_PI2CEN;
+   local_irq_enable();
+   }
+}
+
 #define res_len(r) ((r)->end - (r)->start + 1)
 static int i2c_pxa_probe(struct platform_device *dev)
 {
@@ -899,25 +925,13 @@ static int i2c_pxa_probe(struct platform_device *dev)
 #endif
 
clk_enable(i2c->clk);
-#ifdef CONFIG_PXA27x
-   switch (dev->id) {
-   case 0:
-   pxa_gpio_mode(GPIO117_I2CSCL_MD);
-   pxa_gpio_mode(GPIO118_I2CSDA_MD);
-   break;
-   case 1:
-   local_irq_disable();
-   PCFR |= PCFR_PI2CEN;
-   local_irq_enable();
-   }
-#endif
+   i2c_pxa_enable(dev);
 
ret = request_irq(irq, i2c_pxa_handler, IRQF_DISABLED,
  i2c->adap.name, i2c);
if (ret)
goto ereqirq;
 
-
i2c_pxa_reset(i2c);
 
i2c->adap.algo_data = i2c;
@@ -955,14 +969,7 @@ eadapt:
free_irq(irq, i2c);
 ereqirq:
clk_disable(i2c->clk);
-
-#ifdef CONFIG_PXA27x
-   if (dev->id == 1) {
-   local_irq_disable();
-   PCFR &= ~PCFR_PI2CEN;
-   local_irq_enable();
-   }
-#endif
+   i2c_pxa_disable(dev);
 eremap:
clk_put(i2c->clk);
 eclk:
@@ -983,14 +990,7 @@ static int i2c_pxa_remove(struct platform_device *dev)
 
clk_disable(i2c->clk);
clk_put(i2c->clk);
-
-#ifdef CONFIG_PXA27x
-   if (dev->id == 1) {
-   local_irq_disable();
-   PCFR &= ~PCFR_PI2CEN;
-   local_irq_enable();
-   }
-#endif
+   i2c_pxa_disable(dev);
 
release_mem_region(i2c->iobase, i2c->iosize);
kfree(i2c);
-
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


i2c-algo-bit: Whitespace fixes (+ NAK/ARB comments)

2008-01-27 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cf978ab2846d86709802f38c80d1d53da364bf51
Commit: cf978ab2846d86709802f38c80d1d53da364bf51
Parent: 59d70df025473931c500d6d60510798e4bfa3279
Author: David Brownell <[EMAIL PROTECTED]>
AuthorDate: Sun Jan 27 18:14:46 2008 +0100
Committer:  Jean Delvare <[EMAIL PROTECTED]>
CommitDate: Sun Jan 27 18:14:46 2008 +0100

i2c-algo-bit: Whitespace fixes (+ NAK/ARB comments)

Fix *LOTS* of whitespace goofs and checkpatch.pl warnings, strangely
parenthesized ternary expressions, and other CodingStyle glitches.

Signed-off-by: David Brownell <[EMAIL PROTECTED]>
Signed-off-by: Jean Delvare <[EMAIL PROTECTED]>
---
 drivers/i2c/algos/i2c-algo-bit.c |  202 --
 1 files changed, 105 insertions(+), 97 deletions(-)

diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c
index a37cb6b..260c5d7 100644
--- a/drivers/i2c/algos/i2c-algo-bit.c
+++ b/drivers/i2c/algos/i2c-algo-bit.c
@@ -1,7 +1,7 @@
-/* - */
-/* i2c-algo-bit.c i2c driver algorithms for bit-shift adapters  */
-/* - */
-/*   Copyright (C) 1995-2000 Simon G. Vogl
+/* -
+ * i2c-algo-bit.c i2c driver algorithms for bit-shift adapters
+ * -
+ *   Copyright (C) 1995-2000 Simon G. Vogl
 
 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
@@ -15,8 +15,8 @@
 
 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.   */
-/* - */
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * - */
 
 /* With some changes from Frodo Looijaard <[EMAIL PROTECTED]>, Kyösti Mälkki
<[EMAIL PROTECTED]> and Jean Delvare <[EMAIL PROTECTED]> */
@@ -60,26 +60,26 @@ MODULE_PARM_DESC(i2c_debug,
 
 /* --- setting states on the bus with the right timing: ---
*/
 
-#define setsda(adap,val) adap->setsda(adap->data, val)
-#define setscl(adap,val) adap->setscl(adap->data, val)
-#define getsda(adap) adap->getsda(adap->data)
-#define getscl(adap) adap->getscl(adap->data)
+#define setsda(adap, val)  adap->setsda(adap->data, val)
+#define setscl(adap, val)  adap->setscl(adap->data, val)
+#define getsda(adap)   adap->getsda(adap->data)
+#define getscl(adap)   adap->getscl(adap->data)
 
 static inline void sdalo(struct i2c_algo_bit_data *adap)
 {
-   setsda(adap,0);
+   setsda(adap, 0);
udelay((adap->udelay + 1) / 2);
 }
 
 static inline void sdahi(struct i2c_algo_bit_data *adap)
 {
-   setsda(adap,1);
+   setsda(adap, 1);
udelay((adap->udelay + 1) / 2);
 }
 
 static inline void scllo(struct i2c_algo_bit_data *adap)
 {
-   setscl(adap,0);
+   setscl(adap, 0);
udelay(adap->udelay / 2);
 }
 
@@ -91,22 +91,21 @@ static int sclhi(struct i2c_algo_bit_data *adap)
 {
unsigned long start;
 
-   setscl(adap,1);
+   setscl(adap, 1);
 
/* Not all adapters have scl sense line... */
if (!adap->getscl)
goto done;
 
-   start=jiffies;
-   while (! getscl(adap) ) {   
-   /* the hw knows how to read the clock line,
-* so we wait until it actually gets high.
-* This is safer as some chips may hold it low
-* while they are processing data internally. 
-*/
-   if (time_after_eq(jiffies, start+adap->timeout)) {
+   start = jiffies;
+   while (!getscl(adap)) {
+   /* This hw knows how to read the clock line, so we wait
+* until it actually gets high.  This is safer as some
+* chips may hold it low ("clock stretching") while they
+* are processing data internally.
+*/
+   if (time_after_eq(jiffies, start + adap->timeout))
return -ETIMEDOUT;
-   }
cond_resched();
}
 #ifdef DEBUG
@@ -118,11 +117,11 @@ static int sclhi(struct i2c_algo_bit_data *adap)
 done:
udelay(adap->udelay);
return 0;
-} 
+}
 
 
 /* --- other auxiliary functions --
*/
-static void i2c_start(struct i2c_algo_bit_data *adap) 
+static void i2c_start(struct i2c_algo_bit_data *adap)
 {
/* assert: scl, sda are high */
sets

  1   2   >