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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 2020CC11F6A for ; Thu, 1 Jul 2021 16:48:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08163613E8 for ; Thu, 1 Jul 2021 16:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230002AbhGAQua (ORCPT ); Thu, 1 Jul 2021 12:50:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbhGAQu2 (ORCPT ); Thu, 1 Jul 2021 12:50:28 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 610F6C061764 for ; Thu, 1 Jul 2021 09:47:58 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id g19so11811059ybe.11 for ; Thu, 01 Jul 2021 09:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=4uRX24voOSIDHbQVqER+usC3/rZFKIdOkp91h4ZSrVY=; b=wNv96Uk4ixkMdGS08FR6eNSn1+75uPwjjyujZSdLdrshgiTFabz+nFm6vgNi/szhvd +xagmlbUnOdSVGceT95RYANUi4wlb2LzZ48UiY4ksVAJxg/uf5ehYw5nqWpef0IU3XDZ 8AaxkxJWm/1ywM/gXU10cydNW4004FMs3XZss0AliCdAW1Ggj8fRqRnjEO1z6ywUumgE 7QeI6ESsXo/ANTJ8YaAZJeTmnna3P37obJQOM7ig+tBPPPvekr1ysRJ5zocmpzJUGtQ8 qGRgXvzB10dXdfYOvRybHo5uA8ZOvMM5CUETxC4n0UPoITd7zOv+eP+t9qCXGGrJi4d/ ONVA== 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:content-transfer-encoding; bh=4uRX24voOSIDHbQVqER+usC3/rZFKIdOkp91h4ZSrVY=; b=t67YHDUz2cVC2tIUFR/MbvfUWNWzj8n35Bpa1ed3hISSAFQRHUbxQzRoCZVT9CkDHE ugxBy5GxRJQoIpVbl2oua/KYQLBCo7McQKL+BpiAQmEUJN5Lh54N31WlTY65t7Nn7mmQ dsPPI6NFfjd2gNtC3TkZ/C4p2eVE3GwwYcPlRsofCUNeCmLtOFH2n1eP63yXA2OKsy5t x4GsrA41Xe0Frexj7rnTrBet9yDDhlFv4OqKFgeB9YvYkRPRFYhh4sxx/wDe2d436LFR SLu8B23jckxbjmws0fZGOMJnA7PiEl5SNMLiwi1IICvREJvkiwSqb8Ad1c0ZYy41i+xG cbxQ== X-Gm-Message-State: AOAM531EucIWJobYmqDyuNu3mRF6EtaypEZYv12VlIdYQ/EBalzMhHks rtAclLp5PQWDCpUaTg1uNmVrLKDg7FpYlSV0OPbcYg== X-Google-Smtp-Source: ABdhPJzkWZZbFz/VJ5E1EUZradgQPO2i8YfdsXttHAc41DvpXCWy/FDNZQQSKkWTqW+GLPA7yOiPl3BbfaxRc0Cqd98= X-Received: by 2002:a25:abc3:: with SMTP id v61mr909197ybi.366.1625158077677; Thu, 01 Jul 2021 09:47:57 -0700 (PDT) MIME-Version: 1.0 References: <20210701152825.265729-1-jglisse@redhat.com> In-Reply-To: <20210701152825.265729-1-jglisse@redhat.com> From: Bartosz Golaszewski Date: Thu, 1 Jul 2021 18:47:47 +0200 Message-ID: Subject: Re: [PATCH] misc: eeprom: at24: Always append device id even if label property is set. To: =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= Cc: LKML , Diego Santa Cruz , Jon Hunter , "Stable # 4 . 20+" , linux-i2c , Alexander Fomichev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 1, 2021 at 5:28 PM wrote: > > From: J=C3=A9r=C3=B4me Glisse > > We need to append device id even if eeprom have a label property set as s= ome > platform can have multiple eeproms with same label and we can not registe= r > each of those with same label. Failing to register those eeproms trigger > cascade failures on such platform (system is no longer working). > > This fix regression on such platform introduced with 4e302c3b568e > > Signed-off-by: J=C3=A9r=C3=B4me Glisse > Cc: Diego Santa Cruz > Cc: Bartosz Golaszewski > Cc: Jon Hunter > Cc: stable@vger.kernel.org > Cc: linux-i2c@vger.kernel.org > --- > drivers/misc/eeprom/at24.c | 17 +++++++---------- > 1 file changed, 7 insertions(+), 10 deletions(-) > > diff --git a/drivers/misc/eeprom/at24.c b/drivers/misc/eeprom/at24.c > index 7a6f01ace78a..305ffad131a2 100644 > --- a/drivers/misc/eeprom/at24.c > +++ b/drivers/misc/eeprom/at24.c > @@ -714,23 +714,20 @@ static int at24_probe(struct i2c_client *client) > } > > /* > - * If the 'label' property is not present for the AT24 EEPROM, > - * then nvmem_config.id is initialised to NVMEM_DEVID_AUTO, > - * and this will append the 'devid' to the name of the NVMEM > - * device. This is purely legacy and the AT24 driver has always > - * defaulted to this. However, if the 'label' property is > - * present then this means that the name is specified by the > - * firmware and this name should be used verbatim and so it is > - * not necessary to append the 'devid'. > + * We initialize nvmem_config.id to NVMEM_DEVID_AUTO even if the > + * label property is set as some platform can have multiple eepro= ms > + * with same label and we can not register each of those with sam= e > + * label. Failing to register those eeproms trigger cascade failu= re > + * on such platform. > */ > + nvmem_config.id =3D NVMEM_DEVID_AUTO; > + > if (device_property_present(dev, "label")) { > - nvmem_config.id =3D NVMEM_DEVID_NONE; > err =3D device_property_read_string(dev, "label", > &nvmem_config.name); > if (err) > return err; > } else { > - nvmem_config.id =3D NVMEM_DEVID_AUTO; > nvmem_config.name =3D dev_name(dev); > } > > -- > 2.31.1 > Cc'ing Alexander Fomichev who reported this issue first. This is the second time someone raises this problem so it seems that this change really broke many existing systems. I will apply this patch and send it for stable. Bart