Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2506213rdb; Wed, 15 Nov 2023 02:47:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFHpHklmUmeAm/V3wxkrEcGizG/W2aVzTIDFvH+dzdvaiZrPtI+jncJglhbtjdqAk31+Cow X-Received: by 2002:a05:6870:3e0c:b0:1f4:ecdb:fb2 with SMTP id lk12-20020a0568703e0c00b001f4ecdb0fb2mr12491175oab.54.1700045226811; Wed, 15 Nov 2023 02:47:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700045226; cv=none; d=google.com; s=arc-20160816; b=chthuo4Fc+QYiq1gn4u2TcoamCZprvBJcnKF4RLAuJeY5l40anpjUGRCWeuqARkXmq cp3rK46Fa/kCncKXl92cKJQ0YCmEXU/8vVo5MfZoRRkXQb9PKow3rFhu9WRsaKbj6ENx zUYlg8xN9e+H4JTc8B0/m6Ma8OWPr2aB+25SkqLhfto2cC/UmpIWURXxjL1zTpOZXlao mcuMPkAbv0KdYKO0fQQvxtYnbtfxc1P4rzsMzA4yAKaqUk8x6XrYvliplVqaQokvovyB TjJekqLcoK5RQH1914NFFAZLUm/qYFKj7l5C8O1pL+pe8JxXWYyL8IdHGeIneAbsdYlE IF4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ROkFb04XM1IxjJN8kBBQDGZACqrnfUK4tYFptKzTTH4=; fh=zPHW/UqUTWYJvJiLQ+R55u+v1m6UoL/blIuFPOh8r/M=; b=0dnd0AQKaG/In/c9v7AR+uDDV9MyXgPuGwwqajxMG1UphAYPb82b6yIhtvxfrC468e a4ermWMuz1PORhJrrKmH/zoG2a4Ruuz5yjjx92Z0TPot3CkC5i0qFTL+r4rPV0wBOInE Da08vRXVQZbODJWuYG7xMh54BjVtEGgvEB67AVJg+efVpo+YECvOm4bLu+Wvnf72lw/x pdfjhDg+t5LOt6+iu5TvAL6VSAjM/VdCaIhz+kt1YgbvcUgOHx1hXOPX+TA7xSvpa234 ANQmX4VulsnladYJFzm4gjBYLF1GLWHpm9gEFfhlTzXdQQivPLZ6oHTPCe5zv0eiu0In 741A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qq+AUoDY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ay35-20020a056a00302300b006b28fa70b48si10032421pfb.354.2023.11.15.02.47.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 02:47:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qq+AUoDY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 807D48027972; Wed, 15 Nov 2023 02:47:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234861AbjKOKqw (ORCPT + 99 others); Wed, 15 Nov 2023 05:46:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234868AbjKOKqv (ORCPT ); Wed, 15 Nov 2023 05:46:51 -0500 Received: from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com [IPv6:2607:f8b0:4864:20::b29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D42F11D for ; Wed, 15 Nov 2023 02:46:48 -0800 (PST) Received: by mail-yb1-xb29.google.com with SMTP id 3f1490d57ef6-d9c66e70ebdso6563069276.2 for ; Wed, 15 Nov 2023 02:46:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700045207; x=1700650007; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ROkFb04XM1IxjJN8kBBQDGZACqrnfUK4tYFptKzTTH4=; b=Qq+AUoDYOc0a0eZiNSOetS2+1E0nngzjuMOsneF5hIfylZiWdT9ZoP4aLDorF0DzHB t871xYM4WDv7BcCnOl/YDghEm9Jeo0nu8QB5bwwfjBvdL2uEQrs8E/WOTw1BYnUNm9dB 2OpunecgX1tOn6KQ2KZ4POn2jk3yVP9+94Krp2CwjNEXwHHDKovgn3hWTstjuURXYmB0 vu71QXY6q5RA1BGG0FfLUl3VIHV+DUKl4qii+Iyc0NLNpDDm8XXTebl8ejvdU/rgnZZF Y4bl7E22unXcwE68G2wRItJEa97GHfASywOCn1Px/AIXifq22TIC9FwSadMNhNb3Qwhw Eajg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700045207; x=1700650007; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ROkFb04XM1IxjJN8kBBQDGZACqrnfUK4tYFptKzTTH4=; b=J4/vm4qmsW5+4eEOi2xVgnxGa2G6/4AyE+03pPX6qemA89S7JLYfos08Y8gmsVFQni DI3EY1boT8vgL8ed7eD47V+VQS9E2zpAKoLGJlLyVBXe7LzprDr6KbbHg5qcfJpRpVfE MDHjrsE52ogNdHIqjwsutEPfGWmllkhK/Ykxoojs7WLTjqUGTAayr6b7CoeyWDHHKQhx KtrsavauJPUvbQUoGDh3j+Pkvhd7KK+k+s10CA5xkHf/RfUYsbre/ecp/VKY+ScoONd0 szCTT1zZmaKVnshY3fup2EYOteZaZu8/k4CXwvFxe1n3IVa/kWhOaCTs1o+0OwmLAT8+ Lpmw== X-Gm-Message-State: AOJu0Yw2G6RtPH6lPom2i+W0tOsjBBPdQggZb3m7AVNCdV5bwcCOk+OX Ggtg+rTCmh3ZuKEbDIDVHBuWpidnm/bCX7q0v9CwCw== X-Received: by 2002:a25:6951:0:b0:da3:ab41:2fc8 with SMTP id e78-20020a256951000000b00da3ab412fc8mr11210436ybc.16.1700045207354; Wed, 15 Nov 2023 02:46:47 -0800 (PST) MIME-Version: 1.0 References: <20231115102824.23727-1-quic_aiquny@quicinc.com> In-Reply-To: <20231115102824.23727-1-quic_aiquny@quicinc.com> From: Linus Walleij Date: Wed, 15 Nov 2023 11:46:36 +0100 Message-ID: Subject: Re: [PATCH v3] pinctrl: avoid reload of p state in list iteration To: Maria Yu Cc: andy.shevchenko@gmail.com, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@quicinc.com, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 02:47:04 -0800 (PST) On Wed, Nov 15, 2023 at 11:28=E2=80=AFAM Maria Yu = wrote: > When in the list_for_each_entry iteration, reload of p->state->settings > with a local setting from old_state will makes the list iteration in a > infinite loop. > The typical issue happened, it will frequently have printk message like: > "not freeing pin xx (xxx) as part of deactivating group xxx - it is > already used for some other setting". > This is a compiler-dependent problem, one instance was got using Clang > version 10.0 plus arm64 architecture with linux version 4.19. > > Fixes: 6e5e959dde0d ("pinctrl: API changes to support multiple states per= device") > Signed-off-by: Maria Yu > Cc: stable@vger.kernel.org Patch applied, I edited the commit message a bit. Thanks a lot for finding this tricky bug! Yours, Linus Walleij