Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2074238rwd; Thu, 15 Jun 2023 21:38:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6ypKPz7A7YTqWHd4s4tsfPR9VhB7efr8pb3nSrNOqofotuQyAwpWDhvQ8WHPfgQOxcxemx X-Received: by 2002:a05:6808:bcb:b0:398:57ac:23fe with SMTP id o11-20020a0568080bcb00b0039857ac23femr1492664oik.10.1686890321591; Thu, 15 Jun 2023 21:38:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686890321; cv=none; d=google.com; s=arc-20160816; b=HFw9zAWHI2/++q8CrmoqpNkpp16BrBniXid1u4rZnD1EYsgL90y+1P1FGhKlDUjvTO EEItynP5Otlrs9138dIdFCC7Ge3lC1+n1pL/qyOwzyJqSqmSjgtDQNISndeSLYNR6lck rRfxKIi6F9ZnVWAVjqIkYaaV85geS5f3ebApmkf2tJUkzpzKAEtZr8Ee7GZKe1p4LcSy eZFyVlzQCGDwQsl2mx2coqhMvVkXb3f2gkI/fZl3RGclWNbDfGpReNiaVyAfZNMysuoY QYY7GcL0setXzb5CJhsfLXW7mGKQ9XAm/r7wUG7Ta9+TPfoI9GQRJ/J1Asj+rNt4Z86/ rsIg== 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=Y6kUQJ2oaECsBSDSAayXfsHXsy3gCQva2UbjpQg9ET4=; b=isILKfgVDLI1vgWxN3dYlcZJNoA9+xqHfMX1MsOZyjaqRREAbP8/WQ9M8KFF9XweYQ S/dgpI1L24AoG9ftjYviDy/OIc3YfOLJ7+5jSofTYzkdsX8DQcHchmORWSERcCKuUjrR NVZf+Wjz8qZpN6O4qKMRB3fFSFi/S69NkPFI1mwYAS8kiKsA09KDJu7CndCiD9xeLu02 vosUfafOPNJYruYtU0OAriHXWs92+pc6ZA10dFIMHo03v7lV9A1Bp6gZOcRjQfZNIgAg DLmzuk+RuLyqbIzsb9DH2ogSzjUxHrjVLhMK9EJPDVjSy66DWrC0unCqv0xveMKExgpO vYGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VdN+gFfG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z24-20020a17090ab11800b0025c287f697asi378410pjq.35.2023.06.15.21.38.30; Thu, 15 Jun 2023 21:38:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VdN+gFfG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241882AbjFPDK5 (ORCPT + 99 others); Thu, 15 Jun 2023 23:10:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241771AbjFPDKa (ORCPT ); Thu, 15 Jun 2023 23:10:30 -0400 Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD46B2D4E for ; Thu, 15 Jun 2023 20:10:23 -0700 (PDT) Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-46e4ba859c5so71177e0c.2 for ; Thu, 15 Jun 2023 20:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686885023; x=1689477023; 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=Y6kUQJ2oaECsBSDSAayXfsHXsy3gCQva2UbjpQg9ET4=; b=VdN+gFfGuR0v7U1J1avatXEFmDHfZHhOEPFcWuLwzL6e6adjM1gQQHvPclBAMCk/no aUiYWiB03T+1hr1VHDKhuV9/nRRPWccnJA+Rfc9a/2FSuy0P2tfsNMEKN59pdmFV1B38 E9mYq70J8vHpnVxM8kB4Vd39XkG4SjDCVR5YI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686885023; x=1689477023; 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=Y6kUQJ2oaECsBSDSAayXfsHXsy3gCQva2UbjpQg9ET4=; b=IZWcs/r5o5S8Tr5TUPpkT9iV1V0k2nxXehRNtlketdROHVF4zy1iM3jW+NkzCdb1lA 4LlXtsx/mwaJYsnB0AhhGaqljS+3uNgHnT4g/SnMGh42y6T5kClhoXLvGNbyxpSZzpAa 04r1H/WRMR7LWuhi+A0u1tcuvPD0XSj6rQdCHI9efs+dpYhWy69s/bHBYyPhoZnmeYpJ Rx5C2Xr9rp3DzJ0UMZ0lkQugkxv/wQattS5WeiaVRkNhJWybBsqmbgWkTMwtLjkAtBGa VHZJhtqDzFSmBBARmnr7zvyRVADGXdXaihCjIwVURW9zVj2+V9lPi4b6U4ENeOVIMqml lLCQ== X-Gm-Message-State: AC+VfDz97Hh7pphPn1Ka1ZFlxT4AYD6Vo+/pYtnjKLjLTexyQ14C9Q78 LPA4h8wOX4gIZf54nZljVkhdSIT5ZJ8blYK9T9KYqA== X-Received: by 2002:a1f:45c1:0:b0:471:17be:ba8d with SMTP id s184-20020a1f45c1000000b0047117beba8dmr1120129vka.3.1686885022864; Thu, 15 Jun 2023 20:10:22 -0700 (PDT) MIME-Version: 1.0 References: <20230615122051.546985-1-angelogioacchino.delregno@collabora.com> <20230615122051.546985-2-angelogioacchino.delregno@collabora.com> In-Reply-To: <20230615122051.546985-2-angelogioacchino.delregno@collabora.com> From: Chen-Yu Tsai Date: Fri, 16 Jun 2023 11:10:11 +0800 Message-ID: Subject: Re: [PATCH 1/3] clk: mediatek: clk-mtk: Grab iomem pointer for divider clocks To: AngeloGioacchino Del Regno Cc: sboyd@kernel.org, mturquette@baylibre.com, matthias.bgg@gmail.com, u.kleine-koenig@pengutronix.de, msp@baylibre.com, miles.chen@mediatek.com, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, kernel@collabora.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 15, 2023 at 8:21=E2=80=AFPM AngeloGioacchino Del Regno wrote: > > In the rare case in which one of the clock drivers has divider clocks > but not composite clocks, mtk_clk_simple_probe() would not io(re)map, > hence passing a NULL pointer to mtk_clk_register_dividers(). > > To fix this issue, extend the `if` conditional to also check if any > divider clocks are present. While at it, also make sure the iomem > pointer is NULL if no composite/divider clocks are declared, as we > are checking for that when iounmapping it in the error path. > > This hasn't been seen on any MediaTek clock driver as the current ones > always declare composite clocks along with divider clocks, but this is > still an important fix for a future potential KP. > > Fixes: 1fe074b1f112 ("clk: mediatek: Add divider clocks to mtk_clk_simple= _{probe,remove}()") > Signed-off-by: AngeloGioacchino Del Regno Reviewed-by: Chen-Yu Tsai