X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=kernel-small_fixes.patch;h=a611dd914ba254817d1e4b7cf85364f4b36f007b;hb=3b0ce957970d45f85692a6b314efc275d78825c5;hp=20d437763ad0951a9efb2738a4f9a5d8da8b18b4;hpb=e1bba219cb52f8e69e8d832ef6a255cefefed95c;p=packages%2Fkernel.git diff --git a/kernel-small_fixes.patch b/kernel-small_fixes.patch index 20d43776..a611dd91 100644 --- a/kernel-small_fixes.patch +++ b/kernel-small_fixes.patch @@ -1,673 +1,532 @@ ---- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100 -+++ linux-2.6.33/scripts/mod/modpost.c 2010-03-07 14:26:47.242168558 +0100 -@@ -15,7 +15,8 @@ - #include - #include - #include "modpost.h" --#include "../../include/generated/autoconf.h" -+// PLD architectures don't use CONFIG_SYMBOL_PREFIX -+//#include "../../include/generated/autoconf.h" - #include "../../include/linux/license.h" - - /* Some toolchains use a `_' prefix for all user symbols. */ +Nothing here for now, move along... +commit c695793b52216ad6a11ce952fc8d29f3a9d0c7cd +Author: Balsundar P +Date: Tue Oct 15 11:52:04 2019 +0530 ---- linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh~ 2011-07-22 04:17:23.000000000 +0200 -+++ linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh 2011-08-25 21:26:04.799150642 +0200 -@@ -9,6 +9,12 @@ - $cc -print-file-name=lib${lib}.${ext} | grep -q / - if [ $? -eq 0 ]; then - echo "-l${lib}" -+ for libt in tinfow tinfo ; do -+ $cc -print-file-name=lib${libt}.${ext} | grep -q / -+ if [ $? -eq 0 ]; then -+ echo "-l${libt}" -+ fi -+ done - exit - fi - done - -From 7a29ac474a47eb8cf212b45917683ae89d6fa13b Mon Sep 17 00:00:00 2001 -From: Chris Mason -Date: Tue, 10 Nov 2015 10:10:34 +1100 -Subject: xfs: give all workqueues rescuer threads - -We're consistently hitting deadlocks here with XFS on recent kernels. -After some digging through the crash files, it looks like everyone in -the system is waiting for XFS to reclaim memory. - -Something like this: - -PID: 2733434 TASK: ffff8808cd242800 CPU: 19 COMMAND: "java" - #0 [ffff880019c53588] __schedule at ffffffff818c4df2 - #1 [ffff880019c535d8] schedule at ffffffff818c5517 - #2 [ffff880019c535f8] _xfs_log_force_lsn at ffffffff81316348 - #3 [ffff880019c53688] xfs_log_force_lsn at ffffffff813164fb - #4 [ffff880019c536b8] xfs_iunpin_wait at ffffffff8130835e - #5 [ffff880019c53728] xfs_reclaim_inode at ffffffff812fd453 - #6 [ffff880019c53778] xfs_reclaim_inodes_ag at ffffffff812fd8c7 - #7 [ffff880019c53928] xfs_reclaim_inodes_nr at ffffffff812fe433 - #8 [ffff880019c53958] xfs_fs_free_cached_objects at ffffffff8130d3b9 - #9 [ffff880019c53968] super_cache_scan at ffffffff811a6f73 -#10 [ffff880019c539c8] shrink_slab at ffffffff811460e6 -#11 [ffff880019c53aa8] shrink_zone at ffffffff8114a53f -#12 [ffff880019c53b48] do_try_to_free_pages at ffffffff8114a8ba -#13 [ffff880019c53be8] try_to_free_pages at ffffffff8114ad5a -#14 [ffff880019c53c78] __alloc_pages_nodemask at ffffffff8113e1b8 -#15 [ffff880019c53d88] alloc_kmem_pages_node at ffffffff8113e671 -#16 [ffff880019c53dd8] copy_process at ffffffff8104f781 -#17 [ffff880019c53ec8] do_fork at ffffffff8105129c -#18 [ffff880019c53f38] sys_clone at ffffffff810515b6 -#19 [ffff880019c53f48] stub_clone at ffffffff818c8e4d - -xfs_log_force_lsn is waiting for logs to get cleaned, which is waiting -for IO, which is waiting for workers to complete the IO which is waiting -for worker threads that don't exist yet: - -PID: 2752451 TASK: ffff880bd6bdda00 CPU: 37 COMMAND: "kworker/37:1" - #0 [ffff8808d20abbb0] __schedule at ffffffff818c4df2 - #1 [ffff8808d20abc00] schedule at ffffffff818c5517 - #2 [ffff8808d20abc20] schedule_timeout at ffffffff818c7c6c - #3 [ffff8808d20abcc0] wait_for_completion_killable at ffffffff818c6495 - #4 [ffff8808d20abd30] kthread_create_on_node at ffffffff8106ec82 - #5 [ffff8808d20abdf0] create_worker at ffffffff8106752f - #6 [ffff8808d20abe40] worker_thread at ffffffff810699be - #7 [ffff8808d20abec0] kthread at ffffffff8106ef59 - #8 [ffff8808d20abf50] ret_from_fork at ffffffff818c8ac8 - -I think we should be using WQ_MEM_RECLAIM to make sure this thread -pool makes progress when we're not able to allocate new workers. - -[dchinner: make all workqueues WQ_MEM_RECLAIM] - -Signed-off-by: Chris Mason -Reviewed-by: Dave Chinner -Signed-off-by: Dave Chinner ---- - fs/xfs/xfs_super.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) + scsi: aacraid: bump version + + Bump version to 50877. + + Link: https://lore.kernel.org/r/1571120524-6037-8-git-send-email-balsundar.p@microsemi.com + Signed-off-by: Balsundar P + Signed-off-by: Martin K. Petersen -diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c -index 29531ec..65fbfb7 100644 ---- a/fs/xfs/xfs_super.c -+++ b/fs/xfs/xfs_super.c -@@ -838,17 +838,18 @@ xfs_init_mount_workqueues( - goto out_destroy_unwritten; - - mp->m_reclaim_workqueue = alloc_workqueue("xfs-reclaim/%s", -- WQ_FREEZABLE, 0, mp->m_fsname); -+ WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); - if (!mp->m_reclaim_workqueue) - goto out_destroy_cil; - - mp->m_log_workqueue = alloc_workqueue("xfs-log/%s", -- WQ_FREEZABLE|WQ_HIGHPRI, 0, mp->m_fsname); -+ WQ_MEM_RECLAIM|WQ_FREEZABLE|WQ_HIGHPRI, 0, -+ mp->m_fsname); - if (!mp->m_log_workqueue) - goto out_destroy_reclaim; - - mp->m_eofblocks_workqueue = alloc_workqueue("xfs-eofblocks/%s", -- WQ_FREEZABLE, 0, mp->m_fsname); -+ WQ_MEM_RECLAIM|WQ_FREEZABLE, 0, mp->m_fsname); - if (!mp->m_eofblocks_workqueue) - goto out_destroy_log; - --- -cgit v0.11.2 +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index 17a4e8b8bd00..e3e4ecbea726 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -85,7 +85,7 @@ enum { + #define PMC_GLOBAL_INT_BIT0 0x00000001 + + #ifndef AAC_DRIVER_BUILD +-# define AAC_DRIVER_BUILD 50877 ++# define AAC_DRIVER_BUILD 50983 + # define AAC_DRIVER_BRANCH "-custom" + #endif + #define MAXIMUM_NUM_CONTAINERS 32 -commit c2d42c16ad83006a706d83e51a7268db04af733a -Author: Andrew Morton -Date: Thu Nov 5 18:48:43 2015 -0800 +commit 26c54d0ec25c186329d845ad1beb9d3dde586af9 +Author: Balsundar P +Date: Tue Oct 15 11:52:03 2019 +0530 - mm/vmstat.c: uninline node_page_state() + scsi: aacraid: send AIF request post IOP RESET - With x86_64 (config http://ozlabs.org/~akpm/config-akpm2.txt) and old gcc - (4.4.4), drivers/base/node.c:node_read_meminfo() is using 2344 bytes of - stack. Uninlining node_page_state() reduces this to 440 bytes. + After IOP reset completion, AIF request command is not issued to the + controller. Driver schedules a worker thread to issue a AIF request command + after IOP reset completion. - The stack consumption issue is fixed by newer gcc (4.8.4) however with - that compiler this patch reduces the node.o text size from 7314 bytes to - 4578. + [mkp: fix zeroday warning] - Signed-off-by: Andrew Morton - Signed-off-by: Linus Torvalds + Link: https://lore.kernel.org/r/1571120524-6037-7-git-send-email-balsundar.p@microsemi.com + Acked-by: Balsundar P < Balsundar.P@microchip.com> + Signed-off-by: Balsundar P + Signed-off-by: Martin K. Petersen -diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h -index 82e7db7..49dfe40 100644 ---- a/include/linux/vmstat.h -+++ b/include/linux/vmstat.h -@@ -161,30 +161,8 @@ static inline unsigned long zone_page_state_snapshot(struct zone *zone, +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index f76a33cb0259..17a4e8b8bd00 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -1330,7 +1330,7 @@ struct fib { + #define AAC_DEVTYPE_ARC_RAW 2 + #define AAC_DEVTYPE_NATIVE_RAW 3 + +-#define AAC_SAFW_RESCAN_DELAY (10 * HZ) ++#define AAC_RESCAN_DELAY (10 * HZ) + + struct aac_hba_map_info { + __le32 rmw_nexus; /* nexus for native HBA devices */ +@@ -1603,6 +1603,7 @@ struct aac_dev + struct fsa_dev_info *fsa_dev; + struct task_struct *thread; + struct delayed_work safw_rescan_work; ++ struct delayed_work src_reinit_aif_worker; + int cardtype; + /* + *This lock will protect the two 32-bit +@@ -2647,7 +2648,12 @@ int aac_scan_host(struct aac_dev *dev); + + static inline void aac_schedule_safw_scan_worker(struct aac_dev *dev) + { +- schedule_delayed_work(&dev->safw_rescan_work, AAC_SAFW_RESCAN_DELAY); ++ schedule_delayed_work(&dev->safw_rescan_work, AAC_RESCAN_DELAY); ++} ++ ++static inline void aac_schedule_src_reinit_aif_worker(struct aac_dev *dev) ++{ ++ schedule_delayed_work(&dev->src_reinit_aif_worker, AAC_RESCAN_DELAY); } - #ifdef CONFIG_NUMA --/* -- * Determine the per node value of a stat item. This function -- * is called frequently in a NUMA machine, so try to be as -- * frugal as possible. -- */ --static inline unsigned long node_page_state(int node, -- enum zone_stat_item item) --{ -- struct zone *zones = NODE_DATA(node)->node_zones; -- -- return --#ifdef CONFIG_ZONE_DMA -- zone_page_state(&zones[ZONE_DMA], item) + --#endif --#ifdef CONFIG_ZONE_DMA32 -- zone_page_state(&zones[ZONE_DMA32], item) + --#endif --#ifdef CONFIG_HIGHMEM -- zone_page_state(&zones[ZONE_HIGHMEM], item) + --#endif -- zone_page_state(&zones[ZONE_NORMAL], item) + -- zone_page_state(&zones[ZONE_MOVABLE], item); --} + static inline void aac_safw_rescan_worker(struct work_struct *work) +@@ -2661,10 +2667,10 @@ static inline void aac_safw_rescan_worker(struct work_struct *work) + aac_scan_host(dev); + } + +-static inline void aac_cancel_safw_rescan_worker(struct aac_dev *dev) ++static inline void aac_cancel_rescan_worker(struct aac_dev *dev) + { +- if (dev->sa_firmware) +- cancel_delayed_work_sync(&dev->safw_rescan_work); ++ cancel_delayed_work_sync(&dev->safw_rescan_work); ++ cancel_delayed_work_sync(&dev->src_reinit_aif_worker); + } + + /* SCp.phase values */ +@@ -2674,6 +2680,7 @@ static inline void aac_cancel_safw_rescan_worker(struct aac_dev *dev) + #define AAC_OWNER_FIRMWARE 0x106 + + void aac_safw_rescan_worker(struct work_struct *work); ++void aac_src_reinit_aif_worker(struct work_struct *work); + int aac_acquire_irq(struct aac_dev *dev); + void aac_free_irq(struct aac_dev *dev); + int aac_setup_safw_adapter(struct aac_dev *dev); +@@ -2731,6 +2738,7 @@ int aac_probe_container(struct aac_dev *dev, int cid); + int _aac_rx_init(struct aac_dev *dev); + int aac_rx_select_comm(struct aac_dev *dev, int comm); + int aac_rx_deliver_producer(struct fib * fib); ++void aac_reinit_aif(struct aac_dev *aac, unsigned int index); + + static inline int aac_is_src(struct aac_dev *dev) + { +diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c +index 3f268f669cc3..5a8a999606ea 100644 +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -1464,6 +1464,14 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) + } + } + ++static void aac_schedule_bus_scan(struct aac_dev *aac) ++{ ++ if (aac->sa_firmware) ++ aac_schedule_safw_scan_worker(aac); ++ else ++ aac_schedule_src_reinit_aif_worker(aac); ++} ++ + static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) + { + int index, quirks; +@@ -1639,7 +1647,7 @@ static int _aac_reset_adapter(struct aac_dev *aac, int forced, u8 reset_type) + */ + if (!retval && !is_kdump_kernel()) { + dev_info(&aac->pdev->dev, "Scheduling bus rescan\n"); +- aac_schedule_safw_scan_worker(aac); ++ aac_schedule_bus_scan(aac); + } -+extern unsigned long node_page_state(int node, enum zone_stat_item item); - extern void zone_statistics(struct zone *, struct zone *, gfp_t gfp); - - #else -diff --git a/mm/vmstat.c b/mm/vmstat.c -index fbf1448..ffcb4f5 100644 ---- a/mm/vmstat.c -+++ b/mm/vmstat.c -@@ -591,6 +591,28 @@ void zone_statistics(struct zone *preferred_zone, struct zone *z, gfp_t flags) - else - __inc_zone_state(z, NUMA_OTHER); + if (jafo) { +@@ -1960,6 +1968,16 @@ int aac_scan_host(struct aac_dev *dev) + return rcode; } + ++void aac_src_reinit_aif_worker(struct work_struct *work) ++{ ++ struct aac_dev *dev = container_of(to_delayed_work(work), ++ struct aac_dev, src_reinit_aif_worker); + -+/* -+ * Determine the per node value of a stat item. -+ */ -+unsigned long node_page_state(int node, enum zone_stat_item item) ++ wait_event(dev->scsi_host_ptr->host_wait, ++ !scsi_host_in_recovery(dev->scsi_host_ptr)); ++ aac_reinit_aif(dev, dev->cardtype); ++} ++ + /** + * aac_handle_sa_aif Handle a message from the firmware + * @dev: Which adapter this fib is from +diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c +index 55a55c56fea9..ee6bc2f9b80a 100644 +--- a/drivers/scsi/aacraid/linit.c ++++ b/drivers/scsi/aacraid/linit.c +@@ -1593,6 +1593,19 @@ static void aac_init_char(void) + } + } + ++void aac_reinit_aif(struct aac_dev *aac, unsigned int index) +{ -+ struct zone *zones = NODE_DATA(node)->node_zones; ++ /* ++ * Firmware may send a AIF messages very early and the Driver may have ++ * ignored as it is not fully ready to process the messages. Send ++ * AIF to firmware so that if there are any unprocessed events they ++ * can be processed now. ++ */ ++ if (aac_drivers[index].quirks & AAC_QUIRK_SRC) ++ aac_intr_normal(aac, 0, 2, 0, NULL); + -+ return -+#ifdef CONFIG_ZONE_DMA -+ zone_page_state(&zones[ZONE_DMA], item) + -+#endif -+#ifdef CONFIG_ZONE_DMA32 -+ zone_page_state(&zones[ZONE_DMA32], item) + -+#endif -+#ifdef CONFIG_HIGHMEM -+ zone_page_state(&zones[ZONE_HIGHMEM], item) + -+#endif -+ zone_page_state(&zones[ZONE_NORMAL], item) + -+ zone_page_state(&zones[ZONE_MOVABLE], item); +} + - #endif + static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) + { + unsigned index = id->driver_data; +@@ -1690,6 +1703,8 @@ static int aac_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) + mutex_init(&aac->scan_mutex); + + INIT_DELAYED_WORK(&aac->safw_rescan_work, aac_safw_rescan_worker); ++ INIT_DELAYED_WORK(&aac->src_reinit_aif_worker, ++ aac_src_reinit_aif_worker); + /* + * Map in the registers from the adapter. + */ +@@ -1880,7 +1895,7 @@ static int aac_suspend(struct pci_dev *pdev, pm_message_t state) + struct aac_dev *aac = (struct aac_dev *)shost->hostdata; + + scsi_block_requests(shost); +- aac_cancel_safw_rescan_worker(aac); ++ aac_cancel_rescan_worker(aac); + aac_send_shutdown(aac); + + aac_release_resources(aac); +@@ -1939,7 +1954,7 @@ static void aac_remove_one(struct pci_dev *pdev) + struct Scsi_Host *shost = pci_get_drvdata(pdev); + struct aac_dev *aac = (struct aac_dev *)shost->hostdata; + +- aac_cancel_safw_rescan_worker(aac); ++ aac_cancel_rescan_worker(aac); + scsi_remove_host(shost); + + __aac_shutdown(aac); +@@ -1997,7 +2012,7 @@ static pci_ers_result_t aac_pci_error_detected(struct pci_dev *pdev, + aac->handle_pci_error = 1; + + scsi_block_requests(aac->scsi_host_ptr); +- aac_cancel_safw_rescan_worker(aac); ++ aac_cancel_rescan_worker(aac); + aac_flush_ios(aac); + aac_release_resources(aac); - #ifdef CONFIG_COMPACTION -commit 016c13daa5c9e4827eca703e2f0621c131f2cca3 -Author: Mel Gorman -Date: Fri Nov 6 16:28:18 2015 -0800 - mm, page_alloc: use masks and shifts when converting GFP flags to migrate types +commit 572ee53a9badf62f3973d66f6475f9ce69720a25 +Author: Balsundar P +Date: Tue Oct 15 11:52:02 2019 +0530 + + scsi: aacraid: check adapter health + + Currently driver waits for the command IOCTL from the firmware and if the + firmware enters nonresponsive state, the driver doesn't respond till the + firmware is responsive again. - This patch redefines which GFP bits are used for specifying mobility and - the order of the migrate types. Once redefined it's possible to convert - GFP flags to a migrate type with a simple mask and shift. The only - downside is that readers of OOM kill messages and allocation failures may - have been used to the existing values but scripts/gfp-translate will help. + Check that firmware is alive, otherwise return -EBUSY. - Signed-off-by: Mel Gorman - Acked-by: Vlastimil Babka - Cc: Christoph Lameter - Cc: David Rientjes - Cc: Johannes Weiner - Cc: Michal Hocko - Cc: Vitaly Wool - Cc: Rik van Riel - Signed-off-by: Andrew Morton - Signed-off-by: Linus Torvalds + [mkp: clarified commit desc] + + Link: https://lore.kernel.org/r/1571120524-6037-6-git-send-email-balsundar.p@microsemi.com + Signed-off-by: Balsundar P + Signed-off-by: Martin K. Petersen -diff --git a/include/linux/gfp.h b/include/linux/gfp.h -index f92cbd2..440fca3 100644 ---- a/include/linux/gfp.h -+++ b/include/linux/gfp.h -@@ -14,7 +14,7 @@ struct vm_area_struct; - #define ___GFP_HIGHMEM 0x02u - #define ___GFP_DMA32 0x04u - #define ___GFP_MOVABLE 0x08u --#define ___GFP_WAIT 0x10u -+#define ___GFP_RECLAIMABLE 0x10u - #define ___GFP_HIGH 0x20u - #define ___GFP_IO 0x40u - #define ___GFP_FS 0x80u -@@ -29,7 +29,7 @@ struct vm_area_struct; - #define ___GFP_NOMEMALLOC 0x10000u - #define ___GFP_HARDWALL 0x20000u - #define ___GFP_THISNODE 0x40000u --#define ___GFP_RECLAIMABLE 0x80000u -+#define ___GFP_WAIT 0x80000u - #define ___GFP_NOACCOUNT 0x100000u - #define ___GFP_NOTRACK 0x200000u - #define ___GFP_NO_KSWAPD 0x400000u -@@ -126,6 +126,7 @@ struct vm_area_struct; - - /* This mask makes up all the page movable related flags */ - #define GFP_MOVABLE_MASK (__GFP_RECLAIMABLE|__GFP_MOVABLE) -+#define GFP_MOVABLE_SHIFT 3 - - /* Control page allocator reclaim behavior */ - #define GFP_RECLAIM_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS|\ -@@ -152,14 +153,15 @@ struct vm_area_struct; - /* Convert GFP flags to their corresponding migrate type */ - static inline int gfpflags_to_migratetype(const gfp_t gfp_flags) +diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c +index 40f78509ca94..55a55c56fea9 100644 +--- a/drivers/scsi/aacraid/linit.c ++++ b/drivers/scsi/aacraid/linit.c +@@ -612,9 +612,13 @@ static struct device_attribute *aac_dev_attrs[] = { + static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd, + void __user *arg) { -- WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); -+ VM_WARN_ON((gfp_flags & GFP_MOVABLE_MASK) == GFP_MOVABLE_MASK); -+ BUILD_BUG_ON((1UL << GFP_MOVABLE_SHIFT) != ___GFP_MOVABLE); -+ BUILD_BUG_ON((___GFP_MOVABLE >> GFP_MOVABLE_SHIFT) != MIGRATE_MOVABLE); - - if (unlikely(page_group_by_mobility_disabled)) - return MIGRATE_UNMOVABLE; - - /* Group based on mobility */ -- return (((gfp_flags & __GFP_MOVABLE) != 0) << 1) | -- ((gfp_flags & __GFP_RECLAIMABLE) != 0); -+ return (gfp_flags & GFP_MOVABLE_MASK) >> GFP_MOVABLE_SHIFT; ++ int retval; + struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; + if (!capable(CAP_SYS_RAWIO)) + return -EPERM; ++ retval = aac_adapter_check_health(dev); ++ if (retval) ++ return -EBUSY; + return aac_do_ioctl(dev, cmd, arg); } - #ifdef CONFIG_HIGHMEM -diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h -index e326843..38bed71 100644 ---- a/include/linux/mmzone.h -+++ b/include/linux/mmzone.h -@@ -37,8 +37,8 @@ - - enum { - MIGRATE_UNMOVABLE, -- MIGRATE_RECLAIMABLE, - MIGRATE_MOVABLE, -+ MIGRATE_RECLAIMABLE, - MIGRATE_PCPTYPES, /* the number of types on the pcp lists */ - MIGRATE_RESERVE = MIGRATE_PCPTYPES, - #ifdef CONFIG_CMA -commit 974a786e63c96a2401a78ddba926f34c128474f1 -Author: Mel Gorman -Date: Fri Nov 6 16:28:34 2015 -0800 - mm, page_alloc: remove MIGRATE_RESERVE +commit e2fd90dd2ed87bdcfdfb640f06da48fd23efa080 +Author: Balsundar P +Date: Tue Oct 15 11:52:01 2019 +0530 + + scsi: aacraid: setting different timeout for src and thor - MIGRATE_RESERVE preserves an old property of the buddy allocator that - existed prior to fragmentation avoidance -- min_free_kbytes worth of pages - tended to remain contiguous until the only alternative was to fail the - allocation. At the time it was discovered that high-order atomic - allocations relied on this property so MIGRATE_RESERVE was introduced. A - later patch will introduce an alternative MIGRATE_HIGHATOMIC so this patch - deletes MIGRATE_RESERVE and supporting code so it'll be easier to review. - Note that this patch in isolation may look like a false regression if - someone was bisecting high-order atomic allocation failures. + Set 180 second timeout for thor and 60 seconds for src controllers. - Signed-off-by: Mel Gorman - Acked-by: Vlastimil Babka - Cc: Christoph Lameter - Cc: David Rientjes - Cc: Johannes Weiner - Cc: Michal Hocko - Cc: Vitaly Wool - Cc: Rik van Riel - Signed-off-by: Andrew Morton - Signed-off-by: Linus Torvalds + Link: https://lore.kernel.org/r/1571120524-6037-5-git-send-email-balsundar.p@microsemi.com + Signed-off-by: Balsundar P + Signed-off-by: Martin K. Petersen -diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h -index 1e88aae..b86cfa3 100644 ---- a/include/linux/mmzone.h -+++ b/include/linux/mmzone.h -@@ -39,8 +39,6 @@ enum { - MIGRATE_UNMOVABLE, - MIGRATE_MOVABLE, - MIGRATE_RECLAIMABLE, -- MIGRATE_PCPTYPES, /* the number of types on the pcp lists */ -- MIGRATE_RESERVE = MIGRATE_PCPTYPES, - #ifdef CONFIG_CMA - /* - * MIGRATE_CMA migration type is designed to mimic the way -@@ -63,6 +61,8 @@ enum { - MIGRATE_TYPES - }; - -+#define MIGRATE_PCPTYPES (MIGRATE_RECLAIMABLE+1) -+ - #ifdef CONFIG_CMA - # define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA) - #else -@@ -429,12 +429,6 @@ struct zone { - - const char *name; - -- /* -- * Number of MIGRATE_RESERVE page block. To maintain for just -- * optimization. Protected by zone->lock. -- */ -- int nr_migrate_reserve_block; -- - #ifdef CONFIG_MEMORY_ISOLATION - /* - * Number of isolated pageblock. It is used to solve incorrect -diff --git a/mm/huge_memory.c b/mm/huge_memory.c -index 9812d46..dabd247 100644 ---- a/mm/huge_memory.c -+++ b/mm/huge_memory.c -@@ -116,7 +116,7 @@ static void set_recommended_min_free_kbytes(void) - for_each_populated_zone(zone) - nr_zones++; - -- /* Make sure at least 2 hugepages are free for MIGRATE_RESERVE */ -+ /* Ensure 2 pageblocks are free to assist fragmentation avoidance */ - recommended_min = pageblock_nr_pages * nr_zones * 2; +diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c +index 2388143d59f5..e36608ce937a 100644 +--- a/drivers/scsi/aacraid/aachba.c ++++ b/drivers/scsi/aacraid/aachba.c +@@ -1477,6 +1477,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd + struct aac_srb * srbcmd; + u32 flag; + u32 timeout; ++ struct aac_dev *dev = fib->dev; + + aac_fib_init(fib); + switch(cmd->sc_data_direction){ +@@ -1503,7 +1504,7 @@ static struct aac_srb * aac_scsi_common(struct fib * fib, struct scsi_cmnd * cmd + srbcmd->flags = cpu_to_le32(flag); + timeout = cmd->request->timeout/HZ; + if (timeout == 0) +- timeout = 1; ++ timeout = (dev->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT); + srbcmd->timeout = cpu_to_le32(timeout); // timeout in seconds + srbcmd->retry_limit = 0; /* Obsolete parameter */ + srbcmd->cdb_size = cpu_to_le32(cmd->cmd_len); +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index 3fdd4583cbb5..f76a33cb0259 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -108,6 +108,8 @@ enum { + #define AAC_BUS_TARGET_LOOP (AAC_MAX_BUSES * AAC_MAX_TARGETS) + #define AAC_MAX_NATIVE_SIZE 2048 + #define FW_ERROR_BUFFER_SIZE 512 ++#define AAC_SA_TIMEOUT 180 ++#define AAC_ARC_TIMEOUT 60 + + #define get_bus_number(x) (x/AAC_MAX_TARGETS) + #define get_target_number(x) (x%AAC_MAX_TARGETS) +diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c +index 4a858789e6c5..40f78509ca94 100644 +--- a/drivers/scsi/aacraid/linit.c ++++ b/drivers/scsi/aacraid/linit.c +@@ -391,6 +391,7 @@ static int aac_slave_configure(struct scsi_device *sdev) + int chn, tid; + unsigned int depth = 0; + unsigned int set_timeout = 0; ++ int timeout = 0; + bool set_qd_dev_type = false; + u8 devtype = 0; + +@@ -483,10 +484,13 @@ static int aac_slave_configure(struct scsi_device *sdev) /* -diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 8dc6e3c..5888126 100644 ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -817,7 +817,6 @@ static void free_pcppages_bulk(struct zone *zone, int count, - if (unlikely(has_isolate_pageblock(zone))) - mt = get_pageblock_migratetype(page); - -- /* MIGRATE_MOVABLE list may include MIGRATE_RESERVEs */ - __free_one_page(page, page_to_pfn(page), zone, 0, mt); - trace_mm_page_pcpu_drain(page, 0, mt); - } while (--to_free && --batch_free && !list_empty(list)); -@@ -1417,15 +1416,14 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order, - * the free lists for the desirable migrate type are depleted - */ - static int fallbacks[MIGRATE_TYPES][4] = { -- [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE }, -- [MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE, MIGRATE_MOVABLE, MIGRATE_RESERVE }, -- [MIGRATE_MOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_RESERVE }, -+ [MIGRATE_UNMOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_MOVABLE, MIGRATE_TYPES }, -+ [MIGRATE_RECLAIMABLE] = { MIGRATE_UNMOVABLE, MIGRATE_MOVABLE, MIGRATE_TYPES }, -+ [MIGRATE_MOVABLE] = { MIGRATE_RECLAIMABLE, MIGRATE_UNMOVABLE, MIGRATE_TYPES }, - #ifdef CONFIG_CMA -- [MIGRATE_CMA] = { MIGRATE_RESERVE }, /* Never used */ -+ [MIGRATE_CMA] = { MIGRATE_TYPES }, /* Never used */ - #endif -- [MIGRATE_RESERVE] = { MIGRATE_RESERVE }, /* Never used */ - #ifdef CONFIG_MEMORY_ISOLATION -- [MIGRATE_ISOLATE] = { MIGRATE_RESERVE }, /* Never used */ -+ [MIGRATE_ISOLATE] = { MIGRATE_TYPES }, /* Never used */ - #endif + * Firmware has an individual device recovery time typically +- * of 35 seconds, give us a margin. ++ * of 35 seconds, give us a margin. Thor devices can take longer in ++ * error recovery, hence different value. + */ +- if (set_timeout && sdev->request_queue->rq_timeout < (45 * HZ)) +- blk_queue_rq_timeout(sdev->request_queue, 45*HZ); ++ if (set_timeout) { ++ timeout = aac->sa_firmware ? AAC_SA_TIMEOUT : AAC_ARC_TIMEOUT; ++ blk_queue_rq_timeout(sdev->request_queue, timeout * HZ); ++ } + + if (depth > 256) + depth = 256; + +commit c02a3342bad32baa9be201da39d3809b74f92239 +Author: Balsundar P +Date: Tue Oct 15 11:52:00 2019 +0530 + + scsi: aacraid: fixed firmware assert issue + + Before issuing IOP reset, INTX mode is selected. This is triggering MSGU + lockup and ended in basecode assert. Use DROP_IO command when IOP reset is + sent in preparation for interrupt mode switch. + + Link: https://lore.kernel.org/r/1571120524-6037-4-git-send-email-balsundar.p@microsemi.com + Signed-off-by: Balsundar P + Signed-off-by: Martin K. Petersen + +diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h +index 3fa03230f6ba..3fdd4583cbb5 100644 +--- a/drivers/scsi/aacraid/aacraid.h ++++ b/drivers/scsi/aacraid/aacraid.h +@@ -1673,6 +1673,7 @@ struct aac_dev + u8 adapter_shutdown; + u32 handle_pci_error; + bool init_reset; ++ u8 soft_reset_support; }; -@@ -1598,7 +1596,7 @@ int find_suitable_fallback(struct free_area *area, unsigned int order, - *can_steal = false; - for (i = 0;; i++) { - fallback_mt = fallbacks[migratetype][i]; -- if (fallback_mt == MIGRATE_RESERVE) -+ if (fallback_mt == MIGRATE_TYPES) - break; + #define aac_adapter_interrupt(dev) \ +diff --git a/drivers/scsi/aacraid/comminit.c b/drivers/scsi/aacraid/comminit.c +index d4fcfa1e54e0..f75878d773cf 100644 +--- a/drivers/scsi/aacraid/comminit.c ++++ b/drivers/scsi/aacraid/comminit.c +@@ -571,6 +571,11 @@ struct aac_dev *aac_init_adapter(struct aac_dev *dev) + else + dev->sa_firmware = 0; + ++ if (status[4] & le32_to_cpu(AAC_EXTOPT_SOFT_RESET)) ++ dev->soft_reset_support = 1; ++ else ++ dev->soft_reset_support = 0; ++ + if ((dev->comm_interface == AAC_COMM_MESSAGE) && + (status[2] > dev->base_size)) { + aac_adapter_ioremap(dev, 0); +diff --git a/drivers/scsi/aacraid/src.c b/drivers/scsi/aacraid/src.c +index 3b66e06726c8..787ec9baebb0 100644 +--- a/drivers/scsi/aacraid/src.c ++++ b/drivers/scsi/aacraid/src.c +@@ -733,10 +733,20 @@ static bool aac_is_ctrl_up_and_running(struct aac_dev *dev) + return ctrl_up; + } - if (list_empty(&area->free_list[fallback_mt])) -@@ -1676,25 +1674,13 @@ static struct page *__rmqueue(struct zone *zone, unsigned int order, ++static void aac_src_drop_io(struct aac_dev *dev) ++{ ++ if (!dev->soft_reset_support) ++ return; ++ ++ aac_adapter_sync_cmd(dev, DROP_IO, ++ 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL, NULL); ++} ++ + static void aac_notify_fw_of_iop_reset(struct aac_dev *dev) { - struct page *page; - --retry_reserve: - page = __rmqueue_smallest(zone, order, migratetype); -- -- if (unlikely(!page) && migratetype != MIGRATE_RESERVE) { -+ if (unlikely(!page)) { - if (migratetype == MIGRATE_MOVABLE) - page = __rmqueue_cma_fallback(zone, order); - - if (!page) - page = __rmqueue_fallback(zone, order, migratetype); -- -- /* -- * Use MIGRATE_RESERVE rather than fail an allocation. goto -- * is used because __rmqueue_smallest is an inline function -- * and we want just one call site -- */ -- if (!page) { -- migratetype = MIGRATE_RESERVE; -- goto retry_reserve; -- } - } - - trace_mm_page_alloc_zone_locked(page, order, migratetype); -@@ -3492,7 +3478,6 @@ static void show_migration_types(unsigned char type) - [MIGRATE_UNMOVABLE] = 'U', - [MIGRATE_RECLAIMABLE] = 'E', - [MIGRATE_MOVABLE] = 'M', -- [MIGRATE_RESERVE] = 'R', - #ifdef CONFIG_CMA - [MIGRATE_CMA] = 'C', - #endif -@@ -4303,120 +4288,6 @@ static inline unsigned long wait_table_bits(unsigned long size) + aac_adapter_sync_cmd(dev, IOP_RESET_ALWAYS, 0, 0, 0, 0, 0, 0, NULL, + NULL, NULL, NULL, NULL); ++ aac_src_drop_io(dev); } - /* -- * Check if a pageblock contains reserved pages -- */ --static int pageblock_is_reserved(unsigned long start_pfn, unsigned long end_pfn) + static void aac_send_iop_reset(struct aac_dev *dev) + +commit f2244c1b35e5302070af4c729db0b0e9eb8350c9 +Author: Balsundar P +Date: Tue Oct 15 11:51:59 2019 +0530 + + scsi: aacraid: fixed IO reporting error + + The problem is the driver detects FastResponse bit set and saves it to + Fib's flags to not check IO response status, but it never clears it for + next IO. Hence the next IO will pick up FastResponse bit to not check + the IO response status and fail to report any type IO error to kernel + + Link: https://lore.kernel.org/r/1571120524-6037-3-git-send-email-balsundar.p@microsemi.com + Signed-off-by: Balsundar P + Signed-off-by: Martin K. Petersen + +diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c +index 2142a649e865..3f268f669cc3 100644 +--- a/drivers/scsi/aacraid/commsup.c ++++ b/drivers/scsi/aacraid/commsup.c +@@ -232,6 +232,7 @@ struct fib *aac_fib_alloc_tag(struct aac_dev *dev, struct scsi_cmnd *scmd) + fibptr->type = FSAFS_NTC_FIB_CONTEXT; + fibptr->callback_data = NULL; + fibptr->callback = NULL; ++ fibptr->flags = 0; + + return fibptr; + } + +; https://lkml.org/lkml/2019/7/10/244 +diff -ur linux-5.3/drivers/scsi/aacraid.org/aacraid.h linux-5.3/drivers/scsi/aacraid/aacraid.h +--- linux-5.3/drivers/scsi/aacraid.org/aacraid.h 2019-11-01 22:42:37.011469816 +0100 ++++ linux-5.3/drivers/scsi/aacraid/aacraid.h 2019-11-04 09:29:51.321486211 +0100 +@@ -2740,17 +2740,6 @@ + int aac_rx_deliver_producer(struct fib * fib); + void aac_reinit_aif(struct aac_dev *aac, unsigned int index); + +-static inline int aac_is_src(struct aac_dev *dev) -{ -- unsigned long pfn; +- u16 device = dev->pdev->device; - -- for (pfn = start_pfn; pfn < end_pfn; pfn++) { -- if (!pfn_valid_within(pfn) || PageReserved(pfn_to_page(pfn))) -- return 1; -- } +- if (device == PMC_DEVICE_S6 || +- device == PMC_DEVICE_S7 || +- device == PMC_DEVICE_S8) +- return 1; - return 0; -} - --/* -- * Mark a number of pageblocks as MIGRATE_RESERVE. The number -- * of blocks reserved is based on min_wmark_pages(zone). The memory within -- * the reserve will tend to store contiguous free pages. Setting min_free_kbytes -- * higher will lead to a bigger reserve which will get freed as contiguous -- * blocks as reclaim kicks in -- */ --static void setup_zone_migrate_reserve(struct zone *zone) --{ -- unsigned long start_pfn, pfn, end_pfn, block_end_pfn; -- struct page *page; -- unsigned long block_migratetype; -- int reserve; -- int old_reserve; -- -- /* -- * Get the start pfn, end pfn and the number of blocks to reserve -- * We have to be careful to be aligned to pageblock_nr_pages to -- * make sure that we always check pfn_valid for the first page in -- * the block. -- */ -- start_pfn = zone->zone_start_pfn; -- end_pfn = zone_end_pfn(zone); -- start_pfn = roundup(start_pfn, pageblock_nr_pages); -- reserve = roundup(min_wmark_pages(zone), pageblock_nr_pages) >> -- pageblock_order; -- -- /* -- * Reserve blocks are generally in place to help high-order atomic -- * allocations that are short-lived. A min_free_kbytes value that -- * would result in more than 2 reserve blocks for atomic allocations -- * is assumed to be in place to help anti-fragmentation for the -- * future allocation of hugepages at runtime. -- */ -- reserve = min(2, reserve); -- old_reserve = zone->nr_migrate_reserve_block; -- -- /* When memory hot-add, we almost always need to do nothing */ -- if (reserve == old_reserve) -- return; -- zone->nr_migrate_reserve_block = reserve; -- -- for (pfn = start_pfn; pfn < end_pfn; pfn += pageblock_nr_pages) { -- if (!early_page_nid_uninitialised(pfn, zone_to_nid(zone))) -- return; -- -- if (!pfn_valid(pfn)) -- continue; -- page = pfn_to_page(pfn); -- -- /* Watch out for overlapping nodes */ -- if (page_to_nid(page) != zone_to_nid(zone)) -- continue; -- -- block_migratetype = get_pageblock_migratetype(page); -- -- /* Only test what is necessary when the reserves are not met */ -- if (reserve > 0) { -- /* -- * Blocks with reserved pages will never free, skip -- * them. -- */ -- block_end_pfn = min(pfn + pageblock_nr_pages, end_pfn); -- if (pageblock_is_reserved(pfn, block_end_pfn)) -- continue; -- -- /* If this block is reserved, account for it */ -- if (block_migratetype == MIGRATE_RESERVE) { -- reserve--; -- continue; -- } -- -- /* Suitable for reserving if this block is movable */ -- if (block_migratetype == MIGRATE_MOVABLE) { -- set_pageblock_migratetype(page, -- MIGRATE_RESERVE); -- move_freepages_block(zone, page, -- MIGRATE_RESERVE); -- reserve--; -- continue; -- } -- } else if (!old_reserve) { -- /* -- * At boot time we don't need to scan the whole zone -- * for turning off MIGRATE_RESERVE. -- */ -- break; -- } -- -- /* -- * If the reserve is met and this is a previous reserved block, -- * take it back -- */ -- if (block_migratetype == MIGRATE_RESERVE) { -- set_pageblock_migratetype(page, MIGRATE_MOVABLE); -- move_freepages_block(zone, page, MIGRATE_MOVABLE); -- } -- } --} -- --/* - * Initially all pages are reserved - free ones are freed - * up by free_all_bootmem() once the early boot process is - * done. Non-atomic initialization, single-pass. -@@ -4455,9 +4326,7 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone, - * movable at startup. This will force kernel allocations - * to reserve their blocks rather than leaking throughout - * the address space during boot when many long-lived -- * kernel allocations are made. Later some blocks near -- * the start are marked MIGRATE_RESERVE by -- * setup_zone_migrate_reserve() -+ * kernel allocations are made. - * - * bitmap is created for zone's valid pfn range. but memmap - * can be created for invalid pages (for alignment) -@@ -6018,7 +5887,6 @@ static void __setup_per_zone_wmarks(void) - high_wmark_pages(zone) - low_wmark_pages(zone) - - atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH])); - -- setup_zone_migrate_reserve(zone); - spin_unlock_irqrestore(&zone->lock, flags); + static inline int aac_supports_2T(struct aac_dev *dev) + { + return (dev->adapter_info.options & AAC_OPT_NEW_COMM_64); +diff -ur linux-5.3/drivers/scsi/aacraid.org/comminit.c linux-5.3/drivers/scsi/aacraid/comminit.c +--- linux-5.3/drivers/scsi/aacraid.org/comminit.c 2019-11-01 22:42:37.014803249 +0100 ++++ linux-5.3/drivers/scsi/aacraid/comminit.c 2019-11-04 09:29:51.321486211 +0100 +@@ -41,8 +41,11 @@ + { + u32 status = 0; + +- if (aac_is_src(dev)) ++ if (dev->pdev->device == PMC_DEVICE_S6 || ++ dev->pdev->device == PMC_DEVICE_S7 || ++ dev->pdev->device == PMC_DEVICE_S8) { + status = src_readl(dev, MUnit.OMR); ++ } + return (status & AAC_INT_MODE_MSIX); + } + +@@ -349,7 +352,8 @@ + /* FIB should be freed only after getting the response from the F/W */ + if (status != -ERESTARTSYS) + aac_fib_free(fibctx); +- if (aac_is_src(dev) && ++ if ((dev->pdev->device == PMC_DEVICE_S7 || ++ dev->pdev->device == PMC_DEVICE_S8) && + dev->msi_enabled) + aac_set_intx_mode(dev); + return status; +@@ -610,7 +614,8 @@ + dev->max_fib_size = status[1] & 0xFFE0; + host->sg_tablesize = status[2] >> 16; + dev->sg_tablesize = status[2] & 0xFFFF; +- if (aac_is_src(dev)) { ++ if (dev->pdev->device == PMC_DEVICE_S7 || ++ dev->pdev->device == PMC_DEVICE_S8) { + if (host->can_queue > (status[3] >> 16) - + AAC_NUM_MGT_FIB) + host->can_queue = (status[3] >> 16) - +@@ -629,7 +634,9 @@ + pr_warn("numacb=%d ignored\n", numacb); } -diff --git a/mm/vmstat.c b/mm/vmstat.c -index ffcb4f5..5b289dc 100644 ---- a/mm/vmstat.c -+++ b/mm/vmstat.c -@@ -923,7 +923,6 @@ static char * const migratetype_names[MIGRATE_TYPES] = { - "Unmovable", - "Reclaimable", - "Movable", -- "Reserve", - #ifdef CONFIG_CMA - "CMA", - #endif -diff --git a/mm/backing-dev.c b/mm/backing-dev.c -index 8ed2ffd963c5..7340353f8aea 100644 ---- a/mm/backing-dev.c -+++ b/mm/backing-dev.c -@@ -957,8 +957,9 @@ EXPORT_SYMBOL(congestion_wait); - * jiffies for either a BDI to exit congestion of the given @sync queue - * or a write to complete. - * -- * In the absence of zone congestion, cond_resched() is called to yield -- * the processor if necessary but otherwise does not sleep. -+ * In the absence of zone congestion, a short sleep or a cond_resched is -+ * performed to yield the processor and to allow other subsystems to make -+ * a forward progress. - * - * The return value is 0 if the sleep is for the full timeout. Otherwise, - * it is the number of jiffies that were still remaining when the function -@@ -978,7 +979,19 @@ long wait_iff_congested(struct zone *zone, int sync, long timeout) - */ - if (atomic_read(&nr_wb_congested[sync]) == 0 || - !test_bit(ZONE_CONGESTED, &zone->flags)) { -- cond_resched(); -+ -+ /* -+ * Memory allocation/reclaim might be called from a WQ -+ * context and the current implementation of the WQ -+ * concurrency control doesn't recognize that a particular -+ * WQ is congested if the worker thread is looping without -+ * ever sleeping. Therefore we have to do a short sleep -+ * here rather than calling cond_resched(). -+ */ -+ if (current->flags & PF_WQ_WORKER) -+ schedule_timeout(1); -+ else -+ cond_resched(); - - /* In case we scheduled, work out time remaining */ - ret = timeout - (jiffies - start); -diff --git a/mm/vmstat.c b/mm/vmstat.c -index 45dcbcb5c594..0975da8e3432 100644 ---- a/mm/vmstat.c -+++ b/mm/vmstat.c -@@ -1381,6 +1381,7 @@ static const struct file_operations proc_vmstat_file_operations = { - #endif /* CONFIG_PROC_FS */ - - #ifdef CONFIG_SMP -+static struct workqueue_struct *vmstat_wq; - static DEFINE_PER_CPU(struct delayed_work, vmstat_work); - int sysctl_stat_interval __read_mostly = HZ; - static cpumask_var_t cpu_stat_off; -@@ -1393,7 +1394,7 @@ static void vmstat_update(struct work_struct *w) - * to occur in the future. Keep on running the - * update worker thread. - */ -- schedule_delayed_work_on(smp_processor_id(), -+ queue_delayed_work_on(smp_processor_id(), vmstat_wq, - this_cpu_ptr(&vmstat_work), - round_jiffies_relative(sysctl_stat_interval)); - } else { -@@ -1462,7 +1463,7 @@ static void vmstat_shepherd(struct work_struct *w) - if (need_update(cpu) && - cpumask_test_and_clear_cpu(cpu, cpu_stat_off)) - -- schedule_delayed_work_on(cpu, -+ queue_delayed_work_on(cpu, vmstat_wq, - &per_cpu(vmstat_work, cpu), 0); - - put_online_cpus(); -@@ -1551,6 +1552,7 @@ static int __init setup_vmstat(void) - - start_shepherd_timer(); - cpu_notifier_register_done(); -+ vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0); - #endif - #ifdef CONFIG_PROC_FS - proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations); --- -2.6.2 - - +- if (aac_is_src(dev)) ++ if (dev->pdev->device == PMC_DEVICE_S6 || ++ dev->pdev->device == PMC_DEVICE_S7 || ++ dev->pdev->device == PMC_DEVICE_S8) + aac_define_int_mode(dev); + /* + * Ok now init the communication subsystem +diff -ur linux-5.3/drivers/scsi/aacraid.org/commsup.c linux-5.3/drivers/scsi/aacraid/commsup.c +--- linux-5.3/drivers/scsi/aacraid.org/commsup.c 2019-11-01 22:42:37.014803249 +0100 ++++ linux-5.3/drivers/scsi/aacraid/commsup.c 2019-11-04 09:29:51.321486211 +0100 +@@ -2593,7 +2593,9 @@ + { + int i; + +- if (aac_is_src(dev)) { ++ if (dev->pdev->device == PMC_DEVICE_S6 || ++ dev->pdev->device == PMC_DEVICE_S7 || ++ dev->pdev->device == PMC_DEVICE_S8) { + if (dev->max_msix > 1) { + for (i = 0; i < dev->max_msix; i++) + free_irq(pci_irq_vector(dev->pdev, i), +diff -ur linux-5.3/drivers/scsi/aacraid.org/linit.c linux-5.3/drivers/scsi/aacraid/linit.c +--- linux-5.3/drivers/scsi/aacraid.org/linit.c 2019-11-01 22:42:37.011469816 +0100 ++++ linux-5.3/drivers/scsi/aacraid/linit.c 2019-11-04 09:29:51.321486211 +0100 +@@ -1567,8 +1567,9 @@ + aac_send_shutdown(aac); + + aac_adapter_disable_int(aac); +- +- if (aac_is_src(aac)) { ++ if (aac->pdev->device == PMC_DEVICE_S6 || ++ aac->pdev->device == PMC_DEVICE_S7 || ++ aac->pdev->device == PMC_DEVICE_S8) { + if (aac->max_msix > 1) { + for (i = 0; i < aac->max_msix; i++) { + free_irq(pci_irq_vector(aac->pdev, i), +@@ -1858,7 +1859,8 @@ + aac_adapter_enable_int(dev); + + +- if (aac_is_src(dev)) ++ if (dev->pdev->device == PMC_DEVICE_S7 || ++ dev->pdev->device == PMC_DEVICE_S8) + aac_define_int_mode(dev); + + if (dev->msi_enabled)