- Make the IOMMU flags used for mapping main memory into the GPU's I/O space
explicit, instead of relying on the default in the hypervisor,
- Add missing calls to lv1_gpu_context_iomap(..., CBE_IOPTE_M) to unmap the
memory during cleanup.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: linux-fbdev-devel@lists.sourceforge.net
---
v2: Add CBE_ prefix
drivers/video/ps3fb.c | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
Remove the mutex serializing access to the cache.
Instead, queue up new requests on a bio_list if the driver is busy.
This improves sequential write performance by ca. 2%.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Jim Paris <jim@jtan.com>
Cc: Jens Axboe <axboe@kernel.dk>
---
v2: Use bio_list instead of homebrew single-linked list
drivers/block/ps3vram.c | 51 +++++++++++++++++++++++++++++++++-------------
1 files changed, 36 insertions(+), 15 deletions(-)
@@ -81,8 +81,8 @@ struct ps3vram_priv {structps3vram_cachecache;-/* Used to serialize cache/DMA operations */-structmutexlock;+spinlock_tlock;/* protecting list of bios */+structbio_listlist;};
- Make the IOMMU flags used for mapping main memory into the GPU's I/O space
explicit, instead of relying on the default in the hypervisor,
- Add missing calls to lv1_gpu_context_iomap(..., CBE_IOPTE_M) to unmap the
memory during cleanup.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Jim Paris <jim@jtan.com>
Cc: Jens Axboe <axboe@kernel.dk>
---
v2: Add CBE_ prefix
drivers/block/ps3vram.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
Both arch/powerpc/platforms/cell/iommu.c and arch/powerpc/platforms/ps3/mm.c
contain the same Cell IOMMU page table entry definitions. Extract them and move
them to <asm/iommu.h>, while adding a CBE_ prefix.
This also allows them to be used by drivers.
Signed-off-by: Geert Uytterhoeven <redacted>
---
v2: Add CBE_ prefix
arch/powerpc/include/asm/iommu.h | 10 ++++++++
arch/powerpc/platforms/cell/iommu.c | 37 ++++++++++++------------------
arch/powerpc/platforms/ps3/mm.c | 7 ++++-
arch/powerpc/platforms/ps3/platform.h | 10 --------
arch/powerpc/platforms/ps3/system-bus.c | 15 +++++++-----
5 files changed, 39 insertions(+), 40 deletions(-)
@@ -193,19 +183,21 @@ static int tce_build_cell(struct iommu_table *tbl, long index, long npages,*/constunsignedlongprot=0xc48;base_pte=-((prot<<(52+4*direction))&(IOPTE_PP_W|IOPTE_PP_R))-|IOPTE_M|IOPTE_SO_RW|(window->ioid&IOPTE_IOID_Mask);+((prot<<(52+4*direction))&+(CBE_IOPTE_PP_W|CBE_IOPTE_PP_R))|+CBE_IOPTE_M|CBE_IOPTE_SO_RW|+(window->ioid&CBE_IOPTE_IOID_Mask);#else-base_pte=IOPTE_PP_W|IOPTE_PP_R|IOPTE_M|IOPTE_SO_RW|-(window->ioid&IOPTE_IOID_Mask);+base_pte=CBE_IOPTE_PP_W|CBE_IOPTE_PP_R|CBE_IOPTE_M|+CBE_IOPTE_SO_RW|(window->ioid&CBE_IOPTE_IOID_Mask);#endifif(unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING,attrs)))-base_pte&=~IOPTE_SO_RW;+base_pte&=~CBE_IOPTE_SO_RW;io_pte=(unsignedlong*)tbl->it_base+(index-tbl->it_offset);for(i=0;i<npages;i++,uaddr+=IOMMU_PAGE_SIZE)-io_pte[i]=base_pte|(__pa(uaddr)&IOPTE_RPN_Mask);+io_pte[i]=base_pte|(__pa(uaddr)&CBE_IOPTE_RPN_Mask);mb();
@@ -231,8 +223,9 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)#else/* spider bridge does PCI reads after freeing - insert a mapping*toascratchpageinsteadofaninvalidentry*/-pte=IOPTE_PP_R|IOPTE_M|IOPTE_SO_RW|__pa(window->iommu->pad_page)-|(window->ioid&IOPTE_IOID_Mask);+pte=CBE_IOPTE_PP_R|CBE_IOPTE_M|CBE_IOPTE_SO_RW|+__pa(window->iommu->pad_page)|+(window->ioid&CBE_IOPTE_IOID_Mask);#endifio_pte=(unsignedlong*)tbl->it_base+(index-tbl->it_offset);
@@ -1001,7 +994,7 @@ static void insert_16M_pte(unsigned long addr, unsigned long *ptab,pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n",addr,ptab,segment,offset);-ptab[offset]=base_pte|(__pa(addr)&IOPTE_RPN_Mask);+ptab[offset]=base_pte|(__pa(addr)&CBE_IOPTE_RPN_Mask);}staticvoidcell_iommu_setup_fixed_ptab(structcbe_iommu*iommu,
@@ -1016,14 +1009,14 @@ static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu,pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n",fsize,fbase);-base_pte=IOPTE_PP_W|IOPTE_PP_R|IOPTE_M-|(cell_iommu_get_ioid(np)&IOPTE_IOID_Mask);+base_pte=CBE_IOPTE_PP_W|CBE_IOPTE_PP_R|CBE_IOPTE_M|+(cell_iommu_get_ioid(np)&CBE_IOPTE_IOID_Mask);if(iommu_fixed_is_weak)pr_info("IOMMU: Using weak ordering for fixed mapping\n");else{pr_info("IOMMU: Using strong ordering for fixed mapping\n");-base_pte|=IOPTE_SO_RW;+base_pte|=CBE_IOPTE_SO_RW;}for(uaddr=0;uaddr<fsize;uaddr+=(1<<24)){
So we can kill a cast.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Jim Paris <jim@jtan.com>
Cc: Jens Axboe <axboe@kernel.dk>
---
drivers/block/ps3vram.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
@@ -387,7 +387,7 @@ static int __devinit ps3rom_probe(struct ps3_system_bus_device *_dev)}priv=shost_priv(host);-dev->sbd.core.driver_data=host;+ps3_system_bus_set_drvdata(&dev->sbd,host);priv->dev=dev;/* One device/LUN per SCSI bus */
@@ -407,7 +407,7 @@ static int __devinit ps3rom_probe(struct ps3_system_bus_device *_dev)fail_host_put:scsi_host_put(host);-dev->sbd.core.driver_data=NULL;+ps3_system_bus_set_drvdata(&dev->sbd,NULL);fail_teardown:ps3stor_teardown(dev);fail_free_bounce:
@@ -421,12 +421,12 @@ static inline struct ps3_system_bus_driver *staticinlinevoidps3_system_bus_set_driver_data(structps3_system_bus_device*dev,void*data){-dev->core.driver_data=data;+dev_set_drvdata(&dev->core,data);}staticinlinevoid*ps3_system_bus_get_driver_data(structps3_system_bus_device*dev){-returndev->core.driver_data;+returndev_get_drvdata(&dev->core);}/* These two need global scope for get_dma_ops(). */
During cleanup, use L1GPU_CONTEXT_ATTRIBUTE_FB_CLOSE to tear down the setup
done by L1GPU_CONTEXT_ATTRIBUTE_FB_SETUP.
This allows unloading and reloading of ps3fb while the sound driver keeps the
GPU open.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: linux-fbdev-devel@lists.sourceforge.net
---
arch/powerpc/include/asm/ps3gpu.h | 8 ++++++++
drivers/video/ps3fb.c | 5 ++++-
2 files changed, 12 insertions(+), 1 deletions(-)
From: Roel Kluin <redacted>
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
[Geert: Use ps3_system_bus_[gs]et_driver_data() for ps3_system_bus_device]
Signed-off-by: Roel Kluin <redacted>
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Jim Paris <jim@jtan.com>
Cc: Jens Axboe <axboe@kernel.dk>
---
drivers/block/ps3disk.c | 23 +++++++++++++--------
drivers/block/ps3vram.c | 50 ++++++++++++++++++++++------------------------
2 files changed, 38 insertions(+), 35 deletions(-)
Introduce bio_list_peek(), to obtain a pointer to the first bio on the bio_list
without actually removing it from the list. This is needed when you want to
serialize based on the list being empty or not.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Jens Axboe <axboe@kernel.dk>
---
include/linux/bio.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
@@ -1166,7 +1166,7 @@ static int __devinit ps3fb_probe(struct ps3_system_bus_device *dev)if(retval<0)gotoerr_fb_dealloc;-dev->core.driver_data=info;+ps3_system_bus_set_drvdata(dev,info);dev_info(info->device,"%s %s, using %u KiB of video memory\n",dev_driver_string(info->dev),dev_name(info->dev),
@@ -321,7 +318,7 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info *card,spin_lock_irqsave(&card->dma_lock,irqsave);for(ch=0;ch<2;ch++){start_vaddr=card->dma_next_transfer_vaddr[0];-for(stage=0;stage<fill_stages;stage++){+for(stage=0;stage<fill_stages;stage++){dma_ch=stage*2+ch;if(silent)dma_addr=card->null_buffer_start_dma_addr;
@@ -619,7 +616,7 @@ static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card)PS3_AUDIO_AO_3WMCTRL_ASOEN(2)|PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),0);-wmb();/* ensure the hardware sees the change */+wmb();/* ensure the hardware sees the change *//* wait for actually stopped */retries=1000;while((read_reg(PS3_AUDIO_AO_3WMCTRL)&
Signed-off-by: Geert Uytterhoeven <redacted>
---
It slows down small reads, but do we care?
drivers/char/ps3flash.c | 47 +++++++++++++++++------------------------------
1 files changed, 17 insertions(+), 30 deletions(-)
@@ -369,6 +308,71 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info *card,}/*+*Interrupthandler+*/+staticirqreturn_tsnd_ps3_interrupt(intirq,void*dev_id)+{++uint32_tport_intr;+intunderflow_occured=0;+structsnd_ps3_card_info*card=dev_id;++if(!card->running){+update_reg(PS3_AUDIO_AX_IS,0);+update_reg(PS3_AUDIO_INTR_0,0);+returnIRQ_HANDLED;+}++port_intr=read_reg(PS3_AUDIO_AX_IS);+/*+*serialbufferemptydetected(every4times),+*programnextdmaandkickit+*/+if(port_intr&PS3_AUDIO_AX_IE_ASOBEIE(0)){+write_reg(PS3_AUDIO_AX_IS,PS3_AUDIO_AX_IE_ASOBEIE(0));+if(port_intr&PS3_AUDIO_AX_IE_ASOBUIE(0)){+write_reg(PS3_AUDIO_AX_IS,port_intr);+underflow_occured=1;+}+if(card->silent){+/* we are still in silent time */+snd_ps3_program_dma(card,+(underflow_occured)?+SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL:+SND_PS3_DMA_FILLTYPE_SILENT_RUNNING);+snd_ps3_kick_dma(card);+card->silent--;+}else{+snd_ps3_program_dma(card,+(underflow_occured)?+SND_PS3_DMA_FILLTYPE_FIRSTFILL:+SND_PS3_DMA_FILLTYPE_RUNNING);+snd_ps3_kick_dma(card);+snd_pcm_period_elapsed(card->substream);+}+}elseif(port_intr&PS3_AUDIO_AX_IE_ASOBUIE(0)){+write_reg(PS3_AUDIO_AX_IS,PS3_AUDIO_AX_IE_ASOBUIE(0));+/*+*serialoutunderflow,butbufferemptynotdetected.+*inthiscase,fillfifowith0torecover.After+*fillingdummydata,serialautomaticallystartto+*consumethemandthenwillgeneratenormalbuffer+*emptyinterrupts.+*Ifbothbufferunderflowandbufferemptyareoccured,+*itisbettertodonomaldatatransferthanemptyone+*/+snd_ps3_program_dma(card,+SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL);+snd_ps3_kick_dma(card);+snd_ps3_program_dma(card,+SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL);+snd_ps3_kick_dma(card);+}+/* clear interrupt cause */+returnIRQ_HANDLED;+};++/**audiomuteon/off*mute_on:0outputenabled*1mute
@@ -379,6 +383,142 @@ static int snd_ps3_mute(int mute_on)}/*+*avsetting+*NOTE:callingthisfunctionmaygenerateaudiointerrupt.+*/+staticintsnd_ps3_change_avsetting(structsnd_ps3_card_info*card)+{+intret,retries,i;+pr_debug("%s: start\n",__func__);++ret=ps3av_set_audio_mode(card->avs.avs_audio_ch,+card->avs.avs_audio_rate,+card->avs.avs_audio_width,+card->avs.avs_audio_format,+card->avs.avs_audio_source);+/*+*Resetthefollowingunwantedsettings:+*/++/* disable all 3wire buffers */+update_mask_reg(PS3_AUDIO_AO_3WMCTRL,+~(PS3_AUDIO_AO_3WMCTRL_ASOEN(0)|+PS3_AUDIO_AO_3WMCTRL_ASOEN(1)|+PS3_AUDIO_AO_3WMCTRL_ASOEN(2)|+PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),+0);+wmb();/* ensure the hardware sees the change */+/* wait for actually stopped */+retries=1000;+while((read_reg(PS3_AUDIO_AO_3WMCTRL)&+(PS3_AUDIO_AO_3WMCTRL_ASORUN(0)|+PS3_AUDIO_AO_3WMCTRL_ASORUN(1)|+PS3_AUDIO_AO_3WMCTRL_ASORUN(2)|+PS3_AUDIO_AO_3WMCTRL_ASORUN(3)))&&+--retries){+udelay(1);+}++/* reset buffer pointer */+for(i=0;i<4;i++){+update_reg(PS3_AUDIO_AO_3WCTRL(i),+PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET);+udelay(10);+}+wmb();/* ensure the hardware actually start resetting */++/* enable 3wire#0 buffer */+update_reg(PS3_AUDIO_AO_3WMCTRL,PS3_AUDIO_AO_3WMCTRL_ASOEN(0));+++/* In 24bit mode,ALSA inserts a zero byte at first byte of per sample */+update_mask_reg(PS3_AUDIO_AO_3WCTRL(0),+~PS3_AUDIO_AO_3WCTRL_ASODF,+PS3_AUDIO_AO_3WCTRL_ASODF_LSB);+update_mask_reg(PS3_AUDIO_AO_SPDCTRL(0),+~PS3_AUDIO_AO_SPDCTRL_SPODF,+PS3_AUDIO_AO_SPDCTRL_SPODF_LSB);+/* ensure all the setting above is written back to register */+wmb();+/* avsetting driver altered AX_IE, caller must reset it if you want */+pr_debug("%s: end\n",__func__);+returnret;+}++/*+*setsamplingrateaccordingtothesubstream+*/+staticintsnd_ps3_set_avsetting(structsnd_pcm_substream*substream)+{+structsnd_ps3_card_info*card=snd_pcm_substream_chip(substream);+structsnd_ps3_avsetting_infoavs;+intret;++avs=card->avs;++pr_debug("%s: called freq=%d width=%d\n",__func__,+substream->runtime->rate,+snd_pcm_format_width(substream->runtime->format));++pr_debug("%s: before freq=%d width=%d\n",__func__,+card->avs.avs_audio_rate,card->avs.avs_audio_width);++/* sample rate */+switch(substream->runtime->rate){+case44100:+avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_44K;+break;+case48000:+avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_48K;+break;+case88200:+avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_88K;+break;+case96000:+avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_96K;+break;+default:+pr_info("%s: invalid rate %d\n",__func__,+substream->runtime->rate);+return1;+}++/* width */+switch(snd_pcm_format_width(substream->runtime->format)){+case16:+avs.avs_audio_width=PS3AV_CMD_AUDIO_WORD_BITS_16;+break;+case24:+avs.avs_audio_width=PS3AV_CMD_AUDIO_WORD_BITS_24;+break;+default:+pr_info("%s: invalid width %d\n",__func__,+snd_pcm_format_width(substream->runtime->format));+return1;+}++memcpy(avs.avs_cs_info,ps3av_mode_cs_info,8);++if(memcmp(&card->avs,&avs,sizeof(avs))){+pr_debug("%s: after freq=%d width=%d\n",__func__,+card->avs.avs_audio_rate,card->avs.avs_audio_width);++card->avs=avs;+snd_ps3_change_avsetting(card);+ret=0;+}else+ret=1;++/* check CS non-audio bit and mute accordingly */+if(avs.avs_cs_info[0]&0x02)+ps3av_audio_mute_analog(1);/* mute if non-audio */+else+ps3av_audio_mute_analog(0);++returnret;+}++/**PCMoperators*/staticintsnd_ps3_pcm_open(structsnd_pcm_substream*substream)
@@ -403,6 +543,13 @@ static int snd_ps3_pcm_open(struct snd_pcm_substream *substream)return0;};+staticintsnd_ps3_pcm_close(structsnd_pcm_substream*substream)+{+/* mute on */+snd_ps3_mute(1);+return0;+};+staticintsnd_ps3_pcm_hw_params(structsnd_pcm_substream*substream,structsnd_pcm_hw_params*hw_params){
@@ -414,6 +561,13 @@ static int snd_ps3_pcm_hw_params(struct snd_pcm_substream *substream,return0;};+staticintsnd_ps3_pcm_hw_free(structsnd_pcm_substream*substream)+{+intret;+ret=snd_pcm_lib_free_pages(substream);+returnret;+};+staticintsnd_ps3_delay_to_bytes(structsnd_pcm_substream*substream,unsignedintdelay_ms){
@@ -553,202 +707,6 @@ static snd_pcm_uframes_t snd_ps3_pcm_pointer(returnret;};-staticintsnd_ps3_pcm_hw_free(structsnd_pcm_substream*substream)-{-intret;-ret=snd_pcm_lib_free_pages(substream);-returnret;-};--staticintsnd_ps3_pcm_close(structsnd_pcm_substream*substream)-{-/* mute on */-snd_ps3_mute(1);-return0;-};--staticvoidsnd_ps3_audio_fixup(structsnd_ps3_card_info*card)-{-/*-*avsettingdriverseemstoneverchangethefollowings-*so,initthemhereonce-*/--/* no dma interrupt needed */-write_reg(PS3_AUDIO_INTR_EN_0,0);--/* use every 4 buffer empty interrupt */-update_mask_reg(PS3_AUDIO_AX_IC,-PS3_AUDIO_AX_IC_AASOIMD_MASK,-PS3_AUDIO_AX_IC_AASOIMD_EVERY4);--/* enable 3wire clocks */-update_mask_reg(PS3_AUDIO_AO_3WMCTRL,-~(PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_DISABLED|-PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_DISABLED),-0);-update_reg(PS3_AUDIO_AO_3WMCTRL,-PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT);-}--/*-*avsetting-*NOTE:callingthisfunctionmaygenerateaudiointerrupt.-*/-staticintsnd_ps3_change_avsetting(structsnd_ps3_card_info*card)-{-intret,retries,i;-pr_debug("%s: start\n",__func__);--ret=ps3av_set_audio_mode(card->avs.avs_audio_ch,-card->avs.avs_audio_rate,-card->avs.avs_audio_width,-card->avs.avs_audio_format,-card->avs.avs_audio_source);-/*-*Resetthefollowingunwantedsettings:-*/--/* disable all 3wire buffers */-update_mask_reg(PS3_AUDIO_AO_3WMCTRL,-~(PS3_AUDIO_AO_3WMCTRL_ASOEN(0)|-PS3_AUDIO_AO_3WMCTRL_ASOEN(1)|-PS3_AUDIO_AO_3WMCTRL_ASOEN(2)|-PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),-0);-wmb();/* ensure the hardware sees the change */-/* wait for actually stopped */-retries=1000;-while((read_reg(PS3_AUDIO_AO_3WMCTRL)&-(PS3_AUDIO_AO_3WMCTRL_ASORUN(0)|-PS3_AUDIO_AO_3WMCTRL_ASORUN(1)|-PS3_AUDIO_AO_3WMCTRL_ASORUN(2)|-PS3_AUDIO_AO_3WMCTRL_ASORUN(3)))&&---retries){-udelay(1);-}--/* reset buffer pointer */-for(i=0;i<4;i++){-update_reg(PS3_AUDIO_AO_3WCTRL(i),-PS3_AUDIO_AO_3WCTRL_ASOBRST_RESET);-udelay(10);-}-wmb();/* ensure the hardware actually start resetting */--/* enable 3wire#0 buffer */-update_reg(PS3_AUDIO_AO_3WMCTRL,PS3_AUDIO_AO_3WMCTRL_ASOEN(0));---/* In 24bit mode,ALSA inserts a zero byte at first byte of per sample */-update_mask_reg(PS3_AUDIO_AO_3WCTRL(0),-~PS3_AUDIO_AO_3WCTRL_ASODF,-PS3_AUDIO_AO_3WCTRL_ASODF_LSB);-update_mask_reg(PS3_AUDIO_AO_SPDCTRL(0),-~PS3_AUDIO_AO_SPDCTRL_SPODF,-PS3_AUDIO_AO_SPDCTRL_SPODF_LSB);-/* ensure all the setting above is written back to register */-wmb();-/* avsetting driver altered AX_IE, caller must reset it if you want */-pr_debug("%s: end\n",__func__);-returnret;-}--staticintsnd_ps3_init_avsetting(structsnd_ps3_card_info*card)-{-intret;-pr_debug("%s: start\n",__func__);-card->avs.avs_audio_ch=PS3AV_CMD_AUDIO_NUM_OF_CH_2;-card->avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_48K;-card->avs.avs_audio_width=PS3AV_CMD_AUDIO_WORD_BITS_16;-card->avs.avs_audio_format=PS3AV_CMD_AUDIO_FORMAT_PCM;-card->avs.avs_audio_source=PS3AV_CMD_AUDIO_SOURCE_SERIAL;-memcpy(card->avs.avs_cs_info,ps3av_mode_cs_info,8);--ret=snd_ps3_change_avsetting(card);--snd_ps3_audio_fixup(card);--/* to start to generate SPDIF signal, fill data */-snd_ps3_program_dma(card,SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL);-snd_ps3_kick_dma(card);-pr_debug("%s: end\n",__func__);-returnret;-}--/*-*setsamplingrateaccordingtothesubstream-*/-staticintsnd_ps3_set_avsetting(structsnd_pcm_substream*substream)-{-structsnd_ps3_card_info*card=snd_pcm_substream_chip(substream);-structsnd_ps3_avsetting_infoavs;-intret;--avs=card->avs;--pr_debug("%s: called freq=%d width=%d\n",__func__,-substream->runtime->rate,-snd_pcm_format_width(substream->runtime->format));--pr_debug("%s: before freq=%d width=%d\n",__func__,-card->avs.avs_audio_rate,card->avs.avs_audio_width);--/* sample rate */-switch(substream->runtime->rate){-case44100:-avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_44K;-break;-case48000:-avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_48K;-break;-case88200:-avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_88K;-break;-case96000:-avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_96K;-break;-default:-pr_info("%s: invalid rate %d\n",__func__,-substream->runtime->rate);-return1;-}--/* width */-switch(snd_pcm_format_width(substream->runtime->format)){-case16:-avs.avs_audio_width=PS3AV_CMD_AUDIO_WORD_BITS_16;-break;-case24:-avs.avs_audio_width=PS3AV_CMD_AUDIO_WORD_BITS_24;-break;-default:-pr_info("%s: invalid width %d\n",__func__,-snd_pcm_format_width(substream->runtime->format));-return1;-}--memcpy(avs.avs_cs_info,ps3av_mode_cs_info,8);--if(memcmp(&card->avs,&avs,sizeof(avs))){-pr_debug("%s: after freq=%d width=%d\n",__func__,-card->avs.avs_audio_rate,card->avs.avs_audio_width);--card->avs=avs;-snd_ps3_change_avsetting(card);-ret=0;-}else-ret=1;--/* check CS non-audio bit and mute accordingly */-if(avs.avs_cs_info[0]&0x02)-ps3av_audio_mute_analog(1);/* mute if non-audio */-else-ps3av_audio_mute_analog(0);--returnret;-}-/**SPDIFstatusbitscontrols*/
@@ -912,6 +881,52 @@ static void snd_ps3_audio_set_base_addr(uint64_t ioaddr_start)ret);}+staticvoidsnd_ps3_audio_fixup(structsnd_ps3_card_info*card)+{+/*+*avsettingdriverseemstoneverchangethefollowings+*so,initthemhereonce+*/++/* no dma interrupt needed */+write_reg(PS3_AUDIO_INTR_EN_0,0);++/* use every 4 buffer empty interrupt */+update_mask_reg(PS3_AUDIO_AX_IC,+PS3_AUDIO_AX_IC_AASOIMD_MASK,+PS3_AUDIO_AX_IC_AASOIMD_EVERY4);++/* enable 3wire clocks */+update_mask_reg(PS3_AUDIO_AO_3WMCTRL,+~(PS3_AUDIO_AO_3WMCTRL_ASOBCLKD_DISABLED|+PS3_AUDIO_AO_3WMCTRL_ASOLRCKD_DISABLED),+0);+update_reg(PS3_AUDIO_AO_3WMCTRL,+PS3_AUDIO_AO_3WMCTRL_ASOPLRCK_DEFAULT);+}++staticintsnd_ps3_init_avsetting(structsnd_ps3_card_info*card)+{+intret;+pr_debug("%s: start\n",__func__);+card->avs.avs_audio_ch=PS3AV_CMD_AUDIO_NUM_OF_CH_2;+card->avs.avs_audio_rate=PS3AV_CMD_AUDIO_FS_48K;+card->avs.avs_audio_width=PS3AV_CMD_AUDIO_WORD_BITS_16;+card->avs.avs_audio_format=PS3AV_CMD_AUDIO_FORMAT_PCM;+card->avs.avs_audio_source=PS3AV_CMD_AUDIO_SOURCE_SERIAL;+memcpy(card->avs.avs_cs_info,ps3av_mode_cs_info,8);++ret=snd_ps3_change_avsetting(card);++snd_ps3_audio_fixup(card);++/* to start to generate SPDIF signal, fill data */+snd_ps3_program_dma(card,SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL);+snd_ps3_kick_dma(card);+pr_debug("%s: end\n",__func__);+returnret;+}+staticint__initsnd_ps3_driver_probe(structps3_system_bus_device*dev){inti,ret;
@@ -1113,71 +1128,6 @@ static struct ps3_system_bus_driver snd_ps3_bus_driver_info = {/*-*Interrupthandler-*/-staticirqreturn_tsnd_ps3_interrupt(intirq,void*dev_id)-{--uint32_tport_intr;-intunderflow_occured=0;-structsnd_ps3_card_info*card=dev_id;--if(!card->running){-update_reg(PS3_AUDIO_AX_IS,0);-update_reg(PS3_AUDIO_INTR_0,0);-returnIRQ_HANDLED;-}--port_intr=read_reg(PS3_AUDIO_AX_IS);-/*-*serialbufferemptydetected(every4times),-*programnextdmaandkickit-*/-if(port_intr&PS3_AUDIO_AX_IE_ASOBEIE(0)){-write_reg(PS3_AUDIO_AX_IS,PS3_AUDIO_AX_IE_ASOBEIE(0));-if(port_intr&PS3_AUDIO_AX_IE_ASOBUIE(0)){-write_reg(PS3_AUDIO_AX_IS,port_intr);-underflow_occured=1;-}-if(card->silent){-/* we are still in silent time */-snd_ps3_program_dma(card,-(underflow_occured)?-SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL:-SND_PS3_DMA_FILLTYPE_SILENT_RUNNING);-snd_ps3_kick_dma(card);-card->silent--;-}else{-snd_ps3_program_dma(card,-(underflow_occured)?-SND_PS3_DMA_FILLTYPE_FIRSTFILL:-SND_PS3_DMA_FILLTYPE_RUNNING);-snd_ps3_kick_dma(card);-snd_pcm_period_elapsed(card->substream);-}-}elseif(port_intr&PS3_AUDIO_AX_IE_ASOBUIE(0)){-write_reg(PS3_AUDIO_AX_IS,PS3_AUDIO_AX_IE_ASOBUIE(0));-/*-*serialoutunderflow,butbufferemptynotdetected.-*inthiscase,fillfifowith0torecover.After-*fillingdummydata,serialautomaticallystartto-*consumethemandthenwillgeneratenormalbuffer-*emptyinterrupts.-*Ifbothbufferunderflowandbufferemptyareoccured,-*itisbettertodonomaldatatransferthanemptyone-*/-snd_ps3_program_dma(card,-SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL);-snd_ps3_kick_dma(card);-snd_ps3_program_dma(card,-SND_PS3_DMA_FILLTYPE_SILENT_FIRSTFILL);-snd_ps3_kick_dma(card);-}-/* clear interrupt cause */-returnIRQ_HANDLED;-};--/**module/subsysteminitialize/terminate*/staticint__initsnd_ps3_init(void)
@@ -1195,10 +1145,15 @@ static int __init snd_ps3_init(void)returnret;}+module_init(snd_ps3_init);staticvoid__exitsnd_ps3_exit(void){ps3_system_bus_driver_unregister(&snd_ps3_bus_driver_info);}+module_exit(snd_ps3_exit);+MODULE_LICENSE("GPL v2");+MODULE_DESCRIPTION("PS3 sound driver");+MODULE_AUTHOR("Sony Computer Entertainment Inc.");MODULE_ALIAS(PS3_MODULE_ALIAS_SOUND);
Add support for caching, to reduce FLASH wear when writing using small
blocksizes. As we also don't care anymore about heads and tails in case of
partial writes, this greatly simplifies the code for handling writes.
Note: We don't bother caching reads smaller than the FLASH chunk size
(256 KiB).
Signed-off-by: Geert Uytterhoeven <redacted>
---
drivers/char/ps3flash.c | 209 +++++++++++++++++++++++------------------------
1 files changed, 104 insertions(+), 105 deletions(-)
@@ -204,71 +227,23 @@ static ssize_t ps3flash_write(const char __user *userbuf,count=size-*pos;}-chunk_sectors=dev->bounce_size/dev->blk_size;--start_write_sector=*pos/dev->bounce_size*chunk_sectors;+sector=*pos/dev->bounce_size*priv->chunk_sectors;offset=*pos%dev->bounce_size;-end_write_sector=DIV_ROUND_UP(*pos+count,dev->bounce_size)*-chunk_sectors;--end_read_sector=DIV_ROUND_UP(*pos,dev->blk_size);-start_read_sector=(*pos+count)/dev->blk_size;--/*-*Aswehavetowritein256KiBchunks,whilewecanreadinblk_size-*(usually512bytes)chunks,weperformthefollowingsteps:-*1.Readfromstart_write_sectortoend_read_sector("head")-*2.Readfromstart_read_sectortoend_write_sector("tail")-*3.Copydatatobuffer-*4.Writefromstart_write_sectortoend_write_sector-*Allofthisiscomplicatedbyusingonlyone256KiBbouncebuffer.-*/--head=end_read_sector-start_write_sector;-tail=end_write_sector-start_read_sector;remaining=count;do{+n=min_t(u64,remaining,dev->bounce_size-offset);+mutex_lock(&priv->mutex);-if(end_read_sector>=start_read_sector){-/* Merge head and tail */-dev_dbg(&dev->sbd.core,-"Merged head and tail: %llu sectors at %llu\n",-chunk_sectors,start_write_sector);-res=ps3flash_read_sectors(dev,start_write_sector,-chunk_sectors,0);-if(res<0)-gotofail;-}else{-if(head){-/* Read head */-dev_dbg(&dev->sbd.core,-"head: %llu sectors at %llu\n",head,-start_write_sector);-res=ps3flash_read_sectors(dev,-start_write_sector,-head,0);-if(res<0)-gotofail;-}-if(start_read_sector<-start_write_sector+chunk_sectors){-/* Read tail */-dev_dbg(&dev->sbd.core,-"tail: %llu sectors at %llu\n",tail,-start_read_sector);-sec_off=start_read_sector-start_write_sector;-res=ps3flash_read_sectors(dev,-start_read_sector,-tail,sec_off);-if(res<0)-gotofail;-}-}+if(n!=dev->bounce_size)+res=ps3flash_fetch(dev,sector,priv->chunk_sectors);+elseif(sector!=priv->tag)+res=ps3flash_writeback(dev);+if(res)+gotofail;-n=min_t(u64,remaining,dev->bounce_size-offset);-dst=dev->bounce_buf+offset;+dst=dev->bounce_buf+offset;dev_dbg(&dev->sbd.core,"%s:%u: copy %lu bytes from U0x%p/K0x%p to 0x%p\n",__func__,__LINE__,n,userbuf,kernelbuf,dst);
They were never intended to be exported using EXPORT_SYMBOL() anyway
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Geoff Levand <redacted>
---
arch/powerpc/platforms/ps3/os-area.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
@@ -1648,7 +1648,7 @@ static int ps3_gelic_driver_probe(struct ps3_system_bus_device *dev)result=-ENOMEM;gotofail_alloc_card;}-ps3_system_bus_set_driver_data(dev,card);+ps3_system_bus_set_drvdata(dev,card);card->dev=dev;/* get internal vlan info */
Currently the FLASH database is updated by the kernel using file operations,
meant for userspace only. While this works for us because copy_{from,to}_user()
on powerpc can handle kernel pointers, this is unportable and a bad example.
Replace the file operations by callbacks, registered by the ps3flash driver.
Signed-off-by: Geert Uytterhoeven <redacted>
Cc: Geoff Levand <redacted>
---
arch/powerpc/include/asm/ps3.h | 7 ++
arch/powerpc/platforms/ps3/os-area.c | 138 ++++++++++++++++++---------------
drivers/char/ps3flash.c | 94 +++++++++++++++++------
3 files changed, 152 insertions(+), 87 deletions(-)
@@ -352,12 +390,12 @@ static int db_verify(const struct os_area_db *db)if(memcmp(db->magic_num,OS_AREA_DB_MAGIC_NUM,sizeof(db->magic_num))){pr_debug("%s:%d magic_num failed\n",__func__,__LINE__);-return-1;+return-EINVAL;}if(db->version!=1){pr_debug("%s:%d version failed\n",__func__,__LINE__);-return-1;+return-EINVAL;}return0;
@@ -578,59 +616,48 @@ static void os_area_db_init(struct os_area_db *db)**/-staticvoid__maybe_unusedupdate_flash_db(void)+staticintupdate_flash_db(void){-intresult;-intfile;-off_toffset;+constunsignedintbuf_len=8*OS_AREA_SEGMENT_SIZE;+structos_area_header*header;ssize_tcount;-staticconstunsignedintbuf_len=8*OS_AREA_SEGMENT_SIZE;-conststructos_area_header*header;+interror;+loff_tpos;structos_area_db*db;/* Read in header and db from flash. */-file=sys_open("/dev/ps3flash",O_RDWR,0);--if(file<0){-pr_debug("%s:%d sys_open failed\n",__func__,__LINE__);-gotofail_open;-}-header=kmalloc(buf_len,GFP_KERNEL);-if(!header){-pr_debug("%s:%d kmalloc failed\n",__func__,__LINE__);-gotofail_malloc;+pr_debug("%s: kmalloc failed\n",__func__);+return-ENOMEM;}-offset=sys_lseek(file,0,SEEK_SET);--if(offset!=0){-pr_debug("%s:%d sys_lseek failed\n",__func__,__LINE__);-gotofail_header_seek;+count=os_area_flash_read(header,buf_len,0);+if(count<0){+pr_debug("%s: os_area_flash_read failed %zd\n",__func__,+count);+error=count;+gotofail;}-count=sys_read(file,(char__user*)header,buf_len);--result=count<OS_AREA_SEGMENT_SIZE||verify_header(header)-||count<header->db_area_offset*OS_AREA_SEGMENT_SIZE;--if(result){-pr_debug("%s:%d verify_header failed\n",__func__,__LINE__);+pos=header->db_area_offset*OS_AREA_SEGMENT_SIZE;+if(count<OS_AREA_SEGMENT_SIZE||verify_header(header)||+count<pos){+pr_debug("%s: verify_header failed\n",__func__);dump_header(header);-gotofail_header;+error=-EINVAL;+gotofail;}/* Now got a good db offset and some maybe good db data. */-db=(void*)header+header->db_area_offset*OS_AREA_SEGMENT_SIZE;+db=(void*)header+pos;-result=db_verify(db);--if(result){-printk(KERN_NOTICE"%s:%d: Verify of flash database failed, "-"formatting.\n",__func__,__LINE__);+error=db_verify(db);+if(error){+pr_notice("%s: Verify of flash database failed, formatting.\n",+__func__);dump_db(db);os_area_db_init(db);}
@@ -104,18 +104,19 @@ out:returnres;}-staticssize_tps3flash_read(structfile*file,char__user*buf,size_tcount,-loff_t*pos)+staticssize_tps3flash_read(char__user*userbuf,void*kernelbuf,+size_tcount,loff_t*pos){structps3_storage_device*dev=ps3flash_dev;structps3flash_private*priv=ps3_system_bus_get_drvdata(&dev->sbd);u64size,start_sector,end_sector,offset;ssize_tsectors_read;size_tremaining,n;+constvoid*src;dev_dbg(&dev->sbd.core,-"%s:%u: Reading %zu bytes at position %lld to user 0x%p\n",-__func__,__LINE__,count,*pos,buf);+"%s:%u: Reading %zu bytes at position %lld to U0x%p/K0x%p\n",+__func__,__LINE__,count,*pos,userbuf,kernelbuf);size=dev->regions[dev->region_idx].size*dev->blk_size;if(*pos>=size||!count)
@@ -145,19 +146,26 @@ static ssize_t ps3flash_read(struct file *file, char __user *buf, size_t count,}n=min_t(u64,remaining,sectors_read*dev->blk_size-offset);+src=dev->bounce_buf+offset;dev_dbg(&dev->sbd.core,-"%s:%u: copy %lu bytes from 0x%p to user 0x%p\n",-__func__,__LINE__,n,dev->bounce_buf+offset,buf);-if(copy_to_user(buf,dev->bounce_buf+offset,n)){-mutex_unlock(&priv->mutex);-sectors_read=-EFAULT;-gotofail;+"%s:%u: copy %lu bytes from 0x%p to U0x%p/K0x%p\n",+__func__,__LINE__,n,src,userbuf,kernelbuf);+if(userbuf){+if(copy_to_user(userbuf,src,n)){+mutex_unlock(&priv->mutex);+sectors_read=-EFAULT;+gotofail;+}+userbuf+=n;+}+if(kernelbuf){+memcpy(kernelbuf,src,n);+kernelbuf+=n;}mutex_unlock(&priv->mutex);*pos+=n;-buf+=n;remaining-=n;start_sector+=sectors_read;offset=0;
@@ -179,10 +187,11 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf,ssize_tres;size_tremaining,n;unsignedintsec_off;+void*dst;dev_dbg(&dev->sbd.core,-"%s:%u: Writing %zu bytes at position %lld from user 0x%p\n",-__func__,__LINE__,count,*pos,buf);+"%s:%u: Writing %zu bytes at position %lld from U0x%p/K0x%p\n",+__func__,__LINE__,count,*pos,userbuf,kernelbuf);size=dev->regions[dev->region_idx].size*dev->blk_size;if(*pos>=size||!count)
@@ -259,12 +268,20 @@ static ssize_t ps3flash_write(struct file *file, const char __user *buf,}n=min_t(u64,remaining,dev->bounce_size-offset);+dst=dev->bounce_buf+offset;dev_dbg(&dev->sbd.core,-"%s:%u: copy %lu bytes from user 0x%p to 0x%p\n",-__func__,__LINE__,n,buf,dev->bounce_buf+offset);-if(copy_from_user(dev->bounce_buf+offset,buf,n)){-res=-EFAULT;-gotofail;+"%s:%u: copy %lu bytes from U0x%p/K0x%p to 0x%p\n",+__func__,__LINE__,n,userbuf,kernelbuf,dst);+if(userbuf){+if(copy_from_user(dst,userbuf,n)){+res=-EFAULT;+gotofail;+}+userbuf+=n;+}+if(kernelbuf){+memcpy(dst,kernelbuf,n);+kernelbuf+=n;}res=ps3flash_write_chunk(dev,start_write_sector);
@@ -321,7 +318,7 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info *card,spin_lock_irqsave(&card->dma_lock,irqsave);for(ch=0;ch<2;ch++){start_vaddr=card->dma_next_transfer_vaddr[0];-for(stage=0;stage<fill_stages;stage++){+for(stage=0;stage<fill_stages;stage++){dma_ch=stage*2+ch;if(silent)dma_addr=card->null_buffer_start_dma_addr;
@@ -619,7 +616,7 @@ static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card)PS3_AUDIO_AO_3WMCTRL_ASOEN(2)|PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),0);-wmb();/* ensure the hardware sees the change */+wmb();/* ensure the hardware sees the change *//* wait for actually stopped */retries=1000;while((read_reg(PS3_AUDIO_AO_3WMCTRL)&
Currently the FLASH database is updated by the kernel using file operations,
meant for userspace only. While this works for us because copy_{from,to}_user()
on powerpc can handle kernel pointers, this is unportable and a bad example.
Replace the file operations by callbacks, registered by the ps3flash driver.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2009-06-10 21:43:44
On Wed, 2009-06-10 at 16:38 +0200, Geert Uytterhoeven wrote:
Hi Ben,
Here are my PS3-specific patches for 2.6.31:
Grrrr.....
It's -WAY TOO LATE-
I though I made it clear that patches should be ready in -next -before-
the merge window, in fact, by rc7 or rc8, we should have a good idea of
what's going in either via my 'next' branch or pending stuff in
patchwork.
I'll go through your pile and may still merge it this time around, but
you should be more proactive at feeding me with that stuff before it's
merge time.
Cheers,
Ben.
[01] ps3av: Set 16:9 aspect ratio for 720p video modes
[02] ps3vram: Fix error path (return -EIO) for short read/write
[03] ps3vram: Use proc_create_data() instead of proc_create()
[04] ps3vram: Correct exchanged gotos in ps3vram_probe() error path
[05] block: Add bio_list_peek()
[06] ps3vram: Replace mutex by spinlock + bio_list
[07] ps3fb: Remove useless debug checks in ps3fb_shutdown()
[08] ps3fb: Inline functions in ps3fb_probe(), to ease cleanup in the
error path
[09] ps3fb: Correct handling of device opening in ps3fb_probe()
[10] powerpc/cell: Extract duplicated IOPTE_* to <asm/iommu.h>
[11] ps3fb: GPU memory mapping cleanup
[12] ps3vram: GPU memory mapping cleanup
[13] ps3fb/vram: Extract common GPU stuff into <asm/ps3gpu.h>
[14] ps3fb: Tear down FB setup during cleanup
[15] ps3vram: Remove no longer used ps3vram_priv.ddr_base
[16] ps3vram: Make ps3vram_priv.reports a void *
[17] block/ps3: remove driver_data direct access of struct device
[18] ps3: ps3_system_bus_device - Use dev_[gs]et_drvdata() instead of
direct access
[19] ps3: shorten ps3_system_bus_[gs]et_driver_data to
ps3_system_bus_[gs]et_drvdata
[20] ps3: ps3flash - Use ps3_system_bus_[gs]et_drvdata() instead of direct
access
[21] ps3: ps3rom - Use ps3_system_bus_[gs]et_drvdata() instead of direct
access
[22] ps3: ps3fb - Use ps3_system_bus_[gs]et_drvdata() instead of direct
access
[23] net/ps3: gelic - Add missing annotations
[24] usb/ps3: Add missing annotations
[25] drivers/ps3: Add missing annotations
[26] sound/ps3: Fix checkpatch issues
[27] sound/ps3: Restructure driver source
[28] sound/ps3: Correct existing and add missing annotations
[29] ps3: Correct debug message in dma_ioc0_map_pages()
[30] ps3: Switch ps3_os_area_[gs]et_rtc_diff to EXPORT_SYMBOL_GPL()
[31] ps3: Replace direct file operations by callback
[32] ps3flash: Cache the last accessed FLASH chunk
[33] ps3flash: Always read chunks of 256 KiB, and cache them
About half of these have been submitted and reviewed before, with review
comments taken into account.
Patches 05 (in response to feedback on v1 of 06) and 18-33 are new.
Given the interactions between powerpc/ps3-specific code and the various
subsystems, I think the easiest way is to get everything in via the
powerpc tree?
Thanks!
arch/powerpc/include/asm/ps3.h | 16
arch/powerpc/include/asm/ps3gpu.h | 8
arch/powerpc/platforms/ps3/mm.c | 6
arch/powerpc/platforms/ps3/os-area.c | 138 +++---
b/arch/powerpc/include/asm/iommu.h | 10
b/arch/powerpc/include/asm/ps3.h | 3
b/arch/powerpc/include/asm/ps3gpu.h | 78 +++
b/arch/powerpc/platforms/cell/iommu.c | 37 -
b/arch/powerpc/platforms/ps3/mm.c | 7
b/arch/powerpc/platforms/ps3/os-area.c | 5
b/arch/powerpc/platforms/ps3/platform.h | 10
b/arch/powerpc/platforms/ps3/setup.c | 1
b/arch/powerpc/platforms/ps3/system-bus.c | 16
b/drivers/block/ps3disk.c | 23 -
b/drivers/block/ps3vram.c | 2
b/drivers/char/ps3flash.c | 13
b/drivers/net/ps3_gelic_net.c | 8
b/drivers/net/ps3_gelic_wireless.c | 7
b/drivers/ps3/ps3-sys-manager.c | 2
b/drivers/ps3/ps3av.c | 5
b/drivers/ps3/ps3av_cmd.c | 3
b/drivers/scsi/ps3rom.c | 11
b/drivers/usb/host/ehci-ps3.c | 7
b/drivers/usb/host/ohci-ps3.c | 8
b/drivers/video/ps3fb.c | 15
b/include/linux/bio.h | 6
b/sound/ppc/snd_ps3.c | 33 -
drivers/block/ps3disk.c | 23 -
drivers/block/ps3vram.c | 228 +++++-----
drivers/char/ps3flash.c | 353 +++++++++-------
drivers/net/ps3_gelic_net.c | 22 -
drivers/ps3/ps3av.c | 5
drivers/usb/host/ehci-ps3.c | 4
drivers/usb/host/ohci-ps3.c | 5
drivers/video/ps3fb.c | 312 ++++++--------
sound/ppc/snd_ps3.c | 635 +++++++++++++-----------------
36 files changed, 1045 insertions(+), 1020 deletions(-)
With kind regards,
Geert Uytterhoeven
Software Architect
Techsoft Centre
Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
From: Nate Case <hidden> Date: 2009-06-10 22:00:15
On Thu, 2009-06-11 at 07:43 +1000, Benjamin Herrenschmidt wrote:
Grrrr.....
It's -WAY TOO LATE-
I though I made it clear that patches should be ready in -next
-before- the merge window, in fact, by rc7 or rc8, we should have a
good idea of what's going in either via my 'next' branch or pending
stuff in patchwork.
I'll go through your pile and may still merge it this time around, but
you should be more proactive at feeding me with that stuff before it's
merge time.
Hmm, I guess this sorta answers my question to Kumar about my recent
-next submissions being eligible for 2.6.31. Sorry for not paying
closer attention -- I just assumed we weren't even close to the cutoff
time. I didn't even see Kumar's "next" branch until April 30th (around
-rc6..rc7 time I think).
--
Nate Case [off-list ref]
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2009-06-10 22:26:31
On Wed, 2009-06-10 at 17:00 -0500, Nate Case wrote:
Hmm, I guess this sorta answers my question to Kumar about my recent
-next submissions being eligible for 2.6.31. Sorry for not paying
closer attention -- I just assumed we weren't even close to the cutoff
time. I didn't even see Kumar's "next" branch until April 30th
(around -rc6..rc7 time I think).
Your patches may still make it, we'll see. Kumar was away for a week
just before the merge window and I started this round's next branch a
bit late, so we can be flexible, it depends how many patches are
involved, how invasive or risky they are etc...
In your case, I'll let Kumar judge.
However, in Geert case, it's a pile of 33 patches sent after the break
point, which is a bit too much over the top :-)
Cheers,
Ben.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2009-06-15 01:39:28
On Wed, 2009-06-10 at 16:38 +0200, Geert Uytterhoeven wrote:
Introduce bio_list_peek(), to obtain a pointer to the first bio on the bio_list
without actually removing it from the list. This is needed when you want to
serialize based on the list being empty or not.
Leaving that one (and the next one) out for now until Jens Ack them.
Cheers,
Ben.
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2009-06-15 01:41:33
On Wed, 2009-06-10 at 16:38 +0200, Geert Uytterhoeven wrote:
Both arch/powerpc/platforms/cell/iommu.c and arch/powerpc/platforms/ps3/mm.c
contain the same Cell IOMMU page table entry definitions. Extract them and move
them to <asm/iommu.h>, while adding a CBE_ prefix.
This also allows them to be used by drivers.
Are we sure include/asm/iommu.h is the right place for that ?
I'm hesitating here...
Cheers,
Ben.
@@ -193,19 +183,21 @@ static int tce_build_cell(struct iommu_table *tbl, long index, long npages,*/constunsignedlongprot=0xc48;base_pte=-((prot<<(52+4*direction))&(IOPTE_PP_W|IOPTE_PP_R))-|IOPTE_M|IOPTE_SO_RW|(window->ioid&IOPTE_IOID_Mask);+((prot<<(52+4*direction))&+(CBE_IOPTE_PP_W|CBE_IOPTE_PP_R))|+CBE_IOPTE_M|CBE_IOPTE_SO_RW|+(window->ioid&CBE_IOPTE_IOID_Mask);#else-base_pte=IOPTE_PP_W|IOPTE_PP_R|IOPTE_M|IOPTE_SO_RW|-(window->ioid&IOPTE_IOID_Mask);+base_pte=CBE_IOPTE_PP_W|CBE_IOPTE_PP_R|CBE_IOPTE_M|+CBE_IOPTE_SO_RW|(window->ioid&CBE_IOPTE_IOID_Mask);#endifif(unlikely(dma_get_attr(DMA_ATTR_WEAK_ORDERING,attrs)))-base_pte&=~IOPTE_SO_RW;+base_pte&=~CBE_IOPTE_SO_RW;io_pte=(unsignedlong*)tbl->it_base+(index-tbl->it_offset);for(i=0;i<npages;i++,uaddr+=IOMMU_PAGE_SIZE)-io_pte[i]=base_pte|(__pa(uaddr)&IOPTE_RPN_Mask);+io_pte[i]=base_pte|(__pa(uaddr)&CBE_IOPTE_RPN_Mask);mb();
@@ -231,8 +223,9 @@ static void tce_free_cell(struct iommu_table *tbl, long index, long npages)#else/* spider bridge does PCI reads after freeing - insert a mapping*toascratchpageinsteadofaninvalidentry*/-pte=IOPTE_PP_R|IOPTE_M|IOPTE_SO_RW|__pa(window->iommu->pad_page)-|(window->ioid&IOPTE_IOID_Mask);+pte=CBE_IOPTE_PP_R|CBE_IOPTE_M|CBE_IOPTE_SO_RW|+__pa(window->iommu->pad_page)|+(window->ioid&CBE_IOPTE_IOID_Mask);#endifio_pte=(unsignedlong*)tbl->it_base+(index-tbl->it_offset);
@@ -1001,7 +994,7 @@ static void insert_16M_pte(unsigned long addr, unsigned long *ptab,pr_debug("iommu: addr %lx ptab %p segment %lx offset %lx\n",addr,ptab,segment,offset);-ptab[offset]=base_pte|(__pa(addr)&IOPTE_RPN_Mask);+ptab[offset]=base_pte|(__pa(addr)&CBE_IOPTE_RPN_Mask);}staticvoidcell_iommu_setup_fixed_ptab(structcbe_iommu*iommu,
@@ -1016,14 +1009,14 @@ static void cell_iommu_setup_fixed_ptab(struct cbe_iommu *iommu,pr_debug("iommu: mapping 0x%lx pages from 0x%lx\n",fsize,fbase);-base_pte=IOPTE_PP_W|IOPTE_PP_R|IOPTE_M-|(cell_iommu_get_ioid(np)&IOPTE_IOID_Mask);+base_pte=CBE_IOPTE_PP_W|CBE_IOPTE_PP_R|CBE_IOPTE_M|+(cell_iommu_get_ioid(np)&CBE_IOPTE_IOID_Mask);if(iommu_fixed_is_weak)pr_info("IOMMU: Using weak ordering for fixed mapping\n");else{pr_info("IOMMU: Using strong ordering for fixed mapping\n");-base_pte|=IOPTE_SO_RW;+base_pte|=CBE_IOPTE_SO_RW;}for(uaddr=0;uaddr<fsize;uaddr+=(1<<24)){
Thanks, applied these three patches (26,27,28) to sound git tree.
Are you sure they don't depend on the previous patches ? We're already
having fallover from the SCSI tree merging some of them while I haven't
merge the previous ones yet...
Geert, there are several "procedural" issues with your series here: In
addition to the whole thing being submitted too late that is :-)
You don't have the same CC list on all patches. That is fine except that
you also don't provide merge instructions after the signature, such as
"this patch depends on XX from this series" etc...
A bunch of them do have such dependencies. In fact, there's even a patch
that changes something in the block layer (it's not a big deal, just
adding an accessor, but I still -need- an Ack from Jens to merge it) and
so I have to block all patches that depend on this one. But then, we
have indirect dependencies where some patch don't apply because they
touch the same file that was patched by the patch who had the dependency
etc...
I ended up stopping mid-way through the series. I'll push some of the
patches to my -next branch tonight, and the rest once I get the Ack from
Jens.
I recommend all maintainers (scsi, alsa) just drop these patches for now
and instead give me Ack's so I can merge them via the powerpc tree along
with their respective dependencies. James, feel free to do a revert if
you don't want to rebase, that will break bisect on ps3 for a little
while, but that's the price Geert will have to pay for his mistakes :-)
Cheers,
Ben.
@@ -321,7 +318,7 @@ static int snd_ps3_program_dma(struct snd_ps3_card_info *card,spin_lock_irqsave(&card->dma_lock,irqsave);for(ch=0;ch<2;ch++){start_vaddr=card->dma_next_transfer_vaddr[0];-for(stage=0;stage<fill_stages;stage++){+for(stage=0;stage<fill_stages;stage++){dma_ch=stage*2+ch;if(silent)dma_addr=card->null_buffer_start_dma_addr;
@@ -619,7 +616,7 @@ static int snd_ps3_change_avsetting(struct snd_ps3_card_info *card)PS3_AUDIO_AO_3WMCTRL_ASOEN(2)|PS3_AUDIO_AO_3WMCTRL_ASOEN(3)),0);-wmb();/* ensure the hardware sees the change */+wmb();/* ensure the hardware sees the change *//* wait for actually stopped */retries=1000;while((read_reg(PS3_AUDIO_AO_3WMCTRL)&
Thanks, applied these three patches (26,27,28) to sound git tree.
Are you sure they don't depend on the previous patches ? We're already
having fallover from the SCSI tree merging some of them while I haven't
merge the previous ones yet...
These three patches are just trivial changes: coding-style fixes,
shuffle of function lines, and addition of __devinit/__devexit
notations. So they should be fairly safe and independent (thus I
applied them). At least, the test cross-build was OK.
Geert, there are several "procedural" issues with your series here: In
addition to the whole thing being submitted too late that is :-)
You don't have the same CC list on all patches. That is fine except that
you also don't provide merge instructions after the signature, such as
"this patch depends on XX from this series" etc...
A bunch of them do have such dependencies. In fact, there's even a patch
that changes something in the block layer (it's not a big deal, just
adding an accessor, but I still -need- an Ack from Jens to merge it) and
so I have to block all patches that depend on this one. But then, we
have indirect dependencies where some patch don't apply because they
touch the same file that was patched by the patch who had the dependency
etc...
I ended up stopping mid-way through the series. I'll push some of the
patches to my -next branch tonight, and the rest once I get the Ack from
Jens.
I recommend all maintainers (scsi, alsa) just drop these patches for now
and instead give me Ack's so I can merge them via the powerpc tree along
with their respective dependencies. James, feel free to do a revert if
you don't want to rebase, that will break bisect on ps3 for a little
while, but that's the price Geert will have to pay for his mistakes :-)
The alsa part also already reached to the upstream, so we have to give
revert patches if needed. But, in the case of sound bits, I think
they can remain there as they are independent changes.
But, if you think it's better to revert for the whole maintainability,
I'll revert in the next pull request that'll be sent soon later.
thanks,
Takashi
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2009-06-15 05:51:18
On Mon, 2009-06-15 at 07:43 +0200, Takashi Iwai wrote:
The alsa part also already reached to the upstream, so we have to give
revert patches if needed. But, in the case of sound bits, I think
they can remain there as they are independent changes.
But, if you think it's better to revert for the whole maintainability,
I'll revert in the next pull request that'll be sent soon later.
No, that's ok, I'll remove those from my pile.
Cheers,
Ben.
On Mon, Jun 15 2009, Benjamin Herrenschmidt wrote:
On Wed, 2009-06-10 at 16:38 +0200, Geert Uytterhoeven wrote:
quoted
Introduce bio_list_peek(), to obtain a pointer to the first bio on the bio_list
without actually removing it from the list. This is needed when you want to
serialize based on the list being empty or not.
Leaving that one (and the next one) out for now until Jens Ack them.
You can add my acked-by, this one is trivial and a good addition.
At Mon, 15 Jun 2009 15:51:03 +1000,
Benjamin Herrenschmidt wrote:
On Mon, 2009-06-15 at 07:43 +0200, Takashi Iwai wrote:
quoted
The alsa part also already reached to the upstream, so we have to give
revert patches if needed. But, in the case of sound bits, I think
they can remain there as they are independent changes.
But, if you think it's better to revert for the whole maintainability,
I'll revert in the next pull request that'll be sent soon later.
On Monday 15 June 2009, Benjamin Herrenschmidt wrote:
On Wed, 2009-06-10 at 16:38 +0200, Geert Uytterhoeven wrote:
quoted
Both arch/powerpc/platforms/cell/iommu.c and arch/powerpc/platforms/ps3/mm.c
contain the same Cell IOMMU page table entry definitions. Extract them and move
them to <asm/iommu.h>, while adding a CBE_ prefix.
This also allows them to be used by drivers.
Are we sure include/asm/iommu.h is the right place for that ?
I'm hesitating here...
Good point, that file does not contain hardware specific definitions but
only interfaces.
Geert, how about putting them into arch/powerpc/include/asm/cell-regs.h
instead?
Arnd <><
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2009-06-15 07:12:32
On Mon, 2009-06-15 at 09:05 +0200, Arnd Bergmann wrote:
Good point, that file does not contain hardware specific definitions
but
only interfaces.
Geert, how about putting them into
arch/powerpc/include/asm/cell-regs.h
instead?
I've put the patch in powerpc-next for now. But you may want to send
another patch later on to move things.
Cheers,
Ben.
On Mon, 15 Jun 2009, Benjamin Herrenschmidt wrote:
On Mon, 2009-06-15 at 09:05 +0200, Arnd Bergmann wrote:
quoted
Good point, that file does not contain hardware specific definitions
but
only interfaces.
Geert, how about putting them into
arch/powerpc/include/asm/cell-regs.h
instead?
I've put the patch in powerpc-next for now. But you may want to send
another patch later on to move things.
At your service!
---
From bb2fab2f78b24a80669cc6424bf621e4d113cfe4 Mon Sep 17 00:00:00 2001
--
1.6.2.4
With kind regards,
Geert Uytterhoeven
Software Architect
Techsoft Centre
Technology and Software Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010