From: Greg Kroah-Hartman Date: Thu, 4 May 2017 22:37:48 +0000 (-0700) Subject: 4.4-stable patches X-Git-Tag: v3.18.52~15 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2b3f9e50b53c29a58ecbc7a172dc03c987be73ac;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches added patches: ib-ehca-fix-maybe-uninitialized-warnings.patch ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch --- diff --git a/queue-4.4/ib-ehca-fix-maybe-uninitialized-warnings.patch b/queue-4.4/ib-ehca-fix-maybe-uninitialized-warnings.patch new file mode 100644 index 00000000000..1fbbf0fe2e3 --- /dev/null +++ b/queue-4.4/ib-ehca-fix-maybe-uninitialized-warnings.patch @@ -0,0 +1,53 @@ +From arnd@arndb.de Thu May 4 15:31:46 2017 +From: Arnd Bergmann +Date: Thu, 4 May 2017 22:52:03 +0200 +Subject: IB/ehca: fix maybe-uninitialized warnings +To: gregkh@linuxfoundation.org +Cc: stable@vger.kernel.org, Arnd Bergmann +Message-ID: <20170504205209.498721-8-arnd@arndb.de> + +From: Arnd Bergmann + +The driver causes two warnings about possibly uninitialized variables: + +drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_set_pagebuf': +drivers/infiniband/hw/ehca/ehca_mrmw.c:1908:4: warning: 'prev_pgaddr' may be used uninitialized in this function [-Wmaybe-uninitialized] +drivers/infiniband/hw/ehca/ehca_mrmw.c:1924:14: note: 'prev_pgaddr' was declared here +drivers/infiniband/hw/ehca/ehca_mrmw.c: In function 'ehca_reg_mr': +drivers/infiniband/hw/ehca/ehca_mrmw.c:2430:5: warning: 'hret' may be used uninitialized in this function [-Wmaybe-uninitialized] + +The first one is definitely a false positive, the second one may or may not +be one. In both cases, adding an intialization is the safe and easy +workaround. + +The driver was removed in mainline in commit e581d111dad3 +("staging/rdma: remove deprecated ehca driver"), in linux-4.6. +In 4.4, the file is located in drivers/staging/rdma/ehca/ehca_mrmw.c, +and the fix still applies. + +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/rdma/ehca/ehca_mrmw.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/staging/rdma/ehca/ehca_mrmw.c ++++ b/drivers/staging/rdma/ehca/ehca_mrmw.c +@@ -1921,7 +1921,7 @@ static int ehca_set_pagebuf_user2(struct + u64 *kpage) + { + int ret = 0; +- u64 pgaddr, prev_pgaddr; ++ u64 pgaddr, prev_pgaddr = 0; + u32 j = 0; + int kpages_per_hwpage = pginfo->hwpage_size / PAGE_SIZE; + int nr_kpages = kpages_per_hwpage; +@@ -2417,6 +2417,7 @@ static int ehca_reg_bmap_mr_rpages(struc + ehca_err(&shca->ib_device, "kpage alloc failed"); + return -ENOMEM; + } ++ hret = H_SUCCESS; + for (top = 0; top < EHCA_MAP_ENTRIES; top++) { + if (!ehca_bmap_valid(ehca_bmap->top[top])) + continue; diff --git a/queue-4.4/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch b/queue-4.4/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch new file mode 100644 index 00000000000..7368e6a0665 --- /dev/null +++ b/queue-4.4/ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch @@ -0,0 +1,92 @@ +From arnd@arndb.de Thu May 4 15:29:57 2017 +From: Arnd Bergmann +Date: Thu, 4 May 2017 22:52:02 +0200 +Subject: IB/qib: rename BITS_PER_PAGE to RVT_BITS_PER_PAGE +To: gregkh@linuxfoundation.org +Cc: stable@vger.kernel.org, Arnd Bergmann +Message-ID: <20170504205209.498721-7-arnd@arndb.de> + +From: Arnd Bergmann + +We get this build warning on arm64 + +drivers/infiniband/hw/qib/qib_qp.c:44:0: error: "BITS_PER_PAGE" redefined [-Werror] + #define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) + +This is fixed upstream in commit 898fa52b4ac3 ("IB/qib: Remove qpn, qp tables and +related variables from qib"), which does a lot of other things as well. + +Instead, I just backport the rename of the local BITS_PER_PAGE definition to +RVT_BITS_PER_PAGE. + +The driver first showed up in linux-2.6.35, and the fixup should still apply +to that. The upstream fix went into v4.6, so we could apply this workaround +to both 3.18 and 4.4. + +Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters") +Signed-off-by: Arnd Bergmann +Signed-off-by: Greg Kroah-Hartman +--- + drivers/infiniband/hw/qib/qib_qp.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/drivers/infiniband/hw/qib/qib_qp.c ++++ b/drivers/infiniband/hw/qib/qib_qp.c +@@ -41,13 +41,13 @@ + + #include "qib.h" + +-#define BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) +-#define BITS_PER_PAGE_MASK (BITS_PER_PAGE-1) ++#define RVT_BITS_PER_PAGE (PAGE_SIZE*BITS_PER_BYTE) ++#define RVT_BITS_PER_PAGE_MASK (RVT_BITS_PER_PAGE-1) + + static inline unsigned mk_qpn(struct qib_qpn_table *qpt, + struct qpn_map *map, unsigned off) + { +- return (map - qpt->map) * BITS_PER_PAGE + off; ++ return (map - qpt->map) * RVT_BITS_PER_PAGE + off; + } + + static inline unsigned find_next_offset(struct qib_qpn_table *qpt, +@@ -59,7 +59,7 @@ static inline unsigned find_next_offset( + if (((off & qpt->mask) >> 1) >= n) + off = (off | qpt->mask) + 2; + } else +- off = find_next_zero_bit(map->page, BITS_PER_PAGE, off); ++ off = find_next_zero_bit(map->page, RVT_BITS_PER_PAGE, off); + return off; + } + +@@ -147,8 +147,8 @@ static int alloc_qpn(struct qib_devdata + qpn = 2; + if (qpt->mask && ((qpn & qpt->mask) >> 1) >= dd->n_krcv_queues) + qpn = (qpn | qpt->mask) + 2; +- offset = qpn & BITS_PER_PAGE_MASK; +- map = &qpt->map[qpn / BITS_PER_PAGE]; ++ offset = qpn & RVT_BITS_PER_PAGE_MASK; ++ map = &qpt->map[qpn / RVT_BITS_PER_PAGE]; + max_scan = qpt->nmaps - !offset; + for (i = 0;;) { + if (unlikely(!map->page)) { +@@ -173,7 +173,7 @@ static int alloc_qpn(struct qib_devdata + * We just need to be sure we don't loop + * forever. + */ +- } while (offset < BITS_PER_PAGE && qpn < QPN_MAX); ++ } while (offset < RVT_BITS_PER_PAGE && qpn < QPN_MAX); + /* + * In order to keep the number of pages allocated to a + * minimum, we scan the all existing pages before increasing +@@ -204,9 +204,9 @@ static void free_qpn(struct qib_qpn_tabl + { + struct qpn_map *map; + +- map = qpt->map + qpn / BITS_PER_PAGE; ++ map = qpt->map + qpn / RVT_BITS_PER_PAGE; + if (map->page) +- clear_bit(qpn & BITS_PER_PAGE_MASK, map->page); ++ clear_bit(qpn & RVT_BITS_PER_PAGE_MASK, map->page); + } + + static inline unsigned qpn_hash(struct qib_ibdev *dev, u32 qpn) diff --git a/queue-4.4/series b/queue-4.4/series index 2ad428efa1c..ccb617667e3 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -10,3 +10,5 @@ scsi-cxlflash-fix-to-avoid-eeh-and-host-reset-collisions.patch scsi-cxlflash-improve-eeh-recovery-time.patch 8250_pci-fix-potential-use-after-free-in-error-path.patch netlink-allow-direct-reclaim-for-fallback-allocation.patch +ib-qib-rename-bits_per_page-to-rvt_bits_per_page.patch +ib-ehca-fix-maybe-uninitialized-warnings.patch