Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1385530pxb; Tue, 8 Feb 2022 16:27:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAaephgmOZAsq5LjWtxwEiBu/bdTGHVoPdMDKbrxEIE/UjOMk4+M0moe38hK9c/MGwma5g X-Received: by 2002:a17:902:b682:: with SMTP id c2mr6999366pls.126.1644366427057; Tue, 08 Feb 2022 16:27:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644366427; cv=none; d=google.com; s=arc-20160816; b=ERqSXL+UN/tYxAXgx7+evAvPWJNIW95TFu4qvXx0YLj/gGe4Ea8FP9RpTKVGHjAw3H ibomchsKEpym6e8PjjyurJw8a3pWL4pT8hrvs38AzO2JUBtjkSMrneJZ1MWfN+DicSs5 CAKFI/Xw5siEjrqgDi8SmgmgFDiYZT6zPWOrToIzPJYgSqCkJ6XZGu6ZW6DyTMzUeUCD HXbkBZto9y5xJ+gzhwlKUutKzT0sfL17gyXSZM9LN5KEfPa9669NqX1tUcOAFX4colGv nVc4Fr7AkhC0bYAGWCExbh0rsXZmBK3/cl6Pjs3GDDTk1RML60gL4sCVfGRhUcGEW/Kp +YjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Di1q6gm9Pbk96zUtw9657zciT6NGTYjS8oPRdxWH/pM=; b=WymmBaIwS+QGolqBJxtGQ5iTEQKAQcTupssKeJjZ3am1ZuNq30JjwZYBcg2wtLTdRG 23h95XxTzIgHyEdD4n1KVwhm6LQI6a8IPDOMfz0OYpFHedtuaXC7kRPjePhv2KEclOsv DSkdV59dZyyNB7IrEoUydaFPB+/IhUPC5oWaGR7iNdrrY3NlOXE2K+jSpU6qlqTdVoka MEmEmeg2mrDTU5ciq6XvigVciMt9layqhrYKGsUgwMGhbz0FNPmMqUv5KZJomvA2MNfI sxJPGP23ubxGZDa8zolVzU8F1VBWAWHrnrc/6FrRpmRyRMswTeyhOh4CTzxmU9RFG2sv 4IFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i6vbk9/b"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f190si13939011pgc.650.2022.02.08.16.26.54; Tue, 08 Feb 2022 16:27:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="i6vbk9/b"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1391132AbiBGL62 (ORCPT + 99 others); Mon, 7 Feb 2022 06:58:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1385568AbiBGLb7 (ORCPT ); Mon, 7 Feb 2022 06:31:59 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83552C03E969; Mon, 7 Feb 2022 03:30:54 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4DA3CB80EBD; Mon, 7 Feb 2022 11:30:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 879BBC004E1; Mon, 7 Feb 2022 11:30:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1644233452; bh=ommyWLdHB1X5ao2pxgZFgQltSg+lALGtV7sFv7djEpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i6vbk9/b8rxq0BGIoBa7l3rrlS9RSFVdIVtnEYvAKfI5INttm5FwmXK1ZcDxSVX6O P4aVJcrUHWOfzInlDvYwGX7Qnn2mqrow2N7PBE4O5LZ/QT6uC12s1kYRWTlhRUCI6e PJ0TJx+f3UoG4xDRmdNsDqvehV9WpdzR/aHupF2E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anton Lundin , Damien Le Moal Subject: [PATCH 5.16 017/126] ata: libata-core: Introduce ATA_HORKAGE_NO_LOG_DIR horkage Date: Mon, 7 Feb 2022 12:05:48 +0100 Message-Id: <20220207103804.653311531@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220207103804.053675072@linuxfoundation.org> References: <20220207103804.053675072@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anton Lundin commit ac9f0c810684a1b161c18eb4b91ce84cbc13c91d upstream. 06f6c4c6c3e8 ("ata: libata: add missing ata_identify_page_supported() calls") introduced additional calls to ata_identify_page_supported(), thus also adding indirectly accesses to the device log directory log page through ata_log_supported(). Reading this log page causes SATADOM-ML 3ME devices to lock up. Introduce the horkage flag ATA_HORKAGE_NO_LOG_DIR to prevent accesses to the log directory in ata_log_supported() and add a blacklist entry with this flag for "SATADOM-ML 3ME" devices. Fixes: 636f6e2af4fb ("libata: add horkage for missing Identify Device log") Cc: stable@vger.kernel.org # v5.10+ Signed-off-by: Anton Lundin Signed-off-by: Damien Le Moal Signed-off-by: Greg Kroah-Hartman --- drivers/ata/libata-core.c | 10 ++++++++++ include/linux/libata.h | 1 + 2 files changed, 11 insertions(+) --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -2043,6 +2043,9 @@ static bool ata_log_supported(struct ata { struct ata_port *ap = dev->link->ap; + if (dev->horkage & ATA_HORKAGE_NO_LOG_DIR) + return false; + if (ata_read_log_page(dev, ATA_LOG_DIRECTORY, 0, ap->sector_buf, 1)) return false; return get_unaligned_le16(&ap->sector_buf[log * 2]) ? true : false; @@ -4123,6 +4126,13 @@ static const struct ata_blacklist_entry { "WDC WD3000JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, { "WDC WD3200JD-*", NULL, ATA_HORKAGE_WD_BROKEN_LPM }, + /* + * This sata dom device goes on a walkabout when the ATA_LOG_DIRECTORY + * log page is accessed. Ensure we never ask for this log page with + * these devices. + */ + { "SATADOM-ML 3ME", NULL, ATA_HORKAGE_NO_LOG_DIR }, + /* End Marker */ { } }; --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -428,6 +428,7 @@ enum { ATA_HORKAGE_MAX_TRIM_128M = (1 << 26), /* Limit max trim size to 128M */ ATA_HORKAGE_NO_NCQ_ON_ATI = (1 << 27), /* Disable NCQ on ATI chipset */ ATA_HORKAGE_NO_ID_DEV_LOG = (1 << 28), /* Identify device log missing */ + ATA_HORKAGE_NO_LOG_DIR = (1 << 29), /* Do not read log directory */ /* DMA mask for user DMA control: User visible values; DO NOT renumber */