[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1334947310.10129.124.camel@lyra>
Date: Fri, 20 Apr 2012 12:41:50 -0600
From: Khalid Aziz <khalid.aziz@...com>
To: "Stephen M. Cameron" <scameron@...rdog.cce.hp.com>
Cc: james.bottomley@...senpartnership.com, linux-scsi@...r.kernel.org,
linux-kernel@...r.kernel.org, matthew.gates@...com,
stephenmcameron@...il.com, thenzl@...hat.com,
akpm@...ux-foundation.org, mikem@...rdog.cce.hp.com
Subject: Re: [PATCH 03/17] hpsa: enable bus master bit after
pci_enable_device
On Fri, 2012-04-20 at 10:06 -0500, Stephen M. Cameron wrote:
> From: Stephen M. Cameron <scameron@...rdog.cce.hp.com>
>
> pci_disable_device() disables the bus master bit and pci_enable_device does
> not re-enable it. It needs to be enabled.
>
> Signed-off-by: Stephen M. Cameron <scameron@...rdog.cce.hp.com>
> ---
> drivers/scsi/hpsa.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
> index 5119ce6..363619d 100644
> --- a/drivers/scsi/hpsa.c
> +++ b/drivers/scsi/hpsa.c
> @@ -3917,6 +3917,7 @@ static int __devinit hpsa_enter_simple_mode(struct ctlr_info *h)
> static int __devinit hpsa_pci_init(struct ctlr_info *h)
> {
> int prod_index, err;
> + u16 command_register;
>
> prod_index = hpsa_lookup_board_id(h->pdev, &h->board_id);
> if (prod_index < 0)
> @@ -3933,6 +3934,11 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
> return err;
> }
>
> + /* Enable bus mastering (pci_disable_device may disable this) */
> + pci_read_config_word(h->pdev, PCI_COMMAND, &command_register);
> + command_register |= PCI_COMMAND_MASTER;
> + pci_write_config_word(h->pdev, PCI_COMMAND, command_register);
> +
> err = pci_request_regions(h->pdev, HPSA);
> if (err) {
> dev_err(&h->pdev->dev,
Wouldn't it be better to use pci_set_master(h->pdev) to enable bus
mastering?
--
====================================================================
Khalid Aziz Unix Systems Lab
(970)898-9214 Hewlett-Packard
khalid.aziz@...com Fort Collins, CO
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists