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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC3E7C433F5 for ; Mon, 25 Oct 2021 15:19:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id EE41F60F9D for ; Mon, 25 Oct 2021 15:19:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EE41F60F9D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 39BD18352B; Mon, 25 Oct 2021 17:19:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="LgGLEdLp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2A4A983549; Mon, 25 Oct 2021 17:19:11 +0200 (CEST) Received: from mail-ua1-x92c.google.com (mail-ua1-x92c.google.com [IPv6:2607:f8b0:4864:20::92c]) (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 7251D83530 for ; Mon, 25 Oct 2021 17:19:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@google.com Received: by mail-ua1-x92c.google.com with SMTP id e10so22909647uab.3 for ; Mon, 25 Oct 2021 08:19:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HXVVsC+xC9SoFDR3tHGDgVQhVeuaO5/mAuKUN0PDwQ4=; b=LgGLEdLpWL9ULwfFQmrp51HA9gzwk44POQ6HrMi3oMRGhZ61NcMm+j1Dz0pd9C1bXx GqRZZA9WtJrMSyNq9G/wUclS6HLHUk2mjJQfMMHccG2E95BAKQh9H4PpqUDLaznx672E 1xnejikYwOwEDLvXCooafd0R7OhSOidJ3GvFY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HXVVsC+xC9SoFDR3tHGDgVQhVeuaO5/mAuKUN0PDwQ4=; b=VN/OkXoyu70B2CAP++FmQLLnKt83s3Qc2dZ8Gi6xPjJPUAN843Il9qiwoX5Sj4lC1r cSsck1/p1dffeCOq7ady6rL9S6kwI4Gu3ebo7w+Gsn8fegBdQDz5D5zo3uTY2NO26FrB aFnn9LQF0n9haGumybLsLJ4YhEVxEuJN/euI7x3s7m2CKL5g8zJbKae0SH41TXICxTL8 PDsU5v/flxwE6q1VLic060HdN5Dm8daYZPSc2c0eEIpFt0fNv97C1e7faWb0vxdfDXJi 5b8CofSOPszDP1/rLyfp2xHwjQXPZJKoIAr2VC2ZftIroWgJEC3xDcn/rDf0Mi/C+Rli ubhw== X-Gm-Message-State: AOAM530qE5KWB1FPrNOkFXn/MpkDzfcMqPw+LvSxkZdTTJaXZAGwxS7Z VnL70CiNH9LaIhBIH4KZXcU913VnmrkDoRsQYdbVeDhWqDA= X-Google-Smtp-Source: ABdhPJwhW7Al5U1TMB4EYF8/npwMU9xGUAtDc5bO/TGrTDCrzKFU71dMvMDYhvCeXfRgd3n3lW0g+JRGicvLhXkuwh4= X-Received: by 2002:a67:d51c:: with SMTP id l28mr3637000vsj.58.1635175141110; Mon, 25 Oct 2021 08:19:01 -0700 (PDT) MIME-Version: 1.0 References: <20211023140647.7661-1-heinrich.schuchardt@canonical.com> <81777666-a5e1-b32b-b41e-70d894a44b94@canonical.com> In-Reply-To: <81777666-a5e1-b32b-b41e-70d894a44b94@canonical.com> From: Simon Glass Date: Mon, 25 Oct 2021 09:18:49 -0600 Message-ID: Subject: Re: [PATCH 1/1] blk: simplify blk_get_devnum_by_typename() To: Heinrich Schuchardt Cc: Patrick Delaunay , Ilias Apalodimas , U-Boot Mailing List , Tom Rini Content-Type: text/plain; charset="UTF-8" X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean Hi Heinrich, On Mon, 25 Oct 2021 at 02:00, Heinrich Schuchardt wrote: > > On 10/25/21 09:54, Heinrich Schuchardt wrote: > > On 10/24/21 21:54, Simon Glass wrote: > >> Hi Heinrich, > >> > >> On Sat, 23 Oct 2021 at 08:06, Heinrich Schuchardt > >> wrote: > >>> > >>> The block descriptor contains the if_type. There is no need to first > >>> look > >>> up the uclass for the if_type and then to check the parent device's > >>> uclass > >>> to know if the device has the correct if_type. > >>> > >>> Signed-off-by: Heinrich Schuchardt > >>> --- > >>> drivers/block/blk-uclass.c | 35 +---------------------------------- > >>> 1 file changed, 1 insertion(+), 34 deletions(-) > >> > >> This seems to be heading in the wrong direction though. > >> > >> The IF_TYPE should really go away and be replaced with the UCLASS ID, > >> I think. > >> > >> At present we have lots of calls to blk_create_device_f() which > >> specify the type. I think we should drop the IF_TYPE_.. arg to that > >> function and have it figured out from the uclass, in the interim. > >> > >> But why do we need IF_TYPE now? > > > > I admit that this patch is just an intermediate step. > > > > We can replace IF_TYPE by ULASS ID once SPL block devices are always > > using the driver model. Have we reached this point yet? I have not seen > > drivers/block/blk_legacy.c being deleted. > > qemu_malta64, qemu_malta64el, qemu_malta, qemu_maltael are examples of > defconfigs requiring drivers/block/blk_legacy.c Yes, we seem to have BLK on only for MMC and USB, but malta64 (for example) uses IDE. The problem seems to be HAVE_BLOCK_DEVICE which should not be used. +Tom Rini Should we remove HAVE_BLOCK_DEVICE at this point, or make it depend on BROKEN? > > Best regards > > Heinrich > > > > > Removing if_type_uclass_id[] is anyway on the right path. Are you sure? Instead, could we use the uclass ID in more places? Regards, Simon