Skip to content

Commit a06bc2f

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three minor fixes: two obvious ones in drivers and a fix to the SG_IO path to correctly return status on error" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: aic7xxx: fix EISA support Revert "scsi: fcoe: clear FC_RP_STARTED flags when receiving a LOGO" scsi: core: set result when the command cannot be dispatched
2 parents 38a2ca2 + 144ec97 commit a06bc2f

File tree

6 files changed

+12
-8
lines changed

6 files changed

+12
-8
lines changed

drivers/scsi/aic7xxx/aic7770_osm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ aic7770_probe(struct device *dev)
9191
ahc = ahc_alloc(&aic7xxx_driver_template, name);
9292
if (ahc == NULL)
9393
return (ENOMEM);
94+
ahc->dev = dev;
9495
error = aic7770_config(ahc, aic7770_ident_table + edev->id.driver_data,
9596
eisaBase);
9697
if (error != 0) {

drivers/scsi/aic7xxx/aic7xxx.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,7 @@ struct ahc_softc {
943943
* Platform specific device information.
944944
*/
945945
ahc_dev_softc_t dev_softc;
946+
struct device *dev;
946947

947948
/*
948949
* Bus specific device information.

drivers/scsi/aic7xxx/aic7xxx_osm.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -860,8 +860,8 @@ int
860860
ahc_dmamem_alloc(struct ahc_softc *ahc, bus_dma_tag_t dmat, void** vaddr,
861861
int flags, bus_dmamap_t *mapp)
862862
{
863-
*vaddr = pci_alloc_consistent(ahc->dev_softc,
864-
dmat->maxsize, mapp);
863+
/* XXX: check if we really need the GFP_ATOMIC and unwind this mess! */
864+
*vaddr = dma_alloc_coherent(ahc->dev, dmat->maxsize, mapp, GFP_ATOMIC);
865865
if (*vaddr == NULL)
866866
return ENOMEM;
867867
return 0;
@@ -871,8 +871,7 @@ void
871871
ahc_dmamem_free(struct ahc_softc *ahc, bus_dma_tag_t dmat,
872872
void* vaddr, bus_dmamap_t map)
873873
{
874-
pci_free_consistent(ahc->dev_softc, dmat->maxsize,
875-
vaddr, map);
874+
dma_free_coherent(ahc->dev, dmat->maxsize, vaddr, map);
876875
}
877876

878877
int
@@ -1123,8 +1122,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, struct scsi_host_template *templa
11231122

11241123
host->transportt = ahc_linux_transport_template;
11251124

1126-
retval = scsi_add_host(host,
1127-
(ahc->dev_softc ? &ahc->dev_softc->dev : NULL));
1125+
retval = scsi_add_host(host, ahc->dev);
11281126
if (retval) {
11291127
printk(KERN_WARNING "aic7xxx: scsi_add_host failed\n");
11301128
scsi_host_put(host);

drivers/scsi/aic7xxx/aic7xxx_osm_pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
250250
}
251251
}
252252
ahc->dev_softc = pci;
253+
ahc->dev = &pci->dev;
253254
error = ahc_pci_config(ahc, entry);
254255
if (error != 0) {
255256
ahc_free(ahc);

drivers/scsi/libfc/fc_rport.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,6 @@ static void fc_rport_recv_logo_req(struct fc_lport *lport, struct fc_frame *fp)
21622162
FC_RPORT_DBG(rdata, "Received LOGO request while in state %s\n",
21632163
fc_rport_state(rdata));
21642164

2165-
rdata->flags &= ~FC_RP_STARTED;
21662165
fc_rport_enter_delete(rdata, RPORT_EV_STOP);
21672166
mutex_unlock(&rdata->rp_mutex);
21682167
kref_put(&rdata->kref, fc_rport_destroy);

drivers/scsi/scsi_lib.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1706,8 +1706,12 @@ static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
17061706
ret = BLK_STS_DEV_RESOURCE;
17071707
break;
17081708
default:
1709+
if (unlikely(!scsi_device_online(sdev)))
1710+
scsi_req(req)->result = DID_NO_CONNECT << 16;
1711+
else
1712+
scsi_req(req)->result = DID_ERROR << 16;
17091713
/*
1710-
* Make sure to release all allocated ressources when
1714+
* Make sure to release all allocated resources when
17111715
* we hit an error, as we will never see this command
17121716
* again.
17131717
*/

0 commit comments

Comments
 (0)