Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp2006967pxb; Mon, 13 Sep 2021 09:55:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGO0ck1Pxw/5Zot5ySnfpw7rs2S9Zjhr1MXvMkXCS/BIrxGdY1zk/Ha5ggC6I5pmq6YCa/ X-Received: by 2002:a17:906:f24d:: with SMTP id gy13mr13529775ejb.395.1631552110632; Mon, 13 Sep 2021 09:55:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631552110; cv=none; d=google.com; s=arc-20160816; b=G20H4MpJ4D41vJ0Eq0k5N9PjLaf4wuNC+lRcOGIBvRe0TsSd9TITYaak+YZYuQbrTC RwqvqMQafZxRXrTaXHgRS0bzaL9gyqouVOiCc/npthSbfZVC99GLc7fqGANVNiB6pxD1 MFmL+vAwCB43KyUeffEeTfOxDaoK2gNQMeFoDxO2Fxa49WwuKtMuhqnOyEB5MJAaM3ox jl+s9KSQUYLMNPQe7UqXbOhcKiQdEbPZ0HO6EDbc8TtSX2FiVqUPI7cWtztJmHutuYRY ILwEiyct1WrgDZR+7Wa6CPWbtJrgBrrV7UGAIDGQms3SVDb342T5yFUZFVeZidPinWzm Z37w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=jKmrMtYAU38Ek0NsTISM2Zo8smzHINIMpeNn3tlnY80=; b=AZ/7uAW9cMgMAH9MmYcfJenP0+/4XPCX173JsVyJlHDjHAmMqyIt9w9gVKCRquL3V5 SSlE1W71UQ657OXLY7IZNLB5r15dnVgK29qGnh+uqiRXLQjnSWA7VBA4iG3NLGREYSD3 Pvb6dPkE3I/8WnH9nQy9WFM4clh8vaUN4dPJoEyAm2wKKJijuAs4XzyipmtUiDQ9yb1O tdfPFT2aPyrFJu2iVcfUgbfKx+Ovir+7swe9cBUX4ZFAgKE0D/nG8UQeImsKP1ekKLbJ CddrFd0nqBtTlPYs5uxyvCr5heW5GDreZuVc5e/Irqxu9TiYwVmstjdMVladb6z5MWkU uKSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gCMrRKvq; 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 12si8740305ejk.308.2021.09.13.09.54.46; Mon, 13 Sep 2021 09:55:10 -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=20210112 header.b=gCMrRKvq; 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 S239517AbhIMQv7 (ORCPT + 99 others); Mon, 13 Sep 2021 12:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238876AbhIMQv6 (ORCPT ); Mon, 13 Sep 2021 12:51:58 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 792F9C061574; Mon, 13 Sep 2021 09:50:42 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id oc9so6772595pjb.4; Mon, 13 Sep 2021 09:50:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=jKmrMtYAU38Ek0NsTISM2Zo8smzHINIMpeNn3tlnY80=; b=gCMrRKvqPWRUrkSrGMik2fdH4KgaFn6e7amxvH8g3f5m02GSWYxxZA5KVXZ+QmyxuS ngTNTvlGITaNNmuLrgSK6W1Lf3+gOT3SSrBj4I9VnjihlA5CQfO/drvGvwYB1EHjwfpN axizCznZzmp+Mi86btY97Sv53/NMUAYKAKfFkqw5pD8XztHkjadwTVt858bbnfDXIRU+ b8c9puerZoOFpzulKdEmmsoisWUXJ41mKCo2moG39jr8qHopuPEqNjMV01I23V9SnUXo 5VghUSpYCtkpGy5n4ZXIcG6LadKt4AmcBCOeuRb10NWrZcvVU38TBULHGrFZTIER4JIV CR0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=jKmrMtYAU38Ek0NsTISM2Zo8smzHINIMpeNn3tlnY80=; b=cqMKhziJfM9dL4A4cHVqZ/KOzYWY0ZvoCoajr8cUvdFHWVLOXCdruINeqG160E2hOm FtS+CuFsDL1t4U1JfSu0MApbBc8yYX3xE+Ii+ZK4CEJaglHiaWXmC/Aoq/Ea6vUUuVA9 DCldrK/F78uMSx8dXDz1Lx639aYiIA/S+lYNNLLyAAme552zE4R1KsLwozWZixwhIKug Z+wBop9o3dkWnllgraTgSva6JNhWO43uV1OWET+Dmb1A17RQrLxEhKWjqa1xV+uxCsf1 XDywxGwhvQerYZlaK7alwIuFlmeIEUKA+XumgKVUUjHgz9mYXtW3OVfkIcZXdH8tYzOD 3XAw== X-Gm-Message-State: AOAM530l1r1kbY2pBdKIXFW/YPETDTYkK/lPyMtpbry4mchlwoHxB93Z rXBnw0aWsz/WzUrDgq+8ZvkoKOKUtzY= X-Received: by 2002:a17:902:a407:b0:138:849b:56f6 with SMTP id p7-20020a170902a40700b00138849b56f6mr11398144plq.0.1631551841867; Mon, 13 Sep 2021 09:50:41 -0700 (PDT) Received: from [192.168.1.121] (99-44-17-11.lightspeed.irvnca.sbcglobal.net. [99.44.17.11]) by smtp.gmail.com with ESMTPSA id u24sm7754410pfm.85.2021.09.13.09.50.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 09:50:41 -0700 (PDT) Message-ID: <77c03355-f05e-2731-806d-df7e95c45b12@gmail.com> Date: Mon, 13 Sep 2021 09:50:38 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [RFC PATCH net 3/5] net: dsa: hellcreek: be compatible with masters which unregister on shutdown Content-Language: en-US To: Vladimir Oltean , netdev@vger.kernel.org Cc: Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Kurt Kanzenbach , Hauke Mehrtens , Woojung Huh , UNGLinuxDriver@microchip.com, Sean Wang , Landen Chao , DENG Qingfang , Matthias Brugger , Claudiu Manoil , Alexandre Belloni , Linus Walleij , George McCollister , Heiner Kallweit , Russell King , Oleksij Rempel , Michael Grzeschik , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Lino Sanfilippo References: <20210912120932.993440-1-vladimir.oltean@nxp.com> <20210912120932.993440-4-vladimir.oltean@nxp.com> From: Florian Fainelli In-Reply-To: <20210912120932.993440-4-vladimir.oltean@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/12/2021 5:09 AM, Vladimir Oltean wrote: > Since commit 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA > master to get rid of lockdep warnings"), DSA gained a requirement which > it did not fulfill, which is to unlink itself from the DSA master at > shutdown time. > > Since the hellcreek driver was introduced after the bad commit, it has > never worked with DSA masters which decide to unregister their > net_device on shutdown, effectively hanging the reboot process. > > Hellcreek is a platform device driver, so we probably cannot have the > oddities of ->shutdown and ->remove getting both called for the exact > same struct device. But to be in line with the pattern from the other > device drivers which are on slow buses, implement the same "if this then > not that" pattern of either running the ->shutdown or the ->remove hook. > The driver's current ->remove implementation makes that very easy > because it already zeroes out its device_drvdata on ->remove. > > Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") > Link: https://lore.kernel.org/netdev/20210909095324.12978-1-LinoSanfilippo@gmx.de/ > Reported-by: Lino Sanfilippo > Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli -- Florian