From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.9 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41EE3C47092 for ; Tue, 1 Jun 2021 10:43:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 253AF61090 for ; Tue, 1 Jun 2021 10:43:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230288AbhFAKp0 (ORCPT ); Tue, 1 Jun 2021 06:45:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230282AbhFAKpY (ORCPT ); Tue, 1 Jun 2021 06:45:24 -0400 Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F5BDC061574 for ; Tue, 1 Jun 2021 03:43:41 -0700 (PDT) Received: by mail-lf1-x12f.google.com with SMTP id i10so9003468lfj.2 for ; Tue, 01 Jun 2021 03:43:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=T6mQSvWzxu7YzknZEJ5Te3X0ifxaxkG8iVYDDLXgUy0=; b=u8QmaS5wGFma9SnI+ecqbfb8IACKMqM26iciZ1j0E9xDYA6LbajINiAY5kYspkOAsU ji+dPJHjNjaEntbcHFH+xeA7cMfbl0A5lDnDV3oRGT74tPYM5+hk1ATSiUvZ8GdsRIec +3KzqQQjH8Hk6+R4EoJMcHCCR/V67kLzQzLezb5AkEjihb7guj/6Oh1+sOyPT0UL/Nu8 yWTD7mj0sJj9JztoSu/5jpdB35uFluALmNTh4k23kJg41n2JEPVHUgcin7UoH6xcnZfE w3mm1NVHkoHmQzP0UQgUNDlgLKQjXIiZRg/eBmtqBVQoUB3AHegjVjmWpHys8QJZOZvU LU3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=T6mQSvWzxu7YzknZEJ5Te3X0ifxaxkG8iVYDDLXgUy0=; b=l1JN6EAO80UzyD73JLlTzJsTWwjZNZaa8OSGoUi/1vMPt1mhmaAOEZmbUKEpCSZnqH pTV3wVQja0vbrPFvxEHNeC0NFDagg7iouAIAJNO00IFXYuFkOlVON2SnirWNokwcvkK1 h+mCpkBojq0cSK4SAU6BvtvRCG5GgXGEKbKvNj45e/i3S712geXgJHH+WGPBfPsGaj+e 7UsAdvFj8Kmxt1eAhVvrEiXJ8Leimop1qcVH7EdTj1TBcFGf/E3ZHbqPir6bSThRrf2s YV2CI8tr5GYP6y71VYN9s4Gj6IztinVzCkrdlbmdPnQ0mZGAAFMTgMKePDeaXKiY482C Vj0g== X-Gm-Message-State: AOAM533qiOTPxoHnqzzdsCPGJ7NpxbnEp25hRqcLOTQaSAsfc/jHpBez gDv94w8Fk4/WCR3wx+DBVWY= X-Google-Smtp-Source: ABdhPJy/FnBm2jmDKGDzpd7tH/P91NuQriOy45SlIq1AR2GmRV5QknlTX7kdW+hfbr2f3ONZlI86xA== X-Received: by 2002:a05:6512:21c:: with SMTP id a28mr18348015lfo.298.1622544219672; Tue, 01 Jun 2021 03:43:39 -0700 (PDT) Received: from [192.168.0.91] ([188.242.181.97]) by smtp.googlemail.com with ESMTPSA id g28sm288719lfv.142.2021.06.01.03.43.38 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Tue, 01 Jun 2021 03:43:39 -0700 (PDT) Message-ID: <60B611C6.2000801@gmail.com> Date: Tue, 01 Jun 2021 13:53:58 +0300 From: Nikolai Zhubr User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1 MIME-Version: 1.0 To: Arnd Bergmann CC: Heiner Kallweit , netdev , Jeff Garzik Subject: Re: Realtek 8139 problem on 486. References: <60B24AC2.9050505@gmail.com> <60B2E0FF.4030705@gmail.com> <60B36A9A.4010806@gmail.com> <60B3CAF8.90902@gmail.com> <60B41D00.8050801@gmail.com> <60B514A0.1020701@gmail.com> <60B560A8.8000800@gmail.com> <49f40dd8-da68-f579-b359-7a7e229565e1@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi all, 01.06.2021 10:20, Arnd Bergmann: [...] >> What was discussed here 16 yrs ago should sound familiar to you. >> https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg92234.html >> "It was an option in my BIOS PCI level/edge settings as I posted." >> You could check whether you have same/similar option in your BIOS >> and play with it. Yes indeed, this motherboard does have such an option, and it defaulted to "Edge", which apparently is not what PCI device normally expects. Changing it to "Level" made unmodified kernel 2.6.4 work fine. And 8259A.pl comfirms this, too. Before: # ./8259A.pl irq 0: 00, edge irq 1: 00, edge irq 2: 00, edge irq 3: 00, edge irq 4: 00, edge irq 5: 00, edge irq 6: 00, edge irq 7: 00, edge irq 8: 00, edge irq 9: 00, edge irq 10: 00, edge irq 11: 00, edge irq 12: 00, edge irq 13: 00, edge irq 14: 00, edge irq 15: 00, edge After: # ./8259A.pl irq 0: 00, edge irq 1: 00, edge irq 2: 00, edge irq 3: 00, edge irq 4: 00, edge irq 5: 00, edge irq 6: 00, edge irq 7: 00, edge irq 8: 06, edge irq 9: 06, level irq 10: 06, level irq 11: 06, edge irq 12: 06, edge irq 13: 06, edge irq 14: 06, edge irq 15: 06, edge > So it appears that the interrupt is lost if new TX events come in after the > status register is read, and that checking it again manages to make that > race harder to hit, but maybe not reliably. It looks like incorrect IRQ triggering mode makes 2 or more IRQs merge into one, kind of. However, if I understand this 8139 operation logic correctly, the possible max number of signaled events in one go is limited by the number of tx/rx descriptors and can not grow beyond it while inside the interrupt handler in any case. If so, using the loop would seem not that bad, and the limit would be certainly not 20 but max(NUM_TX_DESC, CONFIG_8139_RXBUF_IDX) == 4. > The best idea I have for a proper fix would be to move the TX processing > into the poll function as well, making sure that by the end of that function > the driver is either still in napi polling mode, or both RX and TX interrupts > are enabled and acked. This one is too complicated for me to implement myself, so I'll have to wait if someone does this. Alternatively, maybe it is possible to explicitely request level mode from 8259 at the driver startup? Thank you, Regards, Nikolai > > Arnd >