From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751549Ab2DTUG4 (ORCPT ); Fri, 20 Apr 2012 16:06:56 -0400 Received: from g4t0015.houston.hp.com ([15.201.24.18]:2466 "EHLO g4t0015.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232Ab2DTUGz (ORCPT ); Fri, 20 Apr 2012 16:06:55 -0400 Date: Fri, 20 Apr 2012 15:06:52 -0500 From: scameron@beardog.cce.hp.com To: Khalid Aziz Cc: james.bottomley@hansenpartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, matthew.gates@hp.com, stephenmcameron@gmail.com, thenzl@redhat.com, akpm@linux-foundation.org, mikem@beardog.cce.hp.com, scameron@beardog.cce.hp.com Subject: Re: [PATCH 03/17] hpsa: enable bus master bit after pci_enable_device Message-ID: <20120420200652.GA11802@beardog.cce.hp.com> References: <20120420150349.10596.73732.stgit@beardog.cce.hp.com> <20120420150629.10596.51923.stgit@beardog.cce.hp.com> <1334947310.10129.124.camel@lyra> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1334947310.10129.124.camel@lyra> User-Agent: Mutt/1.4.2.2i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2012 at 12:41:50PM -0600, Khalid Aziz wrote: > On Fri, 2012-04-20 at 10:06 -0500, Stephen M. Cameron wrote: > > From: Stephen M. Cameron > > > > 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 > > --- > > 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? Yes. Thanks. -- steve