Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp867002ybd; Wed, 26 Jun 2019 07:18:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3wIDZGXxO30W/XtnfrB1vYKTR3H08ebBW3ETYvVA1N6wKX/TLJCyhmVGAiLEH+ruAkCvY X-Received: by 2002:a17:90a:1b4c:: with SMTP id q70mr4901596pjq.69.1561558704300; Wed, 26 Jun 2019 07:18:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561558704; cv=none; d=google.com; s=arc-20160816; b=e2MHVEokiJMQ2j8jAz4DC4FGXAUToQUtawpqUBOD7irmccegTr28YUKYFv3I/lfVAS X3mr1ceFZe5jHu8jg1ZbShx1YU/0RQVLSMFi/V0tur6YGFyzvz1X5J/wOBaZZBDYILC6 DFinqxWlh7PXYqIoiENl2YXpGHIn74vGFJpXd800SsGDGprLQltAbhsMeor36H6zAn8F XgHERlWLW+yb+RCWxT/5LlWXQyPD3os3y9kCLr4x13kAyt8JNCRWcT9VcFq8JOS2LcQx 6upPlRL8BsC3rz0BfQOl2UvqGc/Pp0/LEH9c+IwMYxP3X/yk+C5Cam4NPOEjc4U+z5cu /3Iw== 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=Jz+d8Bq6px4B5hv9aLpu7uCGEvD+endKK7G195O5KL8=; b=fxYqivDc9CzE4bWD9PFYNgiOIfEpFk26/ywZMYgZM1I6FEEM/o1azePFRbWfHwZLjG qnO+gZryT/NtSrVARCjk2oUksM0G7oOiBZb24Wip59P/xJWiW/lvcHMq49F2elqWRa3/ 3imBt0KU6s/8dB4qW8lH3zEwOR1bCmF4YeLOAxoWAUZLc9iYQ10SalznRpGGumupkKNZ eIAKDfJnZxbBdxFQw0/3OxOjcv3CsHr+Zh35WXCfDH7wX8kt0cJFRc/6sg1D/jaRWWH4 wFpD2Prrs3NJrTfWD+WR7QCv0Ma4NTpt7rMUN+iwgCQolOtMdLbiP433378YHfjAQjfE EUpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xpyj1SUP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id s32si16266900pgm.291.2019.06.26.07.18.07; Wed, 26 Jun 2019 07:18:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Xpyj1SUP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1727988AbfFZORm (ORCPT + 99 others); Wed, 26 Jun 2019 10:17:42 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:34052 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725958AbfFZORm (ORCPT ); Wed, 26 Jun 2019 10:17:42 -0400 Received: by mail-ed1-f67.google.com with SMTP id s49so3642460edb.1; Wed, 26 Jun 2019 07:17:40 -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=Jz+d8Bq6px4B5hv9aLpu7uCGEvD+endKK7G195O5KL8=; b=Xpyj1SUPnpsE8OMNc9qWXya/cPkZB9lk6rT8T0PoUrlFKAxcKz4Yy7evwdpI1FOXdn FuO689CFG8+xvQfJoY34NLnEzKyE89bBKXy3vMTSJNuCPyh7U9nwu8I98fUrR0/nmcM5 RjvASyRfbHLqGvhuA4sK/ktdvelXsXIYu9/yYn6C+eiAravBk/5asaEO0jtF9r0kxBrx Rrm0y7DRVVTF3MBy+0Qj86uUIeREEb4CBI0Yu/ayD40X+xQjB/jVWu2theWuOjmxxQxH xOksdgr/UaX3dHuv/qwlxewevbcc5oUZIjT3KkXAvEY5rDHZzTqatZMpIYe8I2x5fIhw td2Q== 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=Jz+d8Bq6px4B5hv9aLpu7uCGEvD+endKK7G195O5KL8=; b=aEAfjYE6mtZKAR+uYk4iL08csq26cBekfWzV8t99QYrdQEhYzMAcfwqnUBvuTRHO+o Q52UvOU1VgKDF8LYz8VxOQ4J45lFJ9gRcNf+OtUIi+FRnXxjautpnHe4WP4VaWCBaOMn jSgCgMDQPxZRojVD45/vFiYydlsrULfIqQ2603HSbI/A5AKwjrWZ2twgA1zCAYCQb08z gMNBBSGbf09ytopdbfiMDJoOb1q0PhFm2TvxHu3CukkA5smptxZaSnmSvDWy56Q8ymfE 8KbAuZ4mPk/NcO7eCLUl+qsErDKhdWB9At4zscjwMU8UAr93ieiOn988mMJvyZ31lTGE 5Yyg== X-Gm-Message-State: APjAAAVw66aid8A2zeCNINZdyqoDsloPtUl9POjost7sbi7rFTQYtUqe 7iQXpZK/aKpvXpdlFD8Yai3Q2kioU8BKBJFzJgI= X-Received: by 2002:a50:a53a:: with SMTP id y55mr5734894edb.147.1561558659862; Wed, 26 Jun 2019 07:17:39 -0700 (PDT) MIME-Version: 1.0 References: <20190624083352.29257-1-rasmus.villemoes@prevas.dk> In-Reply-To: From: Willem de Bruijn Date: Wed, 26 Jun 2019 10:17:03 -0400 Message-ID: Subject: Re: [PATCH net-next] can: dev: call netif_carrier_off() in register_candev() To: Rasmus Villemoes Cc: Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Rasmus Villemoes , "linux-can@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" 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 Wed, Jun 26, 2019 at 5:31 AM Rasmus Villemoes wrote: > > On 24/06/2019 19.26, Willem de Bruijn wrote: > > On Mon, Jun 24, 2019 at 4:34 AM Rasmus Villemoes > > wrote: > >> > >> CONFIG_CAN_LEDS is deprecated. When trying to use the generic netdev > >> trigger as suggested, there's a small inconsistency with the link > >> property: The LED is on initially, stays on when the device is brought > >> up, and then turns off (as expected) when the device is brought down. > >> > >> Make sure the LED always reflects the state of the CAN device. > >> > >> Signed-off-by: Rasmus Villemoes > > > > Should this target net? > > No, I think this should go through the CAN tree. Perhaps I've > misunderstood when to use the net-next prefix - is that only for things > that should be applied directly to the net-next tree? If so, sorry. I don't see consistent behavior on the list, so this is probably fine. It would probably help to target can (for fixes) or can-next (for new features). Let me reframe the question: should this target can, instead of can-next? > > Regardless of CONFIG_CAN_LEDS deprecation, > > this is already not initialized properly if that CONFIG is disabled > > and a can_led_event call at device probe is a noop. > > I'm not sure I understand this part. The CONFIG_CAN_LEDS support for > showing the state of the interface is implemented via hooking into the > ndo_open/ndo_stop callbacks, and does not look at or touch the > __LINK_STATE_NOCARRIER bit at all. > > Other than via the netdev LED trigger I don't think one can even observe > the slightly odd initial state of the __LINK_STATE_NOCARRIER bit for CAN > devices, it's still incorrect, though I guess that's moot in practice. > which is why I framed this as a fix purely to allow the netdev > trigger to be a closer drop-in replacement for CONFIG_CAN_LEDS. So the entire CONFIG_CAN_LEDS code is to be removed? What exactly is this netdev trigger replacement, if not can_led_event? Sorry, I probably miss some context.