Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 13231cac authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull SCSI fixes from James Bottomley:
 "A bunch of fixes for aacraid, a set of coherency fixes that only
  affect non-coherent platforms and one coccinelle detected null check
  after use"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  scsi: libsas: align sata_device's rps_resp on a cacheline
  scsi: use dma_get_cache_alignment() as minimum DMA alignment
  scsi: dma-mapping: always provide dma_get_cache_alignment
  scsi: ufs: ufshcd: fix potential NULL pointer dereference in ufshcd_config_vreg
  scsi: aacraid: Prevent crash in case of free interrupt during scsi EH path
  scsi: aacraid: Perform initialization reset only once
  scsi: aacraid: Check for PCI state of device in a generic way
parents e6cdd80a c2e8fbf9
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1673,6 +1673,7 @@ struct aac_dev
	struct aac_hba_map_info	hba_map[AAC_MAX_BUSES][AAC_MAX_TARGETS];
	u8			adapter_shutdown;
	u32			handle_pci_error;
	bool			init_reset;
};

#define aac_adapter_interrupt(dev) \
+3 −32
Original line number Diff line number Diff line
@@ -467,35 +467,6 @@ int aac_queue_get(struct aac_dev * dev, u32 * index, u32 qid, struct hw_fib * hw
	return 0;
}

#ifdef CONFIG_EEH
static inline int aac_check_eeh_failure(struct aac_dev *dev)
{
	/* Check for an EEH failure for the given
	 * device node. Function eeh_dev_check_failure()
	 * returns 0 if there has not been an EEH error
	 * otherwise returns a non-zero value.
	 *
	 * Need to be called before any PCI operation,
	 * i.e.,before aac_adapter_check_health()
	 */
	struct eeh_dev *edev = pci_dev_to_eeh_dev(dev->pdev);

	if (eeh_dev_check_failure(edev)) {
		/* The EEH mechanisms will handle this
		 * error and reset the device if
		 * necessary.
		 */
		return 1;
	}
	return 0;
}
#else
static inline int aac_check_eeh_failure(struct aac_dev *dev)
{
	return 0;
}
#endif

/*
 *	Define the highest level of host to adapter communication routines.
 *	These routines will support host to adapter FS commuication. These
@@ -701,7 +672,7 @@ int aac_fib_send(u16 command, struct fib *fibptr, unsigned long size,
					return -ETIMEDOUT;
				}

				if (aac_check_eeh_failure(dev))
				if (unlikely(pci_channel_offline(dev->pdev)))
					return -EFAULT;

				if ((blink = aac_adapter_check_health(dev)) > 0) {
@@ -801,7 +772,7 @@ int aac_hba_send(u8 command, struct fib *fibptr, fib_callback callback,

		spin_unlock_irqrestore(&fibptr->event_lock, flags);

		if (aac_check_eeh_failure(dev))
		if (unlikely(pci_channel_offline(dev->pdev)))
			return -EFAULT;

		fibptr->flags |= FIB_CONTEXT_FLAG_WAIT;
@@ -1583,6 +1554,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
	 * will ensure that i/o is queisced and the card is flushed in that
	 * case.
	 */
	aac_free_irq(aac);
	aac_fib_map_free(aac);
	dma_free_coherent(&aac->pdev->dev, aac->comm_size, aac->comm_addr,
			  aac->comm_phys);
@@ -1590,7 +1562,6 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type)
	aac->comm_phys = 0;
	kfree(aac->queues);
	aac->queues = NULL;
	aac_free_irq(aac);
	kfree(aac->fsa_dev);
	aac->fsa_dev = NULL;

+3 −0
Original line number Diff line number Diff line
@@ -1680,6 +1680,9 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
	aac->cardtype = index;
	INIT_LIST_HEAD(&aac->entry);

	if (aac_reset_devices || reset_devices)
		aac->init_reset = true;

	aac->fibs = kzalloc(sizeof(struct fib) * (shost->can_queue + AAC_NUM_MGT_FIB), GFP_KERNEL);
	if (!aac->fibs)
		goto out_free_host;
+10 −5
Original line number Diff line number Diff line
@@ -561,11 +561,16 @@ int _aac_rx_init(struct aac_dev *dev)
	dev->a_ops.adapter_sync_cmd = rx_sync_cmd;
	dev->a_ops.adapter_enable_int = aac_rx_disable_interrupt;
	dev->OIMR = status = rx_readb (dev, MUnit.OIMR);
	if ((((status & 0x0c) != 0x0c) || aac_reset_devices || reset_devices) &&
	  !aac_rx_restart_adapter(dev, 0, IOP_HWSOFT_RESET))

	if (((status & 0x0c) != 0x0c) || dev->init_reset) {
		dev->init_reset = false;
		if (!aac_rx_restart_adapter(dev, 0, IOP_HWSOFT_RESET)) {
			/* Make sure the Hardware FIFO is empty */
			while ((++restart < 512) &&
			       (rx_readl(dev, MUnit.OutboundQueue) != 0xFFFFFFFFL));
		}
	}

	/*
	 *	Check to see if the board panic'd while booting.
	 */
+14 −6
Original line number Diff line number Diff line
@@ -868,9 +868,13 @@ int aac_src_init(struct aac_dev *dev)
	/* Failure to reset here is an option ... */
	dev->a_ops.adapter_sync_cmd = src_sync_cmd;
	dev->a_ops.adapter_enable_int = aac_src_disable_interrupt;
	if ((aac_reset_devices || reset_devices) &&
		!aac_src_restart_adapter(dev, 0, IOP_HWSOFT_RESET))

	if (dev->init_reset) {
		dev->init_reset = false;
		if (!aac_src_restart_adapter(dev, 0, IOP_HWSOFT_RESET))
			++restart;
	}

	/*
	 *	Check to see if the board panic'd while booting.
	 */
@@ -1014,9 +1018,13 @@ int aac_srcv_init(struct aac_dev *dev)
	/* Failure to reset here is an option ... */
	dev->a_ops.adapter_sync_cmd = src_sync_cmd;
	dev->a_ops.adapter_enable_int = aac_src_disable_interrupt;
	if ((aac_reset_devices || reset_devices) &&
		!aac_src_restart_adapter(dev, 0, IOP_HWSOFT_RESET))

	if (dev->init_reset) {
		dev->init_reset = false;
		if (!aac_src_restart_adapter(dev, 0, IOP_HWSOFT_RESET))
			++restart;
	}

	/*
	 *	Check to see if flash update is running.
	 *	Wait for the adapter to be up and running. Wait up to 5 minutes
Loading