Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4890541rdb; Fri, 29 Dec 2023 18:30:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGgyYCurLOQF73fZIJQaCFAb/yUbuzJ7uiTWX+bp6Dvxufvfp9nn48pxerFc6vCutWxOK3H X-Received: by 2002:a05:620a:1670:b0:77a:75fb:a0e7 with SMTP id d16-20020a05620a167000b0077a75fba0e7mr15740689qko.63.1703903416237; Fri, 29 Dec 2023 18:30:16 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703903416; cv=pass; d=google.com; s=arc-20160816; b=fMMOTSBWuAbHIaLtaOq1AgXlIPieWAcR8Aox//3FPIXbBdLnJXNaaF3hOSlNVAoPVo T+4p0rz0nXCKafPujg7FQXXGpT1frqCXyNXKkpqaEsTXUSfHdvzUe4XkXNo/GaHtdY+7 fc97LdGU+E1m7l8F9gK8wbt8SAkqxYH5p4aZuEa6pknKcVr5UWX+pjyuIgAJRKXOgWkM ESsvIEVBLxcs3kHUt1XXDUjH8VQ9QYXj1aiyUA0VGEpgb/PpRQfE5PtBvQRv5hWjXa1V M7WLSAi8z+Vo1qrUMDId5N9d6bBniiJGbqIEdjBEi8CX3hUHPtgtsGF5PuuK8muRYW4K O5Pg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:date:message-id:dkim-signature; bh=e7GMhfYHcTr5RGqIPmIp40EkKLkt1NzpPpHir6Lsw4c=; fh=Drl0RnL9AmaVTWAwz1lkCZbsy79P3wY6BqG1qUpgqYg=; b=wSymJkPthky+0enypHgcsnmAZXw1N2gxdHZCVk5STahxh2en9FtK8QjzqoinyasZX4 J5kxIjhoIJ30PQ6Z48Zl1Qtf3VQMRVXE0ev59PEfcrJ+acX2SkZkjhPHkLv9RoKV9njW /LLY+lOwu6WMm5QTyXYdI61Dvd18odInSwJp9q/PWrkgQef041gOFr6/k3cEPTRyWKXq rhTwSspuUeoHamSDWPy4fjGqubsrraIj6QRf4GnQFfElR6ZAEWItRe5SPC8bNnLWeBQU a7Gjp1hPa6Zoy5OhrGvAClSK+2A3ij6x8ygUkJzNKcuriCUWJ4g+LxSHNihKn9vm2wfe +tog== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=lLNIe9Yw; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-13310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id f1-20020a05620a12e100b0077a0d2652absi16628047qkl.759.2023.12.29.18.30.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Dec 2023 18:30:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-13310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=lLNIe9Yw; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel+bounces-13310-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-13310-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E21A11C215A9 for ; Sat, 30 Dec 2023 02:30:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0466F1C0F; Sat, 30 Dec 2023 02:30:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b="lLNIe9Yw" X-Original-To: linux-kernel@vger.kernel.org Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2067.outbound.protection.outlook.com [40.107.243.67]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA5E92598; Sat, 30 Dec 2023 02:30:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RnKXIvTmOPo3uWRFNYmZ7Erv717nwONph447JQnCBUgNKliHxZTh4OhIFB3vT9XIpRJTaxUXnZFz/nurc55mAuXIrm6Wf0yNHEf793im8wJQsB+kXKcm3o2CrttYxVOpZ8e7QbFrZ8wTO+6/pUIrhY3oCWkA/51a9wOWNcgRTQwo67X7w+sY3SqmJfco+Ab0Q5s1e7Cst/rUJWJrU+3KQs+4MifYtPSF8G1dbLHAVU+e3K3WWAWb3jjgbX8UZth1L89E01L9s+AdFiqEJ5rMWrNjIYNAYIFrU7wc0VZ77fvK0H7orXDYJvscd/iH1fhN+crn+xyJaouJxXcp2wb+DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=e7GMhfYHcTr5RGqIPmIp40EkKLkt1NzpPpHir6Lsw4c=; b=Qa6Hqc6YWK31n0l8+Kitr3aXgO6y5T63osFE3ZdFDJiMDGJHtBCAKPelb++g41941Srmql3gdOUNUzeho8Jr9q6SvTEVy20epzDUfTCJLMDPVbfBqTR44SnyaooN9d3jVfzzUt+httd9N20r1NjTViYtPsGmYaP8sA5zmj2ZP+83etHdpTFWbzo0Mq4iOb5lfZB6RagGtYTOsWgY7llPMFRf8zIihCdZN7ZHGytKXmGXr7TxwinFChpgA0qGvaMomubEH5KoKlR1s+OjrmOoOeZOv34f6kjRb9Z1COlaE8y7I8Nz9pq7SbdvgwzD2n48LCgs2/5NCY8W6AED6WzUsQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e7GMhfYHcTr5RGqIPmIp40EkKLkt1NzpPpHir6Lsw4c=; b=lLNIe9Yw68lwD+DQ+xEx7+KJD/8fNL5OZRjXIMiRZoFrL2FgMImRjDMqnt70HgAp9otkbpRTMDfaBY4WShkQGqpV8tVadZQFkepvebTAMClnwRBh+EvbzEaB23++4RzLciJN39P4SixyeLZBUfyQcMkvZ8nGE1mVS5P8/yxx8lo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) by SJ0PR12MB5439.namprd12.prod.outlook.com (2603:10b6:a03:3ae::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7135.21; Sat, 30 Dec 2023 02:30:03 +0000 Received: from MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::ce8d:7121:cb06:91ba]) by MN0PR12MB6101.namprd12.prod.outlook.com ([fe80::ce8d:7121:cb06:91ba%4]) with mapi id 15.20.7135.019; Sat, 30 Dec 2023 02:30:03 +0000 Message-ID: Date: Fri, 29 Dec 2023 20:30:00 -0600 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] firewire: ohci: suppress unexpected system reboot in AMD Ryzen machines and ASM108x/VT630x PCIe cards Content-Language: en-US To: Takashi Sakamoto , linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Cc: adamg@pobox.com, stable@vger.kernel.org, Jiri Slaby , Tobias Gruetzmacher References: <20231229035735.11127-1-o-takashi@sakamocchi.jp> From: Mario Limonciello In-Reply-To: <20231229035735.11127-1-o-takashi@sakamocchi.jp> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA0PR11CA0182.namprd11.prod.outlook.com (2603:10b6:806:1bc::7) To MN0PR12MB6101.namprd12.prod.outlook.com (2603:10b6:208:3cb::10) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MN0PR12MB6101:EE_|SJ0PR12MB5439:EE_ X-MS-Office365-Filtering-Correlation-Id: 4e5effc4-b774-4c24-d372-08dc08df3a69 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PImiX9Mg6smIehSgzoLiLMmtA83hPl9OEyrtu63lQeu4NcHbz9YryU/NLToegAjVE0o4OwFsLzoxo10EHIoxlSBKQKDqZZhUyd9YYOBds8ZXhknIRGWeu8VQy3+w3amshOfOndrjkk98sOD47otodRp9Q7OLgeAM/rPl+xkSaTO7sqbI5bNkNM1NeFPuMfLQ15C2hJif2uJy5t4cY5eaO1P5FZP5cgkGeozToUHZazwnIHLfdMzxEXq1UOl1ou7gmU3NQz931XZ32Jm6B/l/EQ4k/FSl9w0fUlywNHGIkgVIa7g51TMsGDVTnM61oXwTghjQKJtIv+x2/fsTmphMysLMX/bscG/gkCTFFjjUd/TbYST2IzK+r6e+MdC5G17ctfq+EioBJt9cW10J8QHQ11e+UGUSVve4Wjj0y4rrqxXc3X3QwKLfgLUKc0/GhxaUf34WsPUSq49gPCHPkTKqIFW2T1pEZhmzMV+kBnKihDGruUe3UNxzU+rptfAHn6147CcQPFsZdXzzc3LbVvi2VieHRkNkJ4k3bXfZ62uYj2mOG9kYiuY/YchZzWOCD8hnTwBqN+FiZFSe6BCJXkCKNfp6lLqNyNWVPKo6n8z5uMrtWA5eQOJv/lDlzeB4iYcTvjNNbVIWKgbKZBbeyQwpzw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN0PR12MB6101.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(366004)(376002)(39860400002)(396003)(136003)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(2906002)(316002)(31686004)(4326008)(54906003)(966005)(38100700002)(41300700001)(8936002)(6512007)(6506007)(8676002)(478600001)(66556008)(5660300002)(66476007)(66946007)(44832011)(86362001)(36756003)(6486002)(31696002)(53546011)(2616005)(26005)(83380400001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Q0JIYktCLzFhOG9rZGZXS201U1lNNzdtNXF0RFNoOXQyVm4vK3pLdFRRZE9Y?= =?utf-8?B?T1lrYnV0bUxkVHM4ZVBOMWx2Q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huYmZGZm5GOTNRTVVqM2dYU3BrN0pwTHR1bDczbEd5?= =?utf-8?B?Rk5sRDJ2azZJYy9mMmJhVWV4T0FJRXpDYmxmT2k2RUJiR3BtY01WNk16cEd5?= =?utf-8?B?Uys2aVRLTnM1Qkt2Z0t5dGh1TDUxOFV2U1lFUlVuWkZUTVZTTmEwQnhCMksr?= =?utf-8?B?NnQzVUZ1emxaT1VuaFRHK1lFTFkrNWZ0V0F2aU5MS3RqVDc3YzI5Q1luVU1K?= =?utf-8?Q?Fu81CZy8Ldn5bi9or28cDGdHR?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e5effc4-b774-4c24-d372-08dc08df3a69 X-MS-Exchange-CrossTenant-AuthSource: MN0PR12MB6101.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2023 02:30:03.1826 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AWSI9fnKwvmtBkVbAk5il6r+uWplYj1/sajctZTzt9yEflJ7PngOunKiTotp9tIGXieEKOOvUato/zSexut/hQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5439 On 12/28/2023 21:57, Takashi Sakamoto wrote: > VIA VT6306/6307/6308 provides PCI interface compliant to 1394 OHCI. When > the hardware is combined with Asmedia ASM1083/1085 PCIe-to-PCI bus bridge, > it appears that accesses to its 'Isochronous Cycle Timer' register (offset > 0xf0 on PCI I/O space) often causes unexpected system reboot in any type > of AMD Ryzen machine (both 0x17 and 0x19 families). It does not appears in > the other type of machine (AMD pre-Ryzen machine, Intel machine, at least), > or in the other OHCI 1394 hardware (e.g. Texas Instruments). > > The issue explicitly appears at a commit dcadfd7f7c74 ("firewire: core: > use union for callback of transaction completion") added to v6.5 kernel. > It changed 1394 OHCI driver to access to the register every time to > dispatch local asynchronous transaction. However, the issue exists in > older version of kernel as long as it runs in AMD Ryzen machine, since > the access to the register is required to maintain bus time. It is not > hard to imagine that users experience the unexpected system reboot when > generating bus reset by plugging any devices in, or reading the register > by time-aware application programs; e.g. audio sample processing. > > Well, this commit suppresses the system reboot in the combination of > hardware. It avoids the access itself. As a result, the software stack can > not provide the hardware time anymore to unit drivers, userspace > applications, and nodes in the same IEEE 1394 bus. It brings apparent > disadvantage since time-aware application programs require it, while > time-unaware applications are available again; e.g. sbp2. > > Cc: stable@vger.kernel.org > Reported-by: Jiri Slaby > Closes: https://bugzilla.suse.com/show_bug.cgi?id=1215436 > Reported-by: Mario Limonciello > Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217994 > Reported-by: Tobias Gruetzmacher > Closes: https://sourceforge.net/p/linux1394/mailman/message/58711901/ > Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2240973 > Closes: https://bugs.launchpad.net/linux/+bug/2043905 > Signed-off-by: Takashi Sakamoto > --- > drivers/firewire/ohci.c | 49 +++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 49 insertions(+) > > diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c > index 7e88fd489741..62af3fa39a70 100644 > --- a/drivers/firewire/ohci.c > +++ b/drivers/firewire/ohci.c > @@ -279,6 +279,8 @@ static char ohci_driver_name[] = KBUILD_MODNAME; > #define QUIRK_TI_SLLZ059 0x20 > #define QUIRK_IR_WAKE 0x40 > > +#define QUIRK_REBOOT_BY_CYCLE_TIMER_READ 0x80000000 > + > /* In case of multiple matches in ohci_quirks[], only the first one is used. */ > static const struct { > unsigned short vendor, device, revision, flags; > @@ -1724,6 +1726,11 @@ static u32 get_cycle_time(struct fw_ohci *ohci) > s32 diff01, diff12; > int i; > > +#if IS_ENABLED(CONFIG_X86) > + if (ohci->quirks & QUIRK_REBOOT_BY_CYCLE_TIMER_READ) > + return 0; > +#endif > + > c2 = reg_read(ohci, OHCI1394_IsochronousCycleTimer); > > if (ohci->quirks & QUIRK_CYCLE_TIMER) { > @@ -3527,6 +3534,45 @@ static const struct fw_card_driver ohci_driver = { > .stop_iso = ohci_stop_iso, > }; > > +// On PCI Express Root Complex in any type of AMD Ryzen machine, VIA VT6306/6307/6308 with Asmedia > +// ASM1083/1085 brings an inconvenience that read accesses to 'Isochronous Cycle Timer' register > +// (at offset 0xf0 in PCI I/O space) often causes unexpected system reboot. The mechanism is not > +// clear, since the read access to the other registers is enough safe; e.g. 'Node ID' register, > +// while it is probable due to detection of any type of PCIe error. > +#if IS_ENABLED(CONFIG_X86) > + > +#define PCI_DEVICE_ID_ASMEDIA_ASM108X 0x1080 > + > +static bool detect_vt630x_with_asm1083_on_amd_ryzen_machine(const struct pci_dev *pdev, > + struct fw_ohci *ohci) > +{ > + const struct pci_dev *pcie_to_pci_bridge; > + const struct cpuinfo_x86 *cinfo = &cpu_data(0); > + > + // Detect any type of AMD Ryzen machine. > + if (cinfo->x86_vendor != X86_VENDOR_AMD || cinfo->x86 < 0x17) > + return false; Maybe it's better to use X86_FEATURE_ZEN? > + > + // Detect VIA VT6306/6307/6308. > + if (pdev->vendor != PCI_VENDOR_ID_VIA) > + return false; > + if (pdev->device != PCI_DEVICE_ID_VIA_VT630X) > + return false; > + > + // Detect Asmedia ASM1083/1085. > + pcie_to_pci_bridge = pdev->bus->self; > + if (pcie_to_pci_bridge->vendor != PCI_VENDOR_ID_ASMEDIA) > + return false; > + if (pcie_to_pci_bridge->device != PCI_DEVICE_ID_ASMEDIA_ASM108X) > + return false; > + > + return true; > +} > + > +#else > +#define detect_vt630x_with_asm1083_on_amd_ryzen_machine(pdev) false > +#endif > + > #ifdef CONFIG_PPC_PMAC > static void pmac_ohci_on(struct pci_dev *dev) > { > @@ -3630,6 +3676,9 @@ static int pci_probe(struct pci_dev *dev, > if (param_quirks) > ohci->quirks = param_quirks; > > + if (detect_vt630x_with_asm1083_on_amd_ryzen_machine(dev, ohci)) > + ohci->quirks |= QUIRK_REBOOT_BY_CYCLE_TIMER_READ; > + > /* > * Because dma_alloc_coherent() allocates at least one page, > * we save space by using a common buffer for the AR request/