Re: [PATCH 06/24] mpi3mr: add support of event handling part-1

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

 



On 12/22/20 11:11 AM, Kashyap Desai wrote:
> Firmware can report various MPI Events.
> Support for certain Events (as listed below) are enabled in the driver
> and their processing in driver is covered in this patch.
> 
> MPI3_EVENT_DEVICE_ADDED
> MPI3_EVENT_DEVICE_INFO_CHANGED
> MPI3_EVENT_DEVICE_STATUS_CHANGE
> MPI3_EVENT_ENCL_DEVICE_STATUS_CHANGE
> MPI3_EVENT_SAS_TOPOLOGY_CHANGE_LIST
> MPI3_EVENT_SAS_DISCOVERY
> MPI3_EVENT_SAS_DEVICE_DISCOVERY_ERROR
> 
> Key support in this patch is device add/removal.
> 
> Signed-off-by: Kashyap Desai <kashyap.desai@xxxxxxxxxxxx>
> Cc: sathya.prakash@xxxxxxxxxxxx
> ---
...
> + */
> +void mpi3mr_cleanup_fwevt_list(struct mpi3mr_ioc *mrioc)
> +{
> +	struct mpi3mr_fwevt *fwevt = NULL;
> +
> +	if ((list_empty(&mrioc->fwevt_list) && !mrioc->current_event) ||
> +	    !mrioc->fwevt_worker_thread || in_interrupt())
The in_interrup macro is deprecated and should not be used in new code.
Is it at all possible to call the mpi3mr_cleanup_fwevt_list from
interrupt context?

> +		return;
> +
> +	while ((fwevt = mpi3mr_dequeue_fwevt(mrioc)) ||
> +	    (fwevt = mrioc->current_event)) {
> +		/*
> +		 * Wait on the fwevt to complete. If this returns 1, then
> +		 * the event was never executed, and we need a put for the
> +		 * reference the work had on the fwevt.
> +		 *
> +		 * If it did execute, we wait for it to finish, and the put will
> +		 * happen from mpi3mr_process_fwevt()
> +		 */
> +		if (cancel_work_sync(&fwevt->work)) {
> +			/*
> +			 * Put fwevt reference count after
> +			 * dequeuing it from worker queue
> +			 */
> +			mpi3mr_fwevt_put(fwevt);
> +			/*
> +			 * Put fwevt reference count to neutralize
> +			 * kref_init increment
> +			 */
> +			mpi3mr_fwevt_put(fwevt);
> +		}
> +	}
> +}




[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