2009-09-07 11:02:15

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: Tree for September 7

Hi all,

Changes since 20090904:

The acpi tree still has a build failure so I used the version from
next-20090831.

The async_tx tree gained a build failure so I used the version from
next-20090904.

The mtd tree gained a conflict against the i2c tree.

The battery tree gained a conflict against Linus' tree.

The slab tree exposed a build failure in the wireless tree, so I reverted
a commit from there.

The security-testing tree lost its build failure but gained another for
which I reverted a commit.

The trivial tree gained conflicts against the scsi and arm trees.

The percpu tree gained a conflict against Linus' tree.

The tty tree gained a conflict against Linus' tree.

The scsi-post-merge tree gained a build failure for which I reverted a
commit.

----------------------------------------------------------------------------

I have created today's linux-next tree at
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
(patches at http://www.kernel.org/pub/linux/kernel/v2.6/next/ ). If you
are tracking the linux-next tree using git, you should not use "git pull"
to do so as that will try to merge the new linux-next release with the
old one. You should use "git fetch" as mentioned in the FAQ on the wiki
(see below).

You can see which trees have been included by looking in the Next/Trees
file in the source. There are also quilt-import.log and merge.log files
in the Next directory. Between each merge, the tree was built with
a ppc64_defconfig for powerpc and an allmodconfig for x86_64. After the
final fixups (if any), it is also built with powerpc allnoconfig (32 and
64 bit), ppc44x_defconfig and allyesconfig (minus
CONFIG_PROFILE_ALL_BRANCHES - this fails its final link) and i386, sparc
and sparc64 defconfig. These builds also have
CONFIG_ENABLE_WARN_DEPRECATED, CONFIG_ENABLE_MUST_CHECK and
CONFIG_DEBUG_INFO disabled when necessary.

Below is a summary of the state of the merge.

We are up to 141 trees (counting Linus' and 21 trees of patches pending for
Linus' tree), more are welcome (even if they are currently empty).
Thanks to those who have contributed, and to those who haven't, please do.

Status of my local build tests will be at
http://kisskb.ellerman.id.au/linux-next . If maintainers want to give
advice about cross compilers/configs that work, we are always open to add
more builds.

Thanks to Jan Dittmer for adding the linux-next tree to his build tests
at http://l4x.org/k/ , the guys at http://test.kernel.org/ and Randy
Dunlap for doing many randconfig builds.

There is a wiki covering stuff to do with linux-next at
http://linux.f-seidel.de/linux-next/pmwiki/ . Thanks to Frank Seidel.

--
Cheers,
Stephen Rothwell [email protected]

$ git checkout master
$ git reset --hard stable
Merging origin/master
Merging fixes/fixes
Merging arm-current/master
Merging m68k-current/for-linus
Merging powerpc-merge/merge
Merging sparc-current/master
Merging scsi-rc-fixes/master
Merging net-current/master
Merging sound-current/for-linus
Merging pci-current/for-linus
Merging wireless-current/master
Merging kbuild-current/master
Merging quilt/driver-core.current
Merging quilt/tty.current
Merging quilt/usb.current
Merging cpufreq-current/fixes
Merging input-current/for-linus
Merging md-current/for-linus
Merging audit-current/for-linus
Merging crypto-current/master
Merging ide-curent/master
Merging dwmw2/master
Merging arm/devel
Merging davinci/for-next
Merging pxa/for-next
Merging thumb-2/thumb-2
Merging avr32/avr32-arch
Merging blackfin/for-linus
Merging cris/for-next
Merging ia64/test
Merging m68k/for-next
Merging m68knommu/for-next
Merging microblaze/next
Merging mips/mips-for-linux-next
Merging parisc/next
Merging powerpc/next
CONFLICT (content): Merge conflict in kernel/gcov/Kconfig
Merging 4xx/next
Merging galak/next
Merging s390/features
Merging sh/master
Merging sparc/master
Merging xtensa/master
Merging cifs/master
Merging configfs/linux-next
Merging ecryptfs/next
Merging ext3/for_next
Merging ext4/next
Merging fatfs/master
Merging fuse/for-next
Merging gfs2/master
Merging jfs/next
Merging nfs/linux-next
Merging nfsd/nfsd-next
CONFLICT (content): Merge conflict in net/sunrpc/cache.c
Merging nilfs2/for-next
Merging ocfs2/linux-next
Merging squashfs/master
Merging udf/for_next
Merging v9fs/for-next
Merging ubifs/linux-next
Merging xfs/master
CONFLICT (content): Merge conflict in fs/xfs/linux-2.6/xfs_lrw.c
Merging reiserfs-bkl/reiserfs/kill-bkl
Merging vfs/for-next
Merging pci/linux-next
CONFLICT (content): Merge conflict in arch/powerpc/kernel/pci_64.c
Applying: pci: merge fixup for fundamental reset conflict with powerpc tree
Merging hid/for-next
Merging quilt/i2c
Merging quilt/jdelvare-hwmon
Merging quilt/kernel-doc
Merging v4l-dvb/master
CONFLICT (content): Merge conflict in drivers/media/video/gspca/Kconfig
CONFLICT (content): Merge conflict in drivers/media/video/sh_mobile_ceu_camera.c
Merging quota/for_next
Merging kbuild/master
Merging kconfig/for-next
CONFLICT (content): Merge conflict in scripts/extract-ikconfig
Merging ide/master
Merging libata/NEXT
Merging infiniband/for-next
Merging acpi/test
$ git reset --hard HEAD^
Merging refs/next/20090831/acpi
Merging ieee1394/for-next
Merging ubi/linux-next
Merging kvm/master
Merging dlm/next
Merging scsi/master
Merging async_tx/next
$ git reset --hard HEAD^
Merging refs/next/20090904/async_tx
Merging net/master
Merging wireless/master
Merging mtd/master
CONFLICT (content): Merge conflict in drivers/mtd/mtdcore.c
Merging crypto/master
Merging sound/for-next
Merging cpufreq/next
Merging quilt/rr
CONFLICT (content): Merge conflict in drivers/net/virtio_net.c
Merging mmc/next
Merging input/next
CONFLICT (content): Merge conflict in drivers/base/platform.c
Merging lsm/for-next
Merging block/for-next
CONFLICT (content): Merge conflict in fs/ubifs/super.c
Merging quilt/device-mapper
Merging embedded/master
Merging firmware/master
Merging pcmcia/master
Merging battery/master
CONFLICT (content): Merge conflict in drivers/power/wm97xx_battery.c
Merging leds/for-mm
Merging backlight/for-mm
Merging kgdb/kgdb-next
Merging slab/for-next
[master 81a4eb7] Revert "cfg80211: clear cfg80211_inform_bss() from kmemleak reports"
Merging uclinux/for-next
Merging md/for-next
Merging mfd/for-next
CONFLICT (content): Merge conflict in drivers/input/misc/Kconfig
Merging hdlc/hdlc-next
Merging drm/drm-next
CONFLICT (content): Merge conflict in firmware/Makefile
Merging voltage/for-next
CONFLICT (content): Merge conflict in drivers/regulator/Kconfig
Merging security-testing/next
CONFLICT (content): Merge conflict in arch/arm/kernel/signal.c
CONFLICT (content): Merge conflict in arch/parisc/include/asm/thread_info.h
CONFLICT (content): Merge conflict in arch/parisc/kernel/entry.S
CONFLICT (content): Merge conflict in arch/parisc/kernel/signal.c
Applying: security: fix merge for tun_struct changes
Merging lblnet/master
CONFLICT (content): Merge conflict in drivers/net/tun.c
Merging agp/agp-next
CONFLICT (content): Merge conflict in drivers/char/agp/uninorth-agp.c
Merging uwb/for-upstream
Merging watchdog/master
Merging bdev/master
Merging dwmw2-iommu/master
Merging cputime/cputime
Merging osd/linux-next
Merging jc_docs/docs-next
Merging nommu/master
Merging trivial/for-next
CONFLICT (delete/modify): arch/arm/mach-w90x900/w90p910.c deleted in HEAD and modified in trivial/for-next. Version trivial/for-next of arch/arm/mach-w90x900/w90p910.c left in tree.
CONFLICT (content): Merge conflict in drivers/scsi/mpt2sas/mpt2sas_scsih.c
$ git rm -f arch/arm/mach-w90x900/w90p910.c
Merging audit/for-next
Merging omap/for-next
Merging quilt/aoe
Merging suspend/linux-next
Merging bluetooth/master
Merging fsnotify/for-next
Merging irda/for-next
Merging hwlat/for-linus
Merging drbd/drbd
Merging kmemleak/kmemleak
Merging tip/auto-latest
CONFLICT (content): Merge conflict in arch/x86/include/asm/socket.h
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
CONFLICT (content): Merge conflict in drivers/pci/dmar.c
CONFLICT (content): Merge conflict in drivers/pci/intel-iommu.c
CONFLICT (content): Merge conflict in include/linux/rcupdate.h
CONFLICT (content): Merge conflict in kernel/fork.c
Applying: tip: fix merge for cupmask update
Merging oprofile/for-next
CONFLICT (content): Merge conflict in kernel/trace/ring_buffer.c
Merging edac-amd/for-next
CONFLICT (content): Merge conflict in arch/x86/kernel/smpboot.c
CONFLICT (content): Merge conflict in include/linux/topology.h
Merging percpu/for-next
CONFLICT (content): Merge conflict in arch/sh/kernel/vmlinux.lds.S
CONFLICT (content): Merge conflict in kernel/sched.c
CONFLICT (content): Merge conflict in mm/percpu.c
Merging sfi/sfi-test
CONFLICT (content): Merge conflict in arch/x86/kernel/setup.c
Merging asm-generic/next
Merging hwpoison/hwpoison
Merging quilt/driver-core
CONFLICT (content): Merge conflict in drivers/base/class.c
CONFLICT (content): Merge conflict in drivers/mtd/mtdcore.c
CONFLICT (content): Merge conflict in init/main.c
Merging quilt/tty
CONFLICT (content): Merge conflict in arch/x86/include/asm/termios.h
CONFLICT (content): Merge conflict in drivers/char/n_tty.c
Merging quilt/usb
Merging quilt/staging
CONFLICT (delete/modify): drivers/staging/at76_usb/at76_usb.c deleted in quilt/staging and modified in HEAD. Version HEAD of drivers/staging/at76_usb/at76_usb.c left in tree.
CONFLICT (delete/modify): drivers/staging/epl/VirtualEthernetLinux.c deleted in quilt/staging and modified in HEAD. Version HEAD of drivers/staging/epl/VirtualEthernetLinux.c left in tree.
$ git rm -f drivers/staging/epl/VirtualEthernetLinux.c
$ git rm -f drivers/staging/at76_usb/at76_usb.c
Merging scsi-post-merge/master
[master 229d357] Revert "[SCSI] be2iscsi: add 10Gbps iSCSI - BladeEngine 2 driver"
[master e8d0b8f] Revert "KEYS: security_cred_alloc_blank() should return int under all circumstances"
[master a383b61] Revert "KEYS: Add a keyctl to install a process's session keyring on its parent [try #6]"


Attachments:
(No filename) (9.75 kB)
(No filename) (197.00 B)
Download all attachments

2009-09-07 17:28:07

by Randy Dunlap

[permalink] [raw]
Subject: Re: linux-next: Tree for September 7 (scsi/qla2x)

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/

2009-09-08 00:08:50

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH -next] usb gadget: ether needs to select CRC32

From: Randy Dunlap <[email protected]>

Fix build error, ether uses/needs to select CRC32 config symbol:

ether.c:(.text+0x271480): undefined reference to `crc32_le'

Signed-off-by: Randy Dunlap <[email protected]>
---
drivers/usb/gadget/Kconfig | 1 +
1 file changed, 1 insertion(+)

--- linux-next-20090907.orig/drivers/usb/gadget/Kconfig
+++ linux-next-20090907/drivers/usb/gadget/Kconfig
@@ -627,6 +627,7 @@ config USB_AUDIO
config USB_ETH
tristate "Ethernet Gadget (with CDC Ethernet support)"
depends on NET
+ select CRC32
help
This driver implements Ethernet style communication, in one of
several ways:




---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/
---
~Randy
LPC 2009, Sept. 23-25, Portland, Oregon
http://linuxplumbersconf.org/2009/

2009-09-08 18:25:42

by Andrew Vasquez

[permalink] [raw]
Subject: Re: linux-next: Tree for September 7 (scsi/qla2x)

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 <[email protected]>
Date: Tue Aug 25 11:36:15 2009 -0700

[SCSI] qla2xxx: Add firmware-dump kobject uevent notification.

Signed-off-by: Andrew Vasquez <[email protected]>
Signed-off-by: Giridhar Malavali <[email protected]>
Signed-off-by: James Bottomley <[email protected]>

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

2009-09-11 17:53:42

by Andrew Vasquez

[permalink] [raw]
Subject: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))

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 <[email protected]>
---

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 <[email protected]>
> Date: Tue Aug 25 11:36:15 2009 -0700
>
> [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
>
> Signed-off-by: Andrew Vasquez <[email protected]>
> Signed-off-by: Giridhar Malavali <[email protected]>
> Signed-off-by: James Bottomley <[email protected]>
>
> 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

2009-09-11 21:25:58

by Randy Dunlap

[permalink] [raw]
Subject: Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))

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 <[email protected]>

Acked-by: Randy Dunlap <[email protected]>


> 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/

2009-09-11 22:42:39

by James Bottomley

[permalink] [raw]
Subject: Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))

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 <[email protected]>
> ---
>
> 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 <[email protected]>
> > Date: Tue Aug 25 11:36:15 2009 -0700
> >
> > [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
> >
> > Signed-off-by: Andrew Vasquez <[email protected]>
> > Signed-off-by: Giridhar Malavali <[email protected]>
> > Signed-off-by: James Bottomley <[email protected]>
> >
> > 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

2009-09-12 00:07:42

by Andrew Vasquez

[permalink] [raw]
Subject: Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))

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 <[email protected]>
> > ---
> >
> > 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 <[email protected]>
> > > Date: Tue Aug 25 11:36:15 2009 -0700
> > >
> > > [SCSI] qla2xxx: Add firmware-dump kobject uevent notification.
> > >
> > > Signed-off-by: Andrew Vasquez <[email protected]>
> > > Signed-off-by: Giridhar Malavali <[email protected]>
> > > Signed-off-by: James Bottomley <[email protected]>
> > >
> > > 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

2009-09-12 00:17:51

by Andrew Vasquez

[permalink] [raw]
Subject: Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))

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

2009-09-12 00:38:09

by Andrew Vasquez

[permalink] [raw]
Subject: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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 <[email protected]>
---

> 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

2009-09-12 00:57:16

by Greg KH

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-12 02:56:22

by Andrew Vasquez

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-12 04:06:42

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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 <[email protected]>
> ---
>
> > 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

2009-09-12 04:41:08

by Greg KH

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-12 14:30:16

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-12 16:43:59

by Andrew Vasquez

[permalink] [raw]
Subject: [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n.

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 <[email protected]>
---

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

2009-09-13 21:02:18

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCHv3] qla2xxx: Correct compilation issues when CONFIG_MODULES=n.

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 <[email protected]>

That works. Thanks for your persistence.

Acked-by: Randy Dunlap <[email protected]>


> ---
>
> 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/

2009-09-15 15:35:21

by Greg KH

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-15 15:47:24

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-15 16:44:21

by Andrew Vasquez

[permalink] [raw]
Subject: [PATCHv4] qla2xxx: Add firmware-dump kobject uevent notification.

Signed-off-by: Andrew Vasquez <[email protected]>
---

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 <[email protected]>
+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
+ [email protected]
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

2009-09-15 16:59:44

by Greg KH

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-15 17:22:19

by Kay Sievers

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

On Tue, Sep 15, 2009 at 18:57, Greg KH <[email protected]> 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

2009-09-15 18:26:16

by Andrew Vasquez

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

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

2009-09-15 19:07:46

by Greg KH

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

On Tue, Sep 15, 2009 at 07:22:03PM +0200, Kay Sievers wrote:
> On Tue, Sep 15, 2009 at 18:57, Greg KH <[email protected]> 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

2009-09-15 21:57:59

by Andrew Vasquez

[permalink] [raw]
Subject: Re: [PATCHv2] qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n.

On Tue, 15 Sep 2009, Kay Sievers wrote:
> On Tue, Sep 15, 2009 at 18:57, Greg KH <[email protected]> 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