Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Kernel & Hardware
  • Search

Persistently adding new PCI ID for ahci driver

Kernel not recognizing your hardware? Problems with power management or PCMCIA? What hardware is compatible with Gentoo? See here. (Only for kernels supported by Gentoo.)
Post Reply
Advanced search
3 posts • Page 1 of 1
Author
Message
quadbox
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Tue Jun 11, 2002 9:48 am
Location: Brisbane, Australia

Persistently adding new PCI ID for ahci driver

  • Quote

Post by quadbox » Wed Apr 25, 2012 11:22 am

Hi all.

My motherboard happens to have a sata controller on it who's pci ids arent in the AHCI driver by default (a marvell chipset of one flavour or another), and so requires that ID to be added before it'll work. The workaround being to write those IDs in via "echo 1b4b 917a > /sys/bus/pci/drivers/ahci/new_id", the two strings being the vendor ID and device ID.

What I cannot work out is an elegant way to have this happen correctly on boot, short of editing init scripts. It needs to happen before filesystems are mounted, which rules out putting a script in /etc/local.d as that's not loaded in the boot runlevel. I *think* the correct way to do this is to make an appropriate udev rule, but I havent got that working right, possibly I'm approaching it wrong or something. What I've attempted is:

Code: Select all

SUBSYSTEM=="pci", SYSFS{idVendor}=="1b4b", SYSFS{idProduct}=="917a", RUN=="/bin/echo 1b4b 917a >/sys/bus/pci/drivers/ahci/new_id"
This will add the rule, but mounting the partition on boot still fails because it's happening after filesystems are mounted.

The relevant line for the controller from lspci:

Code: Select all

01:00.0 IDE interface: Marvell Technology Group Ltd. Device 917a (rev 11)
Anyone got a suggestion as to how to make this play nice?

EDIT - Fixed a typo and some missing info
Top
roarinelk
Guru
Guru
User avatar
Posts: 524
Joined: Thu Mar 04, 2004 12:24 pm

  • Quote

Post by roarinelk » Wed Apr 25, 2012 11:38 am

Apply this patch to your kernel tree and tell me if it works reliably (i.e. no data errors):

Code: Select all

diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 79a1e9d..e1691f7 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -396,6 +396,8 @@ static const struct pci_device_id ahci_pci_tbl[] = {
          .driver_data = board_ahci_yes_fbs },                  /* 88se9125 */
        { PCI_DEVICE(0x1b4b, 0x91a3),
          .driver_data = board_ahci_yes_fbs },
+       { PCI_DEVICE(0x1b4b, 0x917a),
+         .driver_data = board_ahci_yes_fbs },
 
        /* Promise */
        { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci },   /* PDC42819 */
Can you set some modes for it in the BIOS? By default most/all newer AHCI controllers
use another class code to identify themselves; only when you switch them into alternate
modes (IDE or RAID for example) they aren't immediately recognized by "default" drivers.
Top
quadbox
Tux's lil' helper
Tux's lil' helper
Posts: 94
Joined: Tue Jun 11, 2002 9:48 am
Location: Brisbane, Australia

  • Quote

Post by quadbox » Sat Apr 28, 2012 1:05 pm

Yeah, sure enough there was an option in the bios to set it to AHCI, which did solve my problem. Thanks for the suggestion.

I havent tried your patch, however I was using the controller for a few months just adding the pci IDs via sysfs as I mentioned and it worked reliably. so I'd imagine the patch'd work fine since it's just doing the same thing.

If it's of interest btw, with the controller set to AHCI in the bios lspci shows it as:

Code: Select all

01:00.0 SATA controller: Marvell Technology Group Ltd. 88SE9172 SATA 6Gb/s Controller (rev 11)
Top
Post Reply

3 posts • Page 1 of 1

Return to “Kernel & Hardware”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic