Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp9525839rwl; Wed, 11 Jan 2023 06:51:01 -0800 (PST) X-Google-Smtp-Source: AMrXdXs1as4T9NZ3KpuLtEUGPthkxUSDIaz2yNRlFBYYBQPkpHxOqrqDF1G/UDVc3z1zrhJCJA1D X-Received: by 2002:a05:6a21:788b:b0:ad:db18:e4d with SMTP id bf11-20020a056a21788b00b000addb180e4dmr110353862pzc.43.1673448661149; Wed, 11 Jan 2023 06:51:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673448661; cv=none; d=google.com; s=arc-20160816; b=JJtLBaNK8lHhpyDAkDKYGYCj5Hgh/JWp1NBmDx0FG3xo35jDbYC3KQHv+rBI80Fqk7 K5/4MGSxIDjBsJJKu5HWC60P7RrSiRHJqIXsNd5I48gU6GPLTXkjv1Q5P+WJxYuQS7Uu VpP5gsX1cPHsPRLh2rRVxm/qbOCL5db7IPK992CUGM7Y+JjVm4Q3298aZEh0MO9Batis vQ462rx1he8xA6A1U7aNTED9tc11VUfJiE9ldm3Syt7RR/g1obvalMQWnDpUGxmNtHEx JJH9KVzNr07WsBjSfI6m/ZXiTG+hJ+EV/3OjRwnUZAqpVCkV9vSMDun5Yr0wX7mJr3RP sx+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=MsRiYaskdg0sGF5xunXMD9m3T+0b8GQ25pP1FBEfa78=; b=vTwT8IkIEHlf8O4cjER5H5A7yBD+v4P548QA7Hxc+ahCedzyhjwCtlC3U2Hy+1BUgW 1QXQ3wx8yqUCUcFu/JaFlqKRF5mbBkiJNSHAZMIXsyJ1v7ZksCAgT0Bu2A0iHzu9ncFZ JkiCIu8k+CXRPseJPv6Aogap54Y3I/eB8reEkqIVj40jPW4jzl4wzNW5L0+cFO70eVSH gpo00qbNKLqVqpiHIaEuajZFHZtAUhqrAXo86Y42Cj8uXIC4y91fK1VVVktyNEHWhlfE StFwXnAhG+V9VbpRBiNm2hZn1HK8sLeejHdKJcP6pniXb9vafcmHvAWni/JyX369K0GR 3g6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=jA174vWC; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i190-20020a6387c7000000b004b752450972si1507457pge.38.2023.01.11.06.50.54; Wed, 11 Jan 2023 06:51:01 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=jA174vWC; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239002AbjAKOTu (ORCPT + 53 others); Wed, 11 Jan 2023 09:19:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232062AbjAKOT3 (ORCPT ); Wed, 11 Jan 2023 09:19:29 -0500 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E762425E8; Wed, 11 Jan 2023 06:19:28 -0800 (PST) Received: by mail-pl1-x636.google.com with SMTP id p24so16893975plw.11; Wed, 11 Jan 2023 06:19:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MsRiYaskdg0sGF5xunXMD9m3T+0b8GQ25pP1FBEfa78=; b=jA174vWChBCl1oLhIVR5CZgUkaLSxfe0qehzqMNvikd01BgCeK4vndS4AsU1qHWsUR oY/kx6YXEvOcEPcFjTCCOpItrgok6kroMOFaQWvRu/exo0a91OLN2LEU8iVymYS1Z0of 6Wu3tKdwNBEdxCxv4XIs9GsPJquwneNlGzJokf6wOnZyAC6Gf5VraR5M5tawHaIFpo2S G3lkp2rCyH4zYhCHelH1W/CSJAyxGQiHT9tHQV/oH2xslrSUhutL+s90kqLjqyA3ty5C ZOP85fCu/tG45BE9Zp+puSWPBJM18Ow2EQhWxmoeuCj5PZKvhuZOwWRgSuauyGpi0Mtr z/aw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MsRiYaskdg0sGF5xunXMD9m3T+0b8GQ25pP1FBEfa78=; b=D77CQxUIjIxvI67ZWcldo3Gi4VrF6gktyByzVUna/9iR5iSh7LbAe60iFDeWtYne1U 77Iv1YNiOxnHknRFADgfiTvGyzgzJdGcU1rVtlEbDsl4+VtgvwZ2K+CfrA5icUG3ElMg SPeSdwSRq5+kTA+9zLdSmaZ6uird7tZZRbU7ILzkpMiloazrJJ+ZqRzdsMWa7Qp42RxI D0bWQlv8osJ4Dg+3F+K4JeOdPJ2cD49TapUQvCsGtx67+Nr7LZ7E6as1GOSl75EY9eFu 844wpwbvGYGBzM4O9SDQrGvwfrklTk0+k0XwsUxS2pwoZmC49FbAp4Xh5t9KH+qzJEK+ RzfQ== X-Gm-Message-State: AFqh2kp9/ggxaozDVMJChYBNXvtWUwDkwEgjobVO/0c+fYj8ftF+L8Uu DJvg2wpIeF39qQZgZH/pWYRQJM/aeZQ= X-Received: by 2002:a17:903:1315:b0:192:ccfc:c178 with SMTP id iy21-20020a170903131500b00192ccfcc178mr35630421plb.52.1673446768369; Wed, 11 Jan 2023 06:19:28 -0800 (PST) Received: from localhost.localdomain ([240b:12:500:6500:140c:f2c2:6a66:e450]) by smtp.gmail.com with ESMTPSA id l5-20020a170902f68500b00189c62eac37sm343480plg.32.2023.01.11.06.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Jan 2023 06:19:27 -0800 (PST) From: INAGAKI Hiroshi To: rogerq@kernel.org, tony@atomide.com, krzysztof.kozlowski@linaro.org Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, INAGAKI Hiroshi Subject: [PATCH] memory: omap-gpmc: fix multi-device handling on the same CS Date: Wed, 11 Jan 2023 23:13:46 +0900 Message-Id: <20230111141346.1516-1-musashino.open@gmail.com> X-Mailer: git-send-email 2.39.0.windows.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 This patch fixes the handling of multiple devices on the same CS by replacing CS name to "name" of node instead of "full_name". In c2ade654dbf7d02f09ad491f5621fc321d4af96b ("memory: omap-gpmc: Use of_node_name_eq for node name comparisons"), the name for setting to CS was replaced but it doesn't fit for the comparison by of_node_name_eq. In of_node_name_eq, the length for strncmp will be obtained from the node that trying to register and it doesn't contain the length of "@,". But the base name for comparison passed from registered CS name contains the prefix, then, that two lengths won't match and false will be returned, and registration on the same CS will be failed. example (Century Systems MA-E350/N, AM3352): - Device Tree /* memory mapped gpio controllers on GPMC */ gpio@2,2 { reg = <2 0x2 0x1>; /* CS2, offset 0x2, IO size 0x1 */ ... }; gpio@2,10 { reg = <2 0x10 0x1>; /* CS2, offset 0x10, IO size 0x1 */ ... }; gpio@2,12 { reg = <2 0x12 0x1>; /* CS2, offset 0x12, IO size 0x1 */ ... }; gpio@2,14 { reg = <2 0x14 0x1>; /* CS2, offset 0x14, IO size 0x1 */ ... }; - dmesg [ 1.596402] omap-gpmc 50000000.gpmc: cannot request GPMC CS 2 [ 1.596434] omap-gpmc 50000000.gpmc: failed to probe DT child 'gpio': -16 [ 1.596489] omap-gpmc 50000000.gpmc: cannot request GPMC CS 2 [ 1.596511] omap-gpmc 50000000.gpmc: failed to probe DT child 'gpio': -16 [ 1.596564] omap-gpmc 50000000.gpmc: cannot request GPMC CS 2 [ 1.596586] omap-gpmc 50000000.gpmc: failed to probe DT child 'gpio': -16 ("gpio@2,2" is ok, "gpio@2,10", "gpio@2,12", "gpio@2.14" are fail) Fixes: c2ade654dbf7d02f09ad491f5621fc321d4af96b ("memory: omap-gpmc: Use of_node_name_eq for node name comparisons") Signed-off-by: INAGAKI Hiroshi --- drivers/memory/omap-gpmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/memory/omap-gpmc.c b/drivers/memory/omap-gpmc.c index d78f73db37c8..3e3e84e34795 100644 --- a/drivers/memory/omap-gpmc.c +++ b/drivers/memory/omap-gpmc.c @@ -2202,7 +2202,7 @@ static int gpmc_probe_generic_child(struct platform_device *pdev, dev_err(&pdev->dev, "cannot request GPMC CS %d\n", cs); return ret; } - gpmc_cs_set_name(cs, child->full_name); + gpmc_cs_set_name(cs, child->name); gpmc_read_settings_dt(child, &gpmc_s); gpmc_read_timings_dt(child, &gpmc_t); base-commit: 13f35b3c72f4075e13a974f439b20b9e26f8f243 -- 2.25.1