Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1707498 > unrolled thread

[PATCH 4.12 000/106] 4.12.6-stable review

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-08-09 19:00 +0200
Last post2017-08-10 04:40 +0200
Articles 20 on this page of 110 — 6 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 4.12 000/106] 4.12.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 098/106] udp6: fix socket leak on early demux Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 044/106] ARM: dts: tango4: Request RGMII RX and TX clock delays Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 105/106] sparc64: Fix exception handling in UltraSPARC-III memcpy. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 001/106] parisc: Increase thread and stack size to 32kb Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 097/106] net/mlx5: Fix mlx5_add_flow_rules call with correct num of dests Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 070/106] net: dsa: b53: Add missing ARL entries for BCM53125 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 091/106] net/mlx5e: Add field select to MTPPS register Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 102/106] sparc64: Measure receiver forward progress to avoid send mondo timeout Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 007/106] cgroup: create dfl_root files on subsys registration Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 092/106] net/mlx5e: Fix broken disable 1PPS flow Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 016/106] mmc: dw_mmc: Use device_property_read instead of of_property_read Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 060/106] tcp_bbr: introduce bbr_bw_to_pacing_rate() helper Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 096/106] net/mlx5e: Schedule overflow check work to mlx5e workqueue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 095/106] net/mlx5e: Fix wrong delay calculation for overflow check scheduling Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 035/106] iommu/amd: Enable ga_log_intr when enabling guest_mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 068/106] Revert "rtnetlink: Do not generate notifications for CHANGEADDR event" Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 103/106] sparc64: Prevent perf from running during super critical sections Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 099/106] net: phy: Correctly process PHY_HALTED in phy_stop_machine() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 101/106] virtio_net: fix truesize for mergeable buffers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 054/106] blk-mq: Include all present CPUs in the default queue mapping Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 104/106] sparc64: Register hugepages during arch init Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 047/106] media: platform: davinci: return -EINVAL for VPFE_CMD_S_CCDC_RAW_PARAMS ioctl Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 090/106] net/mlx5: Fix mlx5_ifc_mtpps_reg_bits structure size Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:00 +0200
    [PATCH 4.12 084/106] net/mlx5: Fix command completion after timeout access invalid structure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 083/106] net/mlx5: Consider tx_enabled in all modes on remap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 080/106] dccp: fix a memleak that dccp_ipv6 doesnt put reqsk properly Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 077/106] ipv6: Dont increase IPSTATS_MIB_FRAGFAILS twice in ip6_fragment() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 089/106] net/mlx5e: Fix outer_header_zero() check size Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 081/106] dccp: fix a memleak that dccp_ipv4 doesnt put reqsk properly Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 056/106] block: disable runtime-pm for blk-mq Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 069/106] ipv6: avoid overflow of offset in ip6_find_1stfragopt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 057/106] [media] saa7164: fix double fetch PCIe access condition Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 075/106] openvswitch: fix potential out of bound access in parse_ct Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 065/106] wireless: wext: terminate ifr name coming from userspace Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 078/106] net: ethernet: nb8800: Handle all 4 RGMII modes identically Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 082/106] dccp: fix a memleak for dccp_feat_init err process Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 072/106] rtnetlink: allocate more memory for dev_set_mac_address() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 061/106] tcp_bbr: introduce bbr_init_pacing_rate_from_rtt() helper Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 062/106] tcp_bbr: remove sk_pacing_rate=0 transient during init Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 058/106] sctp: fix an array overflow when all ext chunks are set Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 049/106] tcmu: Fix flushing cmd entry dcache page Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 059/106] tcp_bbr: cut pacing rate only if filled pipe Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 076/106] packet: fix use-after-free in prb_retire_rx_blk_timer_expired() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 073/106] net: bonding: Fix transmit load balancing in balance-alb mode Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 079/106] bonding: commit link status change after propose Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 088/106] net/mlx5e: IPoIB, Modify add/remove underlay QPN flows Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 064/106] ipv4: ipv6: initialize treq->txhash in cookie_v[46]_check() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 074/106] mcs7780: Fix initialization when CONFIG_VMAP_STACK is enabled Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 087/106] sctp: fix the check for _sctp_walk_params and _sctp_walk_errors Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 085/106] net/mlx5: Fix command bad flow on command entry allocation failure Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 071/106] ipv4: initialize fib_trie prior to register_netdev_notifier call. Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 063/106] tcp_bbr: init pacing rate on first RTT sample Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 094/106] net/mlx5e: Add missing support for PTP_CLK_REQ_PPS request Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 086/106] sctp: dont dereference ptr before leaving _sctp_walk_{params, errors}() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 066/106] net: Zero terminate ifr_name in dev_ifname(). Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 093/106] net/mlx5e: Change 1PPS out scheme Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:10 +0200
    [PATCH 4.12 042/106] ARM: mvebu: use __pa_symbol in the mv98dx3236 platform SMP code Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 022/106] cpuset: fix a deadlock due to incomplete patching of cpusets_enabled() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 019/106] userfaultfd: non-cooperative: notify about unmap of destination during mremap Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 041/106] clk: sunxi-ng: sun5i: Add clk_set_rate_parent to the CPU clock Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 045/106] media: pulse8-cec: persistent_config should be off by default Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 017/106] mm, mprotect: flush TLB if potentially racing with a parallel reclaim leaving stale TLB entries Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 024/106] ALSA: hda - Fix speaker output from VAIO VPCL14M1R Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 012/106] brcmfmac: fix memleak due to calling brcmf_sdiod_sgtable_alloc() twice Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 038/106] ext4: fix SEEK_HOLE/SEEK_DATA for blocksize < pagesize Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 018/106] mm/hugetlb.c: __get_user_pages ignores certain follow_hugetlb_page errors Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 050/106] tcmu: Fix possbile memory leak / OOPs when recalculating cmd base size Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 013/106] NFSv4: Fix EXCHANGE_ID corrupt verifier issue Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 046/106] media: lirc: LIRC_GET_REC_RESOLUTION should return microseconds Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 023/106] ocfs2: dont clear SGID when inheriting ACLs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 033/106] powerpc/tm: Fix saving of TM SPRs in core dump Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 043/106] ARM: dts: armada-38x: Fix irq type for pca955 Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 030/106] KVM: arm/arm64: Handle hva aging while destroying the vm Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 028/106] ASoC: ux500: Restore platform DAI assignments Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 015/106] mmc: core: Use device_property_read instead of of_property_read Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 027/106] ASoC: fix pcm-creation regression Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 037/106] gpiolib: skip unwanted events, dont convert them to opposite edge Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 036/106] ARM64: dts: marvell: armada-37xx: Fix the number of GPIO on south bridge Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 032/106] timers: Fix overflow in get_next_timer_interrupt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 055/106] blk-mq: Create hctx for each present CPU Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 052/106] ext4: Dont clear SGID when inheriting ACLs Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 020/106] userfaultfd_zeropage: return -ENOSPC in case mm has gone Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 048/106] [media] ir-spi: Fix issues with lirc API Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
      Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Johannes Thumshirn <jthumshirn@suse.de> - 2017-08-10 08:20 +0200
        Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-10 17:20 +0200
          Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Johannes Thumshirn <jthumshirn@suse.de> - 2017-08-11 09:20 +0200
            Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-11 17:40 +0200
              Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-11 21:40 +0200
      Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers Chris Clayton <chris2553@googlemail.com> - 2017-08-10 10:20 +0200
    [PATCH 4.12 029/106] ASoC: do not close shared backend dailink Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 021/106] userfaultfd: non-cooperative: flush event_wqh at release time Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 053/106] Btrfs: fix early ENOSPC due to delalloc Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 011/106] iwlwifi: dvm: prevent an out of bounds access Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 034/106] powerpc/64: Fix __check_irq_replay missing decrementer interrupt Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 039/106] ext4: fix overflow caused by missing cast in ext4_resize_fs() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:20 +0200
    [PATCH 4.12 003/106] scsi: lpfc: fix linking against modular NVMe support Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 014/106] mmc: sdhci-of-at91: force card detect value for non removable devices Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 006/106] cgroup: dont call migration methods if there are no tasks to migrate Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 002/106] parisc: Handle vmas whose context is not current in flush_cache_range Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 009/106] libata: array underflow in ata_find_dev() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 010/106] workqueue: restore WQ_UNBOUND/max_active==1 to be ordered Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 005/106] ACPI / LPSS: Only call pwm_add_table() for the first PWM controller Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    [PATCH 4.12 008/106] cgroup: fix error return value from cgroup_subtree_control() Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 19:30 +0200
    Re: [PATCH 4.12 000/106] 4.12.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-09 23:50 +0200
      Re: [PATCH 4.12 000/106] 4.12.6-stable review Kevin Hilman <khilman@baylibre.com> - 2017-08-10 17:50 +0200
    Re: [PATCH 4.12 000/106] 4.12.6-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-08-10 02:20 +0200
    Re: [PATCH 4.12 000/106] 4.12.6-stable review Guenter Roeck <linux@roeck-us.net> - 2017-08-10 02:50 +0200
      Re: [PATCH 4.12 000/106] 4.12.6-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-08-10 04:40 +0200

Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6  Next page →


