Re: Multiple errors with DVD drive

J.J. Berkhout
2022-09-26T14:39:26Z

[-- Attachment #1.1: Type: text/plain, Size: 3446 bytes --]

On 21-09-2022 20:32, Niklas Cassel wrote:
> On Wed, Sep 21, 2022 at 02:38:51PM +0200, J.J. Berkhout wrote:
>> On 21-09-2022 13:58, Niklas Cassel wrote:
>>> Another way do disable lpm is to do:
>>> $ sudo sh -c "echo max_performance > /sys/class/scsi_host/host13/link_power_management_policy"
>>
>> Yes, this worked and did the trick! Reading without any errors. I did
>> not yet try to write, but will do so today.
>> When booting with libata.force=nolpm the link_power_management_policy
>> was still med_power_with_dipm and I got the dmesg:
>>
>> [ 0.291452] ata: failed to parse force parameter "nolpm" (unknown value)
>>
>> so the ineffectiveness of this boot parameter seems to be explained.
>> Might there be some other syntax for this parameter?
>
> Apparently this was introduced quite recently, in
> commit 2c33bbdac28c ("ata: libata-core: Allow forcing most horkage flags")
> which was first included in kernel v5.19.
>
>>
>> Nevertheless, my problem now has a work-around and I am very happy.
>> Thanks, Niklas.
>
> Great news!
>
> Then I believe that
> + { "PIONEER BD-RW BDR-207M", NULL, ATA_HORKAGE_NOLPM },
> should be the proper quirk for your device.
>
> If you could test it when you have time (again, no rush),
> then we could send out a proper fix for this.
>
>
> Kind regards,
> Niklas

OK, I got around to testing the patch.
I used kernel 5.19.11 (from https://cdn.kernel.org/pub).
After solving the problem with errors with the compilation (I removed
the NVIDIA driver and switched to the nouveau driver) and space problems
on my /boot partition (solved by using sudo make INSTALL_MOD_STRIP=1
modules_install) I got the following results:

Try 1:
patching libata-core.c with the lines
/* PIONEER BD-RW BDR-207M and PIONEER BD-RW BDR-205 have broken LPM
support */
{ "PIONEER BD-RW DVR-207M", NULL, ATA_HORKAGE_NOLPM },
{ "PIONEER BD-RW DVR-205", NULL, ATA_HORKAGE_NOLPM },

resulted in
link_power_management_policy still "med_power_with_dipm"
problem with pioneer DOES occur

Try 2:
patching libata-core.c with the lines
/* PIONEER BD-RW BDR-207M and PIONEER BD-RW BDR-205 have broken LPM
support */
{ "PIONEER BD-RW DVR-207M", NULL, ATA_HORKAGE_NOSETXFER },
{ "PIONEER BD-RW DVR-205", NULL, ATA_HORKAGE_NOSETXFER },

resulted in
link_power_management_policy still "med_power_with_dipm"
problem with pioneer DOES occur

Try 3:
patching libata-core.c with the lines
/* PIONEER BD-RW BDR-207M and PIONEER BD-RW BDR-205 have broken LPM
support */
{ "PIONEER BD-RW DVR-207M", NULL, ATA_HORKAGE_NOSETXFER |
ATA_HORKAGE_NOLPM },
{ "PIONEER BD-RW DVR-205", NULL, ATA_HORKAGE_NOSETXFER |
ATA_HORKAGE_NOLPM },

resulted in
link_power_management_policy still "med_power_with_dipm"
problem with pioneer DOES occur, additional error in log:
device offline error, dev sr0, sector 1365828 op 0x0:(READ) flags 0x0
phys_seg 1 prio class 0
(not sure if this is significant)'

Try 4:
unpatched libata-core.c
using boot kernel parameter "libata.force=1:nolpm"

resulted in
link_power_management_policy now "max_performance"
problem with pioneer DOES NOT occur
so libata.force=nolpm kernel parameter works, which might interest
Damien ;-)

Niklas, if you want to try other patches for this problem, I wouldbe
happy to be of assistance.

With kind regards,

Jaap Berkhout