Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1569020ybk; Sat, 16 May 2020 15:53:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNG/aAb7pmNjnIVqCjhUsAhPOxqS4VGlmptfk58BTQcC1UXjdt0FC/zXgt9UNlCUgU6k4h X-Received: by 2002:a17:906:a415:: with SMTP id l21mr9422164ejz.100.1589669624973; Sat, 16 May 2020 15:53:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589669624; cv=none; d=google.com; s=arc-20160816; b=z8MRs4vCJPk6u5RKREHFWvivYeLk2rEpEZVs9qJCXfCT03DngURsEFj4OEkJ43EhXO JwlDrdboj97FmeT39qGzYDybah5HeecTatORuLGtbP+BllI3IB69cB+Qb5Thc7t0Jnju mYiKDFlk1iJXXOeJIecG/wjxgWOK6zwEWGdSJ/J5YCW8mlDfsXh6LPpRulldAzrEAyjl 3FzQBTCs1b47BkTYWiulZ6Uw6wfshJPK2k6xIihliE0XeFr8x2YmxEcUOwm40Yh+SUSR eLsvHnSJyPBbs4OxygYQQpNqL5ZoCEwmj9Fy0MqCjweXZDss3MzSsW6SCCEYKLcb2pUB SQaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=9PP2WyeWBRcwUtTtauI38pvOTseYMQkKSYN0LmJyoo8=; b=amlw2N5lIlWz9iok5ymBuBVWab1q9JHgrzGzAu3lljA9vgM/x5DuVv2EiuSrGAvrTS 28CShjoiJ/SdtFH0nt6mneDDGlK+67unn4r1avAMQ+9uqoopQWSwnVM88QFc2tMZgQZn MWIXezxyf9LlehpS/BqdXQn6kLNoqi1QHKBbX63GhDYsblfsChfO+rUfoiG03l3d6oRp Kmj9TYHZiJ83zQoGQLPTG05LqqDOLbjLBy/EnOSCcmiZsCZlt3mbuodKBeJ/bWN5s5pz FoV3/iotEox4FHuzd6KZ2TjRHqXXceznHJa9CpSiSTXyhDgZil5cBku9EhqLjAgCGRim DGJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UUGwnTau; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q10si4073298eja.345.2020.05.16.15.53.22; Sat, 16 May 2020 15:53:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UUGwnTau; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbgEPWwH (ORCPT + 99 others); Sat, 16 May 2020 18:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726660AbgEPWwG (ORCPT ); Sat, 16 May 2020 18:52:06 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54B0CC061A0C; Sat, 16 May 2020 15:52:06 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id l21so5575802eji.4; Sat, 16 May 2020 15:52:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9PP2WyeWBRcwUtTtauI38pvOTseYMQkKSYN0LmJyoo8=; b=UUGwnTauinMgCOPONXeirGZaWszqyGsDCkkRZFlv9pk/19b4omFGbRa9f7FQZf9sHK hX33VfjvwvHjTDVsOLW+RXrpt/Da+oNYhJJygZT4CFoez3W8f45H+I4aO+gRnlLlhT0D VfIOMlGuEwY0BzDBF0erk4NNT/8qPgvwBZdck7b/+qmHRTfUM4rWkt59j8Ui7J/IMpKW t/fjSQrL5ajHU3kuAbQVw/mNxp1h95KTVHDmhMvgq7kbR1andLkIT5ExrNR0TvvSYkUE GGfJd0Kx3vBbaG7YKKUX96vWT5vZdnK65komXTA4NCx38nusndthx0A/KSyDEWhZQ4j9 h+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9PP2WyeWBRcwUtTtauI38pvOTseYMQkKSYN0LmJyoo8=; b=bj1rYU9jaY5veb2F7q5uH4i+4f6NNDHQMcbeqrvavvDDbDrlv1sAgRbMhPcx85eykC EuYZv5WmPI+9tVpK1rI7utijItYQ+RY1aQm9nYlNeMuAFuNs6G46rAU8URygiabdAkkC R95nZ7R1w2KPAzHeVnC905qohyYmDGdpMMTBywAC+6BCGxZkejAXkdqgeLTVrPKlVx8w sQyctlFV+Sc0aqk5usCX9x8je9a2+xmBZS68arkKHXpgPUvBe41ogaCu5AMEyw1tuVbr H3g0q4XKu25QS1ZLEuUB+A3xIG37MoviVyx3qcErQlTytN9wpHYjDCIAh6UhK0jt2IOn /lRQ== X-Gm-Message-State: AOAM530yas24+pfaq4RFIIF+JzUQ3zru1pyydZqyuNTMzhEZqbY0+ZB6 MfA93MVAWuEqcJm/zRFOT5GlGsrRqg2Be6sS9PnVl0vo X-Received: by 2002:a17:906:660f:: with SMTP id b15mr8507711ejp.113.1589669524903; Sat, 16 May 2020 15:52:04 -0700 (PDT) MIME-Version: 1.0 References: <20200515031813.30283-1-xulin.sun@windriver.com> <20200516.135336.2032300090729040507.davem@davemloft.net> In-Reply-To: <20200516.135336.2032300090729040507.davem@davemloft.net> From: Vladimir Oltean Date: Sun, 17 May 2020 01:51:53 +0300 Message-ID: Subject: Re: [PATCH] net: mscc: ocelot: replace readx_poll_timeout with readx_poll_timeout_atomic To: David Miller Cc: Xulin Sun , Alexandre Belloni , Microchip Linux Driver Support , netdev , lkml , xulinsun@gmail.com, steen.hegelund@microchip.com, "Allan W. Nielsen" , Horatiu Vultur Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 16 May 2020 at 23:54, David Miller wrote: > > From: Xulin Sun > Date: Fri, 15 May 2020 11:18:13 +0800 > > > BUG: sleeping function called from invalid context at drivers/net/ethernet/mscc/ocelot.c:59 > > in_atomic(): 1, irqs_disabled(): 0, pid: 3778, name: ifconfig > > INFO: lockdep is turned off. > > Preemption disabled at: > > [] dev_set_rx_mode+0x24/0x40 > > Hardware name: LS1028A RDB Board (DT) > > Call trace: > > dump_backtrace+0x0/0x140 > > show_stack+0x24/0x30 > > dump_stack+0xc4/0x10c > > ___might_sleep+0x194/0x230 > > __might_sleep+0x58/0x90 > > ocelot_mact_forget+0x74/0xf8 > > ocelot_mc_unsync+0x2c/0x38 > > __hw_addr_sync_dev+0x6c/0x130 > > ocelot_set_rx_mode+0x8c/0xa0 > > Vladimir states that this call chain is not possible in mainline. > > I'm not applying this. (but the essence of the problem is legitimate though) There are 2 specific things I don't like: - The problem is claimed to reproduce on "LS1028A RDB Board (DT)" which does not call ocelot_set_rx_mode. So it claims to fix a problem for which only Xulin has the ability to decide whether it is the right solution or not. - On ocelot, it _looks_ like it is indeed a problem which was introduced in 639c1b2625af ("net: mscc: ocelot: Register poll timeout should be wall time not attempts"). But there was no attempt to bring it up with the author of that patch, who very clearly expressed that he is working on hardware where the polling timeout is in the order of milliseconds, and the timeout for the driver is currently set at 100 ms. I'm not very sure that it is desirable to spin in atomic context for 100 ms. Thanks, -Vladimir