From: Andrew Morton <akpm@linux-foundation.org>
To: "Yang, Bo" <Bo.Yang@lsi.com>
Cc: Bo.Yang@lsi.com, James.Bottomley@HansenPartnership.com,
linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
Winston.Austria@lsi.com
Subject: Re: [PATCH 8/9] scsi: megaraid_sas - Add the IEEE SGL support to the driver
Date: Wed, 18 Feb 2009 16:38:35 -0800 [thread overview]
Message-ID: <20090218163835.bb10c640.akpm@linux-foundation.org> (raw)
In-Reply-To: <4B6A08C587958942AA3002690DD4F8C33A07FC5B@cosmail02.lsi.com>
On Tue, 17 Feb 2009 10:31:10 -0700
"Yang, Bo" <Bo.Yang@lsi.com> wrote:
> Add the IEEE SGL support to MegaRAID SAS driver
>
> Signed-off-by Bo Yang<bo.yang@lsi.com>
>
> ---
> drivers/scsi/megaraid/megaraid_sas.c | 125 ++++++++++++++++++++++++++---------
> drivers/scsi/megaraid/megaraid_sas.h | 13 +++
> 2 files changed, 107 insertions(+), 31 deletions(-)
>
> diff -rupN linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c
> --- linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.c 2009-02-12 16:36:41.000000000 -0500
> +++ linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.c 2009-02-12 17:24:26.000000000 -0500
> @@ -698,6 +698,35 @@ megasas_make_sgl64(struct megasas_instan
> return sge_count;
> }
>
> +/**
> + * megasas_make_sgl64 - Prepares 64-bit SGL
> + * @instance: Adapter soft state
> + * @scp: SCSI command from the mid-layer
> + * @mfi_sgl: SGL to be filled in
> + *
> + * If successful, this function returns the number of SG elements. Otherwise,
> + * it returnes -1.
> + */
> +static int
> +megasas_make_sgl_skinny(struct megasas_instance *instance,
> + struct scsi_cmnd *scp, union megasas_sgl *mfi_sgl)
> +{
> + int i;
> + int sge_count;
> + struct scatterlist *os_sgl;
> +
> + sge_count = scsi_dma_map(scp);
> + BUG_ON(sge_count < 0);
Crashing the kernel if scsi_dma_map() fails seems inappropriate?
> + if (sge_count) {
> + scsi_for_each_sg(scp, os_sgl, sge_count, i) {
> + mfi_sgl->sge_skinny[i].length = sg_dma_len(os_sgl);
> + mfi_sgl->sge_skinny[i].phys_addr = sg_dma_address(os_sgl);
> + }
> + }
> + return sge_count;
> +}
>
> ...
>
> + if (instance->flag_ieee == 1) {
> + flags = MFI_FRAME_IEEE;
> + }
We typically omit the unneeded brakes in this situation. But there are
a huge number of places in this driver which ignored that convention.
> /*
> * The RAID firmware may require extended timeouts.
> @@ -1405,7 +1476,7 @@ megasas_bios_param(struct scsi_device *s
> return 0;
> }
>
> -static void megasas_aen_polling(void *arg);
> +static void megasas_aen_polling(struct work_struct *work);
>
> /**
> * megasas_service_aen - Processes an event notification
> @@ -1433,7 +1504,8 @@ megasas_service_aen(struct megasas_insta
> } else {
> ev->instance = instance;
> INIT_WORK(&ev->hotplug_work, megasas_aen_polling);
> - schedule_delayed_work(&ev->hotplug_work, 0);
> + schedule_delayed_work(
> + (struct delayed_work *)&ev->hotplug_work, 0);
Why was this cast added? It looks either unneeded or wrong.
> @@ -4043,12 +4108,12 @@ megasas_aen_polling(struct work_struct *
> class_locale.members.locale = MR_EVT_LOCALE_ALL;
> class_locale.members.class = MR_EVT_CLASS_DEBUG;
>
> - down(&instance->aen_mutex);
> + mutex_lock(&instance->aen_mutex);
>
> error = megasas_register_aen(instance, seq_num,
> class_locale.word);
>
> - up(&instance->aen_mutex);
> + mutex_unlock(&instance->aen_mutex);
OK, so this fixes a bug which was added in an earlier patch.
Please just fix the original patch so that we don't introduce bisection
holes.
> if (error)
> printk(KERN_ERR "%s[%d]: register aen failed error %x\n",
> diff -rupN linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.h linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.h
> --- linux-2.6.28_orig/drivers/scsi/megaraid/megaraid_sas.h 2009-02-12 16:36:42.000000000 -0500
> +++ linux-2.6.28_new/drivers/scsi/megaraid/megaraid_sas.h 2009-02-12 16:53:50.000000000 -0500
> @@ -96,6 +96,7 @@
> #define MFI_FRAME_DIR_WRITE 0x0008
> #define MFI_FRAME_DIR_READ 0x0010
> #define MFI_FRAME_DIR_BOTH 0x0018
> +#define MFI_FRAME_IEEE 0x0020
>
> /*
> * Definition for cmd_status
> @@ -752,10 +753,19 @@ struct megasas_sge64 {
>
> } __attribute__ ((packed));
>
> +struct megasas_sge_skinny {
> +
> + u64 phys_addr;
> + u32 length;
> + u32 flag;
> +
> +} __attribute__ ((packed));
Please use __packed throughout the driver. (might be a problem if this
header is supposed to be shared with userspace?)
next prev parent reply other threads:[~2009-02-19 0:38 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-07 17:09 [PATCH 1/6] scsi: megaraid_sas - add hibernation support bo yang
2007-11-16 21:31 ` Yang, Bo
2007-11-16 22:18 ` James Bottomley
[not found] ` <9738BCBE884FDB42801FAD8A7769C26501C9A4AF@NAMAIL1.ad.lsil.com>
2008-03-18 7:13 ` [PATCH 1/4] scsi: megaraid_sas - Rollback the sense info implementation bo yang
2008-03-17 7:36 ` [PATCH 2/4] scsi: megaraid_sas - Fix the frame count calculation bo yang
2008-03-17 8:13 ` [PATCH 3/4] scsi: megaraid_sas - Add the new controller Support to Driver bo yang
2008-08-01 16:48 ` [PATCH 2/4] scsi: megaraid_sas - Add the shutdown DCMD cmd to driver shutdown routine Yang, Bo
2008-08-01 21:17 ` [PATCH 3/4] scsi: megaraid_sas - Add the new controllers support Yang, Bo
2008-08-01 21:25 ` [PATCH 4/4] scsi: megaraid_sas - Version and Documentation Update Yang, Bo
2008-03-17 8:18 ` [PATCH 4/4] scsi: megaraid_sas - Update the Version and Changelog bo yang
2008-03-17 20:54 ` James Bottomley
2008-03-17 21:00 ` [PATCH 4/4] scsi: megaraid_sas - Update the Version andChangelog Yang, Bo
2009-02-17 14:44 ` [PATCH 1/9] scsi: megaraid_sas - Fix the tape drive support Yang, Bo
2009-02-17 15:25 ` [PATCH 2/9] scsi: megaraid_sas - Add poll wait support to megaraid sas driver - I Yang, Bo
2009-02-17 15:36 ` [PATCH 3/9] scsi: megaraid_sas - Add poll wait support to megaraid sas driver - II Yang, Bo
2009-02-17 15:51 ` [PATCH 4/9] scsi: megaraid_sas - Add new controller 0x73(new SAS2) support to the driver Yang, Bo
2009-02-17 16:37 ` [PATCH 5/9] scsi: megaraid_sas - Add memory support required by 0x73 controller Yang, Bo
2009-02-17 17:09 ` [PATCH 6/9] scsi: megaraid_sas - Report the unconfigured PD (system PD) to OS Yang, Bo
2009-02-17 17:21 ` [PATCH 7/9] scsi: megaraid_sas - Resign the Application cmds to 0x73 (new SAS2) controller Yang, Bo
2009-02-17 17:31 ` [PATCH 8/9] scsi: megaraid_sas - Add the IEEE SGL support to the driver Yang, Bo
2009-02-17 17:50 ` [PATCH 9/9] scsi: megaraid_sas - Update the Version and ChangeLog Yang, Bo
2009-02-19 0:38 ` Andrew Morton [this message]
2009-02-19 0:30 ` [PATCH 5/9] scsi: megaraid_sas - Add memory support required by 0x73 controller Andrew Morton
2009-02-19 0:21 ` [PATCH 2/9] scsi: megaraid_sas - Add poll wait support to megaraid sas driver - I Andrew Morton
2009-02-19 13:55 ` Yang, Bo
2009-05-05 23:55 ` [PATCH 1/10] scsi: megaraid_sas - tape drive support fix Yang, Bo
2009-05-06 0:25 ` [PATCH 2/10] scsi: megaraid_sas - Add Poll Wait mechanism to MegaRAID SAS driver (PART-I) Yang, Bo
2009-05-06 0:41 ` [PATCH 3/10] scsi: megaraid_sas - Add Poll Wait mechanism to MegaRAID SAS driver (PART-II) Yang, Bo
2009-05-06 1:11 ` [PATCH 4/10] scsi: megaraid_sas - Add New SAS 2 (iMR) controller support to the driver Yang, Bo
2009-05-06 1:24 ` [PATCH 5/10] scsi: megaraid_sas - Fixed load/unload issue and Fire the system pd DCDB cmd to MegaRAID SAS FW to get the system PDs Yang, Bo
2009-05-06 1:35 ` [PATCH 6/10] scsi: megaraid_sas - Report the Unconfigured PD (system PD) to OS Yang, Bo
2009-05-06 1:43 ` [PATCH 7/10] scsi: megaraid_sas - Re-assign the Cmds to Application for the iMR controller Yang, Bo
2009-05-06 1:52 ` [PATCH 8/10] scsi: megaraid_sas - Driver adds the IEEE SGE format to support SAS 2 controller Yang, Bo
2009-05-06 2:08 ` [PATCH 9/10] scsi: megaraid_sas - Fixed the logic drives deleted and cmds pending in FW issue Yang, Bo
2009-05-06 2:12 ` [PATCH 10/10] scsi: megaraid_sas - Version and Documentation update Yang, Bo
2009-05-06 21:20 ` [PATCH 5/10] scsi: megaraid_sas - Fixed load/unload issue and Fire the system pd DCDB cmd to MegaRAID SAS FW to get the system PDs Andrew Morton
2009-05-07 15:05 ` Yang, Bo
2009-05-06 21:19 ` [PATCH 3/10] scsi: megaraid_sas - Add Poll Wait mechanism to MegaRAID SAS driver (PART-II) Andrew Morton
2009-05-06 21:17 ` [PATCH 2/10] scsi: megaraid_sas - Add Poll Wait mechanism to MegaRAID SAS driver (PART-I) Andrew Morton
2009-05-07 14:56 ` Yang, Bo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090218163835.bb10c640.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=Bo.Yang@lsi.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=Winston.Austria@lsi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox