How to disable ata driver on Hyper-V
Hongjiang Zhang
honzhan at microsoft.com
Fri Aug 19 02:17:24 UTC 2016
Hi Scott,
I did some hardcode modifications to achieve what I want: disable ata driver but let cd/dvd show up. See the attachment. The boot log is also attached.
hv_ata_pci_disengage.c is the ata driver of FreeBSD for Hyperv.
In the log file, I can see message for ata0 and ata1 together with my dumped PCI information.
Aug 19 09:45:01 hz_BSD11 kernel: ata0: PCI class: 1, PCI subclass: 1
Aug 19 09:45:01 hz_BSD11 kernel: ata0: <ATA channel> at channel 0 on atapci0
Aug 19 09:45:01 hz_BSD11 kernel: ioapic0: routing intpin 14 (ISA IRQ 14) to lapic 0 vector 51
Aug 19 09:45:01 hz_BSD11 kernel: random: harvesting attach, 8 bytes (4 bits) from ata0
Aug 19 09:45:01 hz_BSD11 kernel: ata1: PCI class: 1, PCI subclass: 1
Aug 19 09:45:01 hz_BSD11 kernel: ata1: <ATA channel> at channel 1 on atapci0
Aug 19 09:45:01 hz_BSD11 kernel: ioapic0: routing intpin 15 (ISA IRQ 15) to lapic 0 vector 52
Thanks
Hongjiang Zhang
-----Original Message-----
From: Scott Long [mailto:scott4long at yahoo.com]
Sent: Friday, August 19, 2016 12:48 AM
To: Hongjiang Zhang <honzhan at microsoft.com>
Cc: freebsd-scsi at freebsd.org
Subject: Re: How to disable ata driver on Hyper-V
Hi,
I’m not sure that I understand. Can you provide an example boot-time output?
Thanks,
Scott
> On Aug 17, 2016, at 10:48 PM, Hongjiang Zhang <honzhan at microsoft.com> wrote:
>
> Hi Scott,
>
> FreeBSD on Hyper-V already has a customized ata driver, which returns "BUS_PROBE_DEFAULT" or "EXNIO" for enabling or disabling the driver on ata controller. But this implementation has issues. If the ata controller has a CD/DVD device on it, the /dev/cd0 device failed to be created if I put CD/DVD on an ata controller which has been disabled.
>
> What I want is disable the /dev/ada device but bypass the /dev/cd device. I found it is difficult for me to determine what type of device will be created in my customized ata probe function. That is why I want to disable ata driver.
>
> Thanks
> Hongjiang Zhang
>
> -----Original Message-----
> From: Scott Long [mailto:scott4long at yahoo.com]
> Sent: Thursday, August 18, 2016 12:22 AM
> To: Hongjiang Zhang <honzhan at microsoft.com>
> Cc: freebsd-scsi at freebsd.org
> Subject: Re: How to disable ata driver on Hyper-V
>
> Hi,
>
> There’s no direct way to disable a specific driver or specific instance of a driver. There are ways to disable a particular PCI function, but I’m not sure if that’s what you want. Are you looking to override the default ata driver with your own custom driver? The way to do that is have your custom driver provide a higher priority return code from its dev_probe routine. The way this works is that positive return codes indicate an error. Negative return codes indicate a priority, with the numbers closer to zero being a higher priority. Zero is the highest priority, but should be used only with great care. The priority for the default ahci driver is BUS_PROBE_DEFAULT, which resolves to (-20). You might consider using BUS_PROBE_VENDOR, which resolves to (-10). By having your driver look at the PCI bus:device:function tuple, you can selectively override the default driver for specific hardware.
>
> Scott
>
>> On Aug 17, 2016, at 2:49 AM, Hongjiang Zhang via freebsd-scsi <freebsd-scsi at freebsd.org> wrote:
>>
>> Hi all,
>>
>> I'm want to disable the default ata driver for FreeBSD on Hyper-V. How to do that?
>>
>> Thanks
>> Hongjiang Zhang
>> _______________________________________________
>> freebsd-scsi at freebsd.org mailing list
>> https://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2flist
>> s
>> .freebsd.org%2fmailman%2flistinfo%2ffreebsd-scsi&data=01%7c01%7chonzh
>> a
>> n%40microsoft.com%7cfba44fbedbf7421bb1a008d3c6bafc76%7c72f988bf86f141
>> a
>> f91ab2d7cd011db47%7c1&sdata=YuqATsXVz4e4Ohgv%2fYc09SeQ%2fMSLLgpAhro8N
>> c Lm9tI%3d To unsubscribe, send any mail to
>> "freebsd-scsi-unsubscribe at freebsd.org"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hardcode_disable_ata.patch
Type: application/octet-stream
Size: 2326 bytes
Desc: hardcode_disable_ata.patch
URL: <http://lists.freebsd.org/pipermail/freebsd-scsi/attachments/20160819/dcb97192/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: messages
Type: application/octet-stream
Size: 64337 bytes
Desc: messages
URL: <http://lists.freebsd.org/pipermail/freebsd-scsi/attachments/20160819/dcb97192/attachment-0001.obj>
More information about the freebsd-scsi
mailing list