#1707597 — [PATCH 4.12 055/106] blk-mq: Create hctx for each present CPU

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 055/106] blk-mq: Create hctx for each present CPU
Message-ID<ucCOg-1QT-59@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Christoph Hellwig <hch@lst.de>

commit 4b855ad37194f7bdbb200ce7a1c7051fecb56a08 upstream.

Currently we only create hctx for online CPUs, which can lead to a lot
of churn due to frequent soft offline / online operations.  Instead
allocate one for each present CPU to avoid this and dramatically simplify
the code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Cc: Keith Busch <keith.busch@intel.com>
Cc: linux-block@vger.kernel.org
Cc: linux-nvme@lists.infradead.org
Link: http://lkml.kernel.org/r/20170626102058.10200-3-hch@lst.de
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Oleksandr Natalenko <oleksandr@natalenko.name>
Cc: Mike Galbraith <efault@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 block/blk-mq.c             |  120 ++++-----------------------------------------
 block/blk-mq.h             |    5 -
 include/linux/cpuhotplug.h |    1 
 3 files changed, 11 insertions(+), 115 deletions(-)

--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -37,9 +37,6 @@
 #include "blk-wbt.h"
 #include "blk-mq-sched.h"
 
-static DEFINE_MUTEX(all_q_mutex);
-static LIST_HEAD(all_q_list);
-
 static void blk_mq_poll_stats_start(struct request_queue *q);
 static void blk_mq_poll_stats_fn(struct blk_stat_callback *cb);
 static void __blk_mq_stop_hw_queues(struct request_queue *q, bool sync);
@@ -1975,8 +1972,8 @@ static void blk_mq_init_cpu_queues(struc
 		INIT_LIST_HEAD(&__ctx->rq_list);
 		__ctx->queue = q;
 
-		/* If the cpu isn't online, the cpu is mapped to first hctx */
-		if (!cpu_online(i))
+		/* If the cpu isn't present, the cpu is mapped to first hctx */
+		if (!cpu_present(i))
 			continue;
 
 		hctx = blk_mq_map_queue(q, i);
@@ -2019,8 +2016,7 @@ static void blk_mq_free_map_and_requests
 	}
 }
 
