From patchwork Sun Jul 2 00:15:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ladislav Michl X-Patchwork-Id: 13299133 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 626B7EB64DC for ; Sun, 2 Jul 2023 00:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229846AbjGBAPK (ORCPT ); Sat, 1 Jul 2023 20:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229540AbjGBAPK (ORCPT ); Sat, 1 Jul 2023 20:15:10 -0400 Received: from h2.cmg1.smtp.forpsi.com (h2.cmg1.smtp.forpsi.com [81.2.195.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E334E10D0 for ; Sat, 1 Jul 2023 17:15:08 -0700 (PDT) Received: from lenoch ([91.218.190.200]) by cmgsmtp with ESMTPSA id Fkk5qsmaFPm6CFkk6qpCr0; Sun, 02 Jul 2023 02:15:07 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1688256907; bh=0xPV1SbzfU6QFy8LKKRYigY2tyYLNV24h8E6RGssy6Q=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=kM/9bihQGJlK9Xcu89EECHyoNUQNBbounxewuORx3XEDf4HVDS6xlkJdzlMKcRiht BYImwJF5Aer6ri8uWZ7z2Q+Oeg5s9mE7HJ7ZCNJlcD7ZNTN4mxXYWcYvusAXtA/kWo HgdVvsH2O3W0Fls3hQyEUEfeyiLbq33dFYFihj/4uRQMlNZaQW0ivJz3BlyTNN5rsa rheN6rXsqZYcGTttsWQP6rshUsdSE+dVfmwum1zBQMTMJ+sYJG7nu9BLyvmLc6dBW7 qC8NXpfi6gXpGAyhii4E10x2TBTtYR6m2GHRFPaWXLaeyUCXysdQg2T2aJ0B15LgAL yqGahoaJfSwhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=triops.cz; s=f2019; t=1688256907; bh=0xPV1SbzfU6QFy8LKKRYigY2tyYLNV24h8E6RGssy6Q=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=kM/9bihQGJlK9Xcu89EECHyoNUQNBbounxewuORx3XEDf4HVDS6xlkJdzlMKcRiht BYImwJF5Aer6ri8uWZ7z2Q+Oeg5s9mE7HJ7ZCNJlcD7ZNTN4mxXYWcYvusAXtA/kWo HgdVvsH2O3W0Fls3hQyEUEfeyiLbq33dFYFihj/4uRQMlNZaQW0ivJz3BlyTNN5rsa rheN6rXsqZYcGTttsWQP6rshUsdSE+dVfmwum1zBQMTMJ+sYJG7nu9BLyvmLc6dBW7 qC8NXpfi6gXpGAyhii4E10x2TBTtYR6m2GHRFPaWXLaeyUCXysdQg2T2aJ0B15LgAL yqGahoaJfSwhg== Date: Sun, 2 Jul 2023 02:15:05 +0200 From: Ladislav Michl To: Thomas Bogendoerfer , Thinh Nguyen , Greg Kroah-Hartman , Liang He Cc: linux-mips@vger.kernel.org, linux-usb@vger.kernel.org Subject: [PATCH v2 0/3] Cleanup Octeon DWC3 glue code Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CMAE-Envelope: MS4wfGk7Uh6B7iKdQ7pchZfbrOxWyPoNOY1T/wK5rvC49x1TiMSXlIO6Eo4NiQ7AGElulRScAiZIwQ8dEb0GHtXpG3NhRUskRuIDofvYm2RdSZ289LHQvOYU I1oOfO0WCSCHLQD03pYYC77YNeuUojvFcJhu62H0XuM3rFEUYtaANiRDT7wVadgrm5WmynxclUN+zH/pZzqlhFb5MCQ5p1OFDQAORm93g/2ozUG2GEGQIeAT 2Fu24jxY98Cr73IoFGmQmeDgjKODgIiVxZtqCaeOaHv8S5SR3GOJzQqdfJtcDlrXlKlJi0A7UlD3X3/RZW4BCvyg8KAGKWQkbdU44PDS5aDNlVHV7bEbMT2H szq5ElWm Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org Hi, primary motivation was to fix issue Id 29206 as described in OCTEON III CN70XX/CN71XX Known Issues, version: 1.9. Said document is marked as Marvell Proprietary and Confidential, therefore I'm not sure if I can cite from it. This probably does not matter too much as the root of the information listed there is a workaround being implemented in OCTEON SDK 3.1.2 patch 7 and later in u-boot/drivers/usb/host/xhci-octeon.c:dwc3_uphy_pll_reset() My coleague ported that patch to linux-4.9 and I will later modify it to work on top of current glue driver. The glue code currently lives in arch/mips/cavium-octeon/octeon-usb.c and loops for each "cavium,octeon-7130-usb-uctl" compatible. However there is no bond with dwc3 core code, so if anything goes wrong in glue code, the loop breaks, leaving dwc3 in reset. Later on when dwc3 core tries to read any device register, bus error is emited, leading to kernel panic. Therefore move it to drivers/usb/dwc3 while making it glue driver. This is a second attempt, see changelog appended to patches. Ladislav Michl (3): usb: dwc3: dwc3-octeon: Convert to glue driver usb: dwc3: dwc3-octeon: Move node parsing into driver probe usb: dwc3: Add SPDX header and copyright arch/mips/cavium-octeon/Makefile | 1 - arch/mips/cavium-octeon/octeon-platform.c | 1 - drivers/usb/dwc3/Kconfig | 10 + drivers/usb/dwc3/Makefile | 1 + .../usb/dwc3/dwc3-octeon.c | 262 +++++++++--------- drivers/usb/dwc3/dwc3-of-simple.c | 1 - 6 files changed, 142 insertions(+), 134 deletions(-) rename arch/mips/cavium-octeon/octeon-usb.c => drivers/usb/dwc3/dwc3-octeon.c (80%)