[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220427090906.2257940-1-jinxiaobo@uniontech.com>
Date: Wed, 27 Apr 2022 17:09:06 +0800
From: jinxiaobo <jinxiaobo@...ontech.com>
To: jejb@...ux.ibm.com, martin.petersen@...cle.com
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
jinxiaobo <jinxiaobo@...ontech.com>
Subject: [PATCH] scsi: sr: Fix some cdroms automatically ejected when booting into the system
sr_get_events() has been called before udev starts when SCSI CDROM is
built-in and AHCI SATA is bulit-in,so sr events propagated to
user space are not handled.
if both is loadable, udev will handle sr events, some cdroms may eject.
We need call sr_get_events() once before device_add_disk()
to keep the same result, whether both are built-in or loadable.
Signed-off-by: jinxiaobo <jinxiaobo@...ontech.com>
---
drivers/scsi/sr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index cbd92891a762..043b3ab72d7a 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -676,6 +676,7 @@ static int sr_probe(struct device *dev)
set_capacity(disk, cd->capacity);
disk->private_data = cd;
+ sr_get_events(sdev);
if (register_cdrom(disk, &cd->cdi))
goto fail_minor;
--
2.20.1
Powered by blists - more mailing lists