Re: [RFC] Megaraid update, submission

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 16, 2006 at 11:13:14AM -0700, Andre Hedrick wrote:
>  /**
> + * megaraid_pci_master_abort
> + * @dev                : pci device structure
> + *
> + * Tests for PCI Master Abort on the host adapter and clears state
> + * Returns state of error with inverted logic test to give proper
> + * state of the pci statuts bit describing master_abort.
> + */
> +static int megaraid_pci_master_abort(struct pci_dev* dev)
> +{
> +	u16 status, error_bits;
> +
> +	pci_read_config_word(dev, PCI_STATUS, &status);
> +	error_bits = (status & PCI_STATUS_REC_MASTER_ABORT);
> +	if (error_bits)
> +		pci_write_config_word(dev, PCI_STATUS, error_bits);
> +	pci_read_config_word(dev, PCI_STATUS, &status);
> +	error_bits = (status & PCI_STATUS_REC_MASTER_ABORT);
> +	return (!error_bits) ? 0 : 1;

A little clunky still.  How about:

	u16 status;
	pci_read_config_word(dev, PCI_STATUS, &status);
	if (!(status & PCI_STATUS_REC_MASTER_ABORT))
		return 0;
	pci_write_config_word(dev, PCI_STATUS, PCI_STATUS_REC_MASTER_ABORT);
	pci_read_config_word(dev, PCI_STATUS, &status);
	return (status & PCI_STATUS_REC_MASTER_ABORT) ? 1 : 0;

> @@ -2519,14 +2547,13 @@
>  	list_for_each_entry_safe(scb, tmp, &adapter->completed_list, list) {
>  
>  		if (scb->scp == scp) {	// Found command
> -
> -			list_del_init(&scb->list);	// from completed list
> -
>  			con_log(CL_ANN, (KERN_WARNING
>  			"megaraid: %ld:%d[%d:%d], abort from completed list\n",
>  				scp->serial_number, scb->sno,
>  				scb->dev_channel, scb->dev_target));
>  
> +			list_del_init(&scb->list);	// from completed list
> +
>  			scp->result = (DID_ABORT << 16);
>  			scp->scsi_done(scp);
>  

Not quite sure why this change makes any difference

> @@ -2549,8 +2576,6 @@
>  
>  		if (scb->scp == scp) {	// Found command
>  
> -			list_del_init(&scb->list);	// from pending list
> -
>  			ASSERT(!(scb->state & SCB_ISSUED));
>  
>  			con_log(CL_ANN, (KERN_WARNING
> @@ -2558,6 +2583,8 @@
>  				scp->serial_number, scb->dev_channel,
>  				scb->dev_target));
>  
> +			list_del_init(&scb->list);	// from pending list
> +
>  			scp->result = (DID_ABORT << 16);
>  			scp->scsi_done(scp);

ditto

-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux