Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2935898rwd; Mon, 29 May 2023 03:17:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ivJ3/3s0zw8RbcFhKchm5NRONf4Hob8uPe5jH9PcTR6EcUZ+o+6DBP8PJOyPWz+Ibmv9b X-Received: by 2002:a05:6a20:54a6:b0:10c:8f0c:f81c with SMTP id i38-20020a056a2054a600b0010c8f0cf81cmr8428750pzk.53.1685355429618; Mon, 29 May 2023 03:17:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685355429; cv=none; d=google.com; s=arc-20160816; b=IbByn3SNnF1MD8syyka+o9TO9cJxzEG6L+FrrPJrpPKwOSbsrnltMLvOcKnLj48g8z 8bttFb+PmMiEIbKRsbWrAXVYQZINy/dxEgfDcWdq0KdYvZb7jsHja5fVYUMUrhKBRTWQ 8Jshapq/8EMbufeWA6WZmIaOudhTq9d14k7j0jGRvSNTECo7sMLZTAfPO+gB2EPlUl55 J9DsFqDChV4K8N6Ae/1jh/mgEthJ8STIm/q2sllmQXcFQE0tyUk4KqS8OaT6eMRLuymd T7pydGaTX3DNsSoUBhMO8wUXDId0VXELC8MECW4i00dv92aerzpbyrzAhGnOaqPs3eWu OTZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=xjRnOnVzH21qwTF1i1M+CHM/UUU0FRSIh59ttk7gBxQ=; b=rm9tQuvQOvzIyRz+ENCImPZPIHolE9hLtKC3TjxTt5VB1OiCurlgY8+hQSSshzsxMC Vv4FwbeHbmXAUGAAaqfBVvkYSvVAweFlwizseJGlc/RAiyRNbWSFrSsF6Nv6ExQ6f5Km fmIKs85KuyiZprWJmM7ARngwFGUZamPUs6XAMGxd8N8+KP7ZqF0OusdqdqH/57h6hHrf c3pL1zb3woBddaqNXVpwK6CLYGazb8IjALdPiJ5cZuiMmeQreFQL1OP+CE3PZu9an9fI TB+HBpEGVrOOX9BxXNKubiA4+B24ZWVPg0K5s/7WdGUxAVQwdEYBWDoTVfbKxKe73IoK CSKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t9kOBPL4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t144-20020a635f96000000b0053f25281d11si9194662pgb.527.2023.05.29.03.16.56; Mon, 29 May 2023 03:17:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t9kOBPL4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231806AbjE2J4P (ORCPT + 99 others); Mon, 29 May 2023 05:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbjE2J4N (ORCPT ); Mon, 29 May 2023 05:56:13 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2DEC9A7; Mon, 29 May 2023 02:56:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 93D5A6145E; Mon, 29 May 2023 09:56:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3EE4C433D2; Mon, 29 May 2023 09:56:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685354171; bh=XYVh6RzQFkPOqtivE4ll/PWG350C32gRKH4S8zFV7ak=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=t9kOBPL4e5ky2rlmxcimmyy2YD73bM4aNV9F9U6z/v0ObtWoiK8vCoa24M9XwAG2k WxokabhdoeapKQ2KmwuytFBsCfAH0on1zNCzYtuARbsLhvjazecdpUN9AouocEAqcR 2O5hUy6UVpgVhAybCFzgk07pkWUJw3jy+Bp5NqCDahTSCdc3z+b8kJ7wQF8uetwq6r RFUxWs+aI/lgDCNMYXuzVJZLfV4QUVIXUxK5mO1J8J6z1FpgHe7xJ/eaqEJWK3y//n Aj+D9HiBMHja47OvAJTapjeS85/rvSXhbrtaMnpIDfwZ3mvBu3M3Mq1/nwQLptCzBi TaHWIfLw9yBDw== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q3Zbj-0012eN-DS; Mon, 29 May 2023 10:56:08 +0100 Date: Mon, 29 May 2023 10:56:02 +0100 Message-ID: <87353flavh.wl-maz@kernel.org> From: Marc Zyngier To: Biju Das Cc: Laurent Pinchart , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Zheng Wang , Geert Uytterhoeven , Yoshihiro Shimoda , Wolfram Sang , Krzysztof Kozlowski , "linux-usb@vger.kernel.org" , Prabhakar Mahadev Lad , "linux-renesas-soc@vger.kernel.org" Subject: Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error In-Reply-To: References: <20230526143615.372338-1-biju.das.jz@bp.renesas.com> <20230529061714.GA25984@pendragon.ideasonboard.com> <86bki3cxm2.wl-maz@kernel.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: biju.das.jz@bp.renesas.com, laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, zyytlz.wz@163.com, geert+renesas@glider.be, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com, krzysztof.kozlowski@linaro.org, linux-usb@vger.kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, linux-renesas-soc@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 29 May 2023 10:39:50 +0100, Biju Das wrote: > > Hi Marc Zyngier, > > Thanks for the feedback. > > > Subject: Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix RZ/V2M > > {modprobe,bind} error > > > > On Mon, 29 May 2023 09:42:34 +0100, > > Biju Das wrote: > > > > > > Hi Laurent, > > > > > > Thanks for the feedback. > > > > > > > Subject: Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix RZ/V2M > > > > {modprobe,bind} error > > > > > > > > Hi Biju, > > > > > > > > Thank you for the patch. > > > > > > > > On Fri, May 26, 2023 at 03:36:15PM +0100, Biju Das wrote: > > > > > Currently {modprobe, bind} after {rmmod, unbind} results in probe > > > > failure. > > > > > > > > > > genirq: Flags mismatch irq 22. 00000004 (85070400.usb3drd) vs. > > > > > 00000004 (85070400.usb3drd) > > > > > renesas_usb3: probe of 85070000.usb3peri failed with error -16 > > > > > > > > > > Fix this issue by replacing "parent dev"->"dev" as the irq > > > > > resource is managed by this driver. > > > > > > > > If the dev pointer passed to devm_request_irq() is not the correct > > > > one, how does it work the first time the driver is loaded ? > > > > > > + Marc/ Kernel.org to give some feedback on this issue > > > > > > I believe there may be a bug in the genirq (kernel/irq) driver. > > > first time it works ok. Maybe this driver is caching on unload with > > > null value and comparing with actual one (irq 22) during reload?? > > > > > > Maybe genirq expert can comment what went wrong here?? > > > > You get shouted at because you are registering an interrupt handler for > > the same IRQ twice, > > This not true. It is registering only one IRQ, but with parent device handle. And you're doing that *TWICE*. Once per load of this driver. > > and the interrupt is not configured with the SHARED > > flag. > > I haven't added SHARED flag as there is only one IRQ registration. > > If, as I understand it, you only have a single device using this > > interrupt, then it means your driver is not freeing its interrupt on > > unload. > > You mean devm_request_irq(ddata->dev..) doesn't free the resource as > we have unloaded only child device rather than parent. > > But while parent is active, why genirq is giving error during reload? > It should show same behaviour like initial probe. Do you understand the meaning of the "dev" parameter you pass to devm_request_irq()? M. -- Without deviation from the norm, progress is not possible.