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


Groups > linux.kernel > #1605056 > unrolled thread

[PATCH 4.9 00/93] 4.9.17-stable review

Started byGreg Kroah-Hartman <gregkh@linuxfoundation.org>
First post2017-03-20 19:40 +0100
Last post2017-03-21 03:20 +0100
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 4.9 00/93] 4.9.17-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 19:40 +0100
    [PATCH 4.9 50/93] scsi: ibmvscsis: Synchronize cmds at tpg_enable_store time Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-03-20 19:40 +0100
    Re: [PATCH 4.9 00/93] 4.9.17-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-03-21 01:30 +0100
    Re: [PATCH 4.9 00/93] 4.9.17-stable review Guenter Roeck <linux@roeck-us.net> - 2017-03-21 03:20 +0100

#1605056 — [PATCH 4.9 00/93] 4.9.17-stable review

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-20 19:40 +0100
Subject[PATCH 4.9 00/93] 4.9.17-stable review
Message-ID<tn9L3-89w-3@gated-at.bofh.it>
This is the start of the stable review cycle for the 4.9.17 release.
There are 93 patches in this series, all will be posted as a response
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Wed Mar 22 17:47:16 UTC 2017.
Anything received after that time might be too late.

The whole patch series can be found in one patch at:
	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.17-rc1.gz
or in the git tree and branch at:
  git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.

thanks,

greg k-h

-------------
Pseudo-Shortlog of commits:

Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Linux 4.9.17-rc1

Daniel Axtens <dja@axtens.net>
    crypto: powerpc - Fix initialisation of crc32c context

Niklas Cassel <niklas.cassel@axis.com>
    locking/rwsem: Fix down_write_killable() for CONFIG_RWSEM_GENERIC_SPINLOCK=y

Peter Zijlstra <peterz@infradead.org>
    futex: Add missing error handling to FUTEX_REQUEUE_PI

Peter Zijlstra <peterz@infradead.org>
    futex: Fix potential use-after-free in FUTEX_REQUEUE_PI

Andy Lutomirski <luto@kernel.org>
    x86/perf: Fix CR4.PCE propagation to use active_mm instead of mm

Andrey Ryabinin <aryabinin@virtuozzo.com>
    x86/kasan: Fix boot with KASAN=y and PROFILE_ANNOTATED_BRANCHES=y

Peter Zijlstra <peterz@infradead.org>
    x86/tsc: Fix ART for TSC_KNOWN_FREQ

Shanker Donthineni <shankerd@codeaurora.org>
    irqchip/gicv3-its: Add workaround for QDF2400 ITS erratum 0065

Marc Zyngier <marc.zyngier@arm.com>
    arm64: KVM: VHE: Clear HCR_TGE when invalidating guest TLBs

Boris Brezillon <boris.brezillon@free-electrons.com>
    drm/vc4: Fix ->clock_select setting for the VEC encoder

Derek Foreman <derekf@osg.samsung.com>
    drm/vc4: Fix race between page flip completion event and clean-up

Boris Brezillon <boris.brezillon@free-electrons.com>
    clk: bcm2835: Fix ->fixed_divider of pllh_aux

Michael Ellerman <mpe@ellerman.id.au>
    powerpc/mm: Fix build break when CMA=n && SPAPR_TCE_IOMMU=y

Alexandre Belloni <alexandre.belloni@free-electrons.com>
    usb: gadget: udc: atmel: remove memory leak

Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
    serial: 8250_pci: Detach low-level driver during PCI error recovery

Michael Pobega <mpobega@neverware.com>
    ACPI / blacklist: Make Dell Latitude 3350 ethernet work

Alex Hung <alex.hung@canonical.com>
    ACPI / blacklist: add _REV quirks for Dell Precision 5520 and 3520

Vladimir Davydov <vdavydov.dev@gmail.com>
    slub: move synchronize_sched out of slab_mutex on shrink

Henrik Ingo <henrik.ingo@avoinelama.fi>
    uvcvideo: uvc_scan_fallback() for webcams with broken chain

Harald Freudenberger <freude@linux.vnet.ibm.com>
    s390/zcrypt: Introduce CEX6 toleration

Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
    block: allow WRITE_SAME commands with the SG_IO ioctl

Ben Skeggs <bskeggs@redhat.com>
    drm/nouveau/disp/nv50-: specify ctrl/user separately when constructing classes

Ben Skeggs <bskeggs@redhat.com>
    drm/nouveau/disp/nv50-: split chid into chid.ctrl and chid.user

Ben Skeggs <bskeggs@redhat.com>
    drm/nouveau/disp/gp102: fix cursor/overlay immediate channel indices

Alexey Kardashevskiy <aik@ozlabs.ru>
    vfio/spapr: Postpone default window creation

Alexey Kardashevskiy <aik@ozlabs.ru>
    vfio/spapr: Add a helper to create default DMA window

Alexey Kardashevskiy <aik@ozlabs.ru>
    powerpc/mm/iommu, vfio/spapr: Put pages on VFIO container shutdown

