Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Kernel patch to disable 80-wire check
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 905

PostPosted: Tue Feb 17, 2009 11:57 pm    Post subject: Kernel patch to disable 80-wire check Reply with quote

I have 4 gentoo machines All have SSD's. Two of these machines suffer from the kernel shutting down the fast DMA modes because they don't detect an 80 wire cable. That's becuase neither uses a cable. In one case it's a laptop, in the other a CF card plugged directly into the MB.

This patch works against gentoo-sources-2.6.28 and 2.6.28-r1. In case you don't know (I didn't) copy the code below to a patch file like "80w.patch" and put it in /usr/src/linux, then give "# patch -p0 -i 80w.patch" and you should be good to go.

This is the first time I've tinkered with the kernel (but very minimally), the first time I've written a patch, and the first time I've applied one by hand.

Code:

*** drivers/ide/ide-iops.c      Tue Feb 17 17:17:00 2009
--- drivers/ide/ide-iops.c.new  Tue Feb 17 17:18:04 2009
***************
*** 644,660 ****
                return 1;

  no_80w:
!       if (drive->dev_flags & IDE_DFLAG_UDMA33_WARNED)
!               return 0;

        printk(KERN_WARNING "%s: %s side 80-wire cable detection failed, "
!                           "limiting max speed to UDMA33\n",
                            drive->name,
                            hwif->cbl == ATA_CBL_PATA80 ? "drive" : "host");

!       drive->dev_flags |= IDE_DFLAG_UDMA33_WARNED;

!       return 0;
  }

  int ide_driveid_update(ide_drive_t *drive)
--- 644,661 ----
                return 1;

  no_80w:
!       // *** 80 wire patch applied
!       //if (drive->dev_flags & IDE_DFLAG_UDMA33_WARNED)
!       //#     return 0;

        printk(KERN_WARNING "%s: %s side 80-wire cable detection failed, "
!                           "NOT limiting max speed to UDMA33 (Patch)\n",
                            drive->name,
                            hwif->cbl == ATA_CBL_PATA80 ? "drive" : "host");

!       //drive->dev_flags |= IDE_DFLAG_UDMA33_WARNED;

!       return 1;
  }

  int ide_driveid_update(ide_drive_t *drive)



I wish we had a .config option to do this. I'll bet lots of people need it these days.

Cheers,

Jon.
Back to top
View user's profile Send private message
Malvineous
Apprentice
Apprentice


Joined: 20 Oct 2006
Posts: 281
Location: Brisbane, Australia

PostPosted: Sat Feb 21, 2009 1:08 pm    Post subject: Reply with quote

Probably worth making a kernel option for this (not hard) and posting a patch to the kernel list - at the very least it might generate some discussion about the best way of handling this, as you raise a valid point.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum