All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Tejun Heo <htejun@gmail.com>
Cc: linux-ide@vger.kernel.org, liml@rtr.ca, alan@lxorguk.ukuu.org.uk,
	kngregertsen@norway.atmel.com, sonic.adi@gmail.com,
	rmk@dyn-67.arm.linux.org.uk, alessandro.zummo@towertech.it,
	domen.puncer@telargo.com, akira2.iguchi@toshiba.co.jp,
	leoli@freescale.com
Subject: Re: [PATCH 1/9] libata: PCI device should be powered up before being accessed
Date: Fri, 01 Feb 2008 15:44:57 -0500	[thread overview]
Message-ID: <47A384C9.10804@garzik.org> (raw)
In-Reply-To: <12016853434040-git-send-email-htejun@gmail.com>

Tejun Heo wrote:
> diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c
> index 7e68edf..5ef6594 100644
> --- a/drivers/ata/pata_ali.c
> +++ b/drivers/ata/pata_ali.c
> @@ -597,6 +597,11 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  	const struct ata_port_info *ppi[] = { NULL, NULL };
>  	u8 tmp;
>  	struct pci_dev *isa_bridge;
> +	int rc;
> +
> +	rc = pcim_enable_device(pdev);
> +	if (rc)
> +		return rc;
>  
>  	/*
>  	 * The chipset revision selects the driver operations and
> @@ -632,8 +637,15 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  #ifdef CONFIG_PM
>  static int ali_reinit_one(struct pci_dev *pdev)
>  {
> +	struct ata_host *host = dev_get_drvdata(&pdev->dev);
> +	int rc;
> +
> +	rc = ata_pci_device_do_resume(pdev);
> +	if (rc)
> +		return rc;
>  	ali_init_chipset(pdev);
> -	return ata_pci_device_resume(pdev);
> +	ata_host_resume(host);
> +	return 0;
>  }
>  #endif
>  
> diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
> index 761a666..567fe6b 100644
> --- a/drivers/ata/pata_amd.c
> +++ b/drivers/ata/pata_amd.c
> @@ -662,10 +662,15 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  	static int printed_version;
>  	int type = id->driver_data;
>  	u8 fifo;
> +	int rc;
>  
>  	if (!printed_version++)
>  		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
>  
> +	rc = pcim_enable_device(pdev);
> +	if (rc)
> +		return rc;
> +
>  	pci_read_config_byte(pdev, 0x41, &fifo);
>  
>  	/* Check for AMD7409 without swdma errata and if found adjust type */
> @@ -709,6 +714,13 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
>  #ifdef CONFIG_PM
>  static int amd_reinit_one(struct pci_dev *pdev)
>  {
> +	struct ata_host *host = dev_get_drvdata(&pdev->dev);
> +	int rc;
> +
> +	rc = ata_pci_device_do_resume(pdev);
> +	if (rc)
> +		return rc;
> +
>  	if (pdev->vendor == PCI_VENDOR_ID_AMD) {
>  		u8 fifo;
>  		pci_read_config_byte(pdev, 0x41, &fifo);
> @@ -721,7 +733,9 @@ static int amd_reinit_one(struct pci_dev *pdev)
>  		    pdev->device == PCI_DEVICE_ID_AMD_COBRA_7401)
>  		    	ata_pci_clear_simplex(pdev);
>  	}
> -	return ata_pci_device_resume(pdev);
> +
> +	ata_host_resume(host);
> +	return 0;
>  }
>  #endif
>  
> diff --git a/drivers/ata/pata_artop.c b/drivers/ata/pata_artop.c
> index d421831..2f81480 100644
> --- a/drivers/ata/pata_artop.c
> +++ b/drivers/ata/pata_artop.c
> @@ -446,11 +446,16 @@ static int artop_init_one (struct pci_dev *pdev, const struct pci_device_id *id)
>  		.port_ops	= &artop6260_ops,
>  	};
>  	const struct ata_port_info *ppi[] = { NULL, NULL };
> +	int rc;
>  
>  	if (!printed_version++)
>  		dev_printk(KERN_DEBUG, &pdev->dev,
>  			   "version " DRV_VERSION "\n");
>  
> +	rc = pcim_enable_device(pdev);
> +	if (rc)
> +		return rc;
> +
>  	if (id->driver_data == 0) {	/* 6210 variant */
>  		ppi[0] = &info_6210;
>  		ppi[1] = &ata_dummy_port_info;

While _I_ do not object, I'm curious to see what Alan thinks about 
adding enable-device to all these drivers.  Seems like the right (and 
necessary) thing to do, from my perspective...

	Jeff



  reply	other threads:[~2008-02-01 20:45 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-30  9:28 [PATCHSET libata-dev#upstream] clean up scsi_host_templates and ata_port_operations Tejun Heo
2008-01-30  9:28 ` [PATCH 1/9] libata: PCI device should be powered up before being accessed Tejun Heo
2008-02-01 20:44   ` Jeff Garzik [this message]
2008-02-11 19:24   ` Jeff Garzik
2008-01-30  9:28 ` [PATCH 2/9] libata: reorganize ata_port_operations Tejun Heo
2008-01-30  9:28 ` [PATCH 3/9] libata: implement and use ata_noop_irq_clear() Tejun Heo
2008-02-01 20:45   ` Jeff Garzik
2008-01-30  9:28 ` [PATCH 4/9] libata: normalize port_info, port_operations and sht tables Tejun Heo
2008-02-01 20:46   ` Jeff Garzik
2008-02-09  1:57     ` Tejun Heo
2008-02-04 14:24   ` Alan Cox
2008-02-09  6:11     ` Tejun Heo
2008-02-09  6:53       ` Tejun Heo
2008-01-30  9:28 ` [PATCH 5/9] libata: implement and use SHT initializers and ops inheritance Tejun Heo
2008-01-30 17:09   ` Mark Lord
2008-01-31  3:39     ` Tejun Heo
2008-01-31  4:04       ` Mark Lord
2008-01-31  4:12         ` Tejun Heo
2008-02-01 20:49   ` Jeff Garzik
2008-02-02  0:06     ` Tejun Heo
2008-01-30  9:29 ` [PATCH 6/9] make ata_pci_init_one() not use ops->irq_handler and pi->sht Tejun Heo
2008-01-30  9:29 ` [PATCH 7/9] libata: stop overloading port_info->private_data Tejun Heo
2008-02-04 14:26   ` Alan Cox
2008-02-09  2:07     ` Tejun Heo
2008-01-30  9:29 ` [PATCH 8/9] libata: kill port_info->sht and ->irq_handler Tejun Heo
2008-01-30  9:29 ` [PATCH 9/9] libata: make reset related methods proper port operations Tejun Heo
2008-02-01 20:52   ` Jeff Garzik
2008-01-30  9:49 ` How to verify sht-ops-conversion patch doesn't change anything Tejun Heo
2008-01-30  9:51 ` GIT tree available Tejun Heo
2008-01-31  8:29 ` [PATCHSET libata-dev#upstream] clean up scsi_host_templates and ata_port_operations Akira Iguchi
2008-02-09  1:55   ` Tejun Heo
2008-01-31  8:34 ` Akira Iguchi

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=47A384C9.10804@garzik.org \
    --to=jeff@garzik.org \
    --cc=akira2.iguchi@toshiba.co.jp \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=alessandro.zummo@towertech.it \
    --cc=domen.puncer@telargo.com \
    --cc=htejun@gmail.com \
    --cc=kngregertsen@norway.atmel.com \
    --cc=leoli@freescale.com \
    --cc=liml@rtr.ca \
    --cc=linux-ide@vger.kernel.org \
    --cc=rmk@dyn-67.arm.linux.org.uk \
    --cc=sonic.adi@gmail.com \
    /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.