Re: [PATCH v4 1/7] ata: libata-scsi: add atapi_max_lun module parameter
From: Phil Pemberton
Date: Tue May 12 2026 - 11:14:57 EST
On 12/05/2026 11:02, Niklas Cassel wrote:
On Tue, May 12, 2026 at 10:46:39AM +0900, Damien Le Moal wrote:
On 5/7/26 08:45, Phil Pemberton wrote:
Until now libata has hard-coded shost->max_lun = 1 for every ATA host,
so the SCSI layer never scans past LUN 0. This blocks support for
the small handful of multi-LUN ATAPI devices (Panasonic LF-1195C and
COMPAQ PD-1 PD/CD combos export CD on LUN 0 and PD on LUN 1; old
Nakamichi MJ-x.y CD changers expose one LUN per disc slot, up to 7).
Introduce a libata module parameter, atapi_max_lun, that controls the
upper bound of the per-host SCSI LUN scan. Default is 1, preserving
current behaviour exactly: out-of-the-box only LUN 0 is scanned.
Range is clamped to 1..ATAPI_MAX_LUN (8, the SCSI-2 ceiling).
Subsequent patches gate actual LUN>0 probing on BLIST_FORCELUN, so a
device must both be on the SCSI device list (or carry the appropriate
quirk) and run on a host whose atapi_max_lun has been raised before
any extra LUNs are scanned.
Reviewed-by: Hannes Reinecke <hare@xxxxxxx>
Signed-off-by: Phil Pemberton <philpem@xxxxxxxxxxxxx>
Looks good, but this does not apply to libata tree for-7.2 / for-next branch.
What is this based on ? Please rebase and resend as I would like to run some tests.
Tip:
When using "git format-patch" you can specify --base <SHA1> and
then the base SHA1 will be added at the end of the cover-letter.
Thanks for the tip Niklas, I'll do that on the next round.
This is the base for the patch set:
commit 3036cd0d3328220a1858b1ab390be8b562774e8a
Merge: 86782c16a81f 105c42566a55
Author: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Date: Tue Apr 7 10:33:49 2026 -0700
Merge tag 'ata-7.0-final' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux
Pull ata fix from Niklas Cassel:
I'm just rebasing it onto for-7.2/for-next and will send shortly.
Damien: Thanks for the offer to test.
Thanks.
--
Phil.
philpem@xxxxxxxxxxxxx
https://www.philpem.me.uk/