RE: [PATCH v3] ufs: poll pmc until another pa request is completed

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

 



> > +		spin_lock_irqsave(hba->host->host_lock, flags);
> > +		hba->active_uic_cmd = NULL;
> > +		if (ufshcd_is_link_broken(hba)) {
> > +			spin_unlock_irqrestore(hba->host->host_lock, flags);
> > +			ret = -ENOLINK;
> > +			goto out;
> > +		}
> > +		hba->uic_async_done = cnf;
> > +		cmd->argument2 = 0;
> > +		cmd->argument3 = mode;
> > +		ret = __ufshcd_send_uic_cmd(hba, cmd, true);
> > +		spin_unlock_irqrestore(hba->host->host_lock, flags);
> 
> Please consider adding 	lockdep_assert_held(&hba->uic_cmd_mutex) near
> the start of __ufshcd_poll_uic_pwr() to document that this function is
> serialized against other contexts that submit an UIC.

Got it.

> 
> Additionally, I don't think that it is necessary to hold the host lock
> around the ufshcd_is_link_broken() or __ufshcd_send_uic_cmd() calls.

I agree with you on __ufshcd_send_uic_cmd because of the mutex. And I wonder why you make you think that on uic_link_state.
Is it because you think it's not possible to access uic_link_state simultaneously w/ the current code or it should be?

It seems most cases have no problems but anyway I think it seems that uic_link_state could be accessed from more than one context,
especially if auto hibern8 is enabled and only if some UIC errors occur.


Thanks.
Kiwoong Kim
> 
> Thanks,
> 
> Bart.
> 






[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