Re: Problems with nVidia nForce 520 Chipset

2007-07-26 Thread Tejun Heo
Craig Block wrote:
> Hello,
> 
> I'm having a problem getting Linux to handle the SATA drives and controllers 
> on
> a new computer with an ASUS M2N-X motherboard.  This is a socket AM2 board and
> has an nVidia nForce 520 chipset.  It has three controller mode settings in 
> the
> BIOS, SATA, AHCI, and RAID.
> 
> I built and tried a couple kernels, one with SATA_NV plus BLK_DEV_IDECD and 
> the
> other with SATA_AHCI plus PATA_AMD.
> 
> With the controllers in SATA mode, the kernel built with SATA_NV doesn't see
> the SATA controllers at all.  The PATA CD drive links to hda and works
> properly.  I tried the same kernel on an nForce 4 system and everything works
> right.
>  
> With the controllers in AHCI mode, the kernel built with SATA_AHCI, hangs when
> probing the SATA controllers.  It literally takes about a minute to get 
> through
> each one.  It never does link any drives to them.  The PATA CD drive links to
> sr0 and seems to work okay.
> 
> I've had MS Windows working without issue in either mode, using the canned IDE
> driver in SATA mode and the nVidia AHCI driver in AHCI mode.
> 
> Output from "dmesg" and "lspci -n -vvv" commands is attached.

Does 'noapic' kernel parameter help?

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: sata_nv or port issue?

2007-07-26 Thread Tejun Heo
Zivago Lee wrote:
> I'm running Ubuntu Feisty on the 2.6.20 kernel (Linux miyagip
> 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux).

Please give a shot at 2.6.22.  It will report more detail about what's
going on.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] [POWERPC] MPC8349E-mITX: use platform IDE driver for CF interface

2007-07-26 Thread Sergei Shtylyov

Hello.

Vitaly Bordug wrote:


  I acn undertand your complaint in the context of an OF driver
(which we don't have yet) but "mmio-ide" just means nothing to the
current driver, and it doesn't convery enough info on the
programming interface for the conceivable OF driver, it also does
need to know at least "reg-stride" (and maybe "reg-size" in case
only 16/32-bit accesses can be used).  Well, if such driver will be
written, I/O mapping support will probably be dropped from it, so
indeed, calling it mmio-ide.c would make sense.  But that can be
added when this driver is done, and for now 


I don't think the details of what Linux code currently exists should 
drive the device tree binding.  That the current patches use 
platform_device glue code is an implementation detail (and one I'd 
rather see go away, in favor of a driver that supports both 
platform_device and of_device).



I'd really prefer the board name to appear in the "compatible" prop
(to which "mmio-ide" can be appended)...



Sure, that's always good...  it was the "instead" that I objected to.



Hmmm. So what is finally suggested devicetree node for this beast - can 
somebody refine?



I am a little bit confused about decided device_type


   My understanding is that "ata" has been already used, so there's no sense 
in introducing "ide". Anyway, Segher will just say that "device_type" shoudn't 
matter and even be present. ;-)


> and compatible fields...

   In my understanding, as "mmio-ide" currectly makes no sense, it shouldn't 
even appear there.  And since "mpc8349emitx-cf" (or whatever would be most 
generic name for those boards with the same type of CF IDE mapping) should be 
imply the shift value, this property should also be optional, i.e. passing 
hard coded value with platform_device would do.


MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] cs5535: check ide_config_drive_speed() return value

2007-07-26 Thread Sergei Shtylyov

Bartlomiej Zolnierkiewicz wrote:


Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>


Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>

MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] au1xxx: fix au1xxx_set_pio_mode()

2007-07-26 Thread Sergei Shtylyov

Bartlomiej Zolnierkiewicz wrote:


Set transfer mode on the device before programming the host controller for
the new timings (matches what auide_tune_chipset() is doing wrt DMA modes).


  It's not that the most other drives are doing something different... :-)


Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>


Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>

MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [IDE] Platform IDE driver (was: MMIO IDE driver)

2007-07-26 Thread Guennadi Liakhovetski
On Thu, 26 Jul 2007, Sergei Shtylyov wrote:

> Guennadi Liakhovetski wrote:
> 
> > Ok, thanks for the explanation Alan. So, there's no technical argument, 
> > just "being nice to the users", and add a new driver, which we know we'll 
> > have to remove soon, thus having to persuade its users, who by that time 
> 
> Define "soon". :-)

"Soon" in this case means, we NOW have a replacement driver and we aim at 
deprecating the IDE driver in its favour.

> > will get used to it and will not want to invest money into switching to 
> > another one...
> 
> Invest into what if the drivers are functionally identical?

For example, into porting user space (replace hdx with sdx). And even 
switching to a "functionally identical" driver requires a new complete 
testing cycle... No, I won't be in that situation, so, it's not my money 
I'm worrying about. But I know there are companies for whom releasing a 
new version of /etc/fstab is a considerable expense... Not that I cared 
about them anyway.

Thanks
Guennadi
---
Guennadi Liakhovetski
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [IDE] Platform IDE driver (was: MMIO IDE driver)

2007-07-26 Thread Sergei Shtylyov

Hello.

Guennadi Liakhovetski wrote:

driver to using platform-device. I got a reply, that it's not worth it now 
that IDE is slowly becoming obsolete, and the pata_platform serves the 
perpose perfectly well. I found this argument reasonable, I had the same 
doubt, just wanted to double-check. So, why do we now need a new legacy 
(a/drivers/ide/legacy/ide_platform.c) driver when a "modern" driver 
exists?



We don't *need* it but some people still want to use old IDE and the
author was willing to make it neatly compatible so that anything that
works with the pata_platform should be able to use the ide_platform
driver and vice versa. For the shorter term that can only be a good thing
- arch code doesn't need to care about which driver is used, end users
can pick and it doesn't end up adding new ties between code and old IDE.


Ok, thanks for the explanation Alan. So, there's no technical argument, 
just "being nice to the users", and add a new driver, which we know we'll 
have to remove soon, thus having to persuade its users, who by that time 


   Define "soon". :-)

will get used to it and will not want to invest money into switching to 
another one...


   Invest into what if the drivers are functionally identical?


Thanks
Guennadi


MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [IDE] Platform IDE driver (was: MMIO IDE driver)

2007-07-26 Thread Bartlomiej Zolnierkiewicz
On Wednesday 25 July 2007, Alan Cox wrote:
> > pata_platform and ide_platform are carrying same driver names,
> > to easily switch between these drivers, without need to touch
> > platform code.
> > 
> > Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> > Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> 
> Acked-by: Alan Cox <[EMAIL PROTECTED]>

added
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/11] ide-pmac: remove pmac_ide_do_setfeature() (take 2)

2007-07-26 Thread Bartlomiej Zolnierkiewicz
On Tuesday 24 July 2007, Benjamin Herrenschmidt wrote:
> On Tue, 2007-07-24 at 00:29 +0200, Bartlomiej Zolnierkiewicz wrote:
> > Use ide_config_drive_speed() instead of pmac_ide_do_setfeature() and remove
> > the latter, also  ide-iops.c::__ide_wait_stat() could be static again.
> > 
> > Since for IDE PMAC host driver IDE_CONTROL_REG is always true, device's
> > ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than
> > the only changes in behavior are:
> > 
> > * if PIO mode is set then ->dma_off_queitly is called to disable DMA
> > 
> > * if setting transfer mode fails ide_dump_status() is called to dump status
> 
> I'll test that today.

ping?
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [IDE] Platform IDE driver (was: MMIO IDE driver)

2007-07-26 Thread Guennadi Liakhovetski
On Wed, 25 Jul 2007, Alan Cox wrote:

> > driver to using platform-device. I got a reply, that it's not worth it now 
> > that IDE is slowly becoming obsolete, and the pata_platform serves the 
> > perpose perfectly well. I found this argument reasonable, I had the same 
> > doubt, just wanted to double-check. So, why do we now need a new legacy 
> > (a/drivers/ide/legacy/ide_platform.c) driver when a "modern" driver 
> > exists?
> 
> We don't *need* it but some people still want to use old IDE and the
> author was willing to make it neatly compatible so that anything that
> works with the pata_platform should be able to use the ide_platform
> driver and vice versa. For the shorter term that can only be a good thing
> - arch code doesn't need to care about which driver is used, end users
> can pick and it doesn't end up adding new ties between code and old IDE.

Ok, thanks for the explanation Alan. So, there's no technical argument, 
just "being nice to the users", and add a new driver, which we know we'll 
have to remove soon, thus having to persuade its users, who by that time 
will get used to it and will not want to invest money into switching to 
another one...

Thanks
Guennadi
---
Guennadi Liakhovetski
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Re+: SATA hard drive no longer comes up as /dev/sda on 2.6.22 with Intel ICH6M

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Hi,

On Thursday 26 July 2007, Tejun Heo wrote:
> Hello,
> 
> P.C.Chan wrote:
> > The last straw which breaks the SATA support is
> > "CONFIG_IDE_GENERIC=y".   Please see enclosed config files.
> > 
> > The description being:
> > 
> > *generic/default IDE chipset support (IDE_GENERIC)
> > 
> > If unsure, say Y.*
> > 
> > The linux distributions would have a hard time in preparing a kernel for
> > general use,  when CONFIG_IDE_GENERIC and libata are somewhat mutally
> > exclusive for Intel chipset.
> 
> Distros usually know better and don't build in the generic driver.  It's
> built as a module and used only as the last resort.
> 
> > I guess it should at least say:
> > 
> > *If unsure, say N.*
> > 
> > It did no harm prior to 2.6.22 though.
> 
> That didn't to any harm probably because ATA quirk code reserved the
> area for libata during PCI initialization, so the generic driver
> couldn't grab the port before libata.  Now that the quirk is gone, the
> generic driver grabs the first IDE channel before libata and you don't
> have dma for your drive.
> 
> cc'ing Bartlomiej.  Bartlomiej, I think it would be better not to
> default to Y for CONFIG_IDE_GENERIC.  For most cases, it just causes
> misconfiguration and confusion these days.

