From: Jeff Garzik <jeff@garzik.org>
To: Matthew Wilcox <matthew@wil.cx>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH 8/21] advansys: Rewrite resource management
Date: Thu, 26 Jul 2007 15:41:22 -0400 [thread overview]
Message-ID: <46A8F8E2.60309@garzik.org> (raw)
In-Reply-To: <11854705773172-git-send-email-matthew@wil.cx>
Matthew Wilcox wrote:
> @@ -18787,8 +18765,10 @@ advansys_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> int ioport;
> struct Scsi_Host *shost;
>
> - if (pci_enable_device(pdev))
> + if (pci_request_regions(pdev, "advansys"))
> goto fail;
> + if (pci_enable_device(pdev))
> + goto release_regions;
>
> ioport = pci_resource_start(pdev, 0);
> shost = advansys_board_found(ioport, &pdev->dev, ASC_IS_PCI);
> @@ -18799,6 +18779,8 @@ advansys_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
> }
>
> pci_disable_device(pdev);
> + release_regions:
> + pci_release_regions(pdev);
> fail:
> return -ENODEV;
> }
> @@ -18807,6 +18789,7 @@ static void __devexit advansys_pci_remove(struct pci_dev *pdev)
> {
> advansys_remove(pci_get_drvdata(pdev));
> pci_disable_device(pdev);
> + pci_release_regions(pdev);
Your ordering here is completely backwards.
You do not have resources to reserve, until you have enabled the device.
pci_enable_device() ALWAYS comes first, and pci_disable_device() always
comes next-to-last (pci_set_drvdata(pdev, NULL) is last).
Jeff
next prev parent reply other threads:[~2007-07-26 19:41 UTC|newest]
Thread overview: 55+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-26 17:11 Advansys driver Matthew Wilcox
2007-07-26 17:22 ` [PATCH 1/21] advansys: Clean up proc_info implementation Matthew Wilcox
2007-07-26 18:51 ` Jeff Garzik
2007-07-26 19:05 ` Matthew Wilcox
2007-07-26 17:22 ` [PATCH 2/21] advansys: version, copyright, etc Matthew Wilcox
2007-07-26 18:56 ` Jeff Garzik
2007-07-26 19:03 ` Matthew Wilcox
2007-07-26 19:08 ` Jeff Garzik
2007-07-26 19:16 ` Matthew Wilcox
2007-07-26 19:25 ` Christer Weinigel
2007-07-26 17:22 ` [PATCH 3/21] advansys: Convert to pci_register_driver interface Matthew Wilcox
2007-07-26 19:05 ` Jeff Garzik
2007-07-26 19:31 ` Jeff Garzik
2007-07-26 20:49 ` Matthew Wilcox
2007-07-26 21:21 ` Jeff Garzik
2007-07-27 13:48 ` Jeff Garzik
2007-07-26 17:22 ` [PATCH 4/21] advansys: restructure error handling in advansys_board_found Matthew Wilcox
2007-07-26 17:22 ` [PATCH 5/21] advansys: split advansys_init_wide_chip() out of advansys_board_found() Matthew Wilcox
2007-07-26 17:22 ` [PATCH 6/21] advansys: Move to scsi hotplug initialisation model Matthew Wilcox
2007-07-26 18:01 ` Christoph Hellwig
2007-07-26 18:04 ` Matthew Wilcox
2007-07-26 18:06 ` Matthew Wilcox
2007-07-26 18:16 ` Jeff Garzik
2007-07-26 18:29 ` Matthew Wilcox
2007-07-26 18:13 ` Jeff Garzik
2007-07-26 19:19 ` Jeff Garzik
2007-07-26 17:22 ` [PATCH 7/21] advansys: Convert to EISA driver model Matthew Wilcox
2007-07-26 19:38 ` Jeff Garzik
2007-07-26 20:37 ` Matthew Wilcox
2007-07-27 13:50 ` Jeff Garzik
2007-07-27 14:16 ` Matthew Wilcox
2007-07-27 14:55 ` Jeff Garzik
2007-07-26 17:22 ` [PATCH 8/21] advansys: Rewrite resource management Matthew Wilcox
2007-07-26 19:41 ` Jeff Garzik [this message]
2007-07-26 17:22 ` [PATCH 9/21] advansys: More PCI cleanups Matthew Wilcox
2007-07-26 19:43 ` Jeff Garzik
2007-07-26 19:50 ` Matthew Wilcox
2007-07-26 19:55 ` Jeff Garzik
2007-07-26 17:22 ` [PATCH 10/21] advansys: remove AscCompareString() Matthew Wilcox
2007-07-26 17:22 ` [PATCH 11/21] Add QUANTUM XP34301 to the blacklist Matthew Wilcox
2007-07-26 17:22 ` [PATCH 12/21] advansys: remove INQUIRY sniffing Matthew Wilcox
2007-07-26 17:22 ` [PATCH 13/21] advansys: misc reformatting Matthew Wilcox
2007-07-26 17:22 ` [PATCH 14/21] advansys: delete AscGetChipBusType Matthew Wilcox
2007-07-26 17:22 ` [PATCH 15/21] advansys: ioremap no longer needs page-aligned addresses Matthew Wilcox
2007-07-26 17:22 ` [PATCH 16/21] advansys: Stop using n_io_port in Scsi_Host structure Matthew Wilcox
2007-07-26 17:22 ` [PATCH 17/21] advansys: remove detect_called Matthew Wilcox
2007-07-26 19:48 ` Jeff Garzik
2007-07-26 17:22 ` [PATCH 18/21] advansys: Move struct device out of the cfg structures Matthew Wilcox
2007-07-26 19:49 ` Jeff Garzik
2007-07-26 20:26 ` Matthew Wilcox
2007-07-26 17:22 ` [PATCH 19/21] advansys: Remove library-style callback routines Matthew Wilcox
2007-07-26 17:22 ` [PATCH 20/21] advansys: Remove pci_slot_info Matthew Wilcox
2007-07-26 17:22 ` [PATCH 21/21] advansys: use memcpy instead of open-coded loop Matthew Wilcox
2007-07-26 19:50 ` Jeff Garzik
2007-07-27 4:58 ` Matthew Wilcox
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=46A8F8E2.60309@garzik.org \
--to=jeff@garzik.org \
--cc=linux-scsi@vger.kernel.org \
--cc=matthew@wil.cx \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).