From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932331AbbJPM4N (ORCPT ); Fri, 16 Oct 2015 08:56:13 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:56551 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932259AbbJPM4K (ORCPT ); Fri, 16 Oct 2015 08:56:10 -0400 From: Arnd Bergmann To: John Garry Cc: James.Bottomley@hansenpartnership.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linuxarm@huawei.com, zhangfei.gao@linaro.org, linux-scsi@vger.kernel.org, xuwei5@hisilicon.com, john.garry2@mail.dcu.ie, hare@suse.de Subject: Re: [PATCH 13/25] scsi: hisi_sas: add path from phyup irq to SAS framework Date: Fri, 16 Oct 2015 14:55:38 +0200 Message-ID: <3757591.KXgD8p0a1E@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1444663237-238302-14-git-send-email-john.garry@huawei.com> References: <1444663237-238302-1-git-send-email-john.garry@huawei.com> <1444663237-238302-14-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:gGoABk4tAXNe8m0wNfeLc4Ir4+wBSnVlpkRxkzPa5UjZZC/U/u2 FINjBMzsEoxIvMMTikT3L85Ka70AkyfI3OfzL/VC5iepdNC5K0YlnHmuY+5GVbLVfghvPtQ RTDs25Ko7qdOungG5qPvJC14tl8EZhPXaaPlbNyaxfiSUj5cih6aIRp1K4/c9rWaOIkEop4 f2yRtlo6+CEL6W2q60+og== X-UI-Out-Filterresults: notjunk:1;V01:K0:aRK0w7YLP7g=:ctup83MSLANiFWXlNw8KQa jKiq8xbUdKfvLv/WchtiU5OlCKSP+dpxW/FLE3hBoYGUM3iqsAjo7YGbldyJcXzgKijWliqd+ /t9JexSfKMXxysoN5UqGYFbCEmNxle8rx7YkzsSlbQtS8ICfAmUB8ibq2emj1DR29r8eI56oW ePdhnfIBVKl6LT9W6y4j2Rj56fFSem3MbvPjcMINASHHVLUyNMWi73AKGmJPOAlhQH3F7gSUF ftdma1HLTbPnb2UW1xt17O2HAkJfKBMnWkG1i55EVorqQFExL3ld/dcyDXEDc2pAaK+mIxuEl FS/M5HlirJL9MmqBjc4ULZtaw1ReNTcv35QQd1QbTN3p/Zv1iMwMHJSJoHWaJ2g7R7pbStJEX v+oyLcYBoDRKYqTJ0bV2+wiNzi0neoVFa9Xkirae+fPEiTuIXgpEMxP4MhpZk8b9ZFNiImQT9 bvuTbI1iqUlTpkMouB6inh67UIdquKfAMin2icmkxSSxUxXDopKZTgli0bTAyN9jNbauat2Gb 9kBEw0PpGuFsXR2QtihJjg5L1d7c9iMdGl6htBn/yVy0djLbDfQB1TyZLBND+Pt3/wwXNMKTq sSLBVHa5wqG7MsNOSVZQe9NwGVEjdkUe8JjVr2UByZ+PW+bibfr+UOnDDuLexn+u4NRJ5x/BN Ue77fSqcvNqYYDs1fuQu6zZDFo9vDrZGnfFoq7xRnuPoLK0buVCVGkcepWetiYKiogeqzrTd5 4ibFW6osRoFO5HPI Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 12 October 2015 23:20:25 John Garry wrote: > @@ -804,6 +818,16 @@ static irqreturn_t int_phyup_v1_hw(int irq_no, void *p) > phy->identify.target_port_protocols = > SAS_PROTOCOL_SMP; > > + wq = kmalloc(sizeof(*wq), GFP_ATOMIC); > + if (!wq) > + goto end; > + > + wq->event = PHYUP; > + wq->hisi_hba = hisi_hba; > + wq->phy_no = phy_no; > + > + INIT_WORK(&wq->work_struct, hisi_sas_wq_process); > + queue_work(hisi_hba->wq, &wq->work_struct); > > end: > hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2, > While rereading some other parts of the code, I stumbled over this piece. You should generally not allocate work structs dynamically. Why not embed the work struct inside of the phy structure and then just queue that? Arnd