Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Jun 2018 18:13:17 +0000 (11:13 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 5 Jun 2018 18:13:17 +0000 (11:13 -0700)
Pull s390 updates from Martin Schwidefsky:

 - A rework for the s390 arch random code, the TRNG instruction is
   rather slow and should not be used on the interrupt path

 - A fix for a memory leak in the zcrypt driver

 - Changes to the early boot code to add a compile time check for code
   that may not use the .bss section, with the goal to avoid initrd
   corruptions

 - Add an interface to get the physical network ID (pnetid), this is
   useful to group network devices that are attached to the same network

 - Some cleanup for the linker script

 - Some code improvement for the dasd driver

 - Two fixes for the perf sampling support

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/zcrypt: Fix CCA and EP11 CPRB processing failure memory leak.
  s390/archrandom: Rework arch random implementation.
  s390/net: add pnetid support
  s390/dasd: simplify locking in dasd_times_out
  s390/cio: add test for ccwgroup device
  s390/cio: add helper to query utility strings per given ccw device
  s390: remove no-op macro VMLINUX_SYMBOL()
  s390: remove closung punctuation from spectre messages
  s390: introduce compile time check for empty .bss section
  s390/early: move functions which may not access bss section to extra file
  s390/early: get rid of #ifdef CONFIG_BLK_DEV_INITRD
  s390/early: get rid of memmove_early
  s390/cpum_sf: Add data entry sizes to sampling trailer entry
  perf: fix invalid bit in diagnostic entry

1  2 
arch/s390/Kconfig
drivers/s390/block/dasd.c

diff --combined arch/s390/Kconfig
index 6a64287ec1da87dd3ee209ed079d498ac7bd6294,4f778af8323fbd4d157bd19a9864bd789f8721b7..b7deee7e738f59ac52a84d236b0ff4657783d3c8
@@@ -35,6 -35,9 +35,6 @@@ config GENERIC_BU
  config GENERIC_BUG_RELATIVE_POINTERS
        def_bool y
  
 -config ARCH_DMA_ADDR_T_64BIT
 -      def_bool y
 -
  config GENERIC_LOCKBREAK
        def_bool y if SMP && PREEMPT
  
@@@ -130,6 -133,7 +130,6 @@@ config S39
        select HAVE_CMPXCHG_LOCAL
        select HAVE_COPY_THREAD_TLS
        select HAVE_DEBUG_KMEMLEAK
 -      select HAVE_DMA_API_DEBUG
        select HAVE_DMA_CONTIGUOUS
        select DMA_DIRECT_OPS
        select HAVE_DYNAMIC_FTRACE
@@@ -705,11 -709,7 +705,11 @@@ config QDI
  menuconfig PCI
        bool "PCI support"
        select PCI_MSI
 +      select IOMMU_HELPER
        select IOMMU_SUPPORT
 +      select NEED_DMA_MAP_STATE
 +      select NEED_SG_DMA_LENGTH
 +
        help
          Enable PCI support.
  
@@@ -732,6 -732,15 +732,6 @@@ config PCI_DOMAIN
  
  config HAS_IOMEM
        def_bool PCI
 -
 -config IOMMU_HELPER
 -      def_bool PCI
 -
 -config NEED_SG_DMA_LENGTH
 -      def_bool PCI
 -
 -config NEED_DMA_MAP_STATE
 -      def_bool PCI
  
  config CHSC_SCH
        def_tristate m
@@@ -838,6 -847,10 +838,10 @@@ config CC
  
  source "drivers/Kconfig"
  
+ config HAVE_PNETID
+       tristate
+       default (SMC || CCWGROUP)
  source "fs/Kconfig"
  
  source "arch/s390/Kconfig.debug"
index cb9b685118da826cf2ef780a30b333094a66c6a3,f401b4c38cfce3e892fe8f704288e9e3cb92b5c4..73cce3ecb97fefbccc66266a4fd29f08e453079e
@@@ -2569,14 -2569,11 +2569,11 @@@ EXPORT_SYMBOL(dasd_sleep_on_immediatly)
   * Cancellation of a request is an asynchronous operation! The calling
   * function has to wait until the request is properly returned via callback.
   */
int dasd_cancel_req(struct dasd_ccw_req *cqr)
static int __dasd_cancel_req(struct dasd_ccw_req *cqr)
  {
        struct dasd_device *device = cqr->startdev;
-       unsigned long flags;
-       int rc;
+       int rc = 0;
  
-       rc = 0;
-       spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
        switch (cqr->status) {
        case DASD_CQR_QUEUED:
                /* request was not started - just set to cleared */
        default: /* already finished or clear pending - do nothing */
                break;
        }
-       spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
        dasd_schedule_device_bh(device);
        return rc;
  }
- EXPORT_SYMBOL(dasd_cancel_req);
+ int dasd_cancel_req(struct dasd_ccw_req *cqr)
+ {
+       struct dasd_device *device = cqr->startdev;
+       unsigned long flags;
+       int rc;
+       spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
+       rc = __dasd_cancel_req(cqr);
+       spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
+       return rc;
+ }
  
  /*
   * SECTION: Operations of the dasd_block layer.
@@@ -3034,8 -3041,7 +3041,8 @@@ static blk_status_t do_dasd_request(str
        cqr->callback_data = req;
        cqr->status = DASD_CQR_FILLED;
        cqr->dq = dq;
 -      req->completion_data = cqr;
 +      *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req)) = cqr;
 +
        blk_mq_start_request(req);
        spin_lock(&block->queue_lock);
        list_add_tail(&cqr->blocklist, &block->ccw_queue);
   *
   * Return values:
   * BLK_EH_RESET_TIMER if the request should be left running
 - * BLK_EH_NOT_HANDLED if the request is handled or terminated
 + * BLK_EH_DONE if the request is handled or terminated
   *                  by the driver.
   */
  enum blk_eh_timer_return dasd_times_out(struct request *req, bool reserved)
  {
 -      struct dasd_ccw_req *cqr = req->completion_data;
        struct dasd_block *block = req->q->queuedata;
        struct dasd_device *device;
 +      struct dasd_ccw_req *cqr;
        unsigned long flags;
        int rc = 0;
  
 +      cqr = *((struct dasd_ccw_req **) blk_mq_rq_to_pdu(req));
        if (!cqr)
 -              return BLK_EH_NOT_HANDLED;
 +              return BLK_EH_DONE;
  
        spin_lock_irqsave(&cqr->dq->lock, flags);
        device = cqr->startdev ? cqr->startdev : block->base;
        cqr->retries = -1;
        cqr->intrc = -ETIMEDOUT;
        if (cqr->status >= DASD_CQR_QUEUED) {
-               spin_unlock(get_ccwdev_lock(device->cdev));
-               rc = dasd_cancel_req(cqr);
+               rc = __dasd_cancel_req(cqr);
        } else if (cqr->status == DASD_CQR_FILLED ||
                   cqr->status == DASD_CQR_NEED_ERP) {
                cqr->status = DASD_CQR_TERMINATED;
-               spin_unlock(get_ccwdev_lock(device->cdev));
        } else if (cqr->status == DASD_CQR_IN_ERP) {
                struct dasd_ccw_req *searchcqr, *nextcqr, *tmpcqr;
  
                        searchcqr->retries = -1;
                        searchcqr->intrc = -ETIMEDOUT;
                        if (searchcqr->status >= DASD_CQR_QUEUED) {
-                               spin_unlock(get_ccwdev_lock(device->cdev));
-                               rc = dasd_cancel_req(searchcqr);
-                               spin_lock(get_ccwdev_lock(device->cdev));
+                               rc = __dasd_cancel_req(searchcqr);
                        } else if ((searchcqr->status == DASD_CQR_FILLED) ||
                                   (searchcqr->status == DASD_CQR_NEED_ERP)) {
                                searchcqr->status = DASD_CQR_TERMINATED;
                        }
                        break;
                }
-               spin_unlock(get_ccwdev_lock(device->cdev));
        }
+       spin_unlock(get_ccwdev_lock(device->cdev));
        dasd_schedule_block_bh(block);
        spin_unlock(&block->queue_lock);
        spin_unlock_irqrestore(&cqr->dq->lock, flags);
  
 -      return rc ? BLK_EH_RESET_TIMER : BLK_EH_NOT_HANDLED;
 +      return rc ? BLK_EH_RESET_TIMER : BLK_EH_DONE;
  }
  
  static int dasd_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
@@@ -3171,7 -3172,6 +3174,7 @@@ static int dasd_alloc_queue(struct dasd
        int rc;
  
        block->tag_set.ops = &dasd_mq_ops;
 +      block->tag_set.cmd_size = sizeof(struct dasd_ccw_req *);
        block->tag_set.nr_hw_queues = DASD_NR_HW_QUEUES;
        block->tag_set.queue_depth = DASD_MAX_LCU_DEV * DASD_REQ_PER_DEV;
        block->tag_set.flags = BLK_MQ_F_SHOULD_MERGE;