Alexey Kardashevskiy <aik@ozlabs.ru>
    vfio/spapr: Reference mm in tce_container

Alexey Kardashevskiy <aik@ozlabs.ru>
    powerpc/iommu: Stop using @current in mm_iommu_xxx

Alexey Kardashevskiy <aik@ozlabs.ru>
    powerpc/iommu: Pass mm_struct to init/cleanup helpers

Alexey Kardashevskiy <aik@ozlabs.ru>
    vfio/spapr: Postpone allocation of userspace version of TCE table

Vitaly Kuznetsov <vkuznets@redhat.com>
    Drivers: hv: ring_buffer: count on wrap around mappings in get_next_pkt_raw() (v2)

Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
    ibmveth: calculate gso_segs for large packets

Gavin Shan <gwshan@linux.vnet.ibm.com>
    PCI: Do any VF BAR updates before enabling the BARs

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Ignore BAR updates on virtual functions

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Update BARs using property bits appropriate for type

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Don't update VF BARs while VF memory space is enabled

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Decouple IORESOURCE_ROM_ENABLE and PCI_ROM_ADDRESS_ENABLE

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Add comments about ROM BAR updating

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Remove pci_resource_bar() and pci_iov_resource_bar()

Bjorn Helgaas <bhelgaas@google.com>
    PCI: Separate VF BAR updates from standard BAR updates

Vitaly Kuznetsov <vkuznets@redhat.com>
    x86/hyperv: Handle unknown NMIs on one CPU when unknown_nmi_panic

Michael Cyr <mikecyr@us.ibm.com>
    scsi: ibmvscsis: Synchronize cmds at remove time

Michael Cyr <mikecyr@us.ibm.com>
    scsi: ibmvscsis: Synchronize cmds at tpg_enable_store time

Michael Cyr <mikecyr@us.ibm.com>
    scsi: ibmvscsis: Rearrange functions for future patches

Michael Cyr <mikecyr@us.ibm.com>
    scsi: ibmvscsis: Clean up properly if target_submit_cmd/tmr fails

Michael Cyr <mikecyr@us.ibm.com>
    scsi: ibmvscsis: Return correct partition name/# to client

Michael Cyr <mikecyr@us.ibm.com>
    scsi: ibmvscsis: Issues from Dan Carpenter/Smatch

Todd Fujinaka <todd.fujinaka@intel.com>
    igb: add i211 to i210 PHY workaround

Chris J Arges <christopherarges@gmail.com>
    igb: Workaround for igb i210 firmware issue

Dan Streetman <ddstreet@ieee.org>
    xen: do not re-use pirq number cached in pci device msi msg data

Krister Johansen <kjlx@templeofstupid.com>
    dmaengine: iota: ioat_alloc_chan_resources should not perform sleeping allocations.

Daniel Borkmann <daniel@iogearbox.net>
    bpf: fix mark_reg_unknown_value for spilled regs on map value marking

Daniel Borkmann <daniel@iogearbox.net>
    bpf: fix regression on verifier pruning wrt map lookups

Alexei Starovoitov <ast@fb.com>
    bpf: fix state equivalence

Thomas Graf <tgraf@suug.ch>
    bpf: Detect identical PTR_TO_MAP_VALUE_OR_NULL registers

Hannes Frederic Sowa <hannes@stressinduktion.org>
    dccp: fix memory leak during tear-down of unsuccessful connection request

Hannes Frederic Sowa <hannes@stressinduktion.org>
    tun: fix premature POLLOUT notification on tun devices

Jon Maxwell <jmaxwell37@gmail.com>
    dccp/tcp: fix routing redirect race

Florian Westphal <fw@strlen.de>
    bridge: drop netfilter fake rtable unconditionally

Florian Westphal <fw@strlen.de>
    ipv6: avoid write to a possibly cloned skb

Sabrina Dubroca <sd@queasysnail.net>
    ipv6: make ECMP route replacement less greedy

David Ahern <dsa@cumulusnetworks.com>
    mpls: Do not decrement alive counter for unregister events

David Ahern <dsa@cumulusnetworks.com>
    mpls: Send route delete notifications when router module is unloaded

Etienne Noss <etienne.noss@wifirst.fr>
    act_connmark: avoid crashing on malformed nlattrs with null parms

Dmitry V. Levin <ldv@altlinux.org>
    uapi: fix linux/packet_diag.h userspace compilation error

Paolo Abeni <pabeni@redhat.com>
    net/tunnel: set inner protocol in network gro hooks

David Ahern <dsa@cumulusnetworks.com>
    vrf: Fix use-after-free in vrf_xmit

Eric Dumazet <edumazet@google.com>
    dccp: fix use-after-free in dccp_feat_activate_values

Alexey Khoroshilov <khoroshilov@ispras.ru>
    net/sched: act_skbmod: remove unneeded rcu_read_unlock in tcf_skbmod_dump

Eric Dumazet <edumazet@google.com>
    net: fix socket refcounting in skb_complete_tx_timestamp()

Eric Dumazet <edumazet@google.com>
    net: fix socket refcounting in skb_complete_wifi_ack()

Eric Dumazet <edumazet@google.com>
    tcp: fix various issues for sockets morphing to listen state

WANG Cong <xiyou.wangcong@gmail.com>
    strparser: destroy workqueue on module exit

Arnaldo Carvalho de Melo <acme@redhat.com>
    dccp: Unlock sock before calling sk_free()

Eric Dumazet <edumazet@google.com>
    ipv6: orphan skbs in reassembly unit

Eric Dumazet <edumazet@google.com>
    net: net_enable_timestamp() can be called from irq contexts

Alexander Potapenko <glider@google.com>
    net: don't call strlen() on the user buffer in packet_bind_spkt()

Mike Manning <mmanning@brocade.com>
    net: bridge: allow IPv6 when multicast flood is disabled

Eric Dumazet <edumazet@google.com>
    tcp/dccp: block BH for SYN processing

Ido Schimmel <idosch@mellanox.com>
    mlxsw: spectrum_router: Avoid potential packets loss

Jakub Kicinski <jakub.kicinski@netronome.com>
    geneve: lock RCU on TX path

Jakub Kicinski <jakub.kicinski@netronome.com>
    vxlan: lock RCU on TX path

Florian Fainelli <f.fainelli@gmail.com>
    net: phy: Avoid deadlock during phy_error()

Paul Hüber <phueber@kernsp.in>
    l2tp: avoid use-after-free caused by l2tp_ip_backlog_recv

Roman Mashak <mrv@mojatatu.com>
    net sched actions: decrement module reference count after table flush.

Julian Anastasov <ja@ssi.bg>
    ipv4: mask tos for input route

Brian Russell <brussell@brocade.com>
    vxlan: don't allow overwrite of config src addr

David Forster <dforster@brocade.com>
    vti6: return GRE_KEY for vti6

Matthias Schiffer <mschiffer@universe-factory.net>
    vxlan: correctly validate VXLAN ID against VXLAN_N_VID

Tariq Toukan <tariqt@mellanox.com>
    net/mlx5e: Fix wrong CQE decompression

Tariq Toukan <tariqt@mellanox.com>
    net/mlx5e: Do not reduce LRO WQE size when not using build_skb

Saeed Mahameed <saeedm@mellanox.com>
    net/mlx5e: Register/unregister vport representors on interface attach/detach


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

