1 From 848e4c68c4695beae563f9a3d59fce596b466a74 Mon Sep 17 00:00:00 2001
2 From: Tejun Heo <tj@kernel.org>
3 Date: Tue, 21 Oct 2008 14:26:39 +0900
4 Subject: [PATCH] libata: transfer EHI control flags to slave ehc.i
7 ATA_EHI_NO_AUTOPSY and ATA_EHI_QUIET are used to control the behavior
8 of EH. As only the master link is visible outside EH, these flags are
9 set only for the master link although they should also apply to the
10 slave link, which causes spurious EH messages during probe and
13 This patch transfers those two flags to slave ehc.i before performing
14 slave autopsy and reporting.
16 Signed-off-by: Tejun Heo <tj@kernel.org>
17 Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
18 Signed-off-by: Tejun Heo <teheo@suse.de>
20 drivers/ata/libata-eh.c | 5 +++++
21 include/linux/libata.h | 3 +++
22 2 files changed, 8 insertions(+)
24 --- a/drivers/ata/libata-eh.c
25 +++ b/drivers/ata/libata-eh.c
26 @@ -1973,8 +1973,13 @@ void ata_eh_autopsy(struct ata_port *ap)
27 struct ata_eh_context *mehc = &ap->link.eh_context;
28 struct ata_eh_context *sehc = &ap->slave_link->eh_context;
30 + /* transfer control flags from master to slave */
31 + sehc->i.flags |= mehc->i.flags & ATA_EHI_TO_SLAVE_MASK;
33 + /* perform autopsy on the slave link */
34 ata_eh_link_autopsy(ap->slave_link);
36 + /* transfer actions from slave to master and clear slave */
37 ata_eh_about_to_do(ap->slave_link, NULL, ATA_EH_ALL_ACTIONS);
38 mehc->i.action |= sehc->i.action;
39 mehc->i.dev_action[1] |= sehc->i.dev_action[1];
40 --- a/include/linux/libata.h
41 +++ b/include/linux/libata.h
42 @@ -337,6 +337,9 @@ enum {
44 ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET,
46 + /* mask of flags to transfer *to* the slave link */
47 + ATA_EHI_TO_SLAVE_MASK = ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET,
49 /* max tries if error condition is still set after ->error_handler */