-static void blk_mq_map_swqueue(struct request_queue *q,
-			       const struct cpumask *online_mask)
+static void blk_mq_map_swqueue(struct request_queue *q)
 {
 	unsigned int i, hctx_idx;
 	struct blk_mq_hw_ctx *hctx;
@@ -2038,13 +2034,11 @@ static void blk_mq_map_swqueue(struct re
 	}
 
 	/*
-	 * Map software to hardware queues
+	 * Map software to hardware queues.
+	 *
+	 * If the cpu isn't present, the cpu is mapped to first hctx.
 	 */
-	for_each_possible_cpu(i) {
-		/* If the cpu isn't online, the cpu is mapped to first hctx */
-		if (!cpumask_test_cpu(i, online_mask))
-			continue;
-
+	for_each_present_cpu(i) {
 		hctx_idx = q->mq_map[i];
 		/* unmapped hw queue can be remapped after CPU topo changed */
 		if (!set->tags[hctx_idx] &&
@@ -2340,16 +2334,8 @@ struct request_queue *blk_mq_init_alloca
 		blk_queue_softirq_done(q, set->ops->complete);
 
 	blk_mq_init_cpu_queues(q, set->nr_hw_queues);
-
-	get_online_cpus();
-	mutex_lock(&all_q_mutex);
-
-	list_add_tail(&q->all_q_node, &all_q_list);
 	blk_mq_add_queue_tag_set(set, q);
-	blk_mq_map_swqueue(q, cpu_online_mask);
-
-	mutex_unlock(&all_q_mutex);
-	put_online_cpus();
+	blk_mq_map_swqueue(q);
 
 	if (!(set->flags & BLK_MQ_F_NO_SCHED)) {
 		int ret;
@@ -2375,18 +2361,12 @@ void blk_mq_free_queue(struct request_qu
 {
 	struct blk_mq_tag_set	*set = q->tag_set;
 
-	mutex_lock(&all_q_mutex);
-	list_del_init(&q->all_q_node);
-	mutex_unlock(&all_q_mutex);
-
 	blk_mq_del_queue_tag_set(q);
-
 	blk_mq_exit_hw_queues(q, set, set->nr_hw_queues);
 }
 
 /* Basically redo blk_mq_init_queue with queue frozen */
-static void blk_mq_queue_reinit(struct request_queue *q,
-				const struct cpumask *online_mask)
+static void blk_mq_queue_reinit(struct request_queue *q)
 {
 	WARN_ON_ONCE(!atomic_read(&q->mq_freeze_depth));
 
@@ -2399,76 +2379,12 @@ static void blk_mq_queue_reinit(struct r
 	 * involves free and re-allocate memory, worthy doing?)
 	 */
 
-	blk_mq_map_swqueue(q, online_mask);
+	blk_mq_map_swqueue(q);
 
 	blk_mq_sysfs_register(q);
 	blk_mq_debugfs_register_hctxs(q);
 }
 
-/*
- * New online cpumask which is going to be set in this hotplug event.
- * Declare this cpumasks as global as cpu-hotplug operation is invoked
- * one-by-one and dynamically allocating this could result in a failure.
- */
-static struct cpumask cpuhp_online_new;
-
-static void blk_mq_queue_reinit_work(void)
-{
-	struct request_queue *q;
-
-	mutex_lock(&all_q_mutex);
-	/*
-	 * We need to freeze and reinit all existing queues.  Freezing
-	 * involves synchronous wait for an RCU grace period and doing it
-	 * one by one may take a long time.  Start freezing all queues in
-	 * one swoop and then wait for the completions so that freezing can
-	 * take place in parallel.
-	 */
-	list_for_each_entry(q, &all_q_list, all_q_node)
-		blk_freeze_queue_start(q);
-	list_for_each_entry(q, &all_q_list, all_q_node)
-		blk_mq_freeze_queue_wait(q);
-
-	list_for_each_entry(q, &all_q_list, all_q_node)
-		blk_mq_queue_reinit(q, &cpuhp_online_new);
-
-	list_for_each_entry(q, &all_q_list, all_q_node)
-		blk_mq_unfreeze_queue(q);
-
-	mutex_unlock(&all_q_mutex);
-}
-
-static int blk_mq_queue_reinit_dead(unsigned int cpu)
-{
-	cpumask_copy(&cpuhp_online_new, cpu_online_mask);
-	blk_mq_queue_reinit_work();
-	return 0;
-}
-
-/*
- * Before hotadded cpu starts handling requests, new mappings must be
- * established.  Otherwise, these requests in hw queue might never be
- * dispatched.
- *
- * For example, there is a single hw queue (hctx) and two CPU queues (ctx0
- * for CPU0, and ctx1 for CPU1).
- *
- * Now CPU1 is just onlined and a request is inserted into ctx1->rq_list
- * and set bit0 in pending bitmap as ctx1->index_hw is still zero.
- *
- * And then while running hw queue, blk_mq_flush_busy_ctxs() finds bit0 is set
- * in pending bitmap and tries to retrieve requests in hctx->ctxs[0]->rq_list.
- * But htx->ctxs[0] is a pointer to ctx0, so the request in ctx1->rq_list is
- * ignored.
- */
-static int blk_mq_queue_reinit_prepare(unsigned int cpu)
-{
-	cpumask_copy(&cpuhp_online_new, cpu_online_mask);
-	cpumask_set_cpu(cpu, &cpuhp_online_new);
-	blk_mq_queue_reinit_work();
-	return 0;
-}
-
 static int __blk_mq_alloc_rq_maps(struct blk_mq_tag_set *set)
 {
 	int i;
@@ -2679,7 +2595,7 @@ static void __blk_mq_update_nr_hw_queues
 	blk_mq_update_queue_map(set);
 	list_for_each_entry(q, &set->tag_list, tag_set_list) {
 		blk_mq_realloc_hw_ctxs(set, q);
-		blk_mq_queue_reinit(q, cpu_online_mask);
+		blk_mq_queue_reinit(q);
 	}
 
 	list_for_each_entry(q, &set->tag_list, tag_set_list)
@@ -2895,24 +2811,10 @@ bool blk_mq_poll(struct request_queue *q
 }
 EXPORT_SYMBOL_GPL(blk_mq_poll);
 
-void blk_mq_disable_hotplug(void)
-{
-	mutex_lock(&all_q_mutex);
-}
-
-void blk_mq_enable_hotplug(void)
-{
-	mutex_unlock(&all_q_mutex);
-}
-
 static int __init blk_mq_init(void)
 {
 	cpuhp_setup_state_multi(CPUHP_BLK_MQ_DEAD, "block/mq:dead", NULL,
 				blk_mq_hctx_notify_dead);
-
-	cpuhp_setup_state_nocalls(CPUHP_BLK_MQ_PREPARE, "block/mq:prepare",
-				  blk_mq_queue_reinit_prepare,
-				  blk_mq_queue_reinit_dead);
 	return 0;
 }
 subsys_initcall(blk_mq_init);
--- a/block/blk-mq.h
+++ b/block/blk-mq.h
@@ -56,11 +56,6 @@ void __blk_mq_insert_request(struct blk_
 				bool at_head);
 void blk_mq_insert_requests(struct blk_mq_hw_ctx *hctx, struct blk_mq_ctx *ctx,
 				struct list_head *list);
-/*
- * CPU hotplug helpers
- */
-void blk_mq_enable_hotplug(void);
-void blk_mq_disable_hotplug(void);
 
 /*
  * CPU -> queue mappings
--- a/include/linux/cpuhotplug.h
+++ b/include/linux/cpuhotplug.h
@@ -58,7 +58,6 @@ enum cpuhp_state {
 	CPUHP_XEN_EVTCHN_PREPARE,
 	CPUHP_ARM_SHMOBILE_SCU_PREPARE,
 	CPUHP_SH_SH3X_PREPARE,
-	CPUHP_BLK_MQ_PREPARE,
 	CPUHP_NET_FLOW_PREPARE,
 	CPUHP_TOPOLOGY_PREPARE,
 	CPUHP_NET_IUCV_PREPARE,

[toc] | [prev] | [next] | [standalone]


#1707598 — [PATCH 4.12 052/106] ext4: Dont clear SGID when inheriting ACLs

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 052/106] ext4: Dont clear SGID when inheriting ACLs
Message-ID<ucCOg-1QT-63@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jan Kara <jack@suse.cz>

commit a3bb2d5587521eea6dab2d05326abb0afb460abd upstream.

When new directory 'DIR1' is created in a directory 'DIR0' with SGID bit
set, DIR1 is expected to have SGID bit set (and owning group equal to
the owning group of 'DIR0'). However when 'DIR0' also has some default
ACLs that 'DIR1' inherits, setting these ACLs will result in SGID bit on
'DIR1' to get cleared if user is not member of the owning group.

Fix the problem by moving posix_acl_update_mode() out of
__ext4_set_acl() into ext4_set_acl(). That way the function will not be
called when inheriting ACLs which is what we want as it prevents SGID
bit clearing and the mode has been properly set by posix_acl_create()
anyway.

Fixes: 073931017b49d9458aa351605b43a7e34598caef
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/acl.c |   28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

--- a/fs/ext4/acl.c
+++ b/fs/ext4/acl.c
@@ -189,18 +189,10 @@ __ext4_set_acl(handle_t *handle, struct
 	void *value = NULL;
 	size_t size = 0;
 	int error;
-	int update_mode = 0;
-	umode_t mode = inode->i_mode;
 
 	switch (type) {
 	case ACL_TYPE_ACCESS:
 		name_index = EXT4_XATTR_INDEX_POSIX_ACL_ACCESS;
-		if (acl) {
-			error = posix_acl_update_mode(inode, &mode, &acl);
-			if (error)
-				return error;
-			update_mode = 1;
-		}
 		break;
 
 	case ACL_TYPE_DEFAULT:
@@ -224,11 +216,6 @@ __ext4_set_acl(handle_t *handle, struct
 	kfree(value);
 	if (!error) {
 		set_cached_acl(inode, type, acl);
-		if (update_mode) {
-			inode->i_mode = mode;
-			inode->i_ctime = current_time(inode);
-			ext4_mark_inode_dirty(handle, inode);
-		}
 	}
 
 	return error;
@@ -239,6 +226,8 @@ ext4_set_acl(struct inode *inode, struct
 {
 	handle_t *handle;
 	int error, retries = 0;
+	umode_t mode = inode->i_mode;
+	int update_mode = 0;
 
 	error = dquot_initialize(inode);
 	if (error)
@@ -249,7 +238,20 @@ retry:
 	if (IS_ERR(handle))
 		return PTR_ERR(handle);
 
+	if ((type == ACL_TYPE_ACCESS) && acl) {
+		error = posix_acl_update_mode(inode, &mode, &acl);
+		if (error)
+			goto out_stop;
+		update_mode = 1;
+	}
+
 	error = __ext4_set_acl(handle, inode, type, acl);
+	if (!error && update_mode) {
+		inode->i_mode = mode;
+		inode->i_ctime = current_time(inode);
+		ext4_mark_inode_dirty(handle, inode);
+	}
+out_stop:
 	ext4_journal_stop(handle);
 	if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
 		goto retry;

[toc] | [prev] | [next] | [standalone]


#1707599 — [PATCH 4.12 020/106] userfaultfd_zeropage: return -ENOSPC in case mm has gone

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 020/106] userfaultfd_zeropage: return -ENOSPC in case mm has gone
Message-ID<ucCOg-1QT-61@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mike Rapoport <rppt@linux.vnet.ibm.com>

commit 9d95aa4bada24be35bb94827a55e1d6e243d866e upstream.

In the non-cooperative userfaultfd case, the process exit may race with
outstanding mcopy_atomic called by the uffd monitor.  Returning -ENOSPC
instead of -EINVAL when mm is already gone will allow uffd monitor to
distinguish this case from other error conditions.

Unfortunately I overlooked userfaultfd_zeropage when updating
userfaultd_copy().

Link: http://lkml.kernel.org/r/1501136819-21857-1-git-send-email-rppt@linux.vnet.ibm.com
Fixes: 96333187ab162 ("userfaultfd_copy: return -ENOSPC in case mm has gone")
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Cc: Michal Hocko <mhocko@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/userfaultfd.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -1645,6 +1645,8 @@ static int userfaultfd_zeropage(struct u
 		ret = mfill_zeropage(ctx->mm, uffdio_zeropage.range.start,
 				     uffdio_zeropage.range.len);
 		mmput(ctx->mm);
+	} else {
+		return -ENOSPC;
 	}
 	if (unlikely(put_user(ret, &user_uffdio_zeropage->zeropage)))
 		return -EFAULT;

[toc] | [prev] | [next] | [standalone]


#1707600 — [PATCH 4.12 048/106] [media] ir-spi: Fix issues with lirc API

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 048/106] [media] ir-spi: Fix issues with lirc API
Message-ID<ucCOh-1QT-67@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Anton Blanchard <anton@samba.org>

commit cc20ba4ed8576abfa10a17e81cb4521f474624f0 upstream.

The ir-spi driver has 2 issues which prevents it from working with
lirc:

1. The ir-spi driver uses 16 bits of SPI data to create one cycle of
the waveform. As such our SPI clock needs to be 16x faster than the
carrier frequency.

The driver is inconsistent in how it currently handles this. It
initializes it to the carrier frequency:

But the commit message has some example code which initialises it
to 16x the carrier frequency:

	val = 608000;
	ret = ioctl(fd, LIRC_SET_SEND_CARRIER, &val);

To maintain compatibility with lirc, always do the frequency adjustment
in the driver.

2. lirc presents pulses in microseconds, but the ir-spi driver treats
them as cycles of the carrier. Similar to other lirc drivers, do the
conversion with DIV_ROUND_CLOSEST().

Fixes: fe052da49201 ("[media] rc: add support for IR LEDs driven through SPI")
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/media/rc/ir-spi.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

--- a/drivers/media/rc/ir-spi.c
+++ b/drivers/media/rc/ir-spi.c
@@ -57,10 +57,13 @@ static int ir_spi_tx(struct rc_dev *dev,
 
 	/* convert the pulse/space signal to raw binary signal */
 	for (i = 0; i < count; i++) {
+		unsigned int periods;
 		int j;
 		u16 val = ((i + 1) % 2) ? idata->pulse : idata->space;
 
-		if (len + buffer[i] >= IR_SPI_MAX_BUFSIZE)
+		periods = DIV_ROUND_CLOSEST(buffer[i] * idata->freq, 1000000);
+
+		if (len + periods >= IR_SPI_MAX_BUFSIZE)
 			return -EINVAL;
 
 		/*
@@ -69,13 +72,13 @@ static int ir_spi_tx(struct rc_dev *dev,
 		 * contain a space duration.
 		 */
 		val = (i % 2) ? idata->space : idata->pulse;
-		for (j = 0; j < buffer[i]; j++)
+		for (j = 0; j < periods; j++)
 			idata->tx_buf[len++] = val;
 	}
 
 	memset(&xfer, 0, sizeof(xfer));
 
-	xfer.speed_hz = idata->freq;
+	xfer.speed_hz = idata->freq * 16;
 	xfer.len = len * sizeof(*idata->tx_buf);
 	xfer.tx_buf = idata->tx_buf;
 

[toc] | [prev] | [next] | [standalone]


#1707601 — [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<ucCOh-1QT-69@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johannes Thumshirn <jthumshirn@suse.de>

commit 68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47 upstream.

SG_DXFER_FROM_DEV transfers do not necessarily have a dxferp as we set
it to NULL for the old sg_io read/write interface, but must have a
length bigger than 0. This fixes a regression introduced by commit
28676d869bbb ("scsi: sg: check for valid direction before starting the
request")

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the request")
Reported-by: Chris Clayton <chris2553@googlemail.com>
Tested-by: Chris Clayton <chris2553@googlemail.com>
Cc: Douglas Gilbert <dgilbert@interlog.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Tested-by: Chris Clayton <chris2553@googlemail.com>
Acked-by: Douglas Gilbert <dgilbert@interlog.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/sg.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_
 		if (hp->dxferp || hp->dxfer_len > 0)
 			return false;
 		return true;
-	case SG_DXFER_TO_DEV:
 	case SG_DXFER_FROM_DEV:
+		if (hp->dxfer_len < 0)
+			return false;
+		return true;
+	case SG_DXFER_TO_DEV:
 	case SG_DXFER_TO_FROM_DEV:
 		if (!hp->dxferp || hp->dxfer_len == 0)
 			return false;

[toc] | [prev] | [next] | [standalone]


#1708233 — Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-08-10 08:20 +0200
SubjectRe: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<ucOZ3-1Fu-1@gated-at.bofh.it>
In reply to#1707601
On Wed, Aug 09, 2017 at 09:51:48AM -0700, Greg KH wrote:
> 4.12-stable review patch.  If anyone has any objections, please let me know.

Yep I do, please don't use this one. It has a follow up/was superseded by:
f930c7043663 ("scsi: sg: only check for dxfer_len greater than 256M")
in Linus' tree

(Yes I know I explicitly sent it to stable, mea culpa)

Thanks,
	Johannes
-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1708721 — Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-10 17:20 +0200
SubjectRe: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<ucXpE-7qP-27@gated-at.bofh.it>
In reply to#1708233
On Thu, Aug 10, 2017 at 08:14:14AM +0200, Johannes Thumshirn wrote:
> On Wed, Aug 09, 2017 at 09:51:48AM -0700, Greg KH wrote:
> > 4.12-stable review patch.  If anyone has any objections, please let me know.
> 
> Yep I do, please don't use this one. It has a follow up/was superseded by:
> f930c7043663 ("scsi: sg: only check for dxfer_len greater than 256M")
> in Linus' tree
> 
> (Yes I know I explicitly sent it to stable, mea culpa)

"superseeded" implies that this patch needs to be applied in order for
the "new" one to work properly.  So I tried applying it, but it doesn't
apply cleanly.  Then I tried by removing this patch and then applying
the new one.  That too didn't work at all.

So, what am I supposed to do here?  Leave this in, and apply something
else between it and the newer one?  Drop this and you provide a
backport?  Something else?

Totally confusing...

greg k-h

[toc] | [prev] | [next] | [standalone]


#1709328 — Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromJohannes Thumshirn <jthumshirn@suse.de>
Date2017-08-11 09:20 +0200
SubjectRe: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<udcoF-wW-1@gated-at.bofh.it>
In reply to#1708721
On Thu, Aug 10, 2017 at 08:11:34AM -0700, Greg KH wrote:
> else between it and the newer one?  Drop this and you provide a
> backport?  Something else?
> 
> Totally confusing...

Sorry for confusing you, here's the backport for your 4.12 stable branch,

Thanks,
	Johannes

From 469957522c4b356a313cb369e3e14fdac104370f Mon Sep 17 00:00:00 2001
From: Johannes Thumshirn <jthumshirn@suse.de>
Date: Thu, 27 Jul 2017 09:11:26 +0200
Subject: [PATCH] scsi: sg: only check for dxfer_len greater than 256M

commit f930c7043663188429cd9b254e9d761edfc101ce upstream

Don't make any assumptions on the sg_io_hdr_t::dxfer_direction or the
sg_io_hdr_t::dxferp in order to determine if it is a valid request. The
only way we can check for bad requests is by checking if the length
exceeds 256M.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Fixes: 28676d869bbb (scsi: sg: check for valid direction before starting the
request)
Reported-by: Jason L Tibbitts III <tibbs@math.uh.edu>
Tested-by: Jason L Tibbitts III <tibbs@math.uh.edu>
Suggested-by: Doug Gilbert <dgilbert@interlog.com>
Cc: Doug Gilbert <dgilbert@interlog.com>
Cc: <stable@vger.kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
---
 drivers/scsi/sg.c | 25 +------------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 82c33a6edbea..aa6f1debeaa7 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -751,29 +751,6 @@ sg_new_write(Sg_fd *sfp, struct file *file, const char __user *buf,
 	return count;
 }
 
-static bool sg_is_valid_dxfer(sg_io_hdr_t *hp)
-{
-	switch (hp->dxfer_direction) {
-	case SG_DXFER_NONE:
-		if (hp->dxferp || hp->dxfer_len > 0)
-			return false;
-		return true;
-	case SG_DXFER_TO_DEV:
-	case SG_DXFER_FROM_DEV:
-	case SG_DXFER_TO_FROM_DEV:
-		if (!hp->dxferp || hp->dxfer_len == 0)
-			return false;
-		return true;
-	case SG_DXFER_UNKNOWN:
-		if ((!hp->dxferp && hp->dxfer_len) ||
-		    (hp->dxferp && hp->dxfer_len == 0))
-			return false;
-		return true;
-	default:
-		return false;
-	}
-}
-
 static int
 sg_common_write(Sg_fd * sfp, Sg_request * srp,
 		unsigned char *cmnd, int timeout, int blocking)
@@ -794,7 +771,7 @@ sg_common_write(Sg_fd * sfp, Sg_request * srp,
 			"sg_common_write:  scsi opcode=0x%02x, cmd_size=%d\n",
 			(int) cmnd[0], (int) hp->cmd_len));
 
-	if (!sg_is_valid_dxfer(hp))
+	if (hp->dxfer_len >= SZ_256M)
 		return -EINVAL;
 
 	k = sg_start_req(srp, cmnd);
-- 
2.12.3


-- 
Johannes Thumshirn                                          Storage
jthumshirn@suse.de                                +49 911 74053 689
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)
Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850

[toc] | [prev] | [next] | [standalone]


#1709747 — Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-11 17:40 +0200
SubjectRe: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<udkcy-5fX-15@gated-at.bofh.it>
In reply to#1709328
On Fri, Aug 11, 2017 at 09:14:09AM +0200, Johannes Thumshirn wrote:
> On Thu, Aug 10, 2017 at 08:11:34AM -0700, Greg KH wrote:
> > else between it and the newer one?  Drop this and you provide a
> > backport?  Something else?
> > 
> > Totally confusing...
> 
> Sorry for confusing you, here's the backport for your 4.12 stable branch,

Ok, I've dropped the original patch here now and will queue this one up
for the next round of stable updates...

thanks,

greg k-h

[toc] | [prev] | [next] | [standalone]


#1709937 — Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-11 21:40 +0200
SubjectRe: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<udnWN-7ym-15@gated-at.bofh.it>
In reply to#1709747
On Fri, Aug 11, 2017 at 08:30:45AM -0700, Greg Kroah-Hartman wrote:
> On Fri, Aug 11, 2017 at 09:14:09AM +0200, Johannes Thumshirn wrote:
> > On Thu, Aug 10, 2017 at 08:11:34AM -0700, Greg KH wrote:
> > > else between it and the newer one?  Drop this and you provide a
> > > backport?  Something else?
> > > 
> > > Totally confusing...
> > 
> > Sorry for confusing you, here's the backport for your 4.12 stable branch,
> 
> Ok, I've dropped the original patch here now and will queue this one up
> for the next round of stable updates...

Now applied, thanks.

greg k-h

[toc] | [prev] | [next] | [standalone]


#1708305 — Re: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers

FromChris Clayton <chris2553@googlemail.com>
Date2017-08-10 10:20 +0200
SubjectRe: [PATCH 4.12 004/106] scsi: sg: fix SG_DXFER_FROM_DEV transfers
Message-ID<ucQRc-2OS-7@gated-at.bofh.it>
In reply to#1707601

On 09/08/17 17:51, Greg Kroah-Hartman wrote:
> 4.12-stable review patch.  If anyone has any objections, please let me know.
> 
> -------
 I repeat my comments when the patch was queued for stable:

1. Johannes' commit message says that the transfer must have a length bigger than 0, so the code should return false if
the length is less than or equal to 0, but the test is for less than 0.

2. But in any case, there's another patch that removes all this sg_is_valid_dxfer() jiggery-pokery and replaces it with
a simpler test. It hasn't reached Linus' tree yet but is, I believe, cc'd to stable.


As Johannes said in response to the second of my comments, the patch that replaces sg_is_valid_dxfer() with a simpler
test is now in Linus' tree - commit f930c7043663188429cd9b254e9d761edfc101ce. Without that change, I think there is
still some breakage in sg.

Chris
-----------
> 
> From: Johannes Thumshirn <jthumshirn@suse.de>
> 
> commit 68c59fcea1f2c6a54c62aa896cc623c1b5bc9b47 upstream.
> 
> SG_DXFER_FROM_DEV transfers do not necessarily have a dxferp as we set
> it to NULL for the old sg_io read/write interface, but must have a
> length bigger than 0. This fixes a regression introduced by commit
> 28676d869bbb ("scsi: sg: check for valid direction before starting the
> request")
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> Fixes: 28676d869bbb ("scsi: sg: check for valid direction before starting the request")
> Reported-by: Chris Clayton <chris2553@googlemail.com>
> Tested-by: Chris Clayton <chris2553@googlemail.com>
> Cc: Douglas Gilbert <dgilbert@interlog.com>
> Reviewed-by: Hannes Reinecke <hare@suse.com>
> Tested-by: Chris Clayton <chris2553@googlemail.com>
> Acked-by: Douglas Gilbert <dgilbert@interlog.com>
> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> ---
>  drivers/scsi/sg.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> --- a/drivers/scsi/sg.c
> +++ b/drivers/scsi/sg.c
> @@ -758,8 +758,11 @@ static bool sg_is_valid_dxfer(sg_io_hdr_
>  		if (hp->dxferp || hp->dxfer_len > 0)
>  			return false;
>  		return true;
> -	case SG_DXFER_TO_DEV:
>  	case SG_DXFER_FROM_DEV:
> +		if (hp->dxfer_len < 0)
> +			return false;
> +		return true;
> +	case SG_DXFER_TO_DEV:
>  	case SG_DXFER_TO_FROM_DEV:
>  		if (!hp->dxferp || hp->dxfer_len == 0)
>  			return false;
> 
> 

[toc] | [prev] | [next] | [standalone]


#1707602 — [PATCH 4.12 029/106] ASoC: do not close shared backend dailink

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 029/106] ASoC: do not close shared backend dailink
Message-ID<ucCOh-1QT-71@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Banajit Goswami <bgoswami@codeaurora.org>

commit b1cd2e34c69a2f3988786af451b6e17967c293a0 upstream.

Multiple frontend dailinks may be connected to a backend
dailink at the same time. When one of frontend dailinks is
closed, the associated backend dailink should not be closed
if it is connected to other active frontend dailinks. Change
ensures that backend dailink is closed only after all
connected frontend dailinks are closed.

Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Signed-off-by: Patrick Lai <plai@codeaurora.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 sound/soc/soc-pcm.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/sound/soc/soc-pcm.c
+++ b/sound/soc/soc-pcm.c
@@ -181,6 +181,10 @@ int dpcm_dapm_stream_event(struct snd_so
 		dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n",
 				be->dai_link->name, event, dir);
 
+		if ((event == SND_SOC_DAPM_STREAM_STOP) &&
+		    (be->dpcm[dir].users >= 1))
+			continue;
+
 		snd_soc_dapm_stream_event(be, dir, event);
 	}
 

[toc] | [prev] | [next] | [standalone]


#1707603 — [PATCH 4.12 021/106] userfaultfd: non-cooperative: flush event_wqh at release time

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 021/106] userfaultfd: non-cooperative: flush event_wqh at release time
Message-ID<ucCOh-1QT-75@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Mike Rapoport <rppt@linux.vnet.ibm.com>

commit 5a18b64e3f02125be1c0ef777501ae38aafe2a24 upstream.

There may still be threads waiting on event_wqh at the time the
userfault file descriptor is closed.  Flush the events wait-queue to
prevent waiting threads from hanging.

Link: http://lkml.kernel.org/r/1501398127-30419-1-git-send-email-rppt@linux.vnet.ibm.com
Fixes: 9cd75c3cd4c3d ("userfaultfd: non-cooperative: add ability to report
non-PF events from uffd descriptor")
Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
Cc: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/userfaultfd.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/fs/userfaultfd.c
+++ b/fs/userfaultfd.c
@@ -851,6 +851,9 @@ wakeup:
 	__wake_up_locked_key(&ctx->fault_wqh, TASK_NORMAL, &range);
 	spin_unlock(&ctx->fault_pending_wqh.lock);
 
+	/* Flush pending events that may still wait on event_wqh */
+	wake_up_all(&ctx->event_wqh);
+
 	wake_up_poll(&ctx->fd_wqh, POLLHUP);
 	userfaultfd_ctx_put(ctx);
 	return 0;

[toc] | [prev] | [next] | [standalone]


#1707604 — [PATCH 4.12 053/106] Btrfs: fix early ENOSPC due to delalloc

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 053/106] Btrfs: fix early ENOSPC due to delalloc
Message-ID<ucCOh-1QT-77@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Omar Sandoval <osandov@fb.com>

commit 17024ad0a0fdfcfe53043afb969b813d3e020c21 upstream.

If a lot of metadata is reserved for outstanding delayed allocations, we
rely on shrink_delalloc() to reclaim metadata space in order to fulfill
reservation tickets. However, shrink_delalloc() has a shortcut where if
it determines that space can be overcommitted, it will stop early. This
made sense before the ticketed enospc system, but now it means that
shrink_delalloc() will often not reclaim enough space to fulfill any
tickets, leading to an early ENOSPC. (Reservation tickets don't care
about being able to overcommit, they need every byte accounted for.)

Fix it by getting rid of the shortcut so that shrink_delalloc() reclaims
all of the metadata it is supposed to. This fixes early ENOSPCs we were
seeing when doing a btrfs receive to populate a new filesystem, as well
as early ENOSPCs Christoph saw when doing a big cp -r onto Btrfs.

Fixes: 957780eb2788 ("Btrfs: introduce ticketed enospc infrastructure")
Tested-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 fs/btrfs/extent-tree.c |    4 ----
 1 file changed, 4 deletions(-)

--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -4776,10 +4776,6 @@ skip_async:
 		else
 			flush = BTRFS_RESERVE_NO_FLUSH;
 		spin_lock(&space_info->lock);
-		if (can_overcommit(root, space_info, orig, flush)) {
-			spin_unlock(&space_info->lock);
-			break;
-		}
 		if (list_empty(&space_info->tickets) &&
 		    list_empty(&space_info->priority_tickets)) {
 			spin_unlock(&space_info->lock);

[toc] | [prev] | [next] | [standalone]


#1707605 — [PATCH 4.12 011/106] iwlwifi: dvm: prevent an out of bounds access

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 011/106] iwlwifi: dvm: prevent an out of bounds access
Message-ID<ucCOh-1QT-83@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

commit 0b0f934e92a8eaed2e6c48a50eae6f84661f74f3 upstream.

iwlagn_check_ratid_empty takes the tid as a parameter, but
it doesn't check that it is not IWL_TID_NON_QOS.
Since IWL_TID_NON_QOS = 8 and iwl_priv::tid_data is an array
with 8 entries, accessing iwl_priv::tid_data[IWL_TID_NON_QOS]
is a bad idea.
This happened in iwlagn_rx_reply_tx. Since
iwlagn_check_ratid_empty is relevant only to check whether
we can open A-MPDU, this flow is irrelevant if tid is
IWL_TID_NON_QOS. Call iwlagn_check_ratid_empty only inside
the
	if (tid != IWL_TID_NON_QOS)

a few lines earlier in the function.

Reported-by: Seraphime Kirkovski <kirkseraph@gmail.com>
Tested-by: Seraphime Kirkovski <kirkseraph@gmail.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/net/wireless/intel/iwlwifi/dvm/tx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/dvm/tx.c
@@ -1190,11 +1190,11 @@ void iwlagn_rx_reply_tx(struct iwl_priv
 				next_reclaimed;
 			IWL_DEBUG_TX_REPLY(priv, "Next reclaimed packet:%d\n",
 						  next_reclaimed);
+			iwlagn_check_ratid_empty(priv, sta_id, tid);
 		}
 
 		iwl_trans_reclaim(priv->trans, txq_id, ssn, &skbs);
 
-		iwlagn_check_ratid_empty(priv, sta_id, tid);
 		freed = 0;
 
 		/* process frames */

[toc] | [prev] | [next] | [standalone]


#1707606 — [PATCH 4.12 034/106] powerpc/64: Fix __check_irq_replay missing decrementer interrupt

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 034/106] powerpc/64: Fix __check_irq_replay missing decrementer interrupt
Message-ID<ucCOh-1QT-79@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Nicholas Piggin <npiggin@gmail.com>

commit 3db40c312c2c1eb2187c5731102fa8ff380e6e40 upstream.

If the decrementer wraps again and de-asserts the decrementer
exception while hard-disabled, __check_irq_replay() has a test to
notice the wrap when interrupts are re-enabled.

The decrementer check must be done when clearing the PACA_IRQ_HARD_DIS
flag, not when the PACA_IRQ_DEC flag is tested. Previously this worked
because the decrementer interrupt was always the first one checked
after clearing the hard disable flag, but HMI check was moved ahead of
that, which introduced this bug.

This can cause a missed decrementer interrupt if we soft-disable
interrupts then take an HMI which is recorded in irq_happened, then
hard-disable interrupts for > 4s to wrap the decrementer.

Fixes: e0e0d6b7390b ("powerpc/64: Replay hypervisor maintenance interrupt first")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 arch/powerpc/kernel/irq.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -145,6 +145,19 @@ notrace unsigned int __check_irq_replay(
 
 	/* Clear bit 0 which we wouldn't clear otherwise */
 	local_paca->irq_happened &= ~PACA_IRQ_HARD_DIS;
+	if (happened & PACA_IRQ_HARD_DIS) {
+		/*
+		 * We may have missed a decrementer interrupt if hard disabled.
+		 * Check the decrementer register in case we had a rollover
+		 * while hard disabled.
+		 */
+		if (!(happened & PACA_IRQ_DEC)) {
+			if (decrementer_check_overflow()) {
+				local_paca->irq_happened |= PACA_IRQ_DEC;
+				happened |= PACA_IRQ_DEC;
+			}
+		}
+	}
 
 	/*
 	 * Force the delivery of pending soft-disabled interrupts on PS3.
@@ -170,7 +183,7 @@ notrace unsigned int __check_irq_replay(
 	 * in case we also had a rollover while hard disabled
 	 */
 	local_paca->irq_happened &= ~PACA_IRQ_DEC;
-	if ((happened & PACA_IRQ_DEC) || decrementer_check_overflow())
+	if (happened & PACA_IRQ_DEC)
 		return 0x900;
 
 	/* Finally check if an external interrupt happened */

[toc] | [prev] | [next] | [standalone]


#1707607 — [PATCH 4.12 039/106] ext4: fix overflow caused by missing cast in ext4_resize_fs()

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:20 +0200
Subject[PATCH 4.12 039/106] ext4: fix overflow caused by missing cast in ext4_resize_fs()
Message-ID<ucCOh-1QT-81@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jerry Lee <jerrylee@qnap.com>

commit aec51758ce10a9c847a62a48a168f8c804c6e053 upstream.

On a 32-bit platform, the value of n_blcoks_count may be wrong during
the file system is resized to size larger than 2^32 blocks.  This may
caused the superblock being corrupted with zero blocks count.

Fixes: 1c6bd7173d66
Signed-off-by: Jerry Lee <jerrylee@qnap.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 fs/ext4/resize.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/fs/ext4/resize.c
+++ b/fs/ext4/resize.c
@@ -1927,7 +1927,8 @@ retry:
 			n_desc_blocks = o_desc_blocks +
 				le16_to_cpu(es->s_reserved_gdt_blocks);
 			n_group = n_desc_blocks * EXT4_DESC_PER_BLOCK(sb);
-			n_blocks_count = n_group * EXT4_BLOCKS_PER_GROUP(sb);
+			n_blocks_count = (ext4_fsblk_t)n_group *
+				EXT4_BLOCKS_PER_GROUP(sb);
 			n_group--; /* set to last group number */
 		}
 

[toc] | [prev] | [next] | [standalone]


#1707609 — [PATCH 4.12 003/106] scsi: lpfc: fix linking against modular NVMe support

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:30 +0200
Subject[PATCH 4.12 003/106] scsi: lpfc: fix linking against modular NVMe support
Message-ID<ucCXT-1Uf-1@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Arnd Bergmann <arnd@arndb.de>

commit cd069bb9f9ff13b23492fda6ccdb458ac4f641ca upstream.

When LPFC is built-in but NVMe is a loadable module, we fail to link the
kernel:

drivers/scsi/built-in.o: In function `lpfc_nvme_create_localport':
(.text+0x156a82): undefined reference to `nvme_fc_register_localport'
drivers/scsi/built-in.o: In function `lpfc_nvme_destroy_localport':
(.text+0x156eaa): undefined reference to `nvme_fc_unregister_remoteport'

We can avoid this either by forcing lpfc to be a module, or by disabling
NVMe support in this case. This implements the former.

Fixes: 7d7080335f8d ("scsi: lpfc: Finalize Kconfig options for nvme")
Link: https://patchwork.kernel.org/patch/9636569/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/scsi/Kconfig |    2 ++
 1 file changed, 2 insertions(+)

--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -1241,6 +1241,8 @@ config SCSI_LPFC
 	tristate "Emulex LightPulse Fibre Channel Support"
 	depends on PCI && SCSI
 	depends on SCSI_FC_ATTRS
+	depends on NVME_TARGET_FC || NVME_TARGET_FC=n
+	depends on NVME_FC || NVME_FC=n
 	select CRC_T10DIF
 	---help---
           This lpfc driver supports the Emulex LightPulse

[toc] | [prev] | [next] | [standalone]


#1707610 — [PATCH 4.12 014/106] mmc: sdhci-of-at91: force card detect value for non removable devices

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:30 +0200
Subject[PATCH 4.12 014/106] mmc: sdhci-of-at91: force card detect value for non removable devices
Message-ID<ucCXT-1Uf-3@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ludovic Desroches <ludovic.desroches@microchip.com>

commit 7a1e3f143176e8ebdb2f5a9b3b47abc18b879d90 upstream.

When the device is non removable, the card detect signal is often used
for another purpose i.e. muxed to another SoC peripheral or used as a
GPIO. It could lead to wrong behaviors depending the default value of
this signal if not muxed to the SDHCI controller.

Fixes: bb5f8ea4d514 ("mmc: sdhci-of-at91: introduce driver for the Atmel SDMMC")
Signed-off-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/mmc/host/sdhci-of-at91.c |   35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)

--- a/drivers/mmc/host/sdhci-of-at91.c
+++ b/drivers/mmc/host/sdhci-of-at91.c
@@ -31,6 +31,7 @@
 
 #define SDMMC_MC1R	0x204
 #define		SDMMC_MC1R_DDR		BIT(3)
+#define		SDMMC_MC1R_FCD		BIT(7)
 #define SDMMC_CACR	0x230
 #define		SDMMC_CACR_CAPWREN	BIT(0)
 #define		SDMMC_CACR_KEY		(0x46 << 8)
@@ -43,6 +44,15 @@ struct sdhci_at91_priv {
 	struct clk *mainck;
 };
 
+static void sdhci_at91_set_force_card_detect(struct sdhci_host *host)
+{
+	u8 mc1r;
+
+	mc1r = readb(host->ioaddr + SDMMC_MC1R);
+	mc1r |= SDMMC_MC1R_FCD;
+	writeb(mc1r, host->ioaddr + SDMMC_MC1R);
+}
+
 static void sdhci_at91_set_clock(struct sdhci_host *host, unsigned int clock)
 {
 	u16 clk;
@@ -110,10 +120,18 @@ void sdhci_at91_set_uhs_signaling(struct
 	sdhci_set_uhs_signaling(host, timing);
 }
 
+static void sdhci_at91_reset(struct sdhci_host *host, u8 mask)
+{
+	sdhci_reset(host, mask);
+
+	if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
+		sdhci_at91_set_force_card_detect(host);
+}
+
 static const struct sdhci_ops sdhci_at91_sama5d2_ops = {
 	.set_clock		= sdhci_at91_set_clock,
 	.set_bus_width		= sdhci_set_bus_width,
-	.reset			= sdhci_reset,
+	.reset			= sdhci_at91_reset,
 	.set_uhs_signaling	= sdhci_at91_set_uhs_signaling,
 	.set_power		= sdhci_at91_set_power,
 };
@@ -324,6 +342,21 @@ static int sdhci_at91_probe(struct platf
 		host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
 	}
 
+	/*
+	 * If the device attached to the MMC bus is not removable, it is safer
+	 * to set the Force Card Detect bit. People often don't connect the
+	 * card detect signal and use this pin for another purpose. If the card
+	 * detect pin is not muxed to SDHCI controller, a default value is
+	 * used. This value can be different from a SoC revision to another
+	 * one. Problems come when this default value is not card present. To
+	 * avoid this case, if the device is non removable then the card
+	 * detection procedure using the SDMCC_CD signal is bypassed.
+	 * This bit is reset when a software reset for all command is performed
+	 * so we need to implement our own reset function to set back this bit.
+	 */
+	if (host->mmc->caps & MMC_CAP_NONREMOVABLE)
+		sdhci_at91_set_force_card_detect(host);
+
 	pm_runtime_put_autosuspend(&pdev->dev);
 
 	return 0;

[toc] | [prev] | [next] | [standalone]


#1707611 — [PATCH 4.12 006/106] cgroup: dont call migration methods if there are no tasks to migrate

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-08-09 19:30 +0200
Subject[PATCH 4.12 006/106] cgroup: dont call migration methods if there are no tasks to migrate
Message-ID<ucCXT-1Uf-7@gated-at.bofh.it>
In reply to#1707498
4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Tejun Heo <tj@kernel.org>

commit 610467270fb368584b74567edd21c8cc5104490f upstream.

Subsystem migration methods shouldn't be called for empty migrations.
cgroup_migrate_execute() implements this guarantee by bailing early if
there are no source css_sets.  This used to be correct before
a79a908fd2b0 ("cgroup: introduce cgroup namespaces"), but no longer
since the commit because css_sets can stay pinned without tasks in
them.

This caused cgroup_migrate_execute() call into cpuset migration
methods with an empty cgroup_taskset.  cpuset migration methods
correctly assume that cgroup_taskset_first() never returns NULL;
however, due to the bug, it can, leading to the following oops.

  Unable to handle kernel paging request for data at address 0x00000960
  Faulting instruction address: 0xc0000000001d6868
  Oops: Kernel access of bad area, sig: 11 [#1]
  ...
  CPU: 14 PID: 16947 Comm: kworker/14:0 Tainted: G        W
  4.12.0-rc4-next-20170609 #2
  Workqueue: events cpuset_hotplug_workfn
  task: c00000000ca60580 task.stack: c00000000c728000
  NIP: c0000000001d6868 LR: c0000000001d6858 CTR: c0000000001d6810
  REGS: c00000000c72b720 TRAP: 0300   Tainted: GW (4.12.0-rc4-next-20170609)
  MSR: 8000000000009033 <SF,EE,ME,IR,DR,RI,LE>  CR: 44722422  XER: 20000000
  CFAR: c000000000008710 DAR: 0000000000000960 DSISR: 40000000 SOFTE: 1
  GPR00: c0000000001d6858 c00000000c72b9a0 c000000001536e00 0000000000000000
  GPR04: c00000000c72b9c0 0000000000000000 c00000000c72bad0 c000000766367678
  GPR08: c000000766366d10 c00000000c72b958 c000000001736e00 0000000000000000
  GPR12: c0000000001d6810 c00000000e749300 c000000000123ef8 c000000775af4180
  GPR16: 0000000000000000 0000000000000000 c00000075480e9c0 c00000075480e9e0
  GPR20: c00000075480e8c0 0000000000000001 0000000000000000 c00000000c72ba20
  GPR24: c00000000c72baa0 c00000000c72bac0 c000000001407248 c00000000c72ba20
  GPR28: c00000000141fc80 c00000000c72bac0 c00000000c6bc790 0000000000000000
  NIP [c0000000001d6868] cpuset_can_attach+0x58/0x1b0
  LR [c0000000001d6858] cpuset_can_attach+0x48/0x1b0
  Call Trace:
  [c00000000c72b9a0] [c0000000001d6858] cpuset_can_attach+0x48/0x1b0 (unreliable)
  [c00000000c72ba00] [c0000000001cbe80] cgroup_migrate_execute+0xb0/0x450
  [c00000000c72ba80] [c0000000001d3754] cgroup_transfer_tasks+0x1c4/0x360
  [c00000000c72bba0] [c0000000001d923c] cpuset_hotplug_workfn+0x86c/0xa20
  [c00000000c72bca0] [c00000000011aa44] process_one_work+0x1e4/0x580
  [c00000000c72bd30] [c00000000011ae78] worker_thread+0x98/0x5c0
  [c00000000c72bdc0] [c000000000124058] kthread+0x168/0x1b0
  [c00000000c72be30] [c00000000000b2e8] ret_from_kernel_thread+0x5c/0x74
  Instruction dump:
  f821ffa1 7c7d1b78 60000000 60000000 38810020 7fa3eb78 3f42ffed 4bff4c25
  60000000 3b5a0448 3d420020 eb610020 <e9230960> 7f43d378 e9290000 f92af200
  ---[ end trace dcaaf98fb36d9e64 ]---

This patch fixes the bug by adding an explicit nr_tasks counter to
cgroup_taskset and skipping calling the migration methods if the
counter is zero.  While at it, remove the now spurious check on no
source css_sets.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-and-tested-by: Abdul Haleem <abdhalee@linux.vnet.ibm.com>
Cc: Roman Gushchin <guro@fb.com>
Fixes: a79a908fd2b0 ("cgroup: introduce cgroup namespaces")
Link: http://lkml.kernel.org/r/1497266622.15415.39.camel@abdul.in.ibm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/cgroup/cgroup-internal.h |    3 ++
 kernel/cgroup/cgroup.c          |   58 +++++++++++++++++++++-------------------
 2 files changed, 34 insertions(+), 27 deletions(-)

--- a/kernel/cgroup/cgroup-internal.h
+++ b/kernel/cgroup/cgroup-internal.h
@@ -33,6 +33,9 @@ struct cgroup_taskset {
 	struct list_head	src_csets;
 	struct list_head	dst_csets;
 
+	/* the number of tasks in the set */
+	int			nr_tasks;
+
 	/* the subsys currently being processed */
 	int			ssid;
 
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -1948,6 +1948,8 @@ static void cgroup_migrate_add_task(stru
 	if (!cset->mg_src_cgrp)
 		return;
 
+	mgctx->tset.nr_tasks++;
+
 	list_move_tail(&task->cg_list, &cset->mg_tasks);
 	if (list_empty(&cset->mg_node))
 		list_add_tail(&cset->mg_node,
@@ -2036,21 +2038,19 @@ static int cgroup_migrate_execute(struct
 	struct css_set *cset, *tmp_cset;
 	int ssid, failed_ssid, ret;
 
-	/* methods shouldn't be called if no task is actually migrating */
-	if (list_empty(&tset->src_csets))
-		return 0;
-
 	/* check that we can legitimately attach to the cgroup */
-	do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
-		if (ss->can_attach) {
-			tset->ssid = ssid;
-			ret = ss->can_attach(tset);
-			if (ret) {
-				failed_ssid = ssid;
-				goto out_cancel_attach;
+	if (tset->nr_tasks) {
+		do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
+			if (ss->can_attach) {
+				tset->ssid = ssid;
+				ret = ss->can_attach(tset);
+				if (ret) {
+					failed_ssid = ssid;
+					goto out_cancel_attach;
+				}
 			}
-		}
-	} while_each_subsys_mask();
+		} while_each_subsys_mask();
+	}
 
 	/*
 	 * Now that we're guaranteed success, proceed to move all tasks to
@@ -2077,25 +2077,29 @@ static int cgroup_migrate_execute(struct
 	 */
 	tset->csets = &tset->dst_csets;
 
-	do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
-		if (ss->attach) {
-			tset->ssid = ssid;
-			ss->attach(tset);
-		}
-	} while_each_subsys_mask();
+	if (tset->nr_tasks) {
+		do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
+			if (ss->attach) {
+				tset->ssid = ssid;
+				ss->attach(tset);
+			}
+		} while_each_subsys_mask();
+	}
 
 	ret = 0;
 	goto out_release_tset;
 
 out_cancel_attach:
-	do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
-		if (ssid == failed_ssid)
-			break;
-		if (ss->cancel_attach) {
-			tset->ssid = ssid;
-			ss->cancel_attach(tset);
-		}
-	} while_each_subsys_mask();
+	if (tset->nr_tasks) {
+		do_each_subsys_mask(ss, ssid, mgctx->ss_mask) {
+			if (ssid == failed_ssid)
+				break;
+			if (ss->cancel_attach) {
+				tset->ssid = ssid;
+				ss->cancel_attach(tset);
+			}
+		} while_each_subsys_mask();
+	}
 out_release_tset:
 	spin_lock_irq(&css_set_lock);
 	list_splice_init(&tset->dst_csets, &tset->src_csets);

[toc] | [prev] | [next] | [standalone]


Page 5 of 6 — ← Prev page 1 2 3 4 [5] 6  Next page →

Back to top | Article view | linux.kernel


csiph-web