Hello community, here is the log from the commit of package rshim for openSUSE:Factory checked in at 2020-11-11 20:48:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rshim (Old) and /work/SRC/openSUSE:Factory/.rshim.new.26437 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rshim" Wed Nov 11 20:48:11 2020 rev:3 rq:847759 version:2.0.4.40 Changes: -------- --- /work/SRC/openSUSE:Factory/rshim/rshim.changes 2020-10-05 19:43:17.201795827 +0200 +++ /work/SRC/openSUSE:Factory/.rshim.new.26437/rshim.changes 2020-11-11 20:48:14.683751366 +0100 @@ -1,0 +2,11 @@ +Wed Nov 11 10:12:08 UTC 2020 - Matthias Brugger <[email protected]> + +- update to latest version (jsc#SLE-16098 jsc#SLE-13565 jsc#SLE-16108 jsc#SLE-15271) + * Some robust fixes for USB rshim + * Fix a typo in pcie mmap + * Check rshim accessibility when re-enabling it + * Enable console output during boot stream pushing + * Add some delay for the pcie_lf probe + * Auto-start rshim service after installation + +------------------------------------------------------------------- Old: ---- rshim-2.0.4.32.tar New: ---- rshim-2.0.4.40.tar ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rshim.spec ++++++ --- /var/tmp/diff_new_pack.VbLvJN/_old 2020-11-11 20:48:15.295751941 +0100 +++ /var/tmp/diff_new_pack.VbLvJN/_new 2020-11-11 20:48:15.299751945 +0100 @@ -18,7 +18,7 @@ Name: rshim -Version: 2.0.4.32 +Version: 2.0.4.40 Release: 0 Summary: User-space driver for Mellanox BlueField SoC License: GPL-2.0-only ++++++ rshim-2.0.4.32.tar -> rshim-2.0.4.40.tar ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/debian/changelog new/rshim-2.0.4.40/debian/changelog --- old/rshim-2.0.4.32/debian/changelog 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/debian/changelog 2020-10-29 13:09:30.000000000 +0100 @@ -1,3 +1,12 @@ +rshim (2.0.5-5) UNRELEASED; urgency=low + + * Check rshim accessibility when re-enabling it + * Enable console output during boot stream pushing + * Add some delay for the pcie_lf probe + * Auto-start rshim service after installation + + -- Liming Sun <[email protected]> Thu, 29 Oct 2020 08:06:13 -0400 + rshim (2.0.5-4) UNRELEASED; urgency=low * Some robust fixes for USB rshim diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/debian/rules new/rshim-2.0.4.40/debian/rules --- old/rshim-2.0.4.32/debian/rules 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/debian/rules 2020-10-29 13:09:30.000000000 +0100 @@ -9,3 +9,4 @@ override_dh_auto_install: dh_auto_install dh_systemd_enable || true + dh_systemd_start || true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/rhel/rshim.spec.in new/rshim-2.0.4.40/rhel/rshim.spec.in --- old/rshim-2.0.4.32/rhel/rshim.spec.in 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/rhel/rshim.spec.in 2020-10-29 13:09:30.000000000 +0100 @@ -4,7 +4,7 @@ Name: rshim Version: @VERSION@ -Release: 4%{?dist} +Release: 5%{?dist} Summary: User-space driver for Mellanox BlueField SoC License: GPLv2 @@ -54,6 +54,12 @@ %{_mandir}/man8/rshim.8.gz %changelog +* Thu Oct 29 2020 Liming Sun <[email protected]> - 2.0.5-5 +- Check rshim accessibility when re-enabling it +- Enable console output during boot stream pushing +- Add some delay for the pcie_lf probe +- Auto-start rshim service after installation + * Fri Sep 25 2020 Liming Sun <[email protected]> - 2.0.5-4 - Some robust fixes for USB rshim - Fix a typo in pcie mmap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/rshim.spec.in new/rshim-2.0.4.40/rshim.spec.in --- old/rshim-2.0.4.32/rshim.spec.in 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/rshim.spec.in 2020-10-29 13:09:30.000000000 +0100 @@ -4,7 +4,7 @@ Name: rshim Version: @VERSION@ -Release: 4%{?dist} +Release: 5%{?dist} Summary: User-space driver for Mellanox BlueField SoC License: GPLv2 @@ -53,18 +53,30 @@ %{__install} -d %{buildroot}%{_sysconfdir} %{__install} -m 0644 etc/rshim.conf %{buildroot}%{_sysconfdir} +%pre +%if "%{with_systemd}" == "1" + if systemctl is-active --quiet rshim ; then + systemctl stop rshim + fi +%endif + %post %if "%{with_systemd}" == "1" systemctl daemon-reload - systemctl enable rshim.service + systemctl enable rshim + systemctl start rshim %endif %preun +if [ "$1" = "0" ]; then %if "%{with_systemd}" == "1" - systemctl stop rshim + if systemctl is-active --quiet rshim ; then + systemctl stop rshim + fi %else killall -9 rshim %endif +fi %files %{!?_licensedir:%global license %%doc} @@ -79,6 +91,12 @@ %{_mandir}/man8/rshim.8.gz %changelog +* Thu Oct 29 2020 Liming Sun <[email protected]> - 2.0.5-5 +- Check rshim accessibility when re-enabling it +- Enable console output during boot stream pushing +- Add some delay for the pcie_lf probe +- Auto-start rshim service after installation + * Fri Sep 25 2020 Liming Sun <[email protected]> - 2.0.5-4 - Some robust fixes for USB rshim - Fix a typo in pcie mmap diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/src/rshim.c new/rshim-2.0.4.40/src/rshim.c --- old/rshim-2.0.4.32/src/rshim.c 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/src/rshim.c 2020-10-29 13:09:30.000000000 +0100 @@ -274,9 +274,6 @@ return -EINVAL; } - if (bd->is_boot_open) - return 0; - while (total < count) { if (avail == 0) { rc = bd->read_rshim(bd, RSHIM_CHANNEL, RSH_TM_TILE_TO_HOST_STS, ®); @@ -1033,7 +1030,7 @@ uint8_t rx_avail = 0; int rc; - if (bd->is_boot_open || !bd->has_rshim || !bd->has_tm) + if (!bd->has_rshim || !bd->has_tm) return; again: @@ -1587,6 +1584,8 @@ } if (bd->is_boot_open || bd->is_booting) { + if (bd->is_boot_open && bd->has_cons_work) + rshim_fifo_input(bd); pthread_mutex_unlock(&bd->mutex); return; } @@ -2108,8 +2107,7 @@ return 0; } -/* Check whether backend is allowed to register or not. */ -static int rshim_access_check(rshim_backend_t *bd) +int rshim_access_check(rshim_backend_t *bd) { rshim_backend_t *other_bd; uint64_t value; @@ -2368,6 +2366,7 @@ static void rshim_main(int argc, char *argv[]) { int i, fd, num, rc, epoll_fd, timer_fd, index; + bool rshim_pcie_lf_init_done = false; #ifdef __FreeBSD__ const int MAXEVENTS = 16; #else @@ -2377,6 +2376,7 @@ struct epoll_event event; struct itimerspec ts; rshim_backend_t *bd; + time_t t0, t1; uint8_t tmp; memset(&event, 0, sizeof(event)); @@ -2453,7 +2453,6 @@ if (!rshim_backend_name) { rshim_pcie_init(); rshim_usb_init(epoll_fd); - rshim_pcie_lf_init(); } else { if (!strcmp(rshim_backend_name, "usb")) rc = rshim_usb_init(epoll_fd); @@ -2467,6 +2466,8 @@ exit(-1); } + time(&t0); + while (rshim_run) { num = epoll_wait(epoll_fd, events, MAXEVENTS, -1); if (num <= 0) { @@ -2522,6 +2523,15 @@ /* Check USB for timeout or unhandled fd. */ rshim_usb_poll(); } + + /* Delayed initialization for livefish probe. */ + if (!rshim_pcie_lf_init_done && !rshim_backend_name) { + time(&t1); + if (difftime(t1, t0) > 3) { + rshim_pcie_lf_init(); + rshim_pcie_lf_init_done = true; + } + } } rshim_stop(); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/src/rshim.h new/rshim-2.0.4.40/src/rshim.h --- old/rshim-2.0.4.32/src/rshim.h 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/src/rshim.h 2020-10-29 13:09:30.000000000 +0100 @@ -546,4 +546,7 @@ int rshim_get_opn(rshim_backend_t *bd, char *opn, int len); int rshim_set_opn(rshim_backend_t *bd, const char *opn, int len); +/* Check whether rshim backend is accessible or not. */ +int rshim_access_check(rshim_backend_t *bd); + #endif /* _RSHIM_H */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/src/rshim_fuse.c new/rshim-2.0.4.40/src/rshim_fuse.c --- old/rshim-2.0.4.32/src/rshim_fuse.c 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/src/rshim_fuse.c 2020-10-29 13:09:30.000000000 +0100 @@ -786,7 +786,7 @@ rshim_backend_t *bd = cuse_dev_get_priv0(cdev); const char *p = buf; #endif - int i, rc = 0, value = 0, mac[6], vlan[2] = {0}; + int i, rc = 0, value = 0, mac[6], vlan[2] = {0}, old_value; char opn[RSHIM_YU_BOOT_RECORD_OPN_SIZE + 1] = ""; char key[32]; @@ -828,6 +828,7 @@ } else if (strcmp(key, "DROP_MODE") == 0) { if (sscanf(p, "%d", &value) != 1) goto invalid; + old_value = (int)bd->drop_mode; bd->drop_mode = !!value; if (bd->drop_mode) bd->drop_pkt = 1; @@ -835,6 +836,18 @@ if (bd->enable_device(bd, true)) bd->drop_mode = 1; } + /* + * Check if another endpoint driver has already attached to the + * same rshim device before enabling it. + */ + if (old_value && !bd->drop_mode) { + pthread_mutex_lock(&bd->mutex); + if (rshim_access_check(bd)) { + RSHIM_WARN("rshim %s is not accessible\n", bd->dev_name); + bd->drop_mode = old_value; + } + pthread_mutex_unlock(&bd->mutex); + } } else if (strcmp(key, "BOOT_MODE") == 0) { if (sscanf(p, "%x", &value) != 1) goto invalid; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/src/rshim_log.c new/rshim-2.0.4.40/src/rshim_log.c --- old/rshim-2.0.4.32/src/rshim_log.c 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/src/rshim_log.c 2020-10-29 13:09:30.000000000 +0100 @@ -11,7 +11,7 @@ /* Log module */ const char * const rshim_log_mod[] = { - "others", "BL1", "BL2", "BL2R", "BL31", "UEFI" + "MISC", "BL1", "BL2", "BL2R", "BL31", "UEFI" }; /* Log level */ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/rshim-2.0.4.32/src/rshim_pcie.c new/rshim-2.0.4.40/src/rshim_pcie.c --- old/rshim-2.0.4.32/src/rshim_pcie.c 2020-09-28 20:16:37.000000000 +0200 +++ new/rshim-2.0.4.40/src/rshim_pcie.c 2020-10-29 13:09:30.000000000 +0100 @@ -500,6 +500,7 @@ pci_dev->dev, pci_dev->func); dir = opendir(path); if (dir) { + RSHIM_ERR("failed to open %s\n", path); closedir(dir); return -EBUSY; } @@ -509,19 +510,22 @@ SYS_BUS_PCI, pci_dev->domain, pci_dev->bus, pci_dev->dev, pci_dev->func); fd = open(path, O_RDWR | O_CLOEXEC); - if (fd == -1) + if (fd == -1) { + RSHIM_ERR("failed to open %s\n", path); return -errno; + } if (write(fd, enable ? "1" : "0", 1) < 0) rc = -errno; close(fd); - if (rc) + if (rc) { + RSHIM_ERR("failed to write to %s\n", path); return rc; + } pci_write_word(pci_dev, PCI_COMMAND, PCI_COMMAND_MEMORY | PCI_COMMAND_MASTER); - return rc; -#else - return 0; #endif + + return 0; } int rshim_pcie_init(void) _______________________________________________ openSUSE Commits mailing list -- [email protected] To unsubscribe, email [email protected] List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette List Archives: https://lists.opensuse.org/archives/list/[email protected]
