Bug#622997: libata-sff/pata_cmd64x problem with hardwired configurations

2011-04-19 Thread Bartlomiej Zolnierkiewicz

Hi,

Sergei Shtylyov wrote:

 Hello.
 
 James Bottomley wrote:
 
  I can get all of this working by fixing up all the hard coded knowledge
  in libata-sff only to use a single port.
  However, I can't fix the libata-sff driver until I know how to tell
  there's only one port wired.  Does anyone with cmd649 knowledge have any
  idea how I might tell this?
 
  The secondary port is enabled in the PCI config. space: register 0x51 
  bit 
  3 controls this. Unfortunately, pata_cmd64x driver still doesn't check the 
  channel enable bits; the cmd64x driver does though, so it might be worth 
  trying...
 
  So this is the enablebits code in driver/ide
 
 We still need to ensure that these are indeed the enable bits that are at 
 play here...
 
  that's missing from any of
  the libata stuff?
 
 Not from any. It's handled in some drivers, like pata_hpt37x, for example 
 -- 
 in their prereset() methods.
 
  Should this be generic in libata-sff? ...
 
 There's even libata core function, pci_test_config_bits() that 
 facilitates 
 this check.
 
  I mean even on an x86 where arbitrary memory can be poked without 
  consequence,
  trying to activate a disabled port will still produce lots of noise.
 
 The story with pata_cmd64x is somewhat convoluted: originally (when the 
 libata driver was created) in the IDE driver there were only enable bits for 
 the 
 secondary channel of PCI0646 (and even those wrong); I fixed those and added 
 the 
 enable bits for other chips back in 2007 but it never got propagated to 
 pata_cmd64x. Well, I have some plans for changes to this driver but not much 
 time to actually do them currently...

From atang tree, orginally posted in 2009:

From: Bartlomiej Zolnierkiewicz bzoln...@gmail.com
Subject: [PATCH v2] pata_cmd64x: add enablebits checking

Fixes IDE - libata regression.

IDE's cmd64x host driver has been supporting enablebits checking
since the initial driver's merge.

Signed-off-by: Bartlomiej Zolnierkiewicz bzoln...@gmail.com
---
 drivers/ata/pata_cmd64x.c |   35 +++
 1 file changed, 35 insertions(+)

