stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Tejun Heo <tj@kernel.org>,
	Hannes Reinecke <hare@suse.de>
Subject: [PATCH 4.1 45/78] Revert "libata: Implement support for sense data reporting"
Date: Fri, 11 Sep 2015 15:49:46 -0700	[thread overview]
Message-ID: <20150911224612.746419393@linuxfoundation.org> (raw)
In-Reply-To: <20150911224606.758437370@linuxfoundation.org>

4.1-stable review patch.  If anyone has any objections, please let me know.

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

From: Tejun Heo <tj@kernel.org>

commit 84ded2f8e7dda336fc2fb3570726ceb3b3b3590f upstream.

This reverts commit fe7173c206de63fc28475ee6ae42ff95c05692de.

As implemented, ACS-4 sense reporting for ATA devices bypasses error
diagnosis and handling in libata degrading EH behavior significantly.
Revert the related changes for now.

ATA_ID_COMMAND_SET_3/4 constants are not reverted as they're used by
later changes.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/ata/libata-core.c |   20 ----------
 drivers/ata/libata-eh.c   |   86 +---------------------------------------------
 include/linux/ata.h       |   16 --------
 3 files changed, 4 insertions(+), 118 deletions(-)

--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2147,24 +2147,6 @@ static int ata_dev_config_ncq(struct ata
 	return 0;
 }
 
-static void ata_dev_config_sense_reporting(struct ata_device *dev)
-{
-	unsigned int err_mask;
-
-	if (!ata_id_has_sense_reporting(dev->id))
-		return;
-
-	if (ata_id_sense_reporting_enabled(dev->id))
-		return;
-
-	err_mask = ata_dev_set_feature(dev, SETFEATURE_SENSE_DATA, 0x1);
-	if (err_mask) {
-		ata_dev_dbg(dev,
-			    "failed to enable Sense Data Reporting, Emask 0x%x\n",
-			    err_mask);
-	}
-}
-
 /**
  *	ata_dev_configure - Configure the specified ATA/ATAPI device
  *	@dev: Target device to configure
@@ -2387,7 +2369,7 @@ int ata_dev_configure(struct ata_device
 					dev->devslp_timing[i] = sata_setting[j];
 				}
 		}
-		ata_dev_config_sense_reporting(dev);
+
 		dev->cdb_len = 16;
 	}
 
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1630,70 +1630,6 @@ unsigned int atapi_eh_tur(struct ata_dev
 }
 
 /**
- *	ata_eh_request_sense - perform REQUEST_SENSE_DATA_EXT
- *	@dev: device to perform REQUEST_SENSE_SENSE_DATA_EXT to
- *	@sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long)
- *	@dfl_sense_key: default sense key to use
- *
- *	Perform REQUEST_SENSE_DATA_EXT after the device reported CHECK
- *	SENSE.  This function is EH helper.
- *
- *	LOCKING:
- *	Kernel thread context (may sleep).
- *
- *	RETURNS:
- *	encoded sense data on success, 0 on failure or if sense data
- *	is not available.
- */
-static u32 ata_eh_request_sense(struct ata_queued_cmd *qc,
-				struct scsi_cmnd *cmd)
-{
-	struct ata_device *dev = qc->dev;
-	struct ata_taskfile tf;
-	unsigned int err_mask;
-
-	if (!cmd)
-		return 0;
-
-	DPRINTK("ATA request sense\n");
-	ata_dev_warn(dev, "request sense\n");
-	if (!ata_id_sense_reporting_enabled(dev->id)) {
-		ata_dev_warn(qc->dev, "sense data reporting disabled\n");
-		return 0;
-	}
-	ata_tf_init(dev, &tf);
-
-	tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
-	tf.flags |= ATA_TFLAG_LBA | ATA_TFLAG_LBA48;
-	tf.command = ATA_CMD_REQ_SENSE_DATA;
-	tf.protocol = ATA_PROT_NODATA;
-
-	err_mask = ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
-	/*
-	 * ACS-4 states:
-	 * The device may set the SENSE DATA AVAILABLE bit to one in the
-	 * STATUS field and clear the ERROR bit to zero in the STATUS field
-	 * to indicate that the command returned completion without an error
-	 * and the sense data described in table 306 is available.
-	 *
-	 * IOW the 'ATA_SENSE' bit might not be set even though valid
-	 * sense data is available.
-	 * So check for both.
-	 */
-	if ((tf.command & ATA_SENSE) ||
-		tf.lbah != 0 || tf.lbam != 0 || tf.lbal != 0) {
-		ata_scsi_set_sense(cmd, tf.lbah, tf.lbam, tf.lbal);
-		qc->flags |= ATA_QCFLAG_SENSE_VALID;
-		ata_dev_warn(dev, "sense data %02x/%02x/%02x\n",
-			     tf.lbah, tf.lbam, tf.lbal);
-	} else {
-		ata_dev_warn(dev, "request sense failed stat %02x emask %x\n",
-			     tf.command, err_mask);
-	}
-	return err_mask;
-}
-
-/**
  *	atapi_eh_request_sense - perform ATAPI REQUEST_SENSE
  *	@dev: device to perform REQUEST_SENSE to
  *	@sense_buf: result sense data buffer (SCSI_SENSE_BUFFERSIZE bytes long)
@@ -1896,22 +1832,7 @@ static unsigned int ata_eh_analyze_tf(st
 		return ATA_EH_RESET;
 	}
 
-	/*
-	 * Sense data reporting does not work if the
-	 * device fault bit is set.
-	 */
-	if ((stat & ATA_SENSE) && !(stat & ATA_DF) &&
-	    !(qc->flags & ATA_QCFLAG_SENSE_VALID)) {
-		if (!(qc->ap->pflags & ATA_PFLAG_FROZEN)) {
-			tmp = ata_eh_request_sense(qc, qc->scsicmd);
-			if (tmp)
-				qc->err_mask |= tmp;
-		} else {
-			ata_dev_warn(qc->dev, "sense data available but port frozen\n");
-		}
-	}
-
-	/* Set by NCQ autosense or request sense above */
+	/* Set by NCQ autosense */
 	if (qc->flags & ATA_QCFLAG_SENSE_VALID)
 		return 0;
 
