libata: Honor RQF_QUIET flag
authorDamien Le Moal <damien.lemoal@wdc.com>
Wed, 9 May 2018 00:28:11 +0000 (09:28 +0900)
committerTejun Heo <tj@kernel.org>
Thu, 10 May 2018 18:43:20 +0000 (11:43 -0700)
commit7eb49509dd6b2a4ed0c18a0f8c187afbacf98b42
treed50a4054575aa1b7734541b6c722f53c862d52de
parent07b9b6d6e1bb823e278d1afb255ad057cf53960b
libata: Honor RQF_QUIET flag

Currently, libata ignores requests RQF_QUIET flag and print error
messages for failed commands, regardless if this flag is set in the
command request. Fix this by introducing the ata_eh_quiet() function and
using this function in ata_eh_link_autopsy() to determine if the EH
context should be quiet. This works by counting the number of failed
commands and the number of commands with the quiet flag set. If both
numbers are equal, the the EH context can be set to quiet and all error
messages suppressed. Otherwise, only the error messages for the failed
commands are suppressed and the link Emask and irq_stat messages printed.

Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
drivers/ata/libata-eh.c
drivers/ata/libata-scsi.c