Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10147786imu; Wed, 5 Dec 2018 17:18:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VMmPWXkRjUdJSpbJb33y/Hc+THGE8J41JQxISYjbk5CCtKTM+UMIGs0Vbm6UfMwIdJ+EHa X-Received: by 2002:a17:902:2862:: with SMTP id e89mr26770450plb.158.1544059130111; Wed, 05 Dec 2018 17:18:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544059130; cv=none; d=google.com; s=arc-20160816; b=FcyM16CDdc7xbZ3PWcogl5lH6OFtsEkat2p4x4fNO4zMIvurnegMRmTHr/xesXZcw/ Wfdx6rSo186DcN7FRLgTJDlDqhJ710Ds9wYvAoJJjHvtdFGK20XdKmRklDmI3k/vTiyh T8wJyaQiMjemh1pETzU/JsgmFiYAV1Zeqa8gpAW9hD27a6h6sVubb2tcFVtJM5RCn8RL Ec/J/equnk0TZK91N5FSsHqma4OczDIScfqwI+6pIGrR+2MQwKEdVfKJQHazoDOt7fKS VAe1LFZfVhHPoLVD0o+aWeqjkQxKsF1aEe/KkI8XofxbrtSy+ERAPCkaReIN3gePzmmp hoTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Jy5Uhvz2Quz3wWCLHtha+j275tJJrF23MoVqcSXJGNc=; b=IAk0UqNJuCyEPbicWSNvGOxOJ8mNZO/JkNOqtEqVCgSdcjdI6X0TQ2ZBmXqKibDJx8 edZn6fmwpLOyGTSRhEPDboZfgMi0LUfi1+iB/K+nJXZKGQRUZm9B8YNilOkG9IzsE96b O3N6W13XqfuQ4I+zdf5sbRAAecPVK7qMK4t42W5vEnjwjzFB28cejgUJ3ltBD09iBqSC n9QrDJUd1YWab6SxUBF+TMeQVxO4GRU0g+b1syT45RGR4Ru3l5SjTSIQrmX+gsdGfY9u a9+uWC7Ryr32zjAXs83ZJZsBQzqouhdkOFDtXCUGwsAyDfuP5md1bQeajpohvMn4I/Ds wVgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mR6ePTSr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a34si19034367pgb.458.2018.12.05.17.18.34; Wed, 05 Dec 2018 17:18:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mR6ePTSr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728798AbeLFBRa (ORCPT + 99 others); Wed, 5 Dec 2018 20:17:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:32938 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbeLFBRa (ORCPT ); Wed, 5 Dec 2018 20:17:30 -0500 Received: from dragon (61-216-91-114.HINET-IP.hinet.net [61.216.91.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B19D213A2; Thu, 6 Dec 2018 01:17:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544059049; bh=MspFuguXfofW1tCpXNBy2+Evn2PD+MaQszkWQB/huwM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mR6ePTSr9GsSyYGdOTk+Rz9kSNSoIHUyswhPn9d5dBk5ylG6tdga+qHQz3PMedZLW TvWsm1+Aik1+uxiwNQle28f4TOnQzQ7gtujepZkiyorGQ7iBXQxfCo2tZJ4lPyqZJX AowkGSG36QDRsHJHztJ9uvj9UV6NSPIwWCj9LpBE= Date: Thu, 6 Dec 2018 09:16:49 +0800 From: Shawn Guo To: Sven Van Asbroeck Cc: Kees Cook , Rob Herring , Arnd Bergmann , Linux Kernel Mailing List , devicetree Subject: Re: [PATCH v2 1/2] bus: imx-weim: support multiple address ranges per child node Message-ID: <20181206011647.GS3987@dragon> References: <20181130205624.16227-1-TheSven73@googlemail.com> <20181130205624.16227-2-TheSven73@googlemail.com> <20181205075145.GN3987@dragon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 05, 2018 at 10:08:16AM -0500, Sven Van Asbroeck wrote: > Hello Shawn, many thanks for the patch review, I really appreciate it ! > > On Wed, Dec 5, 2018 at 2:52 AM Shawn Guo wrote: > > > > On Fri, Nov 30, 2018 at 03:56:23PM -0500, thesven73@gmail.com wrote: > > > From: Sven Van Asbroeck > > > > > > Ensure that timing values for the child node are applied to > > > all chip selects in the child's address ranges. > > > > > > > I'm not sure about that. Shouldn't we have another child node for > > different chip select, something like below? > > > > &weim { > > acme@0,0 { > > compatible = "acme,whatever"; > > reg = <0 0 0x100>, <0 0x400000 0x800>; > > fsl,weim-cs-timing = <0x024400b1 0x00001010 0x20081100 > > 0x00000000 0xa0000240 0x00000000>; > > }; > > > > acme@1,400000 { > > compatible = "acme,whatever"; > > reg = <1 0x400000 0x800>; > > fsl,weim-cs-timing = <0x024400b1 0x00001010 0x20081100 > > 0x00000000 0xa0000240 0x00000000>; > > }; > > > > Shawn > > I am submitting patches for a device that spans chip selects :( > And such a device needs multiple address changes with different chip selects. > > Imagine we have an acme device, which contains a control and a fifo region, > on different chip selects: > > &weim { > acme@0 { > compatible = "acme"; > reg = <0 0x0 0x100>, <1 0x0 0x100>; > }; > }; > > Now in probe we can access both regions: > int acme_probe(struct platform_device *pdev) > { > control_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > fifo_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); > /* all ok */ > } > > But, if we have two separate child nodes, we also get two calls to probe(), > which assumes two devices on the bus, and that is incorrect: > > &weim { > acme@0 { > compatible = "acme"; > reg = <0 0x0 0x100>; > }; > acme@1 { > compatible = "acme"; > reg = <1 0x0 0x100>; > }; > }; > > int acme_probe(struct platform_device *pdev) > { > control_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > /* next call always fails */ > fifo_res = platform_get_resource(pdev, IORESOURCE_MEM, 1); > } > > For my patchset, Rob Herring suggested I made changes to the imx-weim driver > to accommodate multi-chipselect devices. > > See the conversation below between Rob Herring and myself: > https://lkml.org/lkml/2018/11/30/390 Sorry, I wasn't aware of the discussion. Now I understand the background of the changes. But can you please patch imx-weim bindings doc (Documentation/devicetree/bindings/bus/imx-weim.txt) to accommodate this new use scenario? Shawn