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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7FDB7C433FE for ; Fri, 30 Sep 2022 01:54:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EA73584C81; Fri, 30 Sep 2022 03:54:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HLvRr+Go"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3801184C81; Fri, 30 Sep 2022 03:54:18 +0200 (CEST) Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2E9B8849AA for ; Fri, 30 Sep 2022 03:54:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=takahiro.akashi@linaro.org Received: by mail-pl1-x62f.google.com with SMTP id jo24so2182324plb.13 for ; Thu, 29 Sep 2022 18:54:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=jgP8b3fJKjuXIDySD2RmOh6eB2BQpuXWDw53z5AHU0M=; b=HLvRr+GoVp+wY9BpbEkVIRVeqOPpbuSmJ4QoVsucNgUpUKt5rocVvddEAhnCQrR7RV 6wL5WAeC9sNu8DYIP8ixewko/lWFQaw+tzBAGrEPe19FRVZxd/13z3hImqFLyygYjxmo 2N6cJ6WLXUnAY50swFeAnudhcsOOWNX4LnDdx9ML/Jr4uC2FcFhV+mA/TaH7GsVBrEOK 4lr3jJ3vhBff5//4R861KvSQwqCYGZS31BGkWhKKAkHxRMPyvp/5k6g/jargZh06C3lX Lv5RolKwkzHbwJO4QJ9dvKlKBd53xfCx/Tm3oBU4hAEISp3C3Gt3QCRvBD03UAlwcZ+r varw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jgP8b3fJKjuXIDySD2RmOh6eB2BQpuXWDw53z5AHU0M=; b=B/kx0rLld858XIF0Gbz3lkRw2p53NTtC9HQXJ/t9JbTETo1cmv3knn8CYnZE67q6IJ K6IZTmDT3QXT/OiJcK0O791f0M6rpGHcVeViwDoR/snPU0xgfTic6zV6F76gSvJpNmug l3gFEMxfpbu3y6AfCGxu9CJ+leltzMYbw4/6De0aQVxtVoNKSKJkYOmZ0UnyjG+yi+ie 241k+4/7dr2eb3BCWCmuwK5ULk/OZQJdBja833WJf8D+knTkiVA8zXeMvMWz0xwM9pX6 X//KT1Vf6+Ma5f8MdiwkhoaTGLk1j2M4qEVRAg68ucbUsZWGLJaQ9cp6eMM9fiu1iqxW 4qYQ== X-Gm-Message-State: ACrzQf2QSSOwue0bMTpLDIR4iEOQott8c06V2WvCyoACuJAkOoiftMlS nvzhDhmNr2DtVhgaHHZJDrHTaA== X-Google-Smtp-Source: AMsMyM71Qfn6XJ2K5azDXTOYJPqqyenrP94VR/m5mGpGtj4znnCgMlx7nUIikVYWIQQmnKJSYirKsA== X-Received: by 2002:a17:903:1211:b0:178:a692:b1e3 with SMTP id l17-20020a170903121100b00178a692b1e3mr6667140plh.48.1664502853400; Thu, 29 Sep 2022 18:54:13 -0700 (PDT) Received: from laputa ([2400:4050:c3e1:100:53a5:1102:193e:47f0]) by smtp.gmail.com with ESMTPSA id q4-20020a17090311c400b001750361f430sm565571plh.155.2022.09.29.18.54.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 18:54:12 -0700 (PDT) Date: Fri, 30 Sep 2022 10:54:08 +0900 From: AKASHI Takahiro To: Simon Glass Cc: U-Boot Mailing List , Tom Rini , Heinrich Schuchardt , Marek Vasut , Masahisa Kojima , Pavel Herrmann Subject: Re: [PATCH 14/45] dm: blk: Add udevice functions Message-ID: <20220930015408.GB10018@laputa> Mail-Followup-To: AKASHI Takahiro , Simon Glass , U-Boot Mailing List , Tom Rini , Heinrich Schuchardt , Marek Vasut , Masahisa Kojima , Pavel Herrmann References: <20220925150248.2524421-1-sjg@chromium.org> <20220925150248.2524421-15-sjg@chromium.org> <20220926001728.GB7925@laputa> <20220929005145.GA39264@laputa> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Wed, Sep 28, 2022 at 08:35:58PM -0600, Simon Glass wrote: > Hi Takahiro, > > On Wed, 28 Sept 2022 at 18:51, AKASHI Takahiro > wrote: > > > > Hi Simon, > > > > On Wed, Sep 28, 2022 at 04:20:56AM -0600, Simon Glass wrote: > > > Hi Takahiro, > > > > > > On Sun, 25 Sept 2022 at 18:17, AKASHI Takahiro > > > wrote: > > > > > > > > Hi Simon, > > > > > > > > On Sun, Sep 25, 2022 at 09:02:17AM -0600, Simon Glass wrote: > > > > > At present we have functions called blk_dread(), etc., which take a > > > > > struct blk_desc * to refer to the block device. Add some functions which > > > > > use udevice instead, since this is more in keeping with how driver model > > > > > is supposed to work. > > > > > > > > Unfortunately, NAK. > > > > I have already added similar functions in disk/disk-uclass.c > > > > with my commit 59da9d4782cd ("dm: disk: add read/write interfaces with > > > > udevice"). dev_read()/dev_write() works well with UCLASS_BLK (as intended). > > > > > > > > I remember that you also ack'ed that patch. > > > > > > You have a better memory than me! > > > > > > How about we make those functions call my new ones? > > > > So do you want to have two distinct API's for BLK and PARTITION? > > You seem to have a policy that each DM class should have its own > > API's. > > Yes that's right. > > > > > I don't have a strong opinion here, but form user's point of view, > > block-level accessing has no difference between BLK and PARTITION. > > Most common users of such accessors are file systems. > > In stead of using the following code at every corner, > > cid = device_get_uclass_id(udev); > > if (cid == UCLASS_BLK) > > blk_read(udev, ...); > > else if (cid == UCLASS_PARTITION) > > disk_part(udev, ...); -> I meant disk_read(...) > > it may be more convenient to have a single API. > > Yes I agree, but you already have that with your dev_read() API. I > just want to rename it a bit. If so, that's fine to me. -Takahiro Akashi > > > > > Also I think we should rename your functions to avoid using the > > > dev_read prefix, since this is for reading from the device tree. > > > > Okay. > > > > > Perhaps disk_read()? Also it seems that we could rationalise the code > > > between disk_read() and part_read() ? > > > > I'm not sure what you mean by "rationalise". > > The code seems to be almost the same between the two so I think it may > be possible to move the common code into a shared function. > > > > > > Also should have comments in the > > > header file about what the functions do (and what type of device they > > > accept). > > > > Yeah. > > Regards, > Simon