From patchwork Fri Mar 26 07:02:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Ren X-Patchwork-Id: 12165927 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E39C2C433DB for ; Fri, 26 Mar 2021 07:03:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 57985619CB for ; Fri, 26 Mar 2021 07:03:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 57985619CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:Cc:To:From:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=8+nVcjDo2dUW+GAQKxCMRBL3n8uhRqeyGAs2JX11cbs=; b=pSc7AffSOU/l2x5i79ipNRtmZi k+fI72iKrdOQl0MzBEA+UYlfRZo7Paz08WB5TS/XK9sz6RxUl7wiFkRVU33+o6yU32cHM2G+tRJhz xVHNrCk/IYLpuSeXR2Zwy6f7HJ+vF1WObI5X+iexqR7WaqWvYoQVI8HikTDHZDtgnMI2G+JwJSF2n MpOWSF3+jhzSdoK7cNv0DLjRO3d5+D1Job/Cek+oaISReBbD7cmldzVmkAwHz7frCnPKpWBvYBHTl 3TLWk9j2q+IxMn+zg4I8ZTT3ze0TBmz14Sp5cwyA2Al8Yr4WoP2BHPvrgqci3lMV6r4giecMCygqd floJOyKQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lPgUL-002w2c-B7; Fri, 26 Mar 2021 07:02:33 +0000 Received: from mail-pg1-x533.google.com ([2607:f8b0:4864:20::533]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lPgUF-002w20-17 for linux-arm-kernel@lists.infradead.org; Fri, 26 Mar 2021 07:02:28 +0000 Received: by mail-pg1-x533.google.com with SMTP id r17so4013216pgi.0 for ; Fri, 26 Mar 2021 00:02:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=fYmuhM1IRdVizXhzKiPSv+Ub0QxzG3Tko+5Eq9MvW/Y=; b=heyhvJU3/gnGrud3yBbvIMaXolUTjLPjrYkFKp6B+qMUBMZTyxLexr3TIysq05T7qY z2T9axaa32d04Osw8uFzvGzDUonOoqJ/bR4bav7eZkvokFQkf2tLBat8/6lI1HJOMVxe PZoCfl0RboIDWZunfsbHt/9J12HKfjdo8V6xBagYemS32K1S//zKRB/K6J41+DwGXOUq s77rumz5RicGCo9nqaW+WK5lnTsDJ5FIQtPXxyyl9m5VcWRdIArfJhTn7kjtkjpXTScQ IzUrsv/4AnLYvD/1zvEGmhBd0e/lqhm9SJIq0SoGQudeGNHemfPS77Smni59pQ6VTWzl rSig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=fYmuhM1IRdVizXhzKiPSv+Ub0QxzG3Tko+5Eq9MvW/Y=; b=qi7vPRT46HaU18YxfmlO+K3YRDP6W9oqYWcdQBUujUsq8598b86IsBd/QSpGyPoEbp Qn9Ar6NcQ2mcFLQ9kS0xWhkw0hArh1AVONI14mozEc33jLhgnYGxMxFaxmGdGk6/EvU9 D90OhRDDI3vqLBaFZHa4gLeDeUtNghQI11imOtdIRdOx9ONKwhf6lIpK7QD78XmG/2p5 3FkZdnixn8eDAwE18d4ENEOI7UJapbt1JhAjZY2feTqy921d/YXmXscPB9NdjfXWYgBV a1PtxL2j7Zr0w60z937ZsekVkNakVcSlAov4FgP711yF4Vu1hS4VUYwXEKt/guX4XXoC mthQ== X-Gm-Message-State: AOAM532g/jJWbCYPw16ZsKdHLlQzRhwWWj3dKCf/EhVc0X/OuB/KA7xc m0yZhpQ1tPlEc+PszEmkJLs= X-Google-Smtp-Source: ABdhPJyn9RFt10iRoIkTqW8m0bKtd4afC3cJ85B/IDkwTe37xBUR7RWH1VR4Hm3SQMbY8NcPWjBVjw== X-Received: by 2002:a63:545e:: with SMTP id e30mr11128704pgm.13.1616742144402; Fri, 26 Mar 2021 00:02:24 -0700 (PDT) Received: from taoren-ubuntu-R90MNF91.thefacebook.com (c-73-252-146-110.hsd1.ca.comcast.net. [73.252.146.110]) by smtp.gmail.com with ESMTPSA id y193sm8105133pfc.72.2021.03.26.00.02.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 00:02:23 -0700 (PDT) From: rentao.bupt@gmail.com To: Felipe Balbi , Greg Kroah-Hartman , Joel Stanley , Andrew Jeffery , kernel test robot , Masahiro Yamada , Sasha Levin , Ryan Chen , Thomas Tai , Konrad Rzeszutek Wilk , Christoph Hellwig , Benjamin Herrenschmidt , linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org, openbmc@lists.ozlabs.org, Tao Ren Cc: Tao Ren Subject: [PATCH] usb: gadget: aspeed: set port_dev dma mask Date: Fri, 26 Mar 2021 00:02:14 -0700 Message-Id: <20210326070214.6719-1-rentao.bupt@gmail.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210326_070227_184127_543F7D5A X-CRM114-Status: UNSURE ( 9.72 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Tao Ren Set aspeed-usb vhub port_dev's dma mask to pass the dma_mask test in "dma_map_page_attrs" function, and the dma_mask test was added in 'commit f959dcd6ddfd ("dma-direct: Fix potential NULL pointer dereference")'. Below is the backtrace without the patch: [<80106550>] show_stack+0x20/0x24 [<80106868>] dump_stack+0x28/0x30 [<80823540>] __warn+0xfc/0x110 [<8011ac30>] warn_slowpath_fmt+0xb0/0xc0 [<8011ad44>] dma_map_page_attrs+0x24c/0x314 [<8016a27c>] usb_gadget_map_request_by_dev+0x100/0x1e4 [<805cedd8>] usb_gadget_map_request+0x1c/0x20 [<805cefbc>] ast_vhub_epn_queue+0xa0/0x1d8 [<7f02f710>] usb_ep_queue+0x48/0xc4 [<805cd3e8>] ecm_do_notify+0xf8/0x248 [<7f145920>] ecm_set_alt+0xc8/0x1d0 [<7f145c34>] composite_setup+0x680/0x1d30 [<7f00deb8>] ast_vhub_ep0_handle_setup+0xa4/0x1bc [<7f02ee94>] ast_vhub_dev_irq+0x58/0x84 [<7f0309e0>] ast_vhub_irq+0xb0/0x1c8 [<7f02e118>] __handle_irq_event_percpu+0x50/0x19c [<8015e5bc>] handle_irq_event_percpu+0x38/0x8c [<8015e758>] handle_irq_event+0x38/0x4c Signed-off-by: Tao Ren --- drivers/usb/gadget/udc/aspeed-vhub/dev.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/gadget/udc/aspeed-vhub/dev.c b/drivers/usb/gadget/udc/aspeed-vhub/dev.c index d268306a7bfe..9eb3904a6ff9 100644 --- a/drivers/usb/gadget/udc/aspeed-vhub/dev.c +++ b/drivers/usb/gadget/udc/aspeed-vhub/dev.c @@ -569,6 +569,7 @@ int ast_vhub_init_dev(struct ast_vhub *vhub, unsigned int idx) device_initialize(d->port_dev); d->port_dev->release = ast_vhub_dev_release; d->port_dev->parent = parent; + d->port_dev->dma_mask = parent->dma_mask; dev_set_name(d->port_dev, "%s:p%d", dev_name(parent), idx + 1); rc = device_add(d->port_dev); if (rc)