From: bugzilla-daemon@bugzilla.kernel.org
To: linux-scsi@vger.kernel.org
Subject: [Bug 213759] CD tray ejected on hibernate resume
Date: Mon, 26 Jul 2021 11:01:30 +0000 [thread overview]
Message-ID: <bug-213759-11613-4mUxXwP1fp@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-213759-11613@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=213759
--- Comment #7 from limanyi@uniontech.com (limanyi@uniontech.com) ---
1. modify the file /lib/udev/rules.d/60-cdrom_id.rules:
-ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode",
GOTO="cdrom_end"
+#ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $devnode",
GOTO="cdrom_end"
2. systemctl restart udev.service
I find that CD tray isn`t ejected on resume. I think that the kernel should not
send 'DISK_EVENT_EJECT_REQUEST' when media event code is 3.
This patch solves this problem:
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index 94c254e9012e..a6d3ac0a6cbc 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -221,7 +221,7 @@ static unsigned int sr_get_events(struct scsi_device *sdev)
else if (med->media_event_code == 2)
return DISK_EVENT_MEDIA_CHANGE;
else if (med->media_event_code == 3)
- return DISK_EVENT_EJECT_REQUEST;
+ return DISK_EVENT_MEDIA_CHANGE;
return 0;
}
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are on the CC list for the bug.
You are watching the assignee of the bug.
next prev parent reply other threads:[~2021-07-26 11:01 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-16 22:37 [Bug 213759] New: CD tray ejected on hibernate resume bugzilla-daemon
2021-07-16 22:38 ` [Bug 213759] " bugzilla-daemon
2021-07-17 21:58 ` bugzilla-daemon
2021-07-20 3:58 ` bugzilla-daemon
2021-07-20 5:24 ` bugzilla-daemon
2021-07-23 15:51 ` bugzilla-daemon
2021-07-24 9:42 ` bugzilla-daemon
2021-07-24 10:31 ` bugzilla-daemon
2021-07-26 11:01 ` bugzilla-daemon [this message]
2021-07-27 14:55 ` bugzilla-daemon
2021-08-25 5:34 ` bugzilla-daemon
2021-08-28 22:40 ` bugzilla-daemon
2021-09-15 3:55 ` bugzilla-daemon
2021-09-22 18:27 ` bugzilla-daemon
2021-10-15 17:59 ` bugzilla-daemon
2024-07-07 13:55 ` bugzilla-daemon
2024-09-02 8:48 ` bugzilla-daemon
2025-01-05 6:32 ` bugzilla-daemon
2025-03-26 6:26 ` bugzilla-daemon
2025-05-08 6:03 ` bugzilla-daemon
2025-07-13 7:28 ` bugzilla-daemon
2025-07-20 13:11 ` bugzilla-daemon
2025-08-11 7:38 ` bugzilla-daemon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-213759-11613-4mUxXwP1fp@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@bugzilla.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).