On Tue, Oct 03, 2023 at 08:11:39PM +0300, Michael Tokarev wrote:
> 26.09.2023 15:05, Niklas Cassel:
> > Hello Marcin,
> > 
> > I will have a look at this.
> 
> Hi Marcin, Hi Niklas!
> 
> Niklas, I remember asking you if the whole thing is okay for the -stable,
> and you was a bit unsure about it :)  Regardless, I picked the changes
> up for -stable. I don't think it was anyone's fault though, - after all,
> I guess, without the change being in -stable, we'd know about this issue
> in some distant future instead of now :)
> 
> I'm planning to release 8.1.2 soon, with freeze being at Oct-14.  It'd
> be really great if we can include a fix for this both in master and in
> 8.1.2 (8.1.2 should have a long-awaited fix for a quite serious long-
> standing issue in 8.1).
> 
> Were you able to take a look at what's going on here?  I wish I were
> able to help here but I know right to nothing about ahci emulation..

I was away on a conference all last week, so I didn't have much time to
look at this yet. I will debug the problem this week.

>From at quick look at Marcin logs:
ahcich0: Poll timeout on slot 1 port 0
ahcich0: is 00000000 cs 00000002 ss 00000000 rs 00000002 tfd 170 serr 00000000 
cmd 0000c017

This log seems to come from:
http://fxr.watson.org/fxr/source/dev/ahci/ahci.c?v=FREEBSD-13-STABLE#L1795

Looking at the print "cs 00000002" means PxCI: 0x2.
So PxCI is never cleared.

I will need to run FreeBSD so I can see which command it is that never gets
PxCI cleared.

NCQ commands will always clear PxCI in process_ncq_command().
Non-NCQ commands will always clear PxCI in ahci_clear_cmd_issue().

>From a quick glance, the only time we do not clear PxCI is if we receive
a FIS that we do not handle (trace_handle_cmd_unhandled_fis()).
Will try to see exactly which FIS FreeBSD is sending tomorrow.

(Perhaps we should simply clear PxCI for these FISes that we do not handle...
Or at least make sure that we set ERR_STAT in PxTFD.)


Kind regards,
Niklas


Reply via email to