Fully agreed, care to submit a patch?

Thanks,
Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: CONFIG_IDE_PROC_FS: /sys is not full replacement of /proc

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Hi,

On Wednesday 18 July 2007, Andrey Borzenkov wrote:
> May be I miss something obvious but most information that was available 
> in /proc/ide is missing under /sys. At the very least, Mandriva hardware 
> detection expects /proc/ide/hdX/model; nothing close is under /sys.

It is really better to obtain some information using IOCTLs (i.e. SMART
data) but for other like "model" it makes perfect sense to add them to /sys.

> Are there any plans to extend IDE /sys interface to provide full range of 
> information from /proc? Alternatively I appreciate description (or pointer to 
> thereof) how to get information that was available under /proc/ide 
> without /proc/ide :)

Could you please add the information that you find missing to the existing
infrastructure in ide.c (ide_dev_attrs[] table)?

Thanks,
Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] amd74xx/via82cxxx: check ide_config_drive_speed() return value

2007-07-26 Thread Bartlomiej Zolnierkiewicz

* Check ide_config_drive_speed() return value.

* While at also call ide_config_drive_speed() if the transfer mode is
  XFER_PIO_SLOW (this case happens iff the transfer mode has already been
  set on the device by ide-proc.c::set_xfer_rate()) and remove redundant
  setting of ->{init,current}_speed.

* Bump driver version.

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/amd74xx.c   |   10 +++---
 drivers/ide/pci/via82cxxx.c |   10 +++---
 2 files changed, 6 insertions(+), 14 deletions(-)

Index: b/drivers/ide/pci/amd74xx.c
===
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -1,5 +1,5 @@
 /*
- * Version 2.22
+ * Version 2.23
  *
  * AMD 755/756/766/8111 and nVidia nForce/2/2s/3/3s/CK804/MCP04
  * IDE driver for Linux.
@@ -240,8 +240,8 @@ static int amd_set_drive(ide_drive_t *dr
struct ide_timing t, p;
int T, UT;
 
-   if (speed != XFER_PIO_SLOW)
-   ide_config_drive_speed(drive, speed);
+   if (ide_config_drive_speed(drive, speed))
+   return 1;
 
T = 10 / amd_clock;
UT = (amd_config->udma_mask == ATA_UDMA2) ? T : (T / 2);
@@ -258,10 +258,6 @@ static int amd_set_drive(ide_drive_t *dr
 
amd_set_speed(HWIF(drive)->pci_dev, drive->dn, &t);
 
-   if (!drive->init_speed) 
-   drive->init_speed = speed;
-   drive->current_speed = speed;
-
return 0;
 }
 
Index: b/drivers/ide/pci/via82cxxx.c
===
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
 /*
  *
- * Version 3.47
+ * Version 3.48
  *
  * VIA IDE driver for Linux. Supported southbridges:
  *
@@ -164,8 +164,8 @@ static int via_set_drive(ide_drive_t *dr
struct ide_timing t, p;
unsigned int T, UT;
 
-   if (speed != XFER_PIO_SLOW)
-   ide_config_drive_speed(drive, speed);
+   if (ide_config_drive_speed(drive, speed))
+   return 1;
 
T = 10 / via_clock;
 
@@ -186,10 +186,6 @@ static int via_set_drive(ide_drive_t *dr
 
via_set_speed(HWIF(drive), drive->dn, &t);
 
-   if (!drive->init_speed)
-   drive->init_speed = speed;
-   drive->current_speed = speed;
-
return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pata_cmd64x: Correct the speed ranges

2007-07-26 Thread Jeff Garzik

Sergei Shtylyov wrote:
   Note that the olde driver has MWDMA fixed, and the new one has it 
still borken, yet MWDMA2 is the mode you're using.



What about MWDMA is broken?

Jeff


-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ide: move ide_config_drive_speed() calls to upper layers

2007-07-26 Thread Bartlomiej Zolnierkiewicz
On Friday 27 July 2007, Bartlomiej Zolnierkiewicz wrote:

> * Add IDE_HFLAG_POST_SET_MODE host to indicate the need to program the
>   host for the transfer mode after programming the device.  Set it in
>   au1xxx-ide/cs5530/cs5535/pdc202xx_new/sc1200/via82cxxx host drivers.

and amd74xx :)
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 11/11] ide-pmac: remove pmac_ide_do_setfeature() (take 2)

2007-07-26 Thread Benjamin Herrenschmidt
On Thu, 2007-07-26 at 20:04 +0200, Bartlomiej Zolnierkiewicz wrote:
> On Tuesday 24 July 2007, Benjamin Herrenschmidt wrote:
> > On Tue, 2007-07-24 at 00:29 +0200, Bartlomiej Zolnierkiewicz wrote:
> > > Use ide_config_drive_speed() instead of pmac_ide_do_setfeature() and 
> > > remove
> > > the latter, also  ide-iops.c::__ide_wait_stat() could be static again.
> > > 
> > > Since for IDE PMAC host driver IDE_CONTROL_REG is always true, device's
> > > ->quirk_list is always zero and ->ide_dma_host_{on,off} are nops than
> > > the only changes in behavior are:
> > > 
> > > * if PIO mode is set then ->dma_off_queitly is called to disable DMA
> > > 
> > > * if setting transfer mode fails ide_dump_status() is called to dump 
> > > status
> > 
> > I'll test that today.
> 
> ping?

Oops, sorry, got delayed by urgent work things among others. I'll get
back to that today or next week, not sure yet.

BTW. It might make my life easier if you could email me a tarball of
your full current quilt serie :-)

Cheers,
Ben.

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pata_cmd64x: Correct the speed ranges

2007-07-26 Thread Mikael Pettersson
On Thu, 26 Jul 2007 18:43:01 +0100, Alan Cox wrote:
> I must have been half asleep when doing the original code
> 
> Signed-off-by: Alan Cox <[EMAIL PROTECTED]>
> 
[patch to fix .udma_mask in pata_cmd64x omitted]

This fix inspired me to finally try to convert my Sun Ultra5
(sparc64) with a CMD646 [1095:0646 rev 03] to libata.

With pata_cmd64x the machine has so far survived a usual
boot/mrproper/reconfig/make/install/reboot kernel update
cycle without any issues, and performance seems to be the
same as with the old IDE driver.

/Mikael

scsi0 : pata_cmd64x
scsi1 : pata_cmd64x
ata1: PATA max MWDMA2 cmd 0x01fe02c0 ctl 0x01fe02ca bmdma 
0x01fe02c00020 irq 14
ata2: PATA max MWDMA2 cmd 0x01fe02c00010 ctl 0x01fe02c0001a bmdma 
0x01fe02c00028 irq 14
ata1.00: ATA-4: ST320420A, 3.21, max UDMA/66
ata1.00: 39851760 sectors, multi 0: LBA 
pata_cmd64x: active 3 recovery 1 setup 1.
ata1.00: configured for MWDMA2
ata2.00: ATAPI: CRD-8483B, 1.00, max UDMA/33
pata_cmd64x: active 3 recovery 1 setup 1.
ata2.00: configured for MWDMA2
scsi 0:0:0:0: Direct-Access ATA  ST320420A3.21 PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 39851760 512-byte hardware sectors (20404 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: [sda] 39851760 512-byte hardware sectors (20404 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
 sda: sda1 sda2 sda3 sda4 sda5
sd 0:0:0:0: [sda] Attached SCSI disk
scsi 1:0:0:0: CD-ROMLG   CD-ROM CRD-8483B 1.00 PQ: 0 ANSI: 5
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [IDE] Platform IDE driver (was: MMIO IDE driver)

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Hi,

On Thursday 26 July 2007, Guennadi Liakhovetski wrote:
> On Wed, 25 Jul 2007, Alan Cox wrote:
> 
> > > driver to using platform-device. I got a reply, that it's not worth it 
> > > now 
> > > that IDE is slowly becoming obsolete, and the pata_platform serves the 
> > > perpose perfectly well. I found this argument reasonable, I had the same 
> > > doubt, just wanted to double-check. So, why do we now need a new legacy 
> > > (a/drivers/ide/legacy/ide_platform.c) driver when a "modern" driver 
> > > exists?
> > 
> > We don't *need* it but some people still want to use old IDE and the
> > author was willing to make it neatly compatible so that anything that
> > works with the pata_platform should be able to use the ide_platform
> > driver and vice versa. For the shorter term that can only be a good thing
> > - arch code doesn't need to care about which driver is used, end users
> > can pick and it doesn't end up adding new ties between code and old IDE.
> 
> Ok, thanks for the explanation Alan. So, there's no technical argument, 
> just "being nice to the users", and add a new driver, which we know we'll 

There are some rough edges (especially older and/or rare hardware,
this goes for both cotrollers and devices) that SCSI/libata don't
handle and IDE subsystem do.

> have to remove soon, thus having to persuade its users, who by that time 

Well, we've been hearing "soon" for two years now...

> will get used to it and will not want to invest money into switching to 
> another one...

PS wrt ide_arm.c changes, you really should have cc:ed the author... ;)

Thanks,
Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] icside: use ide_tune_dma()

2007-07-26 Thread Bartlomiej Zolnierkiewicz

* Add "good DMA drives" hack for icside to ide-dma.c::ide_find_dma_mode()
  (in the long-term it should be either removed or generalized for all hosts).

* Use ide_tune_dma() in icside.c::icside_dma_check().

  This results in the following changes in behavior:
  - pre-EIDE SWDMA modes are now also respected
  - drive->autodma is checked instead of hwif->autodma
(doesn't really matter as icside sets both to "1")

* Make ide-dma.c::__ide_dma_good_drive() static and drop "__" prefix.

Cc: Russell King <[EMAIL PROTECTED]>
Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/arm/icside.c |   37 +++--
 drivers/ide/ide-dma.c|   23 ++-
 include/linux/ide.h  |1 -
 3 files changed, 17 insertions(+), 44 deletions(-)

Index: b/drivers/ide/arm/icside.c
===
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -313,41 +313,10 @@ static int icside_dma_on(ide_drive_t *dr
 
 static int icside_dma_check(ide_drive_t *drive)
 {
-   struct hd_driveid *id = drive->id;
-   ide_hwif_t *hwif = HWIF(drive);
-   int xfer_mode = 0;
-
-   if (!(id->capability & 1) || !hwif->autodma)
-   goto out;
-
-   /*
-* Consult the list of known "bad" drives
-*/
-   if (__ide_dma_bad_drive(drive))
-   goto out;
-
-   /*
-* Enable DMA on any drive that has multiword DMA
-*/
-   if (id->field_valid & 2) {
-   xfer_mode = ide_max_dma_mode(drive);
-   goto out;
-   }
-
-   /*
-* Consult the list of known "good" drives
-*/
-   if (__ide_dma_good_drive(drive)) {
-   if (id->eide_dma_time > 150)
-   goto out;
-   xfer_mode = XFER_MW_DMA_1;
-   }
-
-out:
-   if (xfer_mode == 0)
-   return -1;
+   if (ide_tune_dma(drive))
+   return 0;
 
-   return icside_set_speed(drive, xfer_mode) ? -1 : 0;
+   return -1;
 }
 
 static int icside_dma_end(ide_drive_t *drive)
Index: b/drivers/ide/ide-dma.c
===
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -169,6 +169,11 @@ ide_startstop_t ide_dma_intr (ide_drive_
 
 EXPORT_SYMBOL_GPL(ide_dma_intr);
 
+static int ide_dma_good_drive(ide_drive_t *drive)
+{
+   return ide_in_drive_list(drive->id, drive_whitelist);
+}
+
 #ifdef CONFIG_BLK_DEV_IDEDMA_PCI
 /**
  * ide_build_sglist-   map IDE scatter gather for DMA I/O
@@ -357,7 +362,7 @@ static int config_drive_for_dma (ide_dri
return 0;
 
/* Consult the list of known "good" drives */
-   if (__ide_dma_good_drive(drive))
+   if (ide_dma_good_drive(drive))
return 0;
}
 
@@ -639,14 +644,6 @@ int __ide_dma_bad_drive (ide_drive_t *dr
 
 EXPORT_SYMBOL(__ide_dma_bad_drive);
 
-int __ide_dma_good_drive (ide_drive_t *drive)
-{
-   struct hd_driveid *id = drive->id;
-   return ide_in_drive_list(id, drive_whitelist);
-}
-
-EXPORT_SYMBOL(__ide_dma_good_drive);
-
 static const u8 xfer_mode_bases[] = {
XFER_UDMA_0,
XFER_MW_DMA_0,
@@ -740,6 +737,14 @@ u8 ide_find_dma_mode(ide_drive_t *drive,
}
}
 
+   if (hwif->chipset == ide_acorn && mode == 0) {
+   /*
+* is this correct?
+*/
+   if (ide_dma_good_drive(drive) && drive->id->eide_dma_time < 150)
+   mode = XFER_MW_DMA_1;
+   }
+
printk(KERN_DEBUG "%s: selected mode 0x%x\n", drive->name, mode);
 
return min(mode, req_mode);
Index: b/include/linux/ide.h
===
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -1295,7 +1295,6 @@ int ide_in_drive_list(struct hd_driveid 
 
 #ifdef CONFIG_BLK_DEV_IDEDMA
 int __ide_dma_bad_drive(ide_drive_t *);
-int __ide_dma_good_drive(ide_drive_t *);
 
 u8 ide_find_dma_mode(ide_drive_t *, u8);
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/2] [IDE] Platform IDE driver (was: MMIO IDE driver)

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Hi,

On Wednesday 25 July 2007, Vitaly Bordug wrote:
> 
> This is now very similar to pata_platform.c, they both use
> same platform data structure and same resources.
> 
> To achieve that, byte_lanes_swapping platform data variable
> and platform specified iops removed from that driver. It's fine,
> since those were never used anyway.
> 
> pata_platform and ide_platform are carrying same driver names,
> to easily switch between these drivers, without need to touch
> platform code.

Looks really good, thanks for working on this.

> Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>

applied but it would be also nice to fix minor issues found by Sergei
(please just send a new version of the patch and I will replace this
version with the newer one in my tree)

patch #2/2 also looks fine and when issues raised by Sergei gets
addressed it will be merged

Thanks,
Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] pata_mpiix: Forget a conversion

2007-07-26 Thread Alan Cox
This one applies after the big patch. Without it the mpiix module won't
load as it still tries to use the old ata_std_ports symbol which I only
just noticed after posting the main diff.

(Andrew you might want to just cat the two together, sorry about that)

Signed-off-by: Alan Cox <[EMAIL PROTECTED]

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_mpiix.c 
linux-2.6.23rc1-mm1/drivers/ata/pata_mpiix.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_mpiix.c2007-07-26 
15:01:52.951747064 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/pata_mpiix.c2007-07-26 
15:21:13.273351368 +0100
@@ -201,6 +201,7 @@
struct ata_host *host;
struct ata_port *ap;
void __iomem *cmd_addr, *ctl_addr;
+   unsigned long cmd_port, ctl_port;
u16 idetim;
int irq;
 
@@ -222,14 +223,17 @@
/* See if it's primary or secondary channel... */
if (!(idetim & SECONDARY)) {
irq = 14;
-   cmd_addr = devm_ioport_map(&dev->dev, 0x1F0, 8);
-   ctl_addr = devm_ioport_map(&dev->dev, 0x3F6, 1);
+   cmd_port = 0x1F0;
+   ctl_port = 0x3F6;
} else {
irq = 15;
-   cmd_addr = devm_ioport_map(&dev->dev, 0x170, 8);
-   ctl_addr = devm_ioport_map(&dev->dev, 0x376, 1);
+   cmd_port = 0x170;
+   ctl_port = 0x376;
}
 
+   cmd_addr = devm_ioport_map(&dev->dev, cmd_port, 8);
+   ctl_addr = devm_ioport_map(&dev->dev, ctl_port, 1);
+
if (!cmd_addr || !ctl_addr)
return -ENOMEM;
 
@@ -247,9 +251,12 @@
ap->ioaddr.cmd_addr = cmd_addr;
ap->ioaddr.ctl_addr = ctl_addr;
ap->ioaddr.altstatus_addr = ctl_addr;
+   
+   ap->busaddr.cmd_addr = cmd_port;
+   ap->busaddr.ctl_addr = ctl_port;
 
/* Let libata fill in the port details */
-   ata_std_ports(&ap->ioaddr);
+   ata_std_io_ports(&ap->ioaddr, &ap->busaddr);
 
/* activate host */
return ata_host_activate(host, irq, ata_interrupt, IRQF_SHARED,
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] libata: Store bus addresses (versus -mm for testing)

2007-07-26 Thread Alan Cox
As we cannot reverse iomap results portably as we tried before the libata
layer needs to keep bus addresses around for reporting. This first big
patch adds a structure for it and teaches the drivers to keep the
information. Thankfully most drivers go via libata-sff and it can do the
work for them.

For the others we replace ata_std_ports with ata_std_io_ports /
std_mmio_ports and pass both the mapped and some bus address info.

We don't keep all the mappings in both forms. We only need cmd, ctrl and
status (for wait_status() reporting). We also keep a "base" for devices
where the taskfile (cmd/ctl) mapping makes no sense.

This patch stores all the data but doesn't yet change the display side.
I've got a couple of variants I'm playing with on the display side and
want to get that right. In the mean time this should store all the data
and have no side effects for anyone, so is a good first chunk for testing
alone.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/include/linux/libata.h 
linux-2.6.23rc1-mm1/include/linux/libata.h
--- linux.vanilla-2.6.23rc1-mm1/include/linux/libata.h  2007-07-26 
15:02:58.0 +0100
+++ linux-2.6.23rc1-mm1/include/linux/libata.h  2007-07-26 15:37:59.0 
+0100
@@ -370,6 +376,30 @@
void __iomem*scr_addr;
 };
 
+typedef enum {
+   ATA_ADDR_UNSET = 0,
+   ATA_ADDR_PIO = 1,
+   ATA_ADDR_MMIO = 2
+} ata_addr_type;
+
+struct ata_busports {
+   /* If this is set it is used to indicate the resource block for
+  a device (eg AHCI) which may not fit the usual arrangement */
+   unsigned long base_addr;
+   ata_addr_type base_type;
+   /* Optionally we can provide the SFF type task file and BMDMA
+  locations. Status must be provided if the ata_status functions
+  are being used */
+   unsigned long cmd_addr;
+   ata_addr_type cmd_type;
+   unsigned long ctl_addr;
+   ata_addr_type ctl_type;
+   unsigned long bmdma_addr;
+   ata_addr_type bmdma_type;
+   unsigned long status_addr;
+   ata_addr_type status_type;
+};
+
 struct ata_host {
spinlock_t  lock;
struct device   *dev;
@@ -536,6 +566,7 @@
dma_addr_t  pad_dma;
 
struct ata_ioports  ioaddr; /* ATA cmd/ctl/dma register blocks */
+   struct ata_busports busaddr; /* Bus addresses for reporting */
 
u8  ctl;/* cache of ATA control register */
u8  last_ctl;   /* Cache last written value */
@@ -720,7 +751,8 @@
  unsigned long deadline);
 extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
 extern void ata_port_disable(struct ata_port *);