@@ -2658,15 +2579,14 @@ static void ata_eh_link_report(struct at
 
 #ifdef CONFIG_ATA_VERBOSE_ERROR
 		if (res->command & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ |
-				    ATA_SENSE | ATA_ERR)) {
+				    ATA_ERR)) {
 			if (res->command & ATA_BUSY)
 				ata_dev_err(qc->dev, "status: { Busy }\n");
 			else
-				ata_dev_err(qc->dev, "status: { %s%s%s%s%s}\n",
+				ata_dev_err(qc->dev, "status: { %s%s%s%s}\n",
 				  res->command & ATA_DRDY ? "DRDY " : "",
 				  res->command & ATA_DF ? "DF " : "",
 				  res->command & ATA_DRQ ? "DRQ " : "",
-				  res->command & ATA_SENSE ? "SENSE " : "",
 				  res->command & ATA_ERR ? "ERR " : "");
 		}
 
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -385,8 +385,6 @@ enum {
 	SATA_SSP		= 0x06,	/* Software Settings Preservation */
 	SATA_DEVSLP		= 0x09,	/* Device Sleep */
 
-	SETFEATURE_SENSE_DATA = 0xC3, /* Sense Data Reporting feature */
-
 	/* feature values for SET_MAX */
 	ATA_SET_MAX_ADDR	= 0x00,
 	ATA_SET_MAX_PASSWD	= 0x01,
@@ -710,20 +708,6 @@ static inline bool ata_id_has_read_log_d
 	return id[ATA_ID_COMMAND_SET_3] & (1 << 3);
 }
 
-static inline bool ata_id_has_sense_reporting(const u16 *id)
-{
-	if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
-		return false;
-	return id[ATA_ID_COMMAND_SET_3] & (1 << 6);
-}
-
-static inline bool ata_id_sense_reporting_enabled(const u16 *id)
-{
-	if (!(id[ATA_ID_CFS_ENABLE_2] & (1 << 15)))
-		return false;
-	return id[ATA_ID_COMMAND_SET_4] & (1 << 6);
-}
-
 /**
  *	ata_id_major_version	-	get ATA level of drive
  *	@id: Identify data



  parent reply	other threads:[~2015-09-11 22:50 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-11 22:49 [PATCH 4.1 00/78] 4.1.6-stable review Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 01/78] ipc,sem: fix use after free on IPC_RMID after a task using same semaphore set exits Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 02/78] ipc/sem.c: update/correct memory barriers Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 03/78] mm/hwpoison: fix page refcount of unknown non LRU page Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 04/78] mm/hwpoison: fix fail isolate hugetlbfs page w/ refcount held Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 05/78] clk: pxa: pxa3xx: fix CKEN register access Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 08/78] rsi: Fix failure to load firmware after memory leak fix and fix the leak Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 09/78] perf: Fix fasync handling on inherited events Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 10/78] perf: Fix running time accounting Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 11/78] perf: Fix double-free of the AUX buffer Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 12/78] perf: Fix PERF_EVENT_IOC_PERIOD migration race Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 13/78] iwlwifi: pcie: fix prepare card flow Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 14/78] rtlwifi: rtl8723be: Add module parameter for MSI interrupts Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 15/78] rtlwifi: Fix NULL dereference when PCI driver used as an AP Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 16/78] x86/xen: build "Xen PV" APIC driver for domU as well Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 17/78] xen/xenbus: Dont leak memory when unmapping the ring on HVM backend Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 18/78] dm thin metadata: delete btrees when releasing metadata snapshot Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 19/78] localmodconfig: Use Kbuild files too Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 20/78] EDAC, ppc4xx: Access mci->csrows array elements properly Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 21/78] HID: hid-input: Fix accessing freed memory during device disconnect Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 22/78] HID: uclogic: fix limit in uclogic_tablet_enable() Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 23/78] drm/radeon: add new OLAND pci id Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 24/78] drm/vmwgfx: Fix execbuf locking issues Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 25/78] libfc: Fix fc_exch_recv_req() error path Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 26/78] libfc: Fix fc_fcp_cleanup_each_cmd() Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 27/78] ARM: imx6: correct i.MX6 PCIe interrupt routing Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 28/78] ARM: dts: omap243x: Fix broken pbias device creation Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 29/78] ARM: dts: dra7: " Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 30/78] ARM: dts: OMAP4: " Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 31/78] ARM: dts: OMAP5: " Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 32/78] ARM: 8385/1: VDSO: group link options Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 33/78] ARM: 8384/1: VDSO: force use of BFD linker Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 34/78] ARM: v7 setup function should invalidate L1 cache Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 35/78] ARM: invalidate L1 before enabling coherency Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 36/78] mfd: arizona: Fix initialisation of the PM runtime Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 37/78] Revert x86 sigcontext cleanups Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 38/78] regmap: regcache-rbtree: Clean new present bits on present bitmap resize Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 39/78] MIPS: Fix seccomp syscall argument for MIPS64 Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 40/78] libiscsi: Fix host busy blocking during connection teardown Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 41/78] sd: Fix maximum I/O size for BLOCK_PC requests Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 42/78] crypto: nx - respect sg limit bounds when building sg lists for SHA Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 43/78] crypto: caam - fix memory corruption in ahash_final_ctx Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 44/78] Revert "libata-eh: Set information field for autosense" Greg Kroah-Hartman
2015-09-11 22:49 ` Greg Kroah-Hartman [this message]
2015-09-11 22:49 ` [PATCH 4.1 46/78] Revert "libata: Implement NCQ autosense" Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 48/78] ALSA: usb-audio: Fix runtime PM unbalance Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 49/78] ALSA: hda - Fix the white noise on Dell laptop Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 50/78] ALSA: usb: Add native DSD support for Gustard DAC-X20U Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 51/78] ALSA: hda - Shutdown CX20722 on reboot/free to avoid spurious noises Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 52/78] ALSA: hda - Check all inputs for is_active_nid_for_any() Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 53/78] ALSA: hda - Fix path power activation Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 54/78] ALSA: hda: fix possible NULL dereference Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 55/78] mac80211: fix invalid read in minstrel_sort_best_tp_rates() Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 56/78] target/iscsi: Fix double free of a TUR followed by a solicited NOPOUT Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 57/78] PCI: Dont use 64-bit bus addresses on PA-RISC Greg Kroah-Hartman
2015-09-11 22:49 ` [PATCH 4.1 58/78] Input: gpio_keys_polled - request GPIO pin as input Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 59/78] drm/atmel-hlcdc: Compile suspend/resume for PM_SLEEP only Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 60/78] drm/i915: Flag the execlists context object as dirty after every use Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 63/78] 9p: ensure err is initialized to 0 in p9_client_read/write Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 64/78] irqchip/crossbar: Restore the irq_set_type() mechanism Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 65/78] irqchip/crossbar: Restore the mask on suspend behaviour Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 66/78] irqchip/crossbar: Restore set_wake functionality Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 67/78] ARM: OMAP: wakeupgen: Restore the irq_set_type() mechanism Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 68/78] genirq: Dont return ENOSYS in irq_chip_retrigger_hierarchy Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 69/78] genirq: Introduce irq_chip_set_type_parent() helper Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 71/78] can: pcan_usb: dont provide CAN FD bittimings by non-FD adapters Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 72/78] Add factory recertified Crucial M500s to blacklist Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 73/78] fnic: Use the local variable instead of I/O flag to acquire io_req_lock in fnic_queuecommand() to avoid deadloack Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 74/78] arm64: KVM: Fix host crash when injecting a fault into a 32bit guest Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 75/78] arm64: perf: fix unassigned cpu_pmu->plat_device when probing PMU PPIs Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 76/78] x86/xen: make CONFIG_XEN depend on CONFIG_X86_LOCAL_APIC Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 77/78] x86/apic: Fix fallout from x2apic cleanup Greg Kroah-Hartman
2015-09-11 22:50 ` [PATCH 4.1 78/78] x86/idle: Restore trace_cpu_idle to mwait_idle() calls Greg Kroah-Hartman
2015-09-11 23:15 ` [PATCH 4.1 00/78] 4.1.6-stable review Christoph Biedl
2015-09-12  0:59   ` Greg KH
2015-09-11 23:16 ` Holger Hoffstätte
2015-09-12  0:59   ` Greg KH
2015-09-12  0:16 ` Shuah Khan
2015-09-12  1:00   ` Greg Kroah-Hartman
2015-09-12  1:00 ` [PATCH 4.1 00/78] 4.1.7-stable review Greg Kroah-Hartman
2015-09-12  2:10   ` Shuah Khan
2015-09-12  4:39     ` Greg Kroah-Hartman
2015-09-12  4:25   ` Guenter Roeck
2015-09-12  4:39     ` Greg Kroah-Hartman
2015-09-12  8:53   ` Sudip Mukherjee
2015-09-12 15:55     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150911224612.746419393@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=hare@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tj@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).