Device attaches on Solaris 10

Hello,

We have a device driver that's been working on Solaris 7 and higher for some time. We're seeing different behavior on Solaris 10 that is causing us problems. We are running on Sparcs.

Our driver has one pseudo device and one or more physical devices.

Normally when the driver loads, the attach function is called for the pseudo device and the physical devices (in some not necessarily predictable order).

This loading would usually take place when the pseudo device was opened, but could be due to the driver initially being installed or sometimes when the system boots.

With Solaris 10, after rebooting the system, sometimes the pseudo device access only causes the pseudo device to be attached, and not the physical devices.

Our driver is actually accessed by applications soley via the pseudo device, rather than by individual devices, so this causes a big problem for us.

Is there anything we can do to cause the behavior to revert back to what it was before? Anything which causes the physical devices to all be attached would be fine, such as some call the attach for the pseudo device could make. Or something to put in our .conf file, etc.

Thanks,

Nathan

[1233 byte] By [n_glasser] at [2007-11-26 8:25:00]
# 1
what do you have already in the .conf file?tim
timuglow at 2007-7-6 21:36:56 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 2

>what do you have already in the .conf file?

In the nearly one month since I first posted the question, I believe I figured out what to do.

I added ddi-forceattach=1, and I believe that it works.

I've heard an (unsubstantiated) rumor that if a system is uncleanly shutdown (power interrupted), then when the system comes up the devices may not get reattached despite the presence of that config file line. Should that be able to happen?

Thanks,

Nathan

n_glasser at 2007-7-6 21:36:56 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 3

Setting the property :

ddi-forceattach=1;

will ensure that the physical devices to be attached during very early stages of Solaris

boot.Unclean shutdown *will* not affect this functionality in any way.

Setting the "ddi-forceattach" property in Pseudo driver .conf file will not help. Solaris

does not "attach" Pseudo drivers which do not have ".conf" children (even though

the Pseudo driver conf file has "ddi-forceattach=1" property set). Opening the Pseudo

device file will attach the Pseudo driver.

From what I undestand of your requirement, the following should be sufficient :

1. Set property : "ddi-forceattach=1" for all physical devices that is required by Pseudo

driver.

2. Application opens the Pseudo device node.

Let me know if you have any queries / issues.

pramodbg at 2007-7-6 21:36:56 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 4

Thank you for your response.

>Setting the "ddi-forceattach" property in Pseudo driver .conf file will not

>help. Solaris does not "attach" Pseudo drivers which do not have ".conf"

>children (even though the Pseudo driver conf file has "ddi-forceattach=1"

>property set). Opening the Pseudo device file will attach the Pseudo driver.

I'm confused... We have a .conf file, as mentioned, but what makes

it a "Pseudo driver .conf" rather than just a "driver .conf"?

>From what I undestand of your requirement, the following should be sufficient :

>1. Set property : "ddi-forceattach=1" for all physical devices that is

>required by Pseudo driver.

>2. Application opens the Pseudo device node.

>Let me know if you have any queries / issues.

I do have further questions.

Included below is a version of our .conf file modified to protect the

names of the guilty.

As you can see, there is part of it which defines a pseudo device,

and then a set of properties that apply to all devices. Or that's the

intention.

In #1, you said to set the ddi-forceattach property for all "physical

devices", but how do I do this, if it's not what I'm already doing? And what

do you mean "required by Pseudo driver"?

name="foobar" parent="pseudo" instance=1000 FOOBAR_PSEUDO=1;

ddi-forceattach=1

FOOBAR_SYM1=1

FOOBAR_SYM2=2

FOOBAR_SYM3=3;

On a Solaris 9 system of mine, recently I believe I have seen multiple cases

where I've booted, and a physical device has not gotten attached, but if I

reboot, it will be attached the next time.

Thanks,

Nathan

nglasser at 2007-7-6 21:36:56 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 5

Sorry for the confusion. A few clarifications :

Driver configuration files are defined by the man page driver.conf(4). Driver configuration

files which have specified "pseudo" as thier parent, in thier driver.conf file, do not

correspond to any physical hardware device.

Example :/kernel/drv/random.conf

name="random" parent="pseudo" instance=0;

This is termed (I do *not* think that this is an official term) as Pseudo driver.conf. This is

still a driver.conf.

Driver configuration files which have not specified "pseudo" as thioer parent will

correspond to hardware devices.

Example : /kernel/drv/uhci.conf

For driver.conf files, which have specified "parent=pseudo" in the driver.conf, Setting

the property "ddi-forceattach=1" will *not* attach the driver. The driver will attach whenever

an application first opens it. As the driver is not attached to any hardware, this should not

have any impact on any application.

In your example, the driver foobar will be attached when the device opens : "/dev/foobar".

This is because the foorbar.conf has : parent="pseudo"; property. Let us say foobar depends on "uhci" driver (which is a driver correspondng to a hardware), then uhci.conf

should have "ddi-forceattach=1"

Hope this clarifies.

One clarification : When you say that the physical device has not got attached, are you

expecting to see "foobar" attached before any application opens it.

Pramod

pramodbg at 2007-7-6 21:36:56 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...
# 6

Hello,

>In your example, the driver foobar will be attached when the device opens :

>"/dev/foobar". This is because the foorbar.conf has : parent="pseudo";

>property. Let us say foobar depends on "uhci" driver (which is a driver

>correspondng to a hardware), then uhci.conf should have "ddi-forceattach=1"

The intention for our driver is as follows.

There is a psuedo instance which can be opened whether or not there

are any physical devices present.

There may also be one or more physical devices (and most of the time, there

will be). In such cases, we want to make sure they are attached (the reason

for using ddi-forceattach=1.)

>One clarification : When you say that the physical device has not got

>attached, are you expecting to see "foobar" attached before any application

>opens it.

It is not an absolute requirement that the pseudo device be attached

early, but we need to make sure that all the physical devices are

attached no later than a very short span of time after the pseudo

device is attached. It seemed that ddi-forceattach=1 would ensure this

by attaching them at boot.

>name="foobar" parent="pseudo" instance=1000 FOOBAR_PSEUDO=1;

>ddi-forceattach=1

>FOOBAR_SYM1=1

>FOOBAR_SYM2=2

>FOOBAR_SYM3=3;

Does it matter whether the "ddi-forceattach=1" comes before or after

the first ';'? As you saw in my sample, I had it afterwards.

Thanks,

Nathan

nglasser at 2007-7-6 21:36:56 > top of Java-index,Solaris Operating System,Solaris Essentials - General Technical Questions...