-extern void ata_std_ports(struct ata_ioports *ioaddr);
+extern void ata_std_io_ports(struct ata_ioports *ioaddr, struct ata_busports 
*busaddr);
+extern void ata_std_mmio_ports(struct ata_ioports *ioaddr, struct ata_busports 
*busaddr);
 #ifdef CONFIG_PCI
 extern int ata_pci_init_one (struct pci_dev *pdev,
 const struct ata_port_info * const * ppi);
diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-core.c 
linux-2.6.23rc1-mm1/drivers/ata/libata-core.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-core.c   2007-07-26 
15:02:57.656910384 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/libata-core.c   2007-07-26 
15:54:41.130110744 +0100
@@ -6738,7 +6877,7 @@
  * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr.
  */
 
-void ata_std_ports(struct ata_ioports *ioaddr)
+static void ata_std_ports(struct ata_ioports *ioaddr)
 {
ioaddr->data_addr = ioaddr->cmd_addr + ATA_REG_DATA;
ioaddr->error_addr = ioaddr->cmd_addr + ATA_REG_ERR;
@@ -6752,6 +6891,61 @@
ioaddr->command_addr = ioaddr->cmd_addr + ATA_REG_CMD;
 }
 
+/**
+ * ata_std_io_ports - initialize ioaddr with standard port offsets.
+ * @ioaddr: IO address structure to be initialized
+ * @busaddr: Bus addresses to report
+ *
+ * Utility function which initializes data_addr, error_addr,
+ * feature_addr, nsect_addr, lbal_addr, lbam_addr, lbah_addr,
+ * device_addr, status_addr, and command_addr to standard offsets
+ * relative to cmd_addr.
+ *
+ * Does not set ctl_addr, altstatus_addr, bmdma_addr, or scr_addr.
+ *
+ * Sets up the types of the prepared physical bus registers as I/O
+ */
+
+void ata_std_io_ports(struct ata_ioports *ioaddr, struct ata_busports *busaddr)
+{
+   ata_std_ports(ioaddr);
+   busaddr->cmd_type = ATA_ADDR_PIO;
+   if (busaddr->status_addr == 0)
+   busaddr->status_addr = busaddr->cmd_addr + ATA_REG_STATUS;
+   busaddr->status_type = ATA_ADDR_PIO;
+   if (busaddr->bmdma_addr)
+   busaddr->bmdma_type = ATA_ADDR_PIO;
+   if (busaddr->

Re: sata_nv or port issue?

2007-07-26 Thread Zivago Lee
On Thu, 2007-07-26 at 17:23 +0900, Tejun Heo wrote:
> Zivago Lee wrote:
> > I'm running Ubuntu Feisty on the 2.6.20 kernel (Linux miyagip
> > 2.6.20-16-generic #2 SMP Thu Jun 7 20:19:32 UTC 2007 i686 GNU/Linux).
> 
> Please give a shot at 2.6.22.  It will report more detail about what's
> going on.
> 

I've just upgraded to 2.6.22 and hopefully I'll know what's going on if
it happens again.

Thanks,
Zivago

-- 
Zivago Lee <[EMAIL PROTECTED]>


signature.asc
Description: This is a digitally signed message part


[PATCH] libata-sff; Unbreak non DMA capable controllers again

2007-07-26 Thread Alan Cox
Seems nobody else is checking/testing this case as it keeps getting
horked.

If we have no BAR4 mapping on an SFF controller this is *NOT* an error,
it just means it isn't doing BMDMA.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-sff.c 
linux-2.6.23rc1-mm1/drivers/ata/libata-sff.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-sff.c2007-07-26 
15:01:52.899754968 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/libata-sff.c2007-07-26 
15:17:55.178466368 +0100
@@ -573,6 +573,10 @@
struct pci_dev *pdev = to_pci_dev(gdev);
int i, rc;
 
+   /* No BAR4 allocation: No DMA */
+   if (pci_resource_start(pdev, 4) == 0)
+   return 0;
+
/* TODO: If we get no DMA mask we should fall back to PIO */
rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);
if (rc)
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] [POWERPC] MPC8349E-mITX: use platform IDE driver for CF interface

2007-07-26 Thread Vitaly Bordug
On Wed, 25 Jul 2007 21:06:42 +0400
Sergei Shtylyov wrote:

> Hello.
> 
> Vitaly Bordug wrote:
> 
> > This updates relevant platform code (freescale mpc8349itx target) 
> > to make the CompactFlash work in TrueIDE mode. 
> 
>Erm, I'm not sure it's worth submitting the platform device driver
> for PowerPC at this point, but well...
> 
As Ben already confirmed, it is OK to have "constructor" insert platform device 
if such is
required by design.