Diffstat:

 Documentation/arm64/silicon-errata.txt             |   44 +-
 Makefile                                           |    4 +-
 arch/arm64/Kconfig                                 |   10 +
 arch/arm64/kvm/hyp/tlb.c                           |   64 +-
 arch/powerpc/crypto/crc32c-vpmsum_glue.c           |    2 +-
 arch/powerpc/include/asm/mmu_context.h             |   20 +-
 arch/powerpc/kernel/setup-common.c                 |    2 +-
 arch/powerpc/mm/mmu_context_book3s64.c             |    6 +-
 arch/powerpc/mm/mmu_context_iommu.c                |   62 +-
 arch/x86/events/core.c                             |    4 +-
 arch/x86/kernel/cpu/mshyperv.c                     |   24 +
 arch/x86/kernel/head64.c                           |    1 +
 arch/x86/kernel/tsc.c                              |    2 +
 arch/x86/mm/kasan_init_64.c                        |    1 +
 arch/x86/pci/xen.c                                 |   23 +-
 block/scsi_ioctl.c                                 |    3 +
 drivers/acpi/blacklist.c                           |   28 +
 drivers/clk/bcm/clk-bcm2835.c                      |    2 +-
 drivers/dma/ioat/init.c                            |    4 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/Kbuild    |    2 +
 .../gpu/drm/nouveau/nvkm/engine/disp/channv50.c    |   30 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/channv50.h    |   23 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/cursg84.c |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/cursgf119.c   |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/cursgk104.c   |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/cursgp102.c   |   37 +
 .../gpu/drm/nouveau/nvkm/engine/disp/cursgt215.c   |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/cursnv50.c    |    6 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/dmacgf119.c   |   44 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/dmacgp104.c   |   23 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/dmacnv50.c    |   46 +-
 drivers/gpu/drm/nouveau/nvkm/engine/disp/oimmg84.c |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/oimmgf119.c   |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/oimmgk104.c   |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/oimmgp102.c   |   37 +
 .../gpu/drm/nouveau/nvkm/engine/disp/oimmgt215.c   |    2 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/oimmnv50.c    |    6 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/piocgf119.c   |   28 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/piocnv50.c    |   30 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/rootgp104.c   |    4 +-
 .../gpu/drm/nouveau/nvkm/engine/disp/rootnv50.c    |    4 +-
 drivers/gpu/drm/vc4/vc4_crtc.c                     |   46 +-
 drivers/gpu/drm/vc4/vc4_drv.h                      |    2 +
 drivers/gpu/drm/vc4/vc4_kms.c                      |   33 +-
 drivers/gpu/drm/vc4/vc4_regs.h                     |    3 +-
 drivers/irqchip/irq-gic-v3-its.c                   |   16 +
 drivers/media/usb/uvc/uvc_driver.c                 |  118 ++-
 drivers/net/ethernet/ibm/ibmveth.c                 |   12 +-
 drivers/net/ethernet/intel/igb/e1000_phy.c         |    4 +
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c  |   34 +-
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c    |   13 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |   30 +-
 drivers/net/geneve.c                               |   10 +-
 drivers/net/phy/phy.c                              |   14 +-
 drivers/net/tun.c                                  |   18 +-
 drivers/net/vrf.c                                  |    3 +-
 drivers/net/vxlan.c                                |   27 +-
 drivers/pci/iov.c                                  |   70 +-
 drivers/pci/pci.c                                  |   34 -
 drivers/pci/pci.h                                  |    7 +-
 drivers/pci/probe.c                                |    3 +-
 drivers/pci/rom.c                                  |    5 +
 drivers/pci/setup-res.c                            |   48 +-
 drivers/s390/crypto/ap_bus.c                       |    3 +
 drivers/s390/crypto/ap_bus.h                       |    1 +
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c           | 1096 +++++++++-----------
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h           |    5 +-
 drivers/tty/serial/8250/8250_pci.c                 |   23 +-
 drivers/usb/gadget/udc/atmel_usba_udc.c            |    3 +-
 drivers/usb/gadget/udc/atmel_usba_udc.h            |    1 +
 drivers/vfio/vfio_iommu_spapr_tce.c                |  328 ++++--
 include/linux/bpf_verifier.h                       |   14 +-
 include/linux/dccp.h                               |    1 +
 include/linux/hyperv.h                             |   32 +-
 include/uapi/linux/packet_diag.h                   |    2 +-
 kernel/bpf/verifier.c                              |   77 +-
 kernel/futex.c                                     |   22 +-
 kernel/locking/rwsem-spinlock.c                    |   15 +-
 mm/slab.c                                          |    4 +-
 mm/slab.h                                          |    2 +-
 mm/slab_common.c                                   |   27 +-
 mm/slob.c                                          |    2 +-
 mm/slub.c                                          |   19 +-
 net/bridge/br_forward.c                            |    3 +-
 net/bridge/br_input.c                              |    1 +
 net/bridge/br_netfilter_hooks.c                    |   21 -
 net/core/dev.c                                     |   35 +-
 net/core/skbuff.c                                  |   30 +-
 net/dccp/ccids/ccid2.c                             |    1 +
 net/dccp/input.c                                   |   10 +-
 net/dccp/ipv4.c                                    |    3 +-
 net/dccp/ipv6.c                                    |    8 +-
 net/dccp/minisocks.c                               |   25 +-
 net/ipv4/af_inet.c                                 |    4 +-
 net/ipv4/route.c                                   |    1 +
 net/ipv4/tcp_input.c                               |   10 +-
 net/ipv4/tcp_ipv4.c                                |   10 +-
 net/ipv4/tcp_timer.c                               |    6 +-
 net/ipv6/ip6_fib.c                                 |    2 +
 net/ipv6/ip6_offload.c                             |    4 +-
 net/ipv6/ip6_output.c                              |    7 +-
 net/ipv6/ip6_vti.c                                 |    4 +
 net/ipv6/netfilter/nf_conntrack_reasm.c            |    1 +
 net/ipv6/tcp_ipv6.c                                |    8 +-
 net/l2tp/l2tp_ip.c                                 |    2 +-
 net/mpls/af_mpls.c                                 |    4 +-
 net/openvswitch/conntrack.c                        |    1 -
 net/packet/af_packet.c                             |    8 +-
 net/sched/act_api.c                                |    5 +-
 net/sched/act_connmark.c                           |    3 +
 net/sched/act_skbmod.c                             |    1 -
 net/strparser/strparser.c                          |    1 +
 112 files changed, 1816 insertions(+), 1272 deletions(-)

[toc] | [next] | [standalone]


#1605057 — [PATCH 4.9 50/93] scsi: ibmvscsis: Synchronize cmds at tpg_enable_store time

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-03-20 19:40 +0100
Subject[PATCH 4.9 50/93] scsi: ibmvscsis: Synchronize cmds at tpg_enable_store time
Message-ID<tnanP-iT-103@gated-at.bofh.it>
In reply to#1605056
4.9-stable review patch.  If anyone has any objections, please let me know.

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

From: Michael Cyr <mikecyr@us.ibm.com>

[ Upstream commit c9b3379f60a83288a5e2f8ea75476460978689b0 ]

This patch changes the way the IBM vSCSI server driver manages its
Command/Response Queue (CRQ).  We used to register the CRQ with phyp at
probe time.  Now we wait until tpg_enable_store.  Similarly, when
tpg_enable_store is called to "disable" (i.e. the stored value is 0),
we unregister the queue with phyp.

One consquence to this is that we have no need for the PART_UP_WAIT_ENAB
state, since we can't get an Init Message from the client in our CRQ if
we're waiting to be enabled, since we haven't registered the queue yet.

Signed-off-by: Michael Cyr <mikecyr@us.ibm.com>
Signed-off-by: Bryant G. Ly <bryantly@linux.vnet.ibm.com>
Tested-by: Steven Royer <seroyer@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c |  224 +++++--------------------------
 drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h |    2 
 2 files changed, 38 insertions(+), 188 deletions(-)

--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.c
@@ -62,8 +62,6 @@ static long ibmvscsis_parse_command(stru
 
 static void ibmvscsis_adapter_idle(struct scsi_info *vscsi);
 
-static void ibmvscsis_reset_queue(struct scsi_info *vscsi, uint new_state);
-
 static void ibmvscsis_determine_resid(struct se_cmd *se_cmd,
 				      struct srp_rsp *rsp)
 {
@@ -418,7 +416,6 @@ static void ibmvscsis_disconnect(struct
 					       proc_work);
 	u16 new_state;
 	bool wait_idle = false;
-	long rc = ADAPT_SUCCESS;
 
 	spin_lock_bh(&vscsi->intr_lock);
 	new_state = vscsi->new_state;
@@ -471,30 +468,12 @@ static void ibmvscsis_disconnect(struct
 			vscsi->state = new_state;
 		break;
 
-	/*
-	 * If this is a transition into an error state.
-	 * a client is attempting to establish a connection
-	 * and has violated the RPA protocol.
-	 * There can be nothing pending on the adapter although
-	 * there can be requests in the command queue.
-	 */
 	case WAIT_ENABLED:
-	case PART_UP_WAIT_ENAB:
 		switch (new_state) {
+		/* should never happen */
 		case ERR_DISCONNECT:
-			vscsi->flags |= RESPONSE_Q_DOWN;
-			vscsi->state = new_state;
-			vscsi->flags &= ~(SCHEDULE_DISCONNECT |
-					  DISCONNECT_SCHEDULED);
-			ibmvscsis_free_command_q(vscsi);
-			break;
 		case ERR_DISCONNECT_RECONNECT:
-			ibmvscsis_reset_queue(vscsi, WAIT_ENABLED);
-			break;
-
-		/* should never happen */
 		case WAIT_IDLE:
-			rc = ERROR;
 			dev_err(&vscsi->dev, "disconnect: invalid state %d for WAIT_IDLE\n",
 				vscsi->state);
 			break;
@@ -631,7 +610,6 @@ static void ibmvscsis_post_disconnect(st
 			break;
 
 		case WAIT_ENABLED:
-		case PART_UP_WAIT_ENAB:
 		case WAIT_IDLE:
 		case WAIT_CONNECTION:
 		case CONNECTED:
@@ -676,7 +654,6 @@ static long ibmvscsis_handle_init_compl_
 	case SRP_PROCESSING:
 	case CONNECTED:
 	case WAIT_ENABLED:
-	case PART_UP_WAIT_ENAB:
 	default:
 		rc = ERROR;
 		dev_err(&vscsi->dev, "init_msg: invalid state %d to get init compl msg\n",
@@ -699,10 +676,6 @@ static long ibmvscsis_handle_init_msg(st
 	long rc = ADAPT_SUCCESS;
 
 	switch (vscsi->state) {
-	case WAIT_ENABLED:
-		vscsi->state = PART_UP_WAIT_ENAB;
-		break;
-
 	case WAIT_CONNECTION:
 		rc = ibmvscsis_send_init_message(vscsi, INIT_COMPLETE_MSG);
 		switch (rc) {
@@ -738,7 +711,7 @@ static long ibmvscsis_handle_init_msg(st
 	case UNCONFIGURING:
 		break;
 
-	case PART_UP_WAIT_ENAB:
+	case WAIT_ENABLED:
 	case CONNECTED:
 	case SRP_PROCESSING:
 	case WAIT_IDLE:
@@ -801,11 +774,10 @@ static long ibmvscsis_init_msg(struct sc
 /**
  * ibmvscsis_establish_new_q() - Establish new CRQ queue
  * @vscsi:	Pointer to our adapter structure
- * @new_state:	New state being established after resetting the queue
  *
  * Must be called with interrupt lock held.
  */
-static long ibmvscsis_establish_new_q(struct scsi_info *vscsi, uint new_state)
+static long ibmvscsis_establish_new_q(struct scsi_info *vscsi)
 {
 	long rc = ADAPT_SUCCESS;
 	uint format;
@@ -817,19 +789,19 @@ static long ibmvscsis_establish_new_q(st
 
 	rc = vio_enable_interrupts(vscsi->dma_dev);
 	if (rc) {
-		pr_warn("reset_queue: failed to enable interrupts, rc %ld\n",
+		pr_warn("establish_new_q: failed to enable interrupts, rc %ld\n",
 			rc);
 		return rc;
 	}
 
 	rc = ibmvscsis_check_init_msg(vscsi, &format);
 	if (rc) {
-		dev_err(&vscsi->dev, "reset_queue: check_init_msg failed, rc %ld\n",
+		dev_err(&vscsi->dev, "establish_new_q: check_init_msg failed, rc %ld\n",
 			rc);
 		return rc;
 	}
 
-	if (format == UNUSED_FORMAT && new_state == WAIT_CONNECTION) {
+	if (format == UNUSED_FORMAT) {
 		rc = ibmvscsis_send_init_message(vscsi, INIT_MSG);
 		switch (rc) {
 		case H_SUCCESS:
@@ -847,6 +819,8 @@ static long ibmvscsis_establish_new_q(st
 			rc = H_HARDWARE;
 			break;
 		}
+	} else if (format == INIT_MSG) {
+		rc = ibmvscsis_handle_init_msg(vscsi);
 	}
 
 	return rc;
@@ -855,7 +829,6 @@ static long ibmvscsis_establish_new_q(st
 /**
  * ibmvscsis_reset_queue() - Reset CRQ Queue
  * @vscsi:	Pointer to our adapter structure
- * @new_state:	New state to establish after resetting the queue
  *
  * This function calls h_free_q and then calls h_reg_q and does all
  * of the bookkeeping to get us back to where we can communicate.
@@ -872,7 +845,7 @@ static long ibmvscsis_establish_new_q(st
  * EXECUTION ENVIRONMENT:
  *	Process environment, called with interrupt lock held
  */
-static void ibmvscsis_reset_queue(struct scsi_info *vscsi, uint new_state)
+static void ibmvscsis_reset_queue(struct scsi_info *vscsi)
 {
 	int bytes;
 	long rc = ADAPT_SUCCESS;
@@ -885,19 +858,18 @@ static void ibmvscsis_reset_queue(struct
 		vscsi->rsp_q_timer.timer_pops = 0;
 		vscsi->debit = 0;
 		vscsi->credit = 0;
-		vscsi->state = new_state;
+		vscsi->state = WAIT_CONNECTION;
 		vio_enable_interrupts(vscsi->dma_dev);
 	} else {
 		rc = ibmvscsis_free_command_q(vscsi);
 		if (rc == ADAPT_SUCCESS) {
-			vscsi->state = new_state;
+			vscsi->state = WAIT_CONNECTION;
 
 			bytes = vscsi->cmd_q.size * PAGE_SIZE;
 			rc = h_reg_crq(vscsi->dds.unit_id,
 				       vscsi->cmd_q.crq_token, bytes);
 			if (rc == H_CLOSED || rc == H_SUCCESS) {
-				rc = ibmvscsis_establish_new_q(vscsi,
-							       new_state);
+				rc = ibmvscsis_establish_new_q(vscsi);
 			}
 
 			if (rc != ADAPT_SUCCESS) {
@@ -1016,10 +988,6 @@ static long ibmvscsis_trans_event(struct
 						   TRANS_EVENT));
 			break;
 
-		case PART_UP_WAIT_ENAB:
-			vscsi->state = WAIT_ENABLED;
-			break;
-
 		case SRP_PROCESSING:
 			if ((vscsi->debit > 0) ||
 			    !list_empty(&vscsi->schedule_q) ||
@@ -1220,15 +1188,18 @@ static void ibmvscsis_adapter_idle(struc
 
 	switch (vscsi->state) {
 	case ERR_DISCONNECT_RECONNECT:
-		ibmvscsis_reset_queue(vscsi, WAIT_CONNECTION);
+		ibmvscsis_reset_queue(vscsi);
 		pr_debug("adapter_idle, disc_rec: flags 0x%x\n", vscsi->flags);
 		break;
 
 	case ERR_DISCONNECT:
 		ibmvscsis_free_command_q(vscsi);
-		vscsi->flags &= ~DISCONNECT_SCHEDULED;
+		vscsi->flags &= ~(SCHEDULE_DISCONNECT | DISCONNECT_SCHEDULED);
 		vscsi->flags |= RESPONSE_Q_DOWN;
-		vscsi->state = ERR_DISCONNECTED;
+		if (vscsi->tport.enabled)
+			vscsi->state = ERR_DISCONNECTED;
+		else
+			vscsi->state = WAIT_ENABLED;
 		pr_debug("adapter_idle, disc: flags 0x%x, state 0x%hx\n",
 			 vscsi->flags, vscsi->state);
 		break;
@@ -1773,8 +1744,8 @@ static void ibmvscsis_send_messages(stru
 					be64_to_cpu(msg_hi),
 					be64_to_cpu(cmd->rsp.tag));
 
-			pr_debug("send_messages: tag 0x%llx, rc %ld\n",
-				 be64_to_cpu(cmd->rsp.tag), rc);
+			pr_debug("send_messages: cmd %p, tag 0x%llx, rc %ld\n",
+				 cmd, be64_to_cpu(cmd->rsp.tag), rc);
 
 			/* if all ok free up the command element resources */
 			if (rc == H_SUCCESS) {
@@ -2788,36 +2759,6 @@ static irqreturn_t ibmvscsis_interrupt(i
 }
 
 /**
- * ibmvscsis_check_q() - Helper function to Check Init Message Valid
- * @vscsi:	Pointer to our adapter structure
- *
- * Checks if a initialize message was queued by the initiatior
- * while the timing window was open.  This function is called from
- * probe after the CRQ is created and interrupts are enabled.
- * It would only be used by adapters who wait for some event before
- * completing the init handshake with the client.  For ibmvscsi, this
- * event is waiting for the port to be enabled.
- *
- * EXECUTION ENVIRONMENT:
- *	Process level only, interrupt lock held
- */
-static long ibmvscsis_check_q(struct scsi_info *vscsi)
-{
-	uint format;
-	long rc;
-
-	rc = ibmvscsis_check_init_msg(vscsi, &format);
-	if (rc)
-		ibmvscsis_post_disconnect(vscsi, ERR_DISCONNECT_RECONNECT, 0);
-	else if (format == UNUSED_FORMAT)
-		vscsi->state = WAIT_ENABLED;
-	else
-		vscsi->state = PART_UP_WAIT_ENAB;
-
-	return rc;
-}
-
-/**
  * ibmvscsis_enable_change_state() - Set new state based on enabled status
  * @vscsi:	Pointer to our adapter structure
  *
@@ -2828,77 +2769,19 @@ static long ibmvscsis_check_q(struct scs
  */
 static long ibmvscsis_enable_change_state(struct scsi_info *vscsi)
 {
+	int bytes;
 	long rc = ADAPT_SUCCESS;
 
-handle_state_change:
-	switch (vscsi->state) {
-	case WAIT_ENABLED:
-		rc = ibmvscsis_send_init_message(vscsi, INIT_MSG);
-		switch (rc) {
-		case H_SUCCESS:
-		case H_DROPPED:
-		case H_CLOSED:
-			vscsi->state =  WAIT_CONNECTION;
-			rc = ADAPT_SUCCESS;
-			break;
-
-		case H_PARAMETER:
-			break;
-
-		case H_HARDWARE:
-			break;
-
-		default:
-			vscsi->state = UNDEFINED;
-			rc = H_HARDWARE;
-			break;
-		}
-		break;
-	case PART_UP_WAIT_ENAB:
-		rc = ibmvscsis_send_init_message(vscsi, INIT_COMPLETE_MSG);
-		switch (rc) {
-		case H_SUCCESS:
-			vscsi->state = CONNECTED;
-			rc = ADAPT_SUCCESS;
-			break;
-
-		case H_DROPPED:
-		case H_CLOSED:
-			vscsi->state = WAIT_ENABLED;
-			goto handle_state_change;
-
-		case H_PARAMETER:
-			break;
-
-		case H_HARDWARE:
-			break;
-
-		default:
-			rc = H_HARDWARE;
-			break;
-		}
-		break;
-
-	case WAIT_CONNECTION:
-	case WAIT_IDLE:
-	case SRP_PROCESSING:
-	case CONNECTED:
-		rc = ADAPT_SUCCESS;
-		break;
-		/* should not be able to get here */
-	case UNCONFIGURING:
-		rc = ERROR;
-		vscsi->state = UNDEFINED;
-		break;
+	bytes = vscsi->cmd_q.size * PAGE_SIZE;
+	rc = h_reg_crq(vscsi->dds.unit_id, vscsi->cmd_q.crq_token, bytes);
+	if (rc == H_CLOSED || rc == H_SUCCESS) {
+		vscsi->state = WAIT_CONNECTION;
+		rc = ibmvscsis_establish_new_q(vscsi);
+	}
 
-		/* driver should never allow this to happen */
-	case ERR_DISCONNECT:
-	case ERR_DISCONNECT_RECONNECT:
-	default:
-		dev_err(&vscsi->dev, "in invalid state %d during enable_change_state\n",
-			vscsi->state);
-		rc = ADAPT_SUCCESS;
-		break;
+	if (rc != ADAPT_SUCCESS) {
+		vscsi->state = ERR_DISCONNECTED;
+		vscsi->flags |= RESPONSE_Q_DOWN;
 	}
 
 	return rc;
@@ -2918,7 +2801,6 @@ handle_state_change:
  */
 static long ibmvscsis_create_command_q(struct scsi_info *vscsi, int num_cmds)
 {
-	long rc = 0;
 	int pages;
 	struct vio_dev *vdev = vscsi->dma_dev;
 
@@ -2942,22 +2824,7 @@ static long ibmvscsis_create_command_q(s
 		return -ENOMEM;
 	}
 
-	rc =  h_reg_crq(vscsi->dds.unit_id, vscsi->cmd_q.crq_token, PAGE_SIZE);
-	if (rc) {
-		if (rc == H_CLOSED) {
-			vscsi->state = WAIT_ENABLED;
-			rc = 0;
-		} else {
-			dma_unmap_single(&vdev->dev, vscsi->cmd_q.crq_token,
-					 PAGE_SIZE, DMA_BIDIRECTIONAL);
-			free_page((unsigned long)vscsi->cmd_q.base_addr);
-			rc = -ENODEV;
-		}
-	} else {
-		vscsi->state = WAIT_ENABLED;
-	}
-
-	return rc;
+	return 0;
 }
 
 /**
@@ -3491,31 +3358,12 @@ static int ibmvscsis_probe(struct vio_de
 		goto destroy_WQ;
 	}
 
-	spin_lock_bh(&vscsi->intr_lock);
-	vio_enable_interrupts(vdev);
-	if (rc) {
-		dev_err(&vscsi->dev, "enabling interrupts failed, rc %d\n", rc);
-		rc = -ENODEV;
-		spin_unlock_bh(&vscsi->intr_lock);
-		goto free_irq;
-	}
-
-	if (ibmvscsis_check_q(vscsi)) {
-		rc = ERROR;
-		dev_err(&vscsi->dev, "probe: check_q failed, rc %d\n", rc);
-		spin_unlock_bh(&vscsi->intr_lock);
-		goto disable_interrupt;
-	}
-	spin_unlock_bh(&vscsi->intr_lock);
+	vscsi->state = WAIT_ENABLED;
 
 	dev_set_drvdata(&vdev->dev, vscsi);
 
 	return 0;
 
-disable_interrupt:
-	vio_disable_interrupts(vdev);
-free_irq:
-	free_irq(vdev->irq, vscsi);
 destroy_WQ:
 	destroy_workqueue(vscsi->work_q);
 unmap_buf:
@@ -3909,18 +3757,22 @@ static ssize_t ibmvscsis_tpg_enable_stor
 	}
 
 	if (tmp) {
-		tport->enabled = true;
 		spin_lock_bh(&vscsi->intr_lock);
+		tport->enabled = true;
 		lrc = ibmvscsis_enable_change_state(vscsi);
 		if (lrc)
 			pr_err("enable_change_state failed, rc %ld state %d\n",
 			       lrc, vscsi->state);
 		spin_unlock_bh(&vscsi->intr_lock);
 	} else {
+		spin_lock_bh(&vscsi->intr_lock);
 		tport->enabled = false;
+		/* This simulates the server going down */
+		ibmvscsis_post_disconnect(vscsi, ERR_DISCONNECT, 0);
+		spin_unlock_bh(&vscsi->intr_lock);
 	}
 
-	pr_debug("tpg_enable_store, state %d\n", vscsi->state);
+	pr_debug("tpg_enable_store, tmp %ld, state %d\n", tmp, vscsi->state);
 
 	return count;
 }
--- a/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
+++ b/drivers/scsi/ibmvscsi_tgt/ibmvscsi_tgt.h
@@ -204,8 +204,6 @@ struct scsi_info {
 	struct list_head waiting_rsp;
 #define NO_QUEUE                    0x00
 #define WAIT_ENABLED                0X01
-	/* driver has received an initialize command */
-#define PART_UP_WAIT_ENAB           0x02
 #define WAIT_CONNECTION             0x04
 	/* have established a connection */
 #define CONNECTED                   0x08

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


#1605220

FromShuah Khan <shuahkh@osg.samsung.com>
Date2017-03-21 01:30 +0100
Message-ID<tnfQt-40s-5@gated-at.bofh.it>
In reply to#1605056
On 03/20/2017 11:50 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.9.17 release.
> There are 93 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
> 
> Responses should be made by Wed Mar 22 17:47:16 UTC 2017.
> Anything received after that time might be too late.
> 
> The whole patch series can be found in one patch at:
> 	kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.17-rc1.gz
> or in the git tree and branch at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
> and the diffstat can be found below.
> 
> thanks,
> 
> greg k-h
> 

Compiled and booted on my test system. No dmesg regressions.

thanks,
-- Shuah

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


#1605259

FromGuenter Roeck <linux@roeck-us.net>
Date2017-03-21 03:20 +0100
Message-ID<tnhyW-5bM-11@gated-at.bofh.it>
In reply to#1605056
On 03/20/2017 10:50 AM, Greg Kroah-Hartman wrote:
> This is the start of the stable review cycle for the 4.9.17 release.
> There are 93 patches in this series, all will be posted as a response
> to this one.  If anyone has any issues with these being applied, please
> let me know.
>
> Responses should be made by Wed Mar 22 17:47:16 UTC 2017.
> Anything received after that time might be too late.
>

Build results:
	total: 149 pass: 149 fail: 0
Qemu test results:
	total: 122 pass: 122 fail: 0

Details are available at http://kerneltests.org/builders.

Guenter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web