Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1600954imu; Wed, 12 Dec 2018 00:36:43 -0800 (PST) X-Google-Smtp-Source: AFSGD/WjjMGNemZpky28t1p8libE45xWjn6+7tDSi+io5buhIClf48h7PbFXCQtnQ6nSh8tLcCRr X-Received: by 2002:a63:d10:: with SMTP id c16mr17656979pgl.382.1544603803223; Wed, 12 Dec 2018 00:36:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544603803; cv=none; d=google.com; s=arc-20160816; b=kJ4kHpo6+71yXuvL/cew/xLxvSVRNMdOXwnqu0mgujdOx4LPTNmwYnodHxQgUAaUV0 lo3r7MnbKkTL/2UlFtXcg2h+nZV+HkQxuSXhSmNKFHBT61h1SAPi2UjGMORZyYFQyH57 4pczVhQinXkenx2qs3Ma5TMWj6TZ1xzDW9H/5Kz96XYAbZUUbm/ps1NXpujHGs19zTtP B2viIBXVbnTD9offI0t3YUYZv7FwRs9yWGXMB5bE8ihY6e2paLYxCKTqL4pVG7pEdg32 toSotGQNAdfQS6A0iZKAJBOzovSL64UUfVtDzJCpjqZeSx/DayYwgSzwJJdWeCy7vDpb mN4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=a9GWbbJZ1GFqdi4kur5zU8Fvy+seJQwm8F75//hqEBA=; b=IT2GtGVzFd0C1gm6Z7mnFw8ae2MfSphPEKQdbAJW/Z2gbpJDjW/5fInBQOGR1MAT4S sWOB0fF6dVmUpUPkW12f6KGYeBmRmp04eww2HMqs3Q/xVuKS/cekAh/2nC2H2S4zB5Cd IWbZnCWqIrLun8Pw0CqVtktWyewWw5zXFA0YassUwxv5RENbEmNjOAg7TKJEko1b+SuQ 8Xgfb/xSa6LtahnQAJkiRfzHYrcR996XidLTtgPnmpalF3evmde64CLcGK0kvBdc0QWq I0Ph8mga5DeUByzUaId7LQd/yb9bqdT4ujo+81K+B7qdce/42G/WdzwY86weC7G00/oU Rn2A== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w75si15333764pfd.55.2018.12.12.00.36.27; Wed, 12 Dec 2018 00:36:43 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726781AbeLLIef (ORCPT + 99 others); Wed, 12 Dec 2018 03:34:35 -0500 Received: from mga11.intel.com ([192.55.52.93]:32155 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726525AbeLLIee (ORCPT ); Wed, 12 Dec 2018 03:34:34 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2018 00:34:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,343,1539673200"; d="asc'?scan'208";a="282933478" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.72.175]) by orsmga005.jf.intel.com with ESMTP; 12 Dec 2018 00:34:28 -0800 From: Felipe Balbi To: Peter Chen , Peter Chen , "pawell\@cadence.com" Cc: "devicetree\@vger.kernel.org" , Greg Kroah-Hartman , "linux-usb\@vger.kernel.org" , "rogerq\@ti.com" , lkml , "adouglas\@cadence.com" , "jbergsagel\@ti.com" , "nsekhar\@ti.com" , "nm\@ti.com" , "sureshp\@cadence.com" , "pjez\@cadence.com" , "kurahul\@cadence.com" Subject: RE: [PATCH v1 2/2] usb:cdns3 Add Cadence USB3 DRD Driver In-Reply-To: References: <1544445555-17325-1-git-send-email-pawell@cadence.com> <1544445555-17325-3-git-send-email-pawell@cadence.com> <87h8fkmfar.fsf@linux.intel.com> <877egfmdxk.fsf@linux.intel.com> Date: Wed, 12 Dec 2018 10:34:24 +0200 Message-ID: <871s6nm9db.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Peter Chen writes: >> >> >> + irqreturn_t ret =3D IRQ_NONE; >> >> >> + unsigned long flags; >> >> >> + u32 reg; >> >> >> + >> >> >> + priv_dev =3D cdns->gadget_dev; >> >> >> + spin_lock_irqsave(&priv_dev->lock, flags); >> >> > >> >> >you're already running in hardirq context. Why do you need this lock >> >> >at all? I would be better to use the hardirq handler to mask your >> >> >interrupts, so they don't fire again, then used the top-half >> >> >(softirq) handler to actually handle the interrupts. >> >> >> > >> > This controller may be ran at SMP environment, register and flag >> > access needs to be protected among CPUs running. >>=20 >> in hardirq context? When interrupts are already disabled? > > Interrupt handler (hardirq context) at CPU0, and process at CPU1, eg > role switch, unload module, etc. the process at CPU1 would need to disable interrupts (spin_lock_irq() or spin_lock_irqsave()), not the hardirq on CPU0 as that already runs with interrrupts disabled. https://www.kernel.org/doc/html/latest/kernel-hacking/locking.html#table-of= -minimum-requirements =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlwQyBAACgkQzL64meEa mQZ8CxAAvjH18/fOPM8pCR/Wu8JM3pC2RH0ACJcypp+6QdyCQrRBCrDHetCXgIBH INpwQzkJGW8+d4zkFAUgVtuWkKCkNyoMFw9jR1cQSVGyem+S9HN6AR78ufEeXJ61 pCna4GCRwEFdzHLUnEaPEh+q3TUSO1n0zE/afibTkpW+Jh6u7wgtLdOL1m8HaG7R l5taWIvb/RL+pH2Gbbv/7SebacbpK/cf6gSGBbR6LgAvweCDUWdeJJluzY+m9uDp uhwZ3mXvgV0MiQbTRk9j1QclyGNBJrXOOzBW84v8Tnu4P9kCbXVJpwuPAsJZQS7T H8q9s3NUwDKHcAjExzuUdtOwmbdBgbd0IPkwSstuIsKvav3TwtNae0o39eAE5y8S Bx1ulfD9XRaQiWSHo6UTH7wOJNtkQCvcAIirEMnlomKSwwAQTQ6Tmrdh5/hd/OI/ qY7LsmZfN8yZ+1KhKWlJyZJgabw9WIEaesmPwwFfS1dskDMAwoEegrK4azDprALC 6IxDj6oQ05irTwEu8ICFvYkzuBZ5tGEwmNKtnVJxzvbmUQBgoGGlPppVLexBSXdP fRDLzuI4hX0g4vifRo4qcJS4U3yOuJpoIybY4ZSsOPefwA4DqHxG0M8Iqi1Qe84y +e20v5AQnLxxUrC+XnwcW37JoGA6uukzyYijQrvPfngpllTr+fc= =spIR -----END PGP SIGNATURE----- --=-=-=--