> > Signed-off-by: Anton Vorontsov <[EMAIL PROTECTED]>
> > Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
> 
> >  arch/powerpc/boot/dts/mpc8349emitx.dts|9 
> >  arch/powerpc/platforms/83xx/mpc834x_itx.c |   70
> > + 2 files changed, 79 insertions(+), 0
> > deletions(-)
> 
> > diff --git a/arch/powerpc/boot/dts/mpc8349emitx.dts
> > b/arch/powerpc/boot/dts/mpc8349emitx.dts index db0d003..f8f0e8a
> > 100644 --- a/arch/powerpc/boot/dts/mpc8349emitx.dts
> > +++ b/arch/powerpc/boot/dts/mpc8349emitx.dts
> > @@ -37,6 +37,15 @@
> > reg = < 1000>;
> > };
> >  
> > +   [EMAIL PROTECTED] {
> > +   compatible = "mmio-ide";
> > +   device_type = "ide";
> 
> Why not "ata"?
> 

we already argued around this iirc. I have no preferences and will put whatever 
agreed appropriate finally in here.

> > +   reg = ;
> > +   ioport_shift = <1>;
> 
> Please use hyphen, not underscore in the property names
> ("device_type" seems an only exception from this rule).
> And since using shift instead of size buys you nothing is this
> case, I'd prefer this property to be called reg-size or reg-stride.
> 
> [...]
> > diff --git a/arch/powerpc/platforms/83xx/mpc834x_itx.c
> > b/arch/powerpc/platforms/83xx/mpc834x_itx.c index 40a0194..d63a104
> > 100644 --- a/arch/powerpc/platforms/83xx/mpc834x_itx.c
> > +++ b/arch/powerpc/platforms/83xx/mpc834x_itx.c
> [...]
> > @@ -43,6 +44,75 @@ unsigned long isa_io_base = 0;
> >  unsigned long isa_mem_base = 0;
> >  #endif
> >  
> > +static int __init mmio_ide_of_init(void)
> > +{
> > +   struct device_node *np;
> > +   unsigned int i;
> > +
> > +   for (np = NULL, i = 0;
> > +(np = of_find_compatible_node(np, "ide",
> > "mmio-ide")) != NULL;
> > +i++) {
> > +   int ret = 0;
> 
> Unneeded initialization.
> 
> > +   struct resource res[3];
> > +   struct platform_device *pdev = NULL;
> 
> Another one.
> 

ok
> > +   static struct pata_platform_info pdata;
> > +
> > +   memset(res, 0, sizeof(res));
> > +
> > +   ret = of_address_to_resource(np, 0, &res[0]);
> > +   if (ret) {
> > +   printk(KERN_ERR "mmio-ide.%d: unable to
> > get "
> > +  "resource from OF\n", i);
> > +   goto err0;
> > +   }
> > +
> > +   ret = of_address_to_resource(np, 1, &res[1]);
> > +   if (ret) {
> > +   printk(KERN_ERR "mmio-ide.%d: unable to
> > get "
> > +  "resource from OF\n", i);
> > +   goto err0;
> 
> Erm, these printk's are repetitive, isn't it better to put them
> under err0 label?
> 
> > +   }
> > +
> > +   res[2].start = res[2].end =
> > irq_of_parse_and_map(np, 0);
> > +   if (res[2].start == NO_IRQ) {
> > +   printk(KERN_ERR "mmio-ide.%d: no IRQ\n",
> > i);
> > +   goto err0;
> > +   }
> > +   res[2].name = "pata_platform";
> > +   res[2].flags = IORESOURCE_IRQ;
> > +
> > +   pdata.ioport_shift = *((u32 *)of_get_property(np,
> > +   "ioport_shift", NULL));
> > +
> > +   pdev = platform_device_alloc("pata_platform", i);
> > +   if (!pdev)
> > +   goto err1;
> 
> Hm, not err0?
> 
agreed.

> > +
> > +   ret = platform_device_add_data(pdev, &pdata,
> > sizeof(pdata));
> > +   if (ret)
> > +   goto err1;
> > +
> > +   ret = platform_device_add_resources(pdev, res,
> > ARRAY_SIZE(res));
> > +   if (ret)
> > +   goto err1;
> > +
> > +   ret = platform_device_register(pdev);
> > +   if (ret)
> > +   goto err1;
> > +
> > +   continue;
> > +err1:
> > +   printk(KERN_ERR "mmio-ide.%d: registration
> > failed\n", i);
> > +   platform_device_del(pdev); /* it will free
> > everything */ +err0:
> > +   /* Even if some device failed, try others */
> > +   continue;
> > +   }
> > +
> > +   return 0;
> > +}
> > +device_initcall(mmio_ide_of_init);
> > +
> >  /*
> > 
> > *
> >   * Setup the architecture
> 
> MBR, Sergei


-- 
Sincerely, Vitaly
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majo

Re: [PATCH 2/2] [POWERPC] MPC8349E-mITX: use platform IDE driver for CF interface

2007-07-26 Thread Sergei Shtylyov

Hello, I wrote:

  Also, what mmio-ide in the compat properly means in the context 
of ide_platform which is able to handle both port and memory mapped 
IDE.


I/O-space is only valid in the context of PCI, ISA, or similar buses, 
and

the bus-specific reg format indicates whether it's mmio-space or
io-space.


  You could save time on lecturing me (and use it to look on the 
driver ;-).


Sorry, I misread the question as being a mismatch between the 
capabilities of the device binding and the driver, not about the 
specific compatible name.



That too. :-)



Something like "generic-ide" would probably be better.


I strongly disagree with "generic" part. The generic IDE could only be 
said of 1:1 I/O mapped IDE ports, not about this fancy mapping.


   BTW, there's already something called drivers/ide/ide-generic.c... :-)

MBR, Sergei

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Problem with size after growing a device on 3ware-9500

2007-07-26 Thread Lars Michael Jogbäck

Hi,

I don't know really which subsystem this, so I'm sending this to the 
linux-ide list.

Please direct me to a more appropriate place if this is not correct.

I'm using a 3ware 9500 with Linux 2.6.18.1. I've grown the HW 
raid5-array and here is where the problem begins. After the card had 
expanded the array, I used "blockdev --rereadpt /dev/sdn" to get the 
kernel to recognize the now larger device. The last step was to do a 
"pvresize /dev/sdn". The problem is that pvresize still thought that the 
device was at the original size.


From the lvm mailinglist I found out that pvresize used the same 
mechanism as "blockdev" (ioctl BLKGETSIZE64) to get the size of the 
disks, so I tested this and found that blockdev also reported the device 
to have the wrong size.


So, if I do:
# cat /sys/block/sdn/size
5859250176

and

# blockdev --getsize64 /dev/sdn
2499946741760
# blockdev --getss /dev/sdn
512
# expr 2499946741760 / 512
4882708480

Apparently /sys/block/sdk/size is updated with the new size, but 
whatever "ioctl BLKGETSIZE64" is querying is not. If I reboot, 
everything works correctly.


Shouldn't it be possible to extend the size of a disk without rebooting?

Best Regards,
/LM
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pata_cmd64x: Correct the speed ranges

2007-07-26 Thread Sergei Shtylyov

Mikael Pettersson wrote:


This fix inspired me to finally try to convert my Sun Ultra5
(sparc64) with a CMD646 [1095:0646 rev 03] to libata.



With pata_cmd64x the machine has so far survived a usual
boot/mrproper/reconfig/make/install/reboot kernel update
cycle without any issues, and performance seems to be the
same as with the old IDE driver.



/Mikael

scsi0 : pata_cmd64x
scsi1 : pata_cmd64x
ata1: PATA max MWDMA2 cmd 0x01fe02c0 ctl 0x01fe02ca bmdma 
0x01fe02c00020 irq 14
ata2: PATA max MWDMA2 cmd 0x01fe02c00010 ctl 0x01fe02c0001a bmdma 
0x01fe02c00028 irq 14
ata1.00: ATA-4: ST320420A, 3.21, max UDMA/66
ata1.00: 39851760 sectors, multi 0: LBA 
pata_cmd64x: active 3 recovery 1 setup 1.

ata1.00: configured for MWDMA2
ata2.00: ATAPI: CRD-8483B, 1.00, max UDMA/33
pata_cmd64x: active 3 recovery 1 setup 1.
ata2.00: configured for MWDMA2

[...]

   Note that the olde driver has MWDMA fixed, and the new one has it still 
borken, yet MWDMA2 is the mode you're using.


MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pdc202xx_new: check ide_config_drive_speed() return value

2007-07-26 Thread Sergei Shtylyov

Bartlomiej Zolnierkiewicz wrote:


Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>


Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] icside: fix ->speedproc to return on unsupported modes (take 5)

2007-07-26 Thread Bartlomiej Zolnierkiewicz

* All other implementations of ->speedproc return zero on success
  and non-zero on failure.  Currently it doesn't matter for icside host
  driver and isn't a bug per se since:

  - ide_set_xfer_rate() return value is ignored by all IDE core users

  - icside doesn't (yet!) use ide_tune_dma() in icside_dma_check()

  but sooner or later we will need to fix anyway - so lets do it now.

* icside_set_speed() happily accepts unsupported transfer modes which
  results in drive->drive_data being set to the maximum value (480)
  and drive->current_speed being set to the unsupported transfer mode.

  Fix it.

v2:
* The initial version of the patch was broken because it didn't take into
  the account (the different from usual) return values of icside_set_speed()
  (Noticed by Russell).

v3:
* Remove no longer needed initialization/checking of cycle_time
  (Noticed by Sergei).

* No need to set drive->drive_data if DMA is not going to be used
  (Noticed by Sergei).

* Remove incorrect setting of drive->current_speed
  (Noticed by Sergei).

* Move ide_config_drive_speed() at the end of icside_set_speed().

v4:
* If DMA mode is not found in icside_dma_check() then just return "-1" and
  don't call icside_set_speed() (v3 got it wrong and "1" was returned instead).

v5:
* Return "-1"/"0" in icside_set_speed() instead of icside_dma_check() return
  value (just like it was before this patch).

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
Cc: Russell King <[EMAIL PROTECTED]>
Cc: Sergei Shtylyov <[EMAIL PROTECTED]>
---
replacement patch for the one in IDE quilt tree

 drivers/ide/arm/icside.c |   21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

Index: b/drivers/ide/arm/icside.c
===
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -250,7 +250,7 @@ static void icside_build_sglist(ide_driv
  */
 static int icside_set_speed(ide_drive_t *drive, const u8 xfer_mode)
 {
-   int on = 0, cycle_time = 0, use_dma_info = 0;
+   int cycle_time, use_dma_info = 0;
 
switch (xfer_mode) {
case XFER_MW_DMA_2:
@@ -272,6 +272,8 @@ static int icside_set_speed(ide_drive_t 
case XFER_SW_DMA_0:
cycle_time = 480;
break;
+   default:
+   return 1;
}
 
/*
@@ -283,17 +285,10 @@ static int icside_set_speed(ide_drive_t 
 
drive->drive_data = cycle_time;
 
-   if (cycle_time && ide_config_drive_speed(drive, xfer_mode) == 0)
-   on = 1;
-   else
-   drive->drive_data = 480;
-
printk("%s: %s selected (peak %dMB/s)\n", drive->name,
ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data);
 
-   drive->current_speed = xfer_mode;
-
-   return on;
+   return ide_config_drive_speed(drive, xfer_mode);
 }
 
 static void icside_dma_host_off(ide_drive_t *drive)
@@ -320,8 +315,7 @@ static int icside_dma_check(ide_drive_t 
 {
struct hd_driveid *id = drive->id;
ide_hwif_t *hwif = HWIF(drive);
-   int xfer_mode = XFER_PIO_2;
-   int on;
+   int xfer_mode = 0;
 
if (!(id->capability & 1) || !hwif->autodma)
goto out;
@@ -350,9 +344,10 @@ static int icside_dma_check(ide_drive_t 
}
 
 out:
-   on = icside_set_speed(drive, xfer_mode);
+   if (xfer_mode == 0)
+   return -1;
 
-   return on ? 0 : -1;
+   return icside_set_speed(drive, xfer_mode) ? -1 : 0;
 }
 
 static int icside_dma_end(ide_drive_t *drive)
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pata_cmd64x: Correct the speed ranges

2007-07-26 Thread Sergei Shtylyov

Hello.

Alan Cox wrote:


I must have been half asleep when doing the original code



Signed-off-by: Alan Cox <[EMAIL PROTECTED]>


Acked-by: Sergei Shtylyov <[EMAIL PROTECTED]>


diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c 
linux-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c   2007-07-26 
15:01:52.915752536 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c   2007-07-26 
15:18:38.486882488 +0100

[...]

@@ -397,7 +397,7 @@
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x1f,
.mwdma_mask = 0x07,


   Note that MWDMA programming is still borken in the libata driver (fixed 
now in the IDE driver).



-   .udma_mask = ATA_UDMA1,
+   .udma_mask = ATA_UDMA2,
.port_ops = &cmd64x_port_ops
},
{   /* CMD 646 rev 1  */


MBR, Sergei
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] pata_cmd64x: Correct the speed ranges

2007-07-26 Thread Alan Cox
I must have been half asleep when doing the original code

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c 
linux-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c   2007-07-26 
15:01:52.915752536 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/pata_cmd64x.c   2007-07-26 
15:18:38.486882488 +0100
@@ -31,7 +31,7 @@
 #include 
 
 #define DRV_NAME "pata_cmd64x"
-#define DRV_VERSION "0.2.3"
+#define DRV_VERSION "0.2.4"
 
 /*
  * CMD64x specific registers definition.
@@ -397,7 +397,7 @@
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x1f,
.mwdma_mask = 0x07,
-   .udma_mask = ATA_UDMA1,
+   .udma_mask = ATA_UDMA2,
.port_ops = &cmd64x_port_ops
},
{   /* CMD 646 rev 1  */
@@ -412,7 +412,7 @@
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x1f,
.mwdma_mask = 0x07,
-   .udma_mask = ATA_UDMA2,
+   .udma_mask = ATA_UDMA4,
.port_ops = &cmd648_port_ops
},
{   /* CMD 649 */
@@ -420,7 +420,7 @@
.flags = ATA_FLAG_SLAVE_POSS,
.pio_mask = 0x1f,
.mwdma_mask = 0x07,
-   .udma_mask = ATA_UDMA3,
+   .udma_mask = ATA_UDMA5,
.port_ops = &cmd648_port_ops
}
};
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/2] [POWERPC] MPC8349E-mITX: use platform IDE driver for CF interface

2007-07-26 Thread Vitaly Bordug
On Wed, 25 Jul 2007 13:46:57 -0500
Scott Wood wrote:

> Sergei Shtylyov wrote:
> >I acn undertand your complaint in the context of an OF driver
> > (which we don't have yet) but "mmio-ide" just means nothing to the
> > current driver, and it doesn't convery enough info on the
> > programming interface for the conceivable OF driver, it also does
> > need to know at least "reg-stride" (and maybe "reg-size" in case
> > only 16/32-bit accesses can be used).  Well, if such driver will be
> > written, I/O mapping support will probably be dropped from it, so
> > indeed, calling it mmio-ide.c would make sense.  But that can be
> > added when this driver is done, and for now 
> 
> I don't think the details of what Linux code currently exists should 
> drive the device tree binding.  That the current patches use 
> platform_device glue code is an implementation detail (and one I'd 
> rather see go away, in favor of a driver that supports both 
> platform_device and of_device).
> 
> > I'd really prefer the board name to appear in the "compatible" prop
> > (to which "mmio-ide" can be appended)...
> 
> Sure, that's always good...  it was the "instead" that I objected to.
> 

Hmmm. So what is finally suggested devicetree node for this beast - can 
somebody refine?

I am a little bit confused about decided device_type and compatible fields...

-- 
Sincerely, Vitaly
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/4] libata: ACPI checks for 80wire cable

2007-07-26 Thread Alan Cox
Provide actual methods for checking if the ACPI support thinks the cable
is 80wire, or doesn't know

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-acpi.c 
linux-2.6.23rc1-mm1/drivers/ata/libata-acpi.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/libata-acpi.c   2007-07-26 
15:01:53.015737336 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/libata-acpi.c   2007-07-26 
15:15:48.676697560 +0100
@@ -296,6 +296,44 @@
 }
 
 /**
+ * ata_acpi_cbl_80wire -   Check for 80 wire cable
+ * @ap: Port to check
+ *
+ * Return 1 if the ACPI mode data for this port indicates the BIOS selected
+ * an 80wire mode.
+ */
+
+int ata_acpi_cbl_80wire(struct ata_port *ap)
+{
+   struct ata_acpi_gtm gtm;
+   int valid = 0;
+   
+   /* No _GTM data, no information */
+   if (ata_acpi_gtm(ap, >m) < 0)
+   return 0;
+   
+   /* Split timing, DMA enabled */
+   if ((gtm.flags & 0x11) == 0x11 && gtm.drive[0].dma < 55)
+   valid |= 1;
+   if ((gtm.flags & 0x14) == 0x14 && gtm.drive[1].dma < 55)
+   valid |= 2;
+   /* Shared timing, DMA enabled */
+   if ((gtm.flags & 0x11) == 0x01 && gtm.drive[0].dma < 55)
+   valid |= 1;
+   if ((gtm.flags & 0x14) == 0x04 && gtm.drive[0].dma < 55)
+   valid |= 2;
+
+   /* Drive check */
+   if ((valid & 1) && ata_dev_enabled(&ap->device[0]))
+   return 1;
+   if ((valid & 2) && ata_dev_enabled(&ap->device[1]))
+   return 1;
+   return 0;
+}
+
+EXPORT_SYMBOL_GPL(ata_acpi_cbl_80wire);
+
+/**
  * taskfile_load_raw - send taskfile registers to host controller
  * @dev: target ATA device
  * @gtf: raw ATA taskfile register set (0x1f1 - 0x1f7)
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Problems with nVidia nForce 520 Chipset

2007-07-26 Thread Craig Block
--- Tejun Heo <[EMAIL PROTECTED]> wrote:
>
> Craig Block wrote:
> > 
> > I'm having a problem getting Linux to handle the SATA drives and
> > controllers on a new computer with an ASUS M2N-X motherboard.  This is a 
> > socket AM2 board and has an nVidia nForce 520 chipset.
> 
> Does 'noapic' kernel parameter help?

Unfortunately, no.  I also tried noapic with nolapic, nomsi, and pci=nobios.  

I believe it boils down to the following line I'm seeing in the dmesg output;  

ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)

Thanks


   

Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, 
photos & more. 
http://mobile.yahoo.com/go?refer=1GNXIC
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [2.6.23-rc1] ata_piix: EH pending after completion, repeating EH (cnt=4)

2007-07-26 Thread Mikael Pettersson
On Thu, 26 Jul 2007 15:31:10 +0900, Tejun Heo wrote:
> Mikael Pettersson wrote:
> > On Tue, 24 Jul 2007 17:32:29 +0900, Tejun Heo wrote:
> >> Mikael Pettersson wrote:
> >>> This machine has a known good Samsung SATA DVD on ICH8 [8086:2820].
> >>> With kernel 2.6.23-rc1 I now get the following:
> >>>
>  ata_piix :00:1f.2: version 2.11
>  ata_piix :00:1f.2: MAP [ P0 P2 P1 P3 ]
>  ACPI: PCI Interrupt :00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
>  PCI: Setting latency timer of device :00:1f.2 to 64
>  scsi2 : ata_piix
>  scsi3 : ata_piix
>  ata3: SATA max UDMA/133 cmd 0x0001ec00 ctl 0x0001e882 bmdma 0x0001e400 
>  irq 19
>  ata4: SATA max UDMA/133 cmd 0x0001e800 ctl 0x0001e482 bmdma 0x0001e408 
>  irq 19
>  ata4.00: ATAPI: TSSTcorpCD/DVDW SH-S183A, SB00, max UDMA/33
>  ata4.00: applying bridge limits
>  ata4.00: configured for UDMA/33
>  ata4: EH pending after completion, repeating EH (cnt=4)
>  scsi 3:0:0:0: CD-ROMTSSTcorp CD/DVDW SH-S183A SB00 PQ: 0 
>  ANSI: 5
> >>> The "EH pending after completion" is new and did not occur with 2.6.22.
> >>> Apart from that message, things seem fine.
> >> Hmmm... That means someone requested EH while EH was in progress.
> >> Weird.  Can you apply the attached patch and report what the kernel
> >> says?  Thanks.
> > 
> > Here it is. As you can see from the traces, the machine also has a
> > pdc20269 controller driven by pata_pdc2027x.
> 
> Hmm... I missed one path.  Can you please try the attached patch?  Thanks.

Sure, here are the boot messages with the newer debug patch:

pata_pdc2027x :04:02.0: PLL input clock 16660 kHz
scsi0 : pata_pdc2027x
scsi1 : pata_pdc2027x
ata1: PATA max UDMA/133 cmd 0xf88297c0 ctl 0xf8829fda bmdma 0xf8829000 irq 18
ata2: PATA max UDMA/133 cmd 0xf88295c0 ctl 0xf8829dda bmdma 0xf8829008 irq 18
EH scheduled with LOADING set
 [] ata_host_register+0x1ee/0x2c0
 [] ata_interrupt+0x0/0x200
 [] ata_host_activate+0x79/0x90
 [] pdc2027x_init_one+0x23a/0x2d0
 [] pci_device_probe+0x56/0x80
 [] driver_probe_device+0x88/0x190
 [] klist_next+0x55/0xb0
 [] __driver_attach+0x7a/0x80
 [] bus_for_each_dev+0x3a/0x60
 [] driver_attach+0x16/0x20
 [] __driver_attach+0x0/0x80
 [] bus_add_driver+0x8a/0x1b0
 [] __pci_register_driver+0x56/0x90
 [] kernel_init+0x140/0x310
 [] ret_from_fork+0x6/0x1c
 [] kernel_init+0x0/0x310
 [] kernel_init+0x0/0x310
 [] kernel_thread_helper+0x7/0x10
 ===
ata1: soft resetting port
ata1.00: ATA-7: ST3320620A, 3.AAD, max UDMA/100
ata1.00: 625142448 sectors, multi 16: LBA48 
ata1.00: configured for UDMA/100
ata1: EH complete
EH scheduled with LOADING set
 [] ata_host_register+0x1ee/0x2c0
 [] ata_interrupt+0x0/0x200
 [] ata_host_activate+0x79/0x90
 [] pdc2027x_init_one+0x23a/0x2d0
 [] pci_device_probe+0x56/0x80
 [] driver_probe_device+0x88/0x190
 [] klist_next+0x55/0xb0
 [] __driver_attach+0x7a/0x80
 [] bus_for_each_dev+0x3a/0x60
 [] driver_attach+0x16/0x20
 [] __driver_attach+0x0/0x80
 [] bus_add_driver+0x8a/0x1b0
 [] __pci_register_driver+0x56/0x90
 [] kernel_init+0x140/0x310
 [] ret_from_fork+0x6/0x1c
 [] kernel_init+0x0/0x310
 [] kernel_init+0x0/0x310
 [] kernel_thread_helper+0x7/0x10
 ===
ata2: soft resetting port
ata2: EH complete
scsi 0:0:0:0: Direct-Access ATA  ST3320620A   3.AA PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
sd 0:0:0:0: [sda] 625142448 512-byte hardware sectors (320073 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support 
DPO or FUA
 sda: sda1 sda2 sda3 sda4 < sda5 sda6 sda7 sda8 sda9 sda10 >
sd 0:0:0:0: [sda] Attached SCSI disk
...
ata_piix :00:1f.2: version 2.11
ata_piix :00:1f.2: MAP [ P0 P2 P1 P3 ]
ACPI: PCI Interrupt :00:1f.2[B] -> GSI 19 (level, low) -> IRQ 19
PCI: Setting latency timer of device :00:1f.2 to 64
scsi2 : ata_piix
scsi3 : ata_piix
ata3: SATA max UDMA/133 cmd 0x0001ec00 ctl 0x0001e882 bmdma 0x0001e400 irq 19
ata4: SATA max UDMA/133 cmd 0x0001e800 ctl 0x0001e482 bmdma 0x0001e408 irq 19
EH scheduled with LOADING set
 [] ata_host_register+0x1ee/0x2c0
 [] ata_pci_init_one+0x12d/0x250
 [] piix_init_one+0x1d0/0x540 [ata_piix]
 [] pci_device_probe+0x56/0x80
 [] driver_probe_device+0x88/0x190
 [] klist_next+0x55/0xb0
 [] __driver_attach+0x7a/0x80
 [] bus_for_each_dev+0x3a/0x60
 [] driver_attach+0x16/0x20
 [] __driver_attach+0x0/0x80
 [] bus_add_driver+0x8a/0x1b0
 [] __pci_register_driver+0x56/0x90
 [] piix_init+0x14/0x26 [ata_piix]
 [] sys_init_module+0x126/0x1860
 [] do_page_fault+0x484/0x670
 [] ata_port_start+0x0/0x70
 [] syscall_call+0x7/0xb
 [] rtmsg_fib+0x70/0x180
 ===
ata3: soft resetting port
ata3: EH complete
EH s

Please pull for stable ATA

2007-07-26 Thread Jeff Garzik

Please pull

commit fe36cb53cfd82f3c0796a0826e1c9caf198c8f97
Author: Petr Vandrovec <[EMAIL PROTECTED]>
Date:   Fri Jul 20 07:44:44 2007 -0400

[libata] Fix reported task file values in sense data

into the 2.6.22 stable tree.

-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] au1xxx: fix au1xxx_set_pio_mode()

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Set transfer mode on the device before programming the host controller for
the new timings (matches what auide_tune_chipset() is doing wrt DMA modes).

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/mips/au1xxx-ide.c |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

Index: b/drivers/ide/mips/au1xxx-ide.c
===
--- a/drivers/ide/mips/au1xxx-ide.c
+++ b/drivers/ide/mips/au1xxx-ide.c
@@ -103,7 +103,9 @@ static void au1xxx_set_pio_mode(ide_driv
 {
int mem_sttime;
int mem_stcfg;
-   u8 speed;
+
+   if (ide_config_drive_speed(drive, pio + XFER_PIO_0))
+   return;
 
mem_sttime = 0;
mem_stcfg  = au_readl(MEM_STCFG2);
@@ -164,9 +166,6 @@ static void au1xxx_set_pio_mode(ide_driv
 
au_writel(mem_sttime,MEM_STTIME2);
au_writel(mem_stcfg,MEM_STCFG2);
-
-   speed = pio + XFER_PIO_0;
-   ide_config_drive_speed(drive, speed);
 }
 
 static int auide_tune_chipset(ide_drive_t *drive, const u8 speed)
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/4] libata: ACPI checks for 80wire cable

2007-07-26 Thread Alan Cox
Testing this on the VIA boards fixes several problems with otherwise
undetectable SATA bridge chips

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_via.c 
linux-2.6.23rc1-mm1/drivers/ata/pata_via.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_via.c  2007-07-26 
15:01:52.974743568 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/pata_via.c  2007-07-26 15:22:30.211654968 
+0100
@@ -180,6 +180,9 @@
   two drives */
