Re: [PATCH 2/2] Add UAS driver

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

 



Am Mittwoch, 29. September 2010, 02:54:13 schrieb Matthew Wilcox:
> 
> [Could you trim a little when replying?]

Sorry.
> 
> On Tue, Sep 28, 2010 at 03:13:53PM +0200, Oliver Neukum wrote:
> > Am Dienstag, 28. September 2010, 12:14:56 schrieb Matthew Wilcox:
> > > +static void uas_do_work(struct work_struct *work)
> > > +{
> > > +	struct uas_cmd_info *cmdinfo;
> > > +	struct list_head list;
> > > +
> > > +	spin_lock_irq(&uas_work_lock);
> > > +	list_replace_init(&uas_work_list, &list);
> > > +	spin_unlock_irq(&uas_work_lock);
> > > +
> > > +	list_for_each_entry(cmdinfo, &list, list) {
> > > +		struct scsi_pointer *scp = (void *)cmdinfo;
> > > +		struct scsi_cmnd *cmnd = container_of(scp,
> > > +							struct scsi_cmnd, SCp);
> > > +		uas_submit_urbs(cmnd, cmnd->device->hostdata, GFP_KERNEL);
> > 
> > Deadlocky, use GFP_NOIO
> 
> ACK.  I thought I'd fixed this already.

Upon firther thought I think you need a dedicated work queue. Not only
need you use GFP_NOIO, but you need to make sure that no work scheduled
before your work on the same queue uses GFP_KERNEL.

> > > +	cmnd->result = sense_iu->status;
> > > +	if (sdev->current_cmnd)
> > > +		sdev->current_cmnd = NULL;
> > 
> > the condition is absolutely senseless
> 
> That's not true.  Avoiding dirtying a cacheline is important for
> performance.

This is subtle. Do you need to play compiler tricks here?

	Regards
		Oliver
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux