All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: Patrick Mochel <mochel@osdl.org>, Jurriaan <thunder7@xs4all.nl>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.5.44: problemn when shutting down, drivers/base/power.c and the global_device_list
Date: Sun, 20 Oct 2002 20:30:11 -0700	[thread overview]
Message-ID: <20021021033011.GA1534@beaverton.ibm.com> (raw)
In-Reply-To: <20021020145947.A11444@eng2.beaverton.ibm.com>

Thanks for debugging this.

I meant to keep the one in scsi_register_host and delete the one in
scsi_set_pci_device. I was having an issue with non-pci hosts when I
registered only through scsi_set_pci_device though the problem could
have been not ensuring parent was set to null so that if it was not set
prior to device_register we would not oops.

Either Patrick M's patch or this one should work until we straighten out
our device model support.

--- 1.19/drivers/scsi/hosts.h	Wed Oct 16 17:53:47 2002
+++ edited/drivers/scsi/hosts.h	Sun Oct 20 19:45:35 2002
@@ -551,9 +551,6 @@
 {
 	shost->pci_dev = pdev;
 	shost->host_driverfs_dev.parent=&pdev->dev;
-
-	/* register parent with driverfs */
-	device_register(&shost->host_driverfs_dev);
 }
 
 



Patrick Mansfield [patmans@us.ibm.com] wrote:
> On Sun, Oct 20, 2002 at 01:21:29PM -0700, Patrick Mochel wrote:
> > 
> > On Sat, 19 Oct 2002, Jurriaan wrote:
> > 
> > > DEV: registering device: ID = 'scsi0', name = sym53c8xx
> 
> Above is from scsi_set_pci_device() call.
> 
> > > scsi0 : sym53c8xx-1.7.3c-20010512
> > > DEV: registering device: ID = 'scsi0', name = sym53c8xx
> 
> Above are from scsi_register_host().
> 
> > > sym53c860-0-<1,*>: FAST-20 SCSI 20.0 MB/s (50.0 ns, offset 8)
> > >   Vendor: TOSHIBA   Model: DVD-ROM SD-M1401  Rev: 1007
> > >   Type:   CD-ROM                             ANSI SCSI revision: 02
> 
> > 
> > It appears the same device is being added twice. After doing some digging
> > in the sym53c8xx and the scsi host code, that suspicion grows, though I'm 
> > not positively sure how the host is being added twice. 
> > 
> 
> Looks like we have two device_register(&shost->host_driverfs_dev) calls,
> one in scsi_set_pci_device, and one in scsi_register_host(). I think 
> Mike meant to delete the one in scsi_register_host, but I can't tell
> for certain which one should go away.
> 
> And this must might be why I can't shutdown (i.e. no auto reboot).
> 
> So in 2.5.44 have:
> 
> 	scsi_register_host() calls
> 		attach [ncr_attach] calls
> 			scsi_register
> 			scsi_set_pci_device calls
> 				device_register(&shost->host_driverfs_dev)
> 		call to device_register() again in scsi_register_host
> 
> This removes the scsi_register_host() one, I can shutdown/reboot
> with this patch, I didn't dump anything else or try rmmod's:
> 
> --- bleed-2.5/drivers/scsi/hosts.c	Sat Oct 19 10:30:01 2002
> +++ bleed-2.5/drivers/scsi/hosts.c-mine	Sun Oct 20 14:46:13 2002
> @@ -543,7 +543,6 @@
>  				       shost->host_no, dm_name);
>  
>  				/* first register parent with driverfs */
> -				device_register(&shost->host_driverfs_dev);
>  				scan_scsis(shost, 0, 0, 0, 0);
>  			}
>  		}
> 
> > scsi_register_host() then loops through the hosts, and registers all the 
> > ones that this driver added. (Q: why is that function constantly looping 
> > through all the scsi hosts just to operate on the one passed in?).
> 
> A Scsi_Host_Template is passed in, it loops over Scsi_Hosts to find
> everyone that is using the Scsi_Host_Template, the names are confusing
> as well as the code.
> 
> > The SCSI code is confusing and likely the culprit. 
> 
> Yes and yes ...
> 
> -- Patrick Mansfield
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
-andmike
--
Michael Anderson
andmike@us.ibm.com


  reply	other threads:[~2002-10-21  3:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-19 15:34 2.5.44: problemn when shutting down, drivers/base/power.c and the global_device_list Jurriaan
2002-10-20 20:21 ` Patrick Mochel
2002-10-20 21:59   ` Patrick Mansfield
2002-10-21  3:30     ` Mike Anderson [this message]
2002-10-21  5:36     ` Jurriaan
2002-10-21 17:33       ` Patrick Mochel
     [not found]       ` <20021021084425.A29967@eng2.beaverton.ibm.com>
2002-10-21 18:35         ` Jurriaan
2002-10-21  4:26   ` Mike Anderson
  -- strict thread matches above, loose matches on Subject: below --
2002-10-20  1:39 ALESSANDRO.SUARDI

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=20021021033011.GA1534@beaverton.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mochel@osdl.org \
    --cc=thunder7@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.