if (ata66 & (0x1010 >> (16 * ap->port_no)))
return ATA_CBL_PATA80;
+   /* Check with ACPI so we can spot BIOS reported SATA bridges */
+   if (ata_acpi_cbl_80wire(ap))
+   return ATA_CBL_PATA80;
return ATA_CBL_PATA40;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] ide: move ide_config_drive_speed() calls to upper layers

2007-07-26 Thread Bartlomiej Zolnierkiewicz
On Friday 27 July 2007, Bartlomiej Zolnierkiewicz wrote:
> On Friday 27 July 2007, Bartlomiej Zolnierkiewicz wrote:
> 
> > * Add IDE_HFLAG_POST_SET_MODE host to indicate the need to program the
> >   host for the transfer mode after programming the device.  Set it in
> >   au1xxx-ide/cs5530/cs5535/pdc202xx_new/sc1200/via82cxxx host drivers.
> 
> and amd74xx :)

and pmac :) :)

now time for some sleep...

Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] cs5535: check ide_config_drive_speed() return value

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/pci/cs5535.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Index: b/drivers/ide/pci/cs5535.c
===
--- a/drivers/ide/pci/cs5535.c
+++ b/drivers/ide/pci/cs5535.c
@@ -141,7 +141,9 @@ static void cs5535_set_speed(ide_drive_t
  */
 static int cs5535_set_drive(ide_drive_t *drive, u8 speed)
 {
-   ide_config_drive_speed(drive, speed);
+   if (ide_config_drive_speed(drive, speed))
+   return 1;
+
cs5535_set_speed(drive, speed);
 
return 0;
@@ -156,7 +158,9 @@ static int cs5535_set_drive(ide_drive_t 
  */
 static void cs5535_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
-   ide_config_drive_speed(drive, XFER_PIO_0 + pio);
+   if (ide_config_drive_speed(drive, XFER_PIO_0 + pio))
+   return;
+
cs5535_set_speed(drive, XFER_PIO_0 + pio);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] pdc202xx_new: check ide_config_drive_speed() return value

2007-07-26 Thread Bartlomiej Zolnierkiewicz

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

Index: b/drivers/ide/pci/pdc202xx_new.c
===
--- a/drivers/ide/pci/pdc202xx_new.c
+++ b/drivers/ide/pci/pdc202xx_new.c
@@ -150,13 +150,13 @@ static int pdcnew_tune_chipset(ide_drive
 {
ide_hwif_t *hwif= HWIF(drive);
u8 adj  = (drive->dn & 1) ? 0x08 : 0x00;
-   int err;
 
/*
 * Issue SETFEATURES_XFER to the drive first. PDC202xx hardware will
 * automatically set the timing registers based on 100 MHz PLL output.
 */
-   err = ide_config_drive_speed(drive, speed);
+   if (ide_config_drive_speed(drive, speed))
+   return 1;
 
/*
 * As we set up the PLL to output 133 MHz for UltraDMA/133 capable
@@ -212,7 +212,7 @@ static int pdcnew_tune_chipset(ide_drive
set_indexed_reg(hwif, 0x10 + adj, tmp & 0x7f);
}
 
-   return err;
+   return 0;
 }
 
 static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio)
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/4] libata: ACPI checks for 80wire cable

2007-07-26 Thread Alan Cox
We can make use of this on the pata_amd driver as many Nvidia devices
don't have reliable cable detect.

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_amd.c 
linux-2.6.23rc1-mm1/drivers/ata/pata_amd.c
--- linux.vanilla-2.6.23rc1-mm1/drivers/ata/pata_amd.c  2007-07-26 
15:01:52.909753448 +0100
+++ linux-2.6.23rc1-mm1/drivers/ata/pata_amd.c  2007-07-26 15:18:24.934942696 
+0100
@@ -268,6 +268,9 @@
pci_read_config_word(pdev, 0x62 - 2 * ap->port_no, &udma);
if ((udma & 0xC4) == 0xC4 || (udma & 0xC400) == 0xC400)
cbl = ATA_CBL_PATA80;
+   /* And a triple check across suspend/resume with ACPI around */
+   if (ata_acpi_cbl_80wire(ap))
+   cbl = ATA_CBL_PATA80;
return cbl;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/4] libata: ACPI checks for 80wire cable

2007-07-26 Thread Alan Cox
We can use the ACPI mode information with several drivers as a hint to
cable type. If the ACPI mode set by the BIOS is faster than UDMA33 then
we know the BIOS thinks there are 80wire cables. If it doesn't set such a
mode or it has no ACPI method then we get no further information and can
rely on existing approaches

Introduce the function headers needed. Null it out for non ACPI boxes

Signed-off-by: Alan Cox <[EMAIL PROTECTED]>

diff -u --new-file --recursive --exclude-from /usr/src/exclude 
linux.vanilla-2.6.23rc1-mm1/include/linux/libata.h 
linux-2.6.23rc1-mm1/include/linux/libata.h
--- linux.vanilla-2.6.23rc1-mm1/include/linux/libata.h  2007-07-26 
15:02:58.0 +0100
+++ linux-2.6.23rc1-mm1/include/linux/libata.h  2007-07-26 15:37:59.0 
+0100
@@ -883,6 +916,12 @@
  ATA_TIMING_CYCLE | ATA_TIMING_UDMA,
 };
 
+/* libata-acpi.c */
+#ifdef CONFIG_ATA_ACPI
+extern int ata_acpi_cbl_80wire(struct ata_port *ap);
+#else
+static inline int ata_acpi_cbl_80wire(struct ata_port *ap) { return 0; }
+#endif
 
 #ifdef CONFIG_PCI
 struct pci_bits {
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ide: make CONFIG_IDE_GENERIC default to N

2007-07-26 Thread Tejun Heo
These days, CONFIG_IDE_GENERIC causes more confusion and
misconfiguration than it helps.  Especially so because libata is
linked after the generic driver.  Default to N.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
---
 drivers/ide/Kconfig |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index b1a9b81..8113909 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -304,9 +304,9 @@ comment "IDE chipset support/bugfixes"
 
 config IDE_GENERIC
tristate "generic/default IDE chipset support"
-   default y
+   default n
help
- If unsure, say Y.
+ If unsure, say N.
 
 config BLK_DEV_CMD640
bool "CMD640 chipset bugfix/support"
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Problems with nVidia nForce 520 Chipset

2007-07-26 Thread Tejun Heo
Craig Block wrote:
> --- Tejun Heo <[EMAIL PROTECTED]> wrote:
>> Craig Block wrote:
>>> I'm having a problem getting Linux to handle the SATA drives and
>>> controllers on a new computer with an ASUS M2N-X motherboard.  This is a 
>>> socket AM2 board and has an nVidia nForce 520 chipset.
>> Does 'noapic' kernel parameter help?
> 
> Unfortunately, no.  I also tried noapic with nolapic, nomsi, and pci=nobios.  
> 
> I believe it boils down to the following line I'm seeing in the dmesg output; 
>  
> 
> ata1.00: failed to IDENTIFY (I/O error, err_mask=0x4)

Which is most likely caused by IRQ misrouting as indicated by the APIC
error.  I suggest you to post a new message to LKML with title "IRQ
delivery problem on nForce520" and cc linux-ide.  That should attract
the attention of the right people.

Thanks.

-- 
tejun
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: drivers/ide/pci/cs5535.c: array overrun

2007-07-26 Thread Bartlomiej Zolnierkiewicz

Hi,

On Tuesday 24 July 2007, Jordan Crouse wrote:
> > The Coverity checker spotted the following array overrun in 
> > drivers/ide/pci/cs5535.c:
> 
> <-- snip -->
> 
> > if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_7)
> > reg |= cs5535_udma_timings[speed - XFER_UDMA_0];

Not a bug per se since the upper layer will never feed this function
with speed > XFER_UDMA_4 (thanks to ->ultra_mask being set to 0x1f).

Worth fixing anyway.

> Fix is attached.  Somebody got overzealous - the 5535 only supports
> up to UDMA4, which matches the array.

applied, thanks

Bart
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] pci: rename __pci_reenable_device() to pci_reenable_device()

2007-07-26 Thread Tejun Heo
Rename __pci_reenable_device() to pci_reenable_device().

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
---
Jeff, Greg wanted to drop the preceding underscores before exporting
the function and the updated patch was posted but the earlier version
was applied.  This patch renames the function.

 drivers/ata/ata_piix.c   |6 +++---
 drivers/pci/pci-driver.c |2 +-
 drivers/pci/pci.c|7 +++
 include/linux/pci.h  |2 +-
 4 files changed, 8 insertions(+), 9 deletions(-)

Index: work/drivers/ata/ata_piix.c
===
--- work.orig/drivers/ata/ata_piix.c
+++ work/drivers/ata/ata_piix.c
@@ -973,10 +973,10 @@ static int piix_pci_device_resume(struct
pci_restore_state(pdev);
 
/* PCI device wasn't disabled during suspend.  Use
-* __pci_reenable_device() to avoid affecting the
-* enable count.
+* pci_reenable_device() to avoid affecting the enable
+* count.
 */
-   rc = __pci_reenable_device(pdev);
+   rc = pci_reenable_device(pdev);
if (rc)
dev_printk(KERN_ERR, &pdev->dev, "failed to enable "
   "device after resume (%d)\n", rc);
Index: work/drivers/pci/pci-driver.c
===
--- work.orig/drivers/pci/pci-driver.c
+++ work/drivers/pci/pci-driver.c
@@ -310,7 +310,7 @@ static int pci_default_resume(struct pci
/* restore the PCI config space */
pci_restore_state(pci_dev);
/* if the device was enabled before suspend, reenable */
-   retval = __pci_reenable_device(pci_dev);
+   retval = pci_reenable_device(pci_dev);
/* if the device was busmaster before the suspend, make it busmaster 
again */
if (pci_dev->is_busmaster)
pci_set_master(pci_dev);
Index: work/drivers/pci/pci.c
===
--- work.orig/drivers/pci/pci.c
+++ work/drivers/pci/pci.c
@@ -695,14 +695,13 @@ static int do_pci_enable_device(struct p
 }
 
 /**
- * __pci_reenable_device - Resume abandoned device
+ * pci_reenable_device - Resume abandoned device
  * @dev: PCI device to be resumed
  *
  *  Note this function is a backend of pci_default_resume and is not supposed
  *  to be called by normal code, write proper resume handler and use it 
instead.
  */
-int
-__pci_reenable_device(struct pci_dev *dev)
+int pci_reenable_device(struct pci_dev *dev)
 {
if (atomic_read(&dev->enable_cnt))
return do_pci_enable_device(dev, (1 << PCI_NUM_RESOURCES) - 1);
@@ -1604,7 +1603,7 @@ early_param("pci", pci_setup);
 device_initcall(pci_init);
 
 EXPORT_SYMBOL_GPL(pci_restore_bars);
-EXPORT_SYMBOL(__pci_reenable_device);
+EXPORT_SYMBOL(pci_reenable_device);
 EXPORT_SYMBOL(pci_enable_device_bars);
 EXPORT_SYMBOL(pci_enable_device);
 EXPORT_SYMBOL(pcim_enable_device);
Index: work/include/linux/pci.h
===
--- work.orig/include/linux/pci.h
+++ work/include/linux/pci.h
@@ -534,7 +534,7 @@ static inline int pci_write_config_dword
 
 int __must_check pci_enable_device(struct pci_dev *dev);
 int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask);
-int __must_check __pci_reenable_device(struct pci_dev *);
+int __must_check pci_reenable_device(struct pci_dev *);
 int __must_check pcim_enable_device(struct pci_dev *pdev);
 void pcim_pin_device(struct pci_dev *pdev);
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ata_piix: add Tecra M3 to broken suspend blacklist

2007-07-26 Thread Tejun Heo
Add Tecra M3 to the broken suspend blacklist.  Tecra M3 doesn't have
proper DMI_PRODUCT_NAME but has an OEM_STRING instead.  Match it.

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
---
 drivers/ata/ata_piix.c |8 
 1 file changed, 8 insertions(+)

Index: work/drivers/ata/ata_piix.c
===
--- work.orig/drivers/ata/ata_piix.c
+++ work/drivers/ata/ata_piix.c
@@ -916,10 +916,18 @@ static int piix_broken_suspend(void)
},
{ }
};
+   static const char *oemstrs[] = {
+   "Tecra M3,",
+   };
+   int i;
 
if (dmi_check_system(sysids))
return 1;
 
+   for (i = 0; i < ARRAY_SIZE(oemstrs); i++)
+   if (dmi_find_device(DMI_DEV_TYPE_OEM_STRING, oemstrs[i], NULL))
+   return 1;
+
return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ata_piix: implement piix_borken_suspend()

2007-07-26 Thread Tejun Heo
Separate out broken suspend blacklist matching into
piix_broken_suspend().

Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
---
 drivers/ata/ata_piix.c |   60 -
 1 file changed, 30 insertions(+), 30 deletions(-)

Index: work/drivers/ata/ata_piix.c
===
--- work.orig/drivers/ata/ata_piix.c
+++ work/drivers/ata/ata_piix.c
@@ -890,37 +890,38 @@ static void ich_set_dmamode (struct ata_
 }
 
 #ifdef CONFIG_PM
-static struct dmi_system_id piix_broken_suspend_dmi_table[] = {
-   {
-   .ident = "TECRA M5",
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
-   },
-   },
-   {
-   .ident = "Satellite U200",
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U200"),
+static int piix_broken_suspend(void)
+{
+   static struct dmi_system_id sysids[] = {
+   {
+   .ident = "TECRA M5",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+   DMI_MATCH(DMI_PRODUCT_NAME, "TECRA M5"),
+   },
},
-   },
-   {
-   .ident = "Satellite U205",
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"),
+   {
+   .ident = "Satellite U205",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+   DMI_MATCH(DMI_PRODUCT_NAME, "Satellite U205"),
+   },
},
-   },
-   {
-   .ident = "Portege M500",
-   .matches = {
-   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
-   DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"),
+   {
+   .ident = "Portege M500",
+   .matches = {
+   DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
+   DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE M500"),
+   },
},
-   },
-   { }
-};
+   { }
+   };
+
+   if (dmi_check_system(sysids))
+   return 1;
+
+   return 0;
+}
 
 static int piix_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg)
 {
@@ -937,8 +938,7 @@ static int piix_pci_device_suspend(struc
 * cycles and power trying to do something to the sleeping
 * beauty.
 */
-   if (dmi_check_system(piix_broken_suspend_dmi_table) &&
-   mesg.event == PM_EVENT_SUSPEND) {
+   if (piix_broken_suspend() && mesg.event == PM_EVENT_SUSPEND) {
pci_save_state(pdev);
 
/* mark its power state as "unknown", since we don't
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] pci: rename __pci_reenable_device() to pci_reenable_device()

2007-07-26 Thread Greg KH
On Fri, Jul 27, 2007 at 02:43:35PM +0900, Tejun Heo wrote:
> Rename __pci_reenable_device() to pci_reenable_device().
> 
> Signed-off-by: Tejun Heo <[EMAIL PROTECTED]>
> ---
> Jeff, Greg wanted to drop the preceding underscores before exporting
> the function and the updated patch was posted but the earlier version
> was applied.  This patch renames the function.

Yeah, that is nicer :)

Acked-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html