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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 342D6C433EF for ; Mon, 21 Feb 2022 08:21:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236134AbiBUIVb (ORCPT ); Mon, 21 Feb 2022 03:21:31 -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-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> 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; } ... } ... } 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 72EE1C433F5 for ; Mon, 21 Feb 2022 08:22:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=y1T4MrHXZMmG2YKdK8PJLhFOB1+cfY+8bA3kdaoIIhc=; b=FsEcL1WihER1k1 +XmEzwGmzzQdO3E3w+dxXnM4FkhG0wQOUZqYpQI0fJMjBPJwALlqTQLznTqkHRvVac2dy1bOABiYe Wu1rI1L3mFwK2IvRrpubXHrbZS9HmbsCDlTLIzzXwxAaNfi0tMm/oegPZsBzmRvujxezMksaJug3n ZezoGZi2siM9HpwS2PHvCbRcuUmmvIUk1+aJKmCSbORyNmhV14oUQHZ5iwmewTynFCt3sHqQ0okyE T7JLy4tYyaJAPzRr87zNHqZ6TTEV6jwo4Lbwq5hYjRSkQiVBnRFK5RBWy0DGXNh4bXkLTJZMaF/CK ioYnXxocdy/SV7+RxeAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nM3wF-004Fhq-CT; Mon, 21 Feb 2022 08:20:55 +0000 Received: from mail.pr-group.ru ([178.18.215.3]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nM3wB-004Fgc-Ac for linux-arm-kernel@lists.infradead.org; Mon, 21 Feb 2022 08:20:53 +0000 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-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-Disposition: inline In-Reply-To: <20220221072529.GP2249@dragon> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220221_002051_739149_55FD10A6 X-CRM114-Status: GOOD ( 13.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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; } ... } ... } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel