Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3593338pxb; Mon, 21 Feb 2022 01:16:58 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKAf5FFD8sXWr+O0paFh9th5FzUORbCsn2KH4A+Ckkz618uQ+B0vPux6aRUG5QXp66M9o6 X-Received: by 2002:a17:903:281:b0:14c:f3b3:209b with SMTP id j1-20020a170903028100b0014cf3b3209bmr17620048plr.87.1645435018707; Mon, 21 Feb 2022 01:16:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645435018; cv=none; d=google.com; s=arc-20160816; b=wxJ4QOsLDmjaA5DW6WEq68539JDLMY8qv/uhn1I4z65zMG5D0hmSjKpv5V4i/h+U04 Jy4Jn7+YTBVFZMMcDqIyDjcYcYmRuMMXLMi+uvFsMcjJy3UtsC1WgCfpoROXYsLPXjav pdSA+TV5/hNZy05K83rGOkT4Kx4Ot83NUEcUb29R3bHorFs2iF0KthmfswaEswIqCMsr sTw2KZQtqWVtrMH9R4gkgoWG4KYPY4mGQlz9iPgDQdW23MA17jqgBR3B8jMCS4z4DT41 BJMSbz1Fi7RXVr/FSJbfIvnrZoGkaC1YnJmF4DQeDgboO/wxR4h0DQsR1OM8V8H3gXGs Qysw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dITzBIOzZKgWLtny7NpXKRthcxaYnJMVwa2olA3M5YY=; b=NPAIn8qRSXw6VKAK4jevp2iPDN5gNh5pRd8LqSOlovuC3rL6H/6qB7ZDsjbm0P5JlL P67ZhLpVb2T6DB6WZUwUViRmcIy7QmLb0Q16U4RkX0Hwv7WUMwQqQGkh9X9OGsL92UA0 ca3y57e24hv5Pb+e0hFtbZPqmieHgHc3V/BzQq6GjWdCTQwZIbBuZDGWcLIEqIu7u6L+ R0VlAG/14v1qLYJzoXbdeU0Q4+wXrFgcIUz6T/dyYfFPY+zuQyb9rfK2ELVSKx68cBkS KlSYX798qjAlb4VUxRLfU8UYrcWEDSxBvUYgwbrX4qvTMoUECqIpKCcNXlVWkIy9pByF qBGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@metrotek.ru header.s=mail header.b=FfsFM+55; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t21si563971pgv.267.2022.02.21.01.16.44; Mon, 21 Feb 2022 01:16:58 -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=fail header.i=@metrotek.ru header.s=mail header.b=FfsFM+55; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236002AbiBUIV3 (ORCPT + 99 others); Mon, 21 Feb 2022 03:21:29 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:59472 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230419AbiBUIV1 (ORCPT ); Mon, 21 Feb 2022 03:21:27 -0500 Received: from mail.pr-group.ru (mail.pr-group.ru [178.18.215.3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1625B1DA58 for ; Mon, 21 Feb 2022 00:21:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=metrotek.ru; s=mail; h=from:subject:date:message-id:to:cc:mime-version:content-type:in-reply-to: references; bh=7QBc0WEBLu2ln1764MB4fDjlliPNaheIMyMLRttnsXw=; b=FfsFM+55j6jE1hipisrdQZk81jVsUXPCd2hotITo6/IfA3lBXSD4SM/94U5nGmi2hjZ36yJM4g7Y9 UOsBHbvzr3LLlXpurcQRFkbwpUux24x0Sv1S0iD8PEpjmRyYfe0g+16EXno8nawr8TnYnpAE5ZNumU Kr2+gpTKAaO+GeFAQz1JFzumkbllfJs/rc+a66tU2eRHUjJJIF/IN+UHSZFMZetjNUfUgKfdH1V9cR 4d+eB/Yu2jcuVJaC7hvuOsiagOkM6nMziV/NWp9Xf+1H5BYmQksNkDgwKaIJIxXAW2Efam/XsXnqbB keUJeRh9dF9c4V1wc8jeil0GQF2aRGg== X-Kerio-Anti-Spam: Build: [Engines: 2.16.2.1403, Stamp: 3], Multi: [Enabled, t: (0.000008,0.005762)], BW: [Enabled, t: (0.000022,0.000001)], RTDA: [Enabled, t: (0.062456), Hit: No, Details: v2.25.0; Id: 15.52k7rm.1fsdlslmm.1bdlg; mclb], total: 0(700) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Level: X-Footer: bWV0cm90ZWsucnU= Received: from x260 ([178.70.66.234]) (authenticated user i.bornyakov@metrotek.ru) by mail.pr-group.ru with ESMTPSA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256 bits)); Mon, 21 Feb 2022 11:20:40 +0300 Date: Mon, 21 Feb 2022 11:02:44 +0300 From: Ivan Bornyakov To: Shawn Guo Cc: s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, system@metrotek.ru Subject: Re: [PATCH] bus: imx-weim: add DT overlay support for WEIM bus Message-ID: <20220221080244.bd7wankcdsiwzum4@x260> References: <20220205055006.23447-1-i.bornyakov@metrotek.ru> <20220205055006.23447-2-i.bornyakov@metrotek.ru> <20220221072529.GP2249@dragon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220221072529.GP2249@dragon> 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 Mon, Feb 21, 2022 at 03:25:29PM +0800, Shawn Guo wrote: > On Sat, Feb 05, 2022 at 08:50:06AM +0300, Ivan Bornyakov wrote: > > Add OF reconfiguration notifier handler for WEIM bus to setup Chip > > Select timings on runtime creation of child devices. > > > > However, it is not possible to load another DT overlay with conflicting > > CS timings with previously loaded overlay, even if the first one is > > unloaded. > > Are we doing anything if that happens? > On device removal there is no access to device node properties, thus it is not possible to find out which of CS timings was configured for this device to clear theirs 'is_applied'. So, if we apply one DT overlay, configure some CS timings, remove this overlay, apply another with conflicting timings, we will fail here static int weim_timing_setup(...) { ... for (reg_idx = 0; reg_idx < num_regs; reg_idx++) { ... /* prevent re-configuring a CS that's already been configured */ cst = &ts->cs[cs_idx]; if (cst->is_applied && memcmp(value, cst->regs, devtype->cs_regs_count * sizeof(u32))) { dev_err(dev, "fsl,weim-cs-timing conflict on %pOF", np); return -EINVAL; } ... } ... }