* Re: [PATCH 0/2] ASoC: fsl: Use dynamic slot width for ESAI.
From: Mark Brown @ 2014-10-31 18:12 UTC (permalink / raw)
To: Nicolin Chen
Cc: alsa-devel, lgirdwood, b02247, linux-kernel, timur, Li.Xiubo,
linuxppc-dev
In-Reply-To: <cover.1414193668.git.nicoleotsuka@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 237 bytes --]
On Fri, Oct 24, 2014 at 04:48:10PM -0700, Nicolin Chen wrote:
> @Shengjiu,
> Will you be available to test this series on Sabre Auto for both
> Master and Slave cases? I'd like to wait for your Test-by. Thanks.
Any ETA on the testing?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]
^ permalink raw reply
* Re: [PATCH 3/3] ipr: Wait for aborted command responses
From: wenxiong @ 2014-10-31 15:23 UTC (permalink / raw)
To: Brian King; +Cc: James.Bottomley, hch, linuxppc-dev, stable, linux-scsi
In-Reply-To: <54539294.7010209@linux.vnet.ibm.com>
I have reviewed the patch and it fixed the issue we saw in our
environment recently.
Thanks,
Wendy
Quoting Brian King <brking@linux.vnet.ibm.com>:
> Adding Wendy...
>
> On 10/30/2014 05:27 PM, Brian King wrote:
>> Fixes a race condition in abort handling that was injected
>> when multiple interrupt support was added. When only a single
>> interrupt is present, the adapter guarantees it will send
>> responses for aborted commands prior to the response for the
>> abort command itself. With multiple interrupts, these responses
>> generally come back on different interrupts, so we need to
>> ensure the abort thread waits until the aborted command is
>> complete so we don't perform a double completion. This race
>> condition was being hit frequently in environments which
>> were triggering command timeouts, which was resulting in
>> a double completion causing a kernel oops.
>>
>> Cc: <stable@vger.kernel.org>
>> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
>> ---
>>
>> drivers/scsi/ipr.c | 92
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> drivers/scsi/ipr.h | 1
>> 2 files changed, 93 insertions(+)
>>
>> diff -puN drivers/scsi/ipr.c~ipr_eh_wait drivers/scsi/ipr.c
>> --- scsi-queue/drivers/scsi/ipr.c~ipr_eh_wait 2014-10-30
>> 17:15:37.302753120 -0500
>> +++ scsi-queue-bjking1/drivers/scsi/ipr.c 2014-10-30
>> 17:15:37.311753039 -0500
>> @@ -683,6 +683,7 @@ static void ipr_init_ipr_cmnd(struct ipr
>> ipr_reinit_ipr_cmnd(ipr_cmd);
>> ipr_cmd->u.scratch = 0;
>> ipr_cmd->sibling = NULL;
>> + ipr_cmd->eh_comp = NULL;
>> ipr_cmd->fast_done = fast_done;
>> init_timer(&ipr_cmd->timer);
>> }
>> @@ -848,6 +849,8 @@ static void ipr_scsi_eh_done(struct ipr_
>>
>> scsi_dma_unmap(ipr_cmd->scsi_cmd);
>> scsi_cmd->scsi_done(scsi_cmd);
>> + if (ipr_cmd->eh_comp)
>> + complete(ipr_cmd->eh_comp);
>> list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
>> }
>>
>> @@ -4854,6 +4857,84 @@ static int ipr_slave_alloc(struct scsi_d
>> return rc;
>> }
>>
>> +/**
>> + * ipr_match_lun - Match function for specified LUN
>> + * @ipr_cmd: ipr command struct
>> + * @device: device to match (sdev)
>> + *
>> + * Returns:
>> + * 1 if command matches sdev / 0 if command does not match sdev
>> + **/
>> +static int ipr_match_lun(struct ipr_cmnd *ipr_cmd, void *device)
>> +{
>> + if (ipr_cmd->scsi_cmd && ipr_cmd->scsi_cmd->device == device)
>> + return 1;
>> + return 0;
>> +}
>> +
>> +/**
>> + * ipr_wait_for_ops - Wait for matching commands to complete
>> + * @ipr_cmd: ipr command struct
>> + * @device: device to match (sdev)
>> + * @match: match function to use
>> + *
>> + * Returns:
>> + * SUCCESS / FAILED
>> + **/
>> +static int ipr_wait_for_ops(struct ipr_ioa_cfg *ioa_cfg, void *device,
>> + int (*match)(struct ipr_cmnd *, void *))
>> +{
>> + struct ipr_cmnd *ipr_cmd;
>> + int wait;
>> + unsigned long flags;
>> + struct ipr_hrr_queue *hrrq;
>> + signed long timeout = IPR_ABORT_TASK_TIMEOUT;
>> + DECLARE_COMPLETION_ONSTACK(comp);
>> +
>> + ENTER;
>> + do {
>> + wait = 0;
>> +
>> + for_each_hrrq(hrrq, ioa_cfg) {
>> + spin_lock_irqsave(hrrq->lock, flags);
>> + list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
>> + if (match(ipr_cmd, device)) {
>> + ipr_cmd->eh_comp = ∁
>> + wait++;
>> + }
>> + }
>> + spin_unlock_irqrestore(hrrq->lock, flags);
>> + }
>> +
>> + if (wait) {
>> + timeout = wait_for_completion_timeout(&comp, timeout);
>> +
>> + if (!timeout) {
>> + wait = 0;
>> +
>> + for_each_hrrq(hrrq, ioa_cfg) {
>> + spin_lock_irqsave(hrrq->lock, flags);
>> + list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
>> + if (match(ipr_cmd, device)) {
>> + ipr_cmd->eh_comp = NULL;
>> + wait++;
>> + }
>> + }
>> + spin_unlock_irqrestore(hrrq->lock, flags);
>> + }
>> +
>> + if (wait)
>> + dev_err(&ioa_cfg->pdev->dev, "Timed out waiting for aborted
>> commands\n");
>> + LEAVE;
>> + return wait ? FAILED : SUCCESS;
>> + }
>> + }
>> + } while (wait);
>> +
>> + LEAVE;
>> + return SUCCESS;
>> +}
>> +
>> static int ipr_eh_host_reset(struct scsi_cmnd *cmd)
>> {
>> struct ipr_ioa_cfg *ioa_cfg;
>> @@ -5073,11 +5154,17 @@ static int __ipr_eh_dev_reset(struct scs
>> static int ipr_eh_dev_reset(struct scsi_cmnd *cmd)
>> {
>> int rc;
>> + struct ipr_ioa_cfg *ioa_cfg;
>> +
>> + ioa_cfg = (struct ipr_ioa_cfg *) cmd->device->host->hostdata;
>>
>> spin_lock_irq(cmd->device->host->host_lock);
>> rc = __ipr_eh_dev_reset(cmd);
>> spin_unlock_irq(cmd->device->host->host_lock);
>>
>> + if (rc == SUCCESS)
>> + rc = ipr_wait_for_ops(ioa_cfg, cmd->device, ipr_match_lun);
>> +
>> return rc;
>> }
>>
>> @@ -5255,13 +5342,18 @@ static int ipr_eh_abort(struct scsi_cmnd
>> {
>> unsigned long flags;
>> int rc;
>> + struct ipr_ioa_cfg *ioa_cfg;
>>
>> ENTER;
>>
>> + ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
>> +
>> spin_lock_irqsave(scsi_cmd->device->host->host_lock, flags);
>> rc = ipr_cancel_op(scsi_cmd);
>> spin_unlock_irqrestore(scsi_cmd->device->host->host_lock, flags);
>>
>> + if (rc == SUCCESS)
>> + rc = ipr_wait_for_ops(ioa_cfg, scsi_cmd->device, ipr_match_lun);
>> LEAVE;
>> return rc;
>> }
>> diff -puN drivers/scsi/ipr.h~ipr_eh_wait drivers/scsi/ipr.h
>> --- scsi-queue/drivers/scsi/ipr.h~ipr_eh_wait 2014-10-30
>> 17:15:37.305753093 -0500
>> +++ scsi-queue-bjking1/drivers/scsi/ipr.h 2014-10-30
>> 17:15:37.315753003 -0500
>> @@ -1608,6 +1608,7 @@ struct ipr_cmnd {
>> struct scsi_device *sdev;
>> } u;
>>
>> + struct completion *eh_comp;
>> struct ipr_hrr_queue *hrrq;
>> struct ipr_ioa_cfg *ioa_cfg;
>> };
>> _
>>
>
>
> --
> Brian King
> Power Linux I/O
> IBM Linux Technology Center
^ permalink raw reply
* Re: [PATCH 3/3] ipr: Wait for aborted command responses
From: Brian King @ 2014-10-31 13:45 UTC (permalink / raw)
To: James.Bottomley; +Cc: hch, Wendy Xiong, linuxppc-dev, stable, linux-scsi
In-Reply-To: <201410302227.s9UMRAix027807@d01av02.pok.ibm.com>
Adding Wendy...
On 10/30/2014 05:27 PM, Brian King wrote:
> Fixes a race condition in abort handling that was injected
> when multiple interrupt support was added. When only a single
> interrupt is present, the adapter guarantees it will send
> responses for aborted commands prior to the response for the
> abort command itself. With multiple interrupts, these responses
> generally come back on different interrupts, so we need to
> ensure the abort thread waits until the aborted command is
> complete so we don't perform a double completion. This race
> condition was being hit frequently in environments which
> were triggering command timeouts, which was resulting in
> a double completion causing a kernel oops.
>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
> ---
>
> drivers/scsi/ipr.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> drivers/scsi/ipr.h | 1
> 2 files changed, 93 insertions(+)
>
> diff -puN drivers/scsi/ipr.c~ipr_eh_wait drivers/scsi/ipr.c
> --- scsi-queue/drivers/scsi/ipr.c~ipr_eh_wait 2014-10-30 17:15:37.302753120 -0500
> +++ scsi-queue-bjking1/drivers/scsi/ipr.c 2014-10-30 17:15:37.311753039 -0500
> @@ -683,6 +683,7 @@ static void ipr_init_ipr_cmnd(struct ipr
> ipr_reinit_ipr_cmnd(ipr_cmd);
> ipr_cmd->u.scratch = 0;
> ipr_cmd->sibling = NULL;
> + ipr_cmd->eh_comp = NULL;
> ipr_cmd->fast_done = fast_done;
> init_timer(&ipr_cmd->timer);
> }
> @@ -848,6 +849,8 @@ static void ipr_scsi_eh_done(struct ipr_
>
> scsi_dma_unmap(ipr_cmd->scsi_cmd);
> scsi_cmd->scsi_done(scsi_cmd);
> + if (ipr_cmd->eh_comp)
> + complete(ipr_cmd->eh_comp);
> list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
> }
>
> @@ -4854,6 +4857,84 @@ static int ipr_slave_alloc(struct scsi_d
> return rc;
> }
>
> +/**
> + * ipr_match_lun - Match function for specified LUN
> + * @ipr_cmd: ipr command struct
> + * @device: device to match (sdev)
> + *
> + * Returns:
> + * 1 if command matches sdev / 0 if command does not match sdev
> + **/
> +static int ipr_match_lun(struct ipr_cmnd *ipr_cmd, void *device)
> +{
> + if (ipr_cmd->scsi_cmd && ipr_cmd->scsi_cmd->device == device)
> + return 1;
> + return 0;
> +}
> +
> +/**
> + * ipr_wait_for_ops - Wait for matching commands to complete
> + * @ipr_cmd: ipr command struct
> + * @device: device to match (sdev)
> + * @match: match function to use
> + *
> + * Returns:
> + * SUCCESS / FAILED
> + **/
> +static int ipr_wait_for_ops(struct ipr_ioa_cfg *ioa_cfg, void *device,
> + int (*match)(struct ipr_cmnd *, void *))
> +{
> + struct ipr_cmnd *ipr_cmd;
> + int wait;
> + unsigned long flags;
> + struct ipr_hrr_queue *hrrq;
> + signed long timeout = IPR_ABORT_TASK_TIMEOUT;
> + DECLARE_COMPLETION_ONSTACK(comp);
> +
> + ENTER;
> + do {
> + wait = 0;
> +
> + for_each_hrrq(hrrq, ioa_cfg) {
> + spin_lock_irqsave(hrrq->lock, flags);
> + list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
> + if (match(ipr_cmd, device)) {
> + ipr_cmd->eh_comp = ∁
> + wait++;
> + }
> + }
> + spin_unlock_irqrestore(hrrq->lock, flags);
> + }
> +
> + if (wait) {
> + timeout = wait_for_completion_timeout(&comp, timeout);
> +
> + if (!timeout) {
> + wait = 0;
> +
> + for_each_hrrq(hrrq, ioa_cfg) {
> + spin_lock_irqsave(hrrq->lock, flags);
> + list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
> + if (match(ipr_cmd, device)) {
> + ipr_cmd->eh_comp = NULL;
> + wait++;
> + }
> + }
> + spin_unlock_irqrestore(hrrq->lock, flags);
> + }
> +
> + if (wait)
> + dev_err(&ioa_cfg->pdev->dev, "Timed out waiting for aborted commands\n");
> + LEAVE;
> + return wait ? FAILED : SUCCESS;
> + }
> + }
> + } while (wait);
> +
> + LEAVE;
> + return SUCCESS;
> +}
> +
> static int ipr_eh_host_reset(struct scsi_cmnd *cmd)
> {
> struct ipr_ioa_cfg *ioa_cfg;
> @@ -5073,11 +5154,17 @@ static int __ipr_eh_dev_reset(struct scs
> static int ipr_eh_dev_reset(struct scsi_cmnd *cmd)
> {
> int rc;
> + struct ipr_ioa_cfg *ioa_cfg;
> +
> + ioa_cfg = (struct ipr_ioa_cfg *) cmd->device->host->hostdata;
>
> spin_lock_irq(cmd->device->host->host_lock);
> rc = __ipr_eh_dev_reset(cmd);
> spin_unlock_irq(cmd->device->host->host_lock);
>
> + if (rc == SUCCESS)
> + rc = ipr_wait_for_ops(ioa_cfg, cmd->device, ipr_match_lun);
> +
> return rc;
> }
>
> @@ -5255,13 +5342,18 @@ static int ipr_eh_abort(struct scsi_cmnd
> {
> unsigned long flags;
> int rc;
> + struct ipr_ioa_cfg *ioa_cfg;
>
> ENTER;
>
> + ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
> +
> spin_lock_irqsave(scsi_cmd->device->host->host_lock, flags);
> rc = ipr_cancel_op(scsi_cmd);
> spin_unlock_irqrestore(scsi_cmd->device->host->host_lock, flags);
>
> + if (rc == SUCCESS)
> + rc = ipr_wait_for_ops(ioa_cfg, scsi_cmd->device, ipr_match_lun);
> LEAVE;
> return rc;
> }
> diff -puN drivers/scsi/ipr.h~ipr_eh_wait drivers/scsi/ipr.h
> --- scsi-queue/drivers/scsi/ipr.h~ipr_eh_wait 2014-10-30 17:15:37.305753093 -0500
> +++ scsi-queue-bjking1/drivers/scsi/ipr.h 2014-10-30 17:15:37.315753003 -0500
> @@ -1608,6 +1608,7 @@ struct ipr_cmnd {
> struct scsi_device *sdev;
> } u;
>
> + struct completion *eh_comp;
> struct ipr_hrr_queue *hrrq;
> struct ipr_ioa_cfg *ioa_cfg;
> };
> _
>
--
Brian King
Power Linux I/O
IBM Linux Technology Center
^ permalink raw reply
* Re: FSL MSI Mapping
From: Sebastian Andrzej Siewior @ 2014-10-31 11:28 UTC (permalink / raw)
To: Johannes Thumshirn, Michael Ellerman
Cc: linuxppc-dev, 'David Engster'
In-Reply-To: <20141031081225.GA20831@jtlinux>
On 10/31/2014 09:12 AM, Johannes Thumshirn wrote:
> On Thu, Oct 30, 2014 at 02:51:57PM +1100, Michael Ellerman wrote:
>> Why would you not use MSI-X ?
If I'm not mistaken, a PCI-E requirement is to support MSI but MSI-X is
optional. And with MSI you can have multiple interrupts per single
device (power of two, max 32).
Now imagine you have a FPGA with two (or more) different devices in it
and you don't want them to share the IRQ line (for $reason). I bet the
HW developer sees MSI and MSI-X and the former is for some reason
cheaper compared to MSI-X and it fits the needs. So…
>
> Does anyone (especially the original author) have any objections if I re-spin
> the patch series?
I didn't get around to address the review comments so it did not went
in and there was no v2. Feel free re-do the series.
Sebastian
^ permalink raw reply
* Re: [PATCH] hwrng: pseries - port to new read API and fix stack corruption
From: Herbert Xu @ 2014-10-31 9:36 UTC (permalink / raw)
To: Greg Kurz; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20141031103141.7b91c647@bahia.local>
On Fri, Oct 31, 2014 at 10:31:41AM +0100, Greg Kurz wrote:
>
> > > Cc'ing stable as I could reproduce back to 3.15.10
> >
> > The right way to CC stable for a patch that isn't yet in upstream is to add:
> >
> > CC: stable@vger.kernel.org
> >
> > Before your Signed-off-by. They will then pick it up once it's merged into
> > Linus' tree. See Documentation/stable_kernel_rules.txt
> >
> > cheers
> >
>
> Oops... should I repost then ?
Don't worry, I can fix this up.
Cheers,
--
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH] hwrng: pseries - port to new read API and fix stack corruption
From: Greg Kurz @ 2014-10-31 9:31 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, linux-kernel, Herbert Xu
In-Reply-To: <1414738812.21815.5.camel@concordia>
On Fri, 31 Oct 2014 18:00:12 +1100
Michael Ellerman <mpe@ellerman.id.au> wrote:
> On Fri, 2014-10-31 at 07:50 +0100, Greg Kurz wrote:
> > The add_early_randomness() function in drivers/char/hw_random/core.c passes
> > a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall()
> > returns four 64-bit values and trashes 16 bytes on the stack.
>
> Hmm, thanks. I thought I'd fixed that, but I guess I never sent the patch :}
>
Heh so many patches ! :)
> > This bug has been lying around for a long time. It got unveiled by:
> >
> > commit d3cc7996473a7bdd33256029988ea690754e4e2a
> > Author: Amit Shah <amit.shah@redhat.com>
> > Date: Thu Jul 10 15:42:34 2014 +0530
> >
> > hwrng: fetch randomness only after device init
> >
> > It may trig a oops while loading or unloading the pseries-rng module for both
> > PowerVM and PowerKVM guests.
> >
> > This patch does two things:
> > - pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe
> > since we're not on a hot path.
>
> Well probably, can you do a before and after test of dd if=/dev/hwrng ?
>
I had to do this to be able to run the before test:
@@ -78,7 +78,7 @@ static size_t rng_buffer_size(void)
static void add_early_randomness(struct hwrng *rng)
{
- unsigned char bytes[16];
+ unsigned char bytes[32];
I ran tests for 128 MB and 1G several times in a PowerKVM guest on a POWER8 box.
Before:
[root@fedora20-ppc64 ~]# time dd if=/dev/hwrng of=/dev/null bs=1024 count=131072
131072+0 records in
131072+0 records out
134217728 bytes (134 MB) copied, 17.0503 s, 7.9 MB/s
real 0m17.051s
user 0m0.024s
sys 0m16.797s
[root@fedora20-ppc64 ~]# time dd if=/dev/hwrng of=/dev/null bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 136.374 s, 7.9 MB/s
real 2m16.376s
user 0m0.189s
sys 2m14.367s
After:
[root@fedora20-ppc64 ~]# time dd if=/dev/hwrng of=/dev/null bs=1024 count=131072
131072+0 records in
131072+0 records out
134217728 bytes (134 MB) copied, 17.0502 s, 7.9 MB/s
real 0m17.051s
user 0m0.024s
sys 0m16.797s
[root@fedora20-ppc64 ~]# time dd if=/dev/hwrng of=/dev/null bs=1024 count=1048576
1048576+0 records in
1048576+0 records out
1073741824 bytes (1.1 GB) copied, 136.432 s, 7.9 MB/s
real 2m16.433s
user 0m0.188s
sys 2m14.370s
It shows no degradation of performance.
> > Cc'ing stable as I could reproduce back to 3.15.10
>
> The right way to CC stable for a patch that isn't yet in upstream is to add:
>
> CC: stable@vger.kernel.org
>
> Before your Signed-off-by. They will then pick it up once it's merged into
> Linus' tree. See Documentation/stable_kernel_rules.txt
>
> cheers
>
Oops... should I repost then ?
Thanks.
--
Greg
^ permalink raw reply
* Re: FSL MSI Mapping
From: Johannes Thumshirn @ 2014-10-31 8:12 UTC (permalink / raw)
To: Michael Ellerman, Sebastian Andrzej Siewior
Cc: Johannes Thumshirn, linuxppc-dev, 'David Engster'
In-Reply-To: <1414641117.12600.4.camel@concordia>
On Thu, Oct 30, 2014 at 02:51:57PM +1100, Michael Ellerman wrote:
> On Tue, 2014-10-28 at 18:06 +0100, Johannes Thumshirn wrote:
> > Hi,
> >
> > I got notified about your patch to support multiple MSI Vectors on Freescale
> > PowerPC platforms. Is there any reason why it wasn't applied until now? I
> > couldn't find anything about it in the list archives.
> >
> > I think it would be a real benefit for all to have multiple MSI vecotrs on
> > PowerPCs.
>
> Why would you not use MSI-X ?
>
> cheers
>
>
Does anyone (especially the original author) have any objections if I re-spin
the patch series?
^ permalink raw reply
* RE: [PATCH v3 1/3] QE: move qe code from arch/powerpc to drivers/soc
From: qiang.zhao @ 2014-10-31 7:24 UTC (permalink / raw)
To: Kumar Gala
Cc: Scott Wood, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, Xiaobo Xie
In-Reply-To: <845EBC7E-52A3-48D6-826D-886FC18B0B88@kernel.crashing.org>
On Oct 30, 2014, at 9:37 AM, Kumar Gala wrote:
> -----Original Message-----
> From: Kumar Gala [mailto:galak@kernel.crashing.org]
> Sent: Thursday, October 30, 2014 9:37 PM
> To: Zhao Qiang-B45475
> Cc: linuxppc-dev@lists.ozlabs.org; linux-kernel@vger.kernel.org; Wood
> Scott-B07421; Xie Xiaobo-R63061
> Subject: Re: [PATCH v3 1/3] QE: move qe code from arch/powerpc to
> drivers/soc
>=20
>=20
> On Oct 30, 2014, at 2:31 AM, Zhao Qiang <B45475@freescale.com> wrote:
>=20
> > LS1 is arm cpu and it has qe ip block.
> > move qe code from platform directory to public directory.
> >
> > QE is an IP block integrates several comunications peripheral
> > controllers. It can implement a variety of applications, such as uart,
> > usb and tdm and so on.
> >
> > Signed-off-by: Zhao Qiang <B45475@freescale.com>
> > ---
> > Changes for v2:
> > - move code to driver/soc
> > Changes for v3:
> > - change drivers/soc/qe to drivers/soc/fsl-qe
> >
> > arch/powerpc/Kconfig | 2 -
> > arch/powerpc/platforms/83xx/km83xx.c | 4 +-
> > arch/powerpc/platforms/83xx/misc.c | 2 +-
> > arch/powerpc/platforms/83xx/mpc832x_mds.c | 4 +-
> > arch/powerpc/platforms/83xx/mpc832x_rdb.c | 4 +-
> > arch/powerpc/platforms/83xx/mpc836x_mds.c | 4 +-
> > arch/powerpc/platforms/83xx/mpc836x_rdk.c | 4 +-
> > arch/powerpc/platforms/85xx/common.c | 2 +-
> > arch/powerpc/platforms/85xx/corenet_generic.c | 2 +-
> > arch/powerpc/platforms/85xx/mpc85xx_mds.c | 4 +-
> > arch/powerpc/platforms/85xx/mpc85xx_rdb.c | 4 +-
> > arch/powerpc/platforms/85xx/twr_p102x.c | 4 +-
> > arch/powerpc/platforms/Kconfig | 19 ---------
> > arch/powerpc/sysdev/Makefile | 1 -
> > arch/powerpc/sysdev/qe_lib/Kconfig | 27 -------------
> > drivers/net/ethernet/freescale/fsl_pq_mdio.c | 2 +-
> > drivers/net/ethernet/freescale/ucc_geth.c | 8 ++--
> > drivers/net/ethernet/freescale/ucc_geth.h | 8 ++--
> > drivers/soc/Kconfig | 2 +
> > drivers/soc/Makefile | 1 +
> > drivers/soc/fsl-qe/Kconfig | 45
> ++++++++++++++++++++++
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/Makefile | 0
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/gpio.c | 2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe.c | 4 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.c | 2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.h | 2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_io.c | 2 +-
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc.c | 6 +--
> > .../qe_lib =3D> drivers/soc/fsl-qe}/ucc_fast.c | 8 ++--
> > .../qe_lib =3D> drivers/soc/fsl-qe}/ucc_slow.c | 8 ++--
> > .../sysdev/qe_lib =3D> drivers/soc/fsl-qe}/usb.c | 4 +-
> > drivers/spi/spi-fsl-cpm.c | 2 +-
> > drivers/tty/serial/ucc_uart.c | 2 +-
> > drivers/usb/gadget/fsl_qe_udc.c | 2 +-
> > drivers/usb/host/fhci-hcd.c | 2 +-
> > drivers/usb/host/fhci-hub.c | 2 +-
> > drivers/usb/host/fhci-sched.c | 2 +-
> > drivers/usb/host/fhci.h | 4 +-
> > .../include/asm =3D> include/linux/fsl}/immap_qe.h | 0
> > .../powerpc/include/asm =3D> include/linux/fsl}/qe.h | 2 +-
> > .../include/asm =3D> include/linux/fsl}/qe_ic.h | 0
> > .../include/asm =3D> include/linux/fsl}/ucc.h | 4 +-
> > .../include/asm =3D> include/linux/fsl}/ucc_fast.h | 6 +--
> > .../include/asm =3D> include/linux/fsl}/ucc_slow.h | 6 +--
> > 44 files changed, 112 insertions(+), 113 deletions(-) delete mode
> > 100644 arch/powerpc/sysdev/qe_lib/Kconfig
> > create mode 100644 drivers/soc/fsl-qe/Kconfig rename
> > {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/Makefile (100%)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/gpio.c (99%=
)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe.c (99%)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/qe_ic.c
> > (99%) rename {arch/powerpc/sysdev/qe_lib =3D>
> > drivers/soc/fsl-qe}/qe_ic.h (98%) rename {arch/powerpc/sysdev/qe_lib
> > =3D> drivers/soc/fsl-qe}/qe_io.c (99%) rename
> > {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc.c (98%) rename
> > {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc_fast.c (98%)
> > rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/ucc_slow.c
> > (98%) rename {arch/powerpc/sysdev/qe_lib =3D> drivers/soc/fsl-qe}/usb.c
> > (96%) rename {arch/powerpc/include/asm =3D>
> > include/linux/fsl}/immap_qe.h (100%) rename {arch/powerpc/include/asm
> > =3D> include/linux/fsl}/qe.h (99%) rename {arch/powerpc/include/asm =3D=
>
> > include/linux/fsl}/qe_ic.h (100%) rename {arch/powerpc/include/asm =3D>
> > include/linux/fsl}/ucc.h (96%) rename {arch/powerpc/include/asm =3D>
> > include/linux/fsl}/ucc_fast.h (98%) rename {arch/powerpc/include/asm
> > =3D> include/linux/fsl}/ucc_slow.h (99%)
>=20
>=20
> So you should be moving things to drivers/soc/fsl/qe/ not
> drivers/soc/fsl-qe/
>=20
> The headers should be in include/soc/fsl, not include/linux/fsl
I don't understand why I need to put headers in include/soc/fsl,
Can you explain more?
>=20
> In addition before this move is accepted, other changes need to be made
> to convert to using standard frameworks for various functionality in QE
> lib.
>=20
> 1. gpio.c -> needs to be converted to GPIO framework and placed in
> drivers/gpio 2. qe_ic* should probably move into drivers/irqchip 3.
> qe_io.c should be converted over to pinmux and put in drivers/pinctrl 4.
> Some of the clock could should be looked to be converted to use the clk
> framework
>=20
> These changes need to be addressed before any of the qe_lib code can get
> moved into drivers/soc
>=20
> - k
Best Regards
Zhao Qiang
^ permalink raw reply
* Re: [PATCH] hwrng: pseries - port to new read API and fix stack corruption
From: Michael Ellerman @ 2014-10-31 7:00 UTC (permalink / raw)
To: Greg Kurz; +Cc: linuxppc-dev, linux-kernel, stable, Herbert Xu
In-Reply-To: <20141031063233.1884.86309.stgit@bahia.local>
On Fri, 2014-10-31 at 07:50 +0100, Greg Kurz wrote:
> The add_early_randomness() function in drivers/char/hw_random/core.c passes
> a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall()
> returns four 64-bit values and trashes 16 bytes on the stack.
Hmm, thanks. I thought I'd fixed that, but I guess I never sent the patch :}
> This bug has been lying around for a long time. It got unveiled by:
>
> commit d3cc7996473a7bdd33256029988ea690754e4e2a
> Author: Amit Shah <amit.shah@redhat.com>
> Date: Thu Jul 10 15:42:34 2014 +0530
>
> hwrng: fetch randomness only after device init
>
> It may trig a oops while loading or unloading the pseries-rng module for both
> PowerVM and PowerKVM guests.
>
> This patch does two things:
> - pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe
> since we're not on a hot path.
Well probably, can you do a before and after test of dd if=/dev/hwrng ?
> Cc'ing stable as I could reproduce back to 3.15.10
The right way to CC stable for a patch that isn't yet in upstream is to add:
CC: stable@vger.kernel.org
Before your Signed-off-by. They will then pick it up once it's merged into
Linus' tree. See Documentation/stable_kernel_rules.txt
cheers
^ permalink raw reply
* [PATCH] hwrng: pseries - port to new read API and fix stack corruption
From: Greg Kurz @ 2014-10-31 6:50 UTC (permalink / raw)
To: linux-kernel; +Cc: linuxppc-dev, Herbert Xu, stable
The add_early_randomness() function in drivers/char/hw_random/core.c passes
a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall()
returns four 64-bit values and trashes 16 bytes on the stack.
This bug has been lying around for a long time. It got unveiled by:
commit d3cc7996473a7bdd33256029988ea690754e4e2a
Author: Amit Shah <amit.shah@redhat.com>
Date: Thu Jul 10 15:42:34 2014 +0530
hwrng: fetch randomness only after device init
It may trig a oops while loading or unloading the pseries-rng module for both
PowerVM and PowerKVM guests.
This patch does two things:
- pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe
since we're not on a hot path.
- move to the new read API so that we know the return buffer size for sure.
Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com>
---
Cc'ing stable as I could reproduce back to 3.15.10
drivers/char/hw_random/pseries-rng.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/char/hw_random/pseries-rng.c b/drivers/char/hw_random/pseries-rng.c
index 6226aa0..bcf86f9 100644
--- a/drivers/char/hw_random/pseries-rng.c
+++ b/drivers/char/hw_random/pseries-rng.c
@@ -25,18 +25,21 @@
#include <asm/vio.h>
-static int pseries_rng_data_read(struct hwrng *rng, u32 *data)
+static int pseries_rng_read(struct hwrng *rng, void *data, size_t max, bool wait)
{
+ u64 buffer[PLPAR_HCALL_BUFSIZE];
+ size_t size = max < 8 ? max : 8;
int rc;
- rc = plpar_hcall(H_RANDOM, (unsigned long *)data);
+ rc = plpar_hcall(H_RANDOM, (unsigned long *)buffer);
if (rc != H_SUCCESS) {
pr_err_ratelimited("H_RANDOM call failed %d\n", rc);
return -EIO;
}
+ memcpy(data, buffer, size);
/* The hypervisor interface returns 64 bits */
- return 8;
+ return size;
}
/**
@@ -55,7 +58,7 @@ static unsigned long pseries_rng_get_desired_dma(struct vio_dev *vdev)
static struct hwrng pseries_rng = {
.name = KBUILD_MODNAME,
- .data_read = pseries_rng_data_read,
+ .read = pseries_rng_read,
};
static int __init pseries_rng_probe(struct vio_dev *dev,
^ permalink raw reply related
* Re: [PATCH] powerpc/pseries: Quieten ibm,pcie-link-speed-stats warning
From: Benjamin Herrenschmidt @ 2014-10-31 6:27 UTC (permalink / raw)
To: Anton Blanchard; +Cc: paulus, linuxppc-dev
In-Reply-To: <1414731901-2096-1-git-send-email-anton@samba.org>
On Fri, 2014-10-31 at 16:05 +1100, Anton Blanchard wrote:
> The ibm,pcie-link-speed-stats isn't mandatory, so we shouldn't print
> a high priority error message when missing. One example where we see
> this is QEMU.
>
> Reduce it to pr_info.
I would reduce it even further to pr_dbg.
Cheers,
Ben.
> Signed-off-by: Anton Blanchard <anton@samba.org>
> ---
> arch/powerpc/platforms/pseries/pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
> index 67e4859..57dd7a0 100644
> --- a/arch/powerpc/platforms/pseries/pci.c
> +++ b/arch/powerpc/platforms/pseries/pci.c
> @@ -134,7 +134,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
> of_node_put(pdn);
>
> if (rc) {
> - pr_err("no ibm,pcie-link-speed-stats property\n");
> + pr_info("no ibm,pcie-link-speed-stats property\n");
> return 0;
> }
>
^ permalink raw reply
* Re: [PATCH v2] PPC: bpf_jit_comp: add SKF_AD_PKTTYPE instruction
From: Denis Kirjanov @ 2014-10-31 6:09 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: netdev@vger.kernel.org, Denis Kirjanov, Matt Evans, linuxppc-dev
In-Reply-To: <CAADnVQKvfay7zC-kNGXz7uAjVrhqL80xQ=zvmAsSz4pNhD=9NQ@mail.gmail.com>
On 10/30/14, Alexei Starovoitov <alexei.starovoitov@gmail.com> wrote:
> On Wed, Oct 29, 2014 at 11:12 PM, Denis Kirjanov <kda@linux-powerpc.org>
> wrote:
>> Add BPF extension SKF_AD_PKTTYPE to ppc JIT to load
>> skb->pkt_type field.
>>
>> Before:
>> [ 88.262622] test_bpf: #11 LD_IND_NET 86 97 99 PASS
>> [ 88.265740] test_bpf: #12 LD_PKTTYPE 109 107 PASS
>>
>> After:
>> [ 80.605964] test_bpf: #11 LD_IND_NET 44 40 39 PASS
>> [ 80.607370] test_bpf: #12 LD_PKTTYPE 9 9 PASS
>
> if you'd only quoted #12, it would all make sense ;)
> but #11 test is not using PKTTYPE. So your patch shouldn't
> make a difference. Are these numbers with JIT on and off?
Right.
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Regards,
Denis
^ permalink raw reply
* [PATCH] powerpc: do_notify_resume can be called with bad thread_info flags argument
From: Anton Blanchard @ 2014-10-31 5:50 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
Back in 7230c5644188 ("powerpc: Rework lazy-interrupt handling") we
added a call out to restore_interrupts() (written in c) before calling
do_notify_resume:
bl restore_interrupts
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_notify_resume
Unfortunately do_notify_resume takes two arguments, the second one
being the thread_info flags:
void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
We do populate r4 (the second argument) earlier, but
restore_interrupts() is free to muck it up all it wants. My guess is
the gcc compiler gods shone down on us and its register allocator
never used r4. Sometimes, rarely, luck is on our side.
LLVM on the other hand did trample r4.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@vger.kernel.org
---
arch/powerpc/kernel/entry_64.S | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 9caab69..194e46d 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -659,7 +659,13 @@ _GLOBAL(ret_from_except_lite)
3:
#endif
bl save_nvgprs
+ /*
+ * Use a non volatile GPR to save and restore our thread_info flags
+ * across the call to restore_interrupts.
+ */
+ mr r30,r4
bl restore_interrupts
+ mr r4,r30
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_notify_resume
b ret_from_except
--
1.9.1
^ permalink raw reply related
* [PATCH] powerpc/pseries: Quieten ibm,pcie-link-speed-stats warning
From: Anton Blanchard @ 2014-10-31 5:05 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
The ibm,pcie-link-speed-stats isn't mandatory, so we shouldn't print
a high priority error message when missing. One example where we see
this is QEMU.
Reduce it to pr_info.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/platforms/pseries/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/pseries/pci.c b/arch/powerpc/platforms/pseries/pci.c
index 67e4859..57dd7a0 100644
--- a/arch/powerpc/platforms/pseries/pci.c
+++ b/arch/powerpc/platforms/pseries/pci.c
@@ -134,7 +134,7 @@ int pseries_root_bridge_prepare(struct pci_host_bridge *bridge)
of_node_put(pdn);
if (rc) {
- pr_err("no ibm,pcie-link-speed-stats property\n");
+ pr_info("no ibm,pcie-link-speed-stats property\n");
return 0;
}
--
1.9.1
^ permalink raw reply related
* [PATCH 3/3] powerpc: LLVM complains about forward declaration of struct rtas_sensors
From: Anton Blanchard @ 2014-10-31 3:47 UTC (permalink / raw)
To: benh, paulus, mpe, ulrich.weigand; +Cc: linuxppc-dev
In-Reply-To: <1414727247-31838-1-git-send-email-anton@samba.org>
Move the declaration up to silence the warning.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/rtas-proc.c | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
index 8777fb0..fb2fb3e 100644
--- a/arch/powerpc/kernel/rtas-proc.c
+++ b/arch/powerpc/kernel/rtas-proc.c
@@ -113,17 +113,6 @@
#define SENSOR_PREFIX "ibm,sensor-"
#define cel_to_fahr(x) ((x*9/5)+32)
-
-/* Globals */
-static struct rtas_sensors sensors;
-static struct device_node *rtas_node = NULL;
-static unsigned long power_on_time = 0; /* Save the time the user set */
-static char progress_led[MAX_LINELENGTH];
-
-static unsigned long rtas_tone_frequency = 1000;
-static unsigned long rtas_tone_volume = 0;
-
-/* ****************STRUCTS******************************************* */
struct individual_sensor {
unsigned int token;
unsigned int quant;
@@ -134,6 +123,15 @@ struct rtas_sensors {
unsigned int quant;
};
+/* Globals */
+static struct rtas_sensors sensors;
+static struct device_node *rtas_node = NULL;
+static unsigned long power_on_time = 0; /* Save the time the user set */
+static char progress_led[MAX_LINELENGTH];
+
+static unsigned long rtas_tone_frequency = 1000;
+static unsigned long rtas_tone_volume = 0;
+
/* ****************************************************************** */
/* Declarations */
static int ppc_rtas_sensors_show(struct seq_file *m, void *v);
--
1.9.1
^ permalink raw reply related
* [PATCH 2/3] powerpc: Remove double braces in alignment code.
From: Anton Blanchard @ 2014-10-31 3:47 UTC (permalink / raw)
To: benh, paulus, mpe, ulrich.weigand; +Cc: linuxppc-dev
In-Reply-To: <1414727247-31838-1-git-send-email-anton@samba.org>
Looks like I introduced this when adding LE support.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/kernel/align.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/align.c b/arch/powerpc/kernel/align.c
index 34f5552..86150fb 100644
--- a/arch/powerpc/kernel/align.c
+++ b/arch/powerpc/kernel/align.c
@@ -908,7 +908,7 @@ int fix_alignment(struct pt_regs *regs)
flush_fp_to_thread(current);
}
- if ((nb == 16)) {
+ if (nb == 16) {
if (flags & F) {
/* Special case for 16-byte FP loads and stores */
PPC_WARN_ALIGNMENT(fp_pair, regs);
--
1.9.1
^ permalink raw reply related
* [PATCH 1/3] powerpc: Don't use local named register variable in current_thread_info
From: Anton Blanchard @ 2014-10-31 3:47 UTC (permalink / raw)
To: benh, paulus, mpe, ulrich.weigand; +Cc: linuxppc-dev
LLVM doesn't support local named register variables and is unlikely
to. current_thread_info is using one, fix it by moving it out and
calling it __current_r1().
I gave it a bit of an obscure name because we don't want anyone else
using it - they should use current_stack_pointer(). This specific
case is performance critical and we can't afford to call a function
to get it. Furthermore it isn't important to know exactly where in
the stack we are since we mask the lower bits.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
arch/powerpc/include/asm/thread_info.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index b034ecd..ebc4f16 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -71,13 +71,12 @@ struct thread_info {
#define THREAD_SIZE_ORDER (THREAD_SHIFT - PAGE_SHIFT)
/* how to get the thread information struct from C */
+register unsigned long __current_r1 asm("r1");
static inline struct thread_info *current_thread_info(void)
{
- register unsigned long sp asm("r1");
-
/* gcc4, at least, is smart enough to turn this into a single
* rlwinm for ppc32 and clrrdi for ppc64 */
- return (struct thread_info *)(sp & ~(THREAD_SIZE-1));
+ return (struct thread_info *)(__current_r1 & ~(THREAD_SIZE-1));
}
#endif /* __ASSEMBLY__ */
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/5] powerpc: Remove bootmem allocator
From: Emil Medve @ 2014-10-31 3:35 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, paulus, Anton Blanchard
In-Reply-To: <1414721739.21815.4.camel@concordia>
Hello Michael,
On 10/30/2014 09:15 PM, Michael Ellerman wrote:
> On Thu, 2014-10-30 at 01:00 -0500, Emil Medve wrote:
>> On 09/17/2014 07:15 AM, Anton Blanchard wrote:
>>> At the moment we transition from the memblock alloctor to the bootmem
>>> allocator. Gitting rid of the bootmem allocator removes a bunch of
>>> complicated code (most of which I owe the dubious honour of being
>>> responsible for writing).
>>
>> Any idea on how to move these patches forward?
>
> It's in my test branch and will go into next on Monday.
Thank you
Cheers,
^ permalink raw reply
* [PATCH] powerpc: do_notify_resume can be called with bad thread_info flags argument
From: Anton Blanchard @ 2014-10-31 3:23 UTC (permalink / raw)
To: benh, paulus, mpe; +Cc: linuxppc-dev
Back in 7230c5644188 ("powerpc: Rework lazy-interrupt handling") we
added a call out to restore_interrupts() (written in c) before calling
do_notify_resume:
bl restore_interrupts
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_notify_resume
Unfortunately do_notify_resume takes two arguments, the second one
being the thread_info flags:
void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
We do populate r4 (the second argument) earlier, but
restore_interrupts() is free to muck it up all it wants. My guess is
the gcc compiler gods shone down on us and its register allocator
never used r4. Sometimes, rarely, luck is on our side.
LLVM on the other hand did trample r4.
To avoid having to reload the flags, pass it through
restore_interrupts, suggested by benh.
Signed-off-by: Anton Blanchard <anton@samba.org>
Cc: stable@vger.kernel.org
---
arch/powerpc/kernel/entry_64.S | 6 ++++++
arch/powerpc/kernel/irq.c | 8 +++++++-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index 9caab69..086c566 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -659,7 +659,13 @@ _GLOBAL(ret_from_except_lite)
3:
#endif
bl save_nvgprs
+ /*
+ * restore_interrupts takes an argument and returns it unmodified
+ * so we can get the thread_info flags into do_notify_resume.
+ */
+ mr r3,r4
bl restore_interrupts
+ mr r4,r3
addi r3,r1,STACK_FRAME_OVERHEAD
bl do_notify_resume
b ret_from_except
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 6dbae00..44b0530 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -283,16 +283,22 @@ EXPORT_SYMBOL(arch_local_irq_restore);
* schedule() or do_signal() when returning to userspace. We do it
* in C to avoid the burden of dealing with lockdep etc...
*
+ * We are passed the current thread_info flags which we return. This
+ * is useful in the exception exit code where we already have loaded
+ * the flags and need to use them again after calling restore_interrupts.
+ *
* NOTE: This is called with interrupts hard disabled but not marked
* as such in paca->irq_happened, so we need to resync this.
*/
-void notrace restore_interrupts(void)
+unsigned long notrace restore_interrupts(unsigned long thread_info_flags)
{
if (irqs_disabled()) {
local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
local_irq_enable();
} else
__hard_irq_enable();
+
+ return thread_info_flags;
}
/*
--
1.9.1
^ permalink raw reply related
* Re: [PATCH 1/5] powerpc: Remove bootmem allocator
From: Michael Ellerman @ 2014-10-31 2:15 UTC (permalink / raw)
To: Emil Medve; +Cc: linuxppc-dev, paulus, Anton Blanchard
In-Reply-To: <5451D416.7030300@Freescale.com>
On Thu, 2014-10-30 at 01:00 -0500, Emil Medve wrote:
> On 09/17/2014 07:15 AM, Anton Blanchard wrote:
> > At the moment we transition from the memblock alloctor to the bootmem
> > allocator. Gitting rid of the bootmem allocator removes a bunch of
> > complicated code (most of which I owe the dubious honour of being
> > responsible for writing).
>
> Any idea on how to move these patches forward?
It's in my test branch and will go into next on Monday.
cheers
^ permalink raw reply
* Re: [PATCH 1/3] powerpc/dts: Factorize the clock control node
From: Scott Wood @ 2014-10-30 23:21 UTC (permalink / raw)
To: Emil Medve; +Cc: yuantian.tang, linuxppc-dev, devicetree
In-Reply-To: <54524405.5090509@Freescale.com>
On Thu, 2014-10-30 at 08:58 -0500, Emil Medve wrote:
> Hello Scott,
>
>
> On 10/28/2014 06:21 PM, Scott Wood wrote:
> > On Wed, 2014-10-22 at 09:42 -0500, Emil Medve wrote:
> >> Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
> >> Change-Id: I25ce24a25862b4ca460164159867abefe00ccdd1
> >
> > Please remove gerrit stuff prior to submitting.
>
> I did remove the bulk of it. I wanted to keep the Change-Id so I can
> easily correlate the upstream patches with the sordid internal history.
> Seems the upstream history has enough instances of 'Change-Id' for this
> not to be an issue
OK...
> > I don't think the mux stuff belongs here, given that clockgen2.dtsi
> > doesn't have it, and I saw at least one clockgen1 user needing to
> > supplement this with more muxes.
>
> The intent was to put here devices/nodes that are common per chassis
> from the low to high end. Specific SoC would change/augment this as
> appropriate. I could have put each node in its own file as we've done
> elsewhere, but I thought it would be too much
>
> Yes, chassis v1 and v2 have differences, but that's not unexpected
It just strikes me as being an awkward split of where each mux node
goes. Is it guaranteed by the chassis that all v1 will have at least
the first two muxes?
> >> @@ -1068,7 +1043,6 @@
> >> clocks = <&sysclk>;
> >> clock-output-names = "pll2", "pll2-div2", "pll2-div4";
> >> };
> >> -
> >> pll3: pll3@860 {
> >> #clock-cells = <1>;
> >> reg = <0x860 0x4>;
> >> @@ -1076,7 +1050,6 @@
> >> clocks = <&sysclk>;
> >> clock-output-names = "pll3", "pll3-div2", "pll3-div4";
> >> };
> >> -
> >> pll4: pll4@880 {
> >> #clock-cells = <1>;
> >> reg = <0x880 0x4>;
> >
> > Why?
>
> Why what?
Why are you removing all these blank lines?
-Scott
^ permalink raw reply
* Re: [PATCHv5] clk: ppc-corenet: rename to qoriq and add CLK_OF_DECLARE support
From: Scott Wood @ 2014-10-30 23:12 UTC (permalink / raw)
To: Lu Jingchang-B35083
Cc: linuxppc-dev@lists.ozlabs.org, mturquette@linaro.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <ccb7de6dc94e4493bbf8685c4d8b3421@BL2PR03MB467.namprd03.prod.outlook.com>
The CLK_OF_DECLARE part is addressed by:
http://patchwork.ozlabs.org/patch/400740/
http://patchwork.ozlabs.org/patch/400741/
http://patchwork.ozlabs.org/patch/400742/
...which does what I was asking earlier, getting rid of the (currently
broken due to a misguided attempt to remove an __init warning) platform
driver part rather than maintaining both approaches.
I suggest sending a rename patch that applies after those patches.
-Scott
On Tue, 2014-10-14 at 05:32 -0500, Lu Jingchang-B35083 wrote:
> Hi, Scott and Mike,
>
> Could you please help review this patch. Thanks.
>
> Best Regards,
> Jingchang
>
> >-----Original Message-----
> >From: Jingchang Lu [mailto:jingchang.lu@freescale.com]
> >Sent: Friday, October 10, 2014 5:15 PM
> >To: mturquette@linaro.org
> >Cc: Wood Scott-B07421; linuxppc-dev@lists.ozlabs.org; linux-
> >kernel@vger.kernel.org; linux-arm-kernel@lists.infradead.org; Lu
> >Jingchang-B35083
> >Subject: [PATCHv5] clk: ppc-corenet: rename to qoriq and add
> >CLK_OF_DECLARE support
> >
> >The IP is shared by PPC and ARM, this renames it to qoriq for better
> >represention, and this also adds the CLK_OF_DECLARE support for being
> >initialized by of_clk_init() on ARM.
> >
> >Signed-off-by: Jingchang Lu <jingchang.lu@freescale.com>
> >---
> >changes in v5:
> > update drivers/cpufreq/Kconfig.powerpc to slect the renamed config option.
> >
> >changes in v4:
> > remove "corenet" literals omitted in v3 remove.
> >
> >changes in v3:
> > generate the patch with -M -C option
> >
> >changes in v2:
> > rename the driver name to ppc-qoriq.c for shared on PPC and ARM.
> >
> > drivers/clk/Kconfig | 10 ++++-----
> > drivers/clk/Makefile | 2 +-
> > drivers/clk/{clk-ppc-corenet.c => clk-qoriq.c} | 29 +++++++++++++++------
> >-----
> > drivers/cpufreq/Kconfig.powerpc | 2 +-
> > 4 files changed, 24 insertions(+), 19 deletions(-) rename
> >drivers/clk/{clk-ppc-corenet.c => clk-qoriq.c} (89%)
> >
> >diff --git a/drivers/clk/Kconfig b/drivers/clk/Kconfig index
> >455fd17..4706a9f 100644
> >--- a/drivers/clk/Kconfig
> >+++ b/drivers/clk/Kconfig
> >@@ -101,12 +101,12 @@ config COMMON_CLK_AXI_CLKGEN
> > Support for the Analog Devices axi-clkgen pcore clock generator
> >for Xilinx
> > FPGAs. It is commonly used in Analog Devices' reference designs.
> >
> >-config CLK_PPC_CORENET
> >- bool "Clock driver for PowerPC corenet platforms"
> >- depends on PPC_E500MC && OF
> >+config CLK_QORIQ
> >+ bool "Clock driver for Freescale QorIQ platforms"
> >+ depends on (PPC_E500MC || ARM) && OF
> > ---help---
> >- This adds the clock driver support for Freescale PowerPC corenet
> >- platforms using common clock framework.
> >+ This adds the clock driver support for Freescale QorIQ platforms
> >+ using common clock framework.
> >
> > config COMMON_CLK_XGENE
> > bool "Clock driver for APM XGene SoC"
> >diff --git a/drivers/clk/Makefile b/drivers/clk/Makefile index
> >d5fba5b..4ff94cd 100644
> >--- a/drivers/clk/Makefile
> >+++ b/drivers/clk/Makefile
> >@@ -30,7 +30,7 @@ obj-$(CONFIG_ARCH_MOXART) += clk-moxart.o
> > obj-$(CONFIG_ARCH_NOMADIK) += clk-nomadik.o
> > obj-$(CONFIG_ARCH_NSPIRE) += clk-nspire.o
> > obj-$(CONFIG_COMMON_CLK_PALMAS) += clk-palmas.o
> >-obj-$(CONFIG_CLK_PPC_CORENET) += clk-ppc-corenet.o
> >+obj-$(CONFIG_CLK_QORIQ) += clk-qoriq.o
> > obj-$(CONFIG_COMMON_CLK_RK808) += clk-rk808.o
> > obj-$(CONFIG_COMMON_CLK_S2MPS11) += clk-s2mps11.o
> > obj-$(CONFIG_COMMON_CLK_SI5351) += clk-si5351.o
> >diff --git a/drivers/clk/clk-ppc-corenet.c b/drivers/clk/clk-qoriq.c
> >similarity index 89% rename from drivers/clk/clk-ppc-corenet.c rename to
> >drivers/clk/clk-qoriq.c index 8e58edf..48cb923 100644
> >--- a/drivers/clk/clk-ppc-corenet.c
> >+++ b/drivers/clk/clk-qoriq.c
> >@@ -5,7 +5,7 @@
> > * it under the terms of the GNU General Public License version 2 as
> > * published by the Free Software Foundation.
> > *
> >- * clock driver for Freescale PowerPC corenet SoCs.
> >+ * clock driver for Freescale QorIQ SoCs.
> > */
> > #include <linux/clk-provider.h>
> > #include <linux/io.h>
> >@@ -155,7 +155,7 @@ static void __init core_pll_init(struct device_node
> >*np)
> >
> > base = of_iomap(np, 0);
> > if (!base) {
> >- pr_err("clk-ppc: iomap error\n");
> >+ pr_err("clk-qoriq: iomap error\n");
> > return;
> > }
> >
> >@@ -252,7 +252,7 @@ static void __init sysclk_init(struct device_node
> >*node)
> > u32 rate;
> >
> > if (!np) {
> >- pr_err("ppc-clk: could not get parent node\n");
> >+ pr_err("qoriq-clk: could not get parent node\n");
> > return;
> > }
> >
> >@@ -278,30 +278,35 @@ static const struct of_device_id clk_match[]
> >__initconst = {
> > {}
> > };
> >
> >-static int __init ppc_corenet_clk_probe(struct platform_device *pdev)
> >+static int __init qoriq_clk_probe(struct platform_device *pdev)
> > {
> > of_clk_init(clk_match);
> >
> > return 0;
> > }
> >
> >-static const struct of_device_id ppc_clk_ids[] __initconst = {
> >+static const struct of_device_id qoriq_clk_ids[] __initconst = {
> > { .compatible = "fsl,qoriq-clockgen-1.0", },
> > { .compatible = "fsl,qoriq-clockgen-2.0", },
> > {}
> > };
> >
> >-static struct platform_driver ppc_corenet_clk_driver __initdata = {
> >+static struct platform_driver qoriq_clk_driver __initdata = {
> > .driver = {
> >- .name = "ppc_corenet_clock",
> >+ .name = "qoriq_clock",
> > .owner = THIS_MODULE,
> >- .of_match_table = ppc_clk_ids,
> >+ .of_match_table = qoriq_clk_ids,
> > },
> >- .probe = ppc_corenet_clk_probe,
> >+ .probe = qoriq_clk_probe,
> > };
> >
> >-static int __init ppc_corenet_clk_init(void)
> >+static int __init qoriq_clk_init(void)
> > {
> >- return platform_driver_register(&ppc_corenet_clk_driver);
> >+ return platform_driver_register(&qoriq_clk_driver);
> > }
> >-subsys_initcall(ppc_corenet_clk_init);
> >+subsys_initcall(qoriq_clk_init);
> >+
> >+CLK_OF_DECLARE(qoriq_core_pll_v1, "fsl,qoriq-core-pll-1.0",
> >+core_pll_init); CLK_OF_DECLARE(qoriq_core_pll_v2,
> >+"fsl,qoriq-core-pll-2.0", core_pll_init);
> >+CLK_OF_DECLARE(qoriq_core_mux_v1, "fsl,qoriq-core-mux-1.0",
> >+core_mux_init); CLK_OF_DECLARE(qoriq_core_mux_v2,
> >+"fsl,qoriq-core-mux-2.0", core_mux_init);
> >diff --git a/drivers/cpufreq/Kconfig.powerpc
> >b/drivers/cpufreq/Kconfig.powerpc index 72564b7..7ea2441 100644
> >--- a/drivers/cpufreq/Kconfig.powerpc
> >+++ b/drivers/cpufreq/Kconfig.powerpc
> >@@ -26,7 +26,7 @@ config CPU_FREQ_MAPLE
> > config PPC_CORENET_CPUFREQ
> > tristate "CPU frequency scaling driver for Freescale E500MC SoCs"
> > depends on PPC_E500MC && OF && COMMON_CLK
> >- select CLK_PPC_CORENET
> >+ select CLK_QORIQ
> > help
> > This adds the CPUFreq driver support for Freescale e500mc,
> > e5500 and e6500 series SoCs which are capable of changing
> >--
> >1.8.0
>
^ permalink raw reply
* [PATCH 3/3] ipr: Wait for aborted command responses
From: Brian King @ 2014-10-30 22:27 UTC (permalink / raw)
To: James.Bottomley; +Cc: hch, brking, linuxppc-dev, stable, linux-scsi
Fixes a race condition in abort handling that was injected
when multiple interrupt support was added. When only a single
interrupt is present, the adapter guarantees it will send
responses for aborted commands prior to the response for the
abort command itself. With multiple interrupts, these responses
generally come back on different interrupts, so we need to
ensure the abort thread waits until the aborted command is
complete so we don't perform a double completion. This race
condition was being hit frequently in environments which
were triggering command timeouts, which was resulting in
a double completion causing a kernel oops.
Cc: <stable@vger.kernel.org>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
drivers/scsi/ipr.c | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++++
drivers/scsi/ipr.h | 1
2 files changed, 93 insertions(+)
diff -puN drivers/scsi/ipr.c~ipr_eh_wait drivers/scsi/ipr.c
--- scsi-queue/drivers/scsi/ipr.c~ipr_eh_wait 2014-10-30 17:15:37.302753120 -0500
+++ scsi-queue-bjking1/drivers/scsi/ipr.c 2014-10-30 17:15:37.311753039 -0500
@@ -683,6 +683,7 @@ static void ipr_init_ipr_cmnd(struct ipr
ipr_reinit_ipr_cmnd(ipr_cmd);
ipr_cmd->u.scratch = 0;
ipr_cmd->sibling = NULL;
+ ipr_cmd->eh_comp = NULL;
ipr_cmd->fast_done = fast_done;
init_timer(&ipr_cmd->timer);
}
@@ -848,6 +849,8 @@ static void ipr_scsi_eh_done(struct ipr_
scsi_dma_unmap(ipr_cmd->scsi_cmd);
scsi_cmd->scsi_done(scsi_cmd);
+ if (ipr_cmd->eh_comp)
+ complete(ipr_cmd->eh_comp);
list_add_tail(&ipr_cmd->queue, &ipr_cmd->hrrq->hrrq_free_q);
}
@@ -4854,6 +4857,84 @@ static int ipr_slave_alloc(struct scsi_d
return rc;
}
+/**
+ * ipr_match_lun - Match function for specified LUN
+ * @ipr_cmd: ipr command struct
+ * @device: device to match (sdev)
+ *
+ * Returns:
+ * 1 if command matches sdev / 0 if command does not match sdev
+ **/
+static int ipr_match_lun(struct ipr_cmnd *ipr_cmd, void *device)
+{
+ if (ipr_cmd->scsi_cmd && ipr_cmd->scsi_cmd->device == device)
+ return 1;
+ return 0;
+}
+
+/**
+ * ipr_wait_for_ops - Wait for matching commands to complete
+ * @ipr_cmd: ipr command struct
+ * @device: device to match (sdev)
+ * @match: match function to use
+ *
+ * Returns:
+ * SUCCESS / FAILED
+ **/
+static int ipr_wait_for_ops(struct ipr_ioa_cfg *ioa_cfg, void *device,
+ int (*match)(struct ipr_cmnd *, void *))
+{
+ struct ipr_cmnd *ipr_cmd;
+ int wait;
+ unsigned long flags;
+ struct ipr_hrr_queue *hrrq;
+ signed long timeout = IPR_ABORT_TASK_TIMEOUT;
+ DECLARE_COMPLETION_ONSTACK(comp);
+
+ ENTER;
+ do {
+ wait = 0;
+
+ for_each_hrrq(hrrq, ioa_cfg) {
+ spin_lock_irqsave(hrrq->lock, flags);
+ list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
+ if (match(ipr_cmd, device)) {
+ ipr_cmd->eh_comp = ∁
+ wait++;
+ }
+ }
+ spin_unlock_irqrestore(hrrq->lock, flags);
+ }
+
+ if (wait) {
+ timeout = wait_for_completion_timeout(&comp, timeout);
+
+ if (!timeout) {
+ wait = 0;
+
+ for_each_hrrq(hrrq, ioa_cfg) {
+ spin_lock_irqsave(hrrq->lock, flags);
+ list_for_each_entry(ipr_cmd, &hrrq->hrrq_pending_q, queue) {
+ if (match(ipr_cmd, device)) {
+ ipr_cmd->eh_comp = NULL;
+ wait++;
+ }
+ }
+ spin_unlock_irqrestore(hrrq->lock, flags);
+ }
+
+ if (wait)
+ dev_err(&ioa_cfg->pdev->dev, "Timed out waiting for aborted commands\n");
+ LEAVE;
+ return wait ? FAILED : SUCCESS;
+ }
+ }
+ } while (wait);
+
+ LEAVE;
+ return SUCCESS;
+}
+
static int ipr_eh_host_reset(struct scsi_cmnd *cmd)
{
struct ipr_ioa_cfg *ioa_cfg;
@@ -5073,11 +5154,17 @@ static int __ipr_eh_dev_reset(struct scs
static int ipr_eh_dev_reset(struct scsi_cmnd *cmd)
{
int rc;
+ struct ipr_ioa_cfg *ioa_cfg;
+
+ ioa_cfg = (struct ipr_ioa_cfg *) cmd->device->host->hostdata;
spin_lock_irq(cmd->device->host->host_lock);
rc = __ipr_eh_dev_reset(cmd);
spin_unlock_irq(cmd->device->host->host_lock);
+ if (rc == SUCCESS)
+ rc = ipr_wait_for_ops(ioa_cfg, cmd->device, ipr_match_lun);
+
return rc;
}
@@ -5255,13 +5342,18 @@ static int ipr_eh_abort(struct scsi_cmnd
{
unsigned long flags;
int rc;
+ struct ipr_ioa_cfg *ioa_cfg;
ENTER;
+ ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
+
spin_lock_irqsave(scsi_cmd->device->host->host_lock, flags);
rc = ipr_cancel_op(scsi_cmd);
spin_unlock_irqrestore(scsi_cmd->device->host->host_lock, flags);
+ if (rc == SUCCESS)
+ rc = ipr_wait_for_ops(ioa_cfg, scsi_cmd->device, ipr_match_lun);
LEAVE;
return rc;
}
diff -puN drivers/scsi/ipr.h~ipr_eh_wait drivers/scsi/ipr.h
--- scsi-queue/drivers/scsi/ipr.h~ipr_eh_wait 2014-10-30 17:15:37.305753093 -0500
+++ scsi-queue-bjking1/drivers/scsi/ipr.h 2014-10-30 17:15:37.315753003 -0500
@@ -1608,6 +1608,7 @@ struct ipr_cmnd {
struct scsi_device *sdev;
} u;
+ struct completion *eh_comp;
struct ipr_hrr_queue *hrrq;
struct ipr_ioa_cfg *ioa_cfg;
};
_
^ permalink raw reply
* [PATCH 2/3] ipr: set coherent DMA mask
From: Brian King @ 2014-10-30 22:27 UTC (permalink / raw)
To: James.Bottomley; +Cc: hch, brking, linuxppc-dev, anton, linux-scsi
From: Anton Blanchard <anton@samba.org>
Use dma_set_mask_and_coherent() to set both the DMA and coherent
DMA mask.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
drivers/scsi/ipr.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff -puN drivers/scsi/ipr.c~ipr_set_coherent_DMA_mask drivers/scsi/ipr.c
--- scsi-queue/drivers/scsi/ipr.c~ipr_set_coherent_DMA_mask 2014-10-30 17:15:30.007820722 -0500
+++ scsi-queue-bjking1/drivers/scsi/ipr.c 2014-10-30 17:15:30.013820667 -0500
@@ -9621,16 +9621,17 @@ static int ipr_probe_ioa(struct pci_dev
ipr_init_regs(ioa_cfg);
if (ioa_cfg->sis64) {
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
if (rc < 0) {
- dev_dbg(&pdev->dev, "Failed to set 64 bit PCI DMA mask\n");
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ dev_dbg(&pdev->dev, "Failed to set 64 bit DMA mask\n");
+ rc = dma_set_mask_and_coherent(&pdev->dev,
+ DMA_BIT_MASK(32));
}
} else
- rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
+ rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
if (rc < 0) {
- dev_err(&pdev->dev, "Failed to set PCI DMA mask\n");
+ dev_err(&pdev->dev, "Failed to set DMA mask\n");
goto cleanup_nomem;
}
_
^ permalink raw reply
* [PATCH 1/3] ipr: Convert to generic DMA API
From: Brian King @ 2014-10-30 22:27 UTC (permalink / raw)
To: James.Bottomley; +Cc: hch, brking, linuxppc-dev, anton, linux-scsi
From: Anton Blanchard <anton@samba.org>
Even though the ipr driver is only used on PCI, convert it
to use the generic DMA API.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
---
drivers/scsi/ipr.c | 103 +++++++++++++++++++++++++++--------------------------
drivers/scsi/ipr.h | 2 -
2 files changed, 54 insertions(+), 51 deletions(-)
diff -puN drivers/scsi/ipr.c~ipr_convert_to_generic_DMA_API drivers/scsi/ipr.c
--- scsi-queue/drivers/scsi/ipr.c~ipr_convert_to_generic_DMA_API 2014-10-30 17:15:26.135856602 -0500
+++ scsi-queue-bjking1/drivers/scsi/ipr.c 2014-10-30 17:15:26.144856521 -0500
@@ -3942,8 +3942,9 @@ static int ipr_update_ioa_ucode(struct i
return -EIO;
}
- sglist->num_dma_sg = pci_map_sg(ioa_cfg->pdev, sglist->scatterlist,
- sglist->num_sg, DMA_TO_DEVICE);
+ sglist->num_dma_sg = dma_map_sg(&ioa_cfg->pdev->dev,
+ sglist->scatterlist, sglist->num_sg,
+ DMA_TO_DEVICE);
if (!sglist->num_dma_sg) {
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
@@ -5585,7 +5586,7 @@ static int ipr_build_ioadl64(struct ipr_
nseg = scsi_dma_map(scsi_cmd);
if (nseg < 0) {
if (printk_ratelimit())
- dev_err(&ioa_cfg->pdev->dev, "pci_map_sg failed!\n");
+ dev_err(&ioa_cfg->pdev->dev, "scsi_dma_map failed!\n");
return -1;
}
@@ -5636,7 +5637,7 @@ static int ipr_build_ioadl(struct ipr_io
nseg = scsi_dma_map(scsi_cmd);
if (nseg < 0) {
- dev_err(&ioa_cfg->pdev->dev, "pci_map_sg failed!\n");
+ dev_err(&ioa_cfg->pdev->dev, "scsi_dma_map failed!\n");
return -1;
}
@@ -8431,7 +8432,7 @@ static int ipr_reset_ucode_download_done
struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
struct ipr_sglist *sglist = ioa_cfg->ucode_sglist;
- pci_unmap_sg(ioa_cfg->pdev, sglist->scatterlist,
+ dma_unmap_sg(&ioa_cfg->pdev->dev, sglist->scatterlist,
sglist->num_sg, DMA_TO_DEVICE);
ipr_cmd->job_step = ipr_reset_alert;
@@ -8871,7 +8872,7 @@ static void ipr_free_cmd_blks(struct ipr
for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
if (ioa_cfg->ipr_cmnd_list[i])
- pci_pool_free(ioa_cfg->ipr_cmd_pool,
+ dma_pool_free(ioa_cfg->ipr_cmd_pool,
ioa_cfg->ipr_cmnd_list[i],
ioa_cfg->ipr_cmnd_list_dma[i]);
@@ -8879,7 +8880,7 @@ static void ipr_free_cmd_blks(struct ipr
}
if (ioa_cfg->ipr_cmd_pool)
- pci_pool_destroy(ioa_cfg->ipr_cmd_pool);
+ dma_pool_destroy(ioa_cfg->ipr_cmd_pool);
kfree(ioa_cfg->ipr_cmnd_list);
kfree(ioa_cfg->ipr_cmnd_list_dma);
@@ -8900,25 +8901,24 @@ static void ipr_free_mem(struct ipr_ioa_
int i;
kfree(ioa_cfg->res_entries);
- pci_free_consistent(ioa_cfg->pdev, sizeof(struct ipr_misc_cbs),
- ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
+ dma_free_coherent(&ioa_cfg->pdev->dev, sizeof(struct ipr_misc_cbs),
+ ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
ipr_free_cmd_blks(ioa_cfg);
for (i = 0; i < ioa_cfg->hrrq_num; i++)
- pci_free_consistent(ioa_cfg->pdev,
- sizeof(u32) * ioa_cfg->hrrq[i].size,
- ioa_cfg->hrrq[i].host_rrq,
- ioa_cfg->hrrq[i].host_rrq_dma);
+ dma_free_coherent(&ioa_cfg->pdev->dev,
+ sizeof(u32) * ioa_cfg->hrrq[i].size,
+ ioa_cfg->hrrq[i].host_rrq,
+ ioa_cfg->hrrq[i].host_rrq_dma);
- pci_free_consistent(ioa_cfg->pdev, ioa_cfg->cfg_table_size,
- ioa_cfg->u.cfg_table,
- ioa_cfg->cfg_table_dma);
+ dma_free_coherent(&ioa_cfg->pdev->dev, ioa_cfg->cfg_table_size,
+ ioa_cfg->u.cfg_table, ioa_cfg->cfg_table_dma);
for (i = 0; i < IPR_NUM_HCAMS; i++) {
- pci_free_consistent(ioa_cfg->pdev,
- sizeof(struct ipr_hostrcb),
- ioa_cfg->hostrcb[i],
- ioa_cfg->hostrcb_dma[i]);
+ dma_free_coherent(&ioa_cfg->pdev->dev,
+ sizeof(struct ipr_hostrcb),
+ ioa_cfg->hostrcb[i],
+ ioa_cfg->hostrcb_dma[i]);
}
ipr_free_dump(ioa_cfg);
@@ -8979,7 +8979,7 @@ static int ipr_alloc_cmd_blks(struct ipr
dma_addr_t dma_addr;
int i, entries_each_hrrq, hrrq_id = 0;
- ioa_cfg->ipr_cmd_pool = pci_pool_create(IPR_NAME, ioa_cfg->pdev,
+ ioa_cfg->ipr_cmd_pool = dma_pool_create(IPR_NAME, &ioa_cfg->pdev->dev,
sizeof(struct ipr_cmnd), 512, 0);
if (!ioa_cfg->ipr_cmd_pool)
@@ -9029,7 +9029,7 @@ static int ipr_alloc_cmd_blks(struct ipr
}
for (i = 0; i < IPR_NUM_CMD_BLKS; i++) {
- ipr_cmd = pci_pool_alloc(ioa_cfg->ipr_cmd_pool, GFP_KERNEL, &dma_addr);
+ ipr_cmd = dma_pool_alloc(ioa_cfg->ipr_cmd_pool, GFP_KERNEL, &dma_addr);
if (!ipr_cmd) {
ipr_free_cmd_blks(ioa_cfg);
@@ -9100,9 +9100,10 @@ static int ipr_alloc_mem(struct ipr_ioa_
ioa_cfg->res_entries[i].ioa_cfg = ioa_cfg;
}
- ioa_cfg->vpd_cbs = pci_alloc_consistent(ioa_cfg->pdev,
- sizeof(struct ipr_misc_cbs),
- &ioa_cfg->vpd_cbs_dma);
+ ioa_cfg->vpd_cbs = dma_alloc_coherent(&pdev->dev,
+ sizeof(struct ipr_misc_cbs),
+ &ioa_cfg->vpd_cbs_dma,
+ GFP_KERNEL);
if (!ioa_cfg->vpd_cbs)
goto out_free_res_entries;
@@ -9111,13 +9112,14 @@ static int ipr_alloc_mem(struct ipr_ioa_
goto out_free_vpd_cbs;
for (i = 0; i < ioa_cfg->hrrq_num; i++) {
- ioa_cfg->hrrq[i].host_rrq = pci_alloc_consistent(ioa_cfg->pdev,
+ ioa_cfg->hrrq[i].host_rrq = dma_alloc_coherent(&pdev->dev,
sizeof(u32) * ioa_cfg->hrrq[i].size,
- &ioa_cfg->hrrq[i].host_rrq_dma);
+ &ioa_cfg->hrrq[i].host_rrq_dma,
+ GFP_KERNEL);
if (!ioa_cfg->hrrq[i].host_rrq) {
while (--i > 0)
- pci_free_consistent(pdev,
+ dma_free_coherent(&pdev->dev,
sizeof(u32) * ioa_cfg->hrrq[i].size,
ioa_cfg->hrrq[i].host_rrq,
ioa_cfg->hrrq[i].host_rrq_dma);
@@ -9126,17 +9128,19 @@ static int ipr_alloc_mem(struct ipr_ioa_
ioa_cfg->hrrq[i].ioa_cfg = ioa_cfg;
}
- ioa_cfg->u.cfg_table = pci_alloc_consistent(ioa_cfg->pdev,
- ioa_cfg->cfg_table_size,
- &ioa_cfg->cfg_table_dma);
+ ioa_cfg->u.cfg_table = dma_alloc_coherent(&pdev->dev,
+ ioa_cfg->cfg_table_size,
+ &ioa_cfg->cfg_table_dma,
+ GFP_KERNEL);
if (!ioa_cfg->u.cfg_table)
goto out_free_host_rrq;
for (i = 0; i < IPR_NUM_HCAMS; i++) {
- ioa_cfg->hostrcb[i] = pci_alloc_consistent(ioa_cfg->pdev,
- sizeof(struct ipr_hostrcb),
- &ioa_cfg->hostrcb_dma[i]);
+ ioa_cfg->hostrcb[i] = dma_alloc_coherent(&pdev->dev,
+ sizeof(struct ipr_hostrcb),
+ &ioa_cfg->hostrcb_dma[i],
+ GFP_KERNEL);
if (!ioa_cfg->hostrcb[i])
goto out_free_hostrcb_dma;
@@ -9160,25 +9164,24 @@ out:
out_free_hostrcb_dma:
while (i-- > 0) {
- pci_free_consistent(pdev, sizeof(struct ipr_hostrcb),
- ioa_cfg->hostrcb[i],
- ioa_cfg->hostrcb_dma[i]);
- }
- pci_free_consistent(pdev, ioa_cfg->cfg_table_size,
- ioa_cfg->u.cfg_table,
- ioa_cfg->cfg_table_dma);
+ dma_free_coherent(&pdev->dev, sizeof(struct ipr_hostrcb),
+ ioa_cfg->hostrcb[i],
+ ioa_cfg->hostrcb_dma[i]);
+ }
+ dma_free_coherent(&pdev->dev, ioa_cfg->cfg_table_size,
+ ioa_cfg->u.cfg_table, ioa_cfg->cfg_table_dma);
out_free_host_rrq:
for (i = 0; i < ioa_cfg->hrrq_num; i++) {
- pci_free_consistent(pdev,
- sizeof(u32) * ioa_cfg->hrrq[i].size,
- ioa_cfg->hrrq[i].host_rrq,
- ioa_cfg->hrrq[i].host_rrq_dma);
+ dma_free_coherent(&pdev->dev,
+ sizeof(u32) * ioa_cfg->hrrq[i].size,
+ ioa_cfg->hrrq[i].host_rrq,
+ ioa_cfg->hrrq[i].host_rrq_dma);
}
out_ipr_free_cmd_blocks:
ipr_free_cmd_blks(ioa_cfg);
out_free_vpd_cbs:
- pci_free_consistent(pdev, sizeof(struct ipr_misc_cbs),
- ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
+ dma_free_coherent(&pdev->dev, sizeof(struct ipr_misc_cbs),
+ ioa_cfg->vpd_cbs, ioa_cfg->vpd_cbs_dma);
out_free_res_entries:
kfree(ioa_cfg->res_entries);
goto out;
@@ -9618,13 +9621,13 @@ static int ipr_probe_ioa(struct pci_dev
ipr_init_regs(ioa_cfg);
if (ioa_cfg->sis64) {
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64));
if (rc < 0) {
dev_dbg(&pdev->dev, "Failed to set 64 bit PCI DMA mask\n");
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
}
} else
- rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
+ rc = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
if (rc < 0) {
dev_err(&pdev->dev, "Failed to set PCI DMA mask\n");
diff -puN drivers/scsi/ipr.h~ipr_convert_to_generic_DMA_API drivers/scsi/ipr.h
--- scsi-queue/drivers/scsi/ipr.h~ipr_convert_to_generic_DMA_API 2014-10-30 17:15:26.138856575 -0500
+++ scsi-queue-bjking1/drivers/scsi/ipr.h 2014-10-30 17:15:26.148856485 -0500
@@ -1549,7 +1549,7 @@ struct ipr_ioa_cfg {
struct ipr_misc_cbs *vpd_cbs;
dma_addr_t vpd_cbs_dma;
- struct pci_pool *ipr_cmd_pool;
+ struct dma_pool *ipr_cmd_pool;
struct ipr_cmnd *reset_cmd;
int (*reset) (struct ipr_cmnd *);
_
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox