Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp723023yba; Sat, 20 Apr 2019 12:01:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxOwe7gL41Y96jA7bdOWX0/Vk4nS55Fd7+PxVyZD5IddTH8hM906lR3JtPpJK7CfVBDkBDe X-Received: by 2002:a62:1194:: with SMTP id 20mr11294716pfr.224.1555786890771; Sat, 20 Apr 2019 12:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555786890; cv=none; d=google.com; s=arc-20160816; b=oMRKPB43gQgBc3wDvc5uUPHkGIwJYOsv4YlrDTKgXwWo0G6dBrSs6UJkkjvEdbZ2iv S8fOTiTcTRHgngYP7YMwG2OTioQFn5PtiTDCfDohzF7kQ2Y6bygR9dcLe4MeRShzs4Mi AY1AqFqaXhKRChPdKAraDDI+Z1ItN0eiNEqGd/87Fu+LAhm/WTA3IVW1KabPHPFhBBR6 8mfHhnOIql4buVyZ1Pil83517eQr9H39ZK3tFUFCJ0uGPupSndjcOe4qpYLfkNatAxmv o1NMD+k2xCg6jes/6Hfdk+r9zDbB6zYyMvbxPet7PHOteEw1nWfLKDEPb7X+9wT097VF al5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :date:cc:to:from:subject:message-id:dkim-signature:dkim-signature; bh=12O6CqhvbZijXXHUUMWGk6aPJgDtYWDrX+Ok6x1xrSI=; b=mPJvJv914+wC0SMqIjkhaJCaOX/cvXqfTzElDgrrhu5FnyOzgthCc7/bwvk/qyFA5a FdbrpHD5qHpFPoaTgkcNPsBkSqX2diDJpNuPptYZJk7DgOwLQGabRzN83HHJJbFMnT/U /1E+BKqDCl4rWD+eEDRhtOJL598ejnwQrjku/O23AvmVCZ72IHWcyjsA/XOMP4YKDiEZ mHw74k9+uzoqqntBE120AnE+vBXJRrEIHa6HyhxJyydin8JuEQh7yR0YcZNHWQx9SiEd wzX5jyTCnw0MRnD7UjfuN6tVizFg9IG5fC+6145zWfpwRXk4ILhfAtmGpJtOPvYdCCSG ne4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=eiZm1PcY; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=wtxx1nV7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o6si2591965pgn.407.2019.04.20.12.01.15; Sat, 20 Apr 2019 12:01:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=eiZm1PcY; dkim=fail header.i=@hansenpartnership.com header.s=20151216 header.b=wtxx1nV7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726728AbfDTSz7 (ORCPT + 99 others); Sat, 20 Apr 2019 14:55:59 -0400 Received: from bedivere.hansenpartnership.com ([66.63.167.143]:54636 "EHLO bedivere.hansenpartnership.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726251AbfDTSz7 (ORCPT ); Sat, 20 Apr 2019 14:55:59 -0400 Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id 7F2FD8EE0CC; Sat, 20 Apr 2019 11:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1555786558; bh=7ZSLBPCeXo+8E9FosbVGQAaHgh6pbrSM286HihIARBY=; h=Subject:From:To:Cc:Date:From; b=eiZm1PcYI7lv74g8rMdvtcYZC4W4Fm42qvUf98IgNmjQCq8noS4sWCMb3vKqhRJnt NQAYjGmPL710F4vCjThTHLoZbnr03tkwln1iCndyls9eM10UqsCiAUt4GQ5UexipHp ZUy2ZDR5tbfAAQtwLFCT2d/9mL5/oEX0jvV4cRd8= Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hnDopo7e8kdL; Sat, 20 Apr 2019 11:55:57 -0700 (PDT) Received: from jarvis (host109-155-185-12.range109-155.btcentralplus.com [109.155.185.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id C6B1D8EE0AB; Sat, 20 Apr 2019 11:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=hansenpartnership.com; s=20151216; t=1555786557; bh=7ZSLBPCeXo+8E9FosbVGQAaHgh6pbrSM286HihIARBY=; h=Subject:From:To:Cc:Date:From; b=wtxx1nV7ZiP/cDz3EOF/u95zjWL36zGj+HfTccvQls1gqqNAY+hv8F59S2FdRES0L hWj08jiUtQX17Q8Bm1+OwtOXrgt0jsiZplV5HCi4HgAXi6NgaA5pTB9VJ0gEqQvXPT ydpHwD1CA6YTcMkaVp0NomyjoZE7pnPKgjuu/W7k= Message-ID: <1555786552.2830.3.camel@HansenPartnership.com> Subject: [GIT PULL] SCSI fixes for 5.1-rc5 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Sat, 20 Apr 2019 19:55:52 +0100 Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Three minor fixes: two obvious ones in drivers and a fix to the SG_IO path to correctly return status on error. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Christoph Hellwig (1): scsi: aic7xxx: fix EISA support Jaesoo Lee (1): scsi: core: set result when the command cannot be dispatched Saurav Kashyap (1): Revert "scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO" And the diffstat: drivers/scsi/aic7xxx/aic7770_osm.c | 1 + drivers/scsi/aic7xxx/aic7xxx.h | 1 + drivers/scsi/aic7xxx/aic7xxx_osm.c | 10 ++++------ drivers/scsi/aic7xxx/aic7xxx_osm_pci.c | 1 + drivers/scsi/libfc/fc_rport.c | 1 - drivers/scsi/scsi_lib.c | 6 +++++- 6 files changed, 12 insertions(+), 8 deletions(-) With full diff below. James --- diff --git a/drivers/scsi/aic7xxx/aic7770_osm.c b/drivers/scsi/aic7xxx/aic7770_osm.c index 3d401d02c019..bdd177e3d762 100644 --- a/drivers/scsi/aic7xxx/aic7770_osm.c +++ b/drivers/scsi/aic7xxx/aic7770_osm.c @@ -91,6 +91,7 @@ aic7770_probe(struct device *dev) ahc = ahc_alloc(&aic7xxx_driver_template, name); if (ahc == NULL) return (ENOMEM); + ahc->dev = dev; error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data, eisaBase); if (error != 0) { diff --git a/drivers/scsi/aic7xxx/aic7xxx.h b/drivers/scsi/aic7xxx/aic7xxx.h index 5614921b4041..88b90f9806c9 100644 --- a/drivers/scsi/aic7xxx/aic7xxx.h +++ b/drivers/scsi/aic7xxx/aic7xxx.h @@ -943,6 +943,7 @@ struct ahc_softc { * Platform specific device information. */ ahc_dev_softc_t dev_softc; + struct device *dev; /* * Bus specific device information. diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c index 3c9c17450bb3..d5c4a0d23706 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c @@ -860,8 +860,8 @@ int ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr, int flags, bus_dmamap_t *mapp) { - *vaddr = pci_alloc_consistent(ahc->dev_softc, - dmat->maxsize, mapp); + /* XXX: check if we really need the GFP_ATOMIC and unwind this mess! */ + *vaddr = dma_alloc_coherent(ahc->dev, dmat->maxsize, mapp, GFP_ATOMIC); if (*vaddr == NULL) return ENOMEM; return 0; @@ -871,8 +871,7 @@ void ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat, void* vaddr, bus_dmamap_t map) { - pci_free_consistent(ahc->dev_softc, dmat->maxsize, - vaddr, map); + dma_free_coherent(ahc->dev, dmat->maxsize, vaddr, map); } int @@ -1123,8 +1122,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa host->transportt = ahc_linux_transport_template; - retval = scsi_add_host(host, - (ahc->dev_softc ? &ahc->dev_softc->dev : NULL)); + retval = scsi_add_host(host, ahc->dev); if (retval) { printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n"); scsi_host_put(host); diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c index 0fc14dac7070..717d8d1082ce 100644 --- a/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c +++ b/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c @@ -250,6 +250,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } ahc->dev_softc = pci; + ahc->dev = &pci->dev; error = ahc_pci_config(ahc, entry); if (error != 0) { ahc_free(ahc); diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c index dfba4921b265..5bf61431434b 100644 --- a/drivers/scsi/libfc/fc_rport.c +++ b/drivers/scsi/libfc/fc_rport.c @@ -2162,7 +2162,6 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp) FC_RPORT_DBG(rdata, "Received LOGO request while in state %s\n", fc_rport_state(rdata)); - rdata->flags &= ~FC_RP_STARTED; fc_rport_enter_delete(rdata, RPORT_EV_STOP); mutex_unlock(&rdata->rp_mutex); kref_put(&rdata->kref, fc_rport_destroy); diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 601b9f1de267..07dfc17d4824 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1706,8 +1706,12 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx, ret = BLK_STS_DEV_RESOURCE; break; default: + if (unlikely(!scsi_device_online(sdev))) + scsi_req(req)->result = DID_NO_CONNECT << 16; + else + scsi_req(req)->result = DID_ERROR << 16; /* - * Make sure to release all allocated ressources when + * Make sure to release all allocated resources when * we hit an error, as we will never see this command * again. */