Index: b/drivers/ata/pata_cmd64x.c
===
--- a/drivers/ata/pata_cmd64x.c
+++ b/drivers/ata/pata_cmd64x.c
@@ -79,6 +79,40 @@ static int cmd648_cable_detect(struct at
 }
 
 /**
+ * cmd64x_prereset -   perform reset handling
+ * @link: ATA link
+ * @deadline: deadline jiffies for the operation
+ *
+ * Reset sequence checking enable bits to see which ports are
+ * active.
+ */
+
+static int cmd64x_prereset(struct ata_link *link, unsigned long deadline)
+{
+   static const struct pci_bits cmd64x_enable_bits[] = {
+   { 0x51, 1, 0x04, 0x04 },
+   { 0x51, 1, 0x08, 0x08 }
+   };
+
+   struct ata_port *ap = link-ap;
+   struct pci_dev *pdev = to_pci_dev(ap-host-dev);
+
+   /*
+* The original PCI0643 and PCI0646 didn't have the primary
+* channel enable bit, it appeared starting with PCI0646U
+* (i.e. revision ID 3).
+*/
+   if (ap-port_no == 0  (pdev-device == PCI_DEVICE_ID_CMD_643 ||
+   (pdev-device == PCI_DEVICE_ID_CMD_646  pdev-revision  3)))
+   goto out;
+
+   if (!pci_test_config_bits(pdev, cmd64x_enable_bits[ap-port_no]))
+   return -ENOENT;
+out:
+   return ata_sff_prereset(link, deadline);
+}
+
+/**
  * cmd64x_set_timing   -   set PIO and MWDMA timing
  * @ap: ATA interface
  * @adev: ATA device
@@ -266,6 +300,7 @@ static const struct ata_port_operations
.inherits   = ata_bmdma_port_ops,
.set_piomode= cmd64x_set_piomode,
.set_dmamode= cmd64x_set_dmamode,
+   .prereset   = cmd64x_prereset,
 };
 
 static struct ata_port_operations cmd64x_port_ops = {







--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#622997: libata-sff/pata_cmd64x problem with hardwired configurations

2011-04-19 Thread Bartlomiej Zolnierkiewicz
On Tue, Apr 19, 2011 at 12:08 PM, Alan Cox a...@lxorguk.ukuu.org.uk wrote:
 From: Bartlomiej Zolnierkiewicz bzoln...@gmail.com
 Subject: [PATCH v2] pata_cmd64x: add enablebits checking

 Fixes IDE - libata regression.

 And causes a regression too

Could you be more explicit?

Regression in this patch would mean that old driver currently doesn't
work which is not true..

Thanks,
Bartlomiej



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#401035: ST310211A and HPA ( was Re: Bug#401035: linux-image-2.6-686 - another misbehaving Seagate )

2008-02-16 Thread Bartlomiej Zolnierkiewicz
On Wednesday 06 February 2008, Mikko Rapeli wrote:
 (cc'ing linux-ide)
 
 On Mon, Feb 04, 2008 at 02:32:59AM +0100, Bart Champagne wrote:
  Just found another type of Seagate drives that shows this behaviour : 
  ST310211A
  Can this one be blacklisted as well ?
 
 Yes, do you have a patch? And a dmesg dump of the drive in use with and 
 without a patch?
 
 If you do, please send them to upstream [EMAIL PROTECTED] and hope
 that the fix gets applied to Debian kernels too. Also, please test the
 sata/pata driver with your drive and add a blacklist there too.
 
 If you don't have a patch, here's one for 2.6.24 to go.
 
 From 4a8b40c53d2e539bad3f93996f599d69a16af94b Mon Sep 17 00:00:00 2001
 From: Mikko Rapeli [EMAIL PROTECTED]
 Date: Wed, 6 Feb 2008 09:41:14 +0200
 Subject: [PATCH] ST310211A has buggy HPA too.
 
 Signed-off-by: Mikko Rapeli [EMAIL PROTECTED]

applied (this was confirmed by Bart Champagne to fix the issue)

Thanks.

 ---
  drivers/ata/libata-core.c |1 +
  drivers/ide/ide-disk.c|1 +
  2 files changed, 2 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
 index 6380726..d08f869 100644
 --- a/drivers/ata/libata-core.c
 +++ b/drivers/ata/libata-core.c
 @@ -4169,6 +4169,7 @@ static const struct ata_blacklist_entry 
 ata_device_blacklist [] = {
   /* Devices which report 1 sector over size HPA */
   { ST340823A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
   { ST320413A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
 + { ST310211A,  NULL,   ATA_HORKAGE_HPA_SIZE, },
  
   /* Devices which get the IVB wrong */
   { QUANTUM FIREBALLlct10 05, A03.0900, ATA_HORKAGE_IVB, },
 diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c
 index b178190..a0f9940 100644
 --- a/drivers/ide/ide-disk.c
 +++ b/drivers/ide/ide-disk.c
 @@ -462,6 +462,7 @@ static inline int idedisk_supports_lba48(const struct 
 hd_driveid *id)
  static const struct drive_list_entry hpa_list[] = {
   { ST340823A,  NULL },
   { ST320413A,  NULL },
 + { ST310211A,  NULL },
   { NULL, NULL }
  };



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#321442: kernel-source-2.6.8: fails to compile on powerpc (drivers/ide/ppc/pmac.c)

2005-09-05 Thread Bartlomiej Zolnierkiewicz
Should be fixed in 2.6.13.

On 8/16/05, Kyle Moffett [EMAIL PROTECTED] wrote:
 On Aug 13, 2005, at 18:54:30, LT-P wrote:
  Le lun 08 aoû 2005 17:57:04 CEST, Horms [EMAIL PROTECTED] a écrit:
  Can you please enable BLK_DEV_IDEDMA_PCI and see if that resolves
  your
  problem. If it does, then the following patch should fix Kconfig
  so that BLK_DEV_IDEDMA_PCI needs to be enabled for BLK_DEV_IDE_PMAC
  to be enabled. It should patch cleanly against Debian's 2.6.8 and
  Linus' current Git tree.
  It seems to solve the problem, thanks.
  Sometimes, I feel like I am the only person in the world to compile
  the kernel on
  powerpc... :)
 
 Actually, I ran into this same bug a day or so ago when updating to
 2.6.13-rc6,
 it's just I noticed the error, fixed my config, then recompiled and
 forgot
 about it completely until now :-D.  Thanks for the bug report, though!
 
 Cheers,
 Kyle Moffett



Bug#289770: (fwd) Re: Bug#289770: kernel-image-2.6.10-1-686: 2.6.10 fails to set up DMA on my IBM thinkpad

2005-01-12 Thread Bartlomiej Zolnierkiewicz
On Wednesday 12 January 2005 13:02, Philip Armstrong wrote:
 On Tue, Jan 11, 2005 at 08:53:45PM +0100, maximilian attems wrote:
  dma on a thinkpad  600E worked for 2.6.8, but didn't since 2.6.9
  also non working 2.6.10.
  
  -hda: 12594960 sectors (6448 MB) w/460KiB Cache, CHS=13328/15/63, UDMA(33)
  +hda: 12594960 sectors (6448 MB) w/460KiB Cache, CHS=13328/15/63
  
  could you please look at the following ide dma bug report for piix in
  debian - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=289770
  full dmesg of both 2.6.8 and 2.6.10 are posted there.

something steals resource needed for IDE driver so no DMA

 Incidentally, this may be the same bug as Debian bug #284558:
 
   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=284558
 
 which involves more recent PIIX hardware.

this one is an user error, ide_generic driver shouldn't be used
at the same time as piix driver


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]