kernel/kernel-std/debian/patches/0016-Revert-commit-f049cf1a7b.patch
Li Zhou 998d337c2b Debian: porting kernel commits from centos
To keep kernel debian stx aligned with centos stx, porting below commits
from centos stx to debian stx:
(1)patches related
   ef3c9a4 kernel: Add auxiliary bus support
   19ca0df kernel: Backport IRQ affinity patches
   a10b746 workqueue affinity: Remove unused variable
   8fde1a8 kthread_cpus: Avoid large stack allocation
   bb6ec66 scsi: Make the disk detection order more consistent
   bf940a8 rcu: Avoid RCU-related unexpected reboot
   cfe452a workqueue: Affine rescuer threads and unbound wqs
(2)config related
   6fe8d60 kernel: Disable NVMe multi-path kconfig option
   c9cdb90 Fixup recent kconfig cleanup
   8551799 Resolve v5.10 kernel configuration file differences
(3)kernel-modules related
   7ded004 kernel-modules: IRQ affinity hint fix-ups

Please pay attention to:
[ef3c9a4 kernel: Add auxiliary bus support]
which is not only related with kernel patches but also related with
kernel-modules.
It removes the auxiliary.ko from the oot ice package because auxiliary
bus device driver is built into kernel. But the detecting of builtin
auxiliary driver in intel-iavf/intel-ice oot driver will fail because
debian has 2 linux header packages. So extra patches are added for
intel-iavf and intel-ice to pass linux common header to check_aux_bus
to make builtin auxiliary driver detected. At the same time the patch
[check_aux_bus: Look for kernel headers in the right location]
for the oot drivers is removed because it isn't needed any more if
the right header path is passed.

Test Plan:
 - PASS: Build kernel-std/kernel-rt.
 - PASS: Build the 7 oot kernel modules for kernel-std/kernel-rt.
 - PASS: Build the iso for kernel-std and modules and boot up on qemu.
 - PASS: Build the test iso for kernel-rt and modules and boot up
         on qemu.

Story: 2009221
Task: 44989
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Change-Id: Ic7cddc068eab1516800e90bfe431d042274f86d3
2022-04-14 21:33:05 -04:00

136 lines
4.3 KiB
Diff

From b5dad6e67f9704968ca7d4daf1715667cddafa3d Mon Sep 17 00:00:00 2001
From: Jiping Ma <jiping.ma2@windriver.com>
Date: Wed, 8 Dec 2021 18:34:59 -0800
Subject: [PATCH 2/2] Revert commit f049cf1a7b
commit f049cf1a7b "scsi: sd: Rely on the driver core for asynchronous
probing"
This reverts commit f049cf1a7b6737c75884247c3f6383ef104d255a,
and it is a clean revert, there is not any conflict.
Signed-off-by: M. Vefa Bicakci <vefa.bicakci@windriver.com>
Signed-off-by: Jiping Ma <jiping.ma2@windriver.com>
---
drivers/scsi/scsi.c | 12 +++++++++---
drivers/scsi/scsi_pm.c | 6 +++++-
drivers/scsi/scsi_priv.h | 1 +
drivers/scsi/sd.c | 12 +++++++++---
4 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 24619c3bebd5..3080292a16cd 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -86,10 +86,15 @@ unsigned int scsi_logging_level;
EXPORT_SYMBOL(scsi_logging_level);
#endif
+/* sd, scsi core and power management need to coordinate flushing async actions */
+ASYNC_DOMAIN(scsi_sd_probe_domain);
+EXPORT_SYMBOL(scsi_sd_probe_domain);
+
/*
- * Domain for asynchronous system resume operations. It is marked 'exclusive'
- * to avoid being included in the async_synchronize_full() that is invoked by
- * dpm_resume().
+ * Separate domain (from scsi_sd_probe_domain) to maximize the benefit of
+ * asynchronous system resume operations. It is marked 'exclusive' to avoid
+ * being included in the async_synchronize_full() that is invoked by
+ * dpm_resume()
*/
ASYNC_DOMAIN_EXCLUSIVE(scsi_sd_pm_domain);
EXPORT_SYMBOL(scsi_sd_pm_domain);
@@ -799,6 +804,7 @@ static void __exit exit_scsi(void)
scsi_exit_devinfo();
scsi_exit_procfs();
scsi_exit_queue();
+ async_unregister_domain(&scsi_sd_probe_domain);
}
subsys_initcall(init_scsi);
diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
index 3717eea37ecb..b3d71b516213 100644
--- a/drivers/scsi/scsi_pm.c
+++ b/drivers/scsi/scsi_pm.c
@@ -175,7 +175,11 @@ static int scsi_bus_resume_common(struct device *dev,
static int scsi_bus_prepare(struct device *dev)
{
- if (scsi_is_host_device(dev)) {
+ if (scsi_is_sdev_device(dev)) {
+ /* sd probing uses async_schedule. Wait until it finishes. */
+ async_synchronize_full_domain(&scsi_sd_probe_domain);
+
+ } else if (scsi_is_host_device(dev)) {
/* Wait until async scanning is finished */
scsi_complete_async_scans();
}
diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
index 180636d54982..c43456f0870c 100644
--- a/drivers/scsi/scsi_priv.h
+++ b/drivers/scsi/scsi_priv.h
@@ -172,6 +172,7 @@ static inline void scsi_autopm_put_host(struct Scsi_Host *h) {}
#endif /* CONFIG_PM */
extern struct async_domain scsi_sd_pm_domain;
+extern struct async_domain scsi_sd_probe_domain;
/* scsi_dh.c */
#ifdef CONFIG_SCSI_DH
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 2e22ee4501e7..e6c70475f084 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -616,7 +616,6 @@ static struct scsi_driver sd_template = {
.name = "sd",
.owner = THIS_MODULE,
.probe = sd_probe,
- .probe_type = PROBE_PREFER_ASYNCHRONOUS,
.remove = sd_remove,
.shutdown = sd_shutdown,
.pm = &sd_pm_ops,
@@ -3364,8 +3363,12 @@ static int sd_format_disk_name(char *prefix, int index, char *buf, int buflen)
return 0;
}
-static void sd_probe_part2(struct scsi_disk *sdkp)
+/*
+ * The asynchronous part of sd_probe
+ */
+static void sd_probe_async(void *data, async_cookie_t cookie)
{
+ struct scsi_disk *sdkp = data;
struct scsi_device *sdp;
struct gendisk *gd;
u32 index;
@@ -3424,6 +3427,7 @@ static void sd_probe_part2(struct scsi_disk *sdkp)
sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n",
sdp->removable ? "removable " : "");
scsi_autopm_put_device(sdp);
+ put_device(&sdkp->dev);
}
/**
@@ -3517,7 +3521,8 @@ static int sd_probe(struct device *dev)
dev_set_drvdata(dev, sdkp);
- sd_probe_part2(sdkp);
+ get_device(&sdkp->dev); /* prevent release before async_schedule */
+ async_schedule_domain(sd_probe_async, sdkp, &scsi_sd_probe_domain);
return 0;
@@ -3554,6 +3559,7 @@ static int sd_remove(struct device *dev)
scsi_autopm_get_device(sdkp->device);
async_synchronize_full_domain(&scsi_sd_pm_domain);
+ async_synchronize_full_domain(&scsi_sd_probe_domain);
device_del(&sdkp->dev);
del_gendisk(sdkp->disk);
sd_shutdown(dev);
--
2.31.1