* Re: linux-next: Tree for September 7 (scsi/qla2x)
[not found] <20090907210206.7830ba68.sfr@canb.auug.org.au>
@ 2009-09-07 17:27 ` Randy Dunlap
2009-09-08 18:25 ` Andrew Vasquez
0 siblings, 1 reply; 23+ messages in thread
From: Randy Dunlap @ 2009-09-07 17:27 UTC (permalink / raw)
To: Stephen Rothwell, linux-scsi; +Cc: linux-next, LKML, Andrew Vasquez
On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> Hi all,
>
> Changes since 20090904:
when CONFIG_MODULES=n:
drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
in
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: linux-next: Tree for September 7 (scsi/qla2x)
2009-09-07 17:27 ` linux-next: Tree for September 7 (scsi/qla2x) Randy Dunlap
@ 2009-09-08 18:25 ` Andrew Vasquez
2009-09-11 17:53 ` qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x)) Andrew Vasquez
0 siblings, 1 reply; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-08 18:25 UTC (permalink / raw)
To: Randy Dunlap
Cc: Stephen Rothwell, linux-scsi@vger.kernel.org,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
On Mon, 07 Sep 2009, Randy Dunlap wrote:
> On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
>
> > Hi all,
> >
> > Changes since 20090904:
>
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
Argg... Some history here... During several unwelcome
hardware/firmware events (ISP system error, mailbox command timeouts,
etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
snapshot of the current state of the ISP firmware). This snapshot is
then captured via a user-space tool querying a driver sysfs-node
hanging off of a scsi_host's device tree:
/sys/class/scsi_host/host4/device/fw_dump
The dump is then used by our firmware engineering group to help triage
the issue.
This recent change:
commit 10a71b40153a19279428053ad9743e15ef414148
Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
Date: Tue Aug 25 11:36:15 2009 -0700
[SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
attempted to help 'automate' the task of retrieval by signaling udev
to automatically run the 'retrieval' script anytime the driver
captured the firmware-dump. Here's a snippet of the udev rule:
# qla2xxx driver
KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
Any suggestions here on an alternate driver-specific kobject an LLD
can/should use for something like this? I looked previously at other
callers of kobject_uevent_env(), but didn't really see a simlar
usage-pattern of a driver wanting to signal events to userspace...
Thanks, AV
^ permalink raw reply [flat|nested] 23+ messages in thread
* qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
2009-09-08 18:25 ` Andrew Vasquez
@ 2009-09-11 17:53 ` Andrew Vasquez
2009-09-11 21:25 ` Randy Dunlap
2009-09-11 22:42 ` James Bottomley
0 siblings, 2 replies; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-11 17:53 UTC (permalink / raw)
To: Linux SCSI Mailing List
Cc: Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali
Randy Dunlap noted:
when CONFIG_MODULES=n:
drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
in
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
On Tue, 08 Sep 2009, Andrew Vasquez wrote:
> On Mon, 07 Sep 2009, Randy Dunlap wrote:
>
> > On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> >
> > > Hi all,
> > >
> > > Changes since 20090904:
> >
> >
> > when CONFIG_MODULES=n:
> >
> > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >
> > in
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
>
> Argg... Some history here... During several unwelcome
> hardware/firmware events (ISP system error, mailbox command timeouts,
> etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
> snapshot of the current state of the ISP firmware). This snapshot is
> then captured via a user-space tool querying a driver sysfs-node
> hanging off of a scsi_host's device tree:
>
> /sys/class/scsi_host/host4/device/fw_dump
>
> The dump is then used by our firmware engineering group to help triage
> the issue.
>
> This recent change:
>
> commit 10a71b40153a19279428053ad9743e15ef414148
> Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
> Date: Tue Aug 25 11:36:15 2009 -0700
>
> [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
>
> attempted to help 'automate' the task of retrieval by signaling udev
> to automatically run the 'retrieval' script anytime the driver
> captured the firmware-dump. Here's a snippet of the udev rule:
>
> # qla2xxx driver
> KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
>
> Any suggestions here on an alternate driver-specific kobject an LLD
> can/should use for something like this? I looked previously at other
> callers of kobject_uevent_env(), but didn't really see a simlar
> usage-pattern of a driver wanting to signal events to userspace...
>
> Thanks, AV
Ok, So any strong objections to just having the functionality present
when module support is enabled?
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 29396c0..3887adb 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
static void
qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
{
+#ifdef CONFIG_MODULES
char event_string[40];
char *envp[] = { event_string, NULL };
@@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
}
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
+#endif
}
void
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
2009-09-11 17:53 ` qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x)) Andrew Vasquez
@ 2009-09-11 21:25 ` Randy Dunlap
2009-09-11 22:42 ` James Bottomley
1 sibling, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-09-11 21:25 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
On Fri, 11 Sep 2009 10:53:41 -0700 Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
> Ok, So any strong objections to just having the functionality present
> when module support is enabled?
Fine with me. Thanks.
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..3887adb 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
> static void
> qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> {
> +#ifdef CONFIG_MODULES
> char event_string[40];
> char *envp[] = { event_string, NULL };
>
> @@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> }
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
> +#endif
> }
>
> void
>
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
2009-09-11 17:53 ` qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x)) Andrew Vasquez
2009-09-11 21:25 ` Randy Dunlap
@ 2009-09-11 22:42 ` James Bottomley
2009-09-12 0:07 ` Andrew Vasquez
1 sibling, 1 reply; 23+ messages in thread
From: James Bottomley @ 2009-09-11 22:42 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
On Fri, 2009-09-11 at 10:53 -0700, Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> ---
>
> On Tue, 08 Sep 2009, Andrew Vasquez wrote:
>
> > On Mon, 07 Sep 2009, Randy Dunlap wrote:
> >
> > > On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> > >
> > > > Hi all,
> > > >
> > > > Changes since 20090904:
> > >
> > >
> > > when CONFIG_MODULES=n:
> > >
> > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > >
> > > in
> > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > KOBJ_CHANGE, envp);
> >
> > Argg... Some history here... During several unwelcome
> > hardware/firmware events (ISP system error, mailbox command timeouts,
> > etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
> > snapshot of the current state of the ISP firmware). This snapshot is
> > then captured via a user-space tool querying a driver sysfs-node
> > hanging off of a scsi_host's device tree:
> >
> > /sys/class/scsi_host/host4/device/fw_dump
> >
> > The dump is then used by our firmware engineering group to help triage
> > the issue.
> >
> > This recent change:
> >
> > commit 10a71b40153a19279428053ad9743e15ef414148
> > Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > Date: Tue Aug 25 11:36:15 2009 -0700
> >
> > [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
> >
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> > Signed-off-by: James Bottomley <James.Bottomley@suse.de>
> >
> > attempted to help 'automate' the task of retrieval by signaling udev
> > to automatically run the 'retrieval' script anytime the driver
> > captured the firmware-dump. Here's a snippet of the udev rule:
> >
> > # qla2xxx driver
> > KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
> >
> > Any suggestions here on an alternate driver-specific kobject an LLD
> > can/should use for something like this? I looked previously at other
> > callers of kobject_uevent_env(), but didn't really see a simlar
> > usage-pattern of a driver wanting to signal events to userspace...
> >
> > Thanks, AV
>
> Ok, So any strong objections to just having the functionality present
> when module support is enabled?
>
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..3887adb 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
> static void
> qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> {
> +#ifdef CONFIG_MODULES
> char event_string[40];
> char *envp[] = { event_string, NULL };
>
> @@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> }
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
> +#endif
Only emitting events if the thing is compiled as a module doesn't really
look like the right solution. The first question that springs to mind
is why are you emitting events against the module kobject in the first
place? Why not emit them against the device kobject (which is always
present)?
James
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
2009-09-11 22:42 ` James Bottomley
@ 2009-09-12 0:07 ` Andrew Vasquez
2009-09-12 0:17 ` Andrew Vasquez
0 siblings, 1 reply; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-12 0:07 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
On Fri, 11 Sep 2009, James Bottomley wrote:
> On Fri, 2009-09-11 at 10:53 -0700, Andrew Vasquez wrote:
> > Randy Dunlap noted:
> >
> > when CONFIG_MODULES=n:
> >
> > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >
> > in
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
> >
> > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > ---
> >
> > On Tue, 08 Sep 2009, Andrew Vasquez wrote:
> >
> > > On Mon, 07 Sep 2009, Randy Dunlap wrote:
> > >
> > > > On Mon, 7 Sep 2009 21:02:06 +1000 Stephen Rothwell wrote:
> > > >
> > > > > Hi all,
> > > > >
> > > > > Changes since 20090904:
> > > >
> > > >
> > > > when CONFIG_MODULES=n:
> > > >
> > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > >
> > > > in
> > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > KOBJ_CHANGE, envp);
> > >
> > > Argg... Some history here... During several unwelcome
> > > hardware/firmware events (ISP system error, mailbox command timeouts,
> > > etc), the qla2xxx driver can store a 'firmware-dump' (essentially a
> > > snapshot of the current state of the ISP firmware). This snapshot is
> > > then captured via a user-space tool querying a driver sysfs-node
> > > hanging off of a scsi_host's device tree:
> > >
> > > /sys/class/scsi_host/host4/device/fw_dump
> > >
> > > The dump is then used by our firmware engineering group to help triage
> > > the issue.
> > >
> > > This recent change:
> > >
> > > commit 10a71b40153a19279428053ad9743e15ef414148
> > > Author: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > > Date: Tue Aug 25 11:36:15 2009 -0700
> > >
> > > [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
> > >
> > > Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> > > Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> > > Signed-off-by: James Bottomley <James.Bottomley@suse.de>
> > >
> > > attempted to help 'automate' the task of retrieval by signaling udev
> > > to automatically run the 'retrieval' script anytime the driver
> > > captured the firmware-dump. Here's a snippet of the udev rule:
> > >
> > > # qla2xxx driver
> > > KERNEL=="qla2xxx", SUBSYSTEM=="module", ACTION=="change", RUN+="qla2xxx_udev.sh"
> > >
> > > Any suggestions here on an alternate driver-specific kobject an LLD
> > > can/should use for something like this? I looked previously at other
> > > callers of kobject_uevent_env(), but didn't really see a simlar
> > > usage-pattern of a driver wanting to signal events to userspace...
> > >
> > > Thanks, AV
> >
> > Ok, So any strong objections to just having the functionality present
> > when module support is enabled?
> >
> > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > index 29396c0..3887adb 100644
> > --- a/drivers/scsi/qla2xxx/qla_os.c
> > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > @@ -2671,6 +2671,7 @@ qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
> > static void
> > qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> > {
> > +#ifdef CONFIG_MODULES
> > char event_string[40];
> > char *envp[] = { event_string, NULL };
> >
> > @@ -2685,6 +2686,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> > }
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
> > +#endif
>
> Only emitting events if the thing is compiled as a module doesn't really
> look like the right solution. The first question that springs to mind
> is why are you emitting events against the module kobject in the first
> place? Why not emit them against the device kobject (which is always
> present)?
The struct device's kobj from pdev->dev?
My udev-foo is pathetic, so how exactly would that get multiplexed at
the udev side?
KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
Thanks, AV
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
2009-09-12 0:07 ` Andrew Vasquez
@ 2009-09-12 0:17 ` Andrew Vasquez
2009-09-12 0:38 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Andrew Vasquez
0 siblings, 1 reply; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-12 0:17 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali
On Fri, 11 Sep 2009, Andrew Vasquez wrote:
> The struct device's kobj from pdev->dev?
>
> My udev-foo is pathetic, so how exactly would that get multiplexed at
> the udev side?
>
> KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
Ok, udevadm helps a bit... Let me see if I can convert this uevent
off of:
kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
to something meaningful:
UEVENT[1252714722.263731] change
/devices/pci0000:17/0000:17:08.0/0000:1e:00.0 (pci)
ACTION=change
DEVPATH=/devices/pci0000:17/0000:17:08.0/0000:1e:00.0
SUBSYSTEM=pci
FW_DUMP=6
DRIVER=qla2xxx
PHYSDEVBUS=pci
PHYSDEVDRIVER=qla2xxx
PCI_CLASS=C0400
PCI_ID=1077:2532
PCI_SUBSYS_ID=1077:015C
PCI_SLOT_NAME=0000:1e:00.0
MODALIAS=pci:v00001077d00002532sv00001077sd0000015Cbc0Csc04i00
SEQNUM=3574
Thanks, AV
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 0:17 ` Andrew Vasquez
@ 2009-09-12 0:38 ` Andrew Vasquez
2009-09-12 0:54 ` Greg KH
2009-09-12 4:06 ` James Bottomley
0 siblings, 2 replies; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-12 0:38 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
Randy Dunlap noted:
when CONFIG_MODULES=n:
drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
in
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
Trigger kobject event on the 'struct device' hanging off the pci_dev.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
> On Fri, 11 Sep 2009, Andrew Vasquez wrote:
>
> > The struct device's kobj from pdev->dev?
> >
> > My udev-foo is pathetic, so how exactly would that get multiplexed at
> > the udev side?
> >
> > KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
>
> Ok, udevadm helps a bit... Let me see if I can convert this uevent
> off of:
>
> kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
>
> to something meaningful:
>
> UEVENT[1252714722.263731] change
> /devices/pci0000:17/0000:17:08.0/0000:1e:00.0 (pci)
> ACTION=change
> DEVPATH=/devices/pci0000:17/0000:17:08.0/0000:1e:00.0
> SUBSYSTEM=pci
> FW_DUMP=6
> DRIVER=qla2xxx
> PHYSDEVBUS=pci
> PHYSDEVDRIVER=qla2xxx
> PCI_CLASS=C0400
> PCI_ID=1077:2532
> PCI_SUBSYS_ID=1077:015C
> PCI_SLOT_NAME=0000:1e:00.0
> MODALIAS=pci:v00001077d00002532sv00001077sd0000015Cbc0Csc04i00
> SEQNUM=3574
Ok, with the kobject_uevent_env() change and the udev-rule modified to:
SUBSYSTEM=="pci", ENV{DRIVER}="qla2xxx", ACTION=="change", RUN+="qla2xxx_udev.sh"
we're working again.
This seem reasonable?
Thanks, AV
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 29396c0..369a270 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
/* do nothing */
break;
}
- kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
- KOBJ_CHANGE, envp);
+ kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
}
void
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 0:38 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Andrew Vasquez
@ 2009-09-12 0:54 ` Greg KH
2009-09-12 2:56 ` Andrew Vasquez
2009-09-12 4:06 ` James Bottomley
1 sibling, 1 reply; 23+ messages in thread
From: Greg KH @ 2009-09-12 0:54 UTC (permalink / raw)
To: Andrew Vasquez
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
>
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Trigger kobject event on the 'struct device' hanging off the pci_dev.
Um, why? What are you trying to do here? kobject change should not be
for a device, or a "normal" kobject.
What do you expect userspace to do with this? Where have you documented
it?
confused,
greg k-h
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 0:54 ` Greg KH
@ 2009-09-12 2:56 ` Andrew Vasquez
2009-09-12 4:33 ` Greg KH
0 siblings, 1 reply; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-12 2:56 UTC (permalink / raw)
To: Greg KH
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Fri, 11 Sep 2009, Greg KH wrote:
> On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > Randy Dunlap noted:
> >
> > when CONFIG_MODULES=n:
> >
> > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >
> > in
> >
> > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > KOBJ_CHANGE, envp);
> >
> > Trigger kobject event on the 'struct device' hanging off the pci_dev.
>
> Um, why? What are you trying to do here? kobject change should not be
> for a device, or a "normal" kobject.
>
> What do you expect userspace to do with this? Where have you documented
> it?
The purpose was described here:
http://article.gmane.org/gmane.linux.scsi/54155
Basically we'd like to instruct user-space to retrieve a blob of data
automatically. Original implementation used the kboject hanging off
the module which does not exist when CONFIG_MODULES=n. It was
suggested that perhaps an alternative would be to use 'struct device'
kobj. Any tips on how to trigger such a driver-specific event,
perhaps a dedicated kobject exported by the driver itself???
> confused,
anch'io...
Thanks, AV
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 0:38 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Andrew Vasquez
2009-09-12 0:54 ` Greg KH
@ 2009-09-12 4:06 ` James Bottomley
2009-09-12 16:43 ` [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n Andrew Vasquez
1 sibling, 1 reply; 23+ messages in thread
From: James Bottomley @ 2009-09-12 4:06 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
On Fri, 2009-09-11 at 17:38 -0700, Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
>
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Trigger kobject event on the 'struct device' hanging off the pci_dev.
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> ---
>
> > On Fri, 11 Sep 2009, Andrew Vasquez wrote:
> >
> > > The struct device's kobj from pdev->dev?
> > >
> > > My udev-foo is pathetic, so how exactly would that get multiplexed at
> > > the udev side?
> > >
> > > KERNEL=="???", SUBSYSTEM=="???", ACTION=="change", RUN+="qla2xxx_udev.sh"
> >
> > Ok, udevadm helps a bit... Let me see if I can convert this uevent
> > off of:
> >
> > kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
> >
> > to something meaningful:
> >
> > UEVENT[1252714722.263731] change
> > /devices/pci0000:17/0000:17:08.0/0000:1e:00.0 (pci)
> > ACTION=change
> > DEVPATH=/devices/pci0000:17/0000:17:08.0/0000:1e:00.0
> > SUBSYSTEM=pci
> > FW_DUMP=6
> > DRIVER=qla2xxx
> > PHYSDEVBUS=pci
> > PHYSDEVDRIVER=qla2xxx
> > PCI_CLASS=C0400
> > PCI_ID=1077:2532
> > PCI_SUBSYS_ID=1077:015C
> > PCI_SLOT_NAME=0000:1e:00.0
> > MODALIAS=pci:v00001077d00002532sv00001077sd0000015Cbc0Csc04i00
> > SEQNUM=3574
>
> Ok, with the kobject_uevent_env() change and the udev-rule modified to:
>
> SUBSYSTEM=="pci", ENV{DRIVER}="qla2xxx", ACTION=="change", RUN+="qla2xxx_udev.sh"
>
> we're working again.
>
> This seem reasonable?
>
> Thanks, AV
>
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..369a270 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> /* do nothing */
> break;
> }
> - kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> - KOBJ_CHANGE, envp);
> + kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
Much better. Of course to be perfect, you might like to remember that
(&x)->y is actually x.y
so
kobject_uevent_env(&vha->hw->pdev->dev.kobj, ...
James
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 2:56 ` Andrew Vasquez
@ 2009-09-12 4:33 ` Greg KH
2009-09-12 14:30 ` James Bottomley
0 siblings, 1 reply; 23+ messages in thread
From: Greg KH @ 2009-09-12 4:33 UTC (permalink / raw)
To: Andrew Vasquez
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> On Fri, 11 Sep 2009, Greg KH wrote:
>
> > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > Randy Dunlap noted:
> > >
> > > when CONFIG_MODULES=n:
> > >
> > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > >
> > > in
> > >
> > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > KOBJ_CHANGE, envp);
> > >
> > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> >
> > Um, why? What are you trying to do here? kobject change should not be
> > for a device, or a "normal" kobject.
> >
> > What do you expect userspace to do with this? Where have you documented
> > it?
>
> The purpose was described here:
>
> http://article.gmane.org/gmane.linux.scsi/54155
>
> Basically we'd like to instruct user-space to retrieve a blob of data
> automatically.
Hm, like a firmware object perhaps?
> Original implementation used the kboject hanging off
> the module which does not exist when CONFIG_MODULES=n. It was
> suggested that perhaps an alternative would be to use 'struct device'
> kobj. Any tips on how to trigger such a driver-specific event,
> perhaps a dedicated kobject exported by the driver itself???
Why not use the firmware interface for it, that is what it is designed
for, and you will not have to craft any new udev rules.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 4:33 ` Greg KH
@ 2009-09-12 14:30 ` James Bottomley
2009-09-15 15:33 ` Greg KH
0 siblings, 1 reply; 23+ messages in thread
From: James Bottomley @ 2009-09-12 14:30 UTC (permalink / raw)
To: Greg KH
Cc: Andrew Vasquez, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> > On Fri, 11 Sep 2009, Greg KH wrote:
> >
> > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > > Randy Dunlap noted:
> > > >
> > > > when CONFIG_MODULES=n:
> > > >
> > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > >
> > > > in
> > > >
> > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > KOBJ_CHANGE, envp);
> > > >
> > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> > >
> > > Um, why? What are you trying to do here? kobject change should not be
> > > for a device, or a "normal" kobject.
> > >
> > > What do you expect userspace to do with this? Where have you documented
> > > it?
> >
> > The purpose was described here:
> >
> > http://article.gmane.org/gmane.linux.scsi/54155
> >
> > Basically we'd like to instruct user-space to retrieve a blob of data
> > automatically.
>
> Hm, like a firmware object perhaps?
>
> > Original implementation used the kboject hanging off
> > the module which does not exist when CONFIG_MODULES=n. It was
> > suggested that perhaps an alternative would be to use 'struct device'
> > kobj. Any tips on how to trigger such a driver-specific event,
> > perhaps a dedicated kobject exported by the driver itself???
>
> Why not use the firmware interface for it, that is what it is designed
> for, and you will not have to craft any new udev rules.
The data is going the wrong way to use the current firmware interface,
which is designed to load data from userspace into the kernel. For this
interface, we want the data to go the other way (i.e. the kernel has a
blob of dump data it would like userspace to save if it can).
I'd be amenable to updating the firmware interface to do this, but it
looks like adding a completely new codepath, which it's not clear even
belongs there.
James
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n.
2009-09-12 4:06 ` James Bottomley
@ 2009-09-12 16:43 ` Andrew Vasquez
2009-09-13 21:02 ` Randy Dunlap
0 siblings, 1 reply; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-12 16:43 UTC (permalink / raw)
To: James Bottomley
Cc: Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
Randy Dunlap noted:
when CONFIG_MODULES=n:
drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
in
kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
KOBJ_CHANGE, envp);
Trigger kobject event on the 'struct device' hanging off the pci_dev.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
On Fri, 11 Sep 2009, James Bottomley wrote:
> > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > index 29396c0..369a270 100644
> > --- a/drivers/scsi/qla2xxx/qla_os.c
> > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > @@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> > /* do nothing */
> > break;
> > }
> > - kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > - KOBJ_CHANGE, envp);
> > + kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
>
> Much better. Of course to be perfect, you might like to remember that
> (&x)->y is actually x.y
>
> so
>
> kobject_uevent_env(&vha->hw->pdev->dev.kobj, ...
Ahh, of course... Perfection...the enemy of progress...
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 29396c0..86f337f 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
/* do nothing */
break;
}
- kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
- KOBJ_CHANGE, envp);
+ kobject_uevent_env(&vha->hw->pdev->dev.kobj, KOBJ_CHANGE, envp);
}
void
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n.
2009-09-12 16:43 ` [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n Andrew Vasquez
@ 2009-09-13 21:02 ` Randy Dunlap
0 siblings, 0 replies; 23+ messages in thread
From: Randy Dunlap @ 2009-09-13 21:02 UTC (permalink / raw)
To: Andrew Vasquez
Cc: James Bottomley, Linux SCSI Mailing List, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
On Sat, 12 Sep 2009 09:43:56 -0700 Andrew Vasquez wrote:
> Randy Dunlap noted:
>
> when CONFIG_MODULES=n:
>
> drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>
> in
>
> kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> KOBJ_CHANGE, envp);
>
> Trigger kobject event on the 'struct device' hanging off the pci_dev.
>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
That works. Thanks for your persistence.
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
> ---
>
> On Fri, 11 Sep 2009, James Bottomley wrote:
>
> > > diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> > > index 29396c0..369a270 100644
> > > --- a/drivers/scsi/qla2xxx/qla_os.c
> > > +++ b/drivers/scsi/qla2xxx/qla_os.c
> > > @@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> > > /* do nothing */
> > > break;
> > > }
> > > - kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > - KOBJ_CHANGE, envp);
> > > + kobject_uevent_env(&(&vha->hw->pdev->dev)->kobj, KOBJ_CHANGE, envp);
> >
> > Much better. Of course to be perfect, you might like to remember that
> > (&x)->y is actually x.y
> >
> > so
> >
> > kobject_uevent_env(&vha->hw->pdev->dev.kobj, ...
>
> Ahh, of course... Perfection...the enemy of progress...
>
> diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
> index 29396c0..86f337f 100644
> --- a/drivers/scsi/qla2xxx/qla_os.c
> +++ b/drivers/scsi/qla2xxx/qla_os.c
> @@ -2683,8 +2683,7 @@ qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
> /* do nothing */
> break;
> }
> - kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> - KOBJ_CHANGE, envp);
> + kobject_uevent_env(&vha->hw->pdev->dev.kobj, KOBJ_CHANGE, envp);
> }
>
> void
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-12 14:30 ` James Bottomley
@ 2009-09-15 15:33 ` Greg KH
2009-09-15 15:47 ` James Bottomley
0 siblings, 1 reply; 23+ messages in thread
From: Greg KH @ 2009-09-15 15:33 UTC (permalink / raw)
To: James Bottomley
Cc: Andrew Vasquez, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> > > On Fri, 11 Sep 2009, Greg KH wrote:
> > >
> > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > > > Randy Dunlap noted:
> > > > >
> > > > > when CONFIG_MODULES=n:
> > > > >
> > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > > >
> > > > > in
> > > > >
> > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > > KOBJ_CHANGE, envp);
> > > > >
> > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> > > >
> > > > Um, why? What are you trying to do here? kobject change should not be
> > > > for a device, or a "normal" kobject.
> > > >
> > > > What do you expect userspace to do with this? Where have you documented
> > > > it?
> > >
> > > The purpose was described here:
> > >
> > > http://article.gmane.org/gmane.linux.scsi/54155
> > >
> > > Basically we'd like to instruct user-space to retrieve a blob of data
> > > automatically.
> >
> > Hm, like a firmware object perhaps?
> >
> > > Original implementation used the kboject hanging off
> > > the module which does not exist when CONFIG_MODULES=n. It was
> > > suggested that perhaps an alternative would be to use 'struct device'
> > > kobj. Any tips on how to trigger such a driver-specific event,
> > > perhaps a dedicated kobject exported by the driver itself???
> >
> > Why not use the firmware interface for it, that is what it is designed
> > for, and you will not have to craft any new udev rules.
>
> The data is going the wrong way to use the current firmware interface,
> which is designed to load data from userspace into the kernel. For this
> interface, we want the data to go the other way (i.e. the kernel has a
> blob of dump data it would like userspace to save if it can).
Ick.
> I'd be amenable to updating the firmware interface to do this, but it
> looks like adding a completely new codepath, which it's not clear even
> belongs there.
Well, I don't think it deserves a kobject change event, as that means
something a bit different to userspace today, right?
Either way, I see no documentation being added to the Documentation/ABI/
directory describing what is happening here, that needs to be added at
the least.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-15 15:33 ` Greg KH
@ 2009-09-15 15:47 ` James Bottomley
2009-09-15 16:44 ` [PATCHv4] qla2xxx: Add firmware-dump kobject uevent notification Andrew Vasquez
2009-09-15 16:57 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Greg KH
0 siblings, 2 replies; 23+ messages in thread
From: James Bottomley @ 2009-09-15 15:47 UTC (permalink / raw)
To: Greg KH
Cc: Andrew Vasquez, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
> On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> > > > On Fri, 11 Sep 2009, Greg KH wrote:
> > > >
> > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > > > > Randy Dunlap noted:
> > > > > >
> > > > > > when CONFIG_MODULES=n:
> > > > > >
> > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > > > >
> > > > > > in
> > > > > >
> > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > > > KOBJ_CHANGE, envp);
> > > > > >
> > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> > > > >
> > > > > Um, why? What are you trying to do here? kobject change should not be
> > > > > for a device, or a "normal" kobject.
> > > > >
> > > > > What do you expect userspace to do with this? Where have you documented
> > > > > it?
> > > >
> > > > The purpose was described here:
> > > >
> > > > http://article.gmane.org/gmane.linux.scsi/54155
> > > >
> > > > Basically we'd like to instruct user-space to retrieve a blob of data
> > > > automatically.
> > >
> > > Hm, like a firmware object perhaps?
> > >
> > > > Original implementation used the kboject hanging off
> > > > the module which does not exist when CONFIG_MODULES=n. It was
> > > > suggested that perhaps an alternative would be to use 'struct device'
> > > > kobj. Any tips on how to trigger such a driver-specific event,
> > > > perhaps a dedicated kobject exported by the driver itself???
> > >
> > > Why not use the firmware interface for it, that is what it is designed
> > > for, and you will not have to craft any new udev rules.
> >
> > The data is going the wrong way to use the current firmware interface,
> > which is designed to load data from userspace into the kernel. For this
> > interface, we want the data to go the other way (i.e. the kernel has a
> > blob of dump data it would like userspace to save if it can).
>
> Ick.
It's a natural debugging event ... the user can simply program the
system to discard the dump.
> > I'd be amenable to updating the firmware interface to do this, but it
> > looks like adding a completely new codepath, which it's not clear even
> > belongs there.
>
> Well, I don't think it deserves a kobject change event, as that means
> something a bit different to userspace today, right?
Well, the documentation (in include/linux/kobject.h) does say that
KOBJ_CHANGED is the dumping ground for events that don't match anything
else, which this one seems to qualify as. What else do you suggest?
> Either way, I see no documentation being added to the Documentation/ABI/
> directory describing what is happening here, that needs to be added at
> the least.
OK, we can add that in the next go around.
Andrew, I actually dropped the patch (just this one, not the rest of the
qla2xxx patches) from the tree, so we can work on updating this as a
whole.
James
^ permalink raw reply [flat|nested] 23+ messages in thread
* [PATCHv4] qla2xxx: Add firmware-dump kobject uevent notification.
2009-09-15 15:47 ` James Bottomley
@ 2009-09-15 16:44 ` Andrew Vasquez
2009-09-15 16:57 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Greg KH
1 sibling, 0 replies; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-15 16:44 UTC (permalink / raw)
To: James Bottomley
Cc: Greg KH, Linux SCSI Mailing List, Randy Dunlap, Stephen Rothwell,
linux-next@vger.kernel.org, LKML, Giridhar Malavali, Ravi Anand,
Lalit Chandivade
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
On Tue, 15 Sep 2009, James Bottomley wrote:
> On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
> > On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> > > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> > > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> > > > > On Fri, 11 Sep 2009, Greg KH wrote:
> > > > >
> > > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > > > > > Randy Dunlap noted:
> > > > > > >
> > > > > > > when CONFIG_MODULES=n:
> > > > > > >
> > > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > > > > >
> > > > > > > in
> > > > > > >
> > > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > > > > KOBJ_CHANGE, envp);
> > > > > > >
> > > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> > > > > >
> > > > > > Um, why? What are you trying to do here? kobject change should not be
> > > > > > for a device, or a "normal" kobject.
> > > > > >
> > > > > > What do you expect userspace to do with this? Where have you documented
> > > > > > it?
> > > > >
> > > > > The purpose was described here:
> > > > >
> > > > > http://article.gmane.org/gmane.linux.scsi/54155
> > > > >
> > > > > Basically we'd like to instruct user-space to retrieve a blob of data
> > > > > automatically.
> > > >
> > > > Hm, like a firmware object perhaps?
> > > >
> > > > > Original implementation used the kboject hanging off
> > > > > the module which does not exist when CONFIG_MODULES=n. It was
> > > > > suggested that perhaps an alternative would be to use 'struct device'
> > > > > kobj. Any tips on how to trigger such a driver-specific event,
> > > > > perhaps a dedicated kobject exported by the driver itself???
> > > >
> > > > Why not use the firmware interface for it, that is what it is designed
> > > > for, and you will not have to craft any new udev rules.
> > >
> > > The data is going the wrong way to use the current firmware interface,
> > > which is designed to load data from userspace into the kernel. For this
> > > interface, we want the data to go the other way (i.e. the kernel has a
> > > blob of dump data it would like userspace to save if it can).
> >
> > Ick.
>
> It's a natural debugging event ... the user can simply program the
> system to discard the dump.
>
> > > I'd be amenable to updating the firmware interface to do this, but it
> > > looks like adding a completely new codepath, which it's not clear even
> > > belongs there.
> >
> > Well, I don't think it deserves a kobject change event, as that means
> > something a bit different to userspace today, right?
>
> Well, the documentation (in include/linux/kobject.h) does say that
> KOBJ_CHANGED is the dumping ground for events that don't match anything
> else, which this one seems to qualify as. What else do you suggest?
>
> > Either way, I see no documentation being added to the Documentation/ABI/
> > directory describing what is happening here, that needs to be added at
> > the least.
>
> OK, we can add that in the next go around.
>
> Andrew, I actually dropped the patch (just this one, not the rest of the
> qla2xxx patches) from the tree, so we can work on updating this as a
> whole.
Ok, how about this squashed commit as a first stab at documenting the
ABI???
Thanks, AV
Documentation/ABI/stable/sysfs-driver-qla2xxx | 8 +++
drivers/scsi/qla2xxx/qla_dbg.c | 78 +++++++-----------------
drivers/scsi/qla2xxx/qla_def.h | 5 ++
drivers/scsi/qla2xxx/qla_gbl.h | 1 +
drivers/scsi/qla2xxx/qla_os.c | 35 +++++++++++
5 files changed, 72 insertions(+), 55 deletions(-)
create mode 100644 Documentation/ABI/stable/sysfs-driver-qla2xxx
diff --git a/Documentation/ABI/stable/sysfs-driver-qla2xxx b/Documentation/ABI/stable/sysfs-driver-qla2xxx
new file mode 100644
index 0000000..9a59d84
--- /dev/null
+++ b/Documentation/ABI/stable/sysfs-driver-qla2xxx
@@ -0,0 +1,8 @@
+What: /sys/bus/pci/drivers/qla2xxx/.../devices/*
+Date: September 2009
+Contact: QLogic Linux Driver <linux-driver@qlogic.com>
+Description: qla2xxx-udev.sh currently looks for uevent CHANGE events to
+ signal a firmware-dump has been generated by the driver and is
+ ready for retrieval.
+Users: qla2xxx-udev.sh. Proposed changes should be mailed to
+ linux-driver@qlogic.com
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index cca8e4a..cb2eca4 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -377,6 +377,24 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, uint32_t **last_chain)
return ptr + sizeof(struct qla2xxx_mq_chain);
}
+static void
+qla2xxx_dump_post_process(scsi_qla_host_t *vha, int rval)
+{
+ struct qla_hw_data *ha = vha->hw;
+
+ if (rval != QLA_SUCCESS) {
+ qla_printk(KERN_WARNING, ha,
+ "Failed to dump firmware (%x)!!!\n", rval);
+ ha->fw_dumped = 0;
+ } else {
+ qla_printk(KERN_INFO, ha,
+ "Firmware dump saved to temp buffer (%ld/%p).\n",
+ vha->host_no, ha->fw_dump);
+ ha->fw_dumped = 1;
+ qla2x00_post_uevent_work(vha, QLA_UEVENT_CODE_FW_DUMP);
+ }
+}
+
/**
* qla2300_fw_dump() - Dumps binary data from the 2300 firmware.
* @ha: HA context
@@ -530,17 +548,7 @@ qla2300_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
if (rval == QLA_SUCCESS)
qla2xxx_copy_queues(ha, nxt);
- if (rval != QLA_SUCCESS) {
- qla_printk(KERN_WARNING, ha,
- "Failed to dump firmware (%x)!!!\n", rval);
- ha->fw_dumped = 0;
-
- } else {
- qla_printk(KERN_INFO, ha,
- "Firmware dump saved to temp buffer (%ld/%p).\n",
- base_vha->host_no, ha->fw_dump);
- ha->fw_dumped = 1;
- }
+ qla2xxx_dump_post_process(base_vha, rval);
qla2300_fw_dump_failed:
if (!hardware_locked)
@@ -737,17 +745,7 @@ qla2100_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
if (rval == QLA_SUCCESS)
qla2xxx_copy_queues(ha, &fw->risc_ram[cnt]);
- if (rval != QLA_SUCCESS) {
- qla_printk(KERN_WARNING, ha,
- "Failed to dump firmware (%x)!!!\n", rval);
- ha->fw_dumped = 0;
-
- } else {
- qla_printk(KERN_INFO, ha,
- "Firmware dump saved to temp buffer (%ld/%p).\n",
- base_vha->host_no, ha->fw_dump);
- ha->fw_dumped = 1;
- }
+ qla2xxx_dump_post_process(base_vha, rval);
qla2100_fw_dump_failed:
if (!hardware_locked)
@@ -984,17 +982,7 @@ qla24xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
qla24xx_copy_eft(ha, nxt);
qla24xx_fw_dump_failed_0:
- if (rval != QLA_SUCCESS) {
- qla_printk(KERN_WARNING, ha,
- "Failed to dump firmware (%x)!!!\n", rval);
- ha->fw_dumped = 0;
-
- } else {
- qla_printk(KERN_INFO, ha,
- "Firmware dump saved to temp buffer (%ld/%p).\n",
- base_vha->host_no, ha->fw_dump);
- ha->fw_dumped = 1;
- }
+ qla2xxx_dump_post_process(base_vha, rval);
qla24xx_fw_dump_failed:
if (!hardware_locked)
@@ -1305,17 +1293,7 @@ qla25xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
}
qla25xx_fw_dump_failed_0:
- if (rval != QLA_SUCCESS) {
- qla_printk(KERN_WARNING, ha,
- "Failed to dump firmware (%x)!!!\n", rval);
- ha->fw_dumped = 0;
-
- } else {
- qla_printk(KERN_INFO, ha,
- "Firmware dump saved to temp buffer (%ld/%p).\n",
- base_vha->host_no, ha->fw_dump);
- ha->fw_dumped = 1;
- }
+ qla2xxx_dump_post_process(base_vha, rval);
qla25xx_fw_dump_failed:
if (!hardware_locked)
@@ -1628,17 +1606,7 @@ qla81xx_fw_dump(scsi_qla_host_t *vha, int hardware_locked)
}
qla81xx_fw_dump_failed_0:
- if (rval != QLA_SUCCESS) {
- qla_printk(KERN_WARNING, ha,
- "Failed to dump firmware (%x)!!!\n", rval);
- ha->fw_dumped = 0;
-
- } else {
- qla_printk(KERN_INFO, ha,
- "Firmware dump saved to temp buffer (%ld/%p).\n",
- base_vha->host_no, ha->fw_dump);
- ha->fw_dumped = 1;
- }
+ qla2xxx_dump_post_process(base_vha, rval);
qla81xx_fw_dump_failed:
if (!hardware_locked)
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 2150618..d8ce310 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2123,6 +2123,7 @@ enum qla_work_type {
QLA_EVT_ASYNC_LOGIN_DONE,
QLA_EVT_ASYNC_LOGOUT,
QLA_EVT_ASYNC_LOGOUT_DONE,
+ QLA_EVT_UEVENT,
};
@@ -2146,6 +2147,10 @@ struct qla_work_evt {
#define QLA_LOGIO_LOGIN_RETRIED BIT_0
u16 data[2];
} logio;
+ struct {
+ u32 code;
+#define QLA_UEVENT_CODE_FW_DUMP 0
+ } uevent;
} u;
};
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index f3d1d1a..14e0562 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -92,6 +92,7 @@ extern int qla2x00_post_async_logout_work(struct scsi_qla_host *, fc_port_t *,
uint16_t *);
extern int qla2x00_post_async_logout_done_work(struct scsi_qla_host *,
fc_port_t *, uint16_t *);
+extern int qla2x00_post_uevent_work(struct scsi_qla_host *, u32);
extern int qla81xx_restart_mpi_firmware(scsi_qla_host_t *);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index b79fca7..ecf2a40 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -11,6 +11,7 @@
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/mutex.h>
+#include <linux/kobject.h>
#include <scsi/scsi_tcq.h>
#include <scsi/scsicam.h>
@@ -2653,6 +2654,37 @@ qla2x00_post_async_work(login_done, QLA_EVT_ASYNC_LOGIN_DONE);
qla2x00_post_async_work(logout, QLA_EVT_ASYNC_LOGOUT);
qla2x00_post_async_work(logout_done, QLA_EVT_ASYNC_LOGOUT_DONE);
+int
+qla2x00_post_uevent_work(struct scsi_qla_host *vha, u32 code)
+{
+ struct qla_work_evt *e;
+
+ e = qla2x00_alloc_work(vha, QLA_EVT_UEVENT);
+ if (!e)
+ return QLA_FUNCTION_FAILED;
+
+ e->u.uevent.code = code;
+ return qla2x00_post_work(vha, e);
+}
+
+static void
+qla2x00_uevent_emit(struct scsi_qla_host *vha, u32 code)
+{
+ char event_string[40];
+ char *envp[] = { event_string, NULL };
+
+ switch (code) {
+ case QLA_UEVENT_CODE_FW_DUMP:
+ snprintf(event_string, sizeof(event_string), "FW_DUMP=%ld",
+ vha->host_no);
+ break;
+ default:
+ /* do nothing */
+ break;
+ }
+ kobject_uevent_env(&vha->hw->pdev->dev.kobj, KOBJ_CHANGE, envp);
+}
+
void
qla2x00_do_work(struct scsi_qla_host *vha)
{
@@ -2690,6 +2722,9 @@ qla2x00_do_work(struct scsi_qla_host *vha)
qla2x00_async_logout_done(vha, e->u.logio.fcport,
e->u.logio.data);
break;
+ case QLA_EVT_UEVENT:
+ qla2x00_uevent_emit(vha, e->u.uevent.code);
+ break;
}
if (e->flags & QLA_EVT_FLAG_FREE)
kfree(e);
--
1.6.5.rc0
^ permalink raw reply related [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-15 15:47 ` James Bottomley
2009-09-15 16:44 ` [PATCHv4] qla2xxx: Add firmware-dump kobject uevent notification Andrew Vasquez
@ 2009-09-15 16:57 ` Greg KH
2009-09-15 17:22 ` Kay Sievers
2009-09-15 18:26 ` Andrew Vasquez
1 sibling, 2 replies; 23+ messages in thread
From: Greg KH @ 2009-09-15 16:57 UTC (permalink / raw)
To: James Bottomley
Cc: Andrew Vasquez, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Tue, Sep 15, 2009 at 10:47:11AM -0500, James Bottomley wrote:
> On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
> > On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> > > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> > > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> > > > > On Fri, 11 Sep 2009, Greg KH wrote:
> > > > >
> > > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > > > > > Randy Dunlap noted:
> > > > > > >
> > > > > > > when CONFIG_MODULES=n:
> > > > > > >
> > > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > > > > >
> > > > > > > in
> > > > > > >
> > > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > > > > KOBJ_CHANGE, envp);
> > > > > > >
> > > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> > > > > >
> > > > > > Um, why? What are you trying to do here? kobject change should not be
> > > > > > for a device, or a "normal" kobject.
> > > > > >
> > > > > > What do you expect userspace to do with this? Where have you documented
> > > > > > it?
> > > > >
> > > > > The purpose was described here:
> > > > >
> > > > > http://article.gmane.org/gmane.linux.scsi/54155
> > > > >
> > > > > Basically we'd like to instruct user-space to retrieve a blob of data
> > > > > automatically.
> > > >
> > > > Hm, like a firmware object perhaps?
> > > >
> > > > > Original implementation used the kboject hanging off
> > > > > the module which does not exist when CONFIG_MODULES=n. It was
> > > > > suggested that perhaps an alternative would be to use 'struct device'
> > > > > kobj. Any tips on how to trigger such a driver-specific event,
> > > > > perhaps a dedicated kobject exported by the driver itself???
> > > >
> > > > Why not use the firmware interface for it, that is what it is designed
> > > > for, and you will not have to craft any new udev rules.
> > >
> > > The data is going the wrong way to use the current firmware interface,
> > > which is designed to load data from userspace into the kernel. For this
> > > interface, we want the data to go the other way (i.e. the kernel has a
> > > blob of dump data it would like userspace to save if it can).
> >
> > Ick.
>
> It's a natural debugging event ... the user can simply program the
> system to discard the dump.
>
> > > I'd be amenable to updating the firmware interface to do this, but it
> > > looks like adding a completely new codepath, which it's not clear even
> > > belongs there.
> >
> > Well, I don't think it deserves a kobject change event, as that means
> > something a bit different to userspace today, right?
>
> Well, the documentation (in include/linux/kobject.h) does say that
> KOBJ_CHANGED is the dumping ground for events that don't match anything
> else, which this one seems to qualify as. What else do you suggest?
Ok, I can't think of anything else at the moment, sorry.
This is using a binary sysfs file, right?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-15 16:57 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Greg KH
@ 2009-09-15 17:22 ` Kay Sievers
2009-09-15 18:29 ` Greg KH
2009-09-15 21:57 ` Andrew Vasquez
2009-09-15 18:26 ` Andrew Vasquez
1 sibling, 2 replies; 23+ messages in thread
From: Kay Sievers @ 2009-09-15 17:22 UTC (permalink / raw)
To: Greg KH
Cc: James Bottomley, Andrew Vasquez, Linux SCSI Mailing List,
Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Tue, Sep 15, 2009 at 18:57, Greg KH <greg@kroah.com> wrote:
> On Tue, Sep 15, 2009 at 10:47:11AM -0500, James Bottomley wrote:
>> On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
>> > On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
>> > > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
>> > > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
>> > > > > On Fri, 11 Sep 2009, Greg KH wrote:
>> > > > >
>> > > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
>> > > > > > > Randy Dunlap noted:
>> > > > > > >
>> > > > > > > when CONFIG_MODULES=n:
>> > > > > > >
>> > > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
>> > > > > > >
>> > > > > > > in
>> > > > > > >
>> > > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
>> > > > > > > KOBJ_CHANGE, envp);
>> > > > > > >
>> > > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
>> > > > > >
>> > > > > > Um, why? What are you trying to do here? kobject change should not be
>> > > > > > for a device, or a "normal" kobject.
>> > > > > >
>> > > > > > What do you expect userspace to do with this? Where have you documented
>> > > > > > it?
>> > > > >
>> > > > > The purpose was described here:
>> > > > >
>> > > > > http://article.gmane.org/gmane.linux.scsi/54155
>> > > > >
>> > > > > Basically we'd like to instruct user-space to retrieve a blob of data
>> > > > > automatically.
>> > > >
>> > > > Hm, like a firmware object perhaps?
>> > > >
>> > > > > Original implementation used the kboject hanging off
>> > > > > the module which does not exist when CONFIG_MODULES=n. It was
>> > > > > suggested that perhaps an alternative would be to use 'struct device'
>> > > > > kobj. Any tips on how to trigger such a driver-specific event,
>> > > > > perhaps a dedicated kobject exported by the driver itself???
>> > > >
>> > > > Why not use the firmware interface for it, that is what it is designed
>> > > > for, and you will not have to craft any new udev rules.
>> > >
>> > > The data is going the wrong way to use the current firmware interface,
>> > > which is designed to load data from userspace into the kernel. For this
>> > > interface, we want the data to go the other way (i.e. the kernel has a
>> > > blob of dump data it would like userspace to save if it can).
>> >
>> > Ick.
>>
>> It's a natural debugging event ... the user can simply program the
>> system to discard the dump.
>>
>> > > I'd be amenable to updating the firmware interface to do this, but it
>> > > looks like adding a completely new codepath, which it's not clear even
>> > > belongs there.
>> >
>> > Well, I don't think it deserves a kobject change event, as that means
>> > something a bit different to userspace today, right?
>>
>> Well, the documentation (in include/linux/kobject.h) does say that
>> KOBJ_CHANGED is the dumping ground for events that don't match anything
>> else, which this one seems to qualify as. What else do you suggest?
>
> Ok, I can't think of anything else at the moment, sorry.
Wouldn't kernel/kmod.c :: call_usermodehelper_pipe() somehow fit for
that interface?
Kay
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-15 16:57 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Greg KH
2009-09-15 17:22 ` Kay Sievers
@ 2009-09-15 18:26 ` Andrew Vasquez
1 sibling, 0 replies; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-15 18:26 UTC (permalink / raw)
To: Greg KH
Cc: James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Tue, 15 Sep 2009, Greg KH wrote:
> On Tue, Sep 15, 2009 at 10:47:11AM -0500, James Bottomley wrote:
> > On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
> > > On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> > > > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> > > > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> > > > > > On Fri, 11 Sep 2009, Greg KH wrote:
> > > > > >
> > > > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> > > > > > > > Randy Dunlap noted:
> > > > > > > >
> > > > > > > > when CONFIG_MODULES=n:
> > > > > > > >
> > > > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> > > > > > > >
> > > > > > > > in
> > > > > > > >
> > > > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> > > > > > > > KOBJ_CHANGE, envp);
> > > > > > > >
> > > > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> > > > > > >
> > > > > > > Um, why? What are you trying to do here? kobject change should not be
> > > > > > > for a device, or a "normal" kobject.
> > > > > > >
> > > > > > > What do you expect userspace to do with this? Where have you documented
> > > > > > > it?
> > > > > >
> > > > > > The purpose was described here:
> > > > > >
> > > > > > http://article.gmane.org/gmane.linux.scsi/54155
> > > > > >
> > > > > > Basically we'd like to instruct user-space to retrieve a blob of data
> > > > > > automatically.
> > > > >
> > > > > Hm, like a firmware object perhaps?
> > > > >
> > > > > > Original implementation used the kboject hanging off
> > > > > > the module which does not exist when CONFIG_MODULES=n. It was
> > > > > > suggested that perhaps an alternative would be to use 'struct device'
> > > > > > kobj. Any tips on how to trigger such a driver-specific event,
> > > > > > perhaps a dedicated kobject exported by the driver itself???
> > > > >
> > > > > Why not use the firmware interface for it, that is what it is designed
> > > > > for, and you will not have to craft any new udev rules.
> > > >
> > > > The data is going the wrong way to use the current firmware interface,
> > > > which is designed to load data from userspace into the kernel. For this
> > > > interface, we want the data to go the other way (i.e. the kernel has a
> > > > blob of dump data it would like userspace to save if it can).
> > >
> > > Ick.
> >
> > It's a natural debugging event ... the user can simply program the
> > system to discard the dump.
> >
> > > > I'd be amenable to updating the firmware interface to do this, but it
> > > > looks like adding a completely new codepath, which it's not clear even
> > > > belongs there.
> > >
> > > Well, I don't think it deserves a kobject change event, as that means
> > > something a bit different to userspace today, right?
> >
> > Well, the documentation (in include/linux/kobject.h) does say that
> > KOBJ_CHANGED is the dumping ground for events that don't match anything
> > else, which this one seems to qualify as. What else do you suggest?
>
> Ok, I can't think of anything else at the moment, sorry.
>
> This is using a binary sysfs file, right?
Yes, the userspace tool retrieves the dump from a binary sysfs node:
/sys/class/scsi_host/hostX/device/fw_dump
-- AV
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-15 17:22 ` Kay Sievers
@ 2009-09-15 18:29 ` Greg KH
2009-09-15 21:57 ` Andrew Vasquez
1 sibling, 0 replies; 23+ messages in thread
From: Greg KH @ 2009-09-15 18:29 UTC (permalink / raw)
To: Kay Sievers
Cc: James Bottomley, Andrew Vasquez, Linux SCSI Mailing List,
Randy Dunlap, Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Tue, Sep 15, 2009 at 07:22:03PM +0200, Kay Sievers wrote:
> On Tue, Sep 15, 2009 at 18:57, Greg KH <greg@kroah.com> wrote:
> > On Tue, Sep 15, 2009 at 10:47:11AM -0500, James Bottomley wrote:
> >> On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
> >> > On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> >> > > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> >> > > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> >> > > > > On Fri, 11 Sep 2009, Greg KH wrote:
> >> > > > >
> >> > > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> >> > > > > > > Randy Dunlap noted:
> >> > > > > > >
> >> > > > > > > when CONFIG_MODULES=n:
> >> > > > > > >
> >> > > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >> > > > > > >
> >> > > > > > > in
> >> > > > > > >
> >> > > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> >> > > > > > > KOBJ_CHANGE, envp);
> >> > > > > > >
> >> > > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> >> > > > > >
> >> > > > > > Um, why? What are you trying to do here? kobject change should not be
> >> > > > > > for a device, or a "normal" kobject.
> >> > > > > >
> >> > > > > > What do you expect userspace to do with this? Where have you documented
> >> > > > > > it?
> >> > > > >
> >> > > > > The purpose was described here:
> >> > > > >
> >> > > > > http://article.gmane.org/gmane.linux.scsi/54155
> >> > > > >
> >> > > > > Basically we'd like to instruct user-space to retrieve a blob of data
> >> > > > > automatically.
> >> > > >
> >> > > > Hm, like a firmware object perhaps?
> >> > > >
> >> > > > > Original implementation used the kboject hanging off
> >> > > > > the module which does not exist when CONFIG_MODULES=n. It was
> >> > > > > suggested that perhaps an alternative would be to use 'struct device'
> >> > > > > kobj. Any tips on how to trigger such a driver-specific event,
> >> > > > > perhaps a dedicated kobject exported by the driver itself???
> >> > > >
> >> > > > Why not use the firmware interface for it, that is what it is designed
> >> > > > for, and you will not have to craft any new udev rules.
> >> > >
> >> > > The data is going the wrong way to use the current firmware interface,
> >> > > which is designed to load data from userspace into the kernel. For this
> >> > > interface, we want the data to go the other way (i.e. the kernel has a
> >> > > blob of dump data it would like userspace to save if it can).
> >> >
> >> > Ick.
> >>
> >> It's a natural debugging event ... the user can simply program the
> >> system to discard the dump.
> >>
> >> > > I'd be amenable to updating the firmware interface to do this, but it
> >> > > looks like adding a completely new codepath, which it's not clear even
> >> > > belongs there.
> >> >
> >> > Well, I don't think it deserves a kobject change event, as that means
> >> > something a bit different to userspace today, right?
> >>
> >> Well, the documentation (in include/linux/kobject.h) does say that
> >> KOBJ_CHANGED is the dumping ground for events that don't match anything
> >> else, which this one seems to qualify as. What else do you suggest?
> >
> > Ok, I can't think of anything else at the moment, sorry.
>
> Wouldn't kernel/kmod.c :: call_usermodehelper_pipe() somehow fit for
> that interface?
Ah, yeah, good idea. Anyone tried that?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.
2009-09-15 17:22 ` Kay Sievers
2009-09-15 18:29 ` Greg KH
@ 2009-09-15 21:57 ` Andrew Vasquez
1 sibling, 0 replies; 23+ messages in thread
From: Andrew Vasquez @ 2009-09-15 21:57 UTC (permalink / raw)
To: Kay Sievers
Cc: Greg KH, James Bottomley, Linux SCSI Mailing List, Randy Dunlap,
Stephen Rothwell, linux-next@vger.kernel.org, LKML,
Giridhar Malavali, Ravi Anand, Lalit Chandivade
On Tue, 15 Sep 2009, Kay Sievers wrote:
> On Tue, Sep 15, 2009 at 18:57, Greg KH <greg@kroah.com> wrote:
> > On Tue, Sep 15, 2009 at 10:47:11AM -0500, James Bottomley wrote:
> >> On Tue, 2009-09-15 at 08:33 -0700, Greg KH wrote:
> >> > On Sat, Sep 12, 2009 at 09:30:07AM -0500, James Bottomley wrote:
> >> > > On Fri, 2009-09-11 at 21:33 -0700, Greg KH wrote:
> >> > > > On Fri, Sep 11, 2009 at 07:56:23PM -0700, Andrew Vasquez wrote:
> >> > > > > On Fri, 11 Sep 2009, Greg KH wrote:
> >> > > > >
> >> > > > > > On Fri, Sep 11, 2009 at 05:38:08PM -0700, Andrew Vasquez wrote:
> >> > > > > > > Randy Dunlap noted:
> >> > > > > > >
> >> > > > > > > when CONFIG_MODULES=n:
> >> > > > > > >
> >> > > > > > > drivers/scsi/qla2xxx/qla_os.c:2685: error: dereferencing pointer to incomplete type
> >> > > > > > >
> >> > > > > > > in
> >> > > > > > >
> >> > > > > > > kobject_uevent_env(&(&vha->hw->pdev->driver->driver)->owner->mkobj.kobj,
> >> > > > > > > KOBJ_CHANGE, envp);
> >> > > > > > >
> >> > > > > > > Trigger kobject event on the 'struct device' hanging off the pci_dev.
> >> > > > > >
> >> > > > > > Um, why? What are you trying to do here? kobject change should not be
> >> > > > > > for a device, or a "normal" kobject.
> >> > > > > >
> >> > > > > > What do you expect userspace to do with this? Where have you documented
> >> > > > > > it?
> >> > > > >
> >> > > > > The purpose was described here:
> >> > > > >
> >> > > > > http://article.gmane.org/gmane.linux.scsi/54155
> >> > > > >
> >> > > > > Basically we'd like to instruct user-space to retrieve a blob of data
> >> > > > > automatically.
> >> > > >
> >> > > > Hm, like a firmware object perhaps?
> >> > > >
> >> > > > > Original implementation used the kboject hanging off
> >> > > > > the module which does not exist when CONFIG_MODULES=n. It was
> >> > > > > suggested that perhaps an alternative would be to use 'struct device'
> >> > > > > kobj. Any tips on how to trigger such a driver-specific event,
> >> > > > > perhaps a dedicated kobject exported by the driver itself???
> >> > > >
> >> > > > Why not use the firmware interface for it, that is what it is designed
> >> > > > for, and you will not have to craft any new udev rules.
> >> > >
> >> > > The data is going the wrong way to use the current firmware interface,
> >> > > which is designed to load data from userspace into the kernel. For this
> >> > > interface, we want the data to go the other way (i.e. the kernel has a
> >> > > blob of dump data it would like userspace to save if it can).
> >> >
> >> > Ick.
> >>
> >> It's a natural debugging event ... the user can simply program the
> >> system to discard the dump.
> >>
> >> > > I'd be amenable to updating the firmware interface to do this, but it
> >> > > looks like adding a completely new codepath, which it's not clear even
> >> > > belongs there.
> >> >
> >> > Well, I don't think it deserves a kobject change event, as that means
> >> > something a bit different to userspace today, right?
> >>
> >> Well, the documentation (in include/linux/kobject.h) does say that
> >> KOBJ_CHANGED is the dumping ground for events that don't match anything
> >> else, which this one seems to qualify as. What else do you suggest?
> >
> > Ok, I can't think of anything else at the moment, sorry.
>
> Wouldn't kernel/kmod.c :: call_usermodehelper_pipe() somehow fit for
> that interface?
The only current consumer of call_usermodehelper_pipe() is
fs/exec.c::do_coredump() and it appears to manipulate the blob of data
via file-level operations. Would this be a 'notification'
alternative? Or, are you suggesting the whole process be redone (both
notification and blob-transfer)? Uevent notifications with a udev
user-space front-end appears to be a much more simplified and flexible
mechanism.
-- av
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2009-09-15 21:57 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20090907210206.7830ba68.sfr@canb.auug.org.au>
2009-09-07 17:27 ` linux-next: Tree for September 7 (scsi/qla2x) Randy Dunlap
2009-09-08 18:25 ` Andrew Vasquez
2009-09-11 17:53 ` qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x)) Andrew Vasquez
2009-09-11 21:25 ` Randy Dunlap
2009-09-11 22:42 ` James Bottomley
2009-09-12 0:07 ` Andrew Vasquez
2009-09-12 0:17 ` Andrew Vasquez
2009-09-12 0:38 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Andrew Vasquez
2009-09-12 0:54 ` Greg KH
2009-09-12 2:56 ` Andrew Vasquez
2009-09-12 4:33 ` Greg KH
2009-09-12 14:30 ` James Bottomley
2009-09-15 15:33 ` Greg KH
2009-09-15 15:47 ` James Bottomley
2009-09-15 16:44 ` [PATCHv4] qla2xxx: Add firmware-dump kobject uevent notification Andrew Vasquez
2009-09-15 16:57 ` [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n Greg KH
2009-09-15 17:22 ` Kay Sievers
2009-09-15 18:29 ` Greg KH
2009-09-15 21:57 ` Andrew Vasquez
2009-09-15 18:26 ` Andrew Vasquez
2009-09-12 4:06 ` James Bottomley
2009-09-12 16:43 ` [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n Andrew Vasquez
2009-09-13 21:02 ` Randy Dunlap
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox