From patchwork Fri May 4 01:38:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erick Cafferata X-Patchwork-Id: 10379623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9C51160159 for ; Fri, 4 May 2018 01:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8888D2929A for ; Fri, 4 May 2018 01:36:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7C232292E0; Fri, 4 May 2018 01:36:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AE972929A for ; Fri, 4 May 2018 01:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751220AbeEDBgm (ORCPT ); Thu, 3 May 2018 21:36:42 -0400 Received: from mail-ua0-f179.google.com ([209.85.217.179]:33810 "EHLO mail-ua0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751036AbeEDBgl (ORCPT ); Thu, 3 May 2018 21:36:41 -0400 Received: by mail-ua0-f179.google.com with SMTP id f22so13073688uam.1 for ; Thu, 03 May 2018 18:36:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cafferata-me.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=TJXd4byQzQs6RTNMny70gu0I6pYIlCWnYA6KYCx6oyE=; b=0Ka4RqkD9UJPhn4S4sLQowZg0BCvAN0nVYNP9k/unNeKxT7DPlBIeCO2Ukt9rBy2KH pZxN2uEpn8pCKe5zKP1jCAynAhZEWvit5M0LWQttqclXLqx0e3eRcHhO3NDLGTSlrEhL mqWM7HZhThvTKqIlfC7UZbD5by94JfEpFUn/NRt+A3y9qBMBsQ8Aq1Ybs/yei6abQiEm KqL8WeWZS/aZevwys165Km2HEAZHcFDRYxKS3Rq5GzcUs6ovwS+FRaq/yuJHO2Uvl/3L 6lTPAi5vGtX4GZLJstkWGLs1+TXb3+hGU/EgWSVgzK6R9cBlBXlbGkaINdjybc6aRq15 /Ubg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=TJXd4byQzQs6RTNMny70gu0I6pYIlCWnYA6KYCx6oyE=; b=H2uB702l8uDARi3RhOK6nB0axwU5SQJ1cjP6yK7ldiGdGtz46hSlxIu/R7p+JRgxzC O1AXISJ7FHrS32ai4pY5MUY0FK4jesEY3F8Q6Yhe7xdZgNBolecwLLvaqZqWJFWFiXcP tAJEw9Yt/5KqyoyLoUxMkERMcwFa3LHcSMz/eYq5hyKR6brnrwXnW1lFkOqxTmZHjxU2 ZEXrGqjJKVA8S/jAgMVwJyRKz2XZ0Cq/BdaI/2Acw0iQ/Nz5ojKnFY6yugU5A120rlA3 Zw6VGwUEsUrDHYHcm9VGBMnb/Ch6Nh4RFFqd2KcvOU9YvW0IGeU9dhVeUxit3y7AQ0eS a9AA== X-Gm-Message-State: ALQs6tA6h3tanLeMR+csl+qXCAV9YmmWOUxeVckCikhlZB3L8bDhZrH5 AMJJYwWYK2iFL1Jg1QzAOl1rvF1kkQ== X-Google-Smtp-Source: AB8JxZrlwq59B+wCnV5AOIB9nbISVvnA54rBKnTakfyoky6PV/0fmgaKrbTNpyMil2VzWYAtZtxklQ== X-Received: by 10.176.93.27 with SMTP id u27mr14299890uaf.59.1525397800491; Thu, 03 May 2018 18:36:40 -0700 (PDT) Received: from YUKI.localdomain ([181.64.238.107]) by smtp.gmail.com with ESMTPSA id w3sm173337uaw.9.2018.05.03.18.36.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 03 May 2018 18:36:39 -0700 (PDT) Date: Thu, 3 May 2018 20:38:02 -0500 From: Erick Cafferata To: linux-usb@vger.kernel.org Cc: Alan Stern Subject: ehci-usb regression on 32-bit laptops in v4.17-rc1 Message-ID: <20180504013800.mtidmwujbub5b744@YUKI.localdomain> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20180323 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Starting from v4.17-rc1, I've been having problems with my laptop's webcam. Immediately after attempting to open Guvcview(or any other camera software), the system just stops working. No response from any input and the Caps lock LED starts blinking. I've been following the last three -rc and no changes, so I started testing on my own. I bisected it back to commit 22072e83ebd510fb6a090aef9d65ccfda9b1e7e4 Author: Souptick Joarder Date: Wed Feb 14 23:18:48 2018 +0530 usb: host: ehci: Use dma_pool_zalloc() Use dma_pool_zalloc() instead of dma_pool_alloc + memset I tried reverting it on top of -rc3 and everything worked again. I test this bug on four machines: - 2 hp mini 210(atom n450 and n2800, respectively) - 1 Sony Vaio (Core 2 Duo T7250) - 1 Thinkpad T410 (some core i7..) The three 32-bit laptops presented the exact same bug, however the Thinkpad did not crash (the driver didn't create the /dev/videoN at all, I think this might be a different issue, so disregard). And reverting this commit solved the issue in all three laptops. Let me know if you need any further information regarding this issue. Sincerely, Erick Cafferata commit d3c88476223b51d2a0a1bc2326760c0dcb6efd88 Author: Erick Cafferata Date: Wed May 2 11:13:32 2018 -0500 Revert "usb: host: ehci: Use dma_pool_zalloc()" This reverts commit 22072e83ebd510fb6a090aef9d65ccfda9b1e7e4. --- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 4c6c08b675b5..21307d862af6 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c @@ -73,9 +73,10 @@ static struct ehci_qh *ehci_qh_alloc (struct ehci_hcd *ehci, gfp_t flags) if (!qh) goto done; qh->hw = (struct ehci_qh_hw *) - dma_pool_zalloc(ehci->qh_pool, flags, &dma); + dma_pool_alloc(ehci->qh_pool, flags, &dma); if (!qh->hw) goto fail; + memset(qh->hw, 0, sizeof *qh->hw); qh->qh_dma = dma; // INIT_LIST_HEAD (&qh->qh_list); INIT_LIST_HEAD (&qh->qtd_list); diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index 28e2a338b481..e56db44708bc 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c @@ -1287,7 +1287,7 @@ itd_urb_transaction( } else { alloc_itd: spin_unlock_irqrestore(&ehci->lock, flags); - itd = dma_pool_zalloc(ehci->itd_pool, mem_flags, + itd = dma_pool_alloc(ehci->itd_pool, mem_flags, &itd_dma); spin_lock_irqsave(&ehci->lock, flags); if (!itd) { @@ -1297,6 +1297,7 @@ itd_urb_transaction( } } + memset(itd, 0, sizeof(*itd)); itd->itd_dma = itd_dma; itd->frame = NO_FRAME; list_add(&itd->itd_list, &sched->td_list); @@ -2080,7 +2081,7 @@ sitd_urb_transaction( } else { alloc_sitd: spin_unlock_irqrestore(&ehci->lock, flags); - sitd = dma_pool_zalloc(ehci->sitd_pool, mem_flags, + sitd = dma_pool_alloc(ehci->sitd_pool, mem_flags, &sitd_dma); spin_lock_irqsave(&ehci->lock, flags); if (!sitd) { @@ -2090,6 +2091,7 @@ sitd_urb_transaction( } } + memset(sitd, 0, sizeof(*sitd)); sitd->sitd_dma = sitd_dma; sitd->frame = NO_FRAME; list_add(&sitd->sitd_list, &iso_sched->td_list);