public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Andrew Vasquez <andrew.vasquez@qlogic•com>
To: James Bottomley <James.Bottomley@suse•de>
Cc: Linux SCSI Mailing List <linux-scsi@vger•kernel.org>,
	Randy Dunlap <randy.dunlap@oracle•com>,
	Stephen Rothwell <sfr@canb•auug.org.au>,
	"linux-next@vger•kernel.org" <linux-next@vger•kernel.org>,
	LKML <linux-kernel@vger•kernel.org>,
	Giridhar Malavali <giridhar.malavali@qlogic•com>
Subject: Re: qla2xxx: Correct compilation issues when CONFIG_MOUDLES=n (was: Re: linux-next: Tree for September 7 (scsi/qla2x))
Date: Fri, 11 Sep 2009 17:07:42 -0700	[thread overview]
Message-ID: <20090912000742.GB12098@plap4-2.local> (raw)
In-Reply-To: <1252708951.13282.151.camel@mulgrave.site>

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

  reply	other threads:[~2009-09-12  0:07 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-07 11:02 linux-next: Tree for September 7 Stephen Rothwell
2009-09-07 16:49 ` Next Sept 7: Bug : skb_release_head_state on x86 Sachin Sant
     [not found] ` <4AA5399A.405@in.ibm.com>
2009-09-07 17:17   ` Eric Dumazet
2009-09-08  5:09     ` Sachin Sant
2009-09-09 11:13       ` Sachin Sant
2009-09-09 12:10         ` Eric Dumazet
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 [this message]
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
2009-09-08  0:08 ` [PATCH -next] usb gadget: ether needs to select CRC32 Randy Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090912000742.GB12098@plap4-2.local \
    --to=andrew.vasquez@qlogic$(echo .)com \
    --cc=James.Bottomley@suse$(echo .)de \
    --cc=giridhar.malavali@qlogic$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=linux-scsi@vger$(echo .)kernel.org \
    --cc=randy.dunlap@oracle$(echo .)com \
    --cc=sfr@canb$(echo .)auug.org.au \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox