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 05047EB64D9 for ; Mon, 19 Jun 2023 14:38:32 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 32A4B865B3; Mon, 19 Jun 2023 16:37:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="YoEw5trk"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 2F90586351; Mon, 19 Jun 2023 16:32:19 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A937E865C1 for ; Mon, 19 Jun 2023 16:29:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1687184993; x=1687789793; i=xypron.glpk@gmx.de; bh=aNHAH5e0l4VjKeru7voJQ7uQTqYkR2el8a1AJnI2XQY=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=YoEw5trkdvDU1hXh75RiF4q2g7GQcmeTi6z+DMRzVktqO1mOP11z/6NmCDYpYCdmwilEcU2 b53wGUZjEH5T7obp8swzUH92IIVwftq8jI2mHjNM5oqvvSCa0Rsem+QdJ33TA3PZ7xKlLRLdu sDCgD05Ge0VYA0CouVUkof4UrjJnWyHC6rQfqNB7+YYz4NqXgGfregL2UzTJU+a2evH1No+6K 0DRjniF2omaiNJJAYBJ8ZhVeCKBZAtwcuZ9scdD3A1sxyV6v8KTbFTjATr7lGt1NRJ8v6g4DH XAQbF6189Csa7x6S9bB8+bOpByzHvso4kNlff0qEYDlE7tmiPqYw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.123.67] ([84.119.33.219]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MWzjt-1qZg9K3rJZ-00XNbw; Mon, 19 Jun 2023 14:48:11 +0200 Message-ID: <0cd35f9c-e5ca-fe05-fd63-ef89c44a2c9e@gmx.de> Date: Mon, 19 Jun 2023 14:48:11 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [BUG] bind command leads to invalid state where plaform data is NULL Content-Language: en-US To: Simon Glass Cc: U-Boot Mailing List References: <7c92ea2d-c683-787f-ab30-0e2f572a311c@gmx.de> From: Heinrich Schuchardt In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:BMyeOyOk2CSBs16l3vMS5CczkzGBDl4UnrXW5/8Ly6laoTbYd9I dZzL0UFg46YALnA5LgSgb2D+uQHIDAbRuMY4B1YyyeGBsoGi8FlOh4jZPff8X7tzI5AHBrY 5Z5UUx64bXMG68QWZ0ALTuL/paszP4c6/aYEfO1ndjE79hFul7cqZD4lh+NoOaH6BBYQumP H/cNBHKAQZ4LMaiveKYZA== UI-OutboundReport: notjunk:1;M01:P0:oGRX/hok5+c=;+XamFUkD0keI+ZxgwB5eS71WqMB 5dM2FMcBQNx516h7I18b50UY1oawS0bJbyQStuc+sngUOkPf7Drmb1i+4xl0URyuzeqBQpEF5 Bu4NTNzL0bwlbzZeeva5OEGBrZd1yraWti/FIRPpUvMYvdB70NyfoTxdqck+AN0qmbEGobtoB hUizyajci2CY5DftMLFNVtr3AI2a06QmPOzMdBTtRCb+AMsIehqHUTlLBYsg6RQFyWVxoVzWs /a+jQQxssVIshiHU4UEtQfAdJfPjLalCt/Pv/x4lYjOxy6geyLHRxD2QZflXK1tnTGdphKKzD iYdgZHRCEKMrCxBUBFI2lzTJyGSm21TQZv71BcKn6wxoFOSDuYaPrP6zxvYgnAMTTl1h0+Dkm XhEv/Rt93D4fPoUiI5El6nVjNn2gE0CkSK/65RCUTHaToxVt+Ga1rEIlIqxOwmOvcofbr+O4C 36kfhpefzpakp+Vtf5WKViS0NFO48JaK5PbVGdWZiSVwGp7MQ1aNS4ym2sNQCsEn1C6fWUVYG 7JTE2sKmYtTZsbOZ9I3g2Unf57eteKDZ32EJ5Nr5ZmsttYMRy0wrgoMFWyyvBES17U1ml5gXQ bX3ze7hKbMqCMIQGIxpATrrqKMfh90carWHyL0GtMw+NdM9lKV4xSkrO1gz6gHblTv9LvTZKa 19WUfDuIQghLft1E/qxGJKqv4dumDR1JaOYvHtiZymu5pqYKwRxKy1wymRdbpwmZa9NhnbZgR TsO6X6zzJ3RLBWx1U+KN3zLefqhtU6mkdRDnypWhlLEDS44GgbOhE0xslq0qDpIYhCGyApjOn U4p5wAIXvHSFG9eHD+i5mLTshRnmofKvBeVrycJxllMTcYgblX4QsKyi2MnDh8/6JWYaao1Xy g67aTDkpfW6EK7c8eUq0JcBY7fsnFTkhHg0s9I9YoHFBcieA9Udu88P32ayfti1TZME5y+12D LLglvUe9mfpgKE3oE4s197d8Lyc= 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.8 at phobos.denx.de X-Virus-Status: Clean On 6/19/23 14:37, Simon Glass wrote: > Hi Heinrich, > > On Sun, 18 Jun 2023 at 11:12, Heinrich Schuchardt w= rote: >> >> Hello Simon, >> >> from origin/next I build qemu_arm64_defconfig with CONFIG_CMD_BIND=3Dye= s. >> >> I ran the image with: >> >> qemu-system-aarch64 -semihosting \ >> -machine virt,gic-version=3Dmax -accel $(ACCEL) -m 1G -smp cores= =3D2 \ >> -bios u-boot.bin -cpu $(CPU) -nographic -gdb tcp::1234 \ >> -netdev user,id=3Deth0,tftp=3Dtftp -device e1000,netdev=3Deth0,ro= mfile=3D \ >> -drive if=3Dnone,file=3Darm64.img,format=3Draw,id=3Dmydisk \ >> -drive if=3Dpflash,format=3Draw,index=3D1,file=3Denvstore.img \ >> -device virtio-rng-pci \ >> -device ich9-ahci,id=3Dahci -device ide-hd,drive=3Dmydisk,bus=3Da= hci.0 >> >> =3D> scsi bind >> =3D> dm tree >> Class Index Probed Driver Name >> ----------------------------------------------------------- >> root 0 [ + ] root_driver root_driver >> pci 0 [ + ] pci_generic_ecam |-- pcie@10000000 >> pci_generi 0 [ ] pci_generic_drv | |-- pci_0:0.0 >> ahci 0 [ + ] ahci_pci | `-- ahci_pci >> scsi 0 [ + ] ahci_scsi | `-- ahci_scsi >> blk 0 [ + ] scsi_blk | |-- >> ahci_scsi.id0lun0 >> partition 0 [ + ] blk_partition | | |-- >> ahci_scsi.id0lun0:1 >> partition 1 [ + ] blk_partition | | `-- >> ahci_scsi.id0lun0:15 >> bootdev 2 [ ] scsi_bootdev | `-- >> ahci_scsi.id0lun0.bootdev >> =3D> unbind blk 0 >> =3D> dm tree >> Class Index Probed Driver Name >> ----------------------------------------------------------- >> root 0 [ + ] root_driver root_driver >> pci 0 [ + ] pci_generic_ecam |-- pcie@10000000 >> pci_generi 0 [ ] pci_generic_drv | |-- pci_0:0.0 >> ahci 0 [ + ] ahci_pci | `-- ahci_pci >> scsi 0 [ + ] ahci_scsi | `-- ahci_scsi >> bootdev 2 [ ] scsi_bootdev | `-- >> ahci_scsi.id0lun0.bootdev >> =3D> bind scsi 0 scsi_blk >> =3D> dm tree >> Class Index Probed Driver Name >> ----------------------------------------------------------- >> root 0 [ + ] root_driver root_driver >> pci 0 [ + ] pci_generic_ecam |-- pcie@10000000 >> pci_generi 0 [ ] pci_generic_drv | |-- pci_0:0.0 >> ahci 0 [ + ] ahci_pci | `-- ahci_pci >> scsi 0 [ + ] ahci_scsi | `-- ahci_scsi >> bootdev 2 [ ] scsi_bootdev | |-- >> ahci_scsi.id0lun0.bootdev >> blk 0 [ ] scsi_blk | `-- scsi_= blk >> =3D> part list scsi 0 >> dev_get_uclass_plat: null device >> "Synchronous Abort" handler, esr 0x96000004, far 0xd503201f14000072 >> elr: 000000000003392c lr : 0000000000033924 (reloc) >> elr: 000000007ff1492c lr : 000000007ff14924 >> x0 : d503201f1400000a x1 : 0000000000000000 >> x2 : 0000000000000090 x3 : 0000000000000013 >> x4 : 000000007eda0419 x5 : 0000000000000020 >> x6 : 00000000ffffffd0 x7 : 000000007eda06b0 >> x8 : 0000000000000010 x9 : 0000000000000000 >> x10: 0000000000000006 x11: 000000000001869f >> x12: 0000000000000016 x13: 0000000000000004 >> x14: 0000000000000000 x15: 000000007eda073c >> x16: 000000007ff2547c x17: 0000000000000000 >> x18: 000000007eea0db0 x19: 0000000000000000 >> x20: 0000000000000000 x21: 0000000000000001 >> x22: 0000000000000000 x23: 000000007eda0740 >> x24: 0000000000000000 x25: 0000000000000000 >> x26: 0000000000000000 x27: 0000000000000000 >> x28: 0000000000000000 x29: 000000007eda06d0 >> >> Code: aa0303f7 94000287 aa0003f4 f9400260 (f9403418) >> Resetting CPU ... >> >> The crash occurs in blk_read(). blk_read() does not check if desc =3D= =3D NULL. >> >> I would have expected "bind scsi 0 scsi_blk" to create a valid state >> where the platform data is set up. >> >> Best regards >> >> Heinrich > > I am not sure what 'scsi bind' does. > > But binding a blk device needs to be done by its parent device. I > suspect the 'bind' command does not know how to set up things > correctly. See for example blk_create_device() which does quite a lot > of setup. > > What are you trying to fix / do? I just wanted to have an example for creating a man-page for the bind command. Unfortunately new commands were created without man-page. I have an example for " ". Do you have a better example for "bind "? Best regards Heinrich