From: Greg Kroah-Hartman Date: Sun, 18 Apr 2021 12:14:48 +0000 (+0200) Subject: 4.4-stable patches X-Git-Tag: v5.4.114~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=190cc74cb0aa5f6878ebe89bd1f0b1b6f84eca18;p=thirdparty%2Fkernel%2Fstable-queue.git 4.4-stable patches 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 --- 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 index 00000000000..c3353defcec --- /dev/null +++ b/queue-4.4/net-davicom-fix-regulator-not-turned-off-on-failed-probe.patch @@ -0,0 +1,39 @@ +From 31457db3750c0b0ed229d836f2609fdb8a5b790e Mon Sep 17 00:00:00 2001 +From: Christophe JAILLET +Date: Sun, 11 Apr 2021 11:02:08 +0200 +Subject: net: davicom: Fix regulator not turned off on failed probe + +From: Christophe JAILLET + +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 +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + 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 index 00000000000..51e1e38d527 --- /dev/null +++ b/queue-4.4/scsi-libsas-reset-num_scatter-if-libata-marks-qc-as-nodata.patch @@ -0,0 +1,70 @@ +From 176ddd89171ddcf661862d90c5d257877f7326d6 Mon Sep 17 00:00:00 2001 +From: Jolly Shah +Date: Thu, 18 Mar 2021 15:56:32 -0700 +Subject: scsi: libsas: Reset num_scatter if libata marks qc as NODATA + +From: Jolly Shah + +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 +Reviewed-by: John Garry +Signed-off-by: Jolly Shah +Signed-off-by: Martin K. Petersen +Signed-off-by: Greg Kroah-Hartman +--- + 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; diff --git a/queue-4.4/series b/queue-4.4/series index 324ad780c76..c712fa9e725 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -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