Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp553674lqg; Fri, 1 Mar 2024 13:19:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVD/vDVuF1bAyfziFEcG5URxxIUldtIDH1+LyzQUiBiimZWKchFmJo/FW5P0ZRWLUv53/PgKxc6gPrArOnlAXSz5p6H5BRdQgai1Icdfg== X-Google-Smtp-Source: AGHT+IFMaee1++kZziV0BfuN92cc1fqXlKQDf7qghs/019c/Y2aXpRarTzDgucGu161bzYirZPqv X-Received: by 2002:a05:620a:4489:b0:787:fdd2:6d9a with SMTP id x9-20020a05620a448900b00787fdd26d9amr3599065qkp.41.1709327950202; Fri, 01 Mar 2024 13:19:10 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709327950; cv=pass; d=google.com; s=arc-20160816; b=oTDYNfB9/d8Zt0omYDmJ4QswZ9XLe83FKqq8EFqXe0UM14hU7H9gT+U9HaASIH+tjW uhfBgH7chJgecB1dEG932xidUUYb+LBeR7kFxxDEAc26CHkHHD6m4clsCCwxWniPvC1z z6j8LNw02uxVZ+jc9s0agbLyxr/t3NjaWvoZu1xaqjztc61EU02GoShN29X6VGx4ECN7 NIH4ty/wl/z8GUZhIU5wOpdRKwzuQKp4rmWyiXrqW7mrGXtcAVk8yl0CCj59qfkvbd3c fKVey6ZMWYvgqA7g2bKLDOwssNUVTpDjF1iN2DRV9n2xfXk/AgoRTtnWi5SQ9wFzz2cV wvUg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=L+hKswwgBRlVs6hoFMZ8CfmbaVVy8hEBnVfnxYYsUtE=; fh=xmmhplQnGTIh72yC5RXUXIaj28reI3Wy7enpRYvtyfk=; b=QHQNU5WeYPKDlF9nLSX2QA918LHVhQSCQwvf/xQFy+pUB14I4/p+tqZDqFfEFxxy/4 ie0GBWffwQtgnezwLgmNOeunJ7JwA/HjjlaSTJx2FQsFa2BiUrdp2WAvw9HJPnpTklQE 0hJ1zdty39nvnwiraqZ2il49vkbpg3/0KdSqVb0StD8gXD1yPpSFBvIecHD3M5GXI2Jv /KfH60WLijZatrTbBMbunk4oBe+Bq6k0c+aBX6gVYu7NQGC1+hDuDyJgD/ZgQHy371Bt CfJ3bXR2TvfhxYkJiVx8EmVsWTx7OdZIKvgcLb8GuX74Y53Fl3tsCeNBKKS7qjKmmyjM 22Vg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z95VsU0J; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-89137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id c25-20020a05620a201900b00787ad5a987asi4245824qka.185.2024.03.01.13.19.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Mar 2024 13:19:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Z95VsU0J; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-89137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id D6C8D1C22C27 for ; Fri, 1 Mar 2024 21:19:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4AC93D546; Fri, 1 Mar 2024 21:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Z95VsU0J" Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3E79D3C464 for ; Fri, 1 Mar 2024 21:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709327939; cv=none; b=rG9+szos+hkk0MkEFCf9I8KPk8Wi5lt3SZXo7aAiDkJKwB606+XU5xymZoZODffXQA71NzJxJ8R5XLQEdE4q3IAZUJU4bLO4RBccamwi4eK6JovTrG+q7YHscKE4ThNoHBF6C+MJWt4VBb5rWEU2NxdoBJsP82asRdGFdvxJebE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709327939; c=relaxed/simple; bh=SYTsC+D82Rn+NfDCS0BGr0Enxbh8kD6j4lA9Z46UG/Q=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=sH3elijEb2j/t4vQgmbsoomf+AerN55SbZBDdNQqKzc7SIUnQDuKTh1r1efKT5QHvqx0x+Q4ecZ6RF+iPmgnQKBWSKwI4/40/fkQts+rUxB049cX4/pkVZ6T3BYFuhFgNLd06R9mGGdTCZEh+/FlH6/0dc4mLRYw9zKWehieBtc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Z95VsU0J; arc=none smtp.client-ip=209.85.219.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-dcc80d6004bso2532088276.0 for ; Fri, 01 Mar 2024 13:18:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709327937; x=1709932737; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=L+hKswwgBRlVs6hoFMZ8CfmbaVVy8hEBnVfnxYYsUtE=; b=Z95VsU0JSW5pOfvAZ8Fc7BObiUSpS3VcbVNG9yC5eBNw5CaVvNj/uQHjJV68PkOFgZ c2M5mWDcoCnUgd7CndJsQ7tKPC9eykwgfu/5MQdYJMYVbNfo1SY90v5z6T3aUJDiuJor jZjD9le2P1q4QaAMk31p8Plnvp2v776Er8FVRPLE7Qcg1q67FG/asO1lig2gUzXeWgIJ 6i/If0rZXFiGkoSJmjmqZx5tj5ZLuSMEksA3pp4Svp5E+lc3JNxs1SWVCe8Z25QR4gqz hc1ZqAMUSHrJ9qr2wHlkbhFT+6HmTFvv53UWVNLwJRpNd0WbvGyxAzmoyeVCkeJngDxO 678Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709327937; x=1709932737; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=L+hKswwgBRlVs6hoFMZ8CfmbaVVy8hEBnVfnxYYsUtE=; b=cO4hh/9uXHi4KXuRmThiINDbrfVWENtc8ZfsyaCP6hhc0tNUMAuRqy1n3qPdSHUl8s oQlXspLhhtgDCv/vP5nHIVF+xHk2HUBtrPd/y0+Sq++wjOmxYO7IBVSfqJaE4vBbbrwu KJz6O39UQcSkayu0fMSZilBLTfiAjYwZymsIxt9K3TBFTneklSeKql+0H7JxhHxRHpsZ htDvf5aNDBwVQrmAsMStRH78deek65H27RzvXuEF9fRPg5hhpt8/9ZX/0lStyYITUVPd a3Qll/TvmUf443EhvDBeKLAHc3zoOqdD1EMxv/6v5NHJtdc2kvlg8I1zZ8T4Q4iHhBTU LPUQ== X-Forwarded-Encrypted: i=1; AJvYcCUZ92a9aCmLuRUXCOifTnm+2urKSNM2t23hHElkKGHV2upvHA8H8mF9JiGSUSs64Aw+B0cLhku8sn+iFPshEkeutr71iAIr5DSfhcoh X-Gm-Message-State: AOJu0YxRXJmSwgeUq6m28ni+OwLe+2h6UCLywF8D+p2UDi1OapHbzgYi Idzn+VPjytyMzgBr2FaXH7ec9XOeatm6nWbaZtruSwhfNNw3K8Zn9OL5MDeu0ugPnEJ39XqtX8u T/W6pnAK1SDz/aKBqDwCwgnPOlkdu2T7kI1Qhxw== X-Received: by 2002:a25:c02:0:b0:dcf:4793:9a25 with SMTP id 2-20020a250c02000000b00dcf47939a25mr3196516ybm.44.1709327937273; Fri, 01 Mar 2024 13:18:57 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: In-Reply-To: From: Sam Protsenko Date: Fri, 1 Mar 2024 15:18:46 -0600 Message-ID: Subject: Re: WinLink E850-96: WARNING: at block/blk-settings.c:204 blk_validate_limits To: Arnd Bergmann Cc: Naresh Kamboju , linux-block , lkft-triage@lists.linaro.org, open list , Jens Axboe , Christoph Hellwig , Christian Brauner , Ulf Hansson , Dan Carpenter , Anders Roxell , Jaehoon Chung , linux-mmc@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Mar 1, 2024 at 2:51=E2=80=AFPM Sam Protsenko wrote: > > On Thu, Feb 29, 2024 at 8:56=E2=80=AFAM Arnd Bergmann wro= te: > > > > On Thu, Feb 29, 2024, at 15:14, Naresh Kamboju wrote: > > > The arm64 WinLink E850-96 Board boot failed with 16K and 64K page siz= e builds > > > Please find the below warning log on Linux next-20240229. > > > First noticed on the next-20240220 tag. > > > > > > This issue arises only when one of these Kconfig options is enabled. > > > CONFIG_ARM64_16K_PAGES=3Dy > > > CONFIG_ARM64_64K_PAGES=3Dy > > > > > > Reported-by: Linux Kernel Functional Testing > > > > > > Warning log: > > > ------- > > > [ 2.231008] mmc_host mmc0: Bus speed (slot 0) =3D 49968750Hz (slot > > > req 52000000Hz, actual 49968750HZ div =3D 0) > > > [ 2.231714] mmc_host mmc0: Bus speed (slot 0) =3D 399750000Hz (slo= t > > > req 200000000Hz, actual 199875000HZ div =3D 1) > > > [ 2.241961] mmc0: new HS400 Enhanced strobe MMC card at address 00= 01 > > > [ 2.249182] ------------[ cut here ]------------ > > > [ 2.252371] WARNING: CPU: 3 PID: 90 at block/blk-settings.c:204 > > > blk_validate_limits (block/blk-settings.c:204 (discriminator 1)) > > > > > > The warning was added with commit d690cb8ae14b ("block: add > > an API to atomically update queue limits") > > > > + if (!lim->max_segment_size) > > + lim->max_segment_size =3D BLK_MAX_SEGMENT_SIZE; > > + if (WARN_ON_ONCE(lim->max_segment_size < PAGE_SIZE)) > > + return -EINVAL; > > > > Whereas mmc_alloc_disk sets the limit as > > > > /* > > * Setting a virt_boundary implicity sets a max_segment_size, s= o try > > * to set the hardware one here. > > */ > > if (host->can_dma_map_merge) { > > lim.virt_boundary_mask =3D dma_get_merge_boundary(mmc_d= ev(host)); > > lim.max_segments =3D MMC_DMA_MAP_MERGE_SEGMENTS; > > } else { > > lim.max_segment_size =3D > > round_down(host->max_seg_size, lim.logical_bloc= k_size); > > lim.max_segments =3D host->max_segs; > > } > > > > and max_seg_size gets initialized to either one less > > than 64k, or to exactly 4k in the dwmmc driver here: > > > > /* Useful defaults if platform data is unset. */ > > if (host->use_dma =3D=3D TRANS_MODE_IDMAC) { > > mmc->max_segs =3D host->ring_size; > > mmc->max_blk_size =3D 65535; > > Changing this value here to PAGE_SIZE (instead of 65535) makes E850-96 > functional again (tested with CONFIG_ARM64_16K_PAGES=3Dy). I'm sure this > is just a quick hack, but maybe it can be helpful in further analysis. > If anybody wants me to run some tests on E850-96 -- please let me > know. > Sorry, just noticed I commented on the wrong line. Here is the change I mad= e: - mmc->max_seg_size =3D 0x1000; + mmc->max_seg_size =3D PAGE_SIZE; for (host->use_dma =3D=3D TRANS_MODE_IDMAC) case. > [snip]