Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4671258ybi; Tue, 11 Jun 2019 10:27:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwngntLhpajiJPvm9uTEHQkOtmmoVJ/LtZGN2Ee6pSfXSEx5vHP7Njwkg1i+WDLJceOcqas X-Received: by 2002:a63:e709:: with SMTP id b9mr19948758pgi.209.1560274070387; Tue, 11 Jun 2019 10:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560274070; cv=none; d=google.com; s=arc-20160816; b=W58gk3EZM6tRX8qtjrFwGMu/RpGnxzsu8BS5I/MNE3F/WyZpXwL1eqEURwZaeMT/Yu GzHh6R/xK/o3/Guv5/ZOH84SS0DsBXj4ZXMMzGOI7f24p1VDqCd2ImMsCEB9K6vLTxLm YiXvty3KPnYPkaWXl30v0UJljA7xput1dF3XR6oL3TLGuFhfyDOA68c/OLX0K9+OYdu/ SNm5v2MiuufQFPy1V4xn4XIX6Ppj3lxK0hoRwiBgXD7gntRfk6XHs+C2S6jik9maXXwA NYqvCVuAnA4Fix4LrI43EfWQXMMJKavpojs0ShdxinuEjbhr3jbEia23zd4+y+rJDaGb OrpA== 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; bh=uJg1AHOQJ4aXGxplOnN2NoKHQdeMNczkNqESM9iD52U=; b=mZp4GMNVwlB6RJaMyrfAcJR5RE96qEKXTFOsvyjqLjXFl7vXBITi1qkV3SkcLHePXA OQCC0o3KU9K4FIEEnGGMElctUI8wUGKVUE8AUnB4Z9CRYhp6xuHJ8I4wbsvmJvpHTj6j UCLNCcruG+PAIOapwMWDhsbxq0y9RmxAbPj6LWnR77jcpBePtEfvNVASKESyB9c0WEcR gkf9AxLOFEnJA2lzy0s+x7AQxAySwlFZcfZQdVtVKKTZr0x6UPCJc7ZZsVEQ5v23luBO 2xukKT51ErPh0SunWquqWLzpLV5rifetFtr8BrO/QTlsh5xvwUEZqtEkNHQ/RoFI6DAA 96Dw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 4si7976417pgo.198.2019.06.11.10.27.34; Tue, 11 Jun 2019 10:27:50 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406061AbfFKR1H (ORCPT + 99 others); Tue, 11 Jun 2019 13:27:07 -0400 Received: from pio-pvt-msa3.bahnhof.se ([79.136.2.42]:43676 "EHLO pio-pvt-msa3.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405718AbfFKR1G (ORCPT ); Tue, 11 Jun 2019 13:27:06 -0400 Received: from localhost (localhost [127.0.0.1]) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTP id 3F9B13FA1F; Tue, 11 Jun 2019 19:26:58 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-999 required=6.31 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=ham autolearn_force=no Received: from pio-pvt-msa3.bahnhof.se ([127.0.0.1]) by localhost (pio-pvt-msa3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gYRQZqnvAFS5; Tue, 11 Jun 2019 19:26:57 +0200 (CEST) Received: from localhost (h-41-252.A163.priv.bahnhof.se [46.59.41.252]) (Authenticated sender: mb547485) by pio-pvt-msa3.bahnhof.se (Postfix) with ESMTPA id 579773F8E0; Tue, 11 Jun 2019 19:26:56 +0200 (CEST) Date: Tue, 11 Jun 2019 19:26:54 +0200 From: Fredrik Noring To: Guenter Roeck Cc: laurentiu.tudor@nxp.com, hch@lst.de, stern@rowland.harvard.edu, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, marex@denx.de, leoyang.li@nxp.com, linux-kernel@vger.kernel.org, robin.murphy@arm.com, JuergenUrban@gmx.de Subject: Re: [PATCH v7 3/5] usb: host: ohci-sm501: init genalloc for local memory Message-ID: <20190611172654.GA2602@sx9> References: <20190529102843.13174-1-laurentiu.tudor@nxp.com> <20190529102843.13174-4-laurentiu.tudor@nxp.com> <20190605214622.GA22254@roeck-us.net> <20190611133223.GA30054@roeck-us.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20190611133223.GA30054@roeck-us.net> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, > > This patch results in usb access failures when trying to boot from the > > sm501-usb controller on sh4 with qemu. > > > > usb 1-2.1: reset full-speed USB device number 4 using sm501-usb > > sd 1:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=0x00 > > sd 1:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 08 7c 00 00 f0 00 > > print_req_error: I/O error, dev sda, sector 2172 flags 80700 > > usb 1-2.1: reset full-speed USB device number 4 using sm501-usb > > sd 1:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=0x00 > > sd 1:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 01 da 00 00 f0 00 > > print_req_error: I/O error, dev sda, sector 474 flags 84700 > > usb 1-2.1: reset full-speed USB device number 4 using sm501-usb > > sd 1:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=0x00 > > sd 1:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 02 da 00 00 f0 00 > > print_req_error: I/O error, dev sda, sector 730 flags 84700 > > usb 1-2.1: reset full-speed USB device number 4 using sm501-usb > > sd 1:0:0:0: [sda] tag#0 UNKNOWN(0x2003) Result: hostbyte=0x03 driverbyte=0x00 > > sd 1:0:0:0: [sda] tag#0 CDB: opcode=0x28 28 00 00 00 0b 50 00 00 f0 00 > > print_req_error: I/O error, dev sda, sector 2896 flags 84700 > > > > Qemu command line is: > > > > The qemu command line is: > > > > qemu-system-sh4 -M r2d \ > > -kernel ./arch/sh/boot/zImage \ > > -snapshot \ > > -usb -device usb-storage,drive=d0 \ > > -drive file=rootfs.ext2,if=none,id=d0,format=raw \ > > -append 'panic=-1 slub_debug=FZPUA root=/dev/sda rootwait console=ttySC1,115200 earlycon=scif,mmio16,0xffe80000 noiotrap' \ > > -serial null -serial stdio \ > > -net nic,model=rtl8139 -net user -nographic -monitor null > > > > Reverting this patch as well as "USB: drop HCD_LOCAL_MEM flag" fixes the > > problem. Reverting "USB: drop HCD_LOCAL_MEM flag" alone does not help. > > > > This problem is still seen in next-20190611. > Has anyone actually tested this code ? I tested patches 1, 2 and 5 with v5.0.19. Perhaps yet another part of the OHCI subsystem allocates memory from the wrong pool? With some luck it is relatively easy to trace backwards from the error messages to the point where the memory is being allocated. One way to establish this is to sprinkle printk around if-statements. There may be 10-20 levels of calls including one or two indirect calls via pointers. Would you be able to do that? Fredrik