diff --git a/COPYING-6.12.0-211.16.1.el10_2 b/COPYING-6.12.0-211.18.1.el10_2 similarity index 100% rename from COPYING-6.12.0-211.16.1.el10_2 rename to COPYING-6.12.0-211.18.1.el10_2 diff --git a/Makefile.rhelver b/Makefile.rhelver index e441e065ee813..63a99708f9c8b 100644 --- a/Makefile.rhelver +++ b/Makefile.rhelver @@ -12,7 +12,7 @@ RHEL_MINOR = 2 # # Use this spot to avoid future merge conflicts. # Do not trim this comment. -RHEL_RELEASE = 211.16.1 +RHEL_RELEASE = 211.18.1 # # RHEL_REBASE_NUM diff --git a/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/19bbfe7b.failed b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/19bbfe7b.failed new file mode 100644 index 0000000000000..2473d2cea3c98 --- /dev/null +++ b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/19bbfe7b.failed @@ -0,0 +1,170 @@ +fs: add S_ANON_INODE + +jira KERNEL-1088 +Rebuild_History Non-Buildable kernel-6.12.0-211.18.1.el10_2 +commit-author Christian Brauner +commit 19bbfe7b5fcc04d8711e8e1352acc77c1a5c3955 +Empty-Commit: Cherry-Pick Conflicts during history rebuild. +Will be included in final tarball splat. Ref for failed cherry-pick at: +ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/19bbfe7b.failed + +This makes it easy to detect proper anonymous inodes and to ensure that +we can detect them in codepaths such as readahead(). + +Readahead on anonymous inodes didn't work because they didn't have a +proper mode. Now that they have we need to retain EINVAL being returned +otherwise LTP will fail. + +We also need to ensure that ioctls aren't simply fired like they are for +regular files so things like inotify inodes continue to correctly call +their own ioctl handlers as in [1]. + + Reported-by: Xilin Wu +Link: https://lore.kernel.org/3A9139D5CD543962+89831381-31b9-4392-87ec-a84a5b3507d8@radxa.com [1] +Link: https://lore.kernel.org/7a1a7076-ff6b-4cb0-94e7-7218a0a44028@sirena.org.uk + Signed-off-by: Christian Brauner +(cherry picked from commit 19bbfe7b5fcc04d8711e8e1352acc77c1a5c3955) + Signed-off-by: Jonathan Maple + +# Conflicts: +# mm/readahead.c +diff --cc mm/readahead.c +index 2dbe5993b6aa,20d36d6b055e..000000000000 +--- a/mm/readahead.c ++++ b/mm/readahead.c +@@@ -678,29 -690,34 +678,55 @@@ EXPORT_SYMBOL_GPL(page_cache_async_ra) + + ssize_t ksys_readahead(int fd, loff_t offset, size_t count) + { +++<<<<<<< HEAD + + ssize_t ret; + + struct fd f; + + + + ret = -EBADF; + + f = fdget(fd); + + if (!fd_file(f) || !(fd_file(f)->f_mode & FMODE_READ)) + + goto out; +++======= ++ struct file *file; ++ const struct inode *inode; ++ ++ CLASS(fd, f)(fd); ++ if (fd_empty(f)) ++ return -EBADF; ++ ++ file = fd_file(f); ++ if (!(file->f_mode & FMODE_READ)) ++ return -EBADF; +++>>>>>>> 19bbfe7b5fcc (fs: add S_ANON_INODE) + + /* + * The readahead() syscall is intended to run only on files + * that can execute readahead. If readahead is not possible + * on this file, then we must return -EINVAL. + */ +++<<<<<<< HEAD + + ret = -EINVAL; + + if (!fd_file(f)->f_mapping || !fd_file(f)->f_mapping->a_ops || + + (!S_ISREG(file_inode(fd_file(f))->i_mode) && + + !S_ISBLK(file_inode(fd_file(f))->i_mode))) + + goto out; +++======= ++ if (!file->f_mapping) ++ return -EINVAL; ++ if (!file->f_mapping->a_ops) ++ return -EINVAL; ++ ++ inode = file_inode(file); ++ if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode)) ++ return -EINVAL; ++ if (IS_ANON_FILE(inode)) ++ return -EINVAL; +++>>>>>>> 19bbfe7b5fcc (fs: add S_ANON_INODE) + + - return vfs_fadvise(fd_file(f), offset, count, POSIX_FADV_WILLNEED); + + ret = vfs_fadvise(fd_file(f), offset, count, POSIX_FADV_WILLNEED); + +out: + + fdput(f); + + return ret; + } + + SYSCALL_DEFINE3(readahead, int, fd, loff_t, offset, size_t, count) +diff --git a/fs/ioctl.c b/fs/ioctl.c +index 6e0c954388d4..4dbd5627af8f 100644 +--- a/fs/ioctl.c ++++ b/fs/ioctl.c +@@ -822,7 +822,8 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, + return ioctl_fioasync(fd, filp, argp); + + case FIOQSIZE: +- if (S_ISDIR(inode->i_mode) || S_ISREG(inode->i_mode) || ++ if (S_ISDIR(inode->i_mode) || ++ (S_ISREG(inode->i_mode) && !IS_ANON_FILE(inode)) || + S_ISLNK(inode->i_mode)) { + loff_t res = inode_get_bytes(inode); + return copy_to_user(argp, &res, sizeof(res)) ? +@@ -857,7 +858,7 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, + return ioctl_file_dedupe_range(filp, argp); + + case FIONREAD: +- if (!S_ISREG(inode->i_mode)) ++ if (!S_ISREG(inode->i_mode) || IS_ANON_FILE(inode)) + return vfs_ioctl(filp, cmd, arg); + + return put_user(i_size_read(inode) - filp->f_pos, +@@ -882,7 +883,7 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, + return ioctl_get_fs_sysfs_path(filp, argp); + + default: +- if (S_ISREG(inode->i_mode)) ++ if (S_ISREG(inode->i_mode) && !IS_ANON_FILE(inode)) + return file_ioctl(filp, cmd, argp); + break; + } +diff --git a/fs/libfs.c b/fs/libfs.c +index 7fd661bb935f..df9a2f4472f7 100644 +--- a/fs/libfs.c ++++ b/fs/libfs.c +@@ -1654,7 +1654,7 @@ struct inode *alloc_anon_inode(struct super_block *s) + inode->i_mode = S_IRUSR | S_IWUSR; + inode->i_uid = current_fsuid(); + inode->i_gid = current_fsgid(); +- inode->i_flags |= S_PRIVATE; ++ inode->i_flags |= S_PRIVATE | S_ANON_INODE; + simple_inode_init_ts(inode); + return inode; + } +diff --git a/fs/pidfs.c b/fs/pidfs.c +index d6c0ed79ea24..7e10fac8e623 100644 +--- a/fs/pidfs.c ++++ b/fs/pidfs.c +@@ -804,7 +804,7 @@ static int pidfs_init_inode(struct inode *inode, void *data) + const struct pid *pid = data; + + inode->i_private = data; +- inode->i_flags |= S_PRIVATE; ++ inode->i_flags |= S_PRIVATE | S_ANON_INODE; + inode->i_mode |= S_IRWXU; + inode->i_op = &pidfs_inode_operations; + inode->i_fop = &pidfs_file_operations; +diff --git a/include/linux/fs.h b/include/linux/fs.h +index 106b644cee85..af426a3bd89c 100644 +--- a/include/linux/fs.h ++++ b/include/linux/fs.h +@@ -2319,6 +2319,7 @@ struct super_operations { + #define S_CASEFOLD (1 << 15) /* Casefolded file */ + #define S_VERITY (1 << 16) /* Verity file (using fs/verity/) */ + #define S_KERNEL_FILE (1 << 17) /* File is in use by the kernel (eg. fs/cachefiles) */ ++#define S_ANON_INODE (1 << 19) /* Inode is an anonymous inode */ + + /* + * Note that nosuid etc flags are inode-specific: setting some file-system +@@ -2375,6 +2376,7 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags + + #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ + (inode)->i_rdev == WHITEOUT_DEV) ++#define IS_ANON_FILE(inode) ((inode)->i_flags & S_ANON_INODE) + + static inline bool HAS_UNMAPPED_ID(struct mnt_idmap *idmap, + struct inode *inode) +* Unmerged path mm/readahead.c diff --git a/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/22bdf3d6.failed b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/22bdf3d6.failed new file mode 100644 index 0000000000000..2b8366311cf17 --- /dev/null +++ b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/22bdf3d6.failed @@ -0,0 +1,133 @@ +anon_inode: explicitly block ->setattr() + +jira KERNEL-1088 +Rebuild_History Non-Buildable kernel-6.12.0-211.18.1.el10_2 +commit-author Christian Brauner +commit 22bdf3d6581af6d06ed8a46c6835648421cca0ea +Empty-Commit: Cherry-Pick Conflicts during history rebuild. +Will be included in final tarball splat. Ref for failed cherry-pick at: +ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/22bdf3d6.failed + +It is currently possible to change the mode and owner of the single +anonymous inode in the kernel: + +int main(int argc, char *argv[]) +{ + int ret, sfd; + sigset_t mask; + struct signalfd_siginfo fdsi; + + sigemptyset(&mask); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGQUIT); + + ret = sigprocmask(SIG_BLOCK, &mask, NULL); + if (ret < 0) + _exit(1); + + sfd = signalfd(-1, &mask, 0); + if (sfd < 0) + _exit(2); + + ret = fchown(sfd, 5555, 5555); + if (ret < 0) + _exit(3); + + ret = fchmod(sfd, 0777); + if (ret < 0) + _exit(3); + + _exit(4); +} + +This is a bug. It's not really a meaningful one because anonymous inodes +don't really figure into path lookup and they cannot be reopened via +/proc//fd/ and can't be used for lookup itself. So they can +only ever serve as direct references. + +But it is still completely bogus to allow the mode and ownership or any +of the properties of the anonymous inode to be changed. Block this! + +Link: https://lore.kernel.org/20250407-work-anon_inode-v1-3-53a44c20d44e@kernel.org + Reviewed-by: Jeff Layton + Cc: stable@vger.kernel.org # all LTS kernels + Signed-off-by: Christian Brauner +(cherry picked from commit 22bdf3d6581af6d06ed8a46c6835648421cca0ea) + Signed-off-by: Jonathan Maple + +# Conflicts: +# fs/anon_inodes.c +# fs/internal.h +diff --cc fs/anon_inodes.c +index 5a070be69922,cb51a90bece0..000000000000 +--- a/fs/anon_inodes.c ++++ b/fs/anon_inodes.c +@@@ -28,6 -30,45 +28,48 @@@ static struct vfsmount *anon_inode_mnt + static struct inode *anon_inode_inode __ro_after_init; + + /* +++<<<<<<< HEAD +++======= ++ * User space expects anonymous inodes to have no file type in st_mode. ++ * ++ * In particular, 'lsof' has this legacy logic: ++ * ++ * type = s->st_mode & S_IFMT; ++ * switch (type) { ++ * ... ++ * case 0: ++ * if (!strcmp(p, "anon_inode")) ++ * Lf->ntype = Ntype = N_ANON_INODE; ++ * ++ * to detect our old anon_inode logic. ++ * ++ * Rather than mess with our internal sane inode data, just fix it ++ * up here in getattr() by masking off the format bits. ++ */ ++ int anon_inode_getattr(struct mnt_idmap *idmap, const struct path *path, ++ struct kstat *stat, u32 request_mask, ++ unsigned int query_flags) ++ { ++ struct inode *inode = d_inode(path->dentry); ++ ++ generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); ++ stat->mode &= ~S_IFMT; ++ return 0; ++ } ++ ++ int anon_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, ++ struct iattr *attr) ++ { ++ return -EOPNOTSUPP; ++ } ++ ++ static const struct inode_operations anon_inode_operations = { ++ .getattr = anon_inode_getattr, ++ .setattr = anon_inode_setattr, ++ }; ++ ++ /* +++>>>>>>> 22bdf3d6581a (anon_inode: explicitly block ->setattr()) + * anon_inodefs_dname() is called from d_path(). + */ + static char *anon_inodefs_dname(struct dentry *dentry, char *buffer, int buflen) +diff --cc fs/internal.h +index b555366c7974,f545400ce607..000000000000 +--- a/fs/internal.h ++++ b/fs/internal.h +@@@ -338,3 -341,10 +338,13 @@@ static inline bool path_mounted(const s + return path->mnt->mnt_root == path->dentry; + } + void file_f_owner_release(struct file *file); +++<<<<<<< HEAD +++======= ++ bool file_seek_cur_needs_f_lock(struct file *file); ++ int statmount_mnt_idmap(struct mnt_idmap *idmap, struct seq_file *seq, bool uid_map); ++ int anon_inode_getattr(struct mnt_idmap *idmap, const struct path *path, ++ struct kstat *stat, u32 request_mask, ++ unsigned int query_flags); ++ int anon_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, ++ struct iattr *attr); +++>>>>>>> 22bdf3d6581a (anon_inode: explicitly block ->setattr()) +* Unmerged path fs/anon_inodes.c +* Unmerged path fs/internal.h diff --git a/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/ac1ea219.failed b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/ac1ea219.failed new file mode 100644 index 0000000000000..05748eff74466 --- /dev/null +++ b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/ac1ea219.failed @@ -0,0 +1,70 @@ +mm/page_alloc: clear page->private in free_pages_prepare() + +jira KERNEL-1088 +cve CVE-2026-43303 +Rebuild_History Non-Buildable kernel-6.12.0-211.18.1.el10_2 +commit-author Mikhail Gavrilov +commit ac1ea219590c09572ed5992dc233bbf7bb70fef9 +Empty-Commit: Cherry-Pick Conflicts during history rebuild. +Will be included in final tarball splat. Ref for failed cherry-pick at: +ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/ac1ea219.failed + +Several subsystems (slub, shmem, ttm, etc.) use page->private but don't +clear it before freeing pages. When these pages are later allocated as +high-order pages and split via split_page(), tail pages retain stale +page->private values. + +This causes a use-after-free in the swap subsystem. The swap code uses +page->private to track swap count continuations, assuming freshly +allocated pages have page->private == 0. When stale values are present, +swap_count_continued() incorrectly assumes the continuation list is valid +and iterates over uninitialized page->lru containing LIST_POISON values, +causing a crash: + + KASAN: maybe wild-memory-access in range [0xdead000000000100-0xdead000000000107] + RIP: 0010:__do_sys_swapoff+0x1151/0x1860 + +Fix this by clearing page->private in free_pages_prepare(), ensuring all +freed pages have clean state regardless of previous use. + +Link: https://lkml.kernel.org/r/20260207173615.146159-1-mikhail.v.gavrilov@gmail.com +Fixes: 3b8000ae185c ("mm/vmalloc: huge vmalloc backing pages should be split rather than compound") + Signed-off-by: Mikhail Gavrilov + Suggested-by: Zi Yan + Acked-by: Zi Yan + Acked-by: David Hildenbrand (Arm) + Reviewed-by: Vlastimil Babka + Cc: Brendan Jackman + Cc: Chris Li + Cc: Hugh Dickins + Cc: Johannes Weiner + Cc: Kairui Song + Cc: Matthew Wilcox (Oracle) + Cc: Michal Hocko + Cc: Nicholas Piggin + Cc: Suren Baghdasaryan + Cc: + Signed-off-by: Andrew Morton +(cherry picked from commit ac1ea219590c09572ed5992dc233bbf7bb70fef9) + Signed-off-by: Jonathan Maple + +# Conflicts: +# mm/page_alloc.c +diff --cc mm/page_alloc.c +index 373e0e4bb3d2,77dcec36946f..000000000000 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@@ -1134,7 -1428,8 +1134,12 @@@ __always_inline bool free_pages_prepare + } + + page_cpupid_reset_last(page); +++<<<<<<< HEAD + + page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP; +++======= ++ page->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP; ++ page->private = 0; +++>>>>>>> ac1ea219590c (mm/page_alloc: clear page->private in free_pages_prepare()) + reset_page_owner(page, order); + page_table_check_free(page, order); + pgalloc_tag_sub(page, 1 << order); +* Unmerged path mm/page_alloc.c diff --git a/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/cfd86ef7.failed b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/cfd86ef7.failed new file mode 100644 index 0000000000000..a870b030f6e68 --- /dev/null +++ b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/cfd86ef7.failed @@ -0,0 +1,84 @@ +anon_inode: use a proper mode internally + +jira KERNEL-1088 +Rebuild_History Non-Buildable kernel-6.12.0-211.18.1.el10_2 +commit-author Christian Brauner +commit cfd86ef7e8e7b9e015707e46479a6b1de141eed0 +Empty-Commit: Cherry-Pick Conflicts during history rebuild. +Will be included in final tarball splat. Ref for failed cherry-pick at: +ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/cfd86ef7.failed + +This allows the VFS to not trip over anonymous inodes and we can add +asserts based on the mode into the vfs. When we report it to userspace +we can simply hide the mode to avoid regressions. I've audited all +direct callers of alloc_anon_inode() and only secretmen overrides i_mode +and i_op inode operations but it already uses a regular file. + +Link: https://lore.kernel.org/20250407-work-anon_inode-v1-1-53a44c20d44e@kernel.org +Fixes: af153bb63a336 ("vfs: catch invalid modes in may_open()") + Reviewed-by: Jeff Layton + Cc: stable@vger.kernel.org # all LTS kernels + Reported-by: syzbot+5d8e79d323a13aa0b248@syzkaller.appspotmail.com +Closes: https://lore.kernel.org/all/67ed3fb3.050a0220.14623d.0009.GAE@google.com + Signed-off-by: Christian Brauner +(cherry picked from commit cfd86ef7e8e7b9e015707e46479a6b1de141eed0) + Signed-off-by: Jonathan Maple + +# Conflicts: +# fs/anon_inodes.c +# fs/internal.h +diff --cc fs/anon_inodes.c +index 5a070be69922,42e4b9c34f89..000000000000 +--- a/fs/anon_inodes.c ++++ b/fs/anon_inodes.c +@@@ -78,7 -100,9 +112,13 @@@ struct inode *anon_inode_make_secure_in + if (IS_ERR(inode)) + return inode; + inode->i_flags &= ~S_PRIVATE; +++<<<<<<< HEAD + + error = security_inode_init_security_anon(inode, &qname, context_inode); +++======= ++ inode->i_op = &anon_inode_operations; ++ error = security_inode_init_security_anon(inode, &QSTR(name), ++ context_inode); +++>>>>>>> cfd86ef7e8e7 (anon_inode: use a proper mode internally) + if (error) { + iput(inode); + return ERR_PTR(error); +diff --cc fs/internal.h +index b555366c7974,717dc9eb6185..000000000000 +--- a/fs/internal.h ++++ b/fs/internal.h +@@@ -338,3 -341,8 +338,11 @@@ static inline bool path_mounted(const s + return path->mnt->mnt_root == path->dentry; + } + void file_f_owner_release(struct file *file); +++<<<<<<< HEAD +++======= ++ bool file_seek_cur_needs_f_lock(struct file *file); ++ int statmount_mnt_idmap(struct mnt_idmap *idmap, struct seq_file *seq, bool uid_map); ++ int anon_inode_getattr(struct mnt_idmap *idmap, const struct path *path, ++ struct kstat *stat, u32 request_mask, ++ unsigned int query_flags); +++>>>>>>> cfd86ef7e8e7 (anon_inode: use a proper mode internally) +* Unmerged path fs/anon_inodes.c +* Unmerged path fs/internal.h +diff --git a/fs/libfs.c b/fs/libfs.c +index 7fd661bb935f..4e9de5aa4d7f 100644 +--- a/fs/libfs.c ++++ b/fs/libfs.c +@@ -1651,7 +1651,13 @@ struct inode *alloc_anon_inode(struct super_block *s) + * that it already _is_ on the dirty list. + */ + inode->i_state = I_DIRTY; +- inode->i_mode = S_IRUSR | S_IWUSR; ++ /* ++ * Historically anonymous inodes didn't have a type at all and ++ * userspace has come to rely on this. Internally they're just ++ * regular files but S_IFREG is masked off when reporting ++ * information to userspace. ++ */ ++ inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR; + inode->i_uid = current_fsuid(); + inode->i_gid = current_fsgid(); + inode->i_flags |= S_PRIVATE; diff --git a/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/rebuild.details.txt b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/rebuild.details.txt new file mode 100644 index 0000000000000..ca54af78ca6d0 --- /dev/null +++ b/ciq/ciq_backports/kernel-6.12.0-211.18.1.el10_2/rebuild.details.txt @@ -0,0 +1,25 @@ +Rebuild_History BUILDABLE +Rebuilding Kernel from rpm changelog with Fuzz Limit: 87.50% +Number of commits in upstream range v6.12~1..kernel-mainline: 123983 +Number of commits in rpm: 85 +Number of commits matched with upstream: 80 (94.12%) +Number of commits in upstream but not in rpm: 123903 +Number of commits NOT found in upstream: 5 (5.88%) + +Rebuilding Kernel on Branch rocky10_2_rebuild_kernel-6.12.0-211.18.1.el10_2 for kernel-6.12.0-211.18.1.el10_2 +Clean Cherry Picks: 35 (43.75%) +Empty Cherry Picks: 4 (5.00%) +_______________________________ + +__EMPTY COMMITS__________________________ +cfd86ef7e8e7b9e015707e46479a6b1de141eed0 anon_inode: use a proper mode internally +22bdf3d6581af6d06ed8a46c6835648421cca0ea anon_inode: explicitly block ->setattr() +19bbfe7b5fcc04d8711e8e1352acc77c1a5c3955 fs: add S_ANON_INODE +ac1ea219590c09572ed5992dc233bbf7bb70fef9 mm/page_alloc: clear page->private in free_pages_prepare() + +__CHANGES NOT IN UPSTREAM________________ +Add partial riscv64 support for build root' +Provide basic VisionFive 2 support' +redhat/kernel.spec.template: disable OBJTOOL_WERROR for gcov builds +redhat/configs: enable CONFIG_AQTION on all archs +scsi: lpfc: avoid crashing in lpfc_nlp_get() if lpfc_nodelist was freed diff --git a/configs/kernel-6.12.0-aarch64-64k-debug.config b/configs/kernel-6.12.0-aarch64-64k-debug.config index c14b7eeab5298..0d8fb6c5881c3 100644 --- a/configs/kernel-6.12.0-aarch64-64k-debug.config +++ b/configs/kernel-6.12.0-aarch64-64k-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2970,7 +2970,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64-64k.config b/configs/kernel-6.12.0-aarch64-64k.config index 53be54b0a20c2..6f9f759aedc28 100644 --- a/configs/kernel-6.12.0-aarch64-64k.config +++ b/configs/kernel-6.12.0-aarch64-64k.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2965,7 +2965,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64-debug.config b/configs/kernel-6.12.0-aarch64-debug.config index e4da7ab004284..361da7c4fc92f 100644 --- a/configs/kernel-6.12.0-aarch64-debug.config +++ b/configs/kernel-6.12.0-aarch64-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2973,7 +2973,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64-rt-64k-debug.config b/configs/kernel-6.12.0-aarch64-rt-64k-debug.config index 4e72d1e9666a0..d3222b5fe434b 100644 --- a/configs/kernel-6.12.0-aarch64-rt-64k-debug.config +++ b/configs/kernel-6.12.0-aarch64-rt-64k-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2957,7 +2957,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64-rt-64k.config b/configs/kernel-6.12.0-aarch64-rt-64k.config index f2ee6f5cde8cc..3aad580d397c3 100644 --- a/configs/kernel-6.12.0-aarch64-rt-64k.config +++ b/configs/kernel-6.12.0-aarch64-rt-64k.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2952,7 +2952,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64-rt-debug.config b/configs/kernel-6.12.0-aarch64-rt-debug.config index f727c70a35cbb..8913c99091e46 100644 --- a/configs/kernel-6.12.0-aarch64-rt-debug.config +++ b/configs/kernel-6.12.0-aarch64-rt-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2959,7 +2959,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64-rt.config b/configs/kernel-6.12.0-aarch64-rt.config index a65371e37813b..e8d3514d61c2e 100644 --- a/configs/kernel-6.12.0-aarch64-rt.config +++ b/configs/kernel-6.12.0-aarch64-rt.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2954,7 +2954,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-aarch64.config b/configs/kernel-6.12.0-aarch64.config index 53f84da29a167..5405ecfb60421 100644 --- a/configs/kernel-6.12.0-aarch64.config +++ b/configs/kernel-6.12.0-aarch64.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2968,7 +2968,7 @@ CONFIG_AMD_XGBE=m CONFIG_NET_XGENE=m CONFIG_NET_XGENE_V2=m CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_SPI_AX88796C is not set diff --git a/configs/kernel-6.12.0-ppc64le-debug.config b/configs/kernel-6.12.0-ppc64le-debug.config index 38cb192f9a76a..eee5c257e8e38 100644 --- a/configs/kernel-6.12.0-ppc64le-debug.config +++ b/configs/kernel-6.12.0-ppc64le-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2559,7 +2559,7 @@ CONFIG_NET_VENDOR_AMAZON=y # CONFIG_ENA_ETHERNET is not set # CONFIG_NET_VENDOR_AMD is not set CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y CONFIG_NET_VENDOR_ATHEROS=y diff --git a/configs/kernel-6.12.0-ppc64le.config b/configs/kernel-6.12.0-ppc64le.config index abf0857bf822e..f231b19b0cae6 100644 --- a/configs/kernel-6.12.0-ppc64le.config +++ b/configs/kernel-6.12.0-ppc64le.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2561,7 +2561,7 @@ CONFIG_NET_VENDOR_AMAZON=y # CONFIG_ENA_ETHERNET is not set # CONFIG_NET_VENDOR_AMD is not set CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y CONFIG_NET_VENDOR_ATHEROS=y diff --git a/configs/kernel-6.12.0-riscv64-debug.config b/configs/kernel-6.12.0-riscv64-debug.config index ed2b59c26f4c4..834ae05d81101 100644 --- a/configs/kernel-6.12.0-riscv64-debug.config +++ b/configs/kernel-6.12.0-riscv64-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2599,7 +2599,7 @@ CONFIG_NET_VENDOR_AMAZON=y # CONFIG_ENA_ETHERNET is not set # CONFIG_NET_VENDOR_AMD is not set CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y CONFIG_NET_VENDOR_ATHEROS=y diff --git a/configs/kernel-6.12.0-riscv64.config b/configs/kernel-6.12.0-riscv64.config index 062a06fd58603..5065e01742a80 100644 --- a/configs/kernel-6.12.0-riscv64.config +++ b/configs/kernel-6.12.0-riscv64.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2595,7 +2595,7 @@ CONFIG_NET_VENDOR_AMAZON=y # CONFIG_ENA_ETHERNET is not set # CONFIG_NET_VENDOR_AMD is not set CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y CONFIG_NET_VENDOR_ATHEROS=y diff --git a/configs/kernel-6.12.0-s390x-debug.config b/configs/kernel-6.12.0-s390x-debug.config index 9f2a47b5266b0..a9afc69138683 100644 --- a/configs/kernel-6.12.0-s390x-debug.config +++ b/configs/kernel-6.12.0-s390x-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y @@ -2022,7 +2022,7 @@ CONFIG_ETHERNET=y CONFIG_NET_VENDOR_AMAZON=y # CONFIG_NET_VENDOR_AMD is not set CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_NET_VENDOR_ATHEROS is not set diff --git a/configs/kernel-6.12.0-s390x-zfcpdump.config b/configs/kernel-6.12.0-s390x-zfcpdump.config index 18e0750480891..e9a8d80bb22f1 100644 --- a/configs/kernel-6.12.0-s390x-zfcpdump.config +++ b/configs/kernel-6.12.0-s390x-zfcpdump.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y diff --git a/configs/kernel-6.12.0-s390x.config b/configs/kernel-6.12.0-s390x.config index c056e71c9a4ce..27faec9e8b0f2 100644 --- a/configs/kernel-6.12.0-s390x.config +++ b/configs/kernel-6.12.0-s390x.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y @@ -2046,7 +2046,7 @@ CONFIG_ETHERNET=y CONFIG_NET_VENDOR_AMAZON=y # CONFIG_NET_VENDOR_AMD is not set CONFIG_NET_VENDOR_AQUANTIA=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m # CONFIG_NET_VENDOR_ARC is not set CONFIG_NET_VENDOR_ASIX=y # CONFIG_NET_VENDOR_ATHEROS is not set diff --git a/configs/kernel-6.12.0-x86_64-debug.config b/configs/kernel-6.12.0-x86_64-debug.config index 8a4b447689ae0..459fa6d472c41 100644 --- a/configs/kernel-6.12.0-x86_64-debug.config +++ b/configs/kernel-6.12.0-x86_64-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y diff --git a/configs/kernel-6.12.0-x86_64-rt-debug.config b/configs/kernel-6.12.0-x86_64-rt-debug.config index 5b9293dc7f100..15f8b4707e4d4 100644 --- a/configs/kernel-6.12.0-x86_64-rt-debug.config +++ b/configs/kernel-6.12.0-x86_64-rt-debug.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_CONSTRUCTORS=y CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y diff --git a/configs/kernel-6.12.0-x86_64-rt.config b/configs/kernel-6.12.0-x86_64-rt.config index ce72802a95f07..807efcb465350 100644 --- a/configs/kernel-6.12.0-x86_64-rt.config +++ b/configs/kernel-6.12.0-x86_64-rt.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y diff --git a/configs/kernel-6.12.0-x86_64.config b/configs/kernel-6.12.0-x86_64.config index f1fa3e6dce585..5df0cc5659b2a 100644 --- a/configs/kernel-6.12.0-x86_64.config +++ b/configs/kernel-6.12.0-x86_64.config @@ -22,7 +22,7 @@ CONFIG_TOOLS_SUPPORT_RELR=y CONFIG_CC_HAS_ASM_INLINE=y CONFIG_CC_HAS_NO_PROFILE_FN_ATTR=y CONFIG_CC_HAS_MULTIDIMENSIONAL_NONSTRING=y -CONFIG_PAHOLE_VERSION=130 +CONFIG_PAHOLE_VERSION=131 CONFIG_IRQ_WORK=y CONFIG_BUILDTIME_TABLE_SORT=y CONFIG_THREAD_INFO_IN_TASK=y diff --git a/configs/kernel-aarch64-64k-debug-rhel.config b/configs/kernel-aarch64-64k-debug-rhel.config index 5352f71469728..a2f5f2b6474b5 100644 --- a/configs/kernel-aarch64-64k-debug-rhel.config +++ b/configs/kernel-aarch64-64k-debug-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-64k-rhel.config b/configs/kernel-aarch64-64k-rhel.config index b3fb19520114d..d78dc12d5de9f 100644 --- a/configs/kernel-aarch64-64k-rhel.config +++ b/configs/kernel-aarch64-64k-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-debug-rhel.config b/configs/kernel-aarch64-debug-rhel.config index 89110749aad96..59d027ed4b328 100644 --- a/configs/kernel-aarch64-debug-rhel.config +++ b/configs/kernel-aarch64-debug-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-rhel.config b/configs/kernel-aarch64-rhel.config index c5ec239fae81c..f9f56763d4ff6 100644 --- a/configs/kernel-aarch64-rhel.config +++ b/configs/kernel-aarch64-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-rt-64k-debug-rhel.config b/configs/kernel-aarch64-rt-64k-debug-rhel.config index 863e9ea50d79a..c0ee666e6fbdb 100644 --- a/configs/kernel-aarch64-rt-64k-debug-rhel.config +++ b/configs/kernel-aarch64-rt-64k-debug-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-rt-64k-rhel.config b/configs/kernel-aarch64-rt-64k-rhel.config index e4fc547f9c0dc..9ad2e116ec5ad 100644 --- a/configs/kernel-aarch64-rt-64k-rhel.config +++ b/configs/kernel-aarch64-rt-64k-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-rt-debug-rhel.config b/configs/kernel-aarch64-rt-debug-rhel.config index 53fdb03cb5ed0..15b6260085df3 100644 --- a/configs/kernel-aarch64-rt-debug-rhel.config +++ b/configs/kernel-aarch64-rt-debug-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-aarch64-rt-rhel.config b/configs/kernel-aarch64-rt-rhel.config index 3944b15d8c496..ecde1cb827453 100644 --- a/configs/kernel-aarch64-rt-rhel.config +++ b/configs/kernel-aarch64-rt-rhel.config @@ -261,7 +261,7 @@ CONFIG_AMPERE_ERRATUM_AC04_CPU_23=y # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-ppc64le-debug-rhel.config b/configs/kernel-ppc64le-debug-rhel.config index 59756a5b31443..0892e9496b417 100644 --- a/configs/kernel-ppc64le-debug-rhel.config +++ b/configs/kernel-ppc64le-debug-rhel.config @@ -248,7 +248,7 @@ CONFIG_APDS9802ALS=m # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-ppc64le-rhel.config b/configs/kernel-ppc64le-rhel.config index 78ca491f93d59..5ed1ba308e0af 100644 --- a/configs/kernel-ppc64le-rhel.config +++ b/configs/kernel-ppc64le-rhel.config @@ -248,7 +248,7 @@ CONFIG_APDS9802ALS=m # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-riscv64-debug-rhel.config b/configs/kernel-riscv64-debug-rhel.config index e17367d1499f4..06d56bfd3885d 100644 --- a/configs/kernel-riscv64-debug-rhel.config +++ b/configs/kernel-riscv64-debug-rhel.config @@ -250,7 +250,7 @@ CONFIG_APDS9802ALS=m # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-riscv64-rhel.config b/configs/kernel-riscv64-rhel.config index 645923e9c4b8f..0d82dad4bd94a 100644 --- a/configs/kernel-riscv64-rhel.config +++ b/configs/kernel-riscv64-rhel.config @@ -250,7 +250,7 @@ CONFIG_APDS9802ALS=m # CONFIG_APPLE_MFI_FASTCHARGE is not set CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-s390x-debug-rhel.config b/configs/kernel-s390x-debug-rhel.config index 3a8a47f5a2260..3603e59d4770c 100644 --- a/configs/kernel-s390x-debug-rhel.config +++ b/configs/kernel-s390x-debug-rhel.config @@ -251,7 +251,7 @@ CONFIG_APPLDATA_OS=m CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set CONFIG_AP=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-s390x-rhel.config b/configs/kernel-s390x-rhel.config index dfd5d07bd496f..d77d9c2940af2 100644 --- a/configs/kernel-s390x-rhel.config +++ b/configs/kernel-s390x-rhel.config @@ -251,7 +251,7 @@ CONFIG_APPLDATA_OS=m CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set CONFIG_AP=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/configs/kernel-s390x-zfcpdump-rhel.config b/configs/kernel-s390x-zfcpdump-rhel.config index ec52069c0dc24..9cfa5b16699db 100644 --- a/configs/kernel-s390x-zfcpdump-rhel.config +++ b/configs/kernel-s390x-zfcpdump-rhel.config @@ -251,7 +251,7 @@ CONFIG_APPLDATA_NET_SUM=m CONFIG_APPLE_PROPERTIES=y # CONFIG_APPLICOM is not set CONFIG_AP=y -# CONFIG_AQTION is not set +CONFIG_AQTION=m CONFIG_AQUANTIA_PHY=m # CONFIG_AR5523 is not set # CONFIG_ARCH_ACTIONS is not set diff --git a/drivers/crypto/tegra/tegra-se-aes.c b/drivers/crypto/tegra/tegra-se-aes.c index 0e07d0523291a..8b91f00b9c31d 100644 --- a/drivers/crypto/tegra/tegra-se-aes.c +++ b/drivers/crypto/tegra/tegra-se-aes.c @@ -4,6 +4,7 @@ * Crypto driver to handle block cipher algorithms using NVIDIA Security Engine. */ +#include #include #include #include @@ -333,7 +334,9 @@ static int tegra_aes_do_one_req(struct crypto_engine *engine, void *areq) tegra_key_invalidate_reserved(ctx->se, key2_id, ctx->alg); out_finalize: + local_bh_disable(); crypto_finalize_skcipher_request(se->engine, req, ret); + local_bh_enable(); return 0; } @@ -1261,7 +1264,9 @@ static int tegra_ccm_do_one_req(struct crypto_engine *engine, void *areq) tegra_key_invalidate_reserved(ctx->se, rctx->key_id, ctx->alg); out_finalize: + local_bh_disable(); crypto_finalize_aead_request(ctx->se->engine, req, ret); + local_bh_enable(); return 0; } @@ -1347,7 +1352,9 @@ static int tegra_gcm_do_one_req(struct crypto_engine *engine, void *areq) tegra_key_invalidate_reserved(ctx->se, rctx->key_id, ctx->alg); out_finalize: + local_bh_disable(); crypto_finalize_aead_request(ctx->se->engine, req, ret); + local_bh_enable(); return 0; } @@ -1745,7 +1752,9 @@ static int tegra_cmac_do_one_req(struct crypto_engine *engine, void *areq) if (tegra_key_is_reserved(rctx->key_id)) tegra_key_invalidate_reserved(ctx->se, rctx->key_id, ctx->alg); + local_bh_disable(); crypto_finalize_hash_request(se->engine, req, ret); + local_bh_enable(); return 0; } diff --git a/drivers/crypto/tegra/tegra-se-hash.c b/drivers/crypto/tegra/tegra-se-hash.c index 42d007b7af45d..90bf34eb35784 100644 --- a/drivers/crypto/tegra/tegra-se-hash.c +++ b/drivers/crypto/tegra/tegra-se-hash.c @@ -4,6 +4,7 @@ * Crypto driver to handle HASH algorithms using NVIDIA Security Engine. */ +#include #include #include #include @@ -543,7 +544,9 @@ static int tegra_sha_do_one_req(struct crypto_engine *engine, void *areq) } out: + local_bh_disable(); crypto_finalize_hash_request(se->engine, req, ret); + local_bh_enable(); return 0; } diff --git a/drivers/dpll/zl3073x/core.c b/drivers/dpll/zl3073x/core.c index 63bd97181b9ee..37f3c33570eef 100644 --- a/drivers/dpll/zl3073x/core.c +++ b/drivers/dpll/zl3073x/core.c @@ -981,11 +981,7 @@ zl3073x_devm_dpll_init(struct zl3073x_dev *zldev, u8 num_dplls) } /* Add devres action to release DPLL related resources */ - rc = devm_add_action_or_reset(zldev->dev, zl3073x_dev_dpll_fini, zldev); - if (rc) - goto error; - - return 0; + return devm_add_action_or_reset(zldev->dev, zl3073x_dev_dpll_fini, zldev); error: zl3073x_dev_dpll_fini(zldev); @@ -1026,6 +1022,7 @@ int zl3073x_dev_probe(struct zl3073x_dev *zldev, "Unknown or non-match chip ID: 0x%0x\n", id); } + zldev->chip_id = id; /* Read revision, firmware version and custom config version */ rc = zl3073x_read_u16(zldev, ZL_REG_REVISION, &revision); diff --git a/drivers/dpll/zl3073x/core.h b/drivers/dpll/zl3073x/core.h index 09bca2d0926d5..fd2af3c62a7d5 100644 --- a/drivers/dpll/zl3073x/core.h +++ b/drivers/dpll/zl3073x/core.h @@ -35,6 +35,7 @@ struct zl3073x_dpll; * @dev: pointer to device * @regmap: regmap to access device registers * @multiop_lock: to serialize multiple register operations + * @chip_id: chip ID read from hardware * @ref: array of input references' invariants * @out: array of outs' invariants * @synth: array of synths' invariants @@ -48,6 +49,7 @@ struct zl3073x_dev { struct device *dev; struct regmap *regmap; struct mutex multiop_lock; + u16 chip_id; /* Invariants */ struct zl3073x_ref ref[ZL3073X_NUM_REFS]; @@ -144,6 +146,32 @@ int zl3073x_write_hwreg_seq(struct zl3073x_dev *zldev, int zl3073x_ref_phase_offsets_update(struct zl3073x_dev *zldev, int channel); +/** + * zl3073x_dev_is_ref_phase_comp_32bit - check ref phase comp register size + * @zldev: pointer to zl3073x device + * + * Some chip IDs have a 32-bit wide ref_phase_offset_comp register instead + * of the default 48-bit. + * + * Return: true if the register is 32-bit, false if 48-bit + */ +static inline bool +zl3073x_dev_is_ref_phase_comp_32bit(struct zl3073x_dev *zldev) +{ + switch (zldev->chip_id) { + case 0x0E30: + case 0x0E93: + case 0x0E94: + case 0x0E95: + case 0x0E96: + case 0x0E97: + case 0x1F60: + return true; + default: + return false; + } +} + static inline bool zl3073x_is_n_pin(u8 id) { @@ -301,6 +329,36 @@ u8 zl3073x_dev_out_dpll_get(struct zl3073x_dev *zldev, u8 index) return zl3073x_synth_dpll_get(synth); } +/** + * zl3073x_dev_output_pin_freq_get - get output pin frequency + * @zldev: pointer to zl3073x device + * @id: output pin id + * + * Computes the output pin frequency based on the synth frequency, output + * divisor, and signal format. For N-div formats, N-pin frequency is + * additionally divided by esync_n_period. + * + * Return: frequency of the given output pin in Hz + */ +static inline u32 +zl3073x_dev_output_pin_freq_get(struct zl3073x_dev *zldev, u8 id) +{ + const struct zl3073x_synth *synth; + const struct zl3073x_out *out; + u8 out_id; + u32 freq; + + out_id = zl3073x_output_pin_out_get(id); + out = zl3073x_out_state_get(zldev, out_id); + synth = zl3073x_synth_state_get(zldev, zl3073x_out_synth_get(out)); + freq = zl3073x_synth_freq_get(synth) / out->div; + + if (zl3073x_out_is_ndiv(out) && zl3073x_is_n_pin(id)) + freq /= out->esync_n_period; + + return freq; +} + /** * zl3073x_dev_out_is_diff - check if the given output is differential * @zldev: pointer to zl3073x device diff --git a/drivers/dpll/zl3073x/dpll.c b/drivers/dpll/zl3073x/dpll.c index 897ed682dbf9c..8ffbede117c6f 100644 --- a/drivers/dpll/zl3073x/dpll.c +++ b/drivers/dpll/zl3073x/dpll.c @@ -475,8 +475,11 @@ zl3073x_dpll_input_pin_phase_adjust_get(const struct dpll_pin *dpll_pin, ref_id = zl3073x_input_pin_ref_get(pin->id); ref = zl3073x_ref_state_get(zldev, ref_id); - /* Perform sign extension for 48bit signed value */ - phase_comp = sign_extend64(ref->phase_comp, 47); + /* Perform sign extension based on register width */ + if (zl3073x_dev_is_ref_phase_comp_32bit(zldev)) + phase_comp = sign_extend64(ref->phase_comp, 31); + else + phase_comp = sign_extend64(ref->phase_comp, 47); /* Reverse two's complement negation applied during set and convert * to 32bit signed int @@ -916,46 +919,9 @@ zl3073x_dpll_output_pin_frequency_get(const struct dpll_pin *dpll_pin, struct netlink_ext_ack *extack) { struct zl3073x_dpll *zldpll = dpll_priv; - struct zl3073x_dev *zldev = zldpll->dev; struct zl3073x_dpll_pin *pin = pin_priv; - const struct zl3073x_synth *synth; - const struct zl3073x_out *out; - u32 synth_freq; - u8 out_id; - - out_id = zl3073x_output_pin_out_get(pin->id); - out = zl3073x_out_state_get(zldev, out_id); - - /* Get attached synth frequency */ - synth = zl3073x_synth_state_get(zldev, zl3073x_out_synth_get(out)); - synth_freq = zl3073x_synth_freq_get(synth); - switch (zl3073x_out_signal_format_get(out)) { - case ZL_OUTPUT_MODE_SIGNAL_FORMAT_2_NDIV: - case ZL_OUTPUT_MODE_SIGNAL_FORMAT_2_NDIV_INV: - /* In case of divided format we have to distiguish between - * given output pin type. - * - * For P-pin the resulting frequency is computed as simple - * division of synth frequency and output divisor. - * - * For N-pin we have to divide additionally by divisor stored - * in esync_n_period output mailbox register that is used as - * N-pin divisor for these modes. - */ - *frequency = synth_freq / out->div; - - if (!zl3073x_dpll_is_p_pin(pin)) - *frequency = (u32)*frequency / out->esync_n_period; - - break; - default: - /* In other modes the resulting frequency is computed as - * division of synth frequency and output divisor. - */ - *frequency = synth_freq / out->div; - break; - } + *frequency = zl3073x_dev_output_pin_freq_get(zldpll->dev, pin->id); return 0; } diff --git a/drivers/dpll/zl3073x/out.h b/drivers/dpll/zl3073x/out.h index e8ea7a0e0f071..318f9bb8da3a0 100644 --- a/drivers/dpll/zl3073x/out.h +++ b/drivers/dpll/zl3073x/out.h @@ -79,6 +79,23 @@ static inline bool zl3073x_out_is_enabled(const struct zl3073x_out *out) return !!FIELD_GET(ZL_OUTPUT_CTRL_EN, out->ctrl); } +/** + * zl3073x_out_is_ndiv - check if the given output is in N-div mode + * @out: pointer to out state + * + * Return: true if output is in N-div mode, false otherwise + */ +static inline bool zl3073x_out_is_ndiv(const struct zl3073x_out *out) +{ + switch (zl3073x_out_signal_format_get(out)) { + case ZL_OUTPUT_MODE_SIGNAL_FORMAT_2_NDIV: + case ZL_OUTPUT_MODE_SIGNAL_FORMAT_2_NDIV_INV: + return true; + default: + return false; + } +} + /** * zl3073x_out_synth_get - get synth connected to given output * @out: pointer to out state diff --git a/drivers/dpll/zl3073x/prop.c b/drivers/dpll/zl3073x/prop.c index ad1f099cbe2b5..8523dc8c226e6 100644 --- a/drivers/dpll/zl3073x/prop.c +++ b/drivers/dpll/zl3073x/prop.c @@ -193,9 +193,10 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, { struct dpll_pin_frequency *ranges; struct zl3073x_pin_props *props; - int i, j, num_freqs, rc; + int i, j, num_freqs = 0, rc; + u64 *freqs = NULL; const char *type; - u64 *freqs; + u32 curr_freq; props = kzalloc(sizeof(*props), GFP_KERNEL); if (!props) @@ -207,6 +208,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, props->dpll_props.capabilities = DPLL_PIN_CAPABILITIES_PRIORITY_CAN_CHANGE | DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE; + curr_freq = zl3073x_dev_ref_freq_get(zldev, index); } else { u8 out, synth; u32 f; @@ -220,6 +222,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, synth = zl3073x_dev_out_synth_get(zldev, out); f = 2 * zl3073x_dev_synth_freq_get(zldev, synth); props->dpll_props.phase_gran = f ? div_u64(PSEC_PER_SEC, f) : 1; + curr_freq = zl3073x_dev_output_pin_freq_get(zldev, index); } props->dpll_props.phase_range.min = S32_MIN; @@ -230,7 +233,7 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, /* Get firmware node for the given pin */ rc = zl3073x_prop_pin_fwnode_get(zldev, props, dir, index); if (rc) - return props; /* Return if it does not exist */ + goto skip_fwnode_props; /* Look for label property and store the value as board label */ fwnode_property_read_string(props->fwnode, "label", @@ -264,9 +267,10 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, /* Read supported frequencies property if it is specified */ num_freqs = fwnode_property_count_u64(props->fwnode, "supported-frequencies-hz"); - if (num_freqs <= 0) - /* Return if the property does not exist or number is 0 */ - return props; + if (num_freqs <= 0) { + num_freqs = 0; + goto skip_fwnode_props; + } /* The firmware node specifies list of supported frequencies while * DPLL core pin properties requires list of frequency ranges. @@ -283,19 +287,25 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev, "supported-frequencies-hz", freqs, num_freqs); - /* Allocate frequency ranges list and fill it */ - ranges = kcalloc(num_freqs, sizeof(*ranges), GFP_KERNEL); +skip_fwnode_props: + /* Allocate frequency ranges list - extra slot for current frequency */ + ranges = kcalloc(num_freqs + 1, sizeof(*ranges), GFP_KERNEL); if (!ranges) { rc = -ENOMEM; goto err_alloc_ranges; } - /* Convert list of frequencies to list of frequency ranges but - * filter-out frequencies that are not representable by device + /* Start with current frequency at index 0 */ + ranges[0] = (struct dpll_pin_frequency)DPLL_PIN_FREQUENCY(curr_freq); + + /* Add frequencies from firmware node, skipping current frequency + * and filtering out frequencies not representable by device */ - for (i = 0, j = 0; i < num_freqs; i++) { + for (i = 0, j = 1; i < num_freqs; i++) { struct dpll_pin_frequency freq = DPLL_PIN_FREQUENCY(freqs[i]); + if (freqs[i] == curr_freq) + continue; if (zl3073x_pin_check_freq(zldev, dir, index, freqs[i])) { ranges[j] = freq; j++; diff --git a/drivers/dpll/zl3073x/ref.c b/drivers/dpll/zl3073x/ref.c index aa2de13effa87..6b65e61039999 100644 --- a/drivers/dpll/zl3073x/ref.c +++ b/drivers/dpll/zl3073x/ref.c @@ -121,8 +121,16 @@ int zl3073x_ref_state_fetch(struct zl3073x_dev *zldev, u8 index) return rc; /* Read phase compensation register */ - rc = zl3073x_read_u48(zldev, ZL_REG_REF_PHASE_OFFSET_COMP, - &ref->phase_comp); + if (zl3073x_dev_is_ref_phase_comp_32bit(zldev)) { + u32 val; + + rc = zl3073x_read_u32(zldev, ZL_REG_REF_PHASE_OFFSET_COMP_32, + &val); + ref->phase_comp = val; + } else { + rc = zl3073x_read_u48(zldev, ZL_REG_REF_PHASE_OFFSET_COMP, + &ref->phase_comp); + } if (rc) return rc; @@ -179,9 +187,16 @@ int zl3073x_ref_state_set(struct zl3073x_dev *zldev, u8 index, if (!rc && dref->sync_ctrl != ref->sync_ctrl) rc = zl3073x_write_u8(zldev, ZL_REG_REF_SYNC_CTRL, ref->sync_ctrl); - if (!rc && dref->phase_comp != ref->phase_comp) - rc = zl3073x_write_u48(zldev, ZL_REG_REF_PHASE_OFFSET_COMP, - ref->phase_comp); + if (!rc && dref->phase_comp != ref->phase_comp) { + if (zl3073x_dev_is_ref_phase_comp_32bit(zldev)) + rc = zl3073x_write_u32(zldev, + ZL_REG_REF_PHASE_OFFSET_COMP_32, + ref->phase_comp); + else + rc = zl3073x_write_u48(zldev, + ZL_REG_REF_PHASE_OFFSET_COMP, + ref->phase_comp); + } if (rc) return rc; diff --git a/drivers/dpll/zl3073x/ref.h b/drivers/dpll/zl3073x/ref.h index efc7f59cd9f9c..0d8618f5ce8df 100644 --- a/drivers/dpll/zl3073x/ref.h +++ b/drivers/dpll/zl3073x/ref.h @@ -91,6 +91,8 @@ zl3073x_ref_freq_set(struct zl3073x_ref *ref, u32 freq) ref->freq_base = base; ref->freq_mult = mult; + ref->freq_ratio_m = 1; + ref->freq_ratio_n = 1; return 0; } diff --git a/drivers/dpll/zl3073x/regs.h b/drivers/dpll/zl3073x/regs.h index d837bee72b178..5573d7188406b 100644 --- a/drivers/dpll/zl3073x/regs.h +++ b/drivers/dpll/zl3073x/regs.h @@ -194,6 +194,7 @@ #define ZL_REF_CONFIG_DIFF_EN BIT(2) #define ZL_REG_REF_PHASE_OFFSET_COMP ZL_REG(10, 0x28, 6) +#define ZL_REG_REF_PHASE_OFFSET_COMP_32 ZL_REG(10, 0x28, 4) #define ZL_REG_REF_SYNC_CTRL ZL_REG(10, 0x2e, 1) #define ZL_REF_SYNC_CTRL_MODE GENMASK(2, 0) diff --git a/drivers/gpu/drm/mgag200/mgag200_bmc.c b/drivers/gpu/drm/mgag200/mgag200_bmc.c index a689c71ff1653..bbdeb791c5b38 100644 --- a/drivers/gpu/drm/mgag200/mgag200_bmc.c +++ b/drivers/gpu/drm/mgag200/mgag200_bmc.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only #include +#include #include #include @@ -12,7 +13,7 @@ void mgag200_bmc_stop_scanout(struct mga_device *mdev) { u8 tmp; - int iter_max; + int ret; /* * 1 - The first step is to inform the BMC of an upcoming mode @@ -42,30 +43,22 @@ void mgag200_bmc_stop_scanout(struct mga_device *mdev) /* * 3a- The third step is to verify if there is an active scan. - * We are waiting for a 0 on remhsyncsts ). + * We are waiting for a 0 on remhsyncsts (). */ - iter_max = 300; - while (!(tmp & 0x1) && iter_max) { - WREG8(DAC_INDEX, MGA1064_SPAREREG); - tmp = RREG8(DAC_DATA); - udelay(1000); - iter_max--; - } + ret = read_poll_timeout(RREG_DAC, tmp, !(tmp & 0x1), + 1000, 300000, false, + MGA1064_SPAREREG); + if (ret == -ETIMEDOUT) + return; /* - * 3b- This step occurs only if the remove is actually + * 3b- This step occurs only if the remote BMC is actually * scanning. We are waiting for the end of the frame which is * a 1 on remvsyncsts (XSPAREREG<1>) */ - if (iter_max) { - iter_max = 300; - while ((tmp & 0x2) && iter_max) { - WREG8(DAC_INDEX, MGA1064_SPAREREG); - tmp = RREG8(DAC_DATA); - udelay(1000); - iter_max--; - } - } + (void)read_poll_timeout(RREG_DAC, tmp, (tmp & 0x2), + 1000, 300000, false, + MGA1064_SPAREREG); } void mgag200_bmc_start_scanout(struct mga_device *mdev) diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h index f4bf40cd7c88a..a875c4bf8cbe4 100644 --- a/drivers/gpu/drm/mgag200/mgag200_drv.h +++ b/drivers/gpu/drm/mgag200/mgag200_drv.h @@ -111,6 +111,12 @@ #define DAC_INDEX 0x3c00 #define DAC_DATA 0x3c0a +#define RREG_DAC(reg) \ + ({ \ + WREG8(DAC_INDEX, reg); \ + RREG8(DAC_DATA); \ + }) \ + #define WREG_DAC(reg, v) \ do { \ WREG8(DAC_INDEX, reg); \ diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 9b2c710f8da18..da1f0ea85625d 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1208,10 +1208,20 @@ static int wacom_intuos_bt_irq(struct wacom_wac *wacom, size_t len) switch (data[0]) { case 0x04: + if (len < 32) { + dev_warn(wacom->pen_input->dev.parent, + "Report 0x04 too short: %zu bytes\n", len); + break; + } wacom_intuos_bt_process_data(wacom, data + i); i += 10; fallthrough; case 0x03: + if (i == 1 && len < 22) { + dev_warn(wacom->pen_input->dev.parent, + "Report 0x03 too short: %zu bytes\n", len); + break; + } wacom_intuos_bt_process_data(wacom, data + i); i += 10; wacom_intuos_bt_process_data(wacom, data + i); diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c index 942cd47eb52da..aeec5b9a1dd5c 100644 --- a/drivers/md/persistent-data/dm-btree-remove.c +++ b/drivers/md/persistent-data/dm-btree-remove.c @@ -490,12 +490,20 @@ static int rebalance_children(struct shadow_spine *s, if (le32_to_cpu(n->header.nr_entries) == 1) { struct dm_block *child; + int is_shared; dm_block_t b = value64(n, 0); + r = dm_tm_block_is_shared(info->tm, b, &is_shared); + if (r) + return r; + r = dm_tm_read_lock(info->tm, b, &btree_node_validator, &child); if (r) return r; + if (is_shared) + inc_children(info->tm, dm_block_data(child), vt); + memcpy(n, dm_block_data(child), dm_bm_block_size(dm_tm_get_bm(info->tm))); diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c index a293b08f36d46..2eb47789422ef 100644 --- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c +++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-switch.c @@ -3014,6 +3014,19 @@ static int dpaa2_switch_init(struct fsl_mc_device *sw_dev) goto err_close; } + if (!ethsw->sw_attr.num_ifs) { + dev_err(dev, "DPSW device has no interfaces\n"); + err = -ENODEV; + goto err_close; + } + + if (ethsw->sw_attr.num_ifs >= DPSW_MAX_IF) { + dev_err(dev, "DPSW num_ifs %u exceeds max %u\n", + ethsw->sw_attr.num_ifs, DPSW_MAX_IF); + err = -EINVAL; + goto err_close; + } + err = dpsw_get_api_version(ethsw->mc_io, 0, ðsw->major, ðsw->minor); diff --git a/drivers/net/ethernet/intel/ice/ice.h b/drivers/net/ethernet/intel/ice/ice.h index 00f75d87c73f9..ae1ebf507f291 100644 --- a/drivers/net/ethernet/intel/ice/ice.h +++ b/drivers/net/ethernet/intel/ice/ice.h @@ -839,6 +839,28 @@ static inline void ice_tx_xsk_pool(struct ice_vsi *vsi, u16 qid) WRITE_ONCE(ring->xsk_pool, ice_get_xp_from_qid(vsi, qid)); } +/** + * ice_get_max_txq - return the maximum number of Tx queues for in a PF + * @pf: PF structure + * + * Return: maximum number of Tx queues + */ +static inline int ice_get_max_txq(struct ice_pf *pf) +{ + return min(num_online_cpus(), pf->hw.func_caps.common_cap.num_txq); +} + +/** + * ice_get_max_rxq - return the maximum number of Rx queues for in a PF + * @pf: PF structure + * + * Return: maximum number of Rx queues + */ +static inline int ice_get_max_rxq(struct ice_pf *pf) +{ + return min(num_online_cpus(), pf->hw.func_caps.common_cap.num_rxq); +} + /** * ice_get_main_vsi - Get the PF VSI * @pf: PF instance diff --git a/drivers/net/ethernet/intel/ice/ice_ethtool.c b/drivers/net/ethernet/intel/ice/ice_ethtool.c index e9f2618950c80..33c8182265652 100644 --- a/drivers/net/ethernet/intel/ice/ice_ethtool.c +++ b/drivers/net/ethernet/intel/ice/ice_ethtool.c @@ -3756,24 +3756,6 @@ ice_get_ts_info(struct net_device *dev, struct kernel_ethtool_ts_info *info) return 0; } -/** - * ice_get_max_txq - return the maximum number of Tx queues for in a PF - * @pf: PF structure - */ -static int ice_get_max_txq(struct ice_pf *pf) -{ - return min(num_online_cpus(), pf->hw.func_caps.common_cap.num_txq); -} - -/** - * ice_get_max_rxq - return the maximum number of Rx queues for in a PF - * @pf: PF structure - */ -static int ice_get_max_rxq(struct ice_pf *pf) -{ - return min(num_online_cpus(), pf->hw.func_caps.common_cap.num_rxq); -} - /** * ice_get_combined_cnt - return the current number of combined channels * @vsi: PF VSI pointer diff --git a/drivers/net/ethernet/intel/ice/ice_irq.c b/drivers/net/ethernet/intel/ice/ice_irq.c index 30801fd375f01..1d9b2d646474b 100644 --- a/drivers/net/ethernet/intel/ice/ice_irq.c +++ b/drivers/net/ethernet/intel/ice/ice_irq.c @@ -106,9 +106,10 @@ static struct ice_irq_entry *ice_get_irq_res(struct ice_pf *pf, #define ICE_RDMA_AEQ_MSIX 1 static int ice_get_default_msix_amount(struct ice_pf *pf) { - return ICE_MIN_LAN_OICR_MSIX + num_online_cpus() + + return ICE_MIN_LAN_OICR_MSIX + netif_get_num_default_rss_queues() + (test_bit(ICE_FLAG_FD_ENA, pf->flags) ? ICE_FDIR_MSIX : 0) + - (ice_is_rdma_ena(pf) ? num_online_cpus() + ICE_RDMA_AEQ_MSIX : 0); + (ice_is_rdma_ena(pf) ? netif_get_num_default_rss_queues() + + ICE_RDMA_AEQ_MSIX : 0); } /** diff --git a/drivers/net/ethernet/intel/ice/ice_lib.c b/drivers/net/ethernet/intel/ice/ice_lib.c index 32c2f4c315c7a..c8e463e734268 100644 --- a/drivers/net/ethernet/intel/ice/ice_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_lib.c @@ -155,12 +155,14 @@ static void ice_vsi_set_num_desc(struct ice_vsi *vsi) static u16 ice_get_rxq_count(struct ice_pf *pf) { - return min(ice_get_avail_rxq_count(pf), num_online_cpus()); + return min(ice_get_avail_rxq_count(pf), + netif_get_num_default_rss_queues()); } static u16 ice_get_txq_count(struct ice_pf *pf) { - return min(ice_get_avail_txq_count(pf), num_online_cpus()); + return min(ice_get_avail_txq_count(pf), + netif_get_num_default_rss_queues()); } /** @@ -909,13 +911,15 @@ static void ice_vsi_set_rss_params(struct ice_vsi *vsi) if (vsi->type == ICE_VSI_CHNL) vsi->rss_size = min_t(u16, vsi->num_rxq, max_rss_size); else - vsi->rss_size = min_t(u16, num_online_cpus(), + vsi->rss_size = min_t(u16, + netif_get_num_default_rss_queues(), max_rss_size); vsi->rss_lut_type = ICE_LUT_PF; break; case ICE_VSI_SF: vsi->rss_table_size = ICE_LUT_VSI_SIZE; - vsi->rss_size = min_t(u16, num_online_cpus(), max_rss_size); + vsi->rss_size = min_t(u16, netif_get_num_default_rss_queues(), + max_rss_size); vsi->rss_lut_type = ICE_LUT_VSI; break; case ICE_VSI_VF: diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index 175d9f1729063..b4deab76b62c1 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4699,8 +4699,8 @@ static int ice_cfg_netdev(struct ice_vsi *vsi) struct net_device *netdev; u8 mac_addr[ETH_ALEN]; - netdev = alloc_etherdev_mqs(sizeof(*np), vsi->alloc_txq, - vsi->alloc_rxq); + netdev = alloc_etherdev_mqs(sizeof(*np), ice_get_max_txq(vsi->back), + ice_get_max_rxq(vsi->back)); if (!netdev) return -ENOMEM; diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c index c2d98ee6652f3..1d25dc9ebca8b 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/fweh.c @@ -153,6 +153,11 @@ static void brcmf_fweh_handle_if_event(struct brcmf_pub *drvr, bphy_err(drvr, "invalid interface index: %u\n", ifevent->ifidx); return; } + if (ifevent->bsscfgidx >= BRCMF_MAX_IFS) { + bphy_err(drvr, "invalid bsscfg index: %u\n", + ifevent->bsscfgidx); + return; + } ifp = drvr->iflist[ifevent->bsscfgidx]; diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index 7f8928fffdc7a..62438e84e52a3 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -312,6 +312,7 @@ struct lpfc_defer_flogi_acc { u16 rx_id; u16 ox_id; struct lpfc_nodelist *ndlp; + }; #define LPFC_VMID_TIMER 300 /* timer interval in seconds */ @@ -634,7 +635,6 @@ struct lpfc_vport { #define FC_CT_RSPN_ID 0x8 /* RSPN_ID accepted by switch */ #define FC_CT_RFT_ID 0x10 /* RFT_ID accepted by switch */ #define FC_CT_RPRT_DEFER 0x20 /* Defer issuing FDMI RPRT */ -#define FC_CT_RSPNI_PNI 0x40 /* RSPNI_PNI accepted by switch */ struct list_head fc_nodes; spinlock_t fc_nodes_list_lock; /* spinlock for fc_nodes list */ @@ -662,12 +662,15 @@ struct lpfc_vport { uint32_t num_disc_nodes; /* in addition to hba_state */ uint32_t gidft_inp; /* cnt of outstanding GID_FTs */ + uint32_t fc_nlp_cnt; /* outstanding NODELIST requests */ uint32_t fc_rscn_id_cnt; /* count of RSCNs payloads in list */ uint32_t fc_rscn_flush; /* flag use of fc_rscn_id_list */ struct lpfc_dmabuf *fc_rscn_id_list[FC_MAX_HOLD_RSCN]; struct lpfc_name fc_nodename; /* fc nodename */ struct lpfc_name fc_portname; /* fc portname */ + struct lpfc_work_evt disc_timeout_evt; + struct timer_list fc_disctmo; /* Discovery rescue timer */ uint8_t fc_ns_retry; /* retries for fabric nameserver */ uint32_t fc_prli_sent; /* cntr for outstanding PRLIs */ @@ -742,6 +745,12 @@ struct lpfc_vport { struct lpfc_vmid_priority_info vmid_priority; #ifdef CONFIG_SCSI_LPFC_DEBUG_FS + struct dentry *debug_disc_trc; + struct dentry *debug_nodelist; + struct dentry *debug_nvmestat; + struct dentry *debug_scsistat; + struct dentry *debug_ioktime; + struct dentry *debug_hdwqstat; struct dentry *vport_debugfs_root; struct lpfc_debugfs_trc *disc_trc; atomic_t disc_trc_cnt; @@ -759,6 +768,7 @@ struct lpfc_vport { /* There is a single nvme instance per vport. */ struct nvme_fc_local_port *localport; uint8_t nvmei_support; /* driver supports NVME Initiator */ + uint32_t last_fcp_wqidx; uint32_t rcv_flogi_cnt; /* How many unsol FLOGIs ACK'd. */ }; @@ -1051,6 +1061,8 @@ struct lpfc_hba { struct lpfc_dmabuf hbqslimp; + uint16_t pci_cfg_value; + uint8_t fc_linkspeed; /* Link speed after last READ_LA */ uint32_t fc_eventTag; /* event tag for link attention */ @@ -1077,10 +1089,9 @@ struct lpfc_hba { struct lpfc_stats fc_stat; + struct lpfc_nodelist fc_fcpnodev; /* nodelist entry for no device */ uint32_t nport_event_cnt; /* timestamp for nlplist entry */ - unsigned long pni; /* 64-bit Platform Name Identifier */ - uint8_t wwnn[8]; uint8_t wwpn[8]; uint32_t RandomData[7]; @@ -1219,6 +1230,9 @@ struct lpfc_hba { uint32_t hbq_count; /* Count of configured HBQs */ struct hbq_s hbqs[LPFC_MAX_HBQS]; /* local copy of hbq indicies */ + atomic_t fcp_qidx; /* next FCP WQ (RR Policy) */ + atomic_t nvme_qidx; /* next NVME WQ (RR Policy) */ + phys_addr_t pci_bar0_map; /* Physical address for PCI BAR0 */ phys_addr_t pci_bar1_map; /* Physical address for PCI BAR1 */ phys_addr_t pci_bar2_map; /* Physical address for PCI BAR2 */ @@ -1335,9 +1349,30 @@ struct lpfc_hba { unsigned long last_ramp_down_time; #ifdef CONFIG_SCSI_LPFC_DEBUG_FS struct dentry *hba_debugfs_root; - unsigned int debugfs_vport_count; - + atomic_t debugfs_vport_count; + struct dentry *debug_multixri_pools; + struct dentry *debug_hbqinfo; + struct dentry *debug_dumpHostSlim; + struct dentry *debug_dumpHBASlim; + struct dentry *debug_InjErrLBA; /* LBA to inject errors at */ + struct dentry *debug_InjErrNPortID; /* NPortID to inject errors at */ + struct dentry *debug_InjErrWWPN; /* WWPN to inject errors at */ + struct dentry *debug_writeGuard; /* inject write guard_tag errors */ + struct dentry *debug_writeApp; /* inject write app_tag errors */ + struct dentry *debug_writeRef; /* inject write ref_tag errors */ + struct dentry *debug_readGuard; /* inject read guard_tag errors */ + struct dentry *debug_readApp; /* inject read app_tag errors */ + struct dentry *debug_readRef; /* inject read ref_tag errors */ + + struct dentry *debug_nvmeio_trc; struct lpfc_debugfs_nvmeio_trc *nvmeio_trc; + struct dentry *debug_hdwqinfo; +#ifdef LPFC_HDWQ_LOCK_STAT + struct dentry *debug_lockstat; +#endif + struct dentry *debug_cgn_buffer; + struct dentry *debug_rx_monitor; + struct dentry *debug_ras_log; atomic_t nvmeio_trc_cnt; uint32_t nvmeio_trc_size; uint32_t nvmeio_trc_output_idx; @@ -1354,10 +1389,19 @@ struct lpfc_hba { sector_t lpfc_injerr_lba; #define LPFC_INJERR_LBA_OFF (sector_t)(-1) + struct dentry *debug_slow_ring_trc; struct lpfc_debugfs_trc *slow_ring_trc; atomic_t slow_ring_trc_cnt; /* iDiag debugfs sub-directory */ struct dentry *idiag_root; + struct dentry *idiag_pci_cfg; + struct dentry *idiag_bar_acc; + struct dentry *idiag_que_info; + struct dentry *idiag_que_acc; + struct dentry *idiag_drb_acc; + struct dentry *idiag_ctl_acc; + struct dentry *idiag_mbx_acc; + struct dentry *idiag_ext_acc; uint8_t lpfc_idiag_last_eq; #endif uint16_t nvmeio_trc_on; diff --git a/drivers/scsi/lpfc/lpfc_ct.c b/drivers/scsi/lpfc/lpfc_ct.c index d3caac3942916..530dddd39bab4 100644 --- a/drivers/scsi/lpfc/lpfc_ct.c +++ b/drivers/scsi/lpfc/lpfc_ct.c @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -264,9 +264,9 @@ lpfc_ct_reject_event(struct lpfc_nodelist *ndlp, ct_free_mp: kfree(mp); ct_exit: - lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, - "6440 Unsol CT: Rsp err %d Data: x%lx\n", - rc, vport->fc_flag); + lpfc_printf_vlog(vport, KERN_ERR, LOG_ELS, + "6440 Unsol CT: Rsp err %d Data: x%lx\n", + rc, vport->fc_flag); } /** @@ -313,7 +313,7 @@ lpfc_ct_handle_mibreq(struct lpfc_hba *phba, struct lpfc_iocbq *ctiocbq) mi_cmd = be16_to_cpu(ct_req->CommandResponse.bits.CmdRsp); lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, - "6442 MI Cmd: x%x Not Supported\n", mi_cmd); + "6442 MI Cmd : x%x Not Supported\n", mi_cmd); lpfc_ct_reject_event(ndlp, ct_req, bf_get(wqe_ctxt_tag, &ctiocbq->wqe.xmit_els_rsp.wqe_com), @@ -1742,28 +1742,6 @@ lpfc_cmpl_ct_cmd_rsnn_nn(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, return; } -static void -lpfc_cmpl_ct_cmd_rspni_pni(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, - struct lpfc_iocbq *rspiocb) -{ - struct lpfc_vport *vport; - struct lpfc_dmabuf *outp; - struct lpfc_sli_ct_request *ctrsp; - u32 ulp_status; - - vport = cmdiocb->vport; - ulp_status = get_job_ulpstatus(phba, rspiocb); - - if (ulp_status == IOSTAT_SUCCESS) { - outp = cmdiocb->rsp_dmabuf; - ctrsp = (struct lpfc_sli_ct_request *)outp->virt; - if (be16_to_cpu(ctrsp->CommandResponse.bits.CmdRsp) == - SLI_CT_RESPONSE_FS_ACC) - vport->ct_flags |= FC_CT_RSPNI_PNI; - } - lpfc_cmpl_ct(phba, cmdiocb, rspiocb); -} - static void lpfc_cmpl_ct_cmd_da_id(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, struct lpfc_iocbq *rspiocb) @@ -1978,8 +1956,6 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, bpl->tus.f.bdeSize = RSPN_REQUEST_SZ; else if (cmdcode == SLI_CTNS_RSNN_NN) bpl->tus.f.bdeSize = RSNN_REQUEST_SZ; - else if (cmdcode == SLI_CTNS_RSPNI_PNI) - bpl->tus.f.bdeSize = RSPNI_REQUEST_SZ; else if (cmdcode == SLI_CTNS_DA_ID) bpl->tus.f.bdeSize = DA_ID_REQUEST_SZ; else if (cmdcode == SLI_CTNS_RFF_ID) @@ -2101,18 +2077,6 @@ lpfc_ns_cmd(struct lpfc_vport *vport, int cmdcode, CtReq->un.rsnn.symbname, size); cmpl = lpfc_cmpl_ct_cmd_rsnn_nn; break; - case SLI_CTNS_RSPNI_PNI: - vport->ct_flags &= ~FC_CT_RSPNI_PNI; - CtReq->CommandResponse.bits.CmdRsp = - cpu_to_be16(SLI_CTNS_RSPNI_PNI); - CtReq->un.rspni.pni = cpu_to_be64(phba->pni); - scnprintf(CtReq->un.rspni.symbname, - sizeof(CtReq->un.rspni.symbname), "OS Host Name::%s", - phba->os_host_name); - CtReq->un.rspni.len = strnlen(CtReq->un.rspni.symbname, - sizeof(CtReq->un.rspni.symbname)); - cmpl = lpfc_cmpl_ct_cmd_rspni_pni; - break; case SLI_CTNS_DA_ID: /* Implement DA_ID Nameserver request */ CtReq->CommandResponse.bits.CmdRsp = @@ -2265,6 +2229,21 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /* Look for a retryable error */ if (ulp_status == IOSTAT_LOCAL_REJECT) { switch ((ulp_word4 & IOERR_PARAM_MASK)) { + case IOERR_SLI_ABORTED: + case IOERR_SLI_DOWN: + /* Driver aborted this IO. No retry as error + * is likely Offline->Online or some adapter + * error. Recovery will try again, but if port + * is not active there's no point to continue + * issuing follow up FDMI commands. + */ + if (!(phba->sli.sli_flag & LPFC_SLI_ACTIVE)) { + free_ndlp = cmdiocb->ndlp; + lpfc_ct_free_iocb(phba, cmdiocb); + lpfc_nlp_put(free_ndlp); + return; + } + break; case IOERR_ABORT_IN_PROGRESS: case IOERR_SEQUENCE_TIMEOUT: case IOERR_ILLEGAL_FRAME: @@ -2290,9 +2269,6 @@ lpfc_cmpl_ct_disc_fdmi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, lpfc_ct_free_iocb(phba, cmdiocb); lpfc_nlp_put(free_ndlp); - if (ulp_status != IOSTAT_SUCCESS) - return; - ndlp = lpfc_findnode_did(vport, FDMI_DID); if (!ndlp) return; diff --git a/drivers/scsi/lpfc/lpfc_debugfs.c b/drivers/scsi/lpfc/lpfc_debugfs.c index 92b5b2dbe8474..3fd1aa5cc78cc 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.c +++ b/drivers/scsi/lpfc/lpfc_debugfs.c @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2007-2015 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -2373,117 +2373,93 @@ lpfc_debugfs_dumpHostSlim_open(struct inode *inode, struct file *file) static ssize_t lpfc_debugfs_dif_err_read(struct file *file, char __user *buf, - size_t nbytes, loff_t *ppos) + size_t nbytes, loff_t *ppos) { + struct dentry *dent = file->f_path.dentry; struct lpfc_hba *phba = file->private_data; - int kind = debugfs_get_aux_num(file); - char cbuf[32] = {0}; + char cbuf[32]; + uint64_t tmp = 0; int cnt = 0; - switch (kind) { - case writeGuard: - cnt = scnprintf(cbuf, sizeof(cbuf), "%u\n", - phba->lpfc_injerr_wgrd_cnt); - break; - case writeApp: - cnt = scnprintf(cbuf, sizeof(cbuf), "%u\n", - phba->lpfc_injerr_wapp_cnt); - break; - case writeRef: - cnt = scnprintf(cbuf, sizeof(cbuf), "%u\n", - phba->lpfc_injerr_wref_cnt); - break; - case readGuard: - cnt = scnprintf(cbuf, sizeof(cbuf), "%u\n", - phba->lpfc_injerr_rgrd_cnt); - break; - case readApp: - cnt = scnprintf(cbuf, sizeof(cbuf), "%u\n", - phba->lpfc_injerr_rapp_cnt); - break; - case readRef: - cnt = scnprintf(cbuf, sizeof(cbuf), "%u\n", - phba->lpfc_injerr_rref_cnt); - break; - case InjErrNPortID: - cnt = scnprintf(cbuf, sizeof(cbuf), "0x%06x\n", + if (dent == phba->debug_writeGuard) + cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wgrd_cnt); + else if (dent == phba->debug_writeApp) + cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wapp_cnt); + else if (dent == phba->debug_writeRef) + cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_wref_cnt); + else if (dent == phba->debug_readGuard) + cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rgrd_cnt); + else if (dent == phba->debug_readApp) + cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rapp_cnt); + else if (dent == phba->debug_readRef) + cnt = scnprintf(cbuf, 32, "%u\n", phba->lpfc_injerr_rref_cnt); + else if (dent == phba->debug_InjErrNPortID) + cnt = scnprintf(cbuf, 32, "0x%06x\n", phba->lpfc_injerr_nportid); - break; - case InjErrWWPN: - cnt = scnprintf(cbuf, sizeof(cbuf), "0x%016llx\n", - be64_to_cpu(phba->lpfc_injerr_wwpn.u.wwn_be)); - break; - case InjErrLBA: - if (phba->lpfc_injerr_lba == LPFC_INJERR_LBA_OFF) - cnt = scnprintf(cbuf, sizeof(cbuf), "off\n"); + else if (dent == phba->debug_InjErrWWPN) { + memcpy(&tmp, &phba->lpfc_injerr_wwpn, sizeof(struct lpfc_name)); + tmp = cpu_to_be64(tmp); + cnt = scnprintf(cbuf, 32, "0x%016llx\n", tmp); + } else if (dent == phba->debug_InjErrLBA) { + if (phba->lpfc_injerr_lba == (sector_t)(-1)) + cnt = scnprintf(cbuf, 32, "off\n"); else - cnt = scnprintf(cbuf, sizeof(cbuf), "0x%llx\n", - (uint64_t)phba->lpfc_injerr_lba); - break; - default: - lpfc_log_msg(phba, KERN_WARNING, LOG_INIT, - "0547 Unknown debugfs error injection entry\n"); - break; - } + cnt = scnprintf(cbuf, 32, "0x%llx\n", + (uint64_t) phba->lpfc_injerr_lba); + } else + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0547 Unknown debugfs error injection entry\n"); return simple_read_from_buffer(buf, nbytes, ppos, &cbuf, cnt); } static ssize_t lpfc_debugfs_dif_err_write(struct file *file, const char __user *buf, - size_t nbytes, loff_t *ppos) + size_t nbytes, loff_t *ppos) { + struct dentry *dent = file->f_path.dentry; struct lpfc_hba *phba = file->private_data; - int kind = debugfs_get_aux_num(file); - char dstbuf[33] = {0}; - unsigned long long tmp; - unsigned long size; + char dstbuf[33]; + uint64_t tmp = 0; + int size; - size = (nbytes < (sizeof(dstbuf) - 1)) ? nbytes : (sizeof(dstbuf) - 1); + memset(dstbuf, 0, 33); + size = (nbytes < 32) ? nbytes : 32; if (copy_from_user(dstbuf, buf, size)) return -EFAULT; - if (kstrtoull(dstbuf, 0, &tmp)) { - if (kind != InjErrLBA || !strstr(dstbuf, "off")) - return -EINVAL; + if (dent == phba->debug_InjErrLBA) { + if ((dstbuf[0] == 'o') && (dstbuf[1] == 'f') && + (dstbuf[2] == 'f')) + tmp = (uint64_t)(-1); } - switch (kind) { - case writeGuard: + if ((tmp == 0) && (kstrtoull(dstbuf, 0, &tmp))) + return -EINVAL; + + if (dent == phba->debug_writeGuard) phba->lpfc_injerr_wgrd_cnt = (uint32_t)tmp; - break; - case writeApp: + else if (dent == phba->debug_writeApp) phba->lpfc_injerr_wapp_cnt = (uint32_t)tmp; - break; - case writeRef: + else if (dent == phba->debug_writeRef) phba->lpfc_injerr_wref_cnt = (uint32_t)tmp; - break; - case readGuard: + else if (dent == phba->debug_readGuard) phba->lpfc_injerr_rgrd_cnt = (uint32_t)tmp; - break; - case readApp: + else if (dent == phba->debug_readApp) phba->lpfc_injerr_rapp_cnt = (uint32_t)tmp; - break; - case readRef: + else if (dent == phba->debug_readRef) phba->lpfc_injerr_rref_cnt = (uint32_t)tmp; - break; - case InjErrLBA: - if (strstr(dstbuf, "off")) - phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; - else - phba->lpfc_injerr_lba = (sector_t)tmp; - break; - case InjErrNPortID: + else if (dent == phba->debug_InjErrLBA) + phba->lpfc_injerr_lba = (sector_t)tmp; + else if (dent == phba->debug_InjErrNPortID) phba->lpfc_injerr_nportid = (uint32_t)(tmp & Mask_DID); - break; - case InjErrWWPN: - phba->lpfc_injerr_wwpn.u.wwn_be = cpu_to_be64(tmp); - break; - default: - lpfc_log_msg(phba, KERN_WARNING, LOG_INIT, - "0548 Unknown debugfs error injection entry\n"); - break; - } + else if (dent == phba->debug_InjErrWWPN) { + tmp = cpu_to_be64(tmp); + memcpy(&phba->lpfc_injerr_wwpn, &tmp, sizeof(struct lpfc_name)); + } else + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0548 Unknown debugfs error injection entry\n"); + return nbytes; } @@ -5752,7 +5728,7 @@ static const struct file_operations lpfc_debugfs_op_slow_ring_trc = { }; static struct dentry *lpfc_debugfs_root = NULL; -static unsigned int lpfc_debugfs_hba_count; +static atomic_t lpfc_debugfs_hba_count; /* * File operations for the iDiag debugfs @@ -6074,12 +6050,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) /* Setup lpfc root directory */ if (!lpfc_debugfs_root) { lpfc_debugfs_root = debugfs_create_dir("lpfc", NULL); - lpfc_debugfs_hba_count = 0; - if (IS_ERR(lpfc_debugfs_root)) { - lpfc_vlog_msg(vport, KERN_WARNING, LOG_INIT, - "0527 Cannot create debugfs lpfc\n"); - return; - } + atomic_set(&lpfc_debugfs_hba_count, 0); } if (!lpfc_debugfs_start_time) lpfc_debugfs_start_time = jiffies; @@ -6090,96 +6061,159 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) pport_setup = true; phba->hba_debugfs_root = debugfs_create_dir(name, lpfc_debugfs_root); - phba->debugfs_vport_count = 0; - if (IS_ERR(phba->hba_debugfs_root)) { - lpfc_vlog_msg(vport, KERN_WARNING, LOG_INIT, - "0528 Cannot create debugfs %s\n", name); - return; - } - lpfc_debugfs_hba_count++; + atomic_inc(&lpfc_debugfs_hba_count); + atomic_set(&phba->debugfs_vport_count, 0); /* Multi-XRI pools */ - debugfs_create_file("multixripools", 0644, - phba->hba_debugfs_root, phba, - &lpfc_debugfs_op_multixripools); + snprintf(name, sizeof(name), "multixripools"); + phba->debug_multixri_pools = + debugfs_create_file(name, S_IFREG | 0644, + phba->hba_debugfs_root, + phba, + &lpfc_debugfs_op_multixripools); + if (IS_ERR(phba->debug_multixri_pools)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "0527 Cannot create debugfs multixripools\n"); + goto debug_failed; + } /* Congestion Info Buffer */ - debugfs_create_file("cgn_buffer", 0644, phba->hba_debugfs_root, - phba, &lpfc_cgn_buffer_op); + scnprintf(name, sizeof(name), "cgn_buffer"); + phba->debug_cgn_buffer = + debugfs_create_file(name, S_IFREG | 0644, + phba->hba_debugfs_root, + phba, &lpfc_cgn_buffer_op); + if (IS_ERR(phba->debug_cgn_buffer)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "6527 Cannot create debugfs " + "cgn_buffer\n"); + goto debug_failed; + } /* RX Monitor */ - debugfs_create_file("rx_monitor", 0644, phba->hba_debugfs_root, - phba, &lpfc_rx_monitor_op); + scnprintf(name, sizeof(name), "rx_monitor"); + phba->debug_rx_monitor = + debugfs_create_file(name, S_IFREG | 0644, + phba->hba_debugfs_root, + phba, &lpfc_rx_monitor_op); + if (IS_ERR(phba->debug_rx_monitor)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "6528 Cannot create debugfs " + "rx_monitor\n"); + goto debug_failed; + } /* RAS log */ - debugfs_create_file("ras_log", 0644, phba->hba_debugfs_root, - phba, &lpfc_debugfs_ras_log); + snprintf(name, sizeof(name), "ras_log"); + phba->debug_ras_log = + debugfs_create_file(name, 0644, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_ras_log); + if (IS_ERR(phba->debug_ras_log)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "6148 Cannot create debugfs" + " ras_log\n"); + goto debug_failed; + } /* Setup hbqinfo */ - debugfs_create_file("hbqinfo", 0644, phba->hba_debugfs_root, - phba, &lpfc_debugfs_op_hbqinfo); + snprintf(name, sizeof(name), "hbqinfo"); + phba->debug_hbqinfo = + debugfs_create_file(name, S_IFREG | 0644, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_hbqinfo); #ifdef LPFC_HDWQ_LOCK_STAT /* Setup lockstat */ - debugfs_create_file("lockstat", 0644, phba->hba_debugfs_root, - phba, &lpfc_debugfs_op_lockstat); + snprintf(name, sizeof(name), "lockstat"); + phba->debug_lockstat = + debugfs_create_file(name, S_IFREG | 0644, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_lockstat); + if (IS_ERR(phba->debug_lockstat)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "4610 Can't create debugfs lockstat\n"); + goto debug_failed; + } #endif + + /* Setup dumpHBASlim */ if (phba->sli_rev < LPFC_SLI_REV4) { - /* Setup dumpHBASlim */ - debugfs_create_file("dumpHBASlim", 0644, - phba->hba_debugfs_root, phba, - &lpfc_debugfs_op_dumpHBASlim); - } + snprintf(name, sizeof(name), "dumpHBASlim"); + phba->debug_dumpHBASlim = + debugfs_create_file(name, + S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dumpHBASlim); + } else + phba->debug_dumpHBASlim = NULL; + /* Setup dumpHostSlim */ if (phba->sli_rev < LPFC_SLI_REV4) { - /* Setup dumpHostSlim */ - debugfs_create_file("dumpHostSlim", 0644, - phba->hba_debugfs_root, phba, - &lpfc_debugfs_op_dumpHostSlim); - } + snprintf(name, sizeof(name), "dumpHostSlim"); + phba->debug_dumpHostSlim = + debugfs_create_file(name, + S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dumpHostSlim); + } else + phba->debug_dumpHostSlim = NULL; /* Setup DIF Error Injections */ - debugfs_create_file_aux_num("InjErrLBA", 0644, - phba->hba_debugfs_root, phba, - InjErrLBA, - &lpfc_debugfs_op_dif_err); + snprintf(name, sizeof(name), "InjErrLBA"); + phba->debug_InjErrLBA = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); phba->lpfc_injerr_lba = LPFC_INJERR_LBA_OFF; - debugfs_create_file_aux_num("InjErrNPortID", 0644, - phba->hba_debugfs_root, phba, - InjErrNPortID, - &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("InjErrWWPN", 0644, - phba->hba_debugfs_root, phba, - InjErrWWPN, - &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("writeGuardInjErr", 0644, - phba->hba_debugfs_root, phba, - writeGuard, - &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("writeAppInjErr", 0644, - phba->hba_debugfs_root, phba, - writeApp, &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("writeRefInjErr", 0644, - phba->hba_debugfs_root, phba, - writeRef, &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("readGuardInjErr", 0644, - phba->hba_debugfs_root, phba, - readGuard, - &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("readAppInjErr", 0644, - phba->hba_debugfs_root, phba, - readApp, &lpfc_debugfs_op_dif_err); - - debugfs_create_file_aux_num("readRefInjErr", 0644, - phba->hba_debugfs_root, phba, - readRef, &lpfc_debugfs_op_dif_err); + snprintf(name, sizeof(name), "InjErrNPortID"); + phba->debug_InjErrNPortID = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "InjErrWWPN"); + phba->debug_InjErrWWPN = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "writeGuardInjErr"); + phba->debug_writeGuard = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "writeAppInjErr"); + phba->debug_writeApp = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "writeRefInjErr"); + phba->debug_writeRef = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "readGuardInjErr"); + phba->debug_readGuard = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "readAppInjErr"); + phba->debug_readApp = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); + + snprintf(name, sizeof(name), "readRefInjErr"); + phba->debug_readRef = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_dif_err); /* Setup slow ring trace */ if (lpfc_debugfs_max_slow_ring_trc) { @@ -6193,15 +6227,16 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) i++; } lpfc_debugfs_max_slow_ring_trc = (1 << i); - pr_info("lpfc_debugfs_max_slow_ring_trc " - "changed to %d\n", - lpfc_debugfs_max_slow_ring_trc); + pr_err("lpfc_debugfs_max_disc_trc changed to " + "%d\n", lpfc_debugfs_max_disc_trc); } } - debugfs_create_file("slow_ring_trace", 0644, - phba->hba_debugfs_root, phba, - &lpfc_debugfs_op_slow_ring_trc); + snprintf(name, sizeof(name), "slow_ring_trace"); + phba->debug_slow_ring_trc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_slow_ring_trc); if (!phba->slow_ring_trc) { phba->slow_ring_trc = kcalloc( lpfc_debugfs_max_slow_ring_trc, @@ -6211,18 +6246,21 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, "0416 Cannot create debugfs " "slow_ring buffer\n"); - goto out; + goto debug_failed; } atomic_set(&phba->slow_ring_trc_cnt, 0); } - debugfs_create_file("nvmeio_trc", 0644, phba->hba_debugfs_root, - phba, &lpfc_debugfs_op_nvmeio_trc); + snprintf(name, sizeof(name), "nvmeio_trc"); + phba->debug_nvmeio_trc = + debugfs_create_file(name, 0644, + phba->hba_debugfs_root, + phba, &lpfc_debugfs_op_nvmeio_trc); atomic_set(&phba->nvmeio_trc_cnt, 0); if (lpfc_debugfs_max_nvmeio_trc) { num = lpfc_debugfs_max_nvmeio_trc - 1; - if (num & lpfc_debugfs_max_nvmeio_trc) { + if (num & lpfc_debugfs_max_disc_trc) { /* Change to be a power of 2 */ num = lpfc_debugfs_max_nvmeio_trc; i = 0; @@ -6231,9 +6269,10 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) i++; } lpfc_debugfs_max_nvmeio_trc = (1 << i); - pr_info("lpfc_debugfs_max_nvmeio_trc changed " - "to %d\n", - lpfc_debugfs_max_nvmeio_trc); + lpfc_printf_log(phba, KERN_ERR, LOG_INIT, + "0575 lpfc_debugfs_max_nvmeio_trc " + "changed to %d\n", + lpfc_debugfs_max_nvmeio_trc); } phba->nvmeio_trc_size = lpfc_debugfs_max_nvmeio_trc; @@ -6250,6 +6289,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) } phba->nvmeio_trc_on = 1; phba->nvmeio_trc_output_idx = 0; + phba->nvmeio_trc = NULL; } else { nvmeio_off: phba->nvmeio_trc_size = 0; @@ -6263,12 +6303,7 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) if (!vport->vport_debugfs_root) { vport->vport_debugfs_root = debugfs_create_dir(name, phba->hba_debugfs_root); - if (IS_ERR(vport->vport_debugfs_root)) { - lpfc_vlog_msg(vport, KERN_WARNING, LOG_INIT, - "0529 Cannot create debugfs %s\n", name); - return; - } - phba->debugfs_vport_count++; + atomic_inc(&phba->debugfs_vport_count); } if (lpfc_debugfs_max_disc_trc) { @@ -6282,8 +6317,8 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) i++; } lpfc_debugfs_max_disc_trc = (1 << i); - pr_info("lpfc_debugfs_max_disc_trc changed to %d\n", - lpfc_debugfs_max_disc_trc); + pr_err("lpfc_debugfs_max_disc_trc changed to %d\n", + lpfc_debugfs_max_disc_trc); } } @@ -6295,27 +6330,54 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, "0418 Cannot create debugfs disc trace " "buffer\n"); - goto out; + goto debug_failed; } atomic_set(&vport->disc_trc_cnt, 0); - debugfs_create_file("discovery_trace", 0644, vport->vport_debugfs_root, - vport, &lpfc_debugfs_op_disc_trc); - - debugfs_create_file("nodelist", 0644, vport->vport_debugfs_root, vport, - &lpfc_debugfs_op_nodelist); - - debugfs_create_file("nvmestat", 0644, vport->vport_debugfs_root, vport, - &lpfc_debugfs_op_nvmestat); - - debugfs_create_file("scsistat", 0644, vport->vport_debugfs_root, vport, - &lpfc_debugfs_op_scsistat); + snprintf(name, sizeof(name), "discovery_trace"); + vport->debug_disc_trc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + vport->vport_debugfs_root, + vport, &lpfc_debugfs_op_disc_trc); + snprintf(name, sizeof(name), "nodelist"); + vport->debug_nodelist = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + vport->vport_debugfs_root, + vport, &lpfc_debugfs_op_nodelist); + + snprintf(name, sizeof(name), "nvmestat"); + vport->debug_nvmestat = + debugfs_create_file(name, 0644, + vport->vport_debugfs_root, + vport, &lpfc_debugfs_op_nvmestat); + + snprintf(name, sizeof(name), "scsistat"); + vport->debug_scsistat = + debugfs_create_file(name, 0644, + vport->vport_debugfs_root, + vport, &lpfc_debugfs_op_scsistat); + if (IS_ERR(vport->debug_scsistat)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "4611 Cannot create debugfs scsistat\n"); + goto debug_failed; + } - debugfs_create_file("ioktime", 0644, vport->vport_debugfs_root, vport, - &lpfc_debugfs_op_ioktime); + snprintf(name, sizeof(name), "ioktime"); + vport->debug_ioktime = + debugfs_create_file(name, 0644, + vport->vport_debugfs_root, + vport, &lpfc_debugfs_op_ioktime); + if (IS_ERR(vport->debug_ioktime)) { + lpfc_printf_vlog(vport, KERN_ERR, LOG_INIT, + "0815 Cannot create debugfs ioktime\n"); + goto debug_failed; + } - debugfs_create_file("hdwqstat", 0644, vport->vport_debugfs_root, vport, - &lpfc_debugfs_op_hdwqstat); + snprintf(name, sizeof(name), "hdwqstat"); + vport->debug_hdwqstat = + debugfs_create_file(name, 0644, + vport->vport_debugfs_root, + vport, &lpfc_debugfs_op_hdwqstat); /* * The following section is for additional directories/files for the @@ -6323,58 +6385,93 @@ lpfc_debugfs_initialize(struct lpfc_vport *vport) */ if (!pport_setup) - return; + goto debug_failed; /* * iDiag debugfs root entry points for SLI4 device only */ if (phba->sli_rev < LPFC_SLI_REV4) - return; + goto debug_failed; + snprintf(name, sizeof(name), "iDiag"); if (!phba->idiag_root) { phba->idiag_root = - debugfs_create_dir("iDiag", phba->hba_debugfs_root); + debugfs_create_dir(name, phba->hba_debugfs_root); /* Initialize iDiag data structure */ memset(&idiag, 0, sizeof(idiag)); } /* iDiag read PCI config space */ - debugfs_create_file("pciCfg", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_pciCfg); - idiag.offset.last_rd = 0; + snprintf(name, sizeof(name), "pciCfg"); + if (!phba->idiag_pci_cfg) { + phba->idiag_pci_cfg = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, &lpfc_idiag_op_pciCfg); + idiag.offset.last_rd = 0; + } /* iDiag PCI BAR access */ - debugfs_create_file("barAcc", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_barAcc); - idiag.offset.last_rd = 0; + snprintf(name, sizeof(name), "barAcc"); + if (!phba->idiag_bar_acc) { + phba->idiag_bar_acc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, &lpfc_idiag_op_barAcc); + idiag.offset.last_rd = 0; + } /* iDiag get PCI function queue information */ - debugfs_create_file("queInfo", 0444, phba->idiag_root, phba, - &lpfc_idiag_op_queInfo); + snprintf(name, sizeof(name), "queInfo"); + if (!phba->idiag_que_info) { + phba->idiag_que_info = + debugfs_create_file(name, S_IFREG|S_IRUGO, + phba->idiag_root, phba, &lpfc_idiag_op_queInfo); + } /* iDiag access PCI function queue */ - debugfs_create_file("queAcc", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_queAcc); + snprintf(name, sizeof(name), "queAcc"); + if (!phba->idiag_que_acc) { + phba->idiag_que_acc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, &lpfc_idiag_op_queAcc); + } /* iDiag access PCI function doorbell registers */ - debugfs_create_file("drbAcc", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_drbAcc); + snprintf(name, sizeof(name), "drbAcc"); + if (!phba->idiag_drb_acc) { + phba->idiag_drb_acc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, &lpfc_idiag_op_drbAcc); + } /* iDiag access PCI function control registers */ - debugfs_create_file("ctlAcc", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_ctlAcc); + snprintf(name, sizeof(name), "ctlAcc"); + if (!phba->idiag_ctl_acc) { + phba->idiag_ctl_acc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, &lpfc_idiag_op_ctlAcc); + } /* iDiag access mbox commands */ - debugfs_create_file("mbxAcc", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_mbxAcc); + snprintf(name, sizeof(name), "mbxAcc"); + if (!phba->idiag_mbx_acc) { + phba->idiag_mbx_acc = + debugfs_create_file(name, S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, &lpfc_idiag_op_mbxAcc); + } /* iDiag extents access commands */ if (phba->sli4_hba.extents_in_use) { - debugfs_create_file("extAcc", 0644, phba->idiag_root, phba, - &lpfc_idiag_op_extAcc); + snprintf(name, sizeof(name), "extAcc"); + if (!phba->idiag_ext_acc) { + phba->idiag_ext_acc = + debugfs_create_file(name, + S_IFREG|S_IRUGO|S_IWUSR, + phba->idiag_root, phba, + &lpfc_idiag_op_extAcc); + } } -out: - /* alloc'ed items are kfree'd in lpfc_debugfs_terminate */ + +debug_failed: return; #endif } @@ -6399,26 +6496,145 @@ lpfc_debugfs_terminate(struct lpfc_vport *vport) kfree(vport->disc_trc); vport->disc_trc = NULL; + debugfs_remove(vport->debug_disc_trc); /* discovery_trace */ + vport->debug_disc_trc = NULL; + + debugfs_remove(vport->debug_nodelist); /* nodelist */ + vport->debug_nodelist = NULL; + + debugfs_remove(vport->debug_nvmestat); /* nvmestat */ + vport->debug_nvmestat = NULL; + + debugfs_remove(vport->debug_scsistat); /* scsistat */ + vport->debug_scsistat = NULL; + + debugfs_remove(vport->debug_ioktime); /* ioktime */ + vport->debug_ioktime = NULL; + + debugfs_remove(vport->debug_hdwqstat); /* hdwqstat */ + vport->debug_hdwqstat = NULL; + if (vport->vport_debugfs_root) { debugfs_remove(vport->vport_debugfs_root); /* vportX */ vport->vport_debugfs_root = NULL; - phba->debugfs_vport_count--; + atomic_dec(&phba->debugfs_vport_count); } - if (!phba->debugfs_vport_count) { + if (atomic_read(&phba->debugfs_vport_count) == 0) { + + debugfs_remove(phba->debug_multixri_pools); /* multixripools*/ + phba->debug_multixri_pools = NULL; + + debugfs_remove(phba->debug_hbqinfo); /* hbqinfo */ + phba->debug_hbqinfo = NULL; + + debugfs_remove(phba->debug_cgn_buffer); + phba->debug_cgn_buffer = NULL; + + debugfs_remove(phba->debug_rx_monitor); + phba->debug_rx_monitor = NULL; + + debugfs_remove(phba->debug_ras_log); + phba->debug_ras_log = NULL; + +#ifdef LPFC_HDWQ_LOCK_STAT + debugfs_remove(phba->debug_lockstat); /* lockstat */ + phba->debug_lockstat = NULL; +#endif + debugfs_remove(phba->debug_dumpHBASlim); /* HBASlim */ + phba->debug_dumpHBASlim = NULL; + + debugfs_remove(phba->debug_dumpHostSlim); /* HostSlim */ + phba->debug_dumpHostSlim = NULL; + + debugfs_remove(phba->debug_InjErrLBA); /* InjErrLBA */ + phba->debug_InjErrLBA = NULL; + + debugfs_remove(phba->debug_InjErrNPortID); + phba->debug_InjErrNPortID = NULL; + + debugfs_remove(phba->debug_InjErrWWPN); /* InjErrWWPN */ + phba->debug_InjErrWWPN = NULL; + + debugfs_remove(phba->debug_writeGuard); /* writeGuard */ + phba->debug_writeGuard = NULL; + + debugfs_remove(phba->debug_writeApp); /* writeApp */ + phba->debug_writeApp = NULL; + + debugfs_remove(phba->debug_writeRef); /* writeRef */ + phba->debug_writeRef = NULL; + + debugfs_remove(phba->debug_readGuard); /* readGuard */ + phba->debug_readGuard = NULL; + + debugfs_remove(phba->debug_readApp); /* readApp */ + phba->debug_readApp = NULL; + + debugfs_remove(phba->debug_readRef); /* readRef */ + phba->debug_readRef = NULL; + kfree(phba->slow_ring_trc); phba->slow_ring_trc = NULL; + /* slow_ring_trace */ + debugfs_remove(phba->debug_slow_ring_trc); + phba->debug_slow_ring_trc = NULL; + + debugfs_remove(phba->debug_nvmeio_trc); + phba->debug_nvmeio_trc = NULL; + kfree(phba->nvmeio_trc); phba->nvmeio_trc = NULL; + /* + * iDiag release + */ + if (phba->sli_rev == LPFC_SLI_REV4) { + /* iDiag extAcc */ + debugfs_remove(phba->idiag_ext_acc); + phba->idiag_ext_acc = NULL; + + /* iDiag mbxAcc */ + debugfs_remove(phba->idiag_mbx_acc); + phba->idiag_mbx_acc = NULL; + + /* iDiag ctlAcc */ + debugfs_remove(phba->idiag_ctl_acc); + phba->idiag_ctl_acc = NULL; + + /* iDiag drbAcc */ + debugfs_remove(phba->idiag_drb_acc); + phba->idiag_drb_acc = NULL; + + /* iDiag queAcc */ + debugfs_remove(phba->idiag_que_acc); + phba->idiag_que_acc = NULL; + + /* iDiag queInfo */ + debugfs_remove(phba->idiag_que_info); + phba->idiag_que_info = NULL; + + /* iDiag barAcc */ + debugfs_remove(phba->idiag_bar_acc); + phba->idiag_bar_acc = NULL; + + /* iDiag pciCfg */ + debugfs_remove(phba->idiag_pci_cfg); + phba->idiag_pci_cfg = NULL; + + /* Finally remove the iDiag debugfs root */ + debugfs_remove(phba->idiag_root); + phba->idiag_root = NULL; + } + if (phba->hba_debugfs_root) { debugfs_remove(phba->hba_debugfs_root); /* fnX */ phba->hba_debugfs_root = NULL; - lpfc_debugfs_hba_count--; + atomic_dec(&lpfc_debugfs_hba_count); } - if (!lpfc_debugfs_hba_count) { + if (atomic_read(&lpfc_debugfs_hba_count) == 0) { debugfs_remove(lpfc_debugfs_root); /* lpfc */ lpfc_debugfs_root = NULL; } diff --git a/drivers/scsi/lpfc/lpfc_debugfs.h b/drivers/scsi/lpfc/lpfc_debugfs.h index a1464f8ac331a..8d2e8d05bbc05 100644 --- a/drivers/scsi/lpfc/lpfc_debugfs.h +++ b/drivers/scsi/lpfc/lpfc_debugfs.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2022 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2007-2011 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -44,9 +44,6 @@ /* hbqinfo output buffer size */ #define LPFC_HBQINFO_SIZE 8192 -/* hdwqinfo output buffer size */ -#define LPFC_HDWQINFO_SIZE 8192 - /* nvmestat output buffer size */ #define LPFC_NVMESTAT_SIZE 8192 #define LPFC_IOKTIME_SIZE 8192 @@ -325,17 +322,6 @@ enum { * discovery */ #endif /* H_LPFC_DEBUG_FS */ -enum { - writeGuard = 1, - writeApp, - writeRef, - readGuard, - readApp, - readRef, - InjErrLBA, - InjErrNPortID, - InjErrWWPN, -}; /* * Driver debug utility routines outside of debugfs. The debug utility diff --git a/drivers/scsi/lpfc/lpfc_disc.h b/drivers/scsi/lpfc/lpfc_disc.h index 51cb8571c0492..3d47dc7458d1d 100644 --- a/drivers/scsi/lpfc/lpfc_disc.h +++ b/drivers/scsi/lpfc/lpfc_disc.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2013 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -208,7 +208,6 @@ enum lpfc_nlp_flag { NPR list */ NLP_RM_DFLT_RPI = 26, /* need to remove leftover dflt RPI */ NLP_NODEV_REMOVE = 27, /* Defer removal till discovery ends */ - NLP_FLOGI_DFR_ACC = 28, /* FLOGI LS_ACC was Deferred */ NLP_SC_REQ = 29, /* Target requires authentication */ NLP_FIRSTBURST = 30, /* Target supports FirstBurst */ NLP_RPI_REGISTERED = 31 /* nlp_rpi is valid */ diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index b96ee18611433..4ff5afb1544ef 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c @@ -650,6 +650,8 @@ lpfc_cmpl_els_flogi_fabric(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ndlp->nlp_class_sup |= FC_COS_CLASS2; if (sp->cls3.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS3; + if (sp->cls4.classValid) + ndlp->nlp_class_sup |= FC_COS_CLASS4; ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb; @@ -932,15 +934,10 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, /* Check to see if link went down during discovery */ if (lpfc_els_chk_latt(vport)) { /* One additional decrement on node reference count to - * trigger the release of the node. Make sure the ndlp - * is marked NLP_DROPPED. + * trigger the release of the node */ - if (!test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag) && - !test_bit(NLP_DROPPED, &ndlp->nlp_flag) && - !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { - set_bit(NLP_DROPPED, &ndlp->nlp_flag); + if (!(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) lpfc_nlp_put(ndlp); - } goto out; } @@ -998,10 +995,9 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, IOERR_LOOP_OPEN_FAILURE))) lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, "2858 FLOGI Status:x%x/x%x TMO" - ":x%x Data x%lx x%x x%lx x%x\n", + ":x%x Data x%lx x%x\n", ulp_status, ulp_word4, tmo, - phba->hba_flag, phba->fcf.fcf_flag, - ndlp->nlp_flag, ndlp->fc4_xpt_flags); + phba->hba_flag, phba->fcf.fcf_flag); /* Check for retry */ if (lpfc_els_retry(phba, cmdiocb, rspiocb)) { @@ -1019,17 +1015,14 @@ lpfc_cmpl_els_flogi(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, * reference to trigger node release. */ if (!test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag) && - !test_bit(NLP_DROPPED, &ndlp->nlp_flag) && - !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { - set_bit(NLP_DROPPED, &ndlp->nlp_flag); + !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) lpfc_nlp_put(ndlp); - } lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS, "0150 FLOGI Status:x%x/x%x " - "xri x%x iotag x%x TMO:x%x refcnt %d\n", + "xri x%x TMO:x%x refcnt %d\n", ulp_status, ulp_word4, cmdiocb->sli4_xritag, - cmdiocb->iotag, tmo, kref_read(&ndlp->kref)); + tmo, kref_read(&ndlp->kref)); /* If this is not a loop open failure, bail out */ if (!(ulp_status == IOSTAT_LOCAL_REJECT && @@ -1286,19 +1279,6 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, uint32_t tmo, did; int rc; - /* It's possible for lpfc to reissue a FLOGI on an ndlp that is marked - * NLP_DROPPED. This happens when the FLOGI completed with the XB bit - * set causing lpfc to reference the ndlp until the XRI_ABORTED CQE is - * issued. The time window for the XRI_ABORTED CQE can be as much as - * 2*2*RA_TOV allowing for ndlp reuse of this type when the link is - * cycling quickly. When true, restore the initial reference and remove - * the NLP_DROPPED flag as lpfc is retrying. - */ - if (test_and_clear_bit(NLP_DROPPED, &ndlp->nlp_flag)) { - if (!lpfc_nlp_get(ndlp)) - return 1; - } - cmdsize = (sizeof(uint32_t) + sizeof(struct serv_parm)); elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, ndlp->nlp_DID, ELS_CMD_FLOGI); @@ -1354,14 +1334,6 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, /* Can't do SLI4 class2 without support sequence coalescing */ sp->cls2.classValid = 0; sp->cls2.seqDelivery = 0; - - /* Fill out Auxiliary Parameter Data */ - if (phba->pni) { - sp->aux.flags = - AUX_PARM_DATA_VALID | AUX_PARM_PNI_VALID; - sp->aux.pni = cpu_to_be64(phba->pni); - sp->aux.npiv_cnt = cpu_to_be16(phba->max_vpi - 1); - } } else { /* Historical, setting sequential-delivery bit for SLI3 */ sp->cls2.seqDelivery = (sp->cls2.classValid) ? 1 : 0; @@ -1441,12 +1413,11 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, phba->defer_flogi_acc.ox_id; } - /* The LS_ACC completion needs to drop the initial reference. - * This is a special case for Pt2Pt because both FLOGIs need - * to complete and lpfc defers the LS_ACC when the remote - * FLOGI arrives before the driver's FLOGI. - */ - set_bit(NLP_FLOGI_DFR_ACC, &ndlp->nlp_flag); + lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, + "3354 Xmit deferred FLOGI ACC: rx_id: x%x," + " ox_id: x%x, hba_flag x%lx\n", + phba->defer_flogi_acc.rx_id, + phba->defer_flogi_acc.ox_id, phba->hba_flag); /* Send deferred FLOGI ACC */ lpfc_els_rsp_acc(vport, ELS_CMD_FLOGI, &defer_flogi_acc, @@ -1462,14 +1433,6 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, phba->defer_flogi_acc.ndlp = NULL; } - lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, - "3354 Xmit deferred FLOGI ACC: rx_id: x%x," - " ox_id: x%x, ndlp x%px hba_flag x%lx\n", - phba->defer_flogi_acc.rx_id, - phba->defer_flogi_acc.ox_id, - phba->defer_flogi_acc.ndlp, - phba->hba_flag); - vport->fc_myDID = did; } @@ -2285,8 +2248,7 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry) sp->cmn.valid_vendor_ver_level = 0; memset(sp->un.vendorVersion, 0, sizeof(sp->un.vendorVersion)); - if (!test_bit(FC_PT2PT, &vport->fc_flag)) - sp->cmn.bbRcvSizeMsb &= 0xF; + sp->cmn.bbRcvSizeMsb &= 0xF; /* Check if the destination port supports VMID */ ndlp->vmid_support = 0; @@ -2405,7 +2367,7 @@ lpfc_cmpl_els_prli(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, mode = KERN_INFO; /* Warn PRLI status */ - lpfc_vlog_msg(vport, mode, LOG_ELS, + lpfc_printf_vlog(vport, mode, LOG_ELS, "2754 PRLI DID:%06X Status:x%x/x%x, " "data: x%x x%x x%lx\n", ndlp->nlp_DID, ulp_status, @@ -3062,7 +3024,6 @@ lpfc_cmpl_els_logo(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ndlp->nlp_DID, ulp_status, ulp_word4); - /* Call NLP_EVT_DEVICE_RM if link is down or LOGO is aborted */ if (lpfc_error_lost_link(vport, ulp_status, ulp_word4)) skip_recovery = 1; } @@ -3301,7 +3262,7 @@ lpfc_reg_fab_ctrl_node(struct lpfc_vport *vport, struct lpfc_nodelist *fc_ndlp) return -ENOMEM; } rc = lpfc_reg_rpi(phba, vport->vpi, fc_ndlp->nlp_DID, - (u8 *)&ns_ndlp->fc_sparam, mbox, fc_ndlp->nlp_rpi); + (u8 *)&vport->fc_sparam, mbox, fc_ndlp->nlp_rpi); if (rc) { rc = -EACCES; goto out; @@ -3345,8 +3306,7 @@ lpfc_reg_fab_ctrl_node(struct lpfc_vport *vport, struct lpfc_nodelist *fc_ndlp) * * This routine is a generic completion callback function for Discovery ELS cmd. * Currently used by the ELS command issuing routines for the ELS State Change - * Request (SCR), lpfc_issue_els_scr(), Exchange Diagnostic Capabilities (EDC), - * lpfc_issue_els_edc() and the ELS RDF, lpfc_issue_els_rdf(). + * Request (SCR), lpfc_issue_els_scr() and the ELS RDF, lpfc_issue_els_rdf(). * These commands will be retried once only for ELS timeout errors. **/ static void @@ -3419,21 +3379,11 @@ lpfc_cmpl_els_disc_cmd(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, lpfc_cmpl_els_edc(phba, cmdiocb, rspiocb); return; } - if (ulp_status) { /* ELS discovery cmd completes with error */ lpfc_printf_vlog(vport, KERN_WARNING, LOG_ELS | LOG_CGN_MGMT, "4203 ELS cmd x%x error: x%x x%X\n", cmd, ulp_status, ulp_word4); - - /* In the case where the ELS cmd completes with an error and - * the node does not have RPI registered, the node is - * outstanding and should put its initial reference. - */ - if ((cmd == ELS_CMD_SCR || cmd == ELS_CMD_RDF) && - !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD) && - !test_and_set_bit(NLP_DROPPED, &ndlp->nlp_flag)) - lpfc_nlp_put(ndlp); goto out; } @@ -3502,7 +3452,6 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry) uint8_t *pcmd; uint16_t cmdsize; struct lpfc_nodelist *ndlp; - bool node_created = false; cmdsize = (sizeof(uint32_t) + sizeof(SCR)); @@ -3512,21 +3461,21 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry) if (!ndlp) return 1; lpfc_enqueue_node(vport, ndlp); - node_created = true; } elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, ndlp->nlp_DID, ELS_CMD_SCR); if (!elsiocb) - goto out_node_created; + return 1; if (phba->sli_rev == LPFC_SLI_REV4) { rc = lpfc_reg_fab_ctrl_node(vport, ndlp); if (rc) { + lpfc_els_free_iocb(phba, elsiocb); lpfc_printf_vlog(vport, KERN_ERR, LOG_NODE, "0937 %s: Failed to reg fc node, rc %d\n", __func__, rc); - goto out_free_iocb; + return 1; } } pcmd = (uint8_t *)elsiocb->cmd_dmabuf->virt; @@ -3545,27 +3494,23 @@ lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry) phba->fc_stat.elsXmitSCR++; elsiocb->cmd_cmpl = lpfc_cmpl_els_disc_cmd; elsiocb->ndlp = lpfc_nlp_get(ndlp); - if (!elsiocb->ndlp) - goto out_free_iocb; + if (!elsiocb->ndlp) { + lpfc_els_free_iocb(phba, elsiocb); + return 1; + } lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, "Issue SCR: did:x%x refcnt %d", ndlp->nlp_DID, kref_read(&ndlp->kref), 0); rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0); - if (rc == IOCB_ERROR) - goto out_iocb_error; + if (rc == IOCB_ERROR) { + lpfc_els_free_iocb(phba, elsiocb); + lpfc_nlp_put(ndlp); + return 1; + } return 0; - -out_iocb_error: - lpfc_nlp_put(ndlp); -out_free_iocb: - lpfc_els_free_iocb(phba, elsiocb); -out_node_created: - if (node_created) - lpfc_nlp_put(ndlp); - return 1; } /** @@ -3652,8 +3597,8 @@ lpfc_issue_els_rscn(struct lpfc_vport *vport, uint8_t retry) } lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, - "Issue RSCN: did:x%x refcnt %d", - ndlp->nlp_DID, kref_read(&ndlp->kref), 0); + "Issue RSCN: did:x%x", + ndlp->nlp_DID, 0, 0); rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0); if (rc == IOCB_ERROR) { @@ -3760,7 +3705,10 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) lpfc_nlp_put(ndlp); return 1; } - + /* This will cause the callback-function lpfc_cmpl_els_cmd to + * trigger the release of the node. + */ + /* Don't release reference count as RDF is likely outstanding */ return 0; } @@ -3778,12 +3726,7 @@ lpfc_issue_els_farpr(struct lpfc_vport *vport, uint32_t nportid, uint8_t retry) * * Return code * 0 - Successfully issued rdf command - * < 0 - Failed to issue rdf command - * -EACCES - RDF not required for NPIV_PORT - * -ENODEV - No fabric controller device available - * -ENOMEM - No available memory - * -EIO - The mailbox failed to complete successfully. - * + * 1 - Failed to issue rdf command **/ int lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) @@ -3794,30 +3737,25 @@ lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) struct lpfc_nodelist *ndlp; uint16_t cmdsize; int rc; - bool node_created = false; - int err; cmdsize = sizeof(*prdf); - /* RDF ELS is not required on an NPIV VN_Port. */ - if (vport->port_type == LPFC_NPIV_PORT) - return -EACCES; - ndlp = lpfc_findnode_did(vport, Fabric_Cntl_DID); if (!ndlp) { ndlp = lpfc_nlp_init(vport, Fabric_Cntl_DID); if (!ndlp) return -ENODEV; lpfc_enqueue_node(vport, ndlp); - node_created = true; } + /* RDF ELS is not required on an NPIV VN_Port. */ + if (vport->port_type == LPFC_NPIV_PORT) + return -EACCES; + elsiocb = lpfc_prep_els_iocb(vport, 1, cmdsize, retry, ndlp, ndlp->nlp_DID, ELS_CMD_RDF); - if (!elsiocb) { - err = -ENOMEM; - goto out_node_created; - } + if (!elsiocb) + return -ENOMEM; /* Configure the payload for the supported FPIN events. */ prdf = (struct lpfc_els_rdf_req *)elsiocb->cmd_dmabuf->virt; @@ -3843,8 +3781,8 @@ lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) elsiocb->cmd_cmpl = lpfc_cmpl_els_disc_cmd; elsiocb->ndlp = lpfc_nlp_get(ndlp); if (!elsiocb->ndlp) { - err = -EIO; - goto out_free_iocb; + lpfc_els_free_iocb(phba, elsiocb); + return -EIO; } lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, @@ -3853,19 +3791,11 @@ lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry) rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0); if (rc == IOCB_ERROR) { - err = -EIO; - goto out_iocb_error; + lpfc_els_free_iocb(phba, elsiocb); + lpfc_nlp_put(ndlp); + return -EIO; } return 0; - -out_iocb_error: - lpfc_nlp_put(ndlp); -out_free_iocb: - lpfc_els_free_iocb(phba, elsiocb); -out_node_created: - if (node_created) - lpfc_nlp_put(ndlp); - return err; } /** @@ -3886,23 +3816,19 @@ static int lpfc_els_rcv_rdf(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, struct lpfc_nodelist *ndlp) { - int rc; - - rc = lpfc_els_rsp_acc(vport, ELS_CMD_RDF, cmdiocb, ndlp, NULL); /* Send LS_ACC */ - if (rc) { + if (lpfc_els_rsp_acc(vport, ELS_CMD_RDF, cmdiocb, ndlp, NULL)) { lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, - "1623 Failed to RDF_ACC from x%x for x%x Data: %d\n", - ndlp->nlp_DID, vport->fc_myDID, rc); + "1623 Failed to RDF_ACC from x%x for x%x\n", + ndlp->nlp_DID, vport->fc_myDID); return -EIO; } - rc = lpfc_issue_els_rdf(vport, 0); /* Issue new RDF for reregistering */ - if (rc) { + if (lpfc_issue_els_rdf(vport, 0)) { lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS | LOG_CGN_MGMT, - "2623 Failed to re register RDF for x%x Data: %d\n", - vport->fc_myDID, rc); + "2623 Failed to re register RDF for x%x\n", + vport->fc_myDID); return -EIO; } @@ -4373,7 +4299,7 @@ lpfc_issue_els_edc(struct lpfc_vport *vport, uint8_t retry) rc = lpfc_sli_issue_iocb(phba, LPFC_ELS_RING, elsiocb, 0); if (rc == IOCB_ERROR) { /* The additional lpfc_nlp_put will cause the following - * lpfc_els_free_iocb routine to trigger the release of + * lpfc_els_free_iocb routine to trigger the rlease of * the node. */ lpfc_els_free_iocb(phba, elsiocb); @@ -5201,7 +5127,7 @@ lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb) { struct lpfc_dmabuf *buf_ptr, *buf_ptr1; - /* The I/O iocb is complete. Clear the node and first dmabuf */ + /* The I/O iocb is complete. Clear the node and first dmbuf */ elsiocb->ndlp = NULL; /* cmd_dmabuf = cmd, cmd_dmabuf->next = rsp, bpl_dmabuf = bpl */ @@ -5234,12 +5160,14 @@ lpfc_els_free_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *elsiocb) } else { buf_ptr1 = elsiocb->cmd_dmabuf; lpfc_els_free_data(phba, buf_ptr1); + elsiocb->cmd_dmabuf = NULL; } } if (elsiocb->bpl_dmabuf) { buf_ptr = elsiocb->bpl_dmabuf; lpfc_els_free_bpl(phba, buf_ptr); + elsiocb->bpl_dmabuf = NULL; } lpfc_sli_release_iocbq(phba, elsiocb); return 0; @@ -5377,12 +5305,11 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, IOCB_t *irsp; LPFC_MBOXQ_t *mbox = NULL; u32 ulp_status, ulp_word4, tmo, did, iotag; - u32 cmd; if (!vport) { lpfc_printf_log(phba, KERN_WARNING, LOG_ELS, "3177 null vport in ELS rsp\n"); - goto release; + goto out; } if (cmdiocb->context_un.mbox) mbox = cmdiocb->context_un.mbox; @@ -5412,12 +5339,12 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, ulp_status, ulp_word4, did); /* ELS response tag completes */ lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, - "0110 ELS response tag x%x completes fc_flag x%lx" + "0110 ELS response tag x%x completes " "Data: x%x x%x x%x x%x x%lx x%x x%x x%x %p %p\n", - iotag, vport->fc_flag, ulp_status, ulp_word4, tmo, + iotag, ulp_status, ulp_word4, tmo, ndlp->nlp_DID, ndlp->nlp_flag, ndlp->nlp_state, ndlp->nlp_rpi, kref_read(&ndlp->kref), mbox, ndlp); - if (mbox && !test_bit(FC_PT2PT, &vport->fc_flag)) { + if (mbox) { if (ulp_status == 0 && test_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag)) { if (!lpfc_unreg_rpi(vport, ndlp) && @@ -5476,10 +5403,6 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, } out_free_mbox: lpfc_mbox_rsrc_cleanup(phba, mbox, MBOX_THD_UNLOCKED); - } else if (mbox && test_bit(FC_PT2PT, &vport->fc_flag) && - test_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag)) { - lpfc_mbx_cmpl_reg_login(phba, mbox); - clear_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); } out: if (ndlp && shost) { @@ -5492,7 +5415,7 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, * these conditions because it doesn't need the login. */ if (phba->sli_rev == LPFC_SLI_REV4 && - vport->port_type == LPFC_NPIV_PORT && + vport && vport->port_type == LPFC_NPIV_PORT && !(ndlp->fc4_xpt_flags & SCSI_XPT_REGD)) { if (ndlp->nlp_state != NLP_STE_PLOGI_ISSUE && ndlp->nlp_state != NLP_STE_REG_LOGIN_ISSUE && @@ -5508,27 +5431,6 @@ lpfc_cmpl_els_rsp(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, } } - /* The driver's unsolicited deferred FLOGI ACC in Pt2Pt needs to - * release the initial reference because the put after the free_iocb - * call removes only the reference from the defer logic. This FLOGI - * is never registered with the SCSI transport. - */ - if (test_bit(FC_PT2PT, &vport->fc_flag) && - test_and_clear_bit(NLP_FLOGI_DFR_ACC, &ndlp->nlp_flag)) { - lpfc_printf_vlog(vport, KERN_INFO, - LOG_ELS | LOG_NODE | LOG_DISCOVERY, - "3357 Pt2Pt Defer FLOGI ACC ndlp x%px, " - "nflags x%lx, fc_flag x%lx\n", - ndlp, ndlp->nlp_flag, - vport->fc_flag); - cmd = *((u32 *)cmdiocb->cmd_dmabuf->virt); - if (cmd == ELS_CMD_ACC) { - if (!test_and_set_bit(NLP_DROPPED, &ndlp->nlp_flag)) - lpfc_nlp_put(ndlp); - } - } - -release: /* Release the originating I/O reference. */ lpfc_els_free_iocb(phba, cmdiocb); lpfc_nlp_put(ndlp); @@ -5663,6 +5565,7 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, sp->cls1.classValid = 0; sp->cls2.classValid = 0; sp->cls3.classValid = 0; + sp->cls4.classValid = 0; /* Copy our worldwide names */ memcpy(&sp->portName, &vport->fc_sparam.portName, @@ -5676,8 +5579,7 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, sp->cmn.valid_vendor_ver_level = 0; memset(sp->un.vendorVersion, 0, sizeof(sp->un.vendorVersion)); - if (!test_bit(FC_PT2PT, &vport->fc_flag)) - sp->cmn.bbRcvSizeMsb &= 0xF; + sp->cmn.bbRcvSizeMsb &= 0xF; /* If our firmware supports this feature, convey that * info to the target using the vendor specific field. @@ -7959,13 +7861,6 @@ lpfc_rscn_recovery_check(struct lpfc_vport *vport) /* Move all affected nodes by pending RSCNs to NPR state. */ list_for_each_entry_safe(ndlp, n, &vport->fc_nodes, nlp_listp) { - if (test_bit(FC_UNLOADING, &vport->load_flag)) { - lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, - "1000 %s Unloading set\n", - __func__); - return 0; - } - if ((ndlp->nlp_state == NLP_STE_UNUSED_NODE) || !lpfc_rscn_payload_check(vport, ndlp->nlp_DID)) continue; @@ -8475,9 +8370,9 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, clear_bit(FC_PUBLIC_LOOP, &vport->fc_flag); lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, "3311 Rcv Flogi PS x%x new PS x%x " - "fc_flag x%lx new fc_flag x%lx, hba_flag x%lx\n", + "fc_flag x%lx new fc_flag x%lx\n", port_state, vport->port_state, - fc_flag, vport->fc_flag, phba->hba_flag); + fc_flag, vport->fc_flag); /* * We temporarily set fc_myDID to make it look like we are @@ -8497,6 +8392,13 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, &wqe->xmit_els_rsp.wqe_com); vport->fc_myDID = did; + + lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, + "3344 Deferring FLOGI ACC: rx_id: x%x," + " ox_id: x%x, hba_flag x%lx\n", + phba->defer_flogi_acc.rx_id, + phba->defer_flogi_acc.ox_id, phba->hba_flag); + phba->defer_flogi_acc.flag = true; /* This nlp_get is paired with nlp_puts that reset the @@ -8505,14 +8407,6 @@ lpfc_els_rcv_flogi(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, * processed or cancelled. */ phba->defer_flogi_acc.ndlp = lpfc_nlp_get(ndlp); - - lpfc_printf_vlog(vport, KERN_INFO, LOG_ELS, - "3344 Deferring FLOGI ACC: rx_id: x%x," - " ox_id: x%x, ndlp x%px, hba_flag x%lx\n", - phba->defer_flogi_acc.rx_id, - phba->defer_flogi_acc.ox_id, - phba->defer_flogi_acc.ndlp, - phba->hba_flag); return 0; } @@ -8830,7 +8724,7 @@ lpfc_els_rcv_rls(struct lpfc_vport *vport, struct lpfc_iocbq *cmdiocb, * @cmdiocb: pointer to lpfc command iocb data structure. * @ndlp: pointer to a node-list data structure. * - * This routine processes Read Timeout Value (RTV) IOCB received as an + * This routine processes Read Timout Value (RTV) IOCB received as an * ELS unsolicited event. It first checks the remote port state. If the * remote port is not in NLP_STE_UNMAPPED_NODE state or NLP_STE_MAPPED_NODE * state, it invokes the lpfc_els_rsl_reject() routine to send the reject @@ -10453,8 +10347,11 @@ lpfc_els_unsol_buffer(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, * Do not process any unsolicited ELS commands * if the ndlp is in DEV_LOSS */ - if (test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) + if (test_bit(NLP_IN_DEV_LOSS, &ndlp->nlp_flag)) { + if (newnode) + lpfc_nlp_put(ndlp); goto dropit; + } elsiocb->ndlp = lpfc_nlp_get(ndlp); if (!elsiocb->ndlp) @@ -10936,7 +10833,7 @@ lpfc_els_unsol_event(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, lpfc_els_unsol_buffer(phba, pring, vport, elsiocb); /* * The different unsolicited event handlers would tell us - * if they are done with "mp" by setting cmd_dmabuf/bpl_dmabuf to NULL. + * if they are done with "mp" by setting cmd_dmabuf to NULL. */ if (elsiocb->cmd_dmabuf) { lpfc_in_buf_free(phba, elsiocb->cmd_dmabuf); @@ -11356,11 +11253,6 @@ lpfc_cmpl_els_fdisc(struct lpfc_hba *phba, struct lpfc_iocbq *cmdiocb, lpfc_vlog_msg(vport, KERN_WARNING, LOG_ELS, "0126 FDISC cmpl status: x%x/x%x)\n", ulp_status, ulp_word4); - - /* drop initial reference */ - if (!test_and_set_bit(NLP_DROPPED, &ndlp->nlp_flag)) - lpfc_nlp_put(ndlp); - goto fdisc_failed; } @@ -11516,13 +11408,6 @@ lpfc_issue_els_fdisc(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, sp->cls2.seqDelivery = 1; sp->cls3.seqDelivery = 1; - /* Fill out Auxiliary Parameter Data */ - if (phba->pni) { - sp->aux.flags = - AUX_PARM_DATA_VALID | AUX_PARM_PNI_VALID; - sp->aux.pni = cpu_to_be64(phba->pni); - } - pcmd += sizeof(uint32_t); /* CSP Word 2 */ pcmd += sizeof(uint32_t); /* CSP Word 3 */ pcmd += sizeof(uint32_t); /* CSP Word 4 */ @@ -12117,11 +12002,7 @@ lpfc_sli4_els_xri_aborted(struct lpfc_hba *phba, sglq_entry->state = SGL_FREED; spin_unlock_irqrestore(&phba->sli4_hba.sgl_list_lock, iflag); - lpfc_printf_log(phba, KERN_INFO, LOG_ELS | LOG_SLI | - LOG_DISCOVERY | LOG_NODE, - "0732 ELS XRI ABORT on Node: ndlp=x%px " - "xri=x%x\n", - ndlp, xri); + if (ndlp) { lpfc_set_rrq_active(phba, ndlp, sglq_entry->sli4_lxritag, diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c index c28fe4de66a10..d8b5896e8f58b 100644 --- a/drivers/scsi/lpfc/lpfc_hbadisc.c +++ b/drivers/scsi/lpfc/lpfc_hbadisc.c @@ -183,8 +183,7 @@ lpfc_dev_loss_tmo_callbk(struct fc_rport *rport) /* Don't schedule a worker thread event if the vport is going down. */ if (test_bit(FC_UNLOADING, &vport->load_flag) || - (phba->sli_rev == LPFC_SLI_REV4 && - !test_bit(HBA_SETUP, &phba->hba_flag))) { + !test_bit(HBA_SETUP, &phba->hba_flag)) { spin_lock_irqsave(&ndlp->lock, iflags); ndlp->rport = NULL; @@ -424,7 +423,6 @@ lpfc_check_nlp_post_devloss(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp) { if (test_and_clear_bit(NLP_IN_RECOV_POST_DEV_LOSS, &ndlp->save_flags)) { - clear_bit(NLP_DROPPED, &ndlp->nlp_flag); lpfc_nlp_get(ndlp); lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY | LOG_NODE, "8438 Devloss timeout reversed on DID x%x " @@ -567,8 +565,7 @@ lpfc_dev_loss_tmo_handler(struct lpfc_nodelist *ndlp) return fcf_inuse; } - if (!test_and_set_bit(NLP_DROPPED, &ndlp->nlp_flag)) - lpfc_nlp_put(ndlp); + lpfc_nlp_put(ndlp); return fcf_inuse; } @@ -1269,10 +1266,6 @@ lpfc_linkdown(struct lpfc_hba *phba) } phba->defer_flogi_acc.flag = false; - /* reinitialize initial HBA flag */ - clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag); - clear_bit(HBA_RHBA_CMPL, &phba->hba_flag); - /* Clear external loopback plug detected flag */ phba->link_flag &= ~LS_EXTERNAL_LOOPBACK; @@ -1443,6 +1436,10 @@ lpfc_linkup(struct lpfc_hba *phba) phba->pport->rcv_flogi_cnt = 0; spin_unlock_irq(shost->host_lock); + /* reinitialize initial HBA flag */ + clear_bit(HBA_FLOGI_ISSUED, &phba->hba_flag); + clear_bit(HBA_RHBA_CMPL, &phba->hba_flag); + return 0; } @@ -4373,8 +4370,6 @@ lpfc_mbx_cmpl_ns_reg_login(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb) lpfc_ns_cmd(vport, SLI_CTNS_RNN_ID, 0, 0); lpfc_ns_cmd(vport, SLI_CTNS_RSNN_NN, 0, 0); lpfc_ns_cmd(vport, SLI_CTNS_RSPN_ID, 0, 0); - if (phba->pni) - lpfc_ns_cmd(vport, SLI_CTNS_RSPNI_PNI, 0, 0); lpfc_ns_cmd(vport, SLI_CTNS_RFT_ID, 0, 0); if ((vport->cfg_enable_fc4_type == LPFC_ENABLE_BOTH) || @@ -6600,11 +6595,6 @@ lpfc_nlp_get(struct lpfc_nodelist *ndlp) unsigned long flags; if (ndlp) { - lpfc_debugfs_disc_trc(ndlp->vport, LPFC_DISC_TRC_NODE, - "node get: did:x%x flg:x%lx refcnt:x%x", - ndlp->nlp_DID, ndlp->nlp_flag, - kref_read(&ndlp->kref)); - /* The check of ndlp usage to prevent incrementing the * ndlp reference count that is in the process of being * released. @@ -6612,9 +6602,8 @@ lpfc_nlp_get(struct lpfc_nodelist *ndlp) spin_lock_irqsave(&ndlp->lock, flags); if (!kref_get_unless_zero(&ndlp->kref)) { spin_unlock_irqrestore(&ndlp->lock, flags); - lpfc_printf_vlog(ndlp->vport, KERN_WARNING, LOG_NODE, - "0276 %s: ndlp:x%px refcnt:%d\n", - __func__, (void *)ndlp, kref_read(&ndlp->kref)); + pr_info("0276 %s: NDLP has zero reference count. " + "Exiting\n", __func__); return NULL; } spin_unlock_irqrestore(&ndlp->lock, flags); diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h index b2e353590ebb5..32298285ea5ea 100644 --- a/drivers/scsi/lpfc/lpfc_hw.h +++ b/drivers/scsi/lpfc/lpfc_hw.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -168,11 +168,6 @@ struct lpfc_sli_ct_request { uint8_t len; uint8_t symbname[255]; } rspn; - struct rspni { /* For RSPNI_PNI requests */ - __be64 pni; - u8 len; - u8 symbname[255]; - } rspni; struct gff { uint32_t PortId; } gff; @@ -218,8 +213,6 @@ struct lpfc_sli_ct_request { sizeof(struct da_id)) #define RSPN_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ sizeof(struct rspn)) -#define RSPNI_REQUEST_SZ (offsetof(struct lpfc_sli_ct_request, un) + \ - sizeof(struct rspni)) /* * FsType Definitions @@ -316,7 +309,6 @@ struct lpfc_sli_ct_request { #define SLI_CTNS_RIP_NN 0x0235 #define SLI_CTNS_RIPA_NN 0x0236 #define SLI_CTNS_RSNN_NN 0x0239 -#define SLI_CTNS_RSPNI_PNI 0x0240 #define SLI_CTNS_DA_ID 0x0300 /* @@ -374,7 +366,6 @@ struct lpfc_name { } s; uint8_t wwn[8]; uint64_t name __packed __aligned(4); - __be64 wwn_be __packed __aligned(4); } u; }; @@ -520,21 +511,6 @@ struct class_parms { uint8_t word3Reserved2; /* Fc Word 3, bit 0: 7 */ }; -enum aux_parm_flags { - AUX_PARM_PNI_VALID = 0x20, /* FC Word 0, bit 29 */ - AUX_PARM_DATA_VALID = 0x40, /* FC Word 0, bit 30 */ -}; - -struct aux_parm { - u8 flags; /* FC Word 0, bit 31:24 */ - u8 ext_feat[3]; /* FC Word 0, bit 23:0 */ - - __be64 pni; /* FC Word 1 and 2, platform name identifier */ - - __be16 rsvd; /* FC Word 3, bit 31:16 */ - __be16 npiv_cnt; /* FC Word 3, bit 15:0 */ -} __packed; - struct serv_parm { /* Structure is in Big Endian format */ struct csp cmn; struct lpfc_name portName; @@ -542,7 +518,7 @@ struct serv_parm { /* Structure is in Big Endian format */ struct class_parms cls1; struct class_parms cls2; struct class_parms cls3; - struct aux_parm aux; + struct class_parms cls4; union { uint8_t vendorVersion[16]; struct { diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index bc709786e6af3..2dedb273b0919 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2009-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -1328,9 +1328,6 @@ struct cq_context { #define LPFC_CQ_CNT_512 0x1 #define LPFC_CQ_CNT_1024 0x2 #define LPFC_CQ_CNT_WORD7 0x3 -#define lpfc_cq_context_cqe_sz_SHIFT 25 -#define lpfc_cq_context_cqe_sz_MASK 0x00000003 -#define lpfc_cq_context_cqe_sz_WORD word0 #define lpfc_cq_context_autovalid_SHIFT 15 #define lpfc_cq_context_autovalid_MASK 0x00000001 #define lpfc_cq_context_autovalid_WORD word0 @@ -1386,9 +1383,9 @@ struct lpfc_mbx_cq_create_set { #define lpfc_mbx_cq_create_set_valid_SHIFT 29 #define lpfc_mbx_cq_create_set_valid_MASK 0x00000001 #define lpfc_mbx_cq_create_set_valid_WORD word1 -#define lpfc_mbx_cq_create_set_cqecnt_SHIFT 27 -#define lpfc_mbx_cq_create_set_cqecnt_MASK 0x00000003 -#define lpfc_mbx_cq_create_set_cqecnt_WORD word1 +#define lpfc_mbx_cq_create_set_cqe_cnt_SHIFT 27 +#define lpfc_mbx_cq_create_set_cqe_cnt_MASK 0x00000003 +#define lpfc_mbx_cq_create_set_cqe_cnt_WORD word1 #define lpfc_mbx_cq_create_set_cqe_size_SHIFT 25 #define lpfc_mbx_cq_create_set_cqe_size_MASK 0x00000003 #define lpfc_mbx_cq_create_set_cqe_size_WORD word1 @@ -1401,16 +1398,13 @@ struct lpfc_mbx_cq_create_set { #define lpfc_mbx_cq_create_set_clswm_SHIFT 12 #define lpfc_mbx_cq_create_set_clswm_MASK 0x00000003 #define lpfc_mbx_cq_create_set_clswm_WORD word1 -#define lpfc_mbx_cq_create_set_cqe_cnt_hi_SHIFT 0 -#define lpfc_mbx_cq_create_set_cqe_cnt_hi_MASK 0x0000001F -#define lpfc_mbx_cq_create_set_cqe_cnt_hi_WORD word1 uint32_t word2; #define lpfc_mbx_cq_create_set_arm_SHIFT 31 #define lpfc_mbx_cq_create_set_arm_MASK 0x00000001 #define lpfc_mbx_cq_create_set_arm_WORD word2 -#define lpfc_mbx_cq_create_set_cqe_cnt_lo_SHIFT 16 -#define lpfc_mbx_cq_create_set_cqe_cnt_lo_MASK 0x00007FFF -#define lpfc_mbx_cq_create_set_cqe_cnt_lo_WORD word2 +#define lpfc_mbx_cq_create_set_cq_cnt_SHIFT 16 +#define lpfc_mbx_cq_create_set_cq_cnt_MASK 0x00007FFF +#define lpfc_mbx_cq_create_set_cq_cnt_WORD word2 #define lpfc_mbx_cq_create_set_num_cq_SHIFT 0 #define lpfc_mbx_cq_create_set_num_cq_MASK 0x0000FFFF #define lpfc_mbx_cq_create_set_num_cq_WORD word2 diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index ba0b3fb66545b..81be82434b73a 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -2627,33 +2627,27 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) "Obsolete, Unsupported Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_BMID: - m = (typeof(m)){"LP1150", "PCI-X2", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LP1150", "PCI-X2", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_BSMB: m = (typeof(m)){"LP111", "PCI-X2", "Obsolete, Unsupported Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_ZEPHYR: - m = (typeof(m)){"LPe11000", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe11000", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_ZEPHYR_SCSP: - m = (typeof(m)){"LPe11000", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe11000", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_ZEPHYR_DCSP: - m = (typeof(m)){"LP2105", "PCIe", - "Obsolete, Unsupported FCoE Adapter"}; + m = (typeof(m)){"LP2105", "PCIe", "FCoE Adapter"}; GE = 1; break; case PCI_DEVICE_ID_ZMID: - m = (typeof(m)){"LPe1150", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe1150", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_ZSMB: - m = (typeof(m)){"LPe111", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe111", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_LP101: m = (typeof(m)){"LP101", "PCI-X", @@ -2672,28 +2666,22 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) "Obsolete, Unsupported Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_SAT: - m = (typeof(m)){"LPe12000", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe12000", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_SAT_MID: - m = (typeof(m)){"LPe1250", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe1250", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_SAT_SMB: - m = (typeof(m)){"LPe121", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe121", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_SAT_DCSP: - m = (typeof(m)){"LPe12002-SP", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe12002-SP", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_SAT_SCSP: - m = (typeof(m)){"LPe12000-SP", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe12000-SP", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_SAT_S: - m = (typeof(m)){"LPe12000-S", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe12000-S", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_PROTEUS_VF: m = (typeof(m)){"LPev12000", "PCIe IOV", @@ -2709,25 +2697,22 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) break; case PCI_DEVICE_ID_TIGERSHARK: oneConnect = 1; - m = (typeof(m)){"OCe10100", "PCIe", - "Obsolete, Unsupported FCoE Adapter"}; + m = (typeof(m)){"OCe10100", "PCIe", "FCoE"}; break; case PCI_DEVICE_ID_TOMCAT: oneConnect = 1; - m = (typeof(m)){"OCe11100", "PCIe", - "Obsolete, Unsupported FCoE Adapter"}; + m = (typeof(m)){"OCe11100", "PCIe", "FCoE"}; break; case PCI_DEVICE_ID_FALCON: m = (typeof(m)){"LPSe12002-ML1-E", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + "EmulexSecure Fibre"}; break; case PCI_DEVICE_ID_BALIUS: m = (typeof(m)){"LPVe12002", "PCIe Shared I/O", "Obsolete, Unsupported Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_LANCER_FC: - m = (typeof(m)){"LPe16000", "PCIe", - "Obsolete, Unsupported Fibre Channel Adapter"}; + m = (typeof(m)){"LPe16000", "PCIe", "Fibre Channel Adapter"}; break; case PCI_DEVICE_ID_LANCER_FC_VF: m = (typeof(m)){"LPe16000", "PCIe", @@ -2735,13 +2720,12 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) break; case PCI_DEVICE_ID_LANCER_FCOE: oneConnect = 1; - m = (typeof(m)){"OCe15100", "PCIe", - "Obsolete, Unsupported FCoE Adapter"}; + m = (typeof(m)){"OCe15100", "PCIe", "FCoE"}; break; case PCI_DEVICE_ID_LANCER_FCOE_VF: oneConnect = 1; m = (typeof(m)){"OCe15100", "PCIe", - "Obsolete, Unsupported FCoE Adapter"}; + "Obsolete, Unsupported FCoE"}; break; case PCI_DEVICE_ID_LANCER_G6_FC: m = (typeof(m)){"LPe32000", "PCIe", "Fibre Channel Adapter"}; @@ -2755,8 +2739,7 @@ lpfc_get_hba_model_desc(struct lpfc_hba *phba, uint8_t *mdp, uint8_t *descp) case PCI_DEVICE_ID_SKYHAWK: case PCI_DEVICE_ID_SKYHAWK_VF: oneConnect = 1; - m = (typeof(m)){"OCe14000", "PCIe", - "Obsolete, Unsupported FCoE Adapter"}; + m = (typeof(m)){"OCe14000", "PCIe", "FCoE"}; break; default: m = (typeof(m)){"Unknown", "", ""}; @@ -3057,6 +3040,19 @@ lpfc_cleanup(struct lpfc_vport *vport) lpfc_vmid_vport_cleanup(vport); list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { + if (vport->port_type != LPFC_PHYSICAL_PORT && + ndlp->nlp_DID == Fabric_DID) { + /* Just free up ndlp with Fabric_DID for vports */ + lpfc_nlp_put(ndlp); + continue; + } + + if (ndlp->nlp_DID == Fabric_Cntl_DID && + ndlp->nlp_state == NLP_STE_UNUSED_NODE) { + lpfc_nlp_put(ndlp); + continue; + } + /* Fabric Ports not in UNMAPPED state are cleaned up in the * DEVICE_RM event. */ @@ -7923,6 +7919,8 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) int longs; int extra; uint64_t wwn; + u32 if_type; + u32 if_fam; phba->sli4_hba.num_present_cpu = lpfc_present_cpu; phba->sli4_hba.num_possible_cpu = cpumask_last(cpu_possible_mask) + 1; @@ -8182,11 +8180,28 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) */ rc = lpfc_get_sli4_parameters(phba, mboxq); if (rc) { - lpfc_log_msg(phba, KERN_WARNING, LOG_INIT, - "2999 Could not get SLI4 parameters\n"); - rc = -EIO; - mempool_free(mboxq, phba->mbox_mem_pool); - goto out_free_bsmbx; + if_type = bf_get(lpfc_sli_intf_if_type, + &phba->sli4_hba.sli_intf); + if_fam = bf_get(lpfc_sli_intf_sli_family, + &phba->sli4_hba.sli_intf); + if (phba->sli4_hba.extents_in_use && + phba->sli4_hba.rpi_hdrs_in_use) { + lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, + "2999 Unsupported SLI4 Parameters " + "Extents and RPI headers enabled.\n"); + if (if_type == LPFC_SLI_INTF_IF_TYPE_0 && + if_fam == LPFC_SLI_INTF_FAMILY_BE2) { + mempool_free(mboxq, phba->mbox_mem_pool); + rc = -EIO; + goto out_free_bsmbx; + } + } + if (!(if_type == LPFC_SLI_INTF_IF_TYPE_0 && + if_fam == LPFC_SLI_INTF_FAMILY_BE2)) { + mempool_free(mboxq, phba->mbox_mem_pool); + rc = -EIO; + goto out_free_bsmbx; + } } /* @@ -8287,7 +8302,10 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) phba->cfg_total_seg_cnt, phba->cfg_scsi_seg_cnt, phba->cfg_nvme_seg_cnt); - i = min(phba->cfg_sg_dma_buf_size, SLI4_PAGE_SIZE); + if (phba->cfg_sg_dma_buf_size < SLI4_PAGE_SIZE) + i = phba->cfg_sg_dma_buf_size; + else + i = SLI4_PAGE_SIZE; phba->lpfc_sg_dma_buf_pool = dma_pool_create("lpfc_sg_dma_buf_pool", @@ -9076,9 +9094,9 @@ lpfc_setup_fdmi_mask(struct lpfc_vport *vport) vport->fdmi_port_mask = LPFC_FDMI2_PORT_ATTR; } - lpfc_printf_vlog(vport, KERN_INFO, LOG_DISCOVERY, - "6077 Setup FDMI mask: hba x%x port x%x\n", - vport->fdmi_hba_mask, vport->fdmi_port_mask); + lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, + "6077 Setup FDMI mask: hba x%x port x%x\n", + vport->fdmi_hba_mask, vport->fdmi_port_mask); } /** diff --git a/drivers/scsi/lpfc/lpfc_nportdisc.c b/drivers/scsi/lpfc/lpfc_nportdisc.c index 9e785bbf67851..5aa21c683ac6a 100644 --- a/drivers/scsi/lpfc/lpfc_nportdisc.c +++ b/drivers/scsi/lpfc/lpfc_nportdisc.c @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -326,14 +326,8 @@ lpfc_defer_plogi_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *login_mbox) /* Now that REG_RPI completed successfully, * we can now proceed with sending the PLOGI ACC. */ - if (test_bit(FC_PT2PT, &ndlp->vport->fc_flag)) { - rc = lpfc_els_rsp_acc(login_mbox->vport, ELS_CMD_PLOGI, - save_iocb, ndlp, login_mbox); - } else { - rc = lpfc_els_rsp_acc(login_mbox->vport, ELS_CMD_PLOGI, - save_iocb, ndlp, NULL); - } - + rc = lpfc_els_rsp_acc(login_mbox->vport, ELS_CMD_PLOGI, + save_iocb, ndlp, NULL); if (rc) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "4576 PLOGI ACC fails pt2pt discovery: " @@ -341,16 +335,9 @@ lpfc_defer_plogi_acc(struct lpfc_hba *phba, LPFC_MBOXQ_t *login_mbox) } } - /* If this is a fabric topology, complete the reg_rpi and prli now. - * For Pt2Pt, the reg_rpi and PRLI are deferred until after the LS_ACC - * completes. This ensures, in Pt2Pt, that the PLOGI LS_ACC is sent - * before the PRLI. - */ - if (!test_bit(FC_PT2PT, &ndlp->vport->fc_flag)) { - /* Now process the REG_RPI cmpl */ - lpfc_mbx_cmpl_reg_login(phba, login_mbox); - clear_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); - } + /* Now process the REG_RPI cmpl */ + lpfc_mbx_cmpl_reg_login(phba, login_mbox); + clear_bit(NLP_ACC_REGLOGIN, &ndlp->nlp_flag); kfree(save_iocb); } @@ -432,6 +419,8 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, ndlp->nlp_class_sup |= FC_COS_CLASS2; if (sp->cls3.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS3; + if (sp->cls4.classValid) + ndlp->nlp_class_sup |= FC_COS_CLASS4; ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb; /* if already logged in, do implicit logout */ @@ -450,7 +439,18 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, */ if (!(ndlp->nlp_type & NLP_FABRIC) && !(phba->nvmet_support)) { - break; + /* Clear ndlp info, since follow up PRLI may have + * updated ndlp information + */ + ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); + ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); + ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; + ndlp->nlp_nvme_info &= ~NLP_NVME_NSLER; + clear_bit(NLP_FIRSTBURST, &ndlp->nlp_flag); + + lpfc_els_rsp_acc(vport, ELS_CMD_PLOGI, cmdiocb, + ndlp, NULL); + return 1; } if (nlp_portwwn != 0 && nlp_portwwn != wwn_to_u64(sp->portName.u.wwn)) @@ -472,9 +472,7 @@ lpfc_rcv_plogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, lpfc_nlp_set_state(vport, ndlp, NLP_STE_NPR_NODE); break; } - /* Clear ndlp info, since follow up processes may have - * updated ndlp information - */ + ndlp->nlp_type &= ~(NLP_FCP_TARGET | NLP_FCP_INITIATOR); ndlp->nlp_type &= ~(NLP_NVME_TARGET | NLP_NVME_INITIATOR); ndlp->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; @@ -1415,6 +1413,8 @@ lpfc_cmpl_plogi_plogi_issue(struct lpfc_vport *vport, ndlp->nlp_class_sup |= FC_COS_CLASS2; if (sp->cls3.classValid) ndlp->nlp_class_sup |= FC_COS_CLASS3; + if (sp->cls4.classValid) + ndlp->nlp_class_sup |= FC_COS_CLASS4; ndlp->nlp_maxframe = ((sp->cmn.bbRcvSizeMsb & 0x0F) << 8) | sp->cmn.bbRcvSizeLsb; diff --git a/drivers/scsi/lpfc/lpfc_nvme.c b/drivers/scsi/lpfc/lpfc_nvme.c index 2dd148fd3ea1e..1d7488b9e7b95 100644 --- a/drivers/scsi/lpfc/lpfc_nvme.c +++ b/drivers/scsi/lpfc/lpfc_nvme.c @@ -1234,8 +1234,12 @@ lpfc_nvme_prep_io_cmd(struct lpfc_vport *vport, if ((phba->cfg_nvme_enable_fb) && test_bit(NLP_FIRSTBURST, &pnode->nlp_flag)) { req_len = lpfc_ncmd->nvmeCmd->payload_length; - wqe->fcp_iwrite.initial_xfer_len = min(req_len, - pnode->nvme_fb_size); + if (req_len < pnode->nvme_fb_size) + wqe->fcp_iwrite.initial_xfer_len = + req_len; + else + wqe->fcp_iwrite.initial_xfer_len = + pnode->nvme_fb_size; } else { wqe->fcp_iwrite.initial_xfer_len = 0; } diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c index 81ea958336a31..f969410244859 100644 --- a/drivers/scsi/lpfc/lpfc_scsi.c +++ b/drivers/scsi/lpfc/lpfc_scsi.c @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2004-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -390,10 +390,6 @@ lpfc_sli4_vport_delete_fcp_xri_aborted(struct lpfc_vport *vport) if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_FCP)) return; - /* may be called before queues established if hba_setup fails */ - if (!phba->sli4_hba.hdwq) - return; - spin_lock_irqsave(&phba->hbalock, iflag); for (idx = 0; idx < phba->cfg_hdw_queue; idx++) { qp = &phba->sli4_hba.hdwq[idx]; @@ -536,8 +532,7 @@ lpfc_sli4_io_xri_aborted(struct lpfc_hba *phba, psb = container_of(iocbq, struct lpfc_io_buf, cur_iocbq); psb->flags &= ~LPFC_SBUF_XBUSY; spin_unlock_irqrestore(&phba->hbalock, iflag); - if (test_bit(HBA_SETUP, &phba->hba_flag) && - !list_empty(&pring->txq)) + if (!list_empty(&pring->txq)) lpfc_worker_wake_up(phba); return; } @@ -5936,7 +5931,7 @@ lpfc_chk_tgt_mapped(struct lpfc_vport *vport, struct fc_rport *rport) /** * lpfc_reset_flush_io_context - * @vport: The virtual port (scsi_host) for the flush context - * @tgt_id: If aborting by Target context - specifies the target id + * @tgt_id: If aborting by Target contect - specifies the target id * @lun_id: If aborting by Lun context - specifies the lun id * @context: specifies the context level to flush at. * @@ -6110,14 +6105,8 @@ lpfc_target_reset_handler(struct scsi_cmnd *cmnd) pnode->nlp_fcp_info &= ~NLP_FCP_2_DEVICE; spin_unlock_irqrestore(&pnode->lock, flags); } - status = lpfc_reset_flush_io_context(vport, tgt_id, lun_id, - LPFC_CTX_TGT); - if (status != SUCCESS) { - lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, - "0726 Target Reset flush status x%x\n", - status); - return status; - } + lpfc_reset_flush_io_context(vport, tgt_id, lun_id, + LPFC_CTX_TGT); return FAST_IO_FAIL; } @@ -6210,7 +6199,7 @@ lpfc_host_reset_handler(struct scsi_cmnd *cmnd) int rc, ret = SUCCESS; lpfc_printf_vlog(vport, KERN_ERR, LOG_FCP, - "3172 SCSI layer issued Host Reset\n"); + "3172 SCSI layer issued Host Reset Data:\n"); lpfc_offline_prep(phba, LPFC_MBX_WAIT); lpfc_offline(phba); diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 35a35987aa5c5..198531187df9e 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c @@ -27,8 +27,6 @@ #include #include #include -#include -#include #include #include @@ -5162,6 +5160,7 @@ lpfc_sli4_brdreset(struct lpfc_hba *phba) phba->link_events = 0; phba->pport->fc_myDID = 0; phba->pport->fc_prevDID = 0; + clear_bit(HBA_SETUP, &phba->hba_flag); spin_lock_irq(&phba->hbalock); psli->sli_flag &= ~(LPFC_PROCESS_LA); @@ -5278,7 +5277,6 @@ lpfc_sli_brdrestart_s4(struct lpfc_hba *phba) "0296 Restart HBA Data: x%x x%x\n", phba->pport->port_state, psli->sli_flag); - clear_bit(HBA_SETUP, &phba->hba_flag); lpfc_sli4_queue_unset(phba); rc = lpfc_sli4_brdreset(phba); @@ -8441,70 +8439,6 @@ lpfc_set_host_tm(struct lpfc_hba *phba) return rc; } -/** - * lpfc_get_platform_uuid - Attempts to extract a platform uuid - * @phba: pointer to lpfc hba data structure. - * - * This routine attempts to first read SMBIOS DMI data for the System - * Information structure offset 08h called System UUID. Else, no platform - * UUID will be advertised. - **/ -static void -lpfc_get_platform_uuid(struct lpfc_hba *phba) -{ - int rc; - const char *uuid; - char pni[17] = {0}; /* 16 characters + '\0' */ - bool is_ff = true, is_00 = true; - u8 i; - - /* First attempt SMBIOS DMI */ - uuid = dmi_get_system_info(DMI_PRODUCT_UUID); - if (uuid) { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2088 SMBIOS UUID %s\n", - uuid); - } else { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2099 Could not extract UUID\n"); - } - - if (uuid && uuid_is_valid(uuid)) { - /* Generate PNI from UUID format. - * - * 1.) Extract lower 64 bits from UUID format. - * 2.) Set 3h for NAA Locally Assigned Name Identifier format. - * - * e.g. xxxxxxxx-xxxx-xxxx-yyyy-yyyyyyyyyyyy - * - * extract the yyyy-yyyyyyyyyyyy portion - * final PNI 3yyyyyyyyyyyyyyy - */ - scnprintf(pni, sizeof(pni), "3%c%c%c%s", - uuid[20], uuid[21], uuid[22], &uuid[24]); - - /* Sanitize the converted PNI */ - for (i = 1; i < 16 && (is_ff || is_00); i++) { - if (pni[i] != '0') - is_00 = false; - if (pni[i] != 'f' && pni[i] != 'F') - is_ff = false; - } - - /* Convert from char* to unsigned long */ - rc = kstrtoul(pni, 16, &phba->pni); - if (!rc && !is_ff && !is_00) { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2100 PNI 0x%016lx\n", phba->pni); - } else { - lpfc_printf_log(phba, KERN_INFO, LOG_INIT, - "2101 PNI %s generation status %d\n", - pni, rc); - phba->pni = 0; - } - } -} - /** * lpfc_sli4_hba_setup - SLI4 device initialization PCI function * @phba: Pointer to HBA context object. @@ -8588,10 +8522,6 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) clear_bit(HBA_FCOE_MODE, &phba->hba_flag); } - /* Obtain platform UUID, only for SLI4 FC adapters */ - if (!test_bit(HBA_FCOE_MODE, &phba->hba_flag)) - lpfc_get_platform_uuid(phba); - if (bf_get(lpfc_mbx_rd_rev_cee_ver, &mqe->un.read_rev) == LPFC_DCBX_CEE_MODE) set_bit(HBA_FIP_SUPPORT, &phba->hba_flag); @@ -8883,7 +8813,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) if (unlikely(rc)) { lpfc_printf_log(phba, KERN_ERR, LOG_TRACE_EVENT, "0381 Error %d during queue setup.\n", rc); - goto out_destroy_queue; + goto out_stop_timers; } /* Initialize the driver internal SLI layer lists. */ lpfc_sli4_setup(phba); @@ -9166,6 +9096,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) lpfc_free_iocb_list(phba); out_destroy_queue: lpfc_sli4_queue_destroy(phba); +out_stop_timers: lpfc_stop_hba_timers(phba); out_free_mbox: mempool_free(mboxq, phba->mbox_mem_pool); @@ -12505,11 +12436,19 @@ lpfc_sli_issue_abort_iotag(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, } /* - * Always abort the outstanding WQE and set the IA bit correctly - * for the context. This is necessary for correctly removing - * outstanding ndlp reference counts when the CQE completes with - * the XB bit set. + * If we're unloading, don't abort iocb on the ELS ring, but change + * the callback so that nothing happens when it finishes. */ + if (test_bit(FC_UNLOADING, &vport->load_flag) && + pring->ringno == LPFC_ELS_RING) { + if (cmdiocb->cmd_flag & LPFC_IO_FABRIC) + cmdiocb->fabric_cmd_cmpl = lpfc_ignore_els_cmpl; + else + cmdiocb->cmd_cmpl = lpfc_ignore_els_cmpl; + return retval; + } + + /* issue ABTS for this IOCB based on iotag */ abtsiocbp = __lpfc_sli_get_iocbq(phba); if (abtsiocbp == NULL) return IOCB_NORESOURCE; @@ -16537,10 +16476,10 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, case 4096: if (phba->sli4_hba.pc_sli4_params.cqv == LPFC_Q_CREATE_VERSION_2) { - bf_set(lpfc_mbx_cq_create_set_cqe_cnt_lo, + bf_set(lpfc_mbx_cq_create_set_cqe_cnt, &cq_set->u.request, - cq->entry_count); - bf_set(lpfc_mbx_cq_create_set_cqecnt, + cq->entry_count); + bf_set(lpfc_mbx_cq_create_set_cqe_cnt, &cq_set->u.request, LPFC_CQ_CNT_WORD7); break; @@ -16556,15 +16495,15 @@ lpfc_cq_create_set(struct lpfc_hba *phba, struct lpfc_queue **cqp, } fallthrough; /* otherwise default to smallest */ case 256: - bf_set(lpfc_mbx_cq_create_set_cqecnt, + bf_set(lpfc_mbx_cq_create_set_cqe_cnt, &cq_set->u.request, LPFC_CQ_CNT_256); break; case 512: - bf_set(lpfc_mbx_cq_create_set_cqecnt, + bf_set(lpfc_mbx_cq_create_set_cqe_cnt, &cq_set->u.request, LPFC_CQ_CNT_512); break; case 1024: - bf_set(lpfc_mbx_cq_create_set_cqecnt, + bf_set(lpfc_mbx_cq_create_set_cqe_cnt, &cq_set->u.request, LPFC_CQ_CNT_1024); break; } @@ -19927,15 +19866,13 @@ lpfc_sli4_remove_rpis(struct lpfc_hba *phba) } /** - * lpfc_sli4_resume_rpi - Resume traffic relative to an RPI + * lpfc_sli4_resume_rpi - Remove the rpi bitmask region * @ndlp: pointer to lpfc nodelist data structure. * @cmpl: completion call-back. * @iocbq: data to load as mbox ctx_u information * - * Return codes - * 0 - successful - * -ENOMEM - No available memory - * -EIO - The mailbox failed to complete successfully. + * This routine is invoked to remove the memory region that + * provided rpi via a bitmask. **/ int lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, @@ -19965,6 +19902,7 @@ lpfc_sli4_resume_rpi(struct lpfc_nodelist *ndlp, return -EIO; } + /* Post all rpi memory regions to the port. */ lpfc_resume_rpi(mboxq, ndlp); if (cmpl) { mboxq->mbox_cmpl = cmpl; @@ -21434,7 +21372,7 @@ lpfc_sli4_issue_wqe(struct lpfc_hba *phba, struct lpfc_sli4_hdw_queue *qp, struct lpfc_sglq *sglq; struct lpfc_sli_ring *pring; unsigned long iflags; - int ret = 0; + uint32_t ret = 0; /* NVME_LS and NVME_LS ABTS requests. */ if (pwqe->cmd_flag & LPFC_IO_NVME_LS) { diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index fd6dab1578872..9be3da91c9235 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h @@ -1,7 +1,7 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * * Fibre Channel Host Bus Adapters. * - * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term * + * Copyright (C) 2017-2024 Broadcom. All Rights Reserved. The term * * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * * Copyright (C) 2009-2016 Emulex. All rights reserved. * * EMULEX and SLI are trademarks of Emulex. * @@ -575,10 +575,8 @@ struct lpfc_pc_sli4_params { #define LPFC_CQ_4K_PAGE_SZ 0x1 #define LPFC_CQ_16K_PAGE_SZ 0x4 -#define LPFC_CQ_32K_PAGE_SZ 0x8 #define LPFC_WQ_4K_PAGE_SZ 0x1 #define LPFC_WQ_16K_PAGE_SZ 0x4 -#define LPFC_WQ_32K_PAGE_SZ 0x8 struct lpfc_iov { uint32_t pf_number; diff --git a/drivers/scsi/lpfc/lpfc_version.h b/drivers/scsi/lpfc/lpfc_version.h index f3dada5bf7c1e..749688aa8a820 100644 --- a/drivers/scsi/lpfc/lpfc_version.h +++ b/drivers/scsi/lpfc/lpfc_version.h @@ -20,7 +20,7 @@ * included with this package. * *******************************************************************/ -#define LPFC_DRIVER_VERSION "14.4.0.12" +#define LPFC_DRIVER_VERSION "14.4.0.9" #define LPFC_DRIVER_NAME "lpfc" /* Used for SLI 2/3 */ diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c index 8653839ee728c..3d70cc5175730 100644 --- a/drivers/scsi/lpfc/lpfc_vport.c +++ b/drivers/scsi/lpfc/lpfc_vport.c @@ -666,7 +666,7 @@ lpfc_vport_delete(struct fc_vport *fc_vport) * Take early refcount for outstanding I/O requests we schedule during * delete processing for unreg_vpi. Always keep this before * scsi_remove_host() as we can no longer obtain a reference through - * scsi_host_get() after scsi_remove_host as shost is set to SHOST_DEL. + * scsi_host_get() after scsi_host_remove as shost is set to SHOST_DEL. */ if (!scsi_host_get(shost)) return VPORT_INVAL; diff --git a/fs/anon_inodes.c b/fs/anon_inodes.c index 5a070be69922a..b3445f5c8544c 100644 --- a/fs/anon_inodes.c +++ b/fs/anon_inodes.c @@ -24,9 +24,50 @@ #include +#include "internal.h" + static struct vfsmount *anon_inode_mnt __ro_after_init; static struct inode *anon_inode_inode __ro_after_init; +/* + * User space expects anonymous inodes to have no file type in st_mode. + * + * In particular, 'lsof' has this legacy logic: + * + * type = s->st_mode & S_IFMT; + * switch (type) { + * ... + * case 0: + * if (!strcmp(p, "anon_inode")) + * Lf->ntype = Ntype = N_ANON_INODE; + * + * to detect our old anon_inode logic. + * + * Rather than mess with our internal sane inode data, just fix it + * up here in getattr() by masking off the format bits. + */ +int anon_inode_getattr(struct mnt_idmap *idmap, const struct path *path, + struct kstat *stat, u32 request_mask, + unsigned int query_flags) +{ + struct inode *inode = d_inode(path->dentry); + + generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); + stat->mode &= ~S_IFMT; + return 0; +} + +int anon_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, + struct iattr *attr) +{ + return -EOPNOTSUPP; +} + +static const struct inode_operations anon_inode_operations = { + .getattr = anon_inode_getattr, + .setattr = anon_inode_setattr, +}; + /* * anon_inodefs_dname() is called from d_path(). */ @@ -45,6 +86,8 @@ static int anon_inodefs_init_fs_context(struct fs_context *fc) struct pseudo_fs_context *ctx = init_pseudo(fc, ANON_INODE_FS_MAGIC); if (!ctx) return -ENOMEM; + fc->s_iflags |= SB_I_NOEXEC; + fc->s_iflags |= SB_I_NODEV; ctx->dops = &anon_inodefs_dentry_operations; return 0; } @@ -78,6 +121,7 @@ struct inode *anon_inode_make_secure_inode(struct super_block *sb, const char *n if (IS_ERR(inode)) return inode; inode->i_flags &= ~S_PRIVATE; + inode->i_op = &anon_inode_operations; error = security_inode_init_security_anon(inode, &qname, context_inode); if (error) { iput(inode); @@ -326,6 +370,7 @@ static int __init anon_inode_init(void) anon_inode_inode = alloc_anon_inode(anon_inode_mnt->mnt_sb); if (IS_ERR(anon_inode_inode)) panic("anon_inode_init() inode allocation failed (%ld)\n", PTR_ERR(anon_inode_inode)); + anon_inode_inode->i_op = &anon_inode_operations; return 0; } diff --git a/fs/internal.h b/fs/internal.h index b555366c79749..dd13dfde4adb2 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -338,3 +338,8 @@ static inline bool path_mounted(const struct path *path) return path->mnt->mnt_root == path->dentry; } void file_f_owner_release(struct file *file); +int anon_inode_getattr(struct mnt_idmap *idmap, const struct path *path, + struct kstat *stat, u32 request_mask, + unsigned int query_flags); +int anon_inode_setattr(struct mnt_idmap *idmap, struct dentry *dentry, + struct iattr *attr); diff --git a/fs/ioctl.c b/fs/ioctl.c index 6e0c954388d47..4dbd5627af8f1 100644 --- a/fs/ioctl.c +++ b/fs/ioctl.c @@ -822,7 +822,8 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, return ioctl_fioasync(fd, filp, argp); case FIOQSIZE: - if (S_ISDIR(inode->i_mode) || S_ISREG(inode->i_mode) || + if (S_ISDIR(inode->i_mode) || + (S_ISREG(inode->i_mode) && !IS_ANON_FILE(inode)) || S_ISLNK(inode->i_mode)) { loff_t res = inode_get_bytes(inode); return copy_to_user(argp, &res, sizeof(res)) ? @@ -857,7 +858,7 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, return ioctl_file_dedupe_range(filp, argp); case FIONREAD: - if (!S_ISREG(inode->i_mode)) + if (!S_ISREG(inode->i_mode) || IS_ANON_FILE(inode)) return vfs_ioctl(filp, cmd, arg); return put_user(i_size_read(inode) - filp->f_pos, @@ -882,7 +883,7 @@ static int do_vfs_ioctl(struct file *filp, unsigned int fd, return ioctl_get_fs_sysfs_path(filp, argp); default: - if (S_ISREG(inode->i_mode)) + if (S_ISREG(inode->i_mode) && !IS_ANON_FILE(inode)) return file_ioctl(filp, cmd, argp); break; } diff --git a/fs/libfs.c b/fs/libfs.c index 7fd661bb935fc..c4a305967619f 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -1651,10 +1651,16 @@ struct inode *alloc_anon_inode(struct super_block *s) * that it already _is_ on the dirty list. */ inode->i_state = I_DIRTY; - inode->i_mode = S_IRUSR | S_IWUSR; + /* + * Historically anonymous inodes didn't have a type at all and + * userspace has come to rely on this. Internally they're just + * regular files but S_IFREG is masked off when reporting + * information to userspace. + */ + inode->i_mode = S_IFREG | S_IRUSR | S_IWUSR; inode->i_uid = current_fsuid(); inode->i_gid = current_fsgid(); - inode->i_flags |= S_PRIVATE; + inode->i_flags |= S_PRIVATE | S_ANON_INODE; simple_inode_init_ts(inode); return inode; } diff --git a/fs/pidfs.c b/fs/pidfs.c index 4a76e19ba7ed4..7e10fac8e6239 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -568,36 +568,14 @@ static struct vfsmount *pidfs_mnt __ro_after_init; static int pidfs_setattr(struct mnt_idmap *idmap, struct dentry *dentry, struct iattr *attr) { - return -EOPNOTSUPP; + return anon_inode_setattr(idmap, dentry, attr); } - -/* - * User space expects pidfs inodes to have no file type in st_mode. - * - * In particular, 'lsof' has this legacy logic: - * - * type = s->st_mode & S_IFMT; - * switch (type) { - * ... - * case 0: - * if (!strcmp(p, "anon_inode")) - * Lf->ntype = Ntype = N_ANON_INODE; - * - * to detect our old anon_inode logic. - * - * Rather than mess with our internal sane inode data, just fix it - * up here in getattr() by masking off the format bits. - */ static int pidfs_getattr(struct mnt_idmap *idmap, const struct path *path, struct kstat *stat, u32 request_mask, unsigned int query_flags) { - struct inode *inode = d_inode(path->dentry); - - generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat); - stat->mode &= ~S_IFMT; - return 0; + return anon_inode_getattr(idmap, path, stat, request_mask, query_flags); } static const struct inode_operations pidfs_inode_operations = { @@ -826,7 +804,7 @@ static int pidfs_init_inode(struct inode *inode, void *data) const struct pid *pid = data; inode->i_private = data; - inode->i_flags |= S_PRIVATE; + inode->i_flags |= S_PRIVATE | S_ANON_INODE; inode->i_mode |= S_IRWXU; inode->i_op = &pidfs_inode_operations; inode->i_fop = &pidfs_file_operations; diff --git a/fs/smb/client/fs_context.c b/fs/smb/client/fs_context.c index e57eee9b78147..c1a036391806a 100644 --- a/fs/smb/client/fs_context.c +++ b/fs/smb/client/fs_context.c @@ -2002,7 +2002,7 @@ int smb3_init_fs_context(struct fs_context *fc) ctx->backupuid_specified = false; /* no backup intent for a user */ ctx->backupgid_specified = false; /* no backup intent for a group */ - ctx->retrans = 1; + ctx->retrans = 0; ctx->reparse_type = CIFS_REPARSE_TYPE_DEFAULT; ctx->symlink_type = CIFS_SYMLINK_TYPE_DEFAULT; ctx->nonativesocket = 0; diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index ae39b3c027d2d..22225d87da6a9 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -3178,8 +3178,6 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses, if (tcon && !tcon->ipc) { /* ipc tcons are not refcounted */ cifs_put_tcon(tcon, netfs_trace_tcon_ref_put_dfs_refer); - trace_smb3_tcon_ref(tcon->debug_id, tcon->tc_count, - netfs_trace_tcon_ref_dec_dfs_refer); } kfree(utf16_path); kfree(dfs_req); diff --git a/fs/smb/client/trace.h b/fs/smb/client/trace.h index 191f02344dcdd..9228f95cae2bd 100644 --- a/fs/smb/client/trace.h +++ b/fs/smb/client/trace.h @@ -168,7 +168,6 @@ E_(cifs_trace_rw_credits_zero_in_flight, "ZERO-IN-FLT") #define smb3_tcon_ref_traces \ - EM(netfs_trace_tcon_ref_dec_dfs_refer, "DEC DfsRef") \ EM(netfs_trace_tcon_ref_free, "FRE ") \ EM(netfs_trace_tcon_ref_free_fail, "FRE Fail ") \ EM(netfs_trace_tcon_ref_free_ipc, "FRE Ipc ") \ diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c index fddb55605e0cc..bfcac9036c112 100644 --- a/fs/xfs/libxfs/xfs_attr_leaf.c +++ b/fs/xfs/libxfs/xfs_attr_leaf.c @@ -1489,6 +1489,7 @@ xfs_attr3_leaf_add_work( struct xfs_attr_leaf_name_local *name_loc; struct xfs_attr_leaf_name_remote *name_rmt; struct xfs_mount *mp; + int old_end, new_end; int tmp; int i; @@ -1581,17 +1582,49 @@ xfs_attr3_leaf_add_work( if (be16_to_cpu(entry->nameidx) < ichdr->firstused) ichdr->firstused = be16_to_cpu(entry->nameidx); - ASSERT(ichdr->firstused >= ichdr->count * sizeof(xfs_attr_leaf_entry_t) - + xfs_attr3_leaf_hdr_size(leaf)); - tmp = (ichdr->count - 1) * sizeof(xfs_attr_leaf_entry_t) - + xfs_attr3_leaf_hdr_size(leaf); + new_end = ichdr->count * sizeof(struct xfs_attr_leaf_entry) + + xfs_attr3_leaf_hdr_size(leaf); + old_end = new_end - sizeof(struct xfs_attr_leaf_entry); + + ASSERT(ichdr->firstused >= new_end); for (i = 0; i < XFS_ATTR_LEAF_MAPSIZE; i++) { - if (ichdr->freemap[i].base == tmp) { - ichdr->freemap[i].base += sizeof(xfs_attr_leaf_entry_t); + int diff = 0; + + if (ichdr->freemap[i].base == old_end) { + /* + * This freemap entry starts at the old end of the + * leaf entry array, so we need to adjust its base + * upward to accomodate the larger array. + */ + diff = sizeof(struct xfs_attr_leaf_entry); + } else if (ichdr->freemap[i].size > 0 && + ichdr->freemap[i].base < new_end) { + /* + * This freemap entry starts in the space claimed by + * the new leaf entry. Adjust its base upward to + * reflect that. + */ + diff = new_end - ichdr->freemap[i].base; + } + + if (diff) { + ichdr->freemap[i].base += diff; ichdr->freemap[i].size -= - min_t(uint16_t, ichdr->freemap[i].size, - sizeof(xfs_attr_leaf_entry_t)); + min_t(uint16_t, ichdr->freemap[i].size, diff); + } + + /* + * Don't leave zero-length freemaps with nonzero base lying + * around, because we don't want the code in _remove that + * matches on base address to get confused and create + * overlapping freemaps. If we end up with no freemap entries + * then the next _add will compact the leaf block and + * regenerate the freemaps. + */ + if (ichdr->freemap[i].size == 0 && ichdr->freemap[i].base > 0) { + ichdr->freemap[i].base = 0; + ichdr->holes = 1; } } ichdr->usedbytes += xfs_attr_leaf_entsize(leaf, args->index); diff --git a/include/linux/fs.h b/include/linux/fs.h index 106b644cee85e..af426a3bd89c1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2319,6 +2319,7 @@ struct super_operations { #define S_CASEFOLD (1 << 15) /* Casefolded file */ #define S_VERITY (1 << 16) /* Verity file (using fs/verity/) */ #define S_KERNEL_FILE (1 << 17) /* File is in use by the kernel (eg. fs/cachefiles) */ +#define S_ANON_INODE (1 << 19) /* Inode is an anonymous inode */ /* * Note that nosuid etc flags are inode-specific: setting some file-system @@ -2375,6 +2376,7 @@ static inline bool sb_rdonly(const struct super_block *sb) { return sb->s_flags #define IS_WHITEOUT(inode) (S_ISCHR(inode->i_mode) && \ (inode)->i_rdev == WHITEOUT_DEV) +#define IS_ANON_FILE(inode) ((inode)->i_flags & S_ANON_INODE) static inline bool HAS_UNMAPPED_ID(struct mnt_idmap *idmap, struct inode *inode) diff --git a/include/net/netfilter/nf_conntrack_core.h b/include/net/netfilter/nf_conntrack_core.h index 3384859a89210..8883575adcc1e 100644 --- a/include/net/netfilter/nf_conntrack_core.h +++ b/include/net/netfilter/nf_conntrack_core.h @@ -83,6 +83,11 @@ void nf_conntrack_lock(spinlock_t *lock); extern spinlock_t nf_conntrack_expect_lock; +static inline void lockdep_nfct_expect_lock_held(void) +{ + lockdep_assert_held(&nf_conntrack_expect_lock); +} + /* ctnetlink code shared by both ctnetlink and nf_conntrack_bpf */ static inline void __nf_ct_set_timeout(struct nf_conn *ct, u64 timeout) diff --git a/io_uring/rsrc.c b/io_uring/rsrc.c index 5b40f7992e417..3f0a7c0efd250 100644 --- a/io_uring/rsrc.c +++ b/io_uring/rsrc.c @@ -1072,6 +1072,10 @@ static int io_import_fixed(int ddir, struct iov_iter *iter, return ret; if (!(imu->dir & (1 << ddir))) return -EFAULT; + if (unlikely(!len)) { + iov_iter_bvec(iter, ddir, NULL, 0, 0); + return 0; + } offset = buf_addr - imu->ubuf; diff --git a/kernel.sbat b/kernel.sbat index 7368e5cba8dd2..044934dec32f5 100644 --- a/kernel.sbat +++ b/kernel.sbat @@ -1,2 +1,2 @@ sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md -kernel.rocky,1,RESF,kernel-core,6.12.0-211.16.1.el10_2.x86_64,mailto:security@rockylinux.org +kernel.rocky,1,RESF,kernel-core,6.12.0-211.18.1.el10_2.x86_64,mailto:security@rockylinux.org diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 832dafc300cd4..3b996dedfeae5 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -95,6 +95,9 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma) inode = file_inode(vma->vm_file); + if (IS_ANON_FILE(inode)) + return false; + return !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode); } diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 373e0e4bb3d2f..5fb5afed835ce 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -1135,6 +1135,7 @@ __always_inline bool free_pages_prepare(struct page *page, page_cpupid_reset_last(page); page->flags &= ~PAGE_FLAGS_CHECK_AT_PREP; + page->private = 0; reset_page_owner(page, order); page_table_check_free(page, order); pgalloc_tag_sub(page, 1 << order); diff --git a/mm/readahead.c b/mm/readahead.c index 2dbe5993b6aae..a3547f923249a 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -678,29 +678,34 @@ EXPORT_SYMBOL_GPL(page_cache_async_ra); ssize_t ksys_readahead(int fd, loff_t offset, size_t count) { - ssize_t ret; - struct fd f; + struct file *file; + const struct inode *inode; - ret = -EBADF; - f = fdget(fd); - if (!fd_file(f) || !(fd_file(f)->f_mode & FMODE_READ)) - goto out; + CLASS(fd, f)(fd); + if (fd_empty(f)) + return -EBADF; + + file = fd_file(f); + if (!(file->f_mode & FMODE_READ)) + return -EBADF; /* * The readahead() syscall is intended to run only on files * that can execute readahead. If readahead is not possible * on this file, then we must return -EINVAL. */ - ret = -EINVAL; - if (!fd_file(f)->f_mapping || !fd_file(f)->f_mapping->a_ops || - (!S_ISREG(file_inode(fd_file(f))->i_mode) && - !S_ISBLK(file_inode(fd_file(f))->i_mode))) - goto out; - - ret = vfs_fadvise(fd_file(f), offset, count, POSIX_FADV_WILLNEED); -out: - fdput(f); - return ret; + if (!file->f_mapping) + return -EINVAL; + if (!file->f_mapping->a_ops) + return -EINVAL; + + inode = file_inode(file); + if (!S_ISREG(inode->i_mode) && !S_ISBLK(inode->i_mode)) + return -EINVAL; + if (IS_ANON_FILE(inode)) + return -EINVAL; + + return vfs_fadvise(fd_file(f), offset, count, POSIX_FADV_WILLNEED); } SYSCALL_DEFINE3(readahead, int, fd, loff_t, offset, size_t, count) diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index 6fd13a39f48a9..27520b86fae8e 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -7163,6 +7163,9 @@ static bool ltk_is_valid(struct mgmt_ltk_info *key) if (key->initiator != 0x00 && key->initiator != 0x01) return false; + if (key->enc_size > sizeof(key->val)) + return false; + switch (key->addr.type) { case BDADDR_LE_PUBLIC: return true; diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index 87f8c34eb0ca5..ad9f4a0d32b70 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c @@ -298,7 +298,7 @@ static int sco_chan_add(struct sco_conn *conn, struct sock *sk, int err = 0; sco_conn_lock(conn); - if (conn->sk) + if (conn->sk || sco_pi(sk)->conn) err = -EBUSY; else __sco_chan_add(conn, sk, parent); @@ -353,9 +353,20 @@ static int sco_connect(struct sock *sk) lock_sock(sk); + /* Recheck state after reacquiring the socket lock, as another + * thread may have changed it (e.g., closed the socket). + */ + if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) { + release_sock(sk); + hci_conn_drop(hcon); + err = -EBADFD; + goto unlock; + } + err = sco_chan_add(conn, sk, NULL); if (err) { release_sock(sk); + hci_conn_drop(hcon); goto unlock; } @@ -655,13 +666,18 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen addr->sa_family != AF_BLUETOOTH) return -EINVAL; - if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) + lock_sock(sk); + + if (sk->sk_state != BT_OPEN && sk->sk_state != BT_BOUND) { + release_sock(sk); return -EBADFD; + } - if (sk->sk_type != SOCK_SEQPACKET) - err = -EINVAL; + if (sk->sk_type != SOCK_SEQPACKET) { + release_sock(sk); + return -EINVAL; + } - lock_sock(sk); /* Set destination address and psm */ bacpy(&sco_pi(sk)->dst, &sa->sco_bdaddr); release_sock(sk); diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index 7f97e7f977992..a0d3508717454 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -1505,7 +1505,7 @@ static struct j1939_session *j1939_session_new(struct j1939_priv *priv, session->state = J1939_SESSION_NEW; skb_queue_head_init(&session->skb_queue); - skb_queue_tail(&session->skb_queue, skb); + skb_queue_tail(&session->skb_queue, skb_get(skb)); skcb = j1939_skb_to_cb(skb); memcpy(&session->skcb, skcb, sizeof(session->skcb)); diff --git a/net/core/dev.c b/net/core/dev.c index f362a1eca1237..f2218f61a7788 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -7468,11 +7468,12 @@ static int napi_thread_wait(struct napi_struct *napi) return -1; } -static void napi_threaded_poll_loop(struct napi_struct *napi, bool busy_poll) +static void napi_threaded_poll_loop(struct napi_struct *napi, + unsigned long *busy_poll_last_qs) { + unsigned long last_qs = busy_poll_last_qs ? *busy_poll_last_qs : jiffies; struct bpf_net_context __bpf_net_ctx, *bpf_net_ctx; struct softnet_data *sd; - unsigned long last_qs = jiffies; for (;;) { bool repoll = false; @@ -7501,12 +7502,12 @@ static void napi_threaded_poll_loop(struct napi_struct *napi, bool busy_poll) /* When busy poll is enabled, the old packets are not flushed in * napi_complete_done. So flush them here. */ - if (busy_poll) + if (busy_poll_last_qs) gro_flush_normal(&napi->gro, HZ >= 1000); local_bh_enable(); /* Call cond_resched here to avoid watchdog warnings. */ - if (repoll || busy_poll) { + if (repoll || busy_poll_last_qs) { rcu_softirq_qs_periodic(last_qs); cond_resched(); } @@ -7514,11 +7515,15 @@ static void napi_threaded_poll_loop(struct napi_struct *napi, bool busy_poll) if (!repoll) break; } + + if (busy_poll_last_qs) + *busy_poll_last_qs = last_qs; } static int napi_threaded_poll(void *data) { struct napi_struct *napi = data; + unsigned long last_qs = jiffies; bool want_busy_poll; bool in_busy_poll; unsigned long val; @@ -7536,7 +7541,7 @@ static int napi_threaded_poll(void *data) assign_bit(NAPI_STATE_IN_BUSY_POLL, &napi->state, want_busy_poll); - napi_threaded_poll_loop(napi, want_busy_poll); + napi_threaded_poll_loop(napi, want_busy_poll ? &last_qs : NULL); } return 0; @@ -12767,7 +12772,7 @@ static void run_backlog_napi(unsigned int cpu) { struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu); - napi_threaded_poll_loop(&sd->backlog, false); + napi_threaded_poll_loop(&sd->backlog, NULL); } static void backlog_napi_setup(unsigned int cpu) diff --git a/net/ipv6/netfilter/ip6t_eui64.c b/net/ipv6/netfilter/ip6t_eui64.c index d704f7ed300c2..da69a27e8332c 100644 --- a/net/ipv6/netfilter/ip6t_eui64.c +++ b/net/ipv6/netfilter/ip6t_eui64.c @@ -22,8 +22,7 @@ eui64_mt6(const struct sk_buff *skb, struct xt_action_param *par) unsigned char eui64[8]; if (!(skb_mac_header(skb) >= skb->head && - skb_mac_header(skb) + ETH_HLEN <= skb->data) && - par->fragoff != 0) { + skb_mac_header(skb) + ETH_HLEN <= skb->data)) { par->hotdrop = true; return false; } diff --git a/net/netfilter/nf_conntrack_ecache.c b/net/netfilter/nf_conntrack_ecache.c index 81baf20826046..9df159448b897 100644 --- a/net/netfilter/nf_conntrack_ecache.c +++ b/net/netfilter/nf_conntrack_ecache.c @@ -247,6 +247,8 @@ void nf_ct_expect_event_report(enum ip_conntrack_expect_events event, struct nf_ct_event_notifier *notify; struct nf_conntrack_ecache *e; + lockdep_nfct_expect_lock_held(); + rcu_read_lock(); notify = rcu_dereference(net->ct.nf_conntrack_event_cb); if (!notify) diff --git a/net/netfilter/nf_conntrack_expect.c b/net/netfilter/nf_conntrack_expect.c index cfc2daa3fc7f3..f9e65f03dc5ea 100644 --- a/net/netfilter/nf_conntrack_expect.c +++ b/net/netfilter/nf_conntrack_expect.c @@ -51,6 +51,7 @@ void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp, struct net *net = nf_ct_exp_net(exp); struct nf_conntrack_net *cnet; + lockdep_nfct_expect_lock_held(); WARN_ON(!master_help); WARN_ON(timer_pending(&exp->timeout)); @@ -118,6 +119,8 @@ nf_ct_exp_equal(const struct nf_conntrack_tuple *tuple, bool nf_ct_remove_expect(struct nf_conntrack_expect *exp) { + lockdep_nfct_expect_lock_held(); + if (timer_delete(&exp->timeout)) { nf_ct_unlink_expect(exp); nf_ct_expect_put(exp); @@ -177,6 +180,8 @@ nf_ct_find_expectation(struct net *net, struct nf_conntrack_expect *i, *exp = NULL; unsigned int h; + lockdep_nfct_expect_lock_held(); + if (!cnet->expect_count) return NULL; @@ -442,6 +447,8 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect, unsigned int h; int ret = 0; + lockdep_nfct_expect_lock_held(); + if (!master_help) { ret = -ESHUTDOWN; goto out; @@ -498,8 +505,9 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, nf_ct_expect_insert(expect); - spin_unlock_bh(&nf_conntrack_expect_lock); nf_ct_expect_event_report(IPEXP_NEW, expect, portid, report); + spin_unlock_bh(&nf_conntrack_expect_lock); + return 0; out: spin_unlock_bh(&nf_conntrack_expect_lock); diff --git a/net/netfilter/nf_conntrack_h323_asn1.c b/net/netfilter/nf_conntrack_h323_asn1.c index 540d97715bd23..ca103c9461903 100644 --- a/net/netfilter/nf_conntrack_h323_asn1.c +++ b/net/netfilter/nf_conntrack_h323_asn1.c @@ -922,6 +922,8 @@ int DecodeQ931(unsigned char *buf, size_t sz, Q931 *q931) break; p++; len--; + if (len <= 0) + break; return DecodeH323_UserInformation(buf, p, len, &q931->UUIE); } diff --git a/net/netfilter/nf_conntrack_helper.c b/net/netfilter/nf_conntrack_helper.c index ceb48c3ca0a43..9d7d36ac83083 100644 --- a/net/netfilter/nf_conntrack_helper.c +++ b/net/netfilter/nf_conntrack_helper.c @@ -419,7 +419,7 @@ void nf_conntrack_helper_unregister(struct nf_conntrack_helper *me) */ synchronize_rcu(); - nf_ct_expect_iterate_destroy(expect_iter_me, NULL); + nf_ct_expect_iterate_destroy(expect_iter_me, me); nf_ct_iterate_destroy(unhelp, me); } EXPORT_SYMBOL_GPL(nf_conntrack_helper_unregister); diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index e54128fa594b9..633c57f992dd5 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c @@ -3353,31 +3353,37 @@ static int ctnetlink_get_expect(struct sk_buff *skb, if (err < 0) return err; + skb2 = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); + if (!skb2) + return -ENOMEM; + + spin_lock_bh(&nf_conntrack_expect_lock); exp = nf_ct_expect_find_get(info->net, &zone, &tuple); - if (!exp) + if (!exp) { + spin_unlock_bh(&nf_conntrack_expect_lock); + kfree_skb(skb2); return -ENOENT; + } if (cda[CTA_EXPECT_ID]) { __be32 id = nla_get_be32(cda[CTA_EXPECT_ID]); if (id != nf_expect_get_id(exp)) { nf_ct_expect_put(exp); + spin_unlock_bh(&nf_conntrack_expect_lock); + kfree_skb(skb2); return -ENOENT; } } - skb2 = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); - if (!skb2) { - nf_ct_expect_put(exp); - return -ENOMEM; - } - rcu_read_lock(); err = ctnetlink_exp_fill_info(skb2, NETLINK_CB(skb).portid, info->nlh->nlmsg_seq, IPCTNL_MSG_EXP_NEW, exp); rcu_read_unlock(); nf_ct_expect_put(exp); + spin_unlock_bh(&nf_conntrack_expect_lock); + if (err <= 0) { kfree_skb(skb2); return -ENOMEM; @@ -3427,22 +3433,26 @@ static int ctnetlink_del_expect(struct sk_buff *skb, if (err < 0) return err; + spin_lock_bh(&nf_conntrack_expect_lock); + /* bump usage count to 2 */ exp = nf_ct_expect_find_get(info->net, &zone, &tuple); - if (!exp) + if (!exp) { + spin_unlock_bh(&nf_conntrack_expect_lock); return -ENOENT; + } if (cda[CTA_EXPECT_ID]) { __be32 id = nla_get_be32(cda[CTA_EXPECT_ID]); if (id != nf_expect_get_id(exp)) { nf_ct_expect_put(exp); + spin_unlock_bh(&nf_conntrack_expect_lock); return -ENOENT; } } /* after list removal, usage count == 1 */ - spin_lock_bh(&nf_conntrack_expect_lock); if (timer_delete(&exp->timeout)) { nf_ct_unlink_expect_report(exp, NETLINK_CB(skb).portid, nlmsg_report(info->nlh)); diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c index f714ee7998ff6..6411001710316 100644 --- a/net/netfilter/nf_tables_api.c +++ b/net/netfilter/nf_tables_api.c @@ -9349,6 +9349,7 @@ static int nf_tables_newflowtable(struct sk_buff *skb, return 0; err_flowtable_hooks: + synchronize_rcu(); nft_trans_destroy(trans); err_flowtable_trans: nft_hooks_destroy(&flowtable->hook_list); diff --git a/net/netfilter/xt_tcpmss.c b/net/netfilter/xt_tcpmss.c index 37704ab017992..0d32d4841cb32 100644 --- a/net/netfilter/xt_tcpmss.c +++ b/net/netfilter/xt_tcpmss.c @@ -61,7 +61,7 @@ tcpmss_mt(const struct sk_buff *skb, struct xt_action_param *par) return (mssval >= info->mss_min && mssval <= info->mss_max) ^ info->invert; } - if (op[i] < 2) + if (op[i] < 2 || i == optlen - 1) i++; else i += op[i+1] ? : 1; diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 5cc8e407e7911..8ea37c2c3c549 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c @@ -603,8 +603,12 @@ TC_INDIRECT_SCOPE int tcf_csum_act(struct sk_buff *skb, protocol = skb->protocol; orig_vlan_tag_present = true; } else { - struct vlan_hdr *vlan = (struct vlan_hdr *)skb->data; + struct vlan_hdr *vlan; + if (!pskb_may_pull(skb, VLAN_HLEN)) + goto drop; + + vlan = (struct vlan_hdr *)skb->data; protocol = vlan->h_vlan_encapsulated_proto; skb_pull(skb, VLAN_HLEN); skb_reset_network_header(skb); diff --git a/redhat/configs/rhel/automotive/generic/arm/aarch64/CONFIG_AQTION b/redhat/configs/common/generic/CONFIG_AQTION similarity index 100% rename from redhat/configs/rhel/automotive/generic/arm/aarch64/CONFIG_AQTION rename to redhat/configs/common/generic/CONFIG_AQTION diff --git a/redhat/configs/rhel/generic/CONFIG_AQTION b/redhat/configs/rhel/generic/CONFIG_AQTION deleted file mode 100644 index 42dea55ccf3bf..0000000000000 --- a/redhat/configs/rhel/generic/CONFIG_AQTION +++ /dev/null @@ -1 +0,0 @@ -# CONFIG_AQTION is not set diff --git a/redhat/configs/rhel/generic/x86/CONFIG_AQTION b/redhat/configs/rhel/generic/x86/CONFIG_AQTION deleted file mode 100644 index 7812ca0163779..0000000000000 --- a/redhat/configs/rhel/generic/x86/CONFIG_AQTION +++ /dev/null @@ -1 +0,0 @@ -CONFIG_AQTION=m diff --git a/redhat/kernel.changelog-10.2 b/redhat/kernel.changelog-10.2 index b0b1b17c051c6..3089903db7f6a 100644 --- a/redhat/kernel.changelog-10.2 +++ b/redhat/kernel.changelog-10.2 @@ -1,3 +1,92 @@ +* Thu May 21 2026 CKI KWF Bot [6.12.0-211.18.1.el10_2] +- xfs: fix freemap adjustments when adding xattrs to leaf blocks (CKI Backport Bot) [RHEL-174051] {CVE-2026-43158} +- xfs: delete attr leaf freemap entries when empty (CKI Backport Bot) [RHEL-174051] {CVE-2026-43158} +- Bluetooth: SCO: fix race conditions in sco_sock_connect() (CKI Backport Bot) [RHEL-172603] {CVE-2026-43023} +- Bluetooth: MGMT: validate LTK enc_size on load (CKI Backport Bot) [RHEL-172577] {CVE-2026-43020} +- crypto: tegra - Disable softirqs before finalizing request (CKI Backport Bot) [RHEL-133872] +Resolves: RHEL-133872, RHEL-172577, RHEL-172603, RHEL-174051 + +* Wed May 20 2026 CKI KWF Bot [6.12.0-211.17.1.el10_2] +- dm-thin: fix metadata refcount underflow (Benjamin Marzinski) [RHEL-169625] +- redhat/kernel.spec.template: disable OBJTOOL_WERROR for gcov builds (Oleksii Baranov) +- mm/page_alloc: clear page->private in free_pages_prepare() (Rafael Aquini) [RHEL-174756] {CVE-2026-43303} +- dpaa2-switch: validate num_ifs to prevent out-of-bounds write (CKI Backport Bot) [RHEL-174258] {CVE-2026-43205} +- dpaa2-switch: prevent ZERO_SIZE_PTR dereference when num_ifs is zero (CKI Backport Bot) [RHEL-174258] {CVE-2026-43205} +- mm: thp: deny THP for files on anonymous inodes (Rafael Aquini) [RHEL-171617] {CVE-2026-23375} +- fs: add S_ANON_INODE (Rafael Aquini) [RHEL-171617] +- anon_inode: raise SB_I_NODEV and SB_I_NOEXEC (Rafael Aquini) [RHEL-171617] +- pidfs: use anon_inode_setattr() (Rafael Aquini) [RHEL-171617] +- anon_inode: explicitly block ->setattr() (Rafael Aquini) [RHEL-171617] +- pidfs: use anon_inode_getattr() (Rafael Aquini) [RHEL-171617] +- anon_inode: use a proper mode internally (Rafael Aquini) [RHEL-171617] +- ice: set max queues in alloc_etherdev_mqs() (CKI Backport Bot) [RHEL-174331] +- ice: use netif_get_num_default_rss_queues() (CKI Backport Bot) [RHEL-174331] +- net: Fix rcu_tasks stall in threaded busypoll (CKI Backport Bot) [RHEL-170809] +- netfilter: xt_tcpmss: check remaining length before reading optlen (CKI Backport Bot) [RHEL-174217] {CVE-2026-43190} +- netfilter: ctnetlink: ensure safe access to master conntrack (CKI Backport Bot) [RHEL-173872] {CVE-2026-43116} +- wifi: brcmfmac: validate bsscfg indices in IF events (CKI Backport Bot) [RHEL-173857] {CVE-2026-43110} +- redhat/configs: enable CONFIG_AQTION on all archs (CKI Backport Bot) [RHEL-171944] +- HID: wacom: fix out-of-bounds read in wacom_intuos_bt_irq (CKI Backport Bot) [RHEL-172745] {CVE-2026-43051} +- netfilter: nf_conntrack_helper: pass helper to expect cleanup (CKI Backport Bot) [RHEL-172625] {CVE-2026-43027} +- io_uring/rsrc: reject zero-length fixed buffer import (CKI Backport Bot) [RHEL-172556] {CVE-2026-43006} +- dpll: zl3073x: Remove redundant cleanup in devm_dpll_init() (CKI Backport Bot) [RHEL-164434] +- dpll: zl3073x: fix REF_PHASE_OFFSET_COMP register width for some chip IDs (CKI Backport Bot) [RHEL-164434] +- dpll: zl3073x: Fix ref frequency setting (CKI Backport Bot) [RHEL-164434] +- dpll: zl3073x: Include current frequency in supported frequencies list (CKI Backport Bot) [RHEL-164434] +- dpll: zl3073x: Add output pin frequency helper (CKI Backport Bot) [RHEL-164434] +- cifs: make default value of retrans as zero (Paulo Alcantara) [RHEL-171637] +- cifs: remove unnecessary tracing after put tcon (Paulo Alcantara) [RHEL-171637] +- netfilter: ip6t_eui64: reject invalid MAC header for all packets (CKI Backport Bot) [RHEL-171159] {CVE-2026-31685} +- net: sched: act_csum: validate nested VLAN headers (CKI Backport Bot) [RHEL-171142] {CVE-2026-31684} +- drm/mgag200: fix mgag200_bmc_stop_scanout() (Jocelyn Falempe) [RHEL-150180] +- scsi: lpfc: avoid crashing in lpfc_nlp_get() if lpfc_nodelist was freed (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Revise logging format for failed CT MIB requests" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Update debugfs trace ring initialization messages" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Check for hdwq null ptr when cleaning up lpfc_vport structure" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Skip RSCN processing when FC_UNLOADING flag is set" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Early return out of FDMI cmpl for locally rejected statuses" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Simplify error handling for failed lpfc_get_sli4_parameters cmd" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Relocate clearing initial phba flags from link up to link down hdlr" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Ensure HBA_SETUP flag is used only for SLI4 in dev_loss_tmo_callbk" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Move clearing of HBA_SETUP flag to before lpfc_sli4_queue_unset" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Revise CQ_CREATE_SET mailbox bitfield definitions" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Modify end-of-life adapters' model descriptions" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Update lpfc version to 14.4.0.10" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Copyright updates for 14.4.0.10 patches" (Ewan D. Milne) [RHEL-169786] +- Revert "lpfc: don't use file->f_path.dentry for comparisons" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Fix wrong function reference in a comment" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: use min() to improve code" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Use int type to store negative error codes" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Remove unused member variables in struct lpfc_hba and lpfc_vport" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Abort outstanding ELS WQEs regardless of if rmmod is in progress" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Clean up allocated queues when queue setup mbox commands fail" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Remove ndlp kref decrement clause for F_Port_Ctrl in lpfc_cleanup" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Decrement ndlp kref after FDISC retries exhausted" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Check return status of lpfc_reset_flush_io_context during TGT_RESET" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Ensure PLOGI_ACC is sent prior to PRLI in Point to Point topology" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Define size of debugfs entry for xri rebalancing" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Fix memory leak when nvmeio_trc debugfs entry is used" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Use switch case statements in DIF debugfs handlers" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Clean up extraneous phba dentries" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Convert debugfs directory counts from atomic to unsigned int" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Update lpfc version to 14.4.0.11" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Copyright updates for 14.4.0.11 patches" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Update various NPIV diagnostic log messaging" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Revise discovery related function headers and comments" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Remove redundant NULL ptr assignment in lpfc_els_free_iocb()" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Ensure unregistration of rpis for received PLOGIs" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Fix leaked ndlp krefs when in point-to-point topology" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Modify kref handling for Fabric Controller ndlps" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Fix reusing an ndlp that is marked NLP_DROPPED during FLOGI" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Allow support for BB credit recovery in point-to-point topology" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Add capability to register Platform Name ID to fabric" (Ewan D. Milne) [RHEL-169786] +- Revert "scsi: lpfc: Update lpfc version to 14.4.0.12" (Ewan D. Milne) [RHEL-169786] +- netfilter: nf_conntrack_h323: check for zero length in DecodeQ931() (CKI Backport Bot) [RHEL-166991] {CVE-2026-23455} +- ima: don't clear IMA_DIGSIG flag when setting or removing non-IMA xattr (Bruno Meneguele) [RHEL-169738] {CVE-2025-68183} +- can: j1939: j1939_session_new(): fix skb reference counting (CKI Backport Bot) [RHEL-162260] {CVE-2024-56645} +- netfilter: nf_tables: release flowtable after rcu grace period on error (CKI Backport Bot) [RHEL-160469] {CVE-2026-23392} +Resolves: RHEL-150180, RHEL-160469, RHEL-162260, RHEL-164434, RHEL-166991, RHEL-169625, RHEL-169738, RHEL-169786, RHEL-170809, RHEL-171142, RHEL-171159, RHEL-171617, RHEL-171637, RHEL-171944, RHEL-172556, RHEL-172625, RHEL-172745, RHEL-173857, RHEL-173872, RHEL-174217, RHEL-174258, RHEL-174331, RHEL-174756 + * Mon May 18 2026 CKI KWF Bot [6.12.0-211.16.1.el10_2] - net: skbuff: propagate shared-frag marker through frag-transfer helpers (Sabrina Dubroca) [RHEL-176053] {CVE-2026-46300} - net: skbuff: preserve shared-frag marker during coalescing (Sabrina Dubroca) [RHEL-176053] {CVE-2026-46300} diff --git a/redhat/kernel.spec.template b/redhat/kernel.spec.template index ebb3bf2e36f3f..a86ff99518dcb 100644 --- a/redhat/kernel.spec.template +++ b/redhat/kernel.spec.template @@ -2077,6 +2077,13 @@ do done rm -f $i.tmp done +%if %{with_gcov} +%{log_msg "Disabling CONFIG_OBJTOOL_WERROR for gcov build"} +for i in %{all_configs} +do + sed -i "s|CONFIG_OBJTOOL_WERROR=y|# CONFIG_OBJTOOL_WERROR is not set|g" $i +done +%endif %endif %if %{signkernel}%{signmodules} diff --git a/redhat/scripts/generate-rebuild-changelog.sh b/redhat/scripts/generate-rebuild-changelog.sh index db75fac530b17..e6fd9feb12881 100755 --- a/redhat/scripts/generate-rebuild-changelog.sh +++ b/redhat/scripts/generate-rebuild-changelog.sh @@ -60,26 +60,38 @@ fi last_synced=$(sed -n '/\[.*\]$/{s/.*\[\([^]]*\)\]$/\1/p;q;}' "$distgit_clog") pkg_version="$DISTBASEVERSION" +HEAD="${HEAD:-HEAD}" -# Assemble: rebuild entry + new kernel entries + previous changelog -{ - # Create the rebuild entry, e.g.: - # * Thu Feb 19 2026 Scott Weaver - 6.12.0-209.el10iv - # - Rebuilt for kernel-automotive - cdate=$(LC_ALL=C date +"%a %b %d %Y") - cname="$(git config user.name) <$(git config user.email)>" - echo "* $cdate $cname - $pkg_version" - echo "- Rebuilt for ${SPECPACKAGE_NAME}" - echo "" +# Get the commit SHA for the rebuild reference +commit_sha=$(git rev-parse --short=12 "$HEAD") - # Extract only new entries from the kernel changelog. +# Assemble: rebuild entry combined with first kernel entry + remaining entries + previous changelog +{ + # Extract new entries from the kernel changelog. # Take everything since the last synced version. + new_entries=$(mktemp) if [[ -n "$last_synced" ]]; then - sed "/\[${last_synced}\]/,\$d" "$kernel_clog" + sed "/\[${last_synced}\]/,\$d" "$kernel_clog" > "$new_entries" else - cat "$kernel_clog" + cat "$kernel_clog" > "$new_entries" fi + # Create the rebuild entry + # Example output: + # * Mon Apr 20 2026 Oleksii Baranov - 6.12.0-220.el10iv + # - Rebuild base kernel commit 5df0f425c0d3 for kernel-automotive + # - iommufd: Report ATS not supported status via IOMMU_GET_HW_INFO (Jerry Snitselaar) [RHEL-160188] + # Resolves: RHEL-160188 + cdate=$(LC_ALL=C date +"%a %b %d %Y") + cname="$(git config user.name) <$(git config user.email)>" + echo "* $cdate $cname - $pkg_version" + echo "- Rebuild base kernel commit ${commit_sha} for ${SPECPACKAGE_NAME}" + + # Remove the first line starting with * (the kernel entry header) and keep everything else + sed '0,/^\* /{ /^\* /d; }' "$new_entries" + + rm -f "$new_entries" + # Append the changelog that we fetched from dist-git cat "$distgit_clog" } > "$pkg_clog" diff --git a/security/integrity/ima/ima_appraise.c b/security/integrity/ima/ima_appraise.c index 656c709b974fd..f7770c24995b7 100644 --- a/security/integrity/ima/ima_appraise.c +++ b/security/integrity/ima/ima_appraise.c @@ -671,6 +671,15 @@ static int ima_protect_xattr(struct dentry *dentry, const char *xattr_name, return 0; } +/* + * ima_reset_appraise_flags - reset ima_iint_cache flags + * + * @digsig: whether to clear/set IMA_DIGSIG flag, tristate values + * 0: clear IMA_DIGSIG + * 1: set IMA_DIGSIG + * -1: don't change IMA_DIGSIG + * + */ static void ima_reset_appraise_flags(struct inode *inode, int digsig) { struct ima_iint_cache *iint; @@ -683,9 +692,9 @@ static void ima_reset_appraise_flags(struct inode *inode, int digsig) return; iint->measured_pcrs = 0; set_bit(IMA_CHANGE_XATTR, &iint->atomic_flags); - if (digsig) + if (digsig == 1) set_bit(IMA_DIGSIG, &iint->atomic_flags); - else + else if (digsig == 0) clear_bit(IMA_DIGSIG, &iint->atomic_flags); } @@ -771,6 +780,8 @@ static int ima_inode_setxattr(struct mnt_idmap *idmap, struct dentry *dentry, digsig = (xvalue->type == EVM_IMA_XATTR_DIGSIG); } else if (!strcmp(xattr_name, XATTR_NAME_EVM) && xattr_value_len > 0) { digsig = (xvalue->type == EVM_XATTR_PORTABLE_DIGSIG); + } else { + digsig = -1; } if (result == 1 || evm_revalidate_status(xattr_name)) { ima_reset_appraise_flags(d_backing_inode(dentry), digsig); @@ -784,7 +795,7 @@ static int ima_inode_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, const char *acl_name, struct posix_acl *kacl) { if (evm_revalidate_status(acl_name)) - ima_reset_appraise_flags(d_backing_inode(dentry), 0); + ima_reset_appraise_flags(d_backing_inode(dentry), -1); return 0; } @@ -792,11 +803,13 @@ static int ima_inode_set_acl(struct mnt_idmap *idmap, struct dentry *dentry, static int ima_inode_removexattr(struct mnt_idmap *idmap, struct dentry *dentry, const char *xattr_name) { - int result; + int result, digsig = -1; result = ima_protect_xattr(dentry, xattr_name, NULL, 0); if (result == 1 || evm_revalidate_status(xattr_name)) { - ima_reset_appraise_flags(d_backing_inode(dentry), 0); + if (!strcmp(xattr_name, XATTR_NAME_IMA)) + digsig = 0; + ima_reset_appraise_flags(d_backing_inode(dentry), digsig); if (result == 1) result = 0; } diff --git a/uki-addons.sbat b/uki-addons.sbat index d58f7014b0ab8..59f4eb70703e8 100644 --- a/uki-addons.sbat +++ b/uki-addons.sbat @@ -1,2 +1,2 @@ sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md -kernel-uki-virt-addons.rocky,1,RESF,kernel-uki-virt-addons,6.12.0-211.16.1.el10_2.x86_64,mailto:security@rockylinux.org +kernel-uki-virt-addons.rocky,1,RESF,kernel-uki-virt-addons,6.12.0-211.18.1.el10_2.x86_64,mailto:security@rockylinux.org diff --git a/uki.sbat b/uki.sbat index 5cec6c3dd154d..860dec4d6d59d 100644 --- a/uki.sbat +++ b/uki.sbat @@ -1,2 +1,2 @@ sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md -kernel-uki-virt.rocky,1,RESF,kernel-uki-virt,6.12.0-211.16.1.el10_2.x86_64,mailto:security@rockylinux.org +kernel-uki-virt.rocky,1,RESF,kernel-uki-virt,6.12.0-211.18.1.el10_2.x86_64,mailto:security@rockylinux.org