]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Apr 2021 12:14:48 +0000 (14:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 18 Apr 2021 12:14:48 +0000 (14:14 +0200)
added patches:
net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch
scsi-libsas-reset-num_scatter-if-libata-marks-qc-as-nodata.patch

queue-4.4/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch [new file with mode: 0644]
queue-4.4/scsi-libsas-reset-num_scatter-if-libata-marks-qc-as-nodata.patch [new file with mode: 0644]
queue-4.4/series

diff --git a/queue-4.4/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch b/queue-4.4/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch
new file mode 100644 (file)
index 0000000..c3353de
--- /dev/null
@@ -0,0 +1,39 @@
+From 31457db3750c0b0ed229d836f2609fdb8a5b790e Mon Sep 17 00:00:00 2001
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Date: Sun, 11 Apr 2021 11:02:08 +0200
+Subject: net: davicom: Fix regulator not turned off on failed probe
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+commit 31457db3750c0b0ed229d836f2609fdb8a5b790e upstream.
+
+When the probe fails, we must disable the regulator that was previously
+enabled.
+
+This patch is a follow-up to commit ac88c531a5b3
+("net: davicom: Fix regulator not turned off on failed probe") which missed
+one case.
+
+Fixes: 7994fe55a4a2 ("dm9000: Add regulator and reset support to dm9000")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/davicom/dm9000.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/davicom/dm9000.c
++++ b/drivers/net/ethernet/davicom/dm9000.c
+@@ -1484,8 +1484,10 @@ dm9000_probe(struct platform_device *pde
+       /* Init network device */
+       ndev = alloc_etherdev(sizeof(struct board_info));
+-      if (!ndev)
+-              return -ENOMEM;
++      if (!ndev) {
++              ret = -ENOMEM;
++              goto out_regulator_disable;
++      }
+       SET_NETDEV_DEV(ndev, &pdev->dev);
diff --git a/queue-4.4/scsi-libsas-reset-num_scatter-if-libata-marks-qc-as-nodata.patch b/queue-4.4/scsi-libsas-reset-num_scatter-if-libata-marks-qc-as-nodata.patch
new file mode 100644 (file)
index 0000000..51e1e38
--- /dev/null
@@ -0,0 +1,70 @@
+From 176ddd89171ddcf661862d90c5d257877f7326d6 Mon Sep 17 00:00:00 2001
+From: Jolly Shah <jollys@google.com>
+Date: Thu, 18 Mar 2021 15:56:32 -0700
+Subject: scsi: libsas: Reset num_scatter if libata marks qc as NODATA
+
+From: Jolly Shah <jollys@google.com>
+
+commit 176ddd89171ddcf661862d90c5d257877f7326d6 upstream.
+
+When the cache_type for the SCSI device is changed, the SCSI layer issues a
+MODE_SELECT command. The caching mode details are communicated via a
+request buffer associated with the SCSI command with data direction set as
+DMA_TO_DEVICE (scsi_mode_select()). When this command reaches the libata
+layer, as a part of generic initial setup, libata layer sets up the
+scatterlist for the command using the SCSI command (ata_scsi_qc_new()).
+This command is then translated by the libata layer into
+ATA_CMD_SET_FEATURES (ata_scsi_mode_select_xlat()). The libata layer treats
+this as a non-data command (ata_mselect_caching()), since it only needs an
+ATA taskfile to pass the caching on/off information to the device. It does
+not need the scatterlist that has been setup, so it does not perform
+dma_map_sg() on the scatterlist (ata_qc_issue()). Unfortunately, when this
+command reaches the libsas layer (sas_ata_qc_issue()), libsas layer sees it
+as a non-data command with a scatterlist. It cannot extract the correct DMA
+length since the scatterlist has not been mapped with dma_map_sg() for a
+DMA operation. When this partially constructed SAS task reaches pm80xx
+LLDD, it results in the following warning:
+
+"pm80xx_chip_sata_req 6058: The sg list address
+start_addr=0x0000000000000000 data_len=0x0end_addr_high=0xffffffff
+end_addr_low=0xffffffff has crossed 4G boundary"
+
+Update libsas to handle ATA non-data commands separately so num_scatter and
+total_xfer_len remain 0.
+
+Link: https://lore.kernel.org/r/20210318225632.2481291-1-jollys@google.com
+Fixes: 53de092f47ff ("scsi: libsas: Set data_dir as DMA_NONE if libata marks qc as NODATA")
+Tested-by: Luo Jiaxing <luojiaxing@huawei.com>
+Reviewed-by: John Garry <john.garry@huawei.com>
+Signed-off-by: Jolly Shah <jollys@google.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/scsi/libsas/sas_ata.c |    9 ++++-----
+ 1 file changed, 4 insertions(+), 5 deletions(-)
+
+--- a/drivers/scsi/libsas/sas_ata.c
++++ b/drivers/scsi/libsas/sas_ata.c
+@@ -216,18 +216,17 @@ static unsigned int sas_ata_qc_issue(str
+               memcpy(task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len);
+               task->total_xfer_len = qc->nbytes;
+               task->num_scatter = qc->n_elem;
++              task->data_dir = qc->dma_dir;
++      } else if (qc->tf.protocol == ATA_PROT_NODATA) {
++              task->data_dir = DMA_NONE;
+       } else {
+               for_each_sg(qc->sg, sg, qc->n_elem, si)
+                       xfer += sg_dma_len(sg);
+               task->total_xfer_len = xfer;
+               task->num_scatter = si;
+-      }
+-
+-      if (qc->tf.protocol == ATA_PROT_NODATA)
+-              task->data_dir = DMA_NONE;
+-      else
+               task->data_dir = qc->dma_dir;
++      }
+       task->scatter = qc->sg;
+       task->ata_task.retry_count = 1;
+       task->task_state_flags = SAS_TASK_STATE_PENDING;
index 324ad780c7625eb2f888e22797e3a203feefbcfd..c712fa9e725279833311d64c7dad30692137f949 100644 (file)
@@ -17,3 +17,5 @@ pcnet32-use-pci_resource_len-to-validate-pci-resourc.patch
 net-rds-avoid-potential-use-after-free-in-rds_send_r.patch
 net-tipc-fix-spelling-errors-in-net-tipc-module.patch
 input-i8042-fix-pegatron-c15b-id-entry.patch
+scsi-libsas-reset-num_scatter-if-libata-marks-qc-as-nodata.patch
+net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch