From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2CCB3413D64 for ; Fri, 15 May 2026 19:52:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778874737; cv=none; b=tuYvxlG082BaaGHgxrY/O1JV1MnmJFz7NkEYD3ozc5A2fm02YaLOuUqWv6yu/MbiCuvE8yvTBoihMh5oJrRyOBwqESvtvT8uoSbmKID1KpfbCuYXNVGL7X2bFt0KMc20cpixyeiJtLySrj3hNlvj6roazGa4l6ZVWhzsSx1p8Lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778874737; c=relaxed/simple; bh=67v01lutIIJe+loL2irKpXHgU9bSneJunpWke2ocJ0g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=k0Z6e8uvXSvwRmI9rb51bgZOttjDJq9k+ivHzKllo0M3XjTjDiQyuvVlaqrm0PJSs9sMox3PuxJMrCRgRWS4bp1qftaFmu89gbOUET4zHHQsxg9IfPSYy66Vx7dLhIX8YDtVM9PB4yZS71xNkdPrLquY550rCixHQYv/L1pw1Kc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=sQA0OLMk; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sQA0OLMk" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4891d7164ddso956135e9.3 for ; Fri, 15 May 2026 12:52:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1778874735; x=1779479535; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=HQgTHiwAaq/3ufGCYEG/RW9Unijgsix8K9ENtTZJ2vY=; b=sQA0OLMkAN4BtVywQZvMFpqkEe4TMHbX5zG/lujd9MurEoL58GVy5cjgLZYhUWVPV9 G5RzTz/HvfBUJunKCA+zoHFF3JGk06QuWRMNka8PF2LaPvXEQrgv6rU/cakmxTTnJkQU d/HDWkXoJtAsuPKYtY6OBEskAWMGn/QFwX7TfevrslIQPbuAvSzwzfxf0xdpmQwEunoX G0dNuXAzAwOAV0aKoSQ/E1wnm86oE5gmJCq4CLNydXaJdxsnyTOTjQjA4rEZzkbOb/xy 96iQhfZCORUebArz4um3txJEj3ZKGmBUE3Qzs9QoFHmS03JCQjQ4lvsTmVOEGhIcdo4K /qcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1778874735; x=1779479535; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=HQgTHiwAaq/3ufGCYEG/RW9Unijgsix8K9ENtTZJ2vY=; b=lcbYBAhdK0faoK8tcTE5ky9W/lGmqpF5iXMC81pVzDHfdEwaK+1n6PBH5RBjd2SXDJ yI9Rm83sLVJQe3+abJ5z599DiYbGgSCPvt6sQ3Pm4Ypc+PkzLxq9KS/c7lY3iLi2gDia 4g+KMPdf6KACVjXV6aWSnvwZxA0fuo+xL92hQ0zEpjM7fiO33aIrwFYCeFDhLP2BVkkl +ensYRtF1nakQcGhSVzt9kz0JtjqpYX74a6q4o9GJT2sFWREENEJuTKaHq+xMqyJp18Y Y4lz2tiwegu3mtCJGjNytuThW8eMdptPCfOAYsDPbNKM+xtkF0s62YEKMbnj/n7a2VyC 8suw== X-Gm-Message-State: AOJu0YyYXPrHBu/W+IZ+enHb9+Og67g/O64vYJhdVrXVpLo6wlBUOFtO IW4ebq9z+2Day82DTkNMfbYJZhB2s1WqrsqFRB93hoostibVDx3GGgM= X-Gm-Gg: Acq92OF5J/X9YGMLWQBNWqRjOpXMlU9WswtN1PA0ZZK5QlrdodrjTGANyMDWF98GT6n PcfXyPNVxJrW2iqiz5m6reVZ+ortWO8vgtEn3iIKCza3a1XUDrnjhkVedFHvpE0eGX87o2ovC6H lf90VHIuttR1wTrmCEuBjQ4qolqHksrOupo/cZLjabQuwT7RPhb+SVFcpMM2+oalp6JS4ALGlrR oNXkjwpLLi0fgb3K96+z57ko3YhQ9V6vxwW05VJ6/YoXTxL1BzBKe1IjICDcSen0ZirzGoeea8e JNVCW6nYhZTpqKXtY1totd0+2DQ+5G8iP3mCk1isV2vfkDDBWT3VBBGMqD9023ebJGEoPzzcymD f1e3eAABJrimxLv3JTGeu/Dd52CmA43rAdkRq9BWp0x5C/lvRpeman/z41yPBKeFV4XZGNqrM8g 3EGzyhnayZ3wGvwCNwwVPvQEIfKmzFJSS8jEdSJnD+5GidksW436nMXgm+FKMcRcmmAvfhiZ4kn fswCus= X-Received: by 2002:a05:600c:1389:b0:48f:de4e:882b with SMTP id 5b1f17b1804b1-48fe60e524dmr74553605e9.6.1778874734409; Fri, 15 May 2026 12:52:14 -0700 (PDT) Received: from localhost ([2a02:810d:4a94:b300:fb24:41ce:1d7:fad9]) by smtp.gmail.com with UTF8SMTPSA id 5b1f17b1804b1-48feaf14d22sm31388355e9.3.2026.05.15.12.52.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2026 12:52:14 -0700 (PDT) From: Florian Fuchs To: linux-sh@vger.kernel.org, John Paul Adrian Glaubitz , Artur Rojek Cc: linux-kernel@vger.kernel.org, Florian Fuchs , Adrian McMenamin Subject: [PATCH v4 0/3] cdrom: gdrom: fix block I/O and capacity setting Date: Fri, 15 May 2026 21:51:08 +0200 Message-ID: <20260515195111.3295031-1-fuchsfl@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Hi all, This series fixes a gdrom driver Oops due to bad MMIO register access and fixes the missing updates of the block layer gendisk capacity that prevented ISO9660 mounts from working. It fixes also the case of disc swapping by sending the Test Unit command prior to cdrom_open(). The change was tested on real Sega Dreamcast devices (PAL-E, NTSC-J, NTSC-U) with physical CD-R discs and with GDEMU emulated discs. Before: Oops on mount and an unusable drive. After: Successfully able to mount and use the inserted medium. Thanks, Florian --- v3->v4: Simplified condition in "cdrom: gdrom: update gendisk capacity on open" according to review feedback. Sort trailers correctly. v2->v3: Added patch "cdrom: gdrom: verify device access after disc swap" from Artur Rojek to also handle the disc swap case reliably. And added Acked-by, Reviewed-by from v2 to the respective patches. Also handle the GDROM case in gdrom_update_capacity(). v1->v2: for "cdrom: gdrom: replace port I/O with MMIO accessors": Don't use helper functions with io.*_rep(), but writesw() and readsw() local in the respective functions. Improved failure case of gdrom_update_capacity() in gdrom_bdops_open(). v3: https://lore.kernel.org/linux-sh/20260423194132.693271-1-fuchsfl@gmail.com/ v2: https://lore.kernel.org/linux-sh/20260419162823.2829286-1-fuchsfl@gmail.com/ v1: https://lore.kernel.org/linux-sh/20260405082330.4104672-1-fuchsfl@gmail.com/ Artur Rojek (1): cdrom: gdrom: verify device access after disc swap Florian Fuchs (2): cdrom: gdrom: replace port I/O with MMIO accessors cdrom: gdrom: update gendisk capacity on open drivers/cdrom/gdrom.c | 61 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 4 deletions(-) base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f -- 2.43.0